PERFORCE change 156530 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Thu Jan 22 09:09:58 PST 2009
http://perforce.freebsd.org/chv.cgi?CH=156530
Change 156530 by hselasky at hselasky_laptop001 on 2009/01/22 17:09:44
Improve my UHCI SOF patch.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb2/controller/uhci2.c#24 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb2/controller/uhci2.c#24 (text+ko) ====
@@ -2396,6 +2396,24 @@
else
return (USB_ERR_IOERROR);
+ /*
+ * Before we do anything, turn on SOF messages on the USB
+ * BUS. Some USB devices do not cope without them!
+ */
+ if (!(UREAD2(sc, UHCI_CMD) & UHCI_CMD_RS)) {
+
+ DPRINTF("Activating SOFs!\n");
+
+ UHCICMD(sc, (UHCI_CMD_MAXP | UHCI_CMD_RS));
+
+ /* wait a little bit */
+ if (use_polling) {
+ DELAY(10000);
+ } else {
+ usb2_pause_mtx(&sc->sc_bus.bus_mtx, 10);
+ }
+ }
+
x = URWMASK(UREAD2(sc, port));
UWRITE2(sc, port, x | UHCI_PORTSC_PR);
@@ -3321,9 +3339,9 @@
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!
+ * 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 |
More information about the p4-projects
mailing list