aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/82596.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/82596.c')
-rw-r--r--drivers/net/82596.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/net/82596.c b/drivers/net/82596.c
index ea6b139b812c..56e68db48861 100644
--- a/drivers/net/82596.c
+++ b/drivers/net/82596.c
@@ -19,7 +19,7 @@
19 TBD: 19 TBD:
20 * look at deferring rx frames rather than discarding (as per tulip) 20 * look at deferring rx frames rather than discarding (as per tulip)
21 * handle tx ring full as per tulip 21 * handle tx ring full as per tulip
22 * performace test to tune rx_copybreak 22 * performance test to tune rx_copybreak
23 23
24 Most of my modifications relate to the braindead big-endian 24 Most of my modifications relate to the braindead big-endian
25 implementation by Intel. When the i596 is operating in 25 implementation by Intel. When the i596 is operating in
@@ -45,7 +45,6 @@
45#include <linux/string.h> 45#include <linux/string.h>
46#include <linux/errno.h> 46#include <linux/errno.h>
47#include <linux/ioport.h> 47#include <linux/ioport.h>
48#include <linux/slab.h>
49#include <linux/interrupt.h> 48#include <linux/interrupt.h>
50#include <linux/delay.h> 49#include <linux/delay.h>
51#include <linux/netdevice.h> 50#include <linux/netdevice.h>
@@ -53,6 +52,7 @@
53#include <linux/skbuff.h> 52#include <linux/skbuff.h>
54#include <linux/init.h> 53#include <linux/init.h>
55#include <linux/bitops.h> 54#include <linux/bitops.h>
55#include <linux/gfp.h>
56 56
57#include <asm/io.h> 57#include <asm/io.h>
58#include <asm/dma.h> 58#include <asm/dma.h>
@@ -1505,7 +1505,7 @@ static void set_multicast_list(struct net_device *dev)
1505 int config = 0, cnt; 1505 int config = 0, cnt;
1506 1506
1507 DEB(DEB_MULTI,printk(KERN_DEBUG "%s: set multicast list, %d entries, promisc %s, allmulti %s\n", 1507 DEB(DEB_MULTI,printk(KERN_DEBUG "%s: set multicast list, %d entries, promisc %s, allmulti %s\n",
1508 dev->name, dev->mc_count, 1508 dev->name, netdev_mc_count(dev),
1509 dev->flags & IFF_PROMISC ? "ON" : "OFF", 1509 dev->flags & IFF_PROMISC ? "ON" : "OFF",
1510 dev->flags & IFF_ALLMULTI ? "ON" : "OFF")); 1510 dev->flags & IFF_ALLMULTI ? "ON" : "OFF"));
1511 1511
@@ -1533,7 +1533,7 @@ static void set_multicast_list(struct net_device *dev)
1533 i596_add_cmd(dev, &lp->cf_cmd.cmd); 1533 i596_add_cmd(dev, &lp->cf_cmd.cmd);
1534 } 1534 }
1535 1535
1536 cnt = dev->mc_count; 1536 cnt = netdev_mc_count(dev);
1537 if (cnt > MAX_MC_CNT) 1537 if (cnt > MAX_MC_CNT)
1538 { 1538 {
1539 cnt = MAX_MC_CNT; 1539 cnt = MAX_MC_CNT;
@@ -1541,7 +1541,7 @@ static void set_multicast_list(struct net_device *dev)
1541 dev->name, cnt); 1541 dev->name, cnt);
1542 } 1542 }
1543 1543
1544 if (dev->mc_count > 0) { 1544 if (!netdev_mc_empty(dev)) {
1545 struct dev_mc_list *dmi; 1545 struct dev_mc_list *dmi;
1546 unsigned char *cp; 1546 unsigned char *cp;
1547 struct mc_cmd *cmd; 1547 struct mc_cmd *cmd;
@@ -1550,13 +1550,16 @@ static void set_multicast_list(struct net_device *dev)
1550 return; 1550 return;
1551 cmd = &lp->mc_cmd; 1551 cmd = &lp->mc_cmd;
1552 cmd->cmd.command = CmdMulticastList; 1552 cmd->cmd.command = CmdMulticastList;
1553 cmd->mc_cnt = dev->mc_count * 6; 1553 cmd->mc_cnt = cnt * ETH_ALEN;
1554 cp = cmd->mc_addrs; 1554 cp = cmd->mc_addrs;
1555 for (dmi = dev->mc_list; cnt && dmi != NULL; dmi = dmi->next, cnt--, cp += 6) { 1555 netdev_for_each_mc_addr(dmi, dev) {
1556 memcpy(cp, dmi->dmi_addr, 6); 1556 if (!cnt--)
1557 break;
1558 memcpy(cp, dmi->dmi_addr, ETH_ALEN);
1557 if (i596_debug > 1) 1559 if (i596_debug > 1)
1558 DEB(DEB_MULTI,printk(KERN_INFO "%s: Adding address %pM\n", 1560 DEB(DEB_MULTI,printk(KERN_INFO "%s: Adding address %pM\n",
1559 dev->name, cp)); 1561 dev->name, cp));
1562 cp += ETH_ALEN;
1560 } 1563 }
1561 i596_add_cmd(dev, &cmd->cmd); 1564 i596_add_cmd(dev, &cmd->cmd);
1562 } 1565 }