diff options
Diffstat (limited to 'drivers/net/at1700.c')
-rw-r--r-- | drivers/net/at1700.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/net/at1700.c b/drivers/net/at1700.c index 544d5af6950e..10a20fb9ae65 100644 --- a/drivers/net/at1700.c +++ b/drivers/net/at1700.c | |||
@@ -47,7 +47,6 @@ | |||
47 | #include <linux/ioport.h> | 47 | #include <linux/ioport.h> |
48 | #include <linux/in.h> | 48 | #include <linux/in.h> |
49 | #include <linux/skbuff.h> | 49 | #include <linux/skbuff.h> |
50 | #include <linux/slab.h> | ||
51 | #include <linux/string.h> | 50 | #include <linux/string.h> |
52 | #include <linux/init.h> | 51 | #include <linux/init.h> |
53 | #include <linux/crc32.h> | 52 | #include <linux/crc32.h> |
@@ -350,13 +349,13 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr) | |||
350 | slot = -1; | 349 | slot = -1; |
351 | /* We must check for the EEPROM-config boards first, else accessing | 350 | /* We must check for the EEPROM-config boards first, else accessing |
352 | IOCONFIG0 will move the board! */ | 351 | IOCONFIG0 will move the board! */ |
353 | if (at1700_probe_list[inb(ioaddr + IOCONFIG1) & 0x07] == ioaddr | 352 | if (at1700_probe_list[inb(ioaddr + IOCONFIG1) & 0x07] == ioaddr && |
354 | && read_eeprom(ioaddr, 4) == 0x0000 | 353 | read_eeprom(ioaddr, 4) == 0x0000 && |
355 | && (read_eeprom(ioaddr, 5) & 0xff00) == 0xF400) | 354 | (read_eeprom(ioaddr, 5) & 0xff00) == 0xF400) |
356 | is_at1700 = 1; | 355 | is_at1700 = 1; |
357 | else if (inb(ioaddr + SAPROM ) == 0x00 | 356 | else if (inb(ioaddr + SAPROM ) == 0x00 && |
358 | && inb(ioaddr + SAPROM + 1) == 0x00 | 357 | inb(ioaddr + SAPROM + 1) == 0x00 && |
359 | && inb(ioaddr + SAPROM + 2) == 0x0e) | 358 | inb(ioaddr + SAPROM + 2) == 0x0e) |
360 | is_fmv18x = 1; | 359 | is_fmv18x = 1; |
361 | else { | 360 | else { |
362 | goto err_out; | 361 | goto err_out; |
@@ -468,7 +467,7 @@ found: | |||
468 | lp->jumpered = is_fmv18x; | 467 | lp->jumpered = is_fmv18x; |
469 | lp->mca_slot = slot; | 468 | lp->mca_slot = slot; |
470 | /* Snarf the interrupt vector now. */ | 469 | /* Snarf the interrupt vector now. */ |
471 | ret = request_irq(irq, &net_interrupt, 0, DRV_NAME, dev); | 470 | ret = request_irq(irq, net_interrupt, 0, DRV_NAME, dev); |
472 | if (ret) { | 471 | if (ret) { |
473 | printk(KERN_ERR "AT1700 at %#3x is unusable due to a " | 472 | printk(KERN_ERR "AT1700 at %#3x is unusable due to a " |
474 | "conflict on IRQ %d.\n", | 473 | "conflict on IRQ %d.\n", |
@@ -839,21 +838,19 @@ set_rx_mode(struct net_device *dev) | |||
839 | if (dev->flags & IFF_PROMISC) { | 838 | if (dev->flags & IFF_PROMISC) { |
840 | memset(mc_filter, 0xff, sizeof(mc_filter)); | 839 | memset(mc_filter, 0xff, sizeof(mc_filter)); |
841 | outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */ | 840 | outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */ |
842 | } else if (dev->mc_count > MC_FILTERBREAK | 841 | } else if (netdev_mc_count(dev) > MC_FILTERBREAK || |
843 | || (dev->flags & IFF_ALLMULTI)) { | 842 | (dev->flags & IFF_ALLMULTI)) { |
844 | /* Too many to filter perfectly -- accept all multicasts. */ | 843 | /* Too many to filter perfectly -- accept all multicasts. */ |
845 | memset(mc_filter, 0xff, sizeof(mc_filter)); | 844 | memset(mc_filter, 0xff, sizeof(mc_filter)); |
846 | outb(2, ioaddr + RX_MODE); /* Use normal mode. */ | 845 | outb(2, ioaddr + RX_MODE); /* Use normal mode. */ |
847 | } else if (dev->mc_count == 0) { | 846 | } else if (netdev_mc_empty(dev)) { |
848 | memset(mc_filter, 0x00, sizeof(mc_filter)); | 847 | memset(mc_filter, 0x00, sizeof(mc_filter)); |
849 | outb(1, ioaddr + RX_MODE); /* Ignore almost all multicasts. */ | 848 | outb(1, ioaddr + RX_MODE); /* Ignore almost all multicasts. */ |
850 | } else { | 849 | } else { |
851 | struct dev_mc_list *mclist; | 850 | struct dev_mc_list *mclist; |
852 | int i; | ||
853 | 851 | ||
854 | memset(mc_filter, 0, sizeof(mc_filter)); | 852 | memset(mc_filter, 0, sizeof(mc_filter)); |
855 | for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; | 853 | netdev_for_each_mc_addr(mclist, dev) { |
856 | i++, mclist = mclist->next) { | ||
857 | unsigned int bit = | 854 | unsigned int bit = |
858 | ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 26; | 855 | ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 26; |
859 | mc_filter[bit >> 3] |= (1 << bit); | 856 | mc_filter[bit >> 3] |= (1 << bit); |