Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/usb/serial/usb_serial.c
Show First 20 Lines • Show All 520 Lines • ▼ Show 20 Lines | ucom_detach_tty(struct ucom_super_softc *ssc, struct ucom_softc *sc) | ||||
UCOM_MTX_UNLOCK(sc); | UCOM_MTX_UNLOCK(sc); | ||||
if (tp) { | if (tp) { | ||||
mtx_lock(&ucom_mtx); | mtx_lock(&ucom_mtx); | ||||
ucom_close_refs++; | ucom_close_refs++; | ||||
mtx_unlock(&ucom_mtx); | mtx_unlock(&ucom_mtx); | ||||
tty_lock(tp); | tty_lock(tp); | ||||
ttydisc_lock(tp); | |||||
ucom_close(tp); /* close, if any */ | ucom_close(tp); /* close, if any */ | ||||
tty_rel_gone(tp); | tty_rel_gone(tp); | ||||
UCOM_MTX_LOCK(sc); | UCOM_MTX_LOCK(sc); | ||||
/* | /* | ||||
* make sure that read and write transfers are stopped | * make sure that read and write transfers are stopped | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | ucom_queue_command(struct ucom_softc *sc, | ||||
/* | /* | ||||
* Make a copy of the termios. This field is only present if | * Make a copy of the termios. This field is only present if | ||||
* the "pt" field is not NULL. | * the "pt" field is not NULL. | ||||
*/ | */ | ||||
if (pt != NULL) | if (pt != NULL) | ||||
task->termios_copy = *pt; | task->termios_copy = *pt; | ||||
/* | /* | ||||
* Closing or opening the device should be synchronous. | * The tty lock is sleepable and the ttydisc lock is shared with the USB | ||||
* parts. We can now asychronously do the USB parts while making sure | |||||
* that we're not violation termios guarantees about the state of the | |||||
* hardware when we return. | |||||
*/ | */ | ||||
if (fn == ucom_cfg_close || fn == ucom_cfg_open) | |||||
usb_proc_mwait(&ssc->sc_tq, t0, t1); | usb_proc_mwait(&ssc->sc_tq, t0, t1); | ||||
/* | /* | ||||
* In case of multiple configure requests, | * In case of multiple configure requests, | ||||
* keep track of the last one! | * keep track of the last one! | ||||
*/ | */ | ||||
if (fn == ucom_cfg_start_transfers) | if (fn == ucom_cfg_start_transfers) | ||||
sc->sc_last_start_xfer = &task->hdr; | sc->sc_last_start_xfer = &task->hdr; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,143 Lines • Show Last 20 Lines |