Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Some cleanup and renaming of the callouts used i...



details:   https://anonhg.NetBSD.org/src/rev/0508c2cf0d0d
branches:  trunk
changeset: 484072:0508c2cf0d0d
user:      augustss <augustss%NetBSD.org@localhost>
date:      Fri Mar 24 22:03:28 2000 +0000

description:
Some cleanup and renaming of the callouts used in USB drivers.

diffstat:

 sys/dev/usb/if_aue.c    |  16 +++++-------
 sys/dev/usb/if_auereg.h |   6 ++--
 sys/dev/usb/if_cue.c    |  15 +++++------
 sys/dev/usb/if_cuereg.h |   6 ++--
 sys/dev/usb/if_kue.c    |   3 +-
 sys/dev/usb/if_kuereg.h |   4 +--
 sys/dev/usb/ohci.c      |  16 ++++++------
 sys/dev/usb/uhci.c      |  61 ++++++++++++++++++------------------------------
 sys/dev/usb/uhcivar.h   |   9 +-----
 sys/dev/usb/usb_port.h  |  20 ++++++++++-----
 sys/dev/usb/usbdi.c     |   8 ++----
 sys/dev/usb/usbdivar.h  |  11 ++------
 12 files changed, 74 insertions(+), 101 deletions(-)

diffs (truncated from 609 to 300 lines):

diff -r a883448e8480 -r 0508c2cf0d0d sys/dev/usb/if_aue.c
--- a/sys/dev/usb/if_aue.c      Fri Mar 24 21:56:04 2000 +0000
+++ b/sys/dev/usb/if_aue.c      Fri Mar 24 22:03:28 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_aue.c,v 1.32 2000/03/23 07:01:45 thorpej Exp $      */
+/*     $NetBSD: if_aue.c,v 1.33 2000/03/24 22:03:28 augustss Exp $     */
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
  *     Bill Paul <wpaul%ee.columbia.edu@localhost>.  All rights reserved.
@@ -854,15 +854,12 @@
         */
        if_attach(ifp);
        ether_ifattach(ifp);
-       callout_handle_init(&sc->aue_stat_ch);
        bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
 
        usb_register_netisr();
 
 #elif defined(__NetBSD__) || defined(__OpenBSD__)
 
-       callout_init(&sc->aue_stat_ch);
-
        printf("%s: Ethernet address %s\n", USBDEVNAME(sc->aue_dev),
            ether_sprintf(eaddr));
 
@@ -905,6 +902,8 @@
 
 #endif /* defined(__NetBSD__) || defined(__OpenBSD__) */
 
+       usb_callout_init(sc->aue_stat_ch);
+
        sc->aue_attached = 1;
        splx(s);
 
@@ -924,7 +923,7 @@
 
        s = splusb();
 
-       usb_untimeout(aue_tick, sc, sc->aue_stat_ch);
+       usb_uncallout(sc->aue_stat_ch, aue_tick, sc);
 
        if (!sc->aue_attached) {
                /* Detached before attached finished, so just bail out. */
@@ -1379,7 +1378,7 @@
                }
        }
 
-       usb_timeout(aue_tick, sc, hz, sc->aue_stat_ch);
+       usb_callout(sc->aue_stat_ch, hz, aue_tick, sc);
 
        splx(s);
 }
@@ -1554,8 +1553,7 @@
 
        splx(s);
 
-       usb_untimeout(aue_tick, sc, sc->aue_stat_ch);
-       usb_timeout(aue_tick, sc, hz, sc->aue_stat_ch);
+       usb_callout(sc->aue_stat_ch, hz, aue_tick, sc);
 }
 
 static int
@@ -1799,7 +1797,7 @@
        aue_csr_write_1(sc, AUE_CTL0, 0);
        aue_csr_write_1(sc, AUE_CTL1, 0);
        aue_reset(sc);
