diff --git a/sys/dev/usb/serial/umodem.c b/sys/dev/usb/serial/umodem.c --- a/sys/dev/usb/serial/umodem.c +++ b/sys/dev/usb/serial/umodem.c @@ -218,6 +218,7 @@ uint8_t *); static int umodem_pre_param(struct ucom_softc *, struct termios *); static void umodem_cfg_param(struct ucom_softc *, struct termios *); +static void umodem_cfg_open(struct ucom_softc *ucom); static int umodem_ioctl(struct ucom_softc *, uint32_t, caddr_t, int, struct thread *); static void umodem_cfg_set_dtr(struct ucom_softc *, uint8_t); @@ -283,6 +284,7 @@ .ucom_cfg_set_break = &umodem_cfg_set_break, .ucom_cfg_param = &umodem_cfg_param, .ucom_pre_param = &umodem_pre_param, + .ucom_cfg_open = &umodem_cfg_open, .ucom_ioctl = &umodem_ioctl, .ucom_start_read = &umodem_start_read, .ucom_stop_read = &umodem_stop_read, @@ -633,6 +635,17 @@ &req, &ls, 0, 1000); } +static void +umodem_cfg_open(struct ucom_softc *ucom) +{ + struct umodem_softc *sc = ucom->sc_parent; + + if ((sc->sc_super_ucom.sc_flag & UCOM_FLAG_DEVICE_MODE) == 0) { + usbd_xfer_set_stall(sc->sc_xfer[UMODEM_BULK_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UMODEM_BULK_RD]); + } +} + static int umodem_ioctl(struct ucom_softc *ucom, uint32_t cmd, caddr_t data, int flag, struct thread *td) diff --git a/sys/dev/usb/serial/usb_serial.c b/sys/dev/usb/serial/usb_serial.c --- a/sys/dev/usb/serial/usb_serial.c +++ b/sys/dev/usb/serial/usb_serial.c @@ -628,9 +628,9 @@ task->termios_copy = *pt; /* - * Closing the device should be synchronous. + * Closing or opening the device should be synchronous. */ - if (fn == ucom_cfg_close) + if (fn == ucom_cfg_close || fn == ucom_cfg_open) usb_proc_mwait(&ssc->sc_tq, t0, t1); /*