diff options
Diffstat (limited to 'drivers/net/epic100.c')
-rw-r--r-- | drivers/net/epic100.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c index 641a10d2e843..7a567201e829 100644 --- a/drivers/net/epic100.c +++ b/drivers/net/epic100.c | |||
@@ -73,7 +73,6 @@ static int rx_copybreak; | |||
73 | #include <linux/timer.h> | 73 | #include <linux/timer.h> |
74 | #include <linux/errno.h> | 74 | #include <linux/errno.h> |
75 | #include <linux/ioport.h> | 75 | #include <linux/ioport.h> |
76 | #include <linux/slab.h> | ||
77 | #include <linux/interrupt.h> | 76 | #include <linux/interrupt.h> |
78 | #include <linux/pci.h> | 77 | #include <linux/pci.h> |
79 | #include <linux/delay.h> | 78 | #include <linux/delay.h> |
@@ -167,7 +166,7 @@ static const struct epic_chip_info pci_id_tbl[] = { | |||
167 | }; | 166 | }; |
168 | 167 | ||
169 | 168 | ||
170 | static struct pci_device_id epic_pci_tbl[] = { | 169 | static DEFINE_PCI_DEVICE_TABLE(epic_pci_tbl) = { |
171 | { 0x10B8, 0x0005, 0x1092, 0x0AB4, 0, 0, SMSC_83C170_0 }, | 170 | { 0x10B8, 0x0005, 0x1092, 0x0AB4, 0, 0, SMSC_83C170_0 }, |
172 | { 0x10B8, 0x0005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SMSC_83C170 }, | 171 | { 0x10B8, 0x0005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SMSC_83C170 }, |
173 | { 0x10B8, 0x0006, PCI_ANY_ID, PCI_ANY_ID, | 172 | { 0x10B8, 0x0006, PCI_ANY_ID, PCI_ANY_ID, |
@@ -630,8 +629,8 @@ static int mdio_read(struct net_device *dev, int phy_id, int location) | |||
630 | barrier(); | 629 | barrier(); |
631 | if ((inl(ioaddr + MIICtrl) & MII_READOP) == 0) { | 630 | if ((inl(ioaddr + MIICtrl) & MII_READOP) == 0) { |
632 | /* Work around read failure bug. */ | 631 | /* Work around read failure bug. */ |
633 | if (phy_id == 1 && location < 6 | 632 | if (phy_id == 1 && location < 6 && |
634 | && inw(ioaddr + MIIData) == 0xffff) { | 633 | inw(ioaddr + MIIData) == 0xffff) { |
635 | outl(read_cmd, ioaddr + MIICtrl); | 634 | outl(read_cmd, ioaddr + MIICtrl); |
636 | continue; | 635 | continue; |
637 | } | 636 | } |
@@ -668,7 +667,7 @@ static int epic_open(struct net_device *dev) | |||
668 | outl(0x4001, ioaddr + GENCTL); | 667 | outl(0x4001, ioaddr + GENCTL); |
669 | 668 | ||
670 | napi_enable(&ep->napi); | 669 | napi_enable(&ep->napi); |
671 | if ((retval = request_irq(dev->irq, &epic_interrupt, IRQF_SHARED, dev->name, dev))) { | 670 | if ((retval = request_irq(dev->irq, epic_interrupt, IRQF_SHARED, dev->name, dev))) { |
672 | napi_disable(&ep->napi); | 671 | napi_disable(&ep->napi); |
673 | return retval; | 672 | return retval; |
674 | } | 673 | } |
@@ -1205,8 +1204,8 @@ static int epic_rx(struct net_device *dev, int budget) | |||
1205 | } | 1204 | } |
1206 | /* Check if the packet is long enough to accept without copying | 1205 | /* Check if the packet is long enough to accept without copying |
1207 | to a minimally-sized skbuff. */ | 1206 | to a minimally-sized skbuff. */ |
1208 | if (pkt_len < rx_copybreak | 1207 | if (pkt_len < rx_copybreak && |
1209 | && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { | 1208 | (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { |
1210 | skb_reserve(skb, 2); /* 16 byte align the IP header */ | 1209 | skb_reserve(skb, 2); /* 16 byte align the IP header */ |
1211 | pci_dma_sync_single_for_cpu(ep->pci_dev, | 1210 | pci_dma_sync_single_for_cpu(ep->pci_dev, |
1212 | ep->rx_ring[entry].bufaddr, | 1211 | ep->rx_ring[entry].bufaddr, |
@@ -1390,21 +1389,20 @@ static void set_rx_mode(struct net_device *dev) | |||
1390 | outl(0x002C, ioaddr + RxCtrl); | 1389 | outl(0x002C, ioaddr + RxCtrl); |
1391 | /* Unconditionally log net taps. */ | 1390 | /* Unconditionally log net taps. */ |
1392 | memset(mc_filter, 0xff, sizeof(mc_filter)); | 1391 | memset(mc_filter, 0xff, sizeof(mc_filter)); |
1393 | } else if ((dev->mc_count > 0) || (dev->flags & IFF_ALLMULTI)) { | 1392 | } else if ((!netdev_mc_empty(dev)) || (dev->flags & IFF_ALLMULTI)) { |
1394 | /* There is apparently a chip bug, so the multicast filter | 1393 | /* There is apparently a chip bug, so the multicast filter |
1395 | is never enabled. */ | 1394 | is never enabled. */ |
1396 | /* Too many to filter perfectly -- accept all multicasts. */ | 1395 | /* Too many to filter perfectly -- accept all multicasts. */ |
1397 | memset(mc_filter, 0xff, sizeof(mc_filter)); | 1396 | memset(mc_filter, 0xff, sizeof(mc_filter)); |
1398 | outl(0x000C, ioaddr + RxCtrl); | 1397 | outl(0x000C, ioaddr + RxCtrl); |
1399 | } else if (dev->mc_count == 0) { | 1398 | } else if (netdev_mc_empty(dev)) { |
1400 | outl(0x0004, ioaddr + RxCtrl); | 1399 | outl(0x0004, ioaddr + RxCtrl); |
1401 | return; | 1400 | return; |
1402 | } else { /* Never executed, for now. */ | 1401 | } else { /* Never executed, for now. */ |
1403 | struct dev_mc_list *mclist; | 1402 | struct dev_mc_list *mclist; |
1404 | 1403 | ||
1405 | memset(mc_filter, 0, sizeof(mc_filter)); | 1404 | memset(mc_filter, 0, sizeof(mc_filter)); |
1406 | for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; | 1405 | netdev_for_each_mc_addr(mclist, dev) { |
1407 | i++, mclist = mclist->next) { | ||
1408 | unsigned int bit_nr = | 1406 | unsigned int bit_nr = |
1409 | ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f; | 1407 | ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f; |
1410 | mc_filter[bit_nr >> 3] |= (1 << bit_nr); | 1408 | mc_filter[bit_nr >> 3] |= (1 << bit_nr); |