[RFT] cpmac: napi fix
From: Stephen Hemminger <hidden>
Date: 2007-12-12 22:04:18
The NAPI changes for 2.6.24 would break this driver. It doesn't return correct value and has error if exactly "budget" packets are received. Don't have ARM so this is by inspection only. Please test.
--- a/drivers/net/cpmac.c 2007-10-26 11:56:12.000000000 -0700
+++ b/drivers/net/cpmac.c 2007-12-12 13:48:40.000000000 -0800@@ -439,14 +439,14 @@ static int cpmac_poll(struct napi_struct if (unlikely(netif_msg_rx_status(priv))) printk(KERN_DEBUG "%s: poll processed %d packets\n", priv->dev->name, received); - if (desc->dataflags & CPMAC_OWN) { + + if (received < budget) { netif_rx_complete(priv->dev, napi); cpmac_write(priv->regs, CPMAC_RX_PTR(0), (u32)desc->mapping); cpmac_write(priv->regs, CPMAC_RX_INT_ENABLE, 1); - return 0; } - return 1; + return received; } static int cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev)