aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/Kconfig1
-rw-r--r--drivers/net/arm/at91_ether.c3
-rw-r--r--drivers/net/at1700.c2
-rw-r--r--drivers/net/benet/be_main.c8
-rw-r--r--drivers/net/cnic.c23
-rw-r--r--drivers/net/eepro.c2
-rw-r--r--drivers/net/fealnx.c3
-rw-r--r--drivers/net/fs_enet/fs_enet-main.c20
-rw-r--r--drivers/net/gianfar.c24
-rw-r--r--drivers/net/ixgbe/ixgbe.h1
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_nl.c24
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c52
-rw-r--r--drivers/net/netxen/netxen_nic_init.c7
-rw-r--r--drivers/net/phy/mdio-gpio.c77
-rw-r--r--drivers/net/r8169.c13
-rw-r--r--drivers/net/skge.c4
-rw-r--r--drivers/net/smc91x.h3
-rw-r--r--drivers/net/tokenring/ibmtr.c2
-rw-r--r--drivers/net/ucc_geth.c23
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/ani.c12
-rw-r--r--drivers/net/wireless/ath/regd.c17
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c4
-rw-r--r--drivers/net/wireless/iwmc3200wifi/netdev.c2
-rw-r--r--drivers/net/wireless/libertas/cmd.c8
-rw-r--r--drivers/net/wireless/libertas/defs.h2
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c6
-rw-r--r--drivers/net/wireless/p54/p54spi.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c4
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187_leds.c3
32 files changed, 229 insertions, 133 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index b5a7513df4eb..5f6509a5f640 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1732,6 +1732,7 @@ config KS8842
1732config KS8851 1732config KS8851
1733 tristate "Micrel KS8851 SPI" 1733 tristate "Micrel KS8851 SPI"
1734 depends on SPI 1734 depends on SPI
1735 select MII
1735 help 1736 help
1736 SPI driver for Micrel KS8851 SPI attached network chip. 1737 SPI driver for Micrel KS8851 SPI attached network chip.
1737 1738
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c
index 2e7419a61191..5041d10bae9d 100644
--- a/drivers/net/arm/at91_ether.c
+++ b/drivers/net/arm/at91_ether.c
@@ -1228,7 +1228,6 @@ static int at91ether_resume(struct platform_device *pdev)
1228#endif 1228#endif
1229 1229
1230static struct platform_driver at91ether_driver = { 1230static struct platform_driver at91ether_driver = {
1231 .probe = at91ether_probe,
1232 .remove = __devexit_p(at91ether_remove), 1231 .remove = __devexit_p(at91ether_remove),
1233 .suspend = at91ether_suspend, 1232 .suspend = at91ether_suspend,
1234 .resume = at91ether_resume, 1233 .resume = at91ether_resume,
@@ -1240,7 +1239,7 @@ static struct platform_driver at91ether_driver = {
1240 1239
1241static int __init at91ether_init(void) 1240static int __init at91ether_init(void)
1242{ 1241{
1243 return platform_driver_register(&at91ether_driver); 1242 return platform_driver_probe(&at91ether_driver, at91ether_probe);
1244} 1243}
1245 1244
1246static void __exit at91ether_exit(void) 1245static void __exit at91ether_exit(void)
diff --git a/drivers/net/at1700.c b/drivers/net/at1700.c
index 18b566ad4fd1..cf30e278f182 100644
--- a/drivers/net/at1700.c
+++ b/drivers/net/at1700.c
@@ -318,7 +318,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
318 pos3 = mca_read_stored_pos( slot, 3 ); 318 pos3 = mca_read_stored_pos( slot, 3 );
319 pos4 = mca_read_stored_pos( slot, 4 ); 319 pos4 = mca_read_stored_pos( slot, 4 );
320 320
321 for (l_i = 0; l_i < 0x09; l_i++) 321 for (l_i = 0; l_i < 8; l_i++)
322 if (( pos3 & 0x07) == at1700_ioaddr_pattern[l_i]) 322 if (( pos3 & 0x07) == at1700_ioaddr_pattern[l_i])
323 break; 323 break;
324 ioaddr = at1700_mca_probe_list[l_i]; 324 ioaddr = at1700_mca_probe_list[l_i];
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index c43f6a119295..dea3155688bb 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -667,7 +667,7 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
667 struct be_queue_info *rxq = &adapter->rx_obj.q; 667 struct be_queue_info *rxq = &adapter->rx_obj.q;
668 struct be_rx_page_info *page_info; 668 struct be_rx_page_info *page_info;
669 u16 rxq_idx, i, num_rcvd, j; 669 u16 rxq_idx, i, num_rcvd, j;
670 u32 pktsize, hdr_len, curr_frag_len; 670 u32 pktsize, hdr_len, curr_frag_len, size;
671 u8 *start; 671 u8 *start;
672 672
673 rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); 673 rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp);
@@ -708,12 +708,13 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
708 } 708 }
709 709
710 /* More frags present for this completion */ 710 /* More frags present for this completion */
711 pktsize -= curr_frag_len; /* account for above copied frag */ 711 size = pktsize;
712 for (i = 1, j = 0; i < num_rcvd; i++) { 712 for (i = 1, j = 0; i < num_rcvd; i++) {
713 size -= curr_frag_len;
713 index_inc(&rxq_idx, rxq->len); 714 index_inc(&rxq_idx, rxq->len);
714 page_info = get_rx_page_info(adapter, rxq_idx); 715 page_info = get_rx_page_info(adapter, rxq_idx);
715 716
716 curr_frag_len = min(pktsize, rx_frag_size); 717 curr_frag_len = min(size, rx_frag_size);
717 718
718 /* Coalesce all frags from the same physical page in one slot */ 719 /* Coalesce all frags from the same physical page in one slot */
719 if (page_info->page_offset == 0) { 720 if (page_info->page_offset == 0) {
@@ -731,7 +732,6 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
731 skb_shinfo(skb)->frags[j].size += curr_frag_len; 732 skb_shinfo(skb)->frags[j].size += curr_frag_len;
732 skb->len += curr_frag_len; 733 skb->len += curr_frag_len;
733 skb->data_len += curr_frag_len; 734 skb->data_len += curr_frag_len;
734 pktsize -= curr_frag_len;
735 735
736 memset(page_info, 0, sizeof(*page_info)); 736 memset(page_info, 0, sizeof(*page_info));
737 } 737 }
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 4d1515f45ba2..4869d77cbe91 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -227,7 +227,7 @@ static int cnic_send_nlmsg(struct cnic_local *cp, u32 type,
227 } 227 }
228 228
229 rcu_read_lock(); 229 rcu_read_lock();
230 ulp_ops = rcu_dereference(cp->ulp_ops[CNIC_ULP_ISCSI]); 230 ulp_ops = rcu_dereference(cnic_ulp_tbl[CNIC_ULP_ISCSI]);
231 if (ulp_ops) 231 if (ulp_ops)
232 ulp_ops->iscsi_nl_send_msg(cp->dev, msg_type, buf, len); 232 ulp_ops->iscsi_nl_send_msg(cp->dev, msg_type, buf, len);
233 rcu_read_unlock(); 233 rcu_read_unlock();
@@ -319,6 +319,20 @@ static int cnic_abort_prep(struct cnic_sock *csk)
319 return 0; 319 return 0;
320} 320}
321 321
322static void cnic_uio_stop(void)
323{
324 struct cnic_dev *dev;
325
326 read_lock(&cnic_dev_lock);
327 list_for_each_entry(dev, &cnic_dev_list, list) {
328 struct cnic_local *cp = dev->cnic_priv;
329
330 if (cp->cnic_uinfo)
331 cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
332 }
333 read_unlock(&cnic_dev_lock);
334}
335
322int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops) 336int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops)
323{ 337{
324 struct cnic_dev *dev; 338 struct cnic_dev *dev;
@@ -390,6 +404,9 @@ int cnic_unregister_driver(int ulp_type)
390 } 404 }
391 read_unlock(&cnic_dev_lock); 405 read_unlock(&cnic_dev_lock);
392 406
407 if (ulp_type == CNIC_ULP_ISCSI)
408 cnic_uio_stop();
409
393 rcu_assign_pointer(cnic_ulp_tbl[ulp_type], NULL); 410 rcu_assign_pointer(cnic_ulp_tbl[ulp_type], NULL);
394 411
395 mutex_unlock(&cnic_lock); 412 mutex_unlock(&cnic_lock);
@@ -632,7 +649,6 @@ static void cnic_free_resc(struct cnic_dev *dev)
632 int i = 0; 649 int i = 0;
633 650
634 if (cp->cnic_uinfo) { 651 if (cp->cnic_uinfo) {
635 cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
636 while (cp->uio_dev != -1 && i < 15) { 652 while (cp->uio_dev != -1 && i < 15) {
637 msleep(100); 653 msleep(100);
638 i++; 654 i++;
@@ -1057,6 +1073,9 @@ static void cnic_ulp_stop(struct cnic_dev *dev)
1057 struct cnic_local *cp = dev->cnic_priv; 1073 struct cnic_local *cp = dev->cnic_priv;
1058 int if_type; 1074 int if_type;
1059 1075
1076 if (cp->cnic_uinfo)
1077 cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
1078
1060 rcu_read_lock(); 1079 rcu_read_lock();
1061 for (if_type = 0; if_type < MAX_CNIC_ULP_TYPE; if_type++) { 1080 for (if_type = 0; if_type < MAX_CNIC_ULP_TYPE; if_type++) {
1062 struct cnic_ulp_ops *ulp_ops; 1081 struct cnic_ulp_ops *ulp_ops;
diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c
index cc2ab6412c73..4f7003485348 100644
--- a/drivers/net/eepro.c
+++ b/drivers/net/eepro.c
@@ -1784,7 +1784,7 @@ int __init init_module(void)
1784 printk(KERN_INFO "eepro_init_module: Auto-detecting boards (May God protect us...)\n"); 1784 printk(KERN_INFO "eepro_init_module: Auto-detecting boards (May God protect us...)\n");
1785 } 1785 }
1786 1786
1787 for (i = 0; io[i] != -1 && i < MAX_EEPRO; i++) { 1787 for (i = 0; i < MAX_EEPRO && io[i] != -1; i++) {
1788 dev = alloc_etherdev(sizeof(struct eepro_local)); 1788 dev = alloc_etherdev(sizeof(struct eepro_local));
1789 if (!dev) 1789 if (!dev)
1790 break; 1790 break;
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
index 48385c42ab57..160655d24581 100644
--- a/drivers/net/fealnx.c
+++ b/drivers/net/fealnx.c
@@ -584,7 +584,8 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
584 if (np->flags == HAS_MII_XCVR) { 584 if (np->flags == HAS_MII_XCVR) {
585 int phy, phy_idx = 0; 585 int phy, phy_idx = 0;
586 586
587 for (phy = 1; phy < 32 && phy_idx < 4; phy++) { 587 for (phy = 1; phy < 32 && phy_idx < ARRAY_SIZE(np->phys);
588 phy++) {
588 int mii_status = mdio_read(dev, phy, 1); 589 int mii_status = mdio_read(dev, phy, 1);
589 590
590 if (mii_status != 0xffff && mii_status != 0x0000) { 591 if (mii_status != 0xffff && mii_status != 0x0000) {
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index b892c3ad9a74..2bc2d2b20644 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -754,17 +754,16 @@ static int fs_init_phy(struct net_device *dev)
754 fep->oldlink = 0; 754 fep->oldlink = 0;
755 fep->oldspeed = 0; 755 fep->oldspeed = 0;
756 fep->oldduplex = -1; 756 fep->oldduplex = -1;
757 if(fep->fpi->phy_node) 757
758 phydev = of_phy_connect(dev, fep->fpi->phy_node, 758 phydev = of_phy_connect(dev, fep->fpi->phy_node, &fs_adjust_link, 0,
759 &fs_adjust_link, 0, 759 PHY_INTERFACE_MODE_MII);
760 PHY_INTERFACE_MODE_MII); 760 if (!phydev) {
761 else { 761 phydev = of_phy_connect_fixed_link(dev, &fs_adjust_link,
762 printk("No phy bus ID specified in BSP code\n"); 762 PHY_INTERFACE_MODE_MII);
763 return -EINVAL;
764 } 763 }
765 if (IS_ERR(phydev)) { 764 if (!phydev) {
766 printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); 765 dev_err(&dev->dev, "Could not attach to PHY\n");
767 return PTR_ERR(phydev); 766 return -ENODEV;
768 } 767 }
769 768
770 fep->phydev = phydev; 769 fep->phydev = phydev;
@@ -1005,6 +1004,7 @@ static int __devinit fs_enet_probe(struct of_device *ofdev,
1005 goto out_free_fpi; 1004 goto out_free_fpi;
1006 } 1005 }
1007 1006
1007 SET_NETDEV_DEV(ndev, &ofdev->dev);
1008 dev_set_drvdata(&ofdev->dev, ndev); 1008 dev_set_drvdata(&ofdev->dev, ndev);
1009 1009
1010 fep = netdev_priv(ndev); 1010 fep = netdev_priv(ndev);
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 43d813ed9f45..f8ffcbf0bc39 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -264,15 +264,6 @@ static int gfar_of_init(struct net_device *dev)
264 priv->device_flags |= FSL_GIANFAR_DEV_HAS_MAGIC_PACKET; 264 priv->device_flags |= FSL_GIANFAR_DEV_HAS_MAGIC_PACKET;
265 265
266 priv->phy_node = of_parse_phandle(np, "phy-handle", 0); 266 priv->phy_node = of_parse_phandle(np, "phy-handle", 0);
267 if (!priv->phy_node) {
268 u32 *fixed_link;
269
270 fixed_link = (u32 *)of_get_property(np, "fixed-link", NULL);
271 if (!fixed_link) {
272 err = -ENODEV;
273 goto err_out;
274 }
275 }
276 267
277 /* Find the TBI PHY. If it's not there, we don't support SGMII */ 268 /* Find the TBI PHY. If it's not there, we don't support SGMII */
278 priv->tbi_node = of_parse_phandle(np, "tbi-handle", 0); 269 priv->tbi_node = of_parse_phandle(np, "tbi-handle", 0);
@@ -659,13 +650,14 @@ static int init_phy(struct net_device *dev)
659 650
660 interface = gfar_get_interface(dev); 651 interface = gfar_get_interface(dev);
661 652
662 if (priv->phy_node) { 653 priv->phydev = of_phy_connect(dev, priv->phy_node, &adjust_link, 0,
663 priv->phydev = of_phy_connect(dev, priv->phy_node, &adjust_link, 654 interface);
664 0, interface); 655 if (!priv->phydev)
665 if (!priv->phydev) { 656 priv->phydev = of_phy_connect_fixed_link(dev, &adjust_link,
666 dev_err(&dev->dev, "error: Could not attach to PHY\n"); 657 interface);
667 return -ENODEV; 658 if (!priv->phydev) {
668 } 659 dev_err(&dev->dev, "could not attach to PHY\n");
660 return -ENODEV;
669 } 661 }
670 662
671 if (interface == PHY_INTERFACE_MODE_SGMII) 663 if (interface == PHY_INTERFACE_MODE_SGMII)
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index cd22323cfd22..1b12c7ba275f 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -327,6 +327,7 @@ struct ixgbe_adapter {
327#define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 25) 327#define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 25)
328#define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 26) 328#define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 26)
329#define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 27) 329#define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 27)
330#define IXGBE_FLAG_FCOE_CAPABLE (u32)(1 << 28)
330#define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 29) 331#define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 29)
331 332
332 u32 flags2; 333 u32 flags2;
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index da2c8514b8d0..1c7265732900 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -139,6 +139,18 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
139 adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE; 139 adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
140 } 140 }
141 adapter->flags |= IXGBE_FLAG_DCB_ENABLED; 141 adapter->flags |= IXGBE_FLAG_DCB_ENABLED;
142#ifdef IXGBE_FCOE
143 /* Turn on FCoE offload */
144 if ((adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) &&
145 (!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED))) {
146 adapter->flags |= IXGBE_FLAG_FCOE_ENABLED;
147 adapter->ring_feature[RING_F_FCOE].indices =
148 IXGBE_FCRETA_SIZE;
149 netdev->features |= NETIF_F_FCOE_CRC;
150 netdev->features |= NETIF_F_FSO;
151 netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1;
152 }
153#endif /* IXGBE_FCOE */
142 ixgbe_init_interrupt_scheme(adapter); 154 ixgbe_init_interrupt_scheme(adapter);
143 if (netif_running(netdev)) 155 if (netif_running(netdev))
144 netdev->netdev_ops->ndo_open(netdev); 156 netdev->netdev_ops->ndo_open(netdev);
@@ -156,6 +168,18 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
156 adapter->flags |= IXGBE_FLAG_RSS_ENABLED; 168 adapter->flags |= IXGBE_FLAG_RSS_ENABLED;
157 if (adapter->hw.mac.type == ixgbe_mac_82599EB) 169 if (adapter->hw.mac.type == ixgbe_mac_82599EB)
158 adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; 170 adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;
171
172#ifdef IXGBE_FCOE
173 /* Turn off FCoE offload */
174 if (adapter->flags & (IXGBE_FLAG_FCOE_CAPABLE |
175 IXGBE_FLAG_FCOE_ENABLED)) {
176 adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
177 adapter->ring_feature[RING_F_FCOE].indices = 0;
178 netdev->features &= ~NETIF_F_FCOE_CRC;
179 netdev->features &= ~NETIF_F_FSO;
180 netdev->fcoe_ddp_xid = 0;
181 }
182#endif /* IXGBE_FCOE */
159 ixgbe_init_interrupt_scheme(adapter); 183 ixgbe_init_interrupt_scheme(adapter);
160 if (netif_running(netdev)) 184 if (netif_running(netdev))
161 netdev->netdev_ops->ndo_open(netdev); 185 netdev->netdev_ops->ndo_open(netdev);
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index e3442f47f932..200454f30f6a 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -34,6 +34,7 @@
34#include <linux/in.h> 34#include <linux/in.h>
35#include <linux/ip.h> 35#include <linux/ip.h>
36#include <linux/tcp.h> 36#include <linux/tcp.h>
37#include <linux/pkt_sched.h>
37#include <linux/ipv6.h> 38#include <linux/ipv6.h>
38#include <net/checksum.h> 39#include <net/checksum.h>
39#include <net/ip6_checksum.h> 40#include <net/ip6_checksum.h>
@@ -510,8 +511,11 @@ static void ixgbe_receive_skb(struct ixgbe_q_vector *q_vector,
510 * @skb: skb currently being received and modified 511 * @skb: skb currently being received and modified
511 **/ 512 **/
512static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter, 513static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter,
513 u32 status_err, struct sk_buff *skb) 514 union ixgbe_adv_rx_desc *rx_desc,
515 struct sk_buff *skb)
514{ 516{
517 u32 status_err = le32_to_cpu(rx_desc->wb.upper.status_error);
518
515 skb->ip_summed = CHECKSUM_NONE; 519 skb->ip_summed = CHECKSUM_NONE;
516 520
517 /* Rx csum disabled */ 521 /* Rx csum disabled */
@@ -529,6 +533,16 @@ static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter,
529 return; 533 return;
530 534
531 if (status_err & IXGBE_RXDADV_ERR_TCPE) { 535 if (status_err & IXGBE_RXDADV_ERR_TCPE) {
536 u16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info;
537
538 /*
539 * 82599 errata, UDP frames with a 0 checksum can be marked as
540 * checksum errors.
541 */
542 if ((pkt_info & IXGBE_RXDADV_PKTTYPE_UDP) &&
543 (adapter->hw.mac.type == ixgbe_mac_82599EB))
544 return;
545
532 adapter->hw_csum_rx_error++; 546 adapter->hw_csum_rx_error++;
533 return; 547 return;
534 } 548 }
@@ -802,7 +816,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
802 goto next_desc; 816 goto next_desc;
803 } 817 }
804 818
805 ixgbe_rx_checksum(adapter, staterr, skb); 819 ixgbe_rx_checksum(adapter, rx_desc, skb);
806 820
807 /* probably a little skewed due to removing CRC */ 821 /* probably a little skewed due to removing CRC */
808 total_rx_bytes += skb->len; 822 total_rx_bytes += skb->len;
@@ -3806,8 +3820,9 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
3806 adapter->atr_sample_rate = 20; 3820 adapter->atr_sample_rate = 20;
3807 adapter->fdir_pballoc = 0; 3821 adapter->fdir_pballoc = 0;
3808#ifdef IXGBE_FCOE 3822#ifdef IXGBE_FCOE
3809 adapter->flags |= IXGBE_FLAG_FCOE_ENABLED; 3823 adapter->flags |= IXGBE_FLAG_FCOE_CAPABLE;
3810 adapter->ring_feature[RING_F_FCOE].indices = IXGBE_FCRETA_SIZE; 3824 adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
3825 adapter->ring_feature[RING_F_FCOE].indices = 0;
3811#endif /* IXGBE_FCOE */ 3826#endif /* IXGBE_FCOE */
3812 } 3827 }
3813 3828
@@ -5125,9 +5140,6 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
5125 int count = 0; 5140 int count = 0;
5126 unsigned int f; 5141 unsigned int f;
5127 5142
5128 r_idx = skb->queue_mapping;
5129 tx_ring = &adapter->tx_ring[r_idx];
5130
5131 if (adapter->vlgrp && vlan_tx_tag_present(skb)) { 5143 if (adapter->vlgrp && vlan_tx_tag_present(skb)) {
5132 tx_flags |= vlan_tx_tag_get(skb); 5144 tx_flags |= vlan_tx_tag_get(skb);
5133 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { 5145 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
@@ -5137,11 +5149,19 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
5137 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT; 5149 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT;
5138 tx_flags |= IXGBE_TX_FLAGS_VLAN; 5150 tx_flags |= IXGBE_TX_FLAGS_VLAN;
5139 } else if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { 5151 } else if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
5140 tx_flags |= (skb->queue_mapping << 13); 5152 if (skb->priority != TC_PRIO_CONTROL) {
5141 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT; 5153 tx_flags |= (skb->queue_mapping << 13);
5142 tx_flags |= IXGBE_TX_FLAGS_VLAN; 5154 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT;
5155 tx_flags |= IXGBE_TX_FLAGS_VLAN;
5156 } else {
5157 skb->queue_mapping =
5158 adapter->ring_feature[RING_F_DCB].indices-1;
5159 }
5143 } 5160 }
5144 5161
5162 r_idx = skb->queue_mapping;
5163 tx_ring = &adapter->tx_ring[r_idx];
5164
5145 if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && 5165 if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) &&
5146 (skb->protocol == htons(ETH_P_FCOE))) 5166 (skb->protocol == htons(ETH_P_FCOE)))
5147 tx_flags |= IXGBE_TX_FLAGS_FCOE; 5167 tx_flags |= IXGBE_TX_FLAGS_FCOE;
@@ -5580,16 +5600,11 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
5580#endif 5600#endif
5581 5601
5582#ifdef IXGBE_FCOE 5602#ifdef IXGBE_FCOE
5583 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { 5603 if (adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) {
5584 if (hw->mac.ops.get_device_caps) { 5604 if (hw->mac.ops.get_device_caps) {
5585 hw->mac.ops.get_device_caps(hw, &device_caps); 5605 hw->mac.ops.get_device_caps(hw, &device_caps);
5586 if (!(device_caps & IXGBE_DEVICE_CAPS_FCOE_OFFLOADS)) { 5606 if (device_caps & IXGBE_DEVICE_CAPS_FCOE_OFFLOADS)
5587 netdev->features |= NETIF_F_FCOE_CRC; 5607 adapter->flags &= ~IXGBE_FLAG_FCOE_CAPABLE;
5588 netdev->features |= NETIF_F_FSO;
5589 netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1;
5590 } else {
5591 adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
5592 }
5593 } 5608 }
5594 } 5609 }
5595#endif /* IXGBE_FCOE */ 5610#endif /* IXGBE_FCOE */
@@ -5638,7 +5653,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
5638 adapter->wol = 0; 5653 adapter->wol = 0;
5639 break; 5654 break;
5640 } 5655 }
5641 device_init_wakeup(&adapter->pdev->dev, true);
5642 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); 5656 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
5643 5657
5644 /* pick up the PCI bus settings for reporting later */ 5658 /* pick up the PCI bus settings for reporting later */
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 5d3343ef3d86..7acf204e38c9 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -184,6 +184,13 @@ void netxen_free_sw_resources(struct netxen_adapter *adapter)
184 kfree(recv_ctx->rds_rings); 184 kfree(recv_ctx->rds_rings);
185 185
186skip_rds: 186skip_rds:
187 if (recv_ctx->sds_rings == NULL)
188 goto skip_sds;
189
190 for(ring = 0; ring < adapter->max_sds_rings; ring++)
191 recv_ctx->sds_rings[ring].consumer = 0;
192
193skip_sds:
187 if (adapter->tx_ring == NULL) 194 if (adapter->tx_ring == NULL)
188 return; 195 return;
189 196
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
index 33984b737233..22cdd451fb82 100644
--- a/drivers/net/phy/mdio-gpio.c
+++ b/drivers/net/phy/mdio-gpio.c
@@ -30,6 +30,7 @@
30 30
31#ifdef CONFIG_OF_GPIO 31#ifdef CONFIG_OF_GPIO
32#include <linux/of_gpio.h> 32#include <linux/of_gpio.h>
33#include <linux/of_mdio.h>
33#include <linux/of_platform.h> 34#include <linux/of_platform.h>
34#endif 35#endif
35 36
@@ -81,13 +82,12 @@ static struct mdiobb_ops mdio_gpio_ops = {
81 .get_mdio_data = mdio_get, 82 .get_mdio_data = mdio_get,
82}; 83};
83 84
84static int __devinit mdio_gpio_bus_init(struct device *dev, 85static struct mii_bus * __devinit mdio_gpio_bus_init(struct device *dev,
85 struct mdio_gpio_platform_data *pdata, 86 struct mdio_gpio_platform_data *pdata,
86 int bus_id) 87 int bus_id)
87{ 88{
88 struct mii_bus *new_bus; 89 struct mii_bus *new_bus;
89 struct mdio_gpio_info *bitbang; 90 struct mdio_gpio_info *bitbang;
90 int ret = -ENOMEM;
91 int i; 91 int i;
92 92
93 bitbang = kzalloc(sizeof(*bitbang), GFP_KERNEL); 93 bitbang = kzalloc(sizeof(*bitbang), GFP_KERNEL);
@@ -104,8 +104,6 @@ static int __devinit mdio_gpio_bus_init(struct device *dev,
104 104
105 new_bus->name = "GPIO Bitbanged MDIO", 105 new_bus->name = "GPIO Bitbanged MDIO",
106 106
107 ret = -ENODEV;
108
109 new_bus->phy_mask = pdata->phy_mask; 107 new_bus->phy_mask = pdata->phy_mask;
110 new_bus->irq = pdata->irqs; 108 new_bus->irq = pdata->irqs;
111 new_bus->parent = dev; 109 new_bus->parent = dev;
@@ -129,15 +127,8 @@ static int __devinit mdio_gpio_bus_init(struct device *dev,
129 127
130 dev_set_drvdata(dev, new_bus); 128 dev_set_drvdata(dev, new_bus);
131 129
132 ret = mdiobus_register(new_bus); 130 return new_bus;
133 if (ret)
134 goto out_free_all;
135
136 return 0;
137 131
138out_free_all:
139 dev_set_drvdata(dev, NULL);
140 gpio_free(bitbang->mdio);
141out_free_mdc: 132out_free_mdc:
142 gpio_free(bitbang->mdc); 133 gpio_free(bitbang->mdc);
143out_free_bus: 134out_free_bus:
@@ -145,30 +136,47 @@ out_free_bus:
145out_free_bitbang: 136out_free_bitbang:
146 kfree(bitbang); 137 kfree(bitbang);
147out: 138out:
148 return ret; 139 return NULL;
149} 140}
150 141
151static void __devexit mdio_gpio_bus_destroy(struct device *dev) 142static void __devinit mdio_gpio_bus_deinit(struct device *dev)
152{ 143{
153 struct mii_bus *bus = dev_get_drvdata(dev); 144 struct mii_bus *bus = dev_get_drvdata(dev);
154 struct mdio_gpio_info *bitbang = bus->priv; 145 struct mdio_gpio_info *bitbang = bus->priv;
155 146
156 mdiobus_unregister(bus);
157 free_mdio_bitbang(bus);
158 dev_set_drvdata(dev, NULL); 147 dev_set_drvdata(dev, NULL);
159 gpio_free(bitbang->mdc);
160 gpio_free(bitbang->mdio); 148 gpio_free(bitbang->mdio);
149 gpio_free(bitbang->mdc);
150 free_mdio_bitbang(bus);
161 kfree(bitbang); 151 kfree(bitbang);
162} 152}
163 153
154static void __devexit mdio_gpio_bus_destroy(struct device *dev)
155{
156 struct mii_bus *bus = dev_get_drvdata(dev);
157
158 mdiobus_unregister(bus);
159 mdio_gpio_bus_deinit(dev);
160}
161
164static int __devinit mdio_gpio_probe(struct platform_device *pdev) 162static int __devinit mdio_gpio_probe(struct platform_device *pdev)
165{ 163{
166 struct mdio_gpio_platform_data *pdata = pdev->dev.platform_data; 164 struct mdio_gpio_platform_data *pdata = pdev->dev.platform_data;
165 struct mii_bus *new_bus;
166 int ret;
167 167
168 if (!pdata) 168 if (!pdata)
169 return -ENODEV; 169 return -ENODEV;
170 170
171 return mdio_gpio_bus_init(&pdev->dev, pdata, pdev->id); 171 new_bus = mdio_gpio_bus_init(&pdev->dev, pdata, pdev->id);
172 if (!new_bus)
173 return -ENODEV;
174
175 ret = mdiobus_register(new_bus);
176 if (ret)
177 mdio_gpio_bus_deinit(&pdev->dev);
178
179 return ret;
172} 180}
173 181
174static int __devexit mdio_gpio_remove(struct platform_device *pdev) 182static int __devexit mdio_gpio_remove(struct platform_device *pdev)
@@ -179,29 +187,12 @@ static int __devexit mdio_gpio_remove(struct platform_device *pdev)
179} 187}
180 188
181#ifdef CONFIG_OF_GPIO 189#ifdef CONFIG_OF_GPIO
182static void __devinit add_phy(struct mdio_gpio_platform_data *pdata,
183 struct device_node *np)
184{
185 const u32 *data;
186 int len, id, irq;
187
188 data = of_get_property(np, "reg", &len);
189 if (!data || len != 4)
190 return;
191
192 id = *data;
193 pdata->phy_mask &= ~(1 << id);
194
195 irq = of_irq_to_resource(np, 0, NULL);
196 if (irq)
197 pdata->irqs[id] = irq;
198}
199 190
200static int __devinit mdio_ofgpio_probe(struct of_device *ofdev, 191static int __devinit mdio_ofgpio_probe(struct of_device *ofdev,
201 const struct of_device_id *match) 192 const struct of_device_id *match)
202{ 193{
203 struct device_node *np = NULL;
204 struct mdio_gpio_platform_data *pdata; 194 struct mdio_gpio_platform_data *pdata;
195 struct mii_bus *new_bus;
205 int ret; 196 int ret;
206 197
207 pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); 198 pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
@@ -215,14 +206,18 @@ static int __devinit mdio_ofgpio_probe(struct of_device *ofdev,
215 206
216 ret = of_get_gpio(ofdev->node, 1); 207 ret = of_get_gpio(ofdev->node, 1);
217 if (ret < 0) 208 if (ret < 0)
218 goto out_free; 209 goto out_free;
219 pdata->mdio = ret; 210 pdata->mdio = ret;
220 211
221 while ((np = of_get_next_child(ofdev->node, np))) 212 new_bus = mdio_gpio_bus_init(&ofdev->dev, pdata, pdata->mdc);
222 if (!strcmp(np->type, "ethernet-phy")) 213 if (!new_bus)
223 add_phy(pdata, np); 214 return -ENODEV;
224 215
225 return mdio_gpio_bus_init(&ofdev->dev, pdata, pdata->mdc); 216 ret = of_mdiobus_register(new_bus, ofdev->node);
217 if (ret)
218 mdio_gpio_bus_deinit(&ofdev->dev);
219
220 return ret;
226 221
227out_free: 222out_free:
228 kfree(pdata); 223 kfree(pdata);
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 4b53b58d75fc..b82780d805f5 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2060,8 +2060,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2060 } 2060 }
2061 } 2061 }
2062 2062
2063 pci_set_master(pdev);
2064
2065 /* ioremap MMIO region */ 2063 /* ioremap MMIO region */
2066 ioaddr = ioremap(pci_resource_start(pdev, region), R8169_REGS_SIZE); 2064 ioaddr = ioremap(pci_resource_start(pdev, region), R8169_REGS_SIZE);
2067 if (!ioaddr) { 2065 if (!ioaddr) {
@@ -2089,6 +2087,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2089 2087
2090 RTL_W16(IntrStatus, 0xffff); 2088 RTL_W16(IntrStatus, 0xffff);
2091 2089
2090 pci_set_master(pdev);
2091
2092 /* Identify chip attached to board */ 2092 /* Identify chip attached to board */
2093 rtl8169_get_mac_version(tp, ioaddr); 2093 rtl8169_get_mac_version(tp, ioaddr);
2094 2094
@@ -3874,6 +3874,15 @@ static void rtl_shutdown(struct pci_dev *pdev)
3874 spin_unlock_irq(&tp->lock); 3874 spin_unlock_irq(&tp->lock);
3875 3875
3876 if (system_state == SYSTEM_POWER_OFF) { 3876 if (system_state == SYSTEM_POWER_OFF) {
3877 /* WoL fails with some 8168 when the receiver is disabled. */
3878 if (tp->features & RTL_FEATURE_WOL) {
3879 pci_clear_master(pdev);
3880
3881 RTL_W8(ChipCmd, CmdRxEnb);
3882 /* PCI commit */
3883 RTL_R8(ChipCmd);
3884 }
3885
3877 pci_wake_from_d3(pdev, true); 3886 pci_wake_from_d3(pdev, true);
3878 pci_set_power_state(pdev, PCI_D3hot); 3887 pci_set_power_state(pdev, PCI_D3hot);
3879 } 3888 }
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 60d502eef4fc..543af2044f40 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -3854,8 +3854,10 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port,
3854 skge->speed = -1; 3854 skge->speed = -1;
3855 skge->advertising = skge_supported_modes(hw); 3855 skge->advertising = skge_supported_modes(hw);
3856 3856
3857 if (device_may_wakeup(&hw->pdev->dev)) 3857 if (device_can_wakeup(&hw->pdev->dev)) {
3858 skge->wol = wol_supported(hw) & WAKE_MAGIC; 3858 skge->wol = wol_supported(hw) & WAKE_MAGIC;
3859 device_set_wakeup_enable(&hw->pdev->dev, skge->wol);
3860 }
3859 3861
3860 hw->dev[port] = dev; 3862 hw->dev[port] = dev;
3861 3863
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h
index f1f773b17fe1..57a159fac99f 100644
--- a/drivers/net/smc91x.h
+++ b/drivers/net/smc91x.h
@@ -186,7 +186,8 @@ static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg)
186#define SMC_outsb(a, r, p, l) writesb((a) + (r), p, (l)) 186#define SMC_outsb(a, r, p, l) writesb((a) + (r), p, (l))
187#define SMC_IRQ_FLAGS (-1) /* from resource */ 187#define SMC_IRQ_FLAGS (-1) /* from resource */
188 188
189#elif defined(CONFIG_MACH_LOGICPD_PXA270) 189#elif defined(CONFIG_MACH_LOGICPD_PXA270) \
190 || defined(CONFIG_MACH_NOMADIK_8815NHK)
190 191
191#define SMC_CAN_USE_8BIT 0 192#define SMC_CAN_USE_8BIT 0
192#define SMC_CAN_USE_16BIT 1 193#define SMC_CAN_USE_16BIT 1
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c
index 9d896116cf76..08a6c41c1599 100644
--- a/drivers/net/tokenring/ibmtr.c
+++ b/drivers/net/tokenring/ibmtr.c
@@ -1912,7 +1912,7 @@ static int __init ibmtr_init(void)
1912 1912
1913 find_turbo_adapters(io); 1913 find_turbo_adapters(io);
1914 1914
1915 for (i = 0; io[i] && (i < IBMTR_MAX_ADAPTERS); i++) { 1915 for (i = 0; i < IBMTR_MAX_ADAPTERS && io[i]; i++) {
1916 struct net_device *dev; 1916 struct net_device *dev;
1917 irq[i] = 0; 1917 irq[i] = 0;
1918 mem[i] = 0; 1918 mem[i] = 0;
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 40c6eba775ce..3b957e6412ee 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -1590,13 +1590,13 @@ static int init_phy(struct net_device *dev)
1590 priv->oldspeed = 0; 1590 priv->oldspeed = 0;
1591 priv->oldduplex = -1; 1591 priv->oldduplex = -1;
1592 1592
1593 if (!ug_info->phy_node)
1594 return 0;
1595
1596 phydev = of_phy_connect(dev, ug_info->phy_node, &adjust_link, 0, 1593 phydev = of_phy_connect(dev, ug_info->phy_node, &adjust_link, 0,
1597 priv->phy_interface); 1594 priv->phy_interface);
1595 if (!phydev)
1596 phydev = of_phy_connect_fixed_link(dev, &adjust_link,
1597 priv->phy_interface);
1598 if (!phydev) { 1598 if (!phydev) {
1599 printk("%s: Could not attach to PHY\n", dev->name); 1599 dev_err(&dev->dev, "Could not attach to PHY\n");
1600 return -ENODEV; 1600 return -ENODEV;
1601 } 1601 }
1602 1602
@@ -3608,9 +3608,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3608 struct ucc_geth_private *ugeth = NULL; 3608 struct ucc_geth_private *ugeth = NULL;
3609 struct ucc_geth_info *ug_info; 3609 struct ucc_geth_info *ug_info;
3610 struct resource res; 3610 struct resource res;
3611 struct device_node *phy;
3612 int err, ucc_num, max_speed = 0; 3611 int err, ucc_num, max_speed = 0;
3613 const u32 *fixed_link;
3614 const unsigned int *prop; 3612 const unsigned int *prop;
3615 const char *sprop; 3613 const char *sprop;
3616 const void *mac_addr; 3614 const void *mac_addr;
@@ -3708,15 +3706,8 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3708 3706
3709 ug_info->uf_info.regs = res.start; 3707 ug_info->uf_info.regs = res.start;
3710 ug_info->uf_info.irq = irq_of_parse_and_map(np, 0); 3708 ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
3711 fixed_link = of_get_property(np, "fixed-link", NULL); 3709
3712 if (fixed_link) { 3710 ug_info->phy_node = of_parse_phandle(np, "phy-handle", 0);
3713 phy = NULL;
3714 } else {
3715 phy = of_parse_phandle(np, "phy-handle", 0);
3716 if (phy == NULL)
3717 return -ENODEV;
3718 }
3719 ug_info->phy_node = phy;
3720 3711
3721 /* Find the TBI PHY node. If it's not there, we don't support SGMII */ 3712 /* Find the TBI PHY node. If it's not there, we don't support SGMII */
3722 ug_info->tbi_node = of_parse_phandle(np, "tbi-handle", 0); 3713 ug_info->tbi_node = of_parse_phandle(np, "tbi-handle", 0);
@@ -3725,7 +3716,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3725 prop = of_get_property(np, "phy-connection-type", NULL); 3716 prop = of_get_property(np, "phy-connection-type", NULL);
3726 if (!prop) { 3717 if (!prop) {
3727 /* handle interface property present in old trees */ 3718 /* handle interface property present in old trees */
3728 prop = of_get_property(phy, "interface", NULL); 3719 prop = of_get_property(ug_info->phy_node, "interface", NULL);
3729 if (prop != NULL) { 3720 if (prop != NULL) {
3730 phy_interface = enet_to_phy_interface[*prop]; 3721 phy_interface = enet_to_phy_interface[*prop];
3731 max_speed = enet_to_speed[*prop]; 3722 max_speed = enet_to_speed[*prop];
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index ea045151f953..029c1bc7468f 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2970,6 +2970,9 @@ ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
2970 if (modparam_nohwcrypt) 2970 if (modparam_nohwcrypt)
2971 return -EOPNOTSUPP; 2971 return -EOPNOTSUPP;
2972 2972
2973 if (sc->opmode == NL80211_IFTYPE_AP)
2974 return -EOPNOTSUPP;
2975
2973 switch (key->alg) { 2976 switch (key->alg) {
2974 case ALG_WEP: 2977 case ALG_WEP:
2975 case ALG_TKIP: 2978 case ALG_TKIP:
diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index 1aeafb511ddd..aad259b4c197 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -478,6 +478,18 @@ void ath9k_ani_reset(struct ath_hw *ah)
478 "Reset ANI state opmode %u\n", ah->opmode); 478 "Reset ANI state opmode %u\n", ah->opmode);
479 ah->stats.ast_ani_reset++; 479 ah->stats.ast_ani_reset++;
480 480
481 if (ah->opmode == NL80211_IFTYPE_AP) {
482 /*
483 * ath9k_hw_ani_control() will only process items set on
484 * ah->ani_function
485 */
486 if (IS_CHAN_2GHZ(chan))
487 ah->ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL |
488 ATH9K_ANI_FIRSTEP_LEVEL);
489 else
490 ah->ani_function = 0;
491 }
492
481 ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 0); 493 ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 0);
482 ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0); 494 ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0);
483 ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0); 495 ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0);
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index eef370bd1211..bf3d25ba7be1 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -474,6 +474,21 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
474 return 0; 474 return 0;
475} 475}
476 476
477/*
478 * Some users have reported their EEPROM programmed with
479 * 0x8000 set, this is not a supported regulatory domain
480 * but since we have more than one user with it we need
481 * a solution for them. We default to 0x64, which is the
482 * default Atheros world regulatory domain.
483 */
484static void ath_regd_sanitize(struct ath_regulatory *reg)
485{
486 if (reg->current_rd != COUNTRY_ERD_FLAG)
487 return;
488 printk(KERN_DEBUG "ath: EEPROM regdomain sanitized\n");
489 reg->current_rd = 0x64;
490}
491
477int 492int
478ath_regd_init(struct ath_regulatory *reg, 493ath_regd_init(struct ath_regulatory *reg,
479 struct wiphy *wiphy, 494 struct wiphy *wiphy,
@@ -486,6 +501,8 @@ ath_regd_init(struct ath_regulatory *reg,
486 if (!reg) 501 if (!reg)
487 return -EINVAL; 502 return -EINVAL;
488 503
504 ath_regd_sanitize(reg);
505
489 printk(KERN_DEBUG "ath: EEPROM regdomain: 0x%0x\n", reg->current_rd); 506 printk(KERN_DEBUG "ath: EEPROM regdomain: 0x%0x\n", reg->current_rd);
490 507
491 if (!ath_regd_is_eeprom_valid(reg)) { 508 if (!ath_regd_is_eeprom_valid(reg)) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 6d1519e1f011..355f50ea7fef 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2675,12 +2675,10 @@ static ssize_t show_power_level(struct device *d,
2675 struct device_attribute *attr, char *buf) 2675 struct device_attribute *attr, char *buf)
2676{ 2676{
2677 struct iwl_priv *priv = dev_get_drvdata(d); 2677 struct iwl_priv *priv = dev_get_drvdata(d);
2678 int mode = priv->power_data.user_power_setting;
2679 int level = priv->power_data.power_mode; 2678 int level = priv->power_data.power_mode;
2680 char *p = buf; 2679 char *p = buf;
2681 2680
2682 p += sprintf(p, "INDEX:%d\t", level); 2681 p += sprintf(p, "%d\n", level);
2683 p += sprintf(p, "USER:%d\n", mode);
2684 return p - buf + 1; 2682 return p - buf + 1;
2685} 2683}
2686 2684
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index 85ae7a62109c..9bbeec9427f0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -872,7 +872,8 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
872 iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)tx_cmd->hdr, hdr_len); 872 iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)tx_cmd->hdr, hdr_len);
873 873
874 /* Set up entry for this TFD in Tx byte-count array */ 874 /* Set up entry for this TFD in Tx byte-count array */
875 priv->cfg->ops->lib->txq_update_byte_cnt_tbl(priv, txq, 875 if (info->flags & IEEE80211_TX_CTL_AMPDU)
876 priv->cfg->ops->lib->txq_update_byte_cnt_tbl(priv, txq,
876 le16_to_cpu(tx_cmd->len)); 877 le16_to_cpu(tx_cmd->len));
877 878
878 pci_dma_sync_single_for_device(priv->pci_dev, txcmd_phys, 879 pci_dma_sync_single_for_device(priv->pci_dev, txcmd_phys,
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index cb9bd4c8f25e..956798f2c80c 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -3643,12 +3643,10 @@ static ssize_t show_power_level(struct device *d,
3643 struct device_attribute *attr, char *buf) 3643 struct device_attribute *attr, char *buf)
3644{ 3644{
3645 struct iwl_priv *priv = dev_get_drvdata(d); 3645 struct iwl_priv *priv = dev_get_drvdata(d);
3646 int mode = priv->power_data.user_power_setting;
3647 int level = priv->power_data.power_mode; 3646 int level = priv->power_data.power_mode;
3648 char *p = buf; 3647 char *p = buf;
3649 3648
3650 p += sprintf(p, "INDEX:%d\t", level); 3649 p += sprintf(p, "%d\n", level);
3651 p += sprintf(p, "USER:%d\n", mode);
3652 return p - buf + 1; 3650 return p - buf + 1;
3653} 3651}
3654 3652
diff --git a/drivers/net/wireless/iwmc3200wifi/netdev.c b/drivers/net/wireless/iwmc3200wifi/netdev.c
index aaa20c6885c8..aea5ccf24ccf 100644
--- a/drivers/net/wireless/iwmc3200wifi/netdev.c
+++ b/drivers/net/wireless/iwmc3200wifi/netdev.c
@@ -151,8 +151,8 @@ void iwm_if_free(struct iwm_priv *iwm)
151 return; 151 return;
152 152
153 free_netdev(iwm_to_ndev(iwm)); 153 free_netdev(iwm_to_ndev(iwm));
154 iwm_wdev_free(iwm);
155 iwm_priv_deinit(iwm); 154 iwm_priv_deinit(iwm);
155 iwm_wdev_free(iwm);
156} 156}
157 157
158int iwm_if_add(struct iwm_priv *iwm) 158int iwm_if_add(struct iwm_priv *iwm)
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 01db705a38ec..685098148e10 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -135,8 +135,14 @@ int lbs_update_hw_spec(struct lbs_private *priv)
135 /* Clamp region code to 8-bit since FW spec indicates that it should 135 /* Clamp region code to 8-bit since FW spec indicates that it should
136 * only ever be 8-bit, even though the field size is 16-bit. Some firmware 136 * only ever be 8-bit, even though the field size is 16-bit. Some firmware
137 * returns non-zero high 8 bits here. 137 * returns non-zero high 8 bits here.
138 *
139 * Firmware version 4.0.102 used in CF8381 has region code shifted. We
140 * need to check for this problem and handle it properly.
138 */ 141 */
139 priv->regioncode = le16_to_cpu(cmd.regioncode) & 0xFF; 142 if (MRVL_FW_MAJOR_REV(priv->fwrelease) == MRVL_FW_V4)
143 priv->regioncode = (le16_to_cpu(cmd.regioncode) >> 8) & 0xFF;
144 else
145 priv->regioncode = le16_to_cpu(cmd.regioncode) & 0xFF;
140 146
141 for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) { 147 for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) {
142 /* use the region code to search for the index */ 148 /* use the region code to search for the index */
diff --git a/drivers/net/wireless/libertas/defs.h b/drivers/net/wireless/libertas/defs.h
index 48da157d6cda..72f3479a4d70 100644
--- a/drivers/net/wireless/libertas/defs.h
+++ b/drivers/net/wireless/libertas/defs.h
@@ -234,6 +234,8 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in
234/** Mesh enable bit in FW capability */ 234/** Mesh enable bit in FW capability */
235#define MESH_CAPINFO_ENABLE_MASK (1<<16) 235#define MESH_CAPINFO_ENABLE_MASK (1<<16)
236 236
237/** FW definition from Marvell v4 */
238#define MRVL_FW_V4 (0x04)
237/** FW definition from Marvell v5 */ 239/** FW definition from Marvell v5 */
238#define MRVL_FW_V5 (0x05) 240#define MRVL_FW_V5 (0x05)
239/** FW definition from Marvell v10 */ 241/** FW definition from Marvell v10 */
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index a111bda392e2..7916ca3f84c8 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -709,7 +709,7 @@ static const struct ieee80211_ops mac80211_hwsim_ops =
709static void mac80211_hwsim_free(void) 709static void mac80211_hwsim_free(void)
710{ 710{
711 struct list_head tmplist, *i, *tmp; 711 struct list_head tmplist, *i, *tmp;
712 struct mac80211_hwsim_data *data; 712 struct mac80211_hwsim_data *data, *tmpdata;
713 713
714 INIT_LIST_HEAD(&tmplist); 714 INIT_LIST_HEAD(&tmplist);
715 715
@@ -718,7 +718,7 @@ static void mac80211_hwsim_free(void)
718 list_move(i, &tmplist); 718 list_move(i, &tmplist);
719 spin_unlock_bh(&hwsim_radio_lock); 719 spin_unlock_bh(&hwsim_radio_lock);
720 720
721 list_for_each_entry(data, &tmplist, list) { 721 list_for_each_entry_safe(data, tmpdata, &tmplist, list) {
722 debugfs_remove(data->debugfs_group); 722 debugfs_remove(data->debugfs_group);
723 debugfs_remove(data->debugfs_ps); 723 debugfs_remove(data->debugfs_ps);
724 debugfs_remove(data->debugfs); 724 debugfs_remove(data->debugfs);
@@ -1167,8 +1167,8 @@ static void __exit exit_mac80211_hwsim(void)
1167{ 1167{
1168 printk(KERN_DEBUG "mac80211_hwsim: unregister radios\n"); 1168 printk(KERN_DEBUG "mac80211_hwsim: unregister radios\n");
1169 1169
1170 unregister_netdev(hwsim_mon);
1171 mac80211_hwsim_free(); 1170 mac80211_hwsim_free();
1171 unregister_netdev(hwsim_mon);
1172} 1172}
1173 1173
1174 1174
diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
index 83116baeb110..72c7dbd39d0a 100644
--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -635,7 +635,7 @@ static int __devinit p54spi_probe(struct spi_device *spi)
635 635
636 hw = p54_init_common(sizeof(*priv)); 636 hw = p54_init_common(sizeof(*priv));
637 if (!hw) { 637 if (!hw) {
638 dev_err(&priv->spi->dev, "could not alloc ieee80211_hw"); 638 dev_err(&spi->dev, "could not alloc ieee80211_hw");
639 return -ENOMEM; 639 return -ENOMEM;
640 } 640 }
641 641
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 66daf68ff0ee..ce75426764a1 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1550,7 +1550,9 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
1550 rt2500usb_register_read(rt2x00dev, MAC_CSR0, &reg); 1550 rt2500usb_register_read(rt2x00dev, MAC_CSR0, &reg);
1551 rt2x00_set_chip(rt2x00dev, RT2570, value, reg); 1551 rt2x00_set_chip(rt2x00dev, RT2570, value, reg);
1552 1552
1553 if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0)) { 1553 if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0) ||
1554 rt2x00_check_rev(&rt2x00dev->chip, 0x0000000f, 0)) {
1555
1554 ERROR(rt2x00dev, "Invalid RT chipset detected.\n"); 1556 ERROR(rt2x00dev, "Invalid RT chipset detected.\n");
1555 return -ENODEV; 1557 return -ENODEV;
1556 } 1558 }
diff --git a/drivers/net/wireless/rtl818x/rtl8187_leds.c b/drivers/net/wireless/rtl818x/rtl8187_leds.c
index b44253592243..cf9f899fe0e6 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_leds.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_leds.c
@@ -208,11 +208,12 @@ void rtl8187_leds_exit(struct ieee80211_hw *dev)
208{ 208{
209 struct rtl8187_priv *priv = dev->priv; 209 struct rtl8187_priv *priv = dev->priv;
210 210
211 rtl8187_unregister_led(&priv->led_tx);
212 /* turn the LED off before exiting */ 211 /* turn the LED off before exiting */
213 queue_delayed_work(dev->workqueue, &priv->led_off, 0); 212 queue_delayed_work(dev->workqueue, &priv->led_off, 0);
214 cancel_delayed_work_sync(&priv->led_off); 213 cancel_delayed_work_sync(&priv->led_off);
214 cancel_delayed_work_sync(&priv->led_on);
215 rtl8187_unregister_led(&priv->led_rx); 215 rtl8187_unregister_led(&priv->led_rx);
216 rtl8187_unregister_led(&priv->led_tx);
216} 217}
217#endif /* def CONFIG_RTL8187_LED */ 218#endif /* def CONFIG_RTL8187_LED */
218 219