]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blame - net/mac80211/rc80211_minstrel_ht.h
mac80211: Unify rate statistic variables between Minstrel & Minstrel_HT
[mirror_ubuntu-zesty-kernel.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 */
16#define MINSTREL_MAX_STREAMS 3
17#define MINSTREL_STREAM_GROUPS 4
18
ec8aa669
FF
19#define MCS_GROUP_RATES 8
20
21struct mcs_group {
22 u32 flags;
23 unsigned int streams;
24 unsigned int duration[MCS_GROUP_RATES];
25};
26
de66bfd8
JL
27extern const struct mcs_group minstrel_mcs_groups[];
28
ec8aa669
FF
29struct minstrel_mcs_group_data {
30 u8 index;
31 u8 column;
32
33 /* bitfield of supported MCS rates of this group */
34 u8 supported;
35
36 /* selected primary rates */
37 unsigned int max_tp_rate;
38 unsigned int max_tp_rate2;
39 unsigned int max_prob_rate;
40
41 /* MCS rate statistics */
42 struct minstrel_rate_stats rates[MCS_GROUP_RATES];
43};
44
45struct minstrel_ht_sta {
a8566662
FF
46 struct ieee80211_sta *sta;
47
ec8aa669
FF
48 /* ampdu length (average, per sampling interval) */
49 unsigned int ampdu_len;
50 unsigned int ampdu_packets;
51
52 /* ampdu length (EWMA) */
53 unsigned int avg_ampdu_len;
54
55 /* best throughput rate */
56 unsigned int max_tp_rate;
57
58 /* second best throughput rate */
59 unsigned int max_tp_rate2;
60
61 /* best probability rate */
62 unsigned int max_prob_rate;
965237ab 63 unsigned int max_prob_streams;
ec8aa669
FF
64
65 /* time of last status update */
66 unsigned long stats_update;
67
68 /* overhead time in usec for each frame */
69 unsigned int overhead;
70 unsigned int overhead_rtscts;
71
72 unsigned int total_packets;
73 unsigned int sample_packets;
74
75 /* tx flags to add for frames for this sta */
76 u32 tx_flags;
77
78 u8 sample_wait;
79 u8 sample_tries;
80 u8 sample_count;
81 u8 sample_slow;
82
83 /* current MCS group to be sampled */
84 u8 sample_group;
85
a0497f9f
FF
86 u8 cck_supported;
87 u8 cck_supported_short;
88
ec8aa669 89 /* MCS rate group info and statistics */
a0497f9f 90 struct minstrel_mcs_group_data groups[MINSTREL_MAX_STREAMS * MINSTREL_STREAM_GROUPS + 1];
ec8aa669
FF
91};
92
93struct minstrel_ht_sta_priv {
94 union {
95 struct minstrel_ht_sta ht;
96 struct minstrel_sta_info legacy;
97 };
98#ifdef CONFIG_MAC80211_DEBUGFS
99 struct dentry *dbg_stats;
100#endif
101 void *ratelist;
102 void *sample_table;
103 bool is_ht;
104};
105
106void minstrel_ht_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
107void minstrel_ht_remove_sta_debugfs(void *priv, void *priv_sta);
108
109#endif