@@ -648,27 +648,6 @@ __minstrel_ht_get_sample_rate(struct minstrel_ht_sta *mi,
648
648
return 0 ;
649
649
}
650
650
651
- static void
652
- minstrel_ht_rate_sample_switch (struct minstrel_priv * mp ,
653
- struct minstrel_ht_sta * mi )
654
- {
655
- u16 rate ;
656
-
657
- /*
658
- * Use rate switching instead of probing packets for devices with
659
- * little control over retry fallback behavior
660
- */
661
- if (mp -> hw -> max_rates > 1 )
662
- return ;
663
-
664
- rate = __minstrel_ht_get_sample_rate (mi , MINSTREL_SAMPLE_TYPE_INC );
665
- if (!rate )
666
- return ;
667
-
668
- mi -> sample_rate = rate ;
669
- mi -> sample_mode = MINSTREL_SAMPLE_ACTIVE ;
670
- }
671
-
672
651
static inline int
673
652
minstrel_ewma (int old , int new , int weight )
674
653
{
@@ -1012,8 +991,7 @@ minstrel_ht_refill_sample_rates(struct minstrel_ht_sta *mi)
1012
991
* higher throughput rates, even if the probablity is a bit lower
1013
992
*/
1014
993
static void
1015
- minstrel_ht_update_stats (struct minstrel_priv * mp , struct minstrel_ht_sta * mi ,
1016
- bool sample )
994
+ minstrel_ht_update_stats (struct minstrel_priv * mp , struct minstrel_ht_sta * mi )
1017
995
{
1018
996
struct minstrel_mcs_group_data * mg ;
1019
997
struct minstrel_rate_stats * mrs ;
@@ -1023,18 +1001,6 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
1023
1001
u16 index ;
1024
1002
bool ht_supported = mi -> sta -> ht_cap .ht_supported ;
1025
1003
1026
- mi -> sample_mode = MINSTREL_SAMPLE_IDLE ;
1027
-
1028
- if (sample ) {
1029
- mi -> total_packets_cur = mi -> total_packets -
1030
- mi -> total_packets_last ;
1031
- mi -> total_packets_last = mi -> total_packets ;
1032
- }
1033
- if (!mp -> sample_switch )
1034
- sample = false;
1035
- if (mi -> total_packets_cur < SAMPLE_SWITCH_THR && mp -> sample_switch != 1 )
1036
- sample = false;
1037
-
1038
1004
if (mi -> ampdu_packets > 0 ) {
1039
1005
if (!ieee80211_hw_check (mp -> hw , TX_STATUS_NO_AMPDU_LEN ))
1040
1006
mi -> avg_ampdu_len = minstrel_ewma (mi -> avg_ampdu_len ,
@@ -1148,16 +1114,12 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
1148
1114
minstrel_ht_prob_rate_reduce_streams (mi );
1149
1115
minstrel_ht_refill_sample_rates (mi );
1150
1116
1151
- if (sample )
1152
- minstrel_ht_rate_sample_switch (mp , mi );
1153
-
1154
1117
#ifdef CONFIG_MAC80211_DEBUGFS
1155
1118
/* use fixed index if set */
1156
1119
if (mp -> fixed_rate_idx != -1 ) {
1157
1120
for (i = 0 ; i < 4 ; i ++ )
1158
1121
mi -> max_tp_rate [i ] = mp -> fixed_rate_idx ;
1159
1122
mi -> max_prob_rate = mp -> fixed_rate_idx ;
1160
- mi -> sample_mode = MINSTREL_SAMPLE_IDLE ;
1161
1123
}
1162
1124
#endif
1163
1125
@@ -1247,11 +1209,10 @@ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband,
1247
1209
struct ieee80211_tx_info * info = st -> info ;
1248
1210
struct minstrel_ht_sta * mi = priv_sta ;
1249
1211
struct ieee80211_tx_rate * ar = info -> status .rates ;
1250
- struct minstrel_rate_stats * rate , * rate2 , * rate_sample = NULL ;
1212
+ struct minstrel_rate_stats * rate , * rate2 ;
1251
1213
struct minstrel_priv * mp = priv ;
1252
1214
u32 update_interval = mp -> update_interval ;
1253
1215
bool last , update = false;
1254
- bool sample_status = false;
1255
1216
int i ;
1256
1217
1257
1218
/* This packet was aggregated but doesn't carry status info */
@@ -1278,49 +1239,18 @@ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband,
1278
1239
mi -> ampdu_packets ++ ;
1279
1240
mi -> ampdu_len += info -> status .ampdu_len ;
1280
1241
1281
- if (mi -> sample_mode != MINSTREL_SAMPLE_IDLE )
1282
- rate_sample = minstrel_get_ratestats (mi , mi -> sample_rate );
1283
-
1284
1242
last = !minstrel_ht_txstat_valid (mp , mi , & ar [0 ]);
1285
1243
for (i = 0 ; !last ; i ++ ) {
1286
1244
last = (i == IEEE80211_TX_MAX_RATES - 1 ) ||
1287
1245
!minstrel_ht_txstat_valid (mp , mi , & ar [i + 1 ]);
1288
1246
1289
1247
rate = minstrel_ht_get_stats (mp , mi , & ar [i ]);
1290
- if (rate == rate_sample )
1291
- sample_status = true;
1292
-
1293
1248
if (last )
1294
1249
rate -> success += info -> status .ampdu_ack_len ;
1295
1250
1296
1251
rate -> attempts += ar [i ].count * info -> status .ampdu_len ;
1297
1252
}
1298
1253
1299
- switch (mi -> sample_mode ) {
1300
- case MINSTREL_SAMPLE_IDLE :
1301
- if (mp -> hw -> max_rates > 1 ||
1302
- mi -> total_packets_cur < SAMPLE_SWITCH_THR )
1303
- update_interval /= 2 ;
1304
- break ;
1305
-
1306
- case MINSTREL_SAMPLE_ACTIVE :
1307
- if (!sample_status )
1308
- break ;
1309
-
1310
- mi -> sample_mode = MINSTREL_SAMPLE_PENDING ;
1311
- update = true;
1312
- break ;
1313
-
1314
- case MINSTREL_SAMPLE_PENDING :
1315
- if (sample_status )
1316
- break ;
1317
-
1318
- update = true;
1319
- minstrel_ht_update_stats (mp , mi , false);
1320
- break ;
1321
- }
1322
-
1323
-
1324
1254
if (mp -> hw -> max_rates > 1 ) {
1325
1255
/*
1326
1256
* check for sudden death of spatial multiplexing,
@@ -1343,7 +1273,7 @@ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband,
1343
1273
1344
1274
if (time_after (jiffies , mi -> last_stats_update + update_interval )) {
1345
1275
update = true;
1346
- minstrel_ht_update_stats (mp , mi , true );
1276
+ minstrel_ht_update_stats (mp , mi );
1347
1277
}
1348
1278
1349
1279
if (update )
@@ -1522,18 +1452,14 @@ static void
1522
1452
minstrel_ht_update_rates (struct minstrel_priv * mp , struct minstrel_ht_sta * mi )
1523
1453
{
1524
1454
struct ieee80211_sta_rates * rates ;
1525
- u16 first_rate = mi -> max_tp_rate [0 ];
1526
1455
int i = 0 ;
1527
1456
1528
- if (mi -> sample_mode == MINSTREL_SAMPLE_ACTIVE )
1529
- first_rate = mi -> sample_rate ;
1530
-
1531
1457
rates = kzalloc (sizeof (* rates ), GFP_ATOMIC );
1532
1458
if (!rates )
1533
1459
return ;
1534
1460
1535
1461
/* Start with max_tp_rate[0] */
1536
- minstrel_ht_set_rate (mp , mi , rates , i ++ , first_rate );
1462
+ minstrel_ht_set_rate (mp , mi , rates , i ++ , mi -> max_tp_rate [ 0 ] );
1537
1463
1538
1464
if (mp -> hw -> max_rates >= 3 ) {
1539
1465
/* At least 3 tx rates supported, use max_tp_rate[1] next */
@@ -1592,11 +1518,6 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
1592
1518
(info -> control .flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO ))
1593
1519
return ;
1594
1520
1595
- if (mp -> hw -> max_rates == 1 && mp -> sample_switch &&
1596
- (mi -> total_packets_cur >= SAMPLE_SWITCH_THR ||
1597
- mp -> sample_switch == 1 ))
1598
- return ;
1599
-
1600
1521
if (time_is_before_jiffies (mi -> sample_time ))
1601
1522
return ;
1602
1523
@@ -1810,7 +1731,7 @@ minstrel_ht_update_caps(void *priv, struct ieee80211_supported_band *sband,
1810
1731
minstrel_ht_update_ofdm (mp , mi , sband , sta );
1811
1732
1812
1733
/* create an initial rate table with the lowest supported rates */
1813
- minstrel_ht_update_stats (mp , mi , true );
1734
+ minstrel_ht_update_stats (mp , mi );
1814
1735
minstrel_ht_update_rates (mp , mi );
1815
1736
}
1816
1737
@@ -1926,8 +1847,6 @@ minstrel_ht_alloc(struct ieee80211_hw *hw)
1926
1847
if (!mp )
1927
1848
return NULL ;
1928
1849
1929
- mp -> sample_switch = -1 ;
1930
-
1931
1850
/* contention window settings
1932
1851
* Just an approximation. Using the per-queue values would complicate
1933
1852
* the calculations and is probably unnecessary */
@@ -1947,7 +1866,7 @@ minstrel_ht_alloc(struct ieee80211_hw *hw)
1947
1866
mp -> has_mrr = true;
1948
1867
1949
1868
mp -> hw = hw ;
1950
- mp -> update_interval = HZ / 10 ;
1869
+ mp -> update_interval = HZ / 20 ;
1951
1870
1952
1871
minstrel_ht_init_cck_rates (mp );
1953
1872
for (i = 0 ; i < ARRAY_SIZE (mp -> hw -> wiphy -> bands ); i ++ )
@@ -1965,8 +1884,6 @@ static void minstrel_ht_add_debugfs(struct ieee80211_hw *hw, void *priv,
1965
1884
mp -> fixed_rate_idx = (u32 ) - 1 ;
1966
1885
debugfs_create_u32 ("fixed_rate_idx" , S_IRUGO | S_IWUGO , debugfsdir ,
1967
1886
& mp -> fixed_rate_idx );
1968
- debugfs_create_u32 ("sample_switch" , S_IRUGO | S_IWUSR , debugfsdir ,
1969
- & mp -> sample_switch );
1970
1887
}
1971
1888
#endif
1972
1889
0 commit comments