summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_device.h
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2010-05-12 22:42:35 +0000
committerthompsa <thompsa@FreeBSD.org>2010-05-12 22:42:35 +0000
commitf61fd930ea6d4ab1f68a77846ad3ce133636197c (patch)
tree5cb412eb53df6be590b70f2b1455668701879e35 /sys/dev/usb/usb_device.h
parent2cc73b6656a9910435455e662e86cf485e86b069 (diff)
downloadFreeBSD-src-f61fd930ea6d4ab1f68a77846ad3ce133636197c.zip
FreeBSD-src-f61fd930ea6d4ab1f68a77846ad3ce133636197c.tar.gz
If a USB device is suspended and a USB set config request is issued when the
USB enumeration lock is locked, then the USB stack fails to resume the device because locking the USB enumeration lock is part of the resume procedure. To solve this issue a new lock is introduced which only protects the suspend and resume callbacks, which can be dropped inside the usbd_do_request_flags() function, to allow suspend and resume during so-called enumeration operations. Submitted by: Hans Petter Selasky
Diffstat (limited to 'sys/dev/usb/usb_device.h')
-rw-r--r--sys/dev/usb/usb_device.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/usb/usb_device.h b/sys/dev/usb/usb_device.h
index 08b9fd7..6a02f50 100644
--- a/sys/dev/usb/usb_device.h
+++ b/sys/dev/usb/usb_device.h
@@ -115,6 +115,7 @@ struct usb_device {
* messages */
struct sx ctrl_sx;
struct sx enum_sx;
+ struct sx sr_sx;
struct mtx device_mtx;
struct cv ctrlreq_cv;
struct cv ref_cv;
@@ -215,6 +216,8 @@ void usb_set_device_state(struct usb_device *udev,
enum usb_dev_state state);
void usbd_enum_lock(struct usb_device *);
void usbd_enum_unlock(struct usb_device *);
+void usbd_sr_lock(struct usb_device *);
+void usbd_sr_unlock(struct usb_device *);
uint8_t usbd_enum_is_locked(struct usb_device *);
#endif /* _USB_DEVICE_H_ */
OpenPOWER on IntegriCloud