summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
diff options
context:
space:
mode:
authorMatt Chen <matt.chen@intel.com>2017-06-23 17:50:18 +0800
committerLuca Coelho <luciano.coelho@intel.com>2017-08-09 21:14:42 +0300
commit0bef1b83d35566e9bc757469c823c126862a65d3 (patch)
tree5cba3248bfa93f068022036f0188d01301cd9f3c /drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
parent6ca33f8bae01bd3f1949287a0339c3e6f9e96aca (diff)
downloadlinux-0bef1b83d35566e9bc757469c823c126862a65d3.tar.bz2
iwlwifi: mvm: don't send CTDP commands via debugfs if not supported
Fix this issue if it is not supported by the firmware. Fixes: 00f481bd895a ("iwlwifi: mvm: add ctdp operations to debugfs") Signed-off-by: Matt Chen <matt.chen@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index 0b5cae54b86b..ceb486610a56 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -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;