Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/sys/dev/usb Pull up (approved by thorpej).
details: https://anonhg.NetBSD.org/src/rev/c29ca9d83be1
branches: netbsd-1-5
changeset: 489377:c29ca9d83be1
user: augustss <augustss%NetBSD.org@localhost>
date: Mon Sep 04 17:53:13 2000 +0000
description:
Pull up (approved by thorpej).
Handle output packet headers in a cleaner way. From IWAMOTO Toshihiro
<iwamoto%sat.t.u-tokyo.ac.jp@localhost>, fixes kern/10573.
diffstat:
sys/dev/usb/ucom.c | 12 ++++++++----
sys/dev/usb/ucomvar.h | 4 ++--
sys/dev/usb/uftdi.c | 4 ++--
sys/dev/usb/umodem.c | 4 ++--
sys/dev/usb/uvisor.c | 4 ++--
5 files changed, 16 insertions(+), 12 deletions(-)
diffs (119 lines):
diff -r 416adf531c58 -r c29ca9d83be1 sys/dev/usb/ucom.c
--- a/sys/dev/usb/ucom.c Mon Sep 04 17:35:14 2000 +0000
+++ b/sys/dev/usb/ucom.c Mon Sep 04 17:53:13 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ucom.c,v 1.24 2000/06/01 14:28:59 augustss Exp $ */
+/* $NetBSD: ucom.c,v 1.24.2.1 2000/09/04 17:53:13 augustss Exp $ */
/*
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -101,7 +101,8 @@
usbd_xfer_handle sc_oxfer; /* write request */
u_char *sc_obuf; /* write buffer */
u_int sc_obufsize; /* write buffer size */
- u_int sc_obufsizepad; /* write buffer size padded */
+ u_int sc_opkthdrlen; /* header length of
+ * output packet */
struct ucom_methods *sc_methods;
void *sc_parent;
@@ -161,7 +162,7 @@
sc->sc_ibufsize = uca->ibufsize;
sc->sc_ibufsizepad = uca->ibufsizepad;
sc->sc_obufsize = uca->obufsize;
- sc->sc_obufsizepad = uca->obufsizepad;
+ sc->sc_opkthdrlen = uca->opkthdrlen;
sc->sc_methods = uca->methods;
sc->sc_parent = uca->arg;
sc->sc_portno = uca->portno;
@@ -399,7 +400,8 @@
return (ENOMEM);
}
sc->sc_obuf = usbd_alloc_buffer(sc->sc_oxfer,
- sc->sc_obufsizepad);
+ sc->sc_obufsize +
+ sc->sc_opkthdrlen);
if (sc->sc_obuf == NULL) {
usbd_free_xfer(sc->sc_oxfer);
usbd_free_xfer(sc->sc_ixfer);
@@ -912,6 +914,8 @@
usbd_get_xfer_status(xfer, NULL, NULL, &cc, NULL);
DPRINTFN(5,("ucomwritecb: cc=%d\n", cc));
+ /* convert from USB bytes to tty bytes */
+ cc -= sc->sc_opkthdrlen;
s = spltty();
CLR(tp->t_state, TS_BUSY);
diff -r 416adf531c58 -r c29ca9d83be1 sys/dev/usb/ucomvar.h
--- a/sys/dev/usb/ucomvar.h Mon Sep 04 17:35:14 2000 +0000
+++ b/sys/dev/usb/ucomvar.h Mon Sep 04 17:53:13 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ucomvar.h,v 1.7 2000/06/01 14:28:59 augustss Exp $ */
+/* $NetBSD: ucomvar.h,v 1.7.2.1 2000/09/04 17:53:14 augustss Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -98,7 +98,7 @@
u_int ibufsize;
u_int ibufsizepad;
u_int obufsize;
- u_int obufsizepad;
+ u_int opkthdrlen;
usbd_device_handle device;
usbd_interface_handle iface;
struct ucom_methods *methods;
diff -r 416adf531c58 -r c29ca9d83be1 sys/dev/usb/uftdi.c
--- a/sys/dev/usb/uftdi.c Mon Sep 04 17:35:14 2000 +0000
+++ b/sys/dev/usb/uftdi.c Mon Sep 04 17:53:13 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uftdi.c,v 1.2 2000/06/01 14:28:59 augustss Exp $ */
+/* $NetBSD: uftdi.c,v 1.2.2.1 2000/09/04 17:53:14 augustss Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -211,7 +211,7 @@
uca.ibufsize = UFTDIIBUFSIZE;
uca.obufsize = UFTDIOBUFSIZE - 1;
uca.ibufsizepad = UFTDIIBUFSIZE;
- uca.obufsizepad = UFTDIOBUFSIZE;
+ uca.opkthdrlen = 1;
uca.device = dev;
uca.iface = iface;
uca.methods = &uftdi_methods;
diff -r 416adf531c58 -r c29ca9d83be1 sys/dev/usb/umodem.c
--- a/sys/dev/usb/umodem.c Mon Sep 04 17:35:14 2000 +0000
+++ b/sys/dev/usb/umodem.c Mon Sep 04 17:53:13 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: umodem.c,v 1.29 2000/06/01 14:29:01 augustss Exp $ */
+/* $NetBSD: umodem.c,v 1.29.2.1 2000/09/04 17:53:14 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -276,7 +276,7 @@
uca.ibufsize = UMODEMIBUFSIZE;
uca.obufsize = UMODEMOBUFSIZE;
uca.ibufsizepad = UMODEMIBUFSIZE;
- uca.obufsizepad = UMODEMOBUFSIZE;
+ uca.opkthdrlen = 0;
uca.device = sc->sc_udev;
uca.iface = sc->sc_data_iface;
uca.methods = &umodem_methods;
diff -r 416adf531c58 -r c29ca9d83be1 sys/dev/usb/uvisor.c
--- a/sys/dev/usb/uvisor.c Mon Sep 04 17:35:14 2000 +0000
+++ b/sys/dev/usb/uvisor.c Mon Sep 04 17:53:13 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvisor.c,v 1.7 2000/06/01 14:29:03 augustss Exp $ */
+/* $NetBSD: uvisor.c,v 1.7.2.1 2000/09/04 17:53:14 augustss Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -240,7 +240,7 @@
uca.ibufsize = UVISORIBUFSIZE;
uca.obufsize = UVISOROBUFSIZE;
uca.ibufsizepad = UVISORIBUFSIZE;
- uca.obufsizepad = UVISOROBUFSIZE;
+ uca.opkthdrlen = 0;
uca.device = dev;
uca.iface = iface;
uca.methods = &uvisor_methods;
Home |
Main Index |
Thread Index |
Old Index