summaryrefslogtreecommitdiff
path: root/target/linux/generic
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-02-11 10:05:35 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-02-11 10:05:35 +0000
commitc475d8eda70a4a6bb1e7568567b65b327d0f47cc (patch)
tree316d35a6414ec1c64ee4739c1f19e0a4921afb23 /target/linux/generic
parentdbeab3d4f98464c7c67832dbf38e35d5947442dd (diff)
generic: ar8216: fix PHY features setup
Sujith says: This commit breaks the WAN port on my AP96 - DHCP fails. Reverting it fixes the issue. commit b67cc3a0cdd02973610d4d5a63226d1c44841e94 Author: juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> Date: Fri Feb 8 09:13:18 2013 +0000 generic: ar8216: simplify phy features setup Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@355183c298f89-4303-0410-b956-a3cf2f4a3e73 This change restores the previous behaviour and moves the code into the ar8216_probe function. Reported-by: Sujith Manoharan <sujith@msujith.org> Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Tested-by: Sujith Manoharan <sujith@msujith.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35549 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic')
-rw-r--r--target/linux/generic/files/drivers/net/phy/ar8216.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index c0b51e7c67..c4631080e8 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -1861,12 +1861,6 @@ ar8216_config_init(struct phy_device *pdev)
priv->phy = pdev;
- if (ar8xxx_has_gige(priv))
- pdev->supported = SUPPORTED_1000baseT_Full;
- else
- pdev->supported = SUPPORTED_100baseT_Full;
- pdev->advertising = pdev->supported;
-
if (pdev->addr != 0) {
if (chip_is_ar8316(priv)) {
/* check if we're attaching to the switch twice */
@@ -2050,8 +2044,28 @@ ar8216_probe(struct phy_device *pdev)
priv->phy = pdev;
ret = ar8xxx_probe_switch(priv);
- ar8xxx_free(priv);
+ if (ret)
+ goto out;
+ if (pdev->addr == 0) {
+ if (ar8xxx_has_gige(priv)) {
+ pdev->supported = SUPPORTED_1000baseT_Full;
+ pdev->advertising = ADVERTISED_1000baseT_Full;
+ } else {
+ pdev->supported = SUPPORTED_100baseT_Full;
+ pdev->advertising = ADVERTISED_100baseT_Full;
+ }
+ } else {
+ if (ar8xxx_has_gige(priv)) {
+ pdev->supported |= SUPPORTED_1000baseT_Full;
+ pdev->advertising |= ADVERTISED_1000baseT_Full;
+ }
+ }
+
+ ret = 0;
+
+out:
+ ar8xxx_free(priv);
return ret;
}