Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <nbd@nbd.name>
Link: https://lore.kernel.org/r/20210127055735.78599-5-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Felix Fietkau and committed by
Johannes Berg
4a8d0c99 80d55154

+16 -2
+16 -2
net/mac80211/rc80211_minstrel_ht_debugfs.c
··· 32 32 return 0; 33 33 } 34 34 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 + 35 47 static char * 36 48 minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p) 37 49 { ··· 96 84 *(p++) = (idx == mi->max_tp_rate[2]) ? 'C' : ' '; 97 85 *(p++) = (idx == mi->max_tp_rate[3]) ? 'D' : ' '; 98 86 *(p++) = (idx == mi->max_prob_rate) ? 'P' : ' '; 87 + *(p++) = minstrel_ht_is_sample_rate(mi, idx) ? 'S' : ' '; 99 88 100 89 if (gflags & IEEE80211_TX_RC_MCS) { 101 90 p += sprintf(p, " MCS%-2u", (mg->streams - 1) * 8 + j); ··· 158 145 159 146 p += sprintf(p, "\n"); 160 147 p += sprintf(p, 161 - " best ____________rate__________ ____statistics___ _____last____ ______sum-of________\n"); 148 + " best ____________rate__________ ____statistics___ _____last____ ______sum-of________\n"); 162 149 p += sprintf(p, 163 - "mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob)] [retry|suc|att] [#success | #attempts]\n"); 150 + "mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob)] [retry|suc|att] [#success | #attempts]\n"); 164 151 165 152 p = minstrel_ht_stats_dump(mi, MINSTREL_CCK_GROUP, p); 166 153 for (i = 0; i < MINSTREL_CCK_GROUP; i++) ··· 241 228 p += sprintf(p, "%s" ,((idx == mi->max_tp_rate[2]) ? "C" : "")); 242 229 p += sprintf(p, "%s" ,((idx == mi->max_tp_rate[3]) ? "D" : "")); 243 230 p += sprintf(p, "%s" ,((idx == mi->max_prob_rate) ? "P" : "")); 231 + p += sprintf(p, "%s", (minstrel_ht_is_sample_rate(mi, idx) ? "S" : "")); 244 232 245 233 if (gflags & IEEE80211_TX_RC_MCS) { 246 234 p += sprintf(p, ",MCS%-2u,", (mg->streams - 1) * 8 + j);