aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/rc.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/rc.h')
-rw-r--r--drivers/net/wireless/ath/ath9k/rc.h48
1 files changed, 31 insertions, 17 deletions
diff --git a/drivers/net/wireless/ath/ath9k/rc.h b/drivers/net/wireless/ath/ath9k/rc.h
index dc1082654501..c3d850207bee 100644
--- a/drivers/net/wireless/ath/ath9k/rc.h
+++ b/drivers/net/wireless/ath/ath9k/rc.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Copyright (c) 2004 Sam Leffler, Errno Consulting 2 * Copyright (c) 2004 Sam Leffler, Errno Consulting
3 * Copyright (c) 2004 Video54 Technologies, Inc. 3 * Copyright (c) 2004 Video54 Technologies, Inc.
4 * Copyright (c) 2008-2009 Atheros Communications Inc. 4 * Copyright (c) 2008-2011 Atheros Communications Inc.
5 * 5 *
6 * Permission to use, copy, modify, and/or distribute this software for any 6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above 7 * purpose with or without fee is hereby granted, provided that the above
@@ -135,20 +135,21 @@ enum {
135 135
136/** 136/**
137 * struct ath_rate_table - Rate Control table 137 * struct ath_rate_table - Rate Control table
138 * @valid: valid for use in rate control 138 * @rate_cnt: total number of rates for the given wireless mode
139 * @valid_single_stream: valid for use in rate control for 139 * @mcs_start: MCS rate index offset
140 * single stream operation 140 * @rate_flags: Rate Control flags
141 * @phy: CCK/OFDM 141 * @phy: CCK/OFDM/HT20/HT40
142 * @ratekbps: rate in Kbits per second 142 * @ratekbps: rate in Kbits per second
143 * @user_ratekbps: user rate in Kbits per second 143 * @user_ratekbps: user rate in Kbits per second
144 * @ratecode: rate that goes into HW descriptors 144 * @ratecode: rate that goes into HW descriptors
145 * @short_preamble: Mask for enabling short preamble in ratecode for CCK
146 * @dot11rate: value that goes into supported 145 * @dot11rate: value that goes into supported
147 * rates info element of MLME 146 * rates info element of MLME
148 * @ctrl_rate: Index of next lower basic rate, used for duration computation 147 * @ctrl_rate: Index of next lower basic rate, used for duration computation
149 * @max_4ms_framelen: maximum frame length(bytes) for tx duration 148 * @cw40index: Index of rates having 40MHz channel width
149 * @sgi_index: Index of rates having Short Guard Interval
150 * @ht_index: high throughput rates having 40MHz channel width and
151 * Short Guard Interval
150 * @probe_interval: interval for rate control to probe for other rates 152 * @probe_interval: interval for rate control to probe for other rates
151 * @rssi_reduce_interval: interval for rate control to reduce rssi
152 * @initial_ratemax: initial ratemax value 153 * @initial_ratemax: initial ratemax value
153 */ 154 */
154struct ath_rate_table { 155struct ath_rate_table {
@@ -175,6 +176,13 @@ struct ath_rateset {
175 u8 rs_rates[ATH_RATE_MAX]; 176 u8 rs_rates[ATH_RATE_MAX];
176}; 177};
177 178
179struct ath_rc_stats {
180 u32 success;
181 u32 retries;
182 u32 xretries;
183 u8 per;
184};
185
178/** 186/**
179 * struct ath_rate_priv - Rate Control priv data 187 * struct ath_rate_priv - Rate Control priv data
180 * @state: RC state 188 * @state: RC state
@@ -187,7 +195,6 @@ struct ath_rateset {
187 * @rate_max_phy: phy index for the max rate 195 * @rate_max_phy: phy index for the max rate
188 * @per: PER for every valid rate in % 196 * @per: PER for every valid rate in %
189 * @probe_interval: interval for ratectrl to probe for other rates 197 * @probe_interval: interval for ratectrl to probe for other rates
190 * @prev_data_rix: rate idx of last data frame
191 * @ht_cap: HT capabilities 198 * @ht_cap: HT capabilities
192 * @neg_rates: Negotatied rates 199 * @neg_rates: Negotatied rates
193 * @neg_ht_rates: Negotiated HT rates 200 * @neg_ht_rates: Negotiated HT rates
@@ -206,17 +213,13 @@ struct ath_rate_priv {
206 u32 probe_time; 213 u32 probe_time;
207 u32 per_down_time; 214 u32 per_down_time;
208 u32 probe_interval; 215 u32 probe_interval;
209 u32 prev_data_rix;
210 u32 tx_triglevel_max;
211 struct ath_rateset neg_rates; 216 struct ath_rateset neg_rates;
212 struct ath_rateset neg_ht_rates; 217 struct ath_rateset neg_ht_rates;
213 struct ath_rate_softc *asc; 218 const struct ath_rate_table *rate_table;
214};
215 219
216#define ATH_TX_INFO_FRAME_TYPE_INTERNAL (1 << 0) 220 struct dentry *debugfs_rcstats;
217#define ATH_TX_INFO_FRAME_TYPE_PAUSE (1 << 1) 221 struct ath_rc_stats rcstats[RATE_TABLE_SIZE];
218#define ATH_TX_INFO_XRETRY (1 << 3) 222};
219#define ATH_TX_INFO_UNDERRUN (1 << 4)
220 223
221enum ath9k_internal_frame_type { 224enum ath9k_internal_frame_type {
222 ATH9K_IFT_NOT_INTERNAL, 225 ATH9K_IFT_NOT_INTERNAL,
@@ -224,7 +227,18 @@ enum ath9k_internal_frame_type {
224 ATH9K_IFT_UNPAUSE 227 ATH9K_IFT_UNPAUSE
225}; 228};
226 229
230#ifdef CONFIG_ATH9K_RATE_CONTROL
227int ath_rate_control_register(void); 231int ath_rate_control_register(void);
228void ath_rate_control_unregister(void); 232void ath_rate_control_unregister(void);
233#else
234static inline int ath_rate_control_register(void)
235{
236 return 0;
237}
238
239static inline void ath_rate_control_unregister(void)
240{
241}
242#endif
229 243
230#endif /* RC_H */ 244#endif /* RC_H */