Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0bef1b83 authored by Matt Chen's avatar Matt Chen Committed by Luca Coelho
Browse files

iwlwifi: mvm: don't send CTDP commands via debugfs if not supported



Fix this issue if it is not supported by the firmware.

Fixes: 00f481bd ("iwlwifi: mvm: add ctdp operations to debugfs")
Signed-off-by: default avatarMatt Chen <matt.chen@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 6ca33f8b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -82,6 +82,9 @@ static ssize_t iwl_dbgfs_ctdp_budget_read(struct file *file,
	char buf[16];
	int pos, budget;

	if (!iwl_mvm_is_ctdp_supported(mvm))
		return -EOPNOTSUPP;

	if (!iwl_mvm_firmware_running(mvm) ||
	    mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR)
		return -EIO;
@@ -103,6 +106,9 @@ static ssize_t iwl_dbgfs_stop_ctdp_write(struct iwl_mvm *mvm, char *buf,
{
	int ret;

	if (!iwl_mvm_is_ctdp_supported(mvm))
		return -EOPNOTSUPP;

	if (!iwl_mvm_firmware_running(mvm) ||
	    mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR)
		return -EIO;