d96a874ba15134debf8b482886bf8c4c3700807a
[openwrt/svn-archive/archive.git] / target / linux / ar71xx / patches-2.6.30 / 803-ar71xx-update-dsa-switch-support.patch
1 --- a/arch/mips/ar71xx/devices.c
2 +++ b/arch/mips/ar71xx/devices.c
3 @@ -792,6 +792,8 @@ static struct platform_device ar71xx_dsa
4 void __init ar71xx_add_device_dsa(unsigned int id,
5 struct dsa_platform_data *d)
6 {
7 + int i;
8 +
9 switch (id) {
10 case 0:
11 d->netdev = &ar71xx_eth0_device.dev;
12 @@ -805,7 +807,10 @@ void __init ar71xx_add_device_dsa(unsign
13 id);
14 return;
15 }
16 - d->mii_bus = &ar71xx_mdio_device.dev;
17 +
18 + for (i = 0; i < d->nr_chips; i++)
19 + d->chip[i].mii_bus = &ar71xx_mdio_device.dev;
20 +
21 ar71xx_dsa_switch_device.dev.platform_data = d;
22
23 platform_device_register(&ar71xx_dsa_switch_device);
24 --- a/arch/mips/ar71xx/mach-tl-wr941nd.c
25 +++ b/arch/mips/ar71xx/mach-tl-wr941nd.c
26 @@ -104,7 +104,7 @@ static struct gpio_button tl_wr941nd_gpi
27 }
28 };
29
30 -static struct dsa_platform_data tl_wr941nd_dsa_data = {
31 +static struct dsa_chip_data tl_wr941nd_dsa_chip = {
32 .port_names[0] = "wan",
33 .port_names[1] = "lan1",
34 .port_names[2] = "lan2",
35 @@ -113,6 +113,11 @@ static struct dsa_platform_data tl_wr941
36 .port_names[5] = "cpu",
37 };
38
39 +static struct dsa_platform_data tl_wr941nd_dsa_data = {
40 + .nr_chips = 1,
41 + .chip = &tl_wr941nd_dsa_chip,
42 +};
43 +
44 static void __init tl_wr941nd_setup(void)
45 {
46 u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);