aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965-rs.h
diff options
context:
space:
mode:
authorBen Cahill <ben.m.cahill@intel.com>2007-11-28 22:09:44 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:05:15 -0500
commit7762635547ad31ecb045e7073989e76ae13e6c54 (patch)
tree041e42e31702b2a0e9934baf7c395aa0c314fb63 /drivers/net/wireless/iwlwifi/iwl-4965-rs.h
parentf58177b9c3f377eee31bac719bda87e1aab415ab (diff)
iwl4965: add comments to rate scaling code
Add comments to rate scaling code. Signed-off-by: Ben Cahill <ben.m.cahill@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965-rs.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-rs.h45
1 files changed, 29 insertions, 16 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.h b/drivers/net/wireless/iwlwifi/iwl-4965-rs.h
index 4259099eae71..86f62d809058 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.h
@@ -30,10 +30,10 @@
30#include "iwl-4965.h" 30#include "iwl-4965.h"
31 31
32struct iwl4965_rate_info { 32struct iwl4965_rate_info {
33 u8 plcp; 33 u8 plcp; /* uCode API: IWL_RATE_6M_PLCP, etc. */
34 u8 plcp_siso; 34 u8 plcp_siso; /* uCode API: IWL_RATE_SISO_6M_PLCP, etc. */
35 u8 plcp_mimo; 35 u8 plcp_mimo; /* uCode API: IWL_RATE_MIMO_6M_PLCP, etc. */
36 u8 ieee; 36 u8 ieee; /* MAC header: IWL_RATE_6M_IEEE, etc. */
37 u8 prev_ieee; /* previous rate in IEEE speeds */ 37 u8 prev_ieee; /* previous rate in IEEE speeds */
38 u8 next_ieee; /* next rate in IEEE speeds */ 38 u8 next_ieee; /* next rate in IEEE speeds */
39 u8 prev_rs; /* previous rate used in rs algo */ 39 u8 prev_rs; /* previous rate used in rs algo */
@@ -42,6 +42,7 @@ struct iwl4965_rate_info {
42 u8 next_rs_tgg; /* next rate used in TGG rs algo */ 42 u8 next_rs_tgg; /* next rate used in TGG rs algo */
43}; 43};
44 44
45/* For driver (not uCode API) */
45enum { 46enum {
46 IWL_RATE_1M_INDEX = 0, 47 IWL_RATE_1M_INDEX = 0,
47 IWL_RATE_2M_INDEX, 48 IWL_RATE_2M_INDEX,
@@ -83,6 +84,7 @@ enum {
83#define IWL_RATE_5M_MASK (1<<IWL_RATE_5M_INDEX) 84#define IWL_RATE_5M_MASK (1<<IWL_RATE_5M_INDEX)
84#define IWL_RATE_11M_MASK (1<<IWL_RATE_11M_INDEX) 85#define IWL_RATE_11M_MASK (1<<IWL_RATE_11M_INDEX)
85 86
87/* 4965 uCode API values for legacy bit rates, both OFDM and CCK */
86enum { 88enum {
87 IWL_RATE_6M_PLCP = 13, 89 IWL_RATE_6M_PLCP = 13,
88 IWL_RATE_9M_PLCP = 15, 90 IWL_RATE_9M_PLCP = 15,
@@ -99,7 +101,7 @@ enum {
99 IWL_RATE_11M_PLCP = 110, 101 IWL_RATE_11M_PLCP = 110,
100}; 102};
101 103
102/* OFDM HT rate plcp */ 104/* 4965 uCode API values for OFDM high-throughput (HT) bit rates */
103enum { 105enum {
104 IWL_RATE_SISO_6M_PLCP = 0, 106 IWL_RATE_SISO_6M_PLCP = 0,
105 IWL_RATE_SISO_12M_PLCP = 1, 107 IWL_RATE_SISO_12M_PLCP = 1,
@@ -121,6 +123,7 @@ enum {
121 IWL_RATE_MIMO_INVM_PLCP = IWL_RATE_SISO_INVM_PLCP, 123 IWL_RATE_MIMO_INVM_PLCP = IWL_RATE_SISO_INVM_PLCP,
122}; 124};
123 125
126/* MAC header values for bit rates */
124enum { 127enum {
125 IWL_RATE_6M_IEEE = 12, 128 IWL_RATE_6M_IEEE = 12,
126 IWL_RATE_9M_IEEE = 18, 129 IWL_RATE_9M_IEEE = 18,
@@ -170,13 +173,8 @@ enum {
170#define IWL_MIN_RSSI_VAL -100 173#define IWL_MIN_RSSI_VAL -100
171#define IWL_MAX_RSSI_VAL 0 174#define IWL_MAX_RSSI_VAL 0
172 175
173#define IWL_LEGACY_SWITCH_ANTENNA 0 176/* These values specify how many Tx frame attempts before
174#define IWL_LEGACY_SWITCH_SISO 1 177 * searching for a new modulation mode */
175#define IWL_LEGACY_SWITCH_MIMO 2
176
177#define IWL_RS_GOOD_RATIO 12800
178
179#define IWL_ACTION_LIMIT 3
180#define IWL_LEGACY_FAILURE_LIMIT 160 178#define IWL_LEGACY_FAILURE_LIMIT 160
181#define IWL_LEGACY_SUCCESS_LIMIT 480 179#define IWL_LEGACY_SUCCESS_LIMIT 480
182#define IWL_LEGACY_TABLE_COUNT 160 180#define IWL_LEGACY_TABLE_COUNT 160
@@ -185,29 +183,44 @@ enum {
185#define IWL_NONE_LEGACY_SUCCESS_LIMIT 4500 183#define IWL_NONE_LEGACY_SUCCESS_LIMIT 4500
186#define IWL_NONE_LEGACY_TABLE_COUNT 1500 184#define IWL_NONE_LEGACY_TABLE_COUNT 1500
187 185
188#define IWL_RATE_SCALE_SWITCH (10880) 186/* Success ratio (ACKed / attempted tx frames) values (perfect is 128 * 100) */
187#define IWL_RS_GOOD_RATIO 12800 /* 100% */
188#define IWL_RATE_SCALE_SWITCH 10880 /* 85% */
189#define IWL_RATE_HIGH_TH 10880 /* 85% */
190#define IWL_RATE_INCREASE_TH 8960 /* 70% */
191#define IWL_RATE_DECREASE_TH 1920 /* 15% */
189 192
193/* possible actions when in legacy mode */
194#define IWL_LEGACY_SWITCH_ANTENNA 0
195#define IWL_LEGACY_SWITCH_SISO 1
196#define IWL_LEGACY_SWITCH_MIMO 2
197
198/* possible actions when in siso mode */
190#define IWL_SISO_SWITCH_ANTENNA 0 199#define IWL_SISO_SWITCH_ANTENNA 0
191#define IWL_SISO_SWITCH_MIMO 1 200#define IWL_SISO_SWITCH_MIMO 1
192#define IWL_SISO_SWITCH_GI 2 201#define IWL_SISO_SWITCH_GI 2
193 202
203/* possible actions when in mimo mode */
194#define IWL_MIMO_SWITCH_ANTENNA_A 0 204#define IWL_MIMO_SWITCH_ANTENNA_A 0
195#define IWL_MIMO_SWITCH_ANTENNA_B 1 205#define IWL_MIMO_SWITCH_ANTENNA_B 1
196#define IWL_MIMO_SWITCH_GI 2 206#define IWL_MIMO_SWITCH_GI 2
197 207
198#define LQ_SIZE 2 208#define IWL_ACTION_LIMIT 3 /* # possible actions */
209
210#define LQ_SIZE 2 /* 2 mode tables: "Active" and "Search" */
199 211
200extern const struct iwl4965_rate_info iwl4965_rates[IWL_RATE_COUNT]; 212extern const struct iwl4965_rate_info iwl4965_rates[IWL_RATE_COUNT];
201 213
202enum iwl4965_table_type { 214enum iwl4965_table_type {
203 LQ_NONE, 215 LQ_NONE,
204 LQ_G, 216 LQ_G, /* legacy types */
205 LQ_A, 217 LQ_A,
206 LQ_SISO, 218 LQ_SISO, /* high-throughput types */
207 LQ_MIMO, 219 LQ_MIMO,
208 LQ_MAX, 220 LQ_MAX,
209}; 221};
210 222
223/* 4965 has 2 antennas/chains for Tx (but 3 for Rx) */
211enum iwl4965_antenna_type { 224enum iwl4965_antenna_type {
212 ANT_NONE, 225 ANT_NONE,
213 ANT_MAIN, 226 ANT_MAIN,