aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-03-13 17:29:34 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-03-13 17:29:34 +0000
commit4e4e7aeec4dee3ad033949f06353c323f881a38e (patch)
treedf37ccca1c3185fe46ed820ae1472999936042a4 /target
parent011e04374600c1fd923baa7b96380142f64d59fe (diff)
downloadupstream-4e4e7aeec4dee3ad033949f06353c323f881a38e.tar.gz
upstream-4e4e7aeec4dee3ad033949f06353c323f881a38e.tar.bz2
upstream-4e4e7aeec4dee3ad033949f06353c323f881a38e.zip
ar71xx: ag71xx: allow to use port 5 of the AR934x built-in switch
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30923 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c
index 8a497b0cab..25ee7d4f14 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c
@@ -1017,6 +1017,7 @@ static struct ar7240sw *ar7240_probe(struct ag71xx *ag)
if (sw_is_ar7240(as)) {
swdev->name = "AR7240/AR9330 built-in switch";
+ swdev->ports = AR7240_NUM_PORTS - 1;
} else if (sw_is_ar934x(as)) {
swdev->name = "AR934X built-in switch";
@@ -1032,16 +1033,19 @@ static struct ar7240sw *ar7240_probe(struct ag71xx *ag)
goto err_free;
}
- if (as->swdata->phy4_mii_en)
+ if (as->swdata->phy4_mii_en) {
ar7240sw_reg_set(mii, AR934X_REG_OPER_MODE1,
AR934X_REG_OPER_MODE1_PHY4_MII_EN);
+ swdev->ports = AR7240_NUM_PORTS - 1;
+ } else {
+ swdev->ports = AR7240_NUM_PORTS;
+ }
} else {
pr_err("%s: unsupported chip, ctrl=%08x\n",
ag->dev->name, ctrl);
goto err_free;
}
- swdev->ports = AR7240_NUM_PORTS - 1;
swdev->cpu_port = AR7240_PORT_CPU;
swdev->vlans = AR7240_MAX_VLANS;
swdev->ops = &ar7240_ops;