mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
wifi: iwlwifi: add iwl_trans_is_dead() API
Add iwl_trans_is_dead() function to be called by the op modes instead of directly checking the trans status bits. This hides the trans internal implementation details from callers. Signed-off-by: Rotem Kerem <rotem.kerem@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20250710212632.cd89d8013261.I214b7ffbabc393593fb57831d61d1a9ffa318a1e@changeid
This commit is contained in:
parent
c7236b1f5a
commit
11c5cc9ec6
@ -3186,7 +3186,7 @@ static void iwl_fw_dbg_collect_sync(struct iwl_fw_runtime *fwrt, u8 wk_idx)
|
||||
}
|
||||
|
||||
/* there's no point in fw dump if the bus is dead */
|
||||
if (test_bit(STATUS_TRANS_DEAD, &fwrt->trans->status)) {
|
||||
if (iwl_trans_is_dead(fwrt->trans)) {
|
||||
IWL_ERR(fwrt, "Skip fw error dump since bus is dead\n");
|
||||
goto out;
|
||||
}
|
||||
|
@ -1545,7 +1545,7 @@ _iwl_op_mode_start(struct iwl_drv *drv, struct iwlwifi_opmode_table *op)
|
||||
if (!IS_ERR(op_mode))
|
||||
return op_mode;
|
||||
|
||||
if (test_bit(STATUS_TRANS_DEAD, &drv->trans->status))
|
||||
if (iwl_trans_is_dead(drv->trans))
|
||||
break;
|
||||
|
||||
#ifdef CONFIG_IWLWIFI_DEBUGFS
|
||||
|
@ -1240,6 +1240,11 @@ static inline bool iwl_trans_device_enabled(struct iwl_trans *trans)
|
||||
return test_bit(STATUS_DEVICE_ENABLED, &trans->status);
|
||||
}
|
||||
|
||||
static inline bool iwl_trans_is_dead(struct iwl_trans *trans)
|
||||
{
|
||||
return test_bit(STATUS_TRANS_DEAD, &trans->status);
|
||||
}
|
||||
|
||||
/*****************************************************
|
||||
* PCIe handling
|
||||
*****************************************************/
|
||||
|
@ -630,7 +630,7 @@ iwl_mld_nic_error(struct iwl_op_mode *op_mode,
|
||||
enum iwl_fw_error_type type)
|
||||
{
|
||||
struct iwl_mld *mld = IWL_OP_MODE_GET_MLD(op_mode);
|
||||
bool trans_dead = test_bit(STATUS_TRANS_DEAD, &mld->trans->status);
|
||||
bool trans_dead = iwl_trans_is_dead(mld->trans);
|
||||
|
||||
if (type == IWL_ERR_TYPE_CMD_QUEUE_FULL)
|
||||
IWL_ERR(mld, "Command queue full!\n");
|
||||
|
@ -2053,7 +2053,7 @@ static void iwl_mvm_nic_error(struct iwl_op_mode *op_mode,
|
||||
|
||||
if (type == IWL_ERR_TYPE_CMD_QUEUE_FULL)
|
||||
IWL_ERR(mvm, "Command queue full!\n");
|
||||
else if (!test_bit(STATUS_TRANS_DEAD, &mvm->trans->status) &&
|
||||
else if (!iwl_trans_is_dead(mvm->trans) &&
|
||||
!test_and_clear_bit(IWL_MVM_STATUS_SUPPRESS_ERROR_LOG_ONCE,
|
||||
&mvm->status))
|
||||
iwl_mvm_dump_nic_error_log(mvm);
|
||||
|
Loading…
Reference in New Issue
Block a user