From: Johannes Berg <[email protected]>

Instead of checking whether a given station is the first to
be added on a client interface check for the new TDLS flag
and warn in the unexpected cases.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Emmanuel Grumbach <[email protected]>
---
 drivers/net/wireless/iwlwifi/mvm/sta.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.c 
b/drivers/net/wireless/iwlwifi/mvm/sta.c
index 960687b..ccfc256 100644
--- a/drivers/net/wireless/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/iwlwifi/mvm/sta.c
@@ -252,10 +252,14 @@ int iwl_mvm_add_sta(struct iwl_mvm *mvm,
        if (ret)
                return ret;
 
-       /* The first station added is the AP, the others are TDLS STAs */
-       if (vif->type == NL80211_IFTYPE_STATION &&
-           mvmvif->ap_sta_id == IWL_MVM_STATION_COUNT)
-               mvmvif->ap_sta_id = sta_id;
+       if (vif->type == NL80211_IFTYPE_STATION) {
+               if (!sta->tdls) {
+                       WARN_ON(mvmvif->ap_sta_id != IWL_MVM_STATION_COUNT);
+                       mvmvif->ap_sta_id = sta_id;
+               } else {
+                       WARN_ON(mvmvif->ap_sta_id == IWL_MVM_STATION_COUNT);
+               }
+       }
 
        rcu_assign_pointer(mvm->fw_id_to_mac_id[sta_id], sta);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to