1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Sat, 23 Jan 2021 00:10:34 +0100
3 Subject: [PATCH] mac80211: minstrel_ht: show sampling rates in debugfs
5 This makes it easier to see what rates are going to be tested next
7 Signed-off-by: Felix Fietkau <nbd@nbd.name>
10 --- a/net/mac80211/rc80211_minstrel_ht_debugfs.c
11 +++ b/net/mac80211/rc80211_minstrel_ht_debugfs.c
12 @@ -32,6 +32,18 @@ minstrel_stats_release(struct inode *ino
17 +minstrel_ht_is_sample_rate(struct minstrel_ht_sta *mi, int idx)
21 + for (type = 0; type < ARRAY_SIZE(mi->sample); type++)
22 + for (i = 0; i < MINSTREL_SAMPLE_RATES; i++)
23 + if (mi->sample[type].cur_sample_rates[i] == idx)
29 minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p)
31 @@ -84,6 +96,7 @@ minstrel_ht_stats_dump(struct minstrel_h
32 *(p++) = (idx == mi->max_tp_rate[2]) ? 'C' : ' ';
33 *(p++) = (idx == mi->max_tp_rate[3]) ? 'D' : ' ';
34 *(p++) = (idx == mi->max_prob_rate) ? 'P' : ' ';
35 + *(p++) = minstrel_ht_is_sample_rate(mi, idx) ? 'S' : ' ';
37 if (gflags & IEEE80211_TX_RC_MCS) {
38 p += sprintf(p, " MCS%-2u", (mg->streams - 1) * 8 + j);
39 @@ -145,9 +158,9 @@ minstrel_ht_stats_open(struct inode *ino
41 p += sprintf(p, "\n");
43 - " best ____________rate__________ ____statistics___ _____last____ ______sum-of________\n");
44 + " best ____________rate__________ ____statistics___ _____last____ ______sum-of________\n");
46 - "mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob)] [retry|suc|att] [#success | #attempts]\n");
47 + "mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob)] [retry|suc|att] [#success | #attempts]\n");
49 p = minstrel_ht_stats_dump(mi, MINSTREL_CCK_GROUP, p);
50 for (i = 0; i < MINSTREL_CCK_GROUP; i++)
51 @@ -228,6 +241,8 @@ minstrel_ht_stats_csv_dump(struct minstr
52 p += sprintf(p, "%s" ,((idx == mi->max_tp_rate[2]) ? "C" : ""));
53 p += sprintf(p, "%s" ,((idx == mi->max_tp_rate[3]) ? "D" : ""));
54 p += sprintf(p, "%s" ,((idx == mi->max_prob_rate) ? "P" : ""));
55 + p += sprintf(p, "%s" ,((idx == mi->max_prob_rate) ? "P" : ""));
56 + p += sprintf(p, "%s", (minstrel_ht_is_sample_rate(mi, idx) ? "S" : ""));
58 if (gflags & IEEE80211_TX_RC_MCS) {
59 p += sprintf(p, ",MCS%-2u,", (mg->streams - 1) * 8 + j);