2
0

365-mac80211-minstrel_ht-fix-default-max-throughput-rate.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From: Felix Fietkau <[email protected]>
  2. Date: Fri, 14 Jun 2019 21:14:22 +0200
  3. Subject: [PATCH] mac80211: minstrel_ht: fix default max throughput rate
  4. indexes
  5. Use the first supported rate instead of 0 (which can be invalid)
  6. Signed-off-by: Felix Fietkau <[email protected]>
  7. ---
  8. --- a/net/mac80211/rc80211_minstrel_ht.c
  9. +++ b/net/mac80211/rc80211_minstrel_ht.c
  10. @@ -487,7 +487,7 @@ minstrel_ht_assign_best_tp_rates(struct
  11. tmp_prob = mi->groups[tmp_group].rates[tmp_idx].prob_ewma;
  12. tmp_mcs_tp = minstrel_ht_get_tp_avg(mi, tmp_group, tmp_idx, tmp_prob);
  13. - if (tmp_cck_tp > tmp_mcs_tp) {
  14. + if (tmp_cck_tp_rate && tmp_cck_tp > tmp_mcs_tp) {
  15. for(i = 0; i < MAX_THR_RATES; i++) {
  16. minstrel_ht_sort_best_tp_rates(mi, tmp_cck_tp_rate[i],
  17. tmp_mcs_tp_rate);
  18. @@ -559,11 +559,19 @@ minstrel_ht_update_stats(struct minstrel
  19. mi->sample_slow = 0;
  20. mi->sample_count = 0;
  21. - /* Initialize global rate indexes */
  22. - for(j = 0; j < MAX_THR_RATES; j++){
  23. - tmp_mcs_tp_rate[j] = 0;
  24. - tmp_cck_tp_rate[j] = 0;
  25. - }
  26. + memset(tmp_mcs_tp_rate, 0, sizeof(tmp_mcs_tp_rate));
  27. + memset(tmp_cck_tp_rate, 0, sizeof(tmp_cck_tp_rate));
  28. + if (mi->supported[MINSTREL_CCK_GROUP])
  29. + for (j = 0; j < ARRAY_SIZE(tmp_cck_tp_rate); j++)
  30. + tmp_cck_tp_rate[j] = MINSTREL_CCK_GROUP * MCS_GROUP_RATES;
  31. +
  32. + if (mi->supported[MINSTREL_VHT_GROUP_0])
  33. + index = MINSTREL_VHT_GROUP_0 * MCS_GROUP_RATES;
  34. + else
  35. + index = MINSTREL_HT_GROUP_0 * MCS_GROUP_RATES;
  36. +
  37. + for (j = 0; j < ARRAY_SIZE(tmp_mcs_tp_rate); j++)
  38. + tmp_mcs_tp_rate[j] = index;
  39. /* Find best rate sets within all MCS groups*/
  40. for (group = 0; group < ARRAY_SIZE(minstrel_mcs_groups); group++) {