Lines Matching +full:auto +full:- +full:retry
1 // SPDX-License-Identifier: BSD-3-Clause-Clear
3 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
4 * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
20 struct rate_info *txrate = &arsta->txrate; in ath11k_debugfs_sta_add_tx_stats()
24 if (!arsta->tx_stats) in ath11k_debugfs_sta_add_tx_stats()
27 tx_stats = arsta->tx_stats; in ath11k_debugfs_sta_add_tx_stats()
28 gi = FIELD_GET(RATE_INFO_FLAGS_SHORT_GI, arsta->txrate.flags); in ath11k_debugfs_sta_add_tx_stats()
29 mcs = txrate->mcs; in ath11k_debugfs_sta_add_tx_stats()
30 bw = ath11k_mac_mac80211_bw_to_ath11k_bw(txrate->bw); in ath11k_debugfs_sta_add_tx_stats()
31 nss = txrate->nss - 1; in ath11k_debugfs_sta_add_tx_stats()
33 #define STATS_OP_FMT(name) tx_stats->stats[ATH11K_STATS_TYPE_##name] in ath11k_debugfs_sta_add_tx_stats()
35 if (txrate->flags & RATE_INFO_FLAGS_HE_MCS) { in ath11k_debugfs_sta_add_tx_stats()
36 STATS_OP_FMT(SUCC).he[0][mcs] += peer_stats->succ_bytes; in ath11k_debugfs_sta_add_tx_stats()
37 STATS_OP_FMT(SUCC).he[1][mcs] += peer_stats->succ_pkts; in ath11k_debugfs_sta_add_tx_stats()
38 STATS_OP_FMT(FAIL).he[0][mcs] += peer_stats->failed_bytes; in ath11k_debugfs_sta_add_tx_stats()
39 STATS_OP_FMT(FAIL).he[1][mcs] += peer_stats->failed_pkts; in ath11k_debugfs_sta_add_tx_stats()
40 STATS_OP_FMT(RETRY).he[0][mcs] += peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
41 STATS_OP_FMT(RETRY).he[1][mcs] += peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
42 } else if (txrate->flags & RATE_INFO_FLAGS_VHT_MCS) { in ath11k_debugfs_sta_add_tx_stats()
43 STATS_OP_FMT(SUCC).vht[0][mcs] += peer_stats->succ_bytes; in ath11k_debugfs_sta_add_tx_stats()
44 STATS_OP_FMT(SUCC).vht[1][mcs] += peer_stats->succ_pkts; in ath11k_debugfs_sta_add_tx_stats()
45 STATS_OP_FMT(FAIL).vht[0][mcs] += peer_stats->failed_bytes; in ath11k_debugfs_sta_add_tx_stats()
46 STATS_OP_FMT(FAIL).vht[1][mcs] += peer_stats->failed_pkts; in ath11k_debugfs_sta_add_tx_stats()
47 STATS_OP_FMT(RETRY).vht[0][mcs] += peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
48 STATS_OP_FMT(RETRY).vht[1][mcs] += peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
49 } else if (txrate->flags & RATE_INFO_FLAGS_MCS) { in ath11k_debugfs_sta_add_tx_stats()
50 STATS_OP_FMT(SUCC).ht[0][mcs] += peer_stats->succ_bytes; in ath11k_debugfs_sta_add_tx_stats()
51 STATS_OP_FMT(SUCC).ht[1][mcs] += peer_stats->succ_pkts; in ath11k_debugfs_sta_add_tx_stats()
52 STATS_OP_FMT(FAIL).ht[0][mcs] += peer_stats->failed_bytes; in ath11k_debugfs_sta_add_tx_stats()
53 STATS_OP_FMT(FAIL).ht[1][mcs] += peer_stats->failed_pkts; in ath11k_debugfs_sta_add_tx_stats()
54 STATS_OP_FMT(RETRY).ht[0][mcs] += peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
55 STATS_OP_FMT(RETRY).ht[1][mcs] += peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
59 STATS_OP_FMT(SUCC).legacy[0][mcs] += peer_stats->succ_bytes; in ath11k_debugfs_sta_add_tx_stats()
60 STATS_OP_FMT(SUCC).legacy[1][mcs] += peer_stats->succ_pkts; in ath11k_debugfs_sta_add_tx_stats()
61 STATS_OP_FMT(FAIL).legacy[0][mcs] += peer_stats->failed_bytes; in ath11k_debugfs_sta_add_tx_stats()
62 STATS_OP_FMT(FAIL).legacy[1][mcs] += peer_stats->failed_pkts; in ath11k_debugfs_sta_add_tx_stats()
63 STATS_OP_FMT(RETRY).legacy[0][mcs] += peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
64 STATS_OP_FMT(RETRY).legacy[1][mcs] += peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
67 if (peer_stats->is_ampdu) { in ath11k_debugfs_sta_add_tx_stats()
68 tx_stats->ba_fails += peer_stats->ba_fails; in ath11k_debugfs_sta_add_tx_stats()
70 if (txrate->flags & RATE_INFO_FLAGS_HE_MCS) { in ath11k_debugfs_sta_add_tx_stats()
72 peer_stats->succ_bytes + peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
74 peer_stats->succ_pkts + peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
75 } else if (txrate->flags & RATE_INFO_FLAGS_MCS) { in ath11k_debugfs_sta_add_tx_stats()
77 peer_stats->succ_bytes + peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
79 peer_stats->succ_pkts + peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
82 peer_stats->succ_bytes + peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
84 peer_stats->succ_pkts + peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
87 peer_stats->succ_bytes + peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
89 peer_stats->succ_bytes + peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
91 peer_stats->succ_bytes + peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
93 peer_stats->succ_pkts + peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
95 peer_stats->succ_pkts + peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
97 peer_stats->succ_pkts + peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
99 tx_stats->ack_fails += peer_stats->ba_fails; in ath11k_debugfs_sta_add_tx_stats()
102 STATS_OP_FMT(SUCC).bw[0][bw] += peer_stats->succ_bytes; in ath11k_debugfs_sta_add_tx_stats()
103 STATS_OP_FMT(SUCC).nss[0][nss] += peer_stats->succ_bytes; in ath11k_debugfs_sta_add_tx_stats()
104 STATS_OP_FMT(SUCC).gi[0][gi] += peer_stats->succ_bytes; in ath11k_debugfs_sta_add_tx_stats()
106 STATS_OP_FMT(SUCC).bw[1][bw] += peer_stats->succ_pkts; in ath11k_debugfs_sta_add_tx_stats()
107 STATS_OP_FMT(SUCC).nss[1][nss] += peer_stats->succ_pkts; in ath11k_debugfs_sta_add_tx_stats()
108 STATS_OP_FMT(SUCC).gi[1][gi] += peer_stats->succ_pkts; in ath11k_debugfs_sta_add_tx_stats()
110 STATS_OP_FMT(FAIL).bw[0][bw] += peer_stats->failed_bytes; in ath11k_debugfs_sta_add_tx_stats()
111 STATS_OP_FMT(FAIL).nss[0][nss] += peer_stats->failed_bytes; in ath11k_debugfs_sta_add_tx_stats()
112 STATS_OP_FMT(FAIL).gi[0][gi] += peer_stats->failed_bytes; in ath11k_debugfs_sta_add_tx_stats()
114 STATS_OP_FMT(FAIL).bw[1][bw] += peer_stats->failed_pkts; in ath11k_debugfs_sta_add_tx_stats()
115 STATS_OP_FMT(FAIL).nss[1][nss] += peer_stats->failed_pkts; in ath11k_debugfs_sta_add_tx_stats()
116 STATS_OP_FMT(FAIL).gi[1][gi] += peer_stats->failed_pkts; in ath11k_debugfs_sta_add_tx_stats()
118 STATS_OP_FMT(RETRY).bw[0][bw] += peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
119 STATS_OP_FMT(RETRY).nss[0][nss] += peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
120 STATS_OP_FMT(RETRY).gi[0][gi] += peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
122 STATS_OP_FMT(RETRY).bw[1][bw] += peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
123 STATS_OP_FMT(RETRY).nss[1][nss] += peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
124 STATS_OP_FMT(RETRY).gi[1][gi] += peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
126 tx_stats->tx_duration += peer_stats->duration; in ath11k_debugfs_sta_add_tx_stats()
139 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_dump_tx_stats()
141 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_dump_tx_stats()
144 "retry", "ampdu"}; in ath11k_dbg_sta_dump_tx_stats()
150 if (!arsta->tx_stats) in ath11k_dbg_sta_dump_tx_stats()
151 return -ENOENT; in ath11k_dbg_sta_dump_tx_stats()
155 return -ENOMEM; in ath11k_dbg_sta_dump_tx_stats()
157 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_dump_tx_stats()
159 spin_lock_bh(&ar->data_lock); in ath11k_dbg_sta_dump_tx_stats()
162 stats = &arsta->tx_stats->stats[k]; in ath11k_dbg_sta_dump_tx_stats()
163 len += scnprintf(buf + len, size - len, "%s_%s\n", in ath11k_dbg_sta_dump_tx_stats()
166 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
170 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
172 stats->he[j][i]); in ath11k_dbg_sta_dump_tx_stats()
173 len += scnprintf(buf + len, size - len, "\n"); in ath11k_dbg_sta_dump_tx_stats()
174 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
178 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
180 stats->vht[j][i]); in ath11k_dbg_sta_dump_tx_stats()
181 len += scnprintf(buf + len, size - len, "\n"); in ath11k_dbg_sta_dump_tx_stats()
182 len += scnprintf(buf + len, size - len, " HT MCS %s\n", in ath11k_dbg_sta_dump_tx_stats()
185 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
186 " %llu ", stats->ht[j][i]); in ath11k_dbg_sta_dump_tx_stats()
187 len += scnprintf(buf + len, size - len, "\n"); in ath11k_dbg_sta_dump_tx_stats()
188 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
190 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
192 stats->bw[j][0], stats->bw[j][1], in ath11k_dbg_sta_dump_tx_stats()
193 stats->bw[j][2], stats->bw[j][3]); in ath11k_dbg_sta_dump_tx_stats()
194 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
196 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
198 stats->nss[j][0], stats->nss[j][1], in ath11k_dbg_sta_dump_tx_stats()
199 stats->nss[j][2], stats->nss[j][3]); in ath11k_dbg_sta_dump_tx_stats()
200 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
203 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
205 stats->gi[j][0], stats->gi[j][1], in ath11k_dbg_sta_dump_tx_stats()
206 stats->gi[j][2], stats->gi[j][3]); in ath11k_dbg_sta_dump_tx_stats()
207 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
211 len += scnprintf(buf + len, size - len, "%llu ", in ath11k_dbg_sta_dump_tx_stats()
212 stats->legacy[j][i]); in ath11k_dbg_sta_dump_tx_stats()
213 len += scnprintf(buf + len, size - len, "\n"); in ath11k_dbg_sta_dump_tx_stats()
217 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
219 arsta->tx_stats->tx_duration); in ath11k_dbg_sta_dump_tx_stats()
220 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
221 "BA fails\n %llu\n", arsta->tx_stats->ba_fails); in ath11k_dbg_sta_dump_tx_stats()
222 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
223 "ack fails\n %llu\n", arsta->tx_stats->ack_fails); in ath11k_dbg_sta_dump_tx_stats()
224 spin_unlock_bh(&ar->data_lock); in ath11k_dbg_sta_dump_tx_stats()
231 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_dump_tx_stats()
246 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_dump_rx_stats()
248 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_dump_rx_stats()
249 struct ath11k_rx_peer_stats *rx_stats = arsta->rx_stats; in ath11k_dbg_sta_dump_rx_stats()
255 return -ENOENT; in ath11k_dbg_sta_dump_rx_stats()
259 return -ENOMEM; in ath11k_dbg_sta_dump_rx_stats()
261 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_dump_rx_stats()
262 spin_lock_bh(&ar->ab->base_lock); in ath11k_dbg_sta_dump_rx_stats()
264 len += scnprintf(buf + len, size - len, "RX peer stats:\n"); in ath11k_dbg_sta_dump_rx_stats()
265 len += scnprintf(buf + len, size - len, "Num of MSDUs: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
266 rx_stats->num_msdu); in ath11k_dbg_sta_dump_rx_stats()
267 len += scnprintf(buf + len, size - len, "Num of MSDUs with TCP L4: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
268 rx_stats->tcp_msdu_count); in ath11k_dbg_sta_dump_rx_stats()
269 len += scnprintf(buf + len, size - len, "Num of MSDUs with UDP L4: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
270 rx_stats->udp_msdu_count); in ath11k_dbg_sta_dump_rx_stats()
271 len += scnprintf(buf + len, size - len, "Num of MSDUs part of AMPDU: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
272 rx_stats->ampdu_msdu_count); in ath11k_dbg_sta_dump_rx_stats()
273 len += scnprintf(buf + len, size - len, "Num of MSDUs not part of AMPDU: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
274 rx_stats->non_ampdu_msdu_count); in ath11k_dbg_sta_dump_rx_stats()
275 len += scnprintf(buf + len, size - len, "Num of MSDUs using STBC: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
276 rx_stats->stbc_count); in ath11k_dbg_sta_dump_rx_stats()
277 len += scnprintf(buf + len, size - len, "Num of MSDUs beamformed: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
278 rx_stats->beamformed_count); in ath11k_dbg_sta_dump_rx_stats()
279 len += scnprintf(buf + len, size - len, "Num of MPDUs with FCS ok: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
280 rx_stats->num_mpdu_fcs_ok); in ath11k_dbg_sta_dump_rx_stats()
281 len += scnprintf(buf + len, size - len, "Num of MPDUs with FCS error: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
282 rx_stats->num_mpdu_fcs_err); in ath11k_dbg_sta_dump_rx_stats()
283 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_rx_stats()
285 rx_stats->gi_count[0], rx_stats->gi_count[1], in ath11k_dbg_sta_dump_rx_stats()
286 rx_stats->gi_count[2], rx_stats->gi_count[3]); in ath11k_dbg_sta_dump_rx_stats()
287 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_rx_stats()
289 rx_stats->bw_count[0], rx_stats->bw_count[1], in ath11k_dbg_sta_dump_rx_stats()
290 rx_stats->bw_count[2], rx_stats->bw_count[3]); in ath11k_dbg_sta_dump_rx_stats()
291 len += scnprintf(buf + len, size - len, "BCC %llu LDPC %llu\n", in ath11k_dbg_sta_dump_rx_stats()
292 rx_stats->coding_count[0], rx_stats->coding_count[1]); in ath11k_dbg_sta_dump_rx_stats()
293 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_rx_stats()
295 rx_stats->pream_cnt[0], rx_stats->pream_cnt[1], in ath11k_dbg_sta_dump_rx_stats()
296 rx_stats->pream_cnt[2], rx_stats->pream_cnt[3], in ath11k_dbg_sta_dump_rx_stats()
297 rx_stats->pream_cnt[4]); in ath11k_dbg_sta_dump_rx_stats()
298 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_rx_stats()
300 rx_stats->reception_type[0], rx_stats->reception_type[1], in ath11k_dbg_sta_dump_rx_stats()
301 rx_stats->reception_type[2], rx_stats->reception_type[3]); in ath11k_dbg_sta_dump_rx_stats()
302 len += scnprintf(buf + len, size - len, "TID(0-15) Legacy TID(16):"); in ath11k_dbg_sta_dump_rx_stats()
304 len += scnprintf(buf + len, size - len, "%llu ", rx_stats->tid_count[i]); in ath11k_dbg_sta_dump_rx_stats()
305 len += scnprintf(buf + len, size - len, "\nMCS(0-11) Legacy MCS(12):"); in ath11k_dbg_sta_dump_rx_stats()
307 len += scnprintf(buf + len, size - len, "%llu ", rx_stats->mcs_count[i]); in ath11k_dbg_sta_dump_rx_stats()
308 len += scnprintf(buf + len, size - len, "\nNSS(1-8):"); in ath11k_dbg_sta_dump_rx_stats()
310 len += scnprintf(buf + len, size - len, "%llu ", rx_stats->nss_count[i]); in ath11k_dbg_sta_dump_rx_stats()
311 len += scnprintf(buf + len, size - len, "\nRX Duration:%llu ", in ath11k_dbg_sta_dump_rx_stats()
312 rx_stats->rx_duration); in ath11k_dbg_sta_dump_rx_stats()
313 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_rx_stats()
315 rx_stats->dcm_count, rx_stats->ru_alloc_cnt[0], in ath11k_dbg_sta_dump_rx_stats()
316 rx_stats->ru_alloc_cnt[1], rx_stats->ru_alloc_cnt[2], in ath11k_dbg_sta_dump_rx_stats()
317 rx_stats->ru_alloc_cnt[3], rx_stats->ru_alloc_cnt[4], in ath11k_dbg_sta_dump_rx_stats()
318 rx_stats->ru_alloc_cnt[5]); in ath11k_dbg_sta_dump_rx_stats()
320 len += scnprintf(buf + len, size - len, "\n"); in ath11k_dbg_sta_dump_rx_stats()
322 spin_unlock_bh(&ar->ab->base_lock); in ath11k_dbg_sta_dump_rx_stats()
329 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_dump_rx_stats()
343 struct ieee80211_sta *sta = inode->i_private; in ath11k_dbg_sta_open_htt_peer_stats()
345 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_open_htt_peer_stats()
347 int type = ar->debug.htt_stats.type; in ath11k_dbg_sta_open_htt_peer_stats()
353 return -EPERM; in ath11k_dbg_sta_open_htt_peer_stats()
357 return -ENOMEM; in ath11k_dbg_sta_open_htt_peer_stats()
359 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_open_htt_peer_stats()
360 ar->debug.htt_stats.stats_req = stats_req; in ath11k_dbg_sta_open_htt_peer_stats()
361 stats_req->type = type; in ath11k_dbg_sta_open_htt_peer_stats()
362 memcpy(stats_req->peer_addr, sta->addr, ETH_ALEN); in ath11k_dbg_sta_open_htt_peer_stats()
364 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_open_htt_peer_stats()
368 file->private_data = stats_req; in ath11k_dbg_sta_open_htt_peer_stats()
372 ar->debug.htt_stats.stats_req = NULL; in ath11k_dbg_sta_open_htt_peer_stats()
379 struct ieee80211_sta *sta = inode->i_private; in ath11k_dbg_sta_release_htt_peer_stats()
381 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_release_htt_peer_stats()
383 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_release_htt_peer_stats()
384 vfree(file->private_data); in ath11k_dbg_sta_release_htt_peer_stats()
385 ar->debug.htt_stats.stats_req = NULL; in ath11k_dbg_sta_release_htt_peer_stats()
386 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_release_htt_peer_stats()
395 struct debug_htt_stats_req *stats_req = file->private_data; in ath11k_dbg_sta_read_htt_peer_stats()
399 buf = stats_req->buf; in ath11k_dbg_sta_read_htt_peer_stats()
400 length = min_t(u32, stats_req->buf_len, ATH11K_HTT_STATS_BUF_SIZE); in ath11k_dbg_sta_read_htt_peer_stats()
416 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_write_peer_pktlog()
418 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_write_peer_pktlog()
421 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_write_peer_pktlog()
423 if (ar->state != ATH11K_STATE_ON) { in ath11k_dbg_sta_write_peer_pktlog()
424 ret = -ENETDOWN; in ath11k_dbg_sta_write_peer_pktlog()
432 ar->debug.pktlog_peer_valid = enable; in ath11k_dbg_sta_write_peer_pktlog()
433 memcpy(ar->debug.pktlog_peer_addr, sta->addr, ETH_ALEN); in ath11k_dbg_sta_write_peer_pktlog()
436 ret = ath11k_wmi_pdev_peer_pktlog_filter(ar, sta->addr, enable); in ath11k_dbg_sta_write_peer_pktlog()
438 ath11k_warn(ar->ab, "failed to set peer pktlog filter %pM: %d\n", in ath11k_dbg_sta_write_peer_pktlog()
439 sta->addr, ret); in ath11k_dbg_sta_write_peer_pktlog()
443 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "peer pktlog filter set to %d\n", in ath11k_dbg_sta_write_peer_pktlog()
448 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_write_peer_pktlog()
456 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_read_peer_pktlog()
458 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_read_peer_pktlog()
462 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_read_peer_pktlog()
464 ar->debug.pktlog_peer_valid, in ath11k_dbg_sta_read_peer_pktlog()
465 ar->debug.pktlog_peer_addr); in ath11k_dbg_sta_read_peer_pktlog()
466 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_read_peer_pktlog()
483 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_write_delba()
485 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_write_delba()
490 ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, in ath11k_dbg_sta_write_delba()
497 return -EINVAL; in ath11k_dbg_sta_write_delba()
500 if (tid > HAL_DESC_REO_NON_QOS_TID - 1) in ath11k_dbg_sta_write_delba()
501 return -EINVAL; in ath11k_dbg_sta_write_delba()
503 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_write_delba()
504 if (ar->state != ATH11K_STATE_ON || in ath11k_dbg_sta_write_delba()
505 arsta->aggr_mode != ATH11K_DBG_AGGR_MODE_MANUAL) { in ath11k_dbg_sta_write_delba()
510 ret = ath11k_wmi_delba_send(ar, arsta->arvif->vdev_id, sta->addr, in ath11k_dbg_sta_write_delba()
513 ath11k_warn(ar->ab, "failed to send delba: vdev_id %u peer %pM tid %u initiator %u reason %u\n", in ath11k_dbg_sta_write_delba()
514 arsta->arvif->vdev_id, sta->addr, tid, initiator, in ath11k_dbg_sta_write_delba()
519 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_write_delba()
534 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_write_addba_resp()
536 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_write_addba_resp()
541 ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, in ath11k_dbg_sta_write_addba_resp()
548 return -EINVAL; in ath11k_dbg_sta_write_addba_resp()
551 if (tid > HAL_DESC_REO_NON_QOS_TID - 1) in ath11k_dbg_sta_write_addba_resp()
552 return -EINVAL; in ath11k_dbg_sta_write_addba_resp()
554 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_write_addba_resp()
555 if (ar->state != ATH11K_STATE_ON || in ath11k_dbg_sta_write_addba_resp()
556 arsta->aggr_mode != ATH11K_DBG_AGGR_MODE_MANUAL) { in ath11k_dbg_sta_write_addba_resp()
561 ret = ath11k_wmi_addba_set_resp(ar, arsta->arvif->vdev_id, sta->addr, in ath11k_dbg_sta_write_addba_resp()
564 ath11k_warn(ar->ab, "failed to send addba response: vdev_id %u peer %pM tid %u status%u\n", in ath11k_dbg_sta_write_addba_resp()
565 arsta->arvif->vdev_id, sta->addr, tid, status); in ath11k_dbg_sta_write_addba_resp()
569 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_write_addba_resp()
584 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_write_addba()
586 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_write_addba()
591 ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, in ath11k_dbg_sta_write_addba()
598 return -EINVAL; in ath11k_dbg_sta_write_addba()
601 if (tid > HAL_DESC_REO_NON_QOS_TID - 1) in ath11k_dbg_sta_write_addba()
602 return -EINVAL; in ath11k_dbg_sta_write_addba()
604 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_write_addba()
605 if (ar->state != ATH11K_STATE_ON || in ath11k_dbg_sta_write_addba()
606 arsta->aggr_mode != ATH11K_DBG_AGGR_MODE_MANUAL) { in ath11k_dbg_sta_write_addba()
611 ret = ath11k_wmi_addba_send(ar, arsta->arvif->vdev_id, sta->addr, in ath11k_dbg_sta_write_addba()
614 ath11k_warn(ar->ab, "failed to send addba request: vdev_id %u peer %pM tid %u buf_size %u\n", in ath11k_dbg_sta_write_addba()
615 arsta->arvif->vdev_id, sta->addr, tid, buf_size); in ath11k_dbg_sta_write_addba()
620 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_write_addba()
635 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_read_aggr_mode()
637 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_read_aggr_mode()
641 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_read_aggr_mode()
642 len = scnprintf(buf, sizeof(buf) - len, in ath11k_dbg_sta_read_aggr_mode()
644 (arsta->aggr_mode == ATH11K_DBG_AGGR_MODE_AUTO) ? in ath11k_dbg_sta_read_aggr_mode()
645 "auto" : "manual", "auto = 0", "manual = 1"); in ath11k_dbg_sta_read_aggr_mode()
646 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_read_aggr_mode()
655 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_write_aggr_mode()
657 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_write_aggr_mode()
662 return -EINVAL; in ath11k_dbg_sta_write_aggr_mode()
665 return -EINVAL; in ath11k_dbg_sta_write_aggr_mode()
667 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_write_aggr_mode()
668 if (ar->state != ATH11K_STATE_ON || in ath11k_dbg_sta_write_aggr_mode()
669 aggr_mode == arsta->aggr_mode) { in ath11k_dbg_sta_write_aggr_mode()
674 ret = ath11k_wmi_addba_clear_resp(ar, arsta->arvif->vdev_id, sta->addr); in ath11k_dbg_sta_write_aggr_mode()
676 ath11k_warn(ar->ab, "failed to clear addba session ret: %d\n", in ath11k_dbg_sta_write_aggr_mode()
681 arsta->aggr_mode = aggr_mode; in ath11k_dbg_sta_write_aggr_mode()
683 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_write_aggr_mode()
700 struct ieee80211_sta *sta = file->private_data; in ath11k_write_htt_peer_stats_reset()
702 struct ath11k *ar = arsta->arvif->ar; in ath11k_write_htt_peer_stats_reset()
714 mutex_lock(&ar->conf_mutex); in ath11k_write_htt_peer_stats_reset()
721 cfg_params.cfg2 |= FIELD_PREP(GENMASK(7, 0), sta->addr[0]); in ath11k_write_htt_peer_stats_reset()
722 cfg_params.cfg2 |= FIELD_PREP(GENMASK(15, 8), sta->addr[1]); in ath11k_write_htt_peer_stats_reset()
723 cfg_params.cfg2 |= FIELD_PREP(GENMASK(23, 16), sta->addr[2]); in ath11k_write_htt_peer_stats_reset()
724 cfg_params.cfg2 |= FIELD_PREP(GENMASK(31, 24), sta->addr[3]); in ath11k_write_htt_peer_stats_reset()
726 cfg_params.cfg3 |= FIELD_PREP(GENMASK(7, 0), sta->addr[4]); in ath11k_write_htt_peer_stats_reset()
727 cfg_params.cfg3 |= FIELD_PREP(GENMASK(15, 8), sta->addr[5]); in ath11k_write_htt_peer_stats_reset()
736 ath11k_warn(ar->ab, "failed to send htt peer stats request: %d\n", ret); in ath11k_write_htt_peer_stats_reset()
737 mutex_unlock(&ar->conf_mutex); in ath11k_write_htt_peer_stats_reset()
741 mutex_unlock(&ar->conf_mutex); in ath11k_write_htt_peer_stats_reset()
759 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_read_peer_ps_state()
761 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_read_peer_ps_state()
765 spin_lock_bh(&ar->data_lock); in ath11k_dbg_sta_read_peer_ps_state()
767 len = scnprintf(buf, sizeof(buf), "%d\n", arsta->peer_ps_state); in ath11k_dbg_sta_read_peer_ps_state()
769 spin_unlock_bh(&ar->data_lock); in ath11k_dbg_sta_read_peer_ps_state()
786 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_read_current_ps_duration()
788 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_read_current_ps_duration()
793 spin_lock_bh(&ar->data_lock); in ath11k_dbg_sta_read_current_ps_duration()
795 if (arsta->peer_ps_state == WMI_PEER_PS_STATE_ON && in ath11k_dbg_sta_read_current_ps_duration()
796 arsta->peer_current_ps_valid) in ath11k_dbg_sta_read_current_ps_duration()
798 - arsta->ps_start_jiffies); in ath11k_dbg_sta_read_current_ps_duration()
804 spin_unlock_bh(&ar->data_lock); in ath11k_dbg_sta_read_current_ps_duration()
820 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_read_total_ps_duration()
822 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_read_total_ps_duration()
827 spin_lock_bh(&ar->data_lock); in ath11k_dbg_sta_read_total_ps_duration()
829 if (arsta->peer_ps_state == WMI_PEER_PS_STATE_ON && in ath11k_dbg_sta_read_total_ps_duration()
830 arsta->peer_current_ps_valid) in ath11k_dbg_sta_read_total_ps_duration()
832 - arsta->ps_start_jiffies) in ath11k_dbg_sta_read_total_ps_duration()
833 + arsta->ps_total_duration; in ath11k_dbg_sta_read_total_ps_duration()
835 power_save_duration = arsta->ps_total_duration; in ath11k_dbg_sta_read_total_ps_duration()
839 spin_unlock_bh(&ar->data_lock); in ath11k_dbg_sta_read_total_ps_duration()
854 struct ath11k *ar = hw->priv; in ath11k_debugfs_sta_op_add()
875 ar->ab->wmi_ab.svc_map)) in ath11k_debugfs_sta_op_add()
883 ar->ab->wmi_ab.svc_map)) { in ath11k_debugfs_sta_op_add()