Index: ubsa.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/ubsa.c,v retrieving revision 1.6 diff -u -r1.6 ubsa.c --- ubsa.c 19 Feb 2003 05:47:15 -0000 1.6 +++ ubsa.c 28 Feb 2003 04:55:58 -0000 @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #include @@ -92,7 +93,7 @@ #include -#ifdef USB_DEBUG +#ifdef UBSA_DEBUG Static int ubsadebug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ubsa, CTLFLAG_RW, 0, "USB ubsa"); SYSCTL_INT(_hw_usb_ubsa, OID_AUTO, debug, CTLFLAG_RW, @@ -177,9 +178,11 @@ u_char sc_lsr; /* Local status register */ u_char sc_msr; /* ubsa status register */ + void *sc_swicookie; }; Static void ubsa_intr(usbd_xfer_handle, usbd_private_handle, usbd_status); +Static void ubsa_notify(void *); Static void ubsa_get_status(void *, int, u_char *, u_char *); Static void ubsa_set(void *, int, int, int); @@ -247,6 +250,8 @@ MODULE_DEPEND(ubsa, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); MODULE_VERSION(ubsa, UBSA_MODVER); +static struct ithd *ucom_ithd; + USB_MATCH(ubsa) { USB_MATCH_START(ubsa, uaa); @@ -285,7 +290,7 @@ /* * initialize rts, dtr variables to something - * different from boolean 0, 1 + * different from boolean 0, 1 */ sc->sc_dtr = -1; sc->sc_rts = -1; @@ -304,7 +309,7 @@ DPRINTF(("ubsa attach: sc = %p\n", sc)); - /* initialize endpoints */ + /* initialize endpoints */ ucom->sc_bulkin_no = ucom->sc_bulkout_no = -1; sc->sc_intr_number = -1; sc->sc_intr_pipe = NULL; @@ -401,6 +406,9 @@ DPRINTF(("ubsa: in = 0x%x, out = 0x%x, intr = 0x%x\n", ucom->sc_bulkin_no, ucom->sc_bulkout_no, sc->sc_intr_number)); + swi_add(&ucom_ithd, "ucom", ubsa_notify, sc, SWI_TTY, 0, + &sc->sc_swicookie); + ucom_attach(ucom); free(devinfo, M_USBDEV); @@ -430,6 +438,8 @@ rv = ucom_detach(&sc->sc_ucom); + ithread_remove_handler(sc->sc_swicookie); + return (rv); } @@ -512,7 +522,7 @@ ubsa_baudrate(struct ubsa_softc *sc, speed_t speed) { u_int16_t value = 0; - + DPRINTF(("ubsa_baudrate: speed = %d\n", speed)); switch(speed) { @@ -528,17 +538,17 @@ case B38400: case B57600: case B115200: - case B230400: + case B230400: value = B230400 / speed; break; - default: + default: printf("%s: ubsa_param: unsupported baudrate, " "forcing default of 9600\n", USBDEVNAME(sc->sc_ucom.sc_dev)); value = B230400 / B9600; break; }; - + if (speed == B0) { ubsa_flow(sc, 0, 0); ubsa_dtr(sc, 0); @@ -574,7 +584,7 @@ case CS6: value = 1; break; case CS7: value = 2; break; case CS8: value = 3; break; - default: + default: printf("%s: ubsa_param: unsupported databits requested, " "forcing default of 8\n", USBDEVNAME(sc->sc_ucom.sc_dev)); @@ -600,7 +610,7 @@ ubsa_flow(struct ubsa_softc *sc, tcflag_t cflag, tcflag_t iflag) { int value; - + DPRINTF(("ubsa_flow: cflag = 0x%x, iflag = 0x%x\n", cflag, iflag)); value = 0; @@ -617,10 +627,9 @@ { struct ubsa_softc *sc; - sc = addr; - DPRINTF(("ubsa_param: sc = %p\n", sc)); + sc = addr; ubsa_baudrate(sc, ti->c_ospeed); ubsa_parity(sc, ti->c_cflag); ubsa_databits(sc, ti->c_cflag); @@ -635,7 +644,7 @@ { struct ubsa_softc *sc; int err; - + sc = addr; if (sc->sc_ucom.sc_dying) return (ENXIO); @@ -665,7 +674,7 @@ } Static void -ubsa_close(void *addr, int portno) +ubsa_close(void *addr, int portno) { struct ubsa_softc *sc; int err; @@ -721,6 +730,16 @@ DPRINTF(("%s: ubsa lsr = 0x%02x, msr = 0x%02x\n", USBDEVNAME(sc->sc_ucom.sc_dev), sc->sc_lsr, sc->sc_msr)); + swi_sched(sc->sc_swicookie, 0); +} + +/* Handle delayed events. */ +Static void +ubsa_notify(void *arg) +{ + struct ubsa_softc *sc; + + sc = arg; ucom_status_change(&sc->sc_ucom); } Index: uhci.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/uhci.c,v retrieving revision 1.133 diff -u -r1.133 uhci.c --- uhci.c 11 Mar 2003 09:12:55 -0000 1.133 +++ uhci.c 15 Mar 2003 16:57:04 -0000 @@ -1928,7 +1928,10 @@ * use of the xfer. Also make sure the soft interrupt routine * has run. */ + DELAY(2000); +#if 0 usb_delay_ms(upipe->pipe.device->bus, 2); /* Hardware finishes in 1ms */ +#endif s = splusb(); #ifdef USB_USE_SOFTINTR sc->sc_softwake = 1;