aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-rs.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-rs.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.h51
1 files changed, 3 insertions, 48 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.h b/drivers/net/wireless/iwlwifi/iwl-agn-rs.h
index 8292f6d48ec6..bdae82e7fa90 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2003 - 2010 Intel Corporation. All rights reserved. 3 * Copyright(c) 2003 - 2011 Intel Corporation. All rights reserved.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
@@ -41,20 +41,6 @@ struct iwl_rate_info {
41 u8 next_rs_tgg; /* next rate used in TGG rs algo */ 41 u8 next_rs_tgg; /* next rate used in TGG rs algo */
42}; 42};
43 43
44struct iwl3945_rate_info {
45 u8 plcp; /* uCode API: IWL_RATE_6M_PLCP, etc. */
46 u8 ieee; /* MAC header: IWL_RATE_6M_IEEE, etc. */
47 u8 prev_ieee; /* previous rate in IEEE speeds */
48 u8 next_ieee; /* next rate in IEEE speeds */
49 u8 prev_rs; /* previous rate used in rs algo */
50 u8 next_rs; /* next rate used in rs algo */
51 u8 prev_rs_tgg; /* previous rate used in TGG rs algo */
52 u8 next_rs_tgg; /* next rate used in TGG rs algo */
53 u8 table_rs_index; /* index in rate scale table cmd */
54 u8 prev_table_rs; /* prev in rate table cmd */
55};
56
57
58/* 44/*
59 * These serve as indexes into 45 * These serve as indexes into
60 * struct iwl_rate_info iwl_rates[IWL_RATE_COUNT]; 46 * struct iwl_rate_info iwl_rates[IWL_RATE_COUNT];
@@ -75,7 +61,6 @@ enum {
75 IWL_RATE_60M_INDEX, 61 IWL_RATE_60M_INDEX,
76 IWL_RATE_COUNT, /*FIXME:RS:change to IWL_RATE_INDEX_COUNT,*/ 62 IWL_RATE_COUNT, /*FIXME:RS:change to IWL_RATE_INDEX_COUNT,*/
77 IWL_RATE_COUNT_LEGACY = IWL_RATE_COUNT - 1, /* Excluding 60M */ 63 IWL_RATE_COUNT_LEGACY = IWL_RATE_COUNT - 1, /* Excluding 60M */
78 IWL_RATE_COUNT_3945 = IWL_RATE_COUNT - 1,
79 IWL_RATE_INVM_INDEX = IWL_RATE_COUNT, 64 IWL_RATE_INVM_INDEX = IWL_RATE_COUNT,
80 IWL_RATE_INVALID = IWL_RATE_COUNT, 65 IWL_RATE_INVALID = IWL_RATE_COUNT,
81}; 66};
@@ -98,7 +83,6 @@ enum {
98 83
99enum { 84enum {
100 IWL_FIRST_OFDM_RATE = IWL_RATE_6M_INDEX, 85 IWL_FIRST_OFDM_RATE = IWL_RATE_6M_INDEX,
101 IWL39_LAST_OFDM_RATE = IWL_RATE_54M_INDEX,
102 IWL_LAST_OFDM_RATE = IWL_RATE_60M_INDEX, 86 IWL_LAST_OFDM_RATE = IWL_RATE_60M_INDEX,
103 IWL_FIRST_CCK_RATE = IWL_RATE_1M_INDEX, 87 IWL_FIRST_CCK_RATE = IWL_RATE_1M_INDEX,
104 IWL_LAST_CCK_RATE = IWL_RATE_11M_INDEX, 88 IWL_LAST_CCK_RATE = IWL_RATE_11M_INDEX,
@@ -299,7 +283,6 @@ enum {
299#define TIME_WRAP_AROUND(x, y) (((y) > (x)) ? (y) - (x) : (0-(x)) + (y)) 283#define TIME_WRAP_AROUND(x, y) (((y) > (x)) ? (y) - (x) : (0-(x)) + (y))
300 284
301extern const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT]; 285extern const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT];
302extern const struct iwl3945_rate_info iwl3945_rates[IWL_RATE_COUNT_3945];
303 286
304enum iwl_table_type { 287enum iwl_table_type {
305 LQ_NONE, 288 LQ_NONE,
@@ -432,6 +415,8 @@ struct iwl_lq_sta {
432 u32 last_rate_n_flags; 415 u32 last_rate_n_flags;
433 /* packets destined for this STA are aggregated */ 416 /* packets destined for this STA are aggregated */
434 u8 is_agg; 417 u8 is_agg;
418 /* BT traffic this sta was last updated in */
419 u8 last_bt_traffic;
435}; 420};
436 421
437static inline u8 num_of_ant(u8 mask) 422static inline u8 num_of_ant(u8 mask)
@@ -451,37 +436,9 @@ static inline u8 first_antenna(u8 mask)
451} 436}
452 437
453 438
454static inline u8 iwl_get_prev_ieee_rate(u8 rate_index)
455{
456 u8 rate = iwl_rates[rate_index].prev_ieee;
457
458 if (rate == IWL_RATE_INVALID)
459 rate = rate_index;
460 return rate;
461}
462
463static inline u8 iwl3945_get_prev_ieee_rate(u8 rate_index)
464{
465 u8 rate = iwl3945_rates[rate_index].prev_ieee;
466
467 if (rate == IWL_RATE_INVALID)
468 rate = rate_index;
469 return rate;
470}
471
472/**
473 * iwl3945_rate_scale_init - Initialize the rate scale table based on assoc info
474 *
475 * The specific throughput table used is based on the type of network
476 * the associated with, including A, B, G, and G w/ TGG protection
477 */
478extern void iwl3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id);
479
480/* Initialize station's rate scaling information after adding station */ 439/* Initialize station's rate scaling information after adding station */
481extern void iwl_rs_rate_init(struct iwl_priv *priv, 440extern void iwl_rs_rate_init(struct iwl_priv *priv,
482 struct ieee80211_sta *sta, u8 sta_id); 441 struct ieee80211_sta *sta, u8 sta_id);
483extern void iwl3945_rs_rate_init(struct iwl_priv *priv,
484 struct ieee80211_sta *sta, u8 sta_id);
485 442
486/** 443/**
487 * iwl_rate_control_register - Register the rate control algorithm callbacks 444 * iwl_rate_control_register - Register the rate control algorithm callbacks
@@ -494,7 +451,6 @@ extern void iwl3945_rs_rate_init(struct iwl_priv *priv,
494 * 451 *
495 */ 452 */
496extern int iwlagn_rate_control_register(void); 453extern int iwlagn_rate_control_register(void);
497extern int iwl3945_rate_control_register(void);
498 454
499/** 455/**
500 * iwl_rate_control_unregister - Unregister the rate control callbacks 456 * iwl_rate_control_unregister - Unregister the rate control callbacks
@@ -503,6 +459,5 @@ extern int iwl3945_rate_control_register(void);
503 * the driver is unloaded. 459 * the driver is unloaded.
504 */ 460 */
505extern void iwlagn_rate_control_unregister(void); 461extern void iwlagn_rate_control_unregister(void);
506extern void iwl3945_rate_control_unregister(void);
507 462
508#endif /* __iwl_agn__rs__ */ 463#endif /* __iwl_agn__rs__ */