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

the chip revision.
This commit is contained in:
Adrian Chadd 2014-02-19 04:30:53 +00:00
parent 26ca36d4ca
commit dd843f87d3
2 changed files with 4 additions and 0 deletions

View File

@ -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";

View File

@ -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];