aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-rs.h
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2008-12-18 21:37:12 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:58:58 -0500
commitd9829a67f953379b5cab6b78ae8f7a879a591eb1 (patch)
treea41656685e3ecda9ecdec06ca06efc5367485f05 /drivers/net/wireless/iwlwifi/iwl-agn-rs.h
parent250bdd216c95907760b3fcc3aac1ed436d21c66c (diff)
iwl3945: Use iwl-agn-rs.h rates definitions.
A lot of rate relates definition are shared between iwl-3945-rs.h and iwl-agn-rs.h. Let's just use the agn version, and add the 3945 specific constants there. Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-rs.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.h53
1 files changed, 51 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.h b/drivers/net/wireless/iwlwifi/iwl-agn-rs.h
index 78ee83adf742..7c21292b3aeb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.h
@@ -27,8 +27,6 @@
27#ifndef __iwl_agn_rs_h__ 27#ifndef __iwl_agn_rs_h__
28#define __iwl_agn_rs_h__ 28#define __iwl_agn_rs_h__
29 29
30#include "iwl-dev.h"
31
32struct iwl_rate_info { 30struct iwl_rate_info {
33 u8 plcp; /* uCode API: IWL_RATE_6M_PLCP, etc. */ 31 u8 plcp; /* uCode API: IWL_RATE_6M_PLCP, etc. */
34 u8 plcp_siso; /* uCode API: IWL_RATE_SISO_6M_PLCP, etc. */ 32 u8 plcp_siso; /* uCode API: IWL_RATE_SISO_6M_PLCP, etc. */
@@ -43,6 +41,19 @@ struct iwl_rate_info {
43 u8 next_rs_tgg; /* next rate used in TGG rs algo */ 41 u8 next_rs_tgg; /* next rate used in TGG rs algo */
44}; 42};
45 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
46/* 57/*
47 * These serve as indexes into 58 * These serve as indexes into
48 * struct iwl_rate_info iwl_rates[IWL_RATE_COUNT]; 59 * struct iwl_rate_info iwl_rates[IWL_RATE_COUNT];
@@ -62,12 +73,30 @@ enum {
62 IWL_RATE_54M_INDEX, 73 IWL_RATE_54M_INDEX,
63 IWL_RATE_60M_INDEX, 74 IWL_RATE_60M_INDEX,
64 IWL_RATE_COUNT, /*FIXME:RS:change to IWL_RATE_INDEX_COUNT,*/ 75 IWL_RATE_COUNT, /*FIXME:RS:change to IWL_RATE_INDEX_COUNT,*/
76 IWL_RATE_COUNT_3945 = IWL_RATE_COUNT - 1,
65 IWL_RATE_INVM_INDEX = IWL_RATE_COUNT, 77 IWL_RATE_INVM_INDEX = IWL_RATE_COUNT,
66 IWL_RATE_INVALID = IWL_RATE_COUNT, 78 IWL_RATE_INVALID = IWL_RATE_COUNT,
67}; 79};
68 80
69enum { 81enum {
82 IWL_RATE_6M_INDEX_TABLE = 0,
83 IWL_RATE_9M_INDEX_TABLE,
84 IWL_RATE_12M_INDEX_TABLE,
85 IWL_RATE_18M_INDEX_TABLE,
86 IWL_RATE_24M_INDEX_TABLE,
87 IWL_RATE_36M_INDEX_TABLE,
88 IWL_RATE_48M_INDEX_TABLE,
89 IWL_RATE_54M_INDEX_TABLE,
90 IWL_RATE_1M_INDEX_TABLE,
91 IWL_RATE_2M_INDEX_TABLE,
92 IWL_RATE_5M_INDEX_TABLE,
93 IWL_RATE_11M_INDEX_TABLE,
94 IWL_RATE_INVM_INDEX_TABLE = IWL_RATE_INVM_INDEX - 1,
95};
96
97enum {
70 IWL_FIRST_OFDM_RATE = IWL_RATE_6M_INDEX, 98 IWL_FIRST_OFDM_RATE = IWL_RATE_6M_INDEX,
99 IWL39_LAST_OFDM_RATE = IWL_RATE_54M_INDEX,
71 IWL_LAST_OFDM_RATE = IWL_RATE_60M_INDEX, 100 IWL_LAST_OFDM_RATE = IWL_RATE_60M_INDEX,
72 IWL_FIRST_CCK_RATE = IWL_RATE_1M_INDEX, 101 IWL_FIRST_CCK_RATE = IWL_RATE_1M_INDEX,
73 IWL_LAST_CCK_RATE = IWL_RATE_11M_INDEX, 102 IWL_LAST_CCK_RATE = IWL_RATE_11M_INDEX,
@@ -248,6 +277,7 @@ enum {
248#define TIME_WRAP_AROUND(x, y) (((y) > (x)) ? (y) - (x) : (0-(x)) + (y)) 277#define TIME_WRAP_AROUND(x, y) (((y) > (x)) ? (y) - (x) : (0-(x)) + (y))
249 278
250extern const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT]; 279extern const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT];
280extern const struct iwl3945_rate_info iwl3945_rates[IWL_RATE_COUNT_3945];
251 281
252enum iwl_table_type { 282enum iwl_table_type {
253 LQ_NONE, 283 LQ_NONE,
@@ -303,6 +333,23 @@ static inline u8 iwl_get_prev_ieee_rate(u8 rate_index)
303 return rate; 333 return rate;
304} 334}
305 335
336static inline u8 iwl3945_get_prev_ieee_rate(u8 rate_index)
337{
338 u8 rate = iwl3945_rates[rate_index].prev_ieee;
339
340 if (rate == IWL_RATE_INVALID)
341 rate = rate_index;
342 return rate;
343}
344
345/**
346 * iwl3945_rate_scale_init - Initialize the rate scale table based on assoc info
347 *
348 * The specific throughput table used is based on the type of network
349 * the associated with, including A, B, G, and G w/ TGG protection
350 */
351extern void iwl3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id);
352
306/** 353/**
307 * iwl_rate_control_register - Register the rate control algorithm callbacks 354 * iwl_rate_control_register - Register the rate control algorithm callbacks
308 * 355 *
@@ -314,6 +361,7 @@ static inline u8 iwl_get_prev_ieee_rate(u8 rate_index)
314 * 361 *
315 */ 362 */
316extern int iwlagn_rate_control_register(void); 363extern int iwlagn_rate_control_register(void);
364extern int iwl3945_rate_control_register(void);
317 365
318/** 366/**
319 * iwl_rate_control_unregister - Unregister the rate control callbacks 367 * iwl_rate_control_unregister - Unregister the rate control callbacks
@@ -322,5 +370,6 @@ extern int iwlagn_rate_control_register(void);
322 * the driver is unloaded. 370 * the driver is unloaded.
323 */ 371 */
324extern void iwlagn_rate_control_unregister(void); 372extern void iwlagn_rate_control_unregister(void);
373extern void iwl3945_rate_control_unregister(void);
325 374
326#endif /* __iwl_agn__rs__ */ 375#endif /* __iwl_agn__rs__ */