diff options
author | Felix Fietkau <nbd@openwrt.org> | 2009-03-22 22:10:54 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2009-03-22 22:10:54 +0000 |
commit | 8d217b716266993846d4d6921ed75158230d8fb1 (patch) | |
tree | 4f58bbb141bcb9a0c6825b9d90fb3414b39de5df /target/linux | |
parent | fd11bfec64d313b1d629ac454ebba7cab4339a72 (diff) | |
download | openwrt-8d217b716266993846d4d6921ed75158230d8fb1.tar.gz openwrt-8d217b716266993846d4d6921ed75158230d8fb1.tar.bz2 openwrt-8d217b716266993846d4d6921ed75158230d8fb1.zip |
atheros: fix mdio bus registration for multiple ethernet interfaces
SVN-Revision: 14984
Diffstat (limited to 'target/linux')
-rw-r--r-- | target/linux/atheros/patches-2.6.28/110-ar2313_ethernet.patch | 13 | ||||
-rw-r--r-- | target/linux/atheros/patches-2.6.28/200-ar2313_enable_mvswitch.patch | 10 |
2 files changed, 12 insertions, 11 deletions
diff --git a/target/linux/atheros/patches-2.6.28/110-ar2313_ethernet.patch b/target/linux/atheros/patches-2.6.28/110-ar2313_ethernet.patch index ea61bcd3e3..8d1d24f748 100644 --- a/target/linux/atheros/patches-2.6.28/110-ar2313_ethernet.patch +++ b/target/linux/atheros/patches-2.6.28/110-ar2313_ethernet.patch @@ -25,7 +25,7 @@ obj-$(CONFIG_DECLANCE) += declance.o --- /dev/null +++ b/drivers/net/ar231x.c -@@ -0,0 +1,1267 @@ +@@ -0,0 +1,1268 @@ +/* + * ar231x.c: Linux driver for the Atheros AR231x Ethernet device. + * @@ -301,23 +301,24 @@ + sp->mii_bus->write = ar231x_mdiobus_write; + sp->mii_bus->reset = ar231x_mdiobus_reset; + sp->mii_bus->name = "ar231x_eth_mii"; -+ snprintf(sp->mii_bus->id, MII_BUS_ID_SIZE, "0"); ++ snprintf(sp->mii_bus->id, MII_BUS_ID_SIZE, "%d", pdev->id); + sp->mii_bus->irq = kmalloc(sizeof(int), GFP_KERNEL); + *sp->mii_bus->irq = PHY_POLL; + + mdiobus_register(sp->mii_bus); + + if (ar231x_mdiobus_probe(dev) != 0) { -+ printk(KERN_ERR "ar231x: mdiobus_probe failed"); ++ printk(KERN_ERR "%s: mdiobus_probe failed\n", dev->name); + rx_tasklet_cleanup(dev); + ar231x_init_cleanup(dev); + unregister_netdev(dev); + kfree(dev); -+ } else { -+ /* start link poll timer */ -+ ar231x_setup_timer(dev); ++ return -ENODEV; + } + ++ /* start link poll timer */ ++ ar231x_setup_timer(dev); ++ + return 0; +} + diff --git a/target/linux/atheros/patches-2.6.28/200-ar2313_enable_mvswitch.patch b/target/linux/atheros/patches-2.6.28/200-ar2313_enable_mvswitch.patch index 88ffad62d0..8e75d75d84 100644 --- a/target/linux/atheros/patches-2.6.28/200-ar2313_enable_mvswitch.patch +++ b/target/linux/atheros/patches-2.6.28/200-ar2313_enable_mvswitch.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ar231x.c +++ b/drivers/net/ar231x.c -@@ -735,6 +735,7 @@ static void ar231x_load_rx_ring(struct n +@@ -736,6 +736,7 @@ static void ar231x_load_rx_ring(struct n for (i = 0; i < nr_bufs; i++) { struct sk_buff *skb; ar231x_descr_t *rd; @@ -8,7 +8,7 @@ if (sp->rx_skb[idx]) break; -@@ -753,7 +754,9 @@ static void ar231x_load_rx_ring(struct n +@@ -754,7 +755,9 @@ static void ar231x_load_rx_ring(struct n * Make sure IP header starts on a fresh cache line. */ skb->dev = dev; @@ -19,7 +19,7 @@ sp->rx_skb[idx] = skb; rd = (ar231x_descr_t *) & sp->rx_ring[idx]; -@@ -828,6 +831,7 @@ static int ar231x_rx_int(struct net_devi +@@ -829,6 +832,7 @@ static int ar231x_rx_int(struct net_devi /* alloc new buffer. */ skb_new = dev_alloc_skb(AR2313_BUFSIZE + RX_OFFSET + 128); if (skb_new != NULL) { @@ -27,7 +27,7 @@ skb = sp->rx_skb[idx]; /* set skb */ -@@ -835,13 +839,17 @@ static int ar231x_rx_int(struct net_devi +@@ -836,13 +840,17 @@ static int ar231x_rx_int(struct net_devi ((status >> DMA_RX_LEN_SHIFT) & 0x3fff) - CRC_LEN); dev->stats.rx_bytes += skb->len; @@ -48,7 +48,7 @@ /* reset descriptor's curr_addr */ rxdesc->addr = virt_to_phys(skb_new->data); -@@ -1243,6 +1251,8 @@ static int ar231x_mdiobus_probe (struct +@@ -1244,6 +1252,8 @@ static int ar231x_mdiobus_probe (struct return PTR_ERR(phydev); } |