Lines Matching full:ar

26 void ath10k_info(struct ath10k *ar, const char *fmt, ...)  in ath10k_info()  argument
35 dev_info(ar->dev, "%pV", &vaf); in ath10k_info()
36 trace_ath10k_log_info(ar, &vaf); in ath10k_info()
41 void ath10k_debug_print_hwfw_info(struct ath10k *ar) in ath10k_debug_print_hwfw_info() argument
47 ath10k_core_get_fw_features_str(ar, fw_features, sizeof(fw_features)); in ath10k_debug_print_hwfw_info()
49 ath10k_info(ar, "%s target 0x%08x chip_id 0x%08x sub %04x:%04x", in ath10k_debug_print_hwfw_info()
50 ar->hw_params.name, in ath10k_debug_print_hwfw_info()
51 ar->target_version, in ath10k_debug_print_hwfw_info()
52 ar->bus_param.chip_id, in ath10k_debug_print_hwfw_info()
53 ar->id.subsystem_vendor, ar->id.subsystem_device); in ath10k_debug_print_hwfw_info()
55 ath10k_info(ar, "kconfig debug %d debugfs %d tracing %d dfs %d testmode %d\n", in ath10k_debug_print_hwfw_info()
62 firmware = ar->normal_mode_fw.fw_file.firmware; in ath10k_debug_print_hwfw_info()
66 ath10k_info(ar, "firmware ver %s api %d features %s crc32 %08x\n", in ath10k_debug_print_hwfw_info()
67 ar->hw->wiphy->fw_version, in ath10k_debug_print_hwfw_info()
68 ar->fw_api, in ath10k_debug_print_hwfw_info()
73 void ath10k_debug_print_board_info(struct ath10k *ar) in ath10k_debug_print_board_info() argument
79 if (ar->id.bmi_ids_valid) in ath10k_debug_print_board_info()
81 ar->id.bmi_chip_id, ar->id.bmi_board_id); in ath10k_debug_print_board_info()
85 board = ar->normal_mode_fw.board; in ath10k_debug_print_board_info()
91 ath10k_info(ar, "board_file api %d bmi_id %s crc32 %08x", in ath10k_debug_print_board_info()
92 ar->bd_api, in ath10k_debug_print_board_info()
97 void ath10k_debug_print_boot_info(struct ath10k *ar) in ath10k_debug_print_boot_info() argument
99 ath10k_info(ar, "htt-ver %d.%d wmi-op %d htt-op %d cal %s max-sta %d raw %d hwcrypto %d\n", in ath10k_debug_print_boot_info()
100 ar->htt.target_version_major, in ath10k_debug_print_boot_info()
101 ar->htt.target_version_minor, in ath10k_debug_print_boot_info()
102 ar->normal_mode_fw.fw_file.wmi_op_version, in ath10k_debug_print_boot_info()
103 ar->normal_mode_fw.fw_file.htt_op_version, in ath10k_debug_print_boot_info()
104 ath10k_cal_mode_str(ar->cal_mode), in ath10k_debug_print_boot_info()
105 ar->max_num_stations, in ath10k_debug_print_boot_info()
106 test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags), in ath10k_debug_print_boot_info()
107 !test_bit(ATH10K_FLAG_HW_CRYPTO_DISABLED, &ar->dev_flags)); in ath10k_debug_print_boot_info()
110 void ath10k_print_driver_info(struct ath10k *ar) in ath10k_print_driver_info() argument
112 ath10k_debug_print_hwfw_info(ar); in ath10k_print_driver_info()
113 ath10k_debug_print_board_info(ar); in ath10k_print_driver_info()
114 ath10k_debug_print_boot_info(ar); in ath10k_print_driver_info()
118 void ath10k_err(struct ath10k *ar, const char *fmt, ...) in ath10k_err() argument
127 dev_err(ar->dev, "%pV", &vaf); in ath10k_err()
128 trace_ath10k_log_err(ar, &vaf); in ath10k_err()
133 void ath10k_warn(struct ath10k *ar, const char *fmt, ...) in ath10k_warn() argument
142 dev_warn_ratelimited(ar->dev, "%pV", &vaf); in ath10k_warn()
143 trace_ath10k_log_warn(ar, &vaf); in ath10k_warn()
155 struct ath10k *ar = file->private_data; in ath10k_read_wmi_services() local
167 mutex_lock(&ar->conf_mutex); in ath10k_read_wmi_services()
169 spin_lock_bh(&ar->data_lock); in ath10k_read_wmi_services()
171 enabled = test_bit(i, ar->wmi.svc_map); in ath10k_read_wmi_services()
187 spin_unlock_bh(&ar->data_lock); in ath10k_read_wmi_services()
191 mutex_unlock(&ar->conf_mutex); in ath10k_read_wmi_services()
244 static void ath10k_debug_fw_stats_reset(struct ath10k *ar) in ath10k_debug_fw_stats_reset() argument
246 spin_lock_bh(&ar->data_lock); in ath10k_debug_fw_stats_reset()
247 ar->debug.fw_stats_done = false; in ath10k_debug_fw_stats_reset()
248 ar->debug.fw_stats.extended = false; in ath10k_debug_fw_stats_reset()
249 ath10k_fw_stats_pdevs_free(&ar->debug.fw_stats.pdevs); in ath10k_debug_fw_stats_reset()
250 ath10k_fw_stats_vdevs_free(&ar->debug.fw_stats.vdevs); in ath10k_debug_fw_stats_reset()
251 ath10k_fw_stats_peers_free(&ar->debug.fw_stats.peers); in ath10k_debug_fw_stats_reset()
252 ath10k_fw_extd_stats_peers_free(&ar->debug.fw_stats.peers_extd); in ath10k_debug_fw_stats_reset()
253 spin_unlock_bh(&ar->data_lock); in ath10k_debug_fw_stats_reset()
256 void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb) in ath10k_debug_fw_stats_process() argument
269 spin_lock_bh(&ar->data_lock); in ath10k_debug_fw_stats_process()
270 ret = ath10k_wmi_pull_fw_stats(ar, skb, &stats); in ath10k_debug_fw_stats_process()
272 ath10k_warn(ar, "failed to pull fw stats: %d\n", ret); in ath10k_debug_fw_stats_process()
287 if (ath10k_peer_stats_enabled(ar)) in ath10k_debug_fw_stats_process()
288 ath10k_sta_update_rx_duration(ar, &stats); in ath10k_debug_fw_stats_process()
290 if (ar->debug.fw_stats_done) { in ath10k_debug_fw_stats_process()
291 if (!ath10k_peer_stats_enabled(ar)) in ath10k_debug_fw_stats_process()
292 ath10k_warn(ar, "received unsolicited stats update event\n"); in ath10k_debug_fw_stats_process()
297 num_peers = list_count_nodes(&ar->debug.fw_stats.peers); in ath10k_debug_fw_stats_process()
298 num_vdevs = list_count_nodes(&ar->debug.fw_stats.vdevs); in ath10k_debug_fw_stats_process()
299 is_start = (list_empty(&ar->debug.fw_stats.pdevs) && in ath10k_debug_fw_stats_process()
301 is_end = (!list_empty(&ar->debug.fw_stats.pdevs) && in ath10k_debug_fw_stats_process()
305 list_splice_tail_init(&stats.pdevs, &ar->debug.fw_stats.pdevs); in ath10k_debug_fw_stats_process()
308 ar->debug.fw_stats_done = true; in ath10k_debug_fw_stats_process()
311 ar->debug.fw_stats.extended = true; in ath10k_debug_fw_stats_process()
313 is_started = !list_empty(&ar->debug.fw_stats.pdevs); in ath10k_debug_fw_stats_process()
320 ath10k_fw_stats_peers_free(&ar->debug.fw_stats.peers); in ath10k_debug_fw_stats_process()
321 ath10k_fw_extd_stats_peers_free(&ar->debug.fw_stats.peers_extd); in ath10k_debug_fw_stats_process()
322 ath10k_warn(ar, "dropping fw peer stats\n"); in ath10k_debug_fw_stats_process()
327 ath10k_fw_stats_vdevs_free(&ar->debug.fw_stats.vdevs); in ath10k_debug_fw_stats_process()
328 ath10k_warn(ar, "dropping fw vdev stats\n"); in ath10k_debug_fw_stats_process()
334 &ar->debug.fw_stats.peers_extd); in ath10k_debug_fw_stats_process()
336 list_splice_tail_init(&stats.peers, &ar->debug.fw_stats.peers); in ath10k_debug_fw_stats_process()
337 list_splice_tail_init(&stats.vdevs, &ar->debug.fw_stats.vdevs); in ath10k_debug_fw_stats_process()
340 complete(&ar->debug.fw_stats_complete); in ath10k_debug_fw_stats_process()
351 spin_unlock_bh(&ar->data_lock); in ath10k_debug_fw_stats_process()
354 int ath10k_debug_fw_stats_request(struct ath10k *ar) in ath10k_debug_fw_stats_request() argument
359 lockdep_assert_held(&ar->conf_mutex); in ath10k_debug_fw_stats_request()
363 ath10k_debug_fw_stats_reset(ar); in ath10k_debug_fw_stats_request()
369 reinit_completion(&ar->debug.fw_stats_complete); in ath10k_debug_fw_stats_request()
371 ret = ath10k_wmi_request_stats(ar, ar->fw_stats_req_mask); in ath10k_debug_fw_stats_request()
373 ath10k_warn(ar, "could not request stats (%d)\n", ret); in ath10k_debug_fw_stats_request()
378 wait_for_completion_timeout(&ar->debug.fw_stats_complete, in ath10k_debug_fw_stats_request()
383 spin_lock_bh(&ar->data_lock); in ath10k_debug_fw_stats_request()
384 if (ar->debug.fw_stats_done) { in ath10k_debug_fw_stats_request()
385 spin_unlock_bh(&ar->data_lock); in ath10k_debug_fw_stats_request()
388 spin_unlock_bh(&ar->data_lock); in ath10k_debug_fw_stats_request()
396 struct ath10k *ar = inode->i_private; in ath10k_fw_stats_open() local
400 mutex_lock(&ar->conf_mutex); in ath10k_fw_stats_open()
402 if (ar->state != ATH10K_STATE_ON) { in ath10k_fw_stats_open()
413 ret = ath10k_debug_fw_stats_request(ar); in ath10k_fw_stats_open()
415 ath10k_warn(ar, "failed to request fw stats: %d\n", ret); in ath10k_fw_stats_open()
419 ret = ath10k_wmi_fw_stats_fill(ar, &ar->debug.fw_stats, buf); in ath10k_fw_stats_open()
421 ath10k_warn(ar, "failed to fill fw stats: %d\n", ret); in ath10k_fw_stats_open()
427 mutex_unlock(&ar->conf_mutex); in ath10k_fw_stats_open()
434 mutex_unlock(&ar->conf_mutex); in ath10k_fw_stats_open()
466 struct ath10k *ar = file->private_data; in ath10k_debug_fw_reset_stats_read() local
475 spin_lock_bh(&ar->data_lock); in ath10k_debug_fw_reset_stats_read()
478 "fw_crash_counter\t\t%d\n", ar->stats.fw_crash_counter); in ath10k_debug_fw_reset_stats_read()
481 ar->stats.fw_warm_reset_counter); in ath10k_debug_fw_reset_stats_read()
484 ar->stats.fw_cold_reset_counter); in ath10k_debug_fw_reset_stats_read()
486 spin_unlock_bh(&ar->data_lock); in ath10k_debug_fw_reset_stats_read()
503 static int ath10k_debug_fw_assert(struct ath10k *ar) in ath10k_debug_fw_assert() argument
508 skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd) + 16); in ath10k_debug_fw_assert()
518 return ath10k_wmi_cmd_send(ar, skb, in ath10k_debug_fw_assert()
519 ar->wmi.cmd->vdev_install_key_cmdid); in ath10k_debug_fw_assert()
547 struct ath10k *ar = file->private_data; in ath10k_write_simulate_fw_crash() local
564 mutex_lock(&ar->conf_mutex); in ath10k_write_simulate_fw_crash()
566 if (ar->state != ATH10K_STATE_ON && in ath10k_write_simulate_fw_crash()
567 ar->state != ATH10K_STATE_RESTARTED) { in ath10k_write_simulate_fw_crash()
573 ath10k_info(ar, "simulating soft firmware crash\n"); in ath10k_write_simulate_fw_crash()
574 ret = ath10k_wmi_force_fw_hang(ar, WMI_FORCE_FW_HANG_ASSERT, 0); in ath10k_write_simulate_fw_crash()
576 ath10k_info(ar, "simulating hard firmware crash\n"); in ath10k_write_simulate_fw_crash()
580 ret = ath10k_wmi_vdev_set_param(ar, 0x7fff, in ath10k_write_simulate_fw_crash()
581 ar->wmi.vdev_param->rts_threshold, in ath10k_write_simulate_fw_crash()
584 ath10k_info(ar, "simulating firmware assert crash\n"); in ath10k_write_simulate_fw_crash()
585 ret = ath10k_debug_fw_assert(ar); in ath10k_write_simulate_fw_crash()
587 ath10k_info(ar, "user requested hw restart\n"); in ath10k_write_simulate_fw_crash()
588 ath10k_core_start_recovery(ar); in ath10k_write_simulate_fw_crash()
596 ath10k_warn(ar, "failed to simulate firmware crash: %d\n", ret); in ath10k_write_simulate_fw_crash()
603 mutex_unlock(&ar->conf_mutex); in ath10k_write_simulate_fw_crash()
618 struct ath10k *ar = file->private_data; in ath10k_read_chip_id() local
622 len = scnprintf(buf, sizeof(buf), "0x%08x\n", ar->bus_param.chip_id); in ath10k_read_chip_id()
638 struct ath10k *ar = file->private_data; in ath10k_reg_addr_read() local
643 mutex_lock(&ar->conf_mutex); in ath10k_reg_addr_read()
644 reg_addr = ar->debug.reg_addr; in ath10k_reg_addr_read()
645 mutex_unlock(&ar->conf_mutex); in ath10k_reg_addr_read()
656 struct ath10k *ar = file->private_data; in ath10k_reg_addr_write() local
667 mutex_lock(&ar->conf_mutex); in ath10k_reg_addr_write()
668 ar->debug.reg_addr = reg_addr; in ath10k_reg_addr_write()
669 mutex_unlock(&ar->conf_mutex); in ath10k_reg_addr_write()
686 struct ath10k *ar = file->private_data; in ath10k_reg_value_read() local
692 mutex_lock(&ar->conf_mutex); in ath10k_reg_value_read()
694 if (ar->state != ATH10K_STATE_ON && in ath10k_reg_value_read()
695 ar->state != ATH10K_STATE_UTF) { in ath10k_reg_value_read()
700 reg_addr = ar->debug.reg_addr; in ath10k_reg_value_read()
702 reg_val = ath10k_hif_read32(ar, reg_addr); in ath10k_reg_value_read()
708 mutex_unlock(&ar->conf_mutex); in ath10k_reg_value_read()
717 struct ath10k *ar = file->private_data; in ath10k_reg_value_write() local
721 mutex_lock(&ar->conf_mutex); in ath10k_reg_value_write()
723 if (ar->state != ATH10K_STATE_ON && in ath10k_reg_value_write()
724 ar->state != ATH10K_STATE_UTF) { in ath10k_reg_value_write()
729 reg_addr = ar->debug.reg_addr; in ath10k_reg_value_write()
735 ath10k_hif_write32(ar, reg_addr, reg_val); in ath10k_reg_value_write()
740 mutex_unlock(&ar->conf_mutex); in ath10k_reg_value_write()
757 struct ath10k *ar = file->private_data; in ath10k_mem_value_read() local
767 mutex_lock(&ar->conf_mutex); in ath10k_mem_value_read()
775 if (ar->state != ATH10K_STATE_ON && in ath10k_mem_value_read()
776 ar->state != ATH10K_STATE_UTF) { in ath10k_mem_value_read()
781 ret = ath10k_hif_diag_read(ar, *ppos, buf, count); in ath10k_mem_value_read()
783 ath10k_warn(ar, "failed to read address 0x%08x via diagnose window from debugfs: %d\n", in ath10k_mem_value_read()
800 mutex_unlock(&ar->conf_mutex); in ath10k_mem_value_read()
809 struct ath10k *ar = file->private_data; in ath10k_mem_value_write() local
819 mutex_lock(&ar->conf_mutex); in ath10k_mem_value_write()
827 if (ar->state != ATH10K_STATE_ON && in ath10k_mem_value_write()
828 ar->state != ATH10K_STATE_UTF) { in ath10k_mem_value_write()
839 ret = ath10k_hif_diag_write(ar, *ppos, buf, count); in ath10k_mem_value_write()
841 ath10k_warn(ar, "failed to write address 0x%08x via diagnose window from debugfs: %d\n", in ath10k_mem_value_write()
851 mutex_unlock(&ar->conf_mutex); in ath10k_mem_value_write()
864 static int ath10k_debug_htt_stats_req(struct ath10k *ar) in ath10k_debug_htt_stats_req() argument
869 lockdep_assert_held(&ar->conf_mutex); in ath10k_debug_htt_stats_req()
871 if (ar->debug.htt_stats_mask == 0) in ath10k_debug_htt_stats_req()
875 if (ar->state != ATH10K_STATE_ON) in ath10k_debug_htt_stats_req()
880 ret = ath10k_htt_h2t_stats_req(&ar->htt, ar->debug.htt_stats_mask, in ath10k_debug_htt_stats_req()
881 ar->debug.reset_htt_stats, cookie); in ath10k_debug_htt_stats_req()
883 ath10k_warn(ar, "failed to send htt stats request: %d\n", ret); in ath10k_debug_htt_stats_req()
887 queue_delayed_work(ar->workqueue, &ar->debug.htt_stats_dwork, in ath10k_debug_htt_stats_req()
895 struct ath10k *ar = container_of(work, struct ath10k, in ath10k_debug_htt_stats_dwork() local
898 mutex_lock(&ar->conf_mutex); in ath10k_debug_htt_stats_dwork()
900 ath10k_debug_htt_stats_req(ar); in ath10k_debug_htt_stats_dwork()
902 mutex_unlock(&ar->conf_mutex); in ath10k_debug_htt_stats_dwork()
909 struct ath10k *ar = file->private_data; in ath10k_read_htt_stats_mask() local
913 len = scnprintf(buf, sizeof(buf), "%lu\n", ar->debug.htt_stats_mask); in ath10k_read_htt_stats_mask()
922 struct ath10k *ar = file->private_data; in ath10k_write_htt_stats_mask() local
934 mutex_lock(&ar->conf_mutex); in ath10k_write_htt_stats_mask()
936 ar->debug.htt_stats_mask = mask; in ath10k_write_htt_stats_mask()
938 ret = ath10k_debug_htt_stats_req(ar); in ath10k_write_htt_stats_mask()
945 mutex_unlock(&ar->conf_mutex); in ath10k_write_htt_stats_mask()
962 struct ath10k *ar = file->private_data; in ath10k_read_htt_max_amsdu_ampdu() local
967 mutex_lock(&ar->conf_mutex); in ath10k_read_htt_max_amsdu_ampdu()
969 amsdu = ar->htt.max_num_amsdu; in ath10k_read_htt_max_amsdu_ampdu()
970 ampdu = ar->htt.max_num_ampdu; in ath10k_read_htt_max_amsdu_ampdu()
971 mutex_unlock(&ar->conf_mutex); in ath10k_read_htt_max_amsdu_ampdu()
982 struct ath10k *ar = file->private_data; in ath10k_write_htt_max_amsdu_ampdu() local
997 mutex_lock(&ar->conf_mutex); in ath10k_write_htt_max_amsdu_ampdu()
999 res = ath10k_htt_h2t_aggr_cfg_msg(&ar->htt, ampdu, amsdu); in ath10k_write_htt_max_amsdu_ampdu()
1004 ar->htt.max_num_amsdu = amsdu; in ath10k_write_htt_max_amsdu_ampdu()
1005 ar->htt.max_num_ampdu = ampdu; in ath10k_write_htt_max_amsdu_ampdu()
1008 mutex_unlock(&ar->conf_mutex); in ath10k_write_htt_max_amsdu_ampdu()
1024 struct ath10k *ar = file->private_data; in ath10k_read_fw_dbglog() local
1029 ar->debug.fw_dbglog_mask, ar->debug.fw_dbglog_level); in ath10k_read_fw_dbglog()
1038 struct ath10k *ar = file->private_data; in ath10k_write_fw_dbglog() local
1058 mutex_lock(&ar->conf_mutex); in ath10k_write_fw_dbglog()
1060 ar->debug.fw_dbglog_mask = mask; in ath10k_write_fw_dbglog()
1061 ar->debug.fw_dbglog_level = log_level; in ath10k_write_fw_dbglog()
1063 if (ar->state == ATH10K_STATE_ON) { in ath10k_write_fw_dbglog()
1064 ret = ath10k_wmi_dbglog_cfg(ar, ar->debug.fw_dbglog_mask, in ath10k_write_fw_dbglog()
1065 ar->debug.fw_dbglog_level); in ath10k_write_fw_dbglog()
1067 ath10k_warn(ar, "dbglog cfg failed from debugfs: %d\n", in ath10k_write_fw_dbglog()
1076 mutex_unlock(&ar->conf_mutex); in ath10k_write_fw_dbglog()
1161 struct ath10k *ar = hw->priv; in ath10k_debug_get_et_stats() local
1166 mutex_lock(&ar->conf_mutex); in ath10k_debug_get_et_stats()
1168 if (ar->state == ATH10K_STATE_ON) { in ath10k_debug_get_et_stats()
1169 ret = ath10k_debug_fw_stats_request(ar); in ath10k_debug_get_et_stats()
1172 ath10k_warn(ar, in ath10k_debug_get_et_stats()
1178 pdev_stats = list_first_entry_or_null(&ar->debug.fw_stats.pdevs, in ath10k_debug_get_et_stats()
1186 spin_lock_bh(&ar->data_lock); in ath10k_debug_get_et_stats()
1199 data[i++] = ar->stats.rx_crc_err_drop; in ath10k_debug_get_et_stats()
1232 data[i++] = ar->stats.fw_crash_counter; in ath10k_debug_get_et_stats()
1233 data[i++] = ar->stats.fw_warm_reset_counter; in ath10k_debug_get_et_stats()
1234 data[i++] = ar->stats.fw_cold_reset_counter; in ath10k_debug_get_et_stats()
1236 spin_unlock_bh(&ar->data_lock); in ath10k_debug_get_et_stats()
1238 mutex_unlock(&ar->conf_mutex); in ath10k_debug_get_et_stats()
1251 static int ath10k_debug_cal_data_fetch(struct ath10k *ar) in ath10k_debug_cal_data_fetch() argument
1257 lockdep_assert_held(&ar->conf_mutex); in ath10k_debug_cal_data_fetch()
1259 if (WARN_ON(ar->hw_params.cal_data_len > ATH10K_DEBUG_CAL_DATA_LEN)) in ath10k_debug_cal_data_fetch()
1262 if (ar->hw_params.cal_data_len == 0) in ath10k_debug_cal_data_fetch()
1267 ret = ath10k_hif_diag_read(ar, hi_addr, &addr, sizeof(addr)); in ath10k_debug_cal_data_fetch()
1269 ath10k_warn(ar, "failed to read hi_board_data address: %d\n", in ath10k_debug_cal_data_fetch()
1274 ret = ath10k_hif_diag_read(ar, le32_to_cpu(addr), ar->debug.cal_data, in ath10k_debug_cal_data_fetch()
1275 ar->hw_params.cal_data_len); in ath10k_debug_cal_data_fetch()
1277 ath10k_warn(ar, "failed to read calibration data: %d\n", ret); in ath10k_debug_cal_data_fetch()
1286 struct ath10k *ar = inode->i_private; in ath10k_debug_cal_data_open() local
1288 mutex_lock(&ar->conf_mutex); in ath10k_debug_cal_data_open()
1290 if (ar->state == ATH10K_STATE_ON || in ath10k_debug_cal_data_open()
1291 ar->state == ATH10K_STATE_UTF) { in ath10k_debug_cal_data_open()
1292 ath10k_debug_cal_data_fetch(ar); in ath10k_debug_cal_data_open()
1295 file->private_data = ar; in ath10k_debug_cal_data_open()
1296 mutex_unlock(&ar->conf_mutex); in ath10k_debug_cal_data_open()
1305 struct ath10k *ar = file->private_data; in ath10k_debug_cal_data_read() local
1307 mutex_lock(&ar->conf_mutex); in ath10k_debug_cal_data_read()
1310 ar->debug.cal_data, in ath10k_debug_cal_data_read()
1311 ar->hw_params.cal_data_len); in ath10k_debug_cal_data_read()
1313 mutex_unlock(&ar->conf_mutex); in ath10k_debug_cal_data_read()
1322 struct ath10k *ar = file->private_data; in ath10k_write_ani_enable() local
1329 mutex_lock(&ar->conf_mutex); in ath10k_write_ani_enable()
1331 if (ar->ani_enabled == enable) { in ath10k_write_ani_enable()
1336 ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->ani_enable, in ath10k_write_ani_enable()
1339 ath10k_warn(ar, "ani_enable failed from debugfs: %d\n", ret); in ath10k_write_ani_enable()
1342 ar->ani_enabled = enable; in ath10k_write_ani_enable()
1347 mutex_unlock(&ar->conf_mutex); in ath10k_write_ani_enable()
1355 struct ath10k *ar = file->private_data; in ath10k_read_ani_enable() local
1359 len = scnprintf(buf, sizeof(buf), "%d\n", ar->ani_enabled); in ath10k_read_ani_enable()
1383 struct ath10k *ar = file->private_data; in ath10k_read_nf_cal_period() local
1387 len = scnprintf(buf, sizeof(buf), "%d\n", ar->debug.nf_cal_period); in ath10k_read_nf_cal_period()
1396 struct ath10k *ar = file->private_data; in ath10k_write_nf_cal_period() local
1411 mutex_lock(&ar->conf_mutex); in ath10k_write_nf_cal_period()
1413 ar->debug.nf_cal_period = period; in ath10k_write_nf_cal_period()
1415 if (ar->state != ATH10K_STATE_ON) { in ath10k_write_nf_cal_period()
1421 ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->cal_period, in ath10k_write_nf_cal_period()
1422 ar->debug.nf_cal_period); in ath10k_write_nf_cal_period()
1424 ath10k_warn(ar, "cal period cfg failed from debugfs: %d\n", in ath10k_write_nf_cal_period()
1432 mutex_unlock(&ar->conf_mutex); in ath10k_write_nf_cal_period()
1447 static int ath10k_debug_tpc_stats_request(struct ath10k *ar) in ath10k_debug_tpc_stats_request() argument
1452 lockdep_assert_held(&ar->conf_mutex); in ath10k_debug_tpc_stats_request()
1454 reinit_completion(&ar->debug.tpc_complete); in ath10k_debug_tpc_stats_request()
1456 ret = ath10k_wmi_pdev_get_tpc_config(ar, WMI_TPC_CONFIG_PARAM); in ath10k_debug_tpc_stats_request()
1458 ath10k_warn(ar, "failed to request tpc config: %d\n", ret); in ath10k_debug_tpc_stats_request()
1462 time_left = wait_for_completion_timeout(&ar->debug.tpc_complete, in ath10k_debug_tpc_stats_request()
1470 void ath10k_debug_tpc_stats_process(struct ath10k *ar, in ath10k_debug_tpc_stats_process() argument
1473 spin_lock_bh(&ar->data_lock); in ath10k_debug_tpc_stats_process()
1475 kfree(ar->debug.tpc_stats); in ath10k_debug_tpc_stats_process()
1476 ar->debug.tpc_stats = tpc_stats; in ath10k_debug_tpc_stats_process()
1477 complete(&ar->debug.tpc_complete); in ath10k_debug_tpc_stats_process()
1479 spin_unlock_bh(&ar->data_lock); in ath10k_debug_tpc_stats_process()
1483 ath10k_debug_tpc_stats_final_process(struct ath10k *ar, in ath10k_debug_tpc_stats_final_process() argument
1486 spin_lock_bh(&ar->data_lock); in ath10k_debug_tpc_stats_final_process()
1488 kfree(ar->debug.tpc_stats_final); in ath10k_debug_tpc_stats_final_process()
1489 ar->debug.tpc_stats_final = tpc_stats; in ath10k_debug_tpc_stats_final_process()
1490 complete(&ar->debug.tpc_complete); in ath10k_debug_tpc_stats_final_process()
1492 spin_unlock_bh(&ar->data_lock); in ath10k_debug_tpc_stats_final_process()
1541 static void ath10k_tpc_stats_fill(struct ath10k *ar, in ath10k_tpc_stats_fill() argument
1551 spin_lock_bh(&ar->data_lock); in ath10k_tpc_stats_fill()
1554 ath10k_warn(ar, "failed to get tpc stats\n"); in ath10k_tpc_stats_fill()
1621 spin_unlock_bh(&ar->data_lock); in ath10k_tpc_stats_fill()
1631 struct ath10k *ar = inode->i_private; in ath10k_tpc_stats_open() local
1635 mutex_lock(&ar->conf_mutex); in ath10k_tpc_stats_open()
1637 if (ar->state != ATH10K_STATE_ON) { in ath10k_tpc_stats_open()
1648 ret = ath10k_debug_tpc_stats_request(ar); in ath10k_tpc_stats_open()
1650 ath10k_warn(ar, "failed to request tpc config stats: %d\n", in ath10k_tpc_stats_open()
1655 ath10k_tpc_stats_fill(ar, ar->debug.tpc_stats, buf); in ath10k_tpc_stats_open()
1658 mutex_unlock(&ar->conf_mutex); in ath10k_tpc_stats_open()
1665 mutex_unlock(&ar->conf_mutex); in ath10k_tpc_stats_open()
1693 int ath10k_debug_start(struct ath10k *ar) in ath10k_debug_start() argument
1697 lockdep_assert_held(&ar->conf_mutex); in ath10k_debug_start()
1699 ret = ath10k_debug_htt_stats_req(ar); in ath10k_debug_start()
1702 ath10k_warn(ar, "failed to start htt stats workqueue: %d\n", in ath10k_debug_start()
1705 if (ar->debug.fw_dbglog_mask) { in ath10k_debug_start()
1706 ret = ath10k_wmi_dbglog_cfg(ar, ar->debug.fw_dbglog_mask, in ath10k_debug_start()
1710 ath10k_warn(ar, "failed to enable dbglog during start: %d", in ath10k_debug_start()
1714 if (ar->pktlog_filter) { in ath10k_debug_start()
1715 ret = ath10k_wmi_pdev_pktlog_enable(ar, in ath10k_debug_start()
1716 ar->pktlog_filter); in ath10k_debug_start()
1719 ath10k_warn(ar, in ath10k_debug_start()
1721 ar->pktlog_filter, ret); in ath10k_debug_start()
1723 ret = ath10k_wmi_pdev_pktlog_disable(ar); in ath10k_debug_start()
1726 ath10k_warn(ar, "failed to disable pktlog: %d\n", ret); in ath10k_debug_start()
1729 if (ar->debug.nf_cal_period && in ath10k_debug_start()
1731 ar->normal_mode_fw.fw_file.fw_features)) { in ath10k_debug_start()
1732 ret = ath10k_wmi_pdev_set_param(ar, in ath10k_debug_start()
1733 ar->wmi.pdev_param->cal_period, in ath10k_debug_start()
1734 ar->debug.nf_cal_period); in ath10k_debug_start()
1737 ath10k_warn(ar, "cal period cfg failed from debug start: %d\n", in ath10k_debug_start()
1744 void ath10k_debug_stop(struct ath10k *ar) in ath10k_debug_stop() argument
1746 lockdep_assert_held(&ar->conf_mutex); in ath10k_debug_stop()
1749 ar->normal_mode_fw.fw_file.fw_features)) in ath10k_debug_stop()
1750 ath10k_debug_cal_data_fetch(ar); in ath10k_debug_stop()
1756 if (ar->debug.htt_stats_mask != 0) in ath10k_debug_stop()
1757 cancel_delayed_work(&ar->debug.htt_stats_dwork); in ath10k_debug_stop()
1759 ath10k_wmi_pdev_pktlog_disable(ar); in ath10k_debug_stop()
1766 struct ath10k *ar = file->private_data; in ath10k_write_simulate_radar() local
1773 arvif = list_first_entry(&ar->arvifs, typeof(*arvif), list); in ath10k_write_simulate_radar()
1777 ieee80211_radar_detected(ar->hw); in ath10k_write_simulate_radar()
1791 ar->debug.dfs_stats.p))
1795 ar->debug.dfs_pool_stats.p))
1802 struct ath10k *ar = file->private_data; in ath10k_read_dfs_stats() local
1809 if (!ar->dfs_detector) { in ath10k_read_dfs_stats()
1814 ar->debug.dfs_pool_stats = in ath10k_read_dfs_stats()
1815 ar->dfs_detector->get_stats(ar->dfs_detector); in ath10k_read_dfs_stats()
1855 struct ath10k *ar = file->private_data; in ath10k_write_pktlog_filter() local
1862 mutex_lock(&ar->conf_mutex); in ath10k_write_pktlog_filter()
1864 if (ar->state != ATH10K_STATE_ON) { in ath10k_write_pktlog_filter()
1865 ar->pktlog_filter = filter; in ath10k_write_pktlog_filter()
1870 if (filter == ar->pktlog_filter) { in ath10k_write_pktlog_filter()
1876 ret = ath10k_wmi_pdev_pktlog_enable(ar, filter); in ath10k_write_pktlog_filter()
1878 ath10k_warn(ar, "failed to enable pktlog filter %x: %d\n", in ath10k_write_pktlog_filter()
1879 ar->pktlog_filter, ret); in ath10k_write_pktlog_filter()
1883 ret = ath10k_wmi_pdev_pktlog_disable(ar); in ath10k_write_pktlog_filter()
1885 ath10k_warn(ar, "failed to disable pktlog: %d\n", ret); in ath10k_write_pktlog_filter()
1890 ar->pktlog_filter = filter; in ath10k_write_pktlog_filter()
1894 mutex_unlock(&ar->conf_mutex); in ath10k_write_pktlog_filter()
1902 struct ath10k *ar = file->private_data; in ath10k_read_pktlog_filter() local
1905 mutex_lock(&ar->conf_mutex); in ath10k_read_pktlog_filter()
1907 ar->pktlog_filter); in ath10k_read_pktlog_filter()
1908 mutex_unlock(&ar->conf_mutex); in ath10k_read_pktlog_filter()
1923 struct ath10k *ar = file->private_data; in ath10k_write_quiet_period() local
1930 ath10k_warn(ar, "Quiet period %u can not be lesser than 25ms\n", in ath10k_write_quiet_period()
1934 mutex_lock(&ar->conf_mutex); in ath10k_write_quiet_period()
1935 ar->thermal.quiet_period = period; in ath10k_write_quiet_period()
1936 ath10k_thermal_set_throttling(ar); in ath10k_write_quiet_period()
1937 mutex_unlock(&ar->conf_mutex); in ath10k_write_quiet_period()
1946 struct ath10k *ar = file->private_data; in ath10k_read_quiet_period() local
1949 mutex_lock(&ar->conf_mutex); in ath10k_read_quiet_period()
1951 ar->thermal.quiet_period); in ath10k_read_quiet_period()
1952 mutex_unlock(&ar->conf_mutex); in ath10k_read_quiet_period()
1967 struct ath10k *ar = file->private_data; in ath10k_write_btcoex() local
1983 if (!ar->coex_support) in ath10k_write_btcoex()
1986 mutex_lock(&ar->conf_mutex); in ath10k_write_btcoex()
1988 if (ar->state != ATH10K_STATE_ON && in ath10k_write_btcoex()
1989 ar->state != ATH10K_STATE_RESTARTED) { in ath10k_write_btcoex()
1994 if (!(test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags) ^ val)) { in ath10k_write_btcoex()
1999 pdev_param = ar->wmi.pdev_param->enable_btcoex; in ath10k_write_btcoex()
2001 ar->running_fw->fw_file.fw_features)) { in ath10k_write_btcoex()
2002 ret = ath10k_wmi_pdev_set_param(ar, pdev_param, val); in ath10k_write_btcoex()
2004 ath10k_warn(ar, "failed to enable btcoex: %d\n", ret); in ath10k_write_btcoex()
2009 ath10k_info(ar, "restarting firmware due to btcoex change"); in ath10k_write_btcoex()
2010 ath10k_core_start_recovery(ar); in ath10k_write_btcoex()
2014 set_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags); in ath10k_write_btcoex()
2016 clear_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags); in ath10k_write_btcoex()
2021 mutex_unlock(&ar->conf_mutex); in ath10k_write_btcoex()
2030 struct ath10k *ar = file->private_data; in ath10k_read_btcoex() local
2033 mutex_lock(&ar->conf_mutex); in ath10k_read_btcoex()
2035 test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags)); in ath10k_read_btcoex()
2036 mutex_unlock(&ar->conf_mutex); in ath10k_read_btcoex()
2051 struct ath10k *ar = file->private_data; in ath10k_write_enable_extd_tx_stats() local
2058 mutex_lock(&ar->conf_mutex); in ath10k_write_enable_extd_tx_stats()
2060 if (ar->state != ATH10K_STATE_ON) { in ath10k_write_enable_extd_tx_stats()
2061 ar->debug.enable_extd_tx_stats = filter; in ath10k_write_enable_extd_tx_stats()
2066 if (filter == ar->debug.enable_extd_tx_stats) { in ath10k_write_enable_extd_tx_stats()
2071 ar->debug.enable_extd_tx_stats = filter; in ath10k_write_enable_extd_tx_stats()
2075 mutex_unlock(&ar->conf_mutex); in ath10k_write_enable_extd_tx_stats()
2085 struct ath10k *ar = file->private_data; in ath10k_read_enable_extd_tx_stats() local
2088 mutex_lock(&ar->conf_mutex); in ath10k_read_enable_extd_tx_stats()
2090 ar->debug.enable_extd_tx_stats); in ath10k_read_enable_extd_tx_stats()
2091 mutex_unlock(&ar->conf_mutex); in ath10k_read_enable_extd_tx_stats()
2106 struct ath10k *ar = file->private_data; in ath10k_write_peer_stats() local
2121 mutex_lock(&ar->conf_mutex); in ath10k_write_peer_stats()
2123 if (ar->state != ATH10K_STATE_ON && in ath10k_write_peer_stats()
2124 ar->state != ATH10K_STATE_RESTARTED) { in ath10k_write_peer_stats()
2129 if (!(test_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags) ^ val)) { in ath10k_write_peer_stats()
2135 set_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags); in ath10k_write_peer_stats()
2137 clear_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags); in ath10k_write_peer_stats()
2139 ath10k_info(ar, "restarting firmware due to Peer stats change"); in ath10k_write_peer_stats()
2141 ath10k_core_start_recovery(ar); in ath10k_write_peer_stats()
2145 mutex_unlock(&ar->conf_mutex); in ath10k_write_peer_stats()
2154 struct ath10k *ar = file->private_data; in ath10k_read_peer_stats() local
2157 mutex_lock(&ar->conf_mutex); in ath10k_read_peer_stats()
2159 test_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags)); in ath10k_read_peer_stats()
2160 mutex_unlock(&ar->conf_mutex); in ath10k_read_peer_stats()
2175 struct ath10k *ar = file->private_data; in ath10k_debug_fw_checksums_read() local
2184 mutex_lock(&ar->conf_mutex); in ath10k_debug_fw_checksums_read()
2188 crc32_le(0, ar->normal_mode_fw.fw_file.firmware->data, in ath10k_debug_fw_checksums_read()
2189 ar->normal_mode_fw.fw_file.firmware->size)); in ath10k_debug_fw_checksums_read()
2192 crc32_le(0, ar->normal_mode_fw.fw_file.firmware_data, in ath10k_debug_fw_checksums_read()
2193 ar->normal_mode_fw.fw_file.firmware_len)); in ath10k_debug_fw_checksums_read()
2196 crc32_le(0, ar->normal_mode_fw.fw_file.otp_data, in ath10k_debug_fw_checksums_read()
2197 ar->normal_mode_fw.fw_file.otp_len)); in ath10k_debug_fw_checksums_read()
2200 crc32_le(0, ar->normal_mode_fw.fw_file.codeswap_data, in ath10k_debug_fw_checksums_read()
2201 ar->normal_mode_fw.fw_file.codeswap_len)); in ath10k_debug_fw_checksums_read()
2204 crc32_le(0, ar->normal_mode_fw.board->data, in ath10k_debug_fw_checksums_read()
2205 ar->normal_mode_fw.board->size)); in ath10k_debug_fw_checksums_read()
2208 crc32_le(0, ar->normal_mode_fw.board_data, in ath10k_debug_fw_checksums_read()
2209 ar->normal_mode_fw.board_len)); in ath10k_debug_fw_checksums_read()
2213 mutex_unlock(&ar->conf_mutex); in ath10k_debug_fw_checksums_read()
2230 struct ath10k *ar = file->private_data; in ath10k_sta_tid_stats_mask_read() local
2234 len = scnprintf(buf, sizeof(buf), "0x%08x\n", ar->sta_tid_stats_mask); in ath10k_sta_tid_stats_mask_read()
2242 struct ath10k *ar = file->private_data; in ath10k_sta_tid_stats_mask_write() local
2255 ar->sta_tid_stats_mask = mask; in ath10k_sta_tid_stats_mask_write()
2268 static int ath10k_debug_tpc_stats_final_request(struct ath10k *ar) in ath10k_debug_tpc_stats_final_request() argument
2273 lockdep_assert_held(&ar->conf_mutex); in ath10k_debug_tpc_stats_final_request()
2275 reinit_completion(&ar->debug.tpc_complete); in ath10k_debug_tpc_stats_final_request()
2277 ret = ath10k_wmi_pdev_get_tpc_table_cmdid(ar, WMI_TPC_CONFIG_PARAM); in ath10k_debug_tpc_stats_final_request()
2279 ath10k_warn(ar, "failed to request tpc table cmdid: %d\n", ret); in ath10k_debug_tpc_stats_final_request()
2283 time_left = wait_for_completion_timeout(&ar->debug.tpc_complete, in ath10k_debug_tpc_stats_final_request()
2293 struct ath10k *ar = inode->i_private; in ath10k_tpc_stats_final_open() local
2297 mutex_lock(&ar->conf_mutex); in ath10k_tpc_stats_final_open()
2299 if (ar->state != ATH10K_STATE_ON) { in ath10k_tpc_stats_final_open()
2310 ret = ath10k_debug_tpc_stats_final_request(ar); in ath10k_tpc_stats_final_open()
2312 ath10k_warn(ar, "failed to request tpc stats final: %d\n", in ath10k_tpc_stats_final_open()
2317 ath10k_tpc_stats_fill(ar, ar->debug.tpc_stats, buf); in ath10k_tpc_stats_final_open()
2320 mutex_unlock(&ar->conf_mutex); in ath10k_tpc_stats_final_open()
2327 mutex_unlock(&ar->conf_mutex); in ath10k_tpc_stats_final_open()
2361 struct ath10k *ar = file->private_data; in ath10k_write_warm_hw_reset() local
2371 mutex_lock(&ar->conf_mutex); in ath10k_write_warm_hw_reset()
2373 if (ar->state != ATH10K_STATE_ON) { in ath10k_write_warm_hw_reset()
2378 ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->pdev_reset, in ath10k_write_warm_hw_reset()
2382 ath10k_warn(ar, "failed to enable warm hw reset: %d\n", ret); in ath10k_write_warm_hw_reset()
2389 mutex_unlock(&ar->conf_mutex); in ath10k_write_warm_hw_reset()
2403 struct ath10k *ar = data; in ath10k_peer_ps_state_disable() local
2406 spin_lock_bh(&ar->data_lock); in ath10k_peer_ps_state_disable()
2408 spin_unlock_bh(&ar->data_lock); in ath10k_peer_ps_state_disable()
2415 struct ath10k *ar = file->private_data; in ath10k_write_ps_state_enable() local
2426 mutex_lock(&ar->conf_mutex); in ath10k_write_ps_state_enable()
2428 if (ar->ps_state_enable == ps_state_enable) { in ath10k_write_ps_state_enable()
2433 param = ar->wmi.pdev_param->peer_sta_ps_statechg_enable; in ath10k_write_ps_state_enable()
2434 ret = ath10k_wmi_pdev_set_param(ar, param, ps_state_enable); in ath10k_write_ps_state_enable()
2436 ath10k_warn(ar, "failed to enable ps_state_enable: %d\n", in ath10k_write_ps_state_enable()
2440 ar->ps_state_enable = ps_state_enable; in ath10k_write_ps_state_enable()
2442 if (!ar->ps_state_enable) in ath10k_write_ps_state_enable()
2443 ieee80211_iterate_stations_atomic(ar->hw, in ath10k_write_ps_state_enable()
2445 ar); in ath10k_write_ps_state_enable()
2450 mutex_unlock(&ar->conf_mutex); in ath10k_write_ps_state_enable()
2459 struct ath10k *ar = file->private_data; in ath10k_read_ps_state_enable() local
2463 mutex_lock(&ar->conf_mutex); in ath10k_read_ps_state_enable()
2465 ar->ps_state_enable); in ath10k_read_ps_state_enable()
2466 mutex_unlock(&ar->conf_mutex); in ath10k_read_ps_state_enable()
2483 struct ath10k *ar = file->private_data; in ath10k_write_reset_htt_stats() local
2494 mutex_lock(&ar->conf_mutex); in ath10k_write_reset_htt_stats()
2496 ar->debug.reset_htt_stats = reset; in ath10k_write_reset_htt_stats()
2498 ret = ath10k_debug_htt_stats_req(ar); in ath10k_write_reset_htt_stats()
2502 ar->debug.reset_htt_stats = 0; in ath10k_write_reset_htt_stats()
2506 mutex_unlock(&ar->conf_mutex); in ath10k_write_reset_htt_stats()
2517 int ath10k_debug_create(struct ath10k *ar) in ath10k_debug_create() argument
2519 ar->debug.cal_data = vzalloc(ATH10K_DEBUG_CAL_DATA_LEN); in ath10k_debug_create()
2520 if (!ar->debug.cal_data) in ath10k_debug_create()
2523 INIT_LIST_HEAD(&ar->debug.fw_stats.pdevs); in ath10k_debug_create()
2524 INIT_LIST_HEAD(&ar->debug.fw_stats.vdevs); in ath10k_debug_create()
2525 INIT_LIST_HEAD(&ar->debug.fw_stats.peers); in ath10k_debug_create()
2526 INIT_LIST_HEAD(&ar->debug.fw_stats.peers_extd); in ath10k_debug_create()
2531 void ath10k_debug_destroy(struct ath10k *ar) in ath10k_debug_destroy() argument
2533 vfree(ar->debug.cal_data); in ath10k_debug_destroy()
2534 ar->debug.cal_data = NULL; in ath10k_debug_destroy()
2536 ath10k_debug_fw_stats_reset(ar); in ath10k_debug_destroy()
2538 kfree(ar->debug.tpc_stats); in ath10k_debug_destroy()
2539 kfree(ar->debug.tpc_stats_final); in ath10k_debug_destroy()
2542 int ath10k_debug_register(struct ath10k *ar) in ath10k_debug_register() argument
2544 ar->debug.debugfs_phy = debugfs_create_dir("ath10k", in ath10k_debug_register()
2545 ar->hw->wiphy->debugfsdir); in ath10k_debug_register()
2546 if (IS_ERR_OR_NULL(ar->debug.debugfs_phy)) { in ath10k_debug_register()
2547 if (IS_ERR(ar->debug.debugfs_phy)) in ath10k_debug_register()
2548 return PTR_ERR(ar->debug.debugfs_phy); in ath10k_debug_register()
2553 INIT_DELAYED_WORK(&ar->debug.htt_stats_dwork, in ath10k_debug_register()
2556 init_completion(&ar->debug.tpc_complete); in ath10k_debug_register()
2557 init_completion(&ar->debug.fw_stats_complete); in ath10k_debug_register()
2559 debugfs_create_file("fw_stats", 0400, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2562 debugfs_create_file("fw_reset_stats", 0400, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2565 debugfs_create_file("wmi_services", 0400, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2568 debugfs_create_file("simulate_fw_crash", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2571 debugfs_create_file("reg_addr", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2574 debugfs_create_file("reg_value", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2577 debugfs_create_file("mem_value", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2580 debugfs_create_file("chip_id", 0400, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2583 debugfs_create_file("htt_stats_mask", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2586 debugfs_create_file("htt_max_amsdu_ampdu", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2589 debugfs_create_file("fw_dbglog", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2593 ar->normal_mode_fw.fw_file.fw_features)) { in ath10k_debug_register()
2594 debugfs_create_file("cal_data", 0400, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2597 debugfs_create_file("nf_cal_period", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2601 debugfs_create_file("ani_enable", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2605 debugfs_create_file("dfs_simulate_radar", 0200, ar->debug.debugfs_phy, in ath10k_debug_register()
2606 ar, &fops_simulate_radar); in ath10k_debug_register()
2609 ar->debug.debugfs_phy, in ath10k_debug_register()
2610 &ar->dfs_block_radar_events); in ath10k_debug_register()
2612 debugfs_create_file("dfs_stats", 0400, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2616 debugfs_create_file("pktlog_filter", 0644, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2619 if (test_bit(WMI_SERVICE_THERM_THROT, ar->wmi.svc_map)) in ath10k_debug_register()
2620 debugfs_create_file("quiet_period", 0644, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2623 debugfs_create_file("tpc_stats", 0400, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2626 if (test_bit(WMI_SERVICE_COEX_GPIO, ar->wmi.svc_map)) in ath10k_debug_register()
2627 debugfs_create_file("btcoex", 0644, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2630 if (test_bit(WMI_SERVICE_PEER_STATS, ar->wmi.svc_map)) { in ath10k_debug_register()
2631 debugfs_create_file("peer_stats", 0644, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2635 ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2639 debugfs_create_file("fw_checksums", 0400, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2644 ar->debug.debugfs_phy, in ath10k_debug_register()
2645 ar, &fops_sta_tid_stats_mask); in ath10k_debug_register()
2647 if (test_bit(WMI_SERVICE_TPC_STATS_FINAL, ar->wmi.svc_map)) in ath10k_debug_register()
2649 ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2652 if (test_bit(WMI_SERVICE_RESET_CHIP, ar->wmi.svc_map)) in ath10k_debug_register()
2654 ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2657 debugfs_create_file("ps_state_enable", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2660 debugfs_create_file("reset_htt_stats", 0200, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2666 void ath10k_debug_unregister(struct ath10k *ar) in ath10k_debug_unregister() argument
2668 cancel_delayed_work_sync(&ar->debug.htt_stats_dwork); in ath10k_debug_unregister()
2674 void __ath10k_dbg(struct ath10k *ar, enum ath10k_debug_mask mask, in __ath10k_dbg() argument
2686 dev_printk(KERN_DEBUG, ar->dev, "%pV", &vaf); in __ath10k_dbg()
2688 trace_ath10k_log_dbg(ar, mask, &vaf); in __ath10k_dbg()
2694 void ath10k_dbg_dump(struct ath10k *ar, in ath10k_dbg_dump() argument
2705 __ath10k_dbg(ar, mask, "%s\n", msg); in ath10k_dbg_dump()
2717 dev_printk(KERN_DEBUG, ar->dev, "%s\n", linebuf); in ath10k_dbg_dump()
2722 trace_ath10k_log_dbg_dump(ar, msg ? msg : "", prefix ? prefix : "", in ath10k_dbg_dump()