summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/if_aue.c10
-rw-r--r--sys/dev/usb/if_axe.c12
-rw-r--r--sys/dev/usb/if_cdce.c4
-rw-r--r--sys/dev/usb/if_cue.c6
-rw-r--r--sys/dev/usb/if_kue.c4
-rw-r--r--sys/dev/usb/if_ral.c6
-rw-r--r--sys/dev/usb/if_rum.c6
-rw-r--r--sys/dev/usb/if_uath.c6
-rw-r--r--sys/dev/usb/if_udav.c32
-rw-r--r--sys/dev/usb/if_upl.c6
-rw-r--r--sys/dev/usb/if_url.c22
-rw-r--r--sys/dev/usb/if_wi_usb.c24
-rw-r--r--sys/dev/usb/if_zyd.c6
-rw-r--r--sys/dev/usb/moscom.c6
-rw-r--r--sys/dev/usb/uark.c6
-rw-r--r--sys/dev/usb/uaudio.c6
-rw-r--r--sys/dev/usb/uberry.c6
-rw-r--r--sys/dev/usb/ubsa.c6
-rw-r--r--sys/dev/usb/ubt.c18
-rw-r--r--sys/dev/usb/ucom.c12
-rw-r--r--sys/dev/usb/ucycom.c4
-rw-r--r--sys/dev/usb/udcf.c6
-rw-r--r--sys/dev/usb/udsbr.c8
-rw-r--r--sys/dev/usb/ueagle.c6
-rw-r--r--sys/dev/usb/uftdi.c6
-rw-r--r--sys/dev/usb/ugen.c14
-rw-r--r--sys/dev/usb/uhid.c12
-rw-r--r--sys/dev/usb/uhidev.c6
-rw-r--r--sys/dev/usb/uhub.c10
-rw-r--r--sys/dev/usb/uipaq.c6
-rw-r--r--sys/dev/usb/ulpt.c12
-rw-r--r--sys/dev/usb/umass.c8
-rw-r--r--sys/dev/usb/umass_scsi.c6
-rw-r--r--sys/dev/usb/umct.c6
-rw-r--r--sys/dev/usb/umidi.c6
-rw-r--r--sys/dev/usb/umodem.c6
-rw-r--r--sys/dev/usb/umsm.c6
-rw-r--r--sys/dev/usb/uow.c4
-rw-r--r--sys/dev/usb/uplcom.c6
-rw-r--r--sys/dev/usb/urio.c14
-rw-r--r--sys/dev/usb/usb.c4
-rw-r--r--sys/dev/usb/usb_port.h3
-rw-r--r--sys/dev/usb/uscanner.c12
-rw-r--r--sys/dev/usb/uslcom.c6
-rw-r--r--sys/dev/usb/usscanner.c8
-rw-r--r--sys/dev/usb/uts.c6
-rw-r--r--sys/dev/usb/uvisor.c6
-rw-r--r--sys/dev/usb/uvscom.c6
48 files changed, 203 insertions, 204 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c
index bec33195957..9259644bbc5 100644
--- a/sys/dev/usb/if_aue.c
+++ b/sys/dev/usb/if_aue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_aue.c,v 1.59 2007/06/10 10:15:35 mbalmer Exp $ */
+/* $OpenBSD: if_aue.c,v 1.60 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: if_aue.c,v 1.82 2003/03/05 17:37:36 shiba Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -422,7 +422,7 @@ aue_unlock_mii(struct aue_softc *sc)
{
rw_exit_write(&sc->aue_mii_lock);
if (--sc->aue_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->aue_dev));
+ usb_detach_wakeup(&sc->aue_dev);
}
int
@@ -827,7 +827,7 @@ aue_attach(struct device *parent, struct device *self, void *aux)
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->aue_udev,
- USBDEV(sc->aue_dev));
+ &sc->aue_dev);
}
int
@@ -876,12 +876,12 @@ aue_detach(struct device *self, int flags)
if (--sc->aue_refcnt >= 0) {
/* Wait for processes to go away. */
- usb_detach_wait(USBDEV(sc->aue_dev));
+ usb_detach_wait(&sc->aue_dev);
}
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->aue_udev,
- USBDEV(sc->aue_dev));
+ &sc->aue_dev);
return (0);
}
diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c
index a6b3b51be71..bd5754c561d 100644
--- a/sys/dev/usb/if_axe.c
+++ b/sys/dev/usb/if_axe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_axe.c,v 1.72 2007/06/10 10:15:35 mbalmer Exp $ */
+/* $OpenBSD: if_axe.c,v 1.73 2007/06/10 10:53:48 mbalmer Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Jonathan Gray <jsg@openbsd.org>
@@ -216,7 +216,7 @@ axe_unlock_mii(struct axe_softc *sc)
{
rw_exit_write(&sc->axe_mii_lock);
if (--sc->axe_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->axe_dev));
+ usb_detach_wakeup(&sc->axe_dev);
}
int
@@ -720,7 +720,7 @@ axe_attach(struct device *parent, struct device *self, void *aux)
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->axe_udev,
- USBDEV(sc->axe_dev));
+ &sc->axe_dev);
}
int
@@ -760,7 +760,7 @@ axe_detach(struct device *self, int flags)
if (--sc->axe_refcnt >= 0) {
/* Wait for processes to go away */
- usb_detach_wait(USBDEV(sc->axe_dev));
+ usb_detach_wait(&sc->axe_dev);
}
if (ifp->if_flags & IFF_RUNNING)
@@ -783,12 +783,12 @@ axe_detach(struct device *self, int flags)
if (--sc->axe_refcnt >= 0) {
/* Wait for processes to go away. */
- usb_detach_wait(USBDEV(sc->axe_dev));
+ usb_detach_wait(&sc->axe_dev);
}
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->axe_udev,
- USBDEV(sc->axe_dev));
+ &sc->axe_dev);
return (0);
}
diff --git a/sys/dev/usb/if_cdce.c b/sys/dev/usb/if_cdce.c
index cd660a9e3a0..047c75fc455 100644
--- a/sys/dev/usb/if_cdce.c
+++ b/sys/dev/usb/if_cdce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cdce.c,v 1.28 2007/06/09 12:22:53 mbalmer Exp $ */
+/* $OpenBSD: if_cdce.c,v 1.29 2007/06/10 10:53:48 mbalmer Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul@windriver.com>
@@ -265,7 +265,7 @@ cdce_attach(struct device *parent, struct device *self, void *aux)
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->cdce_udev,
- USBDEV(sc->cdce_dev));
+ &sc->cdce_dev);
}
int
diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c
index 56ec079787c..2d3fa098922 100644
--- a/sys/dev/usb/if_cue.c
+++ b/sys/dev/usb/if_cue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cue.c,v 1.39 2007/06/10 10:15:35 mbalmer Exp $ */
+/* $OpenBSD: if_cue.c,v 1.40 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: if_cue.c,v 1.40 2002/07/11 21:14:26 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -534,7 +534,7 @@ cue_attach(struct device *parent, struct device *self, void *aux)
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->cue_udev,
- USBDEV(sc->cue_dev));
+ &sc->cue_dev);
}
int
@@ -580,7 +580,7 @@ cue_detach(struct device *self, int flags)
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->cue_udev,
- USBDEV(sc->cue_dev));
+ &sc->cue_dev);
return (0);
}
diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c
index 2d7c65e370f..bcfc72a52d1 100644
--- a/sys/dev/usb/if_kue.c
+++ b/sys/dev/usb/if_kue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_kue.c,v 1.50 2007/06/05 08:43:55 mbalmer Exp $ */
+/* $OpenBSD: if_kue.c,v 1.51 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: if_kue.c,v 1.50 2002/07/16 22:00:31 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -536,7 +536,7 @@ kue_attach(struct device *parent, struct device *self, void *aux)
kue_attachhook(sc);
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->kue_udev,
- USBDEV(sc->kue_dev));
+ &sc->kue_dev);
}
int
diff --git a/sys/dev/usb/if_ral.c b/sys/dev/usb/if_ral.c
index 83965781340..febbaabab03 100644
--- a/sys/dev/usb/if_ral.c
+++ b/sys/dev/usb/if_ral.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ral.c,v 1.95 2007/06/09 12:22:53 mbalmer Exp $ */
+/* $OpenBSD: if_ral.c,v 1.96 2007/06/10 10:53:48 mbalmer Exp $ */
/*-
* Copyright (c) 2005, 2006
@@ -339,7 +339,7 @@ ural_attach(struct device *parent, struct device *self, void *aux)
#endif
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
}
int
@@ -379,7 +379,7 @@ ural_detach(struct device *self, int flags)
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return 0;
}
diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c
index 5ad6cbe6e7d..04bcf57fba6 100644
--- a/sys/dev/usb/if_rum.c
+++ b/sys/dev/usb/if_rum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rum.c,v 1.60 2007/06/09 12:22:53 mbalmer Exp $ */
+/* $OpenBSD: if_rum.c,v 1.61 2007/06/10 10:53:48 mbalmer Exp $ */
/*-
* Copyright (c) 2005-2007 Damien Bergamini <damien.bergamini@free.fr>
@@ -423,7 +423,7 @@ rum_attach(struct device *parent, struct device *self, void *aux)
#endif
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
}
int
@@ -461,7 +461,7 @@ rum_detach(struct device *self, int flags)
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return 0;
}
diff --git a/sys/dev/usb/if_uath.c b/sys/dev/usb/if_uath.c
index 12424fdda0d..e97e5010467 100644
--- a/sys/dev/usb/if_uath.c
+++ b/sys/dev/usb/if_uath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_uath.c,v 1.22 2007/06/09 12:22:53 mbalmer Exp $ */
+/* $OpenBSD: if_uath.c,v 1.23 2007/06/10 10:53:48 mbalmer Exp $ */
/*-
* Copyright (c) 2006
@@ -410,7 +410,7 @@ uath_attach(struct device *parent, struct device *self, void *aux)
#endif
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return;
@@ -462,7 +462,7 @@ uath_detach(struct device *self, int flags)
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return 0;
}
diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c
index 574bbd91907..d1d3c382af6 100644
--- a/sys/dev/usb/if_udav.c
+++ b/sys/dev/usb/if_udav.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_udav.c,v 1.28 2007/06/10 10:15:35 mbalmer Exp $ */
+/* $OpenBSD: if_udav.c,v 1.29 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: if_udav.c,v 1.3 2004/04/23 17:25:25 itojun Exp $ */
/* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */
/*
@@ -295,7 +295,7 @@ udav_attach(struct device *parent, struct device *self, void *aux)
sc->sc_attached = 1;
splx(s);
- usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, dev, USBDEV(sc->sc_dev));
+ usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, dev, &sc->sc_dev);
return;
@@ -327,7 +327,7 @@ udav_detach(struct device *self, int flags)
if (--sc->sc_refcnt >= 0) {
/* Wait for processes to go away */
- usb_detach_wait(USBDEV(sc->sc_dev));
+ usb_detach_wait(&sc->sc_dev);
}
if (ifp->if_flags & IFF_RUNNING)
udav_stop(GET_IFP(sc), 1);
@@ -353,7 +353,7 @@ udav_detach(struct device *self, int flags)
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (0);
}
@@ -387,7 +387,7 @@ udav_mem_read(struct udav_softc *sc, int offset, void *buf, int len)
sc->sc_refcnt++;
err = usbd_do_request(sc->sc_udev, &req, buf);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
if (err) {
DPRINTF(("%s: %s: read failed. off=%04x, err=%d\n",
USBDEVNAME(sc->sc_dev), __func__, offset, err));
@@ -424,7 +424,7 @@ udav_mem_write(struct udav_softc *sc, int offset, void *buf, int len)
sc->sc_refcnt++;
err = usbd_do_request(sc->sc_udev, &req, buf);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
if (err) {
DPRINTF(("%s: %s: write failed. off=%04x, err=%d\n",
USBDEVNAME(sc->sc_dev), __func__, offset, err));
@@ -460,7 +460,7 @@ udav_mem_write1(struct udav_softc *sc, int offset, unsigned char ch)
sc->sc_refcnt++;
err = usbd_do_request(sc->sc_udev, &req, NULL);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
if (err) {
DPRINTF(("%s: %s: write failed. off=%04x, err=%d\n",
USBDEVNAME(sc->sc_dev), __func__, offset, err));
@@ -498,7 +498,7 @@ udav_csr_read(struct udav_softc *sc, int offset, void *buf, int len)
sc->sc_refcnt++;
err = usbd_do_request(sc->sc_udev, &req, buf);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
if (err) {
DPRINTF(("%s: %s: read failed. off=%04x, err=%d\n",
USBDEVNAME(sc->sc_dev), __func__, offset, err));
@@ -535,7 +535,7 @@ udav_csr_write(struct udav_softc *sc, int offset, void *buf, int len)
sc->sc_refcnt++;
err = usbd_do_request(sc->sc_udev, &req, buf);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
if (err) {
DPRINTF(("%s: %s: write failed. off=%04x, err=%d\n",
USBDEVNAME(sc->sc_dev), __func__, offset, err));
@@ -588,7 +588,7 @@ udav_csr_write1(struct udav_softc *sc, int offset, unsigned char ch)
sc->sc_refcnt++;
err = usbd_do_request(sc->sc_udev, &req, NULL);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
if (err) {
DPRINTF(("%s: %s: write failed. off=%04x, err=%d\n",
USBDEVNAME(sc->sc_dev), __func__, offset, err));
@@ -849,7 +849,7 @@ udav_openpipes(struct udav_softc *sc)
done:
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return (error);
}
@@ -1025,7 +1025,7 @@ udav_send(struct udav_softc *sc, struct mbuf *m, int idx)
sc->sc_refcnt++;
err = usbd_transfer(c->udav_xfer);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
if (err != USBD_IN_PROGRESS) {
printf("%s: udav_send error=%s\n", USBDEVNAME(sc->sc_dev),
usbd_errstr(err));
@@ -1072,7 +1072,7 @@ udav_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
sc->sc_refcnt++;
usbd_clear_endpoint_stall_async(sc->sc_pipe_tx);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
}
splx(s);
return;
@@ -1119,7 +1119,7 @@ udav_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
sc->sc_refcnt++;
usbd_clear_endpoint_stall_async(sc->sc_pipe_rx);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
}
goto done;
}
@@ -1178,7 +1178,7 @@ udav_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
sc->sc_refcnt++;
usbd_transfer(xfer);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
DPRINTF(("%s: %s: start rx\n", USBDEVNAME(sc->sc_dev), __func__));
}
@@ -1511,7 +1511,7 @@ udav_unlock_mii(struct udav_softc *sc)
rw_exit_write(&sc->sc_mii_lock);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
}
int
diff --git a/sys/dev/usb/if_upl.c b/sys/dev/usb/if_upl.c
index 8eb72e2bee7..494fd3456a1 100644
--- a/sys/dev/usb/if_upl.c
+++ b/sys/dev/usb/if_upl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_upl.c,v 1.33 2007/06/10 10:15:35 mbalmer Exp $ */
+/* $OpenBSD: if_upl.c,v 1.34 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: if_upl.c,v 1.19 2002/07/11 21:14:26 augustss Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -311,7 +311,7 @@ upl_attach(struct device *parent, struct device *self, void *aux)
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
}
int
@@ -348,7 +348,7 @@ upl_detach(struct device *self, int flags)
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (0);
}
diff --git a/sys/dev/usb/if_url.c b/sys/dev/usb/if_url.c
index e8a6a58c5b5..7ffb711690d 100644
--- a/sys/dev/usb/if_url.c
+++ b/sys/dev/usb/if_url.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_url.c,v 1.42 2007/06/10 10:15:35 mbalmer Exp $ */
+/* $OpenBSD: if_url.c,v 1.43 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: if_url.c,v 1.6 2002/09/29 10:19:21 martin Exp $ */
/*
* Copyright (c) 2001, 2002
@@ -304,7 +304,7 @@ url_attach(struct device *parent, struct device *self, void *aux)
sc->sc_attached = 1;
splx(s);
- usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, dev, USBDEV(sc->sc_dev));
+ usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, dev, &sc->sc_dev);
return;
@@ -336,7 +336,7 @@ url_detach(struct device *self, int flags)
if (--sc->sc_refcnt >= 0) {
/* Wait for processes to go away */
- usb_detach_wait(USBDEV(sc->sc_dev));
+ usb_detach_wait(&sc->sc_dev);
}
if (ifp->if_flags & IFF_RUNNING)
@@ -364,7 +364,7 @@ url_detach(struct device *self, int flags)
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (0);
}
@@ -397,7 +397,7 @@ url_mem(struct url_softc *sc, int cmd, int offset, void *buf, int len)
sc->sc_refcnt++;
err = usbd_do_request(sc->sc_udev, &req, buf);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
if (err) {
DPRINTF(("%s: url_mem(): %s failed. off=%04x, err=%d\n",
USBDEVNAME(sc->sc_dev),
@@ -739,7 +739,7 @@ url_openpipes(struct url_softc *sc)
done:
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return (error);
}
@@ -908,7 +908,7 @@ url_send(struct url_softc *sc, struct mbuf *m, int idx)
sc->sc_refcnt++;
err = usbd_transfer(c->url_xfer);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
if (err != USBD_IN_PROGRESS) {
printf("%s: url_send error=%s\n", USBDEVNAME(sc->sc_dev),
usbd_errstr(err));
@@ -955,7 +955,7 @@ url_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
sc->sc_refcnt++;
usbd_clear_endpoint_stall_async(sc->sc_pipe_tx);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
}
splx(s);
return;
@@ -1002,7 +1002,7 @@ url_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
sc->sc_refcnt++;
usbd_clear_endpoint_stall_async(sc->sc_pipe_rx);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
}
goto done;
}
@@ -1065,7 +1065,7 @@ url_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
sc->sc_refcnt++;
usbd_transfer(xfer);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
DPRINTF(("%s: %s: start rx\n", USBDEVNAME(sc->sc_dev), __func__));
}
@@ -1399,7 +1399,7 @@ url_unlock_mii(struct url_softc *sc)
rw_exit_write(&sc->sc_mii_lock);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
}
int
diff --git a/sys/dev/usb/if_wi_usb.c b/sys/dev/usb/if_wi_usb.c
index ccfbcd3558a..04dcdaef226 100644
--- a/sys/dev/usb/if_wi_usb.c
+++ b/sys/dev/usb/if_wi_usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_usb.c,v 1.38 2007/06/10 10:15:35 mbalmer Exp $ */
+/* $OpenBSD: if_wi_usb.c,v 1.39 2007/06/10 10:53:48 mbalmer Exp $ */
/*
* Copyright (c) 2003 Dale Rahn. All rights reserved.
@@ -379,7 +379,7 @@ wi_usb_attach(struct device *parent, struct device *self, void *aux)
kthread_create_deferred(wi_usb_start_thread, sc);
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->wi_usb_udev,
- USBDEV(sc->wi_usb_dev));
+ &sc->wi_usb_dev);
}
int
@@ -426,7 +426,7 @@ wi_usb_detach(struct device *self, int flags)
if (--sc->wi_usb_refcnt >= 0) {
/* Wait for processes to go away. */
- usb_detach_wait(USBDEV(sc->wi_usb_dev));
+ usb_detach_wait(&sc->wi_usb_dev);
}
while (sc->wi_usb_nummem) {
@@ -479,7 +479,7 @@ wi_usb_detach(struct device *self, int flags)
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->wi_usb_udev,
- USBDEV(sc->wi_usb_dev));
+ &sc->wi_usb_dev);
return (0);
}
@@ -1077,7 +1077,7 @@ wi_usb_do_transmit_sync(struct wi_usb_softc *sc, struct wi_usb_chain *c,
}
done:
if (--sc->wi_usb_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->wi_usb_dev));
+ usb_detach_wakeup(&sc->wi_usb_dev);
return err;
}
@@ -1116,7 +1116,7 @@ wi_usb_txeof(usbd_xfer_handle xfer, usbd_private_handle priv,
usbd_clear_endpoint_stall_async(
sc->wi_usb_ep[WI_USB_ENDPT_TX]);
if (--sc->wi_usb_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->wi_usb_dev));
+ usb_detach_wakeup(&sc->wi_usb_dev);
}
splx(s);
return;
@@ -1162,7 +1162,7 @@ wi_usb_txeof_frm(usbd_xfer_handle xfer, usbd_private_handle priv,
usbd_clear_endpoint_stall_async(
sc->wi_usb_ep[WI_USB_ENDPT_TX]);
if (--sc->wi_usb_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->wi_usb_dev));
+ usb_detach_wakeup(&sc->wi_usb_dev);
}
splx(s);
return;
@@ -1297,7 +1297,7 @@ wi_usb_open_pipes(struct wi_usb_softc *sc)
done:
if (--sc->wi_usb_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->wi_usb_dev));
+ usb_detach_wakeup(&sc->wi_usb_dev);
return (error);
}
@@ -1407,7 +1407,7 @@ wi_usb_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status
usbd_clear_endpoint_stall_async(
sc->wi_usb_ep[WI_USB_ENDPT_RX]);
if (--sc->wi_usb_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->wi_usb_dev));
+ usb_detach_wakeup(&sc->wi_usb_dev);
}
goto done;
}
@@ -1485,7 +1485,7 @@ wi_usb_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status
sc->wi_usb_refcnt++;
usbd_transfer(c->wi_usb_xfer);
if (--sc->wi_usb_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->wi_usb_dev));
+ usb_detach_wakeup(&sc->wi_usb_dev);
DPRINTFN(10,("%s: %s: start rx\n", USBDEVNAME(sc->wi_usb_dev),
__func__));
@@ -1510,7 +1510,7 @@ wi_usb_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
usbd_clear_endpoint_stall_async(
sc->wi_usb_ep[WI_USB_ENDPT_RX]);
if (--sc->wi_usb_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->wi_usb_dev));
+ usb_detach_wakeup(&sc->wi_usb_dev);
}
return;
}
@@ -1829,7 +1829,7 @@ wi_usb_thread(void *arg)
for(;;) {
if (wi_thread_info->dying) {
if (--sc->wi_usb_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->wi_usb_dev));
+ usb_detach_wakeup(&sc->wi_usb_dev);
kthread_exit(0);
}
diff --git a/sys/dev/usb/if_zyd.c b/sys/dev/usb/if_zyd.c
index bbb177ba999..0105d81eab3 100644
--- a/sys/dev/usb/if_zyd.c
+++ b/sys/dev/usb/if_zyd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_zyd.c,v 1.54 2007/06/09 12:22:53 mbalmer Exp $ */
+/* $OpenBSD: if_zyd.c,v 1.55 2007/06/10 10:53:48 mbalmer Exp $ */
/*-
* Copyright (c) 2006 by Damien Bergamini <damien.bergamini@free.fr>
@@ -402,7 +402,7 @@ zyd_complete_attach(struct zyd_softc *sc)
#endif
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
fail: return error;
}
@@ -438,7 +438,7 @@ zyd_detach(struct device *self, int flags)
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return 0;
}
diff --git a/sys/dev/usb/moscom.c b/sys/dev/usb/moscom.c
index 54180c22738..0dce335ceb5 100644
--- a/sys/dev/usb/moscom.c
+++ b/sys/dev/usb/moscom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: moscom.c,v 1.5 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: moscom.c,v 1.6 2007/06/10 10:53:48 mbalmer Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@@ -252,7 +252,7 @@ moscom_attach(struct device *parent, struct device *self, void *aux)
uca.info = NULL;
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
sc->sc_subdev = config_found_sm(self, &uca, ucomprint, ucomsubmatch);
}
@@ -270,7 +270,7 @@ moscom_detach(struct device *self, int flags)
}
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}
diff --git a/sys/dev/usb/uark.c b/sys/dev/usb/uark.c
index 634e07a9975..af1689a52c0 100644
--- a/sys/dev/usb/uark.c
+++ b/sys/dev/usb/uark.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uark.c,v 1.5 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: uark.c,v 1.6 2007/06/10 10:53:48 mbalmer Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@@ -179,7 +179,7 @@ uark_attach(struct device *parent, struct device *self, void *aux)
uca.info = NULL;
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
sc->sc_subdev = config_found_sm(self, &uca, ucomprint, ucomsubmatch);
}
@@ -197,7 +197,7 @@ uark_detach(struct device *self, int flags)
}
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}
diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c
index b8a0f6297f9..48cd8c31f93 100644
--- a/sys/dev/usb/uaudio.c
+++ b/sys/dev/usb/uaudio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uaudio.c,v 1.42 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: uaudio.c,v 1.43 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: uaudio.c,v 1.90 2004/10/29 17:12:53 kent Exp $ */
/*
@@ -452,7 +452,7 @@ uaudio_attach(struct device *parent, struct device *self, void *aux)
printf(", %d mixer controls\n", sc->sc_nctls);
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
DPRINTF(("uaudio_attach: doing audio_attach_mi\n"));
sc->sc_audiodev = audio_attach_mi(&uaudio_hw_if, sc, &sc->sc_dev);
@@ -497,7 +497,7 @@ uaudio_detach(device_ptr_t self, int flags)
rv = config_detach(sc->sc_audiodev, flags);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}
diff --git a/sys/dev/usb/uberry.c b/sys/dev/usb/uberry.c
index 97e7f6e3cac..cfa1a1c71f7 100644
--- a/sys/dev/usb/uberry.c
+++ b/sys/dev/usb/uberry.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uberry.c,v 1.6 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: uberry.c,v 1.7 2007/06/10 10:53:48 mbalmer Exp $ */
/*-
* Copyright (c) 2006 Theo de Raadt <deraadt@openbsd.org>
@@ -85,7 +85,7 @@ uberry_attach(struct device *parent, struct device *self, void *aux)
printf("%s: Charging enabled\n", USBDEVNAME(sc->sc_dev));
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
}
int
@@ -94,7 +94,7 @@ uberry_detach(struct device *self, int flags)
struct uberry_softc *sc = (struct uberry_softc *)self;
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return 0;
}
diff --git a/sys/dev/usb/ubsa.c b/sys/dev/usb/ubsa.c
index a8a482c3233..a09c44c42ef 100644
--- a/sys/dev/usb/ubsa.c
+++ b/sys/dev/usb/ubsa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubsa.c,v 1.25 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: ubsa.c,v 1.26 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: ubsa.c,v 1.5 2002/11/25 00:51:33 fvdl Exp $ */
/*-
* Copyright (c) 2002, Alexander Kabaev <kan.FreeBSD.org>.
@@ -373,7 +373,7 @@ ubsa_attach(struct device *parent, struct device *self, void *aux)
uca.info = NULL;
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
DPRINTF(("ubsa: in = 0x%x, out = 0x%x, intr = 0x%x\n",
uca.bulkin, uca.bulkout, sc->sc_intr_number));
@@ -407,7 +407,7 @@ ubsa_detach(struct device *self, int flags)
}
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}
diff --git a/sys/dev/usb/ubt.c b/sys/dev/usb/ubt.c
index 5ee08bff855..c90a6814b15 100644
--- a/sys/dev/usb/ubt.c
+++ b/sys/dev/usb/ubt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubt.c,v 1.4 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: ubt.c,v 1.5 2007/06/10 10:53:48 mbalmer Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -425,7 +425,7 @@ ubt_attach(struct device *parent, struct device *self, void *aux)
hci_attach(&sc->sc_unit);
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
sc->sc_ok = 1;
@@ -460,12 +460,12 @@ ubt_detach(struct device *self, int flags)
/* wait for all processes to finish */
s = splusb();
if (sc->sc_refcnt-- > 0)
- usb_detach_wait(USBDEV(sc->sc_dev));
+ usb_detach_wait(&sc->sc_dev);
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
DPRINTFN(1, "driver detached\n");
@@ -917,7 +917,7 @@ ubt_xmit_cmd_complete(usbd_xfer_handle xfer,
if (--sc->sc_refcnt < 0) {
DPRINTF("sc_refcnt=%d\n", sc->sc_refcnt);
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return;
}
@@ -1012,7 +1012,7 @@ ubt_xmit_acl_complete(usbd_xfer_handle xfer,
unit->hci_flags &= ~BTF_XMIT_ACL;
if (--sc->sc_refcnt < 0) {
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return;
}
@@ -1159,7 +1159,7 @@ ubt_xmit_sco_complete(usbd_xfer_handle xfer,
}
if (--sc->sc_refcnt < 0) {
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return;
}
@@ -1296,7 +1296,7 @@ ubt_recv_acl_complete(usbd_xfer_handle xfer,
if (--sc->sc_refcnt < 0) {
DPRINTF("refcnt = %d\n", sc->sc_refcnt);
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return;
}
@@ -1389,7 +1389,7 @@ ubt_recv_sco_complete(usbd_xfer_handle xfer,
if (--sc->sc_refcnt < 0) {
DPRINTF("refcnt=%d\n", sc->sc_refcnt);
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return;
}
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c
index 417bcb4d0f4..a02fe611570 100644
--- a/sys/dev/usb/ucom.c
+++ b/sys/dev/usb/ucom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ucom.c,v 1.36 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: ucom.c,v 1.37 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: ucom.c,v 1.49 2003/01/01 00:10:25 thorpej Exp $ */
/*
@@ -162,7 +162,7 @@ ucom_unlock(struct ucom_softc *sc)
{
rw_exit_write(&sc->sc_lock);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
}
int
@@ -233,7 +233,7 @@ ucom_detach(struct device *self, int flags)
ttyflush(tp, FREAD|FWRITE);
}
/* Wait for processes to go away. */
- usb_detach_wait(USBDEV(sc->sc_dev));
+ usb_detach_wait(&sc->sc_dev);
}
splx(s);
@@ -575,7 +575,7 @@ ucomread(dev_t dev, struct uio *uio, int flag)
sc->sc_refcnt++;
error = (*LINESW(tp, l_read))(tp, uio, flag);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return (error);
}
@@ -592,7 +592,7 @@ ucomwrite(dev_t dev, struct uio *uio, int flag)
sc->sc_refcnt++;
error = (*LINESW(tp, l_write))(tp, uio, flag);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return (error);
}
@@ -614,7 +614,7 @@ ucomioctl(dev_t dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
sc->sc_refcnt++;
error = ucom_do_ioctl(sc, cmd, data, flag, p);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return (error);
}
diff --git a/sys/dev/usb/ucycom.c b/sys/dev/usb/ucycom.c
index 064fc6142af..780ab86f542 100644
--- a/sys/dev/usb/ucycom.c
+++ b/sys/dev/usb/ucycom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ucycom.c,v 1.7 2007/06/05 08:43:55 mbalmer Exp $ */
+/* $OpenBSD: ucycom.c,v 1.8 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: ucycom.c,v 1.3 2005/08/05 07:27:47 skrll Exp $ */
/*
@@ -232,7 +232,7 @@ ucycom_attach(struct device *parent, struct device *self, void *aux)
uca.info = NULL;
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_hdev.sc_dev));
+ &sc->sc_hdev.sc_dev);
sc->sc_subdev = config_found_sm(self, &uca, ucomprint, ucomsubmatch);
DPRINTF(("ucycom_attach: complete %p\n", sc->sc_subdev));
diff --git a/sys/dev/usb/udcf.c b/sys/dev/usb/udcf.c
index 9bc035dbaae..54c50582db3 100644
--- a/sys/dev/usb/udcf.c
+++ b/sys/dev/usb/udcf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udcf.c,v 1.34 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: udcf.c,v 1.35 2007/06/10 10:53:48 mbalmer Exp $ */
/*
* Copyright (c) 2006 Marc Balmer <mbalmer@openbsd.org>
@@ -249,7 +249,7 @@ udcf_attach(struct device *parent, struct device *self, void *aux)
}
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
usb_init_task(&sc->sc_task, udcf_probe, sc);
usb_init_task(&sc->sc_bv_task, udcf_bv_probe, sc);
@@ -335,7 +335,7 @@ udcf_detach(struct device *self, int flags)
usb_rem_task(sc->sc_udev, &sc->sc_ct_task);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return 0;
}
diff --git a/sys/dev/usb/udsbr.c b/sys/dev/usb/udsbr.c
index a0c46384e65..b2bcc0185fd 100644
--- a/sys/dev/usb/udsbr.c
+++ b/sys/dev/usb/udsbr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udsbr.c,v 1.13 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: udsbr.c,v 1.14 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: udsbr.c,v 1.7 2002/07/11 21:14:27 augustss Exp $ */
/*
@@ -146,9 +146,9 @@ udsbr_attach(struct device *parent, struct device *self, void *aux)
DPRINTFN(10, ("udsbr_attach: %p\n", sc->sc_udev));
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
- sc->sc_child = radio_attach_mi(&udsbr_hw_if, sc, USBDEV(sc->sc_dev));
+ sc->sc_child = radio_attach_mi(&udsbr_hw_if, sc, &sc->sc_dev);
}
int
@@ -161,7 +161,7 @@ udsbr_detach(struct device *self, int flags)
rv = config_detach(sc->sc_child, flags);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}
diff --git a/sys/dev/usb/ueagle.c b/sys/dev/usb/ueagle.c
index 107f108519f..452b22aec36 100644
--- a/sys/dev/usb/ueagle.c
+++ b/sys/dev/usb/ueagle.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ueagle.c,v 1.17 2007/06/09 12:22:53 mbalmer Exp $ */
+/* $OpenBSD: ueagle.c,v 1.18 2007/06/10 10:53:48 mbalmer Exp $ */
/*-
* Copyright (c) 2003-2006
@@ -224,7 +224,7 @@ ueagle_attach(struct device *parent, struct device *self, void *aux)
#endif
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
}
int
@@ -253,7 +253,7 @@ ueagle_detach(struct device *self, int flags)
if_detach(ifp);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return 0;
}
diff --git a/sys/dev/usb/uftdi.c b/sys/dev/usb/uftdi.c
index 055c2e83a55..6e11ad6d992 100644
--- a/sys/dev/usb/uftdi.c
+++ b/sys/dev/usb/uftdi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uftdi.c,v 1.36 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: uftdi.c,v 1.37 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: uftdi.c,v 1.14 2003/02/23 04:20:07 simonb Exp $ */
/*
@@ -367,7 +367,7 @@ uftdi_attach(struct device *parent, struct device *self, void *aux)
uca.info = NULL;
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
DPRINTF(("uftdi: in=0x%x out=0x%x\n", uca.bulkin, uca.bulkout));
sc->sc_subdev = config_found_sm(self, &uca, ucomprint, ucomsubmatch);
@@ -411,7 +411,7 @@ uftdi_detach(device_ptr_t self, int flags)
}
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (0);
}
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
index 2d6ed69f777..054199e78e5 100644
--- a/sys/dev/usb/ugen.c
+++ b/sys/dev/usb/ugen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ugen.c,v 1.41 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: ugen.c,v 1.42 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $ */
/* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -194,7 +194,7 @@ ugen_attach(struct device *parent, struct device *self, void *aux)
}
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
}
int
@@ -618,7 +618,7 @@ ugenread(dev_t dev, struct uio *uio, int flag)
sc->sc_refcnt++;
error = ugen_do_read(sc, endpt, uio, flag);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return (error);
}
@@ -717,7 +717,7 @@ ugenwrite(dev_t dev, struct uio *uio, int flag)
sc->sc_refcnt++;
error = ugen_do_write(sc, endpt, uio, flag);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return (error);
}
@@ -764,7 +764,7 @@ ugen_detach(struct device *self, int flags)
for (i = 0; i < USB_MAX_ENDPOINTS; i++)
wakeup(&sc->sc_endpoints[i][IN]);
/* Wait for processes to go away. */
- usb_detach_wait(USBDEV(sc->sc_dev));
+ usb_detach_wait(&sc->sc_dev);
}
splx(s);
@@ -778,7 +778,7 @@ ugen_detach(struct device *self, int flags)
vdevgone(maj, mn, mn + USB_MAX_ENDPOINTS - 1, VCHR);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (0);
}
@@ -1263,7 +1263,7 @@ ugenioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
sc->sc_refcnt++;
error = ugen_do_ioctl(sc, endpt, cmd, addr, flag, p);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return (error);
}
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
index 5aa478acd1c..aa0d9643a92 100644
--- a/sys/dev/usb/uhid.c
+++ b/sys/dev/usb/uhid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhid.c,v 1.34 2007/06/05 08:43:55 mbalmer Exp $ */
+/* $OpenBSD: uhid.c,v 1.35 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -179,7 +179,7 @@ uhid_detach(struct device *self, int flags)
/* Wake everyone */
wakeup(&sc->sc_q);
/* Wait for processes to go away. */
- usb_detach_wait(USBDEV(sc->sc_hdev.sc_dev));
+ usb_detach_wait(&sc->sc_hdev.sc_dev);
}
splx(s);
}
@@ -196,7 +196,7 @@ uhid_detach(struct device *self, int flags)
#if 0
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH,
sc->sc_hdev.sc_parent->sc_udev,
- USBDEV(sc->sc_hdev.sc_dev));
+ &sc->sc_hdev.sc_dev);
#endif
return (0);
@@ -346,7 +346,7 @@ uhidread(dev_t dev, struct uio *uio, int flag)
sc->sc_refcnt++;
error = uhid_do_read(sc, uio, flag);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_hdev.sc_dev));
+ usb_detach_wakeup(&sc->sc_hdev.sc_dev);
return (error);
}
@@ -388,7 +388,7 @@ uhidwrite(dev_t dev, struct uio *uio, int flag)
sc->sc_refcnt++;
error = uhid_do_write(sc, uio, flag);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_hdev.sc_dev));
+ usb_detach_wakeup(&sc->sc_hdev.sc_dev);
return (error);
}
@@ -518,7 +518,7 @@ uhidioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
sc->sc_refcnt++;
error = uhid_do_ioctl(sc, cmd, addr, flag, p);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_hdev.sc_dev));
+ usb_detach_wakeup(&sc->sc_hdev.sc_dev);
return (error);
}
diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c
index 0ddaea1a9a2..11b983780b9 100644
--- a/sys/dev/usb/uhidev.c
+++ b/sys/dev/usb/uhidev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhidev.c,v 1.23 2007/06/05 08:43:55 mbalmer Exp $ */
+/* $OpenBSD: uhidev.c,v 1.24 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -254,7 +254,7 @@ uhidev_attach(struct device *parent, struct device *self, void *aux)
sc->sc_isize = 0;
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
for (repid = 0; repid < nrepid; repid++) {
repsz = hid_report_size(desc, size, hid_input, repid);
@@ -384,7 +384,7 @@ uhidev_detach(struct device *self, int flags)
}
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c
index cfec381f835..0b9a9bfa72e 100644
--- a/sys/dev/usb/uhub.c
+++ b/sys/dev/usb/uhub.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhub.c,v 1.43 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: uhub.c,v 1.44 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: uhub.c,v 1.64 2003/02/08 03:32:51 ichiro Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */
@@ -238,7 +238,7 @@ uhub_attach(struct device *parent, struct device *self, void *aux)
/* Wait with power off for a while. */
usbd_delay_ms(dev, USB_POWER_DOWN_TIME);
- usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, dev, USBDEV(sc->sc_dev));
+ usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, dev, &sc->sc_dev);
/*
* To have the best chance of success we do things in the exact same
@@ -413,7 +413,7 @@ uhub_explore(usbd_device_handle dev)
/* Disconnected */
DPRINTF(("uhub_explore: device addr=%d disappeared "
"on port %d\n", up->device->address, port));
- usb_disconnect_port(up, USBDEV(sc->sc_dev));
+ usb_disconnect_port(up, &sc->sc_dev);
usbd_clear_port_feature(dev, port,
UHF_C_PORT_CONNECTION);
}
@@ -465,7 +465,7 @@ uhub_explore(usbd_device_handle dev)
else
speed = USB_SPEED_FULL;
/* Get device info and set its address. */
- err = usbd_new_device(USBDEV(sc->sc_dev), dev->bus,
+ err = usbd_new_device(&sc->sc_dev, dev->bus,
dev->depth + 1, speed, port, up);
/* XXX retry a few times? */
if (err) {
@@ -549,7 +549,7 @@ uhub_detach(struct device *self, int flags)
}
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_hub,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
if (hub->ports[0].tt)
free(hub->ports[0].tt, M_USBDEV);
diff --git a/sys/dev/usb/uipaq.c b/sys/dev/usb/uipaq.c
index be7e121c28d..457be69965e 100644
--- a/sys/dev/usb/uipaq.c
+++ b/sys/dev/usb/uipaq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipaq.c,v 1.7 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: uipaq.c,v 1.8 2007/06/10 10:53:48 mbalmer Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -209,7 +209,7 @@ uipaq_attach(struct device *parent, struct device *self, void *aux)
}*/
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
uca.bulkin = uca.bulkout = -1;
for (i=0; i<id->bNumEndpoints; i++) {
@@ -385,7 +385,7 @@ uipaq_detach(device_ptr_t self, int flags)
}
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}
diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c
index aff35c321c8..f89d2b1495d 100644
--- a/sys/dev/usb/ulpt.c
+++ b/sys/dev/usb/ulpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ulpt.c,v 1.25 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: ulpt.c,v 1.26 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: ulpt.c,v 1.57 2003/01/05 10:19:42 scw Exp $ */
/* $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.24 1999/11/17 22:33:44 n_hibma Exp $ */
@@ -294,7 +294,7 @@ ulpt_attach(struct device *parent, struct device *self, void *aux)
}
#endif
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
}
int
@@ -332,7 +332,7 @@ ulpt_detach(struct device *self, int flags)
if (--sc->sc_refcnt >= 0) {
/* There is noone to wake, aborting the pipe is enough */
/* Wait for processes to go away. */
- usb_detach_wait(USBDEV(sc->sc_dev));
+ usb_detach_wait(&sc->sc_dev);
}
splx(s);
@@ -347,7 +347,7 @@ ulpt_detach(struct device *self, int flags)
vdevgone(maj, mn | ULPT_NOPRIME , mn | ULPT_NOPRIME, VCHR);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (0);
}
@@ -510,7 +510,7 @@ ulptopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
done:
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
DPRINTF(("ulptopen: done, error=%d\n", error));
return (error);
@@ -621,7 +621,7 @@ ulptwrite(dev_t dev, struct uio *uio, int flags)
sc->sc_refcnt++;
error = ulpt_do_write(sc, uio, flags);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return (error);
}
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c
index a3cef5dd2a8..ea974d45dc2 100644
--- a/sys/dev/usb/umass.c
+++ b/sys/dev/usb/umass.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umass.c,v 1.47 2007/06/05 08:43:55 mbalmer Exp $ */
+/* $OpenBSD: umass.c,v 1.48 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: umass.c,v 1.116 2004/06/30 05:53:46 mycroft Exp $ */
/*
@@ -623,7 +623,7 @@ umass_attach(struct device *parent, struct device *self, void *aux)
}
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
DPRINTF(UDMASS_GEN, ("%s: Attach finished\n", USBDEVNAME(sc->sc_dev)));
}
@@ -652,7 +652,7 @@ umass_detach(struct device *self, int flags)
printf("%s: waiting for refcnt\n", USBDEVNAME(sc->sc_dev));
#endif
/* Wait for processes to go away. */
- usb_detach_wait(USBDEV(sc->sc_dev));
+ usb_detach_wait(&sc->sc_dev);
}
splx(s);
@@ -670,7 +670,7 @@ umass_detach(struct device *self, int flags)
umass_disco(sc);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}
diff --git a/sys/dev/usb/umass_scsi.c b/sys/dev/usb/umass_scsi.c
index 39b8056ad8c..980fa6394e4 100644
--- a/sys/dev/usb/umass_scsi.c
+++ b/sys/dev/usb/umass_scsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umass_scsi.c,v 1.15 2006/11/30 10:05:32 deraadt Exp $ */
+/* $OpenBSD: umass_scsi.c,v 1.16 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: umass_scsipi.c,v 1.9 2003/02/16 23:14:08 augustss Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -114,7 +114,7 @@ umass_scsi_attach(struct umass_softc *sc)
scbus->base.sc_child =
config_found((struct device *)sc, &saa, scsiprint);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return (0);
}
@@ -144,7 +144,7 @@ umass_atapi_attach(struct umass_softc *sc)
scbus->base.sc_child = config_found((struct device *)sc,
&saa, scsiprint);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return (0);
}
diff --git a/sys/dev/usb/umct.c b/sys/dev/usb/umct.c
index 9b24b31537b..41c3b198e5b 100644
--- a/sys/dev/usb/umct.c
+++ b/sys/dev/usb/umct.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umct.c,v 1.21 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: umct.c,v 1.22 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: umct.c,v 1.10 2003/02/23 04:20:07 simonb Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -302,7 +302,7 @@ umct_attach(struct device *parent, struct device *self, void *aux)
umct_init(sc);
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
DPRINTF(("umct: in=0x%x out=0x%x intr=0x%x\n",
uca.bulkin, uca.bulkout, sc->sc_intr_number ));
@@ -331,7 +331,7 @@ umct_detach(struct device *self, int flags)
}
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}
diff --git a/sys/dev/usb/umidi.c b/sys/dev/usb/umidi.c
index 92102230676..901b1238aff 100644
--- a/sys/dev/usb/umidi.c
+++ b/sys/dev/usb/umidi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umidi.c,v 1.18 2007/05/27 04:00:25 jsg Exp $ */
+/* $OpenBSD: umidi.c,v 1.19 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: umidi.c,v 1.16 2002/07/11 21:14:32 augustss Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -220,7 +220,7 @@ umidi_attach(struct device *parent, struct device *self, void *aux)
}
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH,
- sc->sc_udev, USBDEV(sc->sc_dev));
+ sc->sc_udev, &sc->sc_dev);
return;
error:
@@ -260,7 +260,7 @@ umidi_detach(struct device *self, int flags)
free_all_endpoints(sc);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return 0;
}
diff --git a/sys/dev/usb/umodem.c b/sys/dev/usb/umodem.c
index 44794c51baa..75f7f0df930 100644
--- a/sys/dev/usb/umodem.c
+++ b/sys/dev/usb/umodem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umodem.c,v 1.27 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: umodem.c,v 1.28 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: umodem.c,v 1.45 2002/09/23 05:51:23 simonb Exp $ */
/*
@@ -366,7 +366,7 @@ umodem_attach(struct device *parent, struct device *self, void *aux)
uca.info = NULL;
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
DPRINTF(("umodem_attach: sc=%p\n", sc));
sc->sc_subdev = config_found_sm(self, &uca, ucomprint, ucomsubmatch);
@@ -745,7 +745,7 @@ umodem_detach(struct device *self, int flags)
rv = config_detach(sc->sc_subdev, flags);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}
diff --git a/sys/dev/usb/umsm.c b/sys/dev/usb/umsm.c
index d4e7ff20bde..a070acb7fc0 100644
--- a/sys/dev/usb/umsm.c
+++ b/sys/dev/usb/umsm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umsm.c,v 1.10 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: umsm.c,v 1.11 2007/06/10 10:53:48 mbalmer Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@@ -162,7 +162,7 @@ umsm_attach(struct device *parent, struct device *self, void *aux)
uca.info = NULL;
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
sc->sc_subdev = config_found_sm(self, &uca, ucomprint, ucomsubmatch);
}
@@ -180,7 +180,7 @@ umsm_detach(struct device *self, int flags)
}
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}
diff --git a/sys/dev/usb/uow.c b/sys/dev/usb/uow.c
index d34eda0739e..a2f253ca3b2 100644
--- a/sys/dev/usb/uow.c
+++ b/sys/dev/usb/uow.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uow.c,v 1.17 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: uow.c,v 1.18 2007/06/10 10:53:48 mbalmer Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -258,7 +258,7 @@ uow_detach(struct device *self, int flags)
splx(s);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}
diff --git a/sys/dev/usb/uplcom.c b/sys/dev/usb/uplcom.c
index 1a4af0228f5..a382c789e4e 100644
--- a/sys/dev/usb/uplcom.c
+++ b/sys/dev/usb/uplcom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uplcom.c,v 1.37 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: uplcom.c,v 1.38 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: uplcom.c,v 1.29 2002/09/23 05:51:23 simonb Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -395,7 +395,7 @@ uplcom_attach(struct device *parent, struct device *self, void *aux)
}
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
DPRINTF(("uplcom: in=0x%x out=0x%x intr=0x%x\n",
uca.bulkin, uca.bulkout, sc->sc_intr_number ));
@@ -424,7 +424,7 @@ uplcom_detach(struct device *self, int flags)
}
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}
diff --git a/sys/dev/usb/urio.c b/sys/dev/usb/urio.c
index b2ea04ed352..33e8b583d17 100644
--- a/sys/dev/usb/urio.c
+++ b/sys/dev/usb/urio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: urio.c,v 1.25 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: urio.c,v 1.26 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: urio.c,v 1.15 2002/10/23 09:14:02 jdolecek Exp $ */
/*
@@ -183,7 +183,7 @@ urio_attach(struct device *parent, struct device *self, void *aux)
DPRINTFN(10, ("urio_attach: %p\n", sc->sc_udev));
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
}
int
@@ -211,7 +211,7 @@ urio_detach(struct device *self, int flags)
s = splusb();
if (--sc->sc_refcnt >= 0) {
/* Wait for processes to go away. */
- usb_detach_wait(USBDEV(sc->sc_dev));
+ usb_detach_wait(&sc->sc_dev);
}
splx(s);
@@ -225,7 +225,7 @@ urio_detach(struct device *self, int flags)
vdevgone(maj, mn, mn, VCHR);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (0);
}
@@ -354,7 +354,7 @@ urioread(dev_t dev, struct uio *uio, int flag)
usbd_free_xfer(xfer);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return (error);
}
@@ -412,7 +412,7 @@ uriowrite(dev_t dev, struct uio *uio, int flag)
usbd_free_xfer(xfer);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
DPRINTFN(5, ("uriowrite: done unit=%d, error=%d\n", URIOUNIT(dev),
error));
@@ -501,7 +501,7 @@ urioioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
&req_actlen, USBD_DEFAULT_TIMEOUT);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
if (err) {
error = EIO;
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
index 759d8a67268..a4391421edb 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb.c,v 1.44 2007/06/10 10:15:35 mbalmer Exp $ */
+/* $OpenBSD: usb.c,v 1.45 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */
/*
@@ -195,7 +195,7 @@ usb_attach(struct device *parent, struct device *self, void *aux)
#endif
#endif
- err = usbd_new_device(USBDEV(sc->sc_dev), sc->sc_bus, 0, speed, 0,
+ err = usbd_new_device(&sc->sc_dev, sc->sc_bus, 0, speed, 0,
&sc->sc_port);
if (!err) {
dev = sc->sc_port.device;
diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h
index 0e830f536da..a8aed532b64 100644
--- a/sys/dev/usb/usb_port.h
+++ b/sys/dev/usb/usb_port.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb_port.h,v 1.75 2007/06/10 10:15:35 mbalmer Exp $ */
+/* $OpenBSD: usb_port.h,v 1.76 2007/06/10 10:53:48 mbalmer Exp $ */
/* $NetBSD: usb_port.h,v 1.62 2003/02/15 18:33:30 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_port.h,v 1.21 1999/11/17 22:33:47 n_hibma Exp $ */
@@ -85,7 +85,6 @@ typedef struct proc *usb_proc_ptr;
#define slinear16_to_ulinear8_be linear16_to_ulinear8_be
typedef struct device *device_ptr_t;
-#define USBDEV(bdev) (&(bdev))
#define USBDEVNAME(bdev) ((bdev).dv_xname)
#define USBDEVUNIT(bdev) ((bdev).dv_unit)
#define USBDEVPTRNAME(bdevptr) ((bdevptr)->dv_xname)
diff --git a/sys/dev/usb/uscanner.c b/sys/dev/usb/uscanner.c
index ae4c24a59d5..c6c93c696eb 100644
--- a/sys/dev/usb/uscanner.c
+++ b/sys/dev/usb/uscanner.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uscanner.c,v 1.27 2007/06/06 19:25:50 mk Exp $ */
+/* $OpenBSD: uscanner.c,v 1.28 2007/06/10 10:53:49 mbalmer Exp $ */
/* $NetBSD: uscanner.c,v 1.40 2003/01/27 00:32:44 wiz Exp $ */
/*
@@ -320,7 +320,7 @@ uscanner_attach(struct device *parent, struct device *self, void *aux)
sc->sc_bulkout = ed_bulkout->bEndpointAddress;
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
}
int
@@ -495,7 +495,7 @@ uscannerread(dev_t dev, struct uio *uio, int flag)
sc->sc_refcnt++;
error = uscanner_do_read(sc, uio, flag);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return (error);
}
@@ -545,7 +545,7 @@ uscannerwrite(dev_t dev, struct uio *uio, int flag)
sc->sc_refcnt++;
error = uscanner_do_write(sc, uio, flag);
if (--sc->sc_refcnt < 0)
- usb_detach_wakeup(USBDEV(sc->sc_dev));
+ usb_detach_wakeup(&sc->sc_dev);
return (error);
}
@@ -586,7 +586,7 @@ uscanner_detach(struct device *self, int flags)
s = splusb();
if (--sc->sc_refcnt >= 0) {
/* Wait for processes to go away. */
- usb_detach_wait(USBDEV(sc->sc_dev));
+ usb_detach_wait(&sc->sc_dev);
}
splx(s);
@@ -599,7 +599,7 @@ uscanner_detach(struct device *self, int flags)
mn = self->dv_unit * USB_MAX_ENDPOINTS;
vdevgone(maj, mn, mn + USB_MAX_ENDPOINTS - 1, VCHR);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (0);
}
diff --git a/sys/dev/usb/uslcom.c b/sys/dev/usb/uslcom.c
index bc07f8f2b0a..796aec90cc6 100644
--- a/sys/dev/usb/uslcom.c
+++ b/sys/dev/usb/uslcom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uslcom.c,v 1.8 2007/06/06 19:25:50 mk Exp $ */
+/* $OpenBSD: uslcom.c,v 1.9 2007/06/10 10:53:49 mbalmer Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@@ -215,7 +215,7 @@ uslcom_attach(struct device *parent, struct device *self, void *aux)
uca.info = NULL;
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
sc->sc_subdev = config_found_sm(self, &uca, ucomprint, ucomsubmatch);
}
@@ -233,7 +233,7 @@ uslcom_detach(struct device *self, int flags)
}
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}
diff --git a/sys/dev/usb/usscanner.c b/sys/dev/usb/usscanner.c
index 613620c54a8..6bcf94db2f0 100644
--- a/sys/dev/usb/usscanner.c
+++ b/sys/dev/usb/usscanner.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usscanner.c,v 1.17 2007/06/06 19:25:50 mk Exp $ */
+/* $OpenBSD: usscanner.c,v 1.18 2007/06/10 10:53:49 mbalmer Exp $ */
/* $NetBSD: usscanner.c,v 1.6 2001/01/23 14:04:14 augustss Exp $ */
/*
@@ -349,7 +349,7 @@ usscanner_attach(struct device *parent, struct device *self, void *aux)
sc->sc_child = config_found(&sc->sc_dev, &saa, scsiprint);
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
DPRINTFN(10, ("usscanner_attach: %p\n", sc->sc_udev));
}
@@ -374,7 +374,7 @@ usscanner_detach(struct device *self, int flags)
s = splusb();
if (--sc->sc_refcnt >= 0) {
/* Wait for processes to go away. */
- usb_detach_wait(USBDEV(sc->sc_dev));
+ usb_detach_wait(&sc->sc_dev);
}
splx(s);
@@ -384,7 +384,7 @@ usscanner_detach(struct device *self, int flags)
rv = 0;
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}
diff --git a/sys/dev/usb/uts.c b/sys/dev/usb/uts.c
index afed1db07e1..efc55588078 100644
--- a/sys/dev/usb/uts.c
+++ b/sys/dev/usb/uts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uts.c,v 1.11 2007/06/06 19:25:50 mk Exp $ */
+/* $OpenBSD: uts.c,v 1.12 2007/06/10 10:53:49 mbalmer Exp $ */
/*
* Copyright (c) 2007 Robert Nagy <robert@openbsd.org>
@@ -209,7 +209,7 @@ uts_attach(struct device *parent, struct device *self, void *aux)
}
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
a.accessops = &uts_accessops;
a.accesscookie = sc;
@@ -237,7 +237,7 @@ uts_detach(struct device *self, int flags)
}
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}
diff --git a/sys/dev/usb/uvisor.c b/sys/dev/usb/uvisor.c
index 6ba0887de99..5b2fac493a4 100644
--- a/sys/dev/usb/uvisor.c
+++ b/sys/dev/usb/uvisor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvisor.c,v 1.30 2007/06/06 19:25:50 mk Exp $ */
+/* $OpenBSD: uvisor.c,v 1.31 2007/06/10 10:53:49 mbalmer Exp $ */
/* $NetBSD: uvisor.c,v 1.21 2003/08/03 21:59:26 nathanw Exp $ */
/*
@@ -287,7 +287,7 @@ uvisor_attach(struct device *parent, struct device *self, void *aux)
}
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
if (sc->sc_flags & VISOR) {
sc->sc_numcon = UGETW(coninfo.num_ports);
@@ -413,7 +413,7 @@ uvisor_detach(device_ptr_t self, int flags)
}
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}
diff --git a/sys/dev/usb/uvscom.c b/sys/dev/usb/uvscom.c
index f31b29e80fc..b05eb731c92 100644
--- a/sys/dev/usb/uvscom.c
+++ b/sys/dev/usb/uvscom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvscom.c,v 1.13 2007/06/06 19:25:50 mk Exp $ */
+/* $OpenBSD: uvscom.c,v 1.14 2007/06/10 10:53:49 mbalmer Exp $ */
/* $NetBSD: uvscom.c,v 1.9 2003/02/12 15:36:20 ichiro Exp $ */
/*-
* Copyright (c) 2001-2002, Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
@@ -351,7 +351,7 @@ uvscom_attach(struct device *parent, struct device *self, void *aux)
ucom->sc_bulkin_no, ucom->sc_bulkout_no, sc->sc_intr_number));
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
DPRINTF(("uplcom: in=0x%x out=0x%x intr=0x%x\n",
uca.bulkin, uca.bulkout, sc->sc_intr_number ));
@@ -382,7 +382,7 @@ uvscom_detach(struct device *self, int flags)
}
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ &sc->sc_dev);
return (rv);
}