Lines Matching refs:ar
31 void ath10k_info(struct ath10k *ar, const char *fmt, ...) in ath10k_info() argument
41 dev_info(ar->dev, "%pV", &vaf); in ath10k_info()
46 dev_printk(KERN_DEBUG, ar->dev, "%s", str); in ath10k_info()
50 trace_ath10k_log_info(ar, &vaf); in ath10k_info()
55 void ath10k_debug_print_hwfw_info(struct ath10k *ar) in ath10k_debug_print_hwfw_info() argument
61 ath10k_core_get_fw_features_str(ar, fw_features, sizeof(fw_features)); in ath10k_debug_print_hwfw_info()
64 ath10k_info(ar, "%s target 0x%08x chip_id 0x%08x sub %04x:%04x", in ath10k_debug_print_hwfw_info()
66 ath10k_info(ar, "%s target 0x%08x chip_id 0x%08x sub %04x:%04x\n", in ath10k_debug_print_hwfw_info()
68 ar->hw_params.name, in ath10k_debug_print_hwfw_info()
69 ar->target_version, in ath10k_debug_print_hwfw_info()
70 ar->bus_param.chip_id, in ath10k_debug_print_hwfw_info()
71 ar->id.subsystem_vendor, ar->id.subsystem_device); in ath10k_debug_print_hwfw_info()
73 ath10k_info(ar, "kconfig debug %d debugfs %d tracing %d dfs %d testmode %d\n", in ath10k_debug_print_hwfw_info()
80 firmware = ar->normal_mode_fw.fw_file.firmware; in ath10k_debug_print_hwfw_info()
84 ath10k_info(ar, "firmware ver %s api %d features %s crc32 %08x\n", in ath10k_debug_print_hwfw_info()
85 ar->hw->wiphy->fw_version, in ath10k_debug_print_hwfw_info()
86 ar->fw_api, in ath10k_debug_print_hwfw_info()
91 void ath10k_debug_print_board_info(struct ath10k *ar) in ath10k_debug_print_board_info() argument
97 if (ar->id.bmi_ids_valid) in ath10k_debug_print_board_info()
99 ar->id.bmi_chip_id, ar->id.bmi_board_id); in ath10k_debug_print_board_info()
103 board = ar->normal_mode_fw.board; in ath10k_debug_print_board_info()
110 ath10k_info(ar, "board_file api %d bmi_id %s crc32 %08x", in ath10k_debug_print_board_info()
112 ath10k_info(ar, "board_file api %d bmi_id %s crc32 %08x\n", in ath10k_debug_print_board_info()
114 ar->bd_api, in ath10k_debug_print_board_info()
119 void ath10k_debug_print_boot_info(struct ath10k *ar) in ath10k_debug_print_boot_info() argument
121 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()
122 ar->htt.target_version_major, in ath10k_debug_print_boot_info()
123 ar->htt.target_version_minor, in ath10k_debug_print_boot_info()
124 ar->normal_mode_fw.fw_file.wmi_op_version, in ath10k_debug_print_boot_info()
125 ar->normal_mode_fw.fw_file.htt_op_version, in ath10k_debug_print_boot_info()
126 ath10k_cal_mode_str(ar->cal_mode), in ath10k_debug_print_boot_info()
127 ar->max_num_stations, in ath10k_debug_print_boot_info()
128 test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags), in ath10k_debug_print_boot_info()
129 !test_bit(ATH10K_FLAG_HW_CRYPTO_DISABLED, &ar->dev_flags)); in ath10k_debug_print_boot_info()
132 void ath10k_print_driver_info(struct ath10k *ar) in ath10k_print_driver_info() argument
134 ath10k_debug_print_hwfw_info(ar); in ath10k_print_driver_info()
135 ath10k_debug_print_board_info(ar); in ath10k_print_driver_info()
136 ath10k_debug_print_boot_info(ar); in ath10k_print_driver_info()
140 void ath10k_err(struct ath10k *ar, const char *fmt, ...) in ath10k_err() argument
150 dev_err(ar->dev, "%pV", &vaf); in ath10k_err()
155 dev_err(ar->dev, "%s", str); in ath10k_err()
159 trace_ath10k_log_err(ar, &vaf); in ath10k_err()
164 void ath10k_warn(struct ath10k *ar, const char *fmt, ...) in ath10k_warn() argument
174 dev_warn_ratelimited(ar->dev, "%pV", &vaf); in ath10k_warn()
179 dev_warn_ratelimited(ar->dev, "%s", str); in ath10k_warn()
183 trace_ath10k_log_warn(ar, &vaf); in ath10k_warn()
195 struct ath10k *ar = file->private_data; in ath10k_read_wmi_services() local
207 mutex_lock(&ar->conf_mutex); in ath10k_read_wmi_services()
209 spin_lock_bh(&ar->data_lock); in ath10k_read_wmi_services()
211 enabled = test_bit(i, ar->wmi.svc_map); in ath10k_read_wmi_services()
227 spin_unlock_bh(&ar->data_lock); in ath10k_read_wmi_services()
231 mutex_unlock(&ar->conf_mutex); in ath10k_read_wmi_services()
284 static void ath10k_debug_fw_stats_reset(struct ath10k *ar) in ath10k_debug_fw_stats_reset() argument
286 spin_lock_bh(&ar->data_lock); in ath10k_debug_fw_stats_reset()
287 ar->debug.fw_stats_done = false; in ath10k_debug_fw_stats_reset()
288 ar->debug.fw_stats.extended = false; in ath10k_debug_fw_stats_reset()
289 ath10k_fw_stats_pdevs_free(&ar->debug.fw_stats.pdevs); in ath10k_debug_fw_stats_reset()
290 ath10k_fw_stats_vdevs_free(&ar->debug.fw_stats.vdevs); in ath10k_debug_fw_stats_reset()
291 ath10k_fw_stats_peers_free(&ar->debug.fw_stats.peers); in ath10k_debug_fw_stats_reset()
292 ath10k_fw_extd_stats_peers_free(&ar->debug.fw_stats.peers_extd); in ath10k_debug_fw_stats_reset()
293 spin_unlock_bh(&ar->data_lock); in ath10k_debug_fw_stats_reset()
296 void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb) in ath10k_debug_fw_stats_process() argument
309 spin_lock_bh(&ar->data_lock); in ath10k_debug_fw_stats_process()
310 ret = ath10k_wmi_pull_fw_stats(ar, skb, &stats); in ath10k_debug_fw_stats_process()
312 ath10k_warn(ar, "failed to pull fw stats: %d\n", ret); in ath10k_debug_fw_stats_process()
327 if (ath10k_peer_stats_enabled(ar)) in ath10k_debug_fw_stats_process()
328 ath10k_sta_update_rx_duration(ar, &stats); in ath10k_debug_fw_stats_process()
330 if (ar->debug.fw_stats_done) { in ath10k_debug_fw_stats_process()
331 if (!ath10k_peer_stats_enabled(ar)) in ath10k_debug_fw_stats_process()
332 ath10k_warn(ar, "received unsolicited stats update event\n"); in ath10k_debug_fw_stats_process()
337 num_peers = list_count_nodes(&ar->debug.fw_stats.peers); in ath10k_debug_fw_stats_process()
338 num_vdevs = list_count_nodes(&ar->debug.fw_stats.vdevs); in ath10k_debug_fw_stats_process()
339 is_start = (list_empty(&ar->debug.fw_stats.pdevs) && in ath10k_debug_fw_stats_process()
341 is_end = (!list_empty(&ar->debug.fw_stats.pdevs) && in ath10k_debug_fw_stats_process()
345 list_splice_tail_init(&stats.pdevs, &ar->debug.fw_stats.pdevs); in ath10k_debug_fw_stats_process()
348 ar->debug.fw_stats_done = true; in ath10k_debug_fw_stats_process()
351 ar->debug.fw_stats.extended = true; in ath10k_debug_fw_stats_process()
353 is_started = !list_empty(&ar->debug.fw_stats.pdevs); in ath10k_debug_fw_stats_process()
360 ath10k_fw_stats_peers_free(&ar->debug.fw_stats.peers); in ath10k_debug_fw_stats_process()
361 ath10k_fw_extd_stats_peers_free(&ar->debug.fw_stats.peers_extd); in ath10k_debug_fw_stats_process()
362 ath10k_warn(ar, "dropping fw peer stats\n"); in ath10k_debug_fw_stats_process()
367 ath10k_fw_stats_vdevs_free(&ar->debug.fw_stats.vdevs); in ath10k_debug_fw_stats_process()
368 ath10k_warn(ar, "dropping fw vdev stats\n"); in ath10k_debug_fw_stats_process()
374 &ar->debug.fw_stats.peers_extd); in ath10k_debug_fw_stats_process()
376 list_splice_tail_init(&stats.peers, &ar->debug.fw_stats.peers); in ath10k_debug_fw_stats_process()
377 list_splice_tail_init(&stats.vdevs, &ar->debug.fw_stats.vdevs); in ath10k_debug_fw_stats_process()
380 complete(&ar->debug.fw_stats_complete); in ath10k_debug_fw_stats_process()
391 spin_unlock_bh(&ar->data_lock); in ath10k_debug_fw_stats_process()
394 int ath10k_debug_fw_stats_request(struct ath10k *ar) in ath10k_debug_fw_stats_request() argument
399 lockdep_assert_held(&ar->conf_mutex); in ath10k_debug_fw_stats_request()
403 ath10k_debug_fw_stats_reset(ar); in ath10k_debug_fw_stats_request()
409 reinit_completion(&ar->debug.fw_stats_complete); in ath10k_debug_fw_stats_request()
411 ret = ath10k_wmi_request_stats(ar, ar->fw_stats_req_mask); in ath10k_debug_fw_stats_request()
413 ath10k_warn(ar, "could not request stats (%d)\n", ret); in ath10k_debug_fw_stats_request()
418 wait_for_completion_timeout(&ar->debug.fw_stats_complete, in ath10k_debug_fw_stats_request()
423 spin_lock_bh(&ar->data_lock); in ath10k_debug_fw_stats_request()
424 if (ar->debug.fw_stats_done) { in ath10k_debug_fw_stats_request()
425 spin_unlock_bh(&ar->data_lock); in ath10k_debug_fw_stats_request()
428 spin_unlock_bh(&ar->data_lock); in ath10k_debug_fw_stats_request()
436 struct ath10k *ar = inode->i_private; in ath10k_fw_stats_open() local
440 mutex_lock(&ar->conf_mutex); in ath10k_fw_stats_open()
442 if (ar->state != ATH10K_STATE_ON) { in ath10k_fw_stats_open()
453 ret = ath10k_debug_fw_stats_request(ar); in ath10k_fw_stats_open()
455 ath10k_warn(ar, "failed to request fw stats: %d\n", ret); in ath10k_fw_stats_open()
459 ret = ath10k_wmi_fw_stats_fill(ar, &ar->debug.fw_stats, buf); in ath10k_fw_stats_open()
461 ath10k_warn(ar, "failed to fill fw stats: %d\n", ret); in ath10k_fw_stats_open()
467 mutex_unlock(&ar->conf_mutex); in ath10k_fw_stats_open()
474 mutex_unlock(&ar->conf_mutex); in ath10k_fw_stats_open()
506 struct ath10k *ar = file->private_data; in ath10k_debug_fw_reset_stats_read() local
515 spin_lock_bh(&ar->data_lock); in ath10k_debug_fw_reset_stats_read()
518 "fw_crash_counter\t\t%d\n", ar->stats.fw_crash_counter); in ath10k_debug_fw_reset_stats_read()
521 ar->stats.fw_warm_reset_counter); in ath10k_debug_fw_reset_stats_read()
524 ar->stats.fw_cold_reset_counter); in ath10k_debug_fw_reset_stats_read()
526 spin_unlock_bh(&ar->data_lock); in ath10k_debug_fw_reset_stats_read()
543 static int ath10k_debug_fw_assert(struct ath10k *ar) in ath10k_debug_fw_assert() argument
548 skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd) + 16); in ath10k_debug_fw_assert()
558 return ath10k_wmi_cmd_send(ar, skb, in ath10k_debug_fw_assert()
559 ar->wmi.cmd->vdev_install_key_cmdid); in ath10k_debug_fw_assert()
587 struct ath10k *ar = file->private_data; in ath10k_write_simulate_fw_crash() local
604 mutex_lock(&ar->conf_mutex); in ath10k_write_simulate_fw_crash()
606 if (ar->state != ATH10K_STATE_ON && in ath10k_write_simulate_fw_crash()
607 ar->state != ATH10K_STATE_RESTARTED) { in ath10k_write_simulate_fw_crash()
613 ath10k_info(ar, "simulating soft firmware crash\n"); in ath10k_write_simulate_fw_crash()
614 ret = ath10k_wmi_force_fw_hang(ar, WMI_FORCE_FW_HANG_ASSERT, 0); in ath10k_write_simulate_fw_crash()
616 ath10k_info(ar, "simulating hard firmware crash\n"); in ath10k_write_simulate_fw_crash()
620 ret = ath10k_wmi_vdev_set_param(ar, 0x7fff, in ath10k_write_simulate_fw_crash()
621 ar->wmi.vdev_param->rts_threshold, in ath10k_write_simulate_fw_crash()
624 ath10k_info(ar, "simulating firmware assert crash\n"); in ath10k_write_simulate_fw_crash()
625 ret = ath10k_debug_fw_assert(ar); in ath10k_write_simulate_fw_crash()
627 ath10k_info(ar, "user requested hw restart\n"); in ath10k_write_simulate_fw_crash()
628 ath10k_core_start_recovery(ar); in ath10k_write_simulate_fw_crash()
636 ath10k_warn(ar, "failed to simulate firmware crash: %d\n", ret); in ath10k_write_simulate_fw_crash()
643 mutex_unlock(&ar->conf_mutex); in ath10k_write_simulate_fw_crash()
658 struct ath10k *ar = file->private_data; in ath10k_read_chip_id() local
662 len = scnprintf(buf, sizeof(buf), "0x%08x\n", ar->bus_param.chip_id); in ath10k_read_chip_id()
678 struct ath10k *ar = file->private_data; in ath10k_reg_addr_read() local
683 mutex_lock(&ar->conf_mutex); in ath10k_reg_addr_read()
684 reg_addr = ar->debug.reg_addr; in ath10k_reg_addr_read()
685 mutex_unlock(&ar->conf_mutex); in ath10k_reg_addr_read()
696 struct ath10k *ar = file->private_data; in ath10k_reg_addr_write() local
707 mutex_lock(&ar->conf_mutex); in ath10k_reg_addr_write()
708 ar->debug.reg_addr = reg_addr; in ath10k_reg_addr_write()
709 mutex_unlock(&ar->conf_mutex); in ath10k_reg_addr_write()
726 struct ath10k *ar = file->private_data; in ath10k_reg_value_read() local
732 mutex_lock(&ar->conf_mutex); in ath10k_reg_value_read()
734 if (ar->state != ATH10K_STATE_ON && in ath10k_reg_value_read()
735 ar->state != ATH10K_STATE_UTF) { in ath10k_reg_value_read()
740 reg_addr = ar->debug.reg_addr; in ath10k_reg_value_read()
742 reg_val = ath10k_hif_read32(ar, reg_addr); in ath10k_reg_value_read()
748 mutex_unlock(&ar->conf_mutex); in ath10k_reg_value_read()
757 struct ath10k *ar = file->private_data; in ath10k_reg_value_write() local
761 mutex_lock(&ar->conf_mutex); in ath10k_reg_value_write()
763 if (ar->state != ATH10K_STATE_ON && in ath10k_reg_value_write()
764 ar->state != ATH10K_STATE_UTF) { in ath10k_reg_value_write()
769 reg_addr = ar->debug.reg_addr; in ath10k_reg_value_write()
775 ath10k_hif_write32(ar, reg_addr, reg_val); in ath10k_reg_value_write()
780 mutex_unlock(&ar->conf_mutex); in ath10k_reg_value_write()
797 struct ath10k *ar = file->private_data; in ath10k_mem_value_read() local
807 mutex_lock(&ar->conf_mutex); in ath10k_mem_value_read()
815 if (ar->state != ATH10K_STATE_ON && in ath10k_mem_value_read()
816 ar->state != ATH10K_STATE_UTF) { in ath10k_mem_value_read()
821 ret = ath10k_hif_diag_read(ar, *ppos, buf, count); in ath10k_mem_value_read()
823 ath10k_warn(ar, "failed to read address 0x%08x via diagnose window from debugfs: %d\n", in ath10k_mem_value_read()
840 mutex_unlock(&ar->conf_mutex); in ath10k_mem_value_read()
849 struct ath10k *ar = file->private_data; in ath10k_mem_value_write() local
859 mutex_lock(&ar->conf_mutex); in ath10k_mem_value_write()
867 if (ar->state != ATH10K_STATE_ON && in ath10k_mem_value_write()
868 ar->state != ATH10K_STATE_UTF) { in ath10k_mem_value_write()
879 ret = ath10k_hif_diag_write(ar, *ppos, buf, count); in ath10k_mem_value_write()
881 ath10k_warn(ar, "failed to write address 0x%08x via diagnose window from debugfs: %d\n", in ath10k_mem_value_write()
891 mutex_unlock(&ar->conf_mutex); in ath10k_mem_value_write()
904 static int ath10k_debug_htt_stats_req(struct ath10k *ar) in ath10k_debug_htt_stats_req() argument
909 lockdep_assert_held(&ar->conf_mutex); in ath10k_debug_htt_stats_req()
911 if (ar->debug.htt_stats_mask == 0) in ath10k_debug_htt_stats_req()
915 if (ar->state != ATH10K_STATE_ON) in ath10k_debug_htt_stats_req()
920 ret = ath10k_htt_h2t_stats_req(&ar->htt, ar->debug.htt_stats_mask, in ath10k_debug_htt_stats_req()
921 ar->debug.reset_htt_stats, cookie); in ath10k_debug_htt_stats_req()
923 ath10k_warn(ar, "failed to send htt stats request: %d\n", ret); in ath10k_debug_htt_stats_req()
927 queue_delayed_work(ar->workqueue, &ar->debug.htt_stats_dwork, in ath10k_debug_htt_stats_req()
935 struct ath10k *ar = container_of(work, struct ath10k, in ath10k_debug_htt_stats_dwork() local
938 mutex_lock(&ar->conf_mutex); in ath10k_debug_htt_stats_dwork()
940 ath10k_debug_htt_stats_req(ar); in ath10k_debug_htt_stats_dwork()
942 mutex_unlock(&ar->conf_mutex); in ath10k_debug_htt_stats_dwork()
949 struct ath10k *ar = file->private_data; in ath10k_read_htt_stats_mask() local
953 len = scnprintf(buf, sizeof(buf), "%lu\n", ar->debug.htt_stats_mask); in ath10k_read_htt_stats_mask()
962 struct ath10k *ar = file->private_data; in ath10k_write_htt_stats_mask() local
974 mutex_lock(&ar->conf_mutex); in ath10k_write_htt_stats_mask()
976 ar->debug.htt_stats_mask = mask; in ath10k_write_htt_stats_mask()
978 ret = ath10k_debug_htt_stats_req(ar); in ath10k_write_htt_stats_mask()
985 mutex_unlock(&ar->conf_mutex); in ath10k_write_htt_stats_mask()
1002 struct ath10k *ar = file->private_data; in ath10k_read_htt_max_amsdu_ampdu() local
1007 mutex_lock(&ar->conf_mutex); in ath10k_read_htt_max_amsdu_ampdu()
1009 amsdu = ar->htt.max_num_amsdu; in ath10k_read_htt_max_amsdu_ampdu()
1010 ampdu = ar->htt.max_num_ampdu; in ath10k_read_htt_max_amsdu_ampdu()
1011 mutex_unlock(&ar->conf_mutex); in ath10k_read_htt_max_amsdu_ampdu()
1022 struct ath10k *ar = file->private_data; in ath10k_write_htt_max_amsdu_ampdu() local
1037 mutex_lock(&ar->conf_mutex); in ath10k_write_htt_max_amsdu_ampdu()
1039 res = ath10k_htt_h2t_aggr_cfg_msg(&ar->htt, ampdu, amsdu); in ath10k_write_htt_max_amsdu_ampdu()
1044 ar->htt.max_num_amsdu = amsdu; in ath10k_write_htt_max_amsdu_ampdu()
1045 ar->htt.max_num_ampdu = ampdu; in ath10k_write_htt_max_amsdu_ampdu()
1048 mutex_unlock(&ar->conf_mutex); in ath10k_write_htt_max_amsdu_ampdu()
1064 struct ath10k *ar = file->private_data; in ath10k_read_fw_dbglog() local
1069 ar->debug.fw_dbglog_mask, ar->debug.fw_dbglog_level); in ath10k_read_fw_dbglog()
1078 struct ath10k *ar = file->private_data; in ath10k_write_fw_dbglog() local
1098 mutex_lock(&ar->conf_mutex); in ath10k_write_fw_dbglog()
1100 ar->debug.fw_dbglog_mask = mask; in ath10k_write_fw_dbglog()
1101 ar->debug.fw_dbglog_level = log_level; in ath10k_write_fw_dbglog()
1103 if (ar->state == ATH10K_STATE_ON) { in ath10k_write_fw_dbglog()
1104 ret = ath10k_wmi_dbglog_cfg(ar, ar->debug.fw_dbglog_mask, in ath10k_write_fw_dbglog()
1105 ar->debug.fw_dbglog_level); in ath10k_write_fw_dbglog()
1107 ath10k_warn(ar, "dbglog cfg failed from debugfs: %d\n", in ath10k_write_fw_dbglog()
1116 mutex_unlock(&ar->conf_mutex); in ath10k_write_fw_dbglog()
1201 struct ath10k *ar = hw->priv; in ath10k_debug_get_et_stats() local
1206 mutex_lock(&ar->conf_mutex); in ath10k_debug_get_et_stats()
1208 if (ar->state == ATH10K_STATE_ON) { in ath10k_debug_get_et_stats()
1209 ret = ath10k_debug_fw_stats_request(ar); in ath10k_debug_get_et_stats()
1212 ath10k_warn(ar, in ath10k_debug_get_et_stats()
1218 pdev_stats = list_first_entry_or_null(&ar->debug.fw_stats.pdevs, in ath10k_debug_get_et_stats()
1226 spin_lock_bh(&ar->data_lock); in ath10k_debug_get_et_stats()
1239 data[i++] = ar->stats.rx_crc_err_drop; in ath10k_debug_get_et_stats()
1272 data[i++] = ar->stats.fw_crash_counter; in ath10k_debug_get_et_stats()
1273 data[i++] = ar->stats.fw_warm_reset_counter; in ath10k_debug_get_et_stats()
1274 data[i++] = ar->stats.fw_cold_reset_counter; in ath10k_debug_get_et_stats()
1276 spin_unlock_bh(&ar->data_lock); in ath10k_debug_get_et_stats()
1278 mutex_unlock(&ar->conf_mutex); in ath10k_debug_get_et_stats()
1291 static int ath10k_debug_cal_data_fetch(struct ath10k *ar) in ath10k_debug_cal_data_fetch() argument
1297 lockdep_assert_held(&ar->conf_mutex); in ath10k_debug_cal_data_fetch()
1299 if (WARN_ON(ar->hw_params.cal_data_len > ATH10K_DEBUG_CAL_DATA_LEN)) in ath10k_debug_cal_data_fetch()
1302 if (ar->hw_params.cal_data_len == 0) in ath10k_debug_cal_data_fetch()
1307 ret = ath10k_hif_diag_read(ar, hi_addr, &addr, sizeof(addr)); in ath10k_debug_cal_data_fetch()
1309 ath10k_warn(ar, "failed to read hi_board_data address: %d\n", in ath10k_debug_cal_data_fetch()
1314 ret = ath10k_hif_diag_read(ar, le32_to_cpu(addr), ar->debug.cal_data, in ath10k_debug_cal_data_fetch()
1315 ar->hw_params.cal_data_len); in ath10k_debug_cal_data_fetch()
1317 ath10k_warn(ar, "failed to read calibration data: %d\n", ret); in ath10k_debug_cal_data_fetch()
1326 struct ath10k *ar = inode->i_private; in ath10k_debug_cal_data_open() local
1328 mutex_lock(&ar->conf_mutex); in ath10k_debug_cal_data_open()
1330 if (ar->state == ATH10K_STATE_ON || in ath10k_debug_cal_data_open()
1331 ar->state == ATH10K_STATE_UTF) { in ath10k_debug_cal_data_open()
1332 ath10k_debug_cal_data_fetch(ar); in ath10k_debug_cal_data_open()
1335 file->private_data = ar; in ath10k_debug_cal_data_open()
1336 mutex_unlock(&ar->conf_mutex); in ath10k_debug_cal_data_open()
1345 struct ath10k *ar = file->private_data; in ath10k_debug_cal_data_read() local
1347 mutex_lock(&ar->conf_mutex); in ath10k_debug_cal_data_read()
1350 ar->debug.cal_data, in ath10k_debug_cal_data_read()
1351 ar->hw_params.cal_data_len); in ath10k_debug_cal_data_read()
1353 mutex_unlock(&ar->conf_mutex); in ath10k_debug_cal_data_read()
1362 struct ath10k *ar = file->private_data; in ath10k_write_ani_enable() local
1369 mutex_lock(&ar->conf_mutex); in ath10k_write_ani_enable()
1371 if (ar->ani_enabled == enable) { in ath10k_write_ani_enable()
1376 ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->ani_enable, in ath10k_write_ani_enable()
1379 ath10k_warn(ar, "ani_enable failed from debugfs: %d\n", ret); in ath10k_write_ani_enable()
1382 ar->ani_enabled = enable; in ath10k_write_ani_enable()
1387 mutex_unlock(&ar->conf_mutex); in ath10k_write_ani_enable()
1395 struct ath10k *ar = file->private_data; in ath10k_read_ani_enable() local
1399 len = scnprintf(buf, sizeof(buf), "%d\n", ar->ani_enabled); in ath10k_read_ani_enable()
1423 struct ath10k *ar = file->private_data; in ath10k_read_nf_cal_period() local
1427 len = scnprintf(buf, sizeof(buf), "%d\n", ar->debug.nf_cal_period); in ath10k_read_nf_cal_period()
1436 struct ath10k *ar = file->private_data; in ath10k_write_nf_cal_period() local
1451 mutex_lock(&ar->conf_mutex); in ath10k_write_nf_cal_period()
1453 ar->debug.nf_cal_period = period; in ath10k_write_nf_cal_period()
1455 if (ar->state != ATH10K_STATE_ON) { in ath10k_write_nf_cal_period()
1461 ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->cal_period, in ath10k_write_nf_cal_period()
1462 ar->debug.nf_cal_period); in ath10k_write_nf_cal_period()
1464 ath10k_warn(ar, "cal period cfg failed from debugfs: %d\n", in ath10k_write_nf_cal_period()
1472 mutex_unlock(&ar->conf_mutex); in ath10k_write_nf_cal_period()
1487 static int ath10k_debug_tpc_stats_request(struct ath10k *ar) in ath10k_debug_tpc_stats_request() argument
1492 lockdep_assert_held(&ar->conf_mutex); in ath10k_debug_tpc_stats_request()
1494 reinit_completion(&ar->debug.tpc_complete); in ath10k_debug_tpc_stats_request()
1496 ret = ath10k_wmi_pdev_get_tpc_config(ar, WMI_TPC_CONFIG_PARAM); in ath10k_debug_tpc_stats_request()
1498 ath10k_warn(ar, "failed to request tpc config: %d\n", ret); in ath10k_debug_tpc_stats_request()
1502 time_left = wait_for_completion_timeout(&ar->debug.tpc_complete, in ath10k_debug_tpc_stats_request()
1510 void ath10k_debug_tpc_stats_process(struct ath10k *ar, in ath10k_debug_tpc_stats_process() argument
1513 spin_lock_bh(&ar->data_lock); in ath10k_debug_tpc_stats_process()
1515 kfree(ar->debug.tpc_stats); in ath10k_debug_tpc_stats_process()
1516 ar->debug.tpc_stats = tpc_stats; in ath10k_debug_tpc_stats_process()
1517 complete(&ar->debug.tpc_complete); in ath10k_debug_tpc_stats_process()
1519 spin_unlock_bh(&ar->data_lock); in ath10k_debug_tpc_stats_process()
1523 ath10k_debug_tpc_stats_final_process(struct ath10k *ar, in ath10k_debug_tpc_stats_final_process() argument
1526 spin_lock_bh(&ar->data_lock); in ath10k_debug_tpc_stats_final_process()
1528 kfree(ar->debug.tpc_stats_final); in ath10k_debug_tpc_stats_final_process()
1529 ar->debug.tpc_stats_final = tpc_stats; in ath10k_debug_tpc_stats_final_process()
1530 complete(&ar->debug.tpc_complete); in ath10k_debug_tpc_stats_final_process()
1532 spin_unlock_bh(&ar->data_lock); in ath10k_debug_tpc_stats_final_process()
1581 static void ath10k_tpc_stats_fill(struct ath10k *ar, in ath10k_tpc_stats_fill() argument
1591 spin_lock_bh(&ar->data_lock); in ath10k_tpc_stats_fill()
1594 ath10k_warn(ar, "failed to get tpc stats\n"); in ath10k_tpc_stats_fill()
1661 spin_unlock_bh(&ar->data_lock); in ath10k_tpc_stats_fill()
1671 struct ath10k *ar = inode->i_private; in ath10k_tpc_stats_open() local
1675 mutex_lock(&ar->conf_mutex); in ath10k_tpc_stats_open()
1677 if (ar->state != ATH10K_STATE_ON) { in ath10k_tpc_stats_open()
1688 ret = ath10k_debug_tpc_stats_request(ar); in ath10k_tpc_stats_open()
1690 ath10k_warn(ar, "failed to request tpc config stats: %d\n", in ath10k_tpc_stats_open()
1695 ath10k_tpc_stats_fill(ar, ar->debug.tpc_stats, buf); in ath10k_tpc_stats_open()
1698 mutex_unlock(&ar->conf_mutex); in ath10k_tpc_stats_open()
1705 mutex_unlock(&ar->conf_mutex); in ath10k_tpc_stats_open()
1733 int ath10k_debug_start(struct ath10k *ar) in ath10k_debug_start() argument
1737 lockdep_assert_held(&ar->conf_mutex); in ath10k_debug_start()
1739 ret = ath10k_debug_htt_stats_req(ar); in ath10k_debug_start()
1742 ath10k_warn(ar, "failed to start htt stats workqueue: %d\n", in ath10k_debug_start()
1745 if (ar->debug.fw_dbglog_mask) { in ath10k_debug_start()
1746 ret = ath10k_wmi_dbglog_cfg(ar, ar->debug.fw_dbglog_mask, in ath10k_debug_start()
1750 ath10k_warn(ar, "failed to enable dbglog during start: %d", in ath10k_debug_start()
1754 if (ar->pktlog_filter) { in ath10k_debug_start()
1755 ret = ath10k_wmi_pdev_pktlog_enable(ar, in ath10k_debug_start()
1756 ar->pktlog_filter); in ath10k_debug_start()
1759 ath10k_warn(ar, in ath10k_debug_start()
1761 ar->pktlog_filter, ret); in ath10k_debug_start()
1763 ret = ath10k_wmi_pdev_pktlog_disable(ar); in ath10k_debug_start()
1766 ath10k_warn(ar, "failed to disable pktlog: %d\n", ret); in ath10k_debug_start()
1769 if (ar->debug.nf_cal_period && in ath10k_debug_start()
1771 ar->normal_mode_fw.fw_file.fw_features)) { in ath10k_debug_start()
1772 ret = ath10k_wmi_pdev_set_param(ar, in ath10k_debug_start()
1773 ar->wmi.pdev_param->cal_period, in ath10k_debug_start()
1774 ar->debug.nf_cal_period); in ath10k_debug_start()
1777 ath10k_warn(ar, "cal period cfg failed from debug start: %d\n", in ath10k_debug_start()
1784 void ath10k_debug_stop(struct ath10k *ar) in ath10k_debug_stop() argument
1786 lockdep_assert_held(&ar->conf_mutex); in ath10k_debug_stop()
1789 ar->normal_mode_fw.fw_file.fw_features)) in ath10k_debug_stop()
1790 ath10k_debug_cal_data_fetch(ar); in ath10k_debug_stop()
1796 if (ar->debug.htt_stats_mask != 0) in ath10k_debug_stop()
1797 cancel_delayed_work(&ar->debug.htt_stats_dwork); in ath10k_debug_stop()
1799 ath10k_wmi_pdev_pktlog_disable(ar); in ath10k_debug_stop()
1806 struct ath10k *ar = file->private_data; in ath10k_write_simulate_radar() local
1813 arvif = list_first_entry(&ar->arvifs, typeof(*arvif), list); in ath10k_write_simulate_radar()
1817 ieee80211_radar_detected(ar->hw); in ath10k_write_simulate_radar()
1831 ar->debug.dfs_stats.p))
1835 ar->debug.dfs_pool_stats.p))
1842 struct ath10k *ar = file->private_data; in ath10k_read_dfs_stats() local
1849 if (!ar->dfs_detector) { in ath10k_read_dfs_stats()
1854 ar->debug.dfs_pool_stats = in ath10k_read_dfs_stats()
1855 ar->dfs_detector->get_stats(ar->dfs_detector); in ath10k_read_dfs_stats()
1895 struct ath10k *ar = file->private_data; in ath10k_write_pktlog_filter() local
1902 mutex_lock(&ar->conf_mutex); in ath10k_write_pktlog_filter()
1904 if (ar->state != ATH10K_STATE_ON) { in ath10k_write_pktlog_filter()
1905 ar->pktlog_filter = filter; in ath10k_write_pktlog_filter()
1910 if (filter == ar->pktlog_filter) { in ath10k_write_pktlog_filter()
1916 ret = ath10k_wmi_pdev_pktlog_enable(ar, filter); in ath10k_write_pktlog_filter()
1918 ath10k_warn(ar, "failed to enable pktlog filter %x: %d\n", in ath10k_write_pktlog_filter()
1919 ar->pktlog_filter, ret); in ath10k_write_pktlog_filter()
1923 ret = ath10k_wmi_pdev_pktlog_disable(ar); in ath10k_write_pktlog_filter()
1925 ath10k_warn(ar, "failed to disable pktlog: %d\n", ret); in ath10k_write_pktlog_filter()
1930 ar->pktlog_filter = filter; in ath10k_write_pktlog_filter()
1934 mutex_unlock(&ar->conf_mutex); in ath10k_write_pktlog_filter()
1942 struct ath10k *ar = file->private_data; in ath10k_read_pktlog_filter() local
1945 mutex_lock(&ar->conf_mutex); in ath10k_read_pktlog_filter()
1947 ar->pktlog_filter); in ath10k_read_pktlog_filter()
1948 mutex_unlock(&ar->conf_mutex); in ath10k_read_pktlog_filter()
1963 struct ath10k *ar = file->private_data; in ath10k_write_quiet_period() local
1970 ath10k_warn(ar, "Quiet period %u can not be lesser than 25ms\n", in ath10k_write_quiet_period()
1974 mutex_lock(&ar->conf_mutex); in ath10k_write_quiet_period()
1975 ar->thermal.quiet_period = period; in ath10k_write_quiet_period()
1976 ath10k_thermal_set_throttling(ar); in ath10k_write_quiet_period()
1977 mutex_unlock(&ar->conf_mutex); in ath10k_write_quiet_period()
1986 struct ath10k *ar = file->private_data; in ath10k_read_quiet_period() local
1989 mutex_lock(&ar->conf_mutex); in ath10k_read_quiet_period()
1991 ar->thermal.quiet_period); in ath10k_read_quiet_period()
1992 mutex_unlock(&ar->conf_mutex); in ath10k_read_quiet_period()
2007 struct ath10k *ar = file->private_data; in ath10k_write_btcoex() local
2023 if (!ar->coex_support) in ath10k_write_btcoex()
2026 mutex_lock(&ar->conf_mutex); in ath10k_write_btcoex()
2028 if (ar->state != ATH10K_STATE_ON && in ath10k_write_btcoex()
2029 ar->state != ATH10K_STATE_RESTARTED) { in ath10k_write_btcoex()
2034 if (!(test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags) ^ val)) { in ath10k_write_btcoex()
2039 pdev_param = ar->wmi.pdev_param->enable_btcoex; in ath10k_write_btcoex()
2041 ar->running_fw->fw_file.fw_features)) { in ath10k_write_btcoex()
2042 ret = ath10k_wmi_pdev_set_param(ar, pdev_param, val); in ath10k_write_btcoex()
2044 ath10k_warn(ar, "failed to enable btcoex: %d\n", ret); in ath10k_write_btcoex()
2049 ath10k_info(ar, "restarting firmware due to btcoex change"); in ath10k_write_btcoex()
2050 ath10k_core_start_recovery(ar); in ath10k_write_btcoex()
2054 set_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags); in ath10k_write_btcoex()
2056 clear_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags); in ath10k_write_btcoex()
2061 mutex_unlock(&ar->conf_mutex); in ath10k_write_btcoex()
2070 struct ath10k *ar = file->private_data; in ath10k_read_btcoex() local
2073 mutex_lock(&ar->conf_mutex); in ath10k_read_btcoex()
2075 test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags)); in ath10k_read_btcoex()
2076 mutex_unlock(&ar->conf_mutex); in ath10k_read_btcoex()
2091 struct ath10k *ar = file->private_data; in ath10k_write_enable_extd_tx_stats() local
2098 mutex_lock(&ar->conf_mutex); in ath10k_write_enable_extd_tx_stats()
2100 if (ar->state != ATH10K_STATE_ON) { in ath10k_write_enable_extd_tx_stats()
2101 ar->debug.enable_extd_tx_stats = filter; in ath10k_write_enable_extd_tx_stats()
2106 if (filter == ar->debug.enable_extd_tx_stats) { in ath10k_write_enable_extd_tx_stats()
2111 ar->debug.enable_extd_tx_stats = filter; in ath10k_write_enable_extd_tx_stats()
2115 mutex_unlock(&ar->conf_mutex); in ath10k_write_enable_extd_tx_stats()
2125 struct ath10k *ar = file->private_data; in ath10k_read_enable_extd_tx_stats() local
2128 mutex_lock(&ar->conf_mutex); in ath10k_read_enable_extd_tx_stats()
2130 ar->debug.enable_extd_tx_stats); in ath10k_read_enable_extd_tx_stats()
2131 mutex_unlock(&ar->conf_mutex); in ath10k_read_enable_extd_tx_stats()
2146 struct ath10k *ar = file->private_data; in ath10k_write_peer_stats() local
2161 mutex_lock(&ar->conf_mutex); in ath10k_write_peer_stats()
2163 if (ar->state != ATH10K_STATE_ON && in ath10k_write_peer_stats()
2164 ar->state != ATH10K_STATE_RESTARTED) { in ath10k_write_peer_stats()
2169 if (!(test_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags) ^ val)) { in ath10k_write_peer_stats()
2175 set_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags); in ath10k_write_peer_stats()
2177 clear_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags); in ath10k_write_peer_stats()
2179 ath10k_info(ar, "restarting firmware due to Peer stats change"); in ath10k_write_peer_stats()
2181 ath10k_core_start_recovery(ar); in ath10k_write_peer_stats()
2185 mutex_unlock(&ar->conf_mutex); in ath10k_write_peer_stats()
2194 struct ath10k *ar = file->private_data; in ath10k_read_peer_stats() local
2197 mutex_lock(&ar->conf_mutex); in ath10k_read_peer_stats()
2199 test_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags)); in ath10k_read_peer_stats()
2200 mutex_unlock(&ar->conf_mutex); in ath10k_read_peer_stats()
2215 struct ath10k *ar = file->private_data; in ath10k_debug_fw_checksums_read() local
2224 mutex_lock(&ar->conf_mutex); in ath10k_debug_fw_checksums_read()
2228 crc32_le(0, ar->normal_mode_fw.fw_file.firmware->data, in ath10k_debug_fw_checksums_read()
2229 ar->normal_mode_fw.fw_file.firmware->size)); in ath10k_debug_fw_checksums_read()
2232 crc32_le(0, ar->normal_mode_fw.fw_file.firmware_data, in ath10k_debug_fw_checksums_read()
2233 ar->normal_mode_fw.fw_file.firmware_len)); in ath10k_debug_fw_checksums_read()
2236 crc32_le(0, ar->normal_mode_fw.fw_file.otp_data, in ath10k_debug_fw_checksums_read()
2237 ar->normal_mode_fw.fw_file.otp_len)); in ath10k_debug_fw_checksums_read()
2240 crc32_le(0, ar->normal_mode_fw.fw_file.codeswap_data, in ath10k_debug_fw_checksums_read()
2241 ar->normal_mode_fw.fw_file.codeswap_len)); in ath10k_debug_fw_checksums_read()
2244 crc32_le(0, ar->normal_mode_fw.board->data, in ath10k_debug_fw_checksums_read()
2245 ar->normal_mode_fw.board->size)); in ath10k_debug_fw_checksums_read()
2248 crc32_le(0, ar->normal_mode_fw.board_data, in ath10k_debug_fw_checksums_read()
2249 ar->normal_mode_fw.board_len)); in ath10k_debug_fw_checksums_read()
2253 mutex_unlock(&ar->conf_mutex); in ath10k_debug_fw_checksums_read()
2270 struct ath10k *ar = file->private_data; in ath10k_sta_tid_stats_mask_read() local
2274 len = scnprintf(buf, sizeof(buf), "0x%08x\n", ar->sta_tid_stats_mask); in ath10k_sta_tid_stats_mask_read()
2282 struct ath10k *ar = file->private_data; in ath10k_sta_tid_stats_mask_write() local
2295 ar->sta_tid_stats_mask = mask; in ath10k_sta_tid_stats_mask_write()
2308 static int ath10k_debug_tpc_stats_final_request(struct ath10k *ar) in ath10k_debug_tpc_stats_final_request() argument
2313 lockdep_assert_held(&ar->conf_mutex); in ath10k_debug_tpc_stats_final_request()
2315 reinit_completion(&ar->debug.tpc_complete); in ath10k_debug_tpc_stats_final_request()
2317 ret = ath10k_wmi_pdev_get_tpc_table_cmdid(ar, WMI_TPC_CONFIG_PARAM); in ath10k_debug_tpc_stats_final_request()
2319 ath10k_warn(ar, "failed to request tpc table cmdid: %d\n", ret); in ath10k_debug_tpc_stats_final_request()
2323 time_left = wait_for_completion_timeout(&ar->debug.tpc_complete, in ath10k_debug_tpc_stats_final_request()
2333 struct ath10k *ar = inode->i_private; in ath10k_tpc_stats_final_open() local
2337 mutex_lock(&ar->conf_mutex); in ath10k_tpc_stats_final_open()
2339 if (ar->state != ATH10K_STATE_ON) { in ath10k_tpc_stats_final_open()
2350 ret = ath10k_debug_tpc_stats_final_request(ar); in ath10k_tpc_stats_final_open()
2352 ath10k_warn(ar, "failed to request tpc stats final: %d\n", in ath10k_tpc_stats_final_open()
2357 ath10k_tpc_stats_fill(ar, ar->debug.tpc_stats, buf); in ath10k_tpc_stats_final_open()
2360 mutex_unlock(&ar->conf_mutex); in ath10k_tpc_stats_final_open()
2367 mutex_unlock(&ar->conf_mutex); in ath10k_tpc_stats_final_open()
2401 struct ath10k *ar = file->private_data; in ath10k_write_warm_hw_reset() local
2411 mutex_lock(&ar->conf_mutex); in ath10k_write_warm_hw_reset()
2413 if (ar->state != ATH10K_STATE_ON) { in ath10k_write_warm_hw_reset()
2418 ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->pdev_reset, in ath10k_write_warm_hw_reset()
2422 ath10k_warn(ar, "failed to enable warm hw reset: %d\n", ret); in ath10k_write_warm_hw_reset()
2429 mutex_unlock(&ar->conf_mutex); in ath10k_write_warm_hw_reset()
2443 struct ath10k *ar = data; in ath10k_peer_ps_state_disable() local
2446 spin_lock_bh(&ar->data_lock); in ath10k_peer_ps_state_disable()
2448 spin_unlock_bh(&ar->data_lock); in ath10k_peer_ps_state_disable()
2455 struct ath10k *ar = file->private_data; in ath10k_write_ps_state_enable() local
2466 mutex_lock(&ar->conf_mutex); in ath10k_write_ps_state_enable()
2468 if (ar->ps_state_enable == ps_state_enable) { in ath10k_write_ps_state_enable()
2473 param = ar->wmi.pdev_param->peer_sta_ps_statechg_enable; in ath10k_write_ps_state_enable()
2474 ret = ath10k_wmi_pdev_set_param(ar, param, ps_state_enable); in ath10k_write_ps_state_enable()
2476 ath10k_warn(ar, "failed to enable ps_state_enable: %d\n", in ath10k_write_ps_state_enable()
2480 ar->ps_state_enable = ps_state_enable; in ath10k_write_ps_state_enable()
2482 if (!ar->ps_state_enable) in ath10k_write_ps_state_enable()
2483 ieee80211_iterate_stations_atomic(ar->hw, in ath10k_write_ps_state_enable()
2485 ar); in ath10k_write_ps_state_enable()
2490 mutex_unlock(&ar->conf_mutex); in ath10k_write_ps_state_enable()
2499 struct ath10k *ar = file->private_data; in ath10k_read_ps_state_enable() local
2503 mutex_lock(&ar->conf_mutex); in ath10k_read_ps_state_enable()
2505 ar->ps_state_enable); in ath10k_read_ps_state_enable()
2506 mutex_unlock(&ar->conf_mutex); in ath10k_read_ps_state_enable()
2523 struct ath10k *ar = file->private_data; in ath10k_write_reset_htt_stats() local
2534 mutex_lock(&ar->conf_mutex); in ath10k_write_reset_htt_stats()
2536 ar->debug.reset_htt_stats = reset; in ath10k_write_reset_htt_stats()
2538 ret = ath10k_debug_htt_stats_req(ar); in ath10k_write_reset_htt_stats()
2542 ar->debug.reset_htt_stats = 0; in ath10k_write_reset_htt_stats()
2546 mutex_unlock(&ar->conf_mutex); in ath10k_write_reset_htt_stats()
2557 int ath10k_debug_create(struct ath10k *ar) in ath10k_debug_create() argument
2559 ar->debug.cal_data = vzalloc(ATH10K_DEBUG_CAL_DATA_LEN); in ath10k_debug_create()
2560 if (!ar->debug.cal_data) in ath10k_debug_create()
2563 INIT_LIST_HEAD(&ar->debug.fw_stats.pdevs); in ath10k_debug_create()
2564 INIT_LIST_HEAD(&ar->debug.fw_stats.vdevs); in ath10k_debug_create()
2565 INIT_LIST_HEAD(&ar->debug.fw_stats.peers); in ath10k_debug_create()
2566 INIT_LIST_HEAD(&ar->debug.fw_stats.peers_extd); in ath10k_debug_create()
2571 void ath10k_debug_destroy(struct ath10k *ar) in ath10k_debug_destroy() argument
2573 vfree(ar->debug.cal_data); in ath10k_debug_destroy()
2574 ar->debug.cal_data = NULL; in ath10k_debug_destroy()
2576 ath10k_debug_fw_stats_reset(ar); in ath10k_debug_destroy()
2578 kfree(ar->debug.tpc_stats); in ath10k_debug_destroy()
2579 kfree(ar->debug.tpc_stats_final); in ath10k_debug_destroy()
2582 int ath10k_debug_register(struct ath10k *ar) in ath10k_debug_register() argument
2584 ar->debug.debugfs_phy = debugfs_create_dir("ath10k", in ath10k_debug_register()
2585 ar->hw->wiphy->debugfsdir); in ath10k_debug_register()
2586 if (IS_ERR_OR_NULL(ar->debug.debugfs_phy)) { in ath10k_debug_register()
2587 if (IS_ERR(ar->debug.debugfs_phy)) in ath10k_debug_register()
2588 return PTR_ERR(ar->debug.debugfs_phy); in ath10k_debug_register()
2593 INIT_DELAYED_WORK(&ar->debug.htt_stats_dwork, in ath10k_debug_register()
2596 init_completion(&ar->debug.tpc_complete); in ath10k_debug_register()
2597 init_completion(&ar->debug.fw_stats_complete); in ath10k_debug_register()
2599 debugfs_create_file("fw_stats", 0400, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2602 debugfs_create_file("fw_reset_stats", 0400, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2605 debugfs_create_file("wmi_services", 0400, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2608 debugfs_create_file("simulate_fw_crash", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2611 debugfs_create_file("reg_addr", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2614 debugfs_create_file("reg_value", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2617 debugfs_create_file("mem_value", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2620 debugfs_create_file("chip_id", 0400, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2623 debugfs_create_file("htt_stats_mask", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2626 debugfs_create_file("htt_max_amsdu_ampdu", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2629 debugfs_create_file("fw_dbglog", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2633 ar->normal_mode_fw.fw_file.fw_features)) { in ath10k_debug_register()
2634 debugfs_create_file("cal_data", 0400, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2637 debugfs_create_file("nf_cal_period", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2641 debugfs_create_file("ani_enable", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2645 debugfs_create_file("dfs_simulate_radar", 0200, ar->debug.debugfs_phy, in ath10k_debug_register()
2646 ar, &fops_simulate_radar); in ath10k_debug_register()
2649 ar->debug.debugfs_phy, in ath10k_debug_register()
2650 &ar->dfs_block_radar_events); in ath10k_debug_register()
2652 debugfs_create_file("dfs_stats", 0400, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2656 debugfs_create_file("pktlog_filter", 0644, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2659 if (test_bit(WMI_SERVICE_THERM_THROT, ar->wmi.svc_map)) in ath10k_debug_register()
2660 debugfs_create_file("quiet_period", 0644, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2663 debugfs_create_file("tpc_stats", 0400, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2666 if (test_bit(WMI_SERVICE_COEX_GPIO, ar->wmi.svc_map)) in ath10k_debug_register()
2667 debugfs_create_file("btcoex", 0644, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2670 if (test_bit(WMI_SERVICE_PEER_STATS, ar->wmi.svc_map)) { in ath10k_debug_register()
2671 debugfs_create_file("peer_stats", 0644, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2675 ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2679 debugfs_create_file("fw_checksums", 0400, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2684 ar->debug.debugfs_phy, in ath10k_debug_register()
2685 ar, &fops_sta_tid_stats_mask); in ath10k_debug_register()
2687 if (test_bit(WMI_SERVICE_TPC_STATS_FINAL, ar->wmi.svc_map)) in ath10k_debug_register()
2689 ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2692 if (test_bit(WMI_SERVICE_RESET_CHIP, ar->wmi.svc_map)) in ath10k_debug_register()
2694 ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2697 debugfs_create_file("ps_state_enable", 0600, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2700 debugfs_create_file("reset_htt_stats", 0200, ar->debug.debugfs_phy, ar, in ath10k_debug_register()
2706 void ath10k_debug_unregister(struct ath10k *ar) in ath10k_debug_unregister() argument
2708 cancel_delayed_work_sync(&ar->debug.htt_stats_dwork); in ath10k_debug_unregister()
2714 void __ath10k_dbg(struct ath10k *ar, enum ath10k_debug_mask mask, in __ath10k_dbg() argument
2727 dev_printk(KERN_DEBUG, ar->dev, "%pV", &vaf); in __ath10k_dbg()
2732 dev_printk(KERN_DEBUG, ar->dev, "%s", str); in __ath10k_dbg()
2737 trace_ath10k_log_dbg(ar, mask, &vaf); in __ath10k_dbg()
2743 void ath10k_dbg_dump(struct ath10k *ar, in ath10k_dbg_dump() argument
2759 __ath10k_dbg(ar, mask, "%s\n", msg); in ath10k_dbg_dump()
2772 dev_printk(KERN_DEBUG, ar->dev, "%s\n", linebuf); in ath10k_dbg_dump()
2783 dev_printk(KERN_DEBUG, ar->dev, "%s\n", sbuf_data(sb)); in ath10k_dbg_dump()
2790 trace_ath10k_log_dbg_dump(ar, msg ? msg : "", prefix ? prefix : "", in ath10k_dbg_dump()