iwlwifi: mvm: ignore LMAC scan notifications when running UMAC scans
authorLuca Coelho <luciano.coelho@intel.com>
Fri, 6 Nov 2015 08:57:11 +0000 (10:57 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 26 Nov 2015 14:38:49 +0000 (16:38 +0200)
If the firmware sends LMAC scan notifications while a UMAC scan is
running, just WARN and ignore it, otherwise the scanning state gets
messed up.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/scan.c

index 6b9b1904551c90f245c214cde3857515efab2adc..e8a79bff9c1bb167143395b9b15e9f762f775707 100644 (file)
@@ -333,6 +333,13 @@ void iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm,
        struct iwl_periodic_scan_complete *scan_notif = (void *)pkt->data;
        bool aborted = (scan_notif->status == IWL_SCAN_OFFLOAD_ABORTED);
 
+       /* If this happens, the firmware has mistakenly sent an LMAC
+        * notification during UMAC scans -- warn and ignore it.
+        */
+       if (WARN_ON_ONCE(fw_has_capa(&mvm->fw->ucode_capa,
+                                    IWL_UCODE_TLV_CAPA_UMAC_SCAN)))
+               return;
+
        /* scan status must be locked for proper checking */
        lockdep_assert_held(&mvm->mutex);