aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/usb_device.h
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2014-06-08 20:10:29 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2014-06-08 20:10:29 +0000
commitd64e9217c40746d8e4f8172457226b9abfe11be5 (patch)
tree6b6fd9094c2096380007cac3ef2c1b6c0201594f /sys/dev/usb/usb_device.h
parent3345d73ca8033de27169a478810f39a7a8f161ec (diff)
downloadsrc-d64e9217c40746d8e4f8172457226b9abfe11be5.tar.gz
src-d64e9217c40746d8e4f8172457226b9abfe11be5.zip
Resolve a deadlock setting the USB configuration index from userspace
on USB HUBs by moving the code into the USB explore threads. The deadlock happens because child devices of the USB HUB don't have the expected reference count when called from outside the explore thread. Only the HUB device itself, which the IOCTL interface locks, gets the correct reference count. MFC after: 3 days
Notes
Notes: svn path=/head/; revision=267240
Diffstat (limited to 'sys/dev/usb/usb_device.h')
-rw-r--r--sys/dev/usb/usb_device.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/usb/usb_device.h b/sys/dev/usb/usb_device.h
index 0763663fec6f..4bda2a476aba 100644
--- a/sys/dev/usb/usb_device.h
+++ b/sys/dev/usb/usb_device.h
@@ -228,6 +228,7 @@ struct usb_device {
uint8_t address; /* device addess */
uint8_t device_index; /* device index in "bus->devices" */
uint8_t controller_slot_id; /* controller specific value */
+ uint8_t next_config_index; /* used by USB_RE_ENUM_SET_CONFIG */
uint8_t curr_config_index; /* current configuration index */
uint8_t curr_config_no; /* current configuration number */
uint8_t depth; /* distance from root HUB */
@@ -241,6 +242,7 @@ struct usb_device {
#define USB_RE_ENUM_DONE 0
#define USB_RE_ENUM_START 1
#define USB_RE_ENUM_PWR_OFF 2
+#define USB_RE_ENUM_SET_CONFIG 3
uint8_t ifaces_max; /* number of interfaces present */
uint8_t endpoints_max; /* number of endpoints present */