summaryrefslogtreecommitdiff
path: root/openwrt
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-01-11 20:23:41 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-01-11 20:23:41 +0000
commit5f7cbbbcdbe68d2948bcf2ef53f7c15d54bdf91d (patch)
tree95834cc04b55191577c24b48f7ed48a2cfbeecfd /openwrt
parent80fa7cba82003945a68c0b6d97839a7ec33b13cf (diff)
downloadmtk-20170518-5f7cbbbcdbe68d2948bcf2ef53f7c15d54bdf91d.zip
mtk-20170518-5f7cbbbcdbe68d2948bcf2ef53f7c15d54bdf91d.tar.gz
mtk-20170518-5f7cbbbcdbe68d2948bcf2ef53f7c15d54bdf91d.tar.bz2
hardcode number of vlans in switch-robo (run-time detection doesn't seem to work)
SVN-Revision: 2920
Diffstat (limited to 'openwrt')
-rw-r--r--openwrt/target/linux/package/switch/src/switch-robo.c30
1 files changed, 3 insertions, 27 deletions
diff --git a/openwrt/target/linux/package/switch/src/switch-robo.c b/openwrt/target/linux/package/switch/src/switch-robo.c
index 57978bc..4983eec 100644
--- a/openwrt/target/linux/package/switch/src/switch-robo.c
+++ b/openwrt/target/linux/package/switch/src/switch-robo.c
@@ -52,7 +52,6 @@
static int use_et = 0;
static int is_5350 = 0;
-static int max_vlans, max_ports;
static struct ifreq ifr;
static struct net_device *dev;
@@ -256,30 +255,7 @@ static int robo_probe(char *devname)
}
is_5350 = robo_vlan5350();
- max_ports = 6;
- for (i = 0; i <= (is_5350 ? VLAN_ID_MAX5350 : VLAN_ID_MAX); i++) {
- /* issue read */
- __u16 val16 = (i) /* vlan */ | (0 << 12) /* read */ | (1 << 13) /* enable */;
-
- if (is_5350) {
- u32 val32;
- robo_write16(ROBO_VLAN_PAGE, ROBO_VLAN_TABLE_ACCESS_5350, val16);
- /* actual read */
- val32 = robo_read32(ROBO_VLAN_PAGE, ROBO_VLAN_READ);
- if ((val32 & (1 << 20)) /* valid */) {
- max_vlans = i + 1;
- }
- } else {
- robo_write16(ROBO_VLAN_PAGE, ROBO_VLAN_TABLE_ACCESS, val16);
- /* actual read */
- val16 = robo_read16(ROBO_VLAN_PAGE, ROBO_VLAN_READ);
- if ((val16 & (1 << 14)) /* valid */) {
- max_vlans = i + 1;
- }
- }
- }
-
printk("found!\n");
return 0;
}
@@ -376,9 +352,9 @@ static int __init robo_init()
switch_driver driver = {
name: DRIVER_NAME,
interface: device,
- cpuport: max_ports - 1,
- ports: max_ports,
- vlans: max_vlans,
+ cpuport: 5,
+ ports: 6,
+ vlans: 16,
driver_handlers: NULL,
port_handlers: NULL,
vlan_handlers: vlan,