Skip to content

Commit 4a8d0c9

Browse files
nbd168jmberg-intel
authored andcommitted
mac80211: minstrel_ht: show sampling rates in debugfs
This makes it easier to see what rates are going to be tested next Signed-off-by: Felix Fietkau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 80d5515 commit 4a8d0c9

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

net/mac80211/rc80211_minstrel_ht_debugfs.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ minstrel_stats_release(struct inode *inode, struct file *file)
3232
return 0;
3333
}
3434

35+
static bool
36+
minstrel_ht_is_sample_rate(struct minstrel_ht_sta *mi, int idx)
37+
{
38+
int type, i;
39+
40+
for (type = 0; type < ARRAY_SIZE(mi->sample); type++)
41+
for (i = 0; i < MINSTREL_SAMPLE_RATES; i++)
42+
if (mi->sample[type].cur_sample_rates[i] == idx)
43+
return true;
44+
return false;
45+
}
46+
3547
static char *
3648
minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p)
3749
{
@@ -84,6 +96,7 @@ minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p)
8496
*(p++) = (idx == mi->max_tp_rate[2]) ? 'C' : ' ';
8597
*(p++) = (idx == mi->max_tp_rate[3]) ? 'D' : ' ';
8698
*(p++) = (idx == mi->max_prob_rate) ? 'P' : ' ';
99+
*(p++) = minstrel_ht_is_sample_rate(mi, idx) ? 'S' : ' ';
87100

88101
if (gflags & IEEE80211_TX_RC_MCS) {
89102
p += sprintf(p, " MCS%-2u", (mg->streams - 1) * 8 + j);
@@ -145,9 +158,9 @@ minstrel_ht_stats_open(struct inode *inode, struct file *file)
145158

146159
p += sprintf(p, "\n");
147160
p += sprintf(p,
148-
" best ____________rate__________ ____statistics___ _____last____ ______sum-of________\n");
161+
" best ____________rate__________ ____statistics___ _____last____ ______sum-of________\n");
149162
p += sprintf(p,
150-
"mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob)] [retry|suc|att] [#success | #attempts]\n");
163+
"mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob)] [retry|suc|att] [#success | #attempts]\n");
151164

152165
p = minstrel_ht_stats_dump(mi, MINSTREL_CCK_GROUP, p);
153166
for (i = 0; i < MINSTREL_CCK_GROUP; i++)
@@ -228,6 +241,7 @@ minstrel_ht_stats_csv_dump(struct minstrel_ht_sta *mi, int i, char *p)
228241
p += sprintf(p, "%s" ,((idx == mi->max_tp_rate[2]) ? "C" : ""));
229242
p += sprintf(p, "%s" ,((idx == mi->max_tp_rate[3]) ? "D" : ""));
230243
p += sprintf(p, "%s" ,((idx == mi->max_prob_rate) ? "P" : ""));
244+
p += sprintf(p, "%s", (minstrel_ht_is_sample_rate(mi, idx) ? "S" : ""));
231245

232246
if (gflags & IEEE80211_TX_RC_MCS) {
233247
p += sprintf(p, ",MCS%-2u,", (mg->streams - 1) * 8 + j);

0 commit comments

Comments
 (0)