Skip to content

Commit a4f469f

Browse files
Pull up following revision(s) (requested by nat in ticket #1159):
sys/dev/usb/xhci.c: revision 1.190 Handle special case of USBD_FORCE_SHORT_XFER. This fixes devices such as urtwn(4) connected to an xhci port. It works by sending a zero length transfer at the end of the data transfer for the above mentioned flag. Similar artwork in this space already exists for ohci/uhci/ehci. OK jkallsch@.
1 parent 7bc1a43 commit a4f469f

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

sys/dev/usb/xhci.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: xhci.c,v 1.175.2.3 2024/09/20 10:52:21 martin Exp $ */
1+
/* $NetBSD: xhci.c,v 1.175.2.4 2025/09/23 12:44:01 martin Exp $ */
22

33
/*
44
* Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
3434
*/
3535

3636
#include <sys/cdefs.h>
37-
__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.175.2.3 2024/09/20 10:52:21 martin Exp $");
37+
__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.175.2.4 2025/09/23 12:44:01 martin Exp $");
3838

3939
#ifdef _KERNEL_OPT
4040
#include "opt_usb.h"
@@ -4757,6 +4757,13 @@ xhci_device_bulk_start(struct usbd_xfer *xfer)
47574757
XHCI_TRB_3_IOC_BIT;
47584758
xhci_xfer_put_trb(xx, i++, parameter, status, control);
47594759

4760+
if (!isread && (xfer->ux_flags & USBD_FORCE_SHORT_XFER)) {
4761+
status = XHCI_TRB_2_IRQ_SET(0) |
4762+
XHCI_TRB_2_TDSZ_SET(0) |
4763+
XHCI_TRB_2_BYTES_SET(0);
4764+
xhci_xfer_put_trb(xx, i++, parameter, status, control);
4765+
}
4766+
47604767
if (!polling)
47614768
mutex_enter(&tr->xr_lock);
47624769
xhci_ring_put_xfer(sc, tr, xx, i);

0 commit comments

Comments
 (0)