aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/usbdi.h
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2020-12-15 12:05:07 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2020-12-15 12:05:07 +0000
commitb8b3f4fdc31fb21b54f5f3104e318e1c342cb2d9 (patch)
tree1f5c014aeb2abb8fcb9e40518cbfe85b257e92fd /sys/dev/usb/usbdi.h
parent6da5df470099fc55f20b03ef364af730e7be4ffe (diff)
downloadsrc-b8b3f4fdc31fb21b54f5f3104e318e1c342cb2d9.tar.gz
src-b8b3f4fdc31fb21b54f5f3104e318e1c342cb2d9.zip
Improve handling of alternate settings in the USB stack.
Allow setting the alternate interface number to fail when there is only one alternate setting present, to comply with the USB specification. Refactor how iface->num_altsetting is computed. Bump the __FreeBSD_version due to change of core USB structure. PR: 251856 MFC after: 1 week Submitted by: Ma, Horse <Shichun.Ma@dell.com> Sponsored by: Mellanox Technologies // NVIDIA Networking
Notes
Notes: svn path=/head/; revision=368659
Diffstat (limited to 'sys/dev/usb/usbdi.h')
-rw-r--r--sys/dev/usb/usbdi.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h
index a8ba5408f5c4..1b3b4af5f717 100644
--- a/sys/dev/usb/usbdi.h
+++ b/sys/dev/usb/usbdi.h
@@ -174,6 +174,9 @@ struct usb_endpoint {
struct usb_interface {
struct usb_interface_descriptor *idesc;
device_t subdev;
+ /* Total number of alternate settings, from 1 to 256 */
+ uint16_t num_altsetting;
+ /* Current alternate interface index, from 0 to 255 */
uint8_t alt_index;
uint8_t parent_iface_index;
@@ -183,7 +186,6 @@ struct usb_interface {
struct usb_device *linux_udev;
void *bsd_priv_sc; /* device specific information */
char *pnpinfo; /* additional PnP-info for this interface */
- uint8_t num_altsetting; /* number of alternate settings */
uint8_t bsd_iface_index;
};