aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb2
diff options
context:
space:
mode:
authorAndrew Thompson <thompsa@FreeBSD.org>2009-01-13 19:01:35 +0000
committerAndrew Thompson <thompsa@FreeBSD.org>2009-01-13 19:01:35 +0000
commit204793b247d9699a6bf974fbea5280f04cb614b8 (patch)
tree32ed0ed22a0ef2077cf6f07604d9061278daba8e /sys/dev/usb2
parent92346917b15483bca8a0961ba4340cdb1f2466c3 (diff)
Notes
Diffstat (limited to 'sys/dev/usb2')
-rw-r--r--sys/dev/usb2/core/usb2_generic.c11
-rw-r--r--sys/dev/usb2/core/usb2_hub.c3
2 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/usb2/core/usb2_generic.c b/sys/dev/usb2/core/usb2_generic.c
index 9e5b34b8cea4..1b3c316b605b 100644
--- a/sys/dev/usb2/core/usb2_generic.c
+++ b/sys/dev/usb2/core/usb2_generic.c
@@ -1699,11 +1699,12 @@ ugen_set_power_mode(struct usb2_fifo *f, int mode)
}
switch (mode) {
case USB_POWER_MODE_OFF:
- /* clear suspend */
- err = usb2_req_clear_port_feature(udev->parent_hub,
- NULL, udev->port_no, UHF_PORT_SUSPEND);
- if (err)
- break;
+ /* get the device unconfigured */
+ err = ugen_set_config(f, USB_UNCONFIG_INDEX);
+ if (err) {
+ DPRINTFN(0, "Could not unconfigure "
+ "device (ignored)\n");
+ }
/* clear port enable */
err = usb2_req_clear_port_feature(udev->parent_hub,
diff --git a/sys/dev/usb2/core/usb2_hub.c b/sys/dev/usb2/core/usb2_hub.c
index 0d08b9484f41..b58477526806 100644
--- a/sys/dev/usb2/core/usb2_hub.c
+++ b/sys/dev/usb2/core/usb2_hub.c
@@ -1823,7 +1823,8 @@ void
usb2_set_power_mode(struct usb2_device *udev, uint8_t power_mode)
{
/* filter input argument */
- if (power_mode != USB_POWER_MODE_ON) {
+ if ((power_mode != USB_POWER_MODE_ON) &&
+ (power_mode != USB_POWER_MODE_OFF)) {
power_mode = USB_POWER_MODE_SAVE;
}
udev->power_mode = power_mode; /* update copy of power mode */