diff options
Diffstat (limited to 'drivers/net/amd8111e.c')
-rw-r--r-- | drivers/net/amd8111e.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c index c54967f7942a..07a6697e3635 100644 --- a/drivers/net/amd8111e.c +++ b/drivers/net/amd8111e.c | |||
@@ -644,10 +644,6 @@ This function frees the transmiter and receiver descriptor rings. | |||
644 | */ | 644 | */ |
645 | static void amd8111e_free_ring(struct amd8111e_priv* lp) | 645 | static void amd8111e_free_ring(struct amd8111e_priv* lp) |
646 | { | 646 | { |
647 | |||
648 | /* Free transmit and receive skbs */ | ||
649 | amd8111e_free_skbs(lp->amd8111e_net_dev); | ||
650 | |||
651 | /* Free transmit and receive descriptor rings */ | 647 | /* Free transmit and receive descriptor rings */ |
652 | if(lp->rx_ring){ | 648 | if(lp->rx_ring){ |
653 | pci_free_consistent(lp->pci_dev, | 649 | pci_free_consistent(lp->pci_dev, |
@@ -833,12 +829,14 @@ static int amd8111e_rx_poll(struct napi_struct *napi, int budget) | |||
833 | 829 | ||
834 | } while(intr0 & RINT0); | 830 | } while(intr0 & RINT0); |
835 | 831 | ||
836 | /* Receive descriptor is empty now */ | 832 | if (rx_pkt_limit > 0) { |
837 | spin_lock_irqsave(&lp->lock, flags); | 833 | /* Receive descriptor is empty now */ |
838 | __netif_rx_complete(dev, napi); | 834 | spin_lock_irqsave(&lp->lock, flags); |
839 | writel(VAL0|RINTEN0, mmio + INTEN0); | 835 | __netif_rx_complete(dev, napi); |
840 | writel(VAL2 | RDMD0, mmio + CMD0); | 836 | writel(VAL0|RINTEN0, mmio + INTEN0); |
841 | spin_unlock_irqrestore(&lp->lock, flags); | 837 | writel(VAL2 | RDMD0, mmio + CMD0); |
838 | spin_unlock_irqrestore(&lp->lock, flags); | ||
839 | } | ||
842 | 840 | ||
843 | rx_not_empty: | 841 | rx_not_empty: |
844 | return num_rx_pkt; | 842 | return num_rx_pkt; |
@@ -1231,7 +1229,9 @@ static int amd8111e_close(struct net_device * dev) | |||
1231 | 1229 | ||
1232 | amd8111e_disable_interrupt(lp); | 1230 | amd8111e_disable_interrupt(lp); |
1233 | amd8111e_stop_chip(lp); | 1231 | amd8111e_stop_chip(lp); |
1234 | amd8111e_free_ring(lp); | 1232 | |
1233 | /* Free transmit and receive skbs */ | ||
1234 | amd8111e_free_skbs(lp->amd8111e_net_dev); | ||
1235 | 1235 | ||
1236 | netif_carrier_off(lp->amd8111e_net_dev); | 1236 | netif_carrier_off(lp->amd8111e_net_dev); |
1237 | 1237 | ||
@@ -1241,6 +1241,7 @@ static int amd8111e_close(struct net_device * dev) | |||
1241 | 1241 | ||
1242 | spin_unlock_irq(&lp->lock); | 1242 | spin_unlock_irq(&lp->lock); |
1243 | free_irq(dev->irq, dev); | 1243 | free_irq(dev->irq, dev); |
1244 | amd8111e_free_ring(lp); | ||
1244 | 1245 | ||
1245 | /* Update the statistics before closing */ | 1246 | /* Update the statistics before closing */ |
1246 | amd8111e_get_stats(dev); | 1247 | amd8111e_get_stats(dev); |