hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/net/mac80211/rc80211_minstrel_ht.h
....@@ -1,9 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2010 Felix Fietkau <nbd@openwrt.org>
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
74 */
85
96 #ifndef __RC_MINSTREL_HT_H
....@@ -13,13 +10,9 @@
1310 * The number of streams can be changed to 2 to reduce code
1411 * size and memory footprint.
1512 */
16
-#define MINSTREL_MAX_STREAMS 3
13
+#define MINSTREL_MAX_STREAMS 4
1714 #define MINSTREL_HT_STREAM_GROUPS 4 /* BW(=2) * SGI(=2) */
18
-#ifdef CONFIG_MAC80211_RC_MINSTREL_VHT
1915 #define MINSTREL_VHT_STREAM_GROUPS 6 /* BW(=3) * SGI(=2) */
20
-#else
21
-#define MINSTREL_VHT_STREAM_GROUPS 0
22
-#endif
2316
2417 #define MINSTREL_HT_GROUPS_NB (MINSTREL_MAX_STREAMS * \
2518 MINSTREL_HT_STREAM_GROUPS)
....@@ -34,16 +27,14 @@
3427 #define MINSTREL_CCK_GROUP (MINSTREL_HT_GROUP_0 + MINSTREL_HT_GROUPS_NB)
3528 #define MINSTREL_VHT_GROUP_0 (MINSTREL_CCK_GROUP + 1)
3629
37
-#ifdef CONFIG_MAC80211_RC_MINSTREL_VHT
3830 #define MCS_GROUP_RATES 10
39
-#else
40
-#define MCS_GROUP_RATES 8
41
-#endif
4231
4332 struct mcs_group {
44
- u32 flags;
45
- unsigned int streams;
46
- unsigned int duration[MCS_GROUP_RATES];
33
+ u16 flags;
34
+ u8 streams;
35
+ u8 shift;
36
+ u8 bw;
37
+ u16 duration[MCS_GROUP_RATES];
4738 };
4839
4940 extern const struct mcs_group minstrel_mcs_groups[];
....@@ -58,6 +49,12 @@
5849
5950 /* MCS rate statistics */
6051 struct minstrel_rate_stats rates[MCS_GROUP_RATES];
52
+};
53
+
54
+enum minstrel_sample_mode {
55
+ MINSTREL_SAMPLE_IDLE,
56
+ MINSTREL_SAMPLE_ACTIVE,
57
+ MINSTREL_SAMPLE_PENDING,
6158 };
6259
6360 struct minstrel_ht_sta {
....@@ -81,6 +78,8 @@
8178 unsigned int overhead;
8279 unsigned int overhead_rtscts;
8380
81
+ unsigned int total_packets_last;
82
+ unsigned int total_packets_cur;
8483 unsigned int total_packets;
8584 unsigned int sample_packets;
8685
....@@ -91,6 +90,9 @@
9190 u8 sample_tries;
9291 u8 sample_count;
9392 u8 sample_slow;
93
+
94
+ enum minstrel_sample_mode sample_mode;
95
+ u16 sample_rate;
9496
9597 /* current MCS group to be sampled */
9698 u8 sample_group;
....@@ -110,18 +112,13 @@
110112 struct minstrel_ht_sta ht;
111113 struct minstrel_sta_info legacy;
112114 };
113
-#ifdef CONFIG_MAC80211_DEBUGFS
114
- struct dentry *dbg_stats;
115
- struct dentry *dbg_stats_csv;
116
-#endif
117115 void *ratelist;
118116 void *sample_table;
119117 bool is_ht;
120118 };
121119
122120 void minstrel_ht_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
123
-void minstrel_ht_remove_sta_debugfs(void *priv, void *priv_sta);
124121 int minstrel_ht_get_tp_avg(struct minstrel_ht_sta *mi, int group, int rate,
125
- int prob_ewma);
122
+ int prob_avg);
126123
127124 #endif