diff options
author | John W. Linville <linville@tuxdriver.com> | 2013-11-21 10:26:17 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-11-21 10:26:17 -0500 |
commit | 7acd71879ce408af2d2ca3cd3ec3a86d0667ceae (patch) | |
tree | 8332fdffc7980575268f902c1cffe37ee2587a4d /drivers/net | |
parent | 68c6beb373955da0886d8f4f5995b3922ceda4be (diff) | |
parent | 3b1bace9960b0acbcb5d0ca194077f03df7cc2c0 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_phy.c | 50 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_phy.h | 11 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9462_2p1_initvals.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/regd.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/p2p.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 23 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/main.c | 28 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/pcie.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sdio.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/usb.c | 27 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/mac.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | 6 |
13 files changed, 121 insertions, 52 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index 11f53589a3f3..d39b79f5e841 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c | |||
@@ -701,6 +701,54 @@ static int ar9550_hw_get_modes_txgain_index(struct ath_hw *ah, | |||
701 | return ret; | 701 | return ret; |
702 | } | 702 | } |
703 | 703 | ||
704 | static void ar9003_doubler_fix(struct ath_hw *ah) | ||
705 | { | ||
706 | if (AR_SREV_9300(ah) || AR_SREV_9580(ah) || AR_SREV_9550(ah)) { | ||
707 | REG_RMW(ah, AR_PHY_65NM_CH0_RXTX2, | ||
708 | 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S | | ||
709 | 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S, 0); | ||
710 | REG_RMW(ah, AR_PHY_65NM_CH1_RXTX2, | ||
711 | 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S | | ||
712 | 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S, 0); | ||
713 | REG_RMW(ah, AR_PHY_65NM_CH2_RXTX2, | ||
714 | 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S | | ||
715 | 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S, 0); | ||
716 | |||
717 | udelay(200); | ||
718 | |||
719 | REG_CLR_BIT(ah, AR_PHY_65NM_CH0_RXTX2, | ||
720 | AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK); | ||
721 | REG_CLR_BIT(ah, AR_PHY_65NM_CH1_RXTX2, | ||
722 | AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK); | ||
723 | REG_CLR_BIT(ah, AR_PHY_65NM_CH2_RXTX2, | ||
724 | AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK); | ||
725 | |||
726 | udelay(1); | ||
727 | |||
728 | REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_RXTX2, | ||
729 | AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK, 1); | ||
730 | REG_RMW_FIELD(ah, AR_PHY_65NM_CH1_RXTX2, | ||
731 | AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK, 1); | ||
732 | REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX2, | ||
733 | AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK, 1); | ||
734 | |||
735 | udelay(200); | ||
736 | |||
737 | REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_SYNTH12, | ||
738 | AR_PHY_65NM_CH0_SYNTH12_VREFMUL3, 0xf); | ||
739 | |||
740 | REG_RMW(ah, AR_PHY_65NM_CH0_RXTX2, 0, | ||
741 | 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S | | ||
742 | 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S); | ||
743 | REG_RMW(ah, AR_PHY_65NM_CH1_RXTX2, 0, | ||
744 | 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S | | ||
745 | 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S); | ||
746 | REG_RMW(ah, AR_PHY_65NM_CH2_RXTX2, 0, | ||
747 | 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S | | ||
748 | 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S); | ||
749 | } | ||
750 | } | ||
751 | |||
704 | static int ar9003_hw_process_ini(struct ath_hw *ah, | 752 | static int ar9003_hw_process_ini(struct ath_hw *ah, |
705 | struct ath9k_channel *chan) | 753 | struct ath9k_channel *chan) |
706 | { | 754 | { |
@@ -726,6 +774,8 @@ static int ar9003_hw_process_ini(struct ath_hw *ah, | |||
726 | modesIndex); | 774 | modesIndex); |
727 | } | 775 | } |
728 | 776 | ||
777 | ar9003_doubler_fix(ah); | ||
778 | |||
729 | /* | 779 | /* |
730 | * RXGAIN initvals. | 780 | * RXGAIN initvals. |
731 | */ | 781 | */ |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.h b/drivers/net/wireless/ath/ath9k/ar9003_phy.h index fca624322dc8..2af667beb273 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h | |||
@@ -656,13 +656,24 @@ | |||
656 | #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x00000001 : 0x00000002) | 656 | #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x00000001 : 0x00000002) |
657 | #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT_S ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0 : 1) | 657 | #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT_S ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0 : 1) |
658 | #define AR_PHY_65NM_CH0_SYNTH7 0x16098 | 658 | #define AR_PHY_65NM_CH0_SYNTH7 0x16098 |
659 | #define AR_PHY_65NM_CH0_SYNTH12 0x160ac | ||
659 | #define AR_PHY_65NM_CH0_BIAS1 0x160c0 | 660 | #define AR_PHY_65NM_CH0_BIAS1 0x160c0 |
660 | #define AR_PHY_65NM_CH0_BIAS2 0x160c4 | 661 | #define AR_PHY_65NM_CH0_BIAS2 0x160c4 |
661 | #define AR_PHY_65NM_CH0_BIAS4 0x160cc | 662 | #define AR_PHY_65NM_CH0_BIAS4 0x160cc |
663 | #define AR_PHY_65NM_CH0_RXTX2 0x16104 | ||
664 | #define AR_PHY_65NM_CH1_RXTX2 0x16504 | ||
665 | #define AR_PHY_65NM_CH2_RXTX2 0x16904 | ||
662 | #define AR_PHY_65NM_CH0_RXTX4 0x1610c | 666 | #define AR_PHY_65NM_CH0_RXTX4 0x1610c |
663 | #define AR_PHY_65NM_CH1_RXTX4 0x1650c | 667 | #define AR_PHY_65NM_CH1_RXTX4 0x1650c |
664 | #define AR_PHY_65NM_CH2_RXTX4 0x1690c | 668 | #define AR_PHY_65NM_CH2_RXTX4 0x1690c |
665 | 669 | ||
670 | #define AR_PHY_65NM_CH0_SYNTH12_VREFMUL3 0x00780000 | ||
671 | #define AR_PHY_65NM_CH0_SYNTH12_VREFMUL3_S 19 | ||
672 | #define AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK 0x00000004 | ||
673 | #define AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S 2 | ||
674 | #define AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK 0x00000008 | ||
675 | #define AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S 3 | ||
676 | |||
666 | #define AR_CH0_TOP (AR_SREV_9300(ah) ? 0x16288 : \ | 677 | #define AR_CH0_TOP (AR_SREV_9300(ah) ? 0x16288 : \ |
667 | (((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x1628c : 0x16280))) | 678 | (((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x1628c : 0x16280))) |
668 | #define AR_CH0_TOP_XPABIASLVL (AR_SREV_9550(ah) ? 0x3c0 : 0x300) | 679 | #define AR_CH0_TOP_XPABIASLVL (AR_SREV_9550(ah) ? 0x3c0 : 0x300) |
diff --git a/drivers/net/wireless/ath/ath9k/ar9462_2p1_initvals.h b/drivers/net/wireless/ath/ath9k/ar9462_2p1_initvals.h index 4dbc294df7e3..57fc5f459d0a 100644 --- a/drivers/net/wireless/ath/ath9k/ar9462_2p1_initvals.h +++ b/drivers/net/wireless/ath/ath9k/ar9462_2p1_initvals.h | |||
@@ -361,7 +361,7 @@ static const u32 ar9462_2p1_baseband_postamble[][5] = { | |||
361 | {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3236605e, 0x32365a5e}, | 361 | {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3236605e, 0x32365a5e}, |
362 | {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | 362 | {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
363 | {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c}, | 363 | {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c}, |
364 | {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce}, | 364 | {0x00009e20, 0x000003a5, 0x000003a5, 0x000003a5, 0x000003a5}, |
365 | {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021}, | 365 | {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021}, |
366 | {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282}, | 366 | {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282}, |
367 | {0x00009e44, 0x62321e27, 0x62321e27, 0xfe291e27, 0xfe291e27}, | 367 | {0x00009e44, 0x62321e27, 0x62321e27, 0xfe291e27, 0xfe291e27}, |
@@ -400,7 +400,7 @@ static const u32 ar9462_2p1_baseband_postamble[][5] = { | |||
400 | {0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x00100000}, | 400 | {0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x00100000}, |
401 | {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | 401 | {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
402 | {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c}, | 402 | {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c}, |
403 | {0x0000ae20, 0x000001b5, 0x000001b5, 0x000001ce, 0x000001ce}, | 403 | {0x0000ae20, 0x000001a6, 0x000001a6, 0x000001aa, 0x000001aa}, |
404 | {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550}, | 404 | {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550}, |
405 | }; | 405 | }; |
406 | 406 | ||
@@ -472,7 +472,7 @@ static const u32 ar9462_2p1_radio_postamble[][5] = { | |||
472 | 472 | ||
473 | static const u32 ar9462_2p1_soc_preamble[][2] = { | 473 | static const u32 ar9462_2p1_soc_preamble[][2] = { |
474 | /* Addr allmodes */ | 474 | /* Addr allmodes */ |
475 | {0x000040a4, 0x00a0c1c9}, | 475 | {0x000040a4, 0x00a0c9c9}, |
476 | {0x00007020, 0x00000000}, | 476 | {0x00007020, 0x00000000}, |
477 | {0x00007034, 0x00000002}, | 477 | {0x00007034, 0x00000002}, |
478 | {0x00007038, 0x000004c2}, | 478 | {0x00007038, 0x000004c2}, |
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c index c00687e05688..1217c52ab28e 100644 --- a/drivers/net/wireless/ath/regd.c +++ b/drivers/net/wireless/ath/regd.c | |||
@@ -362,7 +362,8 @@ static int __ath_reg_dyn_country(struct wiphy *wiphy, | |||
362 | { | 362 | { |
363 | u16 country_code; | 363 | u16 country_code; |
364 | 364 | ||
365 | if (!ath_is_world_regd(reg)) | 365 | if (request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE && |
366 | !ath_is_world_regd(reg)) | ||
366 | return -EINVAL; | 367 | return -EINVAL; |
367 | 368 | ||
368 | country_code = ath_regd_find_country_by_name(request->alpha2); | 369 | country_code = ath_regd_find_country_by_name(request->alpha2); |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c index 5b5b952d47b1..4a2293041821 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c | |||
@@ -823,6 +823,7 @@ static s32 brcmf_p2p_run_escan(struct brcmf_cfg80211_info *cfg, | |||
823 | } | 823 | } |
824 | err = brcmf_p2p_escan(p2p, num_nodfs, chanspecs, search_state, | 824 | err = brcmf_p2p_escan(p2p, num_nodfs, chanspecs, search_state, |
825 | action, P2PAPI_BSSCFG_DEVICE); | 825 | action, P2PAPI_BSSCFG_DEVICE); |
826 | kfree(chanspecs); | ||
826 | } | 827 | } |
827 | exit: | 828 | exit: |
828 | if (err) | 829 | if (err) |
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index fbad00a5abc8..aeaea0e3b4c4 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -2210,8 +2210,10 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
2210 | priv->bss_started = 0; | 2210 | priv->bss_started = 0; |
2211 | priv->bss_num = 0; | 2211 | priv->bss_num = 0; |
2212 | 2212 | ||
2213 | if (mwifiex_cfg80211_init_p2p_client(priv)) | 2213 | if (mwifiex_cfg80211_init_p2p_client(priv)) { |
2214 | return ERR_PTR(-EFAULT); | 2214 | wdev = ERR_PTR(-EFAULT); |
2215 | goto done; | ||
2216 | } | ||
2215 | 2217 | ||
2216 | break; | 2218 | break; |
2217 | default: | 2219 | default: |
@@ -2224,7 +2226,8 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
2224 | if (!dev) { | 2226 | if (!dev) { |
2225 | wiphy_err(wiphy, "no memory available for netdevice\n"); | 2227 | wiphy_err(wiphy, "no memory available for netdevice\n"); |
2226 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; | 2228 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; |
2227 | return ERR_PTR(-ENOMEM); | 2229 | wdev = ERR_PTR(-ENOMEM); |
2230 | goto done; | ||
2228 | } | 2231 | } |
2229 | 2232 | ||
2230 | mwifiex_init_priv_params(priv, dev); | 2233 | mwifiex_init_priv_params(priv, dev); |
@@ -2264,7 +2267,9 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
2264 | wiphy_err(wiphy, "cannot register virtual network device\n"); | 2267 | wiphy_err(wiphy, "cannot register virtual network device\n"); |
2265 | free_netdev(dev); | 2268 | free_netdev(dev); |
2266 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; | 2269 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; |
2267 | return ERR_PTR(-EFAULT); | 2270 | priv->netdev = NULL; |
2271 | wdev = ERR_PTR(-EFAULT); | ||
2272 | goto done; | ||
2268 | } | 2273 | } |
2269 | 2274 | ||
2270 | sema_init(&priv->async_sem, 1); | 2275 | sema_init(&priv->async_sem, 1); |
@@ -2274,6 +2279,13 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
2274 | #ifdef CONFIG_DEBUG_FS | 2279 | #ifdef CONFIG_DEBUG_FS |
2275 | mwifiex_dev_debugfs_init(priv); | 2280 | mwifiex_dev_debugfs_init(priv); |
2276 | #endif | 2281 | #endif |
2282 | |||
2283 | done: | ||
2284 | if (IS_ERR(wdev)) { | ||
2285 | kfree(priv->wdev); | ||
2286 | priv->wdev = NULL; | ||
2287 | } | ||
2288 | |||
2277 | return wdev; | 2289 | return wdev; |
2278 | } | 2290 | } |
2279 | EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf); | 2291 | EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf); |
@@ -2298,7 +2310,10 @@ int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev) | |||
2298 | unregister_netdevice(wdev->netdev); | 2310 | unregister_netdevice(wdev->netdev); |
2299 | 2311 | ||
2300 | /* Clear the priv in adapter */ | 2312 | /* Clear the priv in adapter */ |
2313 | priv->netdev->ieee80211_ptr = NULL; | ||
2301 | priv->netdev = NULL; | 2314 | priv->netdev = NULL; |
2315 | kfree(wdev); | ||
2316 | priv->wdev = NULL; | ||
2302 | 2317 | ||
2303 | priv->media_connected = false; | 2318 | priv->media_connected = false; |
2304 | 2319 | ||
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index 9d7c9d354d34..78e8a6666cc6 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c | |||
@@ -411,13 +411,14 @@ static void mwifiex_terminate_workqueue(struct mwifiex_adapter *adapter) | |||
411 | */ | 411 | */ |
412 | static void mwifiex_fw_dpc(const struct firmware *firmware, void *context) | 412 | static void mwifiex_fw_dpc(const struct firmware *firmware, void *context) |
413 | { | 413 | { |
414 | int ret, i; | 414 | int ret; |
415 | char fmt[64]; | 415 | char fmt[64]; |
416 | struct mwifiex_private *priv; | 416 | struct mwifiex_private *priv; |
417 | struct mwifiex_adapter *adapter = context; | 417 | struct mwifiex_adapter *adapter = context; |
418 | struct mwifiex_fw_image fw; | 418 | struct mwifiex_fw_image fw; |
419 | struct semaphore *sem = adapter->card_sem; | 419 | struct semaphore *sem = adapter->card_sem; |
420 | bool init_failed = false; | 420 | bool init_failed = false; |
421 | struct wireless_dev *wdev; | ||
421 | 422 | ||
422 | if (!firmware) { | 423 | if (!firmware) { |
423 | dev_err(adapter->dev, | 424 | dev_err(adapter->dev, |
@@ -469,14 +470,16 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context) | |||
469 | priv = adapter->priv[MWIFIEX_BSS_ROLE_STA]; | 470 | priv = adapter->priv[MWIFIEX_BSS_ROLE_STA]; |
470 | if (mwifiex_register_cfg80211(adapter)) { | 471 | if (mwifiex_register_cfg80211(adapter)) { |
471 | dev_err(adapter->dev, "cannot register with cfg80211\n"); | 472 | dev_err(adapter->dev, "cannot register with cfg80211\n"); |
472 | goto err_register_cfg80211; | 473 | goto err_init_fw; |
473 | } | 474 | } |
474 | 475 | ||
475 | rtnl_lock(); | 476 | rtnl_lock(); |
476 | /* Create station interface by default */ | 477 | /* Create station interface by default */ |
477 | if (!mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d", | 478 | wdev = mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d", |
478 | NL80211_IFTYPE_STATION, NULL, NULL)) { | 479 | NL80211_IFTYPE_STATION, NULL, NULL); |
480 | if (IS_ERR(wdev)) { | ||
479 | dev_err(adapter->dev, "cannot create default STA interface\n"); | 481 | dev_err(adapter->dev, "cannot create default STA interface\n"); |
482 | rtnl_unlock(); | ||
480 | goto err_add_intf; | 483 | goto err_add_intf; |
481 | } | 484 | } |
482 | rtnl_unlock(); | 485 | rtnl_unlock(); |
@@ -486,17 +489,6 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context) | |||
486 | goto done; | 489 | goto done; |
487 | 490 | ||
488 | err_add_intf: | 491 | err_add_intf: |
489 | for (i = 0; i < adapter->priv_num; i++) { | ||
490 | priv = adapter->priv[i]; | ||
491 | |||
492 | if (!priv) | ||
493 | continue; | ||
494 | |||
495 | if (priv->wdev && priv->netdev) | ||
496 | mwifiex_del_virtual_intf(adapter->wiphy, priv->wdev); | ||
497 | } | ||
498 | rtnl_unlock(); | ||
499 | err_register_cfg80211: | ||
500 | wiphy_unregister(adapter->wiphy); | 492 | wiphy_unregister(adapter->wiphy); |
501 | wiphy_free(adapter->wiphy); | 493 | wiphy_free(adapter->wiphy); |
502 | err_init_fw: | 494 | err_init_fw: |
@@ -1006,12 +998,6 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem) | |||
1006 | wiphy_unregister(priv->wdev->wiphy); | 998 | wiphy_unregister(priv->wdev->wiphy); |
1007 | wiphy_free(priv->wdev->wiphy); | 999 | wiphy_free(priv->wdev->wiphy); |
1008 | 1000 | ||
1009 | for (i = 0; i < adapter->priv_num; i++) { | ||
1010 | priv = adapter->priv[i]; | ||
1011 | if (priv) | ||
1012 | kfree(priv->wdev); | ||
1013 | } | ||
1014 | |||
1015 | mwifiex_terminate_workqueue(adapter); | 1001 | mwifiex_terminate_workqueue(adapter); |
1016 | 1002 | ||
1017 | /* Unregister device */ | 1003 | /* Unregister device */ |
diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c index 33fa9432b241..03688aa14e8a 100644 --- a/drivers/net/wireless/mwifiex/pcie.c +++ b/drivers/net/wireless/mwifiex/pcie.c | |||
@@ -232,7 +232,6 @@ static void mwifiex_pcie_remove(struct pci_dev *pdev) | |||
232 | } | 232 | } |
233 | 233 | ||
234 | mwifiex_remove_card(card->adapter, &add_remove_card_sem); | 234 | mwifiex_remove_card(card->adapter, &add_remove_card_sem); |
235 | kfree(card); | ||
236 | } | 235 | } |
237 | 236 | ||
238 | static void mwifiex_pcie_shutdown(struct pci_dev *pdev) | 237 | static void mwifiex_pcie_shutdown(struct pci_dev *pdev) |
@@ -2313,6 +2312,7 @@ static void mwifiex_pcie_cleanup(struct mwifiex_adapter *adapter) | |||
2313 | pci_release_region(pdev, 0); | 2312 | pci_release_region(pdev, 0); |
2314 | pci_set_drvdata(pdev, NULL); | 2313 | pci_set_drvdata(pdev, NULL); |
2315 | } | 2314 | } |
2315 | kfree(card); | ||
2316 | } | 2316 | } |
2317 | 2317 | ||
2318 | /* | 2318 | /* |
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c index 9bf8898743ab..b44a31523461 100644 --- a/drivers/net/wireless/mwifiex/sdio.c +++ b/drivers/net/wireless/mwifiex/sdio.c | |||
@@ -196,7 +196,6 @@ mwifiex_sdio_remove(struct sdio_func *func) | |||
196 | } | 196 | } |
197 | 197 | ||
198 | mwifiex_remove_card(card->adapter, &add_remove_card_sem); | 198 | mwifiex_remove_card(card->adapter, &add_remove_card_sem); |
199 | kfree(card); | ||
200 | } | 199 | } |
201 | 200 | ||
202 | /* | 201 | /* |
@@ -1745,7 +1744,6 @@ mwifiex_unregister_dev(struct mwifiex_adapter *adapter) | |||
1745 | sdio_claim_host(card->func); | 1744 | sdio_claim_host(card->func); |
1746 | sdio_disable_func(card->func); | 1745 | sdio_disable_func(card->func); |
1747 | sdio_release_host(card->func); | 1746 | sdio_release_host(card->func); |
1748 | sdio_set_drvdata(card->func, NULL); | ||
1749 | } | 1747 | } |
1750 | } | 1748 | } |
1751 | 1749 | ||
@@ -1773,7 +1771,6 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter) | |||
1773 | return ret; | 1771 | return ret; |
1774 | } | 1772 | } |
1775 | 1773 | ||
1776 | sdio_set_drvdata(func, card); | ||
1777 | 1774 | ||
1778 | adapter->dev = &func->dev; | 1775 | adapter->dev = &func->dev; |
1779 | 1776 | ||
@@ -1801,6 +1798,8 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter) | |||
1801 | int ret; | 1798 | int ret; |
1802 | u8 sdio_ireg; | 1799 | u8 sdio_ireg; |
1803 | 1800 | ||
1801 | sdio_set_drvdata(card->func, card); | ||
1802 | |||
1804 | /* | 1803 | /* |
1805 | * Read the HOST_INT_STATUS_REG for ACK the first interrupt got | 1804 | * Read the HOST_INT_STATUS_REG for ACK the first interrupt got |
1806 | * from the bootloader. If we don't do this we get a interrupt | 1805 | * from the bootloader. If we don't do this we get a interrupt |
@@ -1883,6 +1882,8 @@ static void mwifiex_cleanup_sdio(struct mwifiex_adapter *adapter) | |||
1883 | kfree(card->mpa_rx.len_arr); | 1882 | kfree(card->mpa_rx.len_arr); |
1884 | kfree(card->mpa_tx.buf); | 1883 | kfree(card->mpa_tx.buf); |
1885 | kfree(card->mpa_rx.buf); | 1884 | kfree(card->mpa_rx.buf); |
1885 | sdio_set_drvdata(card->func, NULL); | ||
1886 | kfree(card); | ||
1886 | } | 1887 | } |
1887 | 1888 | ||
1888 | /* | 1889 | /* |
diff --git a/drivers/net/wireless/mwifiex/usb.c b/drivers/net/wireless/mwifiex/usb.c index 1c70b8d09227..edf5b7a24900 100644 --- a/drivers/net/wireless/mwifiex/usb.c +++ b/drivers/net/wireless/mwifiex/usb.c | |||
@@ -350,7 +350,6 @@ static int mwifiex_usb_probe(struct usb_interface *intf, | |||
350 | 350 | ||
351 | card->udev = udev; | 351 | card->udev = udev; |
352 | card->intf = intf; | 352 | card->intf = intf; |
353 | usb_card = card; | ||
354 | 353 | ||
355 | pr_debug("info: bcdUSB=%#x Device Class=%#x SubClass=%#x Protocol=%#x\n", | 354 | pr_debug("info: bcdUSB=%#x Device Class=%#x SubClass=%#x Protocol=%#x\n", |
356 | udev->descriptor.bcdUSB, udev->descriptor.bDeviceClass, | 355 | udev->descriptor.bcdUSB, udev->descriptor.bDeviceClass, |
@@ -525,25 +524,28 @@ static int mwifiex_usb_resume(struct usb_interface *intf) | |||
525 | static void mwifiex_usb_disconnect(struct usb_interface *intf) | 524 | static void mwifiex_usb_disconnect(struct usb_interface *intf) |
526 | { | 525 | { |
527 | struct usb_card_rec *card = usb_get_intfdata(intf); | 526 | struct usb_card_rec *card = usb_get_intfdata(intf); |
528 | struct mwifiex_adapter *adapter; | ||
529 | 527 | ||
530 | if (!card || !card->adapter) { | 528 | if (!card) { |
531 | pr_err("%s: card or card->adapter is NULL\n", __func__); | 529 | pr_err("%s: card is NULL\n", __func__); |
532 | return; | 530 | return; |
533 | } | 531 | } |
534 | 532 | ||
535 | adapter = card->adapter; | ||
536 | if (!adapter->priv_num) | ||
537 | return; | ||
538 | |||
539 | mwifiex_usb_free(card); | 533 | mwifiex_usb_free(card); |
540 | 534 | ||
541 | dev_dbg(adapter->dev, "%s: removing card\n", __func__); | 535 | if (card->adapter) { |
542 | mwifiex_remove_card(adapter, &add_remove_card_sem); | 536 | struct mwifiex_adapter *adapter = card->adapter; |
537 | |||
538 | if (!adapter->priv_num) | ||
539 | return; | ||
540 | |||
541 | dev_dbg(adapter->dev, "%s: removing card\n", __func__); | ||
542 | mwifiex_remove_card(adapter, &add_remove_card_sem); | ||
543 | } | ||
543 | 544 | ||
544 | usb_set_intfdata(intf, NULL); | 545 | usb_set_intfdata(intf, NULL); |
545 | usb_put_dev(interface_to_usbdev(intf)); | 546 | usb_put_dev(interface_to_usbdev(intf)); |
546 | kfree(card); | 547 | kfree(card); |
548 | usb_card = NULL; | ||
547 | 549 | ||
548 | return; | 550 | return; |
549 | } | 551 | } |
@@ -754,6 +756,7 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter) | |||
754 | card->adapter = adapter; | 756 | card->adapter = adapter; |
755 | adapter->dev = &card->udev->dev; | 757 | adapter->dev = &card->udev->dev; |
756 | strcpy(adapter->fw_name, USB8797_DEFAULT_FW_NAME); | 758 | strcpy(adapter->fw_name, USB8797_DEFAULT_FW_NAME); |
759 | usb_card = card; | ||
757 | 760 | ||
758 | return 0; | 761 | return 0; |
759 | } | 762 | } |
@@ -762,7 +765,7 @@ static void mwifiex_unregister_dev(struct mwifiex_adapter *adapter) | |||
762 | { | 765 | { |
763 | struct usb_card_rec *card = (struct usb_card_rec *)adapter->card; | 766 | struct usb_card_rec *card = (struct usb_card_rec *)adapter->card; |
764 | 767 | ||
765 | usb_set_intfdata(card->intf, NULL); | 768 | card->adapter = NULL; |
766 | } | 769 | } |
767 | 770 | ||
768 | static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter, | 771 | static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter, |
@@ -1004,7 +1007,7 @@ static void mwifiex_usb_cleanup_module(void) | |||
1004 | if (!down_interruptible(&add_remove_card_sem)) | 1007 | if (!down_interruptible(&add_remove_card_sem)) |
1005 | up(&add_remove_card_sem); | 1008 | up(&add_remove_card_sem); |
1006 | 1009 | ||
1007 | if (usb_card) { | 1010 | if (usb_card && usb_card->adapter) { |
1008 | struct mwifiex_adapter *adapter = usb_card->adapter; | 1011 | struct mwifiex_adapter *adapter = usb_card->adapter; |
1009 | int i; | 1012 | int i; |
1010 | 1013 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 080b1fcae5fa..9dd92a700442 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -181,6 +181,7 @@ static void rt2x00lib_autowakeup(struct work_struct *work) | |||
181 | static void rt2x00lib_bc_buffer_iter(void *data, u8 *mac, | 181 | static void rt2x00lib_bc_buffer_iter(void *data, u8 *mac, |
182 | struct ieee80211_vif *vif) | 182 | struct ieee80211_vif *vif) |
183 | { | 183 | { |
184 | struct ieee80211_tx_control control = {}; | ||
184 | struct rt2x00_dev *rt2x00dev = data; | 185 | struct rt2x00_dev *rt2x00dev = data; |
185 | struct sk_buff *skb; | 186 | struct sk_buff *skb; |
186 | 187 | ||
@@ -195,7 +196,7 @@ static void rt2x00lib_bc_buffer_iter(void *data, u8 *mac, | |||
195 | */ | 196 | */ |
196 | skb = ieee80211_get_buffered_bc(rt2x00dev->hw, vif); | 197 | skb = ieee80211_get_buffered_bc(rt2x00dev->hw, vif); |
197 | while (skb) { | 198 | while (skb) { |
198 | rt2x00mac_tx(rt2x00dev->hw, NULL, skb); | 199 | rt2x00mac_tx(rt2x00dev->hw, &control, skb); |
199 | skb = ieee80211_get_buffered_bc(rt2x00dev->hw, vif); | 200 | skb = ieee80211_get_buffered_bc(rt2x00dev->hw, vif); |
200 | } | 201 | } |
201 | } | 202 | } |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c b/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c index 393685390f3e..e26312fb4356 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c | |||
@@ -769,7 +769,7 @@ static long _rtl92c_signal_scale_mapping(struct ieee80211_hw *hw, | |||
769 | 769 | ||
770 | static void _rtl92c_query_rxphystatus(struct ieee80211_hw *hw, | 770 | static void _rtl92c_query_rxphystatus(struct ieee80211_hw *hw, |
771 | struct rtl_stats *pstats, | 771 | struct rtl_stats *pstats, |
772 | struct rx_desc_92c *pdesc, | 772 | struct rx_desc_92c *p_desc, |
773 | struct rx_fwinfo_92c *p_drvinfo, | 773 | struct rx_fwinfo_92c *p_drvinfo, |
774 | bool packet_match_bssid, | 774 | bool packet_match_bssid, |
775 | bool packet_toself, | 775 | bool packet_toself, |
@@ -784,11 +784,11 @@ static void _rtl92c_query_rxphystatus(struct ieee80211_hw *hw, | |||
784 | u32 rssi, total_rssi = 0; | 784 | u32 rssi, total_rssi = 0; |
785 | bool in_powersavemode = false; | 785 | bool in_powersavemode = false; |
786 | bool is_cck_rate; | 786 | bool is_cck_rate; |
787 | u8 *pdesc = (u8 *)p_desc; | ||
787 | 788 | ||
788 | is_cck_rate = RX_HAL_IS_CCK_RATE(pdesc); | 789 | is_cck_rate = RX_HAL_IS_CCK_RATE(p_desc); |
789 | pstats->packet_matchbssid = packet_match_bssid; | 790 | pstats->packet_matchbssid = packet_match_bssid; |
790 | pstats->packet_toself = packet_toself; | 791 | pstats->packet_toself = packet_toself; |
791 | pstats->is_cck = is_cck_rate; | ||
792 | pstats->packet_beacon = packet_beacon; | 792 | pstats->packet_beacon = packet_beacon; |
793 | pstats->is_cck = is_cck_rate; | 793 | pstats->is_cck = is_cck_rate; |
794 | pstats->RX_SIGQ[0] = -1; | 794 | pstats->RX_SIGQ[0] = -1; |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c index b0c346a9e4b8..1bc21ccfa71b 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | |||
@@ -303,10 +303,10 @@ out: | |||
303 | bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw, | 303 | bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw, |
304 | struct rtl_stats *stats, | 304 | struct rtl_stats *stats, |
305 | struct ieee80211_rx_status *rx_status, | 305 | struct ieee80211_rx_status *rx_status, |
306 | u8 *p_desc, struct sk_buff *skb) | 306 | u8 *pdesc, struct sk_buff *skb) |
307 | { | 307 | { |
308 | struct rx_fwinfo_92c *p_drvinfo; | 308 | struct rx_fwinfo_92c *p_drvinfo; |
309 | struct rx_desc_92c *pdesc = (struct rx_desc_92c *)p_desc; | 309 | struct rx_desc_92c *p_desc = (struct rx_desc_92c *)pdesc; |
310 | u32 phystatus = GET_RX_DESC_PHY_STATUS(pdesc); | 310 | u32 phystatus = GET_RX_DESC_PHY_STATUS(pdesc); |
311 | 311 | ||
312 | stats->length = (u16) GET_RX_DESC_PKT_LEN(pdesc); | 312 | stats->length = (u16) GET_RX_DESC_PKT_LEN(pdesc); |
@@ -345,7 +345,7 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw, | |||
345 | if (phystatus) { | 345 | if (phystatus) { |
346 | p_drvinfo = (struct rx_fwinfo_92c *)(skb->data + | 346 | p_drvinfo = (struct rx_fwinfo_92c *)(skb->data + |
347 | stats->rx_bufshift); | 347 | stats->rx_bufshift); |
348 | rtl92c_translate_rx_signal_stuff(hw, skb, stats, pdesc, | 348 | rtl92c_translate_rx_signal_stuff(hw, skb, stats, p_desc, |
349 | p_drvinfo); | 349 | p_drvinfo); |
350 | } | 350 | } |
351 | /*rx_status->qual = stats->signal; */ | 351 | /*rx_status->qual = stats->signal; */ |