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/usbdi.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/usbdi.h')
-rw-r--r-- | sys/dev/usb/usbdi.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h index 653f395..4193118 100644 --- a/sys/dev/usb/usbdi.h +++ b/sys/dev/usb/usbdi.h @@ -133,7 +133,8 @@ struct usb_xfer_queue { * USB endpoint. */ struct usb_endpoint { - struct usb_xfer_queue endpoint_q; /* queue of USB transfers */ + /* queue of USB transfers */ + struct usb_xfer_queue endpoint_q[USB_MAX_EP_STREAMS]; struct usb_endpoint_descriptor *edesc; struct usb_endpoint_ss_comp_descriptor *ecomp; @@ -156,6 +157,10 @@ struct usb_endpoint { uint8_t usb_smask; /* USB start mask */ uint8_t usb_cmask; /* USB complete mask */ uint8_t usb_uframe; /* USB microframe */ + + /* USB endpoint mode, see USB_EP_MODE_XXX */ + + uint8_t ep_mode; }; /* @@ -220,6 +225,7 @@ struct usb_config { #define USB_DEFAULT_INTERVAL 0 usb_timeout_t timeout; /* transfer timeout in milliseconds */ struct usb_xfer_flags flags; /* transfer flags */ + usb_stream_t stream_id; /* USB3.0 specific */ enum usb_hc_mode usb_mode; /* host or device mode */ uint8_t type; /* pipe type */ uint8_t endpoint; /* pipe number */ @@ -477,6 +483,10 @@ usb_error_t usbd_set_pnpinfo(struct usb_device *udev, uint8_t iface_index, const char *pnpinfo); usb_error_t usbd_add_dynamic_quirk(struct usb_device *udev, uint16_t quirk); +usb_error_t usbd_set_endpoint_mode(struct usb_device *udev, + struct usb_endpoint *ep, uint8_t ep_mode); +uint8_t usbd_get_endpoint_mode(struct usb_device *udev, + struct usb_endpoint *ep); const struct usb_device_id *usbd_lookup_id_by_info( const struct usb_device_id *id, usb_size_t sizeof_id, |