371-mac80211-minstrel-merge-with-minstrel_ht-always-enab.patch 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. From: Felix Fietkau <[email protected]>
  2. Date: Sat, 10 Feb 2018 12:43:30 +0100
  3. Subject: [PATCH] mac80211: minstrel: merge with minstrel_ht, always enable
  4. VHT support
  5. Legacy-only devices are not very common and the overhead of the extra
  6. code for HT and VHT rates is not big enough to justify all those extra
  7. lines of code to make it optional.
  8. Signed-off-by: Felix Fietkau <[email protected]>
  9. ---
  10. Index: backports-v4.18-rc7/net/mac80211/Kconfig
  11. ===================================================================
  12. --- backports-v4.18-rc7.orig/net/mac80211/Kconfig
  13. +++ backports-v4.18-rc7/net/mac80211/Kconfig
  14. @@ -25,20 +25,6 @@ config MAC80211_RC_MINSTREL
  15. ---help---
  16. This option enables the 'minstrel' TX rate control algorithm
  17. -config MAC80211_RC_MINSTREL_HT
  18. - bool "Minstrel 802.11n support" if EXPERT
  19. - depends on MAC80211_RC_MINSTREL
  20. - default y
  21. - ---help---
  22. - This option enables the 'minstrel_ht' TX rate control algorithm
  23. -
  24. -config MAC80211_RC_MINSTREL_VHT
  25. - bool "Minstrel 802.11ac support" if EXPERT
  26. - depends on MAC80211_RC_MINSTREL_HT
  27. - default n
  28. - ---help---
  29. - This option enables VHT in the 'minstrel_ht' TX rate control algorithm
  30. -
  31. choice
  32. prompt "Default rate control algorithm"
  33. depends on MAC80211_HAS_RC
  34. @@ -60,8 +46,7 @@ endchoice
  35. config MAC80211_RC_DEFAULT
  36. string
  37. - default "minstrel_ht" if MAC80211_RC_DEFAULT_MINSTREL && MAC80211_RC_MINSTREL_HT
  38. - default "minstrel" if MAC80211_RC_DEFAULT_MINSTREL
  39. + default "minstrel_ht" if MAC80211_RC_DEFAULT_MINSTREL
  40. default ""
  41. endif
  42. Index: backports-v4.18-rc7/net/mac80211/Makefile
  43. ===================================================================
  44. --- backports-v4.18-rc7.orig/net/mac80211/Makefile
  45. +++ backports-v4.18-rc7/net/mac80211/Makefile
  46. @@ -51,13 +51,14 @@ mac80211-$(CONFIG_PM) += pm.o
  47. CFLAGS_trace.o := -I$(src)
  48. -rc80211_minstrel-y := rc80211_minstrel.o
  49. -rc80211_minstrel-$(CPTCFG_MAC80211_DEBUGFS) += rc80211_minstrel_debugfs.o
  50. +rc80211_minstrel-y := \
  51. + rc80211_minstrel.o \
  52. + rc80211_minstrel_ht.o
  53. -rc80211_minstrel_ht-y := rc80211_minstrel_ht.o
  54. -rc80211_minstrel_ht-$(CPTCFG_MAC80211_DEBUGFS) += rc80211_minstrel_ht_debugfs.o
  55. +rc80211_minstrel-$(CPTCFG_MAC80211_DEBUGFS) += \
  56. + rc80211_minstrel_debugfs.o \
  57. + rc80211_minstrel_ht_debugfs.o
  58. mac80211-$(CPTCFG_MAC80211_RC_MINSTREL) += $(rc80211_minstrel-y)
  59. -mac80211-$(CPTCFG_MAC80211_RC_MINSTREL_HT) += $(rc80211_minstrel_ht-y)
  60. ccflags-y += -DDEBUG
  61. Index: backports-v4.18-rc7/net/mac80211/main.c
  62. ===================================================================
  63. --- backports-v4.18-rc7.orig/net/mac80211/main.c
  64. +++ backports-v4.18-rc7/net/mac80211/main.c
  65. @@ -1264,18 +1264,12 @@ static int __init ieee80211_init(void)
  66. if (ret)
  67. return ret;
  68. - ret = rc80211_minstrel_ht_init();
  69. - if (ret)
  70. - goto err_minstrel;
  71. -
  72. ret = ieee80211_iface_init();
  73. if (ret)
  74. goto err_netdev;
  75. return 0;
  76. err_netdev:
  77. - rc80211_minstrel_ht_exit();
  78. - err_minstrel:
  79. rc80211_minstrel_exit();
  80. return ret;
  81. @@ -1283,7 +1277,6 @@ static int __init ieee80211_init(void)
  82. static void __exit ieee80211_exit(void)
  83. {
  84. - rc80211_minstrel_ht_exit();
  85. rc80211_minstrel_exit();
  86. ieee80211s_stop();
  87. Index: backports-v4.18-rc7/net/mac80211/rate.h
  88. ===================================================================
  89. --- backports-v4.18-rc7.orig/net/mac80211/rate.h
  90. +++ backports-v4.18-rc7/net/mac80211/rate.h
  91. @@ -95,18 +95,5 @@ static inline void rc80211_minstrel_exit
  92. }
  93. #endif
  94. -#ifdef CPTCFG_MAC80211_RC_MINSTREL_HT
  95. -int rc80211_minstrel_ht_init(void);
  96. -void rc80211_minstrel_ht_exit(void);
  97. -#else
  98. -static inline int rc80211_minstrel_ht_init(void)
  99. -{
  100. - return 0;
  101. -}
  102. -static inline void rc80211_minstrel_ht_exit(void)
  103. -{
  104. -}
  105. -#endif
  106. -
  107. #endif /* IEEE80211_RATE_H */
  108. Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel.c
  109. ===================================================================
  110. --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel.c
  111. +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel.c
  112. @@ -572,138 +572,6 @@ minstrel_rate_init(void *priv, struct ie
  113. minstrel_update_rates(mp, mi);
  114. }
  115. -static void *
  116. -minstrel_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
  117. -{
  118. - struct ieee80211_supported_band *sband;
  119. - struct minstrel_sta_info *mi;
  120. - struct minstrel_priv *mp = priv;
  121. - struct ieee80211_hw *hw = mp->hw;
  122. - int max_rates = 0;
  123. - int i;
  124. -
  125. - mi = kzalloc(sizeof(struct minstrel_sta_info), gfp);
  126. - if (!mi)
  127. - return NULL;
  128. -
  129. - for (i = 0; i < NUM_NL80211_BANDS; i++) {
  130. - sband = hw->wiphy->bands[i];
  131. - if (sband && sband->n_bitrates > max_rates)
  132. - max_rates = sband->n_bitrates;
  133. - }
  134. -
  135. - mi->r = kcalloc(max_rates, sizeof(struct minstrel_rate), gfp);
  136. - if (!mi->r)
  137. - goto error;
  138. -
  139. - mi->sample_table = kmalloc_array(max_rates, SAMPLE_COLUMNS, gfp);
  140. - if (!mi->sample_table)
  141. - goto error1;
  142. -
  143. - mi->last_stats_update = jiffies;
  144. - return mi;
  145. -
  146. -error1:
  147. - kfree(mi->r);
  148. -error:
  149. - kfree(mi);
  150. - return NULL;
  151. -}
  152. -
  153. -static void
  154. -minstrel_free_sta(void *priv, struct ieee80211_sta *sta, void *priv_sta)
  155. -{
  156. - struct minstrel_sta_info *mi = priv_sta;
  157. -
  158. - kfree(mi->sample_table);
  159. - kfree(mi->r);
  160. - kfree(mi);
  161. -}
  162. -
  163. -static void
  164. -minstrel_init_cck_rates(struct minstrel_priv *mp)
  165. -{
  166. - static const int bitrates[4] = { 10, 20, 55, 110 };
  167. - struct ieee80211_supported_band *sband;
  168. - u32 rate_flags = ieee80211_chandef_rate_flags(&mp->hw->conf.chandef);
  169. - int i, j;
  170. -
  171. - sband = mp->hw->wiphy->bands[NL80211_BAND_2GHZ];
  172. - if (!sband)
  173. - return;
  174. -
  175. - for (i = 0, j = 0; i < sband->n_bitrates; i++) {
  176. - struct ieee80211_rate *rate = &sband->bitrates[i];
  177. -
  178. - if (rate->flags & IEEE80211_RATE_ERP_G)
  179. - continue;
  180. -
  181. - if ((rate_flags & sband->bitrates[i].flags) != rate_flags)
  182. - continue;
  183. -
  184. - for (j = 0; j < ARRAY_SIZE(bitrates); j++) {
  185. - if (rate->bitrate != bitrates[j])
  186. - continue;
  187. -
  188. - mp->cck_rates[j] = i;
  189. - break;
  190. - }
  191. - }
  192. -}
  193. -
  194. -static void *
  195. -minstrel_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
  196. -{
  197. - struct minstrel_priv *mp;
  198. -
  199. - mp = kzalloc(sizeof(struct minstrel_priv), GFP_ATOMIC);
  200. - if (!mp)
  201. - return NULL;
  202. -
  203. - /* contention window settings
  204. - * Just an approximation. Using the per-queue values would complicate
  205. - * the calculations and is probably unnecessary */
  206. - mp->cw_min = 15;
  207. - mp->cw_max = 1023;
  208. -
  209. - /* number of packets (in %) to use for sampling other rates
  210. - * sample less often for non-mrr packets, because the overhead
  211. - * is much higher than with mrr */
  212. - mp->lookaround_rate = 5;
  213. - mp->lookaround_rate_mrr = 10;
  214. -
  215. - /* maximum time that the hw is allowed to stay in one MRR segment */
  216. - mp->segment_size = 6000;
  217. -
  218. - if (hw->max_rate_tries > 0)
  219. - mp->max_retry = hw->max_rate_tries;
  220. - else
  221. - /* safe default, does not necessarily have to match hw properties */
  222. - mp->max_retry = 7;
  223. -
  224. - if (hw->max_rates >= 4)
  225. - mp->has_mrr = true;
  226. -
  227. - mp->hw = hw;
  228. - mp->update_interval = 100;
  229. -
  230. -#ifdef CPTCFG_MAC80211_DEBUGFS
  231. - mp->fixed_rate_idx = (u32) -1;
  232. - debugfs_create_u32("fixed_rate_idx", S_IRUGO | S_IWUGO, debugfsdir,
  233. - &mp->fixed_rate_idx);
  234. -#endif
  235. -
  236. - minstrel_init_cck_rates(mp);
  237. -
  238. - return mp;
  239. -}
  240. -
  241. -static void
  242. -minstrel_free(void *priv)
  243. -{
  244. - kfree(priv);
  245. -}
  246. -
  247. static u32 minstrel_get_expected_throughput(void *priv_sta)
  248. {
  249. struct minstrel_sta_info *mi = priv_sta;
  250. @@ -722,29 +590,8 @@ static u32 minstrel_get_expected_through
  251. }
  252. const struct rate_control_ops mac80211_minstrel = {
  253. - .name = "minstrel",
  254. .tx_status_ext = minstrel_tx_status,
  255. .get_rate = minstrel_get_rate,
  256. .rate_init = minstrel_rate_init,
  257. - .alloc = minstrel_alloc,
  258. - .free = minstrel_free,
  259. - .alloc_sta = minstrel_alloc_sta,
  260. - .free_sta = minstrel_free_sta,
  261. -#ifdef CPTCFG_MAC80211_DEBUGFS
  262. - .add_sta_debugfs = minstrel_add_sta_debugfs,
  263. -#endif
  264. .get_expected_throughput = minstrel_get_expected_throughput,
  265. };
  266. -
  267. -int __init
  268. -rc80211_minstrel_init(void)
  269. -{
  270. - return ieee80211_rate_control_register(&mac80211_minstrel);
  271. -}
  272. -
  273. -void
  274. -rc80211_minstrel_exit(void)
  275. -{
  276. - ieee80211_rate_control_unregister(&mac80211_minstrel);
  277. -}
  278. -
  279. Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel.h
  280. ===================================================================
  281. --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel.h
  282. +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel.h
  283. @@ -158,7 +158,5 @@ int minstrel_get_tp_avg(struct minstrel_
  284. /* debugfs */
  285. int minstrel_stats_open(struct inode *inode, struct file *file);
  286. int minstrel_stats_csv_open(struct inode *inode, struct file *file);
  287. -ssize_t minstrel_stats_read(struct file *file, char __user *buf, size_t len, loff_t *ppos);
  288. -int minstrel_stats_release(struct inode *inode, struct file *file);
  289. #endif
  290. Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_debugfs.c
  291. ===================================================================
  292. --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_debugfs.c
  293. +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel_debugfs.c
  294. @@ -54,22 +54,6 @@
  295. #include <net/mac80211.h>
  296. #include "rc80211_minstrel.h"
  297. -ssize_t
  298. -minstrel_stats_read(struct file *file, char __user *buf, size_t len, loff_t *ppos)
  299. -{
  300. - struct minstrel_debugfs_info *ms;
  301. -
  302. - ms = file->private_data;
  303. - return simple_read_from_buffer(buf, len, ppos, ms->buf, ms->len);
  304. -}
  305. -
  306. -int
  307. -minstrel_stats_release(struct inode *inode, struct file *file)
  308. -{
  309. - kfree(file->private_data);
  310. - return 0;
  311. -}
  312. -
  313. int
  314. minstrel_stats_open(struct inode *inode, struct file *file)
  315. {
  316. @@ -135,14 +119,6 @@ minstrel_stats_open(struct inode *inode,
  317. return 0;
  318. }
  319. -static const struct file_operations minstrel_stat_fops = {
  320. - .owner = THIS_MODULE,
  321. - .open = minstrel_stats_open,
  322. - .read = minstrel_stats_read,
  323. - .release = minstrel_stats_release,
  324. - .llseek = default_llseek,
  325. -};
  326. -
  327. int
  328. minstrel_stats_csv_open(struct inode *inode, struct file *file)
  329. {
  330. @@ -200,21 +176,3 @@ minstrel_stats_csv_open(struct inode *in
  331. return 0;
  332. }
  333. -
  334. -static const struct file_operations minstrel_stat_csv_fops = {
  335. - .owner = THIS_MODULE,
  336. - .open = minstrel_stats_csv_open,
  337. - .read = minstrel_stats_read,
  338. - .release = minstrel_stats_release,
  339. - .llseek = default_llseek,
  340. -};
  341. -
  342. -void
  343. -minstrel_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir)
  344. -{
  345. - struct minstrel_sta_info *mi = priv_sta;
  346. -
  347. - debugfs_create_file("rc_stats", S_IRUGO, dir, mi, &minstrel_stat_fops);
  348. - debugfs_create_file("rc_stats_csv", S_IRUGO, dir, mi,
  349. - &minstrel_stat_csv_fops);
  350. -}
  351. Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.c
  352. ===================================================================
  353. --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_ht.c
  354. +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.c
  355. @@ -137,12 +137,10 @@
  356. } \
  357. }
  358. -#ifdef CPTCFG_MAC80211_RC_MINSTREL_VHT
  359. static bool minstrel_vht_only = true;
  360. module_param(minstrel_vht_only, bool, 0644);
  361. MODULE_PARM_DESC(minstrel_vht_only,
  362. "Use only VHT rates when VHT is supported by sta.");
  363. -#endif
  364. /*
  365. * To enable sufficiently targeted rate sampling, MCS rates are divided into
  366. @@ -171,7 +169,6 @@ const struct mcs_group minstrel_mcs_grou
  367. CCK_GROUP,
  368. -#ifdef CPTCFG_MAC80211_RC_MINSTREL_VHT
  369. VHT_GROUP(1, 0, BW_20),
  370. VHT_GROUP(2, 0, BW_20),
  371. VHT_GROUP(3, 0, BW_20),
  372. @@ -195,7 +192,6 @@ const struct mcs_group minstrel_mcs_grou
  373. VHT_GROUP(1, 1, BW_80),
  374. VHT_GROUP(2, 1, BW_80),
  375. VHT_GROUP(3, 1, BW_80),
  376. -#endif
  377. };
  378. static u8 sample_table[SAMPLE_COLUMNS][MCS_GROUP_RATES] __read_mostly;
  379. @@ -1146,12 +1142,10 @@ minstrel_ht_update_caps(void *priv, stru
  380. BUILD_BUG_ON(ARRAY_SIZE(minstrel_mcs_groups) != MINSTREL_GROUPS_NB);
  381. -#ifdef CPTCFG_MAC80211_RC_MINSTREL_VHT
  382. if (vht_cap->vht_supported)
  383. use_vht = vht_cap->vht_mcs.tx_mcs_map != cpu_to_le16(~0);
  384. else
  385. -#endif
  386. - use_vht = 0;
  387. + use_vht = 0;
  388. msp->is_ht = true;
  389. memset(mi, 0, sizeof(*mi));
  390. @@ -1226,10 +1220,9 @@ minstrel_ht_update_caps(void *priv, stru
  391. /* HT rate */
  392. if (gflags & IEEE80211_TX_RC_MCS) {
  393. -#ifdef CPTCFG_MAC80211_RC_MINSTREL_VHT
  394. if (use_vht && minstrel_vht_only)
  395. continue;
  396. -#endif
  397. +
  398. mi->supported[i] = mcs->rx_mask[nss - 1];
  399. if (mi->supported[i])
  400. n_supported++;
  401. @@ -1349,16 +1342,88 @@ minstrel_ht_free_sta(void *priv, struct
  402. kfree(msp);
  403. }
  404. +static void
  405. +minstrel_ht_init_cck_rates(struct minstrel_priv *mp)
  406. +{
  407. + static const int bitrates[4] = { 10, 20, 55, 110 };
  408. + struct ieee80211_supported_band *sband;
  409. + u32 rate_flags = ieee80211_chandef_rate_flags(&mp->hw->conf.chandef);
  410. + int i, j;
  411. +
  412. + sband = mp->hw->wiphy->bands[NL80211_BAND_2GHZ];
  413. + if (!sband)
  414. + return;
  415. +
  416. + for (i = 0, j = 0; i < sband->n_bitrates; i++) {
  417. + struct ieee80211_rate *rate = &sband->bitrates[i];
  418. +
  419. + if (rate->flags & IEEE80211_RATE_ERP_G)
  420. + continue;
  421. +
  422. + if ((rate_flags & sband->bitrates[i].flags) != rate_flags)
  423. + continue;
  424. +
  425. + for (j = 0; j < ARRAY_SIZE(bitrates); j++) {
  426. + if (rate->bitrate != bitrates[j])
  427. + continue;
  428. +
  429. + mp->cck_rates[j] = i;
  430. + break;
  431. + }
  432. + }
  433. +}
  434. +
  435. static void *
  436. minstrel_ht_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
  437. {
  438. - return mac80211_minstrel.alloc(hw, debugfsdir);
  439. + struct minstrel_priv *mp;
  440. +
  441. + mp = kzalloc(sizeof(struct minstrel_priv), GFP_ATOMIC);
  442. + if (!mp)
  443. + return NULL;
  444. +
  445. + /* contention window settings
  446. + * Just an approximation. Using the per-queue values would complicate
  447. + * the calculations and is probably unnecessary */
  448. + mp->cw_min = 15;
  449. + mp->cw_max = 1023;
  450. +
  451. + /* number of packets (in %) to use for sampling other rates
  452. + * sample less often for non-mrr packets, because the overhead
  453. + * is much higher than with mrr */
  454. + mp->lookaround_rate = 5;
  455. + mp->lookaround_rate_mrr = 10;
  456. +
  457. + /* maximum time that the hw is allowed to stay in one MRR segment */
  458. + mp->segment_size = 6000;
  459. +
  460. + if (hw->max_rate_tries > 0)
  461. + mp->max_retry = hw->max_rate_tries;
  462. + else
  463. + /* safe default, does not necessarily have to match hw properties */
  464. + mp->max_retry = 7;
  465. +
  466. + if (hw->max_rates >= 4)
  467. + mp->has_mrr = true;
  468. +
  469. + mp->hw = hw;
  470. + mp->update_interval = 100;
  471. +
  472. +#ifdef CPTCFG_MAC80211_DEBUGFS
  473. + mp->fixed_rate_idx = (u32) -1;
  474. + debugfs_create_u32("fixed_rate_idx", S_IRUGO | S_IWUGO, debugfsdir,
  475. + &mp->fixed_rate_idx);
  476. +#endif
  477. +
  478. + minstrel_ht_init_cck_rates(mp);
  479. +
  480. + return mp;
  481. }
  482. static void
  483. minstrel_ht_free(void *priv)
  484. {
  485. - mac80211_minstrel.free(priv);
  486. + kfree(priv);
  487. }
  488. static u32 minstrel_ht_get_expected_throughput(void *priv_sta)
  489. @@ -1417,14 +1482,14 @@ static void __init init_sample_table(voi
  490. }
  491. int __init
  492. -rc80211_minstrel_ht_init(void)
  493. +rc80211_minstrel_init(void)
  494. {
  495. init_sample_table();
  496. return ieee80211_rate_control_register(&mac80211_minstrel_ht);
  497. }
  498. void
  499. -rc80211_minstrel_ht_exit(void)
  500. +rc80211_minstrel_exit(void)
  501. {
  502. ieee80211_rate_control_unregister(&mac80211_minstrel_ht);
  503. }
  504. Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.h
  505. ===================================================================
  506. --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_ht.h
  507. +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht.h
  508. @@ -15,11 +15,7 @@
  509. */
  510. #define MINSTREL_MAX_STREAMS 3
  511. #define MINSTREL_HT_STREAM_GROUPS 4 /* BW(=2) * SGI(=2) */
  512. -#ifdef CPTCFG_MAC80211_RC_MINSTREL_VHT
  513. #define MINSTREL_VHT_STREAM_GROUPS 6 /* BW(=3) * SGI(=2) */
  514. -#else
  515. -#define MINSTREL_VHT_STREAM_GROUPS 0
  516. -#endif
  517. #define MINSTREL_HT_GROUPS_NB (MINSTREL_MAX_STREAMS * \
  518. MINSTREL_HT_STREAM_GROUPS)
  519. @@ -34,11 +30,7 @@
  520. #define MINSTREL_CCK_GROUP (MINSTREL_HT_GROUP_0 + MINSTREL_HT_GROUPS_NB)
  521. #define MINSTREL_VHT_GROUP_0 (MINSTREL_CCK_GROUP + 1)
  522. -#ifdef CPTCFG_MAC80211_RC_MINSTREL_VHT
  523. #define MCS_GROUP_RATES 10
  524. -#else
  525. -#define MCS_GROUP_RATES 8
  526. -#endif
  527. struct mcs_group {
  528. u32 flags;
  529. Index: backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht_debugfs.c
  530. ===================================================================
  531. --- backports-v4.18-rc7.orig/net/mac80211/rc80211_minstrel_ht_debugfs.c
  532. +++ backports-v4.18-rc7/net/mac80211/rc80211_minstrel_ht_debugfs.c
  533. @@ -15,6 +15,22 @@
  534. #include "rc80211_minstrel.h"
  535. #include "rc80211_minstrel_ht.h"
  536. +static ssize_t
  537. +minstrel_stats_read(struct file *file, char __user *buf, size_t len, loff_t *ppos)
  538. +{
  539. + struct minstrel_debugfs_info *ms;
  540. +
  541. + ms = file->private_data;
  542. + return simple_read_from_buffer(buf, len, ppos, ms->buf, ms->len);
  543. +}
  544. +
  545. +static int
  546. +minstrel_stats_release(struct inode *inode, struct file *file)
  547. +{
  548. + kfree(file->private_data);
  549. + return 0;
  550. +}
  551. +
  552. static char *
  553. minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p)
  554. {