Commit 11c5cc9e authored by Rotem Kerem's avatar Rotem Kerem Committed by Miri Korenblit
Browse files

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: default avatarRotem Kerem <rotem.kerem@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250710212632.cd89d8013261.I214b7ffbabc393593fb57831d61d1a9ffa318a1e@changeid
parent c7236b1f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}
+1 −1
Original line number Diff line number Diff line
@@ -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
+5 −0
Original line number Diff line number Diff line
@@ -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
 *****************************************************/
+1 −1
Original line number Diff line number Diff line
@@ -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");
+1 −1
Original line number Diff line number Diff line
@@ -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);