From bcc0e93a829669a3fe6a105f80135b5341c9020d Mon Sep 17 00:00:00 2001 From: aaron Date: Fri, 14 Apr 2000 22:50:23 +0000 Subject: [PATCH] Sync with NetBSD. --- sys/dev/usb/TODO | 16 ++-- sys/dev/usb/hid.c | 10 +-- sys/dev/usb/if_aue.c | 22 +++--- sys/dev/usb/if_auereg.h | 5 +- sys/dev/usb/if_cuereg.h | 5 +- sys/dev/usb/ucom.c | 158 ++++++++++++++++++++++++++----------- sys/dev/usb/ucomvar.h | 20 +++-- sys/dev/usb/uhci.c | 31 +++++--- sys/dev/usb/uhcireg.h | 8 +- sys/dev/usb/uhcivar.h | 17 ++-- sys/dev/usb/uhid.c | 32 +++++++- sys/dev/usb/ulpt.c | 6 +- sys/dev/usb/umass.c | 52 +++++++----- sys/dev/usb/umodem.c | 19 ++++- sys/dev/usb/usb_subr.c | 63 ++++++++------- sys/dev/usb/usbdevs | 16 ++-- sys/dev/usb/usbdevs.h | 16 ++-- sys/dev/usb/usbdevs_data.h | 44 ++++++++--- 18 files changed, 363 insertions(+), 177 deletions(-) diff --git a/sys/dev/usb/TODO b/sys/dev/usb/TODO index acc8feccf51..103ee72d726 100644 --- a/sys/dev/usb/TODO +++ b/sys/dev/usb/TODO @@ -4,12 +4,18 @@ Some things that need to be done in no particular order: Before 1.5: ----------- -Add isoc to OHCI driver. +Reset toggle on SET_INTERFACE (USB 1.1) -Port FreeBSD umass driver. +Allow interrupt out endpoints. (USB 1.1) ----------- +Make flow control work in ucom. + +Figure out why uvisor is so slow. + +Translate UFI commands? + Add lots of bus_dmamap_sync(). Do bandwidth accounting. @@ -26,9 +32,6 @@ Handle overcurrent conditions. Make it possible to open any device in a "generic" way, i.e., like ugen. -Rewrite mouse and keyboard driver to handle devices which use the -report ID. One way would be to attach ums and ukbd to uhid. - Rotate the QHs for bulk transport to get fairer scheduling. Change HC drivers to queue multiple request for an endpoint @@ -59,6 +62,9 @@ Add threads to the Ethernet drivers. Change what's done at watchdog timeout inb if_{a,c,k}ue.c; what we have now doesn't work because it's done in an interrupt context. +Factor out the common code from the Ethernet drivers and reuse that. + Rewrite HID driver to handle report IDs properly. Perhaps there should be a hiddev to which hid with different IDs can attach? +Get rid of hcpriv. diff --git a/sys/dev/usb/hid.c b/sys/dev/usb/hid.c index 123cccc44e4..603f3d49597 100644 --- a/sys/dev/usb/hid.c +++ b/sys/dev/usb/hid.c @@ -1,5 +1,5 @@ -/* $OpenBSD: hid.c,v 1.6 2000/03/30 16:19:32 aaron Exp $ */ -/* $NetBSD: hid.c,v 1.13 2000/03/27 12:33:53 augustss Exp $ */ +/* $OpenBSD: hid.c,v 1.7 2000/04/14 22:50:24 aaron Exp $ */ +/* $NetBSD: hid.c,v 1.14 2000/04/06 22:58:32 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */ /* @@ -127,7 +127,7 @@ hid_get_item(s, h) { struct hid_item *c = &s->cur; unsigned int bTag, bType, bSize; - struct hid_location oldloc; + u_int32_t oldpos; u_char *data; int32_t dval; u_char *p; @@ -301,9 +301,9 @@ hid_get_item(s, h) break; case 11: /* Pop */ hi = c->next; - oldloc = c->loc; + oldpos = c->loc.pos; s->cur = *hi; - c->loc = oldloc; + c->loc.pos = oldpos; free(hi, M_TEMP); break; default: diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index 0540d60cccf..2c4e093bb7e 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -1,5 +1,5 @@ -/* $OpenBSD: if_aue.c,v 1.3 2000/04/04 22:52:29 aaron Exp $ */ -/* $NetBSD: if_aue.c,v 1.37 2000/04/02 21:25:41 augustss Exp $ */ +/* $OpenBSD: if_aue.c,v 1.4 2000/04/14 22:50:24 aaron Exp $ */ +/* $NetBSD: if_aue.c,v 1.38 2000/04/04 20:16:19 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. @@ -1134,8 +1134,13 @@ aue_intr(xfer, priv, status) if (status == USBD_NOT_STARTED || status == USBD_CANCELLED) { return; } - printf("%s: usb error on intr: %s\n", USBDEVNAME(sc->aue_dev), - usbd_errstr(status)); + sc->aue_intr_errs++; + if (usbd_ratecheck(&sc->aue_rx_notice)) { + printf("%s: %u usb errors on intr: %s\n", + USBDEVNAME(sc->aue_dev), sc->aue_rx_errs, + usbd_errstr(status)); + sc->aue_intr_errs = 0; + } if (status == USBD_STALLED) usbd_clear_endpoint_stall(sc->aue_ep[AUE_ENDPT_RX]); return; @@ -1175,15 +1180,6 @@ aue_rxstart(ifp) /* * A frame has been uploaded: pass the resulting mbuf chain up to * the higher level protocols. - * - * Grrr. Receiving transfers larger than about 1152 bytes sometimes - * doesn't work. We get an incomplete frame. In order to avoid - * this, we queue up RX transfers that are shorter than a full sized - * frame. If the received frame is larger than our transfer size, - * we snag the rest of the data using a second transfer. Does this - * hurt performance? Yes. But after fighting with this stupid thing - * for three days, I'm willing to settle. I'd rather have reliable - * receive performance that fast but spotty performance. */ Static void aue_rxeof(xfer, priv, status) diff --git a/sys/dev/usb/if_auereg.h b/sys/dev/usb/if_auereg.h index 00d7ef2ae5d..444866ab213 100644 --- a/sys/dev/usb/if_auereg.h +++ b/sys/dev/usb/if_auereg.h @@ -1,5 +1,5 @@ -/* $OpenBSD: if_auereg.h,v 1.1 2000/03/28 19:37:47 aaron Exp $ */ -/* $NetBSD: if_auereg.h,v 1.9 2000/03/24 22:13:23 augustss Exp $ */ +/* $OpenBSD: if_auereg.h,v 1.2 2000/04/14 22:50:25 aaron Exp $ */ +/* $NetBSD: if_auereg.h,v 1.12 2000/04/04 20:16:19 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. @@ -267,6 +267,7 @@ struct aue_softc { char aue_dying; char aue_attached; u_int aue_rx_errs; + u_int aue_intr_errs; struct timeval aue_rx_notice; }; diff --git a/sys/dev/usb/if_cuereg.h b/sys/dev/usb/if_cuereg.h index d9bdb8b1348..aa4715add9a 100644 --- a/sys/dev/usb/if_cuereg.h +++ b/sys/dev/usb/if_cuereg.h @@ -1,5 +1,5 @@ -/* $OpenBSD: if_cuereg.h,v 1.1 2000/03/28 19:37:47 aaron Exp $ */ -/* $NetBSD: if_cuereg.h,v 1.9 2000/03/24 22:13:24 augustss Exp $ */ +/* $OpenBSD: if_cuereg.h,v 1.2 2000/04/14 22:50:25 aaron Exp $ */ +/* $NetBSD: if_cuereg.h,v 1.11 2000/04/08 20:54:38 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. @@ -187,7 +187,6 @@ struct cue_softc { u_int16_t cue_product; int cue_ed[CUE_ENDPT_MAX]; usbd_pipe_handle cue_ep[CUE_ENDPT_MAX]; - int cue_unit; u_int8_t cue_mctab[CUE_MCAST_TABLE_LEN]; int cue_if_flags; u_int16_t cue_rxfilt; diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c index a79b2bf4668..df1b17926d4 100644 --- a/sys/dev/usb/ucom.c +++ b/sys/dev/usb/ucom.c @@ -1,8 +1,8 @@ -/* $OpenBSD: ucom.c,v 1.2 2000/04/08 20:03:33 aaron Exp $ */ -/* $NetBSD: ucom.c,v 1.16 2000/03/27 12:33:55 augustss Exp $ */ +/* $OpenBSD: ucom.c,v 1.3 2000/04/14 22:50:25 aaron Exp $ */ +/* $NetBSD: ucom.c,v 1.22 2000/04/14 14:21:55 augustss Exp $ */ /* - * Copyright (c) 1998 The NetBSD Foundation, Inc. + * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -37,6 +37,9 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ +/* + * This code is very heavily based on the 16550 driver, com.c. + */ #include #include @@ -80,14 +83,6 @@ int ucomdebug = 0; #define UCOMDIALOUT(x) (minor(x) & UCOMDIALOUT_MASK) #define UCOMCALLUNIT(x) (minor(x) & UCOMCALLUNIT_MASK) -/* - * These are the maximum number of bytes transferred per frame. - * If some really high speed devices should use this driver they - * may need to be increased, but this is good enough for modems. - */ -#define UCOMIBUFSIZE 64 -#define UCOMOBUFSIZE 256 - struct ucom_softc { USBBASEDEVICE sc_dev; /* base device */ @@ -99,11 +94,15 @@ struct ucom_softc { usbd_pipe_handle sc_bulkin_pipe; /* bulk in pipe */ usbd_xfer_handle sc_ixfer; /* read request */ u_char *sc_ibuf; /* read buffer */ + u_int sc_ibufsize; /* read buffer size */ + u_int sc_ibufsizepad; /* read buffer size padded */ int sc_bulkout_no; /* bulk out endpoint address */ usbd_pipe_handle sc_bulkout_pipe;/* bulk out pipe */ 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 */ struct ucom_methods *sc_methods; void *sc_parent; @@ -117,6 +116,7 @@ struct ucom_softc { int sc_swflags; u_char sc_opening; /* lock during open */ + int sc_refcnt; u_char sc_dying; /* disconnecting */ }; @@ -127,6 +127,8 @@ Static void ucom_hwiflow __P((struct ucom_softc *)); Static int ucomparam __P((struct tty *, struct termios *)); Static void ucomstart __P((struct tty *)); Static void ucom_shutdown __P((struct ucom_softc *)); +Static int ucom_do_ioctl __P((struct ucom_softc *, u_long, caddr_t, + int, struct proc *)); Static void ucom_dtr __P((struct ucom_softc *, int)); Static void ucom_rts __P((struct ucom_softc *, int)); Static void ucom_break __P((struct ucom_softc *, int)); @@ -159,6 +161,10 @@ USB_ATTACH(ucom) sc->sc_iface = uca->iface; sc->sc_bulkout_no = uca->bulkout; sc->sc_bulkin_no = uca->bulkin; + sc->sc_ibufsize = uca->ibufsize; + sc->sc_ibufsizepad = uca->ibufsizepad; + sc->sc_obufsize = uca->obufsize; + sc->sc_obufsizepad = uca->obufsizepad; sc->sc_methods = uca->methods; sc->sc_parent = uca->arg; sc->sc_portno = uca->portno; @@ -178,6 +184,7 @@ USB_DETACH(ucom) { struct ucom_softc *sc = (struct ucom_softc *)self; int maj, mn; + int s; DPRINTF(("ucom_detach: sc=%p flags=%d tp=%p\n", sc, flags, sc->sc_tty)); @@ -191,7 +198,13 @@ USB_DETACH(ucom) } #endif - /* XXX Use reference count? */ + s = splusb(); + if (--sc->sc_refcnt >= 0) { + /* Wake everyone.. how? */ + /* Wait for processes to go away. */ + usb_detach_wait(USBDEV(sc->sc_dev)); + } + splx(s); /* locate the major number */ for (maj = 0; maj < nchrdev; maj++) @@ -200,9 +213,10 @@ USB_DETACH(ucom) /* Nuke the vnodes for any open instances. */ mn = self->dv_unit; + DPRINTF(("ucom_detach: maj=%d mn=%d\n", maj, mn)); vdevgone(maj, mn, mn, VCHR); - vdevgone(maj, mn, mn | UCOMDIALOUT_MASK, VCHR); - vdevgone(maj, mn, mn | UCOMCALLUNIT_MASK, VCHR); + vdevgone(maj, mn | UCOMDIALOUT_MASK, mn | UCOMDIALOUT_MASK, VCHR); + vdevgone(maj, mn | UCOMCALLUNIT_MASK, mn | UCOMCALLUNIT_MASK, VCHR); /* Detach and free the tty. */ tty_detach(sc->sc_tty); @@ -291,6 +305,11 @@ ucomopen(dev, flag, mode, p) */ while (sc->sc_opening) tsleep(&sc->sc_opening, PRIBIO, "ucomop", 0); + + if (sc->sc_dying) { + splx(s); + return (EIO); + } sc->sc_opening = 1; #if defined(__NetBSD__) @@ -302,6 +321,15 @@ ucomopen(dev, flag, mode, p) tp->t_dev = dev; + if (sc->sc_methods->ucom_open != NULL) { + error = sc->sc_methods->ucom_open(sc->sc_parent, + sc->sc_portno); + if (error) { + ucom_cleanup(sc); + return (error); + } + } + ucom_status_change(sc); /* @@ -367,7 +395,8 @@ ucomopen(dev, flag, mode, p) usbd_close_pipe(sc->sc_bulkout_pipe); return (ENOMEM); } - sc->sc_ibuf = usbd_alloc_buffer(sc->sc_ixfer, UCOMIBUFSIZE); + sc->sc_ibuf = usbd_alloc_buffer(sc->sc_ixfer, + sc->sc_ibufsizepad); if (sc->sc_ibuf == NULL) { usbd_free_xfer(sc->sc_ixfer); usbd_close_pipe(sc->sc_bulkin_pipe); @@ -382,7 +411,8 @@ ucomopen(dev, flag, mode, p) usbd_close_pipe(sc->sc_bulkout_pipe); return (ENOMEM); } - sc->sc_obuf = usbd_alloc_buffer(sc->sc_oxfer, UCOMOBUFSIZE); + sc->sc_obuf = usbd_alloc_buffer(sc->sc_oxfer, + sc->sc_obufsizepad); if (sc->sc_obuf == NULL) { usbd_free_xfer(sc->sc_oxfer); usbd_free_xfer(sc->sc_ixfer); @@ -391,9 +421,6 @@ ucomopen(dev, flag, mode, p) return (ENOMEM); } - if (sc->sc_methods->ucom_open != NULL) - sc->sc_methods->ucom_open(sc->sc_parent, sc->sc_portno); - ucomstartread(sc); } sc->sc_opening = 0; @@ -443,12 +470,11 @@ ucomclose(dev, flag, mode, p) if (!ISSET(tp->t_state, TS_ISOPEN)) return (0); + sc->sc_refcnt++; + (*linesw[tp->t_line].l_close)(tp, flag); ttyclose(tp); - if (sc->sc_dying) - return (0); - #if defined(__NetBSD__) if (!ISSET(tp->t_state, TS_ISOPEN) && tp->t_wopen == 0) { #else @@ -465,6 +491,9 @@ ucomclose(dev, flag, mode, p) if (sc->sc_methods->ucom_close != NULL) sc->sc_methods->ucom_close(sc->sc_parent, sc->sc_portno); + if (--sc->sc_refcnt < 0) + usb_detach_wakeup(USBDEV(sc->sc_dev)); + return (0); } @@ -476,11 +505,16 @@ ucomread(dev, uio, flag) { struct ucom_softc *sc = ucom_cd.cd_devs[UCOMUNIT(dev)]; struct tty *tp = sc->sc_tty; + int error; if (sc->sc_dying) return (EIO); - return ((*linesw[tp->t_line].l_read)(tp, uio, flag)); + sc->sc_refcnt++; + error = ((*linesw[tp->t_line].l_read)(tp, uio, flag)); + if (--sc->sc_refcnt < 0) + usb_detach_wakeup(USBDEV(sc->sc_dev)); + return (error); } int @@ -491,11 +525,16 @@ ucomwrite(dev, uio, flag) { struct ucom_softc *sc = ucom_cd.cd_devs[UCOMUNIT(dev)]; struct tty *tp = sc->sc_tty; + int error; if (sc->sc_dying) return (EIO); - return ((*linesw[tp->t_line].l_write)(tp, uio, flag)); + sc->sc_refcnt++; + error = ((*linesw[tp->t_line].l_write)(tp, uio, flag)); + if (--sc->sc_refcnt < 0) + usb_detach_wakeup(USBDEV(sc->sc_dev)); + return (error); } struct tty * @@ -517,6 +556,23 @@ ucomioctl(dev, cmd, data, flag, p) struct proc *p; { struct ucom_softc *sc = ucom_cd.cd_devs[UCOMUNIT(dev)]; + int error; + + sc->sc_refcnt++; + error = ucom_do_ioctl(sc, cmd, data, flag, p); + if (--sc->sc_refcnt < 0) + usb_detach_wakeup(USBDEV(sc->sc_dev)); + return (error); +} + +Static int +ucom_do_ioctl(sc, cmd, data, flag, p) + struct ucom_softc *sc; + u_long cmd; + caddr_t data; + int flag; + struct proc *p; +{ struct tty *tp = sc->sc_tty; int error; int s; @@ -594,7 +650,7 @@ ucomioctl(dev, cmd, data, flag, p) return (error); } -void +Static void tiocm_to_ucom(sc, how, ttybits) struct ucom_softc *sc; int how, ttybits; @@ -626,7 +682,7 @@ tiocm_to_ucom(sc, how, ttybits) ucom_rts(sc, (sc->sc_mcr & UMCR_RTS) != 0); } -int +Static int ucom_to_tiocm(sc) struct ucom_softc *sc; { @@ -658,7 +714,7 @@ XXX; return (ttybits); } -void +Static void ucom_break(sc, onoff) struct ucom_softc *sc; int onoff; @@ -670,7 +726,7 @@ ucom_break(sc, onoff) UCOM_SET_BREAK, onoff); } -void +Static void ucom_dtr(sc, onoff) struct ucom_softc *sc; int onoff; @@ -682,7 +738,7 @@ ucom_dtr(sc, onoff) UCOM_SET_DTR, onoff); } -void +Static void ucom_rts(sc, onoff) struct ucom_softc *sc; int onoff; @@ -707,7 +763,7 @@ ucom_status_change(sc) } } -int +Static int ucomparam(tp, t) struct tty *tp; struct termios *t; @@ -780,10 +836,11 @@ XXX what if the hardware is not open /* * (un)block input via hw flowcontrol */ -void +Static void ucom_hwiflow(sc) struct ucom_softc *sc; { + DPRINTF(("ucom_hwiflow:\n")); #if 0 XXX bus_space_tag_t iot = sc->sc_iot; @@ -803,7 +860,7 @@ XXX #endif } -void +Static void ucomstart(tp) struct tty *tp; { @@ -818,7 +875,7 @@ ucomstart(tp) s = spltty(); if (ISSET(tp->t_state, TS_BUSY | TS_TIMEOUT | TS_TTSTOP)) { - DPRINTFN(4,("ucomstart: stopped\n")); + DPRINTFN(4,("ucomstart: no go, state=0x%x\n", tp->t_state)); goto out; } if (sc->sc_tx_stopped) @@ -845,11 +902,15 @@ ucomstart(tp) SET(tp->t_state, TS_BUSY); - if (cnt > UCOMOBUFSIZE) { + if (cnt > sc->sc_obufsize) { DPRINTF(("ucomstart: big buffer %d chars\n", cnt)); - cnt = UCOMOBUFSIZE; + cnt = sc->sc_obufsize; } - memcpy(sc->sc_obuf, data, cnt); + if (sc->sc_methods->ucom_write != NULL) + sc->sc_methods->ucom_write(sc->sc_parent, sc->sc_portno, + sc->sc_obuf, data, &cnt); + else + memcpy(sc->sc_obuf, data, cnt); DPRINTFN(4,("ucomstart: %d chars\n", cnt)); usbd_setup_xfer(sc->sc_oxfer, sc->sc_bulkout_pipe, @@ -875,25 +936,26 @@ ucomstop(tp, flag) struct tty *tp; int flag; { - struct ucom_softc *sc = ucom_cd.cd_devs[UCOMUNIT(tp->t_dev)]; + DPRINTF(("ucomstop: flag=%d\n", flag)); +#if 0 + /*struct ucom_softc *sc = ucom_cd.cd_devs[UCOMUNIT(tp->t_dev)];*/ int s; - DPRINTF(("ucomstop: %d\n", flag)); s = spltty(); if (ISSET(tp->t_state, TS_BUSY)) { DPRINTF(("ucomstop: XXX\n")); - sc->sc_tx_stopped = 1; + /* sc->sc_tx_stopped = 1; */ if (!ISSET(tp->t_state, TS_TTSTOP)) SET(tp->t_state, TS_FLUSH); } splx(s); - +#endif #if !defined(__NetBSD__) return 0; #endif } -void +Static void ucomwritecb(xfer, p, status) usbd_xfer_handle xfer; usbd_private_handle p; @@ -929,7 +991,7 @@ ucomwritecb(xfer, p, status) splx(s); } -usbd_status +Static usbd_status ucomstartread(sc) struct ucom_softc *sc; { @@ -938,7 +1000,7 @@ ucomstartread(sc) DPRINTFN(5,("ucomstartread: start\n")); usbd_setup_xfer(sc->sc_ixfer, sc->sc_bulkin_pipe, (usbd_private_handle)sc, - sc->sc_ibuf, UCOMIBUFSIZE, + sc->sc_ibuf, sc->sc_ibufsize, USBD_SHORT_XFER_OK | USBD_NO_COPY, USBD_NO_TIMEOUT, ucomreadcb); err = usbd_transfer(sc->sc_ixfer); @@ -949,7 +1011,7 @@ ucomstartread(sc) return (USBD_NORMAL_COMPLETION); } -void +Static void ucomreadcb(xfer, p, status) usbd_xfer_handle xfer; usbd_private_handle p; @@ -975,12 +1037,18 @@ ucomreadcb(xfer, p, status) usbd_get_xfer_status(xfer, NULL, (void **)&cp, &cc, NULL); DPRINTFN(5,("ucomreadcb: got %d chars, tp=%p\n", cc, tp)); + if (sc->sc_methods->ucom_read != NULL) + sc->sc_methods->ucom_read(sc->sc_parent, sc->sc_portno, + &cp, &cc); + s = spltty(); /* Give characters to tty layer. */ while (cc-- > 0) { DPRINTFN(7,("ucomreadcb: char=0x%02x\n", *cp)); if ((*rint)(*cp++, tp) == -1) { /* XXX what should we do? */ + printf("%s: lost %d chars\n", USBDEVNAME(sc->sc_dev), + cc); break; } } @@ -993,7 +1061,7 @@ ucomreadcb(xfer, p, status) } } -void +Static void ucom_cleanup(sc) struct ucom_softc *sc; { diff --git a/sys/dev/usb/ucomvar.h b/sys/dev/usb/ucomvar.h index 78803cf9970..20b7f162690 100644 --- a/sys/dev/usb/ucomvar.h +++ b/sys/dev/usb/ucomvar.h @@ -1,5 +1,5 @@ -/* $OpenBSD: ucomvar.h,v 1.2 2000/04/12 16:19:12 aaron Exp $ */ -/* $NetBSD: ucomvar.h,v 1.2 2000/02/08 09:18:02 augustss Exp $ */ +/* $OpenBSD: ucomvar.h,v 1.3 2000/04/14 22:50:25 aaron Exp $ */ +/* $NetBSD: ucomvar.h,v 1.5 2000/04/14 14:21:55 augustss Exp $ */ /* * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ #define CLR(t, f) (t) &= ~(f) #define ISSET(t, f) ((t) & (f)) -#if !defined(__OpenBSD__) +#if defined(__NetBSD__) #include "locators.h" #endif @@ -63,8 +63,12 @@ struct ucom_methods { int (*ucom_param)__P((void *sc, int portno, struct termios *)); int (*ucom_ioctl)__P((void *sc, int portno, u_long cmd, caddr_t data, int flag, struct proc *p)); - void (*ucom_open)__P((void *sc, int portno)); + int (*ucom_open)__P((void *sc, int portno)); void (*ucom_close)__P((void *sc, int portno)); + void (*ucom_read)__P((void *sc, int portno, u_char **ptr, + u_int32_t *count)); + void (*ucom_write)__P((void *sc, int portno, u_char *to, u_char *from, + u_int32_t *count)); }; /* modem control register */ @@ -97,6 +101,10 @@ struct ucom_attach_args { int portno; int bulkin; int bulkout; + u_int ibufsize; + u_int ibufsizepad; + u_int obufsize; + u_int obufsizepad; usbd_device_handle device; usbd_interface_handle iface; struct ucom_methods *methods; @@ -105,8 +113,8 @@ struct ucom_attach_args { int ucomprint __P((void *aux, const char *pnp)); #if defined(__OpenBSD__) -int ucomsubmatch __P((struct device *parent, void *cf, void *aux)); +int ucomsubmatch __P((struct device *parent, void *match, void *aux)); #else int ucomsubmatch __P((struct device *parent, struct cfdata *cf, void *aux)); #endif -void ucom_status_change __P((struct ucom_softc *sc)); +void ucom_status_change __P((struct ucom_softc *)); diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c index 23c8921ac92..e28400a8034 100644 --- a/sys/dev/usb/uhci.c +++ b/sys/dev/usb/uhci.c @@ -1,5 +1,5 @@ -/* $OpenBSD: uhci.c,v 1.11 2000/03/30 16:19:33 aaron Exp $ */ -/* $NetBSD: uhci.c,v 1.108 2000/03/29 18:55:36 augustss Exp $ */ +/* $OpenBSD: uhci.c,v 1.12 2000/04/14 22:50:25 aaron Exp $ */ +/* $NetBSD: uhci.c,v 1.110 2000/04/14 14:11:36 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */ /* @@ -252,12 +252,14 @@ Static __inline__ uhci_soft_qh_t *uhci_find_prev_qh __P((uhci_soft_qh_t *, uhci_soft_qh_t *)); #ifdef UHCI_DEBUG +Static void uhci_dump_all __P((uhci_softc_t *)); Static void uhci_dumpregs __P((uhci_softc_t *)); Static void uhci_dump_qhs __P((uhci_soft_qh_t *)); Static void uhci_dump_qh __P((uhci_soft_qh_t *)); Static void uhci_dump_tds __P((uhci_soft_td_t *)); Static void uhci_dump_td __P((uhci_soft_td_t *)); Static void uhci_dump_ii __P((uhci_intr_info_t *ii)); +Static void uhci_dump __P((void)); #endif #define UWRITE1(sc, r, x) bus_space_write_1((sc)->iot, (sc)->ioh, (r), (x)) @@ -354,7 +356,7 @@ uhci_find_prev_qh(pqh, sqh) for (; pqh->hlink != sqh; pqh = pqh->hlink) { #if defined(DIAGNOSTIC) || defined(UHCI_DEBUG) if (le32toh(pqh->qh.qh_hlink) & UHCI_PTR_T) { - printf("uhci_find_qh: QH not found\n"); + printf("uhci_find_prev_qh: QH not found\n"); return (NULL); } #endif @@ -585,7 +587,7 @@ uhci_allocx(bus) SIMPLEQ_REMOVE_HEAD(&sc->sc_free_xfers, xfer, next); #ifdef DIAGNOSTIC if (xfer->busy_free != XFER_FREE) { - printf("uhci_freex: xfer=%p not free, 0x%08x\n", xfer, + printf("uhci_allocx: xfer=%p not free, 0x%08x\n", xfer, xfer->busy_free); } #endif @@ -644,7 +646,7 @@ uhci_shutdown(v) * Handle suspend/resume. * * We need to switch to polling mode here, because this routine is - * called from an intterupt context. This is all right since we + * called from an interrupt context. This is all right since we * are almost suspended anyway. */ void @@ -771,18 +773,23 @@ uhci_dump_qh(sqh) } -#if 0 +#if 1 void uhci_dump() { - uhci_softc_t *sc = thesc; + uhci_dump_all(thesc); +} +#endif +void +uhci_dump_all(sc) + uhci_softc_t *sc; +{ uhci_dumpregs(sc); printf("intrs=%d\n", sc->sc_bus.no_intrs); - printf("framelist[i].link = %08x\n", sc->sc_framelist[0].link); - uhci_dump_qh(sc->sc_ctl_start->qh.hlink); + /*printf("framelist[i].link = %08x\n", sc->sc_framelist[0].link);*/ + uhci_dump_qh(sc->sc_ctl_start); } -#endif void @@ -1063,6 +1070,10 @@ uhci_intr(arg) printf("%s: host controller halted\n", USBDEVNAME(sc->sc_bus.bdev)); sc->sc_dying = 1; +#ifdef UHCI_DEBUG + uhci_dump_all(sc); +#endif + } if (ack) /* acknowledge the ints */ diff --git a/sys/dev/usb/uhcireg.h b/sys/dev/usb/uhcireg.h index caf07cc2d6a..3fca982be06 100644 --- a/sys/dev/usb/uhcireg.h +++ b/sys/dev/usb/uhcireg.h @@ -1,5 +1,5 @@ -/* $OpenBSD: uhcireg.h,v 1.4 2000/03/28 19:37:49 aaron Exp $ */ -/* $NetBSD: uhcireg.h,v 1.9 1999/11/20 00:57:09 augustss Exp $ */ +/* $OpenBSD: uhcireg.h,v 1.5 2000/04/14 22:50:26 aaron Exp $ */ +/* $NetBSD: uhcireg.h,v 1.10 2000/04/06 23:44:21 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhcireg.h,v 1.12 1999/11/17 22:33:42 n_hibma Exp $ */ /* @@ -119,8 +119,8 @@ typedef u_int32_t uhci_physaddr_t; #define UHCI_PTR_VF 0x00000004 /* - * The Queue Heads and Transfer Descriptors and accessed - * by both the CPU and the USB controller which runs + * The Queue Heads and Transfer Descriptors are accessed + * by both the CPU and the USB controller which run * concurrently. This means that they have to be accessed * with great care. As long as the data structures are * not linked into the controller's frame list they cannot diff --git a/sys/dev/usb/uhcivar.h b/sys/dev/usb/uhcivar.h index 7c30f652b90..07c704cbbab 100644 --- a/sys/dev/usb/uhcivar.h +++ b/sys/dev/usb/uhcivar.h @@ -1,5 +1,5 @@ -/* $OpenBSD: uhcivar.h,v 1.7 2000/03/28 19:37:49 aaron Exp $ */ -/* $NetBSD: uhcivar.h,v 1.27 2000/03/25 18:02:33 augustss Exp $ */ +/* $OpenBSD: uhcivar.h,v 1.8 2000/04/14 22:50:26 aaron Exp $ */ +/* $NetBSD: uhcivar.h,v 1.28 2000/04/06 23:44:21 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhcivar.h,v 1.14 1999/11/17 22:33:42 n_hibma Exp $ */ /* @@ -42,13 +42,14 @@ /* * To avoid having 1024 TDs for each isochronous transfer we introduce * a virtual frame list. Every UHCI_VFRAMELIST_COUNT entries in the real - * frame list points to a non-active TD. These, in turn, which form the + * frame list points to a non-active TD. These, in turn, form the * starts of the virtual frame list. This also has the advantage that it - * simplifies linking in/out TD/QH in the schedule. + * simplifies linking in/out of TDs/QHs in the schedule. * Furthermore, initially each of the inactive TDs point to an inactive * QH that forms the start of the interrupt traffic for that slot. * Each of these QHs point to the same QH that is the start of control - * traffic. + * traffic. This QH points at another QH which is the start of the + * bulk traffic. * * UHCI_VFRAMELIST_COUNT should be a power of 2 and <= UHCI_FRAMELIST_COUNT. */ @@ -161,8 +162,8 @@ typedef struct uhci_softc { LIST_HEAD(, uhci_intr_info) sc_intrhead; - /* Info for the root hub interrupt channel. */ - int sc_ival; /* time between root hug intrs */ + /* Info for the root hub interrupt "pipe". */ + int sc_ival; /* time between root hub intrs */ usbd_xfer_handle sc_intr_xfer; /* root hub interrupt transfer */ usb_callout_t sc_poll_handle; @@ -172,7 +173,7 @@ typedef struct uhci_softc { void *sc_powerhook; /* cookie from power hook */ void *sc_shutdownhook; /* cookie from shutdown hook */ - device_ptr_t sc_child; /* /dev/usb device */ + device_ptr_t sc_child; /* /dev/usb# device */ } uhci_softc_t; usbd_status uhci_init __P((uhci_softc_t *)); diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c index f36e6ce6d21..a5f7eecdbe4 100644 --- a/sys/dev/usb/uhid.c +++ b/sys/dev/usb/uhid.c @@ -1,5 +1,5 @@ -/* $OpenBSD: uhid.c,v 1.9 2000/03/30 16:19:33 aaron Exp $ */ -/* $NetBSD: uhid.c,v 1.36 2000/03/27 12:33:56 augustss Exp $ */ +/* $OpenBSD: uhid.c,v 1.10 2000/04/14 22:50:26 aaron Exp $ */ +/* $NetBSD: uhid.c,v 1.37 2000/04/14 14:12:47 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhid.c,v 1.22 1999/11/17 22:33:43 n_hibma Exp $ */ /* @@ -47,6 +47,7 @@ #include #include #include +#include #if defined(__NetBSD__) || defined(__OpenBSD__) #include #include @@ -104,6 +105,7 @@ struct uhid_softc { struct clist sc_q; struct selinfo sc_rsel; + struct proc *sc_async; /* process that wants SIGIO */ u_char sc_state; /* driver state */ #define UHID_OPEN 0x01 /* device is open */ #define UHID_ASLP 0x02 /* waiting for device data */ @@ -357,6 +359,10 @@ uhid_intr(xfer, addr, status) wakeup(&sc->sc_q); } selwakeup(&sc->sc_rsel); + if (sc->sc_async != NULL) { + DPRINTFN(3, ("uhid_intr: sending SIGIO %p\n", sc->sc_async)); + psignal(sc->sc_async, SIGIO); + } } int @@ -403,6 +409,8 @@ uhidopen(dev, flag, mode, p) sc->sc_state &= ~UHID_IMMED; + sc->sc_async = 0; + return (0); } @@ -431,6 +439,8 @@ uhidclose(dev, flag, mode, p) sc->sc_state &= ~UHID_OPEN; + sc->sc_async = 0; + return (0); } @@ -592,6 +602,24 @@ uhid_do_ioctl(sc, cmd, addr, flag, p) /* All handled in the upper FS layer. */ break; + case FIOASYNC: + if (*(int *)addr) { + if (sc->sc_async != NULL) + return (EBUSY); + sc->sc_async = p; + DPRINTF(("uhid_do_ioctl: FIOASYNC %p\n", p)); + } else + sc->sc_async = NULL; + break; + + /* XXX this is not the most general solution. */ + case TIOCSPGRP: + if (sc->sc_async == NULL) + return (EINVAL); + if (*(int *)addr != sc->sc_async->p_pgid) + return (EPERM); + break; + case USB_GET_REPORT_DESC: rd = (struct usb_ctl_report_desc *)addr; size = min(sc->sc_repdesc_size, sizeof rd->data); diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c index 5ed4f0e9eb0..547de7c2da2 100644 --- a/sys/dev/usb/ulpt.c +++ b/sys/dev/usb/ulpt.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ulpt.c,v 1.2 2000/03/30 16:19:33 aaron Exp $ */ -/* $NetBSD: ulpt.c,v 1.35 2000/03/29 18:24:53 augustss Exp $ */ +/* $OpenBSD: ulpt.c,v 1.3 2000/04/14 22:50:27 aaron Exp $ */ +/* $NetBSD: ulpt.c,v 1.36 2000/04/14 14:12:11 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.24 1999/11/17 22:33:44 n_hibma Exp $ */ /* @@ -220,7 +220,7 @@ USB_ATTACH(ulpt) #if 0 /* - * This code is disabled because for some mysterious it causes + * This code is disabled because for some mysterious reason it causes * printing not to work. But only sometimes, and mostly with * UHCI and less often with OHCI. *sigh* */ diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 86381953196..d00ef26e983 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -1,5 +1,5 @@ -/* $OpenBSD: umass.c,v 1.5 2000/04/08 20:28:07 csapuntz Exp $ */ -/* $NetBSD: umass.c,v 1.31 2000/04/03 12:31:34 augustss Exp $ */ +/* $OpenBSD: umass.c,v 1.6 2000/04/14 22:50:28 aaron Exp $ */ +/* $NetBSD: umass.c,v 1.33 2000/04/06 13:52:04 augustss Exp $ */ /*- * Copyright (c) 1999 MAEKAWA Masahide , * Nick Hibma @@ -787,6 +787,7 @@ USB_ATTACH(umass) USB_ATTACH_START(umass, sc, uaa); usb_interface_descriptor_t *id; usb_endpoint_descriptor_t *ed; + const char *sSubclass, *sProto; char devinfo[1024]; int i, bno; int err; @@ -817,36 +818,45 @@ USB_ATTACH(umass) id = usbd_get_interface_descriptor(sc->iface); printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); - printf("%s: using ", USBDEVNAME(sc->sc_dev)); - switch (sc->proto & PROTO_COMMAND) { - case PROTO_SCSI: - printf("SCSI"); + switch (id->bInterfaceSubClass) { + case UISUBCLASS_SCSI: + sSubclass = "SCSI"; break; - case PROTO_8070: - printf("8070i"); + case UISUBCLASS_UFI: + sSubclass = "UFI"; break; - case PROTO_UFI: - printf("UFI"); + case UISUBCLASS_SFF8020I: + sSubclass = "SFF8020i"; + break; + case UISUBCLASS_SFF8070I: + sSubclass = "SFF8070i"; + break; + case UISUBCLASS_QIC157: + sSubclass = "QIC157"; break; default: - printf("(unknown 0x%02x)", sc->proto&PROTO_COMMAND); + sSubclass = "unknown"; break; } - printf(" over "); - switch (sc->proto & PROTO_WIRE) { - case PROTO_BBB: - printf("Bulk-Only"); + switch (id->bInterfaceProtocol) { + case UIPROTO_MASS_CBI: + sProto = "CBI"; break; - case PROTO_CBI: /* uses Command/Bulk pipes */ - printf("CBI"); + case UIPROTO_MASS_CBI_I: + sProto = "CBI-I"; break; - case PROTO_CBI_I: /* uses Command/Bulk/Interrupt pipes */ - printf("CBI with CCI"); + case UIPROTO_MASS_BBB: + sProto = "BBB"; + break; + case UIPROTO_MASS_BBB_P: + sProto = "BBB-P"; break; default: - printf("(unknown 0x%02x)", sc->proto&PROTO_WIRE); + sProto = "unknown"; + break; } - printf("\n"); + printf("%s: using %s over %s\n", USBDEVNAME(sc->sc_dev), sSubclass, + sProto); /* * In addition to the Control endpoint the following endpoints diff --git a/sys/dev/usb/umodem.c b/sys/dev/usb/umodem.c index 309855764b4..9e1df7f8509 100644 --- a/sys/dev/usb/umodem.c +++ b/sys/dev/usb/umodem.c @@ -1,5 +1,5 @@ -/* $OpenBSD: umodem.c,v 1.2 2000/04/08 20:03:34 aaron Exp $ */ -/* $NetBSD: umodem.c,v 1.25 2000/03/27 12:33:57 augustss Exp $ */ +/* $OpenBSD: umodem.c,v 1.3 2000/04/14 22:50:28 aaron Exp $ */ +/* $NetBSD: umodem.c,v 1.27 2000/04/14 14:21:55 augustss Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -82,6 +82,14 @@ int umodemdebug = 0; #endif #define DPRINTF(x) DPRINTFN(0, x) +/* + * These are the maximum number of bytes transferred per frame. + * If some really high speed devices should use this driver they + * may need to be increased, but this is good enough for normal modems. + */ +#define UMODEMIBUFSIZE 64 +#define UMODEMOBUFSIZE 256 + struct umodem_softc { USBBASEDEVICE sc_dev; /* base device */ @@ -134,6 +142,8 @@ Static struct ucom_methods umodem_methods = { umodem_ioctl, NULL, NULL, + NULL, + NULL, }; USB_DECLARE_DRIVER(umodem); @@ -267,6 +277,10 @@ USB_ATTACH(umodem) uca.portno = UCOM_UNK_PORTNO; /* bulkin, bulkout set above */ + uca.ibufsize = UMODEMIBUFSIZE; + uca.obufsize = UMODEMOBUFSIZE; + uca.ibufsizepad = UMODEMIBUFSIZE; + uca.obufsizepad = UMODEMOBUFSIZE; uca.device = sc->sc_udev; uca.iface = sc->sc_data_iface; uca.methods = &umodem_methods; @@ -480,6 +494,7 @@ void umodem_set(addr, portno, reg, onoff) void *addr; int portno; + int reg; int onoff; { struct umodem_softc *sc = addr; diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c index 0f41f19c5a3..984750fcbeb 100644 --- a/sys/dev/usb/usb_subr.c +++ b/sys/dev/usb/usb_subr.c @@ -1,5 +1,5 @@ -/* $OpenBSD: usb_subr.c,v 1.10 2000/04/08 20:55:41 aaron Exp $ */ -/* $NetBSD: usb_subr.c,v 1.71 2000/03/29 18:24:53 augustss Exp $ */ +/* $OpenBSD: usb_subr.c,v 1.11 2000/04/14 22:50:28 aaron Exp $ */ +/* $NetBSD: usb_subr.c,v 1.72 2000/04/14 14:13:56 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */ /* @@ -769,8 +769,8 @@ usbd_probe_and_attach(parent, dev, port, addr) #endif uaa.device = dev; - uaa.iface = 0; - uaa.ifaces = 0; + uaa.iface = NULL; + uaa.ifaces = NULL; uaa.nifaces = 0; uaa.usegeneric = 0; uaa.port = port; @@ -873,13 +873,10 @@ usbd_probe_and_attach(parent, dev, port, addr) DPRINTF(("usbd_probe_and_attach: no interface drivers found\n")); /* Finally try the generic driver. */ - uaa.iface = 0; + uaa.iface = NULL; uaa.usegeneric = 1; uaa.configno = UHUB_UNK_CONFIGURATION; uaa.ifaceno = UHUB_UNK_INTERFACE; - uaa.vendor = UHUB_UNK_VENDOR; - uaa.product = UHUB_UNK_PRODUCT; - uaa.release = UHUB_UNK_RELEASE; dv = USB_DO_ATTACH(dev, bdev, parent, &uaa, usbd_print, usbd_submatch); if (dv != NULL) { dev->subdevs = malloc(2 * sizeof dv, M_USB, M_NOWAIT); @@ -924,8 +921,8 @@ usbd_new_device(parent, bus, depth, lowspeed, port, up) int addr; int i; - DPRINTF(("usbd_new_device bus=%p depth=%d lowspeed=%d\n", - bus, depth, lowspeed)); + DPRINTF(("usbd_new_device bus=%p port=%d depth=%d lowspeed=%d\n", + bus, port, depth, lowspeed)); addr = usbd_getnewaddr(bus); if (addr < 0) { printf("%s: No free USB addresses, new device ignored.\n", @@ -1136,24 +1133,34 @@ usbd_submatch(parent, match, aux) #endif struct usb_attach_arg *uaa = aux; - if ((uaa->port != 0 && - cf->uhubcf_port != UHUB_UNK_PORT && - cf->uhubcf_port != uaa->port) || - (uaa->configno != UHUB_UNK_CONFIGURATION && - cf->uhubcf_configuration != UHUB_UNK_CONFIGURATION && - cf->uhubcf_configuration != uaa->configno) || - (uaa->ifaceno != UHUB_UNK_INTERFACE && - cf->uhubcf_interface != UHUB_UNK_INTERFACE && - cf->uhubcf_interface != uaa->ifaceno) || - (uaa->vendor != UHUB_UNK_VENDOR && - cf->uhubcf_vendor != UHUB_UNK_VENDOR && - cf->uhubcf_vendor != uaa->vendor) || - (uaa->product != UHUB_UNK_PRODUCT && - cf->uhubcf_product != UHUB_UNK_PRODUCT && - cf->uhubcf_product != uaa->product) || - (uaa->release != UHUB_UNK_RELEASE && - cf->uhubcf_release != UHUB_UNK_RELEASE && - cf->uhubcf_release != uaa->release) + DPRINTFN(5,("usbd_submatch port=%d,%d configno=%d,%d " + "ifaceno=%d,%d vendor=%d,%d product=%d,%d release=%d,%d\n", + uaa->port, cf->uhubcf_port, + uaa->configno, cf->uhubcf_configuration, + uaa->ifaceno, cf->uhubcf_interface, + uaa->vendor, cf->uhubcf_vendor, + uaa->product, cf->uhubcf_product, + uaa->release, cf->uhubcf_release)); + if (uaa->port != 0 && /* root hub has port 0, it should match */ + ((uaa->port != 0 && + cf->uhubcf_port != UHUB_UNK_PORT && + cf->uhubcf_port != uaa->port) || + (uaa->configno != UHUB_UNK_CONFIGURATION && + cf->uhubcf_configuration != UHUB_UNK_CONFIGURATION && + cf->uhubcf_configuration != uaa->configno) || + (uaa->ifaceno != UHUB_UNK_INTERFACE && + cf->uhubcf_interface != UHUB_UNK_INTERFACE && + cf->uhubcf_interface != uaa->ifaceno) || + (uaa->vendor != UHUB_UNK_VENDOR && + cf->uhubcf_vendor != UHUB_UNK_VENDOR && + cf->uhubcf_vendor != uaa->vendor) || + (uaa->product != UHUB_UNK_PRODUCT && + cf->uhubcf_product != UHUB_UNK_PRODUCT && + cf->uhubcf_product != uaa->product) || + (uaa->release != UHUB_UNK_RELEASE && + cf->uhubcf_release != UHUB_UNK_RELEASE && + cf->uhubcf_release != uaa->release) + ) ) return 0; return ((*cf->cf_attach->ca_match)(parent, cf, aux)); diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index b85ef220374..148f92c182b 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -1,4 +1,4 @@ -$OpenBSD: usbdevs,v 1.18 2000/04/11 19:03:19 jakob Exp $ +$OpenBSD: usbdevs,v 1.19 2000/04/14 22:50:29 aaron Exp $ /* $NetBSD: usbdevs,v 1.88 2000/04/03 12:09:43 augustss Exp $ */ /* @@ -47,7 +47,7 @@ vendor ATMEL 0x03eb Atmel Corp. vendor HP 0x03f0 Hewlett Packard vendor ADAPTEC 0x03f3 Adaptec, Inc. vendor ACERLABS 0x0402 Acer Labs, Inc. -vendor FUTURE 0x0403 Future Technology Devices +vendor FTDI 0x0403 Future Technology Devices vendor NEC 0x0409 NEC vendor KODAK 0x040a Eastman Kodak Corp. vendor MELCO 0x0411 Melco, Inc. @@ -147,6 +147,7 @@ vendor LINKSYS 0x066b Linksys, Inc. vendor ACERSA 0x066e Acer Semiconductor America, Inc. vendor AIWA 0x0677 Aiwa Co., Ltd. vendor ACARD 0x0678 ACARD Technology Corp. +vendor PROLIFIC 0x067b Prolific Technology Inc. vendor ADVANCELOGIC 0x0680 Avance Logic, Inc. vendor ASKEY 0x069a Askey Computer Corp. vendor ALCATELT 0x06b9 Alcatel Telecom @@ -322,6 +323,7 @@ product COREGA FETHER_USB_TX 0x0004 FEther USB-TX /* Cypress Semiconductor products */ product CYPRESS MOUSE 0x0001 mouse product CYPRESS THERMO 0x0002 thermometer +product CYPRESS FMRADIO 0x1002 FM Radio /* D-Link products */ /*product DLINK DSBS25 0x0100 DSB-S25 serial adapter*/ @@ -373,7 +375,7 @@ product GRAVIS GAMEPADPRO 0x4001 GamePad Pro product FREECOM DVD 0xfc01 Connector for DVD drive /* Future Technology Devices products */ -product FUTURE SERIAL 0x8372 Serial converter +product FTDI SERIAL 0x8372 Serial converter /* Handspring, Inc. */ product HANDSPRING VISOR 0x0100 Handspring Visor @@ -395,7 +397,8 @@ product INSIDEOUT EDGEPORT4 0x0001 EdgePort/4 serial ports /* In-System products */ product INSYSTEM F5U002 0x0002 Parallel printer adapter -product INSYSTEM ISD110 0x0200 IDE adapter +product INSYSTEM ISD110 0x0200 IDE adapter ISD110 +product INSYSTEM ISD105 0x0202 IDE adapter ISD105 /* Intel products */ product INTEL TESTBOARD 0x9890 82930 test board @@ -515,7 +518,6 @@ product PHILIPS DSS350 0x0101 DSS 350 Digital Speaker System product PHILIPS DSS 0x0104 DSS XXX Digital Speaker System product PHILIPS HUB 0x0201 hub product PHILIPS DSS150 0x0471 DSS 150 Digital Speaker System -product PHILIPS PCVC680K 0x0308 PCVC680K Vesta Pro PC Camera /* P.I. Engineering products */ product PIENGINEERING PS2USB 0x020b PS2 to Mac USB Adapter @@ -528,6 +530,10 @@ product PRIMAX COMFORT 0x4d01 Comfort product PRIMAX MOUSEINABOX 0x4d02 Mouse-in-a-Box product PRIMAX PCGAUMS1 0x4d04 Sony PCGA-UMS1 +/* Prolific products */ +product PROLIFIC PL2301 0x0000 PL2301 Host-Host interface +product PROLIFIC PL2302 0x0001 PL2302 Host-Host interface + /* Quickshot products */ product QUICKSHOT STRIKEPAD 0x6238 USB StrikePad diff --git a/sys/dev/usb/usbdevs.h b/sys/dev/usb/usbdevs.h index 6da825990e9..b7d0c6e70a9 100644 --- a/sys/dev/usb/usbdevs.h +++ b/sys/dev/usb/usbdevs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: usbdevs.h,v 1.17 2000/04/11 19:04:10 jakob Exp $ */ +/* $OpenBSD: usbdevs.h,v 1.18 2000/04/14 22:50:29 aaron Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. @@ -54,7 +54,7 @@ #define USB_VENDOR_HP 0x03f0 /* Hewlett Packard */ #define USB_VENDOR_ADAPTEC 0x03f3 /* Adaptec, Inc. */ #define USB_VENDOR_ACERLABS 0x0402 /* Acer Labs, Inc. */ -#define USB_VENDOR_FUTURE 0x0403 /* Future Technology Devices */ +#define USB_VENDOR_FTDI 0x0403 /* Future Technology Devices */ #define USB_VENDOR_NEC 0x0409 /* NEC */ #define USB_VENDOR_KODAK 0x040a /* Eastman Kodak Corp. */ #define USB_VENDOR_MELCO 0x0411 /* Melco, Inc. */ @@ -154,6 +154,7 @@ #define USB_VENDOR_ACERSA 0x066e /* Acer Semiconductor America, Inc. */ #define USB_VENDOR_AIWA 0x0677 /* Aiwa Co., Ltd. */ #define USB_VENDOR_ACARD 0x0678 /* ACARD Technology Corp. */ +#define USB_VENDOR_PROLIFIC 0x067b /* Prolific Technology Inc. */ #define USB_VENDOR_ADVANCELOGIC 0x0680 /* Avance Logic, Inc. */ #define USB_VENDOR_ASKEY 0x069a /* Askey Computer Corp. */ #define USB_VENDOR_ALCATELT 0x06b9 /* Alcatel Telecom */ @@ -329,6 +330,7 @@ /* Cypress Semiconductor products */ #define USB_PRODUCT_CYPRESS_MOUSE 0x0001 /* mouse */ #define USB_PRODUCT_CYPRESS_THERMO 0x0002 /* thermometer */ +#define USB_PRODUCT_CYPRESS_FMRADIO 0x1002 /* FM Radio */ /* D-Link products */ /*product DLINK DSBS25 0x0100 DSB-S25 serial adapter*/ @@ -380,7 +382,7 @@ #define USB_PRODUCT_FREECOM_DVD 0xfc01 /* Connector for DVD drive */ /* Future Technology Devices products */ -#define USB_PRODUCT_FUTURE_SERIAL 0x8372 /* Serial converter */ +#define USB_PRODUCT_FTDI_SERIAL 0x8372 /* Serial converter */ /* Handspring, Inc. */ #define USB_PRODUCT_HANDSPRING_VISOR 0x0100 /* Handspring Visor */ @@ -402,7 +404,8 @@ /* In-System products */ #define USB_PRODUCT_INSYSTEM_F5U002 0x0002 /* Parallel printer adapter */ -#define USB_PRODUCT_INSYSTEM_ISD110 0x0200 /* IDE adapter */ +#define USB_PRODUCT_INSYSTEM_ISD110 0x0200 /* IDE adapter ISD110 */ +#define USB_PRODUCT_INSYSTEM_ISD105 0x0202 /* IDE adapter ISD105 */ /* Intel products */ #define USB_PRODUCT_INTEL_TESTBOARD 0x9890 /* 82930 test board */ @@ -522,7 +525,6 @@ #define USB_PRODUCT_PHILIPS_DSS 0x0104 /* DSS XXX Digital Speaker System */ #define USB_PRODUCT_PHILIPS_HUB 0x0201 /* hub */ #define USB_PRODUCT_PHILIPS_DSS150 0x0471 /* DSS 150 Digital Speaker System */ -#define USB_PRODUCT_PHILIPS_PCVC680K 0x0308 /* PCVC680K Vesta Pro PC Camera */ /* P.I. Engineering products */ #define USB_PRODUCT_PIENGINEERING_PS2USB 0x020b /* PS2 to Mac USB Adapter */ @@ -535,6 +537,10 @@ #define USB_PRODUCT_PRIMAX_MOUSEINABOX 0x4d02 /* Mouse-in-a-Box */ #define USB_PRODUCT_PRIMAX_PCGAUMS1 0x4d04 /* Sony PCGA-UMS1 */ +/* Prolific products */ +#define USB_PRODUCT_PROLIFIC_PL2301 0x0000 /* PL2301 Host-Host interface */ +#define USB_PRODUCT_PROLIFIC_PL2302 0x0001 /* PL2302 Host-Host interface */ + /* Quickshot products */ #define USB_PRODUCT_QUICKSHOT_STRIKEPAD 0x6238 /* USB StrikePad */ diff --git a/sys/dev/usb/usbdevs_data.h b/sys/dev/usb/usbdevs_data.h index aba18f67f68..a90eb6b3b11 100644 --- a/sys/dev/usb/usbdevs_data.h +++ b/sys/dev/usb/usbdevs_data.h @@ -1,4 +1,4 @@ -/* $OpenBSD: usbdevs_data.h,v 1.17 2000/04/11 19:04:10 jakob Exp $ */ +/* $OpenBSD: usbdevs_data.h,v 1.18 2000/04/14 22:50:29 aaron Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. @@ -286,6 +286,12 @@ struct usb_knowndev usb_knowndevs[] = { "Cypress Semiconductor", "thermometer", }, + { + USB_VENDOR_CYPRESS, USB_PRODUCT_CYPRESS_FMRADIO, + 0, + "Cypress Semiconductor", + "FM Radio", + }, { USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DSB650C, 0, @@ -431,7 +437,7 @@ struct usb_knowndev usb_knowndevs[] = { "Connector for DVD drive", }, { - USB_VENDOR_FUTURE, USB_PRODUCT_FUTURE_SERIAL, + USB_VENDOR_FTDI, USB_PRODUCT_FTDI_SERIAL, 0, "Future Technology Devices", "Serial converter", @@ -518,7 +524,13 @@ struct usb_knowndev usb_knowndevs[] = { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_ISD110, 0, "In-System Design", - "IDE adapter", + "IDE adapter ISD110", + }, + { + USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_ISD105, + 0, + "In-System Design", + "IDE adapter ISD105", }, { USB_VENDOR_INTEL, USB_PRODUCT_INTEL_TESTBOARD, @@ -886,12 +898,6 @@ struct usb_knowndev usb_knowndevs[] = { "Philips", "DSS 150 Digital Speaker System", }, - { - USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_PCVC680K, - 0, - "Philips", - "PCVC680K Vesta Pro PC Camera", - }, { USB_VENDOR_PIENGINEERING, USB_PRODUCT_PIENGINEERING_PS2USB, 0, @@ -922,6 +928,18 @@ struct usb_knowndev usb_knowndevs[] = { "Primax Electronics", "Sony PCGA-UMS1", }, + { + USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2301, + 0, + "Prolific Technology Inc.", + "PL2301 Host-Host interface", + }, + { + USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2302, + 0, + "Prolific Technology Inc.", + "PL2302 Host-Host interface", + }, { USB_VENDOR_QUICKSHOT, USB_PRODUCT_QUICKSHOT_STRIKEPAD, 0, @@ -1085,7 +1103,7 @@ struct usb_knowndev usb_knowndevs[] = { NULL, }, { - USB_VENDOR_FUTURE, 0, + USB_VENDOR_FTDI, 0, USB_KNOWNDEV_NOPROD, "Future Technology Devices", NULL, @@ -1684,6 +1702,12 @@ struct usb_knowndev usb_knowndevs[] = { "ACARD Technology Corp.", NULL, }, + { + USB_VENDOR_PROLIFIC, 0, + USB_KNOWNDEV_NOPROD, + "Prolific Technology Inc.", + NULL, + }, { USB_VENDOR_ADVANCELOGIC, 0, USB_KNOWNDEV_NOPROD, -- 2.20.1