X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/deacfa5c1dca625fb93145b8722651ebc23fd15a..e0c1b38c1c38b468f37ac5061837b5e359cbf371:/target/linux/ar7/patches-2.6.24/140-cpmac_fix.patch diff --git a/target/linux/ar7/patches-2.6.24/140-cpmac_fix.patch b/target/linux/ar7/patches-2.6.24/140-cpmac_fix.patch index 49c6b3234..765893295 100644 --- a/target/linux/ar7/patches-2.6.24/140-cpmac_fix.patch +++ b/target/linux/ar7/patches-2.6.24/140-cpmac_fix.patch @@ -1,5 +1,7 @@ ---- linux-2.6.24/drivers/net/cpmac.c 2008-01-25 02:20:37.000000000 +0100 -+++ linux-2.6.24/drivers/net/cpmac.c 2008-02-08 20:04:58.000000000 +0100 +Index: linux-2.6.24.7/drivers/net/cpmac.c +=================================================================== +--- linux-2.6.24.7.orig/drivers/net/cpmac.c ++++ linux-2.6.24.7/drivers/net/cpmac.c @@ -38,6 +38,7 @@ #include #include @@ -8,7 +10,7 @@ MODULE_AUTHOR("Eugene Konev "); MODULE_DESCRIPTION("TI AR7 ethernet driver (CPMAC)"); -@@ -207,6 +208,7 @@ +@@ -207,6 +208,7 @@ struct cpmac_priv { struct work_struct reset_work; struct platform_device *pdev; struct napi_struct napi; @@ -16,7 +18,7 @@ }; static irqreturn_t cpmac_irq(int, void *); -@@ -455,6 +457,9 @@ +@@ -455,6 +457,9 @@ static int cpmac_start_xmit(struct sk_bu struct cpmac_desc *desc; struct cpmac_priv *priv = netdev_priv(dev); @@ -26,7 +28,7 @@ if (unlikely(skb_padto(skb, ETH_ZLEN))) return NETDEV_TX_OK; -@@ -634,14 +639,14 @@ +@@ -634,14 +639,14 @@ static void cpmac_clear_tx(struct net_de priv->desc_ring[i].dataflags = 0; if (priv->desc_ring[i].skb) { dev_kfree_skb_any(priv->desc_ring[i].skb); @@ -43,10 +45,12 @@ struct cpmac_priv *priv = container_of(work, struct cpmac_priv, reset_work); -@@ -650,8 +655,46 @@ +@@ -650,8 +655,47 @@ static void cpmac_hw_error(struct work_s spin_unlock(&priv->rx_lock); cpmac_clear_tx(priv->dev); cpmac_hw_start(priv->dev); +- napi_enable(&priv->napi); +- netif_start_queue(priv->dev); + barrier(); + atomic_dec(&priv->reset_pending); + @@ -54,6 +58,7 @@ + netif_wake_subqueue(priv->dev, i); + } + netif_wake_queue(priv->dev); ++ cpmac_write(priv->regs, CPMAC_MAC_INT_ENABLE, 3); +} + +static void cpmac_check_status(struct net_device *dev) @@ -82,16 +87,15 @@ + netif_stop_queue(dev); + cpmac_hw_stop(dev); + if (schedule_work(&priv->reset_work)) -+ atomic_inc(&priv->reset_pending); ++ atomic_inc(&priv->reset_pending); + if (unlikely(netif_msg_hw(priv))) + cpmac_dump_regs(dev); + } - napi_enable(&priv->napi); -- netif_start_queue(priv->dev); ++ cpmac_write(priv->regs, CPMAC_MAC_INT_CLEAR, 0xff); } static irqreturn_t cpmac_irq(int irq, void *dev_id) -@@ -661,9 +704,6 @@ +@@ -661,9 +705,6 @@ static irqreturn_t cpmac_irq(int irq, vo int queue; u32 status; @@ -101,7 +105,7 @@ priv = netdev_priv(dev); status = cpmac_read(priv->regs, CPMAC_MAC_INT_VECTOR); -@@ -685,49 +725,33 @@ +@@ -685,49 +726,33 @@ static irqreturn_t cpmac_irq(int irq, vo cpmac_write(priv->regs, CPMAC_MAC_EOI_VECTOR, 0); @@ -165,7 +169,7 @@ } static int cpmac_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) -@@ -848,15 +872,6 @@ +@@ -848,15 +873,6 @@ static void cpmac_adjust_link(struct net spin_unlock(&priv->lock); } @@ -181,7 +185,7 @@ static int cpmac_open(struct net_device *dev) { int i, size, res; -@@ -923,6 +938,7 @@ +@@ -923,6 +939,7 @@ static int cpmac_open(struct net_device goto fail_irq; } @@ -189,7 +193,7 @@ INIT_WORK(&priv->reset_work, cpmac_hw_error); cpmac_hw_start(dev); -@@ -999,11 +1015,11 @@ +@@ -999,11 +1016,11 @@ static int external_switch; static int __devinit cpmac_probe(struct platform_device *pdev) { int rc, phy_id, i; @@ -202,7 +206,7 @@ DECLARE_MAC_BUF(mac); pdata = pdev->dev.platform_data; -@@ -1017,9 +1033,23 @@ +@@ -1017,9 +1034,23 @@ static int __devinit cpmac_probe(struct } if (phy_id == PHY_MAX_ADDR) { @@ -228,7 +232,7 @@ printk(KERN_ERR "cpmac: no PHY present\n"); return -ENODEV; } -@@ -1063,32 +1093,8 @@ +@@ -1063,32 +1094,8 @@ static int __devinit cpmac_probe(struct priv->msg_enable = netif_msg_init(debug_level, 0xff); memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr));