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>
This commit is contained in:
parent
fb2a416f3b
commit
64b78d815a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=67340
@ -64,6 +64,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <sys/conf.h>
|
#include <sys/conf.h>
|
||||||
#include <sys/tty.h>
|
#include <sys/tty.h>
|
||||||
|
#include <sys/clist.h>
|
||||||
#include <sys/file.h>
|
#include <sys/file.h>
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#include <sys/proc.h>
|
#include <sys/proc.h>
|
||||||
@ -228,7 +229,9 @@ USB_ATTACH(umodem)
|
|||||||
usb_endpoint_descriptor_t *ed;
|
usb_endpoint_descriptor_t *ed;
|
||||||
usb_cdc_cm_descriptor_t *cmd;
|
usb_cdc_cm_descriptor_t *cmd;
|
||||||
char devinfo[1024];
|
char devinfo[1024];
|
||||||
|
#if 0
|
||||||
usbd_status err;
|
usbd_status err;
|
||||||
|
#endif
|
||||||
int data_ifaceno;
|
int data_ifaceno;
|
||||||
int i;
|
int i;
|
||||||
struct tty *tp;
|
struct tty *tp;
|
||||||
@ -309,6 +312,7 @@ USB_ATTACH(umodem)
|
|||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (sc->sc_cm_cap & USB_CDC_CM_OVER_DATA) {
|
if (sc->sc_cm_cap & USB_CDC_CM_OVER_DATA) {
|
||||||
err = umodem_set_comm_feature(sc, UCDC_ABSTRACT_STATE,
|
err = umodem_set_comm_feature(sc, UCDC_ABSTRACT_STATE,
|
||||||
UCDC_DATA_MULTIPLEXED);
|
UCDC_DATA_MULTIPLEXED);
|
||||||
@ -316,6 +320,7 @@ USB_ATTACH(umodem)
|
|||||||
goto bad;
|
goto bad;
|
||||||
sc->sc_cm_over_data = 1;
|
sc->sc_cm_over_data = 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
sc->sc_tty = tp = ttymalloc();
|
sc->sc_tty = tp = ttymalloc();
|
||||||
@ -378,6 +383,7 @@ umodemstart(tp)
|
|||||||
struct tty *tp;
|
struct tty *tp;
|
||||||
{
|
{
|
||||||
struct umodem_softc *sc;
|
struct umodem_softc *sc;
|
||||||
|
struct cblock *cbp;
|
||||||
int s;
|
int s;
|
||||||
u_char *data;
|
u_char *data;
|
||||||
int cnt;
|
int cnt;
|
||||||
@ -427,7 +433,8 @@ umodemstart(tp)
|
|||||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
cnt = ndqb(&tp->t_outq, 0);
|
cnt = ndqb(&tp->t_outq, 0);
|
||||||
#elif defined(__FreeBSD__)
|
#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
|
#endif
|
||||||
|
|
||||||
if (cnt == 0) {
|
if (cnt == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user