.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * 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. |
---|
7 | 4 | */ |
---|
8 | 5 | |
---|
9 | 6 | #ifndef __RC_MINSTREL_HT_H |
---|
.. | .. |
---|
13 | 10 | * The number of streams can be changed to 2 to reduce code |
---|
14 | 11 | * size and memory footprint. |
---|
15 | 12 | */ |
---|
16 | | -#define MINSTREL_MAX_STREAMS 3 |
---|
| 13 | +#define MINSTREL_MAX_STREAMS 4 |
---|
17 | 14 | #define MINSTREL_HT_STREAM_GROUPS 4 /* BW(=2) * SGI(=2) */ |
---|
18 | | -#ifdef CONFIG_MAC80211_RC_MINSTREL_VHT |
---|
19 | 15 | #define MINSTREL_VHT_STREAM_GROUPS 6 /* BW(=3) * SGI(=2) */ |
---|
20 | | -#else |
---|
21 | | -#define MINSTREL_VHT_STREAM_GROUPS 0 |
---|
22 | | -#endif |
---|
23 | 16 | |
---|
24 | 17 | #define MINSTREL_HT_GROUPS_NB (MINSTREL_MAX_STREAMS * \ |
---|
25 | 18 | MINSTREL_HT_STREAM_GROUPS) |
---|
.. | .. |
---|
34 | 27 | #define MINSTREL_CCK_GROUP (MINSTREL_HT_GROUP_0 + MINSTREL_HT_GROUPS_NB) |
---|
35 | 28 | #define MINSTREL_VHT_GROUP_0 (MINSTREL_CCK_GROUP + 1) |
---|
36 | 29 | |
---|
37 | | -#ifdef CONFIG_MAC80211_RC_MINSTREL_VHT |
---|
38 | 30 | #define MCS_GROUP_RATES 10 |
---|
39 | | -#else |
---|
40 | | -#define MCS_GROUP_RATES 8 |
---|
41 | | -#endif |
---|
42 | 31 | |
---|
43 | 32 | 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]; |
---|
47 | 38 | }; |
---|
48 | 39 | |
---|
49 | 40 | extern const struct mcs_group minstrel_mcs_groups[]; |
---|
.. | .. |
---|
58 | 49 | |
---|
59 | 50 | /* MCS rate statistics */ |
---|
60 | 51 | 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, |
---|
61 | 58 | }; |
---|
62 | 59 | |
---|
63 | 60 | struct minstrel_ht_sta { |
---|
.. | .. |
---|
81 | 78 | unsigned int overhead; |
---|
82 | 79 | unsigned int overhead_rtscts; |
---|
83 | 80 | |
---|
| 81 | + unsigned int total_packets_last; |
---|
| 82 | + unsigned int total_packets_cur; |
---|
84 | 83 | unsigned int total_packets; |
---|
85 | 84 | unsigned int sample_packets; |
---|
86 | 85 | |
---|
.. | .. |
---|
91 | 90 | u8 sample_tries; |
---|
92 | 91 | u8 sample_count; |
---|
93 | 92 | u8 sample_slow; |
---|
| 93 | + |
---|
| 94 | + enum minstrel_sample_mode sample_mode; |
---|
| 95 | + u16 sample_rate; |
---|
94 | 96 | |
---|
95 | 97 | /* current MCS group to be sampled */ |
---|
96 | 98 | u8 sample_group; |
---|
.. | .. |
---|
110 | 112 | struct minstrel_ht_sta ht; |
---|
111 | 113 | struct minstrel_sta_info legacy; |
---|
112 | 114 | }; |
---|
113 | | -#ifdef CONFIG_MAC80211_DEBUGFS |
---|
114 | | - struct dentry *dbg_stats; |
---|
115 | | - struct dentry *dbg_stats_csv; |
---|
116 | | -#endif |
---|
117 | 115 | void *ratelist; |
---|
118 | 116 | void *sample_table; |
---|
119 | 117 | bool is_ht; |
---|
120 | 118 | }; |
---|
121 | 119 | |
---|
122 | 120 | 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); |
---|
124 | 121 | int minstrel_ht_get_tp_avg(struct minstrel_ht_sta *mi, int group, int rate, |
---|
125 | | - int prob_ewma); |
---|
| 122 | + int prob_avg); |
---|
126 | 123 | |
---|
127 | 124 | #endif |
---|