aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-02 21:00:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-02 21:00:43 -0400
commit5933f2ae353a93b1d3b501bc63c925531849bbc7 (patch)
tree4b21f6a2e5f252651827c8cb7c9692e378ba04c2 /drivers
parentadadfe48df3858c3c1ba52963502f38885ab2f3c (diff)
parentff538818f4a82c4cf02d2d6bd6ac5c7360b9d41d (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (47 commits) sysctl: net: call unregister_net_sysctl_table where needed Revert: veth: remove unneeded ifname code from veth_newlink() smsc95xx: fix reset check tg3: Fix failure to enable WoL by default when possible networking: inappropriate ioctl operation should return ENOTTY amd8111e: trivial typo spelling: Negotitate -> Negotiate ipv4: don't spam dmesg with "Using LC-trie" messages af_unix: Only allow recv on connected seqpacket sockets. mii: add support of pause frames in mii_get_an net: ftmac100: fix scheduling while atomic during PHY link status change usbnet: Transfer of maintainership usbnet: add support for some Huawei modems with cdc-ether ports bnx2: cancel timer on device removal iwl4965: fix "Received BA when not expected" iwlagn: fix "Received BA when not expected" dsa/mv88e6131: fix unknown multicast/broadcast forwarding on mv88e6085 usbnet: Resubmit interrupt URB if device is open iwl4965: fix "TX Power requested while scanning" iwlegacy: led stay solid on when no traffic b43: trivial: update module info about ucode16_mimo firmware ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/amd8111e.c2
-rw-r--r--drivers/net/atl1c/atl1c.h6
-rw-r--r--drivers/net/atl1c/atl1c_main.c14
-rw-r--r--drivers/net/benet/be_main.c1
-rw-r--r--drivers/net/bnx2.c2
-rw-r--r--drivers/net/bnx2x/bnx2x_cmn.c34
-rw-r--r--drivers/net/bonding/bond_3ad.c7
-rw-r--r--drivers/net/ehea/ehea_main.c9
-rw-r--r--drivers/net/fs_enet/mac-fec.c8
-rw-r--r--drivers/net/ftmac100.c8
-rw-r--r--drivers/net/mii.c4
-rw-r--r--drivers/net/netconsole.c8
-rw-r--r--drivers/net/r8169.c99
-rw-r--r--drivers/net/tg3.c8
-rw-r--r--drivers/net/usb/cdc_ether.c14
-rw-r--r--drivers/net/usb/cdc_ncm.c4
-rw-r--r--drivers/net/usb/smsc95xx.c2
-rw-r--r--drivers/net/usb/usbnet.c8
-rw-r--r--drivers/net/veth.c12
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c2
-rw-r--r--drivers/net/wireless/b43/main.c1
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-tx.c28
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-led.c20
-rw-r--r--drivers/net/wireless/iwlegacy/iwl4965-base.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-tx.c27
26 files changed, 242 insertions, 101 deletions
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index 88495c48a81d..241b185e6569 100644
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -106,7 +106,7 @@ MODULE_DESCRIPTION ("AMD8111 based 10/100 Ethernet Controller. Driver Version "M
106MODULE_LICENSE("GPL"); 106MODULE_LICENSE("GPL");
107MODULE_DEVICE_TABLE(pci, amd8111e_pci_tbl); 107MODULE_DEVICE_TABLE(pci, amd8111e_pci_tbl);
108module_param_array(speed_duplex, int, NULL, 0); 108module_param_array(speed_duplex, int, NULL, 0);
109MODULE_PARM_DESC(speed_duplex, "Set device speed and duplex modes, 0: Auto Negotitate, 1: 10Mbps Half Duplex, 2: 10Mbps Full Duplex, 3: 100Mbps Half Duplex, 4: 100Mbps Full Duplex"); 109MODULE_PARM_DESC(speed_duplex, "Set device speed and duplex modes, 0: Auto Negotiate, 1: 10Mbps Half Duplex, 2: 10Mbps Full Duplex, 3: 100Mbps Half Duplex, 4: 100Mbps Full Duplex");
110module_param_array(coalesce, bool, NULL, 0); 110module_param_array(coalesce, bool, NULL, 0);
111MODULE_PARM_DESC(coalesce, "Enable or Disable interrupt coalescing, 1: Enable, 0: Disable"); 111MODULE_PARM_DESC(coalesce, "Enable or Disable interrupt coalescing, 1: Enable, 0: Disable");
112module_param_array(dynamic_ipg, bool, NULL, 0); 112module_param_array(dynamic_ipg, bool, NULL, 0);
diff --git a/drivers/net/atl1c/atl1c.h b/drivers/net/atl1c/atl1c.h
index 7cb375e0e29c..925929d764ca 100644
--- a/drivers/net/atl1c/atl1c.h
+++ b/drivers/net/atl1c/atl1c.h
@@ -566,9 +566,9 @@ struct atl1c_adapter {
566#define __AT_TESTING 0x0001 566#define __AT_TESTING 0x0001
567#define __AT_RESETTING 0x0002 567#define __AT_RESETTING 0x0002
568#define __AT_DOWN 0x0003 568#define __AT_DOWN 0x0003
569 u8 work_event; 569 unsigned long work_event;
570#define ATL1C_WORK_EVENT_RESET 0x01 570#define ATL1C_WORK_EVENT_RESET 0
571#define ATL1C_WORK_EVENT_LINK_CHANGE 0x02 571#define ATL1C_WORK_EVENT_LINK_CHANGE 1
572 u32 msg_enable; 572 u32 msg_enable;
573 573
574 bool have_msi; 574 bool have_msi;
diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c
index 7d9d5067a65c..a6e1c36e48e6 100644
--- a/drivers/net/atl1c/atl1c_main.c
+++ b/drivers/net/atl1c/atl1c_main.c
@@ -325,7 +325,7 @@ static void atl1c_link_chg_event(struct atl1c_adapter *adapter)
325 } 325 }
326 } 326 }
327 327
328 adapter->work_event |= ATL1C_WORK_EVENT_LINK_CHANGE; 328 set_bit(ATL1C_WORK_EVENT_LINK_CHANGE, &adapter->work_event);
329 schedule_work(&adapter->common_task); 329 schedule_work(&adapter->common_task);
330} 330}
331 331
@@ -337,20 +337,16 @@ static void atl1c_common_task(struct work_struct *work)
337 adapter = container_of(work, struct atl1c_adapter, common_task); 337 adapter = container_of(work, struct atl1c_adapter, common_task);
338 netdev = adapter->netdev; 338 netdev = adapter->netdev;
339 339
340 if (adapter->work_event & ATL1C_WORK_EVENT_RESET) { 340 if (test_and_clear_bit(ATL1C_WORK_EVENT_RESET, &adapter->work_event)) {
341 adapter->work_event &= ~ATL1C_WORK_EVENT_RESET;
342 netif_device_detach(netdev); 341 netif_device_detach(netdev);
343 atl1c_down(adapter); 342 atl1c_down(adapter);
344 atl1c_up(adapter); 343 atl1c_up(adapter);
345 netif_device_attach(netdev); 344 netif_device_attach(netdev);
346 return;
347 } 345 }
348 346
349 if (adapter->work_event & ATL1C_WORK_EVENT_LINK_CHANGE) { 347 if (test_and_clear_bit(ATL1C_WORK_EVENT_LINK_CHANGE,
350 adapter->work_event &= ~ATL1C_WORK_EVENT_LINK_CHANGE; 348 &adapter->work_event))
351 atl1c_check_link_status(adapter); 349 atl1c_check_link_status(adapter);
352 }
353 return;
354} 350}
355 351
356 352
@@ -369,7 +365,7 @@ static void atl1c_tx_timeout(struct net_device *netdev)
369 struct atl1c_adapter *adapter = netdev_priv(netdev); 365 struct atl1c_adapter *adapter = netdev_priv(netdev);
370 366
371 /* Do the reset outside of interrupt context */ 367 /* Do the reset outside of interrupt context */
372 adapter->work_event |= ATL1C_WORK_EVENT_RESET; 368 set_bit(ATL1C_WORK_EVENT_RESET, &adapter->work_event);
373 schedule_work(&adapter->common_task); 369 schedule_work(&adapter->common_task);
374} 370}
375 371
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 7cb5a114c733..02a0443d1821 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1873,6 +1873,7 @@ static void be_worker(struct work_struct *work)
1873 be_detect_dump_ue(adapter); 1873 be_detect_dump_ue(adapter);
1874 1874
1875reschedule: 1875reschedule:
1876 adapter->work_counter++;
1876 schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000)); 1877 schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
1877} 1878}
1878 1879
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 8e6d618b5305..d8383a9af9ad 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -8413,6 +8413,8 @@ bnx2_remove_one(struct pci_dev *pdev)
8413 8413
8414 unregister_netdev(dev); 8414 unregister_netdev(dev);
8415 8415
8416 del_timer_sync(&bp->timer);
8417
8416 if (bp->mips_firmware) 8418 if (bp->mips_firmware)
8417 release_firmware(bp->mips_firmware); 8419 release_firmware(bp->mips_firmware);
8418 if (bp->rv2p_firmware) 8420 if (bp->rv2p_firmware)
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c
index e83ac6dd6fc0..16581df5ee4e 100644
--- a/drivers/net/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/bnx2x/bnx2x_cmn.c
@@ -2019,15 +2019,23 @@ static inline void bnx2x_set_pbd_gso(struct sk_buff *skb,
2019static inline u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp, struct sk_buff *skb, 2019static inline u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp, struct sk_buff *skb,
2020 u32 *parsing_data, u32 xmit_type) 2020 u32 *parsing_data, u32 xmit_type)
2021{ 2021{
2022 *parsing_data |= ((tcp_hdrlen(skb)/4) << 2022 *parsing_data |=
2023 ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT) & 2023 ((((u8 *)skb_transport_header(skb) - skb->data) >> 1) <<
2024 ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW; 2024 ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT) &
2025 ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W;
2025 2026
2026 *parsing_data |= ((((u8 *)tcp_hdr(skb) - skb->data) / 2) << 2027 if (xmit_type & XMIT_CSUM_TCP) {
2027 ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT) & 2028 *parsing_data |= ((tcp_hdrlen(skb) / 4) <<
2028 ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W; 2029 ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT) &
2030 ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW;
2029 2031
2030 return skb_transport_header(skb) + tcp_hdrlen(skb) - skb->data; 2032 return skb_transport_header(skb) + tcp_hdrlen(skb) - skb->data;
2033 } else
2034 /* We support checksum offload for TCP and UDP only.
2035 * No need to pass the UDP header length - it's a constant.
2036 */
2037 return skb_transport_header(skb) +
2038 sizeof(struct udphdr) - skb->data;
2031} 2039}
2032 2040
2033/** 2041/**
@@ -2043,7 +2051,7 @@ static inline u8 bnx2x_set_pbd_csum(struct bnx2x *bp, struct sk_buff *skb,
2043 struct eth_tx_parse_bd_e1x *pbd, 2051 struct eth_tx_parse_bd_e1x *pbd,
2044 u32 xmit_type) 2052 u32 xmit_type)
2045{ 2053{
2046 u8 hlen = (skb_network_header(skb) - skb->data) / 2; 2054 u8 hlen = (skb_network_header(skb) - skb->data) >> 1;
2047 2055
2048 /* for now NS flag is not used in Linux */ 2056 /* for now NS flag is not used in Linux */
2049 pbd->global_data = 2057 pbd->global_data =
@@ -2051,9 +2059,15 @@ static inline u8 bnx2x_set_pbd_csum(struct bnx2x *bp, struct sk_buff *skb,
2051 ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN_SHIFT)); 2059 ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN_SHIFT));
2052 2060
2053 pbd->ip_hlen_w = (skb_transport_header(skb) - 2061 pbd->ip_hlen_w = (skb_transport_header(skb) -
2054 skb_network_header(skb)) / 2; 2062 skb_network_header(skb)) >> 1;
2055 2063
2056 hlen += pbd->ip_hlen_w + tcp_hdrlen(skb) / 2; 2064 hlen += pbd->ip_hlen_w;
2065
2066 /* We support checksum offload for TCP and UDP only */
2067 if (xmit_type & XMIT_CSUM_TCP)
2068 hlen += tcp_hdrlen(skb) / 2;
2069 else
2070 hlen += sizeof(struct udphdr) / 2;
2057 2071
2058 pbd->total_hlen_w = cpu_to_le16(hlen); 2072 pbd->total_hlen_w = cpu_to_le16(hlen);
2059 hlen = hlen*2; 2073 hlen = hlen*2;
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 494bf960442d..31912f17653f 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -1482,8 +1482,11 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best,
1482 1482
1483static int agg_device_up(const struct aggregator *agg) 1483static int agg_device_up(const struct aggregator *agg)
1484{ 1484{
1485 return (netif_running(agg->slave->dev) && 1485 struct port *port = agg->lag_ports;
1486 netif_carrier_ok(agg->slave->dev)); 1486 if (!port)
1487 return 0;
1488 return (netif_running(port->slave->dev) &&
1489 netif_carrier_ok(port->slave->dev));
1487} 1490}
1488 1491
1489/** 1492/**
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index f75d3144b8a5..53c0f04b1b23 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -3040,11 +3040,14 @@ static void ehea_rereg_mrs(void)
3040 3040
3041 if (dev->flags & IFF_UP) { 3041 if (dev->flags & IFF_UP) {
3042 mutex_lock(&port->port_lock); 3042 mutex_lock(&port->port_lock);
3043 port_napi_enable(port);
3044 ret = ehea_restart_qps(dev); 3043 ret = ehea_restart_qps(dev);
3045 check_sqs(port); 3044 if (!ret) {
3046 if (!ret) 3045 check_sqs(port);
3046 port_napi_enable(port);
3047 netif_wake_queue(dev); 3047 netif_wake_queue(dev);
3048 } else {
3049 netdev_err(dev, "Unable to restart QPS\n");
3050 }
3048 mutex_unlock(&port->port_lock); 3051 mutex_unlock(&port->port_lock);
3049 } 3052 }
3050 } 3053 }
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c
index 61035fc5599b..b9fbc83d64a7 100644
--- a/drivers/net/fs_enet/mac-fec.c
+++ b/drivers/net/fs_enet/mac-fec.c
@@ -226,8 +226,8 @@ static void set_multicast_finish(struct net_device *dev)
226 } 226 }
227 227
228 FC(fecp, r_cntrl, FEC_RCNTRL_PROM); 228 FC(fecp, r_cntrl, FEC_RCNTRL_PROM);
229 FW(fecp, hash_table_high, fep->fec.hthi); 229 FW(fecp, grp_hash_table_high, fep->fec.hthi);
230 FW(fecp, hash_table_low, fep->fec.htlo); 230 FW(fecp, grp_hash_table_low, fep->fec.htlo);
231} 231}
232 232
233static void set_multicast_list(struct net_device *dev) 233static void set_multicast_list(struct net_device *dev)
@@ -273,8 +273,8 @@ static void restart(struct net_device *dev)
273 /* 273 /*
274 * Reset all multicast. 274 * Reset all multicast.
275 */ 275 */
276 FW(fecp, hash_table_high, fep->fec.hthi); 276 FW(fecp, grp_hash_table_high, fep->fec.hthi);
277 FW(fecp, hash_table_low, fep->fec.htlo); 277 FW(fecp, grp_hash_table_low, fep->fec.htlo);
278 278
279 /* 279 /*
280 * Set maximum receive buffer size. 280 * Set maximum receive buffer size.
diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c
index a31661948c42..9bd7746cbfcf 100644
--- a/drivers/net/ftmac100.c
+++ b/drivers/net/ftmac100.c
@@ -139,11 +139,11 @@ static int ftmac100_reset(struct ftmac100 *priv)
139 * that hardware reset completed (what the f*ck). 139 * that hardware reset completed (what the f*ck).
140 * We still need to wait for a while. 140 * We still need to wait for a while.
141 */ 141 */
142 usleep_range(500, 1000); 142 udelay(500);
143 return 0; 143 return 0;
144 } 144 }
145 145
146 usleep_range(1000, 10000); 146 udelay(1000);
147 } 147 }
148 148
149 netdev_err(netdev, "software reset failed\n"); 149 netdev_err(netdev, "software reset failed\n");
@@ -772,7 +772,7 @@ static int ftmac100_mdio_read(struct net_device *netdev, int phy_id, int reg)
772 if ((phycr & FTMAC100_PHYCR_MIIRD) == 0) 772 if ((phycr & FTMAC100_PHYCR_MIIRD) == 0)
773 return phycr & FTMAC100_PHYCR_MIIRDATA; 773 return phycr & FTMAC100_PHYCR_MIIRDATA;
774 774
775 usleep_range(100, 1000); 775 udelay(100);
776 } 776 }
777 777
778 netdev_err(netdev, "mdio read timed out\n"); 778 netdev_err(netdev, "mdio read timed out\n");
@@ -801,7 +801,7 @@ static void ftmac100_mdio_write(struct net_device *netdev, int phy_id, int reg,
801 if ((phycr & FTMAC100_PHYCR_MIIWR) == 0) 801 if ((phycr & FTMAC100_PHYCR_MIIWR) == 0)
802 return; 802 return;
803 803
804 usleep_range(100, 1000); 804 udelay(100);
805 } 805 }
806 806
807 netdev_err(netdev, "mdio write timed out\n"); 807 netdev_err(netdev, "mdio write timed out\n");
diff --git a/drivers/net/mii.c b/drivers/net/mii.c
index 0a6c6a2e7550..d4fc00b1ff93 100644
--- a/drivers/net/mii.c
+++ b/drivers/net/mii.c
@@ -49,6 +49,10 @@ static u32 mii_get_an(struct mii_if_info *mii, u16 addr)
49 result |= ADVERTISED_100baseT_Half; 49 result |= ADVERTISED_100baseT_Half;
50 if (advert & ADVERTISE_100FULL) 50 if (advert & ADVERTISE_100FULL)
51 result |= ADVERTISED_100baseT_Full; 51 result |= ADVERTISED_100baseT_Full;
52 if (advert & ADVERTISE_PAUSE_CAP)
53 result |= ADVERTISED_Pause;
54 if (advert & ADVERTISE_PAUSE_ASYM)
55 result |= ADVERTISED_Asym_Pause;
52 56
53 return result; 57 return result;
54} 58}
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index dfb67eb2a94b..eb41e44921e6 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -671,6 +671,7 @@ static int netconsole_netdev_event(struct notifier_block *this,
671 goto done; 671 goto done;
672 672
673 spin_lock_irqsave(&target_list_lock, flags); 673 spin_lock_irqsave(&target_list_lock, flags);
674restart:
674 list_for_each_entry(nt, &target_list, list) { 675 list_for_each_entry(nt, &target_list, list) {
675 netconsole_target_get(nt); 676 netconsole_target_get(nt);
676 if (nt->np.dev == dev) { 677 if (nt->np.dev == dev) {
@@ -683,9 +684,16 @@ static int netconsole_netdev_event(struct notifier_block *this,
683 * rtnl_lock already held 684 * rtnl_lock already held
684 */ 685 */
685 if (nt->np.dev) { 686 if (nt->np.dev) {
687 spin_unlock_irqrestore(
688 &target_list_lock,
689 flags);
686 __netpoll_cleanup(&nt->np); 690 __netpoll_cleanup(&nt->np);
691 spin_lock_irqsave(&target_list_lock,
692 flags);
687 dev_put(nt->np.dev); 693 dev_put(nt->np.dev);
688 nt->np.dev = NULL; 694 nt->np.dev = NULL;
695 netconsole_target_put(nt);
696 goto restart;
689 } 697 }
690 /* Fall through */ 698 /* Fall through */
691 case NETDEV_GOING_DOWN: 699 case NETDEV_GOING_DOWN:
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 493b0de3848b..397c36810a15 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -170,6 +170,16 @@ static const struct {
170}; 170};
171#undef _R 171#undef _R
172 172
173static const struct rtl_firmware_info {
174 int mac_version;
175 const char *fw_name;
176} rtl_firmware_infos[] = {
177 { .mac_version = RTL_GIGA_MAC_VER_25, .fw_name = FIRMWARE_8168D_1 },
178 { .mac_version = RTL_GIGA_MAC_VER_26, .fw_name = FIRMWARE_8168D_2 },
179 { .mac_version = RTL_GIGA_MAC_VER_29, .fw_name = FIRMWARE_8105E_1 },
180 { .mac_version = RTL_GIGA_MAC_VER_30, .fw_name = FIRMWARE_8105E_1 }
181};
182
173enum cfg_version { 183enum cfg_version {
174 RTL_CFG_0 = 0x00, 184 RTL_CFG_0 = 0x00,
175 RTL_CFG_1, 185 RTL_CFG_1,
@@ -565,6 +575,7 @@ struct rtl8169_private {
565 u32 saved_wolopts; 575 u32 saved_wolopts;
566 576
567 const struct firmware *fw; 577 const struct firmware *fw;
578#define RTL_FIRMWARE_UNKNOWN ERR_PTR(-EAGAIN);
568}; 579};
569 580
570MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>"); 581MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>");
@@ -1789,25 +1800,26 @@ rtl_phy_write_fw(struct rtl8169_private *tp, const struct firmware *fw)
1789 1800
1790static void rtl_release_firmware(struct rtl8169_private *tp) 1801static void rtl_release_firmware(struct rtl8169_private *tp)
1791{ 1802{
1792 release_firmware(tp->fw); 1803 if (!IS_ERR_OR_NULL(tp->fw))
1793 tp->fw = NULL; 1804 release_firmware(tp->fw);
1805 tp->fw = RTL_FIRMWARE_UNKNOWN;
1794} 1806}
1795 1807
1796static int rtl_apply_firmware(struct rtl8169_private *tp, const char *fw_name) 1808static void rtl_apply_firmware(struct rtl8169_private *tp)
1797{ 1809{
1798 const struct firmware **fw = &tp->fw; 1810 const struct firmware *fw = tp->fw;
1799 int rc = !*fw;
1800
1801 if (rc) {
1802 rc = request_firmware(fw, fw_name, &tp->pci_dev->dev);
1803 if (rc < 0)
1804 goto out;
1805 }
1806 1811
1807 /* TODO: release firmware once rtl_phy_write_fw signals failures. */ 1812 /* TODO: release firmware once rtl_phy_write_fw signals failures. */
1808 rtl_phy_write_fw(tp, *fw); 1813 if (!IS_ERR_OR_NULL(fw))
1809out: 1814 rtl_phy_write_fw(tp, fw);
1810 return rc; 1815}
1816
1817static void rtl_apply_firmware_cond(struct rtl8169_private *tp, u8 reg, u16 val)
1818{
1819 if (rtl_readphy(tp, reg) != val)
1820 netif_warn(tp, hw, tp->dev, "chipset not ready for firmware\n");
1821 else
1822 rtl_apply_firmware(tp);
1811} 1823}
1812 1824
1813static void rtl8169s_hw_phy_config(struct rtl8169_private *tp) 1825static void rtl8169s_hw_phy_config(struct rtl8169_private *tp)
@@ -2246,10 +2258,8 @@ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp)
2246 2258
2247 rtl_writephy(tp, 0x1f, 0x0005); 2259 rtl_writephy(tp, 0x1f, 0x0005);
2248 rtl_writephy(tp, 0x05, 0x001b); 2260 rtl_writephy(tp, 0x05, 0x001b);
2249 if ((rtl_readphy(tp, 0x06) != 0xbf00) || 2261
2250 (rtl_apply_firmware(tp, FIRMWARE_8168D_1) < 0)) { 2262 rtl_apply_firmware_cond(tp, MII_EXPANSION, 0xbf00);
2251 netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n");
2252 }
2253 2263
2254 rtl_writephy(tp, 0x1f, 0x0000); 2264 rtl_writephy(tp, 0x1f, 0x0000);
2255} 2265}
@@ -2351,10 +2361,8 @@ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp)
2351 2361
2352 rtl_writephy(tp, 0x1f, 0x0005); 2362 rtl_writephy(tp, 0x1f, 0x0005);
2353 rtl_writephy(tp, 0x05, 0x001b); 2363 rtl_writephy(tp, 0x05, 0x001b);
2354 if ((rtl_readphy(tp, 0x06) != 0xb300) || 2364
2355 (rtl_apply_firmware(tp, FIRMWARE_8168D_2) < 0)) { 2365 rtl_apply_firmware_cond(tp, MII_EXPANSION, 0xb300);
2356 netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n");
2357 }
2358 2366
2359 rtl_writephy(tp, 0x1f, 0x0000); 2367 rtl_writephy(tp, 0x1f, 0x0000);
2360} 2368}
@@ -2474,8 +2482,7 @@ static void rtl8105e_hw_phy_config(struct rtl8169_private *tp)
2474 rtl_writephy(tp, 0x18, 0x0310); 2482 rtl_writephy(tp, 0x18, 0x0310);
2475 msleep(100); 2483 msleep(100);
2476 2484
2477 if (rtl_apply_firmware(tp, FIRMWARE_8105E_1) < 0) 2485 rtl_apply_firmware(tp);
2478 netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n");
2479 2486
2480 rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init)); 2487 rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
2481} 2488}
@@ -3237,6 +3244,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3237 tp->timer.data = (unsigned long) dev; 3244 tp->timer.data = (unsigned long) dev;
3238 tp->timer.function = rtl8169_phy_timer; 3245 tp->timer.function = rtl8169_phy_timer;
3239 3246
3247 tp->fw = RTL_FIRMWARE_UNKNOWN;
3248
3240 rc = register_netdev(dev); 3249 rc = register_netdev(dev);
3241 if (rc < 0) 3250 if (rc < 0)
3242 goto err_out_msi_4; 3251 goto err_out_msi_4;
@@ -3288,10 +3297,10 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev)
3288 3297
3289 cancel_delayed_work_sync(&tp->task); 3298 cancel_delayed_work_sync(&tp->task);
3290 3299
3291 rtl_release_firmware(tp);
3292
3293 unregister_netdev(dev); 3300 unregister_netdev(dev);
3294 3301
3302 rtl_release_firmware(tp);
3303
3295 if (pci_dev_run_wake(pdev)) 3304 if (pci_dev_run_wake(pdev))
3296 pm_runtime_get_noresume(&pdev->dev); 3305 pm_runtime_get_noresume(&pdev->dev);
3297 3306
@@ -3303,6 +3312,37 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev)
3303 pci_set_drvdata(pdev, NULL); 3312 pci_set_drvdata(pdev, NULL);
3304} 3313}
3305 3314
3315static void rtl_request_firmware(struct rtl8169_private *tp)
3316{
3317 int i;
3318
3319 /* Return early if the firmware is already loaded / cached. */
3320 if (!IS_ERR(tp->fw))
3321 goto out;
3322
3323 for (i = 0; i < ARRAY_SIZE(rtl_firmware_infos); i++) {
3324 const struct rtl_firmware_info *info = rtl_firmware_infos + i;
3325
3326 if (info->mac_version == tp->mac_version) {
3327 const char *name = info->fw_name;
3328 int rc;
3329
3330 rc = request_firmware(&tp->fw, name, &tp->pci_dev->dev);
3331 if (rc < 0) {
3332 netif_warn(tp, ifup, tp->dev, "unable to load "
3333 "firmware patch %s (%d)\n", name, rc);
3334 goto out_disable_request_firmware;
3335 }
3336 goto out;
3337 }
3338 }
3339
3340out_disable_request_firmware:
3341 tp->fw = NULL;
3342out:
3343 return;
3344}
3345
3306static int rtl8169_open(struct net_device *dev) 3346static int rtl8169_open(struct net_device *dev)
3307{ 3347{
3308 struct rtl8169_private *tp = netdev_priv(dev); 3348 struct rtl8169_private *tp = netdev_priv(dev);
@@ -3334,11 +3374,13 @@ static int rtl8169_open(struct net_device *dev)
3334 3374
3335 smp_mb(); 3375 smp_mb();
3336 3376
3377 rtl_request_firmware(tp);
3378
3337 retval = request_irq(dev->irq, rtl8169_interrupt, 3379 retval = request_irq(dev->irq, rtl8169_interrupt,
3338 (tp->features & RTL_FEATURE_MSI) ? 0 : IRQF_SHARED, 3380 (tp->features & RTL_FEATURE_MSI) ? 0 : IRQF_SHARED,
3339 dev->name, dev); 3381 dev->name, dev);
3340 if (retval < 0) 3382 if (retval < 0)
3341 goto err_release_ring_2; 3383 goto err_release_fw_2;
3342 3384
3343 napi_enable(&tp->napi); 3385 napi_enable(&tp->napi);
3344 3386
@@ -3359,7 +3401,8 @@ static int rtl8169_open(struct net_device *dev)
3359out: 3401out:
3360 return retval; 3402 return retval;
3361 3403
3362err_release_ring_2: 3404err_release_fw_2:
3405 rtl_release_firmware(tp);
3363 rtl8169_rx_clear(tp); 3406 rtl8169_rx_clear(tp);
3364err_free_rx_1: 3407err_free_rx_1:
3365 dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray, 3408 dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray,
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index b8c5f35577e4..7a5daefb6f33 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -12327,8 +12327,10 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
12327 if (val & VCPU_CFGSHDW_ASPM_DBNC) 12327 if (val & VCPU_CFGSHDW_ASPM_DBNC)
12328 tp->tg3_flags |= TG3_FLAG_ASPM_WORKAROUND; 12328 tp->tg3_flags |= TG3_FLAG_ASPM_WORKAROUND;
12329 if ((val & VCPU_CFGSHDW_WOL_ENABLE) && 12329 if ((val & VCPU_CFGSHDW_WOL_ENABLE) &&
12330 (val & VCPU_CFGSHDW_WOL_MAGPKT)) 12330 (val & VCPU_CFGSHDW_WOL_MAGPKT)) {
12331 tp->tg3_flags |= TG3_FLAG_WOL_ENABLE; 12331 tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
12332 device_set_wakeup_enable(&tp->pdev->dev, true);
12333 }
12332 goto done; 12334 goto done;
12333 } 12335 }
12334 12336
@@ -12461,8 +12463,10 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
12461 tp->tg3_flags &= ~TG3_FLAG_WOL_CAP; 12463 tp->tg3_flags &= ~TG3_FLAG_WOL_CAP;
12462 12464
12463 if ((tp->tg3_flags & TG3_FLAG_WOL_CAP) && 12465 if ((tp->tg3_flags & TG3_FLAG_WOL_CAP) &&
12464 (nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE)) 12466 (nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE)) {
12465 tp->tg3_flags |= TG3_FLAG_WOL_ENABLE; 12467 tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
12468 device_set_wakeup_enable(&tp->pdev->dev, true);
12469 }
12466 12470
12467 if (cfg2 & (1 << 17)) 12471 if (cfg2 & (1 << 17))
12468 tp->phy_flags |= TG3_PHYFLG_CAPACITIVE_COUPLING; 12472 tp->phy_flags |= TG3_PHYFLG_CAPACITIVE_COUPLING;
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index 341f7056a800..a301479ecc60 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -460,7 +460,7 @@ static const struct driver_info cdc_info = {
460 .manage_power = cdc_manage_power, 460 .manage_power = cdc_manage_power,
461}; 461};
462 462
463static const struct driver_info mbm_info = { 463static const struct driver_info wwan_info = {
464 .description = "Mobile Broadband Network Device", 464 .description = "Mobile Broadband Network Device",
465 .flags = FLAG_WWAN, 465 .flags = FLAG_WWAN,
466 .bind = usbnet_cdc_bind, 466 .bind = usbnet_cdc_bind,
@@ -471,6 +471,7 @@ static const struct driver_info mbm_info = {
471 471
472/*-------------------------------------------------------------------------*/ 472/*-------------------------------------------------------------------------*/
473 473
474#define HUAWEI_VENDOR_ID 0x12D1
474 475
475static const struct usb_device_id products [] = { 476static const struct usb_device_id products [] = {
476/* 477/*
@@ -587,8 +588,17 @@ static const struct usb_device_id products [] = {
587}, { 588}, {
588 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM, 589 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM,
589 USB_CDC_PROTO_NONE), 590 USB_CDC_PROTO_NONE),
590 .driver_info = (unsigned long)&mbm_info, 591 .driver_info = (unsigned long)&wwan_info,
591 592
593}, {
594 /* Various Huawei modems with a network port like the UMG1831 */
595 .match_flags = USB_DEVICE_ID_MATCH_VENDOR
596 | USB_DEVICE_ID_MATCH_INT_INFO,
597 .idVendor = HUAWEI_VENDOR_ID,
598 .bInterfaceClass = USB_CLASS_COMM,
599 .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,
600 .bInterfaceProtocol = 255,
601 .driver_info = (unsigned long)&wwan_info,
592}, 602},
593 { }, // END 603 { }, // END
594}; 604};
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index 967371f04454..1033ef6476a4 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -54,13 +54,13 @@
54#include <linux/usb/usbnet.h> 54#include <linux/usb/usbnet.h>
55#include <linux/usb/cdc.h> 55#include <linux/usb/cdc.h>
56 56
57#define DRIVER_VERSION "7-Feb-2011" 57#define DRIVER_VERSION "23-Apr-2011"
58 58
59/* CDC NCM subclass 3.2.1 */ 59/* CDC NCM subclass 3.2.1 */
60#define USB_CDC_NCM_NDP16_LENGTH_MIN 0x10 60#define USB_CDC_NCM_NDP16_LENGTH_MIN 0x10
61 61
62/* Maximum NTB length */ 62/* Maximum NTB length */
63#define CDC_NCM_NTB_MAX_SIZE_TX 16384 /* bytes */ 63#define CDC_NCM_NTB_MAX_SIZE_TX (16384 + 4) /* bytes, must be short terminated */
64#define CDC_NCM_NTB_MAX_SIZE_RX 16384 /* bytes */ 64#define CDC_NCM_NTB_MAX_SIZE_RX 16384 /* bytes */
65 65
66/* Minimum value for MaxDatagramSize, ch. 6.2.9 */ 66/* Minimum value for MaxDatagramSize, ch. 6.2.9 */
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 47a6c870b51f..48d4efdb4959 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -730,7 +730,7 @@ static int smsc95xx_phy_initialize(struct usbnet *dev)
730 msleep(10); 730 msleep(10);
731 bmcr = smsc95xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR); 731 bmcr = smsc95xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR);
732 timeout++; 732 timeout++;
733 } while ((bmcr & MII_BMCR) && (timeout < 100)); 733 } while ((bmcr & BMCR_RESET) && (timeout < 100));
734 734
735 if (timeout >= 100) { 735 if (timeout >= 100) {
736 netdev_warn(dev->net, "timeout on PHY Reset"); 736 netdev_warn(dev->net, "timeout on PHY Reset");
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 069c1cf0fdf7..009bba3d753e 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -736,6 +736,7 @@ int usbnet_open (struct net_device *net)
736 } 736 }
737 } 737 }
738 738
739 set_bit(EVENT_DEV_OPEN, &dev->flags);
739 netif_start_queue (net); 740 netif_start_queue (net);
740 netif_info(dev, ifup, dev->net, 741 netif_info(dev, ifup, dev->net,
741 "open: enable queueing (rx %d, tx %d) mtu %d %s framing\n", 742 "open: enable queueing (rx %d, tx %d) mtu %d %s framing\n",
@@ -1259,6 +1260,9 @@ void usbnet_disconnect (struct usb_interface *intf)
1259 if (dev->driver_info->unbind) 1260 if (dev->driver_info->unbind)
1260 dev->driver_info->unbind (dev, intf); 1261 dev->driver_info->unbind (dev, intf);
1261 1262
1263 usb_kill_urb(dev->interrupt);
1264 usb_free_urb(dev->interrupt);
1265
1262 free_netdev(net); 1266 free_netdev(net);
1263 usb_put_dev (xdev); 1267 usb_put_dev (xdev);
1264} 1268}
@@ -1498,6 +1502,10 @@ int usbnet_resume (struct usb_interface *intf)
1498 int retval; 1502 int retval;
1499 1503
1500 if (!--dev->suspend_count) { 1504 if (!--dev->suspend_count) {
1505 /* resume interrupt URBs */
1506 if (dev->interrupt && test_bit(EVENT_DEV_OPEN, &dev->flags))
1507 usb_submit_urb(dev->interrupt, GFP_NOIO);
1508
1501 spin_lock_irq(&dev->txq.lock); 1509 spin_lock_irq(&dev->txq.lock);
1502 while ((res = usb_get_from_anchor(&dev->deferred))) { 1510 while ((res = usb_get_from_anchor(&dev->deferred))) {
1503 1511
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 2de9b90c5f8f..3b99f64104fd 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -403,6 +403,17 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
403 if (tb[IFLA_ADDRESS] == NULL) 403 if (tb[IFLA_ADDRESS] == NULL)
404 random_ether_addr(dev->dev_addr); 404 random_ether_addr(dev->dev_addr);
405 405
406 if (tb[IFLA_IFNAME])
407 nla_strlcpy(dev->name, tb[IFLA_IFNAME], IFNAMSIZ);
408 else
409 snprintf(dev->name, IFNAMSIZ, DRV_NAME "%%d");
410
411 if (strchr(dev->name, '%')) {
412 err = dev_alloc_name(dev, dev->name);
413 if (err < 0)
414 goto err_alloc_name;
415 }
416
406 err = register_netdevice(dev); 417 err = register_netdevice(dev);
407 if (err < 0) 418 if (err < 0)
408 goto err_register_dev; 419 goto err_register_dev;
@@ -422,6 +433,7 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
422 433
423err_register_dev: 434err_register_dev:
424 /* nothing to do */ 435 /* nothing to do */
436err_alloc_name:
425err_configure_peer: 437err_configure_peer:
426 unregister_netdevice(peer); 438 unregister_netdevice(peer);
427 return err; 439 return err;
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index dcd19bc337d1..b29c80def35e 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -506,7 +506,7 @@ bool ath_stoprecv(struct ath_softc *sc)
506 "confusing the DMA engine when we start RX up\n"); 506 "confusing the DMA engine when we start RX up\n");
507 ATH_DBG_WARN_ON_ONCE(!stopped); 507 ATH_DBG_WARN_ON_ONCE(!stopped);
508 } 508 }
509 return stopped || reset; 509 return stopped && !reset;
510} 510}
511 511
512void ath_flushrecv(struct ath_softc *sc) 512void ath_flushrecv(struct ath_softc *sc)
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index d59b0168c14a..5af40d9170a0 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -72,6 +72,7 @@ MODULE_FIRMWARE("b43/ucode11.fw");
72MODULE_FIRMWARE("b43/ucode13.fw"); 72MODULE_FIRMWARE("b43/ucode13.fw");
73MODULE_FIRMWARE("b43/ucode14.fw"); 73MODULE_FIRMWARE("b43/ucode14.fw");
74MODULE_FIRMWARE("b43/ucode15.fw"); 74MODULE_FIRMWARE("b43/ucode15.fw");
75MODULE_FIRMWARE("b43/ucode16_mimo.fw");
75MODULE_FIRMWARE("b43/ucode5.fw"); 76MODULE_FIRMWARE("b43/ucode5.fw");
76MODULE_FIRMWARE("b43/ucode9.fw"); 77MODULE_FIRMWARE("b43/ucode9.fw");
77 78
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-tx.c b/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
index 5c40502f869a..79ac081832fb 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
+++ b/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
@@ -316,12 +316,18 @@ int iwl4965_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
316 316
317 hdr_len = ieee80211_hdrlen(fc); 317 hdr_len = ieee80211_hdrlen(fc);
318 318
319 /* Find index into station table for destination station */ 319 /* For management frames use broadcast id to do not break aggregation */
320 sta_id = iwl_legacy_sta_id_or_broadcast(priv, ctx, info->control.sta); 320 if (!ieee80211_is_data(fc))
321 if (sta_id == IWL_INVALID_STATION) { 321 sta_id = ctx->bcast_sta_id;
322 IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n", 322 else {
323 hdr->addr1); 323 /* Find index into station table for destination station */
324 goto drop_unlock; 324 sta_id = iwl_legacy_sta_id_or_broadcast(priv, ctx, info->control.sta);
325
326 if (sta_id == IWL_INVALID_STATION) {
327 IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n",
328 hdr->addr1);
329 goto drop_unlock;
330 }
325 } 331 }
326 332
327 IWL_DEBUG_TX(priv, "station Id %d\n", sta_id); 333 IWL_DEBUG_TX(priv, "station Id %d\n", sta_id);
@@ -1127,12 +1133,16 @@ int iwl4965_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
1127 q->read_ptr = iwl_legacy_queue_inc_wrap(q->read_ptr, q->n_bd)) { 1133 q->read_ptr = iwl_legacy_queue_inc_wrap(q->read_ptr, q->n_bd)) {
1128 1134
1129 tx_info = &txq->txb[txq->q.read_ptr]; 1135 tx_info = &txq->txb[txq->q.read_ptr];
1130 iwl4965_tx_status(priv, tx_info, 1136
1131 txq_id >= IWL4965_FIRST_AMPDU_QUEUE); 1137 if (WARN_ON_ONCE(tx_info->skb == NULL))
1138 continue;
1132 1139
1133 hdr = (struct ieee80211_hdr *)tx_info->skb->data; 1140 hdr = (struct ieee80211_hdr *)tx_info->skb->data;
1134 if (hdr && ieee80211_is_data_qos(hdr->frame_control)) 1141 if (ieee80211_is_data_qos(hdr->frame_control))
1135 nfreed++; 1142 nfreed++;
1143
1144 iwl4965_tx_status(priv, tx_info,
1145 txq_id >= IWL4965_FIRST_AMPDU_QUEUE);
1136 tx_info->skb = NULL; 1146 tx_info->skb = NULL;
1137 1147
1138 priv->cfg->ops->lib->txq_free_tfd(priv, txq); 1148 priv->cfg->ops->lib->txq_free_tfd(priv, txq);
diff --git a/drivers/net/wireless/iwlegacy/iwl-led.c b/drivers/net/wireless/iwlegacy/iwl-led.c
index 15eb8b707157..bda0d61b2c0d 100644
--- a/drivers/net/wireless/iwlegacy/iwl-led.c
+++ b/drivers/net/wireless/iwlegacy/iwl-led.c
@@ -48,8 +48,21 @@ module_param(led_mode, int, S_IRUGO);
48MODULE_PARM_DESC(led_mode, "0=system default, " 48MODULE_PARM_DESC(led_mode, "0=system default, "
49 "1=On(RF On)/Off(RF Off), 2=blinking"); 49 "1=On(RF On)/Off(RF Off), 2=blinking");
50 50
51/* Throughput OFF time(ms) ON time (ms)
52 * >300 25 25
53 * >200 to 300 40 40
54 * >100 to 200 55 55
55 * >70 to 100 65 65
56 * >50 to 70 75 75
57 * >20 to 50 85 85
58 * >10 to 20 95 95
59 * >5 to 10 110 110
60 * >1 to 5 130 130
61 * >0 to 1 167 167
62 * <=0 SOLID ON
63 */
51static const struct ieee80211_tpt_blink iwl_blink[] = { 64static const struct ieee80211_tpt_blink iwl_blink[] = {
52 { .throughput = 0 * 1024 - 1, .blink_time = 334 }, 65 { .throughput = 0, .blink_time = 334 },
53 { .throughput = 1 * 1024 - 1, .blink_time = 260 }, 66 { .throughput = 1 * 1024 - 1, .blink_time = 260 },
54 { .throughput = 5 * 1024 - 1, .blink_time = 220 }, 67 { .throughput = 5 * 1024 - 1, .blink_time = 220 },
55 { .throughput = 10 * 1024 - 1, .blink_time = 190 }, 68 { .throughput = 10 * 1024 - 1, .blink_time = 190 },
@@ -101,6 +114,11 @@ static int iwl_legacy_led_cmd(struct iwl_priv *priv,
101 if (priv->blink_on == on && priv->blink_off == off) 114 if (priv->blink_on == on && priv->blink_off == off)
102 return 0; 115 return 0;
103 116
117 if (off == 0) {
118 /* led is SOLID_ON */
119 on = IWL_LED_SOLID;
120 }
121
104 IWL_DEBUG_LED(priv, "Led blink time compensation=%u\n", 122 IWL_DEBUG_LED(priv, "Led blink time compensation=%u\n",
105 priv->cfg->base_params->led_compensation); 123 priv->cfg->base_params->led_compensation);
106 led_cmd.on = iwl_legacy_blink_compensation(priv, on, 124 led_cmd.on = iwl_legacy_blink_compensation(priv, on,
diff --git a/drivers/net/wireless/iwlegacy/iwl4965-base.c b/drivers/net/wireless/iwlegacy/iwl4965-base.c
index d484c3678163..a62fe24ee594 100644
--- a/drivers/net/wireless/iwlegacy/iwl4965-base.c
+++ b/drivers/net/wireless/iwlegacy/iwl4965-base.c
@@ -2984,15 +2984,15 @@ static void iwl4965_bg_txpower_work(struct work_struct *work)
2984 struct iwl_priv *priv = container_of(work, struct iwl_priv, 2984 struct iwl_priv *priv = container_of(work, struct iwl_priv,
2985 txpower_work); 2985 txpower_work);
2986 2986
2987 mutex_lock(&priv->mutex);
2988
2987 /* If a scan happened to start before we got here 2989 /* If a scan happened to start before we got here
2988 * then just return; the statistics notification will 2990 * then just return; the statistics notification will
2989 * kick off another scheduled work to compensate for 2991 * kick off another scheduled work to compensate for
2990 * any temperature delta we missed here. */ 2992 * any temperature delta we missed here. */
2991 if (test_bit(STATUS_EXIT_PENDING, &priv->status) || 2993 if (test_bit(STATUS_EXIT_PENDING, &priv->status) ||
2992 test_bit(STATUS_SCANNING, &priv->status)) 2994 test_bit(STATUS_SCANNING, &priv->status))
2993 return; 2995 goto out;
2994
2995 mutex_lock(&priv->mutex);
2996 2996
2997 /* Regardless of if we are associated, we must reconfigure the 2997 /* Regardless of if we are associated, we must reconfigure the
2998 * TX power since frames can be sent on non-radar channels while 2998 * TX power since frames can be sent on non-radar channels while
@@ -3002,7 +3002,7 @@ static void iwl4965_bg_txpower_work(struct work_struct *work)
3002 /* Update last_temperature to keep is_calib_needed from running 3002 /* Update last_temperature to keep is_calib_needed from running
3003 * when it isn't needed... */ 3003 * when it isn't needed... */
3004 priv->last_temperature = priv->temperature; 3004 priv->last_temperature = priv->temperature;
3005 3005out:
3006 mutex_unlock(&priv->mutex); 3006 mutex_unlock(&priv->mutex);
3007} 3007}
3008 3008
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index dfdbea6e8f99..fbbde0712fa5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -335,7 +335,6 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
335 struct ieee80211_channel *channel = conf->channel; 335 struct ieee80211_channel *channel = conf->channel;
336 const struct iwl_channel_info *ch_info; 336 const struct iwl_channel_info *ch_info;
337 int ret = 0; 337 int ret = 0;
338 bool ht_changed[NUM_IWL_RXON_CTX] = {};
339 338
340 IWL_DEBUG_MAC80211(priv, "changed %#x", changed); 339 IWL_DEBUG_MAC80211(priv, "changed %#x", changed);
341 340
@@ -383,10 +382,8 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
383 382
384 for_each_context(priv, ctx) { 383 for_each_context(priv, ctx) {
385 /* Configure HT40 channels */ 384 /* Configure HT40 channels */
386 if (ctx->ht.enabled != conf_is_ht(conf)) { 385 if (ctx->ht.enabled != conf_is_ht(conf))
387 ctx->ht.enabled = conf_is_ht(conf); 386 ctx->ht.enabled = conf_is_ht(conf);
388 ht_changed[ctx->ctxid] = true;
389 }
390 387
391 if (ctx->ht.enabled) { 388 if (ctx->ht.enabled) {
392 if (conf_is_ht40_minus(conf)) { 389 if (conf_is_ht40_minus(conf)) {
@@ -455,8 +452,6 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
455 if (!memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging))) 452 if (!memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
456 continue; 453 continue;
457 iwlagn_commit_rxon(priv, ctx); 454 iwlagn_commit_rxon(priv, ctx);
458 if (ht_changed[ctx->ctxid])
459 iwlagn_update_qos(priv, ctx);
460 } 455 }
461 out: 456 out:
462 mutex_unlock(&priv->mutex); 457 mutex_unlock(&priv->mutex);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
index a709d05c5868..0712b67283a4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
@@ -568,12 +568,17 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
568 568
569 hdr_len = ieee80211_hdrlen(fc); 569 hdr_len = ieee80211_hdrlen(fc);
570 570
571 /* Find index into station table for destination station */ 571 /* For management frames use broadcast id to do not break aggregation */
572 sta_id = iwl_sta_id_or_broadcast(priv, ctx, info->control.sta); 572 if (!ieee80211_is_data(fc))
573 if (sta_id == IWL_INVALID_STATION) { 573 sta_id = ctx->bcast_sta_id;
574 IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n", 574 else {
575 hdr->addr1); 575 /* Find index into station table for destination station */
576 goto drop_unlock; 576 sta_id = iwl_sta_id_or_broadcast(priv, ctx, info->control.sta);
577 if (sta_id == IWL_INVALID_STATION) {
578 IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n",
579 hdr->addr1);
580 goto drop_unlock;
581 }
577 } 582 }
578 583
579 IWL_DEBUG_TX(priv, "station Id %d\n", sta_id); 584 IWL_DEBUG_TX(priv, "station Id %d\n", sta_id);
@@ -1224,12 +1229,16 @@ int iwlagn_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
1224 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) { 1229 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {
1225 1230
1226 tx_info = &txq->txb[txq->q.read_ptr]; 1231 tx_info = &txq->txb[txq->q.read_ptr];
1227 iwlagn_tx_status(priv, tx_info, 1232
1228 txq_id >= IWLAGN_FIRST_AMPDU_QUEUE); 1233 if (WARN_ON_ONCE(tx_info->skb == NULL))
1234 continue;
1229 1235
1230 hdr = (struct ieee80211_hdr *)tx_info->skb->data; 1236 hdr = (struct ieee80211_hdr *)tx_info->skb->data;
1231 if (hdr && ieee80211_is_data_qos(hdr->frame_control)) 1237 if (ieee80211_is_data_qos(hdr->frame_control))
1232 nfreed++; 1238 nfreed++;
1239
1240 iwlagn_tx_status(priv, tx_info,
1241 txq_id >= IWLAGN_FIRST_AMPDU_QUEUE);
1233 tx_info->skb = NULL; 1242 tx_info->skb = NULL;
1234 1243
1235 if (priv->cfg->ops->lib->txq_inval_byte_cnt_tbl) 1244 if (priv->cfg->ops->lib->txq_inval_byte_cnt_tbl)