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

wifi: iwlwifi: add iwl_trans_device_enabled() API



add iwl_trans_device_enabled() function to be called by the op modes
instead of directly checking the trans status bits. This
hides the trans internal implementation details.

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.bb957ba9e130.I6ab825caf41308fb0f7aa1c266f50457fd0c496e@changeid
parent 200945e6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2978,7 +2978,7 @@ IWL_EXPORT_SYMBOL(iwl_fw_dbg_collect_desc);
int iwl_fw_dbg_error_collect(struct iwl_fw_runtime *fwrt,
			     enum iwl_fw_dbg_trigger trig_type)
{
	if (!test_bit(STATUS_DEVICE_ENABLED, &fwrt->trans->status))
	if (!iwl_trans_device_enabled(fwrt->trans))
		return -EIO;

	if (iwl_trans_dbg_ini_valid(fwrt->trans)) {
@@ -3180,7 +3180,7 @@ static void iwl_fw_dbg_collect_sync(struct iwl_fw_runtime *fwrt, u8 wk_idx)
		goto out;
	}

	if (!test_bit(STATUS_DEVICE_ENABLED, &fwrt->trans->status)) {
	if (!iwl_trans_device_enabled(fwrt->trans)) {
		IWL_ERR(fwrt, "Device is not enabled - cannot dump error\n");
		goto out;
	}
+1 −1
Original line number Diff line number Diff line
@@ -490,7 +490,7 @@ void iwl_fwrt_dump_error_logs(struct iwl_fw_runtime *fwrt)
	struct iwl_pc_data *pc_data;
	u8 count;

	if (!test_bit(STATUS_DEVICE_ENABLED, &fwrt->trans->status)) {
	if (!iwl_trans_device_enabled(fwrt->trans)) {
		IWL_ERR(fwrt,
			"DEVICE_ENABLED bit is not set. Aborting dump.\n");
		return;
+5 −0
Original line number Diff line number Diff line
@@ -1235,6 +1235,11 @@ static inline void iwl_trans_suppress_cmd_error_once(struct iwl_trans *trans)
	set_bit(STATUS_SUPPRESS_CMD_ERROR_ONCE, &trans->status);
}

static inline bool iwl_trans_device_enabled(struct iwl_trans *trans)
{
	return test_bit(STATUS_DEVICE_ENABLED, &trans->status);
}

/*****************************************************
 * PCIe handling
 *****************************************************/
+1 −1
Original line number Diff line number Diff line
@@ -3547,7 +3547,7 @@ int iwl_mvm_scan_stop(struct iwl_mvm *mvm, int type, bool notify)
	if (!(mvm->scan_status & type))
		return 0;

	if (!test_bit(STATUS_DEVICE_ENABLED, &mvm->trans->status)) {
	if (!iwl_trans_device_enabled(mvm->trans)) {
		ret = 0;
		goto out;
	}