aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sundance.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/sundance.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/sundance.c')
-rw-r--r--drivers/net/sundance.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index e13685a570f4..8249a394a4e1 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -84,7 +84,6 @@ static char *media[MAX_UNITS];
84#include <linux/timer.h> 84#include <linux/timer.h>
85#include <linux/errno.h> 85#include <linux/errno.h>
86#include <linux/ioport.h> 86#include <linux/ioport.h>
87#include <linux/slab.h>
88#include <linux/interrupt.h> 87#include <linux/interrupt.h>
89#include <linux/pci.h> 88#include <linux/pci.h>
90#include <linux/netdevice.h> 89#include <linux/netdevice.h>
@@ -206,7 +205,7 @@ IVc. Errata
206#define USE_IO_OPS 1 205#define USE_IO_OPS 1
207#endif 206#endif
208 207
209static const struct pci_device_id sundance_pci_tbl[] = { 208static DEFINE_PCI_DEVICE_TABLE(sundance_pci_tbl) = {
210 { 0x1186, 0x1002, 0x1186, 0x1002, 0, 0, 0 }, 209 { 0x1186, 0x1002, 0x1186, 0x1002, 0, 0, 0 },
211 { 0x1186, 0x1002, 0x1186, 0x1003, 0, 0, 1 }, 210 { 0x1186, 0x1002, 0x1186, 0x1003, 0, 0, 1 },
212 { 0x1186, 0x1002, 0x1186, 0x1012, 0, 0, 2 }, 211 { 0x1186, 0x1002, 0x1186, 0x1012, 0, 0, 2 },
@@ -603,8 +602,8 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
603 strcmp (media[card_idx], "4") == 0) { 602 strcmp (media[card_idx], "4") == 0) {
604 np->speed = 100; 603 np->speed = 100;
605 np->mii_if.full_duplex = 1; 604 np->mii_if.full_duplex = 1;
606 } else if (strcmp (media[card_idx], "100mbps_hd") == 0 605 } else if (strcmp (media[card_idx], "100mbps_hd") == 0 ||
607 || strcmp (media[card_idx], "3") == 0) { 606 strcmp (media[card_idx], "3") == 0) {
608 np->speed = 100; 607 np->speed = 100;
609 np->mii_if.full_duplex = 0; 608 np->mii_if.full_duplex = 0;
610 } else if (strcmp (media[card_idx], "10mbps_fd") == 0 || 609 } else if (strcmp (media[card_idx], "10mbps_fd") == 0 ||
@@ -819,7 +818,7 @@ static int netdev_open(struct net_device *dev)
819 818
820 /* Do we need to reset the chip??? */ 819 /* Do we need to reset the chip??? */
821 820
822 i = request_irq(dev->irq, &intr_handler, IRQF_SHARED, dev->name, dev); 821 i = request_irq(dev->irq, intr_handler, IRQF_SHARED, dev->name, dev);
823 if (i) 822 if (i)
824 return i; 823 return i;
825 824
@@ -1079,8 +1078,8 @@ start_tx (struct sk_buff *skb, struct net_device *dev)
1079 tasklet_schedule(&np->tx_tasklet); 1078 tasklet_schedule(&np->tx_tasklet);
1080 1079
1081 /* On some architectures: explicitly flush cache lines here. */ 1080 /* On some architectures: explicitly flush cache lines here. */
1082 if (np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 1 1081 if (np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 1 &&
1083 && !netif_queue_stopped(dev)) { 1082 !netif_queue_stopped(dev)) {
1084 /* do nothing */ 1083 /* do nothing */
1085 } else { 1084 } else {
1086 netif_stop_queue (dev); 1085 netif_stop_queue (dev);
@@ -1336,8 +1335,8 @@ static void rx_poll(unsigned long data)
1336#endif 1335#endif
1337 /* Check if the packet is long enough to accept without copying 1336 /* Check if the packet is long enough to accept without copying
1338 to a minimally-sized skbuff. */ 1337 to a minimally-sized skbuff. */
1339 if (pkt_len < rx_copybreak 1338 if (pkt_len < rx_copybreak &&
1340 && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { 1339 (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
1341 skb_reserve(skb, 2); /* 16 byte align the IP header */ 1340 skb_reserve(skb, 2); /* 16 byte align the IP header */
1342 pci_dma_sync_single_for_cpu(np->pci_dev, 1341 pci_dma_sync_single_for_cpu(np->pci_dev,
1343 le32_to_cpu(desc->frag[0].addr), 1342 le32_to_cpu(desc->frag[0].addr),
@@ -1517,19 +1516,18 @@ static void set_rx_mode(struct net_device *dev)
1517 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ 1516 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
1518 memset(mc_filter, 0xff, sizeof(mc_filter)); 1517 memset(mc_filter, 0xff, sizeof(mc_filter));
1519 rx_mode = AcceptBroadcast | AcceptMulticast | AcceptAll | AcceptMyPhys; 1518 rx_mode = AcceptBroadcast | AcceptMulticast | AcceptAll | AcceptMyPhys;
1520 } else if ((dev->mc_count > multicast_filter_limit) 1519 } else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
1521 || (dev->flags & IFF_ALLMULTI)) { 1520 (dev->flags & IFF_ALLMULTI)) {
1522 /* Too many to match, or accept all multicasts. */ 1521 /* Too many to match, or accept all multicasts. */
1523 memset(mc_filter, 0xff, sizeof(mc_filter)); 1522 memset(mc_filter, 0xff, sizeof(mc_filter));
1524 rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; 1523 rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
1525 } else if (dev->mc_count) { 1524 } else if (!netdev_mc_empty(dev)) {
1526 struct dev_mc_list *mclist; 1525 struct dev_mc_list *mclist;
1527 int bit; 1526 int bit;
1528 int index; 1527 int index;
1529 int crc; 1528 int crc;
1530 memset (mc_filter, 0, sizeof (mc_filter)); 1529 memset (mc_filter, 0, sizeof (mc_filter));
1531 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1530 netdev_for_each_mc_addr(mclist, dev) {
1532 i++, mclist = mclist->next) {
1533 crc = ether_crc_le (ETH_ALEN, mclist->dmi_addr); 1531 crc = ether_crc_le (ETH_ALEN, mclist->dmi_addr);
1534 for (index=0, bit=0; bit < 6; bit++, crc <<= 1) 1532 for (index=0, bit=0; bit < 6; bit++, crc <<= 1)
1535 if (crc & 0x80000000) index |= 1 << bit; 1533 if (crc & 0x80000000) index |= 1 << bit;