diff options
author | Hauke Mehrtens <hauke@openwrt.org> | 2013-02-13 16:03:47 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@openwrt.org> | 2013-02-13 16:03:47 +0000 |
commit | 8e4b44416699772bc8ca77e8e9ddc1d0ec5a2620 (patch) | |
tree | 14de6325a63e51752a41c69cd7e78af9db395fbc /package/switch | |
parent | 9f68dd6769936a51c24dbd7d5f838d1415005e4a (diff) | |
download | upstream-8e4b44416699772bc8ca77e8e9ddc1d0ec5a2620.tar.gz upstream-8e4b44416699772bc8ca77e8e9ddc1d0ec5a2620.tar.bz2 upstream-8e4b44416699772bc8ca77e8e9ddc1d0ec5a2620.zip |
switch: fix switches with more than 6 ports
This is based on a patch by jcharest and the Broadcom SDK.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35582 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/switch')
-rw-r--r-- | package/switch/src/switch-robo.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/package/switch/src/switch-robo.c b/package/switch/src/switch-robo.c index 0ab2f69341..0e39c8fe56 100644 --- a/package/switch/src/switch-robo.c +++ b/package/switch/src/switch-robo.c @@ -78,7 +78,7 @@ struct robo_switch { int gpio_lanports_enable; struct ifreq ifr; struct net_device *dev; - unsigned char port[6]; + unsigned char port[9]; }; /* Currently we can only have one device in the system. */ @@ -308,9 +308,6 @@ static int robo_probe(char *devname) } robo.device = devname; - for (i = 0; i < 5; i++) - robo.port[i] = i; - robo.port[5] = 8; /* try access using MII ioctls - get phy address */ err = do_ioctl(SIOCGMIIPHY); @@ -386,6 +383,14 @@ static int robo_probe(char *devname) robo.is_5365 = false; robo.gmii = robo_gmii(); + if (robo.devid == ROBO_DEVICE_ID_5325) { + for (i = 0; i < 5; i++) + robo.port[i] = i; + } else { + for (i = 0; i < 8; i++) + robo.port[i] = i; + } + robo.port[i] = ROBO_IM_PORT_CTRL; robo_switch_reset(); err = robo_switch_enable(); |