]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iwlwifi: mvm: fix assert 0x2B00 on older FWs
authorSara Sharon <sara.sharon@intel.com>
Sun, 7 Jan 2018 12:30:49 +0000 (14:30 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 2 Mar 2018 08:20:00 +0000 (10:20 +0200)
We should add the multicast station before adding the
broadcast station.

However, in older FW, the firmware will start beaconing
when we add the multicast station, and since the broadcast
station is not added at this point so the transmission
of the beacon will fail on assert 0x2b00.

This is fixed in later firmware, so make the order
of addition depend on the TLV.

Fixes: 26d6c16bed53 ("iwlwifi: mvm: add multicast station")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c

index 08de822c3ef0c0f80aa005910b421059f48aab69..ebf511150f4d02561362d8f3973ec2751cb8d3ef 100644 (file)
@@ -8,6 +8,7 @@
  * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
  * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
+ * Copyright(c) 2018        Intel Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of version 2 of the GNU General Public License as
@@ -2106,15 +2107,40 @@ static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw,
        if (ret)
                goto out_remove;
 
-       ret = iwl_mvm_add_mcast_sta(mvm, vif);
-       if (ret)
-               goto out_unbind;
-
-       /* Send the bcast station. At this stage the TBTT and DTIM time events
-        * are added and applied to the scheduler */
-       ret = iwl_mvm_send_add_bcast_sta(mvm, vif);
-       if (ret)
-               goto out_rm_mcast;
+       /*
+        * This is not very nice, but the simplest:
+        * For older FWs adding the mcast sta before the bcast station may
+        * cause assert 0x2b00.
+        * This is fixed in later FW so make the order of removal depend on
+        * the TLV
+        */
+       if (fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE)) {
+               ret = iwl_mvm_add_mcast_sta(mvm, vif);
+               if (ret)
+                       goto out_unbind;
+               /*
+                * Send the bcast station. At this stage the TBTT and DTIM time
+                * events are added and applied to the scheduler
+                */
+               ret = iwl_mvm_send_add_bcast_sta(mvm, vif);
+               if (ret) {
+                       iwl_mvm_rm_mcast_sta(mvm, vif);
+                       goto out_unbind;
+               }
+       } else {
+               /*
+                * Send the bcast station. At this stage the TBTT and DTIM time
+                * events are added and applied to the scheduler
+                */
+               iwl_mvm_send_add_bcast_sta(mvm, vif);
+               if (ret)
+                       goto out_unbind;
+               iwl_mvm_add_mcast_sta(mvm, vif);
+               if (ret) {
+                       iwl_mvm_send_rm_bcast_sta(mvm, vif);
+                       goto out_unbind;
+               }
+       }
 
        /* must be set before quota calculations */
        mvmvif->ap_ibss_active = true;
@@ -2144,7 +2170,6 @@ static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw,
        iwl_mvm_power_update_mac(mvm);
        mvmvif->ap_ibss_active = false;
        iwl_mvm_send_rm_bcast_sta(mvm, vif);
-out_rm_mcast:
        iwl_mvm_rm_mcast_sta(mvm, vif);
 out_unbind:
        iwl_mvm_binding_remove_vif(mvm, vif);