diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-02-07 23:30:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-12 14:38:58 -0500 |
commit | 4cd24eaf0c6ee7f0242e34ee77ec899f255e66b5 (patch) | |
tree | 99f57f6374a58022e1e5ed1cbc12699288c7eae1 /drivers/net/eepro.c | |
parent | 8e5574211d96c0552f84c757718475fdb4021be7 (diff) |
net: use netdev_mc_count and netdev_mc_empty when appropriate
This patch replaces dev->mc_count in all drivers (hopefully I didn't miss
anything). Used spatch and did small tweaks and conding style changes when
it was suitable.
Jirka
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/eepro.c')
-rw-r--r-- | drivers/net/eepro.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c index 94c59498cdb6..488bc13cc7e6 100644 --- a/drivers/net/eepro.c +++ b/drivers/net/eepro.c | |||
@@ -1288,8 +1288,9 @@ set_multicast_list(struct net_device *dev) | |||
1288 | short ioaddr = dev->base_addr; | 1288 | short ioaddr = dev->base_addr; |
1289 | unsigned short mode; | 1289 | unsigned short mode; |
1290 | struct dev_mc_list *dmi=dev->mc_list; | 1290 | struct dev_mc_list *dmi=dev->mc_list; |
1291 | int mc_count = mc_count; | ||
1291 | 1292 | ||
1292 | if (dev->flags&(IFF_ALLMULTI|IFF_PROMISC) || dev->mc_count > 63) | 1293 | if (dev->flags&(IFF_ALLMULTI|IFF_PROMISC) || mc_count > 63) |
1293 | { | 1294 | { |
1294 | eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */ | 1295 | eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */ |
1295 | mode = inb(ioaddr + REG2); | 1296 | mode = inb(ioaddr + REG2); |
@@ -1299,7 +1300,7 @@ set_multicast_list(struct net_device *dev) | |||
1299 | eepro_sw2bank0(ioaddr); /* Return to BANK 0 now */ | 1300 | eepro_sw2bank0(ioaddr); /* Return to BANK 0 now */ |
1300 | } | 1301 | } |
1301 | 1302 | ||
1302 | else if (dev->mc_count==0 ) | 1303 | else if (mc_count == 0) |
1303 | { | 1304 | { |
1304 | eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */ | 1305 | eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */ |
1305 | mode = inb(ioaddr + REG2); | 1306 | mode = inb(ioaddr + REG2); |
@@ -1329,9 +1330,9 @@ set_multicast_list(struct net_device *dev) | |||
1329 | outw(MC_SETUP, ioaddr + IO_PORT); | 1330 | outw(MC_SETUP, ioaddr + IO_PORT); |
1330 | outw(0, ioaddr + IO_PORT); | 1331 | outw(0, ioaddr + IO_PORT); |
1331 | outw(0, ioaddr + IO_PORT); | 1332 | outw(0, ioaddr + IO_PORT); |
1332 | outw(6*(dev->mc_count + 1), ioaddr + IO_PORT); | 1333 | outw(6 * (mc_count + 1), ioaddr + IO_PORT); |
1333 | 1334 | ||
1334 | for (i = 0; i < dev->mc_count; i++) | 1335 | for (i = 0; i < mc_count; i++) |
1335 | { | 1336 | { |
1336 | eaddrs=(unsigned short *)dmi->dmi_addr; | 1337 | eaddrs=(unsigned short *)dmi->dmi_addr; |
1337 | dmi=dmi->next; | 1338 | dmi=dmi->next; |
@@ -1348,7 +1349,7 @@ set_multicast_list(struct net_device *dev) | |||
1348 | outb(MC_SETUP, ioaddr); | 1349 | outb(MC_SETUP, ioaddr); |
1349 | 1350 | ||
1350 | /* Update the transmit queue */ | 1351 | /* Update the transmit queue */ |
1351 | i = lp->tx_end + XMT_HEADER + 6*(dev->mc_count + 1); | 1352 | i = lp->tx_end + XMT_HEADER + 6 * (mc_count + 1); |
1352 | 1353 | ||
1353 | if (lp->tx_start != lp->tx_end) | 1354 | if (lp->tx_start != lp->tx_end) |
1354 | { | 1355 | { |
@@ -1380,8 +1381,8 @@ set_multicast_list(struct net_device *dev) | |||
1380 | break; | 1381 | break; |
1381 | } else if ((i & 0x0f) == 0x03) { /* MC-Done */ | 1382 | } else if ((i & 0x0f) == 0x03) { /* MC-Done */ |
1382 | printk(KERN_DEBUG "%s: set Rx mode to %d address%s.\n", | 1383 | printk(KERN_DEBUG "%s: set Rx mode to %d address%s.\n", |
1383 | dev->name, dev->mc_count, | 1384 | dev->name, mc_count, |
1384 | dev->mc_count > 1 ? "es":""); | 1385 | mc_count > 1 ? "es":""); |
1385 | break; | 1386 | break; |
1386 | } | 1387 | } |
1387 | } | 1388 | } |