diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-11-19 20:17:30 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-11-19 20:17:30 +0000 |
commit | a31b9fd14de0d49147dbed1ac6044c945767408f (patch) | |
tree | 3fa35c8cf859fe0e0d3af00a35ca537dc582c1d9 /target/linux/generic/files | |
parent | 9b9d569e4b358dd30897a2d5c02cc41fcdc549db (diff) | |
download | upstream-a31b9fd14de0d49147dbed1ac6044c945767408f.tar.gz upstream-a31b9fd14de0d49147dbed1ac6044c945767408f.tar.bz2 upstream-a31b9fd14de0d49147dbed1ac6044c945767408f.zip |
ar8216: introduce global constant for number of PHYs
All supported switches have 5 PHYs. Currently partially 5 is hardcoded
and partially switch-specific constants exist.
Replace them with a global constant.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43328 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/files')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/ar8216.c | 8 | ||||
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/ar8216.h | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index 4410fbba50..d57f9e5e14 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -51,6 +51,8 @@ struct ar8xxx_priv; #define AR8XXX_CAP_GIGE BIT(0) #define AR8XXX_CAP_MIB_COUNTERS BIT(1) +#define AR8XXX_NUM_PHYS 5 + enum { AR8XXX_VER_AR8216 = 0x01, AR8XXX_VER_AR8236 = 0x03, @@ -868,7 +870,7 @@ ar8236_hw_init(struct ar8xxx_priv *priv) /* Initialize the PHYs */ bus = priv->mii_bus; - for (i = 0; i < 5; i++) { + for (i = 0; i < AR8XXX_NUM_PHYS; i++) { mdiobus_write(bus, i, MII_ADVERTISE, ADVERTISE_ALL | ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM); @@ -954,7 +956,7 @@ ar8316_hw_init(struct ar8xxx_priv *priv) /* Initialize the ports */ bus = priv->mii_bus; - for (i = 0; i < 5; i++) { + for (i = 0; i < AR8XXX_NUM_PHYS; i++) { /* initialize the port itself */ mdiobus_write(bus, i, MII_ADVERTISE, ADVERTISE_ALL | ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM); @@ -1609,7 +1611,7 @@ ar8327_hw_init(struct ar8xxx_priv *priv) ar8327_leds_init(priv); bus = priv->mii_bus; - for (i = 0; i < AR8327_NUM_PHYS; i++) { + for (i = 0; i < AR8XXX_NUM_PHYS; i++) { ar8327_phy_fixup(priv, i); /* start aneg on the PHY */ diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.h b/target/linux/generic/files/drivers/net/phy/ar8216.h index eb553b489d..ca6b2f2915 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.h +++ b/target/linux/generic/files/drivers/net/phy/ar8216.h @@ -291,7 +291,6 @@ #define AR8327_NUM_PORTS 7 #define AR8327_NUM_LEDS 15 -#define AR8327_NUM_PHYS 5 #define AR8327_PORTS_ALL 0x7f #define AR8327_NUM_LED_CTRL_REGS 4 |