summaryrefslogtreecommitdiffstats
path: root/sys/dev/ed
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2009-04-07 15:43:34 +0000
committerimp <imp@FreeBSD.org>2009-04-07 15:43:34 +0000
commit7fcd8ddb86e3d7a44d957308404e11add0a254f2 (patch)
treef3ad76d8dff358e31278d71fdeeabd6706c6b969 /sys/dev/ed
parentfc993203a0af169531f7887f0dc1a7660e9d41f7 (diff)
downloadFreeBSD-src-7fcd8ddb86e3d7a44d957308404e11add0a254f2.zip
FreeBSD-src-7fcd8ddb86e3d7a44d957308404e11add0a254f2.tar.gz
Move tick to end of file for better code references.
Diffstat (limited to 'sys/dev/ed')
-rw-r--r--sys/dev/ed/if_ed_pccard.c55
1 files changed, 31 insertions, 24 deletions
diff --git a/sys/dev/ed/if_ed_pccard.c b/sys/dev/ed/if_ed_pccard.c
index 53034cd..a677cb9 100644
--- a/sys/dev/ed/if_ed_pccard.c
+++ b/sys/dev/ed/if_ed_pccard.c
@@ -239,6 +239,7 @@ static const struct ed_product {
*/
static int ed_pccard_probe(device_t);
static int ed_pccard_attach(device_t);
+static void ed_pccard_tick(void *);
static int ed_pccard_dl100xx(device_t dev, const struct ed_product *);
static void ed_pccard_dl100xx_mii_reset(struct ed_softc *sc);
@@ -426,30 +427,6 @@ ed_pccard_mediachg(struct ed_softc *sc)
mii_mediachg(mii);
}
-static void
-ed_pccard_tick(void *arg)
-{
- struct ed_softc *sc = arg;
- struct mii_data *mii;
- int media = 0;
-
- ED_ASSERT_LOCKED(sc);
- if (sc->miibus != NULL) {
- mii = device_get_softc(sc->miibus);
- media = mii->mii_media_status;
- mii_tick(mii);
- if (mii->mii_media_status & IFM_ACTIVE &&
- media != mii->mii_media_status && 0 &&
- sc->chip_type == ED_CHIP_TYPE_DL10022) {
- ed_asic_outb(sc, ED_DL10022_DIAG,
- (mii->mii_media_active & IFM_FDX) ?
- ED_DL10022_COLLISON_DIS : 0);
- }
-
- }
- callout_reset(&sc->tick_ch, hz, ed_pccard_tick, sc);
-}
-
static int
ed_pccard_attach(device_t dev)
{
@@ -1204,6 +1181,36 @@ ed_child_detached(device_t dev, device_t child)
sc->miibus = NULL;
}
+static void
+ed_pccard_tick(void *arg)
+{
+ struct ed_softc *sc = arg;
+ struct mii_data *mii;
+ int media = 0;
+
+ ED_ASSERT_LOCKED(sc);
+ if (sc->miibus != NULL) {
+ mii = device_get_softc(sc->miibus);
+ media = mii->mii_media_status;
+ mii_tick(mii);
+ if (mii->mii_media_status & IFM_ACTIVE &&
+ media != mii->mii_media_status) {
+ if (sc->chip_type == ED_CHIP_TYPE_DL10022) {
+ printf("Enabling 10022 workaround\n");
+ ed_asic_outb(sc, ED_DL10022_DIAG,
+ (mii->mii_media_active & IFM_FDX) ?
+ ED_DL10022_COLLISON_DIS : 0);
+ } else if (sc->chip_type == ED_CHIP_TYPE_DL10019) {
+ write_asic(sc, ED_DL10019_MAGIC,
+ (mii->mii_media_active & IFM_FDX) ?
+ DL19FDUPLX : 0);
+ }
+ }
+
+ }
+ callout_reset(&sc->tick_ch, hz, ed_pccard_tick, sc);
+}
+
static device_method_t ed_pccard_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, ed_pccard_probe),
OpenPOWER on IntegriCloud