summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller/ehci.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/controller/ehci.c')
-rw-r--r--sys/dev/usb/controller/ehci.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/usb/controller/ehci.c b/sys/dev/usb/controller/ehci.c
index 812e422..9d73d4a 100644
--- a/sys/dev/usb/controller/ehci.c
+++ b/sys/dev/usb/controller/ehci.c
@@ -1183,18 +1183,18 @@ _ehci_remove_qh(ehci_qh_t *sqh, ehci_qh_t *last)
static void
ehci_data_toggle_update(struct usb_xfer *xfer, uint16_t actlen, uint16_t xlen)
{
- uint8_t full = (actlen == xlen);
+ uint16_t rem;
uint8_t dt;
/* count number of full packets */
dt = (actlen / xfer->max_packet_size) & 1;
/* cumpute remainder */
- actlen = actlen % xfer->max_packet_size;
+ rem = actlen % xfer->max_packet_size;
- if (actlen > 0)
+ if (rem > 0)
dt ^= 1; /* short packet at the end */
- else if (!full)
+ else if (actlen != xlen)
dt ^= 1; /* zero length packet at the end */
xfer->endpoint->toggle_next ^= dt;
OpenPOWER on IntegriCloud