summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2013-12-12 08:34:51 +0000
committerhselasky <hselasky@FreeBSD.org>2013-12-12 08:34:51 +0000
commita00f1af7e6eaa783993b67961962d359713c15cc (patch)
treed8a862072f5fda059b98017cdc24c245c2c66f0e
parent4dd7fdae6aa8630bbc5778e1031013bbe02134f5 (diff)
downloadFreeBSD-src-a00f1af7e6eaa783993b67961962d359713c15cc.zip
FreeBSD-src-a00f1af7e6eaa783993b67961962d359713c15cc.tar.gz
Set chain bit correctly. This will fix some problems sending and
receiving Zero Length Packets, ZLPs. See comment in code for more information. MFC after: 1 week Reported by: Kohji Okuno <okuno.kohji@jp.panasonic.com>
-rw-r--r--sys/dev/usb/controller/xhci.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c
index 48c5edb..c56e6f0 100644
--- a/sys/dev/usb/controller/xhci.c
+++ b/sys/dev/usb/controller/xhci.c
@@ -1892,7 +1892,16 @@ restart:
td->td_trb[x].dwTrb2 = htole32(dword);
dword = XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_LINK) |
- XHCI_TRB_3_CYCLE_BIT | XHCI_TRB_3_IOC_BIT;
+ XHCI_TRB_3_CYCLE_BIT | XHCI_TRB_3_IOC_BIT |
+ /*
+ * CHAIN-BIT: Ensure that a multi-TRB IN-endpoint
+ * frame only receives a single short packet event
+ * by setting the CHAIN bit in the LINK field. In
+ * addition some XHCI controllers have problems
+ * sending a ZLP unless the CHAIN-BIT is set in
+ * the LINK TRB.
+ */
+ XHCI_TRB_3_CHAIN_BIT;
td->td_trb[x].dwTrb3 = htole32(dword);
@@ -1930,7 +1939,7 @@ restart:
}
/* clear TD SIZE to zero, hence this is the last TRB */
- /* remove chain bit because this is the last TRB in the chain */
+ /* remove chain bit because this is the last data TRB in the chain */
td->td_trb[td->ntrb - 1].dwTrb2 &= ~htole32(XHCI_TRB_2_TDSZ_SET(15));
td->td_trb[td->ntrb - 1].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT);
OpenPOWER on IntegriCloud