-       usb_untimeout(aue_tick, sc, sc->aue_stat_ch);
+       usb_uncallout(sc->aue_stat_ch, aue_tick, sc);
 
        /* Stop transfers. */
        if (sc->aue_ep[AUE_ENDPT_RX] != NULL) {
diff -r a883448e8480 -r 0508c2cf0d0d sys/dev/usb/if_auereg.h
--- a/sys/dev/usb/if_auereg.h   Fri Mar 24 21:56:04 2000 +0000
+++ b/sys/dev/usb/if_auereg.h   Fri Mar 24 22:03:28 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_auereg.h,v 1.7 2000/03/23 07:01:45 thorpej Exp $    */
+/*     $NetBSD: if_auereg.h,v 1.8 2000/03/24 22:03:29 augustss Exp $   */
 /*
  * Copyright (c) 1997, 1998, 1999
  *     Bill Paul <wpaul%ee.columbia.edu@localhost>.  All rights reserved.
@@ -233,13 +233,11 @@
 #if defined(__FreeBSD__)
        struct arpcom           arpcom;
        device_t                aue_miibus;
-       struct callout_handle   aue_stat_ch;
 #define GET_IFP(sc) (&(sc)->arpcom.ac_if)
 #define GET_MII(sc) (device_get_softc((sc)->aue_miibus))
 #elif defined(__NetBSD__)
        struct ethercom         aue_ec;
        struct mii_data         aue_mii;
-       struct callout          aue_stat_ch;
 #if NRND > 0
        rndsource_element_t     rnd_source;
 #endif
@@ -247,6 +245,8 @@
 #define GET_MII(sc) (&(sc)->aue_mii)
 #endif
 
+       usb_callout_t           aue_stat_ch;
+
        usbd_device_handle      aue_udev;
        usbd_interface_handle   aue_iface;
        u_int16_t               aue_vendor;
diff -r a883448e8480 -r 0508c2cf0d0d sys/dev/usb/if_cue.c
--- a/sys/dev/usb/if_cue.c      Fri Mar 24 21:56:04 2000 +0000
+++ b/sys/dev/usb/if_cue.c      Fri Mar 24 22:03:28 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cue.c,v 1.15 2000/03/24 13:08:28 augustss Exp $     */
+/*     $NetBSD: if_cue.c,v 1.16 2000/03/24 22:03:29 augustss Exp $     */
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
  *     Bill Paul <wpaul%ee.columbia.edu@localhost>.  All rights reserved.
@@ -681,14 +681,11 @@
         */
        if_attach(ifp);
        ether_ifattach(ifp);
-       callout_handle_init(&sc->cue_stat_ch);
        bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
        usb_register_netisr();
 
 #elif defined(__NetBSD__) || defined(__OpenBSD__)
 
-       callout_init(&sc->cue_stat_ch);
-
        printf("%s: Ethernet address %s\n", USBDEVNAME(sc->cue_dev),
            ether_sprintf(eaddr));
 
@@ -717,6 +714,8 @@
 
 #endif /* defined(__NetBSD__) || defined(__OpenBSD__) */
 
+       usb_callout_init(sc->cue_stat_ch);
+
        sc->cue_attached = 1;
        splx(s);
 
@@ -736,7 +735,7 @@
 
        s = splusb();
 
-       usb_untimeout(cue_tick, sc, sc->cue_stat_ch);
+       usb_uncallout(sc->cue_stat_ch, cue_tick, sc);
 
        if (!sc->cue_attached) {
                /* Detached before attached finished, so just bail out. */
@@ -1125,7 +1124,7 @@
        if (cue_csr_read_2(sc, CUE_RX_FRAMEERR))
                ifp->if_ierrors++;
 
-       usb_timeout(cue_tick, sc, hz, sc->cue_stat_ch);
+       usb_callout(sc->cue_stat_ch, hz, cue_tick, sc);
 
        splx(s);
 }
@@ -1304,7 +1303,7 @@
 
        splx(s);
 
-       usb_timeout(cue_tick, sc, hz, sc->cue_stat_ch);
+       usb_callout(sc->cue_stat_ch, hz, cue_tick, sc);
 }
 
 static int
@@ -1491,7 +1490,7 @@
 
        cue_csr_write_1(sc, CUE_ETHCTL, 0);
        cue_reset(sc);
-       usb_untimeout(cue_tick, sc, sc->cue_stat_ch);
+       usb_uncallout(sc->cue_stat_ch, cue_tick, sc);
 
        /* Stop transfers. */
        if (sc->cue_ep[CUE_ENDPT_RX] != NULL) {
diff -r a883448e8480 -r 0508c2cf0d0d sys/dev/usb/if_cuereg.h
--- a/sys/dev/usb/if_cuereg.h   Fri Mar 24 21:56:04 2000 +0000
+++ b/sys/dev/usb/if_cuereg.h   Fri Mar 24 22:03:28 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cuereg.h,v 1.7 2000/03/24 13:03:21 augustss Exp $   */
+/*     $NetBSD: if_cuereg.h,v 1.8 2000/03/24 22:03:29 augustss Exp $   */
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
  *     Bill Paul <wpaul%ee.columbia.edu@localhost>.  All rights reserved.
@@ -171,17 +171,17 @@
 
 #if defined(__FreeBSD__)
        struct arpcom           arpcom;
-       struct callout_handle   cue_stat_ch;
 #define GET_IFP(sc) (&(sc)->arpcom.ac_if)
 #elif defined(__NetBSD__)
        struct ethercom         cue_ec;
-       struct callout          cue_stat_ch;
 #if NRND > 0
        rndsource_element_t     rnd_source;
 #endif
 #define GET_IFP(sc) (&(sc)->cue_ec.ec_if)
 #endif
 
+       usb_callout_t           cue_stat_ch;
+
        usbd_device_handle      cue_udev;
        usbd_interface_handle   cue_iface;
        u_int16_t               cue_vendor;
diff -r a883448e8480 -r 0508c2cf0d0d sys/dev/usb/if_kue.c
--- a/sys/dev/usb/if_kue.c      Fri Mar 24 21:56:04 2000 +0000
+++ b/sys/dev/usb/if_kue.c      Fri Mar 24 22:03:28 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_kue.c,v 1.20 2000/03/23 07:01:45 thorpej Exp $      */
+/*     $NetBSD: if_kue.c,v 1.21 2000/03/24 22:03:30 augustss Exp $     */
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
  *     Bill Paul <wpaul%ee.columbia.edu@localhost>.  All rights reserved.
@@ -84,7 +84,6 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <sys/callout.h>
 #include <sys/sockio.h>
 #include <sys/mbuf.h>
 #include <sys/malloc.h>
diff -r a883448e8480 -r 0508c2cf0d0d sys/dev/usb/if_kuereg.h
--- a/sys/dev/usb/if_kuereg.h   Fri Mar 24 21:56:04 2000 +0000
+++ b/sys/dev/usb/if_kuereg.h   Fri Mar 24 22:03:28 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_kuereg.h,v 1.7 2000/03/23 07:01:45 thorpej Exp $    */
+/*     $NetBSD: if_kuereg.h,v 1.8 2000/03/24 22:03:30 augustss Exp $   */
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
  *     Bill Paul <wpaul%ee.columbia.edu@localhost>.  All rights reserved.
@@ -164,11 +164,9 @@
 
 #if defined(__FreeBSD__)
        struct arpcom           arpcom;
-       struct callout_handle   kue_stat_ch;
 #define GET_IFP(sc) (&(sc)->arpcom.ac_if)
 #elif defined(__NetBSD__)
        struct ethercom         kue_ec;
-       struct callout          kue_stat_ch;
 #if NRND > 0
        rndsource_element_t     rnd_source;
 #endif
diff -r a883448e8480 -r 0508c2cf0d0d sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c        Fri Mar 24 21:56:04 2000 +0000
+++ b/sys/dev/usb/ohci.c        Fri Mar 24 22:03:28 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci.c,v 1.79 2000/03/23 07:01:46 thorpej Exp $        */
+/*     $NetBSD: ohci.c,v 1.80 2000/03/24 22:03:30 augustss Exp $       */
 /*     $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $       */
 
 /*
@@ -1173,7 +1173,7 @@
                        continue;
                }
                cc = OHCI_TD_GET_CC(le32toh(std->td.td_flags));
-               usb_untimeout(ohci_timeout, xfer, xfer->timo_handle);
+               usb_uncallout(xfer->timo_handle, ohci_timeout, xfer);
                if (xfer->status == USBD_CANCELLED ||
                    xfer->status == USBD_TIMEOUT) {
                        DPRINTF(("ohci_process_done: cancel/timeout %p\n",
@@ -1498,8 +1498,8 @@
        opipe->tail.td = tail;
        OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_CLF);
        if (xfer->timeout && !sc->sc_bus.use_polling) {
-                usb_timeout(ohci_timeout, xfer,
-                           MS_TO_TICKS(xfer->timeout), xfer->timo_handle);
+                usb_callout(xfer->timo_handle, MS_TO_TICKS(xfer->timeout),
+                           ohci_timeout, xfer);
        }
        splx(s);
 
@@ -1840,7 +1840,7 @@
 
        xfer->status = status;
 
-       usb_untimeout(ohci_timeout, xfer, xfer->timo_handle);
+       usb_uncallout(xfer->timo_handle, ohci_timeout, xfer);
 
        sed = opipe->sed;
        DPRINTFN(1,("ohci_abort_xfer: stop ed=%p\n", sed));
@@ -1849,7 +1849,7 @@
 #if 1
        if (xfer->device->bus->intr_context) {
                /* We have no process context, so we can't use tsleep(). */
-               callout_reset(&xfer->abort_handle, hz / USB_FRAMES_PER_SECOND,
+               usb_callout(xfer->abort_handle, hz / USB_FRAMES_PER_SECOND,
                    ohci_abort_xfer_end, xfer);
        } else {
 #if defined(DIAGNOSTIC) && defined(__i386__) && defined(__FreeBSD__)
@@ -2543,8 +2543,8 @@
        sed->ed.ed_flags &= htole32(~OHCI_ED_SKIP);
        OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_BLF);
        if (xfer->timeout && !sc->sc_bus.use_polling) {
-                usb_timeout(ohci_timeout, xfer,
-                           MS_TO_TICKS(xfer->timeout), xfer->timo_handle);
+                usb_callout(xfer->timo_handle, MS_TO_TICKS(xfer->timeout),
+                           ohci_timeout, xfer);
        }
 
 #if 0
diff -r a883448e8480 -r 0508c2cf0d0d sys/dev/usb/uhci.c
--- a/sys/dev/usb/uhci.c        Fri Mar 24 21:56:04 2000 +0000
+++ b/sys/dev/usb/uhci.c        Fri Mar 24 22:03:28 2000 +0000



Home | Main Index | Thread Index | Old Index