aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2007-08-01 16:54:51 +0000
committerGabor Juhos <juhosg@openwrt.org>2007-08-01 16:54:51 +0000
commitc2ed86a8598462a4993631491b9e733b963ff98f (patch)
tree4dfcda9c4a75ebceaea730c1182c576b994573c3 /target/linux
parenta3685c5251e40b654f57a02fdaacd081824e6843 (diff)
downloadupstream-c2ed86a8598462a4993631491b9e733b963ff98f.tar.gz
upstream-c2ed86a8598462a4993631491b9e733b963ff98f.tar.bz2
upstream-c2ed86a8598462a4993631491b9e733b963ff98f.zip
add support for board specific vlan matrix, should fix #2132
SVN-Revision: 8309
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/adm5120-2.6/files/arch/mips/adm5120/board.c9
-rw-r--r--target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/cellvision.c12
-rw-r--r--target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/compex.c36
-rw-r--r--target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/edimax.c7
-rw-r--r--target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/generic.c2
-rw-r--r--target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/infineon.c8
-rw-r--r--target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/mikrotik.c35
-rw-r--r--target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/zyxel.c20
-rw-r--r--target/linux/adm5120-2.6/files/arch/mips/adm5120/platform.c10
-rw-r--r--target/linux/adm5120-2.6/files/drivers/net/adm5120sw.c33
-rw-r--r--target/linux/adm5120-2.6/files/include/asm-mips/mach-adm5120/adm5120_board.h3
-rw-r--r--target/linux/adm5120-2.6/files/include/asm-mips/mach-adm5120/adm5120_info.h1
12 files changed, 123 insertions, 53 deletions
diff --git a/target/linux/adm5120-2.6/files/arch/mips/adm5120/board.c b/target/linux/adm5120-2.6/files/arch/mips/adm5120/board.c
index 17b88c0011..f106009527 100644
--- a/target/linux/adm5120-2.6/files/arch/mips/adm5120/board.c
+++ b/target/linux/adm5120-2.6/files/arch/mips/adm5120/board.c
@@ -82,8 +82,13 @@ static int __init adm5120_board_setup(void)
memcpy(&adm5120_board_name, board->name, ADM5120_BOARD_NAMELEN);
adm5120_board_reset = board->board_reset;
- if (board->num_eth_ports > 0)
- adm5120_eth_num_ports = board->num_eth_ports;
+ if (board->eth_num_ports > 0)
+ adm5120_eth_num_ports = board->eth_num_ports;
+
+ if (board->eth_vlans)
+ memcpy(adm5120_eth_vlans, board->eth_vlans,
+ sizeof(adm5120_eth_vlans));
+
if (board->board_setup)
board->board_setup();
diff --git a/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/cellvision.c b/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/cellvision.c
index fa82b93a11..40e2acfbc7 100644
--- a/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/cellvision.c
+++ b/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/cellvision.c
@@ -128,7 +128,7 @@ static struct adm5120_board cas630_board __initdata = {
.mach_type = MACH_ADM5120_CAS630,
.name = "Cellvision CAS-630/630W",
.board_setup = cas6xx_setup,
- .num_eth_ports = 1,
+ .eth_num_ports = 1,
.num_devices = ARRAY_SIZE(cas6xx_devices),
.devices = cas6xx_devices,
};
@@ -137,7 +137,7 @@ static struct adm5120_board cas670_board __initdata = {
.mach_type = MACH_ADM5120_CAS670,
.name = "Cellvision CAS-670/670W",
.board_setup = cas6xx_setup,
- .num_eth_ports = 1,
+ .eth_num_ports = 1,
.num_devices = ARRAY_SIZE(cas6xx_devices),
.devices = cas6xx_devices,
};
@@ -146,7 +146,7 @@ static struct adm5120_board cas700_board __initdata = {
.mach_type = MACH_ADM5120_CAS700,
.name = "Cellvision CAS-700/700W",
.board_setup = cas7xx_setup,
- .num_eth_ports = 1,
+ .eth_num_ports = 1,
.num_devices = ARRAY_SIZE(cas7xx_devices),
.devices = cas7xx_devices,
};
@@ -155,7 +155,7 @@ static struct adm5120_board cas771_board __initdata = {
.mach_type = MACH_ADM5120_CAS771,
.name = "Cellvision CAS-771/771W",
.board_setup = cas7xx_setup,
- .num_eth_ports = 1,
+ .eth_num_ports = 1,
.num_devices = ARRAY_SIZE(cas7xx_devices),
.devices = cas7xx_devices,
};
@@ -164,7 +164,7 @@ static struct adm5120_board cas790_board __initdata = {
.mach_type = MACH_ADM5120_CAS790,
.name = "Cellvision CAS-790",
.board_setup = cas7xx_setup,
- .num_eth_ports = 1,
+ .eth_num_ports = 1,
.num_devices = ARRAY_SIZE(cas7xx_devices),
.devices = cas7xx_devices,
};
@@ -173,7 +173,7 @@ static struct adm5120_board cas861_board __initdata = {
.mach_type = MACH_ADM5120_CAS861,
.name = "Cellvision CAS-861/861W",
.board_setup = cas7xx_setup,
- .num_eth_ports = 1,
+ .eth_num_ports = 1,
.num_devices = ARRAY_SIZE(cas7xx_devices),
.devices = cas7xx_devices,
};
diff --git a/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/compex.c b/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/compex.c
index 7a48cb04c5..a59e08f434 100644
--- a/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/compex.c
+++ b/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/compex.c
@@ -117,11 +117,27 @@ static void __init wp54_wrt_setup(void)
/* TODO: setup mac address */
}
+unsigned char np27g_vlans[6] __initdata = {
+ /* FIXME: untested */
+ 0x41, 0x42, 0x44, 0x48, 0x50, 0x00
+};
+
+unsigned char np28g_vlans[6] __initdata = {
+ /* FIXME: untested */
+ 0x41, 0x42, 0x44, 0x48, 0x00, 0x00
+};
+
+unsigned char wp54_vlans[6] __initdata = {
+ /* FIXME: untested */
+ 0x41, 0x42, 0x00, 0x00, 0x00, 0x00
+};
+
static struct adm5120_board np27g_board __initdata = {
.mach_type = MACH_ADM5120_NP27G,
.name = "Compex NetPassage 27G",
.board_setup = np2xg_setup,
- .num_eth_ports = 4,
+ .eth_num_ports = 5,
+ .eth_vlans = np27g_vlans,
.num_devices = ARRAY_SIZE(np2xg_devices),
.devices = np2xg_devices,
};
@@ -130,7 +146,8 @@ static struct adm5120_board np28g_board __initdata = {
.mach_type = MACH_ADM5120_NP28G,
.name = "Compex NetPassage 28G",
.board_setup = np2xg_setup,
- .num_eth_ports = 3,
+ .eth_num_ports = 4,
+ .eth_vlans = np28g_vlans,
.num_devices = ARRAY_SIZE(np2xg_devices),
.devices = np2xg_devices,
};
@@ -140,7 +157,8 @@ static struct adm5120_board wp54ag_board __initdata = {
.name = "Compex WP54AG",
.board_setup = wp54_setup,
.board_reset = wp54_reset,
- .num_eth_ports = 2,
+ .eth_num_ports = 2,
+ .eth_vlans = wp54_vlans,
.num_devices = ARRAY_SIZE(wp54_devices),
.devices = wp54_devices,
};
@@ -150,7 +168,8 @@ static struct adm5120_board wp54g_board __initdata = {
.name = "Compex WP54G",
.board_setup = wp54_setup,
.board_reset = wp54_reset,
- .num_eth_ports = 2,
+ .eth_num_ports = 2,
+ .eth_vlans = wp54_vlans,
.num_devices = ARRAY_SIZE(wp54_devices),
.devices = wp54_devices,
};
@@ -160,7 +179,8 @@ static struct adm5120_board wp54g_wrt_board __initdata = {
.name = "Compex WP54G-WRT",
.board_setup = wp54_wrt_setup,
.board_reset = wp54_reset,
- .num_eth_ports = 2,
+ .eth_num_ports = 2,
+ .eth_vlans = wp54_vlans,
.num_devices = ARRAY_SIZE(wp54_devices),
.devices = wp54_devices,
};
@@ -170,7 +190,8 @@ static struct adm5120_board wpp54ag_board __initdata = {
.name = "Compex WPP54AG",
.board_setup = wp54_setup,
.board_reset = wp54_reset,
- .num_eth_ports = 2,
+ .eth_num_ports = 2,
+ .eth_vlans = wp54_vlans,
.num_devices = ARRAY_SIZE(wp54_devices),
.devices = wp54_devices,
};
@@ -180,7 +201,8 @@ static struct adm5120_board wpp54g_board __initdata = {
.name = "Compex WPP54G",
.board_setup = wp54_setup,
.board_reset = wp54_reset,
- .num_eth_ports = 2,
+ .eth_num_ports = 2,
+ .eth_vlans = wp54_vlans,
.num_devices = ARRAY_SIZE(wp54_devices),
.devices = wp54_devices,
};
diff --git a/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/edimax.c b/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/edimax.c
index f39d5c763d..30efdf553d 100644
--- a/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/edimax.c
+++ b/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/edimax.c
@@ -61,11 +61,16 @@ static void __init br6104k_setup(void) {
/* TODO: setup mac addresses, if possible */
}
+unsigned char br6104k_vlans[6] = {
+ 0x41, 0x42, 0x44, 0x48, 0x50, 0x00
+};
+
static struct adm5120_board br6104k_board __initdata = {
.mach_type = MACH_ADM5120_BR6104K,
.name = "Edimax BR-6104K",
.board_setup = br6104k_setup,
- .num_eth_ports = 5,
+ .eth_num_ports = 5,
+ .eth_vlans = br6104k_vlans,
.num_devices = ARRAY_SIZE(br6104k_devices),
.devices = br6104k_devices,
};
diff --git a/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/generic.c b/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/generic.c
index 8d795a8816..78a8f557b5 100644
--- a/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/generic.c
+++ b/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/generic.c
@@ -39,7 +39,7 @@ static struct platform_device *generic_devices[] __initdata = {
static struct adm5120_board generic_board __initdata = {
.mach_type = MACH_ADM5120_GENERIC,
.name = "Generic ADM5120 board",
- .num_eth_ports = 6,
+ .eth_num_ports = 6,
.num_devices = ARRAY_SIZE(generic_devices),
.devices = generic_devices,
};
diff --git a/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/infineon.c b/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/infineon.c
index e1426cca9d..6873ac0b4e 100644
--- a/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/infineon.c
+++ b/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/infineon.c
@@ -123,7 +123,7 @@ static struct adm5120_board easy5120pata_board __initdata = {
.mach_type = MACH_ADM5120_EASY5120PATA,
.name = "Infineon EASY 5120P-ATA Reference Board",
.board_setup = easy_setup_pqfp,
- .num_eth_ports = 6,
+ .eth_num_ports = 6,
.num_devices = ARRAY_SIZE(easy5120pata_devices),
.devices = easy5120pata_devices,
};
@@ -132,7 +132,7 @@ static struct adm5120_board easy5120rt_board __initdata = {
.mach_type = MACH_ADM5120_EASY5120RT,
.name = "Infineon EASY 5120-RT Reference Board",
.board_setup = easy_setup_bga,
- .num_eth_ports = 5,
+ .eth_num_ports = 5,
.num_devices = ARRAY_SIZE(easy5120rt_devices),
.devices = easy5120rt_devices,
};
@@ -141,7 +141,7 @@ static struct adm5120_board easy5120wvoip_board __initdata = {
.mach_type = MACH_ADM5120_EASY5120WVOIP,
.name = "Infineon EASY 5120-WVoIP Reference Board",
.board_setup = easy_setup_bga,
- .num_eth_ports = 6,
+ .eth_num_ports = 6,
.num_devices = ARRAY_SIZE(easy5120wvoip_devices),
.devices = easy5120wvoip_devices,
};
@@ -150,7 +150,7 @@ static struct adm5120_board easy83000_board __initdata = {
.mach_type = MACH_ADM5120_EASY83000,
.name = "Infineon EASY 83000 Reference Board",
.board_setup = easy_setup_pqfp,
- .num_eth_ports = 6,
+ .eth_num_ports = 6,
.num_devices = ARRAY_SIZE(easy83000_devices),
.devices = easy83000_devices,
};
diff --git a/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/mikrotik.c b/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/mikrotik.c
index fccb284d6c..c1b203f7cc 100644
--- a/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/mikrotik.c
+++ b/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/mikrotik.c
@@ -59,11 +59,32 @@ static void __init rb1xx_setup(void)
/* TODO: setup mac address */
}
+static unsigned char rb11x_vlans[6] __initdata = {
+ /* FIXME: untested */
+ 0x41, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+static unsigned char rb133_vlans[6] __initdata = {
+ /* FIXME: untested */
+ 0x41, 0x42, 0x44, 0x00, 0x00, 0x00
+};
+
+static unsigned char rb133c_vlans[6] __initdata = {
+ /* FIXME: untested */
+ 0x44, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+static unsigned char rb153_vlans[6] __initdata = {
+ /* FIXME: untested */
+ 0x41, 0x42, 0x44, 0x48, 0x50, 0x00
+};
+
static struct adm5120_board rb111_board __initdata = {
.mach_type = MACH_ADM5120_RB_111,
.name = "Mikrotik RouterBOARD 111",
.board_setup = rb1xx_setup,
- .num_eth_ports = 1,
+ .eth_num_ports = 1,
+ .eth_vlans = rb11x_vlans,
.num_devices = ARRAY_SIZE(rb1xx_devices),
.devices = rb1xx_devices,
};
@@ -72,7 +93,8 @@ static struct adm5120_board rb112_board __initdata = {
.mach_type = MACH_ADM5120_RB_112,
.name = "Mikrotik RouterBOARD 112",
.board_setup = rb1xx_setup,
- .num_eth_ports = 1,
+ .eth_num_ports = 1,
+ .eth_vlans = rb11x_vlans,
.num_devices = ARRAY_SIZE(rb1xx_devices),
.devices = rb1xx_devices,
};
@@ -81,7 +103,8 @@ static struct adm5120_board rb133_board __initdata = {
.mach_type = MACH_ADM5120_RB_133,
.name = "Mikrotik RouterBOARD 133",
.board_setup = rb1xx_setup,
- .num_eth_ports = 3,
+ .eth_num_ports = 3,
+ .eth_vlans = rb133_vlans,
.num_devices = ARRAY_SIZE(rb1xx_devices),
.devices = rb1xx_devices,
};
@@ -90,7 +113,8 @@ static struct adm5120_board rb133c_board __initdata = {
.mach_type = MACH_ADM5120_RB_133C,
.name = "Mikrotik RouterBOARD 133C",
.board_setup = rb1xx_setup,
- .num_eth_ports = 1,
+ .eth_num_ports = 1,
+ .eth_vlans = rb133c_vlans,
.num_devices = ARRAY_SIZE(rb1xx_devices),
.devices = rb1xx_devices,
};
@@ -99,7 +123,8 @@ static struct adm5120_board rb153_board __initdata = {
.mach_type = MACH_ADM5120_RB_153,
.name = "Mikrotik RouterBOARD 153",
.board_setup = rb1xx_setup,
- .num_eth_ports = 5,
+ .eth_num_ports = 5,
+ .eth_vlans = rb153_vlans,
.num_devices = ARRAY_SIZE(rb1xx_devices),
.devices = rb1xx_devices,
};
diff --git a/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/zyxel.c b/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/zyxel.c
index f6cdc8af4a..25e5a319be 100644
--- a/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/zyxel.c
+++ b/target/linux/adm5120-2.6/files/arch/mips/adm5120/boards/zyxel.c
@@ -55,9 +55,18 @@ static struct mtd_partition p33x_partitions[] = {
.offset = MTDPART_OFS_APPEND,
.size = 16*1024,
} , {
- .name = "firmware",
+ .name = "bootext",
+ .offset = MTDPART_OFS_APPEND,
+ .size = 96*1024,
+ .mask_flags = MTD_WRITEABLE,
+ } , {
+ .name = "trx",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL,
+ } , {
+ .name = "firmware",
+ .offset = 32*1024,
+ .size = MTDPART_SIZ_FULL,
}
};
@@ -83,10 +92,17 @@ static void __init p33x_setup(void)
/* TODO: setup mac address */
}
+unsigned char p33x_vlans[6] __initdata = {
+ /* FIXME: untested */
+ 0x50, 0x48, 0x44, 0x42, 0x41, 0x00
+};
+
static struct adm5120_board p334wt_board __initdata = {
.mach_type = MACH_ADM5120_P334WT,
.name = "ZyXEL Prestige 334WT",
.board_setup = p33x_setup,
+ .eth_num_ports = 5,
+ .eth_vlans = p33x_vlans,
.num_devices = ARRAY_SIZE(p334_devices),
.devices = p334_devices,
};
@@ -95,6 +111,8 @@ static struct adm5120_board p335_board __initdata = {
.mach_type = MACH_ADM5120_P335,
.name = "ZyXEL Prestige 335/335WT",
.board_setup = p33x_setup,
+ .eth_num_ports = 5,
+ .eth_vlans = p33x_vlans,
.num_devices = ARRAY_SIZE(p335_devices),
.devices = p335_devices,
};
diff --git a/target/linux/adm5120-2.6/files/arch/mips/adm5120/platform.c b/target/linux/adm5120-2.6/files/arch/mips/adm5120/platform.c
index 723f27fe70..e3d0513605 100644
--- a/target/linux/adm5120-2.6/files/arch/mips/adm5120/platform.c
+++ b/target/linux/adm5120-2.6/files/arch/mips/adm5120/platform.c
@@ -47,6 +47,8 @@ static void adm5120_uart_set_mctrl(struct amba_device *dev, void __iomem *base,
* converted into a real platform driver
*/
unsigned int adm5120_eth_num_ports = 6;
+EXPORT_SYMBOL_GPL(adm5120_eth_num_ports);
+
unsigned char adm5120_eth_macs[6][6] = {
{'\00', 'A', 'D', 'M', '\x51', '\x20' },
{'\00', 'A', 'D', 'M', '\x51', '\x21' },
@@ -55,9 +57,13 @@ unsigned char adm5120_eth_macs[6][6] = {
{'\00', 'A', 'D', 'M', '\x51', '\x24' },
{'\00', 'A', 'D', 'M', '\x51', '\x25' }
};
-
-EXPORT_SYMBOL_GPL(adm5120_eth_num_ports);
EXPORT_SYMBOL_GPL(adm5120_eth_macs);
+
+unsigned char adm5120_eth_vlans[6] = {
+ 0x41, 0x42, 0x44, 0x48, 0x50, 0x60
+};
+EXPORT_SYMBOL_GPL(adm5120_eth_vlans);
+
#else
/* Built-in ethernet switch */
struct adm5120_switch_platform_data adm5120_switch_data;
diff --git a/target/linux/adm5120-2.6/files/drivers/net/adm5120sw.c b/target/linux/adm5120-2.6/files/drivers/net/adm5120sw.c
index 2714577c8e..80c81abf74 100644
--- a/target/linux/adm5120-2.6/files/drivers/net/adm5120sw.c
+++ b/target/linux/adm5120-2.6/files/drivers/net/adm5120sw.c
@@ -33,19 +33,6 @@ MODULE_AUTHOR("Jeroen Vreeken (pe1rxq@amsat.org)");
MODULE_DESCRIPTION("ADM5120 ethernet switch driver");
MODULE_LICENSE("GPL");
-/*
- * The ADM5120 uses an internal matrix to determine which ports
- * belong to which VLAN.
- * The default generates a VLAN (and device) for each port
- * (including MII port) and the CPU port is part of all of them.
- *
- * Another example, one big switch and everything mapped to eth0:
- * 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00
- */
-static unsigned char vlan_matrix[SW_DEVS] = {
- 0x41, 0x42, 0x44, 0x48, 0x50, 0x60
-};
-
/* default settings - unlimited TX and RX on all ports, default shaper mode */
static unsigned char bw_matrix[SW_DEVS] = {
0, 0, 0, 0, 0, 0
@@ -274,7 +261,7 @@ static int adm5120_sw_open(struct net_device *dev)
val = adm5120_get_reg(ADM5120_PORT_CONF0);
for (i=0; i<SW_DEVS; i++) {
if (dev == adm5120_devs[i])
- val &= ~vlan_matrix[i];
+ val &= ~adm5120_eth_vlans[i];
}
adm5120_set_reg(ADM5120_PORT_CONF0, val);
return 0;
@@ -292,7 +279,7 @@ static int adm5120_sw_stop(struct net_device *dev)
val = adm5120_get_reg(ADM5120_PORT_CONF0) | ADM5120_PORTDISALL;
for (i=0; i<SW_DEVS; i++) {
if ((dev != adm5120_devs[i]) && netif_running(adm5120_devs[i]))
- val &= ~vlan_matrix[i];
+ val &= ~adm5120_eth_vlans[i];
}
adm5120_set_reg(ADM5120_PORT_CONF0, val);
netif_stop_queue(dev);
@@ -351,7 +338,7 @@ static struct net_device_stats *adm5120_sw_stats(struct net_device *dev)
int portmask;
unsigned long adm5120_cpup_conf_reg;
- portmask = vlan_matrix[priv->port] & 0x3f;
+ portmask = adm5120_eth_vlans[priv->port] & 0x3f;
adm5120_cpup_conf_reg = adm5120_get_reg(ADM5120_CPUP_CONF);
@@ -398,7 +385,7 @@ static void adm5120_set_multicast_list(struct net_device *dev)
struct adm5120_sw *priv = netdev_priv(dev);
int portmask;
- portmask = vlan_matrix[priv->port] & 0x3f;
+ portmask = adm5120_eth_vlans[priv->port] & 0x3f;
if (dev->flags & IFF_PROMISC)
adm5120_set_reg(ADM5120_CPUP_CONF,
@@ -460,15 +447,15 @@ static int adm5120_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
case SIOCSMATRIX:
if (!capable(CAP_NET_ADMIN))
return -EPERM;
- err = copy_from_user(vlan_matrix, rq->ifr_data,
- sizeof(vlan_matrix));
+ err = copy_from_user(adm5120_eth_vlans, rq->ifr_data,
+ sizeof(adm5120_eth_vlans));
if (err)
return -EFAULT;
- adm5120_set_vlan(vlan_matrix);
+ adm5120_set_vlan(adm5120_eth_vlans);
break;
case SIOCGMATRIX:
- err = copy_to_user(rq->ifr_data, vlan_matrix,
- sizeof(vlan_matrix));
+ err = copy_to_user(rq->ifr_data, adm5120_eth_vlans,
+ sizeof(adm5120_eth_vlans));
if (err)
return -EFAULT;
break;
@@ -592,7 +579,7 @@ static int __init adm5120_sw_init(void)
printk(KERN_INFO "%s: ADM5120 switch port%d\n", dev->name, i);
}
/* setup vlan/port mapping after devs are filled up */
- adm5120_set_vlan(vlan_matrix);
+ adm5120_set_vlan(adm5120_eth_vlans);
adm5120_set_reg(ADM5120_CPUP_CONF,
ADM5120_CRC_PADDING | ADM5120_DISUNALL | ADM5120_DISMCALL);
diff --git a/target/linux/adm5120-2.6/files/include/asm-mips/mach-adm5120/adm5120_board.h b/target/linux/adm5120-2.6/files/include/asm-mips/mach-adm5120/adm5120_board.h
index 80ace78654..7e95ecad4a 100644
--- a/target/linux/adm5120-2.6/files/include/asm-mips/mach-adm5120/adm5120_board.h
+++ b/target/linux/adm5120-2.6/files/include/asm-mips/mach-adm5120/adm5120_board.h
@@ -37,7 +37,8 @@ struct adm5120_board {
void (*board_setup)(void);
void (*board_reset)(void);
- unsigned int num_eth_ports;
+ unsigned int eth_num_ports;
+ unsigned char *eth_vlans;
unsigned int num_devices;
struct platform_device **devices;
diff --git a/target/linux/adm5120-2.6/files/include/asm-mips/mach-adm5120/adm5120_info.h b/target/linux/adm5120-2.6/files/include/asm-mips/mach-adm5120/adm5120_info.h
index bf00e8bd2b..9f939876d5 100644
--- a/target/linux/adm5120-2.6/files/include/asm-mips/mach-adm5120/adm5120_info.h
+++ b/target/linux/adm5120-2.6/files/include/asm-mips/mach-adm5120/adm5120_info.h
@@ -56,6 +56,7 @@ extern unsigned long adm5120_memsize;
*/
extern unsigned int adm5120_eth_num_ports;
extern unsigned char adm5120_eth_macs[6][6];
+extern unsigned char adm5120_eth_vlans[6];
extern void adm5120_soc_init(void) __init;
extern void adm5120_mem_init(void) __init;