Commit b07f08a5 authored by Kenny Hsu's avatar Kenny Hsu Committed by John W. Linville

iwlwifi: enhance testmode command sram_read

This patch enables SRAM read function to support entire target memory.
Signed-off-by: default avatarKenny Hsu <kenny.hsu@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 102f097f
...@@ -733,7 +733,7 @@ static int iwl_testmode_ownership(struct ieee80211_hw *hw, struct nlattr **tb) ...@@ -733,7 +733,7 @@ static int iwl_testmode_ownership(struct ieee80211_hw *hw, struct nlattr **tb)
static int iwl_testmode_sram(struct ieee80211_hw *hw, struct nlattr **tb) static int iwl_testmode_sram(struct ieee80211_hw *hw, struct nlattr **tb)
{ {
struct iwl_priv *priv = hw->priv; struct iwl_priv *priv = hw->priv;
u32 base, ofs, size, maxsize; u32 ofs, size, maxsize;
if (priv->testmode_sram.sram_readed) if (priv->testmode_sram.sram_readed)
return -EBUSY; return -EBUSY;
...@@ -765,7 +765,7 @@ static int iwl_testmode_sram(struct ieee80211_hw *hw, struct nlattr **tb) ...@@ -765,7 +765,7 @@ static int iwl_testmode_sram(struct ieee80211_hw *hw, struct nlattr **tb)
IWL_DEBUG_INFO(priv, "Error, unsupported uCode type\n"); IWL_DEBUG_INFO(priv, "Error, unsupported uCode type\n");
return -ENOSYS; return -ENOSYS;
} }
if ((ofs + size) > maxsize) { if ((ofs + size) > (maxsize + SRAM_DATA_SEG_OFFSET)) {
IWL_DEBUG_INFO(priv, "Invalid offset/size: out of range\n"); IWL_DEBUG_INFO(priv, "Invalid offset/size: out of range\n");
return -EINVAL; return -EINVAL;
} }
...@@ -776,8 +776,7 @@ static int iwl_testmode_sram(struct ieee80211_hw *hw, struct nlattr **tb) ...@@ -776,8 +776,7 @@ static int iwl_testmode_sram(struct ieee80211_hw *hw, struct nlattr **tb)
IWL_DEBUG_INFO(priv, "Error allocating memory\n"); IWL_DEBUG_INFO(priv, "Error allocating memory\n");
return -ENOMEM; return -ENOMEM;
} }
base = 0x800000; _iwl_read_targ_mem_words(bus(priv), ofs,
_iwl_read_targ_mem_words(bus(priv), base + ofs,
priv->testmode_sram.buff_addr, priv->testmode_sram.buff_addr,
priv->testmode_sram.buff_size / 4); priv->testmode_sram.buff_size / 4);
priv->testmode_sram.num_chunks = priv->testmode_sram.num_chunks =
......
...@@ -271,4 +271,7 @@ enum iwl_tm_attr_t { ...@@ -271,4 +271,7 @@ enum iwl_tm_attr_t {
/* Maximum data size of each dump it packet */ /* Maximum data size of each dump it packet */
#define DUMP_CHUNK_SIZE (PAGE_SIZE - 1024) #define DUMP_CHUNK_SIZE (PAGE_SIZE - 1024)
/* Address offset of data segment in SRAM */
#define SRAM_DATA_SEG_OFFSET 0x800000
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment