aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
diff options
context:
space:
mode:
authorSara Sharon <sara.sharon@intel.com>2018-06-12 03:41:35 -0400
committerLuca Coelho <luciano.coelho@intel.com>2018-10-06 03:25:44 -0400
commit6c042d7505d082b3bda0909c8a2c9817aa210ea2 (patch)
tree2f3548dcbaef969672b46810c90137cb0ccf33ad /drivers/net/wireless/intel/iwlwifi/mvm/utils.c
parent7339cc292c1df3b8f05a90088f8b4e5d2a02cc46 (diff)
iwlwifi: dbg: group trigger condition to helper function
The triplet of get trigger, is trigger enabled and is trigger stopped repeats itself. Group them in a function to avoid code duplication. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/utils.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/utils.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
index dcacc4d11abc..6c14d3413bdc 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
@@ -1238,14 +1238,12 @@ void iwl_mvm_connection_loss(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
1238 struct iwl_fw_dbg_trigger_tlv *trig; 1238 struct iwl_fw_dbg_trigger_tlv *trig;
1239 struct iwl_fw_dbg_trigger_mlme *trig_mlme; 1239 struct iwl_fw_dbg_trigger_mlme *trig_mlme;
1240 1240
1241 if (!iwl_fw_dbg_trigger_enabled(mvm->fw, FW_DBG_TRIGGER_MLME)) 1241 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif),
1242 FW_DBG_TRIGGER_MLME);
1243 if (!trig)
1242 goto out; 1244 goto out;
1243 1245
1244 trig = iwl_fw_dbg_get_trigger(mvm->fw, FW_DBG_TRIGGER_MLME);
1245 trig_mlme = (void *)trig->data; 1246 trig_mlme = (void *)trig->data;
1246 if (!iwl_fw_dbg_trigger_check_stop(&mvm->fwrt,
1247 ieee80211_vif_to_wdev(vif), trig))
1248 goto out;
1249 1247
1250 if (trig_mlme->stop_connection_loss && 1248 if (trig_mlme->stop_connection_loss &&
1251 --trig_mlme->stop_connection_loss) 1249 --trig_mlme->stop_connection_loss)
@@ -1430,14 +1428,12 @@ void iwl_mvm_event_frame_timeout_callback(struct iwl_mvm *mvm,
1430 struct iwl_fw_dbg_trigger_tlv *trig; 1428 struct iwl_fw_dbg_trigger_tlv *trig;
1431 struct iwl_fw_dbg_trigger_ba *ba_trig; 1429 struct iwl_fw_dbg_trigger_ba *ba_trig;
1432 1430
1433 if (!iwl_fw_dbg_trigger_enabled(mvm->fw, FW_DBG_TRIGGER_BA)) 1431 trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif),
1432 FW_DBG_TRIGGER_BA);
1433 if (!trig)
1434 return; 1434 return;
1435 1435
1436 trig = iwl_fw_dbg_get_trigger(mvm->fw, FW_DBG_TRIGGER_BA);
1437 ba_trig = (void *)trig->data; 1436 ba_trig = (void *)trig->data;
1438 if (!iwl_fw_dbg_trigger_check_stop(&mvm->fwrt,
1439 ieee80211_vif_to_wdev(vif), trig))
1440 return;
1441 1437
1442 if (!(le16_to_cpu(ba_trig->frame_timeout) & BIT(tid))) 1438 if (!(le16_to_cpu(ba_trig->frame_timeout) & BIT(tid)))
1443 return; 1439 return;