blob: 75ead7a150fc64f63800224cbdd0c024e1baaa86 [file] [log] [blame]
Christian Lamparter32ddf072008-08-08 21:17:37 +02001#ifndef P54COMMON_H
2#define P54COMMON_H
Michael Wueff1a592007-09-25 18:11:01 -07003
4/*
5 * Common code specific definitions for mac80211 Prism54 drivers
6 *
7 * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net>
8 * Copyright (c) 2007, Christian Lamparter <chunkeey@web.de>
9 *
Christian Lamparter0fdd7c52008-10-15 03:55:37 +020010 * Based on:
11 * - the islsm (softmac prism54) driver, which is:
12 * Copyright 2004-2006 Jean-Baptiste Note <jbnote@gmail.com>, et al.
13 *
14 * - LMAC API interface header file for STLC4560 (lmac_longbow.h)
15 * Copyright (C) 2007 Conexant Systems, Inc.
Michael Wueff1a592007-09-25 18:11:01 -070016 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation.
20 */
21
22struct bootrec {
23 __le32 code;
24 __le32 len;
Larry Finger1f1c0e32008-09-25 14:54:28 -050025 u32 data[10];
Michael Wueff1a592007-09-25 18:11:01 -070026} __attribute__((packed));
27
Christian Lamparter9e7f3f82008-10-18 23:18:01 +020028#define PDR_SYNTH_FRONTEND_MASK 0x0007
Christian Lamparter6917f502009-01-11 01:14:18 +010029#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
Christian Lamparter9e7f3f82008-10-18 23:18:01 +020034#define PDR_SYNTH_IQ_CAL_MASK 0x0018
35#define PDR_SYNTH_IQ_CAL_PA_DETECTOR 0x0000
36#define PDR_SYNTH_IQ_CAL_DISABLED 0x0008
37#define PDR_SYNTH_IQ_CAL_ZIF 0x0010
38#define PDR_SYNTH_FAA_SWITCH_MASK 0x0020
Christian Lamparter78eb7482008-12-30 13:48:19 +010039#define PDR_SYNTH_FAA_SWITCH_ENABLED 0x0020
Christian Lamparter9e7f3f82008-10-18 23:18:01 +020040#define PDR_SYNTH_24_GHZ_MASK 0x0040
41#define PDR_SYNTH_24_GHZ_DISABLED 0x0040
42#define PDR_SYNTH_5_GHZ_MASK 0x0080
43#define PDR_SYNTH_5_GHZ_DISABLED 0x0080
44#define PDR_SYNTH_RX_DIV_MASK 0x0100
45#define PDR_SYNTH_RX_DIV_SUPPORTED 0x0100
46#define PDR_SYNTH_TX_DIV_MASK 0x0200
47#define PDR_SYNTH_TX_DIV_SUPPORTED 0x0200
48
Michael Wueff1a592007-09-25 18:11:01 -070049struct bootrec_exp_if {
50 __le16 role;
51 __le16 if_id;
52 __le16 variant;
53 __le16 btm_compat;
54 __le16 top_compat;
55} __attribute__((packed));
56
John W. Linville27df6052008-10-22 16:41:55 -040057#define BR_DESC_PRIV_CAP_WEP BIT(0)
58#define BR_DESC_PRIV_CAP_TKIP BIT(1)
59#define BR_DESC_PRIV_CAP_MICHAEL BIT(2)
60#define BR_DESC_PRIV_CAP_CCX_CP BIT(3)
61#define BR_DESC_PRIV_CAP_CCX_MIC BIT(4)
62#define BR_DESC_PRIV_CAP_AESCCMP BIT(5)
63
Christian Lamparter4e416a62008-09-01 22:48:41 +020064struct bootrec_desc {
65 __le16 modes;
66 __le16 flags;
67 __le32 rx_start;
68 __le32 rx_end;
69 u8 headroom;
70 u8 tailroom;
John W. Linville27df6052008-10-22 16:41:55 -040071 u8 tx_queues;
72 u8 tx_depth;
73 u8 privacy_caps;
74 u8 rx_keycache_size;
75 u8 time_size;
76 u8 padding;
Christian Lamparter4e416a62008-09-01 22:48:41 +020077 u8 rates[16];
Larry Finger2e20cc32008-10-09 17:38:52 -070078 u8 padding2[4];
79 __le16 rx_mtu;
Christian Lamparter4e416a62008-09-01 22:48:41 +020080} __attribute__((packed));
81
Michael Wueff1a592007-09-25 18:11:01 -070082#define BR_CODE_MIN 0x80000000
83#define BR_CODE_COMPONENT_ID 0x80000001
84#define BR_CODE_COMPONENT_VERSION 0x80000002
85#define BR_CODE_DEPENDENT_IF 0x80000003
86#define BR_CODE_EXPOSED_IF 0x80000004
87#define BR_CODE_DESCR 0x80000101
88#define BR_CODE_MAX 0x8FFFFFFF
89#define BR_CODE_END_OF_BRA 0xFF0000FF
90#define LEGACY_BR_CODE_END_OF_BRA 0xFFFFFFFF
91
John W. Linville27df6052008-10-22 16:41:55 -040092#define P54_HDR_FLAG_DATA_ALIGN BIT(14)
93#define P54_HDR_FLAG_DATA_OUT_PROMISC BIT(0)
94#define P54_HDR_FLAG_DATA_OUT_TIMESTAMP BIT(1)
95#define P54_HDR_FLAG_DATA_OUT_SEQNR BIT(2)
96#define P54_HDR_FLAG_DATA_OUT_BIT3 BIT(3)
97#define P54_HDR_FLAG_DATA_OUT_BURST BIT(4)
98#define P54_HDR_FLAG_DATA_OUT_NOCANCEL BIT(5)
99#define P54_HDR_FLAG_DATA_OUT_CLEARTIM BIT(6)
100#define P54_HDR_FLAG_DATA_OUT_HITCHHIKE BIT(7)
101#define P54_HDR_FLAG_DATA_OUT_COMPRESS BIT(8)
102#define P54_HDR_FLAG_DATA_OUT_CONCAT BIT(9)
103#define P54_HDR_FLAG_DATA_OUT_PCS_ACCEPT BIT(10)
104#define P54_HDR_FLAG_DATA_OUT_WAITEOSP BIT(11)
105
106#define P54_HDR_FLAG_DATA_IN_FCS_GOOD BIT(0)
107#define P54_HDR_FLAG_DATA_IN_MATCH_MAC BIT(1)
108#define P54_HDR_FLAG_DATA_IN_MCBC BIT(2)
109#define P54_HDR_FLAG_DATA_IN_BEACON BIT(3)
110#define P54_HDR_FLAG_DATA_IN_MATCH_BSS BIT(4)
111#define P54_HDR_FLAG_DATA_IN_BCAST_BSS BIT(5)
112#define P54_HDR_FLAG_DATA_IN_DATA BIT(6)
113#define P54_HDR_FLAG_DATA_IN_TRUNCATED BIT(7)
114#define P54_HDR_FLAG_DATA_IN_BIT8 BIT(8)
115#define P54_HDR_FLAG_DATA_IN_TRANSPARENT BIT(9)
116
Michael Wueff1a592007-09-25 18:11:01 -0700117/* PDA defines are Copyright (C) 2005 Nokia Corporation (taken from islsm_pda.h) */
118
119struct pda_entry {
120 __le16 len; /* includes both code and data */
121 __le16 code;
122 u8 data[0];
123} __attribute__ ((packed));
124
125struct eeprom_pda_wrap {
Johannes Berg8c282932008-02-29 13:56:33 +0100126 __le32 magic;
127 __le16 pad;
128 __le16 len;
129 __le32 arm_opcode;
Michael Wueff1a592007-09-25 18:11:01 -0700130 u8 data[0];
131} __attribute__ ((packed));
132
Christian Lamparter6917f502009-01-11 01:14:18 +0100133struct p54_iq_autocal_entry {
134 __le16 iq_param[4];
135} __attribute__ ((packed));
136
Michael Wueff1a592007-09-25 18:11:01 -0700137struct pda_iq_autocal_entry {
138 __le16 freq;
Christian Lamparter6917f502009-01-11 01:14:18 +0100139 struct p54_iq_autocal_entry params;
Michael Wueff1a592007-09-25 18:11:01 -0700140} __attribute__ ((packed));
141
142struct pda_channel_output_limit {
143 __le16 freq;
144 u8 val_bpsk;
145 u8 val_qpsk;
146 u8 val_16qam;
147 u8 val_64qam;
148 u8 rate_set_mask;
149 u8 rate_set_size;
150} __attribute__ ((packed));
151
152struct pda_pa_curve_data_sample_rev0 {
153 u8 rf_power;
154 u8 pa_detector;
155 u8 pcv;
156} __attribute__ ((packed));
157
158struct pda_pa_curve_data_sample_rev1 {
159 u8 rf_power;
160 u8 pa_detector;
161 u8 data_barker;
162 u8 data_bpsk;
163 u8 data_qpsk;
164 u8 data_16qam;
165 u8 data_64qam;
Christian Lamparter154e3af2008-08-23 22:15:25 +0200166} __attribute__ ((packed));
167
168struct p54_pa_curve_data_sample {
169 u8 rf_power;
170 u8 pa_detector;
171 u8 data_barker;
172 u8 data_bpsk;
173 u8 data_qpsk;
174 u8 data_16qam;
175 u8 data_64qam;
Michael Wueff1a592007-09-25 18:11:01 -0700176 u8 padding;
177} __attribute__ ((packed));
178
179struct pda_pa_curve_data {
180 u8 cal_method_rev;
181 u8 channels;
182 u8 points_per_channel;
183 u8 padding;
184 u8 data[0];
185} __attribute__ ((packed));
186
Christian Lamparter69ba3e52008-12-14 14:45:30 +0100187struct pda_rssi_cal_entry {
188 __le16 mul;
189 __le16 add;
190} __attribute__ ((packed));
191
Christian Lamparter98a8d1a2008-12-26 21:50:33 +0100192struct pda_country {
193 u8 regdomain;
194 u8 alpha2[2];
195 u8 flags;
196} __attribute__ ((packed));
197
Christian Lamparter6917f502009-01-11 01:14:18 +0100198/*
199 * Warning: Longbow's structures are bogus.
200 */
201struct p54_channel_output_limit_longbow {
202 __le16 rf_power_points[12];
203} __attribute__ ((packed));
204
205struct 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
Christian Lamparter83cf1b62009-01-11 01:10:33 +0100213struct pda_custom_wrapper {
214 __le16 entries;
215 __le16 entry_size;
216 __le16 offset;
217 __le16 len;
218 u8 data[0];
219} __attribute__ ((packed));
220
Michael Wueff1a592007-09-25 18:11:01 -0700221/*
222 * this defines the PDR codes used to build PDAs as defined in document
223 * number 553155. The current implementation mirrors version 1.1 of the
224 * document and lists only PDRs supported by the ARM platform.
225 */
226
227/* common and choice range (0x0000 - 0x0fff) */
228#define PDR_END 0x0000
229#define PDR_MANUFACTURING_PART_NUMBER 0x0001
230#define PDR_PDA_VERSION 0x0002
231#define PDR_NIC_SERIAL_NUMBER 0x0003
232
233#define PDR_MAC_ADDRESS 0x0101
234#define PDR_REGULATORY_DOMAIN_LIST 0x0103
235#define PDR_TEMPERATURE_TYPE 0x0107
236
237#define PDR_PRISM_PCI_IDENTIFIER 0x0402
238
239/* ARM range (0x1000 - 0x1fff) */
240#define PDR_COUNTRY_INFORMATION 0x1000
241#define PDR_INTERFACE_LIST 0x1001
242#define PDR_HARDWARE_PLATFORM_COMPONENT_ID 0x1002
243#define PDR_OEM_NAME 0x1003
244#define PDR_PRODUCT_NAME 0x1004
245#define PDR_UTF8_OEM_NAME 0x1005
246#define PDR_UTF8_PRODUCT_NAME 0x1006
247#define PDR_COUNTRY_LIST 0x1007
248#define PDR_DEFAULT_COUNTRY 0x1008
249
250#define PDR_ANTENNA_GAIN 0x1100
251
252#define PDR_PRISM_INDIGO_PA_CALIBRATION_DATA 0x1901
253#define PDR_RSSI_LINEAR_APPROXIMATION 0x1902
254#define PDR_PRISM_PA_CAL_OUTPUT_POWER_LIMITS 0x1903
255#define PDR_PRISM_PA_CAL_CURVE_DATA 0x1904
256#define PDR_RSSI_LINEAR_APPROXIMATION_DUAL_BAND 0x1905
257#define PDR_PRISM_ZIF_TX_IQ_CALIBRATION 0x1906
258#define PDR_REGULATORY_POWER_LIMITS 0x1907
259#define PDR_RSSI_LINEAR_APPROXIMATION_EXTENDED 0x1908
260#define PDR_RADIATED_TRANSMISSION_CORRECTION 0x1909
261#define PDR_PRISM_TX_IQ_CALIBRATION 0x190a
262
263/* reserved range (0x2000 - 0x7fff) */
264
265/* customer range (0x8000 - 0xffff) */
Christian Lamparter83cf1b62009-01-11 01:10:33 +0100266#define PDR_BASEBAND_REGISTERS 0x8000
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
Michael Wueff1a592007-09-25 18:11:01 -0700273
Christian Lamparter9e7f3f82008-10-18 23:18:01 +0200274/* PDR definitions for default country & country list */
275#define PDR_COUNTRY_CERT_CODE 0x80
276#define PDR_COUNTRY_CERT_CODE_REAL 0x00
277#define PDR_COUNTRY_CERT_CODE_PSEUDO 0x80
278#define PDR_COUNTRY_CERT_BAND 0x40
279#define PDR_COUNTRY_CERT_BAND_2GHZ 0x00
280#define PDR_COUNTRY_CERT_BAND_5GHZ 0x40
281#define PDR_COUNTRY_CERT_IODOOR 0x30
282#define PDR_COUNTRY_CERT_IODOOR_BOTH 0x00
283#define PDR_COUNTRY_CERT_IODOOR_INDOOR 0x20
284#define PDR_COUNTRY_CERT_IODOOR_OUTDOOR 0x30
285#define PDR_COUNTRY_CERT_INDEX 0x0F
286
Michael Wueff1a592007-09-25 18:11:01 -0700287struct p54_eeprom_lm86 {
Christian Lamparter64c354d2008-11-29 22:35:43 +0100288 union {
289 struct {
290 __le16 offset;
291 __le16 len;
292 u8 data[0];
293 } v1;
294 struct {
295 __le32 offset;
296 __le16 len;
297 u8 magic2;
298 u8 pad;
299 u8 magic[4];
300 u8 data[0];
301 } v2;
302 } __attribute__ ((packed));
Michael Wueff1a592007-09-25 18:11:01 -0700303} __attribute__ ((packed));
304
John W. Linville27df6052008-10-22 16:41:55 -0400305enum p54_rx_decrypt_status {
306 P54_DECRYPT_NONE = 0,
307 P54_DECRYPT_OK,
308 P54_DECRYPT_NOKEY,
309 P54_DECRYPT_NOMICHAEL,
310 P54_DECRYPT_NOCKIPMIC,
311 P54_DECRYPT_FAIL_WEP,
312 P54_DECRYPT_FAIL_TKIP,
Christian Lamparterffed7852008-11-14 19:41:22 +0100313 P54_DECRYPT_FAIL_MICHAEL,
John W. Linville27df6052008-10-22 16:41:55 -0400314 P54_DECRYPT_FAIL_CKIPKP,
315 P54_DECRYPT_FAIL_CKIPMIC,
316 P54_DECRYPT_FAIL_AESCCMP
317};
318
319struct p54_rx_data {
320 __le16 flags;
Michael Wueff1a592007-09-25 18:11:01 -0700321 __le16 len;
322 __le16 freq;
323 u8 antenna;
324 u8 rate;
325 u8 rssi;
326 u8 quality;
John W. Linville27df6052008-10-22 16:41:55 -0400327 u8 decrypt_status;
328 u8 rssi_raw;
Christian Lampartera0db6632008-09-06 02:56:04 +0200329 __le32 tsf32;
330 __le32 unalloc0;
Christian Lamparter19c19d52008-09-03 22:25:25 +0200331 u8 align[0];
Michael Wueff1a592007-09-25 18:11:01 -0700332} __attribute__ ((packed));
333
John W. Linville27df6052008-10-22 16:41:55 -0400334enum p54_trap_type {
335 P54_TRAP_SCAN = 0,
336 P54_TRAP_TIMER,
337 P54_TRAP_BEACON_TX,
338 P54_TRAP_FAA_RADIO_ON,
339 P54_TRAP_FAA_RADIO_OFF,
340 P54_TRAP_RADAR,
341 P54_TRAP_NO_BEACON,
342 P54_TRAP_TBTT,
343 P54_TRAP_SCO_ENTER,
344 P54_TRAP_SCO_EXIT
345};
346
347struct p54_trap {
348 __le16 event;
349 __le16 frequency;
Michael Wueff1a592007-09-25 18:11:01 -0700350} __attribute__ ((packed));
351
John W. Linville27df6052008-10-22 16:41:55 -0400352enum p54_frame_sent_status {
353 P54_TX_OK = 0,
354 P54_TX_FAILED,
355 P54_TX_PSM,
Christian Lamparterc772a082008-11-29 22:33:57 +0100356 P54_TX_PSM_CANCELLED = 4
John W. Linville27df6052008-10-22 16:41:55 -0400357};
358
359struct p54_frame_sent {
360 u8 status;
361 u8 tries;
362 u8 ack_rssi;
363 u8 quality;
364 __le16 seq;
365 u8 antenna;
366 u8 padding;
367} __attribute__ ((packed));
368
Christian Lampartera15bd002008-12-21 20:54:34 +0100369enum p54_tx_data_crypt {
John W. Linville27df6052008-10-22 16:41:55 -0400370 P54_CRYPTO_NONE = 0,
371 P54_CRYPTO_WEP,
372 P54_CRYPTO_TKIP,
373 P54_CRYPTO_TKIPMICHAEL,
374 P54_CRYPTO_CCX_WEPMIC,
375 P54_CRYPTO_CCX_KPMIC,
376 P54_CRYPTO_CCX_KP,
377 P54_CRYPTO_AESCCMP
378};
379
Christian Lampartera15bd002008-12-21 20:54:34 +0100380enum 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
John W. Linville27df6052008-10-22 16:41:55 -0400397struct p54_tx_data {
Michael Wueff1a592007-09-25 18:11:01 -0700398 u8 rateset[8];
John W. Linville27df6052008-10-22 16:41:55 -0400399 u8 rts_rate_idx;
400 u8 crypt_offset;
Christian Lamparteraaa15532008-08-09 19:20:47 -0500401 u8 key_type;
402 u8 key_len;
403 u8 key[16];
404 u8 hw_queue;
John W. Linville27df6052008-10-22 16:41:55 -0400405 u8 backlog;
406 __le16 durations[4];
Christian Lamparteraaa15532008-08-09 19:20:47 -0500407 u8 tx_antenna;
Christian Lamparter6917f502009-01-11 01:14:18 +0100408 union {
409 struct {
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];
Michael Wueff1a592007-09-25 18:11:01 -0700420 u8 align[0];
421} __attribute__ ((packed));
422
Christian Lamparter54fdb042008-12-13 14:14:20 +0100423/* unit is ms */
424#define P54_TX_FRAME_LIFETIME 2000
425#define P54_TX_TIMEOUT 4000
426#define P54_STATISTICS_UPDATE 5000
427
John W. Linville27df6052008-10-22 16:41:55 -0400428#define P54_FILTER_TYPE_NONE 0
429#define P54_FILTER_TYPE_STATION BIT(0)
430#define P54_FILTER_TYPE_IBSS BIT(1)
431#define P54_FILTER_TYPE_AP BIT(2)
432#define P54_FILTER_TYPE_TRANSPARENT BIT(3)
433#define P54_FILTER_TYPE_PROMISCUOUS BIT(4)
434#define P54_FILTER_TYPE_HIBERNATE BIT(5)
435#define P54_FILTER_TYPE_NOACK BIT(6)
436#define P54_FILTER_TYPE_RX_DISABLED BIT(7)
437
Christian Lamparter5e734442008-10-15 04:07:56 +0200438struct p54_setup_mac {
439 __le16 mac_mode;
Christian Lampartere0a58ea2008-09-03 22:25:20 +0200440 u8 mac_addr[ETH_ALEN];
441 u8 bssid[ETH_ALEN];
442 u8 rx_antenna;
443 u8 rx_align;
Christian Lamparter19c19d52008-09-03 22:25:25 +0200444 union {
445 struct {
446 __le32 basic_rate_mask;
447 u8 rts_rates[8];
448 __le32 rx_addr;
449 __le16 max_rx;
450 __le16 rxhw;
451 __le16 wakeup_timer;
452 __le16 unalloc0;
453 } v1 __attribute__ ((packed));
454 struct {
455 __le32 rx_addr;
456 __le16 max_rx;
457 __le16 rxhw;
458 __le16 timer;
Christian Lamparter5e734442008-10-15 04:07:56 +0200459 __le16 truncate;
460 __le32 basic_rate_mask;
461 u8 sbss_offset;
462 u8 mcast_window;
463 u8 rx_rssi_threshold;
464 u8 rx_ed_threshold;
465 __le32 ref_clock;
466 __le16 lpf_bandwidth;
467 __le16 osc_start_delay;
Christian Lamparter19c19d52008-09-03 22:25:25 +0200468 } v2 __attribute__ ((packed));
469 } __attribute__ ((packed));
Michael Wueff1a592007-09-25 18:11:01 -0700470} __attribute__ ((packed));
471
John W. Linville27df6052008-10-22 16:41:55 -0400472#define P54_SETUP_V1_LEN 40
473#define P54_SETUP_V2_LEN (sizeof(struct p54_setup_mac))
474
475#define P54_SCAN_EXIT BIT(0)
476#define P54_SCAN_TRAP BIT(1)
477#define P54_SCAN_ACTIVE BIT(2)
478#define P54_SCAN_FILTER BIT(3)
479
Christian Lamparter6917f502009-01-11 01:14:18 +0100480struct p54_scan_head {
John W. Linville27df6052008-10-22 16:41:55 -0400481 __le16 mode;
Christian Lamparter154e3af2008-08-23 22:15:25 +0200482 __le16 dwell;
Christian Lamparter83cf1b62009-01-11 01:10:33 +0100483 u8 scan_params[20];
Christian Lamparter6917f502009-01-11 01:14:18 +0100484 __le16 freq;
485} __attribute__ ((packed));
486
487struct p54_scan_body {
Michael Wueff1a592007-09-25 18:11:01 -0700488 u8 pa_points_per_curve;
489 u8 val_barker;
490 u8 val_bpsk;
491 u8 val_qpsk;
492 u8 val_16qam;
493 u8 val_64qam;
Christian Lamparter19c19d52008-09-03 22:25:25 +0200494 struct p54_pa_curve_data_sample curve_data[8];
Christian Lamparter154e3af2008-08-23 22:15:25 +0200495 u8 dup_bpsk;
496 u8 dup_qpsk;
497 u8 dup_16qam;
498 u8 dup_64qam;
Michael Wueff1a592007-09-25 18:11:01 -0700499} __attribute__ ((packed));
500
Christian Lamparter6917f502009-01-11 01:14:18 +0100501struct p54_scan_body_longbow {
502 struct p54_channel_output_limit_longbow power_limits;
503 struct p54_pa_curve_data_sample_longbow curve_data[8];
504 __le16 unkn[6]; /* maybe more power_limits or rate_mask */
505} __attribute__ ((packed));
506
507union p54_scan_body_union {
508 struct p54_scan_body normal;
509 struct p54_scan_body_longbow longbow;
510} __attribute__ ((packed));
511
512struct p54_scan_tail_rate {
513 __le32 basic_rate_mask;
514 u8 rts_rates[8];
515} __attribute__ ((packed));
Christian Lamparter19c19d52008-09-03 22:25:25 +0200516
John W. Linville27df6052008-10-22 16:41:55 -0400517struct p54_led {
Christian Lamparterd0b45ae2009-03-06 01:02:04 +0100518 __le16 flags;
519 __le16 mask[2];
520 __le16 delay[2];
Michael Wueff1a592007-09-25 18:11:01 -0700521} __attribute__ ((packed));
522
Christian Lamparter0fdd7c52008-10-15 03:55:37 +0200523struct p54_edcf {
524 u8 flags;
Michael Wueff1a592007-09-25 18:11:01 -0700525 u8 slottime;
Christian Lamparter0fdd7c52008-10-15 03:55:37 +0200526 u8 sifs;
527 u8 eofpad;
528 struct p54_edcf_queue_param queue[8];
529 u8 mapping[4];
Michael Wueff1a592007-09-25 18:11:01 -0700530 __le16 frameburst;
Christian Lamparter0fdd7c52008-10-15 03:55:37 +0200531 __le16 round_trip_delay;
Michael Wueff1a592007-09-25 18:11:01 -0700532} __attribute__ ((packed));
533
Christian Lampartercc6de662008-09-06 02:56:23 +0200534struct p54_statistics {
535 __le32 rx_success;
536 __le32 rx_bad_fcs;
537 __le32 rx_abort;
538 __le32 rx_abort_phy;
539 __le32 rts_success;
540 __le32 rts_fail;
541 __le32 tsf32;
542 __le32 airtime;
543 __le32 noise;
John W. Linville27df6052008-10-22 16:41:55 -0400544 __le32 sample_noise[8];
545 __le32 sample_cca;
546 __le32 sample_tx;
Christian Lampartercc6de662008-09-06 02:56:23 +0200547} __attribute__ ((packed));
548
John W. Linville27df6052008-10-22 16:41:55 -0400549struct p54_xbow_synth {
Christian Lamparter1b997532008-09-06 14:25:58 +0200550 __le16 magic1;
551 __le16 magic2;
552 __le16 freq;
553 u32 padding[5];
554} __attribute__ ((packed));
555
John W. Linville27df6052008-10-22 16:41:55 -0400556struct p54_timer {
557 __le32 interval;
558} __attribute__ ((packed));
559
560struct p54_keycache {
561 u8 entry;
562 u8 key_id;
563 u8 mac[ETH_ALEN];
564 u8 padding[2];
565 u8 key_type;
566 u8 key_len;
567 u8 key[24];
568} __attribute__ ((packed));
569
570struct p54_burst {
571 u8 flags;
572 u8 queue;
573 u8 backlog;
574 u8 pad;
575 __le16 durations[32];
576} __attribute__ ((packed));
577
578struct p54_psm_interval {
579 __le16 interval;
580 __le16 periods;
581} __attribute__ ((packed));
582
Christian Lamparter2b8d4e22008-12-30 13:48:41 +0100583#define P54_PSM_CAM 0
John W. Linville27df6052008-10-22 16:41:55 -0400584#define P54_PSM BIT(0)
585#define P54_PSM_DTIM BIT(1)
586#define P54_PSM_MCBC BIT(2)
587#define P54_PSM_CHECKSUM BIT(3)
588#define P54_PSM_SKIP_MORE_DATA BIT(4)
589#define P54_PSM_BEACON_TIMEOUT BIT(5)
590#define P54_PSM_HFOSLEEP BIT(6)
591#define P54_PSM_AUTOSWITCH_SLEEP BIT(7)
592#define P54_PSM_LPIT BIT(8)
593#define P54_PSM_BF_UCAST_SKIP BIT(9)
594#define P54_PSM_BF_MCAST_SKIP BIT(10)
595
596struct p54_psm {
597 __le16 mode;
598 __le16 aid;
599 struct p54_psm_interval intervals[4];
600 u8 beacon_rssi_skip_max;
601 u8 rssi_delta_threshold;
602 u8 nr;
603 u8 exclude[1];
604} __attribute__ ((packed));
605
606#define MC_FILTER_ADDRESS_NUM 4
607
608struct p54_group_address_table {
609 __le16 filter_enable;
610 __le16 num_address;
611 u8 mac_list[MC_FILTER_ADDRESS_NUM][ETH_ALEN];
612} __attribute__ ((packed));
613
614struct p54_txcancel {
615 __le32 req_id;
616} __attribute__ ((packed));
617
618struct p54_sta_unlock {
619 u8 addr[ETH_ALEN];
620 u16 padding;
621} __attribute__ ((packed));
622
623#define P54_TIM_CLEAR BIT(15)
Christian Lamparter9e7f3f82008-10-18 23:18:01 +0200624struct p54_tim {
John W. Linville27df6052008-10-22 16:41:55 -0400625 u8 count;
626 u8 padding[3];
627 __le16 entry[8];
628} __attribute__ ((packed));
629
630struct p54_cce_quiet {
631 __le32 period;
632} __attribute__ ((packed));
633
634struct p54_bt_balancer {
635 __le16 prio_thresh;
636 __le16 acl_thresh;
637} __attribute__ ((packed));
638
639struct p54_arp_table {
640 __le16 filter_enable;
641 u8 ipv4_addr[4];
642} __attribute__ ((packed));
643
Christian Lamparter32ddf072008-08-08 21:17:37 +0200644#endif /* P54COMMON_H */