diff options
Diffstat (limited to 'drivers/net')
71 files changed, 742 insertions, 497 deletions
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index 3a7bc524af33..c7a4f3bcc2bc 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c | |||
@@ -94,7 +94,7 @@ | |||
94 | #include <asm/io.h> | 94 | #include <asm/io.h> |
95 | #include <asm/irq.h> | 95 | #include <asm/irq.h> |
96 | 96 | ||
97 | static char version[] __initdata = DRV_NAME ".c:" DRV_VERSION " " DRV_RELDATE " becker@scyld.com\n"; | 97 | static char version[] __devinitdata = DRV_NAME ".c:" DRV_VERSION " " DRV_RELDATE " becker@scyld.com\n"; |
98 | 98 | ||
99 | #ifdef EL3_DEBUG | 99 | #ifdef EL3_DEBUG |
100 | static int el3_debug = EL3_DEBUG; | 100 | static int el3_debug = EL3_DEBUG; |
@@ -186,7 +186,7 @@ static int max_interrupt_work = 10; | |||
186 | static int nopnp; | 186 | static int nopnp; |
187 | #endif | 187 | #endif |
188 | 188 | ||
189 | static int __init el3_common_init(struct net_device *dev); | 189 | static int __devinit el3_common_init(struct net_device *dev); |
190 | static void el3_common_remove(struct net_device *dev); | 190 | static void el3_common_remove(struct net_device *dev); |
191 | static ushort id_read_eeprom(int index); | 191 | static ushort id_read_eeprom(int index); |
192 | static ushort read_eeprom(int ioaddr, int index); | 192 | static ushort read_eeprom(int ioaddr, int index); |
@@ -537,7 +537,7 @@ static struct mca_driver el3_mca_driver = { | |||
537 | static int mca_registered; | 537 | static int mca_registered; |
538 | #endif /* CONFIG_MCA */ | 538 | #endif /* CONFIG_MCA */ |
539 | 539 | ||
540 | static int __init el3_common_init(struct net_device *dev) | 540 | static int __devinit el3_common_init(struct net_device *dev) |
541 | { | 541 | { |
542 | struct el3_private *lp = netdev_priv(dev); | 542 | struct el3_private *lp = netdev_priv(dev); |
543 | int err; | 543 | int err; |
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index 85fa40a0a667..9ba1f0b46429 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -1836,10 +1836,9 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1836 | 1836 | ||
1837 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && | 1837 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && |
1838 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pdev->revision < 0x20) { | 1838 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pdev->revision < 0x20) { |
1839 | dev_err(&pdev->dev, | 1839 | dev_info(&pdev->dev, |
1840 | "This (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n", | 1840 | "This (id %04x:%04x rev %02x) is not an 8139C+ compatible chip, use 8139too\n", |
1841 | pdev->vendor, pdev->device, pdev->revision); | 1841 | pdev->vendor, pdev->device, pdev->revision); |
1842 | dev_err(&pdev->dev, "Try the \"8139too\" driver instead.\n"); | ||
1843 | return -ENODEV; | 1842 | return -ENODEV; |
1844 | } | 1843 | } |
1845 | 1844 | ||
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index 0daf8c15e381..63f906b04899 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -946,10 +946,9 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
946 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && | 946 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && |
947 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pdev->revision >= 0x20) { | 947 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pdev->revision >= 0x20) { |
948 | dev_info(&pdev->dev, | 948 | dev_info(&pdev->dev, |
949 | "This (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n", | 949 | "This (id %04x:%04x rev %02x) is an enhanced 8139C+ chip, use 8139cp\n", |
950 | pdev->vendor, pdev->device, pdev->revision); | 950 | pdev->vendor, pdev->device, pdev->revision); |
951 | dev_info(&pdev->dev, | 951 | return -ENODEV; |
952 | "Use the \"8139cp\" driver for improved performance and stability.\n"); | ||
953 | } | 952 | } |
954 | 953 | ||
955 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && | 954 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 0b71ebc074b6..11f143f4adf6 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -894,7 +894,7 @@ config SMC91X | |||
894 | select CRC32 | 894 | select CRC32 |
895 | select MII | 895 | select MII |
896 | depends on ARM || REDWOOD_5 || REDWOOD_6 || M32R || SUPERH || \ | 896 | depends on ARM || REDWOOD_5 || REDWOOD_6 || M32R || SUPERH || \ |
897 | SOC_AU1X00 || BLACKFIN || MN10300 | 897 | MIPS || BLACKFIN || MN10300 |
898 | help | 898 | help |
899 | This is a driver for SMC's 91x series of Ethernet chipsets, | 899 | This is a driver for SMC's 91x series of Ethernet chipsets, |
900 | including the SMC91C94 and the SMC91C111. Say Y if you want it | 900 | including the SMC91C94 and the SMC91C111. Say Y if you want it |
@@ -966,7 +966,7 @@ config SMC911X | |||
966 | tristate "SMSC LAN911[5678] support" | 966 | tristate "SMSC LAN911[5678] support" |
967 | select CRC32 | 967 | select CRC32 |
968 | select MII | 968 | select MII |
969 | depends on ARCH_PXA || SUPERH | 969 | depends on ARM || SUPERH |
970 | help | 970 | help |
971 | This is a driver for SMSC's LAN911x series of Ethernet chipsets | 971 | This is a driver for SMSC's LAN911x series of Ethernet chipsets |
972 | including the new LAN9115, LAN9116, LAN9117, and LAN9118. | 972 | including the new LAN9115, LAN9116, LAN9117, and LAN9118. |
@@ -2009,6 +2009,15 @@ config IGB_LRO | |||
2009 | 2009 | ||
2010 | If in doubt, say N. | 2010 | If in doubt, say N. |
2011 | 2011 | ||
2012 | config IGB_DCA | ||
2013 | bool "Direct Cache Access (DCA) Support" | ||
2014 | default y | ||
2015 | depends on IGB && DCA && !(IGB=y && DCA=m) | ||
2016 | ---help--- | ||
2017 | Say Y here if you want to use Direct Cache Access (DCA) in the | ||
2018 | driver. DCA is a method for warming the CPU cache before data | ||
2019 | is used, with the intent of lessening the impact of cache misses. | ||
2020 | |||
2012 | source "drivers/net/ixp2000/Kconfig" | 2021 | source "drivers/net/ixp2000/Kconfig" |
2013 | 2022 | ||
2014 | config MYRI_SBUS | 2023 | config MYRI_SBUS |
@@ -2432,9 +2441,13 @@ config IXGBE | |||
2432 | will be called ixgbe. | 2441 | will be called ixgbe. |
2433 | 2442 | ||
2434 | config IXGBE_DCA | 2443 | config IXGBE_DCA |
2435 | bool | 2444 | bool "Direct Cache Access (DCA) Support" |
2436 | default y | 2445 | default y |
2437 | depends on IXGBE && DCA && !(IXGBE=y && DCA=m) | 2446 | depends on IXGBE && DCA && !(IXGBE=y && DCA=m) |
2447 | ---help--- | ||
2448 | Say Y here if you want to use Direct Cache Access (DCA) in the | ||
2449 | driver. DCA is a method for warming the CPU cache before data | ||
2450 | is used, with the intent of lessening the impact of cache misses. | ||
2438 | 2451 | ||
2439 | config IXGB | 2452 | config IXGB |
2440 | tristate "Intel(R) PRO/10GbE support" | 2453 | tristate "Intel(R) PRO/10GbE support" |
@@ -2484,9 +2497,13 @@ config MYRI10GE | |||
2484 | will be called myri10ge. | 2497 | will be called myri10ge. |
2485 | 2498 | ||
2486 | config MYRI10GE_DCA | 2499 | config MYRI10GE_DCA |
2487 | bool | 2500 | bool "Direct Cache Access (DCA) Support" |
2488 | default y | 2501 | default y |
2489 | depends on MYRI10GE && DCA && !(MYRI10GE=y && DCA=m) | 2502 | depends on MYRI10GE && DCA && !(MYRI10GE=y && DCA=m) |
2503 | ---help--- | ||
2504 | Say Y here if you want to use Direct Cache Access (DCA) in the | ||
2505 | driver. DCA is a method for warming the CPU cache before data | ||
2506 | is used, with the intent of lessening the impact of cache misses. | ||
2490 | 2507 | ||
2491 | config NETXEN_NIC | 2508 | config NETXEN_NIC |
2492 | tristate "NetXen Multi port (1/10) Gigabit Ethernet NIC" | 2509 | tristate "NetXen Multi port (1/10) Gigabit Ethernet NIC" |
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c index c54967f7942a..07a6697e3635 100644 --- a/drivers/net/amd8111e.c +++ b/drivers/net/amd8111e.c | |||
@@ -644,10 +644,6 @@ This function frees the transmiter and receiver descriptor rings. | |||
644 | */ | 644 | */ |
645 | static void amd8111e_free_ring(struct amd8111e_priv* lp) | 645 | static void amd8111e_free_ring(struct amd8111e_priv* lp) |
646 | { | 646 | { |
647 | |||
648 | /* Free transmit and receive skbs */ | ||
649 | amd8111e_free_skbs(lp->amd8111e_net_dev); | ||
650 | |||
651 | /* Free transmit and receive descriptor rings */ | 647 | /* Free transmit and receive descriptor rings */ |
652 | if(lp->rx_ring){ | 648 | if(lp->rx_ring){ |
653 | pci_free_consistent(lp->pci_dev, | 649 | pci_free_consistent(lp->pci_dev, |
@@ -833,12 +829,14 @@ static int amd8111e_rx_poll(struct napi_struct *napi, int budget) | |||
833 | 829 | ||
834 | } while(intr0 & RINT0); | 830 | } while(intr0 & RINT0); |
835 | 831 | ||
836 | /* Receive descriptor is empty now */ | 832 | if (rx_pkt_limit > 0) { |
837 | spin_lock_irqsave(&lp->lock, flags); | 833 | /* Receive descriptor is empty now */ |
838 | __netif_rx_complete(dev, napi); | 834 | spin_lock_irqsave(&lp->lock, flags); |
839 | writel(VAL0|RINTEN0, mmio + INTEN0); | 835 | __netif_rx_complete(dev, napi); |
840 | writel(VAL2 | RDMD0, mmio + CMD0); | 836 | writel(VAL0|RINTEN0, mmio + INTEN0); |
841 | spin_unlock_irqrestore(&lp->lock, flags); | 837 | writel(VAL2 | RDMD0, mmio + CMD0); |
838 | spin_unlock_irqrestore(&lp->lock, flags); | ||
839 | } | ||
842 | 840 | ||
843 | rx_not_empty: | 841 | rx_not_empty: |
844 | return num_rx_pkt; | 842 | return num_rx_pkt; |
@@ -1231,7 +1229,9 @@ static int amd8111e_close(struct net_device * dev) | |||
1231 | 1229 | ||
1232 | amd8111e_disable_interrupt(lp); | 1230 | amd8111e_disable_interrupt(lp); |
1233 | amd8111e_stop_chip(lp); | 1231 | amd8111e_stop_chip(lp); |
1234 | amd8111e_free_ring(lp); | 1232 | |
1233 | /* Free transmit and receive skbs */ | ||
1234 | amd8111e_free_skbs(lp->amd8111e_net_dev); | ||
1235 | 1235 | ||
1236 | netif_carrier_off(lp->amd8111e_net_dev); | 1236 | netif_carrier_off(lp->amd8111e_net_dev); |
1237 | 1237 | ||
@@ -1241,6 +1241,7 @@ static int amd8111e_close(struct net_device * dev) | |||
1241 | 1241 | ||
1242 | spin_unlock_irq(&lp->lock); | 1242 | spin_unlock_irq(&lp->lock); |
1243 | free_irq(dev->irq, dev); | 1243 | free_irq(dev->irq, dev); |
1244 | amd8111e_free_ring(lp); | ||
1244 | 1245 | ||
1245 | /* Update the statistics before closing */ | 1246 | /* Update the statistics before closing */ |
1246 | amd8111e_get_stats(dev); | 1247 | amd8111e_get_stats(dev); |
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c index 0fa53464efb2..6f431a887e7e 100644 --- a/drivers/net/arm/at91_ether.c +++ b/drivers/net/arm/at91_ether.c | |||
@@ -1080,7 +1080,8 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add | |||
1080 | init_timer(&lp->check_timer); | 1080 | init_timer(&lp->check_timer); |
1081 | lp->check_timer.data = (unsigned long)dev; | 1081 | lp->check_timer.data = (unsigned long)dev; |
1082 | lp->check_timer.function = at91ether_check_link; | 1082 | lp->check_timer.function = at91ether_check_link; |
1083 | } | 1083 | } else if (lp->board_data.phy_irq_pin >= 32) |
1084 | gpio_request(lp->board_data.phy_irq_pin, "ethernet_phy"); | ||
1084 | 1085 | ||
1085 | /* Display ethernet banner */ | 1086 | /* Display ethernet banner */ |
1086 | printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%s)\n", | 1087 | printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%s)\n", |
@@ -1167,6 +1168,9 @@ static int __devexit at91ether_remove(struct platform_device *pdev) | |||
1167 | struct net_device *dev = platform_get_drvdata(pdev); | 1168 | struct net_device *dev = platform_get_drvdata(pdev); |
1168 | struct at91_private *lp = netdev_priv(dev); | 1169 | struct at91_private *lp = netdev_priv(dev); |
1169 | 1170 | ||
1171 | if (lp->board_data.phy_irq_pin >= 32) | ||
1172 | gpio_free(lp->board_data.phy_irq_pin); | ||
1173 | |||
1170 | unregister_netdev(dev); | 1174 | unregister_netdev(dev); |
1171 | free_irq(dev->irq, dev); | 1175 | free_irq(dev->irq, dev); |
1172 | dma_free_coherent(NULL, sizeof(struct recv_desc_bufs), lp->dlist, (dma_addr_t)lp->dlist_phys); | 1176 | dma_free_coherent(NULL, sizeof(struct recv_desc_bufs), lp->dlist, (dma_addr_t)lp->dlist_phys); |
diff --git a/drivers/net/atl1e/atl1e.h b/drivers/net/atl1e/atl1e.h index b645fa0f3f64..c49550d507a0 100644 --- a/drivers/net/atl1e/atl1e.h +++ b/drivers/net/atl1e/atl1e.h | |||
@@ -46,7 +46,6 @@ | |||
46 | #include <linux/vmalloc.h> | 46 | #include <linux/vmalloc.h> |
47 | #include <linux/pagemap.h> | 47 | #include <linux/pagemap.h> |
48 | #include <linux/tcp.h> | 48 | #include <linux/tcp.h> |
49 | #include <linux/mii.h> | ||
50 | #include <linux/ethtool.h> | 49 | #include <linux/ethtool.h> |
51 | #include <linux/if_vlan.h> | 50 | #include <linux/if_vlan.h> |
52 | #include <linux/workqueue.h> | 51 | #include <linux/workqueue.h> |
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index 3cf59a7f5a1c..246d92b42636 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
@@ -2310,7 +2310,8 @@ static void atl1_tx_queue(struct atl1_adapter *adapter, u16 count, | |||
2310 | if (tpd != ptpd) | 2310 | if (tpd != ptpd) |
2311 | memcpy(tpd, ptpd, sizeof(struct tx_packet_desc)); | 2311 | memcpy(tpd, ptpd, sizeof(struct tx_packet_desc)); |
2312 | tpd->buffer_addr = cpu_to_le64(buffer_info->dma); | 2312 | tpd->buffer_addr = cpu_to_le64(buffer_info->dma); |
2313 | tpd->word2 = (cpu_to_le16(buffer_info->length) & | 2313 | tpd->word2 &= ~(TPD_BUFLEN_MASK << TPD_BUFLEN_SHIFT); |
2314 | tpd->word2 |= (cpu_to_le16(buffer_info->length) & | ||
2314 | TPD_BUFLEN_MASK) << TPD_BUFLEN_SHIFT; | 2315 | TPD_BUFLEN_MASK) << TPD_BUFLEN_SHIFT; |
2315 | 2316 | ||
2316 | /* | 2317 | /* |
@@ -2409,8 +2410,8 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
2409 | vlan_tag = (vlan_tag << 4) | (vlan_tag >> 13) | | 2410 | vlan_tag = (vlan_tag << 4) | (vlan_tag >> 13) | |
2410 | ((vlan_tag >> 9) & 0x8); | 2411 | ((vlan_tag >> 9) & 0x8); |
2411 | ptpd->word3 |= 1 << TPD_INS_VL_TAG_SHIFT; | 2412 | ptpd->word3 |= 1 << TPD_INS_VL_TAG_SHIFT; |
2412 | ptpd->word3 |= (vlan_tag & TPD_VL_TAGGED_MASK) << | 2413 | ptpd->word2 |= (vlan_tag & TPD_VLANTAG_MASK) << |
2413 | TPD_VL_TAGGED_SHIFT; | 2414 | TPD_VLANTAG_SHIFT; |
2414 | } | 2415 | } |
2415 | 2416 | ||
2416 | tso = atl1_tso(adapter, skb, ptpd); | 2417 | tso = atl1_tso(adapter, skb, ptpd); |
diff --git a/drivers/net/atlx/atl1.h b/drivers/net/atlx/atl1.h index a5015b14a429..ffa73fc8d95e 100644 --- a/drivers/net/atlx/atl1.h +++ b/drivers/net/atlx/atl1.h | |||
@@ -504,7 +504,7 @@ struct rx_free_desc { | |||
504 | #define TPD_PKTNT_MASK 0x0001 | 504 | #define TPD_PKTNT_MASK 0x0001 |
505 | #define TPD_PKTINT_SHIFT 15 | 505 | #define TPD_PKTINT_SHIFT 15 |
506 | #define TPD_VLANTAG_MASK 0xFFFF | 506 | #define TPD_VLANTAG_MASK 0xFFFF |
507 | #define TPD_VLAN_SHIFT 16 | 507 | #define TPD_VLANTAG_SHIFT 16 |
508 | 508 | ||
509 | /* tpd word 3 bits 0:13 */ | 509 | /* tpd word 3 bits 0:13 */ |
510 | #define TPD_EOP_MASK 0x0001 | 510 | #define TPD_EOP_MASK 0x0001 |
diff --git a/drivers/net/ax88796.c b/drivers/net/ax88796.c index 4207d6efddc0..9a314d88e7b6 100644 --- a/drivers/net/ax88796.c +++ b/drivers/net/ax88796.c | |||
@@ -838,12 +838,12 @@ static int ax_probe(struct platform_device *pdev) | |||
838 | 838 | ||
839 | /* find the platform resources */ | 839 | /* find the platform resources */ |
840 | 840 | ||
841 | dev->irq = platform_get_irq(pdev, 0); | 841 | ret = platform_get_irq(pdev, 0); |
842 | if (dev->irq < 0) { | 842 | if (ret < 0) { |
843 | dev_err(&pdev->dev, "no IRQ specified\n"); | 843 | dev_err(&pdev->dev, "no IRQ specified\n"); |
844 | ret = -ENXIO; | ||
845 | goto exit_mem; | 844 | goto exit_mem; |
846 | } | 845 | } |
846 | dev->irq = ret; | ||
847 | 847 | ||
848 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 848 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
849 | if (res == NULL) { | 849 | if (res == NULL) { |
diff --git a/drivers/net/bnx2x_init.h b/drivers/net/bnx2x_init.h index 130927cfc75b..a6c0b3abba29 100644 --- a/drivers/net/bnx2x_init.h +++ b/drivers/net/bnx2x_init.h | |||
@@ -564,14 +564,15 @@ static const struct arb_line write_arb_addr[NUM_WR_Q-1] = { | |||
564 | 564 | ||
565 | static void bnx2x_init_pxp(struct bnx2x *bp) | 565 | static void bnx2x_init_pxp(struct bnx2x *bp) |
566 | { | 566 | { |
567 | u16 devctl; | ||
567 | int r_order, w_order; | 568 | int r_order, w_order; |
568 | u32 val, i; | 569 | u32 val, i; |
569 | 570 | ||
570 | pci_read_config_word(bp->pdev, | 571 | pci_read_config_word(bp->pdev, |
571 | bp->pcie_cap + PCI_EXP_DEVCTL, (u16 *)&val); | 572 | bp->pcie_cap + PCI_EXP_DEVCTL, &devctl); |
572 | DP(NETIF_MSG_HW, "read 0x%x from devctl\n", (u16)val); | 573 | DP(NETIF_MSG_HW, "read 0x%x from devctl\n", devctl); |
573 | w_order = ((val & PCI_EXP_DEVCTL_PAYLOAD) >> 5); | 574 | w_order = ((devctl & PCI_EXP_DEVCTL_PAYLOAD) >> 5); |
574 | r_order = ((val & PCI_EXP_DEVCTL_READRQ) >> 12); | 575 | r_order = ((devctl & PCI_EXP_DEVCTL_READRQ) >> 12); |
575 | 576 | ||
576 | if (r_order > MAX_RD_ORD) { | 577 | if (r_order > MAX_RD_ORD) { |
577 | DP(NETIF_MSG_HW, "read order of %d order adjusted to %d\n", | 578 | DP(NETIF_MSG_HW, "read order of %d order adjusted to %d\n", |
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index fce745148ff9..600210d7eff9 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -59,8 +59,8 @@ | |||
59 | #include "bnx2x.h" | 59 | #include "bnx2x.h" |
60 | #include "bnx2x_init.h" | 60 | #include "bnx2x_init.h" |
61 | 61 | ||
62 | #define DRV_MODULE_VERSION "1.45.22" | 62 | #define DRV_MODULE_VERSION "1.45.23" |
63 | #define DRV_MODULE_RELDATE "2008/09/09" | 63 | #define DRV_MODULE_RELDATE "2008/11/03" |
64 | #define BNX2X_BC_VER 0x040200 | 64 | #define BNX2X_BC_VER 0x040200 |
65 | 65 | ||
66 | /* Time in jiffies before concluding the transmitter is hung */ | 66 | /* Time in jiffies before concluding the transmitter is hung */ |
@@ -6481,6 +6481,7 @@ load_int_disable: | |||
6481 | bnx2x_free_irq(bp); | 6481 | bnx2x_free_irq(bp); |
6482 | load_error: | 6482 | load_error: |
6483 | bnx2x_free_mem(bp); | 6483 | bnx2x_free_mem(bp); |
6484 | bp->port.pmf = 0; | ||
6484 | 6485 | ||
6485 | /* TBD we really need to reset the chip | 6486 | /* TBD we really need to reset the chip |
6486 | if we want to recover from this */ | 6487 | if we want to recover from this */ |
@@ -6791,6 +6792,7 @@ unload_error: | |||
6791 | /* Report UNLOAD_DONE to MCP */ | 6792 | /* Report UNLOAD_DONE to MCP */ |
6792 | if (!BP_NOMCP(bp)) | 6793 | if (!BP_NOMCP(bp)) |
6793 | bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE); | 6794 | bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE); |
6795 | bp->port.pmf = 0; | ||
6794 | 6796 | ||
6795 | /* Free SKBs, SGEs, TPA pool and driver internals */ | 6797 | /* Free SKBs, SGEs, TPA pool and driver internals */ |
6796 | bnx2x_free_skbs(bp); | 6798 | bnx2x_free_skbs(bp); |
@@ -10204,8 +10206,6 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, | |||
10204 | return -ENOMEM; | 10206 | return -ENOMEM; |
10205 | } | 10207 | } |
10206 | 10208 | ||
10207 | netif_carrier_off(dev); | ||
10208 | |||
10209 | bp = netdev_priv(dev); | 10209 | bp = netdev_priv(dev); |
10210 | bp->msglevel = debug; | 10210 | bp->msglevel = debug; |
10211 | 10211 | ||
@@ -10229,6 +10229,8 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, | |||
10229 | goto init_one_exit; | 10229 | goto init_one_exit; |
10230 | } | 10230 | } |
10231 | 10231 | ||
10232 | netif_carrier_off(dev); | ||
10233 | |||
10232 | bp->common.name = board_info[ent->driver_data].name; | 10234 | bp->common.name = board_info[ent->driver_data].name; |
10233 | printk(KERN_INFO "%s: %s (%c%d) PCI-E x%d %s found at mem %lx," | 10235 | printk(KERN_INFO "%s: %s (%c%d) PCI-E x%d %s found at mem %lx," |
10234 | " IRQ %d, ", dev->name, bp->common.name, | 10236 | " IRQ %d, ", dev->name, bp->common.name, |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index ade5f3f6693b..87437c788476 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -169,11 +169,14 @@ static void tlb_clear_slave(struct bonding *bond, struct slave *slave, int save_ | |||
169 | /* clear slave from tx_hashtbl */ | 169 | /* clear slave from tx_hashtbl */ |
170 | tx_hash_table = BOND_ALB_INFO(bond).tx_hashtbl; | 170 | tx_hash_table = BOND_ALB_INFO(bond).tx_hashtbl; |
171 | 171 | ||
172 | index = SLAVE_TLB_INFO(slave).head; | 172 | /* skip this if we've already freed the tx hash table */ |
173 | while (index != TLB_NULL_INDEX) { | 173 | if (tx_hash_table) { |
174 | u32 next_index = tx_hash_table[index].next; | 174 | index = SLAVE_TLB_INFO(slave).head; |
175 | tlb_init_table_entry(&tx_hash_table[index], save_load); | 175 | while (index != TLB_NULL_INDEX) { |
176 | index = next_index; | 176 | u32 next_index = tx_hash_table[index].next; |
177 | tlb_init_table_entry(&tx_hash_table[index], save_load); | ||
178 | index = next_index; | ||
179 | } | ||
177 | } | 180 | } |
178 | 181 | ||
179 | tlb_init_slave(slave); | 182 | tlb_init_slave(slave); |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 8e2be24f3fe4..a3efba59eee9 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1341,18 +1341,24 @@ static int bond_compute_features(struct bonding *bond) | |||
1341 | int i; | 1341 | int i; |
1342 | 1342 | ||
1343 | features &= ~(NETIF_F_ALL_CSUM | BOND_VLAN_FEATURES); | 1343 | features &= ~(NETIF_F_ALL_CSUM | BOND_VLAN_FEATURES); |
1344 | features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA | | 1344 | features |= NETIF_F_GSO_MASK | NETIF_F_NO_CSUM; |
1345 | NETIF_F_GSO_MASK | NETIF_F_NO_CSUM; | 1345 | |
1346 | if (!bond->first_slave) | ||
1347 | goto done; | ||
1348 | |||
1349 | features &= ~NETIF_F_ONE_FOR_ALL; | ||
1346 | 1350 | ||
1347 | bond_for_each_slave(bond, slave, i) { | 1351 | bond_for_each_slave(bond, slave, i) { |
1348 | features = netdev_compute_features(features, | 1352 | features = netdev_increment_features(features, |
1349 | slave->dev->features); | 1353 | slave->dev->features, |
1354 | NETIF_F_ONE_FOR_ALL); | ||
1350 | if (slave->dev->hard_header_len > max_hard_header_len) | 1355 | if (slave->dev->hard_header_len > max_hard_header_len) |
1351 | max_hard_header_len = slave->dev->hard_header_len; | 1356 | max_hard_header_len = slave->dev->hard_header_len; |
1352 | } | 1357 | } |
1353 | 1358 | ||
1359 | done: | ||
1354 | features |= (bond_dev->features & BOND_VLAN_FEATURES); | 1360 | features |= (bond_dev->features & BOND_VLAN_FEATURES); |
1355 | bond_dev->features = features; | 1361 | bond_dev->features = netdev_fix_features(features, NULL); |
1356 | bond_dev->hard_header_len = max_hard_header_len; | 1362 | bond_dev->hard_header_len = max_hard_header_len; |
1357 | 1363 | ||
1358 | return 0; | 1364 | return 0; |
@@ -1973,6 +1979,20 @@ void bond_destroy(struct bonding *bond) | |||
1973 | unregister_netdevice(bond->dev); | 1979 | unregister_netdevice(bond->dev); |
1974 | } | 1980 | } |
1975 | 1981 | ||
1982 | static void bond_destructor(struct net_device *bond_dev) | ||
1983 | { | ||
1984 | struct bonding *bond = bond_dev->priv; | ||
1985 | |||
1986 | if (bond->wq) | ||
1987 | destroy_workqueue(bond->wq); | ||
1988 | |||
1989 | netif_addr_lock_bh(bond_dev); | ||
1990 | bond_mc_list_destroy(bond); | ||
1991 | netif_addr_unlock_bh(bond_dev); | ||
1992 | |||
1993 | free_netdev(bond_dev); | ||
1994 | } | ||
1995 | |||
1976 | /* | 1996 | /* |
1977 | * First release a slave and than destroy the bond if no more slaves iare left. | 1997 | * First release a slave and than destroy the bond if no more slaves iare left. |
1978 | * Must be under rtnl_lock when this function is called. | 1998 | * Must be under rtnl_lock when this function is called. |
@@ -2370,6 +2390,9 @@ static void bond_miimon_commit(struct bonding *bond) | |||
2370 | continue; | 2390 | continue; |
2371 | 2391 | ||
2372 | case BOND_LINK_DOWN: | 2392 | case BOND_LINK_DOWN: |
2393 | if (slave->link_failure_count < UINT_MAX) | ||
2394 | slave->link_failure_count++; | ||
2395 | |||
2373 | slave->link = BOND_LINK_DOWN; | 2396 | slave->link = BOND_LINK_DOWN; |
2374 | 2397 | ||
2375 | if (bond->params.mode == BOND_MODE_ACTIVEBACKUP || | 2398 | if (bond->params.mode == BOND_MODE_ACTIVEBACKUP || |
@@ -4544,7 +4567,7 @@ static int bond_init(struct net_device *bond_dev, struct bond_params *params) | |||
4544 | 4567 | ||
4545 | bond_set_mode_ops(bond, bond->params.mode); | 4568 | bond_set_mode_ops(bond, bond->params.mode); |
4546 | 4569 | ||
4547 | bond_dev->destructor = free_netdev; | 4570 | bond_dev->destructor = bond_destructor; |
4548 | 4571 | ||
4549 | /* Initialize the device options */ | 4572 | /* Initialize the device options */ |
4550 | bond_dev->tx_queue_len = 0; | 4573 | bond_dev->tx_queue_len = 0; |
@@ -4583,20 +4606,6 @@ static int bond_init(struct net_device *bond_dev, struct bond_params *params) | |||
4583 | return 0; | 4606 | return 0; |
4584 | } | 4607 | } |
4585 | 4608 | ||
4586 | /* De-initialize device specific data. | ||
4587 | * Caller must hold rtnl_lock. | ||
4588 | */ | ||
4589 | static void bond_deinit(struct net_device *bond_dev) | ||
4590 | { | ||
4591 | struct bonding *bond = bond_dev->priv; | ||
4592 | |||
4593 | list_del(&bond->bond_list); | ||
4594 | |||
4595 | #ifdef CONFIG_PROC_FS | ||
4596 | bond_remove_proc_entry(bond); | ||
4597 | #endif | ||
4598 | } | ||
4599 | |||
4600 | static void bond_work_cancel_all(struct bonding *bond) | 4609 | static void bond_work_cancel_all(struct bonding *bond) |
4601 | { | 4610 | { |
4602 | write_lock_bh(&bond->lock); | 4611 | write_lock_bh(&bond->lock); |
@@ -4618,6 +4627,22 @@ static void bond_work_cancel_all(struct bonding *bond) | |||
4618 | cancel_delayed_work(&bond->ad_work); | 4627 | cancel_delayed_work(&bond->ad_work); |
4619 | } | 4628 | } |
4620 | 4629 | ||
4630 | /* De-initialize device specific data. | ||
4631 | * Caller must hold rtnl_lock. | ||
4632 | */ | ||
4633 | static void bond_deinit(struct net_device *bond_dev) | ||
4634 | { | ||
4635 | struct bonding *bond = bond_dev->priv; | ||
4636 | |||
4637 | list_del(&bond->bond_list); | ||
4638 | |||
4639 | bond_work_cancel_all(bond); | ||
4640 | |||
4641 | #ifdef CONFIG_PROC_FS | ||
4642 | bond_remove_proc_entry(bond); | ||
4643 | #endif | ||
4644 | } | ||
4645 | |||
4621 | /* Unregister and free all bond devices. | 4646 | /* Unregister and free all bond devices. |
4622 | * Caller must hold rtnl_lock. | 4647 | * Caller must hold rtnl_lock. |
4623 | */ | 4648 | */ |
@@ -4629,9 +4654,6 @@ static void bond_free_all(void) | |||
4629 | struct net_device *bond_dev = bond->dev; | 4654 | struct net_device *bond_dev = bond->dev; |
4630 | 4655 | ||
4631 | bond_work_cancel_all(bond); | 4656 | bond_work_cancel_all(bond); |
4632 | netif_addr_lock_bh(bond_dev); | ||
4633 | bond_mc_list_destroy(bond); | ||
4634 | netif_addr_unlock_bh(bond_dev); | ||
4635 | /* Release the bonded slaves */ | 4657 | /* Release the bonded slaves */ |
4636 | bond_release_all(bond_dev); | 4658 | bond_release_all(bond_dev); |
4637 | bond_destroy(bond); | 4659 | bond_destroy(bond); |
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c index 65d0a9103297..7e8a63106bdf 100644 --- a/drivers/net/cris/eth_v10.c +++ b/drivers/net/cris/eth_v10.c | |||
@@ -32,14 +32,14 @@ | |||
32 | #include <linux/skbuff.h> | 32 | #include <linux/skbuff.h> |
33 | #include <linux/ethtool.h> | 33 | #include <linux/ethtool.h> |
34 | 34 | ||
35 | #include <asm/arch/svinto.h>/* DMA and register descriptions */ | 35 | #include <arch/svinto.h>/* DMA and register descriptions */ |
36 | #include <asm/io.h> /* CRIS_LED_* I/O functions */ | 36 | #include <asm/io.h> /* CRIS_LED_* I/O functions */ |
37 | #include <asm/irq.h> | 37 | #include <asm/irq.h> |
38 | #include <asm/dma.h> | 38 | #include <asm/dma.h> |
39 | #include <asm/system.h> | 39 | #include <asm/system.h> |
40 | #include <asm/ethernet.h> | 40 | #include <asm/ethernet.h> |
41 | #include <asm/cache.h> | 41 | #include <asm/cache.h> |
42 | #include <asm/arch/io_interface_mux.h> | 42 | #include <arch/io_interface_mux.h> |
43 | 43 | ||
44 | //#define ETHDEBUG | 44 | //#define ETHDEBUG |
45 | #define D(x) | 45 | #define D(x) |
diff --git a/drivers/net/cxgb3/l2t.c b/drivers/net/cxgb3/l2t.c index 4407ac9bb555..ff1611f90e7a 100644 --- a/drivers/net/cxgb3/l2t.c +++ b/drivers/net/cxgb3/l2t.c | |||
@@ -431,6 +431,7 @@ struct l2t_data *t3_init_l2t(unsigned int l2t_capacity) | |||
431 | for (i = 0; i < l2t_capacity; ++i) { | 431 | for (i = 0; i < l2t_capacity; ++i) { |
432 | d->l2tab[i].idx = i; | 432 | d->l2tab[i].idx = i; |
433 | d->l2tab[i].state = L2T_STATE_UNUSED; | 433 | d->l2tab[i].state = L2T_STATE_UNUSED; |
434 | __skb_queue_head_init(&d->l2tab[i].arpq); | ||
434 | spin_lock_init(&d->l2tab[i].lock); | 435 | spin_lock_init(&d->l2tab[i].lock); |
435 | atomic_set(&d->l2tab[i].refcnt, 0); | 436 | atomic_set(&d->l2tab[i].refcnt, 0); |
436 | } | 437 | } |
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index f42c23f42652..5a9083e3f443 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
@@ -47,15 +47,6 @@ | |||
47 | #define CARDNAME "dm9000" | 47 | #define CARDNAME "dm9000" |
48 | #define DRV_VERSION "1.31" | 48 | #define DRV_VERSION "1.31" |
49 | 49 | ||
50 | #ifdef CONFIG_BLACKFIN | ||
51 | #define readsb insb | ||
52 | #define readsw insw | ||
53 | #define readsl insl | ||
54 | #define writesb outsb | ||
55 | #define writesw outsw | ||
56 | #define writesl outsl | ||
57 | #endif | ||
58 | |||
59 | /* | 50 | /* |
60 | * Transmit timeout, default 5 seconds. | 51 | * Transmit timeout, default 5 seconds. |
61 | */ | 52 | */ |
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h index 5524271eedca..002d918fb4c7 100644 --- a/drivers/net/ehea/ehea.h +++ b/drivers/net/ehea/ehea.h | |||
@@ -40,7 +40,7 @@ | |||
40 | #include <asm/io.h> | 40 | #include <asm/io.h> |
41 | 41 | ||
42 | #define DRV_NAME "ehea" | 42 | #define DRV_NAME "ehea" |
43 | #define DRV_VERSION "EHEA_0093" | 43 | #define DRV_VERSION "EHEA_0095" |
44 | 44 | ||
45 | /* eHEA capability flags */ | 45 | /* eHEA capability flags */ |
46 | #define DLPAR_PORT_ADD_REM 1 | 46 | #define DLPAR_PORT_ADD_REM 1 |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index b70c5314f537..422fcb93e2c3 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -2863,7 +2863,7 @@ static void ehea_rereg_mrs(struct work_struct *work) | |||
2863 | struct ehea_adapter *adapter; | 2863 | struct ehea_adapter *adapter; |
2864 | 2864 | ||
2865 | mutex_lock(&dlpar_mem_lock); | 2865 | mutex_lock(&dlpar_mem_lock); |
2866 | ehea_info("LPAR memory enlarged - re-initializing driver"); | 2866 | ehea_info("LPAR memory changed - re-initializing driver"); |
2867 | 2867 | ||
2868 | list_for_each_entry(adapter, &adapter_list, list) | 2868 | list_for_each_entry(adapter, &adapter_list, list) |
2869 | if (adapter->active_ports) { | 2869 | if (adapter->active_ports) { |
@@ -2900,13 +2900,6 @@ static void ehea_rereg_mrs(struct work_struct *work) | |||
2900 | } | 2900 | } |
2901 | } | 2901 | } |
2902 | 2902 | ||
2903 | ehea_destroy_busmap(); | ||
2904 | ret = ehea_create_busmap(); | ||
2905 | if (ret) { | ||
2906 | ehea_error("creating ehea busmap failed"); | ||
2907 | goto out; | ||
2908 | } | ||
2909 | |||
2910 | clear_bit(__EHEA_STOP_XFER, &ehea_driver_flags); | 2903 | clear_bit(__EHEA_STOP_XFER, &ehea_driver_flags); |
2911 | 2904 | ||
2912 | list_for_each_entry(adapter, &adapter_list, list) | 2905 | list_for_each_entry(adapter, &adapter_list, list) |
@@ -3519,9 +3512,21 @@ void ehea_crash_handler(void) | |||
3519 | static int ehea_mem_notifier(struct notifier_block *nb, | 3512 | static int ehea_mem_notifier(struct notifier_block *nb, |
3520 | unsigned long action, void *data) | 3513 | unsigned long action, void *data) |
3521 | { | 3514 | { |
3515 | struct memory_notify *arg = data; | ||
3522 | switch (action) { | 3516 | switch (action) { |
3523 | case MEM_OFFLINE: | 3517 | case MEM_CANCEL_OFFLINE: |
3524 | ehea_info("memory has been removed"); | 3518 | ehea_info("memory offlining canceled"); |
3519 | /* Readd canceled memory block */ | ||
3520 | case MEM_ONLINE: | ||
3521 | ehea_info("memory is going online"); | ||
3522 | if (ehea_add_sect_bmap(arg->start_pfn, arg->nr_pages)) | ||
3523 | return NOTIFY_BAD; | ||
3524 | ehea_rereg_mrs(NULL); | ||
3525 | break; | ||
3526 | case MEM_GOING_OFFLINE: | ||
3527 | ehea_info("memory is going offline"); | ||
3528 | if (ehea_rem_sect_bmap(arg->start_pfn, arg->nr_pages)) | ||
3529 | return NOTIFY_BAD; | ||
3525 | ehea_rereg_mrs(NULL); | 3530 | ehea_rereg_mrs(NULL); |
3526 | break; | 3531 | break; |
3527 | default: | 3532 | default: |
diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c index db8a9257e680..9d006878f045 100644 --- a/drivers/net/ehea/ehea_qmr.c +++ b/drivers/net/ehea/ehea_qmr.c | |||
@@ -567,7 +567,7 @@ static inline int ehea_calc_index(unsigned long i, unsigned long s) | |||
567 | static inline int ehea_init_top_bmap(struct ehea_top_bmap *ehea_top_bmap, | 567 | static inline int ehea_init_top_bmap(struct ehea_top_bmap *ehea_top_bmap, |
568 | int dir) | 568 | int dir) |
569 | { | 569 | { |
570 | if(!ehea_top_bmap->dir[dir]) { | 570 | if (!ehea_top_bmap->dir[dir]) { |
571 | ehea_top_bmap->dir[dir] = | 571 | ehea_top_bmap->dir[dir] = |
572 | kzalloc(sizeof(struct ehea_dir_bmap), GFP_KERNEL); | 572 | kzalloc(sizeof(struct ehea_dir_bmap), GFP_KERNEL); |
573 | if (!ehea_top_bmap->dir[dir]) | 573 | if (!ehea_top_bmap->dir[dir]) |
@@ -578,7 +578,7 @@ static inline int ehea_init_top_bmap(struct ehea_top_bmap *ehea_top_bmap, | |||
578 | 578 | ||
579 | static inline int ehea_init_bmap(struct ehea_bmap *ehea_bmap, int top, int dir) | 579 | static inline int ehea_init_bmap(struct ehea_bmap *ehea_bmap, int top, int dir) |
580 | { | 580 | { |
581 | if(!ehea_bmap->top[top]) { | 581 | if (!ehea_bmap->top[top]) { |
582 | ehea_bmap->top[top] = | 582 | ehea_bmap->top[top] = |
583 | kzalloc(sizeof(struct ehea_top_bmap), GFP_KERNEL); | 583 | kzalloc(sizeof(struct ehea_top_bmap), GFP_KERNEL); |
584 | if (!ehea_bmap->top[top]) | 584 | if (!ehea_bmap->top[top]) |
@@ -587,53 +587,171 @@ static inline int ehea_init_bmap(struct ehea_bmap *ehea_bmap, int top, int dir) | |||
587 | return ehea_init_top_bmap(ehea_bmap->top[top], dir); | 587 | return ehea_init_top_bmap(ehea_bmap->top[top], dir); |
588 | } | 588 | } |
589 | 589 | ||
590 | static int ehea_create_busmap_callback(unsigned long pfn, | 590 | static DEFINE_MUTEX(ehea_busmap_mutex); |
591 | unsigned long nr_pages, void *arg) | 591 | static unsigned long ehea_mr_len; |
592 | |||
593 | #define EHEA_BUSMAP_ADD_SECT 1 | ||
594 | #define EHEA_BUSMAP_REM_SECT 0 | ||
595 | |||
596 | static void ehea_rebuild_busmap(void) | ||
592 | { | 597 | { |
593 | unsigned long i, mr_len, start_section, end_section; | 598 | u64 vaddr = EHEA_BUSMAP_START; |
594 | start_section = (pfn * PAGE_SIZE) / EHEA_SECTSIZE; | 599 | int top, dir, idx; |
595 | end_section = start_section + ((nr_pages * PAGE_SIZE) / EHEA_SECTSIZE); | ||
596 | mr_len = *(unsigned long *)arg; | ||
597 | 600 | ||
598 | if (!ehea_bmap) | 601 | for (top = 0; top < EHEA_MAP_ENTRIES; top++) { |
599 | ehea_bmap = kzalloc(sizeof(struct ehea_bmap), GFP_KERNEL); | 602 | struct ehea_top_bmap *ehea_top; |
600 | if (!ehea_bmap) | 603 | int valid_dir_entries = 0; |
601 | return -ENOMEM; | ||
602 | 604 | ||
603 | for (i = start_section; i < end_section; i++) { | 605 | if (!ehea_bmap->top[top]) |
604 | int ret; | 606 | continue; |
605 | int top, dir, idx; | 607 | ehea_top = ehea_bmap->top[top]; |
606 | u64 vaddr; | 608 | for (dir = 0; dir < EHEA_MAP_ENTRIES; dir++) { |
609 | struct ehea_dir_bmap *ehea_dir; | ||
610 | int valid_entries = 0; | ||
607 | 611 | ||
608 | top = ehea_calc_index(i, EHEA_TOP_INDEX_SHIFT); | 612 | if (!ehea_top->dir[dir]) |
609 | dir = ehea_calc_index(i, EHEA_DIR_INDEX_SHIFT); | 613 | continue; |
614 | valid_dir_entries++; | ||
615 | ehea_dir = ehea_top->dir[dir]; | ||
616 | for (idx = 0; idx < EHEA_MAP_ENTRIES; idx++) { | ||
617 | if (!ehea_dir->ent[idx]) | ||
618 | continue; | ||
619 | valid_entries++; | ||
620 | ehea_dir->ent[idx] = vaddr; | ||
621 | vaddr += EHEA_SECTSIZE; | ||
622 | } | ||
623 | if (!valid_entries) { | ||
624 | ehea_top->dir[dir] = NULL; | ||
625 | kfree(ehea_dir); | ||
626 | } | ||
627 | } | ||
628 | if (!valid_dir_entries) { | ||
629 | ehea_bmap->top[top] = NULL; | ||
630 | kfree(ehea_top); | ||
631 | } | ||
632 | } | ||
633 | } | ||
610 | 634 | ||
611 | ret = ehea_init_bmap(ehea_bmap, top, dir); | 635 | static int ehea_update_busmap(unsigned long pfn, unsigned long nr_pages, int add) |
612 | if(ret) | 636 | { |
613 | return ret; | 637 | unsigned long i, start_section, end_section; |
614 | 638 | ||
615 | idx = i & EHEA_INDEX_MASK; | 639 | if (!nr_pages) |
616 | vaddr = EHEA_BUSMAP_START + mr_len + i * EHEA_SECTSIZE; | 640 | return 0; |
617 | 641 | ||
618 | ehea_bmap->top[top]->dir[dir]->ent[idx] = vaddr; | 642 | if (!ehea_bmap) { |
643 | ehea_bmap = kzalloc(sizeof(struct ehea_bmap), GFP_KERNEL); | ||
644 | if (!ehea_bmap) | ||
645 | return -ENOMEM; | ||
619 | } | 646 | } |
620 | 647 | ||
621 | mr_len += nr_pages * PAGE_SIZE; | 648 | start_section = (pfn * PAGE_SIZE) / EHEA_SECTSIZE; |
622 | *(unsigned long *)arg = mr_len; | 649 | end_section = start_section + ((nr_pages * PAGE_SIZE) / EHEA_SECTSIZE); |
650 | /* Mark entries as valid or invalid only; address is assigned later */ | ||
651 | for (i = start_section; i < end_section; i++) { | ||
652 | u64 flag; | ||
653 | int top = ehea_calc_index(i, EHEA_TOP_INDEX_SHIFT); | ||
654 | int dir = ehea_calc_index(i, EHEA_DIR_INDEX_SHIFT); | ||
655 | int idx = i & EHEA_INDEX_MASK; | ||
656 | |||
657 | if (add) { | ||
658 | int ret = ehea_init_bmap(ehea_bmap, top, dir); | ||
659 | if (ret) | ||
660 | return ret; | ||
661 | flag = 1; /* valid */ | ||
662 | ehea_mr_len += EHEA_SECTSIZE; | ||
663 | } else { | ||
664 | if (!ehea_bmap->top[top]) | ||
665 | continue; | ||
666 | if (!ehea_bmap->top[top]->dir[dir]) | ||
667 | continue; | ||
668 | flag = 0; /* invalid */ | ||
669 | ehea_mr_len -= EHEA_SECTSIZE; | ||
670 | } | ||
623 | 671 | ||
672 | ehea_bmap->top[top]->dir[dir]->ent[idx] = flag; | ||
673 | } | ||
674 | ehea_rebuild_busmap(); /* Assign contiguous addresses for mr */ | ||
624 | return 0; | 675 | return 0; |
625 | } | 676 | } |
626 | 677 | ||
627 | static unsigned long ehea_mr_len; | 678 | int ehea_add_sect_bmap(unsigned long pfn, unsigned long nr_pages) |
679 | { | ||
680 | int ret; | ||
628 | 681 | ||
629 | static DEFINE_MUTEX(ehea_busmap_mutex); | 682 | mutex_lock(&ehea_busmap_mutex); |
683 | ret = ehea_update_busmap(pfn, nr_pages, EHEA_BUSMAP_ADD_SECT); | ||
684 | mutex_unlock(&ehea_busmap_mutex); | ||
685 | return ret; | ||
686 | } | ||
687 | |||
688 | int ehea_rem_sect_bmap(unsigned long pfn, unsigned long nr_pages) | ||
689 | { | ||
690 | int ret; | ||
691 | |||
692 | mutex_lock(&ehea_busmap_mutex); | ||
693 | ret = ehea_update_busmap(pfn, nr_pages, EHEA_BUSMAP_REM_SECT); | ||
694 | mutex_unlock(&ehea_busmap_mutex); | ||
695 | return ret; | ||
696 | } | ||
697 | |||
698 | static int ehea_is_hugepage(unsigned long pfn) | ||
699 | { | ||
700 | int page_order; | ||
701 | |||
702 | if (pfn & EHEA_HUGEPAGE_PFN_MASK) | ||
703 | return 0; | ||
704 | |||
705 | page_order = compound_order(pfn_to_page(pfn)); | ||
706 | if (page_order + PAGE_SHIFT != EHEA_HUGEPAGESHIFT) | ||
707 | return 0; | ||
708 | |||
709 | return 1; | ||
710 | } | ||
711 | |||
712 | static int ehea_create_busmap_callback(unsigned long initial_pfn, | ||
713 | unsigned long total_nr_pages, void *arg) | ||
714 | { | ||
715 | int ret; | ||
716 | unsigned long pfn, start_pfn, end_pfn, nr_pages; | ||
717 | |||
718 | if ((total_nr_pages * PAGE_SIZE) < EHEA_HUGEPAGE_SIZE) | ||
719 | return ehea_update_busmap(initial_pfn, total_nr_pages, | ||
720 | EHEA_BUSMAP_ADD_SECT); | ||
721 | |||
722 | /* Given chunk is >= 16GB -> check for hugepages */ | ||
723 | start_pfn = initial_pfn; | ||
724 | end_pfn = initial_pfn + total_nr_pages; | ||
725 | pfn = start_pfn; | ||
726 | |||
727 | while (pfn < end_pfn) { | ||
728 | if (ehea_is_hugepage(pfn)) { | ||
729 | /* Add mem found in front of the hugepage */ | ||
730 | nr_pages = pfn - start_pfn; | ||
731 | ret = ehea_update_busmap(start_pfn, nr_pages, | ||
732 | EHEA_BUSMAP_ADD_SECT); | ||
733 | if (ret) | ||
734 | return ret; | ||
735 | |||
736 | /* Skip the hugepage */ | ||
737 | pfn += (EHEA_HUGEPAGE_SIZE / PAGE_SIZE); | ||
738 | start_pfn = pfn; | ||
739 | } else | ||
740 | pfn += (EHEA_SECTSIZE / PAGE_SIZE); | ||
741 | } | ||
742 | |||
743 | /* Add mem found behind the hugepage(s) */ | ||
744 | nr_pages = pfn - start_pfn; | ||
745 | return ehea_update_busmap(start_pfn, nr_pages, EHEA_BUSMAP_ADD_SECT); | ||
746 | } | ||
630 | 747 | ||
631 | int ehea_create_busmap(void) | 748 | int ehea_create_busmap(void) |
632 | { | 749 | { |
633 | int ret; | 750 | int ret; |
751 | |||
634 | mutex_lock(&ehea_busmap_mutex); | 752 | mutex_lock(&ehea_busmap_mutex); |
635 | ehea_mr_len = 0; | 753 | ehea_mr_len = 0; |
636 | ret = walk_memory_resource(0, 1ULL << MAX_PHYSMEM_BITS, &ehea_mr_len, | 754 | ret = walk_memory_resource(0, 1ULL << MAX_PHYSMEM_BITS, NULL, |
637 | ehea_create_busmap_callback); | 755 | ehea_create_busmap_callback); |
638 | mutex_unlock(&ehea_busmap_mutex); | 756 | mutex_unlock(&ehea_busmap_mutex); |
639 | return ret; | 757 | return ret; |
diff --git a/drivers/net/ehea/ehea_qmr.h b/drivers/net/ehea/ehea_qmr.h index 0bb6f92fa2f8..0817c1e74a19 100644 --- a/drivers/net/ehea/ehea_qmr.h +++ b/drivers/net/ehea/ehea_qmr.h | |||
@@ -40,6 +40,9 @@ | |||
40 | #define EHEA_PAGESIZE (1UL << EHEA_PAGESHIFT) | 40 | #define EHEA_PAGESIZE (1UL << EHEA_PAGESHIFT) |
41 | #define EHEA_SECTSIZE (1UL << 24) | 41 | #define EHEA_SECTSIZE (1UL << 24) |
42 | #define EHEA_PAGES_PER_SECTION (EHEA_SECTSIZE >> EHEA_PAGESHIFT) | 42 | #define EHEA_PAGES_PER_SECTION (EHEA_SECTSIZE >> EHEA_PAGESHIFT) |
43 | #define EHEA_HUGEPAGESHIFT 34 | ||
44 | #define EHEA_HUGEPAGE_SIZE (1UL << EHEA_HUGEPAGESHIFT) | ||
45 | #define EHEA_HUGEPAGE_PFN_MASK ((EHEA_HUGEPAGE_SIZE - 1) >> PAGE_SHIFT) | ||
43 | 46 | ||
44 | #if ((1UL << SECTION_SIZE_BITS) < EHEA_SECTSIZE) | 47 | #if ((1UL << SECTION_SIZE_BITS) < EHEA_SECTSIZE) |
45 | #error eHEA module cannot work if kernel sectionsize < ehea sectionsize | 48 | #error eHEA module cannot work if kernel sectionsize < ehea sectionsize |
@@ -378,6 +381,8 @@ int ehea_rem_mr(struct ehea_mr *mr); | |||
378 | 381 | ||
379 | void ehea_error_data(struct ehea_adapter *adapter, u64 res_handle); | 382 | void ehea_error_data(struct ehea_adapter *adapter, u64 res_handle); |
380 | 383 | ||
384 | int ehea_add_sect_bmap(unsigned long pfn, unsigned long nr_pages); | ||
385 | int ehea_rem_sect_bmap(unsigned long pfn, unsigned long nr_pages); | ||
381 | int ehea_create_busmap(void); | 386 | int ehea_create_busmap(void); |
382 | void ehea_destroy_busmap(void); | 387 | void ehea_destroy_busmap(void); |
383 | u64 ehea_map_vaddr(void *caddr); | 388 | u64 ehea_map_vaddr(void *caddr); |
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c index 4e4f68304e82..aec3b97e794d 100644 --- a/drivers/net/fec_mpc52xx.c +++ b/drivers/net/fec_mpc52xx.c | |||
@@ -401,6 +401,21 @@ static int mpc52xx_fec_hard_start_xmit(struct sk_buff *skb, struct net_device *d | |||
401 | return 0; | 401 | return 0; |
402 | } | 402 | } |
403 | 403 | ||
404 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
405 | static void mpc52xx_fec_poll_controller(struct net_device *dev) | ||
406 | { | ||
407 | struct mpc52xx_fec_priv *priv = netdev_priv(dev); | ||
408 | |||
409 | disable_irq(priv->t_irq); | ||
410 | mpc52xx_fec_tx_interrupt(priv->t_irq, dev); | ||
411 | enable_irq(priv->t_irq); | ||
412 | disable_irq(priv->r_irq); | ||
413 | mpc52xx_fec_rx_interrupt(priv->r_irq, dev); | ||
414 | enable_irq(priv->r_irq); | ||
415 | } | ||
416 | #endif | ||
417 | |||
418 | |||
404 | /* This handles BestComm transmit task interrupts | 419 | /* This handles BestComm transmit task interrupts |
405 | */ | 420 | */ |
406 | static irqreturn_t mpc52xx_fec_tx_interrupt(int irq, void *dev_id) | 421 | static irqreturn_t mpc52xx_fec_tx_interrupt(int irq, void *dev_id) |
@@ -926,6 +941,9 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match) | |||
926 | ndev->tx_timeout = mpc52xx_fec_tx_timeout; | 941 | ndev->tx_timeout = mpc52xx_fec_tx_timeout; |
927 | ndev->watchdog_timeo = FEC_WATCHDOG_TIMEOUT; | 942 | ndev->watchdog_timeo = FEC_WATCHDOG_TIMEOUT; |
928 | ndev->base_addr = mem.start; | 943 | ndev->base_addr = mem.start; |
944 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
945 | ndev->poll_controller = mpc52xx_fec_poll_controller; | ||
946 | #endif | ||
929 | 947 | ||
930 | priv->t_irq = priv->r_irq = ndev->irq = NO_IRQ; /* IRQ are free for now */ | 948 | priv->t_irq = priv->r_irq = ndev->irq = NO_IRQ; /* IRQ are free for now */ |
931 | 949 | ||
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index cb51c1fb0338..a6f49d025787 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c | |||
@@ -1099,7 +1099,9 @@ static int __devinit fs_enet_probe(struct of_device *ofdev, | |||
1099 | ndev->stop = fs_enet_close; | 1099 | ndev->stop = fs_enet_close; |
1100 | ndev->get_stats = fs_enet_get_stats; | 1100 | ndev->get_stats = fs_enet_get_stats; |
1101 | ndev->set_multicast_list = fs_set_multicast_list; | 1101 | ndev->set_multicast_list = fs_set_multicast_list; |
1102 | 1102 | #ifdef CONFIG_NET_POLL_CONTROLLER | |
1103 | ndev->poll_controller = fs_enet_netpoll; | ||
1104 | #endif | ||
1103 | if (fpi->use_napi) | 1105 | if (fpi->use_napi) |
1104 | netif_napi_add(ndev, &fep->napi, fs_enet_rx_napi, | 1106 | netif_napi_add(ndev, &fep->napi, fs_enet_rx_napi, |
1105 | fpi->napi_weight); | 1107 | fpi->napi_weight); |
@@ -1209,7 +1211,7 @@ static void __exit fs_cleanup(void) | |||
1209 | static void fs_enet_netpoll(struct net_device *dev) | 1211 | static void fs_enet_netpoll(struct net_device *dev) |
1210 | { | 1212 | { |
1211 | disable_irq(dev->irq); | 1213 | disable_irq(dev->irq); |
1212 | fs_enet_interrupt(dev->irq, dev, NULL); | 1214 | fs_enet_interrupt(dev->irq, dev); |
1213 | enable_irq(dev->irq); | 1215 | enable_irq(dev->irq); |
1214 | } | 1216 | } |
1215 | #endif | 1217 | #endif |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index b5bb7ae2817f..83a5cb6aa23b 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -161,7 +161,7 @@ static int gfar_probe(struct platform_device *pdev) | |||
161 | struct gfar_private *priv = NULL; | 161 | struct gfar_private *priv = NULL; |
162 | struct gianfar_platform_data *einfo; | 162 | struct gianfar_platform_data *einfo; |
163 | struct resource *r; | 163 | struct resource *r; |
164 | int err = 0; | 164 | int err = 0, irq; |
165 | DECLARE_MAC_BUF(mac); | 165 | DECLARE_MAC_BUF(mac); |
166 | 166 | ||
167 | einfo = (struct gianfar_platform_data *) pdev->dev.platform_data; | 167 | einfo = (struct gianfar_platform_data *) pdev->dev.platform_data; |
@@ -187,15 +187,25 @@ static int gfar_probe(struct platform_device *pdev) | |||
187 | 187 | ||
188 | /* fill out IRQ fields */ | 188 | /* fill out IRQ fields */ |
189 | if (einfo->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) { | 189 | if (einfo->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) { |
190 | priv->interruptTransmit = platform_get_irq_byname(pdev, "tx"); | 190 | irq = platform_get_irq_byname(pdev, "tx"); |
191 | priv->interruptReceive = platform_get_irq_byname(pdev, "rx"); | 191 | if (irq < 0) |
192 | priv->interruptError = platform_get_irq_byname(pdev, "error"); | 192 | goto regs_fail; |
193 | if (priv->interruptTransmit < 0 || priv->interruptReceive < 0 || priv->interruptError < 0) | 193 | priv->interruptTransmit = irq; |
194 | |||
195 | irq = platform_get_irq_byname(pdev, "rx"); | ||
196 | if (irq < 0) | ||
197 | goto regs_fail; | ||
198 | priv->interruptReceive = irq; | ||
199 | |||
200 | irq = platform_get_irq_byname(pdev, "error"); | ||
201 | if (irq < 0) | ||
194 | goto regs_fail; | 202 | goto regs_fail; |
203 | priv->interruptError = irq; | ||
195 | } else { | 204 | } else { |
196 | priv->interruptTransmit = platform_get_irq(pdev, 0); | 205 | irq = platform_get_irq(pdev, 0); |
197 | if (priv->interruptTransmit < 0) | 206 | if (irq < 0) |
198 | goto regs_fail; | 207 | goto regs_fail; |
208 | priv->interruptTransmit = irq; | ||
199 | } | 209 | } |
200 | 210 | ||
201 | /* get a pointer to the register memory */ | 211 | /* get a pointer to the register memory */ |
@@ -576,6 +586,18 @@ static void gfar_configure_serdes(struct net_device *dev) | |||
576 | struct gfar_mii __iomem *regs = | 586 | struct gfar_mii __iomem *regs = |
577 | (void __iomem *)&priv->regs->gfar_mii_regs; | 587 | (void __iomem *)&priv->regs->gfar_mii_regs; |
578 | int tbipa = gfar_read(&priv->regs->tbipa); | 588 | int tbipa = gfar_read(&priv->regs->tbipa); |
589 | struct mii_bus *bus = gfar_get_miibus(priv); | ||
590 | |||
591 | if (bus) | ||
592 | mutex_lock(&bus->mdio_lock); | ||
593 | |||
594 | /* If the link is already up, we must already be ok, and don't need to | ||
595 | * configure and reset the TBI<->SerDes link. Maybe U-Boot configured | ||
596 | * everything for us? Resetting it takes the link down and requires | ||
597 | * several seconds for it to come back. | ||
598 | */ | ||
599 | if (gfar_local_mdio_read(regs, tbipa, MII_BMSR) & BMSR_LSTATUS) | ||
600 | goto done; | ||
579 | 601 | ||
580 | /* Single clk mode, mii mode off(for serdes communication) */ | 602 | /* Single clk mode, mii mode off(for serdes communication) */ |
581 | gfar_local_mdio_write(regs, tbipa, MII_TBICON, TBICON_CLK_SELECT); | 603 | gfar_local_mdio_write(regs, tbipa, MII_TBICON, TBICON_CLK_SELECT); |
@@ -586,6 +608,10 @@ static void gfar_configure_serdes(struct net_device *dev) | |||
586 | 608 | ||
587 | gfar_local_mdio_write(regs, tbipa, MII_BMCR, BMCR_ANENABLE | | 609 | gfar_local_mdio_write(regs, tbipa, MII_BMCR, BMCR_ANENABLE | |
588 | BMCR_ANRESTART | BMCR_FULLDPLX | BMCR_SPEED1000); | 610 | BMCR_ANRESTART | BMCR_FULLDPLX | BMCR_SPEED1000); |
611 | |||
612 | done: | ||
613 | if (bus) | ||
614 | mutex_unlock(&bus->mdio_lock); | ||
589 | } | 615 | } |
590 | 616 | ||
591 | static void init_registers(struct net_device *dev) | 617 | static void init_registers(struct net_device *dev) |
diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c index bf73eea98010..0e2595d24933 100644 --- a/drivers/net/gianfar_mii.c +++ b/drivers/net/gianfar_mii.c | |||
@@ -269,6 +269,27 @@ static struct device_driver gianfar_mdio_driver = { | |||
269 | .remove = gfar_mdio_remove, | 269 | .remove = gfar_mdio_remove, |
270 | }; | 270 | }; |
271 | 271 | ||
272 | static int match_mdio_bus(struct device *dev, void *data) | ||
273 | { | ||
274 | const struct gfar_private *priv = data; | ||
275 | const struct platform_device *pdev = to_platform_device(dev); | ||
276 | |||
277 | return !strcmp(pdev->name, gianfar_mdio_driver.name) && | ||
278 | pdev->id == priv->einfo->mdio_bus; | ||
279 | } | ||
280 | |||
281 | /* Given a gfar_priv structure, find the mii_bus controlled by this device (not | ||
282 | * necessarily the same as the bus the gfar's PHY is on), if one exists. | ||
283 | * Normally only the first gianfar controls a mii_bus. */ | ||
284 | struct mii_bus *gfar_get_miibus(const struct gfar_private *priv) | ||
285 | { | ||
286 | /*const*/ struct device *d; | ||
287 | |||
288 | d = bus_find_device(gianfar_mdio_driver.bus, NULL, (void *)priv, | ||
289 | match_mdio_bus); | ||
290 | return d ? dev_get_drvdata(d) : NULL; | ||
291 | } | ||
292 | |||
272 | int __init gfar_mdio_init(void) | 293 | int __init gfar_mdio_init(void) |
273 | { | 294 | { |
274 | return driver_register(&gianfar_mdio_driver); | 295 | return driver_register(&gianfar_mdio_driver); |
diff --git a/drivers/net/gianfar_mii.h b/drivers/net/gianfar_mii.h index 2af28b16a0e2..02dc970ca1ff 100644 --- a/drivers/net/gianfar_mii.h +++ b/drivers/net/gianfar_mii.h | |||
@@ -18,6 +18,8 @@ | |||
18 | #ifndef __GIANFAR_MII_H | 18 | #ifndef __GIANFAR_MII_H |
19 | #define __GIANFAR_MII_H | 19 | #define __GIANFAR_MII_H |
20 | 20 | ||
21 | struct gfar_private; /* forward ref */ | ||
22 | |||
21 | #define MIIMIND_BUSY 0x00000001 | 23 | #define MIIMIND_BUSY 0x00000001 |
22 | #define MIIMIND_NOTVALID 0x00000004 | 24 | #define MIIMIND_NOTVALID 0x00000004 |
23 | 25 | ||
@@ -44,6 +46,7 @@ int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value); | |||
44 | int gfar_local_mdio_write(struct gfar_mii __iomem *regs, int mii_id, | 46 | int gfar_local_mdio_write(struct gfar_mii __iomem *regs, int mii_id, |
45 | int regnum, u16 value); | 47 | int regnum, u16 value); |
46 | int gfar_local_mdio_read(struct gfar_mii __iomem *regs, int mii_id, int regnum); | 48 | int gfar_local_mdio_read(struct gfar_mii __iomem *regs, int mii_id, int regnum); |
49 | struct mii_bus *gfar_get_miibus(const struct gfar_private *priv); | ||
47 | int __init gfar_mdio_init(void); | 50 | int __init gfar_mdio_init(void); |
48 | void gfar_mdio_exit(void); | 51 | void gfar_mdio_exit(void); |
49 | #endif /* GIANFAR_PHY_H */ | 52 | #endif /* GIANFAR_PHY_H */ |
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 2ee2622258f5..901212aa37cb 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
@@ -2605,7 +2605,7 @@ static int __devinit emac_init_config(struct emac_instance *dev) | |||
2605 | of_device_is_compatible(np, "ibm,emac-440gr")) | 2605 | of_device_is_compatible(np, "ibm,emac-440gr")) |
2606 | dev->features |= EMAC_FTR_440EP_PHY_CLK_FIX; | 2606 | dev->features |= EMAC_FTR_440EP_PHY_CLK_FIX; |
2607 | if (of_device_is_compatible(np, "ibm,emac-405ez")) { | 2607 | if (of_device_is_compatible(np, "ibm,emac-405ez")) { |
2608 | #ifdef CONFIG_IBM_NEW_EMAC_NO_FLOW_CONTROL | 2608 | #ifdef CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL |
2609 | dev->features |= EMAC_FTR_NO_FLOW_CONTROL_40x; | 2609 | dev->features |= EMAC_FTR_NO_FLOW_CONTROL_40x; |
2610 | #else | 2610 | #else |
2611 | printk(KERN_ERR "%s: Flow control not disabled!\n", | 2611 | printk(KERN_ERR "%s: Flow control not disabled!\n", |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 93d02efa9a0a..1f397cd99414 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -38,10 +38,11 @@ | |||
38 | #include <linux/ethtool.h> | 38 | #include <linux/ethtool.h> |
39 | #include <linux/if_vlan.h> | 39 | #include <linux/if_vlan.h> |
40 | #include <linux/pci.h> | 40 | #include <linux/pci.h> |
41 | #include <linux/pci-aspm.h> | ||
41 | #include <linux/delay.h> | 42 | #include <linux/delay.h> |
42 | #include <linux/interrupt.h> | 43 | #include <linux/interrupt.h> |
43 | #include <linux/if_ether.h> | 44 | #include <linux/if_ether.h> |
44 | #ifdef CONFIG_DCA | 45 | #ifdef CONFIG_IGB_DCA |
45 | #include <linux/dca.h> | 46 | #include <linux/dca.h> |
46 | #endif | 47 | #endif |
47 | #include "igb.h" | 48 | #include "igb.h" |
@@ -106,11 +107,11 @@ static irqreturn_t igb_msix_other(int irq, void *); | |||
106 | static irqreturn_t igb_msix_rx(int irq, void *); | 107 | static irqreturn_t igb_msix_rx(int irq, void *); |
107 | static irqreturn_t igb_msix_tx(int irq, void *); | 108 | static irqreturn_t igb_msix_tx(int irq, void *); |
108 | static int igb_clean_rx_ring_msix(struct napi_struct *, int); | 109 | static int igb_clean_rx_ring_msix(struct napi_struct *, int); |
109 | #ifdef CONFIG_DCA | 110 | #ifdef CONFIG_IGB_DCA |
110 | static void igb_update_rx_dca(struct igb_ring *); | 111 | static void igb_update_rx_dca(struct igb_ring *); |
111 | static void igb_update_tx_dca(struct igb_ring *); | 112 | static void igb_update_tx_dca(struct igb_ring *); |
112 | static void igb_setup_dca(struct igb_adapter *); | 113 | static void igb_setup_dca(struct igb_adapter *); |
113 | #endif /* CONFIG_DCA */ | 114 | #endif /* CONFIG_IGB_DCA */ |
114 | static bool igb_clean_tx_irq(struct igb_ring *); | 115 | static bool igb_clean_tx_irq(struct igb_ring *); |
115 | static int igb_poll(struct napi_struct *, int); | 116 | static int igb_poll(struct napi_struct *, int); |
116 | static bool igb_clean_rx_irq_adv(struct igb_ring *, int *, int); | 117 | static bool igb_clean_rx_irq_adv(struct igb_ring *, int *, int); |
@@ -131,7 +132,7 @@ static int igb_suspend(struct pci_dev *, pm_message_t); | |||
131 | static int igb_resume(struct pci_dev *); | 132 | static int igb_resume(struct pci_dev *); |
132 | #endif | 133 | #endif |
133 | static void igb_shutdown(struct pci_dev *); | 134 | static void igb_shutdown(struct pci_dev *); |
134 | #ifdef CONFIG_DCA | 135 | #ifdef CONFIG_IGB_DCA |
135 | static int igb_notify_dca(struct notifier_block *, unsigned long, void *); | 136 | static int igb_notify_dca(struct notifier_block *, unsigned long, void *); |
136 | static struct notifier_block dca_notifier = { | 137 | static struct notifier_block dca_notifier = { |
137 | .notifier_call = igb_notify_dca, | 138 | .notifier_call = igb_notify_dca, |
@@ -207,7 +208,7 @@ static int __init igb_init_module(void) | |||
207 | global_quad_port_a = 0; | 208 | global_quad_port_a = 0; |
208 | 209 | ||
209 | ret = pci_register_driver(&igb_driver); | 210 | ret = pci_register_driver(&igb_driver); |
210 | #ifdef CONFIG_DCA | 211 | #ifdef CONFIG_IGB_DCA |
211 | dca_register_notify(&dca_notifier); | 212 | dca_register_notify(&dca_notifier); |
212 | #endif | 213 | #endif |
213 | return ret; | 214 | return ret; |
@@ -223,7 +224,7 @@ module_init(igb_init_module); | |||
223 | **/ | 224 | **/ |
224 | static void __exit igb_exit_module(void) | 225 | static void __exit igb_exit_module(void) |
225 | { | 226 | { |
226 | #ifdef CONFIG_DCA | 227 | #ifdef CONFIG_IGB_DCA |
227 | dca_unregister_notify(&dca_notifier); | 228 | dca_unregister_notify(&dca_notifier); |
228 | #endif | 229 | #endif |
229 | pci_unregister_driver(&igb_driver); | 230 | pci_unregister_driver(&igb_driver); |
@@ -966,10 +967,11 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
966 | struct net_device *netdev; | 967 | struct net_device *netdev; |
967 | struct igb_adapter *adapter; | 968 | struct igb_adapter *adapter; |
968 | struct e1000_hw *hw; | 969 | struct e1000_hw *hw; |
970 | struct pci_dev *us_dev; | ||
969 | const struct e1000_info *ei = igb_info_tbl[ent->driver_data]; | 971 | const struct e1000_info *ei = igb_info_tbl[ent->driver_data]; |
970 | unsigned long mmio_start, mmio_len; | 972 | unsigned long mmio_start, mmio_len; |
971 | int i, err, pci_using_dac; | 973 | int i, err, pci_using_dac, pos; |
972 | u16 eeprom_data = 0; | 974 | u16 eeprom_data = 0, state = 0; |
973 | u16 eeprom_apme_mask = IGB_EEPROM_APME; | 975 | u16 eeprom_apme_mask = IGB_EEPROM_APME; |
974 | u32 part_num; | 976 | u32 part_num; |
975 | int bars, need_ioport; | 977 | int bars, need_ioport; |
@@ -1004,6 +1006,28 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
1004 | } | 1006 | } |
1005 | } | 1007 | } |
1006 | 1008 | ||
1009 | /* 82575 requires that the pci-e link partner disable the L0s state */ | ||
1010 | switch (pdev->device) { | ||
1011 | case E1000_DEV_ID_82575EB_COPPER: | ||
1012 | case E1000_DEV_ID_82575EB_FIBER_SERDES: | ||
1013 | case E1000_DEV_ID_82575GB_QUAD_COPPER: | ||
1014 | us_dev = pdev->bus->self; | ||
1015 | pos = pci_find_capability(us_dev, PCI_CAP_ID_EXP); | ||
1016 | if (pos) { | ||
1017 | pci_read_config_word(us_dev, pos + PCI_EXP_LNKCTL, | ||
1018 | &state); | ||
1019 | state &= ~PCIE_LINK_STATE_L0S; | ||
1020 | pci_write_config_word(us_dev, pos + PCI_EXP_LNKCTL, | ||
1021 | state); | ||
1022 | printk(KERN_INFO "Disabling ASPM L0s upstream switch " | ||
1023 | "port %x:%x.%x\n", us_dev->bus->number, | ||
1024 | PCI_SLOT(us_dev->devfn), | ||
1025 | PCI_FUNC(us_dev->devfn)); | ||
1026 | } | ||
1027 | default: | ||
1028 | break; | ||
1029 | } | ||
1030 | |||
1007 | err = pci_request_selected_regions(pdev, bars, igb_driver_name); | 1031 | err = pci_request_selected_regions(pdev, bars, igb_driver_name); |
1008 | if (err) | 1032 | if (err) |
1009 | goto err_pci_reg; | 1033 | goto err_pci_reg; |
@@ -1237,7 +1261,7 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
1237 | if (err) | 1261 | if (err) |
1238 | goto err_register; | 1262 | goto err_register; |
1239 | 1263 | ||
1240 | #ifdef CONFIG_DCA | 1264 | #ifdef CONFIG_IGB_DCA |
1241 | if ((adapter->flags & IGB_FLAG_HAS_DCA) && | 1265 | if ((adapter->flags & IGB_FLAG_HAS_DCA) && |
1242 | (dca_add_requester(&pdev->dev) == 0)) { | 1266 | (dca_add_requester(&pdev->dev) == 0)) { |
1243 | adapter->flags |= IGB_FLAG_DCA_ENABLED; | 1267 | adapter->flags |= IGB_FLAG_DCA_ENABLED; |
@@ -1311,7 +1335,7 @@ static void __devexit igb_remove(struct pci_dev *pdev) | |||
1311 | { | 1335 | { |
1312 | struct net_device *netdev = pci_get_drvdata(pdev); | 1336 | struct net_device *netdev = pci_get_drvdata(pdev); |
1313 | struct igb_adapter *adapter = netdev_priv(netdev); | 1337 | struct igb_adapter *adapter = netdev_priv(netdev); |
1314 | #ifdef CONFIG_DCA | 1338 | #ifdef CONFIG_IGB_DCA |
1315 | struct e1000_hw *hw = &adapter->hw; | 1339 | struct e1000_hw *hw = &adapter->hw; |
1316 | #endif | 1340 | #endif |
1317 | 1341 | ||
@@ -1323,7 +1347,7 @@ static void __devexit igb_remove(struct pci_dev *pdev) | |||
1323 | 1347 | ||
1324 | flush_scheduled_work(); | 1348 | flush_scheduled_work(); |
1325 | 1349 | ||
1326 | #ifdef CONFIG_DCA | 1350 | #ifdef CONFIG_IGB_DCA |
1327 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) { | 1351 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) { |
1328 | dev_info(&pdev->dev, "DCA disabled\n"); | 1352 | dev_info(&pdev->dev, "DCA disabled\n"); |
1329 | dca_remove_requester(&pdev->dev); | 1353 | dca_remove_requester(&pdev->dev); |
@@ -3271,7 +3295,7 @@ static irqreturn_t igb_msix_tx(int irq, void *data) | |||
3271 | struct igb_adapter *adapter = tx_ring->adapter; | 3295 | struct igb_adapter *adapter = tx_ring->adapter; |
3272 | struct e1000_hw *hw = &adapter->hw; | 3296 | struct e1000_hw *hw = &adapter->hw; |
3273 | 3297 | ||
3274 | #ifdef CONFIG_DCA | 3298 | #ifdef CONFIG_IGB_DCA |
3275 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) | 3299 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) |
3276 | igb_update_tx_dca(tx_ring); | 3300 | igb_update_tx_dca(tx_ring); |
3277 | #endif | 3301 | #endif |
@@ -3323,14 +3347,14 @@ static irqreturn_t igb_msix_rx(int irq, void *data) | |||
3323 | if (netif_rx_schedule_prep(adapter->netdev, &rx_ring->napi)) | 3347 | if (netif_rx_schedule_prep(adapter->netdev, &rx_ring->napi)) |
3324 | __netif_rx_schedule(adapter->netdev, &rx_ring->napi); | 3348 | __netif_rx_schedule(adapter->netdev, &rx_ring->napi); |
3325 | 3349 | ||
3326 | #ifdef CONFIG_DCA | 3350 | #ifdef CONFIG_IGB_DCA |
3327 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) | 3351 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) |
3328 | igb_update_rx_dca(rx_ring); | 3352 | igb_update_rx_dca(rx_ring); |
3329 | #endif | 3353 | #endif |
3330 | return IRQ_HANDLED; | 3354 | return IRQ_HANDLED; |
3331 | } | 3355 | } |
3332 | 3356 | ||
3333 | #ifdef CONFIG_DCA | 3357 | #ifdef CONFIG_IGB_DCA |
3334 | static void igb_update_rx_dca(struct igb_ring *rx_ring) | 3358 | static void igb_update_rx_dca(struct igb_ring *rx_ring) |
3335 | { | 3359 | { |
3336 | u32 dca_rxctrl; | 3360 | u32 dca_rxctrl; |
@@ -3450,7 +3474,7 @@ static int igb_notify_dca(struct notifier_block *nb, unsigned long event, | |||
3450 | 3474 | ||
3451 | return ret_val ? NOTIFY_BAD : NOTIFY_DONE; | 3475 | return ret_val ? NOTIFY_BAD : NOTIFY_DONE; |
3452 | } | 3476 | } |
3453 | #endif /* CONFIG_DCA */ | 3477 | #endif /* CONFIG_IGB_DCA */ |
3454 | 3478 | ||
3455 | /** | 3479 | /** |
3456 | * igb_intr_msi - Interrupt Handler | 3480 | * igb_intr_msi - Interrupt Handler |
@@ -3529,13 +3553,13 @@ static int igb_poll(struct napi_struct *napi, int budget) | |||
3529 | int tx_clean_complete, work_done = 0; | 3553 | int tx_clean_complete, work_done = 0; |
3530 | 3554 | ||
3531 | /* this poll routine only supports one tx and one rx queue */ | 3555 | /* this poll routine only supports one tx and one rx queue */ |
3532 | #ifdef CONFIG_DCA | 3556 | #ifdef CONFIG_IGB_DCA |
3533 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) | 3557 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) |
3534 | igb_update_tx_dca(&adapter->tx_ring[0]); | 3558 | igb_update_tx_dca(&adapter->tx_ring[0]); |
3535 | #endif | 3559 | #endif |
3536 | tx_clean_complete = igb_clean_tx_irq(&adapter->tx_ring[0]); | 3560 | tx_clean_complete = igb_clean_tx_irq(&adapter->tx_ring[0]); |
3537 | 3561 | ||
3538 | #ifdef CONFIG_DCA | 3562 | #ifdef CONFIG_IGB_DCA |
3539 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) | 3563 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) |
3540 | igb_update_rx_dca(&adapter->rx_ring[0]); | 3564 | igb_update_rx_dca(&adapter->rx_ring[0]); |
3541 | #endif | 3565 | #endif |
@@ -3563,7 +3587,7 @@ static int igb_clean_rx_ring_msix(struct napi_struct *napi, int budget) | |||
3563 | struct net_device *netdev = adapter->netdev; | 3587 | struct net_device *netdev = adapter->netdev; |
3564 | int work_done = 0; | 3588 | int work_done = 0; |
3565 | 3589 | ||
3566 | #ifdef CONFIG_DCA | 3590 | #ifdef CONFIG_IGB_DCA |
3567 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) | 3591 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) |
3568 | igb_update_rx_dca(rx_ring); | 3592 | igb_update_rx_dca(rx_ring); |
3569 | #endif | 3593 | #endif |
diff --git a/drivers/net/irda/ks959-sir.c b/drivers/net/irda/ks959-sir.c index 2482d61662a2..2e67ae015d91 100644 --- a/drivers/net/irda/ks959-sir.c +++ b/drivers/net/irda/ks959-sir.c | |||
@@ -118,7 +118,6 @@ | |||
118 | #include <linux/errno.h> | 118 | #include <linux/errno.h> |
119 | #include <linux/init.h> | 119 | #include <linux/init.h> |
120 | #include <linux/slab.h> | 120 | #include <linux/slab.h> |
121 | #include <linux/module.h> | ||
122 | #include <linux/kref.h> | 121 | #include <linux/kref.h> |
123 | #include <linux/usb.h> | 122 | #include <linux/usb.h> |
124 | #include <linux/device.h> | 123 | #include <linux/device.h> |
diff --git a/drivers/net/irda/ksdazzle-sir.c b/drivers/net/irda/ksdazzle-sir.c index 1e0de93fd618..3843b5faba8b 100644 --- a/drivers/net/irda/ksdazzle-sir.c +++ b/drivers/net/irda/ksdazzle-sir.c | |||
@@ -82,7 +82,6 @@ | |||
82 | #include <linux/errno.h> | 82 | #include <linux/errno.h> |
83 | #include <linux/init.h> | 83 | #include <linux/init.h> |
84 | #include <linux/slab.h> | 84 | #include <linux/slab.h> |
85 | #include <linux/module.h> | ||
86 | #include <linux/kref.h> | 85 | #include <linux/kref.h> |
87 | #include <linux/usb.h> | 86 | #include <linux/usb.h> |
88 | #include <linux/device.h> | 87 | #include <linux/device.h> |
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 3b43bfd85a0f..b1ac63ab8c16 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c | |||
@@ -76,15 +76,6 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev) | |||
76 | 76 | ||
77 | skb->protocol = eth_type_trans(skb,dev); | 77 | skb->protocol = eth_type_trans(skb,dev); |
78 | 78 | ||
79 | #ifdef LOOPBACK_TSO | ||
80 | if (skb_is_gso(skb)) { | ||
81 | BUG_ON(skb->protocol != htons(ETH_P_IP)); | ||
82 | BUG_ON(ip_hdr(skb)->protocol != IPPROTO_TCP); | ||
83 | |||
84 | emulate_large_send_offload(skb); | ||
85 | return 0; | ||
86 | } | ||
87 | #endif | ||
88 | dev->last_rx = jiffies; | 79 | dev->last_rx = jiffies; |
89 | 80 | ||
90 | /* it's OK to use per_cpu_ptr() because BHs are off */ | 81 | /* it's OK to use per_cpu_ptr() because BHs are off */ |
diff --git a/drivers/net/mlx4/en_main.c b/drivers/net/mlx4/en_main.c index 1b0eebf84f76..4b9794e97a79 100644 --- a/drivers/net/mlx4/en_main.c +++ b/drivers/net/mlx4/en_main.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <linux/module.h> | 35 | #include <linux/module.h> |
36 | #include <linux/delay.h> | 36 | #include <linux/delay.h> |
37 | #include <linux/netdevice.h> | 37 | #include <linux/netdevice.h> |
38 | #include <linux/cpumask.h> | ||
39 | 38 | ||
40 | #include <linux/mlx4/driver.h> | 39 | #include <linux/mlx4/driver.h> |
41 | #include <linux/mlx4/device.h> | 40 | #include <linux/mlx4/device.h> |
diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c index a339afbeed38..a3f732418c49 100644 --- a/drivers/net/mlx4/en_netdev.c +++ b/drivers/net/mlx4/en_netdev.c | |||
@@ -706,7 +706,7 @@ tx_err: | |||
706 | mlx4_en_release_rss_steer(priv); | 706 | mlx4_en_release_rss_steer(priv); |
707 | rx_err: | 707 | rx_err: |
708 | for (i = 0; i < priv->rx_ring_num; i++) | 708 | for (i = 0; i < priv->rx_ring_num; i++) |
709 | mlx4_en_deactivate_rx_ring(priv, &priv->rx_ring[rx_index]); | 709 | mlx4_en_deactivate_rx_ring(priv, &priv->rx_ring[i]); |
710 | cq_err: | 710 | cq_err: |
711 | while (rx_index--) | 711 | while (rx_index--) |
712 | mlx4_en_deactivate_cq(priv, &priv->rx_cq[rx_index]); | 712 | mlx4_en_deactivate_cq(priv, &priv->rx_cq[rx_index]); |
diff --git a/drivers/net/mlx4/fw.c b/drivers/net/mlx4/fw.c index be09fdb79cb8..cee199ceba2f 100644 --- a/drivers/net/mlx4/fw.c +++ b/drivers/net/mlx4/fw.c | |||
@@ -360,9 +360,9 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) | |||
360 | #define QUERY_PORT_ETH_MTU_OFFSET 0x02 | 360 | #define QUERY_PORT_ETH_MTU_OFFSET 0x02 |
361 | #define QUERY_PORT_WIDTH_OFFSET 0x06 | 361 | #define QUERY_PORT_WIDTH_OFFSET 0x06 |
362 | #define QUERY_PORT_MAX_GID_PKEY_OFFSET 0x07 | 362 | #define QUERY_PORT_MAX_GID_PKEY_OFFSET 0x07 |
363 | #define QUERY_PORT_MAC_OFFSET 0x08 | ||
364 | #define QUERY_PORT_MAX_MACVLAN_OFFSET 0x0a | 363 | #define QUERY_PORT_MAX_MACVLAN_OFFSET 0x0a |
365 | #define QUERY_PORT_MAX_VL_OFFSET 0x0b | 364 | #define QUERY_PORT_MAX_VL_OFFSET 0x0b |
365 | #define QUERY_PORT_MAC_OFFSET 0x10 | ||
366 | 366 | ||
367 | for (i = 1; i <= dev_cap->num_ports; ++i) { | 367 | for (i = 1; i <= dev_cap->num_ports; ++i) { |
368 | err = mlx4_cmd_box(dev, 0, mailbox->dma, i, 0, MLX4_CMD_QUERY_PORT, | 368 | err = mlx4_cmd_box(dev, 0, mailbox->dma, i, 0, MLX4_CMD_QUERY_PORT, |
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index a9c8c08044b1..b9dcdbd369f8 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -1066,9 +1066,12 @@ static int smi_wait_ready(struct mv643xx_eth_shared_private *msp) | |||
1066 | return 0; | 1066 | return 0; |
1067 | } | 1067 | } |
1068 | 1068 | ||
1069 | if (!wait_event_timeout(msp->smi_busy_wait, smi_is_done(msp), | 1069 | if (!smi_is_done(msp)) { |
1070 | msecs_to_jiffies(100))) | 1070 | wait_event_timeout(msp->smi_busy_wait, smi_is_done(msp), |
1071 | return -ETIMEDOUT; | 1071 | msecs_to_jiffies(100)); |
1072 | if (!smi_is_done(msp)) | ||
1073 | return -ETIMEDOUT; | ||
1074 | } | ||
1072 | 1075 | ||
1073 | return 0; | 1076 | return 0; |
1074 | } | 1077 | } |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index a9aebad52652..a5f428bcc0eb 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -75,7 +75,7 @@ | |||
75 | #include "myri10ge_mcp.h" | 75 | #include "myri10ge_mcp.h" |
76 | #include "myri10ge_mcp_gen_header.h" | 76 | #include "myri10ge_mcp_gen_header.h" |
77 | 77 | ||
78 | #define MYRI10GE_VERSION_STR "1.4.3-1.369" | 78 | #define MYRI10GE_VERSION_STR "1.4.3-1.375" |
79 | 79 | ||
80 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); | 80 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); |
81 | MODULE_AUTHOR("Maintainer: help@myri.com"); | 81 | MODULE_AUTHOR("Maintainer: help@myri.com"); |
@@ -1393,6 +1393,7 @@ myri10ge_tx_done(struct myri10ge_slice_state *ss, int mcp_index) | |||
1393 | if (tx->req == tx->done) { | 1393 | if (tx->req == tx->done) { |
1394 | tx->queue_active = 0; | 1394 | tx->queue_active = 0; |
1395 | put_be32(htonl(1), tx->send_stop); | 1395 | put_be32(htonl(1), tx->send_stop); |
1396 | mmiowb(); | ||
1396 | } | 1397 | } |
1397 | __netif_tx_unlock(dev_queue); | 1398 | __netif_tx_unlock(dev_queue); |
1398 | } | 1399 | } |
@@ -2497,6 +2498,10 @@ static int myri10ge_open(struct net_device *dev) | |||
2497 | return 0; | 2498 | return 0; |
2498 | 2499 | ||
2499 | abort_with_rings: | 2500 | abort_with_rings: |
2501 | while (slice) { | ||
2502 | slice--; | ||
2503 | napi_disable(&mgp->ss[slice].napi); | ||
2504 | } | ||
2500 | for (i = 0; i < mgp->num_slices; i++) | 2505 | for (i = 0; i < mgp->num_slices; i++) |
2501 | myri10ge_free_rings(&mgp->ss[i]); | 2506 | myri10ge_free_rings(&mgp->ss[i]); |
2502 | 2507 | ||
@@ -2860,6 +2865,7 @@ again: | |||
2860 | if ((mgp->dev->real_num_tx_queues > 1) && tx->queue_active == 0) { | 2865 | if ((mgp->dev->real_num_tx_queues > 1) && tx->queue_active == 0) { |
2861 | tx->queue_active = 1; | 2866 | tx->queue_active = 1; |
2862 | put_be32(htonl(1), tx->send_go); | 2867 | put_be32(htonl(1), tx->send_go); |
2868 | mmiowb(); | ||
2863 | } | 2869 | } |
2864 | tx->pkt_start++; | 2870 | tx->pkt_start++; |
2865 | if ((avail - count) < MXGEFW_MAX_SEND_DESC) { | 2871 | if ((avail - count) < MXGEFW_MAX_SEND_DESC) { |
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index ebc812702903..9acb5d70a3ae 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -8667,7 +8667,6 @@ static void __devinit niu_device_announce(struct niu *np) | |||
8667 | static int __devinit niu_pci_init_one(struct pci_dev *pdev, | 8667 | static int __devinit niu_pci_init_one(struct pci_dev *pdev, |
8668 | const struct pci_device_id *ent) | 8668 | const struct pci_device_id *ent) |
8669 | { | 8669 | { |
8670 | unsigned long niureg_base, niureg_len; | ||
8671 | union niu_parent_id parent_id; | 8670 | union niu_parent_id parent_id; |
8672 | struct net_device *dev; | 8671 | struct net_device *dev; |
8673 | struct niu *np; | 8672 | struct niu *np; |
@@ -8758,10 +8757,7 @@ static int __devinit niu_pci_init_one(struct pci_dev *pdev, | |||
8758 | 8757 | ||
8759 | dev->features |= (NETIF_F_SG | NETIF_F_HW_CSUM); | 8758 | dev->features |= (NETIF_F_SG | NETIF_F_HW_CSUM); |
8760 | 8759 | ||
8761 | niureg_base = pci_resource_start(pdev, 0); | 8760 | np->regs = pci_ioremap_bar(pdev, 0); |
8762 | niureg_len = pci_resource_len(pdev, 0); | ||
8763 | |||
8764 | np->regs = ioremap_nocache(niureg_base, niureg_len); | ||
8765 | if (!np->regs) { | 8761 | if (!np->regs) { |
8766 | dev_err(&pdev->dev, PFX "Cannot map device registers, " | 8762 | dev_err(&pdev->dev, PFX "Cannot map device registers, " |
8767 | "aborting.\n"); | 8763 | "aborting.\n"); |
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index fc6f4b8c64b3..b646e92134dc 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -399,11 +399,11 @@ static int pppoe_rcv(struct sk_buff *skb, | |||
399 | if (skb->len < len) | 399 | if (skb->len < len) |
400 | goto drop; | 400 | goto drop; |
401 | 401 | ||
402 | po = get_item(ph->sid, eth_hdr(skb)->h_source, dev->ifindex); | 402 | if (pskb_trim_rcsum(skb, len)) |
403 | if (!po) | ||
404 | goto drop; | 403 | goto drop; |
405 | 404 | ||
406 | if (pskb_trim_rcsum(skb, len)) | 405 | po = get_item(ph->sid, eth_hdr(skb)->h_source, dev->ifindex); |
406 | if (!po) | ||
407 | goto drop; | 407 | goto drop; |
408 | 408 | ||
409 | return sk_receive_skb(sk_pppox(po), skb, 0); | 409 | return sk_receive_skb(sk_pppox(po), skb, 0); |
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h index 38116f9d4163..ba2e1c5b6bcf 100644 --- a/drivers/net/qlge/qlge.h +++ b/drivers/net/qlge/qlge.h | |||
@@ -1375,7 +1375,6 @@ struct ql_adapter { | |||
1375 | spinlock_t adapter_lock; | 1375 | spinlock_t adapter_lock; |
1376 | spinlock_t hw_lock; | 1376 | spinlock_t hw_lock; |
1377 | spinlock_t stats_lock; | 1377 | spinlock_t stats_lock; |
1378 | spinlock_t legacy_lock; /* used for maintaining legacy intr sync */ | ||
1379 | 1378 | ||
1380 | /* PCI Bus Relative Register Addresses */ | 1379 | /* PCI Bus Relative Register Addresses */ |
1381 | void __iomem *reg_base; | 1380 | void __iomem *reg_base; |
@@ -1399,8 +1398,6 @@ struct ql_adapter { | |||
1399 | struct msix_entry *msi_x_entry; | 1398 | struct msix_entry *msi_x_entry; |
1400 | struct intr_context intr_context[MAX_RX_RINGS]; | 1399 | struct intr_context intr_context[MAX_RX_RINGS]; |
1401 | 1400 | ||
1402 | int (*legacy_check) (struct ql_adapter *); | ||
1403 | |||
1404 | int tx_ring_count; /* One per online CPU. */ | 1401 | int tx_ring_count; /* One per online CPU. */ |
1405 | u32 rss_ring_first_cq_id;/* index of first inbound (rss) rx_ring */ | 1402 | u32 rss_ring_first_cq_id;/* index of first inbound (rss) rx_ring */ |
1406 | u32 rss_ring_count; /* One per online CPU. */ | 1403 | u32 rss_ring_count; /* One per online CPU. */ |
@@ -1502,7 +1499,7 @@ void ql_mpi_work(struct work_struct *work); | |||
1502 | void ql_mpi_reset_work(struct work_struct *work); | 1499 | void ql_mpi_reset_work(struct work_struct *work); |
1503 | int ql_wait_reg_rdy(struct ql_adapter *qdev, u32 reg, u32 bit, u32 ebit); | 1500 | int ql_wait_reg_rdy(struct ql_adapter *qdev, u32 reg, u32 bit, u32 ebit); |
1504 | void ql_queue_asic_error(struct ql_adapter *qdev); | 1501 | void ql_queue_asic_error(struct ql_adapter *qdev); |
1505 | void ql_enable_completion_interrupt(struct ql_adapter *qdev, u32 intr); | 1502 | u32 ql_enable_completion_interrupt(struct ql_adapter *qdev, u32 intr); |
1506 | void ql_set_ethtool_ops(struct net_device *ndev); | 1503 | void ql_set_ethtool_ops(struct net_device *ndev); |
1507 | int ql_read_xgmac_reg64(struct ql_adapter *qdev, u32 reg, u64 *data); | 1504 | int ql_read_xgmac_reg64(struct ql_adapter *qdev, u32 reg, u64 *data); |
1508 | 1505 | ||
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 4b2caa6b7ac5..b83a9c9b6a97 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -577,41 +577,53 @@ static void ql_disable_interrupts(struct ql_adapter *qdev) | |||
577 | * incremented everytime we queue a worker and decremented everytime | 577 | * incremented everytime we queue a worker and decremented everytime |
578 | * a worker finishes. Once it hits zero we enable the interrupt. | 578 | * a worker finishes. Once it hits zero we enable the interrupt. |
579 | */ | 579 | */ |
580 | void ql_enable_completion_interrupt(struct ql_adapter *qdev, u32 intr) | 580 | u32 ql_enable_completion_interrupt(struct ql_adapter *qdev, u32 intr) |
581 | { | 581 | { |
582 | if (likely(test_bit(QL_MSIX_ENABLED, &qdev->flags))) | 582 | u32 var = 0; |
583 | unsigned long hw_flags = 0; | ||
584 | struct intr_context *ctx = qdev->intr_context + intr; | ||
585 | |||
586 | if (likely(test_bit(QL_MSIX_ENABLED, &qdev->flags) && intr)) { | ||
587 | /* Always enable if we're MSIX multi interrupts and | ||
588 | * it's not the default (zeroeth) interrupt. | ||
589 | */ | ||
583 | ql_write32(qdev, INTR_EN, | 590 | ql_write32(qdev, INTR_EN, |
584 | qdev->intr_context[intr].intr_en_mask); | 591 | ctx->intr_en_mask); |
585 | else { | 592 | var = ql_read32(qdev, STS); |
586 | if (qdev->legacy_check) | 593 | return var; |
587 | spin_lock(&qdev->legacy_lock); | ||
588 | if (atomic_dec_and_test(&qdev->intr_context[intr].irq_cnt)) { | ||
589 | QPRINTK(qdev, INTR, ERR, "Enabling interrupt %d.\n", | ||
590 | intr); | ||
591 | ql_write32(qdev, INTR_EN, | ||
592 | qdev->intr_context[intr].intr_en_mask); | ||
593 | } else { | ||
594 | QPRINTK(qdev, INTR, ERR, | ||
595 | "Skip enable, other queue(s) are active.\n"); | ||
596 | } | ||
597 | if (qdev->legacy_check) | ||
598 | spin_unlock(&qdev->legacy_lock); | ||
599 | } | 594 | } |
595 | |||
596 | spin_lock_irqsave(&qdev->hw_lock, hw_flags); | ||
597 | if (atomic_dec_and_test(&ctx->irq_cnt)) { | ||
598 | ql_write32(qdev, INTR_EN, | ||
599 | ctx->intr_en_mask); | ||
600 | var = ql_read32(qdev, STS); | ||
601 | } | ||
602 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | ||
603 | return var; | ||
600 | } | 604 | } |
601 | 605 | ||
602 | static u32 ql_disable_completion_interrupt(struct ql_adapter *qdev, u32 intr) | 606 | static u32 ql_disable_completion_interrupt(struct ql_adapter *qdev, u32 intr) |
603 | { | 607 | { |
604 | u32 var = 0; | 608 | u32 var = 0; |
609 | unsigned long hw_flags; | ||
610 | struct intr_context *ctx; | ||
605 | 611 | ||
606 | if (likely(test_bit(QL_MSIX_ENABLED, &qdev->flags))) | 612 | /* HW disables for us if we're MSIX multi interrupts and |
607 | goto exit; | 613 | * it's not the default (zeroeth) interrupt. |
608 | else if (!atomic_read(&qdev->intr_context[intr].irq_cnt)) { | 614 | */ |
615 | if (likely(test_bit(QL_MSIX_ENABLED, &qdev->flags) && intr)) | ||
616 | return 0; | ||
617 | |||
618 | ctx = qdev->intr_context + intr; | ||
619 | spin_lock_irqsave(&qdev->hw_lock, hw_flags); | ||
620 | if (!atomic_read(&ctx->irq_cnt)) { | ||
609 | ql_write32(qdev, INTR_EN, | 621 | ql_write32(qdev, INTR_EN, |
610 | qdev->intr_context[intr].intr_dis_mask); | 622 | ctx->intr_dis_mask); |
611 | var = ql_read32(qdev, STS); | 623 | var = ql_read32(qdev, STS); |
612 | } | 624 | } |
613 | atomic_inc(&qdev->intr_context[intr].irq_cnt); | 625 | atomic_inc(&ctx->irq_cnt); |
614 | exit: | 626 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); |
615 | return var; | 627 | return var; |
616 | } | 628 | } |
617 | 629 | ||
@@ -623,7 +635,9 @@ static void ql_enable_all_completion_interrupts(struct ql_adapter *qdev) | |||
623 | * and enables only if the result is zero. | 635 | * and enables only if the result is zero. |
624 | * So we precharge it here. | 636 | * So we precharge it here. |
625 | */ | 637 | */ |
626 | atomic_set(&qdev->intr_context[i].irq_cnt, 1); | 638 | if (unlikely(!test_bit(QL_MSIX_ENABLED, &qdev->flags) || |
639 | i == 0)) | ||
640 | atomic_set(&qdev->intr_context[i].irq_cnt, 1); | ||
627 | ql_enable_completion_interrupt(qdev, i); | 641 | ql_enable_completion_interrupt(qdev, i); |
628 | } | 642 | } |
629 | 643 | ||
@@ -1725,19 +1739,6 @@ static irqreturn_t qlge_msix_rx_isr(int irq, void *dev_id) | |||
1725 | return IRQ_HANDLED; | 1739 | return IRQ_HANDLED; |
1726 | } | 1740 | } |
1727 | 1741 | ||
1728 | /* We check here to see if we're already handling a legacy | ||
1729 | * interrupt. If we are, then it must belong to another | ||
1730 | * chip with which we're sharing the interrupt line. | ||
1731 | */ | ||
1732 | int ql_legacy_check(struct ql_adapter *qdev) | ||
1733 | { | ||
1734 | int err; | ||
1735 | spin_lock(&qdev->legacy_lock); | ||
1736 | err = atomic_read(&qdev->intr_context[0].irq_cnt); | ||
1737 | spin_unlock(&qdev->legacy_lock); | ||
1738 | return err; | ||
1739 | } | ||
1740 | |||
1741 | /* This handles a fatal error, MPI activity, and the default | 1742 | /* This handles a fatal error, MPI activity, and the default |
1742 | * rx_ring in an MSI-X multiple vector environment. | 1743 | * rx_ring in an MSI-X multiple vector environment. |
1743 | * In MSI/Legacy environment it also process the rest of | 1744 | * In MSI/Legacy environment it also process the rest of |
@@ -1752,12 +1753,15 @@ static irqreturn_t qlge_isr(int irq, void *dev_id) | |||
1752 | int i; | 1753 | int i; |
1753 | int work_done = 0; | 1754 | int work_done = 0; |
1754 | 1755 | ||
1755 | if (qdev->legacy_check && qdev->legacy_check(qdev)) { | 1756 | spin_lock(&qdev->hw_lock); |
1756 | QPRINTK(qdev, INTR, INFO, "Already busy, not our interrupt.\n"); | 1757 | if (atomic_read(&qdev->intr_context[0].irq_cnt)) { |
1757 | return IRQ_NONE; /* Not our interrupt */ | 1758 | QPRINTK(qdev, INTR, DEBUG, "Shared Interrupt, Not ours!\n"); |
1759 | spin_unlock(&qdev->hw_lock); | ||
1760 | return IRQ_NONE; | ||
1758 | } | 1761 | } |
1762 | spin_unlock(&qdev->hw_lock); | ||
1759 | 1763 | ||
1760 | var = ql_read32(qdev, STS); | 1764 | var = ql_disable_completion_interrupt(qdev, intr_context->intr); |
1761 | 1765 | ||
1762 | /* | 1766 | /* |
1763 | * Check for fatal error. | 1767 | * Check for fatal error. |
@@ -1823,6 +1827,7 @@ static irqreturn_t qlge_isr(int irq, void *dev_id) | |||
1823 | } | 1827 | } |
1824 | } | 1828 | } |
1825 | } | 1829 | } |
1830 | ql_enable_completion_interrupt(qdev, intr_context->intr); | ||
1826 | return work_done ? IRQ_HANDLED : IRQ_NONE; | 1831 | return work_done ? IRQ_HANDLED : IRQ_NONE; |
1827 | } | 1832 | } |
1828 | 1833 | ||
@@ -2701,8 +2706,6 @@ msi: | |||
2701 | } | 2706 | } |
2702 | } | 2707 | } |
2703 | irq_type = LEG_IRQ; | 2708 | irq_type = LEG_IRQ; |
2704 | spin_lock_init(&qdev->legacy_lock); | ||
2705 | qdev->legacy_check = ql_legacy_check; | ||
2706 | QPRINTK(qdev, IFUP, DEBUG, "Running with legacy interrupts.\n"); | 2709 | QPRINTK(qdev, IFUP, DEBUG, "Running with legacy interrupts.\n"); |
2707 | } | 2710 | } |
2708 | 2711 | ||
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index c821da21d8eb..4b7cb389dc49 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -81,6 +81,10 @@ static const int multicast_filter_limit = 32; | |||
81 | #define RTL8169_TX_TIMEOUT (6*HZ) | 81 | #define RTL8169_TX_TIMEOUT (6*HZ) |
82 | #define RTL8169_PHY_TIMEOUT (10*HZ) | 82 | #define RTL8169_PHY_TIMEOUT (10*HZ) |
83 | 83 | ||
84 | #define RTL_EEPROM_SIG cpu_to_le32(0x8129) | ||
85 | #define RTL_EEPROM_SIG_MASK cpu_to_le32(0xffff) | ||
86 | #define RTL_EEPROM_SIG_ADDR 0x0000 | ||
87 | |||
84 | /* write/read MMIO register */ | 88 | /* write/read MMIO register */ |
85 | #define RTL_W8(reg, val8) writeb ((val8), ioaddr + (reg)) | 89 | #define RTL_W8(reg, val8) writeb ((val8), ioaddr + (reg)) |
86 | #define RTL_W16(reg, val16) writew ((val16), ioaddr + (reg)) | 90 | #define RTL_W16(reg, val16) writew ((val16), ioaddr + (reg)) |
@@ -1911,74 +1915,6 @@ static void rtl_disable_msi(struct pci_dev *pdev, struct rtl8169_private *tp) | |||
1911 | } | 1915 | } |
1912 | } | 1916 | } |
1913 | 1917 | ||
1914 | static int rtl_eeprom_read(struct pci_dev *pdev, int cap, int addr, __le32 *val) | ||
1915 | { | ||
1916 | int ret, count = 100; | ||
1917 | u16 status = 0; | ||
1918 | u32 value; | ||
1919 | |||
1920 | ret = pci_write_config_word(pdev, cap + PCI_VPD_ADDR, addr); | ||
1921 | if (ret < 0) | ||
1922 | return ret; | ||
1923 | |||
1924 | do { | ||
1925 | udelay(10); | ||
1926 | ret = pci_read_config_word(pdev, cap + PCI_VPD_ADDR, &status); | ||
1927 | if (ret < 0) | ||
1928 | return ret; | ||
1929 | } while (!(status & PCI_VPD_ADDR_F) && --count); | ||
1930 | |||
1931 | if (!(status & PCI_VPD_ADDR_F)) | ||
1932 | return -ETIMEDOUT; | ||
1933 | |||
1934 | ret = pci_read_config_dword(pdev, cap + PCI_VPD_DATA, &value); | ||
1935 | if (ret < 0) | ||
1936 | return ret; | ||
1937 | |||
1938 | *val = cpu_to_le32(value); | ||
1939 | |||
1940 | return 0; | ||
1941 | } | ||
1942 | |||
1943 | static void rtl_init_mac_address(struct rtl8169_private *tp, | ||
1944 | void __iomem *ioaddr) | ||
1945 | { | ||
1946 | struct pci_dev *pdev = tp->pci_dev; | ||
1947 | u8 cfg1; | ||
1948 | int vpd_cap; | ||
1949 | u8 mac[8]; | ||
1950 | DECLARE_MAC_BUF(buf); | ||
1951 | |||
1952 | cfg1 = RTL_R8(Config1); | ||
1953 | if (!(cfg1 & VPD)) { | ||
1954 | dprintk("VPD access not enabled, enabling\n"); | ||
1955 | RTL_W8(Cfg9346, Cfg9346_Unlock); | ||
1956 | RTL_W8(Config1, cfg1 | VPD); | ||
1957 | RTL_W8(Cfg9346, Cfg9346_Lock); | ||
1958 | } | ||
1959 | |||
1960 | vpd_cap = pci_find_capability(pdev, PCI_CAP_ID_VPD); | ||
1961 | if (!vpd_cap) | ||
1962 | return; | ||
1963 | |||
1964 | /* MAC address is stored in EEPROM at offset 0x0e | ||
1965 | * Realtek says: "The VPD address does not have to be a DWORD-aligned | ||
1966 | * address as defined in the PCI 2.2 Specifications, but the VPD data | ||
1967 | * is always consecutive 4-byte data starting from the VPD address | ||
1968 | * specified." | ||
1969 | */ | ||
1970 | if (rtl_eeprom_read(pdev, vpd_cap, 0x000e, (__le32*)&mac[0]) < 0 || | ||
1971 | rtl_eeprom_read(pdev, vpd_cap, 0x0012, (__le32*)&mac[4]) < 0) { | ||
1972 | dprintk("Reading MAC address from EEPROM failed\n"); | ||
1973 | return; | ||
1974 | } | ||
1975 | |||
1976 | dprintk("MAC address found in EEPROM: %s\n", print_mac(buf, mac)); | ||
1977 | |||
1978 | /* Write MAC address */ | ||
1979 | rtl_rar_set(tp, mac); | ||
1980 | } | ||
1981 | |||
1982 | static int __devinit | 1918 | static int __devinit |
1983 | rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | 1919 | rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) |
1984 | { | 1920 | { |
@@ -2156,8 +2092,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2156 | 2092 | ||
2157 | tp->mmio_addr = ioaddr; | 2093 | tp->mmio_addr = ioaddr; |
2158 | 2094 | ||
2159 | rtl_init_mac_address(tp, ioaddr); | ||
2160 | |||
2161 | /* Get MAC address */ | 2095 | /* Get MAC address */ |
2162 | for (i = 0; i < MAC_ADDR_LEN; i++) | 2096 | for (i = 0; i < MAC_ADDR_LEN; i++) |
2163 | dev->dev_addr[i] = RTL_R8(MAC0 + i); | 2097 | dev->dev_addr[i] = RTL_R8(MAC0 + i); |
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index fa98af58223e..cd0d0873d978 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
@@ -174,8 +174,8 @@ static struct efx_ethtool_stat efx_ethtool_stats[] = { | |||
174 | 174 | ||
175 | /* EEPROM range with gPXE configuration */ | 175 | /* EEPROM range with gPXE configuration */ |
176 | #define EFX_ETHTOOL_EEPROM_MAGIC 0xEFAB | 176 | #define EFX_ETHTOOL_EEPROM_MAGIC 0xEFAB |
177 | #define EFX_ETHTOOL_EEPROM_MIN 0x100U | 177 | #define EFX_ETHTOOL_EEPROM_MIN 0x800U |
178 | #define EFX_ETHTOOL_EEPROM_MAX 0x400U | 178 | #define EFX_ETHTOOL_EEPROM_MAX 0x1800U |
179 | 179 | ||
180 | /************************************************************************** | 180 | /************************************************************************** |
181 | * | 181 | * |
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c index 3fe01763760e..e6e3bf58a569 100644 --- a/drivers/net/sis190.c +++ b/drivers/net/sis190.c | |||
@@ -317,6 +317,7 @@ static struct mii_chip_info { | |||
317 | unsigned int type; | 317 | unsigned int type; |
318 | u32 feature; | 318 | u32 feature; |
319 | } mii_chip_table[] = { | 319 | } mii_chip_table[] = { |
320 | { "Atheros PHY AR8012", { 0x004d, 0xd020 }, LAN, 0 }, | ||
320 | { "Broadcom PHY BCM5461", { 0x0020, 0x60c0 }, LAN, F_PHY_BCM5461 }, | 321 | { "Broadcom PHY BCM5461", { 0x0020, 0x60c0 }, LAN, F_PHY_BCM5461 }, |
321 | { "Broadcom PHY AC131", { 0x0143, 0xbc70 }, LAN, 0 }, | 322 | { "Broadcom PHY AC131", { 0x0143, 0xbc70 }, LAN, 0 }, |
322 | { "Agere PHY ET1101B", { 0x0282, 0xf010 }, LAN, 0 }, | 323 | { "Agere PHY ET1101B", { 0x0282, 0xf010 }, LAN, 0 }, |
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 8aa7460ef0e3..5051554ff05b 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c | |||
@@ -155,23 +155,17 @@ static void PRINT_PKT(u_char *buf, int length) | |||
155 | /* this enables an interrupt in the interrupt mask register */ | 155 | /* this enables an interrupt in the interrupt mask register */ |
156 | #define SMC_ENABLE_INT(lp, x) do { \ | 156 | #define SMC_ENABLE_INT(lp, x) do { \ |
157 | unsigned int __mask; \ | 157 | unsigned int __mask; \ |
158 | unsigned long __flags; \ | ||
159 | spin_lock_irqsave(&lp->lock, __flags); \ | ||
160 | __mask = SMC_GET_INT_EN((lp)); \ | 158 | __mask = SMC_GET_INT_EN((lp)); \ |
161 | __mask |= (x); \ | 159 | __mask |= (x); \ |
162 | SMC_SET_INT_EN((lp), __mask); \ | 160 | SMC_SET_INT_EN((lp), __mask); \ |
163 | spin_unlock_irqrestore(&lp->lock, __flags); \ | ||
164 | } while (0) | 161 | } while (0) |
165 | 162 | ||
166 | /* this disables an interrupt from the interrupt mask register */ | 163 | /* this disables an interrupt from the interrupt mask register */ |
167 | #define SMC_DISABLE_INT(lp, x) do { \ | 164 | #define SMC_DISABLE_INT(lp, x) do { \ |
168 | unsigned int __mask; \ | 165 | unsigned int __mask; \ |
169 | unsigned long __flags; \ | ||
170 | spin_lock_irqsave(&lp->lock, __flags); \ | ||
171 | __mask = SMC_GET_INT_EN((lp)); \ | 166 | __mask = SMC_GET_INT_EN((lp)); \ |
172 | __mask &= ~(x); \ | 167 | __mask &= ~(x); \ |
173 | SMC_SET_INT_EN((lp), __mask); \ | 168 | SMC_SET_INT_EN((lp), __mask); \ |
174 | spin_unlock_irqrestore(&lp->lock, __flags); \ | ||
175 | } while (0) | 169 | } while (0) |
176 | 170 | ||
177 | /* | 171 | /* |
@@ -180,7 +174,7 @@ static void PRINT_PKT(u_char *buf, int length) | |||
180 | static void smc911x_reset(struct net_device *dev) | 174 | static void smc911x_reset(struct net_device *dev) |
181 | { | 175 | { |
182 | struct smc911x_local *lp = netdev_priv(dev); | 176 | struct smc911x_local *lp = netdev_priv(dev); |
183 | unsigned int reg, timeout=0, resets=1; | 177 | unsigned int reg, timeout=0, resets=1, irq_cfg; |
184 | unsigned long flags; | 178 | unsigned long flags; |
185 | 179 | ||
186 | DBG(SMC_DEBUG_FUNC, "%s: --> %s\n", dev->name, __func__); | 180 | DBG(SMC_DEBUG_FUNC, "%s: --> %s\n", dev->name, __func__); |
@@ -252,7 +246,12 @@ static void smc911x_reset(struct net_device *dev) | |||
252 | * Deassert IRQ for 1*10us for edge type interrupts | 246 | * Deassert IRQ for 1*10us for edge type interrupts |
253 | * and drive IRQ pin push-pull | 247 | * and drive IRQ pin push-pull |
254 | */ | 248 | */ |
255 | SMC_SET_IRQ_CFG(lp, (1 << 24) | INT_CFG_IRQ_EN_ | INT_CFG_IRQ_TYPE_); | 249 | irq_cfg = (1 << 24) | INT_CFG_IRQ_EN_ | INT_CFG_IRQ_TYPE_; |
250 | #ifdef SMC_DYNAMIC_BUS_CONFIG | ||
251 | if (lp->cfg.irq_polarity) | ||
252 | irq_cfg |= INT_CFG_IRQ_POL_; | ||
253 | #endif | ||
254 | SMC_SET_IRQ_CFG(lp, irq_cfg); | ||
256 | 255 | ||
257 | /* clear anything saved */ | 256 | /* clear anything saved */ |
258 | if (lp->pending_tx_skb != NULL) { | 257 | if (lp->pending_tx_skb != NULL) { |
@@ -274,6 +273,8 @@ static void smc911x_enable(struct net_device *dev) | |||
274 | 273 | ||
275 | DBG(SMC_DEBUG_FUNC, "%s: --> %s\n", dev->name, __func__); | 274 | DBG(SMC_DEBUG_FUNC, "%s: --> %s\n", dev->name, __func__); |
276 | 275 | ||
276 | spin_lock_irqsave(&lp->lock, flags); | ||
277 | |||
277 | SMC_SET_MAC_ADDR(lp, dev->dev_addr); | 278 | SMC_SET_MAC_ADDR(lp, dev->dev_addr); |
278 | 279 | ||
279 | /* Enable TX */ | 280 | /* Enable TX */ |
@@ -286,12 +287,10 @@ static void smc911x_enable(struct net_device *dev) | |||
286 | SMC_SET_FIFO_TSL(lp, 64); | 287 | SMC_SET_FIFO_TSL(lp, 64); |
287 | SMC_SET_GPT_CFG(lp, GPT_CFG_TIMER_EN_ | 10000); | 288 | SMC_SET_GPT_CFG(lp, GPT_CFG_TIMER_EN_ | 10000); |
288 | 289 | ||
289 | spin_lock_irqsave(&lp->lock, flags); | ||
290 | SMC_GET_MAC_CR(lp, cr); | 290 | SMC_GET_MAC_CR(lp, cr); |
291 | cr |= MAC_CR_TXEN_ | MAC_CR_HBDIS_; | 291 | cr |= MAC_CR_TXEN_ | MAC_CR_HBDIS_; |
292 | SMC_SET_MAC_CR(lp, cr); | 292 | SMC_SET_MAC_CR(lp, cr); |
293 | SMC_SET_TX_CFG(lp, TX_CFG_TX_ON_); | 293 | SMC_SET_TX_CFG(lp, TX_CFG_TX_ON_); |
294 | spin_unlock_irqrestore(&lp->lock, flags); | ||
295 | 294 | ||
296 | /* Add 2 byte padding to start of packets */ | 295 | /* Add 2 byte padding to start of packets */ |
297 | SMC_SET_RX_CFG(lp, (2<<8) & RX_CFG_RXDOFF_); | 296 | SMC_SET_RX_CFG(lp, (2<<8) & RX_CFG_RXDOFF_); |
@@ -300,9 +299,7 @@ static void smc911x_enable(struct net_device *dev) | |||
300 | if (cr & MAC_CR_RXEN_) | 299 | if (cr & MAC_CR_RXEN_) |
301 | DBG(SMC_DEBUG_RX, "%s: Receiver already enabled\n", dev->name); | 300 | DBG(SMC_DEBUG_RX, "%s: Receiver already enabled\n", dev->name); |
302 | 301 | ||
303 | spin_lock_irqsave(&lp->lock, flags); | ||
304 | SMC_SET_MAC_CR(lp, cr | MAC_CR_RXEN_); | 302 | SMC_SET_MAC_CR(lp, cr | MAC_CR_RXEN_); |
305 | spin_unlock_irqrestore(&lp->lock, flags); | ||
306 | 303 | ||
307 | /* Interrupt on every received packet */ | 304 | /* Interrupt on every received packet */ |
308 | SMC_SET_FIFO_RSA(lp, 0x01); | 305 | SMC_SET_FIFO_RSA(lp, 0x01); |
@@ -318,6 +315,8 @@ static void smc911x_enable(struct net_device *dev) | |||
318 | mask|=INT_EN_RDFO_EN_; | 315 | mask|=INT_EN_RDFO_EN_; |
319 | } | 316 | } |
320 | SMC_ENABLE_INT(lp, mask); | 317 | SMC_ENABLE_INT(lp, mask); |
318 | |||
319 | spin_unlock_irqrestore(&lp->lock, flags); | ||
321 | } | 320 | } |
322 | 321 | ||
323 | /* | 322 | /* |
@@ -458,7 +457,6 @@ static void smc911x_hardware_send_pkt(struct net_device *dev) | |||
458 | struct sk_buff *skb; | 457 | struct sk_buff *skb; |
459 | unsigned int cmdA, cmdB, len; | 458 | unsigned int cmdA, cmdB, len; |
460 | unsigned char *buf; | 459 | unsigned char *buf; |
461 | unsigned long flags; | ||
462 | 460 | ||
463 | DBG(SMC_DEBUG_FUNC | SMC_DEBUG_TX, "%s: --> %s\n", dev->name, __func__); | 461 | DBG(SMC_DEBUG_FUNC | SMC_DEBUG_TX, "%s: --> %s\n", dev->name, __func__); |
464 | BUG_ON(lp->pending_tx_skb == NULL); | 462 | BUG_ON(lp->pending_tx_skb == NULL); |
@@ -501,13 +499,11 @@ static void smc911x_hardware_send_pkt(struct net_device *dev) | |||
501 | #else | 499 | #else |
502 | SMC_PUSH_DATA(lp, buf, len); | 500 | SMC_PUSH_DATA(lp, buf, len); |
503 | dev->trans_start = jiffies; | 501 | dev->trans_start = jiffies; |
504 | dev_kfree_skb(skb); | 502 | dev_kfree_skb_irq(skb); |
505 | #endif | 503 | #endif |
506 | spin_lock_irqsave(&lp->lock, flags); | ||
507 | if (!lp->tx_throttle) { | 504 | if (!lp->tx_throttle) { |
508 | netif_wake_queue(dev); | 505 | netif_wake_queue(dev); |
509 | } | 506 | } |
510 | spin_unlock_irqrestore(&lp->lock, flags); | ||
511 | SMC_ENABLE_INT(lp, INT_EN_TDFA_EN_ | INT_EN_TSFL_EN_); | 507 | SMC_ENABLE_INT(lp, INT_EN_TDFA_EN_ | INT_EN_TSFL_EN_); |
512 | } | 508 | } |
513 | 509 | ||
@@ -526,6 +522,8 @@ static int smc911x_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
526 | DBG(SMC_DEBUG_FUNC | SMC_DEBUG_TX, "%s: --> %s\n", | 522 | DBG(SMC_DEBUG_FUNC | SMC_DEBUG_TX, "%s: --> %s\n", |
527 | dev->name, __func__); | 523 | dev->name, __func__); |
528 | 524 | ||
525 | spin_lock_irqsave(&lp->lock, flags); | ||
526 | |||
529 | BUG_ON(lp->pending_tx_skb != NULL); | 527 | BUG_ON(lp->pending_tx_skb != NULL); |
530 | 528 | ||
531 | free = SMC_GET_TX_FIFO_INF(lp) & TX_FIFO_INF_TDFREE_; | 529 | free = SMC_GET_TX_FIFO_INF(lp) & TX_FIFO_INF_TDFREE_; |
@@ -535,12 +533,10 @@ static int smc911x_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
535 | if (free <= SMC911X_TX_FIFO_LOW_THRESHOLD) { | 533 | if (free <= SMC911X_TX_FIFO_LOW_THRESHOLD) { |
536 | DBG(SMC_DEBUG_TX, "%s: Disabling data flow due to low FIFO space (%d)\n", | 534 | DBG(SMC_DEBUG_TX, "%s: Disabling data flow due to low FIFO space (%d)\n", |
537 | dev->name, free); | 535 | dev->name, free); |
538 | spin_lock_irqsave(&lp->lock, flags); | ||
539 | /* Reenable when at least 1 packet of size MTU present */ | 536 | /* Reenable when at least 1 packet of size MTU present */ |
540 | SMC_SET_FIFO_TDA(lp, (SMC911X_TX_FIFO_LOW_THRESHOLD)/64); | 537 | SMC_SET_FIFO_TDA(lp, (SMC911X_TX_FIFO_LOW_THRESHOLD)/64); |
541 | lp->tx_throttle = 1; | 538 | lp->tx_throttle = 1; |
542 | netif_stop_queue(dev); | 539 | netif_stop_queue(dev); |
543 | spin_unlock_irqrestore(&lp->lock, flags); | ||
544 | } | 540 | } |
545 | 541 | ||
546 | /* Drop packets when we run out of space in TX FIFO | 542 | /* Drop packets when we run out of space in TX FIFO |
@@ -556,6 +552,7 @@ static int smc911x_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
556 | lp->pending_tx_skb = NULL; | 552 | lp->pending_tx_skb = NULL; |
557 | dev->stats.tx_errors++; | 553 | dev->stats.tx_errors++; |
558 | dev->stats.tx_dropped++; | 554 | dev->stats.tx_dropped++; |
555 | spin_unlock_irqrestore(&lp->lock, flags); | ||
559 | dev_kfree_skb(skb); | 556 | dev_kfree_skb(skb); |
560 | return 0; | 557 | return 0; |
561 | } | 558 | } |
@@ -565,7 +562,6 @@ static int smc911x_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
565 | /* If the DMA is already running then defer this packet Tx until | 562 | /* If the DMA is already running then defer this packet Tx until |
566 | * the DMA IRQ starts it | 563 | * the DMA IRQ starts it |
567 | */ | 564 | */ |
568 | spin_lock_irqsave(&lp->lock, flags); | ||
569 | if (lp->txdma_active) { | 565 | if (lp->txdma_active) { |
570 | DBG(SMC_DEBUG_TX | SMC_DEBUG_DMA, "%s: Tx DMA running, deferring packet\n", dev->name); | 566 | DBG(SMC_DEBUG_TX | SMC_DEBUG_DMA, "%s: Tx DMA running, deferring packet\n", dev->name); |
571 | lp->pending_tx_skb = skb; | 567 | lp->pending_tx_skb = skb; |
@@ -576,11 +572,11 @@ static int smc911x_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
576 | DBG(SMC_DEBUG_TX | SMC_DEBUG_DMA, "%s: Activating Tx DMA\n", dev->name); | 572 | DBG(SMC_DEBUG_TX | SMC_DEBUG_DMA, "%s: Activating Tx DMA\n", dev->name); |
577 | lp->txdma_active = 1; | 573 | lp->txdma_active = 1; |
578 | } | 574 | } |
579 | spin_unlock_irqrestore(&lp->lock, flags); | ||
580 | } | 575 | } |
581 | #endif | 576 | #endif |
582 | lp->pending_tx_skb = skb; | 577 | lp->pending_tx_skb = skb; |
583 | smc911x_hardware_send_pkt(dev); | 578 | smc911x_hardware_send_pkt(dev); |
579 | spin_unlock_irqrestore(&lp->lock, flags); | ||
584 | 580 | ||
585 | return 0; | 581 | return 0; |
586 | } | 582 | } |
@@ -1242,7 +1238,7 @@ smc911x_rx_dma_irq(int dma, void *data) | |||
1242 | netif_rx(skb); | 1238 | netif_rx(skb); |
1243 | 1239 | ||
1244 | spin_lock_irqsave(&lp->lock, flags); | 1240 | spin_lock_irqsave(&lp->lock, flags); |
1245 | pkts = (SMC_GET_RX_FIFO_INF() & RX_FIFO_INF_RXSUSED_) >> 16; | 1241 | pkts = (SMC_GET_RX_FIFO_INF(lp) & RX_FIFO_INF_RXSUSED_) >> 16; |
1246 | if (pkts != 0) { | 1242 | if (pkts != 0) { |
1247 | smc911x_rcv(dev); | 1243 | smc911x_rcv(dev); |
1248 | }else { | 1244 | }else { |
@@ -2054,7 +2050,7 @@ err_out: | |||
2054 | */ | 2050 | */ |
2055 | static int smc911x_drv_probe(struct platform_device *pdev) | 2051 | static int smc911x_drv_probe(struct platform_device *pdev) |
2056 | { | 2052 | { |
2057 | struct smc91x_platdata *pd = pdev->dev.platform_data; | 2053 | struct smc911x_platdata *pd = pdev->dev.platform_data; |
2058 | struct net_device *ndev; | 2054 | struct net_device *ndev; |
2059 | struct resource *res; | 2055 | struct resource *res; |
2060 | struct smc911x_local *lp; | 2056 | struct smc911x_local *lp; |
diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h index bf6240f23f5d..cc7d85bdfb3e 100644 --- a/drivers/net/smc911x.h +++ b/drivers/net/smc911x.h | |||
@@ -50,6 +50,10 @@ | |||
50 | #define SMC_DYNAMIC_BUS_CONFIG | 50 | #define SMC_DYNAMIC_BUS_CONFIG |
51 | #endif | 51 | #endif |
52 | 52 | ||
53 | #ifdef SMC_USE_PXA_DMA | ||
54 | #define SMC_USE_DMA | ||
55 | #endif | ||
56 | |||
53 | /* store this information for the driver.. */ | 57 | /* store this information for the driver.. */ |
54 | struct smc911x_local { | 58 | struct smc911x_local { |
55 | /* | 59 | /* |
@@ -196,8 +200,6 @@ static inline void SMC_outsl(struct smc911x_local *lp, int reg, | |||
196 | 200 | ||
197 | 201 | ||
198 | #ifdef SMC_USE_PXA_DMA | 202 | #ifdef SMC_USE_PXA_DMA |
199 | #define SMC_USE_DMA | ||
200 | |||
201 | /* | 203 | /* |
202 | * Define the request and free functions | 204 | * Define the request and free functions |
203 | * These are unfortunately architecture specific as no generic allocation | 205 | * These are unfortunately architecture specific as no generic allocation |
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index c70870e0fd61..fc80f250da31 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
@@ -2060,7 +2060,7 @@ static int smc_request_attrib(struct platform_device *pdev, | |||
2060 | struct net_device *ndev) | 2060 | struct net_device *ndev) |
2061 | { | 2061 | { |
2062 | struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); | 2062 | struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); |
2063 | struct smc_local *lp = netdev_priv(ndev); | 2063 | struct smc_local *lp __maybe_unused = netdev_priv(ndev); |
2064 | 2064 | ||
2065 | if (!res) | 2065 | if (!res) |
2066 | return 0; | 2066 | return 0; |
@@ -2075,7 +2075,7 @@ static void smc_release_attrib(struct platform_device *pdev, | |||
2075 | struct net_device *ndev) | 2075 | struct net_device *ndev) |
2076 | { | 2076 | { |
2077 | struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); | 2077 | struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); |
2078 | struct smc_local *lp = netdev_priv(ndev); | 2078 | struct smc_local *lp __maybe_unused = netdev_priv(ndev); |
2079 | 2079 | ||
2080 | if (res) | 2080 | if (res) |
2081 | release_mem_region(res->start, ATTRIB_SIZE); | 2081 | release_mem_region(res->start, ATTRIB_SIZE); |
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index 8e46a513a252..c91852f49a48 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c | |||
@@ -420,9 +420,13 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
420 | /* Allocate Tx/Rx descriptor memory */ | 420 | /* Allocate Tx/Rx descriptor memory */ |
421 | db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) * | 421 | db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) * |
422 | DESC_ALL_CNT + 0x20, &db->desc_pool_dma_ptr); | 422 | DESC_ALL_CNT + 0x20, &db->desc_pool_dma_ptr); |
423 | if (!db->desc_pool_ptr) | ||
424 | goto err_out_res; | ||
423 | 425 | ||
424 | db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC * | 426 | db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC * |
425 | TX_DESC_CNT + 4, &db->buf_pool_dma_ptr); | 427 | TX_DESC_CNT + 4, &db->buf_pool_dma_ptr); |
428 | if (!db->buf_pool_ptr) | ||
429 | goto err_out_free_desc; | ||
426 | 430 | ||
427 | db->first_tx_desc = (struct tx_desc *) db->desc_pool_ptr; | 431 | db->first_tx_desc = (struct tx_desc *) db->desc_pool_ptr; |
428 | db->first_tx_desc_dma = db->desc_pool_dma_ptr; | 432 | db->first_tx_desc_dma = db->desc_pool_dma_ptr; |
@@ -469,7 +473,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
469 | 473 | ||
470 | err = register_netdev (dev); | 474 | err = register_netdev (dev); |
471 | if (err) | 475 | if (err) |
472 | goto err_out_res; | 476 | goto err_out_free_buf; |
473 | 477 | ||
474 | printk(KERN_INFO "%s: Davicom DM%04lx at pci%s, " | 478 | printk(KERN_INFO "%s: Davicom DM%04lx at pci%s, " |
475 | "%s, irq %d.\n", | 479 | "%s, irq %d.\n", |
@@ -483,6 +487,12 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
483 | 487 | ||
484 | return 0; | 488 | return 0; |
485 | 489 | ||
490 | err_out_free_buf: | ||
491 | pci_free_consistent(pdev, TX_BUF_ALLOC * TX_DESC_CNT + 4, | ||
492 | db->buf_pool_ptr, db->buf_pool_dma_ptr); | ||
493 | err_out_free_desc: | ||
494 | pci_free_consistent(pdev, sizeof(struct tx_desc) * DESC_ALL_CNT + 0x20, | ||
495 | db->desc_pool_ptr, db->desc_pool_dma_ptr); | ||
486 | err_out_res: | 496 | err_out_res: |
487 | pci_release_regions(pdev); | 497 | pci_release_regions(pdev); |
488 | err_out_disable: | 498 | err_out_disable: |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 6daea0c91862..33b6d1b122fb 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -1070,8 +1070,6 @@ static int tun_chr_close(struct inode *inode, struct file *file) | |||
1070 | 1070 | ||
1071 | DBG(KERN_INFO "%s: tun_chr_close\n", tun->dev->name); | 1071 | DBG(KERN_INFO "%s: tun_chr_close\n", tun->dev->name); |
1072 | 1072 | ||
1073 | tun_chr_fasync(-1, file, 0); | ||
1074 | |||
1075 | rtnl_lock(); | 1073 | rtnl_lock(); |
1076 | 1074 | ||
1077 | /* Detach from net device */ | 1075 | /* Detach from net device */ |
diff --git a/drivers/net/ucc_geth_ethtool.c b/drivers/net/ucc_geth_ethtool.c index cfbbfee55836..85f38a6b6a49 100644 --- a/drivers/net/ucc_geth_ethtool.c +++ b/drivers/net/ucc_geth_ethtool.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <asm/irq.h> | 37 | #include <asm/irq.h> |
38 | #include <asm/uaccess.h> | 38 | #include <asm/uaccess.h> |
39 | #include <asm/types.h> | 39 | #include <asm/types.h> |
40 | #include <asm/uaccess.h> | ||
41 | 40 | ||
42 | #include "ucc_geth.h" | 41 | #include "ucc_geth.h" |
43 | #include "ucc_geth_mii.h" | 42 | #include "ucc_geth_mii.h" |
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 78df2be8a728..db3377dae9d5 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
@@ -396,6 +396,20 @@ static void dm9601_set_multicast(struct net_device *net) | |||
396 | dm_write_reg_async(dev, DM_RX_CTRL, rx_ctl); | 396 | dm_write_reg_async(dev, DM_RX_CTRL, rx_ctl); |
397 | } | 397 | } |
398 | 398 | ||
399 | static int dm9601_set_mac_address(struct net_device *net, void *p) | ||
400 | { | ||
401 | struct sockaddr *addr = p; | ||
402 | struct usbnet *dev = netdev_priv(net); | ||
403 | |||
404 | if (!is_valid_ether_addr(addr->sa_data)) | ||
405 | return -EINVAL; | ||
406 | |||
407 | memcpy(net->dev_addr, addr->sa_data, net->addr_len); | ||
408 | dm_write_async(dev, DM_PHY_ADDR, net->addr_len, net->dev_addr); | ||
409 | |||
410 | return 0; | ||
411 | } | ||
412 | |||
399 | static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf) | 413 | static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf) |
400 | { | 414 | { |
401 | int ret; | 415 | int ret; |
@@ -406,6 +420,7 @@ static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf) | |||
406 | 420 | ||
407 | dev->net->do_ioctl = dm9601_ioctl; | 421 | dev->net->do_ioctl = dm9601_ioctl; |
408 | dev->net->set_multicast_list = dm9601_set_multicast; | 422 | dev->net->set_multicast_list = dm9601_set_multicast; |
423 | dev->net->set_mac_address = dm9601_set_mac_address; | ||
409 | dev->net->ethtool_ops = &dm9601_ethtool_ops; | 424 | dev->net->ethtool_ops = &dm9601_ethtool_ops; |
410 | dev->net->hard_header_len += DM_TX_OVERHEAD; | 425 | dev->net->hard_header_len += DM_TX_OVERHEAD; |
411 | dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len; | 426 | dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len; |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 1164c52e2c0a..8e90891f0e42 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -2184,19 +2184,20 @@ static void hso_create_rfkill(struct hso_device *hso_dev, | |||
2184 | struct usb_interface *interface) | 2184 | struct usb_interface *interface) |
2185 | { | 2185 | { |
2186 | struct hso_net *hso_net = dev2net(hso_dev); | 2186 | struct hso_net *hso_net = dev2net(hso_dev); |
2187 | struct device *dev = hso_dev->dev; | 2187 | struct device *dev = &hso_net->net->dev; |
2188 | char *rfkn; | 2188 | char *rfkn; |
2189 | 2189 | ||
2190 | hso_net->rfkill = rfkill_allocate(&interface_to_usbdev(interface)->dev, | 2190 | hso_net->rfkill = rfkill_allocate(&interface_to_usbdev(interface)->dev, |
2191 | RFKILL_TYPE_WLAN); | 2191 | RFKILL_TYPE_WWAN); |
2192 | if (!hso_net->rfkill) { | 2192 | if (!hso_net->rfkill) { |
2193 | dev_err(dev, "%s - Out of memory", __func__); | 2193 | dev_err(dev, "%s - Out of memory\n", __func__); |
2194 | return; | 2194 | return; |
2195 | } | 2195 | } |
2196 | rfkn = kzalloc(20, GFP_KERNEL); | 2196 | rfkn = kzalloc(20, GFP_KERNEL); |
2197 | if (!rfkn) { | 2197 | if (!rfkn) { |
2198 | rfkill_free(hso_net->rfkill); | 2198 | rfkill_free(hso_net->rfkill); |
2199 | dev_err(dev, "%s - Out of memory", __func__); | 2199 | hso_net->rfkill = NULL; |
2200 | dev_err(dev, "%s - Out of memory\n", __func__); | ||
2200 | return; | 2201 | return; |
2201 | } | 2202 | } |
2202 | snprintf(rfkn, 20, "hso-%d", | 2203 | snprintf(rfkn, 20, "hso-%d", |
@@ -2209,7 +2210,8 @@ static void hso_create_rfkill(struct hso_device *hso_dev, | |||
2209 | kfree(rfkn); | 2210 | kfree(rfkn); |
2210 | hso_net->rfkill->name = NULL; | 2211 | hso_net->rfkill->name = NULL; |
2211 | rfkill_free(hso_net->rfkill); | 2212 | rfkill_free(hso_net->rfkill); |
2212 | dev_err(dev, "%s - Failed to register rfkill", __func__); | 2213 | hso_net->rfkill = NULL; |
2214 | dev_err(dev, "%s - Failed to register rfkill\n", __func__); | ||
2213 | return; | 2215 | return; |
2214 | } | 2216 | } |
2215 | } | 2217 | } |
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 2dced383bcfb..3590ea5a902d 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -521,7 +521,7 @@ static void __devexit velocity_remove1(struct pci_dev *pdev) | |||
521 | * we don't duplicate code for each option. | 521 | * we don't duplicate code for each option. |
522 | */ | 522 | */ |
523 | 523 | ||
524 | static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max, int def, char *name, char *devname) | 524 | static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max, int def, char *name, const char *devname) |
525 | { | 525 | { |
526 | if (val == -1) | 526 | if (val == -1) |
527 | *opt = def; | 527 | *opt = def; |
@@ -550,7 +550,7 @@ static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max, | |||
550 | * we don't duplicate code for each option. | 550 | * we don't duplicate code for each option. |
551 | */ | 551 | */ |
552 | 552 | ||
553 | static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 flag, char *name, char *devname) | 553 | static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 flag, char *name, const char *devname) |
554 | { | 554 | { |
555 | (*opt) &= (~flag); | 555 | (*opt) &= (~flag); |
556 | if (val == -1) | 556 | if (val == -1) |
@@ -576,7 +576,7 @@ static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 fla | |||
576 | * for the current device | 576 | * for the current device |
577 | */ | 577 | */ |
578 | 578 | ||
579 | static void __devinit velocity_get_options(struct velocity_opt *opts, int index, char *devname) | 579 | static void __devinit velocity_get_options(struct velocity_opt *opts, int index, const char *devname) |
580 | { | 580 | { |
581 | 581 | ||
582 | velocity_set_int_opt(&opts->rx_thresh, rx_thresh[index], RX_THRESH_MIN, RX_THRESH_MAX, RX_THRESH_DEF, "rx_thresh", devname); | 582 | velocity_set_int_opt(&opts->rx_thresh, rx_thresh[index], RX_THRESH_MIN, RX_THRESH_MAX, RX_THRESH_DEF, "rx_thresh", devname); |
@@ -863,6 +863,7 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi | |||
863 | static int first = 1; | 863 | static int first = 1; |
864 | struct net_device *dev; | 864 | struct net_device *dev; |
865 | int i; | 865 | int i; |
866 | const char *drv_string; | ||
866 | const struct velocity_info_tbl *info = &chip_info_table[ent->driver_data]; | 867 | const struct velocity_info_tbl *info = &chip_info_table[ent->driver_data]; |
867 | struct velocity_info *vptr; | 868 | struct velocity_info *vptr; |
868 | struct mac_regs __iomem * regs; | 869 | struct mac_regs __iomem * regs; |
@@ -935,7 +936,9 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi | |||
935 | dev->dev_addr[i] = readb(®s->PAR[i]); | 936 | dev->dev_addr[i] = readb(®s->PAR[i]); |
936 | 937 | ||
937 | 938 | ||
938 | velocity_get_options(&vptr->options, velocity_nics, dev->name); | 939 | drv_string = dev_driver_string(&pdev->dev); |
940 | |||
941 | velocity_get_options(&vptr->options, velocity_nics, drv_string); | ||
939 | 942 | ||
940 | /* | 943 | /* |
941 | * Mask out the options cannot be set to the chip | 944 | * Mask out the options cannot be set to the chip |
diff --git a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c index 327d58589e12..6e92f7b44b1a 100644 --- a/drivers/net/wan/syncppp.c +++ b/drivers/net/wan/syncppp.c | |||
@@ -756,10 +756,11 @@ static void sppp_cisco_input (struct sppp *sp, struct sk_buff *skb) | |||
756 | case CISCO_ADDR_REQ: | 756 | case CISCO_ADDR_REQ: |
757 | /* Stolen from net/ipv4/devinet.c -- SIOCGIFADDR ioctl */ | 757 | /* Stolen from net/ipv4/devinet.c -- SIOCGIFADDR ioctl */ |
758 | { | 758 | { |
759 | struct in_device *in_dev; | ||
760 | struct in_ifaddr *ifa; | ||
761 | __be32 addr = 0, mask = htonl(~0U); /* FIXME: is the mask correct? */ | 759 | __be32 addr = 0, mask = htonl(~0U); /* FIXME: is the mask correct? */ |
762 | #ifdef CONFIG_INET | 760 | #ifdef CONFIG_INET |
761 | struct in_device *in_dev; | ||
762 | struct in_ifaddr *ifa; | ||
763 | |||
763 | rcu_read_lock(); | 764 | rcu_read_lock(); |
764 | if ((in_dev = __in_dev_get_rcu(dev)) != NULL) | 765 | if ((in_dev = __in_dev_get_rcu(dev)) != NULL) |
765 | { | 766 | { |
diff --git a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c index ccd9cd35ecbe..5bf7e01ef0e9 100644 --- a/drivers/net/wan/z85230.c +++ b/drivers/net/wan/z85230.c | |||
@@ -695,7 +695,6 @@ EXPORT_SYMBOL(z8530_nop); | |||
695 | * z8530_interrupt - Handle an interrupt from a Z8530 | 695 | * z8530_interrupt - Handle an interrupt from a Z8530 |
696 | * @irq: Interrupt number | 696 | * @irq: Interrupt number |
697 | * @dev_id: The Z8530 device that is interrupting. | 697 | * @dev_id: The Z8530 device that is interrupting. |
698 | * @regs: unused | ||
699 | * | 698 | * |
700 | * A Z85[2]30 device has stuck its hand in the air for attention. | 699 | * A Z85[2]30 device has stuck its hand in the air for attention. |
701 | * We scan both the channels on the chip for events and then call | 700 | * We scan both the channels on the chip for events and then call |
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index 9b95c4049b31..cfd4d052d666 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -340,9 +340,9 @@ static inline u64 ath5k_extend_tsf(struct ath5k_hw *ah, u32 rstamp) | |||
340 | } | 340 | } |
341 | 341 | ||
342 | /* Interrupt handling */ | 342 | /* Interrupt handling */ |
343 | static int ath5k_init(struct ath5k_softc *sc); | 343 | static int ath5k_init(struct ath5k_softc *sc, bool is_resume); |
344 | static int ath5k_stop_locked(struct ath5k_softc *sc); | 344 | static int ath5k_stop_locked(struct ath5k_softc *sc); |
345 | static int ath5k_stop_hw(struct ath5k_softc *sc); | 345 | static int ath5k_stop_hw(struct ath5k_softc *sc, bool is_suspend); |
346 | static irqreturn_t ath5k_intr(int irq, void *dev_id); | 346 | static irqreturn_t ath5k_intr(int irq, void *dev_id); |
347 | static void ath5k_tasklet_reset(unsigned long data); | 347 | static void ath5k_tasklet_reset(unsigned long data); |
348 | 348 | ||
@@ -646,7 +646,7 @@ ath5k_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
646 | 646 | ||
647 | ath5k_led_off(sc); | 647 | ath5k_led_off(sc); |
648 | 648 | ||
649 | ath5k_stop_hw(sc); | 649 | ath5k_stop_hw(sc, true); |
650 | 650 | ||
651 | free_irq(pdev->irq, sc); | 651 | free_irq(pdev->irq, sc); |
652 | pci_save_state(pdev); | 652 | pci_save_state(pdev); |
@@ -661,8 +661,7 @@ ath5k_pci_resume(struct pci_dev *pdev) | |||
661 | { | 661 | { |
662 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); | 662 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); |
663 | struct ath5k_softc *sc = hw->priv; | 663 | struct ath5k_softc *sc = hw->priv; |
664 | struct ath5k_hw *ah = sc->ah; | 664 | int err; |
665 | int i, err; | ||
666 | 665 | ||
667 | pci_restore_state(pdev); | 666 | pci_restore_state(pdev); |
668 | 667 | ||
@@ -683,21 +682,11 @@ ath5k_pci_resume(struct pci_dev *pdev) | |||
683 | goto err_no_irq; | 682 | goto err_no_irq; |
684 | } | 683 | } |
685 | 684 | ||
686 | err = ath5k_init(sc); | 685 | err = ath5k_init(sc, true); |
687 | if (err) | 686 | if (err) |
688 | goto err_irq; | 687 | goto err_irq; |
689 | ath5k_led_enable(sc); | 688 | ath5k_led_enable(sc); |
690 | 689 | ||
691 | /* | ||
692 | * Reset the key cache since some parts do not | ||
693 | * reset the contents on initial power up or resume. | ||
694 | * | ||
695 | * FIXME: This may need to be revisited when mac80211 becomes | ||
696 | * aware of suspend/resume. | ||
697 | */ | ||
698 | for (i = 0; i < AR5K_KEYTABLE_SIZE; i++) | ||
699 | ath5k_hw_reset_key(ah, i); | ||
700 | |||
701 | return 0; | 690 | return 0; |
702 | err_irq: | 691 | err_irq: |
703 | free_irq(pdev->irq, sc); | 692 | free_irq(pdev->irq, sc); |
@@ -718,7 +707,6 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw) | |||
718 | struct ath5k_softc *sc = hw->priv; | 707 | struct ath5k_softc *sc = hw->priv; |
719 | struct ath5k_hw *ah = sc->ah; | 708 | struct ath5k_hw *ah = sc->ah; |
720 | u8 mac[ETH_ALEN]; | 709 | u8 mac[ETH_ALEN]; |
721 | unsigned int i; | ||
722 | int ret; | 710 | int ret; |
723 | 711 | ||
724 | ATH5K_DBG(sc, ATH5K_DEBUG_ANY, "devid 0x%x\n", pdev->device); | 712 | ATH5K_DBG(sc, ATH5K_DEBUG_ANY, "devid 0x%x\n", pdev->device); |
@@ -737,13 +725,6 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw) | |||
737 | __set_bit(ATH_STAT_MRRETRY, sc->status); | 725 | __set_bit(ATH_STAT_MRRETRY, sc->status); |
738 | 726 | ||
739 | /* | 727 | /* |
740 | * Reset the key cache since some parts do not | ||
741 | * reset the contents on initial power up. | ||
742 | */ | ||
743 | for (i = 0; i < AR5K_KEYTABLE_SIZE; i++) | ||
744 | ath5k_hw_reset_key(ah, i); | ||
745 | |||
746 | /* | ||
747 | * Collect the channel list. The 802.11 layer | 728 | * Collect the channel list. The 802.11 layer |
748 | * is resposible for filtering this list based | 729 | * is resposible for filtering this list based |
749 | * on settings like the phy mode and regulatory | 730 | * on settings like the phy mode and regulatory |
@@ -2200,12 +2181,18 @@ ath5k_beacon_config(struct ath5k_softc *sc) | |||
2200 | \********************/ | 2181 | \********************/ |
2201 | 2182 | ||
2202 | static int | 2183 | static int |
2203 | ath5k_init(struct ath5k_softc *sc) | 2184 | ath5k_init(struct ath5k_softc *sc, bool is_resume) |
2204 | { | 2185 | { |
2205 | int ret; | 2186 | struct ath5k_hw *ah = sc->ah; |
2187 | int ret, i; | ||
2206 | 2188 | ||
2207 | mutex_lock(&sc->lock); | 2189 | mutex_lock(&sc->lock); |
2208 | 2190 | ||
2191 | if (is_resume && !test_bit(ATH_STAT_STARTED, sc->status)) | ||
2192 | goto out_ok; | ||
2193 | |||
2194 | __clear_bit(ATH_STAT_STARTED, sc->status); | ||
2195 | |||
2209 | ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "mode %d\n", sc->opmode); | 2196 | ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "mode %d\n", sc->opmode); |
2210 | 2197 | ||
2211 | /* | 2198 | /* |
@@ -2230,12 +2217,22 @@ ath5k_init(struct ath5k_softc *sc) | |||
2230 | if (ret) | 2217 | if (ret) |
2231 | goto done; | 2218 | goto done; |
2232 | 2219 | ||
2220 | /* | ||
2221 | * Reset the key cache since some parts do not reset the | ||
2222 | * contents on initial power up or resume from suspend. | ||
2223 | */ | ||
2224 | for (i = 0; i < AR5K_KEYTABLE_SIZE; i++) | ||
2225 | ath5k_hw_reset_key(ah, i); | ||
2226 | |||
2227 | __set_bit(ATH_STAT_STARTED, sc->status); | ||
2228 | |||
2233 | /* Set ack to be sent at low bit-rates */ | 2229 | /* Set ack to be sent at low bit-rates */ |
2234 | ath5k_hw_set_ack_bitrate_high(sc->ah, false); | 2230 | ath5k_hw_set_ack_bitrate_high(ah, false); |
2235 | 2231 | ||
2236 | mod_timer(&sc->calib_tim, round_jiffies(jiffies + | 2232 | mod_timer(&sc->calib_tim, round_jiffies(jiffies + |
2237 | msecs_to_jiffies(ath5k_calinterval * 1000))); | 2233 | msecs_to_jiffies(ath5k_calinterval * 1000))); |
2238 | 2234 | ||
2235 | out_ok: | ||
2239 | ret = 0; | 2236 | ret = 0; |
2240 | done: | 2237 | done: |
2241 | mmiowb(); | 2238 | mmiowb(); |
@@ -2290,7 +2287,7 @@ ath5k_stop_locked(struct ath5k_softc *sc) | |||
2290 | * stop is preempted). | 2287 | * stop is preempted). |
2291 | */ | 2288 | */ |
2292 | static int | 2289 | static int |
2293 | ath5k_stop_hw(struct ath5k_softc *sc) | 2290 | ath5k_stop_hw(struct ath5k_softc *sc, bool is_suspend) |
2294 | { | 2291 | { |
2295 | int ret; | 2292 | int ret; |
2296 | 2293 | ||
@@ -2321,6 +2318,9 @@ ath5k_stop_hw(struct ath5k_softc *sc) | |||
2321 | } | 2318 | } |
2322 | } | 2319 | } |
2323 | ath5k_txbuf_free(sc, sc->bbuf); | 2320 | ath5k_txbuf_free(sc, sc->bbuf); |
2321 | if (!is_suspend) | ||
2322 | __clear_bit(ATH_STAT_STARTED, sc->status); | ||
2323 | |||
2324 | mmiowb(); | 2324 | mmiowb(); |
2325 | mutex_unlock(&sc->lock); | 2325 | mutex_unlock(&sc->lock); |
2326 | 2326 | ||
@@ -2718,12 +2718,12 @@ ath5k_reset_wake(struct ath5k_softc *sc) | |||
2718 | 2718 | ||
2719 | static int ath5k_start(struct ieee80211_hw *hw) | 2719 | static int ath5k_start(struct ieee80211_hw *hw) |
2720 | { | 2720 | { |
2721 | return ath5k_init(hw->priv); | 2721 | return ath5k_init(hw->priv, false); |
2722 | } | 2722 | } |
2723 | 2723 | ||
2724 | static void ath5k_stop(struct ieee80211_hw *hw) | 2724 | static void ath5k_stop(struct ieee80211_hw *hw) |
2725 | { | 2725 | { |
2726 | ath5k_stop_hw(hw->priv); | 2726 | ath5k_stop_hw(hw->priv, false); |
2727 | } | 2727 | } |
2728 | 2728 | ||
2729 | static int ath5k_add_interface(struct ieee80211_hw *hw, | 2729 | static int ath5k_add_interface(struct ieee80211_hw *hw, |
diff --git a/drivers/net/wireless/ath5k/base.h b/drivers/net/wireless/ath5k/base.h index 9d0b728928e3..06d1054ca94b 100644 --- a/drivers/net/wireless/ath5k/base.h +++ b/drivers/net/wireless/ath5k/base.h | |||
@@ -128,11 +128,12 @@ struct ath5k_softc { | |||
128 | size_t desc_len; /* size of TX/RX descriptors */ | 128 | size_t desc_len; /* size of TX/RX descriptors */ |
129 | u16 cachelsz; /* cache line size */ | 129 | u16 cachelsz; /* cache line size */ |
130 | 130 | ||
131 | DECLARE_BITMAP(status, 4); | 131 | DECLARE_BITMAP(status, 5); |
132 | #define ATH_STAT_INVALID 0 /* disable hardware accesses */ | 132 | #define ATH_STAT_INVALID 0 /* disable hardware accesses */ |
133 | #define ATH_STAT_MRRETRY 1 /* multi-rate retry support */ | 133 | #define ATH_STAT_MRRETRY 1 /* multi-rate retry support */ |
134 | #define ATH_STAT_PROMISC 2 | 134 | #define ATH_STAT_PROMISC 2 |
135 | #define ATH_STAT_LEDSOFT 3 /* enable LED gpio status */ | 135 | #define ATH_STAT_LEDSOFT 3 /* enable LED gpio status */ |
136 | #define ATH_STAT_STARTED 4 /* opened & irqs enabled */ | ||
136 | 137 | ||
137 | unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */ | 138 | unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */ |
138 | unsigned int curmode; /* current phy mode */ | 139 | unsigned int curmode; /* current phy mode */ |
diff --git a/drivers/net/wireless/ath5k/debug.c b/drivers/net/wireless/ath5k/debug.c index 8f92d670f614..19980cbd5d5f 100644 --- a/drivers/net/wireless/ath5k/debug.c +++ b/drivers/net/wireless/ath5k/debug.c | |||
@@ -339,7 +339,7 @@ static struct { | |||
339 | { ATH5K_DEBUG_BEACON, "beacon", "beacon handling" }, | 339 | { ATH5K_DEBUG_BEACON, "beacon", "beacon handling" }, |
340 | { ATH5K_DEBUG_CALIBRATE, "calib", "periodic calibration" }, | 340 | { ATH5K_DEBUG_CALIBRATE, "calib", "periodic calibration" }, |
341 | { ATH5K_DEBUG_TXPOWER, "txpower", "transmit power setting" }, | 341 | { ATH5K_DEBUG_TXPOWER, "txpower", "transmit power setting" }, |
342 | { ATH5K_DEBUG_LED, "led", "LED mamagement" }, | 342 | { ATH5K_DEBUG_LED, "led", "LED management" }, |
343 | { ATH5K_DEBUG_DUMP_RX, "dumprx", "print received skb content" }, | 343 | { ATH5K_DEBUG_DUMP_RX, "dumprx", "print received skb content" }, |
344 | { ATH5K_DEBUG_DUMP_TX, "dumptx", "print transmit skb content" }, | 344 | { ATH5K_DEBUG_DUMP_TX, "dumptx", "print transmit skb content" }, |
345 | { ATH5K_DEBUG_DUMPBANDS, "dumpbands", "dump bands" }, | 345 | { ATH5K_DEBUG_DUMPBANDS, "dumpbands", "dump bands" }, |
diff --git a/drivers/net/wireless/ath5k/desc.c b/drivers/net/wireless/ath5k/desc.c index dd1374052ba9..5e362a7a3620 100644 --- a/drivers/net/wireless/ath5k/desc.c +++ b/drivers/net/wireless/ath5k/desc.c | |||
@@ -531,10 +531,10 @@ static int ath5k_hw_proc_5210_rx_status(struct ath5k_hw *ah, | |||
531 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_SIGNAL); | 531 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_SIGNAL); |
532 | rs->rs_rate = AR5K_REG_MS(rx_status->rx_status_0, | 532 | rs->rs_rate = AR5K_REG_MS(rx_status->rx_status_0, |
533 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_RATE); | 533 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_RATE); |
534 | rs->rs_antenna = rx_status->rx_status_0 & | 534 | rs->rs_antenna = AR5K_REG_MS(rx_status->rx_status_0, |
535 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_ANTENNA; | 535 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_ANTENNA); |
536 | rs->rs_more = rx_status->rx_status_0 & | 536 | rs->rs_more = !!(rx_status->rx_status_0 & |
537 | AR5K_5210_RX_DESC_STATUS0_MORE; | 537 | AR5K_5210_RX_DESC_STATUS0_MORE); |
538 | /* TODO: this timestamp is 13 bit, later on we assume 15 bit */ | 538 | /* TODO: this timestamp is 13 bit, later on we assume 15 bit */ |
539 | rs->rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1, | 539 | rs->rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1, |
540 | AR5K_5210_RX_DESC_STATUS1_RECEIVE_TIMESTAMP); | 540 | AR5K_5210_RX_DESC_STATUS1_RECEIVE_TIMESTAMP); |
@@ -607,10 +607,10 @@ static int ath5k_hw_proc_5212_rx_status(struct ath5k_hw *ah, | |||
607 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_SIGNAL); | 607 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_SIGNAL); |
608 | rs->rs_rate = AR5K_REG_MS(rx_status->rx_status_0, | 608 | rs->rs_rate = AR5K_REG_MS(rx_status->rx_status_0, |
609 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_RATE); | 609 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_RATE); |
610 | rs->rs_antenna = rx_status->rx_status_0 & | 610 | rs->rs_antenna = AR5K_REG_MS(rx_status->rx_status_0, |
611 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_ANTENNA; | 611 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_ANTENNA); |
612 | rs->rs_more = rx_status->rx_status_0 & | 612 | rs->rs_more = !!(rx_status->rx_status_0 & |
613 | AR5K_5212_RX_DESC_STATUS0_MORE; | 613 | AR5K_5212_RX_DESC_STATUS0_MORE); |
614 | rs->rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1, | 614 | rs->rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1, |
615 | AR5K_5212_RX_DESC_STATUS1_RECEIVE_TIMESTAMP); | 615 | AR5K_5212_RX_DESC_STATUS1_RECEIVE_TIMESTAMP); |
616 | rs->rs_status = 0; | 616 | rs->rs_status = 0; |
diff --git a/drivers/net/wireless/ath5k/initvals.c b/drivers/net/wireless/ath5k/initvals.c index ea2e1a20b499..ceaa6c475c06 100644 --- a/drivers/net/wireless/ath5k/initvals.c +++ b/drivers/net/wireless/ath5k/initvals.c | |||
@@ -806,6 +806,8 @@ static const struct ath5k_ini_mode ar5212_rf5111_ini_mode_end[] = { | |||
806 | { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } }, | 806 | { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } }, |
807 | { AR5K_PHY(642), | 807 | { AR5K_PHY(642), |
808 | { 0xd03e6788, 0xd03e6788, 0xd03e6788, 0xd03e6788, 0xd03e6788 } }, | 808 | { 0xd03e6788, 0xd03e6788, 0xd03e6788, 0xd03e6788, 0xd03e6788 } }, |
809 | { 0xa228, | ||
810 | { 0x000001b5, 0x000001b5, 0x000001b5, 0x000001b5, 0x000001b5 } }, | ||
809 | { 0xa23c, | 811 | { 0xa23c, |
810 | { 0x13c889af, 0x13c889af, 0x13c889af, 0x13c889af, 0x13c889af } }, | 812 | { 0x13c889af, 0x13c889af, 0x13c889af, 0x13c889af, 0x13c889af } }, |
811 | }; | 813 | }; |
diff --git a/drivers/net/wireless/ath5k/reset.c b/drivers/net/wireless/ath5k/reset.c index 8f1886834e61..1b6d45b6772d 100644 --- a/drivers/net/wireless/ath5k/reset.c +++ b/drivers/net/wireless/ath5k/reset.c | |||
@@ -537,9 +537,10 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
537 | mdelay(1); | 537 | mdelay(1); |
538 | 538 | ||
539 | /* | 539 | /* |
540 | * Write some more initial register settings | 540 | * Write some more initial register settings for revised chips |
541 | */ | 541 | */ |
542 | if (ah->ah_version == AR5K_AR5212) { | 542 | if (ah->ah_version == AR5K_AR5212 && |
543 | ah->ah_phy_revision > 0x41) { | ||
543 | ath5k_hw_reg_write(ah, 0x0002a002, 0x982c); | 544 | ath5k_hw_reg_write(ah, 0x0002a002, 0x982c); |
544 | 545 | ||
545 | if (channel->hw_value == CHANNEL_G) | 546 | if (channel->hw_value == CHANNEL_G) |
@@ -558,19 +559,10 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
558 | else | 559 | else |
559 | ath5k_hw_reg_write(ah, 0x00000000, 0x994c); | 560 | ath5k_hw_reg_write(ah, 0x00000000, 0x994c); |
560 | 561 | ||
561 | /* Some bits are disabled here, we know nothing about | 562 | /* Got this from legacy-hal */ |
562 | * register 0xa228 yet, most of the times this ends up | 563 | AR5K_REG_DISABLE_BITS(ah, 0xa228, 0x200); |
563 | * with a value 0x9b5 -haven't seen any dump with | 564 | |
564 | * a different value- */ | 565 | AR5K_REG_MASKED_BITS(ah, 0xa228, 0x800, 0xfffe03ff); |
565 | /* Got this from decompiling binary HAL */ | ||
566 | data = ath5k_hw_reg_read(ah, 0xa228); | ||
567 | data &= 0xfffffdff; | ||
568 | ath5k_hw_reg_write(ah, data, 0xa228); | ||
569 | |||
570 | data = ath5k_hw_reg_read(ah, 0xa228); | ||
571 | data &= 0xfffe03ff; | ||
572 | ath5k_hw_reg_write(ah, data, 0xa228); | ||
573 | data = 0; | ||
574 | 566 | ||
575 | /* Just write 0x9b5 ? */ | 567 | /* Just write 0x9b5 ? */ |
576 | /* ath5k_hw_reg_write(ah, 0x000009b5, 0xa228); */ | 568 | /* ath5k_hw_reg_write(ah, 0x000009b5, 0xa228); */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 24a1aeb6448f..8d690a0eb1a9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2090,7 +2090,6 @@ static void iwl_alive_start(struct iwl_priv *priv) | |||
2090 | iwl4965_error_recovery(priv); | 2090 | iwl4965_error_recovery(priv); |
2091 | 2091 | ||
2092 | iwl_power_update_mode(priv, 1); | 2092 | iwl_power_update_mode(priv, 1); |
2093 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); | ||
2094 | 2093 | ||
2095 | if (test_and_clear_bit(STATUS_MODE_PENDING, &priv->status)) | 2094 | if (test_and_clear_bit(STATUS_MODE_PENDING, &priv->status)) |
2096 | iwl4965_set_mode(priv, priv->iw_mode); | 2095 | iwl4965_set_mode(priv, priv->iw_mode); |
@@ -2342,6 +2341,7 @@ static void iwl_bg_alive_start(struct work_struct *data) | |||
2342 | mutex_lock(&priv->mutex); | 2341 | mutex_lock(&priv->mutex); |
2343 | iwl_alive_start(priv); | 2342 | iwl_alive_start(priv); |
2344 | mutex_unlock(&priv->mutex); | 2343 | mutex_unlock(&priv->mutex); |
2344 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); | ||
2345 | } | 2345 | } |
2346 | 2346 | ||
2347 | static void iwl4965_bg_rf_kill(struct work_struct *work) | 2347 | static void iwl4965_bg_rf_kill(struct work_struct *work) |
@@ -3252,7 +3252,11 @@ static void iwl4965_mac_update_tkip_key(struct ieee80211_hw *hw, | |||
3252 | return; | 3252 | return; |
3253 | } | 3253 | } |
3254 | 3254 | ||
3255 | iwl_scan_cancel_timeout(priv, 100); | 3255 | if (iwl_scan_cancel(priv)) { |
3256 | /* cancel scan failed, just live w/ bad key and rely | ||
3257 | briefly on SW decryption */ | ||
3258 | return; | ||
3259 | } | ||
3256 | 3260 | ||
3257 | key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK); | 3261 | key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK); |
3258 | key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); | 3262 | key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 3b0bee331a33..c89365e2ca58 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -896,6 +896,13 @@ static void iwl_bg_request_scan(struct work_struct *data) | |||
896 | return; | 896 | return; |
897 | 897 | ||
898 | done: | 898 | done: |
899 | /* Cannot perform scan. Make sure we clear scanning | ||
900 | * bits from status so next scan request can be performed. | ||
901 | * If we don't clear scanning status bit here all next scan | ||
902 | * will fail | ||
903 | */ | ||
904 | clear_bit(STATUS_SCAN_HW, &priv->status); | ||
905 | clear_bit(STATUS_SCANNING, &priv->status); | ||
899 | /* inform mac80211 scan aborted */ | 906 | /* inform mac80211 scan aborted */ |
900 | queue_work(priv->workqueue, &priv->scan_completed); | 907 | queue_work(priv->workqueue, &priv->scan_completed); |
901 | mutex_unlock(&priv->mutex); | 908 | mutex_unlock(&priv->mutex); |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index d15a2c997954..285b53e7e261 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -5768,7 +5768,6 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv) | |||
5768 | if (priv->error_recovering) | 5768 | if (priv->error_recovering) |
5769 | iwl3945_error_recovery(priv); | 5769 | iwl3945_error_recovery(priv); |
5770 | 5770 | ||
5771 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); | ||
5772 | return; | 5771 | return; |
5773 | 5772 | ||
5774 | restart: | 5773 | restart: |
@@ -6013,6 +6012,7 @@ static void iwl3945_bg_alive_start(struct work_struct *data) | |||
6013 | mutex_lock(&priv->mutex); | 6012 | mutex_lock(&priv->mutex); |
6014 | iwl3945_alive_start(priv); | 6013 | iwl3945_alive_start(priv); |
6015 | mutex_unlock(&priv->mutex); | 6014 | mutex_unlock(&priv->mutex); |
6015 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); | ||
6016 | } | 6016 | } |
6017 | 6017 | ||
6018 | static void iwl3945_bg_rf_kill(struct work_struct *work) | 6018 | static void iwl3945_bg_rf_kill(struct work_struct *work) |
@@ -6256,6 +6256,11 @@ static void iwl3945_bg_request_scan(struct work_struct *data) | |||
6256 | n_probes, | 6256 | n_probes, |
6257 | (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); | 6257 | (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); |
6258 | 6258 | ||
6259 | if (scan->channel_count == 0) { | ||
6260 | IWL_DEBUG_SCAN("channel count %d\n", scan->channel_count); | ||
6261 | goto done; | ||
6262 | } | ||
6263 | |||
6259 | cmd.len += le16_to_cpu(scan->tx_cmd.len) + | 6264 | cmd.len += le16_to_cpu(scan->tx_cmd.len) + |
6260 | scan->channel_count * sizeof(struct iwl3945_scan_channel); | 6265 | scan->channel_count * sizeof(struct iwl3945_scan_channel); |
6261 | cmd.data = scan; | 6266 | cmd.data = scan; |
@@ -6273,6 +6278,14 @@ static void iwl3945_bg_request_scan(struct work_struct *data) | |||
6273 | return; | 6278 | return; |
6274 | 6279 | ||
6275 | done: | 6280 | done: |
6281 | /* can not perform scan make sure we clear scanning | ||
6282 | * bits from status so next scan request can be performed. | ||
6283 | * if we dont clear scanning status bit here all next scan | ||
6284 | * will fail | ||
6285 | */ | ||
6286 | clear_bit(STATUS_SCAN_HW, &priv->status); | ||
6287 | clear_bit(STATUS_SCANNING, &priv->status); | ||
6288 | |||
6276 | /* inform mac80211 scan aborted */ | 6289 | /* inform mac80211 scan aborted */ |
6277 | queue_work(priv->workqueue, &priv->scan_completed); | 6290 | queue_work(priv->workqueue, &priv->scan_completed); |
6278 | mutex_unlock(&priv->mutex); | 6291 | mutex_unlock(&priv->mutex); |
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 297696de2da0..8265c7d25edc 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -605,9 +605,9 @@ int lbs_get_tx_power(struct lbs_private *priv, s16 *curlevel, s16 *minlevel, | |||
605 | if (ret == 0) { | 605 | if (ret == 0) { |
606 | *curlevel = le16_to_cpu(cmd.curlevel); | 606 | *curlevel = le16_to_cpu(cmd.curlevel); |
607 | if (minlevel) | 607 | if (minlevel) |
608 | *minlevel = le16_to_cpu(cmd.minlevel); | 608 | *minlevel = cmd.minlevel; |
609 | if (maxlevel) | 609 | if (maxlevel) |
610 | *maxlevel = le16_to_cpu(cmd.maxlevel); | 610 | *maxlevel = cmd.maxlevel; |
611 | } | 611 | } |
612 | 612 | ||
613 | lbs_deb_leave(LBS_DEB_CMD); | 613 | lbs_deb_leave(LBS_DEB_CMD); |
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c index 5749f22b296f..079e6aa874dc 100644 --- a/drivers/net/wireless/libertas/rx.c +++ b/drivers/net/wireless/libertas/rx.c | |||
@@ -328,7 +328,7 @@ static int process_rxed_802_11_packet(struct lbs_private *priv, | |||
328 | lbs_deb_rx("rx err: frame received with bad length\n"); | 328 | lbs_deb_rx("rx err: frame received with bad length\n"); |
329 | priv->stats.rx_length_errors++; | 329 | priv->stats.rx_length_errors++; |
330 | ret = -EINVAL; | 330 | ret = -EINVAL; |
331 | kfree(skb); | 331 | kfree_skb(skb); |
332 | goto done; | 332 | goto done; |
333 | } | 333 | } |
334 | 334 | ||
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c index 8f66903641b9..22c4c6110521 100644 --- a/drivers/net/wireless/libertas/scan.c +++ b/drivers/net/wireless/libertas/scan.c | |||
@@ -598,8 +598,8 @@ static int lbs_process_bss(struct bss_descriptor *bss, | |||
598 | 598 | ||
599 | switch (elem->id) { | 599 | switch (elem->id) { |
600 | case MFIE_TYPE_SSID: | 600 | case MFIE_TYPE_SSID: |
601 | bss->ssid_len = elem->len; | 601 | bss->ssid_len = min_t(int, 32, elem->len); |
602 | memcpy(bss->ssid, elem->data, elem->len); | 602 | memcpy(bss->ssid, elem->data, bss->ssid_len); |
603 | lbs_deb_scan("got SSID IE: '%s', len %u\n", | 603 | lbs_deb_scan("got SSID IE: '%s', len %u\n", |
604 | escape_essid(bss->ssid, bss->ssid_len), | 604 | escape_essid(bss->ssid, bss->ssid_len), |
605 | bss->ssid_len); | 605 | bss->ssid_len); |
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index 50904771f291..e0512e49d6d3 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c | |||
@@ -433,7 +433,7 @@ struct fw_info { | |||
433 | const static struct fw_info orinoco_fw[] = { | 433 | const static struct fw_info orinoco_fw[] = { |
434 | { "", "agere_sta_fw.bin", "agere_ap_fw.bin", 0x00390000, 1000 }, | 434 | { "", "agere_sta_fw.bin", "agere_ap_fw.bin", 0x00390000, 1000 }, |
435 | { "", "prism_sta_fw.bin", "prism_ap_fw.bin", 0, 1024 }, | 435 | { "", "prism_sta_fw.bin", "prism_ap_fw.bin", 0, 1024 }, |
436 | { "symbol_sp24t_prim_fw", "symbol_sp24t_sec_fw", "", 0x00003100, 0x100 } | 436 | { "symbol_sp24t_prim_fw", "symbol_sp24t_sec_fw", "", 0x00003100, 512 } |
437 | }; | 437 | }; |
438 | 438 | ||
439 | /* Structure used to access fields in FW | 439 | /* Structure used to access fields in FW |
@@ -458,7 +458,7 @@ orinoco_dl_firmware(struct orinoco_private *priv, | |||
458 | int ap) | 458 | int ap) |
459 | { | 459 | { |
460 | /* Plug Data Area (PDA) */ | 460 | /* Plug Data Area (PDA) */ |
461 | __le16 pda[512] = { 0 }; | 461 | __le16 *pda; |
462 | 462 | ||
463 | hermes_t *hw = &priv->hw; | 463 | hermes_t *hw = &priv->hw; |
464 | const struct firmware *fw_entry; | 464 | const struct firmware *fw_entry; |
@@ -467,7 +467,11 @@ orinoco_dl_firmware(struct orinoco_private *priv, | |||
467 | const unsigned char *end; | 467 | const unsigned char *end; |
468 | const char *firmware; | 468 | const char *firmware; |
469 | struct net_device *dev = priv->ndev; | 469 | struct net_device *dev = priv->ndev; |
470 | int err; | 470 | int err = 0; |
471 | |||
472 | pda = kzalloc(fw->pda_size, GFP_KERNEL); | ||
473 | if (!pda) | ||
474 | return -ENOMEM; | ||
471 | 475 | ||
472 | if (ap) | 476 | if (ap) |
473 | firmware = fw->ap_fw; | 477 | firmware = fw->ap_fw; |
@@ -478,17 +482,17 @@ orinoco_dl_firmware(struct orinoco_private *priv, | |||
478 | dev->name, firmware); | 482 | dev->name, firmware); |
479 | 483 | ||
480 | /* Read current plug data */ | 484 | /* Read current plug data */ |
481 | err = hermes_read_pda(hw, pda, fw->pda_addr, | 485 | err = hermes_read_pda(hw, pda, fw->pda_addr, fw->pda_size, 0); |
482 | min_t(u16, fw->pda_size, sizeof(pda)), 0); | ||
483 | printk(KERN_DEBUG "%s: Read PDA returned %d\n", dev->name, err); | 486 | printk(KERN_DEBUG "%s: Read PDA returned %d\n", dev->name, err); |
484 | if (err) | 487 | if (err) |
485 | return err; | 488 | goto free; |
486 | 489 | ||
487 | err = request_firmware(&fw_entry, firmware, priv->dev); | 490 | err = request_firmware(&fw_entry, firmware, priv->dev); |
488 | if (err) { | 491 | if (err) { |
489 | printk(KERN_ERR "%s: Cannot find firmware %s\n", | 492 | printk(KERN_ERR "%s: Cannot find firmware %s\n", |
490 | dev->name, firmware); | 493 | dev->name, firmware); |
491 | return -ENOENT; | 494 | err = -ENOENT; |
495 | goto free; | ||
492 | } | 496 | } |
493 | 497 | ||
494 | hdr = (const struct orinoco_fw_header *) fw_entry->data; | 498 | hdr = (const struct orinoco_fw_header *) fw_entry->data; |
@@ -532,6 +536,9 @@ orinoco_dl_firmware(struct orinoco_private *priv, | |||
532 | 536 | ||
533 | abort: | 537 | abort: |
534 | release_firmware(fw_entry); | 538 | release_firmware(fw_entry); |
539 | |||
540 | free: | ||
541 | kfree(pda); | ||
535 | return err; | 542 | return err; |
536 | } | 543 | } |
537 | 544 | ||
@@ -549,12 +556,12 @@ symbol_dl_image(struct orinoco_private *priv, const struct fw_info *fw, | |||
549 | int secondary) | 556 | int secondary) |
550 | { | 557 | { |
551 | hermes_t *hw = &priv->hw; | 558 | hermes_t *hw = &priv->hw; |
552 | int ret; | 559 | int ret = 0; |
553 | const unsigned char *ptr; | 560 | const unsigned char *ptr; |
554 | const unsigned char *first_block; | 561 | const unsigned char *first_block; |
555 | 562 | ||
556 | /* Plug Data Area (PDA) */ | 563 | /* Plug Data Area (PDA) */ |
557 | __le16 pda[256]; | 564 | __le16 *pda = NULL; |
558 | 565 | ||
559 | /* Binary block begins after the 0x1A marker */ | 566 | /* Binary block begins after the 0x1A marker */ |
560 | ptr = image; | 567 | ptr = image; |
@@ -563,28 +570,33 @@ symbol_dl_image(struct orinoco_private *priv, const struct fw_info *fw, | |||
563 | 570 | ||
564 | /* Read the PDA from EEPROM */ | 571 | /* Read the PDA from EEPROM */ |
565 | if (secondary) { | 572 | if (secondary) { |
566 | ret = hermes_read_pda(hw, pda, fw->pda_addr, sizeof(pda), 1); | 573 | pda = kzalloc(fw->pda_size, GFP_KERNEL); |
574 | if (!pda) | ||
575 | return -ENOMEM; | ||
576 | |||
577 | ret = hermes_read_pda(hw, pda, fw->pda_addr, fw->pda_size, 1); | ||
567 | if (ret) | 578 | if (ret) |
568 | return ret; | 579 | goto free; |
569 | } | 580 | } |
570 | 581 | ||
571 | /* Stop the firmware, so that it can be safely rewritten */ | 582 | /* Stop the firmware, so that it can be safely rewritten */ |
572 | if (priv->stop_fw) { | 583 | if (priv->stop_fw) { |
573 | ret = priv->stop_fw(priv, 1); | 584 | ret = priv->stop_fw(priv, 1); |
574 | if (ret) | 585 | if (ret) |
575 | return ret; | 586 | goto free; |
576 | } | 587 | } |
577 | 588 | ||
578 | /* Program the adapter with new firmware */ | 589 | /* Program the adapter with new firmware */ |
579 | ret = hermes_program(hw, first_block, end); | 590 | ret = hermes_program(hw, first_block, end); |
580 | if (ret) | 591 | if (ret) |
581 | return ret; | 592 | goto free; |
582 | 593 | ||
583 | /* Write the PDA to the adapter */ | 594 | /* Write the PDA to the adapter */ |
584 | if (secondary) { | 595 | if (secondary) { |
585 | size_t len = hermes_blocks_length(first_block); | 596 | size_t len = hermes_blocks_length(first_block); |
586 | ptr = first_block + len; | 597 | ptr = first_block + len; |
587 | ret = hermes_apply_pda(hw, ptr, pda); | 598 | ret = hermes_apply_pda(hw, ptr, pda); |
599 | kfree(pda); | ||
588 | if (ret) | 600 | if (ret) |
589 | return ret; | 601 | return ret; |
590 | } | 602 | } |
@@ -608,6 +620,10 @@ symbol_dl_image(struct orinoco_private *priv, const struct fw_info *fw, | |||
608 | return -ENODEV; | 620 | return -ENODEV; |
609 | 621 | ||
610 | return 0; | 622 | return 0; |
623 | |||
624 | free: | ||
625 | kfree(pda); | ||
626 | return ret; | ||
611 | } | 627 | } |
612 | 628 | ||
613 | 629 | ||
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 117c7d3a52b0..827ca0384a4c 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -306,8 +306,8 @@ static int p54_convert_rev1(struct ieee80211_hw *dev, | |||
306 | return 0; | 306 | return 0; |
307 | } | 307 | } |
308 | 308 | ||
309 | static const char *p54_rf_chips[] = { "NULL", "Indigo?", "Duette", | 309 | static const char *p54_rf_chips[] = { "NULL", "Duette3", "Duette2", |
310 | "Frisbee", "Xbow", "Longbow" }; | 310 | "Frisbee", "Xbow", "Longbow", "NULL", "NULL" }; |
311 | static int p54_init_xbow_synth(struct ieee80211_hw *dev); | 311 | static int p54_init_xbow_synth(struct ieee80211_hw *dev); |
312 | 312 | ||
313 | static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) | 313 | static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) |
@@ -319,6 +319,7 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) | |||
319 | void *tmp; | 319 | void *tmp; |
320 | int err; | 320 | int err; |
321 | u8 *end = (u8 *)eeprom + len; | 321 | u8 *end = (u8 *)eeprom + len; |
322 | u16 synth = 0; | ||
322 | DECLARE_MAC_BUF(mac); | 323 | DECLARE_MAC_BUF(mac); |
323 | 324 | ||
324 | wrap = (struct eeprom_pda_wrap *) eeprom; | 325 | wrap = (struct eeprom_pda_wrap *) eeprom; |
@@ -400,8 +401,8 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) | |||
400 | tmp = entry->data; | 401 | tmp = entry->data; |
401 | while ((u8 *)tmp < entry->data + data_len) { | 402 | while ((u8 *)tmp < entry->data + data_len) { |
402 | struct bootrec_exp_if *exp_if = tmp; | 403 | struct bootrec_exp_if *exp_if = tmp; |
403 | if (le16_to_cpu(exp_if->if_id) == 0xF) | 404 | if (le16_to_cpu(exp_if->if_id) == 0xf) |
404 | priv->rxhw = le16_to_cpu(exp_if->variant) & 0x07; | 405 | synth = le16_to_cpu(exp_if->variant); |
405 | tmp += sizeof(struct bootrec_exp_if); | 406 | tmp += sizeof(struct bootrec_exp_if); |
406 | } | 407 | } |
407 | break; | 408 | break; |
@@ -421,28 +422,20 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) | |||
421 | entry = (void *)entry + (entry_len + 1)*2; | 422 | entry = (void *)entry + (entry_len + 1)*2; |
422 | } | 423 | } |
423 | 424 | ||
424 | if (!priv->iq_autocal || !priv->output_limit || !priv->curve_data) { | 425 | if (!synth || !priv->iq_autocal || !priv->output_limit || |
426 | !priv->curve_data) { | ||
425 | printk(KERN_ERR "p54: not all required entries found in eeprom!\n"); | 427 | printk(KERN_ERR "p54: not all required entries found in eeprom!\n"); |
426 | err = -EINVAL; | 428 | err = -EINVAL; |
427 | goto err; | 429 | goto err; |
428 | } | 430 | } |
429 | 431 | ||
430 | switch (priv->rxhw) { | 432 | priv->rxhw = synth & 0x07; |
431 | case 4: /* XBow */ | 433 | if (priv->rxhw == 4) |
432 | p54_init_xbow_synth(dev); | 434 | p54_init_xbow_synth(dev); |
433 | case 1: /* Indigo? */ | 435 | if (!(synth & 0x40)) |
434 | case 2: /* Duette */ | ||
435 | dev->wiphy->bands[IEEE80211_BAND_5GHZ] = &band_5GHz; | ||
436 | case 3: /* Frisbee */ | ||
437 | case 5: /* Longbow */ | ||
438 | dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &band_2GHz; | 436 | dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &band_2GHz; |
439 | break; | 437 | if (!(synth & 0x80)) |
440 | default: | 438 | dev->wiphy->bands[IEEE80211_BAND_5GHZ] = &band_5GHz; |
441 | printk(KERN_ERR "%s: unsupported RF-Chip\n", | ||
442 | wiphy_name(dev->wiphy)); | ||
443 | err = -EINVAL; | ||
444 | goto err; | ||
445 | } | ||
446 | 439 | ||
447 | if (!is_valid_ether_addr(dev->wiphy->perm_addr)) { | 440 | if (!is_valid_ether_addr(dev->wiphy->perm_addr)) { |
448 | u8 perm_addr[ETH_ALEN]; | 441 | u8 perm_addr[ETH_ALEN]; |
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c index 1c2a02a741af..88b3cad8b65e 100644 --- a/drivers/net/wireless/p54/p54pci.c +++ b/drivers/net/wireless/p54/p54pci.c | |||
@@ -346,68 +346,6 @@ static void p54p_tx(struct ieee80211_hw *dev, struct p54_control_hdr *data, | |||
346 | printk(KERN_INFO "%s: tx overflow.\n", wiphy_name(dev->wiphy)); | 346 | printk(KERN_INFO "%s: tx overflow.\n", wiphy_name(dev->wiphy)); |
347 | } | 347 | } |
348 | 348 | ||
349 | static int p54p_open(struct ieee80211_hw *dev) | ||
350 | { | ||
351 | struct p54p_priv *priv = dev->priv; | ||
352 | int err; | ||
353 | |||
354 | init_completion(&priv->boot_comp); | ||
355 | err = request_irq(priv->pdev->irq, &p54p_interrupt, | ||
356 | IRQF_SHARED, "p54pci", dev); | ||
357 | if (err) { | ||
358 | printk(KERN_ERR "%s: failed to register IRQ handler\n", | ||
359 | wiphy_name(dev->wiphy)); | ||
360 | return err; | ||
361 | } | ||
362 | |||
363 | memset(priv->ring_control, 0, sizeof(*priv->ring_control)); | ||
364 | err = p54p_upload_firmware(dev); | ||
365 | if (err) { | ||
366 | free_irq(priv->pdev->irq, dev); | ||
367 | return err; | ||
368 | } | ||
369 | priv->rx_idx_data = priv->tx_idx_data = 0; | ||
370 | priv->rx_idx_mgmt = priv->tx_idx_mgmt = 0; | ||
371 | |||
372 | p54p_refill_rx_ring(dev, 0, priv->ring_control->rx_data, | ||
373 | ARRAY_SIZE(priv->ring_control->rx_data), priv->rx_buf_data); | ||
374 | |||
375 | p54p_refill_rx_ring(dev, 2, priv->ring_control->rx_mgmt, | ||
376 | ARRAY_SIZE(priv->ring_control->rx_mgmt), priv->rx_buf_mgmt); | ||
377 | |||
378 | P54P_WRITE(ring_control_base, cpu_to_le32(priv->ring_control_dma)); | ||
379 | P54P_READ(ring_control_base); | ||
380 | wmb(); | ||
381 | udelay(10); | ||
382 | |||
383 | P54P_WRITE(int_enable, cpu_to_le32(ISL38XX_INT_IDENT_INIT)); | ||
384 | P54P_READ(int_enable); | ||
385 | wmb(); | ||
386 | udelay(10); | ||
387 | |||
388 | P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_RESET)); | ||
389 | P54P_READ(dev_int); | ||
390 | |||
391 | if (!wait_for_completion_interruptible_timeout(&priv->boot_comp, HZ)) { | ||
392 | printk(KERN_ERR "%s: Cannot boot firmware!\n", | ||
393 | wiphy_name(dev->wiphy)); | ||
394 | free_irq(priv->pdev->irq, dev); | ||
395 | return -ETIMEDOUT; | ||
396 | } | ||
397 | |||
398 | P54P_WRITE(int_enable, cpu_to_le32(ISL38XX_INT_IDENT_UPDATE)); | ||
399 | P54P_READ(int_enable); | ||
400 | wmb(); | ||
401 | udelay(10); | ||
402 | |||
403 | P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_UPDATE)); | ||
404 | P54P_READ(dev_int); | ||
405 | wmb(); | ||
406 | udelay(10); | ||
407 | |||
408 | return 0; | ||
409 | } | ||
410 | |||
411 | static void p54p_stop(struct ieee80211_hw *dev) | 349 | static void p54p_stop(struct ieee80211_hw *dev) |
412 | { | 350 | { |
413 | struct p54p_priv *priv = dev->priv; | 351 | struct p54p_priv *priv = dev->priv; |
@@ -474,6 +412,68 @@ static void p54p_stop(struct ieee80211_hw *dev) | |||
474 | memset(ring_control, 0, sizeof(*ring_control)); | 412 | memset(ring_control, 0, sizeof(*ring_control)); |
475 | } | 413 | } |
476 | 414 | ||
415 | static int p54p_open(struct ieee80211_hw *dev) | ||
416 | { | ||
417 | struct p54p_priv *priv = dev->priv; | ||
418 | int err; | ||
419 | |||
420 | init_completion(&priv->boot_comp); | ||
421 | err = request_irq(priv->pdev->irq, &p54p_interrupt, | ||
422 | IRQF_SHARED, "p54pci", dev); | ||
423 | if (err) { | ||
424 | printk(KERN_ERR "%s: failed to register IRQ handler\n", | ||
425 | wiphy_name(dev->wiphy)); | ||
426 | return err; | ||
427 | } | ||
428 | |||
429 | memset(priv->ring_control, 0, sizeof(*priv->ring_control)); | ||
430 | err = p54p_upload_firmware(dev); | ||
431 | if (err) { | ||
432 | free_irq(priv->pdev->irq, dev); | ||
433 | return err; | ||
434 | } | ||
435 | priv->rx_idx_data = priv->tx_idx_data = 0; | ||
436 | priv->rx_idx_mgmt = priv->tx_idx_mgmt = 0; | ||
437 | |||
438 | p54p_refill_rx_ring(dev, 0, priv->ring_control->rx_data, | ||
439 | ARRAY_SIZE(priv->ring_control->rx_data), priv->rx_buf_data); | ||
440 | |||
441 | p54p_refill_rx_ring(dev, 2, priv->ring_control->rx_mgmt, | ||
442 | ARRAY_SIZE(priv->ring_control->rx_mgmt), priv->rx_buf_mgmt); | ||
443 | |||
444 | P54P_WRITE(ring_control_base, cpu_to_le32(priv->ring_control_dma)); | ||
445 | P54P_READ(ring_control_base); | ||
446 | wmb(); | ||
447 | udelay(10); | ||
448 | |||
449 | P54P_WRITE(int_enable, cpu_to_le32(ISL38XX_INT_IDENT_INIT)); | ||
450 | P54P_READ(int_enable); | ||
451 | wmb(); | ||
452 | udelay(10); | ||
453 | |||
454 | P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_RESET)); | ||
455 | P54P_READ(dev_int); | ||
456 | |||
457 | if (!wait_for_completion_interruptible_timeout(&priv->boot_comp, HZ)) { | ||
458 | printk(KERN_ERR "%s: Cannot boot firmware!\n", | ||
459 | wiphy_name(dev->wiphy)); | ||
460 | p54p_stop(dev); | ||
461 | return -ETIMEDOUT; | ||
462 | } | ||
463 | |||
464 | P54P_WRITE(int_enable, cpu_to_le32(ISL38XX_INT_IDENT_UPDATE)); | ||
465 | P54P_READ(int_enable); | ||
466 | wmb(); | ||
467 | udelay(10); | ||
468 | |||
469 | P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_UPDATE)); | ||
470 | P54P_READ(dev_int); | ||
471 | wmb(); | ||
472 | udelay(10); | ||
473 | |||
474 | return 0; | ||
475 | } | ||
476 | |||
477 | static int __devinit p54p_probe(struct pci_dev *pdev, | 477 | static int __devinit p54p_probe(struct pci_dev *pdev, |
478 | const struct pci_device_id *id) | 478 | const struct pci_device_id *id) |
479 | { | 479 | { |
@@ -556,11 +556,13 @@ static int __devinit p54p_probe(struct pci_dev *pdev, | |||
556 | spin_lock_init(&priv->lock); | 556 | spin_lock_init(&priv->lock); |
557 | tasklet_init(&priv->rx_tasklet, p54p_rx_tasklet, (unsigned long)dev); | 557 | tasklet_init(&priv->rx_tasklet, p54p_rx_tasklet, (unsigned long)dev); |
558 | 558 | ||
559 | p54p_open(dev); | 559 | err = p54p_open(dev); |
560 | if (err) | ||
561 | goto err_free_common; | ||
560 | err = p54_read_eeprom(dev); | 562 | err = p54_read_eeprom(dev); |
561 | p54p_stop(dev); | 563 | p54p_stop(dev); |
562 | if (err) | 564 | if (err) |
563 | goto err_free_desc; | 565 | goto err_free_common; |
564 | 566 | ||
565 | err = ieee80211_register_hw(dev); | 567 | err = ieee80211_register_hw(dev); |
566 | if (err) { | 568 | if (err) { |
@@ -573,8 +575,6 @@ static int __devinit p54p_probe(struct pci_dev *pdev, | |||
573 | 575 | ||
574 | err_free_common: | 576 | err_free_common: |
575 | p54_free_common(dev); | 577 | p54_free_common(dev); |
576 | |||
577 | err_free_desc: | ||
578 | pci_free_consistent(pdev, sizeof(*priv->ring_control), | 578 | pci_free_consistent(pdev, sizeof(*priv->ring_control), |
579 | priv->ring_control, priv->ring_control_dma); | 579 | priv->ring_control, priv->ring_control_dma); |
580 | 580 | ||
diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig index f839ce044afd..95511ac22470 100644 --- a/drivers/net/wireless/rt2x00/Kconfig +++ b/drivers/net/wireless/rt2x00/Kconfig | |||
@@ -1,5 +1,5 @@ | |||
1 | menuconfig RT2X00 | 1 | menuconfig RT2X00 |
2 | bool "Ralink driver support" | 2 | tristate "Ralink driver support" |
3 | depends on MAC80211 && WLAN_80211 && EXPERIMENTAL | 3 | depends on MAC80211 && WLAN_80211 && EXPERIMENTAL |
4 | ---help--- | 4 | ---help--- |
5 | This will enable the experimental support for the Ralink drivers, | 5 | This will enable the experimental support for the Ralink drivers, |
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index a60ae86bd5c9..a3ccd8c1c716 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c | |||
@@ -61,6 +61,7 @@ static struct usb_device_id usb_ids[] = { | |||
61 | { USB_DEVICE(0x0105, 0x145f), .driver_info = DEVICE_ZD1211 }, | 61 | { USB_DEVICE(0x0105, 0x145f), .driver_info = DEVICE_ZD1211 }, |
62 | /* ZD1211B */ | 62 | /* ZD1211B */ |
63 | { USB_DEVICE(0x0ace, 0x1215), .driver_info = DEVICE_ZD1211B }, | 63 | { USB_DEVICE(0x0ace, 0x1215), .driver_info = DEVICE_ZD1211B }, |
64 | { USB_DEVICE(0x0ace, 0xb215), .driver_info = DEVICE_ZD1211B }, | ||
64 | { USB_DEVICE(0x157e, 0x300d), .driver_info = DEVICE_ZD1211B }, | 65 | { USB_DEVICE(0x157e, 0x300d), .driver_info = DEVICE_ZD1211B }, |
65 | { USB_DEVICE(0x079b, 0x0062), .driver_info = DEVICE_ZD1211B }, | 66 | { USB_DEVICE(0x079b, 0x0062), .driver_info = DEVICE_ZD1211B }, |
66 | { USB_DEVICE(0x1582, 0x6003), .driver_info = DEVICE_ZD1211B }, | 67 | { USB_DEVICE(0x1582, 0x6003), .driver_info = DEVICE_ZD1211B }, |
@@ -82,6 +83,7 @@ static struct usb_device_id usb_ids[] = { | |||
82 | { USB_DEVICE(0x0cde, 0x001a), .driver_info = DEVICE_ZD1211B }, | 83 | { USB_DEVICE(0x0cde, 0x001a), .driver_info = DEVICE_ZD1211B }, |
83 | { USB_DEVICE(0x0586, 0x340a), .driver_info = DEVICE_ZD1211B }, | 84 | { USB_DEVICE(0x0586, 0x340a), .driver_info = DEVICE_ZD1211B }, |
84 | { USB_DEVICE(0x0471, 0x1237), .driver_info = DEVICE_ZD1211B }, | 85 | { USB_DEVICE(0x0471, 0x1237), .driver_info = DEVICE_ZD1211B }, |
86 | { USB_DEVICE(0x07fa, 0x1196), .driver_info = DEVICE_ZD1211B }, | ||
85 | /* "Driverless" devices that need ejecting */ | 87 | /* "Driverless" devices that need ejecting */ |
86 | { USB_DEVICE(0x0ace, 0x2011), .driver_info = DEVICE_INSTALLER }, | 88 | { USB_DEVICE(0x0ace, 0x2011), .driver_info = DEVICE_INSTALLER }, |
87 | { USB_DEVICE(0x0ace, 0x20ff), .driver_info = DEVICE_INSTALLER }, | 89 | { USB_DEVICE(0x0ace, 0x20ff), .driver_info = DEVICE_INSTALLER }, |