PERFORCE change 127023 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Sun Sep 30 08:42:30 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=127023
Change 127023 by hselasky at hselasky_laptop001 on 2007/09/30 15:42:01
Store "use_polling" flag on the stack so that we don't
access anything in the "xfer" structure in case the
USB transfer should be cancelled.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/ehci.c#40 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/ehci.c#40 (text+ko) ====
@@ -3326,6 +3326,7 @@
u_int16_t value;
u_int16_t index;
u_int8_t l;
+ uint8_t use_polling;
mtx_assert(&sc->sc_bus.mtx, MA_OWNED);
@@ -3344,6 +3345,8 @@
value = UGETW(std->req.wValue);
index = UGETW(std->req.wIndex);
+ use_polling = xfer->flags.use_polling;
+
DPRINTFN(2,("type=0x%02x request=0x%02x wLen=0x%04x "
"wValue=0x%04x wIndex=0x%04x\n",
std->req.bmRequestType, std->req.bRequest,
@@ -3634,7 +3637,7 @@
v &= ~ (EHCI_PS_PE | EHCI_PS_PR);
EOWRITE4(sc, port, v | EHCI_PS_PR);
- if (xfer->flags.use_polling) {
+ if (use_polling) {
/* polling */
DELAY(USB_PORT_ROOT_RESET_DELAY * 1000);
} else {
@@ -3647,7 +3650,7 @@
/* Terminate reset sequence. */
EOWRITE4(sc, port, v);
- if (xfer->flags.use_polling) {
+ if (use_polling) {
/* polling */
DELAY(EHCI_PORT_RESET_COMPLETE * 1000);
} else {
More information about the p4-projects
mailing list