diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/atp.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/atp.c')
-rw-r--r-- | drivers/net/atp.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/net/atp.c b/drivers/net/atp.c index 9043294fe617..55039d44dc47 100644 --- a/drivers/net/atp.c +++ b/drivers/net/atp.c | |||
@@ -129,7 +129,6 @@ static int xcvr[NUM_UNITS]; /* The data transfer mode. */ | |||
129 | #include <linux/interrupt.h> | 129 | #include <linux/interrupt.h> |
130 | #include <linux/ioport.h> | 130 | #include <linux/ioport.h> |
131 | #include <linux/in.h> | 131 | #include <linux/in.h> |
132 | #include <linux/slab.h> | ||
133 | #include <linux/string.h> | 132 | #include <linux/string.h> |
134 | #include <linux/errno.h> | 133 | #include <linux/errno.h> |
135 | #include <linux/init.h> | 134 | #include <linux/init.h> |
@@ -437,7 +436,7 @@ static int net_open(struct net_device *dev) | |||
437 | /* The interrupt line is turned off (tri-stated) when the device isn't in | 436 | /* The interrupt line is turned off (tri-stated) when the device isn't in |
438 | use. That's especially important for "attached" interfaces where the | 437 | use. That's especially important for "attached" interfaces where the |
439 | port or interrupt may be shared. */ | 438 | port or interrupt may be shared. */ |
440 | ret = request_irq(dev->irq, &atp_interrupt, 0, dev->name, dev); | 439 | ret = request_irq(dev->irq, atp_interrupt, 0, dev->name, dev); |
441 | if (ret) | 440 | if (ret) |
442 | return ret; | 441 | return ret; |
443 | 442 | ||
@@ -673,8 +672,8 @@ static irqreturn_t atp_interrupt(int irq, void *dev_instance) | |||
673 | netif_wake_queue(dev); /* Inform upper layers. */ | 672 | netif_wake_queue(dev); /* Inform upper layers. */ |
674 | } | 673 | } |
675 | num_tx_since_rx++; | 674 | num_tx_since_rx++; |
676 | } else if (num_tx_since_rx > 8 | 675 | } else if (num_tx_since_rx > 8 && |
677 | && time_after(jiffies, dev->last_rx + HZ)) { | 676 | time_after(jiffies, dev->last_rx + HZ)) { |
678 | if (net_debug > 2) | 677 | if (net_debug > 2) |
679 | printk(KERN_DEBUG "%s: Missed packet? No Rx after %d Tx and " | 678 | printk(KERN_DEBUG "%s: Missed packet? No Rx after %d Tx and " |
680 | "%ld jiffies status %02x CMR1 %02x.\n", dev->name, | 679 | "%ld jiffies status %02x CMR1 %02x.\n", dev->name, |
@@ -861,7 +860,7 @@ static void set_rx_mode_8002(struct net_device *dev) | |||
861 | struct net_local *lp = netdev_priv(dev); | 860 | struct net_local *lp = netdev_priv(dev); |
862 | long ioaddr = dev->base_addr; | 861 | long ioaddr = dev->base_addr; |
863 | 862 | ||
864 | if (dev->mc_count > 0 || (dev->flags & (IFF_ALLMULTI|IFF_PROMISC))) | 863 | if (!netdev_mc_empty(dev) || (dev->flags & (IFF_ALLMULTI|IFF_PROMISC))) |
865 | lp->addr_mode = CMR2h_PROMISC; | 864 | lp->addr_mode = CMR2h_PROMISC; |
866 | else | 865 | else |
867 | lp->addr_mode = CMR2h_Normal; | 866 | lp->addr_mode = CMR2h_Normal; |
@@ -877,7 +876,8 @@ static void set_rx_mode_8012(struct net_device *dev) | |||
877 | 876 | ||
878 | if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ | 877 | if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ |
879 | new_mode = CMR2h_PROMISC; | 878 | new_mode = CMR2h_PROMISC; |
880 | } else if ((dev->mc_count > 1000) || (dev->flags & IFF_ALLMULTI)) { | 879 | } else if ((netdev_mc_count(dev) > 1000) || |
880 | (dev->flags & IFF_ALLMULTI)) { | ||
881 | /* Too many to filter perfectly -- accept all multicasts. */ | 881 | /* Too many to filter perfectly -- accept all multicasts. */ |
882 | memset(mc_filter, 0xff, sizeof(mc_filter)); | 882 | memset(mc_filter, 0xff, sizeof(mc_filter)); |
883 | new_mode = CMR2h_Normal; | 883 | new_mode = CMR2h_Normal; |
@@ -885,9 +885,7 @@ static void set_rx_mode_8012(struct net_device *dev) | |||
885 | struct dev_mc_list *mclist; | 885 | struct dev_mc_list *mclist; |
886 | 886 | ||
887 | memset(mc_filter, 0, sizeof(mc_filter)); | 887 | memset(mc_filter, 0, sizeof(mc_filter)); |
888 | for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; | 888 | netdev_for_each_mc_addr(mclist, dev) { |
889 | i++, mclist = mclist->next) | ||
890 | { | ||
891 | int filterbit = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f; | 889 | int filterbit = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f; |
892 | mc_filter[filterbit >> 5] |= 1 << (filterbit & 31); | 890 | mc_filter[filterbit >> 5] |= 1 << (filterbit & 31); |
893 | } | 891 | } |