]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/starfire.c
drivers/net/wireless/b43: fix sparse warnings: make symbols static
[karo-tx-linux.git] / drivers / net / starfire.c
index 32814183d5a319a0804d3db298352e2d7debccff..f54ac2389da29dd444395853582c5153a55309e9 100644 (file)
@@ -880,9 +880,9 @@ static int mdio_read(struct net_device *dev, int phy_id, int location)
        void __iomem *mdio_addr = np->base + MIICtrl + (phy_id<<7) + (location<<2);
        int result, boguscnt=1000;
        /* ??? Should we add a busy-wait here? */
-       do
+       do {
                result = readl(mdio_addr);
-       while ((result & 0xC0000000) != 0x80000000 && --boguscnt > 0);
+       while ((result & 0xC0000000) != 0x80000000 && --boguscnt > 0);
        if (boguscnt == 0)
                return 0;
        if ((result & 0xffff) == 0xffff)
@@ -1290,8 +1290,8 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)
                if (intr_status & (IntrRxDone | IntrRxEmpty)) {
                        u32 enable;
 
-                       if (likely(netif_rx_schedule_prep(dev, &np->napi))) {
-                               __netif_rx_schedule(dev, &np->napi);
+                       if (likely(netif_rx_schedule_prep(&np->napi))) {
+                               __netif_rx_schedule(&np->napi);
                                enable = readl(ioaddr + IntrEnable);
                                enable &= ~(IntrRxDone | IntrRxEmpty);
                                writel(enable, ioaddr + IntrEnable);
@@ -1496,7 +1496,6 @@ static int __netdev_rx(struct net_device *dev, int *quota)
                } else
 #endif /* VLAN_SUPPORT */
                        netif_receive_skb(skb);
-               dev->last_rx = jiffies;
                np->stats.rx_packets++;
 
        next_rx:
@@ -1504,6 +1503,11 @@ static int __netdev_rx(struct net_device *dev, int *quota)
                desc->status = 0;
                np->rx_done = (np->rx_done + 1) % DONE_Q_SIZE;
        }
+
+       if (*quota == 0) {      /* out of rx quota */
+               retcode = 1;
+               goto out;
+       }
        writew(np->rx_done, np->base + CompletionQConsumerIdx);
 
  out:
@@ -1531,7 +1535,7 @@ static int netdev_poll(struct napi_struct *napi, int budget)
                intr_status = readl(ioaddr + IntrStatus);
        } while (intr_status & (IntrRxDone | IntrRxEmpty));
 
-       netif_rx_complete(dev, napi);
+       netif_rx_complete(napi);
        intr_status = readl(ioaddr + IntrEnable);
        intr_status |= IntrRxDone | IntrRxEmpty;
        writel(intr_status, ioaddr + IntrEnable);