From 26f73f2d50028c31c4f2ac0131c9109eb3549da2 Mon Sep 17 00:00:00 2001 From: n_hibma Date: Fri, 20 Oct 2000 00:35:52 +0000 Subject: Bugfix: The data is not stored only in the first cblock, calculate the length of the data properly. This should be moved into a tty_subr function. Also, disanle the setting of the CDC_CM_OVER_DATA flag. It breaks some modems. I don't think that ther actually is a modem that needs this. Submitted by: Brad Karp --- sys/dev/usb/umodem.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sys/dev') diff --git a/sys/dev/usb/umodem.c b/sys/dev/usb/umodem.c index 5a1a6e0..ca0c781 100644 --- a/sys/dev/usb/umodem.c +++ b/sys/dev/usb/umodem.c @@ -64,6 +64,7 @@ #endif #include #include +#include #include #include #include @@ -228,7 +229,9 @@ USB_ATTACH(umodem) usb_endpoint_descriptor_t *ed; usb_cdc_cm_descriptor_t *cmd; char devinfo[1024]; +#if 0 usbd_status err; +#endif int data_ifaceno; int i; struct tty *tp; @@ -309,6 +312,7 @@ USB_ATTACH(umodem) goto bad; } +#if 0 if (sc->sc_cm_cap & USB_CDC_CM_OVER_DATA) { err = umodem_set_comm_feature(sc, UCDC_ABSTRACT_STATE, UCDC_DATA_MULTIPLEXED); @@ -316,6 +320,7 @@ USB_ATTACH(umodem) goto bad; sc->sc_cm_over_data = 1; } +#endif #if defined(__NetBSD__) || defined(__OpenBSD__) sc->sc_tty = tp = ttymalloc(); @@ -378,6 +383,7 @@ umodemstart(tp) struct tty *tp; { struct umodem_softc *sc; + struct cblock *cbp; int s; u_char *data; int cnt; @@ -427,7 +433,8 @@ umodemstart(tp) #if defined(__NetBSD__) || defined(__OpenBSD__) cnt = ndqb(&tp->t_outq, 0); #elif defined(__FreeBSD__) - cnt = tp->t_outq.c_cc; + cbp = (struct cblock *) ((intptr_t) tp->t_outq.c_cf & ~CROUND); + cnt = min((char *) (cbp+1) - tp->t_outq.c_cf, tp->t_outq.c_cc); #endif if (cnt == 0) { -- cgit v1.1