rk: temp revert rk change
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / bcmdhd / include / wlioctl.h
1 /*
2  * Custom OID/ioctl definitions for
3  * Broadcom 802.11abg Networking Device Driver
4  *
5  * Definitions subject to change without notice.
6  *
7  * Copyright (C) 1999-2011, Broadcom Corporation
8  * 
9  *         Unless you and Broadcom execute a separate written software license
10  * agreement governing use of this software, this software is licensed to you
11  * under the terms of the GNU General Public License version 2 (the "GPL"),
12  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
13  * following added to such license:
14  * 
15  *      As a special exception, the copyright holders of this software give you
16  * permission to link this software with independent modules, and to copy and
17  * distribute the resulting executable under terms of your choice, provided that
18  * you also meet, for each linked independent module, the terms and conditions of
19  * the license of that module.  An independent module is a module which is not
20  * derived from this software.  The special exception does not apply to any
21  * modifications of the software.
22  * 
23  *      Notwithstanding the above, under no circumstances may you combine this
24  * software in any way with any other Broadcom software provided under a license
25  * other than the GPL, without Broadcom's express prior written consent.
26  *
27  * $Id: wlioctl.h 353331 2012-08-27 06:04:47Z $
28  */
29
30
31 #ifndef _wlioctl_h_
32 #define _wlioctl_h_
33
34 #include <typedefs.h>
35 #include <proto/ethernet.h>
36 #include <proto/bcmeth.h>
37 #include <proto/bcmevent.h>
38 #include <proto/802.11.h>
39 #include <bcmwifi.h>
40
41 #include <bcmcdc.h>
42
43 #ifndef INTF_NAME_SIZ
44 #define INTF_NAME_SIZ   16
45 #endif
46
47
48 typedef struct remote_ioctl {
49         cdc_ioctl_t     msg;
50         uint        data_len;
51         char            intf_name[INTF_NAME_SIZ];
52 } rem_ioctl_t;
53 #define REMOTE_SIZE sizeof(rem_ioctl_t)
54
55 #define ACTION_FRAME_SIZE 1040
56
57 typedef struct wl_action_frame {
58         struct ether_addr   da;
59         uint16          len;
60         uint32          packetId;
61         uint8           data[ACTION_FRAME_SIZE];
62 } wl_action_frame_t;
63
64 #define WL_WIFI_ACTION_FRAME_SIZE sizeof(struct wl_action_frame)
65
66 typedef struct ssid_info
67 {
68         uint8           ssid_len;       
69         uint8           ssid[32];       
70 } ssid_info_t;
71
72 typedef struct wl_af_params {
73         uint32          channel;
74         int32           dwell_time;
75         struct ether_addr   BSSID;
76         wl_action_frame_t   action_frame;
77 } wl_af_params_t;
78
79 #define WL_WIFI_AF_PARAMS_SIZE sizeof(struct wl_af_params)
80
81
82 #define BWL_DEFAULT_PACKING
83 #include <packed_section_start.h>
84
85
86 #define WL_BSS_INFO_VERSION 109     
87
88
89 typedef struct wl_bss_info {
90         uint32      version;        
91         uint32      length;         
92         struct ether_addr BSSID;
93         uint16      beacon_period;      
94         uint16      capability;     
95         uint8       SSID_len;
96         uint8       SSID[32];
97         struct {
98                 uint    count;          
99                 uint8   rates[16];      
100         } rateset;              
101         chanspec_t  chanspec;       
102         uint16      atim_window;        
103         uint8       dtim_period;        
104         int16       RSSI;           
105         int8        phy_noise;      
106
107         uint8       n_cap;          
108         uint32      nbss_cap;       
109         uint8       ctl_ch;         
110         uint32      reserved32[1];      
111         uint8       flags;          
112         uint8       reserved[3];        
113         uint8       basic_mcs[MCSSET_LEN];  
114
115         uint16      ie_offset;      
116         uint32      ie_length;      
117         int16       SNR;            
118         
119         
120 } wl_bss_info_t;
121
122
123 #define WL_BSS_FLAGS_FROM_BEACON        0x01
124 #define WL_BSS_FLAGS_FROM_CACHE         0x02
125 #define WL_BSS_FLAGS_RSSI_ONCHANNEL     0x04
126
127
128 #define VHT_BI_SGI_80MHZ                        0x00000100
129
130 typedef struct wlc_ssid {
131         uint32      SSID_len;
132         uchar       SSID[32];
133 } wlc_ssid_t;
134
135
136 #define WL_BSSTYPE_INFRA 1
137 #define WL_BSSTYPE_INDEP 0
138 #define WL_BSSTYPE_ANY   2
139
140
141 #define WL_SCANFLAGS_PASSIVE 0x01       
142 #define WL_SCANFLAGS_RESERVED 0x02      
143 #define WL_SCANFLAGS_PROHIBITED 0x04    
144
145 #define WL_SCAN_PARAMS_SSID_MAX         10
146
147 typedef struct wl_scan_params {
148         wlc_ssid_t ssid;        
149         struct ether_addr bssid;    
150         int8 bss_type;          
151         uint8 scan_type;        
152         int32 nprobes;          
153         int32 active_time;      
154         int32 passive_time;     
155         int32 home_time;        
156         int32 channel_num;      
157         uint16 channel_list[1];     
158 } wl_scan_params_t;
159
160
161 #define WL_SCAN_PARAMS_FIXED_SIZE 64
162
163
164 #define WL_SCAN_PARAMS_COUNT_MASK 0x0000ffff
165 #define WL_SCAN_PARAMS_NSSID_SHIFT 16
166
167 #define WL_SCAN_ACTION_START      1
168 #define WL_SCAN_ACTION_CONTINUE   2
169 #define WL_SCAN_ACTION_ABORT      3
170
171 #define ISCAN_REQ_VERSION 1
172
173
174 typedef struct wl_iscan_params {
175         uint32 version;
176         uint16 action;
177         uint16 scan_duration;
178         wl_scan_params_t params;
179 } wl_iscan_params_t;
180
181
182 #define WL_ISCAN_PARAMS_FIXED_SIZE (OFFSETOF(wl_iscan_params_t, params) + sizeof(wlc_ssid_t))
183
184 typedef struct wl_scan_results {
185         uint32 buflen;
186         uint32 version;
187         uint32 count;
188         wl_bss_info_t bss_info[1];
189 } wl_scan_results_t;
190
191
192 #define WL_SCAN_RESULTS_FIXED_SIZE (sizeof(wl_scan_results_t) - sizeof(wl_bss_info_t))
193
194
195 #define WL_SCAN_RESULTS_SUCCESS 0
196 #define WL_SCAN_RESULTS_PARTIAL 1
197 #define WL_SCAN_RESULTS_PENDING 2
198 #define WL_SCAN_RESULTS_ABORTED 3
199 #define WL_SCAN_RESULTS_NO_MEM  4
200
201
202 #define DNGL_RXCTXT_SIZE        45
203
204 #if defined(SIMPLE_ISCAN)
205 #define ISCAN_RETRY_CNT   5
206 #define ISCAN_STATE_IDLE   0
207 #define ISCAN_STATE_SCANING 1
208 #define ISCAN_STATE_PENDING 2
209
210
211 #define WLC_IW_ISCAN_MAXLEN   2048
212 typedef struct iscan_buf {
213         struct iscan_buf * next;
214         char   iscan_buf[WLC_IW_ISCAN_MAXLEN];
215 } iscan_buf_t;
216 #endif 
217
218 #define ESCAN_REQ_VERSION 1
219
220 typedef struct wl_escan_params {
221         uint32 version;
222         uint16 action;
223         uint16 sync_id;
224         wl_scan_params_t params;
225 } wl_escan_params_t;
226
227 #define WL_ESCAN_PARAMS_FIXED_SIZE (OFFSETOF(wl_escan_params_t, params) + sizeof(wlc_ssid_t))
228
229 typedef struct wl_escan_result {
230         uint32 buflen;
231         uint32 version;
232         uint16 sync_id;
233         uint16 bss_count;
234         wl_bss_info_t bss_info[1];
235 } wl_escan_result_t;
236
237 #define WL_ESCAN_RESULTS_FIXED_SIZE (sizeof(wl_escan_result_t) - sizeof(wl_bss_info_t))
238
239
240 typedef struct wl_iscan_results {
241         uint32 status;
242         wl_scan_results_t results;
243 } wl_iscan_results_t;
244
245
246 #define WL_ISCAN_RESULTS_FIXED_SIZE \
247         (WL_SCAN_RESULTS_FIXED_SIZE + OFFSETOF(wl_iscan_results_t, results))
248
249 typedef struct wl_probe_params {
250         wlc_ssid_t ssid;
251         struct ether_addr bssid;
252         struct ether_addr mac;
253 } wl_probe_params_t;
254
255 #define WL_NUMRATES     16  
256 typedef struct wl_rateset {
257         uint32  count;          
258         uint8   rates[WL_NUMRATES]; 
259 } wl_rateset_t;
260
261 typedef struct wl_rateset_args {
262         uint32  count;          
263         uint8   rates[WL_NUMRATES]; 
264         uint8   mcs[MCSSET_LEN];        
265 } wl_rateset_args_t;
266
267
268 typedef struct wl_uint32_list {
269         
270         uint32 count;
271         
272         uint32 element[1];
273 } wl_uint32_list_t;
274
275
276 typedef struct wl_assoc_params {
277         struct ether_addr bssid;    
278         uint16 bssid_cnt;       
279         int32 chanspec_num;     
280         chanspec_t chanspec_list[1];    
281 } wl_assoc_params_t;
282 #define WL_ASSOC_PARAMS_FIXED_SIZE  (sizeof(wl_assoc_params_t) - sizeof(chanspec_t))
283
284
285 typedef wl_assoc_params_t wl_reassoc_params_t;
286 #define WL_REASSOC_PARAMS_FIXED_SIZE    WL_ASSOC_PARAMS_FIXED_SIZE
287
288
289 typedef wl_assoc_params_t wl_join_assoc_params_t;
290 #define WL_JOIN_ASSOC_PARAMS_FIXED_SIZE        WL_ASSOC_PARAMS_FIXED_SIZE
291
292
293 typedef struct wl_join_params {
294         wlc_ssid_t ssid;
295         wl_assoc_params_t params;   
296 } wl_join_params_t;
297 #define WL_JOIN_PARAMS_FIXED_SIZE   (sizeof(wl_join_params_t) - sizeof(chanspec_t))
298
299
300 typedef struct wl_join_scan_params {
301         uint8 scan_type;                
302         int32 nprobes;                  
303         int32 active_time;              
304         int32 passive_time;             
305         int32 home_time;                
306 } wl_join_scan_params_t;
307
308
309 typedef struct wl_extjoin_params {
310         wlc_ssid_t ssid;                
311         wl_join_scan_params_t scan;
312         wl_join_assoc_params_t assoc;   
313 } wl_extjoin_params_t;
314 #define WL_EXTJOIN_PARAMS_FIXED_SIZE    (sizeof(wl_extjoin_params_t) - sizeof(chanspec_t))
315
316 typedef struct {
317         uint32 num;
318         chanspec_t list[1];
319 } chanspec_list_t;
320
321
322 #define NRATE_MCS_INUSE 0x00000080  
323 #define NRATE_RATE_MASK 0x0000007f  
324 #define NRATE_STF_MASK  0x0000ff00  
325 #define NRATE_STF_SHIFT 8       
326 #define NRATE_OVERRIDE  0x80000000  
327 #define NRATE_OVERRIDE_MCS_ONLY 0x40000000 
328 #define NRATE_SGI_MASK  0x00800000      
329 #define NRATE_SGI_SHIFT 23              
330 #define NRATE_LDPC_CODING 0x00400000    
331 #define NRATE_LDPC_SHIFT 22             
332 #define NRATE_BCMC_OVERRIDE 0x00200000    
333 #define NRATE_BCMC_SHIFT 21             
334
335 #define NRATE_STF_SISO  0       
336 #define NRATE_STF_CDD   1       
337 #define NRATE_STF_STBC  2       
338 #define NRATE_STF_SDM   3       
339
340 #define ANTENNA_NUM_1   1       
341 #define ANTENNA_NUM_2   2
342 #define ANTENNA_NUM_3   3
343 #define ANTENNA_NUM_4   4
344
345 #define ANT_SELCFG_AUTO     0x80    
346 #define ANT_SELCFG_MASK     0x33    
347 #define ANT_SELCFG_MAX      4   
348 #define ANT_SELCFG_TX_UNICAST   0   
349 #define ANT_SELCFG_RX_UNICAST   1   
350 #define ANT_SELCFG_TX_DEF   2   
351 #define ANT_SELCFG_RX_DEF   3   
352
353 #define MAX_STREAMS_SUPPORTED   4   
354
355 typedef struct {
356         uint8 ant_config[ANT_SELCFG_MAX];   
357         uint8 num_antcfg;   
358 } wlc_antselcfg_t;
359
360 #define HIGHEST_SINGLE_STREAM_MCS   7 
361
362 #define MAX_CCA_CHANNELS 38 
363 #define MAX_CCA_SECS     60 
364
365 #define IBSS_MED        15  
366 #define IBSS_HI         25  
367 #define OBSS_MED        12
368 #define OBSS_HI         25
369 #define INTERFER_MED    5
370 #define INTERFER_HI     10
371
372 #define  CCA_FLAG_2G_ONLY       0x01    
373 #define  CCA_FLAG_5G_ONLY       0x02    
374 #define  CCA_FLAG_IGNORE_DURATION   0x04    
375 #define  CCA_FLAGS_PREFER_1_6_11    0x10
376 #define  CCA_FLAG_IGNORE_INTERFER   0x20 
377
378 #define CCA_ERRNO_BAND      1   
379 #define CCA_ERRNO_DURATION  2   
380 #define CCA_ERRNO_PREF_CHAN 3   
381 #define CCA_ERRNO_INTERFER  4   
382 #define CCA_ERRNO_TOO_FEW   5   
383
384 typedef struct {
385         uint32 duration;    
386         uint32 congest_ibss;    
387                                 
388         uint32 congest_obss;    
389         uint32 interference;    
390         uint32 timestamp;   
391 } cca_congest_t;
392
393 typedef struct {
394         chanspec_t chanspec;    
395         uint8 num_secs;     
396         cca_congest_t  secs[1]; 
397 } cca_congest_channel_req_t;
398
399 #define WLC_CNTRY_BUF_SZ    4       
400
401 typedef struct wl_country {
402         char country_abbrev[WLC_CNTRY_BUF_SZ];  
403         int32 rev;              
404         char ccode[WLC_CNTRY_BUF_SZ];       
405 } wl_country_t;
406
407 typedef struct wl_channels_in_country {
408         uint32 buflen;
409         uint32 band;
410         char country_abbrev[WLC_CNTRY_BUF_SZ];
411         uint32 count;
412         uint32 channel[1];
413 } wl_channels_in_country_t;
414
415 typedef struct wl_country_list {
416         uint32 buflen;
417         uint32 band_set;
418         uint32 band;
419         uint32 count;
420         char country_abbrev[1];
421 } wl_country_list_t;
422
423 #define WL_NUM_RPI_BINS     8
424 #define WL_RM_TYPE_BASIC    1
425 #define WL_RM_TYPE_CCA      2
426 #define WL_RM_TYPE_RPI      3
427
428 #define WL_RM_FLAG_PARALLEL (1<<0)
429
430 #define WL_RM_FLAG_LATE     (1<<1)
431 #define WL_RM_FLAG_INCAPABLE    (1<<2)
432 #define WL_RM_FLAG_REFUSED  (1<<3)
433
434 typedef struct wl_rm_req_elt {
435         int8    type;
436         int8    flags;
437         chanspec_t  chanspec;
438         uint32  token;      
439         uint32  tsf_h;      
440         uint32  tsf_l;      
441         uint32  dur;        
442 } wl_rm_req_elt_t;
443
444 typedef struct wl_rm_req {
445         uint32  token;      
446         uint32  count;      
447         void    *cb;        
448         void    *cb_arg;    
449         wl_rm_req_elt_t req[1]; 
450 } wl_rm_req_t;
451 #define WL_RM_REQ_FIXED_LEN OFFSETOF(wl_rm_req_t, req)
452
453 typedef struct wl_rm_rep_elt {
454         int8    type;
455         int8    flags;
456         chanspec_t  chanspec;
457         uint32  token;      
458         uint32  tsf_h;      
459         uint32  tsf_l;      
460         uint32  dur;        
461         uint32  len;        
462         uint8   data[1];    
463 } wl_rm_rep_elt_t;
464 #define WL_RM_REP_ELT_FIXED_LEN 24  
465
466 #define WL_RPI_REP_BIN_NUM 8
467 typedef struct wl_rm_rpi_rep {
468         uint8   rpi[WL_RPI_REP_BIN_NUM];
469         int8    rpi_max[WL_RPI_REP_BIN_NUM];
470 } wl_rm_rpi_rep_t;
471
472 typedef struct wl_rm_rep {
473         uint32  token;      
474         uint32  len;        
475         wl_rm_rep_elt_t rep[1]; 
476 } wl_rm_rep_t;
477 #define WL_RM_REP_FIXED_LEN 8
478
479
480 typedef enum sup_auth_status {
481         
482         WLC_SUP_DISCONNECTED = 0,
483         WLC_SUP_CONNECTING,
484         WLC_SUP_IDREQUIRED,
485         WLC_SUP_AUTHENTICATING,
486         WLC_SUP_AUTHENTICATED,
487         WLC_SUP_KEYXCHANGE,
488         WLC_SUP_KEYED,
489         WLC_SUP_TIMEOUT,
490         WLC_SUP_LAST_BASIC_STATE,
491
492         
493         
494         WLC_SUP_KEYXCHANGE_WAIT_M1 = WLC_SUP_AUTHENTICATED,
495         
496         WLC_SUP_KEYXCHANGE_PREP_M2 = WLC_SUP_KEYXCHANGE,
497         
498         WLC_SUP_KEYXCHANGE_WAIT_M3 = WLC_SUP_LAST_BASIC_STATE,
499         WLC_SUP_KEYXCHANGE_PREP_M4, 
500         WLC_SUP_KEYXCHANGE_WAIT_G1, 
501         WLC_SUP_KEYXCHANGE_PREP_G2  
502 } sup_auth_status_t;
503
504
505 #define CRYPTO_ALGO_OFF         0
506 #define CRYPTO_ALGO_WEP1        1
507 #define CRYPTO_ALGO_TKIP        2
508 #define CRYPTO_ALGO_WEP128      3
509 #define CRYPTO_ALGO_AES_CCM     4
510 #define CRYPTO_ALGO_AES_OCB_MSDU    5
511 #define CRYPTO_ALGO_AES_OCB_MPDU    6
512 #define CRYPTO_ALGO_NALG        7
513 #define CRYPTO_ALGO_PMK                 12      
514
515 #define WSEC_GEN_MIC_ERROR  0x0001
516 #define WSEC_GEN_REPLAY     0x0002
517 #define WSEC_GEN_ICV_ERROR  0x0004
518
519 #define WL_SOFT_KEY (1 << 0)    
520 #define WL_PRIMARY_KEY  (1 << 1)    
521 #define WL_KF_RES_4 (1 << 4)    
522 #define WL_KF_RES_5 (1 << 5)    
523 #define WL_IBSS_PEER_GROUP_KEY  (1 << 6)    
524
525 typedef struct wl_wsec_key {
526         uint32      index;      
527         uint32      len;        
528         uint8       data[DOT11_MAX_KEY_SIZE];   
529         uint32      pad_1[18];
530         uint32      algo;       
531         uint32      flags;      
532         uint32      pad_2[2];
533         int     pad_3;
534         int     iv_initialized; 
535         int     pad_4;
536         
537         struct {
538                 uint32  hi;     
539                 uint16  lo;     
540         } rxiv;
541         uint32      pad_5[2];
542         struct ether_addr ea;       
543 } wl_wsec_key_t;
544
545 #define WSEC_MIN_PSK_LEN    8
546 #define WSEC_MAX_PSK_LEN    64
547
548
549 #define WSEC_PASSPHRASE     (1<<0)
550
551
552 typedef struct {
553         ushort  key_len;        
554         ushort  flags;          
555         uint8   key[WSEC_MAX_PSK_LEN];  
556 } wsec_pmk_t;
557
558
559 #define WEP_ENABLED     0x0001
560 #define TKIP_ENABLED        0x0002
561 #define AES_ENABLED     0x0004
562 #define WSEC_SWFLAG     0x0008
563 #define SES_OW_ENABLED      0x0040  
564
565
566 #define WPA_AUTH_DISABLED   0x0000  
567 #define WPA_AUTH_NONE       0x0001  
568 #define WPA_AUTH_UNSPECIFIED    0x0002  
569 #define WPA_AUTH_PSK        0x0004  
570  
571 #define WPA2_AUTH_UNSPECIFIED   0x0040  
572 #define WPA2_AUTH_PSK       0x0080  
573 #define BRCM_AUTH_PSK           0x0100  
574 #define BRCM_AUTH_DPT       0x0200  
575 #define WPA2_AUTH_MFP           0x1000  
576 #define WPA2_AUTH_TPK           0x2000  
577 #define WPA2_AUTH_FT            0x4000  
578
579
580 #define MAXPMKID        16
581
582 typedef struct _pmkid {
583         struct ether_addr   BSSID;
584         uint8           PMKID[WPA2_PMKID_LEN];
585 } pmkid_t;
586
587 typedef struct _pmkid_list {
588         uint32  npmkid;
589         pmkid_t pmkid[1];
590 } pmkid_list_t;
591
592 typedef struct _pmkid_cand {
593         struct ether_addr   BSSID;
594         uint8           preauth;
595 } pmkid_cand_t;
596
597 typedef struct _pmkid_cand_list {
598         uint32  npmkid_cand;
599         pmkid_cand_t    pmkid_cand[1];
600 } pmkid_cand_list_t;
601
602 typedef struct wl_assoc_info {
603         uint32      req_len;
604         uint32      resp_len;
605         uint32      flags;
606         struct dot11_assoc_req req;
607         struct ether_addr reassoc_bssid;        
608         struct dot11_assoc_resp resp;
609 } wl_assoc_info_t;
610
611
612 #define WLC_ASSOC_REQ_IS_REASSOC 0x01   
613
614
615 typedef struct {
616         uint16          ver;        
617         uint16          len;        
618         uint16          cap;        
619         uint32          flags;      
620         uint32          idle;       
621         struct ether_addr   ea;     
622         wl_rateset_t        rateset;    
623         uint32          in;     
624         uint32          listen_interval_inms; 
625         uint32          tx_pkts;    
626         uint32          tx_failures;    
627         uint32          rx_ucast_pkts;  
628         uint32          rx_mcast_pkts;  
629         uint32          tx_rate;    
630         uint32          rx_rate;    
631         uint32          rx_decrypt_succeeds;    
632         uint32          rx_decrypt_failures;    
633 } sta_info_t;
634
635 #define WL_OLD_STAINFO_SIZE OFFSETOF(sta_info_t, tx_pkts)
636
637 #define WL_STA_VER      3
638
639
640 #define WL_STA_BRCM     0x1     
641 #define WL_STA_WME      0x2     
642 #define WL_STA_ABCAP        0x4
643 #define WL_STA_AUTHE        0x8     
644 #define WL_STA_ASSOC        0x10        
645 #define WL_STA_AUTHO        0x20        
646 #define WL_STA_WDS      0x40        
647 #define WL_STA_WDS_LINKUP   0x80        
648 #define WL_STA_PS       0x100       
649 #define WL_STA_APSD_BE      0x200       
650 #define WL_STA_APSD_BK      0x400       
651 #define WL_STA_APSD_VI      0x800       
652 #define WL_STA_APSD_VO      0x1000      
653 #define WL_STA_N_CAP        0x2000      
654 #define WL_STA_SCBSTATS     0x4000      
655
656 #define WL_WDS_LINKUP       WL_STA_WDS_LINKUP   
657
658
659 #define WLC_TXFILTER_OVERRIDE_DISABLED  0
660 #define WLC_TXFILTER_OVERRIDE_ENABLED   1
661
662
663 typedef struct {
664         uint32  val;
665         struct ether_addr ea;
666 } scb_val_t;
667
668
669 typedef struct {
670         uint32 code;
671         scb_val_t ioctl_args;
672 } authops_t;
673
674
675 typedef struct channel_info {
676         int hw_channel;
677         int target_channel;
678         int scan_channel;
679 } channel_info_t;
680
681
682 struct maclist {
683         uint count;         
684         struct ether_addr ea[1];    
685 };
686
687
688 typedef struct get_pktcnt {
689         uint rx_good_pkt;
690         uint rx_bad_pkt;
691         uint tx_good_pkt;
692         uint tx_bad_pkt;
693         uint rx_ocast_good_pkt; 
694 } get_pktcnt_t;
695
696 #define WL_IOCTL_ACTION_GET                             0x0
697 #define WL_IOCTL_ACTION_SET                             0x1
698 #define WL_IOCTL_ACTION_OVL_IDX_MASK    0x1e
699 #define WL_IOCTL_ACTION_OVL_RSV                 0x20
700 #define WL_IOCTL_ACTION_OVL                             0x40
701 #define WL_IOCTL_ACTION_MASK                    0x7e
702 #define WL_IOCTL_ACTION_OVL_SHIFT               1
703
704
705 typedef struct wl_ioctl {
706         uint cmd;   
707         void *buf;  
708         uint len;   
709         uint8 set;              
710         uint used;  
711         uint needed;    
712 } wl_ioctl_t;
713
714
715 #define ioctl_subtype   set     
716 #define ioctl_pid   used        
717 #define ioctl_status    needed      
718
719
720 typedef struct wlc_rev_info {
721         uint        vendorid;   
722         uint        deviceid;   
723         uint        radiorev;   
724         uint        chiprev;    
725         uint        corerev;    
726         uint        boardid;    
727         uint        boardvendor;    
728         uint        boardrev;   
729         uint        driverrev;  
730         uint        ucoderev;   
731         uint        bus;        
732         uint        chipnum;    
733         uint        phytype;    
734         uint        phyrev;     
735         uint        anarev;     
736         uint        chippkg;    
737 } wlc_rev_info_t;
738
739 #define WL_REV_INFO_LEGACY_LENGTH   48
740
741 #define WL_BRAND_MAX 10
742 typedef struct wl_instance_info {
743         uint instance;
744         char brand[WL_BRAND_MAX];
745 } wl_instance_info_t;
746
747
748 typedef struct wl_txfifo_sz {
749         uint16  magic;
750         uint16  fifo;
751         uint16  size;
752 } wl_txfifo_sz_t;
753
754 #define WL_TXFIFO_SZ_MAGIC  0xa5a5
755
756
757
758 #define WLC_IOV_NAME_LEN 30
759 typedef struct wlc_iov_trx_s {
760         uint8 module;
761         uint8 type;
762         char name[WLC_IOV_NAME_LEN];
763 } wlc_iov_trx_t;
764
765
766 #define WLC_IOCTL_MAGIC     0x14e46c77
767
768
769 #define WLC_IOCTL_VERSION   1
770
771 #define WLC_IOCTL_MAXLEN        8192    
772 #define WLC_IOCTL_SMLEN         256 
773 #define WLC_IOCTL_MEDLEN        1536    
774 #ifdef WLC_HIGH_ONLY
775 #define WLC_SAMPLECOLLECT_MAXLEN    1024    
776 #define WLC_SAMPLECOLLECT_MAXLEN_LCN40  1024
777 #else
778 #if defined(LCNCONF) || defined(LCN40CONF)
779 #define WLC_SAMPLECOLLECT_MAXLEN        8192    
780 #else
781 #define WLC_SAMPLECOLLECT_MAXLEN        10240   
782 #endif
783 #define WLC_SAMPLECOLLECT_MAXLEN_LCN40  8192
784 #endif 
785
786
787 #define WLC_GET_MAGIC               0
788 #define WLC_GET_VERSION             1
789 #define WLC_UP                  2
790 #define WLC_DOWN                3
791 #define WLC_GET_LOOP                4
792 #define WLC_SET_LOOP                5
793 #define WLC_DUMP                6
794 #define WLC_GET_MSGLEVEL            7
795 #define WLC_SET_MSGLEVEL            8
796 #define WLC_GET_PROMISC             9
797 #define WLC_SET_PROMISC             10
798 #define WLC_OVERLAY_IOCTL           11
799 #define WLC_GET_RATE                12
800  
801 #define WLC_GET_INSTANCE            14
802  
803  
804  
805  
806 #define WLC_GET_INFRA               19
807 #define WLC_SET_INFRA               20
808 #define WLC_GET_AUTH                21
809 #define WLC_SET_AUTH                22
810 #define WLC_GET_BSSID               23
811 #define WLC_SET_BSSID               24
812 #define WLC_GET_SSID                25
813 #define WLC_SET_SSID                26
814 #define WLC_RESTART             27
815 #define WLC_TERMINATED             28
816  
817 #define WLC_GET_CHANNEL             29
818 #define WLC_SET_CHANNEL             30
819 #define WLC_GET_SRL             31
820 #define WLC_SET_SRL             32
821 #define WLC_GET_LRL             33
822 #define WLC_SET_LRL             34
823 #define WLC_GET_PLCPHDR             35
824 #define WLC_SET_PLCPHDR             36
825 #define WLC_GET_RADIO               37
826 #define WLC_SET_RADIO               38
827 #define WLC_GET_PHYTYPE             39
828 #define WLC_DUMP_RATE               40
829 #define WLC_SET_RATE_PARAMS         41
830 #define WLC_GET_FIXRATE             42
831 #define WLC_SET_FIXRATE             43
832  
833  
834 #define WLC_GET_KEY             44
835 #define WLC_SET_KEY             45
836 #define WLC_GET_REGULATORY          46
837 #define WLC_SET_REGULATORY          47
838 #define WLC_GET_PASSIVE_SCAN            48
839 #define WLC_SET_PASSIVE_SCAN            49
840 #define WLC_SCAN                50
841 #define WLC_SCAN_RESULTS            51
842 #define WLC_DISASSOC                52
843 #define WLC_REASSOC             53
844 #define WLC_GET_ROAM_TRIGGER            54
845 #define WLC_SET_ROAM_TRIGGER            55
846 #define WLC_GET_ROAM_DELTA          56
847 #define WLC_SET_ROAM_DELTA          57
848 #define WLC_GET_ROAM_SCAN_PERIOD        58
849 #define WLC_SET_ROAM_SCAN_PERIOD        59
850 #define WLC_EVM                 60  
851 #define WLC_GET_TXANT               61
852 #define WLC_SET_TXANT               62
853 #define WLC_GET_ANTDIV              63
854 #define WLC_SET_ANTDIV              64
855  
856  
857 #define WLC_GET_CLOSED              67
858 #define WLC_SET_CLOSED              68
859 #define WLC_GET_MACLIST             69
860 #define WLC_SET_MACLIST             70
861 #define WLC_GET_RATESET             71
862 #define WLC_SET_RATESET             72
863  
864 #define WLC_LONGTRAIN               74
865 #define WLC_GET_BCNPRD              75
866 #define WLC_SET_BCNPRD              76
867 #define WLC_GET_DTIMPRD             77
868 #define WLC_SET_DTIMPRD             78
869 #define WLC_GET_SROM                79
870 #define WLC_SET_SROM                80
871 #define WLC_GET_WEP_RESTRICT            81
872 #define WLC_SET_WEP_RESTRICT            82
873 #define WLC_GET_COUNTRY             83
874 #define WLC_SET_COUNTRY             84
875 #define WLC_GET_PM              85
876 #define WLC_SET_PM              86
877 #define WLC_GET_WAKE                87
878 #define WLC_SET_WAKE                88
879  
880 #define WLC_GET_FORCELINK           90  
881 #define WLC_SET_FORCELINK           91  
882 #define WLC_FREQ_ACCURACY           92  
883 #define WLC_CARRIER_SUPPRESS            93  
884 #define WLC_GET_PHYREG              94
885 #define WLC_SET_PHYREG              95
886 #define WLC_GET_RADIOREG            96
887 #define WLC_SET_RADIOREG            97
888 #define WLC_GET_REVINFO             98
889 #define WLC_GET_UCANTDIV            99
890 #define WLC_SET_UCANTDIV            100
891 #define WLC_R_REG               101
892 #define WLC_W_REG               102
893
894  
895 #define WLC_GET_MACMODE             105
896 #define WLC_SET_MACMODE             106
897 #define WLC_GET_MONITOR             107
898 #define WLC_SET_MONITOR             108
899 #define WLC_GET_GMODE               109
900 #define WLC_SET_GMODE               110
901 #define WLC_GET_LEGACY_ERP          111
902 #define WLC_SET_LEGACY_ERP          112
903 #define WLC_GET_RX_ANT              113
904 #define WLC_GET_CURR_RATESET            114 
905 #define WLC_GET_SCANSUPPRESS            115
906 #define WLC_SET_SCANSUPPRESS            116
907 #define WLC_GET_AP              117
908 #define WLC_SET_AP              118
909 #define WLC_GET_EAP_RESTRICT            119
910 #define WLC_SET_EAP_RESTRICT            120
911 #define WLC_SCB_AUTHORIZE           121
912 #define WLC_SCB_DEAUTHORIZE         122
913 #define WLC_GET_WDSLIST             123
914 #define WLC_SET_WDSLIST             124
915 #define WLC_GET_ATIM                125
916 #define WLC_SET_ATIM                126
917 #define WLC_GET_RSSI                127
918 #define WLC_GET_PHYANTDIV           128
919 #define WLC_SET_PHYANTDIV           129
920 #define WLC_AP_RX_ONLY              130
921 #define WLC_GET_TX_PATH_PWR         131
922 #define WLC_SET_TX_PATH_PWR         132
923 #define WLC_GET_WSEC                133
924 #define WLC_SET_WSEC                134
925 #define WLC_GET_PHY_NOISE           135
926 #define WLC_GET_BSS_INFO            136
927 #define WLC_GET_PKTCNTS             137
928 #define WLC_GET_LAZYWDS             138
929 #define WLC_SET_LAZYWDS             139
930 #define WLC_GET_BANDLIST            140
931 #define WLC_GET_BAND                141
932 #define WLC_SET_BAND                142
933 #define WLC_SCB_DEAUTHENTICATE          143
934 #define WLC_GET_SHORTSLOT           144
935 #define WLC_GET_SHORTSLOT_OVERRIDE      145
936 #define WLC_SET_SHORTSLOT_OVERRIDE      146
937 #define WLC_GET_SHORTSLOT_RESTRICT      147
938 #define WLC_SET_SHORTSLOT_RESTRICT      148
939 #define WLC_GET_GMODE_PROTECTION        149
940 #define WLC_GET_GMODE_PROTECTION_OVERRIDE   150
941 #define WLC_SET_GMODE_PROTECTION_OVERRIDE   151
942 #define WLC_UPGRADE             152
943  
944  
945 #define WLC_GET_IGNORE_BCNS         155
946 #define WLC_SET_IGNORE_BCNS         156
947 #define WLC_GET_SCB_TIMEOUT         157
948 #define WLC_SET_SCB_TIMEOUT         158
949 #define WLC_GET_ASSOCLIST           159
950 #define WLC_GET_CLK             160
951 #define WLC_SET_CLK             161
952 #define WLC_GET_UP              162
953 #define WLC_OUT                 163
954 #define WLC_GET_WPA_AUTH            164
955 #define WLC_SET_WPA_AUTH            165
956 #define WLC_GET_UCFLAGS             166
957 #define WLC_SET_UCFLAGS             167
958 #define WLC_GET_PWRIDX              168
959 #define WLC_SET_PWRIDX              169
960 #define WLC_GET_TSSI                170
961 #define WLC_GET_SUP_RATESET_OVERRIDE        171
962 #define WLC_SET_SUP_RATESET_OVERRIDE        172
963  
964  
965  
966  
967  
968 #define WLC_GET_PROTECTION_CONTROL      178
969 #define WLC_SET_PROTECTION_CONTROL      179
970 #define WLC_GET_PHYLIST             180
971 #define WLC_ENCRYPT_STRENGTH            181 
972 #define WLC_DECRYPT_STATUS          182 
973 #define WLC_GET_KEY_SEQ             183
974 #define WLC_GET_SCAN_CHANNEL_TIME       184
975 #define WLC_SET_SCAN_CHANNEL_TIME       185
976 #define WLC_GET_SCAN_UNASSOC_TIME       186
977 #define WLC_SET_SCAN_UNASSOC_TIME       187
978 #define WLC_GET_SCAN_HOME_TIME          188
979 #define WLC_SET_SCAN_HOME_TIME          189
980 #define WLC_GET_SCAN_NPROBES            190
981 #define WLC_SET_SCAN_NPROBES            191
982 #define WLC_GET_PRB_RESP_TIMEOUT        192
983 #define WLC_SET_PRB_RESP_TIMEOUT        193
984 #define WLC_GET_ATTEN               194
985 #define WLC_SET_ATTEN               195
986 #define WLC_GET_SHMEM               196 
987 #define WLC_SET_SHMEM               197 
988  
989  
990 #define WLC_SET_WSEC_TEST           200
991 #define WLC_SCB_DEAUTHENTICATE_FOR_REASON   201
992 #define WLC_TKIP_COUNTERMEASURES        202
993 #define WLC_GET_PIOMODE             203
994 #define WLC_SET_PIOMODE             204
995 #define WLC_SET_ASSOC_PREFER            205
996 #define WLC_GET_ASSOC_PREFER            206
997 #define WLC_SET_ROAM_PREFER         207
998 #define WLC_GET_ROAM_PREFER         208
999 #define WLC_SET_LED             209
1000 #define WLC_GET_LED             210
1001 #define WLC_GET_INTERFERENCE_MODE       211
1002 #define WLC_SET_INTERFERENCE_MODE       212
1003 #define WLC_GET_CHANNEL_QA          213
1004 #define WLC_START_CHANNEL_QA            214
1005 #define WLC_GET_CHANNEL_SEL         215
1006 #define WLC_START_CHANNEL_SEL           216
1007 #define WLC_GET_VALID_CHANNELS          217
1008 #define WLC_GET_FAKEFRAG            218
1009 #define WLC_SET_FAKEFRAG            219
1010 #define WLC_GET_PWROUT_PERCENTAGE       220
1011 #define WLC_SET_PWROUT_PERCENTAGE       221
1012 #define WLC_SET_BAD_FRAME_PREEMPT       222
1013 #define WLC_GET_BAD_FRAME_PREEMPT       223
1014 #define WLC_SET_LEAP_LIST           224
1015 #define WLC_GET_LEAP_LIST           225
1016 #define WLC_GET_CWMIN               226
1017 #define WLC_SET_CWMIN               227
1018 #define WLC_GET_CWMAX               228
1019 #define WLC_SET_CWMAX               229
1020 #define WLC_GET_WET             230
1021 #define WLC_SET_WET             231
1022 #define WLC_GET_PUB             232
1023  
1024  
1025 #define WLC_GET_KEY_PRIMARY         235
1026 #define WLC_SET_KEY_PRIMARY         236
1027  
1028 #define WLC_GET_ACI_ARGS            238
1029 #define WLC_SET_ACI_ARGS            239
1030 #define WLC_UNSET_CALLBACK          240
1031 #define WLC_SET_CALLBACK            241
1032 #define WLC_GET_RADAR               242
1033 #define WLC_SET_RADAR               243
1034 #define WLC_SET_SPECT_MANAGMENT         244
1035 #define WLC_GET_SPECT_MANAGMENT         245
1036 #define WLC_WDS_GET_REMOTE_HWADDR       246 
1037 #define WLC_WDS_GET_WPA_SUP         247
1038 #define WLC_SET_CS_SCAN_TIMER           248
1039 #define WLC_GET_CS_SCAN_TIMER           249
1040 #define WLC_MEASURE_REQUEST         250
1041 #define WLC_INIT                251
1042 #define WLC_SEND_QUIET              252
1043 #define WLC_KEEPALIVE           253
1044 #define WLC_SEND_PWR_CONSTRAINT         254
1045 #define WLC_UPGRADE_STATUS          255
1046 #define WLC_CURRENT_PWR             256
1047 #define WLC_GET_SCAN_PASSIVE_TIME       257
1048 #define WLC_SET_SCAN_PASSIVE_TIME       258
1049 #define WLC_LEGACY_LINK_BEHAVIOR        259
1050 #define WLC_GET_CHANNELS_IN_COUNTRY     260
1051 #define WLC_GET_COUNTRY_LIST            261
1052 #define WLC_GET_VAR             262 
1053 #define WLC_SET_VAR             263 
1054 #define WLC_NVRAM_GET               264 
1055 #define WLC_NVRAM_SET               265
1056 #define WLC_NVRAM_DUMP              266
1057 #define WLC_REBOOT              267
1058 #define WLC_SET_WSEC_PMK            268
1059 #define WLC_GET_AUTH_MODE           269
1060 #define WLC_SET_AUTH_MODE           270
1061 #define WLC_GET_WAKEENTRY           271
1062 #define WLC_SET_WAKEENTRY           272
1063 #define WLC_NDCONFIG_ITEM           273 
1064 #define WLC_NVOTPW              274
1065 #define WLC_OTPW                275
1066 #define WLC_IOV_BLOCK_GET           276
1067 #define WLC_IOV_MODULES_GET         277
1068 #define WLC_SOFT_RESET              278
1069 #define WLC_GET_ALLOW_MODE          279
1070 #define WLC_SET_ALLOW_MODE          280
1071 #define WLC_GET_DESIRED_BSSID           281
1072 #define WLC_SET_DESIRED_BSSID           282
1073 #define WLC_DISASSOC_MYAP           283
1074 #define WLC_GET_NBANDS              284 
1075 #define WLC_GET_BANDSTATES          285 
1076 #define WLC_GET_WLC_BSS_INFO            286 
1077 #define WLC_GET_ASSOC_INFO          287 
1078 #define WLC_GET_OID_PHY             288 
1079 #define WLC_SET_OID_PHY             289 
1080 #define WLC_SET_ASSOC_TIME          290 
1081 #define WLC_GET_DESIRED_SSID            291 
1082 #define WLC_GET_CHANSPEC            292 
1083 #define WLC_GET_ASSOC_STATE         293 
1084 #define WLC_SET_PHY_STATE           294 
1085 #define WLC_GET_SCAN_PENDING            295 
1086 #define WLC_GET_SCANREQ_PENDING         296 
1087 #define WLC_GET_PREV_ROAM_REASON        297 
1088 #define WLC_SET_PREV_ROAM_REASON        298 
1089 #define WLC_GET_BANDSTATES_PI           299 
1090 #define WLC_GET_PHY_STATE           300 
1091 #define WLC_GET_BSS_WPA_RSN         301 
1092 #define WLC_GET_BSS_WPA2_RSN            302 
1093 #define WLC_GET_BSS_BCN_TS          303 
1094 #define WLC_GET_INT_DISASSOC            304 
1095 #define WLC_SET_NUM_PEERS           305     
1096 #define WLC_GET_NUM_BSS             306 
1097 #define WLC_NPHY_SAMPLE_COLLECT         307 
1098 #define WLC_UM_PRIV             308 
1099 #define WLC_GET_CMD             309
1100   
1101 #define WLC_SET_INTERFERENCE_OVERRIDE_MODE  311 
1102 #define WLC_GET_INTERFERENCE_OVERRIDE_MODE  312 
1103 #define WLC_GET_WAI_RESTRICT            313 
1104 #define WLC_SET_WAI_RESTRICT            314 
1105 #define WLC_SET_WAI_REKEY           315 
1106 #define WLC_SET_PEAKRATE            316 
1107 #define WLC_GET_PEAKRATE            317
1108 #define WLC_LAST                318
1109
1110 #ifndef EPICTRL_COOKIE
1111 #define EPICTRL_COOKIE      0xABADCEDE
1112 #endif
1113
1114
1115 #define CMN_IOCTL_OFF 0x180
1116
1117
1118
1119
1120 #define WL_OID_BASE     0xFFE41420
1121
1122
1123 #define OID_WL_GETINSTANCE  (WL_OID_BASE + WLC_GET_INSTANCE)
1124 #define OID_WL_GET_FORCELINK    (WL_OID_BASE + WLC_GET_FORCELINK)
1125 #define OID_WL_SET_FORCELINK    (WL_OID_BASE + WLC_SET_FORCELINK)
1126 #define OID_WL_ENCRYPT_STRENGTH (WL_OID_BASE + WLC_ENCRYPT_STRENGTH)
1127 #define OID_WL_DECRYPT_STATUS   (WL_OID_BASE + WLC_DECRYPT_STATUS)
1128 #define OID_LEGACY_LINK_BEHAVIOR (WL_OID_BASE + WLC_LEGACY_LINK_BEHAVIOR)
1129 #define OID_WL_NDCONFIG_ITEM    (WL_OID_BASE + WLC_NDCONFIG_ITEM)
1130
1131
1132 #define OID_STA_CHANSPEC    (WL_OID_BASE + WLC_GET_CHANSPEC)
1133 #define OID_STA_NBANDS      (WL_OID_BASE + WLC_GET_NBANDS)
1134 #define OID_STA_GET_PHY     (WL_OID_BASE + WLC_GET_OID_PHY)
1135 #define OID_STA_SET_PHY     (WL_OID_BASE + WLC_SET_OID_PHY)
1136 #define OID_STA_ASSOC_TIME  (WL_OID_BASE + WLC_SET_ASSOC_TIME)
1137 #define OID_STA_DESIRED_SSID    (WL_OID_BASE + WLC_GET_DESIRED_SSID)
1138 #define OID_STA_SET_PHY_STATE   (WL_OID_BASE + WLC_SET_PHY_STATE)
1139 #define OID_STA_SCAN_PENDING    (WL_OID_BASE + WLC_GET_SCAN_PENDING)
1140 #define OID_STA_SCANREQ_PENDING (WL_OID_BASE + WLC_GET_SCANREQ_PENDING)
1141 #define OID_STA_GET_ROAM_REASON (WL_OID_BASE + WLC_GET_PREV_ROAM_REASON)
1142 #define OID_STA_SET_ROAM_REASON (WL_OID_BASE + WLC_SET_PREV_ROAM_REASON)
1143 #define OID_STA_GET_PHY_STATE   (WL_OID_BASE + WLC_GET_PHY_STATE)
1144 #define OID_STA_INT_DISASSOC    (WL_OID_BASE + WLC_GET_INT_DISASSOC)
1145 #define OID_STA_SET_NUM_PEERS   (WL_OID_BASE + WLC_SET_NUM_PEERS)
1146 #define OID_STA_GET_NUM_BSS (WL_OID_BASE + WLC_GET_NUM_BSS)
1147
1148 #define WL_DECRYPT_STATUS_SUCCESS   1
1149 #define WL_DECRYPT_STATUS_FAILURE   2
1150 #define WL_DECRYPT_STATUS_UNKNOWN   3
1151
1152
1153 #define WLC_UPGRADE_SUCCESS         0
1154 #define WLC_UPGRADE_PENDING         1
1155
1156 #ifdef CONFIG_USBRNDIS_RETAIL
1157
1158 typedef struct {
1159         char *name;
1160         void *param;
1161 } ndconfig_item_t;
1162 #endif
1163
1164
1165
1166 #define WL_AUTH_OPEN_SYSTEM     0   
1167 #define WL_AUTH_SHARED_KEY      1   
1168 #define WL_AUTH_OPEN_SHARED             2       
1169
1170
1171 #define WL_RADIO_SW_DISABLE     (1<<0)
1172 #define WL_RADIO_HW_DISABLE     (1<<1)
1173 #define WL_RADIO_MPC_DISABLE        (1<<2)
1174 #define WL_RADIO_COUNTRY_DISABLE    (1<<3)  
1175
1176 #define WL_SPURAVOID_OFF    0
1177 #define WL_SPURAVOID_ON1    1
1178 #define WL_SPURAVOID_ON2    2
1179
1180
1181 #define WL_TXPWR_OVERRIDE   (1U<<31)
1182 #define WL_TXPWR_NEG   (1U<<30)
1183
1184 #define WL_PHY_PAVARS_LEN   6   
1185
1186 #define WL_PHY_PAVARS2_NUM      3       
1187 #define WL_PHY_PAVAR_VER        1       
1188 typedef struct wl_pavars2 {
1189         uint16 ver;             
1190         uint16 len;             
1191         uint16 inuse;           
1192         uint16 phy_type;        
1193         uint16 bandrange;
1194         uint16 chain;
1195         uint16 inpa[WL_PHY_PAVARS2_NUM];        
1196 } wl_pavars2_t;
1197
1198 typedef struct wl_po {
1199         uint16  phy_type;   
1200         uint16  band;
1201         uint16  cckpo;
1202         uint32  ofdmpo;
1203         uint16  mcspo[8];
1204 } wl_po_t;
1205
1206
1207 #define WLC_TXPWR_MAX       (127)   
1208
1209
1210 #define WL_DIAG_INTERRUPT           1   
1211 #define WL_DIAG_LOOPBACK            2   
1212 #define WL_DIAG_MEMORY              3   
1213 #define WL_DIAG_LED             4   
1214 #define WL_DIAG_REG             5   
1215 #define WL_DIAG_SROM                6   
1216 #define WL_DIAG_DMA             7   
1217
1218 #define WL_DIAGERR_SUCCESS          0
1219 #define WL_DIAGERR_FAIL_TO_RUN          1   
1220 #define WL_DIAGERR_NOT_SUPPORTED        2   
1221 #define WL_DIAGERR_INTERRUPT_FAIL       3   
1222 #define WL_DIAGERR_LOOPBACK_FAIL        4   
1223 #define WL_DIAGERR_SROM_FAIL            5   
1224 #define WL_DIAGERR_SROM_BADCRC          6   
1225 #define WL_DIAGERR_REG_FAIL         7   
1226 #define WL_DIAGERR_MEMORY_FAIL          8   
1227 #define WL_DIAGERR_NOMEM            9   
1228 #define WL_DIAGERR_DMA_FAIL         10  
1229
1230 #define WL_DIAGERR_MEMORY_TIMEOUT       11  
1231 #define WL_DIAGERR_MEMORY_BADPATTERN        12  
1232
1233
1234 #define WLC_BAND_AUTO       0   
1235 #define WLC_BAND_5G     1   
1236 #define WLC_BAND_2G     2   
1237 #define WLC_BAND_ALL        3   
1238
1239
1240 #define WL_CHAN_FREQ_RANGE_2G      0
1241 #define WL_CHAN_FREQ_RANGE_5GL     1
1242 #define WL_CHAN_FREQ_RANGE_5GM     2
1243 #define WL_CHAN_FREQ_RANGE_5GH     3
1244
1245 #define WL_CHAN_FREQ_RANGE_5GLL_5BAND    4
1246 #define WL_CHAN_FREQ_RANGE_5GLH_5BAND    5
1247 #define WL_CHAN_FREQ_RANGE_5GML_5BAND    6
1248 #define WL_CHAN_FREQ_RANGE_5GMH_5BAND    7
1249 #define WL_CHAN_FREQ_RANGE_5GH_5BAND     8
1250
1251 #define WL_CHAN_FREQ_RANGE_5G_BAND0     1
1252 #define WL_CHAN_FREQ_RANGE_5G_BAND1     2
1253 #define WL_CHAN_FREQ_RANGE_5G_BAND2     3
1254 #define WL_CHAN_FREQ_RANGE_5G_BAND3     4
1255
1256
1257 #define WLC_PHY_TYPE_A      0
1258 #define WLC_PHY_TYPE_B      1
1259 #define WLC_PHY_TYPE_G      2
1260 #define WLC_PHY_TYPE_N      4
1261 #define WLC_PHY_TYPE_LP     5
1262 #define WLC_PHY_TYPE_SSN    6
1263 #define WLC_PHY_TYPE_HT     7
1264 #define WLC_PHY_TYPE_LCN    8
1265 #define WLC_PHY_TYPE_NULL   0xf
1266
1267
1268 #define WLC_MACMODE_DISABLED    0   
1269 #define WLC_MACMODE_DENY    1   
1270 #define WLC_MACMODE_ALLOW   2   
1271
1272
1273 #define GMODE_LEGACY_B      0
1274 #define GMODE_AUTO      1
1275 #define GMODE_ONLY      2
1276 #define GMODE_B_DEFERRED    3
1277 #define GMODE_PERFORMANCE   4
1278 #define GMODE_LRS       5
1279 #define GMODE_MAX       6
1280
1281
1282 #define WLC_PLCP_AUTO   -1
1283 #define WLC_PLCP_SHORT  0
1284 #define WLC_PLCP_LONG   1
1285
1286
1287 #define WLC_PROTECTION_AUTO     -1
1288 #define WLC_PROTECTION_OFF      0
1289 #define WLC_PROTECTION_ON       1
1290 #define WLC_PROTECTION_MMHDR_ONLY   2
1291 #define WLC_PROTECTION_CTS_ONLY     3
1292
1293
1294 #define WLC_PROTECTION_CTL_OFF      0
1295 #define WLC_PROTECTION_CTL_LOCAL    1
1296 #define WLC_PROTECTION_CTL_OVERLAP  2
1297
1298
1299 #define WLC_N_PROTECTION_OFF        0
1300 #define WLC_N_PROTECTION_OPTIONAL   1
1301 #define WLC_N_PROTECTION_20IN40     2
1302 #define WLC_N_PROTECTION_MIXEDMODE  3
1303
1304
1305 #define WLC_N_PREAMBLE_MIXEDMODE    0
1306 #define WLC_N_PREAMBLE_GF       1
1307 #define WLC_N_PREAMBLE_GF_BRCM          2
1308
1309
1310 #define WLC_N_BW_20ALL          0
1311 #define WLC_N_BW_40ALL          1
1312 #define WLC_N_BW_20IN2G_40IN5G      2
1313
1314
1315 #define WLC_N_TXRX_CHAIN0       0
1316 #define WLC_N_TXRX_CHAIN1       1
1317
1318
1319 #define WLC_N_SGI_20            0x01
1320 #define WLC_N_SGI_40            0x02
1321
1322
1323 #define PM_OFF  0
1324 #define PM_MAX  1
1325 #define PM_FAST 2
1326
1327 #define LISTEN_INTERVAL                 10
1328
1329 #define INTERFERE_OVRRIDE_OFF   -1  
1330 #define INTERFERE_NONE  0   
1331 #define NON_WLAN    1   
1332 #define WLAN_MANUAL 2   
1333 #define WLAN_AUTO   3   
1334 #define WLAN_AUTO_W_NOISE   4   
1335 #define AUTO_ACTIVE (1 << 7) 
1336
1337 typedef struct wl_aci_args {
1338         int enter_aci_thresh; 
1339         int exit_aci_thresh; 
1340         int usec_spin; 
1341         int glitch_delay; 
1342         uint16 nphy_adcpwr_enter_thresh;    
1343         uint16 nphy_adcpwr_exit_thresh; 
1344         uint16 nphy_repeat_ctr;     
1345         uint16 nphy_num_samples;    
1346         uint16 nphy_undetect_window_sz; 
1347         uint16 nphy_b_energy_lo_aci;    
1348         uint16 nphy_b_energy_md_aci;    
1349         uint16 nphy_b_energy_hi_aci;    
1350         uint16 nphy_noise_noassoc_glitch_th_up; 
1351         uint16 nphy_noise_noassoc_glitch_th_dn;
1352         uint16 nphy_noise_assoc_glitch_th_up;
1353         uint16 nphy_noise_assoc_glitch_th_dn;
1354         uint16 nphy_noise_assoc_aci_glitch_th_up;
1355         uint16 nphy_noise_assoc_aci_glitch_th_dn;
1356         uint16 nphy_noise_assoc_enter_th;
1357         uint16 nphy_noise_noassoc_enter_th;
1358         uint16 nphy_noise_assoc_rx_glitch_badplcp_enter_th;
1359         uint16 nphy_noise_noassoc_crsidx_incr;
1360         uint16 nphy_noise_assoc_crsidx_incr;
1361         uint16 nphy_noise_crsidx_decr;
1362 } wl_aci_args_t;
1363
1364 #define TRIGGER_NOW             0
1365 #define TRIGGER_CRS             0x01
1366 #define TRIGGER_CRSDEASSERT         0x02
1367 #define TRIGGER_GOODFCS             0x04
1368 #define TRIGGER_BADFCS              0x08
1369 #define TRIGGER_BADPLCP             0x10
1370 #define TRIGGER_CRSGLITCH           0x20
1371 #define WL_ACI_ARGS_LEGACY_LENGTH   16  
1372 #define WL_SAMPLECOLLECT_T_VERSION      2       
1373 typedef struct wl_samplecollect_args {
1374         
1375         uint8 coll_us;
1376         int cores;
1377         
1378         uint16 version;     
1379         uint16 length;      
1380         int8 trigger;
1381         uint16 timeout;
1382         uint16 mode;
1383         uint32 pre_dur;
1384         uint32 post_dur;
1385         uint8 gpio_sel;
1386         bool downsamp;
1387         bool be_deaf;
1388         bool agc;       
1389         bool filter;        
1390         
1391         uint8 trigger_state;
1392         uint8 module_sel1;
1393         uint8 module_sel2;
1394         uint16 nsamps;
1395 } wl_samplecollect_args_t;
1396
1397 #define WL_SAMPLEDATA_HEADER_TYPE   1
1398 #define WL_SAMPLEDATA_HEADER_SIZE   80  
1399 #define WL_SAMPLEDATA_TYPE      2
1400 #define WL_SAMPLEDATA_SEQ       0xff    
1401 #define WL_SAMPLEDATA_MORE_DATA     0x100   
1402 #define WL_SAMPLEDATA_T_VERSION     1   
1403
1404 #define WL_SAMPLEDATA_T_VERSION_SPEC_AN 2
1405
1406 typedef struct wl_sampledata {
1407         uint16 version; 
1408         uint16 size;    
1409         uint16 tag; 
1410         uint16 length;  
1411         uint32 flag;    
1412 } wl_sampledata_t;
1413
1414
1415 #define WL_CHAN_VALID_HW    (1 << 0)    
1416 #define WL_CHAN_VALID_SW    (1 << 1)    
1417 #define WL_CHAN_BAND_5G     (1 << 2)    
1418 #define WL_CHAN_RADAR       (1 << 3)    
1419 #define WL_CHAN_INACTIVE    (1 << 4)    
1420 #define WL_CHAN_PASSIVE     (1 << 5)    
1421 #define WL_CHAN_RESTRICTED  (1 << 6)    
1422
1423
1424 #define WL_ERROR_VAL        0x00000001
1425 #define WL_TRACE_VAL        0x00000002
1426 #define WL_PRHDRS_VAL       0x00000004
1427 #define WL_PRPKT_VAL        0x00000008
1428 #define WL_INFORM_VAL       0x00000010
1429 #define WL_TMP_VAL      0x00000020
1430 #define WL_OID_VAL      0x00000040
1431 #define WL_RATE_VAL     0x00000080
1432 #define WL_ASSOC_VAL        0x00000100
1433 #define WL_PRUSR_VAL        0x00000200
1434 #define WL_PS_VAL       0x00000400
1435 #define WL_TXPWR_VAL        0x00000800  
1436 #define WL_PORT_VAL     0x00001000
1437 #define WL_DUAL_VAL     0x00002000
1438 #define WL_WSEC_VAL     0x00004000
1439 #define WL_WSEC_DUMP_VAL    0x00008000
1440 #define WL_LOG_VAL      0x00010000
1441 #define WL_NRSSI_VAL        0x00020000  
1442 #define WL_LOFT_VAL     0x00040000  
1443 #define WL_REGULATORY_VAL   0x00080000
1444 #define WL_PHYCAL_VAL       0x00100000  
1445 #define WL_RADAR_VAL        0x00200000  
1446 #define WL_MPC_VAL      0x00400000
1447 #define WL_APSTA_VAL        0x00800000
1448 #define WL_DFS_VAL      0x01000000
1449 #define WL_BA_VAL       0x02000000
1450 #define WL_ACI_VAL      0x04000000
1451 #define WL_MBSS_VAL     0x04000000
1452 #define WL_CAC_VAL      0x08000000
1453 #define WL_AMSDU_VAL        0x10000000
1454 #define WL_AMPDU_VAL        0x20000000
1455 #define WL_FFPLD_VAL        0x40000000
1456
1457
1458 #define WL_DPT_VAL      0x00000001
1459 #define WL_SCAN_VAL     0x00000002
1460 #define WL_WOWL_VAL     0x00000004
1461 #define WL_COEX_VAL     0x00000008
1462 #define WL_RTDC_VAL     0x00000010
1463 #define WL_PROTO_VAL        0x00000020
1464 #define WL_BTA_VAL      0x00000040
1465 #define WL_CHANINT_VAL      0x00000080
1466 #define WL_THERMAL_VAL      0x00000100  
1467 #define WL_P2P_VAL      0x00000200
1468 #define WL_TXRX_VAL             0x00000400
1469 #define WL_MCHAN_VAL            0x00000800
1470 #define WL_TDLS_VAL             0x00001000
1471
1472
1473 #define WL_LED_NUMGPIO      16  
1474
1475
1476 #define WL_LED_OFF      0       
1477 #define WL_LED_ON       1       
1478 #define WL_LED_ACTIVITY     2       
1479 #define WL_LED_RADIO        3       
1480 #define WL_LED_ARADIO       4       
1481 #define WL_LED_BRADIO       5       
1482 #define WL_LED_BGMODE       6       
1483 #define WL_LED_WI1      7
1484 #define WL_LED_WI2      8
1485 #define WL_LED_WI3      9
1486 #define WL_LED_ASSOC        10      
1487 #define WL_LED_INACTIVE     11      
1488 #define WL_LED_ASSOCACT     12      
1489 #define WL_LED_WI4      13
1490 #define WL_LED_WI5      14
1491 #define WL_LED_BLINKSLOW    15      
1492 #define WL_LED_BLINKMED     16      
1493 #define WL_LED_BLINKFAST    17      
1494 #define WL_LED_BLINKCUSTOM  18      
1495 #define WL_LED_BLINKPERIODIC    19      
1496 #define WL_LED_ASSOC_WITH_SEC   20      
1497                                                 
1498 #define WL_LED_START_OFF    21      
1499 #define WL_LED_NUMBEHAVIOR  22
1500
1501
1502 #define WL_LED_BEH_MASK     0x7f        
1503 #define WL_LED_AL_MASK      0x80        
1504
1505
1506 #define WL_NUMCHANNELS      64
1507 #define WL_NUMCHANSPECS     100
1508
1509
1510 #define WL_WDS_WPA_ROLE_AUTH    0   
1511 #define WL_WDS_WPA_ROLE_SUP 1   
1512 #define WL_WDS_WPA_ROLE_AUTO    255 
1513
1514
1515 #define WL_EVENTING_MASK_LEN    16
1516
1517
1518
1519
1520 #define WL_JOIN_PREF_RSSI   1   
1521 #define WL_JOIN_PREF_WPA    2   
1522 #define WL_JOIN_PREF_BAND   3   
1523 #define WL_JOIN_PREF_RSSI_DELTA 4   
1524 #define WL_JOIN_PREF_TRANS_PREF 5       
1525
1526
1527 #define WLJP_BAND_ASSOC_PREF    255 
1528
1529
1530 #define WL_WPA_ACP_MCS_ANY  "\x00\x00\x00\x00"
1531
1532 struct tsinfo_arg {
1533         uint8 octets[3];
1534 };
1535
1536 #define NFIFO           6   
1537
1538 #define WL_CNT_T_VERSION    6   
1539
1540 typedef struct {
1541         uint16  version;    
1542         uint16  length;     
1543
1544         
1545         uint32  txframe;    
1546         uint32  txbyte;     
1547         uint32  txretrans;  
1548         uint32  txerror;    
1549         uint32  txctl;      
1550         uint32  txprshort;  
1551         uint32  txserr;     
1552         uint32  txnobuf;    
1553         uint32  txnoassoc;  
1554         uint32  txrunt;     
1555         uint32  txchit;     
1556         uint32  txcmiss;    
1557
1558         
1559         uint32  txuflo;     
1560         uint32  txphyerr;   
1561         uint32  txphycrs;
1562
1563         
1564         uint32  rxframe;    
1565         uint32  rxbyte;     
1566         uint32  rxerror;    
1567         uint32  rxctl;      
1568         uint32  rxnobuf;    
1569         uint32  rxnondata;  
1570         uint32  rxbadds;    
1571         uint32  rxbadcm;    
1572         uint32  rxfragerr;  
1573         uint32  rxrunt;     
1574         uint32  rxgiant;    
1575         uint32  rxnoscb;    
1576         uint32  rxbadproto; 
1577         uint32  rxbadsrcmac;    
1578         uint32  rxbadda;    
1579         uint32  rxfilter;   
1580
1581         
1582         uint32  rxoflo;     
1583         uint32  rxuflo[NFIFO];  
1584
1585         uint32  d11cnt_txrts_off;   
1586         uint32  d11cnt_rxcrc_off;   
1587         uint32  d11cnt_txnocts_off; 
1588
1589         
1590         uint32  dmade;      
1591         uint32  dmada;      
1592         uint32  dmape;      
1593         uint32  reset;      
1594         uint32  tbtt;       
1595         uint32  txdmawar;
1596         uint32  pkt_callback_reg_fail;  
1597
1598         
1599         uint32  txallfrm;   
1600         uint32  txrtsfrm;   
1601         uint32  txctsfrm;   
1602         uint32  txackfrm;   
1603         uint32  txdnlfrm;   
1604         uint32  txbcnfrm;   
1605         uint32  txfunfl[8]; 
1606         uint32  txtplunfl;  
1607         uint32  txphyerror; 
1608         uint32  rxfrmtoolong;   
1609         uint32  rxfrmtooshrt;   
1610         uint32  rxinvmachdr;    
1611         uint32  rxbadfcs;   
1612         uint32  rxbadplcp;  
1613         uint32  rxcrsglitch;    
1614         uint32  rxstrt;     
1615         uint32  rxdfrmucastmbss; 
1616         uint32  rxmfrmucastmbss; 
1617         uint32  rxcfrmucast;    
1618         uint32  rxrtsucast; 
1619         uint32  rxctsucast; 
1620         uint32  rxackucast; 
1621         uint32  rxdfrmocast;    
1622         uint32  rxmfrmocast;    
1623         uint32  rxcfrmocast;    
1624         uint32  rxrtsocast; 
1625         uint32  rxctsocast; 
1626         uint32  rxdfrmmcast;    
1627         uint32  rxmfrmmcast;    
1628         uint32  rxcfrmmcast;    
1629         uint32  rxbeaconmbss;   
1630         uint32  rxdfrmucastobss; 
1631         uint32  rxbeaconobss;   
1632         uint32  rxrsptmout; 
1633         uint32  bcntxcancl; 
1634         uint32  rxf0ovfl;   
1635         uint32  rxf1ovfl;   
1636         uint32  rxf2ovfl;   
1637         uint32  txsfovfl;   
1638         uint32  pmqovfl;    
1639         uint32  rxcgprqfrm; 
1640         uint32  rxcgprsqovfl;   
1641         uint32  txcgprsfail;    
1642         uint32  txcgprssuc; 
1643         uint32  prs_timeout;    
1644         uint32  rxnack;
1645         uint32  frmscons;
1646         uint32  txnack;
1647         uint32  txglitch_nack;  
1648         uint32  txburst;    
1649
1650         
1651         uint32  txfrag;     
1652         uint32  txmulti;    
1653         uint32  txfail;     
1654         uint32  txretry;    
1655         uint32  txretrie;   
1656         uint32  rxdup;      
1657         uint32  txrts;      
1658         uint32  txnocts;    
1659         uint32  txnoack;    
1660         uint32  rxfrag;     
1661         uint32  rxmulti;    
1662         uint32  rxcrc;      
1663         uint32  txfrmsnt;   
1664         uint32  rxundec;    
1665
1666         
1667         uint32  tkipmicfaill;   
1668         uint32  tkipcntrmsr;    
1669         uint32  tkipreplay; 
1670         uint32  ccmpfmterr; 
1671         uint32  ccmpreplay; 
1672         uint32  ccmpundec;  
1673         uint32  fourwayfail;    
1674         uint32  wepundec;   
1675         uint32  wepicverr;  
1676         uint32  decsuccess; 
1677         uint32  tkipicverr; 
1678         uint32  wepexcluded;    
1679
1680         uint32  rxundec_mcst;   
1681
1682         
1683         uint32  tkipmicfaill_mcst;  
1684         uint32  tkipcntrmsr_mcst;   
1685         uint32  tkipreplay_mcst;    
1686         uint32  ccmpfmterr_mcst;    
1687         uint32  ccmpreplay_mcst;    
1688         uint32  ccmpundec_mcst; 
1689         uint32  fourwayfail_mcst;   
1690         uint32  wepundec_mcst;  
1691         uint32  wepicverr_mcst; 
1692         uint32  decsuccess_mcst;    
1693         uint32  tkipicverr_mcst;    
1694         uint32  wepexcluded_mcst;   
1695
1696         uint32  txchanrej;  
1697         uint32  txexptime;  
1698         uint32  psmwds;     
1699         uint32  phywatchdog;    
1700
1701         
1702         uint32  prq_entries_handled;    
1703         uint32  prq_undirected_entries; 
1704         uint32  prq_bad_entries;    
1705         uint32  atim_suppress_count;    
1706         uint32  bcn_template_not_ready; 
1707         uint32  bcn_template_not_ready_done; 
1708         uint32  late_tbtt_dpc;  
1709
1710         
1711         uint32  rx1mbps;    
1712         uint32  rx2mbps;    
1713         uint32  rx5mbps5;   
1714         uint32  rx6mbps;    
1715         uint32  rx9mbps;    
1716         uint32  rx11mbps;   
1717         uint32  rx12mbps;   
1718         uint32  rx18mbps;   
1719         uint32  rx24mbps;   
1720         uint32  rx36mbps;   
1721         uint32  rx48mbps;   
1722         uint32  rx54mbps;   
1723         uint32  rx108mbps;  
1724         uint32  rx162mbps;  
1725         uint32  rx216mbps;  
1726         uint32  rx270mbps;  
1727         uint32  rx324mbps;  
1728         uint32  rx378mbps;  
1729         uint32  rx432mbps;  
1730         uint32  rx486mbps;  
1731         uint32  rx540mbps;  
1732
1733         
1734         uint32  pktengrxducast; 
1735         uint32  pktengrxdmcast; 
1736
1737         uint32  rfdisable;  
1738         uint32  bphy_rxcrsglitch;   
1739
1740         uint32  txmpdu_sgi; 
1741         uint32  rxmpdu_sgi; 
1742         uint32  txmpdu_stbc;    
1743         uint32  rxmpdu_stbc;    
1744 } wl_cnt_t;
1745
1746
1747 #define WL_WME_CNT_VERSION  1   
1748
1749 typedef struct {
1750         uint32 packets;
1751         uint32 bytes;
1752 } wl_traffic_stats_t;
1753
1754 typedef struct {
1755         uint16  version;    
1756         uint16  length;     
1757
1758         wl_traffic_stats_t tx[AC_COUNT];    
1759         wl_traffic_stats_t tx_failed[AC_COUNT]; 
1760         wl_traffic_stats_t rx[AC_COUNT];    
1761         wl_traffic_stats_t rx_failed[AC_COUNT]; 
1762
1763         wl_traffic_stats_t forward[AC_COUNT];   
1764
1765         wl_traffic_stats_t tx_expired[AC_COUNT];    
1766
1767 } wl_wme_cnt_t;
1768
1769 struct wl_msglevel2 {
1770         uint32 low;
1771         uint32 high;
1772 };
1773
1774 typedef struct wl_mkeep_alive_pkt {
1775         uint16  version; 
1776         uint16  length; 
1777         uint32  period_msec;
1778         uint16  len_bytes;
1779         uint8   keep_alive_id; 
1780         uint8   data[1];
1781 } wl_mkeep_alive_pkt_t;
1782
1783 #define WL_MKEEP_ALIVE_VERSION          1
1784 #define WL_MKEEP_ALIVE_FIXED_LEN        OFFSETOF(wl_mkeep_alive_pkt_t, data)
1785 #define WL_MKEEP_ALIVE_PRECISION        500
1786
1787
1788
1789 #define WLC_ROAM_TRIGGER_DEFAULT    0 
1790 #define WLC_ROAM_TRIGGER_BANDWIDTH  1 
1791 #define WLC_ROAM_TRIGGER_DISTANCE   2 
1792 #define WLC_ROAM_TRIGGER_AUTO       3 
1793 #define WLC_ROAM_TRIGGER_MAX_VALUE  3 
1794
1795
1796 #define WPA_AUTH_PFN_ANY        0xffffffff      
1797
1798 enum {
1799         PFN_LIST_ORDER,
1800         PFN_RSSI
1801 };
1802
1803 enum {
1804         DISABLE,
1805         ENABLE
1806 };
1807
1808 enum {
1809         OFF_ADAPT,
1810         SMART_ADAPT,
1811         STRICT_ADAPT,
1812         SLOW_ADAPT
1813 };
1814
1815 #define SORT_CRITERIA_BIT               0
1816 #define AUTO_NET_SWITCH_BIT             1
1817 #define ENABLE_BKGRD_SCAN_BIT   2
1818 #define IMMEDIATE_SCAN_BIT              3
1819 #define AUTO_CONNECT_BIT                4
1820 #define ENABLE_BD_SCAN_BIT              5
1821 #define ENABLE_ADAPTSCAN_BIT    6
1822 #define IMMEDIATE_EVENT_BIT             8
1823
1824 #define SORT_CRITERIA_MASK              0x0001
1825 #define AUTO_NET_SWITCH_MASK    0x0002
1826 #define ENABLE_BKGRD_SCAN_MASK  0x0004
1827 #define IMMEDIATE_SCAN_MASK             0x0008
1828 #define AUTO_CONNECT_MASK               0x0010
1829 #define ENABLE_BD_SCAN_MASK             0x0020
1830 #define ENABLE_ADAPTSCAN_MASK   0x00c0
1831 #define IMMEDIATE_EVENT_MASK    0x0100
1832
1833 #define PFN_VERSION                             2
1834 #define PFN_SCANRESULT_VERSION  1
1835 #define MAX_PFN_LIST_COUNT      16
1836
1837 #define PFN_COMPLETE                    1
1838 #define PFN_INCOMPLETE                  0
1839
1840 #define DEFAULT_BESTN                   2
1841 #define DEFAULT_MSCAN                   0
1842 #define DEFAULT_REPEAT                  10
1843 #define DEFAULT_EXP                             2
1844
1845
1846 typedef struct wl_pfn_subnet_info {
1847         struct ether_addr BSSID;
1848         uint8   channel; 
1849         uint8   SSID_len;
1850         uint8   SSID[32];
1851 } wl_pfn_subnet_info_t;
1852
1853 typedef struct wl_pfn_net_info {
1854         wl_pfn_subnet_info_t pfnsubnet;
1855         int16   RSSI; 
1856         uint16  timestamp; 
1857 } wl_pfn_net_info_t;
1858
1859 typedef struct wl_pfn_scanresults {
1860         uint32 version;
1861         uint32 status;
1862         uint32 count;
1863         wl_pfn_net_info_t netinfo[1];
1864 } wl_pfn_scanresults_t;
1865
1866
1867 typedef struct wl_pfn_param {
1868         int32 version;                  
1869         int32 scan_freq;                
1870         int32 lost_network_timeout;     
1871         int16 flags;                    
1872         int16 rssi_margin;              
1873         uint8 bestn; 
1874         uint8 mscan; 
1875         uint8 repeat; 
1876         uint8 exp; 
1877         int32 slow_freq; 
1878 } wl_pfn_param_t;
1879
1880 typedef struct wl_pfn_bssid {
1881         struct ether_addr       macaddr;
1882         
1883         uint16                          flags;
1884 } wl_pfn_bssid_t;
1885 #define WL_PFN_SUPPRESSFOUND_MASK       0x08
1886 #define WL_PFN_SUPPRESSLOST_MASK        0x10
1887
1888 typedef struct wl_pfn_cfg {
1889         uint32                          reporttype;
1890         int32                           channel_num;
1891         uint16                          channel_list[WL_NUMCHANNELS];
1892 } wl_pfn_cfg_t;
1893 #define WL_PFN_REPORT_ALLNET    0
1894 #define WL_PFN_REPORT_SSIDNET   1
1895 #define WL_PFN_REPORT_BSSIDNET  2
1896
1897 typedef struct wl_pfn {
1898         wlc_ssid_t              ssid;                   
1899         int32                   flags;                  
1900         int32                   infra;                  
1901         int32                   auth;                   
1902         int32                   wpa_auth;               
1903         int32                   wsec;                   
1904 } wl_pfn_t;
1905 #define WL_PFN_HIDDEN_BIT               2
1906 #define PNO_SCAN_MAX_FW         508*1000        
1907 #define PNO_SCAN_MAX_FW_SEC     PNO_SCAN_MAX_FW/1000 
1908 #define PNO_SCAN_MIN_FW_SEC     10                      
1909 #define WL_PFN_HIDDEN_MASK              0x4
1910
1911
1912 #define TOE_TX_CSUM_OL      0x00000001
1913 #define TOE_RX_CSUM_OL      0x00000002
1914
1915
1916 #define TOE_ERRTEST_TX_CSUM 0x00000001
1917 #define TOE_ERRTEST_RX_CSUM 0x00000002
1918 #define TOE_ERRTEST_RX_CSUM2    0x00000004
1919
1920 struct toe_ol_stats_t {
1921         
1922         uint32 tx_summed;
1923
1924         
1925         uint32 tx_iph_fill;
1926         uint32 tx_tcp_fill;
1927         uint32 tx_udp_fill;
1928         uint32 tx_icmp_fill;
1929
1930         
1931         uint32 rx_iph_good;
1932         uint32 rx_iph_bad;
1933         uint32 rx_tcp_good;
1934         uint32 rx_tcp_bad;
1935         uint32 rx_udp_good;
1936         uint32 rx_udp_bad;
1937         uint32 rx_icmp_good;
1938         uint32 rx_icmp_bad;
1939
1940         
1941         uint32 tx_tcp_errinj;
1942         uint32 tx_udp_errinj;
1943         uint32 tx_icmp_errinj;
1944
1945         
1946         uint32 rx_tcp_errinj;
1947         uint32 rx_udp_errinj;
1948         uint32 rx_icmp_errinj;
1949 };
1950
1951
1952 #define ARP_OL_AGENT        0x00000001
1953 #define ARP_OL_SNOOP        0x00000002
1954 #define ARP_OL_HOST_AUTO_REPLY  0x00000004
1955 #define ARP_OL_PEER_AUTO_REPLY  0x00000008
1956
1957
1958 #define ARP_ERRTEST_REPLY_PEER  0x1
1959 #define ARP_ERRTEST_REPLY_HOST  0x2
1960
1961 #define ARP_MULTIHOMING_MAX 8   
1962
1963
1964 struct arp_ol_stats_t {
1965         uint32  host_ip_entries;    
1966         uint32  host_ip_overflow;   
1967
1968         uint32  arp_table_entries;  
1969         uint32  arp_table_overflow; 
1970
1971         uint32  host_request;       
1972         uint32  host_reply;     
1973         uint32  host_service;       
1974
1975         uint32  peer_request;       
1976         uint32  peer_request_drop;  
1977         uint32  peer_reply;     
1978         uint32  peer_reply_drop;    
1979         uint32  peer_service;       
1980 };
1981
1982
1983
1984
1985 typedef struct wl_keep_alive_pkt {
1986         uint32  period_msec;    
1987         uint16  len_bytes;  
1988         uint8   data[1];    
1989 } wl_keep_alive_pkt_t;
1990
1991 #define WL_KEEP_ALIVE_FIXED_LEN     OFFSETOF(wl_keep_alive_pkt_t, data)
1992
1993
1994
1995
1996 #define MAX_WAKE_PACKET_BYTES 128
1997
1998
1999 typedef struct pm_wake_packet {
2000         uint32  status;         
2001         uint32  pattern_id;     
2002         uint32  original_packet_size;
2003         uint32  saved_packet_size;
2004         uchar   packet[MAX_WAKE_PACKET_BYTES];
2005 } pm_wake_packet_t;
2006
2007
2008
2009 #define PKT_FILTER_MODE_FORWARD_ON_MATCH                1
2010
2011 #define PKT_FILTER_MODE_DISABLE                                 2
2012
2013 #define PKT_FILTER_MODE_PKT_CACHE_ON_MATCH              4
2014
2015 #define PKT_FILTER_MODE_PKT_FORWARD_OFF_DEFAULT 8
2016
2017
2018 typedef enum wl_pkt_filter_type {
2019         WL_PKT_FILTER_TYPE_PATTERN_MATCH,       
2020         WL_PKT_FILTER_TYPE_MAGIC_PATTERN_MATCH  
2021 } wl_pkt_filter_type_t;
2022
2023 #define WL_PKT_FILTER_TYPE wl_pkt_filter_type_t
2024
2025
2026 typedef struct wl_pkt_filter_pattern {
2027         uint32  offset;     
2028         uint32  size_bytes; 
2029         uint8   mask_and_pattern[1]; 
2030 } wl_pkt_filter_pattern_t;
2031
2032
2033 typedef struct wl_pkt_filter {
2034         uint32  id;     
2035         uint32  type;       
2036         uint32  negate_match;   
2037         union {         
2038                 wl_pkt_filter_pattern_t pattern;    
2039         } u;
2040 } wl_pkt_filter_t;
2041
2042 #define WL_PKT_FILTER_FIXED_LEN       OFFSETOF(wl_pkt_filter_t, u)
2043 #define WL_PKT_FILTER_PATTERN_FIXED_LEN   OFFSETOF(wl_pkt_filter_pattern_t, mask_and_pattern)
2044
2045
2046 typedef struct wl_pkt_filter_enable {
2047         uint32  id;     
2048         uint32  enable;     
2049 } wl_pkt_filter_enable_t;
2050
2051
2052 typedef struct wl_pkt_filter_list {
2053         uint32  num;        
2054         wl_pkt_filter_t filter[1];  
2055 } wl_pkt_filter_list_t;
2056
2057 #define WL_PKT_FILTER_LIST_FIXED_LEN      OFFSETOF(wl_pkt_filter_list_t, filter)
2058
2059
2060 typedef struct wl_pkt_filter_stats {
2061         uint32  num_pkts_matched;   
2062         uint32  num_pkts_forwarded; 
2063         uint32  num_pkts_discarded; 
2064 } wl_pkt_filter_stats_t;
2065
2066
2067 typedef struct wl_seq_cmd_ioctl {
2068         uint32 cmd;     
2069         uint32 len;     
2070 } wl_seq_cmd_ioctl_t;
2071
2072 #define WL_SEQ_CMD_ALIGN_BYTES  4
2073
2074
2075 #define WL_SEQ_CMDS_GET_IOCTL_FILTER(cmd) \
2076         (((cmd) == WLC_GET_MAGIC) || \
2077          ((cmd) == WLC_GET_VERSION) || \
2078          ((cmd) == WLC_GET_AP) || \
2079          ((cmd) == WLC_GET_INSTANCE))
2080
2081
2082
2083 #define WL_PKTENG_PER_TX_START          0x01
2084 #define WL_PKTENG_PER_TX_STOP           0x02
2085 #define WL_PKTENG_PER_RX_START          0x04
2086 #define WL_PKTENG_PER_RX_WITH_ACK_START     0x05
2087 #define WL_PKTENG_PER_TX_WITH_ACK_START     0x06
2088 #define WL_PKTENG_PER_RX_STOP           0x08
2089 #define WL_PKTENG_PER_MASK          0xff
2090
2091 #define WL_PKTENG_SYNCHRONOUS           0x100   
2092
2093 typedef struct wl_pkteng {
2094         uint32 flags;
2095         uint32 delay;           
2096         uint32 nframes;         
2097         uint32 length;          
2098         uint8  seqno;           
2099         struct ether_addr dest;     
2100         struct ether_addr src;      
2101 } wl_pkteng_t;
2102
2103 #define NUM_80211b_RATES    4
2104 #define NUM_80211ag_RATES   8
2105 #define NUM_80211n_RATES    32
2106 #define NUM_80211_RATES     (NUM_80211b_RATES+NUM_80211ag_RATES+NUM_80211n_RATES)
2107 typedef struct wl_pkteng_stats {
2108         uint32 lostfrmcnt;      
2109         int32 rssi;         
2110         int32 snr;          
2111         uint16 rxpktcnt[NUM_80211_RATES+1];
2112 } wl_pkteng_stats_t;
2113
2114
2115 #define WL_WOWL_MAGIC   (1 << 0)    
2116 #define WL_WOWL_NET (1 << 1)    
2117 #define WL_WOWL_DIS (1 << 2)    
2118 #define WL_WOWL_RETR    (1 << 3)    
2119 #define WL_WOWL_BCN (1 << 4)    
2120 #define WL_WOWL_TST (1 << 5)    
2121 #define WL_WOWL_M1      (1 << 6)        
2122 #define WL_WOWL_EAPID   (1 << 7)        
2123 #define WL_WOWL_KEYROT  (1 << 14)       
2124 #define WL_WOWL_BCAST   (1 << 15)   
2125
2126 #define MAGIC_PKT_MINLEN 102    
2127
2128 typedef struct {
2129         uint masksize;      
2130         uint offset;        
2131         uint patternoffset; 
2132         uint patternsize;   
2133         ulong id;       
2134         
2135         
2136 } wl_wowl_pattern_t;
2137
2138 typedef struct {
2139         uint            count;
2140         wl_wowl_pattern_t   pattern[1];
2141 } wl_wowl_pattern_list_t;
2142
2143 typedef struct {
2144         uint8   pci_wakeind;    
2145         uint16  ucode_wakeind;  
2146 } wl_wowl_wakeind_t;
2147
2148
2149 typedef struct wl_txrate_class {
2150         uint8       init_rate;
2151         uint8       min_rate;
2152         uint8       max_rate;
2153 } wl_txrate_class_t;
2154
2155
2156
2157
2158 #define WLC_OBSS_SCAN_PASSIVE_DWELL_DEFAULT     20  
2159 #define WLC_OBSS_SCAN_PASSIVE_DWELL_MIN         5   
2160 #define WLC_OBSS_SCAN_PASSIVE_DWELL_MAX         1000    
2161 #define WLC_OBSS_SCAN_ACTIVE_DWELL_DEFAULT      10  
2162 #define WLC_OBSS_SCAN_ACTIVE_DWELL_MIN          10  
2163 #define WLC_OBSS_SCAN_ACTIVE_DWELL_MAX          1000    
2164 #define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_DEFAULT    300 
2165 #define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_MIN        10  
2166 #define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_MAX        900 
2167 #define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_DEFAULT  5
2168 #define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_MIN  5
2169 #define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_MAX  100
2170 #define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_DEFAULT 200 
2171 #define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_MIN 200 
2172 #define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_MAX 10000   
2173 #define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_DEFAULT  20  
2174 #define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_MIN  20  
2175 #define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_MAX  10000   
2176 #define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_DEFAULT    25  
2177 #define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_MIN        0   
2178 #define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_MAX        100 
2179
2180
2181 typedef struct wl_obss_scan_arg {
2182         int16   passive_dwell;
2183         int16   active_dwell;
2184         int16   bss_widthscan_interval;
2185         int16   passive_total;
2186         int16   active_total;
2187         int16   chanwidth_transition_delay;
2188         int16   activity_threshold;
2189 } wl_obss_scan_arg_t;
2190
2191 #define WL_OBSS_SCAN_PARAM_LEN  sizeof(wl_obss_scan_arg_t)
2192 #define WL_MIN_NUM_OBSS_SCAN_ARG 7  
2193
2194 #define WL_COEX_INFO_MASK       0x07
2195 #define WL_COEX_INFO_REQ        0x01
2196 #define WL_COEX_40MHZ_INTOLERANT    0x02
2197 #define WL_COEX_WIDTH20         0x04
2198
2199 #define WLC_RSSI_INVALID     0  
2200
2201 #define MAX_RSSI_LEVELS 8
2202
2203
2204 typedef struct wl_rssi_event {
2205         uint32 rate_limit_msec;     
2206         uint8 num_rssi_levels;      
2207         int8 rssi_levels[MAX_RSSI_LEVELS];  
2208 } wl_rssi_event_t;
2209
2210 typedef struct wl_action_obss_coex_req {
2211         uint8 info;
2212         uint8 num;
2213         uint8 ch_list[1];
2214 } wl_action_obss_coex_req_t;
2215
2216
2217 #define EXTLOG_CUR_VER      0x0100
2218
2219 #define MAX_ARGSTR_LEN      18 
2220
2221
2222 #define LOG_MODULE_COMMON   0x0001
2223 #define LOG_MODULE_ASSOC    0x0002
2224 #define LOG_MODULE_EVENT    0x0004
2225 #define LOG_MODULE_MAX      3           
2226
2227
2228 #define WL_LOG_LEVEL_DISABLE    0
2229 #define WL_LOG_LEVEL_ERR    1
2230 #define WL_LOG_LEVEL_WARN   2
2231 #define WL_LOG_LEVEL_INFO   3
2232 #define WL_LOG_LEVEL_MAX    WL_LOG_LEVEL_INFO   
2233
2234
2235 #define LOG_FLAG_EVENT      1
2236
2237
2238 #define LOG_ARGTYPE_NULL    0
2239 #define LOG_ARGTYPE_STR     1   
2240 #define LOG_ARGTYPE_INT     2   
2241 #define LOG_ARGTYPE_INT_STR 3   
2242 #define LOG_ARGTYPE_STR_INT 4   
2243
2244 typedef struct wlc_extlog_cfg {
2245         int max_number;
2246         uint16 module;  
2247         uint8 level;
2248         uint8 flag;
2249         uint16 version;
2250 } wlc_extlog_cfg_t;
2251
2252 typedef struct log_record {
2253         uint32 time;
2254         uint16 module;
2255         uint16 id;
2256         uint8 level;
2257         uint8 sub_unit;
2258         uint8 seq_num;
2259         int32 arg;
2260         char str[MAX_ARGSTR_LEN];
2261 } log_record_t;
2262
2263 typedef struct wlc_extlog_req {
2264         uint32 from_last;
2265         uint32 num;
2266 } wlc_extlog_req_t;
2267
2268 typedef struct wlc_extlog_results {
2269         uint16 version;
2270         uint16 record_len;
2271         uint32 num;
2272         log_record_t logs[1];
2273 } wlc_extlog_results_t;
2274
2275 typedef struct log_idstr {
2276         uint16  id;
2277         uint16  flag;
2278         uint8   arg_type;
2279         const char  *fmt_str;
2280 } log_idstr_t;
2281
2282 #define FMTSTRF_USER        1
2283
2284
2285 typedef enum {
2286         FMTSTR_DRIVER_UP_ID = 0,
2287         FMTSTR_DRIVER_DOWN_ID = 1,
2288         FMTSTR_SUSPEND_MAC_FAIL_ID = 2,
2289         FMTSTR_NO_PROGRESS_ID = 3,
2290         FMTSTR_RFDISABLE_ID = 4,
2291         FMTSTR_REG_PRINT_ID = 5,
2292         FMTSTR_EXPTIME_ID = 6,
2293         FMTSTR_JOIN_START_ID = 7,
2294         FMTSTR_JOIN_COMPLETE_ID = 8,
2295         FMTSTR_NO_NETWORKS_ID = 9,
2296         FMTSTR_SECURITY_MISMATCH_ID = 10,
2297         FMTSTR_RATE_MISMATCH_ID = 11,
2298         FMTSTR_AP_PRUNED_ID = 12,
2299         FMTSTR_KEY_INSERTED_ID = 13,
2300         FMTSTR_DEAUTH_ID = 14,
2301         FMTSTR_DISASSOC_ID = 15,
2302         FMTSTR_LINK_UP_ID = 16,
2303         FMTSTR_LINK_DOWN_ID = 17,
2304         FMTSTR_RADIO_HW_OFF_ID = 18,
2305         FMTSTR_RADIO_HW_ON_ID = 19,
2306         FMTSTR_EVENT_DESC_ID = 20,
2307         FMTSTR_PNP_SET_POWER_ID = 21,
2308         FMTSTR_RADIO_SW_OFF_ID = 22,
2309         FMTSTR_RADIO_SW_ON_ID = 23,
2310         FMTSTR_PWD_MISMATCH_ID = 24,
2311         FMTSTR_FATAL_ERROR_ID = 25,
2312         FMTSTR_AUTH_FAIL_ID = 26,
2313         FMTSTR_ASSOC_FAIL_ID = 27,
2314         FMTSTR_IBSS_FAIL_ID = 28,
2315         FMTSTR_EXTAP_FAIL_ID = 29,
2316         FMTSTR_MAX_ID
2317 } log_fmtstr_id_t;
2318
2319 #ifdef DONGLEOVERLAYS
2320 typedef struct {
2321         uint32 flags_idx;       
2322         uint32 offset;          
2323         uint32 len;                     
2324         
2325 } wl_ioctl_overlay_t;
2326
2327 #define OVERLAY_IDX_MASK                0x000000ff
2328 #define OVERLAY_IDX_SHIFT               0
2329 #define OVERLAY_FLAGS_MASK              0xffffff00
2330 #define OVERLAY_FLAGS_SHIFT             8
2331
2332 #define OVERLAY_FLAG_POSTLOAD   0x100
2333
2334 #define OVERLAY_FLAG_DEFER_DL   0x200
2335
2336 #define OVERLAY_FLAG_PRESLEEP   0x400
2337
2338 #define OVERLAY_DOWNLOAD_CHUNKSIZE      1024
2339 #endif 
2340
2341
2342 #include <packed_section_end.h>
2343
2344
2345 #include <packed_section_start.h>
2346
2347 #define VNDR_IE_CMD_LEN     4   
2348
2349
2350 #define VNDR_IE_BEACON_FLAG 0x1
2351 #define VNDR_IE_PRBRSP_FLAG 0x2
2352 #define VNDR_IE_ASSOCRSP_FLAG   0x4
2353 #define VNDR_IE_AUTHRSP_FLAG    0x8
2354 #define VNDR_IE_PRBREQ_FLAG 0x10
2355 #define VNDR_IE_ASSOCREQ_FLAG   0x20
2356 #define VNDR_IE_CUSTOM_FLAG 0x100 
2357
2358 #define VNDR_IE_INFO_HDR_LEN    (sizeof(uint32))
2359
2360 typedef BWL_PRE_PACKED_STRUCT struct {
2361         uint32 pktflag;         
2362         vndr_ie_t vndr_ie_data;     
2363 } BWL_POST_PACKED_STRUCT vndr_ie_info_t;
2364
2365 typedef BWL_PRE_PACKED_STRUCT struct {
2366         int iecount;            
2367         vndr_ie_info_t vndr_ie_list[1]; 
2368 } BWL_POST_PACKED_STRUCT vndr_ie_buf_t;
2369
2370 typedef BWL_PRE_PACKED_STRUCT struct {
2371         char cmd[VNDR_IE_CMD_LEN];  
2372         vndr_ie_buf_t vndr_ie_buffer;   
2373 } BWL_POST_PACKED_STRUCT vndr_ie_setbuf_t;
2374
2375
2376
2377 typedef BWL_PRE_PACKED_STRUCT struct sta_prbreq_wps_ie_hdr {
2378         struct ether_addr staAddr;
2379         uint16 ieLen;
2380 } BWL_POST_PACKED_STRUCT sta_prbreq_wps_ie_hdr_t;
2381
2382 typedef BWL_PRE_PACKED_STRUCT struct sta_prbreq_wps_ie_data {
2383         sta_prbreq_wps_ie_hdr_t hdr;
2384         uint8 ieData[1];
2385 } BWL_POST_PACKED_STRUCT sta_prbreq_wps_ie_data_t;
2386
2387 typedef BWL_PRE_PACKED_STRUCT struct sta_prbreq_wps_ie_list {
2388         uint32 totLen;
2389         uint8 ieDataList[1];
2390 } BWL_POST_PACKED_STRUCT sta_prbreq_wps_ie_list_t;
2391
2392
2393 #ifdef WLMEDIA_TXFAILEVENT
2394 typedef BWL_PRE_PACKED_STRUCT struct {
2395         char   dest[ETHER_ADDR_LEN]; 
2396         uint8  prio;            
2397         uint8  flags;           
2398         uint32 tsf_l;           
2399         uint32 tsf_h;           
2400         uint16 rates;           
2401         uint16 txstatus;        
2402 } BWL_POST_PACKED_STRUCT txfailinfo_t;
2403 #endif 
2404
2405 #include <packed_section_end.h>
2406
2407
2408 #define ASSERTLOG_CUR_VER   0x0100
2409 #define MAX_ASSRTSTR_LEN    64
2410
2411 typedef struct assert_record {
2412         uint32 time;
2413         uint8 seq_num;
2414         char str[MAX_ASSRTSTR_LEN];
2415 } assert_record_t;
2416
2417 typedef struct assertlog_results {
2418         uint16 version;
2419         uint16 record_len;
2420         uint32 num;
2421         assert_record_t logs[1];
2422 } assertlog_results_t;
2423
2424 #define LOGRRC_FIX_LEN  8
2425 #define IOBUF_ALLOWED_NUM_OF_LOGREC(type, len) ((len - LOGRRC_FIX_LEN)/sizeof(type))
2426
2427
2428
2429
2430
2431 #define CHANIM_DISABLE  0   
2432 #define CHANIM_DETECT   1   
2433 #define CHANIM_ACT  2   
2434 #define CHANIM_MODE_MAX 2
2435
2436
2437 #define APCS_IOCTL      1
2438 #define APCS_CHANIM     2
2439 #define APCS_CSTIMER    3
2440 #define APCS_BTA        4
2441
2442
2443 #define CHANIM_ACS_RECORD           10
2444
2445
2446 typedef struct {
2447         bool valid;
2448         uint8 trigger;
2449         chanspec_t selected_chspc;
2450         uint32 glitch_cnt;
2451         uint8 ccastats;
2452         uint timestamp;
2453 } chanim_acs_record_t;
2454
2455 typedef struct {
2456         chanim_acs_record_t acs_record[CHANIM_ACS_RECORD];
2457         uint8 count;
2458         uint timestamp;
2459 } wl_acs_record_t;
2460
2461
2462
2463 #define SMFS_VERSION 1
2464
2465 typedef struct wl_smfs_elem {
2466         uint32 count;
2467         uint16 code;  
2468 } wl_smfs_elem_t;
2469
2470 typedef struct wl_smf_stats {
2471         uint32 version;
2472         uint16 length;  
2473         uint8 type;
2474         uint8 codetype;
2475         uint32 ignored_cnt;
2476         uint32 malformed_cnt;
2477         uint32 count_total; 
2478         wl_smfs_elem_t elem[1];
2479 } wl_smf_stats_t;
2480
2481 #define WL_SMFSTATS_FIXED_LEN OFFSETOF(wl_smf_stats_t, elem);
2482
2483 enum {
2484         SMFS_CODETYPE_SC,
2485         SMFS_CODETYPE_RC
2486 };
2487
2488
2489 #define SMFS_CODE_MALFORMED 0xFFFE
2490 #define SMFS_CODE_IGNORED   0xFFFD
2491
2492 typedef enum smfs_type {
2493         SMFS_TYPE_AUTH,
2494         SMFS_TYPE_ASSOC,
2495         SMFS_TYPE_REASSOC,
2496         SMFS_TYPE_DISASSOC_TX,
2497         SMFS_TYPE_DISASSOC_RX,
2498         SMFS_TYPE_DEAUTH_TX,
2499         SMFS_TYPE_DEAUTH_RX,
2500         SMFS_TYPE_MAX
2501 } smfs_type_t;
2502
2503 #ifdef PHYMON
2504
2505 #define PHYMON_VERSION 1
2506
2507 typedef struct wl_phycal_core_state {
2508         
2509         int16 tx_iqlocal_a;
2510         int16 tx_iqlocal_b;
2511         int8 tx_iqlocal_ci;
2512         int8 tx_iqlocal_cq;
2513         int8 tx_iqlocal_di;
2514         int8 tx_iqlocal_dq;
2515         int8 tx_iqlocal_ei;
2516         int8 tx_iqlocal_eq;
2517         int8 tx_iqlocal_fi;
2518         int8 tx_iqlocal_fq;
2519
2520         
2521         int16 rx_iqcal_a;
2522         int16 rx_iqcal_b;
2523
2524         uint8 tx_iqlocal_pwridx; 
2525         uint32 papd_epsilon_table[64]; 
2526         int16 papd_epsilon_offset; 
2527         uint8 curr_tx_pwrindex; 
2528         int8 idle_tssi; 
2529         int8 est_tx_pwr; 
2530         int8 est_rx_pwr; 
2531         uint16 rx_gaininfo; 
2532         uint16 init_gaincode; 
2533         int8 estirr_tx;
2534         int8 estirr_rx;
2535
2536 } wl_phycal_core_state_t;
2537
2538 typedef struct wl_phycal_state {
2539         int version;
2540         int8 num_phy_cores; 
2541         int8 curr_temperature; 
2542         chanspec_t chspec; 
2543         bool aci_state; 
2544         uint16 crsminpower; 
2545         uint16 crsminpowerl; 
2546         uint16 crsminpoweru; 
2547         wl_phycal_core_state_t phycal_core[1];
2548 } wl_phycal_state_t;
2549
2550 #define WL_PHYCAL_STAT_FIXED_LEN OFFSETOF(wl_phycal_state_t, phycal_core)
2551 #endif 
2552
2553 #ifdef WLDSTA
2554 typedef struct wl_dsta_if {
2555         struct ether_addr addr;
2556 } wl_dsta_if_t;
2557 #endif
2558
2559 #ifdef WLP2P
2560
2561 typedef struct wl_p2p_disc_st {
2562         uint8 state;    
2563         chanspec_t chspec;  
2564         uint16 dwell;   
2565 } wl_p2p_disc_st_t;
2566
2567
2568 #define WL_P2P_DISC_ST_SCAN 0
2569 #define WL_P2P_DISC_ST_LISTEN   1
2570 #define WL_P2P_DISC_ST_SEARCH   2
2571
2572
2573 typedef struct wl_p2p_scan {
2574         uint8 type;     
2575         uint8 reserved[3];
2576         
2577 } wl_p2p_scan_t;
2578
2579
2580 typedef struct wl_p2p_if {
2581         struct ether_addr addr;
2582         uint8 type; 
2583         chanspec_t chspec;  
2584 } wl_p2p_if_t;
2585
2586
2587 #define WL_P2P_IF_CLIENT    0
2588 #define WL_P2P_IF_GO        1
2589 #define WL_P2P_IF_DYNBCN_GO     2
2590 #define WL_P2P_IF_DEV       3
2591
2592
2593 typedef struct wl_p2p_ifq {
2594         uint bsscfgidx;
2595         char ifname[BCM_MSG_IFNAME_MAX];
2596 } wl_p2p_ifq_t;
2597
2598
2599 typedef struct wl_p2p_ops {
2600         uint8 ops;  
2601         uint8 ctw;  
2602 } wl_p2p_ops_t;
2603
2604
2605 typedef struct wl_p2p_sched_desc {
2606         uint32 start;
2607         uint32 interval;
2608         uint32 duration;
2609         uint32 count;   
2610 } wl_p2p_sched_desc_t;
2611
2612
2613 #define WL_P2P_SCHED_RSVD   0
2614 #define WL_P2P_SCHED_REPEAT 255 
2615
2616 typedef struct wl_p2p_sched {
2617         uint8 type; 
2618         uint8 action;   
2619         uint8 option;   
2620         wl_p2p_sched_desc_t desc[1];
2621 } wl_p2p_sched_t;
2622 #define WL_P2P_SCHED_FIXED_LEN      3
2623
2624
2625 #define WL_P2P_SCHED_TYPE_ABS       0   
2626 #define WL_P2P_SCHED_TYPE_REQ_ABS   1   
2627
2628
2629 #define WL_P2P_SCHED_ACTION_NONE    0   
2630 #define WL_P2P_SCHED_ACTION_DOZE    1   
2631
2632 #define WL_P2P_SCHED_ACTION_GOOFF   2   
2633
2634 #define WL_P2P_SCHED_ACTION_RESET   255 
2635
2636
2637 #define WL_P2P_SCHED_OPTION_NORMAL  0   
2638 #define WL_P2P_SCHED_OPTION_BCNPCT  1   
2639
2640 #define WL_P2P_SCHED_OPTION_TSFOFS  2   
2641
2642
2643 #define WL_P2P_FEAT_GO_CSA      (1 << 0)        
2644 #define WL_P2P_FEAT_GO_NOLEGACY (1 << 1)        
2645 #define WL_P2P_FEAT_RESTRICT_DEV_RESP (1 << 2)  
2646 #endif 
2647
2648
2649 #define BCM_ACTION_RFAWARE      0x77
2650 #define BCM_ACTION_RFAWARE_DCS  0x01
2651
2652
2653
2654 #define WL_11N_2x2          1
2655 #define WL_11N_3x3          3
2656 #define WL_11N_4x4          4
2657
2658
2659 #define WLFEATURE_DISABLE_11N       0x00000001
2660 #define WLFEATURE_DISABLE_11N_STBC_TX   0x00000002
2661 #define WLFEATURE_DISABLE_11N_STBC_RX   0x00000004
2662 #define WLFEATURE_DISABLE_11N_SGI_TX    0x00000008
2663 #define WLFEATURE_DISABLE_11N_SGI_RX    0x00000010
2664 #define WLFEATURE_DISABLE_11N_AMPDU_TX  0x00000020
2665 #define WLFEATURE_DISABLE_11N_AMPDU_RX  0x00000040
2666 #define WLFEATURE_DISABLE_11N_GF    0x00000080
2667
2668
2669 #define LQ_IDX_LAST             3
2670 #define MCS_INDEX_SIZE          33
2671
2672 #define LQ_IDX_MIN              0
2673 #define LQ_IDX_MAX              1
2674 #define LQ_IDX_AVG              2
2675 #define LQ_IDX_SUM              2
2676 #define LQ_IDX_LAST             3
2677 #define LQ_STOP_MONITOR         0
2678 #define LQ_START_MONITOR        1
2679
2680 #define LINKQUAL_V1     0x01
2681
2682 struct  wl_lq {
2683         int32 enable;
2684         int32 rssi[LQ_IDX_LAST];    
2685         int32 rssicnt;
2686         int32 snr[LQ_IDX_LAST];     
2687         uint32 nsamples;            
2688         uint8 isvalid;              
2689         uint8 version;
2690 }; 
2691
2692 typedef struct wl_lq wl_lq_t;
2693 typedef struct wl_lq  wl_lq_stats_t;
2694
2695 typedef struct {
2696         struct  ether_addr ea;  
2697         uint8   ac_cat; 
2698         uint8   num_pkts;   
2699 } wl_mac_ratehisto_cmd_t;   
2700
2701
2702 typedef struct {
2703         uint32  rate[WLC_MAXRATE + 1];  
2704         uint32  mcs_index[MCS_INDEX_SIZE];  
2705         uint32  tsf_timer[2][2];    
2706 } wl_mac_ratehisto_res_t;   
2707
2708 #ifdef PROP_TXSTATUS
2709
2710
2711 #define WLFC_FLAGS_RSSI_SIGNALS                         1
2712
2713
2714 #define WLFC_FLAGS_XONXOFF_SIGNALS                      2
2715
2716
2717 #define WLFC_FLAGS_CREDIT_STATUS_SIGNALS        4
2718
2719 #define WLFC_FLAGS_HOST_PROPTXSTATUS_ACTIVE     8
2720 #define WLFC_FLAGS_PSQ_GENERATIONFSM_ENABLE     16
2721 #define WLFC_FLAGS_PSQ_ZERO_BUFFER_ENABLE       32
2722 #endif 
2723
2724 #define BTA_STATE_LOG_SZ    64
2725
2726
2727 enum {
2728         HCIReset = 1,
2729         HCIReadLocalAMPInfo,
2730         HCIReadLocalAMPASSOC,
2731         HCIWriteRemoteAMPASSOC,
2732         HCICreatePhysicalLink,
2733         HCIAcceptPhysicalLinkRequest,
2734         HCIDisconnectPhysicalLink,
2735         HCICreateLogicalLink,
2736         HCIAcceptLogicalLink,
2737         HCIDisconnectLogicalLink,
2738         HCILogicalLinkCancel,
2739         HCIAmpStateChange,
2740         HCIWriteLogicalLinkAcceptTimeout
2741 };
2742
2743 typedef struct flush_txfifo {
2744         uint32 txfifobmp;
2745         uint32 hwtxfifoflush;
2746         struct ether_addr ea;
2747 } flush_txfifo_t;
2748
2749 #define CHANNEL_5G_LOW_START    36      
2750 #define CHANNEL_5G_MID_START    52      
2751 #define CHANNEL_5G_HIGH_START   100     
2752 #define CHANNEL_5G_UPPER_START  149     
2753
2754 enum {
2755         SPATIAL_MODE_2G_IDX = 0,
2756         SPATIAL_MODE_5G_LOW_IDX,
2757         SPATIAL_MODE_5G_MID_IDX,
2758         SPATIAL_MODE_5G_HIGH_IDX,
2759         SPATIAL_MODE_5G_UPPER_IDX,
2760         SPATIAL_MODE_MAX_IDX
2761 };
2762
2763 #endif