diff options
author | David Spinadel <david.spinadel@intel.com> | 2012-03-10 13:00:10 -0800 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-12 14:22:02 -0400 |
commit | 8f7ffbe2b275e5315773322161945a24518e31f4 (patch) | |
tree | ca73d736a52b9e443ce79a010c16d19cfb081f75 /drivers/net/wireless/iwlwifi/iwl-debugfs.c | |
parent | 69a10b29eb87cf186cac20921b4884e349b59c97 (diff) | |
download | op-kernel-dev-8f7ffbe2b275e5315773322161945a24518e31f4.zip op-kernel-dev-8f7ffbe2b275e5315773322161945a24518e31f4.tar.gz |
iwlwifi: avoid some operations if no uCode loaded
Printing the SRAM and similar testmode operations could
be triggered when no uCode is loaded; prevent those
invalid operations by tracking whether uCode is loaded.
Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-debugfs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 9b71c87..89cb9a7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c @@ -235,10 +235,21 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file, /* default is to dump the entire data segment */ if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) { priv->dbgfs_sram_offset = 0x800000; - if (priv->shrd->ucode_type == IWL_UCODE_INIT) + if (!priv->ucode_loaded) { + IWL_ERR(priv, "No uCode has been loadded.\n"); + return -EINVAL; + } + if (priv->shrd->ucode_type == IWL_UCODE_INIT) { priv->dbgfs_sram_len = priv->fw->ucode_init.data.len; - else + } else if (priv->shrd->ucode_type == IWL_UCODE_REGULAR) { priv->dbgfs_sram_len = priv->fw->ucode_rt.data.len; + } else if (priv->shrd->ucode_type == IWL_UCODE_WOWLAN) { + priv->dbgfs_sram_len = priv->fw->ucode_wowlan.data.len; + } else { + IWL_ERR(priv, "Unsupported type of uCode loaded?" + " that shouldn't happen.\n"); + return -EINVAL; + } } len = priv->dbgfs_sram_len; |