aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/eepro.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/eepro.c')
-rw-r--r--drivers/net/eepro.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c
index 1e934160062c..27c7bdbfa003 100644
--- a/drivers/net/eepro.c
+++ b/drivers/net/eepro.c
@@ -137,7 +137,6 @@ static const char version[] =
137#include <linux/interrupt.h> 137#include <linux/interrupt.h>
138#include <linux/ioport.h> 138#include <linux/ioport.h>
139#include <linux/in.h> 139#include <linux/in.h>
140#include <linux/slab.h>
141#include <linux/string.h> 140#include <linux/string.h>
142#include <linux/errno.h> 141#include <linux/errno.h>
143#include <linux/netdevice.h> 142#include <linux/netdevice.h>
@@ -990,7 +989,7 @@ static int eepro_open(struct net_device *dev)
990 return -EAGAIN; 989 return -EAGAIN;
991 } 990 }
992 991
993 if (request_irq(dev->irq , &eepro_interrupt, 0, dev->name, dev)) { 992 if (request_irq(dev->irq , eepro_interrupt, 0, dev->name, dev)) {
994 printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, dev->irq); 993 printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, dev->irq);
995 return -EAGAIN; 994 return -EAGAIN;
996 } 995 }
@@ -1287,9 +1286,10 @@ set_multicast_list(struct net_device *dev)
1287 struct eepro_local *lp = netdev_priv(dev); 1286 struct eepro_local *lp = netdev_priv(dev);
1288 short ioaddr = dev->base_addr; 1287 short ioaddr = dev->base_addr;
1289 unsigned short mode; 1288 unsigned short mode;
1290 struct dev_mc_list *dmi=dev->mc_list; 1289 struct dev_mc_list *dmi;
1290 int mc_count = netdev_mc_count(dev);
1291 1291
1292 if (dev->flags&(IFF_ALLMULTI|IFF_PROMISC) || dev->mc_count > 63) 1292 if (dev->flags&(IFF_ALLMULTI|IFF_PROMISC) || mc_count > 63)
1293 { 1293 {
1294 eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */ 1294 eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */
1295 mode = inb(ioaddr + REG2); 1295 mode = inb(ioaddr + REG2);
@@ -1299,7 +1299,7 @@ set_multicast_list(struct net_device *dev)
1299 eepro_sw2bank0(ioaddr); /* Return to BANK 0 now */ 1299 eepro_sw2bank0(ioaddr); /* Return to BANK 0 now */
1300 } 1300 }
1301 1301
1302 else if (dev->mc_count==0 ) 1302 else if (mc_count == 0)
1303 { 1303 {
1304 eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */ 1304 eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */
1305 mode = inb(ioaddr + REG2); 1305 mode = inb(ioaddr + REG2);
@@ -1329,12 +1329,10 @@ set_multicast_list(struct net_device *dev)
1329 outw(MC_SETUP, ioaddr + IO_PORT); 1329 outw(MC_SETUP, ioaddr + IO_PORT);
1330 outw(0, ioaddr + IO_PORT); 1330 outw(0, ioaddr + IO_PORT);
1331 outw(0, ioaddr + IO_PORT); 1331 outw(0, ioaddr + IO_PORT);
1332 outw(6*(dev->mc_count + 1), ioaddr + IO_PORT); 1332 outw(6 * (mc_count + 1), ioaddr + IO_PORT);
1333 1333
1334 for (i = 0; i < dev->mc_count; i++) 1334 netdev_for_each_mc_addr(dmi, dev) {
1335 { 1335 eaddrs = (unsigned short *) dmi->dmi_addr;
1336 eaddrs=(unsigned short *)dmi->dmi_addr;
1337 dmi=dmi->next;
1338 outw(*eaddrs++, ioaddr + IO_PORT); 1336 outw(*eaddrs++, ioaddr + IO_PORT);
1339 outw(*eaddrs++, ioaddr + IO_PORT); 1337 outw(*eaddrs++, ioaddr + IO_PORT);
1340 outw(*eaddrs++, ioaddr + IO_PORT); 1338 outw(*eaddrs++, ioaddr + IO_PORT);
@@ -1348,7 +1346,7 @@ set_multicast_list(struct net_device *dev)
1348 outb(MC_SETUP, ioaddr); 1346 outb(MC_SETUP, ioaddr);
1349 1347
1350 /* Update the transmit queue */ 1348 /* Update the transmit queue */
1351 i = lp->tx_end + XMT_HEADER + 6*(dev->mc_count + 1); 1349 i = lp->tx_end + XMT_HEADER + 6 * (mc_count + 1);
1352 1350
1353 if (lp->tx_start != lp->tx_end) 1351 if (lp->tx_start != lp->tx_end)
1354 { 1352 {
@@ -1380,8 +1378,8 @@ set_multicast_list(struct net_device *dev)
1380 break; 1378 break;
1381 } else if ((i & 0x0f) == 0x03) { /* MC-Done */ 1379 } else if ((i & 0x0f) == 0x03) { /* MC-Done */
1382 printk(KERN_DEBUG "%s: set Rx mode to %d address%s.\n", 1380 printk(KERN_DEBUG "%s: set Rx mode to %d address%s.\n",
1383 dev->name, dev->mc_count, 1381 dev->name, mc_count,
1384 dev->mc_count > 1 ? "es":""); 1382 mc_count > 1 ? "es":"");
1385 break; 1383 break;
1386 } 1384 }
1387 } 1385 }