diff options
author | yongari <yongari@FreeBSD.org> | 2009-05-25 03:24:47 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2009-05-25 03:24:47 +0000 |
commit | 0b27dcc6d6a07584b012699e960a06738fd6a90c (patch) | |
tree | 1724b01c19ee2229ca7a966204de5bc51c793a44 /sys/dev/msk | |
parent | b9dc9ef8236af98d0fd9f041822f82e0055195ea (diff) | |
download | FreeBSD-src-0b27dcc6d6a07584b012699e960a06738fd6a90c.zip FreeBSD-src-0b27dcc6d6a07584b012699e960a06738fd6a90c.tar.gz |
Remove link handling taskqueue and use mii callback directly. While
I'm here also checks driver running state.
Diffstat (limited to 'sys/dev/msk')
-rw-r--r-- | sys/dev/msk/if_msk.c | 21 | ||||
-rw-r--r-- | sys/dev/msk/if_mskreg.h | 1 |
2 files changed, 3 insertions, 19 deletions
diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c index 17bced0..d15a902 100644 --- a/sys/dev/msk/if_msk.c +++ b/sys/dev/msk/if_msk.c @@ -285,7 +285,6 @@ static int msk_phy_writereg(struct msk_if_softc *, int, int, int); static int msk_miibus_readreg(device_t, int, int); static int msk_miibus_writereg(device_t, int, int, int); static void msk_miibus_statchg(device_t); -static void msk_link_task(void *, int); static void msk_rxfilter(struct msk_if_softc *); static void msk_setvlan(struct msk_if_softc *, struct ifnet *); @@ -459,32 +458,22 @@ msk_phy_writereg(struct msk_if_softc *sc_if, int phy, int reg, int val) static void msk_miibus_statchg(device_t dev) { - struct msk_if_softc *sc_if; - - sc_if = device_get_softc(dev); - taskqueue_enqueue(taskqueue_swi, &sc_if->msk_link_task); -} - -static void -msk_link_task(void *arg, int pending) -{ struct msk_softc *sc; struct msk_if_softc *sc_if; struct mii_data *mii; struct ifnet *ifp; uint32_t gmac; - sc_if = (struct msk_if_softc *)arg; + sc_if = device_get_softc(dev); sc = sc_if->msk_softc; MSK_IF_LOCK(sc_if); mii = device_get_softc(sc_if->msk_miibus); ifp = sc_if->msk_ifp; - if (mii == NULL || ifp == NULL) { - MSK_IF_UNLOCK(sc_if); + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - } if (mii->mii_media_status & IFM_ACTIVE) { if (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) @@ -554,8 +543,6 @@ msk_link_task(void *arg, int pending) /* Read again to ensure writing. */ GMAC_READ_2(sc, sc_if->msk_port, GM_GP_CTRL); } - - MSK_IF_UNLOCK(sc_if); } static void @@ -1416,7 +1403,6 @@ msk_attach(device_t dev) } callout_init_mtx(&sc_if->msk_tick_ch, &sc_if->msk_softc->msk_mtx, 0); - TASK_INIT(&sc_if->msk_link_task, 0, msk_link_task, sc_if); msk_sysctl_node(sc_if); /* Disable jumbo frame for Yukon FE. */ @@ -1791,7 +1777,6 @@ msk_detach(device_t dev) MSK_IF_UNLOCK(sc_if); callout_drain(&sc_if->msk_tick_ch); taskqueue_drain(taskqueue_fast, &sc_if->msk_tx_task); - taskqueue_drain(taskqueue_swi, &sc_if->msk_link_task); ether_ifdetach(ifp); MSK_IF_LOCK(sc_if); } diff --git a/sys/dev/msk/if_mskreg.h b/sys/dev/msk/if_mskreg.h index 09b0d0c..34ef9d9 100644 --- a/sys/dev/msk/if_mskreg.h +++ b/sys/dev/msk/if_mskreg.h @@ -2395,7 +2395,6 @@ struct msk_if_softc { struct msk_ring_data msk_rdata; struct msk_softc *msk_softc; /* parent controller */ struct msk_hw_stats msk_stats; - struct task msk_link_task; struct task msk_tx_task; int msk_if_flags; int msk_detach; |