summaryrefslogtreecommitdiff
path: root/sys/dev/usb/urio.c
diff options
context:
space:
mode:
authorNathan Binkert <nate@cvs.openbsd.org>2002-05-07 18:29:20 +0000
committerNathan Binkert <nate@cvs.openbsd.org>2002-05-07 18:29:20 +0000
commite3500453ce2b94b39af2ef626169742ebc17530c (patch)
treed3c1ce90d9ae11b43948c86e7276f9595b6ee08d /sys/dev/usb/urio.c
parent98e3a0a3b6a5b0271467c9f199a555d22161f072 (diff)
Meant to commit only ulpt and committed everything. Most things weren't ready
Diffstat (limited to 'sys/dev/usb/urio.c')
-rw-r--r--sys/dev/usb/urio.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/sys/dev/usb/urio.c b/sys/dev/usb/urio.c
index 89492aeb019..e01c78442c9 100644
--- a/sys/dev/usb/urio.c
+++ b/sys/dev/usb/urio.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: urio.c,v 1.7 2002/05/07 18:08:04 nate Exp $ */
-/* $NetBSD: urio.c,v 1.11 2002/02/11 15:11:49 augustss Exp $ */
+/* $OpenBSD: urio.c,v 1.8 2002/05/07 18:29:18 nate Exp $ */
+/* $NetBSD: urio.c,v 1.6 2001/09/25 21:08:44 jdolecek Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -126,13 +126,6 @@ struct urio_softc {
#define URIO_RW_TIMEOUT 4000 /* ms */
-static const struct usb_devno urio_devs[] = {
- { USB_VENDOR_DIAMOND, USB_PRODUCT_DIAMOND_RIO500USB},
- { USB_VENDOR_DIAMOND2, USB_PRODUCT_DIAMOND2_RIO600USB},
- { USB_VENDOR_DIAMOND2, USB_PRODUCT_DIAMOND2_RIO800USB},
-};
-#define urio_lookup(v, p) usb_lookup(urio_devs, v, p)
-
USB_DECLARE_DRIVER(urio);
USB_MATCH(urio)
@@ -144,8 +137,15 @@ USB_MATCH(urio)
if (uaa->iface != NULL)
return (UMATCH_NONE);
- return (urio_lookup(uaa->vendor, uaa->product) != NULL ?
- UMATCH_VENDOR_PRODUCT : UMATCH_NONE);
+ if ( ( uaa->vendor == USB_VENDOR_DIAMOND &&
+ uaa->product == USB_PRODUCT_DIAMOND_RIO500USB ) ||
+ ( uaa->vendor == USB_VENDOR_DIAMOND2 &&
+ ( uaa->product == USB_PRODUCT_DIAMOND2_RIO600USB ||
+ uaa->product == USB_PRODUCT_DIAMOND2_RIO800USB ) )
+ )
+ return (UMATCH_VENDOR_PRODUCT);
+ else
+ return (UMATCH_NONE);
}
USB_ATTACH(urio)
@@ -293,7 +293,7 @@ urio_activate(device_ptr_t self, enum devact act)
#endif
int
-urioopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
+urioopen(dev_t dev, int flag, int mode, struct proc *p)
{
struct urio_softc *sc;
usbd_status err;
@@ -326,7 +326,7 @@ urioopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
}
int
-urioclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
+urioclose(dev_t dev, int flag, int mode, struct proc *p)
{
struct urio_softc *sc;
USB_GET_SC(urio, URIOUNIT(dev), sc);
@@ -379,7 +379,7 @@ urioread(dev_t dev, struct uio *uio, int flag)
while ((n = min(URIO_BSIZE, uio->uio_resid)) != 0) {
DPRINTFN(1, ("urioread: start transfer %d bytes\n", n));
tn = n;
- err = usbd_bulk_transfer(xfer, sc->sc_in_pipe, USBD_NO_COPY,
+ err = usbd_bulk_transfer(xfer, sc->sc_in_pipe, 0,
URIO_RW_TIMEOUT, bufp, &tn, "uriors");
if (err) {
if (err == USBD_INTERRUPTED)
@@ -441,7 +441,7 @@ uriowrite(dev_t dev, struct uio *uio, int flag)
DPRINTFN(1, ("uriowrite: transfer %d bytes\n", n));
- err = usbd_bulk_transfer(xfer, sc->sc_out_pipe, USBD_NO_COPY,
+ err = usbd_bulk_transfer(xfer, sc->sc_out_pipe, 0,
URIO_RW_TIMEOUT, bufp, &n, "uriowr");
DPRINTFN(2, ("uriowrite: err=%d\n", err));
if (err) {
@@ -468,7 +468,7 @@ uriowrite(dev_t dev, struct uio *uio, int flag)
int
-urioioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
+urioioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
{
struct urio_softc * sc;
int unit = URIOUNIT(dev);
@@ -544,7 +544,7 @@ urioioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
sc->sc_refcnt++;
err = usbd_do_request_flags(sc->sc_udev, &req, ptr, req_flags,
- &req_actlen, USBD_DEFAULT_TIMEOUT);
+ &req_actlen);
if (--sc->sc_refcnt < 0)
usb_detach_wakeup(USBDEV(sc->sc_dev));
@@ -563,7 +563,7 @@ ret:
}
int
-uriopoll(dev_t dev, int events, usb_proc_ptr p)
+uriopoll(dev_t dev, int events, struct proc *p)
{
return (0);
}