Lines Matching +full:ieee80211 +full:- +full:freq +full:- +full:limit

1 // SPDX-License-Identifier: BSD-3-Clause-Clear
3 * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
4 * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
17 struct ath12k *ar = file->private_data; in ath12k_write_simulate_radar()
20 wiphy_lock(ath12k_ar_to_hw(ar)->wiphy); in ath12k_write_simulate_radar()
27 wiphy_unlock(ath12k_ar_to_hw(ar)->wiphy); in ath12k_write_simulate_radar()
42 "`assert` - send WMI_FORCE_FW_HANG_CMDID to firmware to cause assert.\n"; in ath12k_read_simulate_fw_crash()
52 struct ath12k_base *ab = file->private_data; in ath12k_write_simulate_fw_crash()
61 return -EINVAL; in ath12k_write_simulate_fw_crash()
63 rc = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); in ath12k_write_simulate_fw_crash()
68 if (buf[*ppos - 1] == '\n') in ath12k_write_simulate_fw_crash()
69 buf[*ppos - 1] = '\0'; in ath12k_write_simulate_fw_crash()
71 for (i = 0; i < ab->num_radios; i++) { in ath12k_write_simulate_fw_crash()
72 pdev = &ab->pdevs[i]; in ath12k_write_simulate_fw_crash()
73 ar = pdev->ar; in ath12k_write_simulate_fw_crash()
79 return -ENETDOWN; in ath12k_write_simulate_fw_crash()
87 return -EINVAL; in ath12k_write_simulate_fw_crash()
110 struct ath12k *ar = file->private_data; in ath12k_write_tpc_stats_type()
119 return -EINVAL; in ath12k_write_tpc_stats_type()
121 spin_lock_bh(&ar->data_lock); in ath12k_write_tpc_stats_type()
122 ar->debug.tpc_stats_type = type; in ath12k_write_tpc_stats_type()
123 spin_unlock_bh(&ar->data_lock); in ath12k_write_tpc_stats_type()
131 struct ath12k_base *ab = ar->ab; in ath12k_debug_tpc_stats_request()
134 lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); in ath12k_debug_tpc_stats_request()
136 reinit_completion(&ar->debug.tpc_complete); in ath12k_debug_tpc_stats_request()
138 spin_lock_bh(&ar->data_lock); in ath12k_debug_tpc_stats_request()
139 ar->debug.tpc_request = true; in ath12k_debug_tpc_stats_request()
140 tpc_stats_sub_id = ar->debug.tpc_stats_type; in ath12k_debug_tpc_stats_request()
141 spin_unlock_bh(&ar->data_lock); in ath12k_debug_tpc_stats_request()
146 spin_lock_bh(&ar->data_lock); in ath12k_debug_tpc_stats_request()
147 ar->debug.tpc_request = false; in ath12k_debug_tpc_stats_request()
148 spin_unlock_bh(&ar->data_lock); in ath12k_debug_tpc_stats_request()
158 u32 chan_freq = le32_to_cpu(tpc_stats->tpc_config.chan_freq); in ath12k_get_tpc_ctl_mode_idx()
264 chain_idx = num_chains - 1; in ath12k_tpc_get_rate()
265 stm_idx = num_streams - 1; in ath12k_tpc_get_rate()
266 mode = -1; in ath12k_tpc_get_rate()
270 ath12k_warn(ar->ab, "Invalid mode index received\n"); in ath12k_tpc_get_rate()
280 if (le32_to_cpu(tpc_stats->tpc_config.num_tx_chain) <= 1) { in ath12k_tpc_get_rate()
300 rate2 = tpc_stats->rates_array2.rate_array[eht_rate_idx]; in ath12k_tpc_get_rate()
306 rate1 = tpc_stats->rates_array1.rate_array[rate_idx]; in ath12k_tpc_get_rate()
313 if (tpc_stats->tlvs_rcvd & WMI_TPC_CTL_PWR_ARRAY) { in ath12k_tpc_get_rate()
314 tot_nss = le32_to_cpu(tpc_stats->ctl_array.tpc_ctl_pwr.d1); in ath12k_tpc_get_rate()
315 tot_modes = le32_to_cpu(tpc_stats->ctl_array.tpc_ctl_pwr.d2); in ath12k_tpc_get_rate()
316 txbf_on_off = le32_to_cpu(tpc_stats->ctl_array.tpc_ctl_pwr.d3); in ath12k_tpc_get_rate()
321 tpc_ctl = *(tpc_stats->ctl_array.ctl_pwr_table + in ath12k_tpc_get_rate()
326 ath12k_warn(ar->ab, in ath12k_tpc_get_rate()
332 reg_pwr = tpc_stats->max_reg_allowed_power.reg_pwr_array[chain_idx]; in ath12k_tpc_get_rate()
339 /* MODULATION_LIMIT is the maximum power limit,tpc should not exceed in ath12k_tpc_get_rate()
340 * modulation limit even if min tpc of all three array is greater in ath12k_tpc_get_rate()
341 * modulation limit in ath12k_tpc_get_rate()
392 mcs_rate -= 2; in ath12k_get_ratecode()
400 static bool ath12k_he_supports_extra_mcs(struct ath12k *ar, int freq) in ath12k_he_supports_extra_mcs() argument
402 struct ath12k_pdev_cap *cap = &ar->pdev->cap; in ath12k_he_supports_extra_mcs()
406 if (freq <= ATH12K_2GHZ_MAX_FREQUENCY) in ath12k_he_supports_extra_mcs()
407 cap_band = &cap->band[NL80211_BAND_2GHZ]; in ath12k_he_supports_extra_mcs()
408 else if (freq <= ATH12K_5GHZ_MAX_FREQUENCY) in ath12k_he_supports_extra_mcs()
409 cap_band = &cap->band[NL80211_BAND_5GHZ]; in ath12k_he_supports_extra_mcs()
411 cap_band = &cap->band[NL80211_BAND_6GHZ]; in ath12k_he_supports_extra_mcs()
413 extra_mcs_supported = u32_get_bits(cap_band->he_cap_info[1], in ath12k_he_supports_extra_mcs()
424 struct wmi_tpc_stats_arg *tpc_stats = ar->debug.tpc_stats; in ath12k_tpc_fill_pream()
455 active_tx_chains = ar->num_tx_chains; in ath12k_tpc_fill_pream()
475 len += scnprintf(buf + len, buf_len - len, in ath12k_tpc_fill_pream()
482 buf_len - len, in ath12k_tpc_fill_pream()
493 buf_len - len, "\tNA"); in ath12k_tpc_fill_pream()
496 buf_len - len, "\t%d", in ath12k_tpc_fill_pream()
501 len += scnprintf(buf + len, buf_len - len, "\n"); in ath12k_tpc_fill_pream()
603 chan_freq = le32_to_cpu(tpc_stats->tpc_config.chan_freq); in ath12k_tpc_stats_print()
604 num_tx_chain = le32_to_cpu(tpc_stats->tpc_config.num_tx_chain); in ath12k_tpc_stats_print()
605 caps = le32_to_cpu(tpc_stats->tpc_config.caps); in ath12k_tpc_stats_print()
607 active_tx_chains = ar->num_tx_chains; in ath12k_tpc_stats_print()
627 nss = (max_nss[i - 1] < num_tx_chain ? in ath12k_tpc_stats_print()
628 max_nss[i - 1] : num_tx_chain); in ath12k_tpc_stats_print()
630 rate_idx[i] = rate_idx[i - 1] + max_rates[i - 1] * nss; in ath12k_tpc_stats_print()
633 eht_rate_idx[j] = eht_rate_idx[j - 1] + max_rates[i] * nss; in ath12k_tpc_stats_print()
644 len += scnprintf(buf + len, buf_len - len, in ath12k_tpc_stats_print()
645 "No.of rates-%d\n", total_rates); in ath12k_tpc_stats_print()
647 len += scnprintf(buf + len, buf_len - len, in ath12k_tpc_stats_print()
650 len += scnprintf(buf + len, buf_len - len, in ath12k_tpc_stats_print()
652 len += scnprintf(buf + len, buf_len - len, in ath12k_tpc_stats_print()
656 len += scnprintf(buf + len, buf_len - len, in ath12k_tpc_stats_print()
657 "\t%d-Chain", i); in ath12k_tpc_stats_print()
660 len += scnprintf(buf + len, buf_len - len, "\n"); in ath12k_tpc_stats_print()
679 nss = (max_nss[i] < ar->num_tx_chains ? max_nss[i] : ar->num_tx_chains); in ath12k_tpc_stats_print()
713 ath12k_warn(ar->ab, "failed to find tpc stats\n"); in ath12k_tpc_stats_fill()
717 spin_lock_bh(&ar->data_lock); in ath12k_tpc_stats_fill()
719 tpc = &tpc_stats->tpc_config; in ath12k_tpc_stats_fill()
720 len += scnprintf(buf + len, buf_len - len, "\n"); in ath12k_tpc_stats_fill()
721 len += scnprintf(buf + len, buf_len - len, in ath12k_tpc_stats_fill()
723 len += scnprintf(buf + len, buf_len - len, in ath12k_tpc_stats_fill()
725 len += scnprintf(buf + len, buf_len - len, in ath12k_tpc_stats_fill()
726 "reg domain-%d\t\tchan freq-%d\n", in ath12k_tpc_stats_fill()
727 tpc->reg_domain, tpc->chan_freq); in ath12k_tpc_stats_fill()
728 len += scnprintf(buf + len, buf_len - len, in ath12k_tpc_stats_fill()
729 "power limit-%d\t\tmax reg-domain Power-%d\n", in ath12k_tpc_stats_fill()
730 le32_to_cpu(tpc->twice_max_reg_power) / 2, tpc->power_limit); in ath12k_tpc_stats_fill()
731 len += scnprintf(buf + len, buf_len - len, in ath12k_tpc_stats_fill()
732 "No.of tx chain-%d\t", in ath12k_tpc_stats_fill()
733 ar->num_tx_chains); in ath12k_tpc_stats_fill()
736 ar->debug.tpc_stats_type); in ath12k_tpc_stats_fill()
738 spin_unlock_bh(&ar->data_lock); in ath12k_tpc_stats_fill()
743 struct ath12k *ar = inode->i_private; in ath12k_open_tpc_stats()
747 guard(wiphy)(ath12k_ar_to_hw(ar)->wiphy); in ath12k_open_tpc_stats()
749 if (ah->state != ATH12K_HW_STATE_ON) { in ath12k_open_tpc_stats()
750 ath12k_warn(ar->ab, "Interface not up\n"); in ath12k_open_tpc_stats()
751 return -ENETDOWN; in ath12k_open_tpc_stats()
756 return -ENOMEM; in ath12k_open_tpc_stats()
760 ath12k_warn(ar->ab, "failed to request tpc stats: %d\n", in ath12k_open_tpc_stats()
765 if (!wait_for_completion_timeout(&ar->debug.tpc_complete, TPC_STATS_WAIT_TIME)) { in ath12k_open_tpc_stats()
766 spin_lock_bh(&ar->data_lock); in ath12k_open_tpc_stats()
768 ar->debug.tpc_request = false; in ath12k_open_tpc_stats()
769 spin_unlock_bh(&ar->data_lock); in ath12k_open_tpc_stats()
770 return -ETIMEDOUT; in ath12k_open_tpc_stats()
773 ath12k_tpc_stats_fill(ar, ar->debug.tpc_stats, buf); in ath12k_open_tpc_stats()
774 file->private_data = no_free_ptr(buf); in ath12k_open_tpc_stats()
776 spin_lock_bh(&ar->data_lock); in ath12k_open_tpc_stats()
778 spin_unlock_bh(&ar->data_lock); in ath12k_open_tpc_stats()
787 const char *buf = file->private_data; in ath12k_read_tpc_stats()
796 kfree(file->private_data); in ath12k_release_tpc_stats()
818 struct ath12k *ar = file->private_data; in ath12k_write_extd_rx_stats()
825 return -EINVAL; in ath12k_write_extd_rx_stats()
827 wiphy_lock(ath12k_ar_to_hw(ar)->wiphy); in ath12k_write_extd_rx_stats()
829 if (!ar->ab->hw_params->rxdma1_enable) { in ath12k_write_extd_rx_stats()
834 if (ar->ah->state != ATH12K_HW_STATE_ON) { in ath12k_write_extd_rx_stats()
835 ret = -ENETDOWN; in ath12k_write_extd_rx_stats()
839 if (enable == ar->debug.extd_rx_stats) { in ath12k_write_extd_rx_stats()
863 ar->debug.rx_filter = tlv_filter.rx_filter; in ath12k_write_extd_rx_stats()
865 for (i = 0; i < ar->ab->hw_params->num_rxdma_per_pdev; i++) { in ath12k_write_extd_rx_stats()
866 ring_id = ar->dp.rxdma_mon_dst_ring[i].ring_id; in ath12k_write_extd_rx_stats()
867 ret = ath12k_dp_tx_htt_rx_filter_setup(ar->ab, ring_id, ar->dp.mac_id + i, in ath12k_write_extd_rx_stats()
872 ath12k_warn(ar->ab, "failed to set rx filter for monitor status ring\n"); in ath12k_write_extd_rx_stats()
877 ar->debug.extd_rx_stats = !!enable; in ath12k_write_extd_rx_stats()
880 wiphy_unlock(ath12k_ar_to_hw(ar)->wiphy); in ath12k_write_extd_rx_stats()
888 struct ath12k *ar = file->private_data; in ath12k_read_extd_rx_stats()
892 wiphy_lock(ath12k_ar_to_hw(ar)->wiphy); in ath12k_read_extd_rx_stats()
893 len = scnprintf(buf, sizeof(buf) - len, "%d\n", in ath12k_read_extd_rx_stats()
894 ar->debug.extd_rx_stats); in ath12k_read_extd_rx_stats()
895 wiphy_unlock(ath12k_ar_to_hw(ar)->wiphy); in ath12k_read_extd_rx_stats()
908 struct ath12k_vif *ahvif = inode->i_private; in ath12k_open_link_stats()
918 return -EINVAL; in ath12k_open_link_stats()
922 return -ENOMEM; in ath12k_open_link_stats()
924 wiphy = ahvif->ah->hw->wiphy; in ath12k_open_link_stats()
927 links_map = ahvif->links_map; in ath12k_open_link_stats()
930 arvif = rcu_dereference_protected(ahvif->link[link_id], in ath12k_open_link_stats()
931 lockdep_is_held(&wiphy->mtx)); in ath12k_open_link_stats()
933 spin_lock_bh(&arvif->link_stats_lock); in ath12k_open_link_stats()
934 linkstat = arvif->link_stats; in ath12k_open_link_stats()
935 spin_unlock_bh(&arvif->link_stats_lock); in ath12k_open_link_stats()
937 len += scnprintf(buf + len, buf_len - len, in ath12k_open_link_stats()
940 len += scnprintf(buf + len, buf_len - len, in ath12k_open_link_stats()
943 len += scnprintf(buf + len, buf_len - len, in ath12k_open_link_stats()
946 len += scnprintf(buf + len, buf_len - len, in ath12k_open_link_stats()
950 len += scnprintf(buf + len, buf_len - len, in ath12k_open_link_stats()
954 len += scnprintf(buf + len, buf_len - len, in ath12k_open_link_stats()
958 len += scnprintf(buf + len, buf_len - len, in ath12k_open_link_stats()
962 len += scnprintf(buf + len, buf_len - len, in ath12k_open_link_stats()
966 len += scnprintf(buf + len, buf_len - len, in ath12k_open_link_stats()
971 len += scnprintf(buf + len, buf_len - len, in ath12k_open_link_stats()
975 len += scnprintf(buf + len, buf_len - len, in ath12k_open_link_stats()
980 len += scnprintf(buf + len, buf_len - len, in ath12k_open_link_stats()
981 "------------------------------------------------------\n"); in ath12k_open_link_stats()
986 file->private_data = buf; in ath12k_open_link_stats()
993 kfree(file->private_data); in ath12k_release_link_stats()
1001 const char *buf = file->private_data; in ath12k_read_link_stats()
1020 debugfs_create_file("link_stats", 0400, vif->debugfs_dir, ahvif, in ath12k_debugfs_op_vif_add()
1028 struct ath12k_base *ab = file->private_data; in ath12k_debugfs_dump_device_dp_stats()
1029 struct ath12k_device_dp_stats *device_stats = &ab->device_stats; in ath12k_debugfs_dump_device_dp_stats()
1041 [HAL_REO_ENTR_RING_RXDMA_ECODE_MSDU_LIMIT_ERR] = "MSDU limit", in ath12k_debugfs_dump_device_dp_stats()
1081 return -ENOMEM; in ath12k_debugfs_dump_device_dp_stats()
1083 len += scnprintf(buf + len, size - len, "DEVICE RX STATS:\n\n"); in ath12k_debugfs_dump_device_dp_stats()
1084 len += scnprintf(buf + len, size - len, "err ring pkts: %u\n", in ath12k_debugfs_dump_device_dp_stats()
1085 device_stats->err_ring_pkts); in ath12k_debugfs_dump_device_dp_stats()
1086 len += scnprintf(buf + len, size - len, "Invalid RBM: %u\n\n", in ath12k_debugfs_dump_device_dp_stats()
1087 device_stats->invalid_rbm); in ath12k_debugfs_dump_device_dp_stats()
1088 len += scnprintf(buf + len, size - len, "RXDMA errors:\n"); in ath12k_debugfs_dump_device_dp_stats()
1091 len += scnprintf(buf + len, size - len, "%s: %u\n", in ath12k_debugfs_dump_device_dp_stats()
1092 rxdma_err[i], device_stats->rxdma_error[i]); in ath12k_debugfs_dump_device_dp_stats()
1094 len += scnprintf(buf + len, size - len, "\nREO errors:\n"); in ath12k_debugfs_dump_device_dp_stats()
1097 len += scnprintf(buf + len, size - len, "%s: %u\n", in ath12k_debugfs_dump_device_dp_stats()
1098 reo_err[i], device_stats->reo_error[i]); in ath12k_debugfs_dump_device_dp_stats()
1100 len += scnprintf(buf + len, size - len, "\nHAL REO errors:\n"); in ath12k_debugfs_dump_device_dp_stats()
1103 len += scnprintf(buf + len, size - len, in ath12k_debugfs_dump_device_dp_stats()
1105 device_stats->hal_reo_error[i]); in ath12k_debugfs_dump_device_dp_stats()
1107 len += scnprintf(buf + len, size - len, "\nDEVICE TX STATS:\n"); in ath12k_debugfs_dump_device_dp_stats()
1108 len += scnprintf(buf + len, size - len, "\nTCL Ring Full Failures:\n"); in ath12k_debugfs_dump_device_dp_stats()
1111 len += scnprintf(buf + len, size - len, "ring%d: %u\n", in ath12k_debugfs_dump_device_dp_stats()
1112 i, device_stats->tx_err.desc_na[i]); in ath12k_debugfs_dump_device_dp_stats()
1114 len += scnprintf(buf + len, size - len, in ath12k_debugfs_dump_device_dp_stats()
1116 atomic_read(&device_stats->tx_err.misc_fail)); in ath12k_debugfs_dump_device_dp_stats()
1118 len += scnprintf(buf + len, size - len, "\ntx_wbm_rel_source:"); in ath12k_debugfs_dump_device_dp_stats()
1121 len += scnprintf(buf + len, size - len, " %d:%u", in ath12k_debugfs_dump_device_dp_stats()
1122 i, device_stats->tx_wbm_rel_source[i]); in ath12k_debugfs_dump_device_dp_stats()
1124 len += scnprintf(buf + len, size - len, "\n"); in ath12k_debugfs_dump_device_dp_stats()
1126 len += scnprintf(buf + len, size - len, "\ntqm_rel_reason:"); in ath12k_debugfs_dump_device_dp_stats()
1129 len += scnprintf(buf + len, size - len, " %d:%u", in ath12k_debugfs_dump_device_dp_stats()
1130 i, device_stats->tqm_rel_reason[i]); in ath12k_debugfs_dump_device_dp_stats()
1132 len += scnprintf(buf + len, size - len, "\n"); in ath12k_debugfs_dump_device_dp_stats()
1134 len += scnprintf(buf + len, size - len, "\nfw_tx_status:"); in ath12k_debugfs_dump_device_dp_stats()
1137 len += scnprintf(buf + len, size - len, " %d:%u", in ath12k_debugfs_dump_device_dp_stats()
1138 i, device_stats->fw_tx_status[i]); in ath12k_debugfs_dump_device_dp_stats()
1140 len += scnprintf(buf + len, size - len, "\n"); in ath12k_debugfs_dump_device_dp_stats()
1142 len += scnprintf(buf + len, size - len, "\ntx_enqueued:"); in ath12k_debugfs_dump_device_dp_stats()
1145 len += scnprintf(buf + len, size - len, " %d:%u", i, in ath12k_debugfs_dump_device_dp_stats()
1146 device_stats->tx_enqueued[i]); in ath12k_debugfs_dump_device_dp_stats()
1148 len += scnprintf(buf + len, size - len, "\n"); in ath12k_debugfs_dump_device_dp_stats()
1150 len += scnprintf(buf + len, size - len, "\ntx_completed:"); in ath12k_debugfs_dump_device_dp_stats()
1153 len += scnprintf(buf + len, size - len, " %d:%u", in ath12k_debugfs_dump_device_dp_stats()
1154 i, device_stats->tx_completed[i]); in ath12k_debugfs_dump_device_dp_stats()
1156 len += scnprintf(buf + len, size - len, "\n"); in ath12k_debugfs_dump_device_dp_stats()
1158 for (i = 0; i < ab->num_radios; i++) { in ath12k_debugfs_dump_device_dp_stats()
1161 len += scnprintf(buf + len, size - len, in ath12k_debugfs_dump_device_dp_stats()
1163 atomic_read(&ar->dp.num_tx_pending)); in ath12k_debugfs_dump_device_dp_stats()
1167 len += scnprintf(buf + len, size - len, "\nREO Rx Received:\n"); in ath12k_debugfs_dump_device_dp_stats()
1170 len += scnprintf(buf + len, size - len, "Ring%d:", i + 1); in ath12k_debugfs_dump_device_dp_stats()
1173 len += scnprintf(buf + len, size - len, in ath12k_debugfs_dump_device_dp_stats()
1175 device_stats->reo_rx[i][j]); in ath12k_debugfs_dump_device_dp_stats()
1178 len += scnprintf(buf + len, size - len, "\n"); in ath12k_debugfs_dump_device_dp_stats()
1181 len += scnprintf(buf + len, size - len, "\nRx WBM REL SRC Errors:\n"); in ath12k_debugfs_dump_device_dp_stats()
1184 len += scnprintf(buf + len, size - len, "%s:", wbm_rel_src[i]); in ath12k_debugfs_dump_device_dp_stats()
1188 size - len, in ath12k_debugfs_dump_device_dp_stats()
1190 device_stats->rx_wbm_rel_source[i][j]); in ath12k_debugfs_dump_device_dp_stats()
1193 len += scnprintf(buf + len, size - len, "\n"); in ath12k_debugfs_dump_device_dp_stats()
1210 debugfs_create_file("simulate_fw_crash", 0600, ab->debugfs_soc, ab, in ath12k_debugfs_pdev_create()
1213 debugfs_create_file("device_dp_stats", 0400, ab->debugfs_soc, ab, in ath12k_debugfs_pdev_create()
1234 scnprintf(soc_name, sizeof(soc_name), "%s-%s", ath12k_bus_str(ab->hif.bus), in ath12k_debugfs_soc_create()
1235 dev_name(ab->dev)); in ath12k_debugfs_soc_create()
1237 ab->debugfs_soc = debugfs_create_dir(soc_name, debugfs_ath12k); in ath12k_debugfs_soc_create()
1245 debugfs_remove_recursive(ab->debugfs_soc); in ath12k_debugfs_soc_destroy()
1246 ab->debugfs_soc = NULL; in ath12k_debugfs_soc_destroy()
1256 struct ath12k *ar = inode->i_private; in ath12k_open_vdev_stats()
1261 guard(wiphy)(ath12k_ar_to_hw(ar)->wiphy); in ath12k_open_vdev_stats()
1264 return -ENETDOWN; in ath12k_open_vdev_stats()
1266 if (ah->state != ATH12K_HW_STATE_ON) in ath12k_open_vdev_stats()
1267 return -ENETDOWN; in ath12k_open_vdev_stats()
1271 return -ENOMEM; in ath12k_open_vdev_stats()
1280 ath12k_warn(ar->ab, "failed to request fw vdev stats: %d\n", ret); in ath12k_open_vdev_stats()
1284 ath12k_wmi_fw_stats_dump(ar, &ar->fw_stats, param.stats_id, in ath12k_open_vdev_stats()
1287 file->private_data = no_free_ptr(buf); in ath12k_open_vdev_stats()
1294 kfree(file->private_data); in ath12k_release_vdev_stats()
1303 const char *buf = file->private_data; in ath12k_read_vdev_stats()
1319 struct ath12k *ar = inode->i_private; in ath12k_open_bcn_stats()
1325 guard(wiphy)(ath12k_ar_to_hw(ar)->wiphy); in ath12k_open_bcn_stats()
1327 if (ah && ah->state != ATH12K_HW_STATE_ON) in ath12k_open_bcn_stats()
1328 return -ENETDOWN; in ath12k_open_bcn_stats()
1332 return -ENOMEM; in ath12k_open_bcn_stats()
1338 list_for_each_entry(arvif, &ar->arvifs, list) { in ath12k_open_bcn_stats()
1339 if (!arvif->is_up) in ath12k_open_bcn_stats()
1342 param.vdev_id = arvif->vdev_id; in ath12k_open_bcn_stats()
1345 ath12k_warn(ar->ab, "failed to request fw bcn stats: %d\n", ret); in ath12k_open_bcn_stats()
1350 ath12k_wmi_fw_stats_dump(ar, &ar->fw_stats, param.stats_id, in ath12k_open_bcn_stats()
1355 spin_lock_bh(&ar->data_lock); in ath12k_open_bcn_stats()
1356 ath12k_fw_stats_bcn_free(&ar->fw_stats.bcn); in ath12k_open_bcn_stats()
1357 spin_unlock_bh(&ar->data_lock); in ath12k_open_bcn_stats()
1359 file->private_data = no_free_ptr(buf); in ath12k_open_bcn_stats()
1366 kfree(file->private_data); in ath12k_release_bcn_stats()
1375 const char *buf = file->private_data; in ath12k_read_bcn_stats()
1391 struct ath12k *ar = inode->i_private; in ath12k_open_pdev_stats()
1393 struct ath12k_base *ab = ar->ab; in ath12k_open_pdev_stats()
1397 guard(wiphy)(ath12k_ar_to_hw(ar)->wiphy); in ath12k_open_pdev_stats()
1399 if (ah && ah->state != ATH12K_HW_STATE_ON) in ath12k_open_pdev_stats()
1400 return -ENETDOWN; in ath12k_open_pdev_stats()
1404 return -ENOMEM; in ath12k_open_pdev_stats()
1416 ath12k_wmi_fw_stats_dump(ar, &ar->fw_stats, param.stats_id, in ath12k_open_pdev_stats()
1419 file->private_data = no_free_ptr(buf); in ath12k_open_pdev_stats()
1426 kfree(file->private_data); in ath12k_release_pdev_stats()
1435 const char *buf = file->private_data; in ath12k_read_pdev_stats()
1453 ar->debug.debugfs_pdev); in ath12k_debugfs_fw_stats_register()
1470 struct ath12k_base *ab = ar->ab; in ath12k_debugfs_register()
1471 struct ieee80211_hw *hw = ar->ah->hw; in ath12k_debugfs_register()
1475 scnprintf(pdev_name, sizeof(pdev_name), "%s%d", "mac", ar->pdev_idx); in ath12k_debugfs_register()
1477 ar->debug.debugfs_pdev = debugfs_create_dir(pdev_name, ab->debugfs_soc); in ath12k_debugfs_register()
1479 /* Create a symlink under ieee80211/phy* */ in ath12k_debugfs_register()
1480 scnprintf(buf, sizeof(buf), "../../ath12k/%pd2", ar->debug.debugfs_pdev); in ath12k_debugfs_register()
1481 ar->debug.debugfs_pdev_symlink = debugfs_create_symlink("ath12k", in ath12k_debugfs_register()
1482 hw->wiphy->debugfsdir, in ath12k_debugfs_register()
1485 if (ar->mac.sbands[NL80211_BAND_5GHZ].channels) { in ath12k_debugfs_register()
1487 ar->debug.debugfs_pdev, ar, in ath12k_debugfs_register()
1491 debugfs_create_file("tpc_stats", 0400, ar->debug.debugfs_pdev, ar, in ath12k_debugfs_register()
1493 debugfs_create_file("tpc_stats_type", 0200, ar->debug.debugfs_pdev, in ath12k_debugfs_register()
1495 init_completion(&ar->debug.tpc_complete); in ath12k_debugfs_register()
1501 ar->debug.debugfs_pdev, ar, in ath12k_debugfs_register()
1507 if (!ar->debug.debugfs_pdev) in ath12k_debugfs_unregister()
1510 /* Remove symlink under ieee80211/phy* */ in ath12k_debugfs_unregister()
1511 debugfs_remove(ar->debug.debugfs_pdev_symlink); in ath12k_debugfs_unregister()
1512 debugfs_remove_recursive(ar->debug.debugfs_pdev); in ath12k_debugfs_unregister()
1513 ar->debug.debugfs_pdev_symlink = NULL; in ath12k_debugfs_unregister()
1514 ar->debug.debugfs_pdev = NULL; in ath12k_debugfs_unregister()