aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/drivers/net/phy/ar8216.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-01-18 00:53:53 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-01-18 00:53:53 +0000
commitbdc0750191660af3ecefbc52327978af1cd93407 (patch)
treed9c3e27c665764f79bdc79a464d786909bd808d7 /target/linux/generic/files/drivers/net/phy/ar8216.c
parent2f43d3dcba06977877fcab7682be8ecd22c1df5d (diff)
downloadupstream-bdc0750191660af3ecefbc52327978af1cd93407.tar.gz
upstream-bdc0750191660af3ecefbc52327978af1cd93407.tar.bz2
upstream-bdc0750191660af3ecefbc52327978af1cd93407.zip
ar8216: introduce enable_eee swconfig attribute to control 802.3az EEE per port
Users reported network issues with AR8327 which turned out to be caused by EEE not working correctly with certain link partners (ticket 14597). The workaround was to disable EEE on all ports (changeset 41577). The issue was with certain link partners only, therefore this patch allows to control usage of EEE per port via swconfig. Still the default is to initially disable EEE on all ports. Successfully tested on a TL-WDR4900 (AR8327 rev.4) Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 44021
Diffstat (limited to 'target/linux/generic/files/drivers/net/phy/ar8216.c')
-rw-r--r--target/linux/generic/files/drivers/net/phy/ar8216.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 2fd44253c8..99d0e8220f 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -1041,6 +1041,7 @@ int
ar8xxx_sw_reset_switch(struct switch_dev *dev)
{
struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev);
+ const struct ar8xxx_chip *chip = priv->chip;
int i;
mutex_lock(&priv->reg_mutex);
@@ -1052,18 +1053,18 @@ ar8xxx_sw_reset_switch(struct switch_dev *dev)
/* Configure all ports */
for (i = 0; i < dev->ports; i++)
- priv->chip->init_port(priv, i);
+ chip->init_port(priv, i);
priv->mirror_rx = false;
priv->mirror_tx = false;
priv->source_port = 0;
priv->monitor_port = 0;
- priv->chip->init_globals(priv);
+ chip->init_globals(priv);
mutex_unlock(&priv->reg_mutex);
- return ar8xxx_sw_hw_apply(dev);
+ return chip->sw_hw_apply(dev);
}
int
@@ -1194,7 +1195,7 @@ ar8xxx_sw_get_mirror_source_port(struct switch_dev *dev,
return 0;
}
-static int
+int
ar8xxx_sw_set_port_reset_mib(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
@@ -1224,7 +1225,7 @@ unlock:
return ret;
}
-static int
+int
ar8xxx_sw_get_port_mib(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
@@ -1390,6 +1391,7 @@ static const struct ar8xxx_chip ar8216_chip = {
.vtu_flush = ar8216_vtu_flush,
.vtu_load_vlan = ar8216_vtu_load_vlan,
.set_mirror_regs = ar8216_set_mirror_regs,
+ .sw_hw_apply = ar8xxx_sw_hw_apply,
.num_mibs = ARRAY_SIZE(ar8216_mibs),
.mib_decs = ar8216_mibs,
@@ -1416,6 +1418,7 @@ static const struct ar8xxx_chip ar8236_chip = {
.vtu_flush = ar8216_vtu_flush,
.vtu_load_vlan = ar8216_vtu_load_vlan,
.set_mirror_regs = ar8216_set_mirror_regs,
+ .sw_hw_apply = ar8xxx_sw_hw_apply,
.num_mibs = ARRAY_SIZE(ar8236_mibs),
.mib_decs = ar8236_mibs,
@@ -1442,6 +1445,7 @@ static const struct ar8xxx_chip ar8316_chip = {
.vtu_flush = ar8216_vtu_flush,
.vtu_load_vlan = ar8216_vtu_load_vlan,
.set_mirror_regs = ar8216_set_mirror_regs,
+ .sw_hw_apply = ar8xxx_sw_hw_apply,
.num_mibs = ARRAY_SIZE(ar8236_mibs),
.mib_decs = ar8236_mibs,