Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Stop using the compatibility macros USB_ATTACH()...
details: https://anonhg.NetBSD.org/src/rev/d7c75bd6883c
branches: trunk
changeset: 758389:d7c75bd6883c
user: dyoung <dyoung%NetBSD.org@localhost>
date: Wed Nov 03 22:34:23 2010 +0000
description:
Stop using the compatibility macros USB_ATTACH(), USB_DETACH(),
USB_MATCH(), et cetera. These files produce the same assembly
(according to objdump -d) before and after the change
diffstat:
sys/dev/usb/ehci.c | 18 +-
sys/dev/usb/hid.c | 8 +-
sys/dev/usb/ohci.c | 26 ++--
sys/dev/usb/ohcivar.h | 12 +-
sys/dev/usb/pseye.c | 12 +-
sys/dev/usb/stuirda.c | 59 ++++++-----
sys/dev/usb/uaudio.c | 99 ++++++++++---------
sys/dev/usb/uberry.c | 10 +-
sys/dev/usb/ubsa.c | 32 +++--
sys/dev/usb/ubsa_common.c | 24 ++--
sys/dev/usb/ubsavar.h | 4 +-
sys/dev/usb/ubt.c | 121 +++++++++++++-----------
sys/dev/usb/uchcom.c | 48 +++++----
sys/dev/usb/ucom.c | 47 +++++---
sys/dev/usb/ucomvar.h | 4 +-
sys/dev/usb/ucycom.c | 19 ++-
sys/dev/usb/udsbr.c | 38 ++++---
sys/dev/usb/uep.c | 46 +++++----
sys/dev/usb/uftdi.c | 29 +++--
sys/dev/usb/ugen.c | 89 +++++++++++------
sys/dev/usb/ugensa.c | 30 +++--
sys/dev/usb/uhci.c | 29 ++---
sys/dev/usb/uhcivar.h | 6 +-
sys/dev/usb/uhid.c | 47 +++++----
sys/dev/usb/uhidev.c | 50 +++++----
sys/dev/usb/uhidev.h | 6 +-
sys/dev/usb/uhub.c | 10 +-
sys/dev/usb/uipaq.c | 35 +++---
sys/dev/usb/uirda.c | 44 ++++----
sys/dev/usb/uirdavar.h | 4 +-
sys/dev/usb/ukbd.c | 36 +++---
sys/dev/usb/ukyopon.c | 41 +++++---
sys/dev/usb/ulpt.c | 91 ++++++++++-------
sys/dev/usb/umass_isdata.c | 8 +-
sys/dev/usb/umass_quirks.c | 6 +-
sys/dev/usb/umass_scsipi.c | 24 ++--
sys/dev/usb/umassvar.h | 8 +-
sys/dev/usb/umct.c | 54 +++++-----
sys/dev/usb/umidi.c | 52 +++++----
sys/dev/usb/umidivar.h | 4 +-
sys/dev/usb/umodem.c | 36 ++++--
sys/dev/usb/umodem_common.c | 28 ++--
sys/dev/usb/umodemvar.h | 10 +-
sys/dev/usb/ums.c | 32 +++---
sys/dev/usb/uplcom.c | 68 +++++++------
sys/dev/usb/urio.c | 69 ++++++++-----
sys/dev/usb/usb.c | 26 ++--
sys/dev/usb/usb.h | 6 +-
sys/dev/usb/usb_mem.c | 8 +-
sys/dev/usb/usb_port.h | 105 +--------------------
sys/dev/usb/usb_quirks.c | 6 +-
sys/dev/usb/usb_subr.c | 8 +-
sys/dev/usb/usbdi.c | 10 +-
sys/dev/usb/usbdi_util.c | 22 ++--
sys/dev/usb/uscanner.c | 85 +++++++++-------
sys/dev/usb/uslsa.c | 52 +++++----
sys/dev/usb/usscanner.c | 78 ++++++++-------
sys/dev/usb/ustir.c | 54 +++++-----
sys/dev/usb/uthum.c | 18 ++-
sys/dev/usb/utoppy.c | 219 +++++++++++++++++++++++--------------------
sys/dev/usb/uvideo.c | 33 +++---
sys/dev/usb/uvisor.c | 29 +++--
sys/dev/usb/uvscom.c | 78 ++++++++-------
sys/dev/usb/uyap.c | 37 ++++--
64 files changed, 1272 insertions(+), 1175 deletions(-)
diffs (truncated from 8316 to 300 lines):
diff -r 843d4c223c86 -r d7c75bd6883c sys/dev/usb/ehci.c
--- a/sys/dev/usb/ehci.c Wed Nov 03 22:30:50 2010 +0000
+++ b/sys/dev/usb/ehci.c Wed Nov 03 22:34:23 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ehci.c,v 1.170 2010/10/16 05:23:41 kiyohara Exp $ */
+/* $NetBSD: ehci.c,v 1.171 2010/11/03 22:34:23 dyoung Exp $ */
/*
* Copyright (c) 2004-2008 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.170 2010/10/16 05:23:41 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.171 2010/11/03 22:34:23 dyoung Exp $");
#include "ohci.h"
#include "uhci.h"
@@ -780,7 +780,7 @@
}
done:
DPRINTFN(12, ("ehci_check_intr: ex=%p done\n", ex));
- callout_stop(&(ex->xfer.timeout_handle));
+ callout_stop(&ex->xfer.timeout_handle);
ehci_idone(ex);
}
@@ -827,7 +827,7 @@
return;
done:
DPRINTFN(12, ("ehci_check_itd_intr: ex=%p done\n", ex));
- callout_stop(&(ex->xfer.timeout_handle));
+ callout_stop(&ex->xfer.timeout_handle);
ehci_idone(ex);
}
@@ -1080,7 +1080,7 @@
if (rv != 0)
return (rv);
- callout_stop(&(sc->sc_tmo_intrlist));
+ callout_stop(&sc->sc_tmo_intrlist);
usb_delay_ms(&sc->sc_bus, 300); /* XXX let stray task complete */
@@ -2864,7 +2864,7 @@
/* If we're dying, just do the software part. */
s = splusb();
xfer->status = status; /* make software ignore it */
- callout_stop(&(xfer->timeout_handle));
+ callout_stop(&xfer->timeout_handle);
usb_transfer_complete(xfer);
splx(s);
return;
@@ -2898,7 +2898,7 @@
*/
s = splusb();
xfer->status = status; /* make software ignore it */
- callout_stop(&(xfer->timeout_handle));
+ callout_stop(&xfer->timeout_handle);
usb_syncmem(&sqh->dma,
sqh->offs + offsetof(ehci_qh_t, qh_qtd.qtd_status),
@@ -3014,7 +3014,7 @@
if (sc->sc_dying) {
s = splusb();
xfer->status = status;
- callout_stop(&(xfer->timeout_handle));
+ callout_stop(&xfer->timeout_handle);
usb_transfer_complete(xfer);
splx(s);
return;
@@ -3038,7 +3038,7 @@
xfer->hcflags |= UXFER_ABORTING;
xfer->status = status;
- callout_stop(&(xfer->timeout_handle));
+ callout_stop(&xfer->timeout_handle);
s = splusb();
for (itd = exfer->itdstart; itd != NULL; itd = itd->xfer_next) {
diff -r 843d4c223c86 -r d7c75bd6883c sys/dev/usb/hid.c
--- a/sys/dev/usb/hid.c Wed Nov 03 22:30:50 2010 +0000
+++ b/sys/dev/usb/hid.c Wed Nov 03 22:34:23 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hid.c,v 1.30 2010/05/14 17:32:57 plunky Exp $ */
+/* $NetBSD: hid.c,v 1.31 2010/11/03 22:34:23 dyoung Exp $ */
/* $FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.30 2010/05/14 17:32:57 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.31 2010/11/03 22:34:23 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -47,8 +47,8 @@
#include <dev/usb/hid.h>
#ifdef UHIDEV_DEBUG
-#define DPRINTF(x) if (uhidevdebug) logprintf x
-#define DPRINTFN(n,x) if (uhidevdebug>(n)) logprintf x
+#define DPRINTF(x) if (uhidevdebug) printf x
+#define DPRINTFN(n,x) if (uhidevdebug>(n)) printf x
extern int uhidevdebug;
#else
#define DPRINTF(x)
diff -r 843d4c223c86 -r d7c75bd6883c sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c Wed Nov 03 22:30:50 2010 +0000
+++ b/sys/dev/usb/ohci.c Wed Nov 03 22:34:23 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ohci.c,v 1.208 2010/06/09 13:33:13 pgoyette Exp $ */
+/* $NetBSD: ohci.c,v 1.209 2010/11/03 22:34:23 dyoung Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
/*
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.208 2010/06/09 13:33:13 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.209 2010/11/03 22:34:23 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -69,8 +69,8 @@
#ifdef OHCI_DEBUG
-#define DPRINTF(x) if (ohcidebug) logprintf x
-#define DPRINTFN(n,x) if (ohcidebug>(n)) logprintf x
+#define DPRINTF(x) if (ohcidebug) printf x
+#define DPRINTFN(n,x) if (ohcidebug>(n)) printf x
int ohcidebug = 0;
#else
#define DPRINTF(x)
@@ -364,10 +364,10 @@
if (rv != 0)
return (rv);
- usb_uncallout(sc->sc_tmo_rhsc, ohci_rhsc_enable, sc);
+ callout_stop(&sc->sc_tmo_rhsc);
usb_delay_ms(&sc->sc_bus, 300); /* XXX let stray task complete */
- usb_callout_destroy(sc->sc_tmo_rhsc);
+ callout_destroy(&sc->sc_tmo_rhsc);
if (sc->sc_hcca != NULL)
usb_freemem(&sc->sc_bus, &sc->sc_hccadma);
@@ -661,7 +661,7 @@
aprint_normal_dev(sc->sc_dev, "");
sc->sc_hcca = NULL;
- usb_callout_init(sc->sc_tmo_rhsc);
+ callout_init(&sc->sc_tmo_rhsc, 0);
for (i = 0; i < OHCI_HASH_SIZE; i++)
LIST_INIT(&sc->sc_hash_tds[i]);
@@ -1189,7 +1189,7 @@
*/
ohci_rhsc(sc, sc->sc_intrxfer);
/* Do not allow RHSC interrupts > 1 per second */
- usb_callout(sc->sc_tmo_rhsc, hz, ohci_rhsc_enable, sc);
+ callout_reset(&sc->sc_tmo_rhsc, hz, ohci_rhsc_enable, sc);
}
sc->sc_bus.intr_context--;
@@ -1324,7 +1324,7 @@
/* Handled by abort routine. */
continue;
}
- usb_uncallout(xfer->timeout_handle, ohci_timeout, xfer);
+ callout_stop(&xfer->timeout_handle);
len = std->len;
if (std->td.td_cbp != 0)
@@ -1770,7 +1770,7 @@
opipe->tail.td = tail;
OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_CLF);
if (xfer->timeout && !sc->sc_bus.use_polling) {
- usb_callout(xfer->timeout_handle, mstohz(xfer->timeout),
+ callout_reset(&xfer->timeout_handle, mstohz(xfer->timeout),
ohci_timeout, xfer);
}
splx(s);
@@ -2236,7 +2236,7 @@
/* If we're dying, just do the software part. */
s = splusb();
xfer->status = status; /* make software ignore it */
- usb_uncallout(xfer->timeout_handle, ohci_timeout, xfer);
+ callout_stop(&xfer->timeout_handle);
usb_transfer_complete(xfer);
splx(s);
return;
@@ -2270,7 +2270,7 @@
*/
s = splusb();
xfer->status = status; /* make software ignore it */
- usb_uncallout(xfer->timeout_handle, ohci_timeout, xfer);
+ callout_stop(&xfer->timeout_handle);
splx(s);
DPRINTFN(1,("ohci_abort_xfer: stop ed=%p\n", sed));
usb_syncmem(&sed->dma, sed->offs + offsetof(ohci_ed_t, ed_flags),
@@ -2998,7 +2998,7 @@
BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_BLF);
if (xfer->timeout && !sc->sc_bus.use_polling) {
- usb_callout(xfer->timeout_handle, mstohz(xfer->timeout),
+ callout_reset(&xfer->timeout_handle, mstohz(xfer->timeout),
ohci_timeout, xfer);
}
diff -r 843d4c223c86 -r d7c75bd6883c sys/dev/usb/ohcivar.h
--- a/sys/dev/usb/ohcivar.h Wed Nov 03 22:30:50 2010 +0000
+++ b/sys/dev/usb/ohcivar.h Wed Nov 03 22:34:23 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ohcivar.h,v 1.48 2010/07/12 04:16:51 jakllsch Exp $ */
+/* $NetBSD: ohcivar.h,v 1.49 2010/11/03 22:34:23 dyoung Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohcivar.h,v 1.13 1999/11/17 22:33:41 n_hibma Exp $ */
/*
@@ -130,14 +130,10 @@
u_int sc_overrun_cnt;
struct timeval sc_overrun_ntc;
- usb_callout_t sc_tmo_rhsc;
-#if defined(__NetBSD__) || defined(__OpenBSD__)
- device_ptr_t sc_child;
-#endif
+ struct callout sc_tmo_rhsc;
+ device_t sc_child;
char sc_dying;
-#ifdef __NetBSD__
struct usb_dma_reserve sc_dma_reserve;
-#endif
} ohci_softc_t;
struct ohci_xfer {
@@ -147,11 +143,9 @@
usbd_status ohci_init(ohci_softc_t *);
int ohci_intr(void *);
-#if defined(__NetBSD__) || defined(__OpenBSD__)
int ohci_detach(ohci_softc_t *, int);
bool ohci_shutdown(device_t, int);
void ohci_childdet(device_t, device_t);
int ohci_activate(device_t, enum devact);
-#endif
bool ohci_resume(device_t, const pmf_qual_t *);
bool ohci_suspend(device_t, const pmf_qual_t *);
diff -r 843d4c223c86 -r d7c75bd6883c sys/dev/usb/pseye.c
--- a/sys/dev/usb/pseye.c Wed Nov 03 22:30:50 2010 +0000
+++ b/sys/dev/usb/pseye.c Wed Nov 03 22:34:23 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pseye.c,v 1.16 2010/04/22 08:45:55 pooka Exp $ */
+/* $NetBSD: pseye.c,v 1.17 2010/11/03 22:34:23 dyoung Exp $ */
/*-
* Copyright (c) 2008 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pseye.c,v 1.16 2010/04/22 08:45:55 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pseye.c,v 1.17 2010/11/03 22:34:23 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -81,7 +81,7 @@
#define PSEYE_SCCB_OP_READ_2 0xf9
struct pseye_softc {
- USBBASEDEVICE sc_dev;
+ device_t sc_dev;
usbd_device_handle sc_udev;
usbd_interface_handle sc_iface;
@@ -261,7 +261,7 @@
}
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
- USBDEV(self));
+ self);
}
@@ -300,13 +300,13 @@
mutex_destroy(&sc->sc_mtx);
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
- USBDEV(sc->sc_dev));
+ sc->sc_dev);
return 0;
}
int
Home |
Main Index |
Thread Index |
Old Index