aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-09-22 12:02:07 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-10-07 18:51:59 -0400
commit84fac3d9604147db37bd8c68897f79442d7ed714 (patch)
treed61837febecaec0677c4dc23fb91d628c79c88f1 /drivers/net/wireless/iwlwifi/iwl-agn-lib.c
parentfed732920bf9d96a95804a499ca586ff745540cd (diff)
iwlwifi: move iwl_dump_fh to agn
The iwl_dump_fh function is only used by the agn module, so it can be there instead of being exported by the core. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-lib.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index de91ff6dcd6c..ff5f2fc4d6d9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -2291,3 +2291,64 @@ void iwl_dump_csr(struct iwl_priv *priv)
2291 iwl_read32(priv, csr_tbl[i])); 2291 iwl_read32(priv, csr_tbl[i]));
2292 } 2292 }
2293} 2293}
2294
2295static const char *get_fh_string(int cmd)
2296{
2297 switch (cmd) {
2298 IWL_CMD(FH_RSCSR_CHNL0_STTS_WPTR_REG);
2299 IWL_CMD(FH_RSCSR_CHNL0_RBDCB_BASE_REG);
2300 IWL_CMD(FH_RSCSR_CHNL0_WPTR);
2301 IWL_CMD(FH_MEM_RCSR_CHNL0_CONFIG_REG);
2302 IWL_CMD(FH_MEM_RSSR_SHARED_CTRL_REG);
2303 IWL_CMD(FH_MEM_RSSR_RX_STATUS_REG);
2304 IWL_CMD(FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV);
2305 IWL_CMD(FH_TSSR_TX_STATUS_REG);
2306 IWL_CMD(FH_TSSR_TX_ERROR_REG);
2307 default:
2308 return "UNKNOWN";
2309 }
2310}
2311
2312int iwl_dump_fh(struct iwl_priv *priv, char **buf, bool display)
2313{
2314 int i;
2315#ifdef CONFIG_IWLWIFI_DEBUG
2316 int pos = 0;
2317 size_t bufsz = 0;
2318#endif
2319 u32 fh_tbl[] = {
2320 FH_RSCSR_CHNL0_STTS_WPTR_REG,
2321 FH_RSCSR_CHNL0_RBDCB_BASE_REG,
2322 FH_RSCSR_CHNL0_WPTR,
2323 FH_MEM_RCSR_CHNL0_CONFIG_REG,
2324 FH_MEM_RSSR_SHARED_CTRL_REG,
2325 FH_MEM_RSSR_RX_STATUS_REG,
2326 FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV,
2327 FH_TSSR_TX_STATUS_REG,
2328 FH_TSSR_TX_ERROR_REG
2329 };
2330#ifdef CONFIG_IWLWIFI_DEBUG
2331 if (display) {
2332 bufsz = ARRAY_SIZE(fh_tbl) * 48 + 40;
2333 *buf = kmalloc(bufsz, GFP_KERNEL);
2334 if (!*buf)
2335 return -ENOMEM;
2336 pos += scnprintf(*buf + pos, bufsz - pos,
2337 "FH register values:\n");
2338 for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) {
2339 pos += scnprintf(*buf + pos, bufsz - pos,
2340 " %34s: 0X%08x\n",
2341 get_fh_string(fh_tbl[i]),
2342 iwl_read_direct32(priv, fh_tbl[i]));
2343 }
2344 return pos;
2345 }
2346#endif
2347 IWL_ERR(priv, "FH register values:\n");
2348 for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) {
2349 IWL_ERR(priv, " %34s: 0X%08x\n",
2350 get_fh_string(fh_tbl[i]),
2351 iwl_read_direct32(priv, fh_tbl[i]));
2352 }
2353 return 0;
2354}