iwlwifi: mvm: add inactive state to ebs status
authorDavid Spinadel <david.spinadel@intel.com>
Wed, 20 May 2015 08:56:59 +0000 (11:56 +0300)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 3 Jun 2015 06:41:15 +0000 (09:41 +0300)
Currently EBS status in scan complete notifications is set to
success if EBS wasn't activated. FW will add a special return
value for cases when EBS wasn't activated and we add a print
of this status.

This change is needed for debug only, no behavior changes.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h
drivers/net/wireless/iwlwifi/mvm/scan.c

index f34cf002e2438227c7354730cad66378c9b5cb94..5e4cbdb44c607ec8399bae489f28990dc907eaeb 100644 (file)
@@ -294,6 +294,7 @@ enum iwl_scan_ebs_status {
        IWL_SCAN_EBS_SUCCESS,
        IWL_SCAN_EBS_FAILED,
        IWL_SCAN_EBS_CHAN_NOT_FOUND,
+       IWL_SCAN_EBS_INACTIVE,
 };
 
 /**
index 4f4570d5261d6a7e49a481f20ff0d314a2384f95..9409237435b60d02c0c88e25cdaa191ade7c6e12 100644 (file)
@@ -352,6 +352,20 @@ int iwl_mvm_rx_scan_match_found(struct iwl_mvm *mvm,
        return 0;
 }
 
+static const char *iwl_mvm_ebs_status_str(enum iwl_scan_ebs_status status)
+{
+       switch (status) {
+       case IWL_SCAN_EBS_SUCCESS:
+               return "successful";
+       case IWL_SCAN_EBS_INACTIVE:
+               return "inactive";
+       case IWL_SCAN_EBS_FAILED:
+       case IWL_SCAN_EBS_CHAN_NOT_FOUND:
+       default:
+               return "failed";
+       }
+}
+
 int iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm,
                                        struct iwl_rx_cmd_buffer *rxb,
                                        struct iwl_device_cmd *cmd)
@@ -359,7 +373,6 @@ int iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm,
        struct iwl_rx_packet *pkt = rxb_addr(rxb);
        struct iwl_periodic_scan_complete *scan_notif = (void *)pkt->data;
        bool aborted = (scan_notif->status == IWL_SCAN_OFFLOAD_ABORTED);
-       bool ebs_successful = (scan_notif->ebs_status == IWL_SCAN_EBS_SUCCESS);
 
        /* scan status must be locked for proper checking */
        lockdep_assert_held(&mvm->mutex);
@@ -379,13 +392,13 @@ int iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm,
 
                IWL_DEBUG_SCAN(mvm, "Scheduled scan %s, EBS status %s\n",
                               aborted ? "aborted" : "completed",
-                              ebs_successful ? "successful" : "failed");
+                              iwl_mvm_ebs_status_str(scan_notif->ebs_status));
 
                mvm->scan_status &= ~IWL_MVM_SCAN_STOPPING_SCHED;
        } else if (mvm->scan_status & IWL_MVM_SCAN_STOPPING_REGULAR) {
                IWL_DEBUG_SCAN(mvm, "Regular scan %s, EBS status %s\n",
                               aborted ? "aborted" : "completed",
-                              ebs_successful ? "successful" : "failed");
+                              iwl_mvm_ebs_status_str(scan_notif->ebs_status));
 
                mvm->scan_status &= ~IWL_MVM_SCAN_STOPPING_REGULAR;
        } else if (mvm->scan_status & IWL_MVM_SCAN_SCHED) {
@@ -393,14 +406,14 @@ int iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm,
 
                IWL_DEBUG_SCAN(mvm, "Scheduled scan %s, EBS status %s (FW)\n",
                               aborted ? "aborted" : "completed",
-                              ebs_successful ? "successful" : "failed");
+                              iwl_mvm_ebs_status_str(scan_notif->ebs_status));
 
                mvm->scan_status &= ~IWL_MVM_SCAN_SCHED;
                ieee80211_sched_scan_stopped(mvm->hw);
        } else if (mvm->scan_status & IWL_MVM_SCAN_REGULAR) {
                IWL_DEBUG_SCAN(mvm, "Regular scan %s, EBS status %s (FW)\n",
                               aborted ? "aborted" : "completed",
-                              ebs_successful ? "successful" : "failed");
+                              iwl_mvm_ebs_status_str(scan_notif->ebs_status));
 
                mvm->scan_status &= ~IWL_MVM_SCAN_REGULAR;
                ieee80211_scan_completed(mvm->hw,
@@ -408,7 +421,9 @@ int iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm,
                iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN);
        }
 
-       mvm->last_ebs_successful = ebs_successful;
+       mvm->last_ebs_successful =
+                       scan_notif->ebs_status == IWL_SCAN_EBS_SUCCESS ||
+                       scan_notif->ebs_status == IWL_SCAN_EBS_INACTIVE;
 
        return 0;
 }
@@ -1376,10 +1391,10 @@ int iwl_mvm_rx_umac_scan_complete_notif(struct iwl_mvm *mvm,
                       uid, mvm->scan_uid_status[uid],
                       notif->status == IWL_SCAN_OFFLOAD_COMPLETED ?
                                "completed" : "aborted",
-                      notif->ebs_status == IWL_SCAN_EBS_SUCCESS ?
-                               "success" : "failed");
+                      iwl_mvm_ebs_status_str(notif->ebs_status));
 
-       if (notif->ebs_status)
+       if (notif->ebs_status != IWL_SCAN_EBS_SUCCESS &&
+           notif->ebs_status != IWL_SCAN_EBS_INACTIVE)
                mvm->last_ebs_successful = false;
 
        mvm->scan_uid_status[uid] = 0;