summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNathan Binkert <nate@cvs.openbsd.org>2002-11-11 02:32:33 +0000
committerNathan Binkert <nate@cvs.openbsd.org>2002-11-11 02:32:33 +0000
commitbfc8513ad060ae172ee8a491fc1dfe5e8578b64f (patch)
treeb3f0d84391d5e44adb90e588ab1a18b3b941d6d8 /sys
parent5a8ae48cfc551cf56b4e583bdec0942f884088c8 (diff)
sync with NetBSD
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/if_aue.c4
-rw-r--r--sys/dev/usb/if_url.c12
-rw-r--r--sys/dev/usb/ucom.c24
-rw-r--r--sys/dev/usb/uftdi.c5
-rw-r--r--sys/dev/usb/ugen.c26
-rw-r--r--sys/dev/usb/uhid.c22
-rw-r--r--sys/dev/usb/uhidev.c16
-rw-r--r--sys/dev/usb/uhidev.h12
-rw-r--r--sys/dev/usb/ulpt.c26
-rw-r--r--sys/dev/usb/umct.c5
-rw-r--r--sys/dev/usb/umidi.c4
-rw-r--r--sys/dev/usb/umidivar.h4
-rw-r--r--sys/dev/usb/umodem.c5
-rw-r--r--sys/dev/usb/ums.c7
-rw-r--r--sys/dev/usb/uplcom.c5
-rw-r--r--sys/dev/usb/urio.c19
-rw-r--r--sys/dev/usb/uscanner.c22
17 files changed, 157 insertions, 61 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c
index 549bf6678a9..d5769c78b71 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.28 2002/09/27 18:42:51 nate Exp $ */
-/* $NetBSD: if_aue.c,v 1.80 2002/07/25 06:45:38 matt Exp $ */
+/* $OpenBSD: if_aue.c,v 1.29 2002/11/11 02:32:32 nate Exp $ */
+/* $NetBSD: if_aue.c,v 1.81 2002/09/29 19:55:52 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
diff --git a/sys/dev/usb/if_url.c b/sys/dev/usb/if_url.c
index a3a888c4048..b3d1ffcb782 100644
--- a/sys/dev/usb/if_url.c
+++ b/sys/dev/usb/if_url.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: if_url.c,v 1.8 2002/09/29 22:49:10 jason Exp $ */
-/* $NetBSD: if_url.c,v 1.2 2002/03/28 21:49:19 ichiro Exp $ */
+/* $OpenBSD: if_url.c,v 1.9 2002/11/11 02:32:32 nate Exp $ */
+/* $NetBSD: if_url.c,v 1.6 2002/09/29 10:19:21 martin Exp $ */
/*
* Copyright (c) 2001, 2002
* Shingo WATANABE <nabe@nabechan.org>. All rights reserved.
@@ -292,6 +292,10 @@ USB_ATTACH(url)
ifp->if_start = url_start;
ifp->if_ioctl = url_ioctl;
ifp->if_watchdog = url_watchdog;
+#if defined(__NetBSD__)
+ ifp->if_init = url_init;
+ ifp->if_stop = url_stop;
+#endif
IFQ_SET_READY(&ifp->if_snd);
@@ -540,7 +544,7 @@ url_init(struct ifnet *ifp)
eaddr = sc->sc_ac.ac_enaddr;
#elif defined(__NetBSD__)
eaddr = LLADDR(ifp->if_sadl);
-#endif /* defined(__NetBSD__) */
+#endif
for (i = 0; i < ETHER_ADDR_LEN; i++)
url_csr_write_1(sc, URL_IDR0 + i, eaddr[i]);
@@ -638,7 +642,7 @@ url_activate(device_ptr_t self, enum devact act)
break;
case DVACT_DEACTIVATE:
- if_deactivate(&sc->sc_ac.ec_if);
+ if_deactivate(GET_IFP(sc));
sc->sc_dying = 1;
break;
}
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c
index 71d9ccc16a8..ee5d40b300e 100644
--- a/sys/dev/usb/ucom.c
+++ b/sys/dev/usb/ucom.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ucom.c,v 1.16 2002/07/25 04:07:32 nate Exp $ */
-/* $NetBSD: ucom.c,v 1.43 2002/07/11 21:14:27 augustss Exp $ */
+/* $OpenBSD: ucom.c,v 1.17 2002/11/11 02:32:32 nate Exp $ */
+/* $NetBSD: ucom.c,v 1.47 2002/10/23 09:13:59 jdolecek Exp $ */
/*
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -144,7 +144,19 @@ struct ucom_softc {
};
#if defined(__NetBSD__)
-cdev_decl(ucom);
+dev_type_open(ucomopen);
+dev_type_close(ucomclose);
+dev_type_read(ucomread);
+dev_type_write(ucomwrite);
+dev_type_ioctl(ucomioctl);
+dev_type_stop(ucomstop);
+dev_type_tty(ucomtty);
+dev_type_poll(ucompoll);
+
+const struct cdevsw ucom_cdevsw = {
+ ucomopen, ucomclose, ucomread, ucomwrite, ucomioctl,
+ ucomstop, ucomtty, ucompoll, nommap, ttykqfilter, D_TTY
+};
#endif
Static void ucom_cleanup(struct ucom_softc *);
@@ -240,10 +252,15 @@ USB_DETACH(ucom)
}
splx(s);
+#if defined(__NetBSD__)
+ /* locate the major number */
+ maj = cdevsw_lookup_major(&ucom_cdevsw);
+#else
/* locate the major number */
for (maj = 0; maj < nchrdev; maj++)
if (cdevsw[maj].d_open == ucomopen)
break;
+#endif
/* Nuke the vnodes for any open instances. */
mn = self->dv_unit;
@@ -277,7 +294,6 @@ ucom_activate(device_ptr_t self, enum devact act)
switch (act) {
case DVACT_ACTIVATE:
return (EOPNOTSUPP);
- break;
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
diff --git a/sys/dev/usb/uftdi.c b/sys/dev/usb/uftdi.c
index 027e63ac443..7fdefc3b500 100644
--- a/sys/dev/usb/uftdi.c
+++ b/sys/dev/usb/uftdi.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uftdi.c,v 1.9 2002/07/29 03:01:48 nate Exp $ */
-/* $NetBSD: uftdi.c,v 1.12 2002/07/18 14:44:10 scw Exp $ */
+/* $OpenBSD: uftdi.c,v 1.10 2002/11/11 02:32:32 nate Exp $ */
+/* $NetBSD: uftdi.c,v 1.13 2002/09/23 05:51:23 simonb Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -265,7 +265,6 @@ uftdi_activate(device_ptr_t self, enum devact act)
switch (act) {
case DVACT_ACTIVATE:
return (EOPNOTSUPP);
- break;
case DVACT_DEACTIVATE:
if (sc->sc_subdev != NULL)
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
index c88c56705e5..bf301035167 100644
--- a/sys/dev/usb/ugen.c
+++ b/sys/dev/usb/ugen.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ugen.c,v 1.25 2002/07/25 04:07:32 nate Exp $ */
-/* $NetBSD: ugen.c,v 1.59 2002/07/11 21:14:28 augustss Exp $ */
+/* $OpenBSD: ugen.c,v 1.26 2002/11/11 02:32:32 nate Exp $ */
+/* $NetBSD: ugen.c,v 1.62 2002/10/23 09:13:59 jdolecek Exp $ */
/* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */
/*
@@ -121,7 +121,18 @@ struct ugen_softc {
};
#if defined(__NetBSD__)
-cdev_decl(ugen);
+dev_type_open(ugenopen);
+dev_type_close(ugenclose);
+dev_type_read(ugenread);
+dev_type_write(ugenwrite);
+dev_type_ioctl(ugenioctl);
+dev_type_poll(ugenpoll);
+dev_type_kqfilter(ugenkqfilter);
+
+const struct cdevsw ugen_cdevsw = {
+ ugenopen, ugenclose, ugenread, ugenwrite, ugenioctl,
+ nostop, notty, ugenpoll, nommap, ugenkqfilter,
+};
#elif defined(__FreeBSD__)
d_open_t ugenopen;
d_close_t ugenclose;
@@ -735,7 +746,6 @@ ugen_activate(device_ptr_t self, enum devact act)
switch (act) {
case DVACT_ACTIVATE:
return (EOPNOTSUPP);
- break;
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
@@ -779,18 +789,18 @@ USB_DETACH(ugen)
}
splx(s);
-#if defined(__NetBSD__) || defined(__OpenBSD__)
/* locate the major number */
+#if defined(__NetBSD__)
+ maj = cdevsw_lookup_major(&ugen_cdevsw);
+#elif defined(__OpenBSD__)
for (maj = 0; maj < nchrdev; maj++)
if (cdevsw[maj].d_open == ugenopen)
break;
+#endif
/* Nuke the vnodes for any open instances (calls close). */
mn = self->dv_unit * USB_MAX_ENDPOINTS;
vdevgone(maj, mn, mn + USB_MAX_ENDPOINTS - 1, VCHR);
-#elif defined(__FreeBSD__)
- /* XXX not implemented yet */
-#endif
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
USBDEV(sc->sc_dev));
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
index 544ed4d6422..ea946e1e818 100644
--- a/sys/dev/usb/uhid.c
+++ b/sys/dev/usb/uhid.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uhid.c,v 1.23 2002/07/25 04:07:33 nate Exp $ */
-/* $NetBSD: uhid.c,v 1.52 2002/07/11 21:14:29 augustss Exp $ */
+/* $OpenBSD: uhid.c,v 1.24 2002/11/11 02:32:32 nate Exp $ */
+/* $NetBSD: uhid.c,v 1.55 2002/10/23 09:14:00 jdolecek Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -102,7 +102,18 @@ struct uhid_softc {
#define UHID_BSIZE 1020 /* buffer size */
#if defined(__NetBSD__)
-cdev_decl(uhid);
+dev_type_open(uhidopen);
+dev_type_close(uhidclose);
+dev_type_read(uhidread);
+dev_type_write(uhidwrite);
+dev_type_ioctl(uhidioctl);
+dev_type_poll(uhidpoll);
+dev_type_kqfilter(uhidkqfilter);
+
+const struct cdevsw uhid_cdevsw = {
+ uhidopen, uhidclose, uhidread, uhidwrite, uhidioctl,
+ nostop, notty, uhidpoll, nommap, uhidkqfilter,
+};
#endif
Static void uhid_intr(struct uhidev *, void *, u_int len);
@@ -157,7 +168,6 @@ uhid_activate(device_ptr_t self, enum devact act)
switch (act) {
case DVACT_ACTIVATE:
return (EOPNOTSUPP);
- break;
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
@@ -188,9 +198,13 @@ USB_DETACH(uhid)
}
/* locate the major number */
+#if defined(__NetBSD__)
+ maj = cdevsw_lookup_major(&uhid_cdevsw);
+#elif defined(__OpenBSD__)
for (maj = 0; maj < nchrdev; maj++)
if (cdevsw[maj].d_open == uhidopen)
break;
+#endif
/* Nuke the vnodes for any open instances (calls close). */
mn = self->dv_unit;
diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c
index b2a109a0441..ffaddf7e034 100644
--- a/sys/dev/usb/uhidev.c
+++ b/sys/dev/usb/uhidev.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uhidev.c,v 1.5 2002/07/25 04:07:33 nate Exp $ */
-/* $NetBSD: uhidev.c,v 1.6 2002/07/11 21:14:29 augustss Exp $ */
+/* $OpenBSD: uhidev.c,v 1.6 2002/11/11 02:32:32 nate Exp $ */
+/* $NetBSD: uhidev.c,v 1.10 2002/10/09 06:27:09 fair Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -241,6 +241,11 @@ USB_ATTACH(uhidev)
USB_ATTACH_ERROR_RETURN;
}
#endif
+#if defined(__NetBSD__) && NRND > 0
+ rnd_attach_source(&dev->rnd_source,
+ USBDEVNAME(dev->sc_dev),
+ RND_TYPE_TTY, 0);
+#endif
}
}
}
@@ -306,7 +311,6 @@ uhidev_activate(device_ptr_t self, enum devact act)
switch (act) {
case DVACT_ACTIVATE:
return (EOPNOTSUPP);
- break;
case DVACT_DEACTIVATE:
rv = 0;
@@ -337,6 +341,9 @@ USB_DETACH(uhidev)
rv = 0;
for (i = 0; i < sc->sc_nrepid; i++) {
if (sc->sc_subdevs[i] != NULL) {
+#if defined(__NetBSD__) && NRND > 0
+ rnd_detach_source(&sc->sc_subdevs[i]->rnd_source);
+#endif
rv |= config_detach(&sc->sc_subdevs[i]->sc_dev, flags);
sc->sc_subdevs[i] = NULL;
}
@@ -400,6 +407,9 @@ uhidev_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
printf("%s: bad input length %d != %d\n",USBDEVNAME(sc->sc_dev),
scd->sc_in_rep_size, cc);
#endif
+#if defined(__NetBSD__) && NRND > 0
+ rnd_add_uint32(&scd->rnd_source, (uintptr_t)(sc->sc_ibuf));
+#endif
scd->sc_intr(scd, p, cc);
}
diff --git a/sys/dev/usb/uhidev.h b/sys/dev/usb/uhidev.h
index 360eae75784..90ba1509499 100644
--- a/sys/dev/usb/uhidev.h
+++ b/sys/dev/usb/uhidev.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: uhidev.h,v 1.3 2002/05/09 15:06:29 nate Exp $ */
-/* $NetBSD: uhidev.h,v 1.2 2001/12/29 18:56:52 augustss Exp $ */
+/* $OpenBSD: uhidev.h,v 1.4 2002/11/11 02:32:32 nate Exp $ */
+/* $NetBSD: uhidev.h,v 1.3 2002/10/08 09:56:17 dan Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -40,6 +40,11 @@
#if defined(__NetBSD__)
#include "locators.h"
+#include "rnd.h"
+
+#if NRND > 0
+#include <sys/rnd.h>
+#endif
#endif
#define uhidevcf_reportid cf_loc[UHIDBUSCF_REPORTID]
@@ -73,6 +78,9 @@ struct uhidev {
int sc_in_rep_size;
#define UHIDEV_OPEN 0x01 /* device is open */
void (*sc_intr)(struct uhidev *, void *, u_int);
+#if defined(__NetBSD__) && NRND > 0
+ rndsource_element_t rnd_source;
+#endif
};
struct uhidev_attach_arg {
diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c
index 44c4e37b815..025f25b9415 100644
--- a/sys/dev/usb/ulpt.c
+++ b/sys/dev/usb/ulpt.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ulpt.c,v 1.14 2002/10/12 01:09:44 krw Exp $ */
-/* $NetBSD: ulpt.c,v 1.50 2002/07/11 21:14:31 augustss Exp $ */
+/* $OpenBSD: ulpt.c,v 1.15 2002/11/11 02:32:32 nate Exp $ */
+/* $NetBSD: ulpt.c,v 1.55 2002/10/23 09:14:01 jdolecek Exp $ */
/* $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.24 1999/11/17 22:33:44 n_hibma Exp $ */
/*
@@ -125,7 +125,15 @@ struct ulpt_softc {
};
#if defined(__NetBSD__)
-cdev_decl(ulpt);
+dev_type_open(ulptopen);
+dev_type_close(ulptclose);
+dev_type_write(ulptwrite);
+dev_type_ioctl(ulptioctl);
+
+const struct cdevsw ulpt_cdevsw = {
+ ulptopen, ulptclose, noread, ulptwrite, ulptioctl,
+ nostop, notty, nopoll, nommap, nokqfilter,
+};
#elif defined(__FreeBSD__)
Static d_open_t ulptopen;
Static d_close_t ulptclose;
@@ -275,19 +283,20 @@ USB_ATTACH(ulpt)
}
}
if (sc->sc_out == -1) {
- printf("%s: could not find bulk endpoint\n",
+ printf("%s: could not find bulk out endpoint\n",
USBDEVNAME(sc->sc_dev));
sc->sc_dying = 1;
USB_ATTACH_ERROR_RETURN;
}
- printf("%s: using %s-directional mode\n", USBDEVNAME(sc->sc_dev),
- sc->sc_in >= 0 ? "bi" : "uni");
if (usbd_get_quirks(dev)->uq_flags & UQ_BROKEN_BIDIR) {
/* This device doesn't handle reading properly. */
sc->sc_in = -1;
}
+ printf("%s: using %s-directional mode\n", USBDEVNAME(sc->sc_dev),
+ sc->sc_in >= 0 ? "bi" : "uni");
+
DPRINTFN(10, ("ulpt_attach: bulk=%d\n", sc->sc_out));
sc->sc_iface = iface;
@@ -353,7 +362,6 @@ ulpt_activate(device_ptr_t self, enum devact act)
switch (act) {
case DVACT_ACTIVATE:
return (EOPNOTSUPP);
- break;
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
@@ -391,9 +399,13 @@ USB_DETACH(ulpt)
#if defined(__NetBSD__) || defined(__OpenBSD__)
/* locate the major number */
+#if defined(__NetBSD__)
+ maj = cdevsw_lookup_major(&ulpt_cdevsw);
+#elif defined(__OpenBSD__)
for (maj = 0; maj < nchrdev; maj++)
if (cdevsw[maj].d_open == ulptopen)
break;
+#endif
/* Nuke the vnodes for any open instances (calls close). */
mn = self->dv_unit;
diff --git a/sys/dev/usb/umct.c b/sys/dev/usb/umct.c
index 02fa939b59f..90a8fc78b11 100644
--- a/sys/dev/usb/umct.c
+++ b/sys/dev/usb/umct.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: umct.c,v 1.5 2002/07/25 04:07:33 nate Exp $ */
-/* $NetBSD: umct.c,v 1.8 2002/07/11 21:14:32 augustss Exp $ */
+/* $OpenBSD: umct.c,v 1.6 2002/11/11 02:32:32 nate Exp $ */
+/* $NetBSD: umct.c,v 1.9 2002/09/23 05:51:23 simonb Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -336,7 +336,6 @@ umct_activate(device_ptr_t self, enum devact act)
switch (act) {
case DVACT_ACTIVATE:
return (EOPNOTSUPP);
- break;
case DVACT_DEACTIVATE:
if (sc->sc_subdev != NULL)
diff --git a/sys/dev/usb/umidi.c b/sys/dev/usb/umidi.c
index fbb40cd1060..fee783d966a 100644
--- a/sys/dev/usb/umidi.c
+++ b/sys/dev/usb/umidi.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: umidi.c,v 1.6 2002/07/25 04:07:33 nate Exp $ */
-/* $NetBSD: umidi.c,v 1.16 2002/07/11 21:14:32 augustss Exp $ */
+/* $OpenBSD: umidi.c,v 1.7 2002/11/11 02:32:32 nate Exp $ */
+/* $NetBSD: umidi.c,v 1.16 2002/07/11 21:14:32 augustss Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
diff --git a/sys/dev/usb/umidivar.h b/sys/dev/usb/umidivar.h
index 09052693c22..4b6d34a1d45 100644
--- a/sys/dev/usb/umidivar.h
+++ b/sys/dev/usb/umidivar.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: umidivar.h,v 1.6 2002/09/08 01:09:07 deraadt Exp $ */
-/* $NetBSD: umidivar.h,v 1.4 2002/07/11 21:14:32 augustss Exp $ */
+/* $OpenBSD: umidivar.h,v 1.7 2002/11/11 02:32:32 nate Exp $ */
+/* $NetBSD: umidivar.h,v 1.5 2002/09/12 21:00:42 augustss Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
diff --git a/sys/dev/usb/umodem.c b/sys/dev/usb/umodem.c
index 03599cfbc0c..7b1b600e204 100644
--- a/sys/dev/usb/umodem.c
+++ b/sys/dev/usb/umodem.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: umodem.c,v 1.12 2002/07/25 04:07:33 nate Exp $ */
-/* $NetBSD: umodem.c,v 1.44 2002/07/11 21:14:33 augustss Exp $ */
+/* $OpenBSD: umodem.c,v 1.13 2002/11/11 02:32:32 nate Exp $ */
+/* $NetBSD: umodem.c,v 1.45 2002/09/23 05:51:23 simonb Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -723,7 +723,6 @@ umodem_activate(device_ptr_t self, enum devact act)
switch (act) {
case DVACT_ACTIVATE:
return (EOPNOTSUPP);
- break;
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
diff --git a/sys/dev/usb/ums.c b/sys/dev/usb/ums.c
index b94eb0b341d..fe46206de64 100644
--- a/sys/dev/usb/ums.c
+++ b/sys/dev/usb/ums.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ums.c,v 1.11 2002/07/25 04:07:33 nate Exp $ */
-/* $NetBSD: ums.c,v 1.57 2002/07/11 21:14:33 augustss Exp $ */
+/* $OpenBSD: ums.c,v 1.12 2002/11/11 02:32:32 nate Exp $ */
+/* $NetBSD: ums.c,v 1.59 2002/09/23 05:59:01 simonb Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -253,7 +253,6 @@ ums_activate(device_ptr_t self, enum devact act)
switch (act) {
case DVACT_ACTIVATE:
return (EOPNOTSUPP);
- break;
case DVACT_DEACTIVATE:
if (sc->sc_wsmousedev != NULL)
@@ -344,7 +343,7 @@ ums_disable(void *v)
#endif
sc->sc_enabled = 0;
- return (uhidev_close(&sc->sc_hdev));
+ uhidev_close(&sc->sc_hdev);
}
Static int
diff --git a/sys/dev/usb/uplcom.c b/sys/dev/usb/uplcom.c
index 65f9d1d615c..8e048b535e8 100644
--- a/sys/dev/usb/uplcom.c
+++ b/sys/dev/usb/uplcom.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uplcom.c,v 1.7 2002/07/25 04:07:33 nate Exp $ */
-/* $NetBSD: uplcom.c,v 1.28 2002/07/11 21:14:33 augustss Exp $ */
+/* $OpenBSD: uplcom.c,v 1.8 2002/11/11 02:32:32 nate Exp $ */
+/* $NetBSD: uplcom.c,v 1.29 2002/09/23 05:51:23 simonb Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -395,7 +395,6 @@ uplcom_activate(device_ptr_t self, enum devact act)
switch (act) {
case DVACT_ACTIVATE:
return (EOPNOTSUPP);
- break;
case DVACT_DEACTIVATE:
if (sc->sc_subdev != NULL)
diff --git a/sys/dev/usb/urio.c b/sys/dev/usb/urio.c
index 2c10b03123b..4e7a1e8b9c8 100644
--- a/sys/dev/usb/urio.c
+++ b/sys/dev/usb/urio.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: urio.c,v 1.14 2002/07/25 04:07:33 nate Exp $ */
-/* $NetBSD: urio.c,v 1.12 2002/07/11 21:14:33 augustss Exp $ */
+/* $OpenBSD: urio.c,v 1.15 2002/11/11 02:32:32 nate Exp $ */
+/* $NetBSD: urio.c,v 1.15 2002/10/23 09:14:02 jdolecek Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -83,7 +83,16 @@ int uriodebug = 0;
#if defined(__NetBSD__)
-cdev_decl(urio);
+dev_type_open(urioopen);
+dev_type_close(urioclose);
+dev_type_read(urioread);
+dev_type_write(uriowrite);
+dev_type_ioctl(urioioctl);
+
+const struct cdevsw urio_cdevsw = {
+ urioopen, urioclose, urioread, uriowrite, urioioctl,
+ nostop, notty, nopoll, nommap, nokqfilter,
+};
#elif defined(__FreeBSD__)
d_open_t urioopen;
d_close_t urioclose;
@@ -256,9 +265,13 @@ USB_DETACH(urio)
#if defined(__NetBSD__) || defined(__OpenBSD__)
/* locate the major number */
+#if defined(__NetBSD__)
+ maj = cdevsw_lookup_major(&urio_cdevsw);
+#elif defined(__OpenBSD__)
for (maj = 0; maj < nchrdev; maj++)
if (cdevsw[maj].d_open == urioopen)
break;
+#endif
/* Nuke the vnodes for any open instances (calls close). */
mn = self->dv_unit;
diff --git a/sys/dev/usb/uscanner.c b/sys/dev/usb/uscanner.c
index 54a0ad89a8e..7c84360c58c 100644
--- a/sys/dev/usb/uscanner.c
+++ b/sys/dev/usb/uscanner.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uscanner.c,v 1.12 2002/07/25 04:07:33 nate Exp $ */
-/* $NetBSD: uscanner.c,v 1.31 2002/07/14 20:53:21 augustss Exp $ */
+/* $OpenBSD: uscanner.c,v 1.13 2002/11/11 02:32:32 nate Exp $ */
+/* $NetBSD: uscanner.c,v 1.34 2002/10/23 09:14:03 jdolecek Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -237,7 +237,18 @@ struct uscanner_softc {
};
#if defined(__NetBSD__)
-cdev_decl(uscanner);
+dev_type_open(uscanneropen);
+dev_type_close(uscannerclose);
+dev_type_read(uscannerread);
+dev_type_write(uscannerwrite);
+dev_type_ioctl(uscannerioctl);
+dev_type_poll(uscannerpoll);
+dev_type_kqfilter(uscannerkqfilter);
+
+const struct cdevsw uscanner_cdevsw = {
+ uscanneropen, uscannerclose, uscannerread, uscannerwrite,
+ uscannerioctl, nostop, notty, uscannerpoll, nommap, uscannerkqfilter,
+};
#elif defined(__FreeBSD__)
d_open_t uscanneropen;
d_close_t uscannerclose;
@@ -598,7 +609,6 @@ uscanner_activate(device_ptr_t self, enum devact act)
switch (act) {
case DVACT_ACTIVATE:
return (EOPNOTSUPP);
- break;
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
@@ -643,9 +653,13 @@ USB_DETACH(uscanner)
#if defined(__NetBSD__) || defined(__OpenBSD__)
/* locate the major number */
+#if defined(__NetBSD__)
+ maj = cdevsw_lookup_major(&uscanner_cdevsw);
+#elif defined(__OpenBSD__)
for (maj = 0; maj < nchrdev; maj++)
if (cdevsw[maj].d_open == uscanneropen)
break;
+#endif
/* Nuke the vnodes for any open instances (calls close). */
mn = self->dv_unit * USB_MAX_ENDPOINTS;