Commit 4a8d0c99 authored by Felix Fietkau's avatar Felix Fietkau Committed by Johannes Berg

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: default avatarFelix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20210127055735.78599-5-nbd@nbd.nameSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 80d55154
...@@ -32,6 +32,18 @@ minstrel_stats_release(struct inode *inode, struct file *file) ...@@ -32,6 +32,18 @@ minstrel_stats_release(struct inode *inode, struct file *file)
return 0; return 0;
} }
static bool
minstrel_ht_is_sample_rate(struct minstrel_ht_sta *mi, int idx)
{
int type, i;
for (type = 0; type < ARRAY_SIZE(mi->sample); type++)
for (i = 0; i < MINSTREL_SAMPLE_RATES; i++)
if (mi->sample[type].cur_sample_rates[i] == idx)
return true;
return false;
}
static char * static char *
minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p) minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p)
{ {
...@@ -84,6 +96,7 @@ minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p) ...@@ -84,6 +96,7 @@ minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p)
*(p++) = (idx == mi->max_tp_rate[2]) ? 'C' : ' '; *(p++) = (idx == mi->max_tp_rate[2]) ? 'C' : ' ';
*(p++) = (idx == mi->max_tp_rate[3]) ? 'D' : ' '; *(p++) = (idx == mi->max_tp_rate[3]) ? 'D' : ' ';
*(p++) = (idx == mi->max_prob_rate) ? 'P' : ' '; *(p++) = (idx == mi->max_prob_rate) ? 'P' : ' ';
*(p++) = minstrel_ht_is_sample_rate(mi, idx) ? 'S' : ' ';
if (gflags & IEEE80211_TX_RC_MCS) { if (gflags & IEEE80211_TX_RC_MCS) {
p += sprintf(p, " MCS%-2u", (mg->streams - 1) * 8 + j); p += sprintf(p, " MCS%-2u", (mg->streams - 1) * 8 + j);
...@@ -145,9 +158,9 @@ minstrel_ht_stats_open(struct inode *inode, struct file *file) ...@@ -145,9 +158,9 @@ minstrel_ht_stats_open(struct inode *inode, struct file *file)
p += sprintf(p, "\n"); p += sprintf(p, "\n");
p += sprintf(p, p += sprintf(p,
" best ____________rate__________ ____statistics___ _____last____ ______sum-of________\n"); " best ____________rate__________ ____statistics___ _____last____ ______sum-of________\n");
p += sprintf(p, p += sprintf(p,
"mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob)] [retry|suc|att] [#success | #attempts]\n"); "mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob)] [retry|suc|att] [#success | #attempts]\n");
p = minstrel_ht_stats_dump(mi, MINSTREL_CCK_GROUP, p); p = minstrel_ht_stats_dump(mi, MINSTREL_CCK_GROUP, p);
for (i = 0; i < MINSTREL_CCK_GROUP; i++) 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) ...@@ -228,6 +241,7 @@ minstrel_ht_stats_csv_dump(struct minstrel_ht_sta *mi, int i, char *p)
p += sprintf(p, "%s" ,((idx == mi->max_tp_rate[2]) ? "C" : "")); p += sprintf(p, "%s" ,((idx == mi->max_tp_rate[2]) ? "C" : ""));
p += sprintf(p, "%s" ,((idx == mi->max_tp_rate[3]) ? "D" : "")); p += sprintf(p, "%s" ,((idx == mi->max_tp_rate[3]) ? "D" : ""));
p += sprintf(p, "%s" ,((idx == mi->max_prob_rate) ? "P" : "")); p += sprintf(p, "%s" ,((idx == mi->max_prob_rate) ? "P" : ""));
p += sprintf(p, "%s", (minstrel_ht_is_sample_rate(mi, idx) ? "S" : ""));
if (gflags & IEEE80211_TX_RC_MCS) { if (gflags & IEEE80211_TX_RC_MCS) {
p += sprintf(p, ",MCS%-2u,", (mg->streams - 1) * 8 + j); p += sprintf(p, ",MCS%-2u,", (mg->streams - 1) * 8 + j);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment