summaryrefslogtreecommitdiffstats
path: root/sys/dev/dc
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2000-11-25 08:00:10 +0000
committerjlemon <jlemon@FreeBSD.org>2000-11-25 08:00:10 +0000
commita96aa4cf11500995644c97faf43a0149d62abe5d (patch)
treeca5da42ac217bb82985a1f64f582551232f50250 /sys/dev/dc
parenta27d413d095530bcaa22d941f3500ed29a5ea34e (diff)
downloadFreeBSD-src-a96aa4cf11500995644c97faf43a0149d62abe5d.zip
FreeBSD-src-a96aa4cf11500995644c97faf43a0149d62abe5d.tar.gz
Change the driver to allocate its own callout structure, and modify
the interface to use callout_* instead of timeout(). Also add an IS_MPSAFE #define (currently off) which will mark the driver as mpsafe to the upper layers.
Diffstat (limited to 'sys/dev/dc')
-rw-r--r--sys/dev/dc/if_dc.c18
-rw-r--r--sys/dev/dc/if_dcreg.h2
2 files changed, 12 insertions, 8 deletions
diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c
index 3bdd051..a23706a 100644
--- a/sys/dev/dc/if_dc.c
+++ b/sys/dev/dc/if_dc.c
@@ -307,6 +307,8 @@ DRIVER_MODULE(miibus, dc, miibus_driver, miibus_devclass, 0, 0);
#define SIO_SET(x) DC_SETBIT(sc, DC_SIO, (x))
#define SIO_CLR(x) DC_CLRBIT(sc, DC_SIO, (x))
+#define IS_MPSAFE 0
+
static void dc_delay(sc)
struct dc_softc *sc;
{
@@ -1820,7 +1822,8 @@ static int dc_attach(dev)
goto fail;
}
- error = bus_setup_intr(dev, sc->dc_irq, INTR_TYPE_NET,
+ error = bus_setup_intr(dev, sc->dc_irq, INTR_TYPE_NET |
+ (IS_MPSAFE ? INTR_MPSAFE : 0),
dc_intr, sc, &sc->dc_intrhand);
if (error) {
@@ -2038,6 +2041,7 @@ static int dc_attach(dev)
ifp->if_init = dc_init;
ifp->if_baudrate = 10000000;
ifp->if_snd.ifq_maxlen = DC_TX_LIST_CNT - 1;
+ ifp->if_mpsafe = IS_MPSAFE;
/*
* Do MII setup. If this is a 21143, check for a PHY on the
@@ -2100,7 +2104,7 @@ static int dc_attach(dev)
* Call MI attach routine.
*/
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
- callout_handle_init(&sc->dc_stat_ch);
+ callout_init(&sc->dc_stat_ch, IS_MPSAFE);
#ifdef SRM_MEDIA
sc->dc_srm_media = 0;
@@ -2697,9 +2701,9 @@ static void dc_tick(xsc)
}
if (sc->dc_flags & DC_21143_NWAY && !sc->dc_link)
- sc->dc_stat_ch = timeout(dc_tick, sc, hz/10);
+ callout_reset(&sc->dc_stat_ch, hz/10, dc_tick, sc);
else
- sc->dc_stat_ch = timeout(dc_tick, sc, hz);
+ callout_reset(&sc->dc_stat_ch, hz, dc_tick, sc);
DC_UNLOCK(sc);
@@ -3134,9 +3138,9 @@ static void dc_init(xsc)
sc->dc_link = 1;
else {
if (sc->dc_flags & DC_21143_NWAY)
- sc->dc_stat_ch = timeout(dc_tick, sc, hz/10);
+ callout_reset(&sc->dc_stat_ch, hz/10, dc_tick, sc);
else
- sc->dc_stat_ch = timeout(dc_tick, sc, hz);
+ callout_reset(&sc->dc_stat_ch, hz, dc_tick, sc);
}
#ifdef SRM_MEDIA
@@ -3306,7 +3310,7 @@ static void dc_stop(sc)
ifp = &sc->arpcom.ac_if;
ifp->if_timer = 0;
- untimeout(dc_tick, sc, sc->dc_stat_ch);
+ callout_stop(&sc->dc_stat_ch);
DC_CLRBIT(sc, DC_NETCFG, (DC_NETCFG_RX_ON|DC_NETCFG_TX_ON));
CSR_WRITE_4(sc, DC_IMR, 0x00000000);
diff --git a/sys/dev/dc/if_dcreg.h b/sys/dev/dc/if_dcreg.h
index 64ca347..2327fa6 100644
--- a/sys/dev/dc/if_dcreg.h
+++ b/sys/dev/dc/if_dcreg.h
@@ -694,7 +694,7 @@ struct dc_softc {
struct dc_mediainfo *dc_mi;
struct dc_list_data *dc_ldata;
struct dc_chain_data dc_cdata;
- struct callout_handle dc_stat_ch;
+ struct callout dc_stat_ch;
#ifdef SRM_MEDIA
int dc_srm_media;
#endif
OpenPOWER on IntegriCloud