diff options
Diffstat (limited to 'drivers/net/ns83820.c')
-rw-r--r-- | drivers/net/ns83820.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index 57fd483dbb1f..e88e97cd1b10 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c | |||
@@ -116,6 +116,7 @@ | |||
116 | #include <linux/if_vlan.h> | 116 | #include <linux/if_vlan.h> |
117 | #include <linux/rtnetlink.h> | 117 | #include <linux/rtnetlink.h> |
118 | #include <linux/jiffies.h> | 118 | #include <linux/jiffies.h> |
119 | #include <linux/slab.h> | ||
119 | 120 | ||
120 | #include <asm/io.h> | 121 | #include <asm/io.h> |
121 | #include <asm/uaccess.h> | 122 | #include <asm/uaccess.h> |
@@ -648,8 +649,8 @@ static void phy_intr(struct net_device *ndev) | |||
648 | dprintk("phy_intr: tbisr=%08x, tanar=%08x, tanlpar=%08x\n", | 649 | dprintk("phy_intr: tbisr=%08x, tanar=%08x, tanlpar=%08x\n", |
649 | tbisr, tanar, tanlpar); | 650 | tbisr, tanar, tanlpar); |
650 | 651 | ||
651 | if ( (fullduplex = (tanlpar & TANAR_FULL_DUP) | 652 | if ( (fullduplex = (tanlpar & TANAR_FULL_DUP) && |
652 | && (tanar & TANAR_FULL_DUP)) ) { | 653 | (tanar & TANAR_FULL_DUP)) ) { |
653 | 654 | ||
654 | /* both of us are full duplex */ | 655 | /* both of us are full duplex */ |
655 | writel(readl(dev->base + TXCFG) | 656 | writel(readl(dev->base + TXCFG) |
@@ -661,12 +662,12 @@ static void phy_intr(struct net_device *ndev) | |||
661 | writel(readl(dev->base + GPIOR) | GPIOR_GP1_OUT, | 662 | writel(readl(dev->base + GPIOR) | GPIOR_GP1_OUT, |
662 | dev->base + GPIOR); | 663 | dev->base + GPIOR); |
663 | 664 | ||
664 | } else if(((tanlpar & TANAR_HALF_DUP) | 665 | } else if (((tanlpar & TANAR_HALF_DUP) && |
665 | && (tanar & TANAR_HALF_DUP)) | 666 | (tanar & TANAR_HALF_DUP)) || |
666 | || ((tanlpar & TANAR_FULL_DUP) | 667 | ((tanlpar & TANAR_FULL_DUP) && |
667 | && (tanar & TANAR_HALF_DUP)) | 668 | (tanar & TANAR_HALF_DUP)) || |
668 | || ((tanlpar & TANAR_HALF_DUP) | 669 | ((tanlpar & TANAR_HALF_DUP) && |
669 | && (tanar & TANAR_FULL_DUP))) { | 670 | (tanar & TANAR_FULL_DUP))) { |
670 | 671 | ||
671 | /* one or both of us are half duplex */ | 672 | /* one or both of us are half duplex */ |
672 | writel((readl(dev->base + TXCFG) | 673 | writel((readl(dev->base + TXCFG) |
@@ -720,16 +721,16 @@ static void phy_intr(struct net_device *ndev) | |||
720 | 721 | ||
721 | newlinkstate = (cfg & CFG_LNKSTS) ? LINK_UP : LINK_DOWN; | 722 | newlinkstate = (cfg & CFG_LNKSTS) ? LINK_UP : LINK_DOWN; |
722 | 723 | ||
723 | if (newlinkstate & LINK_UP | 724 | if (newlinkstate & LINK_UP && |
724 | && dev->linkstate != newlinkstate) { | 725 | dev->linkstate != newlinkstate) { |
725 | netif_start_queue(ndev); | 726 | netif_start_queue(ndev); |
726 | netif_wake_queue(ndev); | 727 | netif_wake_queue(ndev); |
727 | printk(KERN_INFO "%s: link now %s mbps, %s duplex and up.\n", | 728 | printk(KERN_INFO "%s: link now %s mbps, %s duplex and up.\n", |
728 | ndev->name, | 729 | ndev->name, |
729 | speeds[speed], | 730 | speeds[speed], |
730 | fullduplex ? "full" : "half"); | 731 | fullduplex ? "full" : "half"); |
731 | } else if (newlinkstate & LINK_DOWN | 732 | } else if (newlinkstate & LINK_DOWN && |
732 | && dev->linkstate != newlinkstate) { | 733 | dev->linkstate != newlinkstate) { |
733 | netif_stop_queue(ndev); | 734 | netif_stop_queue(ndev); |
734 | printk(KERN_INFO "%s: link now down.\n", ndev->name); | 735 | printk(KERN_INFO "%s: link now down.\n", ndev->name); |
735 | } | 736 | } |
@@ -1719,7 +1720,7 @@ static void ns83820_set_multicast(struct net_device *ndev) | |||
1719 | else | 1720 | else |
1720 | and_mask &= ~(RFCR_AAU | RFCR_AAM); | 1721 | and_mask &= ~(RFCR_AAU | RFCR_AAM); |
1721 | 1722 | ||
1722 | if (ndev->flags & IFF_ALLMULTI || ndev->mc_count) | 1723 | if (ndev->flags & IFF_ALLMULTI || netdev_mc_count(ndev)) |
1723 | or_mask |= RFCR_AAM; | 1724 | or_mask |= RFCR_AAM; |
1724 | else | 1725 | else |
1725 | and_mask &= ~RFCR_AAM; | 1726 | and_mask &= ~RFCR_AAM; |
@@ -2292,7 +2293,7 @@ static void __devexit ns83820_remove_one(struct pci_dev *pci_dev) | |||
2292 | pci_set_drvdata(pci_dev, NULL); | 2293 | pci_set_drvdata(pci_dev, NULL); |
2293 | } | 2294 | } |
2294 | 2295 | ||
2295 | static struct pci_device_id ns83820_pci_tbl[] = { | 2296 | static DEFINE_PCI_DEVICE_TABLE(ns83820_pci_tbl) = { |
2296 | { 0x100b, 0x0022, PCI_ANY_ID, PCI_ANY_ID, 0, .driver_data = 0, }, | 2297 | { 0x100b, 0x0022, PCI_ANY_ID, PCI_ANY_ID, 0, .driver_data = 0, }, |
2297 | { 0, }, | 2298 | { 0, }, |
2298 | }; | 2299 | }; |