OMAP3: SR: Replace printk's with pr_* calls
[linux-ginger.git] / drivers / staging / stlc45xx / stlc45xx_lmac.h
blobaf5db801347f61caa4d6366f0277ba9fc5093f2b
1 /************************************************************************
2 * This is the LMAC API interface header file for STLC4560. *
3 * Copyright (C) 2007 Conexant Systems, Inc. *
4 * This program is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU General Public License *
6 * as published by the Free Software Foundation; either version 2 *
7 * of the License, or (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.*
16 *************************************************************************/
18 #ifndef __lmac_h__
19 #define __lmac_h__
21 #define LM_TOP_VARIANT 0x0506
22 #define LM_BOTTOM_VARIANT 0x0506
25 * LMAC - UMAC interface definition:
28 #define LM_FLAG_CONTROL 0x8000
29 #define LM_FLAG_ALIGN 0x4000
31 #define LM_CTRL_OPSET 0x0001
33 #define LM_OUT_PROMISC 0x0001
34 #define LM_OUT_TIMESTAMP 0x0002
35 #define LM_OUT_SEQNR 0x0004
36 #define LM_OUT_BURST 0x0010
37 #define LM_OUT_NOCANCEL 0x0020
38 #define LM_OUT_CLEARTIM 0x0040
39 #define LM_OUT_HITCHHIKE 0x0080
40 #define LM_OUT_COMPRESS 0x0100
41 #define LM_OUT_CONCAT 0x0200
42 #define LM_OUT_PCS_ACCEPT 0x0400
43 #define LM_OUT_WAITEOSP 0x0800
46 #define LM_ALOFT_SP 0x10
47 #define LM_ALOFT_CTS 0x20
48 #define LM_ALOFT_RTS 0x40
49 #define LM_ALOFT_MASK 0x1f
50 #define LM_ALOFT_RATE 0x0f
52 #define LM_IN_FCS_GOOD 0x0001
53 #define LM_IN_MATCH_MAC 0x0002
54 #define LM_IN_MCBC 0x0004
55 #define LM_IN_BEACON 0x0008
56 #define LM_IN_MATCH_BSS 0x0010
57 #define LM_IN_BCAST_BSS 0x0020
58 #define LM_IN_DATA 0x0040
59 #define LM_IN_TRUNCATED 0x0080
61 #define LM_IN_TRANSPARENT 0x0200
63 #define LM_QUEUE_BEACON 0
64 #define LM_QUEUE_SCAN 1
65 #define LM_QUEUE_MGT 2
66 #define LM_QUEUE_MCBC 3
67 #define LM_QUEUE_DATA 4
68 #define LM_QUEUE_DATA0 4
69 #define LM_QUEUE_DATA1 5
70 #define LM_QUEUE_DATA2 6
71 #define LM_QUEUE_DATA3 7
73 #define LM_SETUP_INFRA 0x0001
74 #define LM_SETUP_IBSS 0x0002
75 #define LM_SETUP_TRANSPARENT 0x0008
76 #define LM_SETUP_PROMISCUOUS 0x0010
77 #define LM_SETUP_HIBERNATE 0x0020
78 #define LM_SETUP_NOACK 0x0040
79 #define LM_SETUP_RX_DISABLED 0x0080
81 #define LM_ANTENNA_0 0
82 #define LM_ANTENNA_1 1
83 #define LM_ANTENNA_DIVERSITY 2
85 #define LM_TX_FAILED 0x0001
86 #define LM_TX_PSM 0x0002
87 #define LM_TX_PSM_CANCELLED 0x0004
89 #define LM_SCAN_EXIT 0x0001
90 #define LM_SCAN_TRAP 0x0002
91 #define LM_SCAN_ACTIVE 0x0004
92 #define LM_SCAN_FILTER 0x0008
94 #define LM_PSM 0x0001
95 #define LM_PSM_DTIM 0x0002
96 #define LM_PSM_MCBC 0x0004
97 #define LM_PSM_CHECKSUM 0x0008
98 #define LM_PSM_SKIP_MORE_DATA 0x0010
99 #define LM_PSM_BEACON_TIMEOUT 0x0020
100 #define LM_PSM_HFOSLEEP 0x0040
101 #define LM_PSM_AUTOSWITCH_SLEEP 0x0080
102 #define LM_PSM_LPIT 0x0100
103 #define LM_PSM_BF_UCAST_SKIP 0x0200
104 #define LM_PSM_BF_MCAST_SKIP 0x0400
106 /* hfosleep */
107 #define LM_PSM_SLEEP_OPTION_MASK (LM_PSM_AUTOSWITCH_SLEEP | LM_PSM_HFOSLEEP)
108 #define LM_PSM_SLEEP_OPTION_SHIFT 6
109 /* hfosleepend */
110 #define LM_PSM_BF_OPTION_MASK (LM_PSM_BF_MCAST_SKIP | LM_PSM_BF_UCAST_SKIP)
111 #define LM_PSM_BF_OPTION_SHIFT 9
114 #define LM_PRIVACC_WEP 0x01
115 #define LM_PRIVACC_TKIP 0x02
116 #define LM_PRIVACC_MICHAEL 0x04
117 #define LM_PRIVACC_CCX_KP 0x08
118 #define LM_PRIVACC_CCX_MIC 0x10
119 #define LM_PRIVACC_AES_CCMP 0x20
121 /* size of s_lm_descr in words */
122 #define LM_DESCR_SIZE_WORDS 11
124 #ifndef __ASSEMBLER__
126 enum {
127 LM_MODE_CLIENT = 0,
128 LM_MODE_AP
131 struct s_lm_descr {
132 uint16_t modes;
133 uint16_t flags;
134 uint32_t buffer_start;
135 uint32_t buffer_end;
136 uint8_t header;
137 uint8_t trailer;
138 uint8_t tx_queues;
139 uint8_t tx_depth;
140 uint8_t privacy;
141 uint8_t rx_keycache;
142 uint8_t tim_size;
143 uint8_t pad1;
144 uint8_t rates[16];
145 uint32_t link;
146 uint16_t mtu;
150 struct s_lm_control {
151 uint16_t flags;
152 uint16_t length;
153 uint32_t handle;
154 uint16_t oid;
155 uint16_t pad;
156 /* uint8_t data[]; */
159 enum {
160 LM_PRIV_NONE = 0,
161 LM_PRIV_WEP,
162 LM_PRIV_TKIP,
163 LM_PRIV_TKIPMICHAEL,
164 LM_PRIV_CCX_WEPMIC,
165 LM_PRIV_CCX_KPMIC,
166 LM_PRIV_CCX_KP,
167 LM_PRIV_AES_CCMP
170 enum {
171 LM_DECRYPT_NONE,
172 LM_DECRYPT_OK,
173 LM_DECRYPT_NOKEY,
174 LM_DECRYPT_NOMICHAEL,
175 LM_DECRYPT_NOCKIPMIC,
176 LM_DECRYPT_FAIL_WEP,
177 LM_DECRYPT_FAIL_TKIP,
178 LM_DECRYPT_FAIL_MICHAEL,
179 LM_DECRYPT_FAIL_CKIPKP,
180 LM_DECRYPT_FAIL_CKIPMIC,
181 LM_DECRYPT_FAIL_AESCCMP
184 struct s_lm_data_out {
185 uint16_t flags;
186 uint16_t length;
187 uint32_t handle;
188 uint16_t aid;
189 uint8_t rts_retries;
190 uint8_t retries;
191 uint8_t aloft[8];
192 uint8_t aloft_ctrl;
193 uint8_t crypt_offset;
194 uint8_t keytype;
195 uint8_t keylen;
196 uint8_t key[16];
197 uint8_t queue;
198 uint8_t backlog;
199 uint16_t durations[4];
200 uint8_t antenna;
201 uint8_t cts;
202 int16_t power;
203 uint8_t pad[2];
204 /*uint8_t data[];*/
207 #define LM_RCPI_INVALID (0xff)
209 struct s_lm_data_in {
210 uint16_t flags;
211 uint16_t length;
212 uint16_t frequency;
213 uint8_t antenna;
214 uint8_t rate;
215 uint8_t rcpi;
216 uint8_t sq;
217 uint8_t decrypt;
218 uint8_t rssi_raw;
219 uint32_t clock[2];
220 /*uint8_t data[];*/
223 union u_lm_data {
224 struct s_lm_data_out out;
225 struct s_lm_data_in in;
228 enum {
229 LM_OID_SETUP = 0,
230 LM_OID_SCAN = 1,
231 LM_OID_TRAP = 2,
232 LM_OID_EDCF = 3,
233 LM_OID_KEYCACHE = 4,
234 LM_OID_PSM = 6,
235 LM_OID_TXCANCEL = 7,
236 LM_OID_TX = 8,
237 LM_OID_BURST = 9,
238 LM_OID_STATS = 10,
239 LM_OID_LED = 13,
240 LM_OID_TIMER = 15,
241 LM_OID_NAV = 20,
242 LM_OID_PCS = 22,
243 LM_OID_BT_BALANCER = 28,
244 LM_OID_GROUP_ADDRESS_TABLE = 30,
245 LM_OID_ARPTABLE = 31,
246 LM_OID_BT_OPTIONS = 35
249 enum {
250 LM_FRONTEND_UNKNOWN = 0,
251 LM_FRONTEND_DUETTE3,
252 LM_FRONTEND_DUETTE2,
253 LM_FRONTEND_FRISBEE,
254 LM_FRONTEND_CROSSBOW,
255 LM_FRONTEND_LONGBOW
259 #define INVALID_LPF_BANDWIDTH 0xffff
260 #define INVALID_OSC_START_DELAY 0xffff
262 struct s_lmo_setup {
263 uint16_t flags;
264 uint8_t macaddr[6];
265 uint8_t bssid[6];
266 uint8_t antenna;
267 uint8_t rx_align;
268 uint32_t rx_buffer;
269 uint16_t rx_mtu;
270 uint16_t frontend;
271 uint16_t timeout;
272 uint16_t truncate;
273 uint32_t bratemask;
274 uint8_t sbss_offset;
275 uint8_t mcast_window;
276 uint8_t rx_rssi_threshold;
277 uint8_t rx_ed_threshold;
278 uint32_t ref_clock;
279 uint16_t lpf_bandwidth;
280 uint16_t osc_start_delay;
284 struct s_lmo_scan {
285 uint16_t flags;
286 uint16_t dwell;
287 uint8_t channel[292];
288 uint32_t bratemask;
289 uint8_t aloft[8];
290 uint8_t rssical[8];
294 enum {
295 LM_TRAP_SCAN = 0,
296 LM_TRAP_TIMER,
297 LM_TRAP_BEACON_TX,
298 LM_TRAP_FAA_RADIO_ON,
299 LM_TRAP_FAA_RADIO_OFF,
300 LM_TRAP_RADAR,
301 LM_TRAP_NO_BEACON,
302 LM_TRAP_TBTT,
303 LM_TRAP_SCO_ENTER,
304 LM_TRAP_SCO_EXIT
307 struct s_lmo_trap {
308 uint16_t event;
309 uint16_t frequency;
312 struct s_lmo_timer {
313 uint32_t interval;
316 struct s_lmo_nav {
317 uint32_t period;
321 struct s_lmo_edcf_queue;
323 struct s_lmo_edcf {
324 uint8_t flags;
325 uint8_t slottime;
326 uint8_t sifs;
327 uint8_t eofpad;
328 struct s_lmo_edcf_queue {
329 uint8_t aifs;
330 uint8_t pad0;
331 uint16_t cwmin;
332 uint16_t cwmax;
333 uint16_t txop;
334 } queues[8];
335 uint8_t mapping[4];
336 uint16_t maxburst;
337 uint16_t round_trip_delay;
340 struct s_lmo_keycache {
341 uint8_t entry;
342 uint8_t keyid;
343 uint8_t address[6];
344 uint8_t pad[2];
345 uint8_t keytype;
346 uint8_t keylen;
347 uint8_t key[24];
351 struct s_lm_interval;
353 struct s_lmo_psm {
354 uint16_t flags;
355 uint16_t aid;
356 struct s_lm_interval {
357 uint16_t interval;
358 uint16_t periods;
359 } intervals[4];
360 /* uint16_t pad; */
361 uint8_t beacon_rcpi_skip_max;
362 uint8_t rcpi_delta_threshold;
363 uint8_t nr;
364 uint8_t exclude[1];
367 #define MC_FILTER_ADDRESS_NUM 4
369 struct s_lmo_group_address_table {
370 uint16_t filter_enable;
371 uint16_t num_address;
372 uint8_t macaddr_list[MC_FILTER_ADDRESS_NUM][6];
375 struct s_lmo_txcancel {
376 uint32_t address[1];
380 struct s_lmo_tx {
381 uint8_t flags;
382 uint8_t retries;
383 uint8_t rcpi;
384 uint8_t sq;
385 uint16_t seqctrl;
386 uint8_t antenna;
387 uint8_t pad;
390 struct s_lmo_burst {
391 uint8_t flags;
392 uint8_t queue;
393 uint8_t backlog;
394 uint8_t pad;
395 uint16_t durations[32];
398 struct s_lmo_stats {
399 uint32_t valid;
400 uint32_t fcs;
401 uint32_t abort;
402 uint32_t phyabort;
403 uint32_t rts_success;
404 uint32_t rts_fail;
405 uint32_t timestamp;
406 uint32_t time_tx;
407 uint32_t noisefloor;
408 uint32_t sample_noise[8];
409 uint32_t sample_cca;
410 uint32_t sample_tx;
414 struct s_lmo_led {
415 uint16_t flags;
416 uint16_t mask[2];
417 uint16_t delay/*[2]*/;
421 struct s_lmo_bt_balancer {
422 uint16_t prio_thresh;
423 uint16_t acl_thresh;
427 struct s_lmo_arp_table {
428 uint16_t filter_enable;
429 uint32_t ipaddr;
432 #endif /* __ASSEMBLER__ */
434 #endif /* __lmac_h__ */