mac80211: minstrel_ht: include type (cck/ht) in rates flag
[deliverable/linux.git] / net / mac80211 / rc80211_minstrel_ht.h
CommitLineData
ec8aa669
FF
1/*
2 * 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 */
8
9#ifndef __RC_MINSTREL_HT_H
10#define __RC_MINSTREL_HT_H
11
12/*
13 * The number of streams can be changed to 2 to reduce code
14 * size and memory footprint.
15 */
8a0ee4fe
KB
16#define MINSTREL_MAX_STREAMS 3
17#define MINSTREL_HT_STREAM_GROUPS 4 /* BW(=2) * SGI(=2) */
18
19#define MINSTREL_HT_GROUPS_NB (MINSTREL_MAX_STREAMS * \
20 MINSTREL_HT_STREAM_GROUPS)
21#define MINSTREL_CCK_GROUPS_NB 1
22#define MINSTREL_GROUPS_NB (MINSTREL_HT_GROUPS_NB + \
23 MINSTREL_CCK_GROUPS_NB)
24
25#define MINSTREL_HT_GROUP_0 0
26#define MINSTREL_CCK_GROUP (MINSTREL_HT_GROUP_0 + MINSTREL_HT_GROUPS_NB)
ec8aa669 27
ec8aa669
FF
28#define MCS_GROUP_RATES 8
29
30struct mcs_group {
31 u32 flags;
32 unsigned int streams;
33 unsigned int duration[MCS_GROUP_RATES];
34};
35
de66bfd8
JL
36extern const struct mcs_group minstrel_mcs_groups[];
37
ec8aa669
FF
38struct minstrel_mcs_group_data {
39 u8 index;
40 u8 column;
41
42 /* bitfield of supported MCS rates of this group */
43 u8 supported;
44
5935839a 45 /* sorted rate set within a MCS group*/
d4d141ca
KB
46 u16 max_group_tp_rate[MAX_THR_RATES];
47 u16 max_group_prob_rate;
ec8aa669
FF
48
49 /* MCS rate statistics */
50 struct minstrel_rate_stats rates[MCS_GROUP_RATES];
51};
52
53struct minstrel_ht_sta {
a8566662
FF
54 struct ieee80211_sta *sta;
55
ec8aa669
FF
56 /* ampdu length (average, per sampling interval) */
57 unsigned int ampdu_len;
58 unsigned int ampdu_packets;
59
60 /* ampdu length (EWMA) */
61 unsigned int avg_ampdu_len;
62
5935839a 63 /* overall sorted rate set */
d4d141ca
KB
64 u16 max_tp_rate[MAX_THR_RATES];
65 u16 max_prob_rate;
ec8aa669
FF
66
67 /* time of last status update */
68 unsigned long stats_update;
69
70 /* overhead time in usec for each frame */
71 unsigned int overhead;
72 unsigned int overhead_rtscts;
73
74 unsigned int total_packets;
75 unsigned int sample_packets;
76
77 /* tx flags to add for frames for this sta */
78 u32 tx_flags;
79
80 u8 sample_wait;
81 u8 sample_tries;
82 u8 sample_count;
83 u8 sample_slow;
84
85 /* current MCS group to be sampled */
86 u8 sample_group;
87
a0497f9f
FF
88 u8 cck_supported;
89 u8 cck_supported_short;
90
ec8aa669 91 /* MCS rate group info and statistics */
8a0ee4fe 92 struct minstrel_mcs_group_data groups[MINSTREL_GROUPS_NB];
ec8aa669
FF
93};
94
95struct minstrel_ht_sta_priv {
96 union {
97 struct minstrel_ht_sta ht;
98 struct minstrel_sta_info legacy;
99 };
100#ifdef CONFIG_MAC80211_DEBUGFS
101 struct dentry *dbg_stats;
102#endif
103 void *ratelist;
104 void *sample_table;
105 bool is_ht;
106};
107
108void minstrel_ht_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
109void minstrel_ht_remove_sta_debugfs(void *priv, void *priv_sta);
110
111#endif
This page took 0.246511 seconds and 5 git commands to generate.