diff options
author | Ben Cahill <ben.m.cahill@intel.com> | 2007-11-28 22:10:09 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:05:33 -0500 |
commit | 80cc0c382db318de88577eff027d5c4097abef81 (patch) | |
tree | ae9e22b93e112e9f6fb08fa152e44befcf8b44b9 /drivers/net | |
parent | 075416cd18cb4a7ed057d9a96b388bc23b43c4b1 (diff) |
iwlwifi: add comments to RXON command and txpower formats
Add comments to RXON command and txpower formats
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')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945-commands.h | 62 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965-commands.h | 104 |
2 files changed, 124 insertions, 42 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h index 3d3c7e3d37ea..4a8fc6878cff 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h | |||
@@ -124,7 +124,7 @@ enum { | |||
124 | /* Bluetooth device coexistance config command */ | 124 | /* Bluetooth device coexistance config command */ |
125 | REPLY_BT_CONFIG = 0x9b, | 125 | REPLY_BT_CONFIG = 0x9b, |
126 | 126 | ||
127 | /* 4965 Statistics */ | 127 | /* Statistics */ |
128 | REPLY_STATISTICS_CMD = 0x9c, | 128 | REPLY_STATISTICS_CMD = 0x9c, |
129 | STATISTICS_NOTIFICATION = 0x9d, | 129 | STATISTICS_NOTIFICATION = 0x9d, |
130 | 130 | ||
@@ -140,7 +140,8 @@ enum { | |||
140 | 140 | ||
141 | /****************************************************************************** | 141 | /****************************************************************************** |
142 | * (0) | 142 | * (0) |
143 | * Header | 143 | * Commonly used structures and definitions: |
144 | * Command header, txpower | ||
144 | * | 145 | * |
145 | *****************************************************************************/ | 146 | *****************************************************************************/ |
146 | 147 | ||
@@ -183,6 +184,36 @@ struct iwl3945_cmd_header { | |||
183 | u8 data[0]; | 184 | u8 data[0]; |
184 | } __attribute__ ((packed)); | 185 | } __attribute__ ((packed)); |
185 | 186 | ||
187 | /** | ||
188 | * struct iwl3945_tx_power | ||
189 | * | ||
190 | * Used in REPLY_TX_PWR_TABLE_CMD, REPLY_SCAN_CMD, REPLY_CHANNEL_SWITCH | ||
191 | * | ||
192 | * Each entry contains two values: | ||
193 | * 1) DSP gain (or sometimes called DSP attenuation). This is a fine-grained | ||
194 | * linear value that multiplies the output of the digital signal processor, | ||
195 | * before being sent to the analog radio. | ||
196 | * 2) Radio gain. This sets the analog gain of the radio Tx path. | ||
197 | * It is a coarser setting, and behaves in a logarithmic (dB) fashion. | ||
198 | * | ||
199 | * Driver obtains values from struct iwl3945_tx_power power_gain_table[][]. | ||
200 | */ | ||
201 | struct iwl3945_tx_power { | ||
202 | u8 tx_gain; /* gain for analog radio */ | ||
203 | u8 dsp_atten; /* gain for DSP */ | ||
204 | } __attribute__ ((packed)); | ||
205 | |||
206 | /** | ||
207 | * struct iwl3945_power_per_rate | ||
208 | * | ||
209 | * Used in REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH | ||
210 | */ | ||
211 | struct iwl3945_power_per_rate { | ||
212 | u8 rate; /* plcp */ | ||
213 | struct iwl3945_tx_power tpc; | ||
214 | u8 reserved; | ||
215 | } __attribute__ ((packed)); | ||
216 | |||
186 | /****************************************************************************** | 217 | /****************************************************************************** |
187 | * (0a) | 218 | * (0a) |
188 | * Alive and Error Commands & Responses: | 219 | * Alive and Error Commands & Responses: |
@@ -328,8 +359,22 @@ enum { | |||
328 | /* transfer to host non bssid beacons in associated state */ | 359 | /* transfer to host non bssid beacons in associated state */ |
329 | #define RXON_FILTER_BCON_AWARE_MSK __constant_cpu_to_le32(1 << 6) | 360 | #define RXON_FILTER_BCON_AWARE_MSK __constant_cpu_to_le32(1 << 6) |
330 | 361 | ||
331 | /* | 362 | /** |
332 | * REPLY_RXON = 0x10 (command, has simple generic response) | 363 | * REPLY_RXON = 0x10 (command, has simple generic response) |
364 | * | ||
365 | * RXON tunes the radio tuner to a service channel, and sets up a number | ||
366 | * of parameters that are used primarily for Rx, but also for Tx operations. | ||
367 | * | ||
368 | * NOTE: When tuning to a new channel, driver must set the | ||
369 | * RXON_FILTER_ASSOC_MSK to 0. This will clear station-dependent | ||
370 | * info within the device, including the station tables, tx retry | ||
371 | * rate tables, and txpower tables. Driver must build a new station | ||
372 | * table and txpower table before transmitting anything on the RXON | ||
373 | * channel. | ||
374 | * | ||
375 | * NOTE: All RXONs wipe clean the internal txpower table. Driver must | ||
376 | * issue a new REPLY_TX_PWR_TABLE_CMD after each REPLY_RXON (0x10), | ||
377 | * regardless of whether RXON_FILTER_ASSOC_MSK is set. | ||
333 | */ | 378 | */ |
334 | struct iwl3945_rxon_cmd { | 379 | struct iwl3945_rxon_cmd { |
335 | u8 node_addr[6]; | 380 | u8 node_addr[6]; |
@@ -373,17 +418,6 @@ struct iwl3945_rxon_time_cmd { | |||
373 | __le16 reserved; | 418 | __le16 reserved; |
374 | } __attribute__ ((packed)); | 419 | } __attribute__ ((packed)); |
375 | 420 | ||
376 | struct iwl3945_tx_power { | ||
377 | u8 tx_gain; /* gain for analog radio */ | ||
378 | u8 dsp_atten; /* gain for DSP */ | ||
379 | } __attribute__ ((packed)); | ||
380 | |||
381 | struct iwl3945_power_per_rate { | ||
382 | u8 rate; /* plcp */ | ||
383 | struct iwl3945_tx_power tpc; | ||
384 | u8 reserved; | ||
385 | } __attribute__ ((packed)); | ||
386 | |||
387 | /* | 421 | /* |
388 | * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response) | 422 | * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response) |
389 | */ | 423 | */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h index bde3aa018bba..0813e3e3ef67 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h | |||
@@ -123,7 +123,7 @@ enum { | |||
123 | /* Bluetooth device coexistance config command */ | 123 | /* Bluetooth device coexistance config command */ |
124 | REPLY_BT_CONFIG = 0x9b, | 124 | REPLY_BT_CONFIG = 0x9b, |
125 | 125 | ||
126 | /* 4965 Statistics */ | 126 | /* Statistics */ |
127 | REPLY_STATISTICS_CMD = 0x9c, | 127 | REPLY_STATISTICS_CMD = 0x9c, |
128 | STATISTICS_NOTIFICATION = 0x9d, | 128 | STATISTICS_NOTIFICATION = 0x9d, |
129 | 129 | ||
@@ -147,7 +147,7 @@ enum { | |||
147 | /****************************************************************************** | 147 | /****************************************************************************** |
148 | * (0) | 148 | * (0) |
149 | * Commonly used structures and definitions: | 149 | * Commonly used structures and definitions: |
150 | * Command header, rate_n_flags | 150 | * Command header, rate_n_flags, txpower |
151 | * | 151 | * |
152 | *****************************************************************************/ | 152 | *****************************************************************************/ |
153 | 153 | ||
@@ -273,6 +273,65 @@ struct iwl4965_cmd_header { | |||
273 | #define RATE_MCS_ANT_AB_MSK 0xc000 | 273 | #define RATE_MCS_ANT_AB_MSK 0xc000 |
274 | 274 | ||
275 | 275 | ||
276 | /** | ||
277 | * struct iwl4965_tx_power - txpower format used in REPLY_SCAN_CMD | ||
278 | * | ||
279 | * Scan uses only one transmitter, so only one analog/dsp gain pair is needed. | ||
280 | */ | ||
281 | struct iwl4965_tx_power { | ||
282 | u8 tx_gain; /* gain for analog radio */ | ||
283 | u8 dsp_atten; /* gain for DSP */ | ||
284 | } __attribute__ ((packed)); | ||
285 | |||
286 | #define POWER_TABLE_NUM_ENTRIES 33 | ||
287 | #define POWER_TABLE_NUM_HT_OFDM_ENTRIES 32 | ||
288 | #define POWER_TABLE_CCK_ENTRY 32 | ||
289 | |||
290 | /** | ||
291 | * union iwl4965_tx_power_dual_stream | ||
292 | * | ||
293 | * Host format used for REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH | ||
294 | * Use __le32 version (struct tx_power_dual_stream) when building command. | ||
295 | * | ||
296 | * Driver provides radio gain and DSP attenuation settings to device in pairs, | ||
297 | * one value for each transmitter chain. The first value is for transmitter A, | ||
298 | * second for transmitter B. | ||
299 | * | ||
300 | * For SISO bit rates, both values in a pair should be identical. | ||
301 | * For MIMO rates, one value may be different from the other, | ||
302 | * in order to balance the Tx output between the two transmitters. | ||
303 | * | ||
304 | * See more details in doc for TXPOWER in iwl-4965-hw.h. | ||
305 | */ | ||
306 | union iwl4965_tx_power_dual_stream { | ||
307 | struct { | ||
308 | u8 radio_tx_gain[2]; | ||
309 | u8 dsp_predis_atten[2]; | ||
310 | } s; | ||
311 | u32 dw; | ||
312 | }; | ||
313 | |||
314 | /** | ||
315 | * struct tx_power_dual_stream | ||
316 | * | ||
317 | * Table entries in REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH | ||
318 | * | ||
319 | * Same format as iwl_tx_power_dual_stream, but __le32 | ||
320 | */ | ||
321 | struct tx_power_dual_stream { | ||
322 | __le32 dw; | ||
323 | } __attribute__ ((packed)); | ||
324 | |||
325 | /** | ||
326 | * struct iwl4965_tx_power_db | ||
327 | * | ||
328 | * Entire table within REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH | ||
329 | */ | ||
330 | struct iwl4965_tx_power_db { | ||
331 | struct tx_power_dual_stream power_tbl[POWER_TABLE_NUM_ENTRIES]; | ||
332 | } __attribute__ ((packed)); | ||
333 | |||
334 | |||
276 | /****************************************************************************** | 335 | /****************************************************************************** |
277 | * (0a) | 336 | * (0a) |
278 | * Alive and Error Commands & Responses: | 337 | * Alive and Error Commands & Responses: |
@@ -501,8 +560,22 @@ enum { | |||
501 | /* transfer to host non bssid beacons in associated state */ | 560 | /* transfer to host non bssid beacons in associated state */ |
502 | #define RXON_FILTER_BCON_AWARE_MSK __constant_cpu_to_le32(1 << 6) | 561 | #define RXON_FILTER_BCON_AWARE_MSK __constant_cpu_to_le32(1 << 6) |
503 | 562 | ||
504 | /* | 563 | /** |
505 | * REPLY_RXON = 0x10 (command, has simple generic response) | 564 | * REPLY_RXON = 0x10 (command, has simple generic response) |
565 | * | ||
566 | * RXON tunes the radio tuner to a service channel, and sets up a number | ||
567 | * of parameters that are used primarily for Rx, but also for Tx operations. | ||
568 | * | ||
569 | * NOTE: When tuning to a new channel, driver must set the | ||
570 | * RXON_FILTER_ASSOC_MSK to 0. This will clear station-dependent | ||
571 | * info within the device, including the station tables, tx retry | ||
572 | * rate tables, and txpower tables. Driver must build a new station | ||
573 | * table and txpower table before transmitting anything on the RXON | ||
574 | * channel. | ||
575 | * | ||
576 | * NOTE: All RXONs wipe clean the internal txpower table. Driver must | ||
577 | * issue a new REPLY_TX_PWR_TABLE_CMD after each REPLY_RXON (0x10), | ||
578 | * regardless of whether RXON_FILTER_ASSOC_MSK is set. | ||
506 | */ | 579 | */ |
507 | struct iwl4965_rxon_cmd { | 580 | struct iwl4965_rxon_cmd { |
508 | u8 node_addr[6]; | 581 | u8 node_addr[6]; |
@@ -550,31 +623,6 @@ struct iwl4965_rxon_time_cmd { | |||
550 | __le16 reserved; | 623 | __le16 reserved; |
551 | } __attribute__ ((packed)); | 624 | } __attribute__ ((packed)); |
552 | 625 | ||
553 | struct iwl4965_tx_power { | ||
554 | u8 tx_gain; /* gain for analog radio */ | ||
555 | u8 dsp_atten; /* gain for DSP */ | ||
556 | } __attribute__ ((packed)); | ||
557 | |||
558 | #define POWER_TABLE_NUM_ENTRIES 33 | ||
559 | #define POWER_TABLE_NUM_HT_OFDM_ENTRIES 32 | ||
560 | #define POWER_TABLE_CCK_ENTRY 32 | ||
561 | |||
562 | union iwl4965_tx_power_dual_stream { | ||
563 | struct { | ||
564 | u8 radio_tx_gain[2]; | ||
565 | u8 dsp_predis_atten[2]; | ||
566 | } s; | ||
567 | u32 dw; | ||
568 | }; | ||
569 | |||
570 | struct tx_power_dual_stream { | ||
571 | __le32 dw; | ||
572 | } __attribute__ ((packed)); | ||
573 | |||
574 | struct iwl4965_tx_power_db { | ||
575 | struct tx_power_dual_stream power_tbl[POWER_TABLE_NUM_ENTRIES]; | ||
576 | } __attribute__ ((packed)); | ||
577 | |||
578 | /* | 626 | /* |
579 | * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response) | 627 | * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response) |
580 | */ | 628 | */ |