diff options
-rw-r--r-- | sys/dev/usb/ucom.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/ucomvar.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c index 29c11ec..04efc27 100644 --- a/sys/dev/usb/ucom.c +++ b/sys/dev/usb/ucom.c @@ -587,6 +587,7 @@ ucomtty_outwakeup(struct tty *tp) sc->sc_state &= ~UCS_TXBUSY; return; } + sc->sc_obufactive = cnt; DPRINTF(("ucomtty_outwakeup: %zu chars\n", cnt)); usbd_setup_xfer(sc->sc_oxfer, sc->sc_bulkout_pipe, @@ -661,6 +662,9 @@ ucomwritecb(usbd_xfer_handle xfer, usbd_private_handle p, usbd_status status) /* convert from USB bytes to tty bytes */ cc -= sc->sc_opkthdrlen; + if (cc != sc->sc_obufactive) + panic("Partial write of %d of %d bytes, not supported\n", + cc, sc->sc_obufactive); sc->sc_state &= ~UCS_TXBUSY; #if 0 diff --git a/sys/dev/usb/ucomvar.h b/sys/dev/usb/ucomvar.h index 7a35a0a..32d7c04 100644 --- a/sys/dev/usb/ucomvar.h +++ b/sys/dev/usb/ucomvar.h @@ -140,6 +140,7 @@ struct ucom_softc { u_int sc_obufsize; /* write buffer size */ u_int sc_opkthdrlen; /* header length of output packet */ + u_int sc_obufactive; /* Active bytes in buffer */ struct ucom_callback *sc_callback; void *sc_parent; |