diff options
author | hselasky <hselasky@FreeBSD.org> | 2012-08-12 17:53:06 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2012-08-12 17:53:06 +0000 |
commit | ce0da37e7d071995cc8533b668360082f78cb329 (patch) | |
tree | 4ef3a2c09abbce548ca79a0652beee2be50d1199 /sys/dev/usb/controller/xhci.h | |
parent | 0b3ddf87a17ef869513d045700b673f056909ab2 (diff) | |
download | FreeBSD-src-ce0da37e7d071995cc8533b668360082f78cb329.zip FreeBSD-src-ce0da37e7d071995cc8533b668360082f78cb329.tar.gz |
Add support for the so-called streams feature of BULK endpoints
in SUPER-speed mode, USB 3.0.
This feature has not been tested yet, due to lack of hardware.
This feature is useful when implementing protocols like UASP,
USB attached SCSI which promises higher USB mass storage throughput.
This patch also implements support for hardware processing of endpoints
for increased performance. The switching to hardware processing
of an endpoint is done via a callback to the USB controller driver. The
stream feature is implemented like a variant of a hardware USB protocol.
USB controller drivers implementing device mode needs to be updated to
implement the new "xfer_stall" USB controller method and remove the
"xfer" argument from the "set_stall" method.
The API's toward existing USB drivers are preserved. To setup a USB transfer
in stream mode, set the "stream_id" field of the USB config structure to
the desired value.
The maximum number of BULK streams is currently hardcoded and limited to 8
via a define in usb_freebsd.h.
All USB drivers should be re-compiled after this change.
LibUSB will be updated next week to support streams mode. A new IOCTL to
setup BULK streams as already been implemented. The ugen device nodes
currently only supports stream ID zero.
The FreeBSD version has been bumped.
MFC after: 2 weeks
Diffstat (limited to 'sys/dev/usb/controller/xhci.h')
-rw-r--r-- | sys/dev/usb/controller/xhci.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/dev/usb/controller/xhci.h b/sys/dev/usb/controller/xhci.h index 14afcaf..f6d467f 100644 --- a/sys/dev/usb/controller/xhci.h +++ b/sys/dev/usb/controller/xhci.h @@ -35,7 +35,15 @@ #define XHCI_MAX_COMMANDS (16 * 1) #define XHCI_MAX_RSEG 1 #define XHCI_MAX_TRANSFERS 4 - +#if USB_MAX_EP_STREAMS == 8 +#define XHCI_MAX_STREAMS 8 +#define XHCI_MAX_STREAMS_LOG 3 +#elif USB_MAX_EP_STREAMS == 1 +#define XHCI_MAX_STREAMS 1 +#define XHCI_MAX_STREAMS_LOG 0 +#else +#error "The USB_MAX_EP_STREAMS value is not supported." +#endif #define XHCI_DEV_CTX_ADDR_ALIGN 64 /* bytes */ #define XHCI_DEV_CTX_ALIGN 64 /* bytes */ #define XHCI_INPUT_CTX_ALIGN 64 /* bytes */ @@ -307,7 +315,8 @@ struct xhci_trb { } __aligned(4); struct xhci_dev_endpoint_trbs { - struct xhci_trb trb[XHCI_MAX_ENDPOINTS][XHCI_MAX_TRANSFERS]; + struct xhci_trb trb[XHCI_MAX_ENDPOINTS] + [(XHCI_MAX_STREAMS * XHCI_MAX_TRANSFERS) + XHCI_MAX_STREAMS]; }; #define XHCI_TD_PAGE_NBUF 17 /* units, room enough for 64Kbytes */ @@ -353,11 +362,11 @@ struct xhci_hw_root { struct xhci_endpoint_ext { struct xhci_trb *trb; - struct usb_xfer *xfer[XHCI_MAX_TRANSFERS - 1]; + struct usb_xfer *xfer[XHCI_MAX_TRANSFERS * XHCI_MAX_STREAMS]; struct usb_page_cache *page_cache; uint64_t physaddr; - uint8_t trb_used; - uint8_t trb_index; + uint8_t trb_used[XHCI_MAX_STREAMS]; + uint8_t trb_index[XHCI_MAX_STREAMS]; uint8_t trb_halted; uint8_t trb_running; }; |