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

iwlwifi: add generic chunk size of tm dumpit packet

Use generic chunk size of dumpit packet for
all necessary testmode commands instead of
add declaration individually.
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 835df183
...@@ -575,7 +575,7 @@ static int iwl_testmode_trace(struct ieee80211_hw *hw, struct nlattr **tb) ...@@ -575,7 +575,7 @@ static int iwl_testmode_trace(struct ieee80211_hw *hw, struct nlattr **tb)
} }
priv->testmode_trace.num_chunks = priv->testmode_trace.num_chunks =
DIV_ROUND_UP(priv->testmode_trace.buff_size, DIV_ROUND_UP(priv->testmode_trace.buff_size,
TRACE_CHUNK_SIZE); DUMP_CHUNK_SIZE);
break; break;
case IWL_TM_CMD_APP2DEV_END_TRACE: case IWL_TM_CMD_APP2DEV_END_TRACE:
...@@ -607,15 +607,15 @@ static int iwl_testmode_trace_dump(struct ieee80211_hw *hw, struct nlattr **tb, ...@@ -607,15 +607,15 @@ static int iwl_testmode_trace_dump(struct ieee80211_hw *hw, struct nlattr **tb,
idx = cb->args[4]; idx = cb->args[4];
if (idx >= priv->testmode_trace.num_chunks) if (idx >= priv->testmode_trace.num_chunks)
return -ENOENT; return -ENOENT;
length = TRACE_CHUNK_SIZE; length = DUMP_CHUNK_SIZE;
if (((idx + 1) == priv->testmode_trace.num_chunks) && if (((idx + 1) == priv->testmode_trace.num_chunks) &&
(priv->testmode_trace.buff_size % TRACE_CHUNK_SIZE)) (priv->testmode_trace.buff_size % DUMP_CHUNK_SIZE))
length = priv->testmode_trace.buff_size % length = priv->testmode_trace.buff_size %
TRACE_CHUNK_SIZE; DUMP_CHUNK_SIZE;
NLA_PUT(skb, IWL_TM_ATTR_TRACE_DUMP, length, NLA_PUT(skb, IWL_TM_ATTR_TRACE_DUMP, length,
priv->testmode_trace.trace_addr + priv->testmode_trace.trace_addr +
(TRACE_CHUNK_SIZE * idx)); (DUMP_CHUNK_SIZE * idx));
idx++; idx++;
cb->args[4] = idx; cb->args[4] = idx;
return 0; return 0;
...@@ -728,7 +728,7 @@ static int iwl_testmode_sram(struct ieee80211_hw *hw, struct nlattr **tb) ...@@ -728,7 +728,7 @@ static int iwl_testmode_sram(struct ieee80211_hw *hw, struct nlattr **tb)
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 =
DIV_ROUND_UP(priv->testmode_sram.buff_size, TRACE_CHUNK_SIZE); DIV_ROUND_UP(priv->testmode_sram.buff_size, DUMP_CHUNK_SIZE);
priv->testmode_sram.sram_readed = true; priv->testmode_sram.sram_readed = true;
return 0; return 0;
} }
...@@ -746,15 +746,15 @@ static int iwl_testmode_sram_dump(struct ieee80211_hw *hw, struct nlattr **tb, ...@@ -746,15 +746,15 @@ static int iwl_testmode_sram_dump(struct ieee80211_hw *hw, struct nlattr **tb,
iwl_sram_cleanup(priv); iwl_sram_cleanup(priv);
return -ENOENT; return -ENOENT;
} }
length = TRACE_CHUNK_SIZE; length = DUMP_CHUNK_SIZE;
if (((idx + 1) == priv->testmode_sram.num_chunks) && if (((idx + 1) == priv->testmode_sram.num_chunks) &&
(priv->testmode_sram.buff_size % TRACE_CHUNK_SIZE)) (priv->testmode_sram.buff_size % DUMP_CHUNK_SIZE))
length = priv->testmode_sram.buff_size % length = priv->testmode_sram.buff_size %
TRACE_CHUNK_SIZE; DUMP_CHUNK_SIZE;
NLA_PUT(skb, IWL_TM_ATTR_SRAM_DUMP, length, NLA_PUT(skb, IWL_TM_ATTR_SRAM_DUMP, length,
priv->testmode_sram.buff_addr + priv->testmode_sram.buff_addr +
(TRACE_CHUNK_SIZE * idx)); (DUMP_CHUNK_SIZE * idx));
idx++; idx++;
cb->args[4] = idx; cb->args[4] = idx;
return 0; return 0;
......
...@@ -250,6 +250,8 @@ enum iwl_tm_attr_t { ...@@ -250,6 +250,8 @@ enum iwl_tm_attr_t {
#define TRACE_BUFF_SIZE_MIN 0x20000 #define TRACE_BUFF_SIZE_MIN 0x20000
#define TRACE_BUFF_SIZE_DEF TRACE_BUFF_SIZE_MIN #define TRACE_BUFF_SIZE_DEF TRACE_BUFF_SIZE_MIN
#define TRACE_BUFF_PADD 0x2000 #define TRACE_BUFF_PADD 0x2000
#define TRACE_CHUNK_SIZE (PAGE_SIZE - 1024)
/* Maximum data size of each dump it packet */
#define DUMP_CHUNK_SIZE (PAGE_SIZE - 1024)
#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