aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2012-11-21 12:57:56 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-11-21 12:57:56 -0500
commitb3117494772d8f906625905c6e203af745ee3530 (patch)
treecc8960455f9e1f18d0939fddd0e96f349613f753
parente2ff0498409af6f2023f91aba07b281e5e87ee15 (diff)
parent400e020892a9a20eea5d2c9bce8bfb312075c4ba (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Conflicts: drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c drivers/net/wireless/iwlwifi/pcie/tx.c
-rw-r--r--drivers/bluetooth/ath3k.c1
-rw-r--r--drivers/bluetooth/btusb.c1
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c8
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/mac80211.c16
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/main.c2
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/rx.c23
-rw-r--r--drivers/net/wireless/mwifiex/cmdevt.c11
-rw-r--r--drivers/net/wireless/mwifiex/sdio.c11
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/sw.c1
-rw-r--r--drivers/nfc/pn533.c25
-rw-r--r--net/bluetooth/hci_core.c4
-rw-r--r--net/bluetooth/mgmt.c12
-rw-r--r--net/bluetooth/smp.c2
-rw-r--r--net/core/net-sysfs.c20
-rw-r--r--net/mac80211/cfg.c3
-rw-r--r--net/mac80211/ibss.c8
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/main.c6
-rw-r--r--net/mac80211/scan.c2
-rw-r--r--net/mac80211/sta_info.c11
-rw-r--r--net/mac80211/status.c9
-rw-r--r--net/mac80211/tx.c9
-rw-r--r--net/mac80211/util.c2
-rw-r--r--net/nfc/llcp/llcp.c2
-rw-r--r--net/wireless/reg.c5
27 files changed, 148 insertions, 52 deletions
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index fc2de5528dcc..b00000e8aef6 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -67,6 +67,7 @@ static struct usb_device_id ath3k_table[] = {
67 { USB_DEVICE(0x13d3, 0x3304) }, 67 { USB_DEVICE(0x13d3, 0x3304) },
68 { USB_DEVICE(0x0930, 0x0215) }, 68 { USB_DEVICE(0x0930, 0x0215) },
69 { USB_DEVICE(0x0489, 0xE03D) }, 69 { USB_DEVICE(0x0489, 0xE03D) },
70 { USB_DEVICE(0x0489, 0xE027) },
70 71
71 /* Atheros AR9285 Malbec with sflash firmware */ 72 /* Atheros AR9285 Malbec with sflash firmware */
72 { USB_DEVICE(0x03F0, 0x311D) }, 73 { USB_DEVICE(0x03F0, 0x311D) },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index debda27df9b0..ee82f2fb65f0 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -124,6 +124,7 @@ static struct usb_device_id blacklist_table[] = {
124 { USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE }, 124 { USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE },
125 { USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE }, 125 { USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE },
126 { USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE }, 126 { USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE },
127 { USB_DEVICE(0x0489, 0xe027), .driver_info = BTUSB_IGNORE },
127 128
128 /* Atheros AR9285 Malbec with sflash firmware */ 129 /* Atheros AR9285 Malbec with sflash firmware */
129 { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE }, 130 { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 756191b9eeda..e06bcec655a7 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1456,7 +1456,7 @@ static bool ath9k_hw_set_reset_reg(struct ath_hw *ah, u32 type)
1456 switch (type) { 1456 switch (type) {
1457 case ATH9K_RESET_POWER_ON: 1457 case ATH9K_RESET_POWER_ON:
1458 ret = ath9k_hw_set_reset_power_on(ah); 1458 ret = ath9k_hw_set_reset_power_on(ah);
1459 if (!ret) 1459 if (ret)
1460 ah->reset_power_on = true; 1460 ah->reset_power_on = true;
1461 break; 1461 break;
1462 case ATH9K_RESET_WARM: 1462 case ATH9K_RESET_WARM:
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 1ffca7511fa8..741918a2027b 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -394,7 +394,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
394 u16 seq_st = 0, acked_cnt = 0, txfail_cnt = 0, seq_first; 394 u16 seq_st = 0, acked_cnt = 0, txfail_cnt = 0, seq_first;
395 u32 ba[WME_BA_BMP_SIZE >> 5]; 395 u32 ba[WME_BA_BMP_SIZE >> 5];
396 int isaggr, txfail, txpending, sendbar = 0, needreset = 0, nbad = 0; 396 int isaggr, txfail, txpending, sendbar = 0, needreset = 0, nbad = 0;
397 bool rc_update = true; 397 bool rc_update = true, isba;
398 struct ieee80211_tx_rate rates[4]; 398 struct ieee80211_tx_rate rates[4];
399 struct ath_frame_info *fi; 399 struct ath_frame_info *fi;
400 int nframes; 400 int nframes;
@@ -438,13 +438,17 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
438 tidno = ieee80211_get_qos_ctl(hdr)[0] & IEEE80211_QOS_CTL_TID_MASK; 438 tidno = ieee80211_get_qos_ctl(hdr)[0] & IEEE80211_QOS_CTL_TID_MASK;
439 tid = ATH_AN_2_TID(an, tidno); 439 tid = ATH_AN_2_TID(an, tidno);
440 seq_first = tid->seq_start; 440 seq_first = tid->seq_start;
441 isba = ts->ts_flags & ATH9K_TX_BA;
441 442
442 /* 443 /*
443 * The hardware occasionally sends a tx status for the wrong TID. 444 * The hardware occasionally sends a tx status for the wrong TID.
444 * In this case, the BA status cannot be considered valid and all 445 * In this case, the BA status cannot be considered valid and all
445 * subframes need to be retransmitted 446 * subframes need to be retransmitted
447 *
448 * Only BlockAcks have a TID and therefore normal Acks cannot be
449 * checked
446 */ 450 */
447 if (tidno != ts->tid) 451 if (isba && tidno != ts->tid)
448 txok = false; 452 txok = false;
449 453
450 isaggr = bf_isaggr(bf); 454 isaggr = bf_isaggr(bf);
diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
index cb443d54f9b9..bf189f115413 100644
--- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
@@ -519,7 +519,7 @@ static void iwlagn_mac_tx(struct ieee80211_hw *hw,
519 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate); 519 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate);
520 520
521 if (iwlagn_tx_skb(priv, control->sta, skb)) 521 if (iwlagn_tx_skb(priv, control->sta, skb))
522 dev_kfree_skb_any(skb); 522 ieee80211_free_txskb(hw, skb);
523} 523}
524 524
525static void iwlagn_mac_update_tkip_key(struct ieee80211_hw *hw, 525static void iwlagn_mac_update_tkip_key(struct ieee80211_hw *hw,
@@ -1352,6 +1352,20 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw,
1352 vif_priv->ctx = ctx; 1352 vif_priv->ctx = ctx;
1353 ctx->vif = vif; 1353 ctx->vif = vif;
1354 1354
1355 /*
1356 * In SNIFFER device type, the firmware reports the FCS to
1357 * the host, rather than snipping it off. Unfortunately,
1358 * mac80211 doesn't (yet) provide a per-packet flag for
1359 * this, so that we have to set the hardware flag based
1360 * on the interfaces added. As the monitor interface can
1361 * only be present by itself, and will be removed before
1362 * other interfaces are added, this is safe.
1363 */
1364 if (vif->type == NL80211_IFTYPE_MONITOR)
1365 priv->hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS;
1366 else
1367 priv->hw->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS;
1368
1355 err = iwl_setup_interface(priv, ctx); 1369 err = iwl_setup_interface(priv, ctx);
1356 if (!err || reset) 1370 if (!err || reset)
1357 goto out; 1371 goto out;
diff --git a/drivers/net/wireless/iwlwifi/dvm/main.c b/drivers/net/wireless/iwlwifi/dvm/main.c
index 03cbfa765f87..37bb4575ad8d 100644
--- a/drivers/net/wireless/iwlwifi/dvm/main.c
+++ b/drivers/net/wireless/iwlwifi/dvm/main.c
@@ -2107,7 +2107,7 @@ static void iwl_free_skb(struct iwl_op_mode *op_mode, struct sk_buff *skb)
2107 2107
2108 info = IEEE80211_SKB_CB(skb); 2108 info = IEEE80211_SKB_CB(skb);
2109 iwl_trans_free_tx_cmd(priv->trans, info->driver_data[1]); 2109 iwl_trans_free_tx_cmd(priv->trans, info->driver_data[1]);
2110 dev_kfree_skb_any(skb); 2110 ieee80211_free_txskb(priv->hw, skb);
2111} 2111}
2112 2112
2113static void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state) 2113static void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state)
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c
index 11a93eddc84f..323079769567 100644
--- a/drivers/net/wireless/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/rx.c
@@ -318,6 +318,14 @@ static void iwl_rx_allocate(struct iwl_trans *trans, gfp_t priority)
318 dma_map_page(trans->dev, page, 0, 318 dma_map_page(trans->dev, page, 0,
319 PAGE_SIZE << trans_pcie->rx_page_order, 319 PAGE_SIZE << trans_pcie->rx_page_order,
320 DMA_FROM_DEVICE); 320 DMA_FROM_DEVICE);
321 if (dma_mapping_error(trans->dev, rxb->page_dma)) {
322 rxb->page = NULL;
323 spin_lock_irqsave(&rxq->lock, flags);
324 list_add(&rxb->list, &rxq->rx_used);
325 spin_unlock_irqrestore(&rxq->lock, flags);
326 __free_pages(page, trans_pcie->rx_page_order);
327 return;
328 }
321 /* dma address must be no more than 36 bits */ 329 /* dma address must be no more than 36 bits */
322 BUG_ON(rxb->page_dma & ~DMA_BIT_MASK(36)); 330 BUG_ON(rxb->page_dma & ~DMA_BIT_MASK(36));
323 /* and also 256 byte aligned! */ 331 /* and also 256 byte aligned! */
@@ -489,8 +497,19 @@ static void iwl_rx_handle_rxbuf(struct iwl_trans *trans,
489 dma_map_page(trans->dev, rxb->page, 0, 497 dma_map_page(trans->dev, rxb->page, 0,
490 PAGE_SIZE << trans_pcie->rx_page_order, 498 PAGE_SIZE << trans_pcie->rx_page_order,
491 DMA_FROM_DEVICE); 499 DMA_FROM_DEVICE);
492 list_add_tail(&rxb->list, &rxq->rx_free); 500 if (dma_mapping_error(trans->dev, rxb->page_dma)) {
493 rxq->free_count++; 501 /*
502 * free the page(s) as well to not break
503 * the invariant that the items on the used
504 * list have no page(s)
505 */
506 __free_pages(rxb->page, trans_pcie->rx_page_order);
507 rxb->page = NULL;
508 list_add_tail(&rxb->list, &rxq->rx_used);
509 } else {
510 list_add_tail(&rxb->list, &rxq->rx_free);
511 rxq->free_count++;
512 }
494 } else 513 } else
495 list_add_tail(&rxb->list, &rxq->rx_used); 514 list_add_tail(&rxb->list, &rxq->rx_used);
496 spin_unlock_irqrestore(&rxq->lock, flags); 515 spin_unlock_irqrestore(&rxq->lock, flags);
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
index c9528b3e9e9a..5f438e6c2155 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -890,9 +890,6 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
890 return; 890 return;
891 } 891 }
892 cmd_node = adapter->curr_cmd; 892 cmd_node = adapter->curr_cmd;
893 if (cmd_node->wait_q_enabled)
894 adapter->cmd_wait_q.status = -ETIMEDOUT;
895
896 if (cmd_node) { 893 if (cmd_node) {
897 adapter->dbg.timeout_cmd_id = 894 adapter->dbg.timeout_cmd_id =
898 adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index]; 895 adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index];
@@ -941,6 +938,14 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
941 938
942 dev_err(adapter->dev, "ps_mode=%d ps_state=%d\n", 939 dev_err(adapter->dev, "ps_mode=%d ps_state=%d\n",
943 adapter->ps_mode, adapter->ps_state); 940 adapter->ps_mode, adapter->ps_state);
941
942 if (cmd_node->wait_q_enabled) {
943 adapter->cmd_wait_q.status = -ETIMEDOUT;
944 wake_up_interruptible(&adapter->cmd_wait_q.wait);
945 mwifiex_cancel_pending_ioctl(adapter);
946 /* reset cmd_sent flag to unblock new commands */
947 adapter->cmd_sent = false;
948 }
944 } 949 }
945 if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) 950 if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING)
946 mwifiex_init_fw_complete(adapter); 951 mwifiex_init_fw_complete(adapter);
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index 4fbbd611f630..5a1c1d0e5599 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -161,7 +161,6 @@ static int mwifiex_sdio_suspend(struct device *dev)
161 struct sdio_mmc_card *card; 161 struct sdio_mmc_card *card;
162 struct mwifiex_adapter *adapter; 162 struct mwifiex_adapter *adapter;
163 mmc_pm_flag_t pm_flag = 0; 163 mmc_pm_flag_t pm_flag = 0;
164 int hs_actived = 0;
165 int i; 164 int i;
166 int ret = 0; 165 int ret = 0;
167 166
@@ -188,12 +187,14 @@ static int mwifiex_sdio_suspend(struct device *dev)
188 adapter = card->adapter; 187 adapter = card->adapter;
189 188
190 /* Enable the Host Sleep */ 189 /* Enable the Host Sleep */
191 hs_actived = mwifiex_enable_hs(adapter); 190 if (!mwifiex_enable_hs(adapter)) {
192 if (hs_actived) { 191 dev_err(adapter->dev, "cmd: failed to suspend\n");
193 pr_debug("cmd: suspend with MMC_PM_KEEP_POWER\n"); 192 return -EFAULT;
194 ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
195 } 193 }
196 194
195 dev_dbg(adapter->dev, "cmd: suspend with MMC_PM_KEEP_POWER\n");
196 ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
197
197 /* Indicate device suspended */ 198 /* Indicate device suspended */
198 adapter->is_suspended = true; 199 adapter->is_suspended = true;
199 200
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 3bc206d06cd1..c0441a715c96 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2449,7 +2449,7 @@ static int rt2800_get_gain_calibration_delta(struct rt2x00_dev *rt2x00dev)
2449 /* 2449 /*
2450 * Check if temperature compensation is supported. 2450 * Check if temperature compensation is supported.
2451 */ 2451 */
2452 if (tssi_bounds[4] == 0xff) 2452 if (tssi_bounds[4] == 0xff || step == 0xff)
2453 return 0; 2453 return 0;
2454 2454
2455 /* 2455 /*
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index 9970c2b1b199..b7e6607e6b6d 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -297,6 +297,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
297 /*=== Customer ID ===*/ 297 /*=== Customer ID ===*/
298 /****** 8188CU ********/ 298 /****** 8188CU ********/
299 {RTL_USB_DEVICE(0x050d, 0x1102, rtl92cu_hal_cfg)}, /*Belkin - Edimax*/ 299 {RTL_USB_DEVICE(0x050d, 0x1102, rtl92cu_hal_cfg)}, /*Belkin - Edimax*/
300 {RTL_USB_DEVICE(0x050d, 0x11f2, rtl92cu_hal_cfg)}, /*Belkin - ISY*/
300 {RTL_USB_DEVICE(0x06f8, 0xe033, rtl92cu_hal_cfg)}, /*Hercules - Edimax*/ 301 {RTL_USB_DEVICE(0x06f8, 0xe033, rtl92cu_hal_cfg)}, /*Hercules - Edimax*/
301 {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/ 302 {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/
302 {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/ 303 {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index 18e279d3e836..ada681b01a17 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -702,13 +702,14 @@ static void pn533_wq_cmd(struct work_struct *work)
702 702
703 cmd = list_first_entry(&dev->cmd_queue, struct pn533_cmd, queue); 703 cmd = list_first_entry(&dev->cmd_queue, struct pn533_cmd, queue);
704 704
705 list_del(&cmd->queue);
706
705 mutex_unlock(&dev->cmd_lock); 707 mutex_unlock(&dev->cmd_lock);
706 708
707 __pn533_send_cmd_frame_async(dev, cmd->out_frame, cmd->in_frame, 709 __pn533_send_cmd_frame_async(dev, cmd->out_frame, cmd->in_frame,
708 cmd->in_frame_len, cmd->cmd_complete, 710 cmd->in_frame_len, cmd->cmd_complete,
709 cmd->arg, cmd->flags); 711 cmd->arg, cmd->flags);
710 712
711 list_del(&cmd->queue);
712 kfree(cmd); 713 kfree(cmd);
713} 714}
714 715
@@ -1680,11 +1681,14 @@ static void pn533_deactivate_target(struct nfc_dev *nfc_dev,
1680static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg, 1681static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,
1681 u8 *params, int params_len) 1682 u8 *params, int params_len)
1682{ 1683{
1683 struct pn533_cmd_jump_dep *cmd;
1684 struct pn533_cmd_jump_dep_response *resp; 1684 struct pn533_cmd_jump_dep_response *resp;
1685 struct nfc_target nfc_target; 1685 struct nfc_target nfc_target;
1686 u8 target_gt_len; 1686 u8 target_gt_len;
1687 int rc; 1687 int rc;
1688 struct pn533_cmd_jump_dep *cmd = (struct pn533_cmd_jump_dep *)arg;
1689 u8 active = cmd->active;
1690
1691 kfree(arg);
1688 1692
1689 if (params_len == -ENOENT) { 1693 if (params_len == -ENOENT) {
1690 nfc_dev_dbg(&dev->interface->dev, ""); 1694 nfc_dev_dbg(&dev->interface->dev, "");
@@ -1706,7 +1710,6 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,
1706 } 1710 }
1707 1711
1708 resp = (struct pn533_cmd_jump_dep_response *) params; 1712 resp = (struct pn533_cmd_jump_dep_response *) params;
1709 cmd = (struct pn533_cmd_jump_dep *) arg;
1710 rc = resp->status & PN533_CMD_RET_MASK; 1713 rc = resp->status & PN533_CMD_RET_MASK;
1711 if (rc != PN533_CMD_RET_SUCCESS) { 1714 if (rc != PN533_CMD_RET_SUCCESS) {
1712 nfc_dev_err(&dev->interface->dev, 1715 nfc_dev_err(&dev->interface->dev,
@@ -1736,7 +1739,7 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,
1736 if (rc == 0) 1739 if (rc == 0)
1737 rc = nfc_dep_link_is_up(dev->nfc_dev, 1740 rc = nfc_dep_link_is_up(dev->nfc_dev,
1738 dev->nfc_dev->targets[0].idx, 1741 dev->nfc_dev->targets[0].idx,
1739 !cmd->active, NFC_RF_INITIATOR); 1742 !active, NFC_RF_INITIATOR);
1740 1743
1741 return 0; 1744 return 0;
1742} 1745}
@@ -1821,12 +1824,8 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target,
1821 rc = pn533_send_cmd_frame_async(dev, dev->out_frame, dev->in_frame, 1824 rc = pn533_send_cmd_frame_async(dev, dev->out_frame, dev->in_frame,
1822 dev->in_maxlen, pn533_in_dep_link_up_complete, 1825 dev->in_maxlen, pn533_in_dep_link_up_complete,
1823 cmd, GFP_KERNEL); 1826 cmd, GFP_KERNEL);
1824 if (rc) 1827 if (rc < 0)
1825 goto out; 1828 kfree(cmd);
1826
1827
1828out:
1829 kfree(cmd);
1830 1829
1831 return rc; 1830 return rc;
1832} 1831}
@@ -2080,8 +2079,12 @@ error:
2080static int pn533_tm_send_complete(struct pn533 *dev, void *arg, 2079static int pn533_tm_send_complete(struct pn533 *dev, void *arg,
2081 u8 *params, int params_len) 2080 u8 *params, int params_len)
2082{ 2081{
2082 struct sk_buff *skb_out = arg;
2083
2083 nfc_dev_dbg(&dev->interface->dev, "%s", __func__); 2084 nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
2084 2085
2086 dev_kfree_skb(skb_out);
2087
2085 if (params_len < 0) { 2088 if (params_len < 0) {
2086 nfc_dev_err(&dev->interface->dev, 2089 nfc_dev_err(&dev->interface->dev,
2087 "Error %d when sending data", 2090 "Error %d when sending data",
@@ -2119,7 +2122,7 @@ static int pn533_tm_send(struct nfc_dev *nfc_dev, struct sk_buff *skb)
2119 2122
2120 rc = pn533_send_cmd_frame_async(dev, out_frame, dev->in_frame, 2123 rc = pn533_send_cmd_frame_async(dev, out_frame, dev->in_frame,
2121 dev->in_maxlen, pn533_tm_send_complete, 2124 dev->in_maxlen, pn533_tm_send_complete,
2122 NULL, GFP_KERNEL); 2125 skb, GFP_KERNEL);
2123 if (rc) { 2126 if (rc) {
2124 nfc_dev_err(&dev->interface->dev, 2127 nfc_dev_err(&dev->interface->dev,
2125 "Error %d when trying to send data", rc); 2128 "Error %d when trying to send data", rc);
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 515d0c394f35..c68c4098da98 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1717,11 +1717,11 @@ int hci_register_dev(struct hci_dev *hdev)
1717 if (hdev->dev_type != HCI_AMP) 1717 if (hdev->dev_type != HCI_AMP)
1718 set_bit(HCI_AUTO_OFF, &hdev->dev_flags); 1718 set_bit(HCI_AUTO_OFF, &hdev->dev_flags);
1719 1719
1720 schedule_work(&hdev->power_on);
1721
1722 hci_notify(hdev, HCI_DEV_REG); 1720 hci_notify(hdev, HCI_DEV_REG);
1723 hci_dev_hold(hdev); 1721 hci_dev_hold(hdev);
1724 1722
1723 schedule_work(&hdev->power_on);
1724
1725 return id; 1725 return id;
1726 1726
1727err_wqueue: 1727err_wqueue:
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index a1a62baaaafb..a97948b96b49 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -326,7 +326,7 @@ static int read_index_list(struct sock *sk, struct hci_dev *hdev, void *data,
326 struct hci_dev *d; 326 struct hci_dev *d;
327 size_t rp_len; 327 size_t rp_len;
328 u16 count; 328 u16 count;
329 int i, err; 329 int err;
330 330
331 BT_DBG("sock %p", sk); 331 BT_DBG("sock %p", sk);
332 332
@@ -347,9 +347,7 @@ static int read_index_list(struct sock *sk, struct hci_dev *hdev, void *data,
347 return -ENOMEM; 347 return -ENOMEM;
348 } 348 }
349 349
350 rp->num_controllers = cpu_to_le16(count); 350 count = 0;
351
352 i = 0;
353 list_for_each_entry(d, &hci_dev_list, list) { 351 list_for_each_entry(d, &hci_dev_list, list) {
354 if (test_bit(HCI_SETUP, &d->dev_flags)) 352 if (test_bit(HCI_SETUP, &d->dev_flags))
355 continue; 353 continue;
@@ -357,10 +355,13 @@ static int read_index_list(struct sock *sk, struct hci_dev *hdev, void *data,
357 if (!mgmt_valid_hdev(d)) 355 if (!mgmt_valid_hdev(d))
358 continue; 356 continue;
359 357
360 rp->index[i++] = cpu_to_le16(d->id); 358 rp->index[count++] = cpu_to_le16(d->id);
361 BT_DBG("Added hci%u", d->id); 359 BT_DBG("Added hci%u", d->id);
362 } 360 }
363 361
362 rp->num_controllers = cpu_to_le16(count);
363 rp_len = sizeof(*rp) + (2 * count);
364
364 read_unlock(&hci_dev_list_lock); 365 read_unlock(&hci_dev_list_lock);
365 366
366 err = cmd_complete(sk, MGMT_INDEX_NONE, MGMT_OP_READ_INDEX_LIST, 0, rp, 367 err = cmd_complete(sk, MGMT_INDEX_NONE, MGMT_OP_READ_INDEX_LIST, 0, rp,
@@ -1378,6 +1379,7 @@ static int remove_uuid(struct sock *sk, struct hci_dev *hdev, void *data,
1378 continue; 1379 continue;
1379 1380
1380 list_del(&match->list); 1381 list_del(&match->list);
1382 kfree(match);
1381 found++; 1383 found++;
1382 } 1384 }
1383 1385
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 9176bc17595c..68a9587c9694 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -267,7 +267,7 @@ static void smp_failure(struct l2cap_conn *conn, u8 reason, u8 send)
267 267
268 clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->hcon->flags); 268 clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->hcon->flags);
269 mgmt_auth_failed(conn->hcon->hdev, conn->dst, hcon->type, 269 mgmt_auth_failed(conn->hcon->hdev, conn->dst, hcon->type,
270 hcon->dst_type, reason); 270 hcon->dst_type, HCI_ERROR_AUTH_FAILURE);
271 271
272 cancel_delayed_work_sync(&conn->security_timer); 272 cancel_delayed_work_sync(&conn->security_timer);
273 273
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index bcf02f608cbf..017a8bacfb27 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -429,6 +429,17 @@ static struct attribute_group netstat_group = {
429 .name = "statistics", 429 .name = "statistics",
430 .attrs = netstat_attrs, 430 .attrs = netstat_attrs,
431}; 431};
432
433#if IS_ENABLED(CONFIG_WIRELESS_EXT) || IS_ENABLED(CONFIG_CFG80211)
434static struct attribute *wireless_attrs[] = {
435 NULL
436};
437
438static struct attribute_group wireless_group = {
439 .name = "wireless",
440 .attrs = wireless_attrs,
441};
442#endif
432#endif /* CONFIG_SYSFS */ 443#endif /* CONFIG_SYSFS */
433 444
434#ifdef CONFIG_RPS 445#ifdef CONFIG_RPS
@@ -1409,6 +1420,15 @@ int netdev_register_kobject(struct net_device *net)
1409 groups++; 1420 groups++;
1410 1421
1411 *groups++ = &netstat_group; 1422 *groups++ = &netstat_group;
1423
1424#if IS_ENABLED(CONFIG_WIRELESS_EXT) || IS_ENABLED(CONFIG_CFG80211)
1425 if (net->ieee80211_ptr)
1426 *groups++ = &wireless_group;
1427#if IS_ENABLED(CONFIG_WIRELESS_EXT)
1428 else if (net->wireless_handlers)
1429 *groups++ = &wireless_group;
1430#endif
1431#endif
1412#endif /* CONFIG_SYSFS */ 1432#endif /* CONFIG_SYSFS */
1413 1433
1414 error = device_add(dev); 1434 error = device_add(dev);
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 80e0618b25ba..c46d4ee1c298 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2673,6 +2673,9 @@ static void ieee80211_mgmt_frame_register(struct wiphy *wiphy,
2673 else 2673 else
2674 local->probe_req_reg--; 2674 local->probe_req_reg--;
2675 2675
2676 if (!local->open_count)
2677 break;
2678
2676 ieee80211_queue_work(&local->hw, &local->reconfig_filter); 2679 ieee80211_queue_work(&local->hw, &local->reconfig_filter);
2677 break; 2680 break;
2678 default: 2681 default:
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index c7386b2b767e..67774b053535 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -1156,10 +1156,6 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
1156 1156
1157 mutex_lock(&sdata->u.ibss.mtx); 1157 mutex_lock(&sdata->u.ibss.mtx);
1158 1158
1159 sdata->u.ibss.state = IEEE80211_IBSS_MLME_SEARCH;
1160 memset(sdata->u.ibss.bssid, 0, ETH_ALEN);
1161 sdata->u.ibss.ssid_len = 0;
1162
1163 active_ibss = ieee80211_sta_active_ibss(sdata); 1159 active_ibss = ieee80211_sta_active_ibss(sdata);
1164 1160
1165 if (!active_ibss && !is_zero_ether_addr(ifibss->bssid)) { 1161 if (!active_ibss && !is_zero_ether_addr(ifibss->bssid)) {
@@ -1180,6 +1176,10 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
1180 } 1176 }
1181 } 1177 }
1182 1178
1179 ifibss->state = IEEE80211_IBSS_MLME_SEARCH;
1180 memset(ifibss->bssid, 0, ETH_ALEN);
1181 ifibss->ssid_len = 0;
1182
1183 sta_info_flush(sdata->local, sdata); 1183 sta_info_flush(sdata->local, sdata);
1184 1184
1185 spin_lock_bh(&ifibss->incomplete_lock); 1185 spin_lock_bh(&ifibss->incomplete_lock);
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index e1fb97cc9a41..74748896d77b 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1388,6 +1388,8 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
1388 struct net_device *dev); 1388 struct net_device *dev);
1389netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, 1389netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1390 struct net_device *dev); 1390 struct net_device *dev);
1391void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
1392 struct sk_buff_head *skbs);
1391 1393
1392/* HT */ 1394/* HT */
1393void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata, 1395void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 70e87600cacc..da2f41610125 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -925,8 +925,10 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
925 local->hw.wiphy->cipher_suites, 925 local->hw.wiphy->cipher_suites,
926 sizeof(u32) * local->hw.wiphy->n_cipher_suites, 926 sizeof(u32) * local->hw.wiphy->n_cipher_suites,
927 GFP_KERNEL); 927 GFP_KERNEL);
928 if (!suites) 928 if (!suites) {
929 return -ENOMEM; 929 result = -ENOMEM;
930 goto fail_wiphy_register;
931 }
930 for (r = 0; r < local->hw.wiphy->n_cipher_suites; r++) { 932 for (r = 0; r < local->hw.wiphy->n_cipher_suites; r++) {
931 u32 suite = local->hw.wiphy->cipher_suites[r]; 933 u32 suite = local->hw.wiphy->cipher_suites[r];
932 if (suite == WLAN_CIPHER_SUITE_WEP40 || 934 if (suite == WLAN_CIPHER_SUITE_WEP40 ||
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 13d23299e696..8e9bb168b73b 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -934,7 +934,7 @@ int ieee80211_request_sched_scan_start(struct ieee80211_sub_if_data *sdata,
934 struct cfg80211_sched_scan_request *req) 934 struct cfg80211_sched_scan_request *req)
935{ 935{
936 struct ieee80211_local *local = sdata->local; 936 struct ieee80211_local *local = sdata->local;
937 struct ieee80211_sched_scan_ies sched_scan_ies; 937 struct ieee80211_sched_scan_ies sched_scan_ies = {};
938 int ret, i; 938 int ret, i;
939 939
940 mutex_lock(&local->mtx); 940 mutex_lock(&local->mtx);
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index f7bb54f9ab72..e9d57689c05f 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -122,8 +122,8 @@ static void free_sta_work(struct work_struct *wk)
122 122
123 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { 123 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
124 local->total_ps_buffered -= skb_queue_len(&sta->ps_tx_buf[ac]); 124 local->total_ps_buffered -= skb_queue_len(&sta->ps_tx_buf[ac]);
125 __skb_queue_purge(&sta->ps_tx_buf[ac]); 125 ieee80211_purge_tx_queue(&local->hw, &sta->ps_tx_buf[ac]);
126 __skb_queue_purge(&sta->tx_filtered[ac]); 126 ieee80211_purge_tx_queue(&local->hw, &sta->tx_filtered[ac]);
127 } 127 }
128 128
129#ifdef CONFIG_MAC80211_MESH 129#ifdef CONFIG_MAC80211_MESH
@@ -146,7 +146,7 @@ static void free_sta_work(struct work_struct *wk)
146 tid_tx = rcu_dereference_raw(sta->ampdu_mlme.tid_tx[i]); 146 tid_tx = rcu_dereference_raw(sta->ampdu_mlme.tid_tx[i]);
147 if (!tid_tx) 147 if (!tid_tx)
148 continue; 148 continue;
149 __skb_queue_purge(&tid_tx->pending); 149 ieee80211_purge_tx_queue(&local->hw, &tid_tx->pending);
150 kfree(tid_tx); 150 kfree(tid_tx);
151 } 151 }
152 152
@@ -982,6 +982,7 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta)
982 struct ieee80211_local *local = sdata->local; 982 struct ieee80211_local *local = sdata->local;
983 struct sk_buff_head pending; 983 struct sk_buff_head pending;
984 int filtered = 0, buffered = 0, ac; 984 int filtered = 0, buffered = 0, ac;
985 unsigned long flags;
985 986
986 clear_sta_flag(sta, WLAN_STA_SP); 987 clear_sta_flag(sta, WLAN_STA_SP);
987 988
@@ -997,12 +998,16 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta)
997 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { 998 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
998 int count = skb_queue_len(&pending), tmp; 999 int count = skb_queue_len(&pending), tmp;
999 1000
1001 spin_lock_irqsave(&sta->tx_filtered[ac].lock, flags);
1000 skb_queue_splice_tail_init(&sta->tx_filtered[ac], &pending); 1002 skb_queue_splice_tail_init(&sta->tx_filtered[ac], &pending);
1003 spin_unlock_irqrestore(&sta->tx_filtered[ac].lock, flags);
1001 tmp = skb_queue_len(&pending); 1004 tmp = skb_queue_len(&pending);
1002 filtered += tmp - count; 1005 filtered += tmp - count;
1003 count = tmp; 1006 count = tmp;
1004 1007
1008 spin_lock_irqsave(&sta->ps_tx_buf[ac].lock, flags);
1005 skb_queue_splice_tail_init(&sta->ps_tx_buf[ac], &pending); 1009 skb_queue_splice_tail_init(&sta->ps_tx_buf[ac], &pending);
1010 spin_unlock_irqrestore(&sta->ps_tx_buf[ac].lock, flags);
1006 tmp = skb_queue_len(&pending); 1011 tmp = skb_queue_len(&pending);
1007 buffered += tmp - count; 1012 buffered += tmp - count;
1008 } 1013 }
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 2d931ad0e90a..ab63237107c8 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -666,3 +666,12 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb)
666 dev_kfree_skb_any(skb); 666 dev_kfree_skb_any(skb);
667} 667}
668EXPORT_SYMBOL(ieee80211_free_txskb); 668EXPORT_SYMBOL(ieee80211_free_txskb);
669
670void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
671 struct sk_buff_head *skbs)
672{
673 struct sk_buff *skb;
674
675 while ((skb = __skb_dequeue(skbs)))
676 ieee80211_free_txskb(hw, skb);
677}
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index b5468876287e..04076250264b 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1361,7 +1361,7 @@ static int invoke_tx_handlers(struct ieee80211_tx_data *tx)
1361 if (tx->skb) 1361 if (tx->skb)
1362 ieee80211_free_txskb(&tx->local->hw, tx->skb); 1362 ieee80211_free_txskb(&tx->local->hw, tx->skb);
1363 else 1363 else
1364 __skb_queue_purge(&tx->skbs); 1364 ieee80211_purge_tx_queue(&tx->local->hw, &tx->skbs);
1365 return -1; 1365 return -1;
1366 } else if (unlikely(res == TX_QUEUED)) { 1366 } else if (unlikely(res == TX_QUEUED)) {
1367 I802_DEBUG_INC(tx->local->tx_handlers_queued); 1367 I802_DEBUG_INC(tx->local->tx_handlers_queued);
@@ -2161,10 +2161,13 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
2161 */ 2161 */
2162void ieee80211_clear_tx_pending(struct ieee80211_local *local) 2162void ieee80211_clear_tx_pending(struct ieee80211_local *local)
2163{ 2163{
2164 struct sk_buff *skb;
2164 int i; 2165 int i;
2165 2166
2166 for (i = 0; i < local->hw.queues; i++) 2167 for (i = 0; i < local->hw.queues; i++) {
2167 skb_queue_purge(&local->pending[i]); 2168 while ((skb = skb_dequeue(&local->pending[i])) != NULL)
2169 ieee80211_free_txskb(&local->hw, skb);
2170 }
2168} 2171}
2169 2172
2170/* 2173/*
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 4e4f58513673..c4a60bfb9f14 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1555,6 +1555,8 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1555 list_for_each_entry(sdata, &local->interfaces, list) { 1555 list_for_each_entry(sdata, &local->interfaces, list) {
1556 if (sdata->vif.type != NL80211_IFTYPE_STATION) 1556 if (sdata->vif.type != NL80211_IFTYPE_STATION)
1557 continue; 1557 continue;
1558 if (!sdata->u.mgd.associated)
1559 continue;
1558 1560
1559 ieee80211_send_nullfunc(local, sdata, 0); 1561 ieee80211_send_nullfunc(local, sdata, 0);
1560 } 1562 }
diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c
index 66733335345f..2df87056c6df 100644
--- a/net/nfc/llcp/llcp.c
+++ b/net/nfc/llcp/llcp.c
@@ -1397,7 +1397,7 @@ int nfc_llcp_register_device(struct nfc_dev *ndev)
1397 local->remote_miu = LLCP_DEFAULT_MIU; 1397 local->remote_miu = LLCP_DEFAULT_MIU;
1398 local->remote_lto = LLCP_DEFAULT_LTO; 1398 local->remote_lto = LLCP_DEFAULT_LTO;
1399 1399
1400 list_add(&llcp_devices, &local->list); 1400 list_add(&local->list, &llcp_devices);
1401 1401
1402 return 0; 1402 return 0;
1403} 1403}
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index bcc7d7ee5a51..b75756b05af7 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -141,9 +141,8 @@ static const struct ieee80211_regdomain world_regdom = {
141 .reg_rules = { 141 .reg_rules = {
142 /* IEEE 802.11b/g, channels 1..11 */ 142 /* IEEE 802.11b/g, channels 1..11 */
143 REG_RULE(2412-10, 2462+10, 40, 6, 20, 0), 143 REG_RULE(2412-10, 2462+10, 40, 6, 20, 0),
144 /* IEEE 802.11b/g, channels 12..13. No HT40 144 /* IEEE 802.11b/g, channels 12..13. */
145 * channel fits here. */ 145 REG_RULE(2467-10, 2472+10, 40, 6, 20,
146 REG_RULE(2467-10, 2472+10, 20, 6, 20,
147 NL80211_RRF_PASSIVE_SCAN | 146 NL80211_RRF_PASSIVE_SCAN |
148 NL80211_RRF_NO_IBSS), 147 NL80211_RRF_NO_IBSS),
149 /* IEEE 802.11 channel 14 - Only JP enables 148 /* IEEE 802.11 channel 14 - Only JP enables