]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
iwlwifi: mvm: capture connection loss as part of MLME trigger
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Mon, 30 Mar 2015 07:55:57 +0000 (10:55 +0300)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 2 Apr 2015 06:29:13 +0000 (09:29 +0300)
The only other way to catch these would have been to monitor
the Tx deauth event, but we can send a deauth when we roam.
So it would have been tricky to make sure we capture the
connection losses only.
Define a separate trigger for the connection losses to make
it easier to catch them.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/iwl-fw-file.h
drivers/net/wireless/iwlwifi/mvm/mvm.h
drivers/net/wireless/iwlwifi/mvm/ops.c
drivers/net/wireless/iwlwifi/mvm/time-event.c
drivers/net/wireless/iwlwifi/mvm/utils.c

index ee149482061f8165ca1b929a7e7f781c76c438dc..bfdf3faa6c470dafbd9a66672b2f55e38b0872bc 100644 (file)
@@ -586,12 +586,14 @@ struct iwl_fw_dbg_trigger_low_rssi {
  * @stop_tx_deauth: number of Tx deauth before to collect
  * @stop_assoc_denied: number of denied association to collect
  * @stop_assoc_timeout: number of association timeout to collect
+ * @stop_connection_loss: number of connection loss to collect
  * @start_auth_denied: number of denied authentication to start recording
  * @start_auth_timeout: number of authentication timeout to start recording
  * @start_rx_deauth: number of Rx deauth to start recording
  * @start_tx_deauth: number of Tx deauth to start recording
  * @start_assoc_denied: number of denied association to start recording
  * @start_assoc_timeout: number of association timeout to start recording
+ * @start_connection_loss: number of connection loss to start recording
  */
 struct iwl_fw_dbg_trigger_mlme {
        u8 stop_auth_denied;
@@ -601,7 +603,8 @@ struct iwl_fw_dbg_trigger_mlme {
 
        u8 stop_assoc_denied;
        u8 stop_assoc_timeout;
-       __le16 reserved2;
+       u8 stop_connection_loss;
+       u8 reserved;
 
        u8 start_auth_denied;
        u8 start_auth_timeout;
@@ -610,7 +613,8 @@ struct iwl_fw_dbg_trigger_mlme {
 
        u8 start_assoc_denied;
        u8 start_assoc_timeout;
-       __le16 reserved4;
+       u8 start_connection_loss;
+       u8 reserved2;
 } __packed;
 
 /**
index ef78ebc23a0fdc92d9164f27be3929787692c789..d5522a16124292cd6cab36159851a8446b5e2d95 100644 (file)
@@ -1484,6 +1484,8 @@ int iwl_mvm_fw_dbg_collect_trig(struct iwl_mvm *mvm,
 unsigned int iwl_mvm_get_wd_timeout(struct iwl_mvm *mvm,
                                    struct ieee80211_vif *vif,
                                    bool tdls, bool cmd_q);
+void iwl_mvm_connection_loss(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
+                            const char *errmsg);
 static inline bool
 iwl_fw_dbg_trigger_vif_match(struct iwl_fw_dbg_trigger_tlv *trig,
                             struct ieee80211_vif *vif)
index e656511bdbecac9b60ba3b28b8b60490024a608c..a08b03d58d4bf0f3ebd4773a7fdb6e07cc8406b8 100644 (file)
@@ -1161,7 +1161,7 @@ static void iwl_mvm_d0i3_disconnect_iter(void *data, u8 *mac,
 
        if (vif->type == NL80211_IFTYPE_STATION && vif->bss_conf.assoc &&
            mvm->d0i3_ap_sta_id == mvmvif->ap_sta_id)
-               ieee80211_connection_loss(vif);
+               iwl_mvm_connection_loss(mvm, vif, "D0i3");
 }
 
 void iwl_mvm_d0i3_enable_tx(struct iwl_mvm *mvm, __le16 *qos_seq)
index 647822366fe5ed08b2d1feb42c75f9dff835b878..fd7b0d36f9a620b8e99dcc7b643806b76f09af4d 100644 (file)
@@ -187,7 +187,8 @@ static bool iwl_mvm_te_check_disconnect(struct iwl_mvm *mvm,
                return false;
        if (errmsg)
                IWL_ERR(mvm, "%s\n", errmsg);
-       ieee80211_connection_loss(vif);
+
+       iwl_mvm_connection_loss(mvm, vif, errmsg);
        return true;
 }
 
@@ -210,7 +211,8 @@ iwl_mvm_te_handle_notify_csa(struct iwl_mvm *mvm,
                break;
        case NL80211_IFTYPE_STATION:
                if (!notif->status) {
-                       ieee80211_connection_loss(te_data->vif);
+                       iwl_mvm_connection_loss(mvm, vif,
+                                               "CSA TE failed to start");
                        break;
                }
                iwl_mvm_csa_client_absent(mvm, te_data->vif);
index 54e3556842c451ffc25f19d41d034a316f8514b1..bc55a8b82db6d88ad42ef1151e0c5c53c2cbf64c 100644 (file)
@@ -965,3 +965,27 @@ unsigned int iwl_mvm_get_wd_timeout(struct iwl_mvm *mvm,
                return mvm->cfg->base_params->wd_timeout;
        }
 }
+
+void iwl_mvm_connection_loss(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
+                            const char *errmsg)
+{
+       struct iwl_fw_dbg_trigger_tlv *trig;
+       struct iwl_fw_dbg_trigger_mlme *trig_mlme;
+
+       if (!iwl_fw_dbg_trigger_enabled(mvm->fw, FW_DBG_TRIGGER_MLME))
+               goto out;
+
+       trig = iwl_fw_dbg_get_trigger(mvm->fw, FW_DBG_TRIGGER_MLME);
+       trig_mlme = (void *)trig->data;
+       if (!iwl_fw_dbg_trigger_check_stop(mvm, vif, trig))
+               goto out;
+
+       if (trig_mlme->stop_connection_loss &&
+           --trig_mlme->stop_connection_loss)
+               goto out;
+
+       iwl_mvm_fw_dbg_collect_trig(mvm, trig, "%s", errmsg);
+
+out:
+       ieee80211_connection_loss(vif);
+}