diff options
author | (no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2006-08-16 22:19:49 +0000 |
---|---|---|
committer | (no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2006-08-16 22:19:49 +0000 |
commit | 86c8ee950daa48193a6c0aac3e582854cc59fb0f (patch) | |
tree | 976960b68ceb6902a9c7b241de077b742480d511 | |
parent | 6cb35282083026c9bd8fa311dd7fa4777922a39f (diff) |
- 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
-rw-r--r-- | openpcd/firmware/src/rc632.c | 10 |
1 files 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: |