Author: adrian
Date: Wed Feb 19 04:30:53 2014
New Revision: 262201
URL: http://svnweb.freebsd.org/changeset/base/262201

Log:
  Store away the chip version and revision; some AR8327 code depends upon
  the chip revision.

Modified:
  head/sys/dev/etherswitch/arswitch/arswitch.c
  head/sys/dev/etherswitch/arswitch/arswitchvar.h

Modified: head/sys/dev/etherswitch/arswitch/arswitch.c
==============================================================================
--- head/sys/dev/etherswitch/arswitch/arswitch.c        Wed Feb 19 04:23:01 
2014        (r262200)
+++ head/sys/dev/etherswitch/arswitch/arswitch.c        Wed Feb 19 04:30:53 
2014        (r262201)
@@ -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";

Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h
==============================================================================
--- head/sys/dev/etherswitch/arswitch/arswitchvar.h     Wed Feb 19 04:23:01 
2014        (r262200)
+++ head/sys/dev/etherswitch/arswitch/arswitchvar.h     Wed Feb 19 04:30:53 
2014        (r262201)
@@ -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];
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to