FreeBSD Bugzilla – Attachment 8787 Details for
Bug 18261
resume from suspend breaks usb
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.00 KB, created by
mike+fbsd
on 2000-04-27 22:40:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
mike+fbsd
Created:
2000-04-27 22:40:01 UTC
Size:
2.00 KB
patch
obsolete
>--- sys/dev/usb/uhcivar.orig Thu Jan 20 17:24:34 2000 >+++ sys/dev/usb/uhcivar.h Thu Apr 27 16:24:51 2000 >@@ -148,6 +148,9 @@ > u_int8_t sc_addr; /* device address */ > u_int8_t sc_conf; /* device configuration */ > >+ u_int8_t sc_saved_sof; >+ u_int16_t sc_saved_frnum; >+ > char sc_isreset; > char sc_suspend; > >--- sys/dev/usb/uhci.orig Thu Feb 10 13:50:17 2000 >+++ sys/dev/usb/uhci.c Thu Apr 27 16:29:42 2000 >@@ -254,6 +254,7 @@ > static void uhci_dump_td __P((uhci_soft_td_t *)); > #endif > >+#define UWRITE1(sc, r, x) bus_space_write_1((sc)->iot, (sc)->ioh, (r), (x)) > #define UWRITE2(sc, r, x) bus_space_write_2((sc)->iot, (sc)->ioh, (r), (x)) > #define UWRITE4(sc, r, x) bus_space_write_4((sc)->iot, (sc)->ioh, (r), (x)) > #define UREAD1(sc, r) bus_space_read_1((sc)->iot, (sc)->ioh, (r)) >@@ -584,17 +585,17 @@ > sc->sc_has_timo->timo_handle); > sc->sc_bus.use_polling++; > uhci_run(sc, 0); /* stop the controller */ >+ >+ /* save some state if BIOS doesn't */ >+ sc->sc_saved_frnum = UREAD2(sc, UHCI_FRNUM); >+ sc->sc_saved_sof = UREAD1(sc, UHCI_SOF); >+ > UHCICMD(sc, cmd | UHCI_CMD_EGSM); /* enter global suspend */ > usb_delay_ms(&sc->sc_bus, USB_RESUME_WAIT); > sc->sc_suspend = why; > sc->sc_bus.use_polling--; > DPRINTF(("uhci_power: cmd=0x%x\n", UREAD2(sc, UHCI_CMD))); > } else { >- /* >- * XXX We should really do much more here in case the >- * controller registers have been lost and BIOS has >- * not restored them. >- */ > #ifdef DIAGNOSTIC > if (sc->sc_suspend == PWR_RESUME) > printf("uhci_power: weird, resume without suspend.\n"); >@@ -603,6 +604,12 @@ > sc->sc_suspend = why; > if (cmd & UHCI_CMD_RS) > uhci_run(sc, 0); /* in case BIOS has started it */ >+ >+ /* restore saved state */ >+ UWRITE4(sc, UHCI_FLBASEADDR, DMAADDR(&sc->sc_dma, 0)); >+ UWRITE2(sc, UHCI_FRNUM, sc->sc_saved_frnum); >+ UWRITE1(sc, UHCI_SOF, sc->sc_saved_sof); >+ > UHCICMD(sc, cmd | UHCI_CMD_FGR); /* force global resume */ > usb_delay_ms(&sc->sc_bus, USB_RESUME_DELAY); > UHCICMD(sc, cmd & ~UHCI_CMD_EGSM); /* back to normal */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 18261
: 8787