diff options
author | adrian <adrian@FreeBSD.org> | 2014-02-19 04:30:53 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2014-02-19 04:30:53 +0000 |
commit | 4223f4f32140bbb15d1ccfe8a400e64fd35512ce (patch) | |
tree | dc471af4771e67e4bcb2258c3f28c0b906427989 | |
parent | d6af13f80d8392642c3f3ee893c525c7008ca036 (diff) | |
download | FreeBSD-src-4223f4f32140bbb15d1ccfe8a400e64fd35512ce.zip FreeBSD-src-4223f4f32140bbb15d1ccfe8a400e64fd35512ce.tar.gz |
Store away the chip version and revision; some AR8327 code depends upon
the chip revision.
-rw-r--r-- | sys/dev/etherswitch/arswitch/arswitch.c | 2 | ||||
-rw-r--r-- | sys/dev/etherswitch/arswitch/arswitchvar.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/etherswitch/arswitch/arswitch.c b/sys/dev/etherswitch/arswitch/arswitch.c index ad8ca5b..14977be 100644 --- a/sys/dev/etherswitch/arswitch/arswitch.c +++ b/sys/dev/etherswitch/arswitch/arswitch.c @@ -112,6 +112,8 @@ arswitch_probe(device_t dev) /* AR8xxx probe */ id = arswitch_readreg(dev, AR8X16_REG_MASK_CTRL); + sc->chip_rev = (id & AR8X16_MASK_CTRL_REV_MASK); + sc->chip_ver = (id & AR8X16_MASK_CTRL_VER_MASK) > AR8X16_MASK_CTRL_VER_SHIFT; switch (id & (AR8X16_MASK_CTRL_VER_MASK | AR8X16_MASK_CTRL_REV_MASK)) { case 0x0101: chipname = "AR8216"; diff --git a/sys/dev/etherswitch/arswitch/arswitchvar.h b/sys/dev/etherswitch/arswitch/arswitchvar.h index 10a942d..54a7338 100644 --- a/sys/dev/etherswitch/arswitch/arswitchvar.h +++ b/sys/dev/etherswitch/arswitch/arswitchvar.h @@ -53,6 +53,8 @@ struct arswitch_softc { int is_mii; /* PHY mode is MII (XXX which PHY?) */ int page; int is_internal_switch; + int chip_ver; + int chip_rev; int mii_lo_first; ar8x16_switch_type sc_switchtype; char *ifname[AR8X16_NUM_PHYS]; |