diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2008-11-17 22:33:12 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-26 09:47:22 -0500 |
commit | 256b77593f3ec07f58cd1f0d573ffe9ccd941b5b (patch) | |
tree | 024d9dfaa62878bbf54d71012405f72ad44709b7 /drivers/net/wireless/ath9k/rc.h | |
parent | 3fcdfb4b940a226184bc01bfc5c58b32b509b965 (diff) |
ath9k: Merge struct ath_tx_ratectrl with ath_rate_node
Avoid casting of ath_tx_ratctrl and access the elements directly.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/rc.h')
-rw-r--r-- | drivers/net/wireless/ath9k/rc.h | 71 |
1 files changed, 30 insertions, 41 deletions
diff --git a/drivers/net/wireless/ath9k/rc.h b/drivers/net/wireless/ath9k/rc.h index 6671097fad72..2166243045de 100644 --- a/drivers/net/wireless/ath9k/rc.h +++ b/drivers/net/wireless/ath9k/rc.h | |||
@@ -204,8 +204,22 @@ struct ath_tx_ratectrl_state { | |||
204 | u8 per; /* recent estimate of packet error rate (%) */ | 204 | u8 per; /* recent estimate of packet error rate (%) */ |
205 | }; | 205 | }; |
206 | 206 | ||
207 | struct ath_rateset { | ||
208 | u8 rs_nrates; | ||
209 | u8 rs_rates[ATH_RATE_MAX]; | ||
210 | }; | ||
211 | |||
212 | /* per-device state */ | ||
213 | struct ath_rate_softc { | ||
214 | /* phy tables that contain rate control data */ | ||
215 | const void *hw_rate_table[ATH9K_MODE_MAX]; | ||
216 | |||
217 | /* -1 or index of fixed rate */ | ||
218 | int fixedrix; | ||
219 | }; | ||
220 | |||
207 | /** | 221 | /** |
208 | * struct ath_tx_ratectrl - TX Rate control Information | 222 | * struct ath_rate_node - Rate Control priv data |
209 | * @state: RC state | 223 | * @state: RC state |
210 | * @rssi_last: last ACK rssi | 224 | * @rssi_last: last ACK rssi |
211 | * @rssi_last_lookup: last ACK rssi used for lookup | 225 | * @rssi_last_lookup: last ACK rssi used for lookup |
@@ -224,9 +238,15 @@ struct ath_tx_ratectrl_state { | |||
224 | * @valid_phy_ratecnt: valid rate count | 238 | * @valid_phy_ratecnt: valid rate count |
225 | * @rate_max_phy: phy index for the max rate | 239 | * @rate_max_phy: phy index for the max rate |
226 | * @probe_interval: interval for ratectrl to probe for other rates | 240 | * @probe_interval: interval for ratectrl to probe for other rates |
241 | * @prev_data_rix: rate idx of last data frame | ||
242 | * @ht_cap: HT capabilities | ||
243 | * @single_stream: When TRUE, only single TX stream possible | ||
244 | * @neg_rates: Negotatied rates | ||
245 | * @neg_ht_rates: Negotiated HT rates | ||
227 | */ | 246 | */ |
228 | struct ath_tx_ratectrl { | 247 | |
229 | struct ath_tx_ratectrl_state state[MAX_TX_RATE_TBL]; | 248 | /* per-node state */ |
249 | struct ath_rate_node { | ||
230 | int8_t rssi_last; | 250 | int8_t rssi_last; |
231 | int8_t rssi_last_lookup; | 251 | int8_t rssi_last_lookup; |
232 | int8_t rssi_last_prev; | 252 | int8_t rssi_last_prev; |
@@ -236,55 +256,24 @@ struct ath_tx_ratectrl { | |||
236 | int32_t rssi_sum; | 256 | int32_t rssi_sum; |
237 | u8 rate_table_size; | 257 | u8 rate_table_size; |
238 | u8 probe_rate; | 258 | u8 probe_rate; |
239 | u32 rssi_time; | ||
240 | u32 rssi_down_time; | ||
241 | u32 probe_time; | ||
242 | u8 hw_maxretry_pktcnt; | 259 | u8 hw_maxretry_pktcnt; |
243 | u8 max_valid_rate; | 260 | u8 max_valid_rate; |
244 | u8 valid_rate_index[MAX_TX_RATE_TBL]; | 261 | u8 valid_rate_index[MAX_TX_RATE_TBL]; |
245 | u32 per_down_time; | 262 | u8 ht_cap; |
246 | 263 | u8 single_stream; | |
247 | /* 11n state */ | ||
248 | u8 valid_phy_ratecnt[WLAN_RC_PHY_MAX]; | 264 | u8 valid_phy_ratecnt[WLAN_RC_PHY_MAX]; |
249 | u8 valid_phy_rateidx[WLAN_RC_PHY_MAX][MAX_TX_RATE_TBL]; | 265 | u8 valid_phy_rateidx[WLAN_RC_PHY_MAX][MAX_TX_RATE_TBL]; |
250 | u8 rc_phy_mode; | 266 | u8 rc_phy_mode; |
251 | u8 rate_max_phy; | 267 | u8 rate_max_phy; |
268 | u32 rssi_time; | ||
269 | u32 rssi_down_time; | ||
270 | u32 probe_time; | ||
271 | u32 per_down_time; | ||
252 | u32 probe_interval; | 272 | u32 probe_interval; |
253 | }; | ||
254 | |||
255 | struct ath_rateset { | ||
256 | u8 rs_nrates; | ||
257 | u8 rs_rates[ATH_RATE_MAX]; | ||
258 | }; | ||
259 | |||
260 | /* per-device state */ | ||
261 | struct ath_rate_softc { | ||
262 | /* phy tables that contain rate control data */ | ||
263 | const void *hw_rate_table[ATH9K_MODE_MAX]; | ||
264 | |||
265 | /* -1 or index of fixed rate */ | ||
266 | int fixedrix; | ||
267 | }; | ||
268 | |||
269 | /* per-node state */ | ||
270 | struct ath_rate_node { | ||
271 | struct ath_tx_ratectrl tx_ratectrl; | ||
272 | |||
273 | /* rate idx of last data frame */ | ||
274 | u32 prev_data_rix; | 273 | u32 prev_data_rix; |
275 | 274 | struct ath_tx_ratectrl_state state[MAX_TX_RATE_TBL]; | |
276 | /* ht capabilities */ | ||
277 | u8 ht_cap; | ||
278 | |||
279 | /* When TRUE, only single stream Tx possible */ | ||
280 | u8 single_stream; | ||
281 | |||
282 | /* Negotiated rates */ | ||
283 | struct ath_rateset neg_rates; | 275 | struct ath_rateset neg_rates; |
284 | |||
285 | /* Negotiated HT rates */ | ||
286 | struct ath_rateset neg_ht_rates; | 276 | struct ath_rateset neg_ht_rates; |
287 | |||
288 | struct ath_rate_softc *asc; | 277 | struct ath_rate_softc *asc; |
289 | struct ath_vap *avp; | 278 | struct ath_vap *avp; |
290 | }; | 279 | }; |