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