mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-10 18:05:19 +02:00
hardcode number of vlans in switch-robo (run-time detection doesn't seem to work)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@2920 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
62a6047cb1
commit
5086bd86f8
@ -52,7 +52,6 @@
|
|||||||
|
|
||||||
static int use_et = 0;
|
static int use_et = 0;
|
||||||
static int is_5350 = 0;
|
static int is_5350 = 0;
|
||||||
static int max_vlans, max_ports;
|
|
||||||
static struct ifreq ifr;
|
static struct ifreq ifr;
|
||||||
static struct net_device *dev;
|
static struct net_device *dev;
|
||||||
|
|
||||||
@ -256,29 +255,6 @@ static int robo_probe(char *devname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
is_5350 = robo_vlan5350();
|
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");
|
printk("found!\n");
|
||||||
return 0;
|
return 0;
|
||||||
@ -376,9 +352,9 @@ static int __init robo_init()
|
|||||||
switch_driver driver = {
|
switch_driver driver = {
|
||||||
name: DRIVER_NAME,
|
name: DRIVER_NAME,
|
||||||
interface: device,
|
interface: device,
|
||||||
cpuport: max_ports - 1,
|
cpuport: 5,
|
||||||
ports: max_ports,
|
ports: 6,
|
||||||
vlans: max_vlans,
|
vlans: 16,
|
||||||
driver_handlers: NULL,
|
driver_handlers: NULL,
|
||||||
port_handlers: NULL,
|
port_handlers: NULL,
|
||||||
vlan_handlers: vlan,
|
vlan_handlers: vlan,
|
||||||
|
Loading…
Reference in New Issue
Block a user