From 86c8ee950daa48193a6c0aac3e582854cc59fb0f Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> Date: Wed, 16 Aug 2006 22:19:49 +0000 Subject: - introduce ALWAYS_RESPOND #define to determine whether we should always send a blank response even to write commands - fix length calculation in case of FIFO write git-svn-id: https://svn.openpcd.org:2342/trunk@111 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpcd/firmware/src/rc632.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/openpcd/firmware/src/rc632.c b/openpcd/firmware/src/rc632.c index 0876a1b..0f646dd 100644 --- a/openpcd/firmware/src/rc632.c +++ b/openpcd/firmware/src/rc632.c @@ -384,7 +384,7 @@ static int rc632_usb_in(struct req_ctx *rctx) { struct openpcd_hdr *poh = (struct openpcd_hdr *) &rctx->rx.data[0]; struct openpcd_hdr *pih = (struct openpcd_hdr *) &rctx->tx.data[0]; - u_int16_t len = rctx->rx.tot_len; + u_int16_t len = rctx->rx.tot_len-sizeof(*poh); switch (poh->cmd) { case OPENPCD_CMD_READ_REG: @@ -439,7 +439,8 @@ static int rc632_usb_in(struct req_ctx *rctx) rc632_reg_write(RAH, poh->reg, poh->val); break; case OPENPCD_CMD_WRITE_FIFO: - DEBUGP("WRITE FIFO(len=%u) ", len-sizeof(*poh)); + DEBUGP("WRITE FIFO(len=%u): %s ", len, + hexdump(poh->data, len)); rc632_fifo_write(RAH, len, poh->data, 0); break; case OPENPCD_CMD_READ_VFIFO: @@ -469,7 +470,12 @@ static int rc632_usb_in(struct req_ctx *rctx) return -EINVAL; } +#ifdef ALWAYS_RESPND + goto respond; +#endif + req_ctx_put(rctx); + DEBUGPCR(""); return 0; respond: -- cgit v1.2.3