MFp4: //depot/projects/usb@155750

Patch to resolve problems with power mode off.
	Reported by Alexander Best.

Submitted by: Hans Petter Selasky
This commit is contained in:
Andrew Thompson 2009-01-13 19:01:35 +00:00
parent 92346917b1
commit 204793b247
2 changed files with 8 additions and 6 deletions

View File

@ -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,

View File

@ -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 */