X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/a5c4f544067e9cf7a79342bd20547beb41d80fba..118b74e6cd80af62df53057001fb6d1476cb4ca6:/target/linux/atheros/patches-2.6.28/110-ar2313_ethernet.patch 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 ea61bcd3e..49ca66e21 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,1264 @@ +/* + * 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; +} + @@ -767,15 +768,12 @@ + if (sp->rx_skb[idx]) + break; + -+ // partha: create additional room for the second GRE fragment -+ skb = alloc_skb(AR2313_BUFSIZE + 128, GFP_ATOMIC); ++ skb = netdev_alloc_skb(dev, AR2313_BUFSIZE); + if (!skb) { + printk("\n\n\n\n %s: No memory in system\n\n\n\n", + __FUNCTION__); + break; + } -+ // partha: create additional room in the front for tx pkt capture -+ skb_reserve(skb, 32); + + /* + * Make sure IP header starts on a fresh cache line. @@ -835,8 +833,7 @@ + break; + } + -+ if ((status & (DMA_RX_ERROR | DMA_RX_ERR_LENGTH)) && -+ (!(status & DMA_RX_LONG))) { ++ if ((status & DMA_RX_ERROR) && !(status & DMA_RX_LONG)) { + dev->stats.rx_errors++; + dev->stats.rx_dropped++; + @@ -854,7 +851,7 @@ + + } else { + /* alloc new buffer. */ -+ skb_new = dev_alloc_skb(AR2313_BUFSIZE + RX_OFFSET + 128); ++ skb_new = netdev_alloc_skb(dev, AR2313_BUFSIZE + RX_OFFSET); + if (skb_new != NULL) { + + skb = sp->rx_skb[idx]; @@ -869,7 +866,7 @@ + + skb_new->dev = dev; + /* 16 bit align */ -+ skb_reserve(skb_new, RX_OFFSET + 32); ++ skb_reserve(skb_new, RX_OFFSET); + /* reset descriptor's curr_addr */ + rxdesc->addr = virt_to_phys(skb_new->data); +