diff options
author | n_hibma <n_hibma@FreeBSD.org> | 2000-10-20 00:35:52 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 2000-10-20 00:35:52 +0000 |
commit | 26f73f2d50028c31c4f2ac0131c9109eb3549da2 (patch) | |
tree | 6ab3b42e157380ef0a606c8e19313e7bede41aa5 /sys/dev/usb/umodem.c | |
parent | c46af66358fbeab645efd75a82692af0fbcbefcd (diff) | |
download | FreeBSD-src-26f73f2d50028c31c4f2ac0131c9109eb3549da2.zip FreeBSD-src-26f73f2d50028c31c4f2ac0131c9109eb3549da2.tar.gz |
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 <bkarp@ICSI.Berkeley.EDU>
Diffstat (limited to 'sys/dev/usb/umodem.c')
-rw-r--r-- | sys/dev/usb/umodem.c | 9 |
1 files changed, 8 insertions, 1 deletions
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 <sys/conf.h> #include <sys/tty.h> +#include <sys/clist.h> #include <sys/file.h> #include <sys/select.h> #include <sys/proc.h> @@ -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) { |