aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHsu, Kenny <kenny.hsu@intel.com>2011-12-02 11:48:28 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-12-06 16:06:54 -0500
commita2f759fc41579205ad86ef17efe57e730a1af9e6 (patch)
tree5f693aad5512c26710d6ecb21194cb9d74a77d6b
parent835df183011db2342b42d06e17c708854ab6defb (diff)
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: Kenny Hsu <kenny.hsu@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sv-open.c20
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-testmode.h4
2 files changed, 13 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-sv-open.c b/drivers/net/wireless/iwlwifi/iwl-sv-open.c
index a8d0ef649a7c..4ea64d65b35b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sv-open.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sv-open.c
@@ -575,7 +575,7 @@ static int iwl_testmode_trace(struct ieee80211_hw *hw, struct nlattr **tb)
575 } 575 }
576 priv->testmode_trace.num_chunks = 576 priv->testmode_trace.num_chunks =
577 DIV_ROUND_UP(priv->testmode_trace.buff_size, 577 DIV_ROUND_UP(priv->testmode_trace.buff_size,
578 TRACE_CHUNK_SIZE); 578 DUMP_CHUNK_SIZE);
579 break; 579 break;
580 580
581 case IWL_TM_CMD_APP2DEV_END_TRACE: 581 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 idx = cb->args[4]; 607 idx = cb->args[4];
608 if (idx >= priv->testmode_trace.num_chunks) 608 if (idx >= priv->testmode_trace.num_chunks)
609 return -ENOENT; 609 return -ENOENT;
610 length = TRACE_CHUNK_SIZE; 610 length = DUMP_CHUNK_SIZE;
611 if (((idx + 1) == priv->testmode_trace.num_chunks) && 611 if (((idx + 1) == priv->testmode_trace.num_chunks) &&
612 (priv->testmode_trace.buff_size % TRACE_CHUNK_SIZE)) 612 (priv->testmode_trace.buff_size % DUMP_CHUNK_SIZE))
613 length = priv->testmode_trace.buff_size % 613 length = priv->testmode_trace.buff_size %
614 TRACE_CHUNK_SIZE; 614 DUMP_CHUNK_SIZE;
615 615
616 NLA_PUT(skb, IWL_TM_ATTR_TRACE_DUMP, length, 616 NLA_PUT(skb, IWL_TM_ATTR_TRACE_DUMP, length,
617 priv->testmode_trace.trace_addr + 617 priv->testmode_trace.trace_addr +
618 (TRACE_CHUNK_SIZE * idx)); 618 (DUMP_CHUNK_SIZE * idx));
619 idx++; 619 idx++;
620 cb->args[4] = idx; 620 cb->args[4] = idx;
621 return 0; 621 return 0;
@@ -728,7 +728,7 @@ static int iwl_testmode_sram(struct ieee80211_hw *hw, struct nlattr **tb)
728 priv->testmode_sram.buff_addr, 728 priv->testmode_sram.buff_addr,
729 priv->testmode_sram.buff_size / 4); 729 priv->testmode_sram.buff_size / 4);
730 priv->testmode_sram.num_chunks = 730 priv->testmode_sram.num_chunks =
731 DIV_ROUND_UP(priv->testmode_sram.buff_size, TRACE_CHUNK_SIZE); 731 DIV_ROUND_UP(priv->testmode_sram.buff_size, DUMP_CHUNK_SIZE);
732 priv->testmode_sram.sram_readed = true; 732 priv->testmode_sram.sram_readed = true;
733 return 0; 733 return 0;
734} 734}
@@ -746,15 +746,15 @@ static int iwl_testmode_sram_dump(struct ieee80211_hw *hw, struct nlattr **tb,
746 iwl_sram_cleanup(priv); 746 iwl_sram_cleanup(priv);
747 return -ENOENT; 747 return -ENOENT;
748 } 748 }
749 length = TRACE_CHUNK_SIZE; 749 length = DUMP_CHUNK_SIZE;
750 if (((idx + 1) == priv->testmode_sram.num_chunks) && 750 if (((idx + 1) == priv->testmode_sram.num_chunks) &&
751 (priv->testmode_sram.buff_size % TRACE_CHUNK_SIZE)) 751 (priv->testmode_sram.buff_size % DUMP_CHUNK_SIZE))
752 length = priv->testmode_sram.buff_size % 752 length = priv->testmode_sram.buff_size %
753 TRACE_CHUNK_SIZE; 753 DUMP_CHUNK_SIZE;
754 754
755 NLA_PUT(skb, IWL_TM_ATTR_SRAM_DUMP, length, 755 NLA_PUT(skb, IWL_TM_ATTR_SRAM_DUMP, length,
756 priv->testmode_sram.buff_addr + 756 priv->testmode_sram.buff_addr +
757 (TRACE_CHUNK_SIZE * idx)); 757 (DUMP_CHUNK_SIZE * idx));
758 idx++; 758 idx++;
759 cb->args[4] = idx; 759 cb->args[4] = idx;
760 return 0; 760 return 0;
diff --git a/drivers/net/wireless/iwlwifi/iwl-testmode.h b/drivers/net/wireless/iwlwifi/iwl-testmode.h
index 95c87058677b..e20f3d390271 100644
--- a/drivers/net/wireless/iwlwifi/iwl-testmode.h
+++ b/drivers/net/wireless/iwlwifi/iwl-testmode.h
@@ -250,6 +250,8 @@ enum iwl_tm_attr_t {
250#define TRACE_BUFF_SIZE_MIN 0x20000 250#define TRACE_BUFF_SIZE_MIN 0x20000
251#define TRACE_BUFF_SIZE_DEF TRACE_BUFF_SIZE_MIN 251#define TRACE_BUFF_SIZE_DEF TRACE_BUFF_SIZE_MIN
252#define TRACE_BUFF_PADD 0x2000 252#define TRACE_BUFF_PADD 0x2000
253#define TRACE_CHUNK_SIZE (PAGE_SIZE - 1024) 253
254/* Maximum data size of each dump it packet */
255#define DUMP_CHUNK_SIZE (PAGE_SIZE - 1024)
254 256
255#endif 257#endif