diff options
Diffstat (limited to 'drivers/net/wireless/p54/p54common.h')
-rw-r--r-- | drivers/net/wireless/p54/p54common.h | 125 |
1 files changed, 98 insertions, 27 deletions
diff --git a/drivers/net/wireless/p54/p54common.h b/drivers/net/wireless/p54/p54common.h index f5729de83fe1..def23b1f49ec 100644 --- a/drivers/net/wireless/p54/p54common.h +++ b/drivers/net/wireless/p54/p54common.h | |||
@@ -26,12 +26,17 @@ struct bootrec { | |||
26 | } __attribute__((packed)); | 26 | } __attribute__((packed)); |
27 | 27 | ||
28 | #define PDR_SYNTH_FRONTEND_MASK 0x0007 | 28 | #define PDR_SYNTH_FRONTEND_MASK 0x0007 |
29 | #define PDR_SYNTH_FRONTEND_DUETTE3 0x0001 | ||
30 | #define PDR_SYNTH_FRONTEND_DUETTE2 0x0002 | ||
31 | #define PDR_SYNTH_FRONTEND_FRISBEE 0x0003 | ||
32 | #define PDR_SYNTH_FRONTEND_XBOW 0x0004 | ||
33 | #define PDR_SYNTH_FRONTEND_LONGBOW 0x0005 | ||
29 | #define PDR_SYNTH_IQ_CAL_MASK 0x0018 | 34 | #define PDR_SYNTH_IQ_CAL_MASK 0x0018 |
30 | #define PDR_SYNTH_IQ_CAL_PA_DETECTOR 0x0000 | 35 | #define PDR_SYNTH_IQ_CAL_PA_DETECTOR 0x0000 |
31 | #define PDR_SYNTH_IQ_CAL_DISABLED 0x0008 | 36 | #define PDR_SYNTH_IQ_CAL_DISABLED 0x0008 |
32 | #define PDR_SYNTH_IQ_CAL_ZIF 0x0010 | 37 | #define PDR_SYNTH_IQ_CAL_ZIF 0x0010 |
33 | #define PDR_SYNTH_FAA_SWITCH_MASK 0x0020 | 38 | #define PDR_SYNTH_FAA_SWITCH_MASK 0x0020 |
34 | #define PDR_SYNTH_FAA_SWITCH_ENABLED 0x0001 | 39 | #define PDR_SYNTH_FAA_SWITCH_ENABLED 0x0020 |
35 | #define PDR_SYNTH_24_GHZ_MASK 0x0040 | 40 | #define PDR_SYNTH_24_GHZ_MASK 0x0040 |
36 | #define PDR_SYNTH_24_GHZ_DISABLED 0x0040 | 41 | #define PDR_SYNTH_24_GHZ_DISABLED 0x0040 |
37 | #define PDR_SYNTH_5_GHZ_MASK 0x0080 | 42 | #define PDR_SYNTH_5_GHZ_MASK 0x0080 |
@@ -125,9 +130,13 @@ struct eeprom_pda_wrap { | |||
125 | u8 data[0]; | 130 | u8 data[0]; |
126 | } __attribute__ ((packed)); | 131 | } __attribute__ ((packed)); |
127 | 132 | ||
133 | struct p54_iq_autocal_entry { | ||
134 | __le16 iq_param[4]; | ||
135 | } __attribute__ ((packed)); | ||
136 | |||
128 | struct pda_iq_autocal_entry { | 137 | struct pda_iq_autocal_entry { |
129 | __le16 freq; | 138 | __le16 freq; |
130 | __le16 iq_param[4]; | 139 | struct p54_iq_autocal_entry params; |
131 | } __attribute__ ((packed)); | 140 | } __attribute__ ((packed)); |
132 | 141 | ||
133 | struct pda_channel_output_limit { | 142 | struct pda_channel_output_limit { |
@@ -180,6 +189,35 @@ struct pda_rssi_cal_entry { | |||
180 | __le16 add; | 189 | __le16 add; |
181 | } __attribute__ ((packed)); | 190 | } __attribute__ ((packed)); |
182 | 191 | ||
192 | struct pda_country { | ||
193 | u8 regdomain; | ||
194 | u8 alpha2[2]; | ||
195 | u8 flags; | ||
196 | } __attribute__ ((packed)); | ||
197 | |||
198 | /* | ||
199 | * Warning: Longbow's structures are bogus. | ||
200 | */ | ||
201 | struct p54_channel_output_limit_longbow { | ||
202 | __le16 rf_power_points[12]; | ||
203 | } __attribute__ ((packed)); | ||
204 | |||
205 | struct p54_pa_curve_data_sample_longbow { | ||
206 | __le16 rf_power; | ||
207 | __le16 pa_detector; | ||
208 | struct { | ||
209 | __le16 data[4]; | ||
210 | } points[3] __attribute__ ((packed)); | ||
211 | } __attribute__ ((packed)); | ||
212 | |||
213 | struct pda_custom_wrapper { | ||
214 | __le16 entries; | ||
215 | __le16 entry_size; | ||
216 | __le16 offset; | ||
217 | __le16 len; | ||
218 | u8 data[0]; | ||
219 | } __attribute__ ((packed)); | ||
220 | |||
183 | /* | 221 | /* |
184 | * this defines the PDR codes used to build PDAs as defined in document | 222 | * this defines the PDR codes used to build PDAs as defined in document |
185 | * number 553155. The current implementation mirrors version 1.1 of the | 223 | * number 553155. The current implementation mirrors version 1.1 of the |
@@ -225,8 +263,13 @@ struct pda_rssi_cal_entry { | |||
225 | /* reserved range (0x2000 - 0x7fff) */ | 263 | /* reserved range (0x2000 - 0x7fff) */ |
226 | 264 | ||
227 | /* customer range (0x8000 - 0xffff) */ | 265 | /* customer range (0x8000 - 0xffff) */ |
228 | #define PDR_BASEBAND_REGISTERS 0x8000 | 266 | #define PDR_BASEBAND_REGISTERS 0x8000 |
229 | #define PDR_PER_CHANNEL_BASEBAND_REGISTERS 0x8001 | 267 | #define PDR_PER_CHANNEL_BASEBAND_REGISTERS 0x8001 |
268 | |||
269 | /* used by our modificated eeprom image */ | ||
270 | #define PDR_RSSI_LINEAR_APPROXIMATION_CUSTOM 0xDEAD | ||
271 | #define PDR_PRISM_PA_CAL_OUTPUT_POWER_LIMITS_CUSTOM 0xBEEF | ||
272 | #define PDR_PRISM_PA_CAL_CURVE_DATA_CUSTOM 0xB05D | ||
230 | 273 | ||
231 | /* PDR definitions for default country & country list */ | 274 | /* PDR definitions for default country & country list */ |
232 | #define PDR_COUNTRY_CERT_CODE 0x80 | 275 | #define PDR_COUNTRY_CERT_CODE 0x80 |
@@ -241,12 +284,6 @@ struct pda_rssi_cal_entry { | |||
241 | #define PDR_COUNTRY_CERT_IODOOR_OUTDOOR 0x30 | 284 | #define PDR_COUNTRY_CERT_IODOOR_OUTDOOR 0x30 |
242 | #define PDR_COUNTRY_CERT_INDEX 0x0F | 285 | #define PDR_COUNTRY_CERT_INDEX 0x0F |
243 | 286 | ||
244 | /* stored in skb->cb */ | ||
245 | struct memrecord { | ||
246 | u32 start_addr; | ||
247 | u32 end_addr; | ||
248 | }; | ||
249 | |||
250 | struct p54_eeprom_lm86 { | 287 | struct p54_eeprom_lm86 { |
251 | union { | 288 | union { |
252 | struct { | 289 | struct { |
@@ -329,7 +366,7 @@ struct p54_frame_sent { | |||
329 | u8 padding; | 366 | u8 padding; |
330 | } __attribute__ ((packed)); | 367 | } __attribute__ ((packed)); |
331 | 368 | ||
332 | enum p54_tx_data_crypt { | 369 | enum p54_tx_data_crypt { |
333 | P54_CRYPTO_NONE = 0, | 370 | P54_CRYPTO_NONE = 0, |
334 | P54_CRYPTO_WEP, | 371 | P54_CRYPTO_WEP, |
335 | P54_CRYPTO_TKIP, | 372 | P54_CRYPTO_TKIP, |
@@ -340,6 +377,23 @@ enum p54_tx_data_crypt { | |||
340 | P54_CRYPTO_AESCCMP | 377 | P54_CRYPTO_AESCCMP |
341 | }; | 378 | }; |
342 | 379 | ||
380 | enum p54_tx_data_queue { | ||
381 | P54_QUEUE_BEACON = 0, | ||
382 | P54_QUEUE_FWSCAN = 1, | ||
383 | P54_QUEUE_MGMT = 2, | ||
384 | P54_QUEUE_CAB = 3, | ||
385 | P54_QUEUE_DATA = 4, | ||
386 | |||
387 | P54_QUEUE_AC_NUM = 4, | ||
388 | P54_QUEUE_AC_VO = 4, | ||
389 | P54_QUEUE_AC_VI = 5, | ||
390 | P54_QUEUE_AC_BE = 6, | ||
391 | P54_QUEUE_AC_BK = 7, | ||
392 | |||
393 | /* keep last */ | ||
394 | P54_QUEUE_NUM = 8, | ||
395 | }; | ||
396 | |||
343 | struct p54_tx_data { | 397 | struct p54_tx_data { |
344 | u8 rateset[8]; | 398 | u8 rateset[8]; |
345 | u8 rts_rate_idx; | 399 | u8 rts_rate_idx; |
@@ -351,9 +405,18 @@ struct p54_tx_data { | |||
351 | u8 backlog; | 405 | u8 backlog; |
352 | __le16 durations[4]; | 406 | __le16 durations[4]; |
353 | u8 tx_antenna; | 407 | u8 tx_antenna; |
354 | u8 output_power; | 408 | union { |
355 | u8 cts_rate; | 409 | struct { |
356 | u8 unalloc2[3]; | 410 | u8 cts_rate; |
411 | __le16 output_power; | ||
412 | } __attribute__((packed)) longbow; | ||
413 | struct { | ||
414 | u8 output_power; | ||
415 | u8 cts_rate; | ||
416 | u8 unalloc; | ||
417 | } __attribute__ ((packed)) normal; | ||
418 | } __attribute__ ((packed)); | ||
419 | u8 unalloc2[2]; | ||
357 | u8 align[0]; | 420 | u8 align[0]; |
358 | } __attribute__ ((packed)); | 421 | } __attribute__ ((packed)); |
359 | 422 | ||
@@ -414,11 +477,14 @@ struct p54_setup_mac { | |||
414 | #define P54_SCAN_ACTIVE BIT(2) | 477 | #define P54_SCAN_ACTIVE BIT(2) |
415 | #define P54_SCAN_FILTER BIT(3) | 478 | #define P54_SCAN_FILTER BIT(3) |
416 | 479 | ||
417 | struct p54_scan { | 480 | struct p54_scan_head { |
418 | __le16 mode; | 481 | __le16 mode; |
419 | __le16 dwell; | 482 | __le16 dwell; |
420 | u8 padding1[20]; | 483 | u8 scan_params[20]; |
421 | struct pda_iq_autocal_entry iq_autocal; | 484 | __le16 freq; |
485 | } __attribute__ ((packed)); | ||
486 | |||
487 | struct p54_scan_body { | ||
422 | u8 pa_points_per_curve; | 488 | u8 pa_points_per_curve; |
423 | u8 val_barker; | 489 | u8 val_barker; |
424 | u8 val_bpsk; | 490 | u8 val_bpsk; |
@@ -430,19 +496,23 @@ struct p54_scan { | |||
430 | u8 dup_qpsk; | 496 | u8 dup_qpsk; |
431 | u8 dup_16qam; | 497 | u8 dup_16qam; |
432 | u8 dup_64qam; | 498 | u8 dup_64qam; |
433 | union { | 499 | } __attribute__ ((packed)); |
434 | struct pda_rssi_cal_entry v1_rssi; | ||
435 | 500 | ||
436 | struct { | 501 | struct p54_scan_body_longbow { |
437 | __le32 basic_rate_mask; | 502 | struct p54_channel_output_limit_longbow power_limits; |
438 | u8 rts_rates[8]; | 503 | struct p54_pa_curve_data_sample_longbow curve_data[8]; |
439 | struct pda_rssi_cal_entry rssi; | 504 | __le16 unkn[6]; /* maybe more power_limits or rate_mask */ |
440 | } v2 __attribute__ ((packed)); | 505 | } __attribute__ ((packed)); |
441 | } __attribute__ ((packed)); | 506 | |
507 | union p54_scan_body_union { | ||
508 | struct p54_scan_body normal; | ||
509 | struct p54_scan_body_longbow longbow; | ||
442 | } __attribute__ ((packed)); | 510 | } __attribute__ ((packed)); |
443 | 511 | ||
444 | #define P54_SCAN_V1_LEN 0x70 | 512 | struct p54_scan_tail_rate { |
445 | #define P54_SCAN_V2_LEN 0x7c | 513 | __le32 basic_rate_mask; |
514 | u8 rts_rates[8]; | ||
515 | } __attribute__ ((packed)); | ||
446 | 516 | ||
447 | struct p54_led { | 517 | struct p54_led { |
448 | __le16 mode; | 518 | __le16 mode; |
@@ -511,6 +581,7 @@ struct p54_psm_interval { | |||
511 | __le16 periods; | 581 | __le16 periods; |
512 | } __attribute__ ((packed)); | 582 | } __attribute__ ((packed)); |
513 | 583 | ||
584 | #define P54_PSM_CAM 0 | ||
514 | #define P54_PSM BIT(0) | 585 | #define P54_PSM BIT(0) |
515 | #define P54_PSM_DTIM BIT(1) | 586 | #define P54_PSM_DTIM BIT(1) |
516 | #define P54_PSM_MCBC BIT(2) | 587 | #define P54_PSM_MCBC BIT(2) |