PERFORCE change 156522 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Thu Jan 22 07:19:05 PST 2009
http://perforce.freebsd.org/chv.cgi?CH=156522
Change 156522 by hselasky at hselasky_laptop001 on 2009/01/22 15:18:06
UHCI SOF Quirk. Makes some broken USB devices work again.
Reported by several people. Patch made by me.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb2/controller/uhci2.c#23 edit
.. //depot/projects/usb/src/sys/dev/usb2/controller/usb2_controller.h#11 edit
.. //depot/projects/usb/src/sys/dev/usb2/core/usb2_hub.c#34 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb2/controller/uhci2.c#23 (text+ko) ====
@@ -3320,7 +3320,13 @@
flags = bus->hw_power_state;
+ /*
+ * WARNING: Some FULL speed USB devices require periodic SOF messages!
+ * If any USB devices are connected through the UHCI, power
+ * save will be disabled!
+ */
if (flags & (USB_HW_POWER_CONTROL |
+ USB_HW_POWER_NON_ROOT_HUB |
USB_HW_POWER_BULK |
USB_HW_POWER_INTERRUPT |
USB_HW_POWER_ISOC)) {
==== //depot/projects/usb/src/sys/dev/usb2/controller/usb2_controller.h#11 (text+ko) ====
@@ -84,6 +84,11 @@
* are active:
*/
#define USB_HW_POWER_ISOC 0x08
+ /*
+ * The following flag is set if one or more non-root-HUB devices
+ * are present on the given USB bus:
+ */
+#define USB_HW_POWER_NON_ROOT_HUB 0x10
/* USB Device mode only - Mandatory */
==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_hub.c#34 (text+ko) ====
@@ -1503,7 +1503,7 @@
unsigned int temp;
unsigned int limit;
unsigned int mintime;
- uint32_t type_refs[4];
+ uint32_t type_refs[5];
uint8_t x;
uint8_t rem_wakeup;
@@ -1564,6 +1564,7 @@
type_refs[1] = 0;
type_refs[2] = 0;
type_refs[3] = 0;
+ type_refs[4] = 0;
/* Re-loop all the devices to get the actual state */
@@ -1574,6 +1575,9 @@
if (udev == NULL)
continue;
+ /* we found a non-Root-Hub USB device */
+ type_refs[4] += 1;
+
/* "last_xfer_time" can be updated by a resume */
temp = ticks - udev->pwr_save.last_xfer_time;
@@ -1604,6 +1608,8 @@
bus->hw_power_state |= USB_HW_POWER_INTERRUPT;
if (type_refs[UE_ISOCHRONOUS] != 0)
bus->hw_power_state |= USB_HW_POWER_ISOC;
+ if (type_refs[4] != 0)
+ bus->hw_power_state |= USB_HW_POWER_NON_ROOT_HUB;
}
USB_BUS_UNLOCK(bus);
More information about the p4-projects
mailing list