]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
iwlwifi: mvm: add tx fail time point
authorMordechay Goodstein <mordechay.goodstein@intel.com>
Sun, 31 Jan 2021 18:22:04 +0000 (20:22 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 5 Feb 2021 09:57:43 +0000 (11:57 +0200)
This helps collect on any tx failure fw data to better understand what
went wrong.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210131201908.719de818c09a.I2788e6a4c411aa414eaa67e6b7b21d90ccd9d0c1@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/tx.c

index b102fe116f0472862c83a7a515f8754139211de6..03afced82afa01ce67d5ab48a99110dcdad9c12a 100644 (file)
@@ -1324,12 +1324,24 @@ static void iwl_mvm_hwrate_to_tx_status(u32 rate_n_flags,
 }
 
 static void iwl_mvm_tx_status_check_trigger(struct iwl_mvm *mvm,
-                                           u32 status)
+                                           u32 status, __le16 frame_control)
 {
        struct iwl_fw_dbg_trigger_tlv *trig;
        struct iwl_fw_dbg_trigger_tx_status *status_trig;
        int i;
 
+       if ((status & TX_STATUS_MSK) != TX_STATUS_SUCCESS) {
+               enum iwl_fw_ini_time_point tp =
+                       IWL_FW_INI_TIME_POINT_TX_FAILED;
+
+               if (ieee80211_is_action(frame_control))
+                       tp = IWL_FW_INI_TIME_POINT_TX_WFD_ACTION_FRAME_FAILED;
+
+               iwl_dbg_tlv_time_point(&mvm->fwrt,
+                                      tp, NULL);
+               return;
+       }
+
        trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, NULL,
                                     FW_DBG_TRIGGER_TX_STATUS);
        if (!trig)
@@ -1447,7 +1459,7 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm,
                if (skb_freed > 1)
                        info->flags |= IEEE80211_TX_STAT_ACK;
 
-               iwl_mvm_tx_status_check_trigger(mvm, status);
+               iwl_mvm_tx_status_check_trigger(mvm, status, hdr->frame_control);
 
                info->status.rates[0].count = tx_resp->failure_frame + 1;
                iwl_mvm_hwrate_to_tx_status(le32_to_cpu(tx_resp->initial_rate),
@@ -1631,10 +1643,13 @@ static void iwl_mvm_rx_tx_cmd_agg_dbg(struct iwl_mvm *mvm,
        struct agg_tx_status *frame_status =
                iwl_mvm_get_agg_status(mvm, tx_resp);
        int i;
+       bool tirgger_timepoint = false;
 
        for (i = 0; i < tx_resp->frame_count; i++) {
                u16 fstatus = le16_to_cpu(frame_status[i].status);
-
+               /* In case one frame wasn't transmitted trigger time point */
+               tirgger_timepoint |= ((fstatus & AGG_TX_STATE_STATUS_MSK) !=
+                                     AGG_TX_STATE_TRANSMITTED);
                IWL_DEBUG_TX_REPLY(mvm,
                                   "status %s (0x%04x), try-count (%d) seq (0x%x)\n",
                                   iwl_get_agg_tx_status(fstatus),
@@ -1643,6 +1658,11 @@ static void iwl_mvm_rx_tx_cmd_agg_dbg(struct iwl_mvm *mvm,
                                        AGG_TX_STATE_TRY_CNT_POS,
                                   le16_to_cpu(frame_status[i].sequence));
        }
+
+       if (tirgger_timepoint)
+               iwl_dbg_tlv_time_point(&mvm->fwrt,
+                                      IWL_FW_INI_TIME_POINT_TX_FAILED, NULL);
+
 }
 #else
 static void iwl_mvm_rx_tx_cmd_agg_dbg(struct iwl_mvm *mvm,