@@ -32,6 +32,18 @@ minstrel_stats_release(struct inode *inode, struct file *file)
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
{
@@ -84,6 +96,7 @@ minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p)
84
96
* (p ++ ) = (idx == mi -> max_tp_rate [2 ]) ? 'C' : ' ' ;
85
97
* (p ++ ) = (idx == mi -> max_tp_rate [3 ]) ? 'D' : ' ' ;
86
98
* (p ++ ) = (idx == mi -> max_prob_rate ) ? 'P' : ' ' ;
99
+ * (p ++ ) = minstrel_ht_is_sample_rate (mi , idx ) ? 'S' : ' ' ;
87
100
88
101
if (gflags & IEEE80211_TX_RC_MCS ) {
89
102
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
158
146
159
p += sprintf (p , "\n" );
147
160
p += sprintf (p ,
148
- " best ____________rate__________ ____statistics___ _____last____ ______sum-of________\n" );
161
+ " best ____________rate__________ ____statistics___ _____last____ ______sum-of________\n" );
149
162
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" );
151
164
152
165
p = minstrel_ht_stats_dump (mi , MINSTREL_CCK_GROUP , p );
153
166
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
241
p += sprintf (p , "%s" ,((idx == mi -> max_tp_rate [2 ]) ? "C" : "" ));
229
242
p += sprintf (p , "%s" ,((idx == mi -> max_tp_rate [3 ]) ? "D" : "" ));
230
243
p += sprintf (p , "%s" ,((idx == mi -> max_prob_rate ) ? "P" : "" ));
244
+ p += sprintf (p , "%s" , (minstrel_ht_is_sample_rate (mi , idx ) ? "S" : "" ));
231
245
232
246
if (gflags & IEEE80211_TX_RC_MCS ) {
233
247
p += sprintf (p , ",MCS%-2u," , (mg -> streams - 1 ) * 8 + j );
0 commit comments