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.
19 struct rate_info *txrate = &arsta->txrate; in ath11k_debugfs_sta_add_tx_stats()
23 if (!arsta->tx_stats) in ath11k_debugfs_sta_add_tx_stats()
26 tx_stats = arsta->tx_stats; in ath11k_debugfs_sta_add_tx_stats()
27 gi = FIELD_GET(RATE_INFO_FLAGS_SHORT_GI, arsta->txrate.flags); in ath11k_debugfs_sta_add_tx_stats()
28 mcs = txrate->mcs; in ath11k_debugfs_sta_add_tx_stats()
29 bw = ath11k_mac_mac80211_bw_to_ath11k_bw(txrate->bw); in ath11k_debugfs_sta_add_tx_stats()
30 nss = txrate->nss - 1; in ath11k_debugfs_sta_add_tx_stats()
32 #define STATS_OP_FMT(name) tx_stats->stats[ATH11K_STATS_TYPE_##name] in ath11k_debugfs_sta_add_tx_stats()
34 if (txrate->flags & RATE_INFO_FLAGS_HE_MCS) { in ath11k_debugfs_sta_add_tx_stats()
35 STATS_OP_FMT(SUCC).he[0][mcs] += peer_stats->succ_bytes; in ath11k_debugfs_sta_add_tx_stats()
36 STATS_OP_FMT(SUCC).he[1][mcs] += peer_stats->succ_pkts; in ath11k_debugfs_sta_add_tx_stats()
37 STATS_OP_FMT(FAIL).he[0][mcs] += peer_stats->failed_bytes; in ath11k_debugfs_sta_add_tx_stats()
38 STATS_OP_FMT(FAIL).he[1][mcs] += peer_stats->failed_pkts; in ath11k_debugfs_sta_add_tx_stats()
39 STATS_OP_FMT(RETRY).he[0][mcs] += peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
40 STATS_OP_FMT(RETRY).he[1][mcs] += peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
41 } else if (txrate->flags & RATE_INFO_FLAGS_VHT_MCS) { in ath11k_debugfs_sta_add_tx_stats()
42 STATS_OP_FMT(SUCC).vht[0][mcs] += peer_stats->succ_bytes; in ath11k_debugfs_sta_add_tx_stats()
43 STATS_OP_FMT(SUCC).vht[1][mcs] += peer_stats->succ_pkts; in ath11k_debugfs_sta_add_tx_stats()
44 STATS_OP_FMT(FAIL).vht[0][mcs] += peer_stats->failed_bytes; in ath11k_debugfs_sta_add_tx_stats()
45 STATS_OP_FMT(FAIL).vht[1][mcs] += peer_stats->failed_pkts; in ath11k_debugfs_sta_add_tx_stats()
46 STATS_OP_FMT(RETRY).vht[0][mcs] += peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
47 STATS_OP_FMT(RETRY).vht[1][mcs] += peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
48 } else if (txrate->flags & RATE_INFO_FLAGS_MCS) { in ath11k_debugfs_sta_add_tx_stats()
49 STATS_OP_FMT(SUCC).ht[0][mcs] += peer_stats->succ_bytes; in ath11k_debugfs_sta_add_tx_stats()
50 STATS_OP_FMT(SUCC).ht[1][mcs] += peer_stats->succ_pkts; in ath11k_debugfs_sta_add_tx_stats()
51 STATS_OP_FMT(FAIL).ht[0][mcs] += peer_stats->failed_bytes; in ath11k_debugfs_sta_add_tx_stats()
52 STATS_OP_FMT(FAIL).ht[1][mcs] += peer_stats->failed_pkts; in ath11k_debugfs_sta_add_tx_stats()
53 STATS_OP_FMT(RETRY).ht[0][mcs] += peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
54 STATS_OP_FMT(RETRY).ht[1][mcs] += peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
58 STATS_OP_FMT(SUCC).legacy[0][mcs] += peer_stats->succ_bytes; in ath11k_debugfs_sta_add_tx_stats()
59 STATS_OP_FMT(SUCC).legacy[1][mcs] += peer_stats->succ_pkts; in ath11k_debugfs_sta_add_tx_stats()
60 STATS_OP_FMT(FAIL).legacy[0][mcs] += peer_stats->failed_bytes; in ath11k_debugfs_sta_add_tx_stats()
61 STATS_OP_FMT(FAIL).legacy[1][mcs] += peer_stats->failed_pkts; in ath11k_debugfs_sta_add_tx_stats()
62 STATS_OP_FMT(RETRY).legacy[0][mcs] += peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
63 STATS_OP_FMT(RETRY).legacy[1][mcs] += peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
66 if (peer_stats->is_ampdu) { in ath11k_debugfs_sta_add_tx_stats()
67 tx_stats->ba_fails += peer_stats->ba_fails; in ath11k_debugfs_sta_add_tx_stats()
69 if (txrate->flags & RATE_INFO_FLAGS_HE_MCS) { in ath11k_debugfs_sta_add_tx_stats()
71 peer_stats->succ_bytes + peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
73 peer_stats->succ_pkts + peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
74 } else if (txrate->flags & RATE_INFO_FLAGS_MCS) { in ath11k_debugfs_sta_add_tx_stats()
76 peer_stats->succ_bytes + peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
78 peer_stats->succ_pkts + peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
81 peer_stats->succ_bytes + peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
83 peer_stats->succ_pkts + peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
86 peer_stats->succ_bytes + peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
88 peer_stats->succ_bytes + peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
90 peer_stats->succ_bytes + peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
92 peer_stats->succ_pkts + peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
94 peer_stats->succ_pkts + peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
96 peer_stats->succ_pkts + peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
98 tx_stats->ack_fails += peer_stats->ba_fails; in ath11k_debugfs_sta_add_tx_stats()
101 STATS_OP_FMT(SUCC).bw[0][bw] += peer_stats->succ_bytes; in ath11k_debugfs_sta_add_tx_stats()
102 STATS_OP_FMT(SUCC).nss[0][nss] += peer_stats->succ_bytes; in ath11k_debugfs_sta_add_tx_stats()
103 STATS_OP_FMT(SUCC).gi[0][gi] += peer_stats->succ_bytes; in ath11k_debugfs_sta_add_tx_stats()
105 STATS_OP_FMT(SUCC).bw[1][bw] += peer_stats->succ_pkts; in ath11k_debugfs_sta_add_tx_stats()
106 STATS_OP_FMT(SUCC).nss[1][nss] += peer_stats->succ_pkts; in ath11k_debugfs_sta_add_tx_stats()
107 STATS_OP_FMT(SUCC).gi[1][gi] += peer_stats->succ_pkts; in ath11k_debugfs_sta_add_tx_stats()
109 STATS_OP_FMT(FAIL).bw[0][bw] += peer_stats->failed_bytes; in ath11k_debugfs_sta_add_tx_stats()
110 STATS_OP_FMT(FAIL).nss[0][nss] += peer_stats->failed_bytes; in ath11k_debugfs_sta_add_tx_stats()
111 STATS_OP_FMT(FAIL).gi[0][gi] += peer_stats->failed_bytes; in ath11k_debugfs_sta_add_tx_stats()
113 STATS_OP_FMT(FAIL).bw[1][bw] += peer_stats->failed_pkts; in ath11k_debugfs_sta_add_tx_stats()
114 STATS_OP_FMT(FAIL).nss[1][nss] += peer_stats->failed_pkts; in ath11k_debugfs_sta_add_tx_stats()
115 STATS_OP_FMT(FAIL).gi[1][gi] += peer_stats->failed_pkts; in ath11k_debugfs_sta_add_tx_stats()
117 STATS_OP_FMT(RETRY).bw[0][bw] += peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
118 STATS_OP_FMT(RETRY).nss[0][nss] += peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
119 STATS_OP_FMT(RETRY).gi[0][gi] += peer_stats->retry_bytes; in ath11k_debugfs_sta_add_tx_stats()
121 STATS_OP_FMT(RETRY).bw[1][bw] += peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
122 STATS_OP_FMT(RETRY).nss[1][nss] += peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
123 STATS_OP_FMT(RETRY).gi[1][gi] += peer_stats->retry_pkts; in ath11k_debugfs_sta_add_tx_stats()
125 tx_stats->tx_duration += peer_stats->duration; in ath11k_debugfs_sta_add_tx_stats()
138 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_dump_tx_stats()
139 struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_dbg_sta_dump_tx_stats()
140 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_dump_tx_stats()
143 "retry", "ampdu"}; in ath11k_dbg_sta_dump_tx_stats()
149 if (!arsta->tx_stats) in ath11k_dbg_sta_dump_tx_stats()
150 return -ENOENT; in ath11k_dbg_sta_dump_tx_stats()
154 return -ENOMEM; in ath11k_dbg_sta_dump_tx_stats()
156 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_dump_tx_stats()
158 spin_lock_bh(&ar->data_lock); in ath11k_dbg_sta_dump_tx_stats()
161 stats = &arsta->tx_stats->stats[k]; in ath11k_dbg_sta_dump_tx_stats()
162 len += scnprintf(buf + len, size - len, "%s_%s\n", in ath11k_dbg_sta_dump_tx_stats()
165 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
169 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
171 stats->he[j][i]); in ath11k_dbg_sta_dump_tx_stats()
172 len += scnprintf(buf + len, size - len, "\n"); in ath11k_dbg_sta_dump_tx_stats()
173 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
177 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
179 stats->vht[j][i]); in ath11k_dbg_sta_dump_tx_stats()
180 len += scnprintf(buf + len, size - len, "\n"); in ath11k_dbg_sta_dump_tx_stats()
181 len += scnprintf(buf + len, size - len, " HT MCS %s\n", in ath11k_dbg_sta_dump_tx_stats()
184 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
185 " %llu ", stats->ht[j][i]); in ath11k_dbg_sta_dump_tx_stats()
186 len += scnprintf(buf + len, size - len, "\n"); in ath11k_dbg_sta_dump_tx_stats()
187 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
189 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
191 stats->bw[j][0], stats->bw[j][1], in ath11k_dbg_sta_dump_tx_stats()
192 stats->bw[j][2], stats->bw[j][3]); in ath11k_dbg_sta_dump_tx_stats()
193 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
195 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
197 stats->nss[j][0], stats->nss[j][1], in ath11k_dbg_sta_dump_tx_stats()
198 stats->nss[j][2], stats->nss[j][3]); in ath11k_dbg_sta_dump_tx_stats()
199 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
202 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
204 stats->gi[j][0], stats->gi[j][1], in ath11k_dbg_sta_dump_tx_stats()
205 stats->gi[j][2], stats->gi[j][3]); in ath11k_dbg_sta_dump_tx_stats()
206 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
210 len += scnprintf(buf + len, size - len, "%llu ", in ath11k_dbg_sta_dump_tx_stats()
211 stats->legacy[j][i]); in ath11k_dbg_sta_dump_tx_stats()
212 len += scnprintf(buf + len, size - len, "\n"); in ath11k_dbg_sta_dump_tx_stats()
216 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
218 arsta->tx_stats->tx_duration); in ath11k_dbg_sta_dump_tx_stats()
219 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
220 "BA fails\n %llu\n", arsta->tx_stats->ba_fails); in ath11k_dbg_sta_dump_tx_stats()
221 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_tx_stats()
222 "ack fails\n %llu\n", arsta->tx_stats->ack_fails); in ath11k_dbg_sta_dump_tx_stats()
223 spin_unlock_bh(&ar->data_lock); in ath11k_dbg_sta_dump_tx_stats()
230 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_dump_tx_stats()
245 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_dump_rx_stats()
246 struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_dbg_sta_dump_rx_stats()
247 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_dump_rx_stats()
248 struct ath11k_rx_peer_stats *rx_stats = arsta->rx_stats; in ath11k_dbg_sta_dump_rx_stats()
254 return -ENOENT; in ath11k_dbg_sta_dump_rx_stats()
258 return -ENOMEM; in ath11k_dbg_sta_dump_rx_stats()
260 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_dump_rx_stats()
261 spin_lock_bh(&ar->ab->base_lock); in ath11k_dbg_sta_dump_rx_stats()
263 len += scnprintf(buf + len, size - len, "RX peer stats:\n"); in ath11k_dbg_sta_dump_rx_stats()
264 len += scnprintf(buf + len, size - len, "Num of MSDUs: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
265 rx_stats->num_msdu); in ath11k_dbg_sta_dump_rx_stats()
266 len += scnprintf(buf + len, size - len, "Num of MSDUs with TCP L4: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
267 rx_stats->tcp_msdu_count); in ath11k_dbg_sta_dump_rx_stats()
268 len += scnprintf(buf + len, size - len, "Num of MSDUs with UDP L4: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
269 rx_stats->udp_msdu_count); in ath11k_dbg_sta_dump_rx_stats()
270 len += scnprintf(buf + len, size - len, "Num of MSDUs part of AMPDU: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
271 rx_stats->ampdu_msdu_count); in ath11k_dbg_sta_dump_rx_stats()
272 len += scnprintf(buf + len, size - len, "Num of MSDUs not part of AMPDU: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
273 rx_stats->non_ampdu_msdu_count); in ath11k_dbg_sta_dump_rx_stats()
274 len += scnprintf(buf + len, size - len, "Num of MSDUs using STBC: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
275 rx_stats->stbc_count); in ath11k_dbg_sta_dump_rx_stats()
276 len += scnprintf(buf + len, size - len, "Num of MSDUs beamformed: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
277 rx_stats->beamformed_count); in ath11k_dbg_sta_dump_rx_stats()
278 len += scnprintf(buf + len, size - len, "Num of MPDUs with FCS ok: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
279 rx_stats->num_mpdu_fcs_ok); in ath11k_dbg_sta_dump_rx_stats()
280 len += scnprintf(buf + len, size - len, "Num of MPDUs with FCS error: %llu\n", in ath11k_dbg_sta_dump_rx_stats()
281 rx_stats->num_mpdu_fcs_err); in ath11k_dbg_sta_dump_rx_stats()
282 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_rx_stats()
284 rx_stats->gi_count[0], rx_stats->gi_count[1], in ath11k_dbg_sta_dump_rx_stats()
285 rx_stats->gi_count[2], rx_stats->gi_count[3]); in ath11k_dbg_sta_dump_rx_stats()
286 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_rx_stats()
288 rx_stats->bw_count[0], rx_stats->bw_count[1], in ath11k_dbg_sta_dump_rx_stats()
289 rx_stats->bw_count[2], rx_stats->bw_count[3]); in ath11k_dbg_sta_dump_rx_stats()
290 len += scnprintf(buf + len, size - len, "BCC %llu LDPC %llu\n", in ath11k_dbg_sta_dump_rx_stats()
291 rx_stats->coding_count[0], rx_stats->coding_count[1]); in ath11k_dbg_sta_dump_rx_stats()
292 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_rx_stats()
294 rx_stats->pream_cnt[0], rx_stats->pream_cnt[1], in ath11k_dbg_sta_dump_rx_stats()
295 rx_stats->pream_cnt[2], rx_stats->pream_cnt[3], in ath11k_dbg_sta_dump_rx_stats()
296 rx_stats->pream_cnt[4]); in ath11k_dbg_sta_dump_rx_stats()
297 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_rx_stats()
299 rx_stats->reception_type[0], rx_stats->reception_type[1], in ath11k_dbg_sta_dump_rx_stats()
300 rx_stats->reception_type[2], rx_stats->reception_type[3]); in ath11k_dbg_sta_dump_rx_stats()
301 len += scnprintf(buf + len, size - len, "TID(0-15) Legacy TID(16):"); in ath11k_dbg_sta_dump_rx_stats()
303 len += scnprintf(buf + len, size - len, "%llu ", rx_stats->tid_count[i]); in ath11k_dbg_sta_dump_rx_stats()
304 len += scnprintf(buf + len, size - len, "\nMCS(0-11) Legacy MCS(12):"); in ath11k_dbg_sta_dump_rx_stats()
306 len += scnprintf(buf + len, size - len, "%llu ", rx_stats->mcs_count[i]); in ath11k_dbg_sta_dump_rx_stats()
307 len += scnprintf(buf + len, size - len, "\nNSS(1-8):"); in ath11k_dbg_sta_dump_rx_stats()
309 len += scnprintf(buf + len, size - len, "%llu ", rx_stats->nss_count[i]); in ath11k_dbg_sta_dump_rx_stats()
310 len += scnprintf(buf + len, size - len, "\nRX Duration:%llu ", in ath11k_dbg_sta_dump_rx_stats()
311 rx_stats->rx_duration); in ath11k_dbg_sta_dump_rx_stats()
312 len += scnprintf(buf + len, size - len, in ath11k_dbg_sta_dump_rx_stats()
314 rx_stats->dcm_count, rx_stats->ru_alloc_cnt[0], in ath11k_dbg_sta_dump_rx_stats()
315 rx_stats->ru_alloc_cnt[1], rx_stats->ru_alloc_cnt[2], in ath11k_dbg_sta_dump_rx_stats()
316 rx_stats->ru_alloc_cnt[3], rx_stats->ru_alloc_cnt[4], in ath11k_dbg_sta_dump_rx_stats()
317 rx_stats->ru_alloc_cnt[5]); in ath11k_dbg_sta_dump_rx_stats()
319 len += scnprintf(buf + len, size - len, "\n"); in ath11k_dbg_sta_dump_rx_stats()
321 spin_unlock_bh(&ar->ab->base_lock); in ath11k_dbg_sta_dump_rx_stats()
328 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_dump_rx_stats()
342 struct ieee80211_sta *sta = inode->i_private; in ath11k_dbg_sta_open_htt_peer_stats()
343 struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_dbg_sta_open_htt_peer_stats()
344 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_open_htt_peer_stats()
346 int type = ar->debug.htt_stats.type; in ath11k_dbg_sta_open_htt_peer_stats()
352 return -EPERM; in ath11k_dbg_sta_open_htt_peer_stats()
356 return -ENOMEM; in ath11k_dbg_sta_open_htt_peer_stats()
358 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_open_htt_peer_stats()
359 ar->debug.htt_stats.stats_req = stats_req; in ath11k_dbg_sta_open_htt_peer_stats()
360 stats_req->type = type; in ath11k_dbg_sta_open_htt_peer_stats()
361 memcpy(stats_req->peer_addr, sta->addr, ETH_ALEN); in ath11k_dbg_sta_open_htt_peer_stats()
363 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_open_htt_peer_stats()
367 file->private_data = stats_req; in ath11k_dbg_sta_open_htt_peer_stats()
371 ar->debug.htt_stats.stats_req = NULL; in ath11k_dbg_sta_open_htt_peer_stats()
378 struct ieee80211_sta *sta = inode->i_private; in ath11k_dbg_sta_release_htt_peer_stats()
379 struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_dbg_sta_release_htt_peer_stats()
380 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_release_htt_peer_stats()
382 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_release_htt_peer_stats()
383 vfree(file->private_data); in ath11k_dbg_sta_release_htt_peer_stats()
384 ar->debug.htt_stats.stats_req = NULL; in ath11k_dbg_sta_release_htt_peer_stats()
385 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_release_htt_peer_stats()
394 struct debug_htt_stats_req *stats_req = file->private_data; in ath11k_dbg_sta_read_htt_peer_stats()
398 buf = stats_req->buf; in ath11k_dbg_sta_read_htt_peer_stats()
399 length = min_t(u32, stats_req->buf_len, ATH11K_HTT_STATS_BUF_SIZE); in ath11k_dbg_sta_read_htt_peer_stats()
415 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_write_peer_pktlog()
416 struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_dbg_sta_write_peer_pktlog()
417 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_write_peer_pktlog()
420 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_write_peer_pktlog()
422 if (ar->state != ATH11K_STATE_ON) { in ath11k_dbg_sta_write_peer_pktlog()
423 ret = -ENETDOWN; in ath11k_dbg_sta_write_peer_pktlog()
431 ar->debug.pktlog_peer_valid = enable; in ath11k_dbg_sta_write_peer_pktlog()
432 memcpy(ar->debug.pktlog_peer_addr, sta->addr, ETH_ALEN); in ath11k_dbg_sta_write_peer_pktlog()
435 ret = ath11k_wmi_pdev_peer_pktlog_filter(ar, sta->addr, enable); in ath11k_dbg_sta_write_peer_pktlog()
437 ath11k_warn(ar->ab, "failed to set peer pktlog filter %pM: %d\n", in ath11k_dbg_sta_write_peer_pktlog()
438 sta->addr, ret); in ath11k_dbg_sta_write_peer_pktlog()
442 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "peer pktlog filter set to %d\n", in ath11k_dbg_sta_write_peer_pktlog()
447 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_write_peer_pktlog()
455 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_read_peer_pktlog()
456 struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_dbg_sta_read_peer_pktlog()
457 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_read_peer_pktlog()
461 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_read_peer_pktlog()
463 ar->debug.pktlog_peer_valid, in ath11k_dbg_sta_read_peer_pktlog()
464 ar->debug.pktlog_peer_addr); in ath11k_dbg_sta_read_peer_pktlog()
465 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_read_peer_pktlog()
482 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_write_delba()
483 struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_dbg_sta_write_delba()
484 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_write_delba()
489 ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, in ath11k_dbg_sta_write_delba()
496 return -EINVAL; in ath11k_dbg_sta_write_delba()
499 if (tid > HAL_DESC_REO_NON_QOS_TID - 1) in ath11k_dbg_sta_write_delba()
500 return -EINVAL; in ath11k_dbg_sta_write_delba()
502 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_write_delba()
503 if (ar->state != ATH11K_STATE_ON || in ath11k_dbg_sta_write_delba()
504 arsta->aggr_mode != ATH11K_DBG_AGGR_MODE_MANUAL) { in ath11k_dbg_sta_write_delba()
509 ret = ath11k_wmi_delba_send(ar, arsta->arvif->vdev_id, sta->addr, in ath11k_dbg_sta_write_delba()
512 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()
513 arsta->arvif->vdev_id, sta->addr, tid, initiator, in ath11k_dbg_sta_write_delba()
518 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_write_delba()
533 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_write_addba_resp()
534 struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_dbg_sta_write_addba_resp()
535 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_write_addba_resp()
540 ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, in ath11k_dbg_sta_write_addba_resp()
547 return -EINVAL; in ath11k_dbg_sta_write_addba_resp()
550 if (tid > HAL_DESC_REO_NON_QOS_TID - 1) in ath11k_dbg_sta_write_addba_resp()
551 return -EINVAL; in ath11k_dbg_sta_write_addba_resp()
553 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_write_addba_resp()
554 if (ar->state != ATH11K_STATE_ON || in ath11k_dbg_sta_write_addba_resp()
555 arsta->aggr_mode != ATH11K_DBG_AGGR_MODE_MANUAL) { in ath11k_dbg_sta_write_addba_resp()
560 ret = ath11k_wmi_addba_set_resp(ar, arsta->arvif->vdev_id, sta->addr, in ath11k_dbg_sta_write_addba_resp()
563 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()
564 arsta->arvif->vdev_id, sta->addr, tid, status); in ath11k_dbg_sta_write_addba_resp()
568 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_write_addba_resp()
583 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_write_addba()
584 struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_dbg_sta_write_addba()
585 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_write_addba()
590 ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, in ath11k_dbg_sta_write_addba()
597 return -EINVAL; in ath11k_dbg_sta_write_addba()
600 if (tid > HAL_DESC_REO_NON_QOS_TID - 1) in ath11k_dbg_sta_write_addba()
601 return -EINVAL; in ath11k_dbg_sta_write_addba()
603 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_write_addba()
604 if (ar->state != ATH11K_STATE_ON || in ath11k_dbg_sta_write_addba()
605 arsta->aggr_mode != ATH11K_DBG_AGGR_MODE_MANUAL) { in ath11k_dbg_sta_write_addba()
610 ret = ath11k_wmi_addba_send(ar, arsta->arvif->vdev_id, sta->addr, in ath11k_dbg_sta_write_addba()
613 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()
614 arsta->arvif->vdev_id, sta->addr, tid, buf_size); in ath11k_dbg_sta_write_addba()
619 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_write_addba()
634 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_read_aggr_mode()
635 struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_dbg_sta_read_aggr_mode()
636 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_read_aggr_mode()
640 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_read_aggr_mode()
641 len = scnprintf(buf, sizeof(buf) - len, in ath11k_dbg_sta_read_aggr_mode()
643 (arsta->aggr_mode == ATH11K_DBG_AGGR_MODE_AUTO) ? in ath11k_dbg_sta_read_aggr_mode()
644 "auto" : "manual", "auto = 0", "manual = 1"); in ath11k_dbg_sta_read_aggr_mode()
645 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_read_aggr_mode()
654 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_write_aggr_mode()
655 struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_dbg_sta_write_aggr_mode()
656 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_write_aggr_mode()
661 return -EINVAL; in ath11k_dbg_sta_write_aggr_mode()
664 return -EINVAL; in ath11k_dbg_sta_write_aggr_mode()
666 mutex_lock(&ar->conf_mutex); in ath11k_dbg_sta_write_aggr_mode()
667 if (ar->state != ATH11K_STATE_ON || in ath11k_dbg_sta_write_aggr_mode()
668 aggr_mode == arsta->aggr_mode) { in ath11k_dbg_sta_write_aggr_mode()
673 ret = ath11k_wmi_addba_clear_resp(ar, arsta->arvif->vdev_id, sta->addr); in ath11k_dbg_sta_write_aggr_mode()
675 ath11k_warn(ar->ab, "failed to clear addba session ret: %d\n", in ath11k_dbg_sta_write_aggr_mode()
680 arsta->aggr_mode = aggr_mode; in ath11k_dbg_sta_write_aggr_mode()
682 mutex_unlock(&ar->conf_mutex); in ath11k_dbg_sta_write_aggr_mode()
699 struct ieee80211_sta *sta = file->private_data; in ath11k_write_htt_peer_stats_reset()
700 struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_write_htt_peer_stats_reset()
701 struct ath11k *ar = arsta->arvif->ar; in ath11k_write_htt_peer_stats_reset()
713 mutex_lock(&ar->conf_mutex); in ath11k_write_htt_peer_stats_reset()
720 cfg_params.cfg2 |= FIELD_PREP(GENMASK(7, 0), sta->addr[0]); in ath11k_write_htt_peer_stats_reset()
721 cfg_params.cfg2 |= FIELD_PREP(GENMASK(15, 8), sta->addr[1]); in ath11k_write_htt_peer_stats_reset()
722 cfg_params.cfg2 |= FIELD_PREP(GENMASK(23, 16), sta->addr[2]); in ath11k_write_htt_peer_stats_reset()
723 cfg_params.cfg2 |= FIELD_PREP(GENMASK(31, 24), sta->addr[3]); in ath11k_write_htt_peer_stats_reset()
725 cfg_params.cfg3 |= FIELD_PREP(GENMASK(7, 0), sta->addr[4]); in ath11k_write_htt_peer_stats_reset()
726 cfg_params.cfg3 |= FIELD_PREP(GENMASK(15, 8), sta->addr[5]); in ath11k_write_htt_peer_stats_reset()
735 ath11k_warn(ar->ab, "failed to send htt peer stats request: %d\n", ret); in ath11k_write_htt_peer_stats_reset()
736 mutex_unlock(&ar->conf_mutex); in ath11k_write_htt_peer_stats_reset()
740 mutex_unlock(&ar->conf_mutex); in ath11k_write_htt_peer_stats_reset()
758 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_read_peer_ps_state()
759 struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_dbg_sta_read_peer_ps_state()
760 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_read_peer_ps_state()
764 spin_lock_bh(&ar->data_lock); in ath11k_dbg_sta_read_peer_ps_state()
766 len = scnprintf(buf, sizeof(buf), "%d\n", arsta->peer_ps_state); in ath11k_dbg_sta_read_peer_ps_state()
768 spin_unlock_bh(&ar->data_lock); in ath11k_dbg_sta_read_peer_ps_state()
785 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_read_current_ps_duration()
786 struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_dbg_sta_read_current_ps_duration()
787 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_read_current_ps_duration()
792 spin_lock_bh(&ar->data_lock); in ath11k_dbg_sta_read_current_ps_duration()
794 if (arsta->peer_ps_state == WMI_PEER_PS_STATE_ON && in ath11k_dbg_sta_read_current_ps_duration()
795 arsta->peer_current_ps_valid) in ath11k_dbg_sta_read_current_ps_duration()
797 - arsta->ps_start_jiffies); in ath11k_dbg_sta_read_current_ps_duration()
803 spin_unlock_bh(&ar->data_lock); in ath11k_dbg_sta_read_current_ps_duration()
819 struct ieee80211_sta *sta = file->private_data; in ath11k_dbg_sta_read_total_ps_duration()
820 struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_dbg_sta_read_total_ps_duration()
821 struct ath11k *ar = arsta->arvif->ar; in ath11k_dbg_sta_read_total_ps_duration()
826 spin_lock_bh(&ar->data_lock); in ath11k_dbg_sta_read_total_ps_duration()
828 if (arsta->peer_ps_state == WMI_PEER_PS_STATE_ON && in ath11k_dbg_sta_read_total_ps_duration()
829 arsta->peer_current_ps_valid) in ath11k_dbg_sta_read_total_ps_duration()
831 - arsta->ps_start_jiffies) in ath11k_dbg_sta_read_total_ps_duration()
832 + arsta->ps_total_duration; in ath11k_dbg_sta_read_total_ps_duration()
834 power_save_duration = arsta->ps_total_duration; in ath11k_dbg_sta_read_total_ps_duration()
838 spin_unlock_bh(&ar->data_lock); in ath11k_dbg_sta_read_total_ps_duration()
853 struct ath11k *ar = hw->priv; in ath11k_debugfs_sta_op_add()
874 ar->ab->wmi_ab.svc_map)) in ath11k_debugfs_sta_op_add()
882 ar->ab->wmi_ab.svc_map)) { in ath11k_debugfs_sta_op_add()