diff options
Diffstat (limited to 'drivers/net/natsemi.c')
-rw-r--r-- | drivers/net/natsemi.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index b2722c44337e..e52038783245 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c | |||
@@ -247,7 +247,7 @@ static struct { | |||
247 | { "NatSemi DP8381[56]", 0, 24 }, | 247 | { "NatSemi DP8381[56]", 0, 24 }, |
248 | }; | 248 | }; |
249 | 249 | ||
250 | static struct pci_device_id natsemi_pci_tbl[] __devinitdata = { | 250 | static DEFINE_PCI_DEVICE_TABLE(natsemi_pci_tbl) = { |
251 | { PCI_VENDOR_ID_NS, 0x0020, 0x12d9, 0x000c, 0, 0, 0 }, | 251 | { PCI_VENDOR_ID_NS, 0x0020, 0x12d9, 0x000c, 0, 0, 0 }, |
252 | { PCI_VENDOR_ID_NS, 0x0020, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, | 252 | { PCI_VENDOR_ID_NS, 0x0020, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, |
253 | { } /* terminate list */ | 253 | { } /* terminate list */ |
@@ -683,8 +683,8 @@ static ssize_t natsemi_set_dspcfg_workaround(struct device *dev, | |||
683 | /* Find out the new setting */ | 683 | /* Find out the new setting */ |
684 | if (!strncmp("on", buf, count - 1) || !strncmp("1", buf, count - 1)) | 684 | if (!strncmp("on", buf, count - 1) || !strncmp("1", buf, count - 1)) |
685 | new_setting = 1; | 685 | new_setting = 1; |
686 | else if (!strncmp("off", buf, count - 1) | 686 | else if (!strncmp("off", buf, count - 1) || |
687 | || !strncmp("0", buf, count - 1)) | 687 | !strncmp("0", buf, count - 1)) |
688 | new_setting = 0; | 688 | new_setting = 0; |
689 | else | 689 | else |
690 | return count; | 690 | return count; |
@@ -757,8 +757,8 @@ static void __devinit natsemi_init_media (struct net_device *dev) | |||
757 | np->autoneg = (tmp & BMCR_ANENABLE)? AUTONEG_ENABLE: AUTONEG_DISABLE; | 757 | np->autoneg = (tmp & BMCR_ANENABLE)? AUTONEG_ENABLE: AUTONEG_DISABLE; |
758 | np->advertising= mdio_read(dev, MII_ADVERTISE); | 758 | np->advertising= mdio_read(dev, MII_ADVERTISE); |
759 | 759 | ||
760 | if ((np->advertising & ADVERTISE_ALL) != ADVERTISE_ALL | 760 | if ((np->advertising & ADVERTISE_ALL) != ADVERTISE_ALL && |
761 | && netif_msg_probe(np)) { | 761 | netif_msg_probe(np)) { |
762 | printk(KERN_INFO "natsemi %s: Transceiver default autonegotiation %s " | 762 | printk(KERN_INFO "natsemi %s: Transceiver default autonegotiation %s " |
763 | "10%s %s duplex.\n", | 763 | "10%s %s duplex.\n", |
764 | pci_name(np->pci_dev), | 764 | pci_name(np->pci_dev), |
@@ -1153,8 +1153,8 @@ static void init_phy_fixup(struct net_device *dev) | |||
1153 | tmp = mdio_read(dev, MII_BMCR); | 1153 | tmp = mdio_read(dev, MII_BMCR); |
1154 | if (np->autoneg == AUTONEG_ENABLE) { | 1154 | if (np->autoneg == AUTONEG_ENABLE) { |
1155 | /* renegotiate if something changed */ | 1155 | /* renegotiate if something changed */ |
1156 | if ((tmp & BMCR_ANENABLE) == 0 | 1156 | if ((tmp & BMCR_ANENABLE) == 0 || |
1157 | || np->advertising != mdio_read(dev, MII_ADVERTISE)) | 1157 | np->advertising != mdio_read(dev, MII_ADVERTISE)) |
1158 | { | 1158 | { |
1159 | /* turn on autonegotiation and force negotiation */ | 1159 | /* turn on autonegotiation and force negotiation */ |
1160 | tmp |= (BMCR_ANENABLE | BMCR_ANRESTART); | 1160 | tmp |= (BMCR_ANENABLE | BMCR_ANRESTART); |
@@ -1535,7 +1535,7 @@ static int netdev_open(struct net_device *dev) | |||
1535 | /* Reset the chip, just in case. */ | 1535 | /* Reset the chip, just in case. */ |
1536 | natsemi_reset(dev); | 1536 | natsemi_reset(dev); |
1537 | 1537 | ||
1538 | i = request_irq(dev->irq, &intr_handler, IRQF_SHARED, dev->name, dev); | 1538 | i = request_irq(dev->irq, intr_handler, IRQF_SHARED, dev->name, dev); |
1539 | if (i) return i; | 1539 | if (i) return i; |
1540 | 1540 | ||
1541 | if (netif_msg_ifup(np)) | 1541 | if (netif_msg_ifup(np)) |
@@ -2164,8 +2164,8 @@ static void netdev_tx_done(struct net_device *dev) | |||
2164 | dev_kfree_skb_irq(np->tx_skbuff[entry]); | 2164 | dev_kfree_skb_irq(np->tx_skbuff[entry]); |
2165 | np->tx_skbuff[entry] = NULL; | 2165 | np->tx_skbuff[entry] = NULL; |
2166 | } | 2166 | } |
2167 | if (netif_queue_stopped(dev) | 2167 | if (netif_queue_stopped(dev) && |
2168 | && np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 4) { | 2168 | np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 4) { |
2169 | /* The ring is no longer full, wake queue. */ | 2169 | /* The ring is no longer full, wake queue. */ |
2170 | netif_wake_queue(dev); | 2170 | netif_wake_queue(dev); |
2171 | } | 2171 | } |
@@ -2343,8 +2343,8 @@ static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do) | |||
2343 | /* Omit CRC size. */ | 2343 | /* Omit CRC size. */ |
2344 | /* Check if the packet is long enough to accept | 2344 | /* Check if the packet is long enough to accept |
2345 | * without copying to a minimally-sized skbuff. */ | 2345 | * without copying to a minimally-sized skbuff. */ |
2346 | if (pkt_len < rx_copybreak | 2346 | if (pkt_len < rx_copybreak && |
2347 | && (skb = dev_alloc_skb(pkt_len + RX_OFFSET)) != NULL) { | 2347 | (skb = dev_alloc_skb(pkt_len + RX_OFFSET)) != NULL) { |
2348 | /* 16 byte align the IP header */ | 2348 | /* 16 byte align the IP header */ |
2349 | skb_reserve(skb, RX_OFFSET); | 2349 | skb_reserve(skb, RX_OFFSET); |
2350 | pci_dma_sync_single_for_cpu(np->pci_dev, | 2350 | pci_dma_sync_single_for_cpu(np->pci_dev, |
@@ -2390,8 +2390,8 @@ static void netdev_error(struct net_device *dev, int intr_status) | |||
2390 | spin_lock(&np->lock); | 2390 | spin_lock(&np->lock); |
2391 | if (intr_status & LinkChange) { | 2391 | if (intr_status & LinkChange) { |
2392 | u16 lpa = mdio_read(dev, MII_LPA); | 2392 | u16 lpa = mdio_read(dev, MII_LPA); |
2393 | if (mdio_read(dev, MII_BMCR) & BMCR_ANENABLE | 2393 | if (mdio_read(dev, MII_BMCR) & BMCR_ANENABLE && |
2394 | && netif_msg_link(np)) { | 2394 | netif_msg_link(np)) { |
2395 | printk(KERN_INFO | 2395 | printk(KERN_INFO |
2396 | "%s: Autonegotiation advertising" | 2396 | "%s: Autonegotiation advertising" |
2397 | " %#04x partner %#04x.\n", dev->name, | 2397 | " %#04x partner %#04x.\n", dev->name, |
@@ -2488,16 +2488,16 @@ static void __set_rx_mode(struct net_device *dev) | |||
2488 | if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ | 2488 | if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ |
2489 | rx_mode = RxFilterEnable | AcceptBroadcast | 2489 | rx_mode = RxFilterEnable | AcceptBroadcast |
2490 | | AcceptAllMulticast | AcceptAllPhys | AcceptMyPhys; | 2490 | | AcceptAllMulticast | AcceptAllPhys | AcceptMyPhys; |
2491 | } else if ((dev->mc_count > multicast_filter_limit) | 2491 | } else if ((netdev_mc_count(dev) > multicast_filter_limit) || |
2492 | || (dev->flags & IFF_ALLMULTI)) { | 2492 | (dev->flags & IFF_ALLMULTI)) { |
2493 | rx_mode = RxFilterEnable | AcceptBroadcast | 2493 | rx_mode = RxFilterEnable | AcceptBroadcast |
2494 | | AcceptAllMulticast | AcceptMyPhys; | 2494 | | AcceptAllMulticast | AcceptMyPhys; |
2495 | } else { | 2495 | } else { |
2496 | struct dev_mc_list *mclist; | 2496 | struct dev_mc_list *mclist; |
2497 | int i; | 2497 | int i; |
2498 | |||
2498 | memset(mc_filter, 0, sizeof(mc_filter)); | 2499 | memset(mc_filter, 0, sizeof(mc_filter)); |
2499 | for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; | 2500 | netdev_for_each_mc_addr(mclist, dev) { |
2500 | i++, mclist = mclist->next) { | ||
2501 | int b = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 23) & 0x1ff; | 2501 | int b = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 23) & 0x1ff; |
2502 | mc_filter[b/8] |= (1 << (b & 0x07)); | 2502 | mc_filter[b/8] |= (1 << (b & 0x07)); |
2503 | } | 2503 | } |