diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-09-22 12:02:07 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-10-07 18:51:59 -0400 |
commit | 84fac3d9604147db37bd8c68897f79442d7ed714 (patch) | |
tree | d61837febecaec0677c4dc23fb91d628c79c88f1 | |
parent | fed732920bf9d96a95804a499ca586ff745540cd (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>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 61 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 63 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 1 |
4 files changed, 62 insertions, 64 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 | |||
2295 | static 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 | |||
2312 | int 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 | } | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h index 5458e63f803d..1fca5af35771 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn.h | |||
@@ -163,6 +163,7 @@ int iwlagn_wait_tx_queue_empty(struct iwl_priv *priv); | |||
163 | int iwlagn_txfifo_flush(struct iwl_priv *priv, u16 flush_control); | 163 | int iwlagn_txfifo_flush(struct iwl_priv *priv, u16 flush_control); |
164 | void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control); | 164 | void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control); |
165 | void iwl_dump_csr(struct iwl_priv *priv); | 165 | void iwl_dump_csr(struct iwl_priv *priv); |
166 | int iwl_dump_fh(struct iwl_priv *priv, char **buf, bool display); | ||
166 | 167 | ||
167 | /* rx */ | 168 | /* rx */ |
168 | void iwlagn_rx_queue_restock(struct iwl_priv *priv); | 169 | void iwlagn_rx_queue_restock(struct iwl_priv *priv); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index c0d531c669bf..5cd16a745bac 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -2351,69 +2351,6 @@ void iwl_update_stats(struct iwl_priv *priv, bool is_tx, __le16 fc, u16 len) | |||
2351 | EXPORT_SYMBOL(iwl_update_stats); | 2351 | EXPORT_SYMBOL(iwl_update_stats); |
2352 | #endif | 2352 | #endif |
2353 | 2353 | ||
2354 | static const char *get_fh_string(int cmd) | ||
2355 | { | ||
2356 | switch (cmd) { | ||
2357 | IWL_CMD(FH_RSCSR_CHNL0_STTS_WPTR_REG); | ||
2358 | IWL_CMD(FH_RSCSR_CHNL0_RBDCB_BASE_REG); | ||
2359 | IWL_CMD(FH_RSCSR_CHNL0_WPTR); | ||
2360 | IWL_CMD(FH_MEM_RCSR_CHNL0_CONFIG_REG); | ||
2361 | IWL_CMD(FH_MEM_RSSR_SHARED_CTRL_REG); | ||
2362 | IWL_CMD(FH_MEM_RSSR_RX_STATUS_REG); | ||
2363 | IWL_CMD(FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV); | ||
2364 | IWL_CMD(FH_TSSR_TX_STATUS_REG); | ||
2365 | IWL_CMD(FH_TSSR_TX_ERROR_REG); | ||
2366 | default: | ||
2367 | return "UNKNOWN"; | ||
2368 | |||
2369 | } | ||
2370 | } | ||
2371 | |||
2372 | int iwl_dump_fh(struct iwl_priv *priv, char **buf, bool display) | ||
2373 | { | ||
2374 | int i; | ||
2375 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
2376 | int pos = 0; | ||
2377 | size_t bufsz = 0; | ||
2378 | #endif | ||
2379 | u32 fh_tbl[] = { | ||
2380 | FH_RSCSR_CHNL0_STTS_WPTR_REG, | ||
2381 | FH_RSCSR_CHNL0_RBDCB_BASE_REG, | ||
2382 | FH_RSCSR_CHNL0_WPTR, | ||
2383 | FH_MEM_RCSR_CHNL0_CONFIG_REG, | ||
2384 | FH_MEM_RSSR_SHARED_CTRL_REG, | ||
2385 | FH_MEM_RSSR_RX_STATUS_REG, | ||
2386 | FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV, | ||
2387 | FH_TSSR_TX_STATUS_REG, | ||
2388 | FH_TSSR_TX_ERROR_REG | ||
2389 | }; | ||
2390 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
2391 | if (display) { | ||
2392 | bufsz = ARRAY_SIZE(fh_tbl) * 48 + 40; | ||
2393 | *buf = kmalloc(bufsz, GFP_KERNEL); | ||
2394 | if (!*buf) | ||
2395 | return -ENOMEM; | ||
2396 | pos += scnprintf(*buf + pos, bufsz - pos, | ||
2397 | "FH register values:\n"); | ||
2398 | for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) { | ||
2399 | pos += scnprintf(*buf + pos, bufsz - pos, | ||
2400 | " %34s: 0X%08x\n", | ||
2401 | get_fh_string(fh_tbl[i]), | ||
2402 | iwl_read_direct32(priv, fh_tbl[i])); | ||
2403 | } | ||
2404 | return pos; | ||
2405 | } | ||
2406 | #endif | ||
2407 | IWL_ERR(priv, "FH register values:\n"); | ||
2408 | for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) { | ||
2409 | IWL_ERR(priv, " %34s: 0X%08x\n", | ||
2410 | get_fh_string(fh_tbl[i]), | ||
2411 | iwl_read_direct32(priv, fh_tbl[i])); | ||
2412 | } | ||
2413 | return 0; | ||
2414 | } | ||
2415 | EXPORT_SYMBOL(iwl_dump_fh); | ||
2416 | |||
2417 | static void iwl_force_rf_reset(struct iwl_priv *priv) | 2354 | static void iwl_force_rf_reset(struct iwl_priv *priv) |
2418 | { | 2355 | { |
2419 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 2356 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 7e99b7dccb84..b02db31d7d5b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -659,7 +659,6 @@ int iwl_pci_resume(struct pci_dev *pdev); | |||
659 | void iwl_dump_nic_error_log(struct iwl_priv *priv); | 659 | void iwl_dump_nic_error_log(struct iwl_priv *priv); |
660 | int iwl_dump_nic_event_log(struct iwl_priv *priv, | 660 | int iwl_dump_nic_event_log(struct iwl_priv *priv, |
661 | bool full_log, char **buf, bool display); | 661 | bool full_log, char **buf, bool display); |
662 | int iwl_dump_fh(struct iwl_priv *priv, char **buf, bool display); | ||
663 | #ifdef CONFIG_IWLWIFI_DEBUG | 662 | #ifdef CONFIG_IWLWIFI_DEBUG |
664 | void iwl_print_rx_config_cmd(struct iwl_priv *priv, | 663 | void iwl_print_rx_config_cmd(struct iwl_priv *priv, |
665 | struct iwl_rxon_context *ctx); | 664 | struct iwl_rxon_context *ctx); |