diff options
author | Guy Cohen <guy.cohen@intel.com> | 2008-04-21 18:42:01 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-07 15:02:16 -0400 |
commit | fde0db310fd4979e0d8e6ba009975d23cc7e65ac (patch) | |
tree | 79bc5dab39cce0cbc2b4d40433b53c048efbd38a /drivers/net/wireless/iwlwifi/iwl-4965-rs.h | |
parent | d1141dfb3ab5545491e3aa15b7f0d7330a186281 (diff) |
iwlwifi: HT antenna/chains overhaul
1. This patch restructures rate scale algorithm to support
SISO, MIMO2, MIMO3
2. It adds support for detailed valid TX and RX antennas settings
3. It removes few unesfull antenna definitions
Signed-off-by: Guy Cohen <guy.cohen@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@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.h | 85 |
1 files changed, 56 insertions, 29 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.h b/drivers/net/wireless/iwlwifi/iwl-4965-rs.h index 866e378aa385..f6793203515d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.h | |||
@@ -32,7 +32,8 @@ | |||
32 | struct iwl4965_rate_info { | 32 | struct iwl4965_rate_info { |
33 | u8 plcp; /* uCode API: IWL_RATE_6M_PLCP, etc. */ | 33 | u8 plcp; /* uCode API: IWL_RATE_6M_PLCP, etc. */ |
34 | u8 plcp_siso; /* uCode API: IWL_RATE_SISO_6M_PLCP, etc. */ | 34 | u8 plcp_siso; /* uCode API: IWL_RATE_SISO_6M_PLCP, etc. */ |
35 | u8 plcp_mimo; /* uCode API: IWL_RATE_MIMO_6M_PLCP, etc. */ | 35 | u8 plcp_mimo2; /* uCode API: IWL_RATE_MIMO2_6M_PLCP, etc. */ |
36 | u8 plcp_mimo3; /* uCode API: IWL_RATE_MIMO3_6M_PLCP, etc. */ | ||
36 | u8 ieee; /* MAC header: IWL_RATE_6M_IEEE, etc. */ | 37 | u8 ieee; /* MAC header: IWL_RATE_6M_IEEE, etc. */ |
37 | u8 prev_ieee; /* previous rate in IEEE speeds */ | 38 | u8 prev_ieee; /* previous rate in IEEE speeds */ |
38 | u8 next_ieee; /* next rate in IEEE speeds */ | 39 | u8 next_ieee; /* next rate in IEEE speeds */ |
@@ -60,9 +61,9 @@ enum { | |||
60 | IWL_RATE_48M_INDEX, | 61 | IWL_RATE_48M_INDEX, |
61 | IWL_RATE_54M_INDEX, | 62 | IWL_RATE_54M_INDEX, |
62 | IWL_RATE_60M_INDEX, | 63 | IWL_RATE_60M_INDEX, |
63 | IWL_RATE_COUNT, | 64 | IWL_RATE_COUNT, /*FIXME:RS:change to IWL_RATE_INDEX_COUNT,*/ |
64 | IWL_RATE_INVM_INDEX = IWL_RATE_COUNT, | 65 | IWL_RATE_INVM_INDEX = IWL_RATE_COUNT, |
65 | IWL_RATE_INVALID = IWL_RATE_INVM_INDEX | 66 | IWL_RATE_INVALID = IWL_RATE_COUNT, |
66 | }; | 67 | }; |
67 | 68 | ||
68 | enum { | 69 | enum { |
@@ -97,11 +98,13 @@ enum { | |||
97 | IWL_RATE_36M_PLCP = 11, | 98 | IWL_RATE_36M_PLCP = 11, |
98 | IWL_RATE_48M_PLCP = 1, | 99 | IWL_RATE_48M_PLCP = 1, |
99 | IWL_RATE_54M_PLCP = 3, | 100 | IWL_RATE_54M_PLCP = 3, |
100 | IWL_RATE_60M_PLCP = 3, | 101 | IWL_RATE_60M_PLCP = 3,/*FIXME:RS:should be removed*/ |
101 | IWL_RATE_1M_PLCP = 10, | 102 | IWL_RATE_1M_PLCP = 10, |
102 | IWL_RATE_2M_PLCP = 20, | 103 | IWL_RATE_2M_PLCP = 20, |
103 | IWL_RATE_5M_PLCP = 55, | 104 | IWL_RATE_5M_PLCP = 55, |
104 | IWL_RATE_11M_PLCP = 110, | 105 | IWL_RATE_11M_PLCP = 110, |
106 | /*FIXME:RS:change to IWL_RATE_LEGACY_??M_PLCP */ | ||
107 | /*FIXME:RS:add IWL_RATE_LEGACY_INVM_PLCP = 0,*/ | ||
105 | }; | 108 | }; |
106 | 109 | ||
107 | /* 4965 uCode API values for OFDM high-throughput (HT) bit rates */ | 110 | /* 4965 uCode API values for OFDM high-throughput (HT) bit rates */ |
@@ -114,16 +117,25 @@ enum { | |||
114 | IWL_RATE_SISO_48M_PLCP = 5, | 117 | IWL_RATE_SISO_48M_PLCP = 5, |
115 | IWL_RATE_SISO_54M_PLCP = 6, | 118 | IWL_RATE_SISO_54M_PLCP = 6, |
116 | IWL_RATE_SISO_60M_PLCP = 7, | 119 | IWL_RATE_SISO_60M_PLCP = 7, |
117 | IWL_RATE_MIMO_6M_PLCP = 0x8, | 120 | IWL_RATE_MIMO2_6M_PLCP = 0x8, |
118 | IWL_RATE_MIMO_12M_PLCP = 0x9, | 121 | IWL_RATE_MIMO2_12M_PLCP = 0x9, |
119 | IWL_RATE_MIMO_18M_PLCP = 0xa, | 122 | IWL_RATE_MIMO2_18M_PLCP = 0xa, |
120 | IWL_RATE_MIMO_24M_PLCP = 0xb, | 123 | IWL_RATE_MIMO2_24M_PLCP = 0xb, |
121 | IWL_RATE_MIMO_36M_PLCP = 0xc, | 124 | IWL_RATE_MIMO2_36M_PLCP = 0xc, |
122 | IWL_RATE_MIMO_48M_PLCP = 0xd, | 125 | IWL_RATE_MIMO2_48M_PLCP = 0xd, |
123 | IWL_RATE_MIMO_54M_PLCP = 0xe, | 126 | IWL_RATE_MIMO2_54M_PLCP = 0xe, |
124 | IWL_RATE_MIMO_60M_PLCP = 0xf, | 127 | IWL_RATE_MIMO2_60M_PLCP = 0xf, |
128 | IWL_RATE_MIMO3_6M_PLCP = 0x10, | ||
129 | IWL_RATE_MIMO3_12M_PLCP = 0x11, | ||
130 | IWL_RATE_MIMO3_18M_PLCP = 0x12, | ||
131 | IWL_RATE_MIMO3_24M_PLCP = 0x13, | ||
132 | IWL_RATE_MIMO3_36M_PLCP = 0x14, | ||
133 | IWL_RATE_MIMO3_48M_PLCP = 0x15, | ||
134 | IWL_RATE_MIMO3_54M_PLCP = 0x16, | ||
135 | IWL_RATE_MIMO3_60M_PLCP = 0x17, | ||
125 | IWL_RATE_SISO_INVM_PLCP, | 136 | IWL_RATE_SISO_INVM_PLCP, |
126 | IWL_RATE_MIMO_INVM_PLCP = IWL_RATE_SISO_INVM_PLCP, | 137 | IWL_RATE_MIMO2_INVM_PLCP = IWL_RATE_SISO_INVM_PLCP, |
138 | IWL_RATE_MIMO3_INVM_PLCP = IWL_RATE_SISO_INVM_PLCP, | ||
127 | }; | 139 | }; |
128 | 140 | ||
129 | /* MAC header values for bit rates */ | 141 | /* MAC header values for bit rates */ |
@@ -196,11 +208,11 @@ enum { | |||
196 | /* possible actions when in legacy mode */ | 208 | /* possible actions when in legacy mode */ |
197 | #define IWL_LEGACY_SWITCH_ANTENNA 0 | 209 | #define IWL_LEGACY_SWITCH_ANTENNA 0 |
198 | #define IWL_LEGACY_SWITCH_SISO 1 | 210 | #define IWL_LEGACY_SWITCH_SISO 1 |
199 | #define IWL_LEGACY_SWITCH_MIMO 2 | 211 | #define IWL_LEGACY_SWITCH_MIMO2 2 |
200 | 212 | ||
201 | /* possible actions when in siso mode */ | 213 | /* possible actions when in siso mode */ |
202 | #define IWL_SISO_SWITCH_ANTENNA 0 | 214 | #define IWL_SISO_SWITCH_ANTENNA 0 |
203 | #define IWL_SISO_SWITCH_MIMO 1 | 215 | #define IWL_SISO_SWITCH_MIMO2 1 |
204 | #define IWL_SISO_SWITCH_GI 2 | 216 | #define IWL_SISO_SWITCH_GI 2 |
205 | 217 | ||
206 | /* possible actions when in mimo mode */ | 218 | /* possible actions when in mimo mode */ |
@@ -208,6 +220,10 @@ enum { | |||
208 | #define IWL_MIMO_SWITCH_ANTENNA_B 1 | 220 | #define IWL_MIMO_SWITCH_ANTENNA_B 1 |
209 | #define IWL_MIMO_SWITCH_GI 2 | 221 | #define IWL_MIMO_SWITCH_GI 2 |
210 | 222 | ||
223 | /*FIXME:RS:separate MIMO2/3 transitions*/ | ||
224 | |||
225 | /*FIXME:RS:add posible acctions for MIMO3*/ | ||
226 | |||
211 | #define IWL_ACTION_LIMIT 3 /* # possible actions */ | 227 | #define IWL_ACTION_LIMIT 3 /* # possible actions */ |
212 | 228 | ||
213 | #define LQ_SIZE 2 /* 2 mode tables: "Active" and "Search" */ | 229 | #define LQ_SIZE 2 /* 2 mode tables: "Active" and "Search" */ |
@@ -226,29 +242,40 @@ enum { | |||
226 | 242 | ||
227 | extern const struct iwl4965_rate_info iwl4965_rates[IWL_RATE_COUNT]; | 243 | extern const struct iwl4965_rate_info iwl4965_rates[IWL_RATE_COUNT]; |
228 | 244 | ||
229 | enum iwl4965_table_type { | 245 | enum iwl_table_type { |
230 | LQ_NONE, | 246 | LQ_NONE, |
231 | LQ_G, /* legacy types */ | 247 | LQ_G, /* legacy types */ |
232 | LQ_A, | 248 | LQ_A, |
233 | LQ_SISO, /* high-throughput types */ | 249 | LQ_SISO, /* high-throughput types */ |
234 | LQ_MIMO, | 250 | LQ_MIMO2, |
251 | LQ_MIMO3, | ||
235 | LQ_MAX, | 252 | LQ_MAX, |
236 | }; | 253 | }; |
237 | 254 | ||
238 | #define is_legacy(tbl) (((tbl) == LQ_G) || ((tbl) == LQ_A)) | 255 | #define is_legacy(tbl) (((tbl) == LQ_G) || ((tbl) == LQ_A)) |
239 | #define is_siso(tbl) (((tbl) == LQ_SISO)) | 256 | #define is_siso(tbl) ((tbl) == LQ_SISO) |
240 | #define is_mimo(tbl) (((tbl) == LQ_MIMO)) | 257 | #define is_mimo2(tbl) ((tbl) == LQ_MIMO2) |
258 | #define is_mimo3(tbl) ((tbl) == LQ_MIMO3) | ||
259 | #define is_mimo(tbl) (is_mimo2(tbl) || is_mimo3(tbl)) | ||
241 | #define is_Ht(tbl) (is_siso(tbl) || is_mimo(tbl)) | 260 | #define is_Ht(tbl) (is_siso(tbl) || is_mimo(tbl)) |
242 | #define is_a_band(tbl) (((tbl) == LQ_A)) | 261 | #define is_a_band(tbl) ((tbl) == LQ_A) |
243 | #define is_g_and(tbl) (((tbl) == LQ_G)) | 262 | #define is_g_and(tbl) ((tbl) == LQ_G) |
244 | 263 | ||
245 | /* 4965 has 2 antennas/chains for Tx (but 3 for Rx) */ | 264 | #define ANT_NONE 0x0 |
246 | enum iwl4965_antenna_type { | 265 | #define ANT_A BIT(0) |
247 | ANT_NONE, | 266 | #define ANT_B BIT(1) |
248 | ANT_MAIN, | 267 | #define ANT_AB (ANT_A | ANT_B) |
249 | ANT_AUX, | 268 | #define ANT_C BIT(2) |
250 | ANT_BOTH, | 269 | #define ANT_AC (ANT_A | ANT_C) |
251 | }; | 270 | #define ANT_BC (ANT_B | ANT_C) |
271 | #define ANT_ABC (ANT_AB | ANT_C) | ||
272 | |||
273 | static inline u8 num_of_ant(u8 mask) | ||
274 | { | ||
275 | return !!((mask) & ANT_A) + | ||
276 | !!((mask) & ANT_B) + | ||
277 | !!((mask) & ANT_C); | ||
278 | } | ||
252 | 279 | ||
253 | static inline u8 iwl4965_get_prev_ieee_rate(u8 rate_index) | 280 | static inline u8 iwl4965_get_prev_ieee_rate(u8 rate_index) |
254 | { | 281 | { |