diff options
author | Arik Nemtsov <arik@wizery.com> | 2014-06-15 09:03:55 -0400 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-07-22 15:08:47 -0400 |
commit | f697267f827516fba4d0c325ed1db1e72f402f11 (patch) | |
tree | 08509094bf9b271ae4a16503d3c59f39674b018a /drivers/net/wireless/iwlwifi/mvm/mac80211.c | |
parent | ae0008c71a192abe6f0fed7082d5e5b1cadfd4e7 (diff) |
iwlwifi: mvm: teardown TDLS peers during chan-switch and AP DCM
The DCM condition was not checked well for channel switch in both AP and
station scenarios. Teardown was also not done for AP/GO DCM. Add the
missing checks.
Reported-by: Peer, Ilan <ilan.peer@intel.com>
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/mac80211.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mac80211.c | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index 6639341b2c2c..0d6a8b768a68 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
@@ -1406,6 +1406,28 @@ static inline int iwl_mvm_configure_bcast_filter(struct iwl_mvm *mvm, | |||
1406 | } | 1406 | } |
1407 | #endif | 1407 | #endif |
1408 | 1408 | ||
1409 | static void iwl_mvm_teardown_tdls_peers(struct iwl_mvm *mvm) | ||
1410 | { | ||
1411 | struct ieee80211_sta *sta; | ||
1412 | struct iwl_mvm_sta *mvmsta; | ||
1413 | int i; | ||
1414 | |||
1415 | lockdep_assert_held(&mvm->mutex); | ||
1416 | |||
1417 | for (i = 0; i < IWL_MVM_STATION_COUNT; i++) { | ||
1418 | sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], | ||
1419 | lockdep_is_held(&mvm->mutex)); | ||
1420 | if (!sta || IS_ERR(sta) || !sta->tdls) | ||
1421 | continue; | ||
1422 | |||
1423 | mvmsta = iwl_mvm_sta_from_mac80211(sta); | ||
1424 | ieee80211_tdls_oper_request(mvmsta->vif, sta->addr, | ||
1425 | NL80211_TDLS_TEARDOWN, | ||
1426 | WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED, | ||
1427 | GFP_KERNEL); | ||
1428 | } | ||
1429 | } | ||
1430 | |||
1409 | static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, | 1431 | static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, |
1410 | struct ieee80211_vif *vif, | 1432 | struct ieee80211_vif *vif, |
1411 | struct ieee80211_bss_conf *bss_conf, | 1433 | struct ieee80211_bss_conf *bss_conf, |
@@ -1600,6 +1622,10 @@ static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw, | |||
1600 | 1622 | ||
1601 | iwl_mvm_bt_coex_vif_change(mvm); | 1623 | iwl_mvm_bt_coex_vif_change(mvm); |
1602 | 1624 | ||
1625 | /* we don't support TDLS during DCM */ | ||
1626 | if (iwl_mvm_phy_ctx_count(mvm) > 1) | ||
1627 | iwl_mvm_teardown_tdls_peers(mvm); | ||
1628 | |||
1603 | mutex_unlock(&mvm->mutex); | 1629 | mutex_unlock(&mvm->mutex); |
1604 | return 0; | 1630 | return 0; |
1605 | 1631 | ||
@@ -1947,28 +1973,6 @@ static void iwl_mvm_recalc_tdls_state(struct iwl_mvm *mvm, | |||
1947 | iwl_mvm_power_update_mac(mvm); | 1973 | iwl_mvm_power_update_mac(mvm); |
1948 | } | 1974 | } |
1949 | 1975 | ||
1950 | static void iwl_mvm_teardown_tdls_peers(struct iwl_mvm *mvm) | ||
1951 | { | ||
1952 | struct ieee80211_sta *sta; | ||
1953 | struct iwl_mvm_sta *mvmsta; | ||
1954 | int i; | ||
1955 | |||
1956 | lockdep_assert_held(&mvm->mutex); | ||
1957 | |||
1958 | for (i = 0; i < IWL_MVM_STATION_COUNT; i++) { | ||
1959 | sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], | ||
1960 | lockdep_is_held(&mvm->mutex)); | ||
1961 | if (!sta || IS_ERR(sta) || !sta->tdls) | ||
1962 | continue; | ||
1963 | |||
1964 | mvmsta = iwl_mvm_sta_from_mac80211(sta); | ||
1965 | ieee80211_tdls_oper_request(mvmsta->vif, sta->addr, | ||
1966 | NL80211_TDLS_TEARDOWN, | ||
1967 | WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED, | ||
1968 | GFP_KERNEL); | ||
1969 | } | ||
1970 | } | ||
1971 | |||
1972 | static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw, | 1976 | static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw, |
1973 | struct ieee80211_vif *vif, | 1977 | struct ieee80211_vif *vif, |
1974 | struct ieee80211_sta *sta, | 1978 | struct ieee80211_sta *sta, |
@@ -2846,6 +2850,10 @@ static int iwl_mvm_switch_vif_chanctx(struct ieee80211_hw *hw, | |||
2846 | goto out_remove; | 2850 | goto out_remove; |
2847 | } | 2851 | } |
2848 | 2852 | ||
2853 | /* we don't support TDLS during DCM - can be caused by channel switch */ | ||
2854 | if (iwl_mvm_phy_ctx_count(mvm) > 1) | ||
2855 | iwl_mvm_teardown_tdls_peers(mvm); | ||
2856 | |||
2849 | goto out; | 2857 | goto out; |
2850 | 2858 | ||
2851 | out_remove: | 2859 | out_remove: |