1 /*
2  * Copyright 2023, Cypress Semiconductor Corporation (an Infineon company)
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 /*
18  * Custom OID/ioctl definitions for
19  * 802.11abg Networking Device Driver
20  */
21 #ifndef INCLUDED_WHD_WLIOCTL_H
22 #define INCLUDED_WHD_WLIOCTL_H
23 
24 #ifdef __cplusplus
25 extern "C"
26 {
27 #endif
28 /* These are the flags in the BSS Capability Information field as defined in section 7.3.1.4 of IEEE Std 802.11-2007  */
29 #define DOT11_CAP_ESS                     (0x0001)     /** Extended service set capability */
30 #define DOT11_CAP_IBSS                    (0x0002)     /** Ad-hoc capability (Independent Basic Service Set) */
31 #define DOT11_CAP_PRIVACY                 (0x0010)     /** Privacy subfield - indicates data confidentiality is required for all data frames exchanged */
32 
33 #define CH_MAX_2G_CHANNEL       (14)      /* Max channel in 2G band */
34 #define MAX_WFDS_SVC_NAME_LEN   (200)     /* maximum service_name length */
35 
36 #define MGMT_AUTH_FRAME_DWELL_TIME (100) /* Default Dwell Time(Let FW MSCH have enough left time to piggyback this "mgmt_frame" request within "join" request) */
37 
38 #define ACTION_FRAME_SIZE 1040
39 typedef uint16_t chanspec_t;
40 #define    ETHER_ADDR_LEN        6
41 
42 typedef struct ether_addr
43 {
44     uint8_t octet[ETHER_ADDR_LEN];
45 } wl_ether_addr_t;
46 struct wl_ether_header
47 {
48     uint8_t ether_dhost[ETHER_ADDR_LEN];
49     uint8_t ether_shost[ETHER_ADDR_LEN];
50     uint16_t ether_type;
51 };
52 typedef struct wl_action_frame
53 {
54     wl_ether_addr_t da;
55     uint16_t len;
56     uint32_t packetId;
57     uint8_t data[ACTION_FRAME_SIZE];
58 } wl_action_frame_t;
59 
60 typedef struct wl_af_params
61 {
62     uint32_t channel;
63     int32_t dwell_time;
64     struct ether_addr BSSID;
65     wl_action_frame_t action_frame;
66 } wl_af_params_t;
67 
68 typedef struct wl_rx_mgmt_data
69 {
70     uint16_t version;
71     uint16_t channel;
72     int32_t rssi;
73     uint32_t mactime;
74     uint32_t rate;
75 } wl_rx_mgmt_data_t;
76 
77 #define WL_WIFI_AF_PARAMS_SIZE sizeof(struct wl_af_params)
78 
79 /* External Auth Code Type(SAE) */
80 #define WL_EXTAUTH_START      1
81 #define WL_EXTAUTH_ABORT      2
82 #define WL_EXTAUTH_FAIL       3
83 #define WL_EXTAUTH_SUCCESS    4
84 
85 typedef struct whd_xtlv
86 {
87     uint16_t id;
88     uint16_t len;
89     uint8_t data[1];
90 } whd_xtlv_t;
91 
92 /* ether types */
93 #define ETHER_TYPE_LEN      2
94 #define ETHER_TYPE_MIN      0x0600      /* Anything less than MIN is a length */
95 #define ETHER_TYPE_IP       0x0800      /* IP */
96 #define ETHER_TYPE_ARP      0x0806      /* ARP */
97 #define ETHER_TYPE_8021Q    0x8100      /* 802.1Q */
98 #define ETHER_TYPE_802_1X   0x888e      /* 802.1x */
99 #define ETHER_TYPE_WAI      0x88b4      /* WAPI WAI */
100 #define ETHER_TYPE_802_1X_PREAUTH 0x88c7    /* 802.1x preauthentication */
101 #define WL_WIFI_ACTION_FRAME_SIZE sizeof(struct wl_action_frame)
102 #define BWL_DEFAULT_PACKING
103 
104 #define RWL_ACTION_WIFI_CATEGORY    127
105 #define RWL_WIFI_OUI_BYTE1        0x90
106 #define RWL_WIFI_OUI_BYTE2        0x4C
107 #define RWL_WIFI_OUI_BYTE3        0x0F
108 #define RWL_WIFI_ACTION_FRAME_SIZE    sizeof(struct dot11_action_wifi_vendor_specific)
109 #define RWL_WIFI_DEFAULT                0x00
110 #define RWL_WIFI_FIND_MY_PEER        0x09
111 #define RWL_WIFI_FOUND_PEER        0x0A
112 #define RWL_ACTION_WIFI_FRAG_TYPE    0x55
113 
114 typedef struct ssid_info
115 {
116     uint8_t ssid_len;
117     uint8_t ssid[32];
118 } ssid_info_t;
119 typedef struct cnt_rx
120 {
121     uint32_t cnt_rxundec;
122     uint32_t cnt_rxframe;
123 } cnt_rx_t;
124 #define RWL_REF_MAC_ADDRESS_OFFSET    17
125 #define RWL_DUT_MAC_ADDRESS_OFFSET    23
126 #define RWL_WIFI_CLIENT_CHANNEL_OFFSET    50
127 #define RWL_WIFI_SERVER_CHANNEL_OFFSET    51
128 #define WL_BSS_INFO_VERSION    109
129 #define MCSSET_LEN    16
130 
131 typedef struct wlc_ssid
132 {
133     uint32_t SSID_len;
134     uint8_t SSID[32];
135 } wlc_ssid_t;
136 #define WL_BSSTYPE_INFRA 1
137 #define WL_BSSTYPE_INDEP 0
138 #define WL_BSSTYPE_ANY   2
139 #define WL_SCANFLAGS_PASSIVE 0x01
140 #define WL_SCANFLAGS_PROHIBITED    0x04
141 typedef struct wl_scan_params
142 {
143     wlc_ssid_t ssid;
144     wl_ether_addr_t bssid;
145     int8_t bss_type;
146     int8_t scan_type;
147     int32_t nprobes;
148     int32_t active_time;
149     int32_t passive_time;
150     int32_t home_time;
151     int32_t channel_num;
152     uint16_t channel_list[1];
153 } wl_scan_params_t;
154 #define WL_SCAN_PARAMS_FIXED_SIZE          (64)
155 #define WL_SCAN_PARAMS_COUNT_MASK  (0x0000ffff)
156 #define WL_SCAN_PARAMS_NSSID_SHIFT         (16)
157 #define WL_SCAN_ACTION_START                (1)
158 #define WL_SCAN_ACTION_CONTINUE             (2)
159 #define WL_SCAN_ACTION_ABORT                (3)
160 #define ISCAN_REQ_VERSION                   (1)
161 typedef struct wl_iscan_params
162 {
163     uint32_t version;
164     uint16_t action;
165     uint16_t scan_duration;
166     wl_scan_params_t params;
167 } wl_iscan_params_t;
168 #define WL_ISCAN_PARAMS_FIXED_SIZE (offsetof(wl_iscan_params_t, params) + sizeof(wlc_ssid_t) )
169 typedef struct wl_scan_results
170 {
171     uint32_t buflen;
172     uint32_t version;
173     uint32_t count;
174     wl_bss_info_t bss_info[1];
175 } wl_scan_results_t;
176 #define WL_SCAN_RESULTS_FIXED_SIZE  (12)
177 #define WL_SCAN_RESULTS_SUCCESS         (0)
178 #define WL_SCAN_RESULTS_PARTIAL         (1)
179 #define WL_SCAN_RESULTS_PENDING         (2)
180 #define WL_SCAN_RESULTS_ABORTED         (3)
181 #define WL_SCAN_RESULTS_NO_MEM         (4)
182 #define ESCAN_REQ_VERSION 1
183 typedef struct wl_escan_params
184 {
185     uint32_t version;
186     uint16_t action;
187     uint16_t sync_id;
188     wl_scan_params_t params;
189 } wl_escan_params_t;
190 #define WL_ESCAN_PARAMS_FIXED_SIZE (offsetof(wl_escan_params_t, params) + sizeof(wlc_ssid_t) )
191 typedef struct wl_escan_result
192 {
193     uint32_t buflen;
194     uint32_t version;
195     uint16_t sync_id;
196     uint16_t bss_count;
197     wl_bss_info_t bss_info[1];
198 } wl_escan_result_t;
199 #define WL_ESCAN_RESULTS_FIXED_SIZE (sizeof(wl_escan_result_t) - sizeof(wl_bss_info_t) )
200 typedef struct wl_iscan_results
201 {
202     uint32_t status;
203     wl_scan_results_t results;
204 } wl_iscan_results_t;
205 #define WL_ISCAN_RESULTS_FIXED_SIZE \
206     (WL_SCAN_RESULTS_FIXED_SIZE + offsetof(wl_iscan_results_t, results) )
207 #define WL_MAXRATES_IN_SET      16  /* max # of rates in a rateset */
208 typedef struct wl_rateset
209 {
210     uint32_t count;     /* # rates in this set */
211     uint8_t rates[WL_MAXRATES_IN_SET];     /* rates in 500kbps units w/hi bit set if basic */
212 } wl_rateset_t;
213 
214 typedef struct wl_rateset_args
215 {
216     uint32_t count;     /* # rates in this set */
217     uint8_t rates[WL_MAXRATES_IN_SET];     /* rates in 500kbps units w/hi bit set if basic */
218     uint8_t mcs[WL_MAXRATES_IN_SET];     /* supported mcs index bit map */
219 } wl_rateset_args_t;
220 
221 #define WL_RSPEC_RATE_MASK      0x000000FF      /* rate or HT MCS value */
222 #define WL_RSPEC_VHT_MCS_MASK   0x0000000F      /* VHT MCS value */
223 #define WL_RSPEC_VHT_NSS_MASK   0x000000F0      /* VHT Nss value */
224 #define WL_RSPEC_VHT_NSS_SHIFT  4               /* VHT Nss value shift */
225 #define WL_RSPEC_TXEXP_MASK     0x00000300
226 #define WL_RSPEC_TXEXP_SHIFT    8
227 #define WL_RSPEC_BW_MASK        0x00070000      /* bandwidth mask */
228 #define WL_RSPEC_BW_SHIFT       16              /* bandwidth shift */
229 #define WL_RSPEC_STBC           0x00100000      /* STBC encoding, Nsts = 2 x Nss */
230 #define WL_RSPEC_TXBF           0x00200000      /* bit indicates TXBF mode */
231 #define WL_RSPEC_LDPC           0x00400000      /* bit indicates adv coding in use */
232 #define WL_RSPEC_SGI            0x00800000      /* Short GI mode */
233 #define WL_RSPEC_ENCODING_MASK  0x03000000      /* Encoding of Rate/MCS field */
234 #define WL_RSPEC_OVERRIDE_RATE  0x40000000      /* bit indicate to override mcs only */
235 #define WL_RSPEC_OVERRIDE_MODE  0x80000000      /* bit indicates override both rate & mode */
236 #define WL_RSPEC_BW_UNSPECIFIED 0
237 #define WL_RSPEC_BW_20MHZ       0x00010000
238 #define WL_RSPEC_BW_40MHZ       0x00020000
239 #define WL_RSPEC_BW_80MHZ       0x00030000
240 #define WL_RSPEC_BW_160MHZ      0x00040000
241 #define WL_RSPEC_BW_10MHZ       0x00050000
242 #define WL_RSPEC_BW_5MHZ        0x00060000
243 #define WL_RSPEC_BW_2P5MHZ      0x00070000
244 #define WL_RSPEC_ENCODE_RATE    0x00000000      /* Legacy rate is stored in RSPEC_RATE_MASK */
245 #define WL_RSPEC_ENCODE_HT      0x01000000      /* HT MCS is stored in RSPEC_RATE_MASK */
246 #define WL_RSPEC_ENCODE_VHT     0x02000000      /* VHT MCS and Nss is stored in RSPEC_RATE_MASK */
247 
248 typedef struct wl_uint32_list
249 {
250     uint32_t count;
251     uint32_t element[1];
252 } wl_uint32_list_t;
253 
254 typedef struct wl_join_scan_params
255 {
256     uint8_t scan_type;     /* 0 use default, active or passive scan */
257     int32_t nprobes;     /* -1 use default, number of probes per channel */
258     int32_t active_time;     /* -1 use default, dwell time per channel for
259                               * active scanning
260                               */
261     int32_t passive_time;     /* -1 use default, dwell time per channel
262                                * for passive scanning
263                                */
264     int32_t home_time;     /* -1 use default, dwell time for the home channel
265                             * between channel scans
266                             */
267 } wl_join_scan_params_t;
268 
269 #define NRATE_MCS_INUSE            (0x00000080)
270 #define NRATE_RATE_MASK         (0x0000007f)
271 #define NRATE_STF_MASK            (0x0000ff00)
272 #define NRATE_STF_SHIFT                     (8)
273 #define NRATE_OVERRIDE            (0x80000000)
274 #define NRATE_OVERRIDE_MCS_ONLY   (0x40000000)
275 #define NRATE_SGI_MASK          (0x00800000)
276 #define NRATE_SGI_SHIFT                 (23)
277 #define NRATE_LDPC_CODING       (0x00400000)
278 #define NRATE_LDPC_SHIFT                (22)
279 #define NRATE_BCMC_OVERRIDE     (0x00200000)
280 #define NRATE_BCMC_SHIFT                (21)
281 #define NRATE_STF_SISO                     (0)
282 #define NRATE_STF_CDD                     (1)
283 #define NRATE_STF_STBC                     (2)
284 #define NRATE_STF_SDM                     (3)
285 #define ANTENNA_NUM_1                     (1)
286 #define ANTENNA_NUM_2                     (2)
287 #define ANTENNA_NUM_3                     (3)
288 #define ANTENNA_NUM_4                     (4)
289 #define ANT_SELCFG_AUTO                  (0x80)
290 #define ANT_SELCFG_MASK                  (0x33)
291 #define ANT_SELCFG_MAX                     (4)
292 #define ANT_SELCFG_TX_UNICAST             (0)
293 #define ANT_SELCFG_RX_UNICAST             (1)
294 #define ANT_SELCFG_TX_DEF                 (2)
295 #define ANT_SELCFG_RX_DEF                 (3)
296 typedef struct
297 {
298     uint8_t ant_config[ANT_SELCFG_MAX];
299     uint8_t num_antcfg;
300 } wlc_antselcfg_t;
301 #define HIGHEST_SINGLE_STREAM_MCS    (7)
302 #define WLC_CNTRY_BUF_SZ    (4)
303 typedef struct wl_country
304 {
305     char country_abbrev[WLC_CNTRY_BUF_SZ];
306     int32_t rev;
307     char ccode[WLC_CNTRY_BUF_SZ];
308 } wl_country_t;
309 typedef struct wl_channels_in_country
310 {
311     uint32_t buflen;
312     uint32_t band;
313     int8_t country_abbrev[WLC_CNTRY_BUF_SZ];
314     uint32_t count;
315     uint32_t channel[1];
316 } wl_channels_in_country_t;
317 typedef struct wl_country_list
318 {
319     uint32_t buflen;
320     uint32_t band_set;
321     uint32_t band;
322     uint32_t count;
323     int8_t country_abbrev[1];
324 } wl_country_list_t;
325 #define WL_NUM_RPI_BINS        8
326 #define WL_RM_TYPE_BASIC    1
327 #define WL_RM_TYPE_CCA        2
328 #define WL_RM_TYPE_RPI        3
329 #define WL_RM_FLAG_PARALLEL    (1 << 0)
330 #define WL_RM_FLAG_LATE        (1 << 1)
331 #define WL_RM_FLAG_INCAPABLE    (1 << 2)
332 #define WL_RM_FLAG_REFUSED    (1 << 3)
333 typedef struct wl_rm_req_elt
334 {
335     int8_t type;
336     int8_t flags;
337     wl_chanspec_t chanspec;
338     uint32_t token;
339     uint32_t tsf_h;
340     uint32_t tsf_l;
341     uint32_t dur;
342 } wl_rm_req_elt_t;
343 typedef struct wl_rm_req
344 {
345     uint32_t token;
346     uint32_t count;
347     void *cb;
348     void *cb_arg;
349     wl_rm_req_elt_t req[1];
350 } wl_rm_req_t;
351 #define WL_RM_REQ_FIXED_LEN    offsetof(wl_rm_req_t, req)
352 typedef struct wl_rm_rep_elt
353 {
354     int8_t type;
355     int8_t flags;
356     wl_chanspec_t chanspec;
357     uint32_t token;
358     uint32_t tsf_h;
359     uint32_t tsf_l;
360     uint32_t dur;
361     uint32_t len;
362     uint8_t data[1];
363 } wl_rm_rep_elt_t;
364 #define WL_RM_REP_ELT_FIXED_LEN    24
365 #define WL_RPI_REP_BIN_NUM 8
366 typedef struct wl_rm_rpi_rep
367 {
368     uint8_t rpi[WL_RPI_REP_BIN_NUM];
369     int8_t rpi_max[WL_RPI_REP_BIN_NUM];
370 } wl_rm_rpi_rep_t;
371 typedef struct wl_rm_rep
372 {
373     uint32_t token;
374     uint32_t len;
375     wl_rm_rep_elt_t rep[1];
376 } wl_rm_rep_t;
377 #define WL_RM_REP_FIXED_LEN    8
378 #define    CRYPTO_ALGO_OFF            0
379 #define    CRYPTO_ALGO_WEP1        1
380 #define    CRYPTO_ALGO_TKIP        2
381 #define    CRYPTO_ALGO_WEP128        3
382 #define CRYPTO_ALGO_AES_CCM        4
383 #define CRYPTO_ALGO_AES_OCB_MSDU    5
384 #define CRYPTO_ALGO_AES_OCB_MPDU    6
385 #define CRYPTO_ALGO_NALG        7
386 #define WSEC_GEN_MIC_ERROR    0x0001
387 #define WSEC_GEN_REPLAY        0x0002
388 #define WSEC_GEN_ICV_ERROR    0x0004
389 #define WL_SOFT_KEY    (1 << 0)
390 #define WL_PRIMARY_KEY    (1 << 1)
391 #define WL_KF_RES_4    (1 << 4)
392 #define WL_KF_RES_5    (1 << 5)
393 #define WL_IBSS_PEER_GROUP_KEY    (1 << 6)
394 #define DOT11_MAX_KEY_SIZE    32
395 typedef struct wl_wsec_key
396 {
397     uint32_t index;
398     uint32_t len;
399     uint8_t data[DOT11_MAX_KEY_SIZE];
400     uint32_t pad_1[18];
401     uint32_t algo;
402     uint32_t flags;
403     uint32_t pad_2[2];
404     int32_t pad_3;
405     int32_t iv_initialized;
406     int32_t pad_4;
407     struct
408     {
409         uint32_t hi;
410         uint16_t lo;
411     } rxiv;
412     uint32_t pad_5[2];
413     wl_ether_addr_t ea;
414 } wl_wsec_key_t;
415 #define WSEC_MIN_PSK_LEN    8
416 #define WSEC_MAX_PSK_LEN    64
417 #define WSEC_PMK_LEN        32
418 #define WSEC_PASSPHRASE        (1 << 0)
419 typedef struct
420 {
421     uint16_t key_len;
422     uint16_t flags;
423     uint8_t key[WSEC_MAX_PSK_LEN + 1];
424 } wsec_pmk_t;
425 
426 #define WSEC_MAX_SAE_PASSWORD_LEN      128
427 typedef struct
428 {
429     uint16_t password_len;     /* octets in key materials  */
430     uint8_t password[WSEC_MAX_SAE_PASSWORD_LEN];     /* maximum key len for SAE passphrase */
431 } wsec_sae_password_t;
432 
433 #define OPEN_AUTH                   0x0000
434 #define SHARED_AUTH                 0x0001
435 //#define WEP_ENABLED                 0x0001  // moved to whd_types.h
436 //#define TKIP_ENABLED                0x0002
437 //#define AES_ENABLED                 0x0004
438 
439 typedef enum
440 {
441     AUTH_ALGO_80211_OPEN = 1, AUTH_ALGO_80211_SHARED_KEY = 2, AUTH_ALGO_WPA = 3, AUTH_ALGO_WPA_PSK = 4,
442     AUTH_ALGO_WPA_NONE = 5, AUTH_ALGO_RSNA = 6, AUTH_ALGO_RSNA_PSK = 7,
443 } AUTH_ALGORITHM;
444 
445 #define WSEC_SWFLAG                 0x0008
446 #define CKIP_KP_ENABLED             0x0010
447 #define CKIP_MIC_ENABLED            0x0020
448 #define SES_OW_ENABLED              0x0040
449 #define FIPS_ENABLED                0x0080
450 #define SMS4_ENABLED                0x0100
451 
452 #define MFP_NONE                    0x0000
453 #define MFP_CAPABLE                 0x0200
454 #define MFP_REQUIRED                0x0400
455 #define MFP_SHA256                  0x0800 /* a special configuration for STA for WIFI test tool */
456 
457 #define WPA_AUTH_DISABLED           0x0000
458 #define WPA_AUTH_NONE               0x0001
459 #define WPA_AUTH_UNSPECIFIED        0x0002
460 #define WPA_AUTH_PSK                0x0004
461 #define WPA_AUTH_CCKM               0x0008
462 #define WPA2_AUTH_CCKM              0x0010
463 #define WPA2_AUTH_UNSPECIFIED       0x0040
464 #define WPA2_AUTH_PSK               0x0080
465 #define BRCM_AUTH_PSK               0x0100
466 #define BRCM_AUTH_DPT               0x0200
467 #define WPA_AUTH_WAPI               0x0400
468 #define WPA2_AUTH_MFP           0x1000  /* MFP (11w) in contrast to CCX */
469 
470 #define WPA2_AUTH_1X_SHA256     0x1000  /* 1X with SHA256 key derivation */
471 #define WPA2_AUTH_TPK           0x2000  /* TDLS Peer Key */
472 #define WPA2_AUTH_FT            0x4000  /* Fast Transition. */
473 #define WPA2_AUTH_PSK_SHA256    0x8000  /* PSK with SHA256 key derivation */
474 #define WPA2_AUTH_FILS_SHA256   0x10000 /* FILS with SHA256 key derivation */
475 #define WPA2_AUTH_FILS_SHA384   0x20000 /* FILS with SHA384 key derivation */
476 #define WPA2_AUTH_IS_FILS(auth) ( (auth) & (WPA2_AUTH_FILS_SHA256 | WPA2_AUTH_FILS_SHA384) )
477 #define WPA3_AUTH_SAE_PSK       0x40000 /* SAE authentication with SHA-256 */
478 #define WPA3_AUTH_SAE_FBT       0x80000 /* FT authentication over SAE */
479 #define WPA3_AUTH_OWE           0x100000  /* OWE */
480 #define WPA_AUTH_PFN_ANY        0xffffffff  /* for PFN, match only ssid */
481 
482 #define    MAXPMKID                 16
483 
484 typedef struct _pmkid_cand
485 {
486     wl_ether_addr_t BSSID;
487     uint8_t preauth;
488 } pmkid_cand_t;
489 typedef struct _pmkid_cand_list
490 {
491     uint32_t npmkid_cand;
492     pmkid_cand_t pmkid_cand[1];
493 } pmkid_cand_list_t;
494 typedef struct wl_led_info
495 {
496     uint32_t index;
497     uint32_t behavior;
498     uint8_t activehi;
499 } wl_led_info_t;
500 struct wl_dot11_assoc_req
501 {
502     uint16_t capability;
503     uint16_t listen;
504 };
505 struct wl_dot11_assoc_resp
506 {
507     uint16_t capability;
508     uint16_t status;
509     uint16_t aid;
510 };
511 typedef struct wl_assoc_info
512 {
513     uint32_t req_len;
514     uint32_t resp_len;
515     uint32_t flags;
516     struct wl_dot11_assoc_req req;
517     wl_ether_addr_t reassoc_bssid;
518     struct wl_dot11_assoc_resp resp;
519 } wl_assoc_info_t;
520 #define WLC_ASSOC_REQ_IS_REASSOC 0x01
521 typedef struct
522 {
523     uint32_t byteoff;
524     uint32_t nbytes;
525     uint16_t buf[1];
526 } srom_rw_t;
527 typedef struct
528 {
529     uint32_t source;
530     uint32_t byteoff;
531     uint32_t nbytes;
532 } cis_rw_t;
533 #define WLC_CIS_DEFAULT    0
534 #define WLC_CIS_SROM    1
535 #define WLC_CIS_OTP    2
536 typedef struct
537 {
538     uint32_t byteoff;
539     uint32_t val;
540     uint32_t size;
541     uint32_t band;
542 } rw_reg_t;
543 #define WL_ATTEN_APP_INPUT_PCL_OFF    0
544 #define WL_ATTEN_PCL_ON            1
545 #define WL_ATTEN_PCL_OFF        2
546 typedef struct
547 {
548     uint16_t auto_ctrl;
549     uint16_t bb;
550     uint16_t radio;
551     uint16_t txctl1;
552 } atten_t;
553 struct wme_tx_params_s
554 {
555     uint8_t short_retry;
556     uint8_t short_fallback;
557     uint8_t long_retry;
558     uint8_t long_fallback;
559     uint16_t max_rate;
560 };
561 typedef struct wme_tx_params_s wme_tx_params_t;
562 #define WL_WME_TX_PARAMS_IO_BYTES (sizeof(wme_tx_params_t) * AC_COUNT)
563 #define WL_PWRIDX_PCL_OFF    -2
564 #define WL_PWRIDX_PCL_ON    -1
565 #define WL_PWRIDX_LOWER_LIMIT    -2
566 #define WL_PWRIDX_UPPER_LIMIT    63
567 typedef struct
568 {
569     uint32_t val;
570     wl_ether_addr_t ea;
571 } scb_val_t;
572 #define BCM_MAC_STATUS_INDICATION    (0x40010200L)
573 typedef struct
574 {
575     uint16_t ver;
576     uint16_t len;
577     uint16_t cap;
578     uint32_t flags;
579     uint32_t idle;
580     wl_ether_addr_t ea;
581     wl_rateset_t rateset;
582     uint32_t in;
583     uint32_t listen_interval_inms;
584     uint32_t tx_pkts;
585     uint32_t tx_failures;
586     uint32_t rx_ucast_pkts;
587     uint32_t rx_mcast_pkts;
588     uint32_t tx_rate;
589     uint32_t rx_rate;
590 } sta_info_t;
591 #define WL_OLD_STAINFO_SIZE    offsetof(sta_info_t, tx_pkts)
592 #define WL_STA_VER        2
593 #define WL_STA_BRCM        0x1
594 #define WL_STA_WME        0x2
595 #define WL_STA_ABCAP        0x4
596 #define WL_STA_AUTHE        0x8
597 #define WL_STA_ASSOC        0x10
598 #define WL_STA_AUTHO        0x20
599 #define WL_STA_WDS        0x40
600 #define WL_STA_WDS_LINKUP    0x80
601 #define WL_STA_PS        0x100
602 #define WL_STA_APSD_BE        0x200
603 #define WL_STA_APSD_BK        0x400
604 #define WL_STA_APSD_VI        0x800
605 #define WL_STA_APSD_VO        0x1000
606 #define WL_STA_N_CAP        0x2000
607 #define WL_STA_SCBSTATS        0x4000
608 #define WL_WDS_LINKUP        WL_STA_WDS_LINKUP
609 typedef struct channel_info
610 {
611     int32_t hw_channel;
612     int32_t target_channel;
613     int32_t scan_channel;
614 } channel_info_t;
615 struct mac_list
616 {
617     uint32_t count;
618     wl_ether_addr_t ea[1];
619 };
620 typedef struct get_pktcnt
621 {
622     uint32_t rx_good_pkt;
623     uint32_t rx_bad_pkt;
624     uint32_t tx_good_pkt;
625     uint32_t tx_bad_pkt;
626     uint32_t rx_ocast_good_pkt;
627 } get_pktcnt_t;
628 typedef struct wl_ioctl
629 {
630     uint32_t cmd;
631     void *buf;
632     uint32_t len;
633     uint8_t set;
634     uint32_t used;
635     uint32_t needed;
636 } wl_ioctl_t;
637 typedef struct wlc_rev_info
638 {
639     uint32_t vendorid;
640     uint32_t deviceid;
641     uint32_t radiorev;
642     uint32_t chiprev;
643     uint32_t corerev;
644     uint32_t boardid;
645     uint32_t boardvendor;
646     uint32_t boardrev;
647     uint32_t driverrev;
648     uint32_t ucoderev;
649     uint32_t bus;
650     uint32_t chipnum;
651     uint32_t phytype;
652     uint32_t phyrev;
653     uint32_t anarev;
654 } wlc_rev_info_t;
655 #define WL_REV_INFO_LEGACY_LENGTH    48
656 #define WL_BRAND_MAX 10
657 typedef struct wl_instance_info
658 {
659     uint32_t instance;
660     int8_t brand[WL_BRAND_MAX];
661 } wl_instance_info_t;
662 typedef struct wl_txfifo_sz
663 {
664     uint8_t fifo;
665     uint8_t size;
666 } wl_txfifo_sz_t;
667 #define WLC_IOV_NAME_LEN 30
668 typedef struct wlc_iov_trx_s
669 {
670     uint8_t module;
671     uint8_t type;
672     int8_t name[WLC_IOV_NAME_LEN];
673 } wlc_iov_trx_t;
674 
675 /* Event mask ext support */
676 typedef enum event_msgs_ext_command
677 {
678     EVENTMSGS_NONE = 0, EVENTMSGS_SET_BIT = 1, EVENTMSGS_RESET_BIT = 2, EVENTMSGS_SET_MASK = 3
679 } event_msgs_ext_command_t;
680 
681 #define EVENTMSGS_VER 1
682 
683 /* len- for SET it would be mask size from the application to the firmware */
684 /*      for GET it would be actual firmware mask size */
685 /* maxgetsize - is only used for GET. indicate max mask size that the */
686 /*              application can read from the firmware */
687 typedef struct eventmsgs_ext
688 {
689     uint8_t ver;
690     uint8_t command;
691     uint8_t len;
692     uint8_t maxgetsize;
693     uint8_t mask[1];
694 } eventmsgs_ext_t;
695 
696 #define IOVAR_STR_BTADDR                 "bus:btsdiobufaddr"
697 #define IOVAR_STR_ACTFRAME               "actframe"
698 #define IOVAR_STR_BSS                    "bss"
699 #define IOVAR_STR_BSS_RATESET            "bss_rateset"
700 #define IOVAR_STR_CSA                    "csa"
701 #define IOVAR_STR_AMPDU_TID              "ampdu_tid"
702 #define IOVAR_STR_APSTA                  "apsta"
703 #define IOVAR_STR_ALLMULTI               "allmulti"
704 #define IOVAR_STR_COUNTRY                "country"
705 #define IOVAR_STR_EVENT_MSGS             "event_msgs"
706 #define IOVAR_STR_EVENT_MSGS_EXT         "event_msgs_ext"
707 #define IOVAR_STR_ESCAN                  "escan"
708 #define IOVAR_STR_SUP_WPA                "sup_wpa"
709 #define IOVAR_STR_CUR_ETHERADDR          "cur_etheraddr"
710 #define IOVAR_STR_QTXPOWER               "qtxpower"
711 #define IOVAR_STR_MCAST_LIST             "mcast_list"
712 #define IOVAR_STR_PM2_SLEEP_RET          "pm2_sleep_ret"
713 #define IOVAR_STR_PM_LIMIT               "pm_limit"
714 #define IOVAR_STR_LISTEN_INTERVAL_BEACON "bcn_li_bcn"
715 #define IOVAR_STR_LISTEN_INTERVAL_DTIM   "bcn_li_dtim"
716 #define IOVAR_STR_LISTEN_INTERVAL_ASSOC  "assoc_listen"
717 #define IOVAR_PSPOLL_PERIOD              "pspoll_prd"
718 #define IOVAR_STR_VENDOR_IE              "vndr_ie"
719 #define IOVAR_STR_TX_GLOM                "bus:txglom"
720 #define IOVAR_STR_ACTION_FRAME           "actframe"
721 #define IOVAR_STR_AC_PARAMS_STA          "wme_ac_sta"
722 #define IOVAR_STR_COUNTERS               "counters"
723 #define IOVAR_STR_PKT_FILTER_ADD         "pkt_filter_add"
724 #define IOVAR_STR_PKT_FILTER_DELETE      "pkt_filter_delete"
725 #define IOVAR_STR_PKT_FILTER_ENABLE      "pkt_filter_enable"
726 #define IOVAR_STR_PKT_FILTER_MODE        "pkt_filter_mode"
727 #define IOVAR_STR_PKT_FILTER_LIST        "pkt_filter_list"
728 #define IOVAR_STR_PKT_FILTER_STATS       "pkt_filter_stats"
729 #define IOVAR_STR_PKT_FILTER_CLEAR_STATS "pkt_filter_clear_stats"
730 #define IOVAR_STR_DUTY_CYCLE_CCK         "dutycycle_cck"
731 #define IOVAR_STR_DUTY_CYCLE_OFDM        "dutycycle_ofdm"
732 #define IOVAR_STR_MKEEP_ALIVE            "mkeep_alive"
733 #define IOVAR_STR_VERSION                "ver"
734 #define IOVAR_STR_SUP_WPA2_EAPVER        "sup_wpa2_eapver"
735 #define IOVAR_STR_ROAM_OFF               "roam_off"
736 #define IOVAR_STR_CLOSEDNET              "closednet"
737 #define IOVAR_STR_P2P_DISC               "p2p_disc"
738 #define IOVAR_STR_P2P_DEV                "p2p_dev"
739 #define IOVAR_STR_P2P_IF                 "p2p_if"
740 #define IOVAR_STR_P2P_IFADD              "p2p_ifadd"
741 #define IOVAR_STR_P2P_IFDEL              "p2p_ifdel"
742 #define IOVAR_STR_P2P_IFUPD              "p2p_ifupd"
743 #define IOVAR_STR_P2P_SCAN               "p2p_scan"
744 #define IOVAR_STR_P2P_STATE              "p2p_state"
745 #define IOVAR_STR_P2P_SSID               "p2p_ssid"
746 #define IOVAR_STR_P2P_IP_ADDR            "p2p_ip_addr"
747 #define IOVAR_STR_NRATE                  "nrate"
748 #define IOVAR_STR_BGRATE                 "bg_rate"
749 #define IOVAR_STR_ARATE                  "a_rate"
750 #define IOVAR_STR_NMODE                  "nmode"
751 #define IOVAR_STR_MAX_ASSOC              "maxassoc"
752 #define IOVAR_STR_2G_MULTICAST_RATE      "2g_mrate"
753 #define IOVAR_STR_2G_RATE                "2g_rate"
754 #define IOVAR_STR_MPC                    "mpc"
755 #define IOVAR_STR_IBSS_JOIN              "IBSS_join_only"
756 #define IOVAR_STR_AMPDU_BA_WINDOW_SIZE   "ampdu_ba_wsize"
757 #define IOVAR_STR_AMPDU_MPDU             "ampdu_mpdu"
758 #define IOVAR_STR_AMPDU_RX               "ampdu_rx"
759 #define IOVAR_STR_AMPDU_RX_FACTOR        "ampdu_rx_factor"
760 #define IOVAR_STR_AMPDU_HOST_REORDER     "ampdu_hostreorder"
761 #define IOVAR_STR_MIMO_BW_CAP            "mimo_bw_cap"
762 #define IOVAR_STR_RMC_ACKREQ             "rmc_ackreq"
763 #define IOVAR_STR_RMC_STATUS             "rmc_status"
764 #define IOVAR_STR_RMC_COUNTS             "rmc_stats"
765 #define IOVAR_STR_RMC_ROLE               "rmc_role"
766 #define IOVAR_STR_HT40_INTOLERANCE       "intol40"
767 #define IOVAR_STR_RAND                   "rand"
768 #define IOVAR_STR_SSID                   "ssid"
769 #define IOVAR_STR_WSEC                   "wsec"
770 #define IOVAR_STR_WPA_AUTH               "wpa_auth"
771 #define IOVAR_STR_INTERFACE_REMOVE       "interface_remove"
772 #define IOVAR_STR_SUP_WPA_TMO            "sup_wpa_tmo"
773 #define IOVAR_STR_JOIN                   "join"
774 #define IOVAR_STR_TLV                    "tlv"
775 #define IOVAR_STR_NPHY_ANTSEL            "nphy_antsel"
776 #define IOVAR_STR_AVB_TIMESTAMP_ADDR     "avb_timestamp_addr"
777 #define IOVAR_STR_BSS_MAX_ASSOC          "bss_maxassoc"
778 #define IOVAR_STR_RM_REQ                 "rm_req"
779 #define IOVAR_STR_RM_REP                 "rm_rep"
780 #define IOVAR_STR_PSPRETEND_RETRY_LIMIT  "pspretend_retry_limit"
781 #define IOVAR_STR_PSPRETEND_THRESHOLD    "pspretend_threshold"
782 #define IOVAR_STR_SWDIV_TIMEOUT          "swdiv_timeout"
783 #define IOVAR_STR_RESET_CNTS             "reset_cnts"
784 #define IOVAR_STR_PHYRATE_LOG            "phyrate_log"
785 #define IOVAR_STR_PHYRATE_LOG_SIZE       "phyrate_log_size"
786 #define IOVAR_STR_PHYRATE_LOG_DUMP       "phyrate_dump"
787 #define IOVAR_STR_SCAN_ASSOC_TIME        "scan_assoc_time"
788 #define IOVAR_STR_SCAN_UNASSOC_TIME      "scan_unassoc_time"
789 #define IOVAR_STR_SCAN_PASSIVE_TIME      "scan_passive_time"
790 #define IOVAR_STR_SCAN_HOME_TIME         "scan_home_time"
791 #define IOVAR_STR_SCAN_NPROBES           "scan_nprobes"
792 #define IOVAR_STR_AUTOCOUNTRY            "autocountry"
793 #define IOVAR_STR_CAP                    "cap"
794 #define IOVAR_STR_MPDU_PER_AMPDU         "ampdu_mpdu"
795 #define IOVAR_STR_VHT_FEATURES           "vht_features"
796 #define IOVAR_STR_CHANSPEC               "chanspec"
797 #define IOVAR_STR_MGMT_FRAME             "mgmt_frame"
798 
799 #define IOVAR_STR_WOWL                   "wowl"
800 #define IOVAR_STR_WOWL_OS                "wowl_os"
801 #define IOVAR_STR_WOWL_KEEP_ALIVE        "wowl_keepalive"
802 #define IOVAR_STR_WOWL_PATTERN           "wowl_pattern"
803 #define IOVAR_STR_WOWL_PATTERN_CLR       "clr"
804 #define IOVAR_STR_WOWL_PATTERN_ADD       "add"
805 #define IOVAR_STR_WOWL_ARP_HOST_IP       "wowl_arp_hostip"
806 #define IOVAR_STR_ULP_WAIT               "ulp_wait"
807 #define IOVAR_STR_ULP                    "ulp"
808 
809 #define IOVAR_STR_PNO_ON                 "pfn"
810 #define IOVAR_STR_PNO_ADD                "pfn_add"
811 #define IOVAR_STR_PNO_SET                "pfn_set"
812 #define IOVAR_STR_PNO_CLEAR              "pfnclear"
813 #define IOVAR_STR_SCAN_CACHE_CLEAR       "scancache_clear"
814 #define MCS_SETLEN                       16
815 
816 #define IOVAR_STR_RRM                    "rrm"
817 #define IOVAR_STR_RRM_NOISE_REQ          "rrm_noise_req"
818 #define IOVAR_STR_RRM_NBR_REQ            "rrm_nbr_req"
819 #define IOVAR_STR_RRM_LM_REQ             "rrm_lm_req"
820 #define IOVAR_STR_RRM_STAT_REQ           "rrm_stat_req"
821 #define IOVAR_STR_RRM_FRAME_REQ          "rrm_frame_req"
822 #define IOVAR_STR_RRM_CHLOAD_REQ         "rrm_chload_req"
823 #define IOVAR_STR_RRM_BCN_REQ            "rrm_bcn_req"
824 #define IOVAR_STR_RRM_NBR_LIST           "rrm_nbr_list"
825 #define IOVAR_STR_RRM_NBR_ADD            "rrm_nbr_add_nbr"
826 #define IOVAR_STR_RRM_NBR_DEL            "rrm_nbr_del_nbr"
827 #define IOVAR_STR_RRM_BCNREQ_THRTL_WIN   "rrm_bcn_req_thrtl_win"
828 #define IOVAR_STR_RRM_BCNREQ_MAXOFF_TIME "rrm_bcn_req_max_off_chan_time"
829 #define IOVAR_STR_RRM_BCNREQ_TRFMS_PRD   "rrm_bcn_req_traff_meas_per"
830 
831 #define IOVAR_STR_WNM                    "wnm"
832 #define IOVAR_STR_BSSTRANS_QUERY         "wnm_bsstrans_query"
833 #define IOVAR_STR_BSSTRANS_RESP          "wnm_bsstrans_resp"
834 
835 #define IOVAR_STR_MESH_ADD_ROUTE         "mesh_add_route"
836 #define IOVAR_STR_MESH_DEL_ROUTE         "mesh_del_route"
837 #define IOVAR_STR_MESH_FIND              "mesh_find"
838 #define IOVAR_STR_MESH_FILTER            "mesh_filter"
839 #define IOVAR_STR_MESH_PEER              "mesh_peer"
840 #define IOVAR_STR_MESH_PEER_STATUS       "mesh_peer_status"
841 #define IOVAR_STR_MESH_DELFILTER         "mesh_delfilter"
842 #define IOVAR_STR_MESH_MAX_PEERS         "mesh_max_peers"
843 
844 #define IOVAR_STR_FBT_OVER_DS            "fbtoverds"
845 #define IOVAR_STR_FBT_CAPABILITIES       "fbt_cap"
846 
847 #define IOVAR_STR_MFP                    "mfp"
848 
849 #define IOVAR_STR_OTPRAW                 "otpraw"
850 #define IOVAR_NAN                        "nan"
851 #define IOVAR_STR_CLMLOAD                "clmload"
852 #define IOVAR_STR_CLMLOAD_STATUS         "clmload_status"
853 #define IOVAR_STR_CLMVER                 "clmver"
854 #define IOVAR_STR_MEMUSE                 "memuse"
855 
856 #define IOVAR_STR_LDPC_CAP               "ldpc_cap"
857 #define IOVAR_STR_LDPC_TX                "ldpc_tx"
858 #define IOVAR_STR_SGI_RX                 "sgi_rx"
859 #define IOVAR_STR_SGI_TX                 "sgi_tx"
860 
861 #define IOVAR_STR_APIVTW_OVERRIDE        "brcmapivtwo"
862 
863 #define IOVAR_STR_BWTE_BWTE_GCI_MASK     "bwte_gci_mask"
864 #define IOVAR_STR_BWTE_GCI_SENDMSG       "bwte_gci_sendm"
865 #define IOVAR_STR_WD_DISABLE             "wd_disable"
866 #define IOVAR_STR_DLTRO                  "dltro"
867 #define IOVAR_STR_SAE_PASSWORD           "sae_password"
868 #define IOVAR_STR_SAE_PWE_LOOP           "sae_max_pwe_loop"
869 #define IOVAR_STR_PMKID_INFO             "pmkid_info"
870 #define IOVAR_STR_PMKID_CLEAR            "pmkid_clear"
871 #define IOVAR_STR_AUTH_STATUS            "auth_status"
872 
873 #define IOVAR_STR_BTC_LESCAN_PARAMS      "btc_lescan_params"
874 
875 #define IOVAR_STR_ARP_VERSION            "arp_version"
876 #define IOVAR_STR_ARP_PEERAGE            "arp_peerage"
877 #define IOVAR_STR_ARPOE                  "arpoe"
878 #define IOVAR_STR_ARP_OL                 "arp_ol"
879 #define IOVAR_STR_ARP_TABLE_CLEAR        "arp_table_clear"
880 #define IOVAR_STR_ARP_HOSTIP             "arp_hostip"
881 #define IOVAR_STR_ARP_HOSTIP_CLEAR       "arp_hostip_clear"
882 #define IOVAR_STR_ARP_STATS              "arp_stats"
883 #define IOVAR_STR_ARP_STATS_CLEAR        "arp_stats_clear"
884 #define IOVAR_STR_TKO                    "tko"
885 #define IOVAR_STR_ROAM_TIME_THRESH       "roam_time_thresh"
886 
887 /* This value derived from the above strings, which appear maxed out in the 20s */
888 #define IOVAR_NAME_STR_MAX_SIZE          32
889 
890 #define WLC_IOCTL_MAGIC                    (0x14e46c77)
891 #define WLC_IOCTL_VERSION                  (1)
892 #define WLC_IOCTL_SMLEN                    (256)
893 #define WLC_IOCTL_MEDLEN                   (1536)
894 #define WLC_IOCTL_MAXLEN                   (8192)
895 
896 #define WLC_GET_MAGIC                      ( (uint32_t)0 )
897 #define WLC_GET_VERSION                    ( (uint32_t)1 )
898 #define WLC_UP                             ( (uint32_t)2 )
899 #define WLC_DOWN                           ( (uint32_t)3 )
900 #define WLC_GET_LOOP                       ( (uint32_t)4 )
901 #define WLC_SET_LOOP                       ( (uint32_t)5 )
902 #define WLC_DUMP                           ( (uint32_t)6 )
903 #define WLC_GET_MSGLEVEL                   ( (uint32_t)7 )
904 #define WLC_SET_MSGLEVEL                   ( (uint32_t)8 )
905 #define WLC_GET_PROMISC                    ( (uint32_t)9 )
906 #define WLC_SET_PROMISC                    ( (uint32_t)10 )
907 #define WLC_GET_RATE                       ( (uint32_t)12 )
908 #define WLC_GET_INSTANCE                   ( (uint32_t)14 )
909 #define WLC_GET_INFRA                      ( (uint32_t)19 )
910 #define WLC_SET_INFRA                      ( (uint32_t)20 )
911 #define WLC_GET_AUTH                       ( (uint32_t)21 )
912 #define WLC_SET_AUTH                       ( (uint32_t)22 )
913 #define WLC_GET_BSSID                      ( (uint32_t)23 )
914 #define WLC_SET_BSSID                      ( (uint32_t)24 )
915 #define WLC_GET_SSID                       ( (uint32_t)25 )
916 #define WLC_SET_SSID                       ( (uint32_t)26 )
917 #define WLC_RESTART                        ( (uint32_t)27 )
918 #define WLC_GET_CHANNEL                    ( (uint32_t)29 )
919 #define WLC_SET_CHANNEL                    ( (uint32_t)30 )
920 #define WLC_GET_SRL                        ( (uint32_t)31 )
921 #define WLC_SET_SRL                        ( (uint32_t)32 )
922 #define WLC_GET_LRL                        ( (uint32_t)33 )
923 #define WLC_SET_LRL                        ( (uint32_t)34 )
924 #define WLC_GET_PLCPHDR                    ( (uint32_t)35 )
925 #define WLC_SET_PLCPHDR                    ( (uint32_t)36 )
926 #define WLC_GET_RADIO                      ( (uint32_t)37 )
927 #define WLC_SET_RADIO                      ( (uint32_t)38 )
928 #define WLC_GET_PHYTYPE                    ( (uint32_t)39 )
929 #define WLC_DUMP_RATE                      ( (uint32_t)40 )
930 #define WLC_SET_RATE_PARAMS                ( (uint32_t)41 )
931 #define WLC_GET_KEY                        ( (uint32_t)44 )
932 #define WLC_SET_KEY                        ( (uint32_t)45 )
933 #define WLC_GET_REGULATORY                 ( (uint32_t)46 )
934 #define WLC_SET_REGULATORY                 ( (uint32_t)47 )
935 #define WLC_GET_PASSIVE_SCAN               ( (uint32_t)48 )
936 #define WLC_SET_PASSIVE_SCAN               ( (uint32_t)49 )
937 #define WLC_SCAN                           ( (uint32_t)50 )
938 #define WLC_SCAN_RESULTS                   ( (uint32_t)51 )
939 #define WLC_DISASSOC                       ( (uint32_t)52 )
940 #define WLC_REASSOC                        ( (uint32_t)53 )
941 #define WLC_GET_ROAM_TRIGGER               ( (uint32_t)54 )
942 #define WLC_SET_ROAM_TRIGGER               ( (uint32_t)55 )
943 #define WLC_GET_ROAM_DELTA                 ( (uint32_t)56 )
944 #define WLC_SET_ROAM_DELTA                 ( (uint32_t)57 )
945 #define WLC_GET_ROAM_SCAN_PERIOD           ( (uint32_t)58 )
946 #define WLC_SET_ROAM_SCAN_PERIOD           ( (uint32_t)59 )
947 #define WLC_EVM                            ( (uint32_t)60 )
948 #define WLC_GET_TXANT                      ( (uint32_t)61 )
949 #define WLC_SET_TXANT                      ( (uint32_t)62 )
950 #define WLC_GET_ANTDIV                     ( (uint32_t)63 )
951 #define WLC_SET_ANTDIV                     ( (uint32_t)64 )
952 #define WLC_GET_CLOSED                     ( (uint32_t)67 )
953 #define WLC_SET_CLOSED                     ( (uint32_t)68 )
954 #define WLC_GET_MACLIST                    ( (uint32_t)69 )
955 #define WLC_SET_MACLIST                    ( (uint32_t)70 )
956 #define WLC_GET_RATESET                    ( (uint32_t)71 )
957 #define WLC_SET_RATESET                    ( (uint32_t)72 )
958 #define WLC_LONGTRAIN                      ( (uint32_t)74 )
959 #define WLC_GET_BCNPRD                     ( (uint32_t)75 )
960 #define WLC_SET_BCNPRD                     ( (uint32_t)76 )
961 #define WLC_GET_DTIMPRD                    ( (uint32_t)77 )
962 #define WLC_SET_DTIMPRD                    ( (uint32_t)78 )
963 #define WLC_GET_SROM                       ( (uint32_t)79 )
964 #define WLC_SET_SROM                       ( (uint32_t)80 )
965 #define WLC_GET_WEP_RESTRICT               ( (uint32_t)81 )
966 #define WLC_SET_WEP_RESTRICT               ( (uint32_t)82 )
967 #define WLC_GET_COUNTRY                    ( (uint32_t)83 )
968 #define WLC_SET_COUNTRY                    ( (uint32_t)84 )
969 #define WLC_GET_PM                         ( (uint32_t)85 )
970 #define WLC_SET_PM                         ( (uint32_t)86 )
971 #define WLC_GET_WAKE                       ( (uint32_t)87 )
972 #define WLC_SET_WAKE                       ( (uint32_t)88 )
973 #define WLC_GET_FORCELINK                  ( (uint32_t)90 )
974 #define WLC_SET_FORCELINK                  ( (uint32_t)91 )
975 #define WLC_FREQ_ACCURACY                  ( (uint32_t)92 )
976 #define WLC_CARRIER_SUPPRESS               ( (uint32_t)93 )
977 #define WLC_GET_PHYREG                     ( (uint32_t)94 )
978 #define WLC_SET_PHYREG                     ( (uint32_t)95 )
979 #define WLC_GET_RADIOREG                   ( (uint32_t)96 )
980 #define WLC_SET_RADIOREG                   ( (uint32_t)97 )
981 #define WLC_GET_REVINFO                    ( (uint32_t)98 )
982 #define WLC_GET_UCANTDIV                   ( (uint32_t)99 )
983 #define WLC_SET_UCANTDIV                   ( (uint32_t)100 )
984 #define WLC_R_REG                          ( (uint32_t)101 )
985 #define WLC_W_REG                          ( (uint32_t)102 )
986 #define WLC_GET_MACMODE                    ( (uint32_t)105 )
987 #define WLC_SET_MACMODE                    ( (uint32_t)106 )
988 #define WLC_GET_MONITOR                    ( (uint32_t)107 )
989 #define WLC_SET_MONITOR                    ( (uint32_t)108 )
990 #define WLC_GET_GMODE                      ( (uint32_t)109 )
991 #define WLC_SET_GMODE                      ( (uint32_t)110 )
992 #define WLC_GET_LEGACY_ERP                 ( (uint32_t)111 )
993 #define WLC_SET_LEGACY_ERP                 ( (uint32_t)112 )
994 #define WLC_GET_RX_ANT                     ( (uint32_t)113 )
995 #define WLC_GET_CURR_RATESET               ( (uint32_t)114 )
996 #define WLC_GET_SCANSUPPRESS               ( (uint32_t)115 )
997 #define WLC_SET_SCANSUPPRESS               ( (uint32_t)116 )
998 #define WLC_GET_AP                         ( (uint32_t)117 )
999 #define WLC_SET_AP                         ( (uint32_t)118 )
1000 #define WLC_GET_EAP_RESTRICT               ( (uint32_t)119 )
1001 #define WLC_SET_EAP_RESTRICT               ( (uint32_t)120 )
1002 #define WLC_SCB_AUTHORIZE                  ( (uint32_t)121 )
1003 #define WLC_SCB_DEAUTHORIZE                ( (uint32_t)122 )
1004 #define WLC_GET_WDSLIST                    ( (uint32_t)123 )
1005 #define WLC_SET_WDSLIST                    ( (uint32_t)124 )
1006 #define WLC_GET_ATIM                       ( (uint32_t)125 )
1007 #define WLC_SET_ATIM                       ( (uint32_t)126 )
1008 #define WLC_GET_RSSI                       ( (uint32_t)127 )
1009 #define WLC_GET_PHYANTDIV                  ( (uint32_t)128 )
1010 #define WLC_SET_PHYANTDIV                  ( (uint32_t)129 )
1011 #define WLC_AP_RX_ONLY                     ( (uint32_t)130 )
1012 #define WLC_GET_TX_PATH_PWR                ( (uint32_t)131 )
1013 #define WLC_SET_TX_PATH_PWR                ( (uint32_t)132 )
1014 #define WLC_GET_WSEC                       ( (uint32_t)133 )
1015 #define WLC_SET_WSEC                       ( (uint32_t)134 )
1016 #define WLC_GET_PHY_NOISE                  ( (uint32_t)135 )
1017 #define WLC_GET_BSS_INFO                   ( (uint32_t)136 )
1018 #define WLC_GET_PKTCNTS                    ( (uint32_t)137 )
1019 #define WLC_GET_LAZYWDS                    ( (uint32_t)138 )
1020 #define WLC_SET_LAZYWDS                    ( (uint32_t)139 )
1021 #define WLC_GET_BANDLIST                   ( (uint32_t)140 )
1022 #define WLC_GET_BAND                       ( (uint32_t)141 )
1023 #define WLC_SET_BAND                       ( (uint32_t)142 )
1024 #define WLC_SCB_DEAUTHENTICATE             ( (uint32_t)143 )
1025 #define WLC_GET_SHORTSLOT                  ( (uint32_t)144 )
1026 #define WLC_GET_SHORTSLOT_OVERRIDE         ( (uint32_t)145 )
1027 #define WLC_SET_SHORTSLOT_OVERRIDE         ( (uint32_t)146 )
1028 #define WLC_GET_SHORTSLOT_RESTRICT         ( (uint32_t)147 )
1029 #define WLC_SET_SHORTSLOT_RESTRICT         ( (uint32_t)148 )
1030 #define WLC_GET_GMODE_PROTECTION           ( (uint32_t)149 )
1031 #define WLC_GET_GMODE_PROTECTION_OVERRIDE  ( (uint32_t)150 )
1032 #define WLC_SET_GMODE_PROTECTION_OVERRIDE  ( (uint32_t)151 )
1033 #define WLC_UPGRADE                        ( (uint32_t)152 )
1034 #define WLC_GET_IGNORE_BCNS                ( (uint32_t)155 )
1035 #define WLC_SET_IGNORE_BCNS                ( (uint32_t)156 )
1036 #define WLC_GET_SCB_TIMEOUT                ( (uint32_t)157 )
1037 #define WLC_SET_SCB_TIMEOUT                ( (uint32_t)158 )
1038 #define WLC_GET_ASSOCLIST                  ( (uint32_t)159 )
1039 #define WLC_GET_CLK                        ( (uint32_t)160 )
1040 #define WLC_SET_CLK                        ( (uint32_t)161 )
1041 #define WLC_GET_UP                         ( (uint32_t)162 )
1042 #define WLC_OUT                            ( (uint32_t)163 )
1043 #define WLC_GET_WPA_AUTH                   ( (uint32_t)164 )
1044 #define WLC_SET_WPA_AUTH                   ( (uint32_t)165 )
1045 #define WLC_GET_UCFLAGS                    ( (uint32_t)166 )
1046 #define WLC_SET_UCFLAGS                    ( (uint32_t)167 )
1047 #define WLC_GET_PWRIDX                     ( (uint32_t)168 )
1048 #define WLC_SET_PWRIDX                     ( (uint32_t)169 )
1049 #define WLC_GET_TSSI                       ( (uint32_t)170 )
1050 #define WLC_GET_SUP_RATESET_OVERRIDE       ( (uint32_t)171 )
1051 #define WLC_SET_SUP_RATESET_OVERRIDE       ( (uint32_t)172 )
1052 #define WLC_GET_PROTECTION_CONTROL         ( (uint32_t)178 )
1053 #define WLC_SET_PROTECTION_CONTROL         ( (uint32_t)179 )
1054 #define WLC_GET_PHYLIST                    ( (uint32_t)180 )
1055 #define WLC_ENCRYPT_STRENGTH               ( (uint32_t)181 )
1056 #define WLC_DECRYPT_STATUS                 ( (uint32_t)182 )
1057 #define WLC_GET_KEY_SEQ                    ( (uint32_t)183 )
1058 #define WLC_GET_SCAN_CHANNEL_TIME          ( (uint32_t)184 )
1059 #define WLC_SET_SCAN_CHANNEL_TIME          ( (uint32_t)185 )
1060 #define WLC_GET_SCAN_UNASSOC_TIME          ( (uint32_t)186 )
1061 #define WLC_SET_SCAN_UNASSOC_TIME          ( (uint32_t)187 )
1062 #define WLC_GET_SCAN_HOME_TIME             ( (uint32_t)188 )
1063 #define WLC_SET_SCAN_HOME_TIME             ( (uint32_t)189 )
1064 #define WLC_GET_SCAN_NPROBES               ( (uint32_t)190 )
1065 #define WLC_SET_SCAN_NPROBES               ( (uint32_t)191 )
1066 #define WLC_GET_PRB_RESP_TIMEOUT           ( (uint32_t)192 )
1067 #define WLC_SET_PRB_RESP_TIMEOUT           ( (uint32_t)193 )
1068 #define WLC_GET_ATTEN                      ( (uint32_t)194 )
1069 #define WLC_SET_ATTEN                      ( (uint32_t)195 )
1070 #define WLC_GET_SHMEM                      ( (uint32_t)196 )
1071 #define WLC_SET_SHMEM                      ( (uint32_t)197 )
1072 #define WLC_SET_WSEC_TEST                  ( (uint32_t)200 )
1073 #define WLC_SCB_DEAUTHENTICATE_FOR_REASON  ( (uint32_t)201 )
1074 #define WLC_TKIP_COUNTERMEASURES           ( (uint32_t)202 )
1075 #define WLC_GET_PIOMODE                    ( (uint32_t)203 )
1076 #define WLC_SET_PIOMODE                    ( (uint32_t)204 )
1077 #define WLC_SET_ASSOC_PREFER               ( (uint32_t)205 )
1078 #define WLC_GET_ASSOC_PREFER               ( (uint32_t)206 )
1079 #define WLC_SET_ROAM_PREFER                ( (uint32_t)207 )
1080 #define WLC_GET_ROAM_PREFER                ( (uint32_t)208 )
1081 #define WLC_SET_LED                        ( (uint32_t)209 )
1082 #define WLC_GET_LED                        ( (uint32_t)210 )
1083 #define WLC_GET_INTERFERENCE_MODE          ( (uint32_t)211 )
1084 #define WLC_SET_INTERFERENCE_MODE          ( (uint32_t)212 )
1085 #define WLC_GET_CHANNEL_QA                 ( (uint32_t)213 )
1086 #define WLC_START_CHANNEL_QA               ( (uint32_t)214 )
1087 #define WLC_GET_CHANNEL_SEL                ( (uint32_t)215 )
1088 #define WLC_START_CHANNEL_SEL              ( (uint32_t)216 )
1089 #define WLC_GET_VALID_CHANNELS             ( (uint32_t)217 )
1090 #define WLC_GET_FAKEFRAG                   ( (uint32_t)218 )
1091 #define WLC_SET_FAKEFRAG                   ( (uint32_t)219 )
1092 #define WLC_GET_PWROUT_PERCENTAGE          ( (uint32_t)220 )
1093 #define WLC_SET_PWROUT_PERCENTAGE          ( (uint32_t)221 )
1094 #define WLC_SET_BAD_FRAME_PREEMPT          ( (uint32_t)222 )
1095 #define WLC_GET_BAD_FRAME_PREEMPT          ( (uint32_t)223 )
1096 #define WLC_SET_LEAP_LIST                  ( (uint32_t)224 )
1097 #define WLC_GET_LEAP_LIST                  ( (uint32_t)225 )
1098 #define WLC_GET_CWMIN                      ( (uint32_t)226 )
1099 #define WLC_SET_CWMIN                      ( (uint32_t)227 )
1100 #define WLC_GET_CWMAX                      ( (uint32_t)228 )
1101 #define WLC_SET_CWMAX                      ( (uint32_t)229 )
1102 #define WLC_GET_WET                        ( (uint32_t)230 )
1103 #define WLC_SET_WET                        ( (uint32_t)231 )
1104 #define WLC_GET_PUB                        ( (uint32_t)232 )
1105 #define WLC_GET_KEY_PRIMARY                ( (uint32_t)235 )
1106 #define WLC_SET_KEY_PRIMARY                ( (uint32_t)236 )
1107 #define WLC_GET_ACI_ARGS                   ( (uint32_t)238 )
1108 #define WLC_SET_ACI_ARGS                   ( (uint32_t)239 )
1109 #define WLC_UNSET_CALLBACK                 ( (uint32_t)240 )
1110 #define WLC_SET_CALLBACK                   ( (uint32_t)241 )
1111 #define WLC_GET_RADAR                      ( (uint32_t)242 )
1112 #define WLC_SET_RADAR                      ( (uint32_t)243 )
1113 #define WLC_SET_SPECT_MANAGMENT            ( (uint32_t)244 )
1114 #define WLC_GET_SPECT_MANAGMENT            ( (uint32_t)245 )
1115 #define WLC_WDS_GET_REMOTE_HWADDR          ( (uint32_t)246 )
1116 #define WLC_WDS_GET_WPA_SUP                ( (uint32_t)247 )
1117 #define WLC_SET_CS_SCAN_TIMER              ( (uint32_t)248 )
1118 #define WLC_GET_CS_SCAN_TIMER              ( (uint32_t)249 )
1119 #define WLC_MEASURE_REQUEST                ( (uint32_t)250 )
1120 #define WLC_INIT                           ( (uint32_t)251 )
1121 #define WLC_SEND_QUIET                     ( (uint32_t)252 )
1122 #define WLC_KEEPALIVE                      ( (uint32_t)253 )
1123 #define WLC_SEND_PWR_CONSTRAINT            ( (uint32_t)254 )
1124 #define WLC_UPGRADE_STATUS                 ( (uint32_t)255 )
1125 #define WLC_CURRENT_PWR                    ( (uint32_t)256 )
1126 #define WLC_GET_SCAN_PASSIVE_TIME          ( (uint32_t)257 )
1127 #define WLC_SET_SCAN_PASSIVE_TIME          ( (uint32_t)258 )
1128 #define WLC_LEGACY_LINK_BEHAVIOR           ( (uint32_t)259 )
1129 #define WLC_GET_CHANNELS_IN_COUNTRY        ( (uint32_t)260 )
1130 #define WLC_GET_COUNTRY_LIST               ( (uint32_t)261 )
1131 #define WLC_GET_VAR                        ( (uint32_t)262 )
1132 #define WLC_SET_VAR                        ( (uint32_t)263 )
1133 #define WLC_NVRAM_GET                      ( (uint32_t)264 )
1134 #define WLC_NVRAM_SET                      ( (uint32_t)265 )
1135 #define WLC_NVRAM_DUMP                     ( (uint32_t)266 )
1136 #define WLC_REBOOT                         ( (uint32_t)267 )
1137 #define WLC_SET_WSEC_PMK                   ( (uint32_t)268 )
1138 #define WLC_GET_AUTH_MODE                  ( (uint32_t)269 )
1139 #define WLC_SET_AUTH_MODE                  ( (uint32_t)270 )
1140 #define WLC_GET_WAKEENTRY                  ( (uint32_t)271 )
1141 #define WLC_SET_WAKEENTRY                  ( (uint32_t)272 )
1142 #define WLC_NDCONFIG_ITEM                  ( (uint32_t)273 )
1143 #define WLC_NVOTPW                         ( (uint32_t)274 )
1144 #define WLC_OTPW                           ( (uint32_t)275 )
1145 #define WLC_IOV_BLOCK_GET                  ( (uint32_t)276 )
1146 #define WLC_IOV_MODULES_GET                ( (uint32_t)277 )
1147 #define WLC_SOFT_RESET                     ( (uint32_t)278 )
1148 #define WLC_GET_ALLOW_MODE                 ( (uint32_t)279 )
1149 #define WLC_SET_ALLOW_MODE                 ( (uint32_t)280 )
1150 #define WLC_GET_DESIRED_BSSID              ( (uint32_t)281 )
1151 #define WLC_SET_DESIRED_BSSID              ( (uint32_t)282 )
1152 #define WLC_DISASSOC_MYAP                  ( (uint32_t)283 )
1153 #define WLC_GET_NBANDS                     ( (uint32_t)284 )
1154 #define WLC_GET_BANDSTATES                 ( (uint32_t)285 )
1155 #define WLC_GET_WLC_BSS_INFO               ( (uint32_t)286 )
1156 #define WLC_GET_ASSOC_INFO                 ( (uint32_t)287 )
1157 #define WLC_GET_OID_PHY                    ( (uint32_t)288 )
1158 #define WLC_SET_OID_PHY                    ( (uint32_t)289 )
1159 #define WLC_SET_ASSOC_TIME                 ( (uint32_t)290 )
1160 #define WLC_GET_DESIRED_SSID               ( (uint32_t)291 )
1161 #define WLC_GET_CHANSPEC                   ( (uint32_t)292 )
1162 #define WLC_GET_ASSOC_STATE                ( (uint32_t)293 )
1163 #define WLC_SET_PHY_STATE                  ( (uint32_t)294 )
1164 #define WLC_GET_SCAN_PENDING               ( (uint32_t)295 )
1165 #define WLC_GET_SCANREQ_PENDING            ( (uint32_t)296 )
1166 #define WLC_GET_PREV_ROAM_REASON           ( (uint32_t)297 )
1167 #define WLC_SET_PREV_ROAM_REASON           ( (uint32_t)298 )
1168 #define WLC_GET_BANDSTATES_PI              ( (uint32_t)299 )
1169 #define WLC_GET_PHY_STATE                  ( (uint32_t)300 )
1170 #define WLC_GET_BSS_WPA_RSN                ( (uint32_t)301 )
1171 #define WLC_GET_BSS_WPA2_RSN               ( (uint32_t)302 )
1172 #define WLC_GET_BSS_BCN_TS                 ( (uint32_t)303 )
1173 #define WLC_GET_INT_DISASSOC               ( (uint32_t)304 )
1174 #define WLC_SET_NUM_PEERS                  ( (uint32_t)305 )
1175 #define WLC_GET_NUM_BSS                    ( (uint32_t)306 )
1176 #define WLC_GET_WSEC_PMK                   ( (uint32_t)318 )
1177 #define WLC_GET_RANDOM_BYTES               ( (uint32_t)319 )
1178 #define WLC_LAST                           ( (uint32_t)320 )
1179 
1180 #define EPICTRL_COOKIE        0xABADCEDE
1181 #define CMN_IOCTL_OFF 0x180
1182 #define WL_OID_BASE        0xFFE41420
1183 #define OID_WL_GETINSTANCE    (WL_OID_BASE + WLC_GET_INSTANCE)
1184 #define OID_WL_GET_FORCELINK    (WL_OID_BASE + WLC_GET_FORCELINK)
1185 #define OID_WL_SET_FORCELINK    (WL_OID_BASE + WLC_SET_FORCELINK)
1186 #define    OID_WL_ENCRYPT_STRENGTH    (WL_OID_BASE + WLC_ENCRYPT_STRENGTH)
1187 #define OID_WL_DECRYPT_STATUS    (WL_OID_BASE + WLC_DECRYPT_STATUS)
1188 #define OID_LEGACY_LINK_BEHAVIOR (WL_OID_BASE + WLC_LEGACY_LINK_BEHAVIOR)
1189 #define OID_WL_NDCONFIG_ITEM (WL_OID_BASE + WLC_NDCONFIG_ITEM)
1190 #define OID_STA_CHANSPEC    (WL_OID_BASE + WLC_GET_CHANSPEC)
1191 #define OID_STA_NBANDS        (WL_OID_BASE + WLC_GET_NBANDS)
1192 #define OID_STA_GET_PHY        (WL_OID_BASE + WLC_GET_OID_PHY)
1193 #define OID_STA_SET_PHY        (WL_OID_BASE + WLC_SET_OID_PHY)
1194 #define OID_STA_ASSOC_TIME    (WL_OID_BASE + WLC_SET_ASSOC_TIME)
1195 #define OID_STA_DESIRED_SSID (WL_OID_BASE + WLC_GET_DESIRED_SSID)
1196 #define OID_STA_SET_PHY_STATE (WL_OID_BASE + WLC_SET_PHY_STATE)
1197 #define OID_STA_SCAN_PENDING    (WL_OID_BASE + WLC_GET_SCAN_PENDING)
1198 #define OID_STA_SCANREQ_PENDING (WL_OID_BASE + WLC_GET_SCANREQ_PENDING)
1199 #define OID_STA_GET_ROAM_REASON (WL_OID_BASE + WLC_GET_PREV_ROAM_REASON)
1200 #define OID_STA_SET_ROAM_REASON (WL_OID_BASE + WLC_SET_PREV_ROAM_REASON)
1201 #define OID_STA_GET_PHY_STATE (WL_OID_BASE + WLC_GET_PHY_STATE)
1202 #define OID_STA_INT_DISASSOC    (WL_OID_BASE + WLC_GET_INT_DISASSOC)
1203 #define OID_STA_SET_NUM_PEERS    (WL_OID_BASE + WLC_SET_NUM_PEERS)
1204 #define OID_STA_GET_NUM_BSS        (WL_OID_BASE + WLC_GET_NUM_BSS)
1205 #define WL_DECRYPT_STATUS_SUCCESS    1
1206 #define WL_DECRYPT_STATUS_FAILURE    2
1207 #define WL_DECRYPT_STATUS_UNKNOWN    3
1208 #define WLC_UPGRADE_SUCCESS            0
1209 #define WLC_UPGRADE_PENDING            1
1210 typedef struct
1211 {
1212     int8_t *name;
1213     void *param;
1214 } ndconfig_item_t;
1215 typedef struct _wl_assoc_result
1216 {
1217     unsigned long associated;
1218     unsigned long NDIS_auth;
1219     unsigned long NDIS_infra;
1220 } wl_assoc_result_t;
1221 #define WL_RADIO_SW_DISABLE        (1 << 0)
1222 #define WL_RADIO_HW_DISABLE        (1 << 1)
1223 #define WL_RADIO_MPC_DISABLE       (1 << 2)
1224 #define WL_RADIO_COUNTRY_DISABLE   (1 << 3)
1225 #define WL_TXPWR_OVERRIDE          (1U << 31)
1226 #define WL_PHY_PAVARS_LEN          (6)
1227 #define WL_DIAG_INTERRUPT          (1)
1228 #define WL_DIAG_LOOPBACK           (2)
1229 #define WL_DIAG_MEMORY             (3)
1230 #define WL_DIAG_LED                (4)
1231 #define WL_DIAG_REG                (5)
1232 #define WL_DIAG_SROM               (6)
1233 #define WL_DIAG_DMA                (7)
1234 #define WL_DIAGERR_SUCCESS            (0)
1235 #define WL_DIAGERR_FAIL_TO_RUN        (1)
1236 #define WL_DIAGERR_NOT_SUPPORTED      (2)
1237 #define WL_DIAGERR_INTERRUPT_FAIL     (3)
1238 #define WL_DIAGERR_LOOPBACK_FAIL      (4)
1239 #define WL_DIAGERR_SROM_FAIL          (5)
1240 #define WL_DIAGERR_SROM_BADCRC        (6)
1241 #define WL_DIAGERR_REG_FAIL           (7)
1242 #define WL_DIAGERR_MEMORY_FAIL        (8)
1243 #define WL_DIAGERR_NOMEM              (9)
1244 #define WL_DIAGERR_DMA_FAIL           (10)
1245 #define WL_DIAGERR_MEMORY_TIMEOUT     (11)
1246 #define WL_DIAGERR_MEMORY_BADPATTERN  (12)
1247 #define    WLC_BAND_AUTO                (0)
1248 #define    WLC_BAND_5G                  (1)
1249 #define    WLC_BAND_2G                  (2)
1250 #define    WLC_BAND_ALL                 (3)
1251 #define WL_CHAN_FREQ_RANGE_2G           (0)
1252 #define WL_CHAN_FREQ_RANGE_5GL          (1)
1253 #define WL_CHAN_FREQ_RANGE_5GM          (2)
1254 #define WL_CHAN_FREQ_RANGE_5GH          (3)
1255 #define WLC_PHY_TYPE_A               (0)
1256 #define WLC_PHY_TYPE_B               (1)
1257 #define WLC_PHY_TYPE_G               (2)
1258 #define WLC_PHY_TYPE_N               (4)
1259 #define WLC_PHY_TYPE_LP              (5)
1260 #define WLC_PHY_TYPE_SSN             (6)
1261 #define WLC_PHY_TYPE_NULL          (0xf)
1262 #define WLC_MACMODE_DISABLED         (0)
1263 #define WLC_MACMODE_DENY             (1)
1264 #define WLC_MACMODE_ALLOW            (2)
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 #define WLC_PLCP_AUTO               (-1)
1273 #define WLC_PLCP_SHORT               (0)
1274 #define WLC_PLCP_LONG                (1)
1275 #define WLC_PROTECTION_AUTO         (-1)
1276 #define WLC_PROTECTION_OFF           (0)
1277 #define WLC_PROTECTION_ON            (1)
1278 #define WLC_PROTECTION_MMHDR_ONLY    (2)
1279 #define WLC_PROTECTION_CTS_ONLY      (3)
1280 #define WLC_PROTECTION_CTL_OFF       (0)
1281 #define WLC_PROTECTION_CTL_LOCAL     (1)
1282 #define WLC_PROTECTION_CTL_OVERLAP   (2)
1283 #define WLC_N_PROTECTION_OFF         (0)
1284 #define WLC_N_PROTECTION_OPTIONAL    (1)
1285 #define WLC_N_PROTECTION_20IN40      (2)
1286 #define WLC_N_PROTECTION_MIXEDMODE   (3)
1287 #define WLC_N_PREAMBLE_MIXEDMODE     (0)
1288 #define WLC_N_PREAMBLE_GF            (1)
1289 #define WLC_N_BW_20ALL               (0)
1290 #define WLC_N_BW_40ALL               (1)
1291 #define WLC_N_BW_20IN2G_40IN5G       (2)
1292 #define WLC_N_TXRX_CHAIN0            (0)
1293 #define WLC_N_TXRX_CHAIN1            (1)
1294 #define WLC_N_SGI_20              (0x01)
1295 #define WLC_N_SGI_40              (0x02)
1296 #define PM_OFF                       (0)
1297 #define PM_MAX                       (1)
1298 #define PM_FAST                      (2)
1299 #define PM_FORCE_OFF                 (3)
1300 #define INTERFERE_NONE               (0)
1301 #define NON_WLAN                     (1)
1302 #define WLAN_MANUAL                  (2)
1303 #define WLAN_AUTO                    (3)
1304 #define AUTO_ACTIVE             (1 << 7)
1305 typedef struct wl_aci_args
1306 {
1307     int32_t enter_aci_thresh;
1308     int32_t exit_aci_thresh;
1309     int32_t usec_spin;
1310     int32_t glitch_delay;
1311     uint16_t nphy_adcpwr_enter_thresh;
1312     uint16_t nphy_adcpwr_exit_thresh;
1313     uint16_t nphy_repeat_ctr;
1314     uint16_t nphy_num_samples;
1315     uint16_t nphy_undetect_window_sz;
1316     uint16_t nphy_b_energy_lo_aci;
1317     uint16_t nphy_b_energy_md_aci;
1318     uint16_t nphy_b_energy_hi_aci;
1319 } wl_aci_args_t;
1320 #define WL_ACI_ARGS_LEGACY_LENGTH    16
1321 typedef struct
1322 {
1323     int32_t npulses;
1324     int32_t ncontig;
1325     int32_t min_pw;
1326     int32_t max_pw;
1327     uint16_t thresh0;
1328     uint16_t thresh1;
1329     uint16_t blank;
1330     uint16_t fmdemodcfg;
1331     int32_t npulses_lp;
1332     int32_t min_pw_lp;
1333     int32_t max_pw_lp;
1334     int32_t min_fm_lp;
1335     int32_t max_deltat_lp;
1336     int32_t min_deltat;
1337     int32_t max_deltat;
1338     uint16_t autocorr;
1339     uint16_t st_level_time;
1340     uint16_t t2_min;
1341     uint32_t version;
1342 } wl_radar_args_t;
1343 #define WL_RADAR_ARGS_VERSION 1
1344 #define WL_RADAR_DETECTOR_OFF        0
1345 #define WL_RADAR_DETECTOR_ON        1
1346 #define WL_RADAR_SIMULATED        2
1347 #define WL_RSSI_ANT_VERSION    1
1348 #define WL_RSSI_ANT_MAX        4
1349 typedef struct
1350 {
1351     uint32_t version;
1352     uint32_t count;
1353     int8_t rssi_ant[WL_RSSI_ANT_MAX];
1354 } wl_rssi_ant_t;
1355 #define WL_DFS_CACSTATE_IDLE        0
1356 #define    WL_DFS_CACSTATE_PREISM_CAC    1
1357 #define WL_DFS_CACSTATE_ISM        2
1358 #define WL_DFS_CACSTATE_CSA        3
1359 #define WL_DFS_CACSTATE_POSTISM_CAC    4
1360 #define WL_DFS_CACSTATE_PREISM_OOC    5
1361 #define WL_DFS_CACSTATE_POSTISM_OOC    6
1362 #define WL_DFS_CACSTATES        7
1363 typedef struct
1364 {
1365     uint32_t state;
1366     uint32_t duration;
1367     wl_chanspec_t chanspec_cleared;
1368     uint16_t pad;
1369 } wl_dfs_status_t;
1370 #define NUM_PWRCTRL_RATES 12
1371 typedef struct
1372 {
1373     uint8_t txpwr_band_max[NUM_PWRCTRL_RATES];
1374     uint8_t txpwr_limit[NUM_PWRCTRL_RATES];
1375     uint8_t txpwr_local_max;
1376     uint8_t txpwr_local_constraint;
1377     uint8_t txpwr_chan_reg_max;
1378     uint8_t txpwr_target[2][NUM_PWRCTRL_RATES];
1379     uint8_t txpwr_est_Pout[2];
1380     uint8_t txpwr_opo[NUM_PWRCTRL_RATES];
1381     uint8_t txpwr_bphy_cck_max[NUM_PWRCTRL_RATES];
1382     uint8_t txpwr_bphy_ofdm_max;
1383     uint8_t txpwr_aphy_max[NUM_PWRCTRL_RATES];
1384     int8_t txpwr_antgain[2];
1385     uint8_t txpwr_est_Pout_gofdm;
1386 } tx_power_legacy_t;
1387 #define WL_TX_POWER_RATES    45
1388 #define WL_TX_POWER_CCK_FIRST    0
1389 #define WL_TX_POWER_CCK_NUM    4
1390 #define WL_TX_POWER_OFDM_FIRST    4
1391 #define WL_TX_POWER_OFDM_NUM    8
1392 #define WL_TX_POWER_MCS_SISO_NUM 8
1393 #define WL_TX_POWER_MCS20_FIRST    12
1394 #define WL_TX_POWER_MCS20_NUM    16
1395 #define WL_TX_POWER_MCS40_FIRST    28
1396 #define WL_TX_POWER_MCS40_NUM    17
1397 #define WL_TX_POWER_MCS20SISO_NUM    8
1398 #define WL_TX_POWER_MCS40_LAST    44
1399 #define WL_TX_POWER_F_ENABLED    1
1400 #define WL_TX_POWER_F_HW    2
1401 #define WL_TX_POWER_F_MIMO    4
1402 #define WL_TX_POWER_F_SISO    8
1403 #define WL_TX_POWER_F_40M_CAP    16
1404 
1405 #define MAX_QTX_POWER 32
1406 typedef struct
1407 {
1408     uint32_t flags;
1409     wl_chanspec_t chanspec;
1410     wl_chanspec_t local_chanspec;
1411     uint8_t local_max;
1412     uint8_t local_constraint;
1413     int8_t antgain[2];
1414     uint8_t rf_cores;
1415     uint8_t est_Pout[4];
1416     uint8_t est_Pout_cck;
1417     uint8_t user_limit[WL_TX_POWER_RATES];
1418     uint8_t reg_limit[WL_TX_POWER_RATES];
1419     uint8_t board_limit[WL_TX_POWER_RATES];
1420     uint8_t target[WL_TX_POWER_RATES];
1421 } tx_power_t;
1422 typedef struct tx_inst_power
1423 {
1424     uint8_t txpwr_est_Pout[2];
1425     uint8_t txpwr_est_Pout_gofdm;
1426 } tx_inst_power_t;
1427 #define WLC_MEASURE_TPC            1
1428 #define WLC_MEASURE_CHANNEL_BASIC    2
1429 #define WLC_MEASURE_CHANNEL_CCA        3
1430 #define WLC_MEASURE_CHANNEL_RPI        4
1431 #define SPECT_MNGMT_OFF            0
1432 #define SPECT_MNGMT_LOOSE_11H        1
1433 #define SPECT_MNGMT_STRICT_11H        2
1434 #define SPECT_MNGMT_STRICT_11D        3
1435 #define SPECT_MNGMT_LOOSE_11H_D        4
1436 #define WL_CHAN_VALID_HW    (1 << 0)
1437 #define WL_CHAN_VALID_SW    (1 << 1)
1438 #define WL_CHAN_BAND_5G        (1 << 2)
1439 #define WL_CHAN_RADAR        (1 << 3)
1440 #define WL_CHAN_INACTIVE    (1 << 4)
1441 #define WL_CHAN_PASSIVE        (1 << 5)
1442 #define WL_CHAN_RESTRICTED    (1 << 6)
1443 #define    WL_BTC_DISABLE        0
1444 #define WL_BTC_ENABLE        (1 << 0)
1445 #define WL_BTC_PREMPT        (1 << 1)
1446 #define WL_BTC_PARTIAL        (1 << 2)
1447 #define WL_BTC_DEFAULT        (1 << 3)
1448 #define WL_BTC_HYBRID        (WL_BTC_ENABLE | WL_BTC_PARTIAL)
1449 #define WL_INF_BTC_DISABLE      0
1450 #define WL_INF_BTC_ENABLE       1
1451 #define WL_INF_BTC_AUTO         3
1452 #define    WL_BTC_DEFWIRE        0
1453 #define WL_BTC_2WIRE        2
1454 #define WL_BTC_3WIRE        3
1455 #define WL_BTC_4WIRE        4
1456 #define WL_BTC_FLAG_PREMPT               (1 << 0)
1457 #define WL_BTC_FLAG_BT_DEF               (1 << 1)
1458 #define WL_BTC_FLAG_ACTIVE_PROT          (1 << 2)
1459 #define WL_BTC_FLAG_SIM_RSP              (1 << 3)
1460 #define WL_BTC_FLAG_PS_PROTECT           (1 << 4)
1461 #define WL_BTC_FLAG_SIM_TX_LP             (1 << 5)
1462 #define WL_BTC_FLAG_ECI                  (1 << 6)
1463 #define WL_ERROR_VAL        0x00000001
1464 #define WL_TRACE_VAL        0x00000002
1465 #define WL_PRHDRS_VAL        0x00000004
1466 #define WL_PRPKT_VAL        0x00000008
1467 #define WL_INFORM_VAL        0x00000010
1468 #define WL_TMP_VAL        0x00000020
1469 #define WL_OID_VAL        0x00000040
1470 #define WL_RATE_VAL        0x00000080
1471 #define WL_ASSOC_VAL        0x00000100
1472 #define WL_PRUSR_VAL        0x00000200
1473 #define WL_PS_VAL        0x00000400
1474 #define WL_TXPWR_VAL        0x00000800
1475 #define WL_PORT_VAL        0x00001000
1476 #define WL_DUAL_VAL        0x00002000
1477 #define WL_WSEC_VAL        0x00004000
1478 #define WL_WSEC_DUMP_VAL    0x00008000
1479 #define WL_LOG_VAL        0x00010000
1480 #define WL_NRSSI_VAL        0x00020000
1481 #define WL_LOFT_VAL        0x00040000
1482 #define WL_REGULATORY_VAL    0x00080000
1483 #define WL_PHYCAL_VAL        0x00100000
1484 #define WL_RADAR_VAL        0x00200000
1485 #define WL_MPC_VAL        0x00400000
1486 #define WL_APSTA_VAL        0x00800000
1487 #define WL_DFS_VAL        0x01000000
1488 #define WL_BA_VAL        0x02000000
1489 #define WL_NITRO_VAL        0x04000000
1490 #define WL_MBSS_VAL        0x04000000
1491 #define WL_CAC_VAL        0x08000000
1492 #define WL_AMSDU_VAL        0x10000000
1493 #define WL_AMPDU_VAL        0x20000000
1494 #define WL_FFPLD_VAL        0x40000000
1495 #define WL_NIN_VAL        0x80000000
1496 #define WL_DPT_VAL         0x00000001
1497 #define WL_SCAN_VAL        0x00000002
1498 #define WL_WOWL_VAL        0x00000004
1499 #define WL_COEX_VAL        0x00000008
1500 #define WL_RTDC_VAL        0x00000010
1501 #define WL_BTA_VAL        0x00000040
1502 #define    WL_LED_NUMGPIO        16
1503 #define    WL_LED_OFF        0
1504 #define    WL_LED_ON        1
1505 #define    WL_LED_ACTIVITY        2
1506 #define    WL_LED_RADIO        3
1507 #define    WL_LED_ARADIO        4
1508 #define    WL_LED_BRADIO        5
1509 #define    WL_LED_BGMODE        6
1510 #define    WL_LED_WI1        7
1511 #define    WL_LED_WI2        8
1512 #define    WL_LED_WI3        9
1513 #define    WL_LED_ASSOC        10
1514 #define    WL_LED_INACTIVE        11
1515 #define    WL_LED_ASSOCACT        12
1516 #define    WL_LED_NUMBEHAVIOR    13
1517 #define    WL_LED_BEH_MASK        0x7f
1518 #define    WL_LED_AL_MASK        0x80
1519 #define WL_NUMCHANNELS        64
1520 #define WL_NUMCHANSPECS        100
1521 #define WL_WDS_WPA_ROLE_AUTH    0
1522 #define WL_WDS_WPA_ROLE_SUP    1
1523 #define WL_WDS_WPA_ROLE_AUTO    255
1524 #define WL_EVENTING_MASK_LEN    16
1525 
1526 #define VNDR_IE_CMD_LEN        4
1527 #define VNDR_IE_BEACON_FLAG    0x1
1528 #define VNDR_IE_PRBRSP_FLAG    0x2
1529 #define VNDR_IE_ASSOCRSP_FLAG    0x4
1530 #define VNDR_IE_AUTHRSP_FLAG    0x8
1531 #define VNDR_IE_PRBREQ_FLAG    0x10
1532 #define VNDR_IE_ASSOCREQ_FLAG    0x20
1533 #define VNDR_IE_CUSTOM_FLAG        0x100
1534 #define VNDR_IE_INFO_HDR_LEN    (sizeof(uint32_t) )
1535 struct wl_vndr_ie
1536 {
1537     uint8_t id;
1538     uint8_t len;
1539     uint8_t oui[3];
1540     uint8_t data[1];
1541 };
1542 typedef struct wl_vndr_ie wl_vndr_ie_t;
1543 typedef struct
1544 {
1545     uint32_t pktflag;
1546     wl_vndr_ie_t vndr_ie_data;
1547 } vndr_ie_info_t;
1548 typedef struct
1549 {
1550     int32_t iecount;
1551     vndr_ie_info_t vndr_ie_list[1];
1552 } vndr_ie_buf_t;
1553 typedef struct
1554 {
1555     int8_t cmd[VNDR_IE_CMD_LEN];
1556     vndr_ie_buf_t vndr_ie_buffer;
1557 } vndr_ie_setbuf_t;
1558 #define WL_JOIN_PREF_RSSI    1
1559 #define WL_JOIN_PREF_WPA    2
1560 #define WL_JOIN_PREF_BAND    3
1561 #define WLJP_BAND_ASSOC_PREF    255
1562 #define WL_WPA_ACP_MCS_ANY    "\x00\x00\x00\x00"
1563 struct tsinfo_arg
1564 {
1565     uint8_t octets[3];
1566 };
1567 #define NREINITREASONCOUNT      8
1568 /* XXX NREINITREASONCOUNT is 8 in other branches.
1569  * Any change to this will break wl tool compatibility with other branches
1570  * #define NREINITREASONCOUNT   WL_REINIT_RC_LAST
1571  */
1572 
1573 #define    NFIFO            6
1574 #define    WL_CNT_T_VERSION    6
1575 #define    WL_CNT_EXT_T_VERSION    1
1576 #define    WL_PHYRATE_LOG_SIZE     1200
1577 typedef struct
1578 {
1579     uint16_t version;             /**< see definition of WL_CNT_T_VERSION */
1580     uint16_t datalen;             /**< length of data including all paddings. */
1581     uint8_t data[1];              /**< variable length payload:
1582                                    * 1 or more bcm_xtlv_t type of tuples.
1583                                    * each tuple is padded to multiple of 4 bytes.
1584                                    * 'datalen' field of this structure includes all paddings.
1585                                    */
1586 } wl_cnt_info_t;
1587 /** wlc layer counters */
1588 typedef struct
1589 {
1590     /* transmit stat counters */
1591     uint32_t txframe;       /**< tx data frames */
1592     uint32_t txbyte;        /**< tx data bytes */
1593     uint32_t txretrans;     /**< tx mac retransmits */
1594     uint32_t txerror;       /**< tx data errors (derived: sum of others) */
1595     uint32_t txctl;         /**< tx management frames */
1596     uint32_t txprshort;     /**< tx short preamble frames */
1597     uint32_t txserr;        /**< tx status errors */
1598     uint32_t txnobuf;       /**< tx out of buffers errors */
1599     uint32_t txnoassoc;     /**< tx discard because we're not associated */
1600     uint32_t txrunt;        /**< tx runt frames */
1601     uint32_t txchit;        /**< tx header cache hit (fastpath) */
1602     uint32_t txcmiss;       /**< tx header cache miss (slowpath) */
1603 
1604     /* transmit chip error counters */
1605     uint32_t txuflo;        /**< tx fifo underflows */
1606     uint32_t txphyerr;      /**< tx phy errors (indicated in tx status) */
1607     uint32_t txphycrs;      /**< PR8861/8963 counter */
1608 
1609     /* receive stat counters */
1610     uint32_t rxframe;       /**< rx data frames */
1611     uint32_t rxbyte;        /**< rx data bytes */
1612     uint32_t rxerror;       /**< rx data errors (derived: sum of others) */
1613     uint32_t rxctl;         /**< rx management frames */
1614     uint32_t rxnobuf;       /**< rx out of buffers errors */
1615     uint32_t rxnondata;     /**< rx non data frames in the data channel errors */
1616     uint32_t rxbadds;       /**< rx bad DS errors */
1617     uint32_t rxbadcm;       /**< rx bad control or management frames */
1618     uint32_t rxfragerr;     /**< rx fragmentation errors */
1619     uint32_t rxrunt;        /**< rx runt frames */
1620     uint32_t rxgiant;       /**< rx giant frames */
1621     uint32_t rxnoscb;       /**< rx no scb error */
1622     uint32_t rxbadproto;    /**< rx invalid frames */
1623     uint32_t rxbadsrcmac;       /**< rx frames with Invalid Src Mac */
1624     uint32_t rxbadda;       /**< rx frames tossed for invalid da */
1625     uint32_t rxfilter;      /**< rx frames filtered out */
1626 
1627     /* receive chip error counters */
1628     uint32_t rxoflo;        /**< rx fifo overflow errors */
1629     uint32_t rxuflo[NFIFO];     /**< rx dma descriptor underflow errors */
1630 
1631     uint32_t d11cnt_txrts_off;      /**< d11cnt txrts value when reset d11cnt */
1632     uint32_t d11cnt_rxcrc_off;      /**< d11cnt rxcrc value when reset d11cnt */
1633     uint32_t d11cnt_txnocts_off;    /**< d11cnt txnocts value when reset d11cnt */
1634 
1635     /* misc counters */
1636     uint32_t dmade;         /**< tx/rx dma descriptor errors */
1637     uint32_t dmada;         /**< tx/rx dma data errors */
1638     uint32_t dmape;         /**< tx/rx dma descriptor protocol errors */
1639     uint32_t reset;         /**< reset count */
1640     uint32_t tbtt;          /**< cnts the TBTT int's */
1641     uint32_t txdmawar;      /**< # occurrences of PR15420 workaround */
1642     uint32_t pkt_callback_reg_fail;     /**< callbacks register failure */
1643 
1644     /* 802.11 MIB counters, pp. 614 of 802.11 reaff doc. */
1645     uint32_t txfrag;        /**< dot11TransmittedFragmentCount */
1646     uint32_t txmulti;       /**< dot11MulticastTransmittedFrameCount */
1647     uint32_t txfail;        /**< dot11FailedCount */
1648     uint32_t txretry;       /**< dot11RetryCount */
1649     uint32_t txretrie;      /**< dot11MultipleRetryCount */
1650     uint32_t rxdup;         /**< dot11FrameduplicateCount */
1651     uint32_t txrts;         /**< dot11RTSSuccessCount */
1652     uint32_t txnocts;       /**< dot11RTSFailureCount */
1653     uint32_t txnoack;       /**< dot11ACKFailureCount */
1654     uint32_t rxfrag;        /**< dot11ReceivedFragmentCount */
1655     uint32_t rxmulti;       /**< dot11MulticastReceivedFrameCount */
1656     uint32_t rxcrc;         /**< dot11FCSErrorCount */
1657     uint32_t txfrmsnt;      /**< dot11TransmittedFrameCount (bogus MIB?) */
1658     uint32_t rxundec;       /**< dot11WEPUndecryptableCount */
1659 
1660     /* WPA2 counters (see rxundec for DecryptFailureCount) */
1661     uint32_t tkipmicfaill;      /**< TKIPLocalMICFailures */
1662     uint32_t tkipcntrmsr;       /**< TKIPCounterMeasuresInvoked */
1663     uint32_t tkipreplay;    /**< TKIPReplays */
1664     uint32_t ccmpfmterr;    /**< CCMPFormatErrors */
1665     uint32_t ccmpreplay;    /**< CCMPReplays */
1666     uint32_t ccmpundec;     /**< CCMPDecryptErrors */
1667     uint32_t fourwayfail;       /**< FourWayHandshakeFailures */
1668     uint32_t wepundec;      /**< dot11WEPUndecryptableCount */
1669     uint32_t wepicverr;     /**< dot11WEPICVErrorCount */
1670     uint32_t decsuccess;    /**< DecryptSuccessCount */
1671     uint32_t tkipicverr;    /**< TKIPICVErrorCount */
1672     uint32_t wepexcluded;       /**< dot11WEPExcludedCount */
1673 
1674     uint32_t txchanrej;     /**< Tx frames suppressed due to channel rejection */
1675     uint32_t psmwds;        /**< Count PSM watchdogs */
1676     uint32_t phywatchdog;       /**< Count Phy watchdogs (triggered by ucode) */
1677 
1678     /* MBSS counters, AP only */
1679     uint32_t prq_entries_handled;       /**< PRQ entries read in */
1680     uint32_t prq_undirected_entries;    /**<    which were bcast bss & ssid */
1681     uint32_t prq_bad_entries;       /**<    which could not be translated to info */
1682     uint32_t atim_suppress_count;       /**< TX suppressions on ATIM fifo */
1683     uint32_t bcn_template_not_ready;    /**< Template marked in use on send bcn ... */
1684     uint32_t bcn_template_not_ready_done;    /**< ...but "DMA done" interrupt rcvd */
1685     uint32_t late_tbtt_dpc;     /**< TBTT DPC did not happen in time */
1686 
1687     /* per-rate receive stat counters */
1688     uint32_t rx1mbps;   /**< packets rx at 1Mbps */
1689     uint32_t rx2mbps;   /**< packets rx at 2Mbps */
1690     uint32_t rx5mbps5;  /**< packets rx at 5.5Mbps */
1691     uint32_t rx6mbps;   /**< packets rx at 6Mbps */
1692     uint32_t rx9mbps;   /**< packets rx at 9Mbps */
1693     uint32_t rx11mbps;  /**< packets rx at 11Mbps */
1694     uint32_t rx12mbps;  /**< packets rx at 12Mbps */
1695     uint32_t rx18mbps;  /**< packets rx at 18Mbps */
1696     uint32_t rx24mbps;  /**< packets rx at 24Mbps */
1697     uint32_t rx36mbps;  /**< packets rx at 36Mbps */
1698     uint32_t rx48mbps;  /**< packets rx at 48Mbps */
1699     uint32_t rx54mbps;  /**< packets rx at 54Mbps */
1700     uint32_t rx108mbps;     /**< packets rx at 108mbps */
1701     uint32_t rx162mbps;     /**< packets rx at 162mbps */
1702     uint32_t rx216mbps;     /**< packets rx at 216 mbps */
1703     uint32_t rx270mbps;     /**< packets rx at 270 mbps */
1704     uint32_t rx324mbps;     /**< packets rx at 324 mbps */
1705     uint32_t rx378mbps;     /**< packets rx at 378 mbps */
1706     uint32_t rx432mbps;     /**< packets rx at 432 mbps */
1707     uint32_t rx486mbps;     /**< packets rx at 486 mbps */
1708     uint32_t rx540mbps;     /**< packets rx at 540 mbps */
1709 
1710     uint32_t rfdisable;     /**< count of radio disables */
1711 
1712     uint32_t txexptime;     /**< Tx frames suppressed due to timer expiration */
1713 
1714     uint32_t txmpdu_sgi;    /**< count for sgi transmit */
1715     uint32_t rxmpdu_sgi;    /**< count for sgi received */
1716     uint32_t txmpdu_stbc;       /**< count for stbc transmit */
1717     uint32_t rxmpdu_stbc;       /**< count for stbc received */
1718 
1719     uint32_t rxundec_mcst;      /**< dot11WEPUndecryptableCount */
1720 
1721     /* WPA2 counters (see rxundec for DecryptFailureCount) */
1722     uint32_t tkipmicfaill_mcst;     /**< TKIPLocalMICFailures */
1723     uint32_t tkipcntrmsr_mcst;      /**< TKIPCounterMeasuresInvoked */
1724     uint32_t tkipreplay_mcst;       /**< TKIPReplays */
1725     uint32_t ccmpfmterr_mcst;       /**< CCMPFormatErrors */
1726     uint32_t ccmpreplay_mcst;       /**< CCMPReplays */
1727     uint32_t ccmpundec_mcst;    /**< CCMPDecryptErrors */
1728     uint32_t fourwayfail_mcst;      /**< FourWayHandshakeFailures */
1729     uint32_t wepundec_mcst;     /**< dot11WEPUndecryptableCount */
1730     uint32_t wepicverr_mcst;    /**< dot11WEPICVErrorCount */
1731     uint32_t decsuccess_mcst;       /**< DecryptSuccessCount */
1732     uint32_t tkipicverr_mcst;       /**< TKIPICVErrorCount */
1733     uint32_t wepexcluded_mcst;      /**< dot11WEPExcludedCount */
1734 
1735     uint32_t dma_hang;      /**< count for dma hang */
1736     uint32_t reinit;        /**< count for reinit */
1737 
1738     uint32_t pstatxucast;   /**< count of ucast frames xmitted on all psta assoc */
1739     uint32_t pstatxnoassoc;     /**< count of txnoassoc frames xmitted on all psta assoc */
1740     uint32_t pstarxucast;   /**< count of ucast frames received on all psta assoc */
1741     uint32_t pstarxbcmc;    /**< count of bcmc frames received on all psta */
1742     uint32_t pstatxbcmc;    /**< count of bcmc frames transmitted on all psta */
1743 
1744     uint32_t cso_passthrough;  /**< hw cso required but passthrough */
1745     uint32_t cso_normal;    /**< hw cso hdr for normal process */
1746     uint32_t chained;       /**< number of frames chained */
1747     uint32_t chainedsz1;    /**< number of chain size 1 frames */
1748     uint32_t unchained;     /**< number of frames not chained */
1749     uint32_t maxchainsz;    /**< max chain size so far */
1750     uint32_t currchainsz;       /**< current chain size */
1751     uint32_t pciereset;     /**< Secondary Bus Reset issued by driver */
1752     uint32_t cfgrestore;    /**< configspace restore by driver */
1753     uint32_t reinitreason[NREINITREASONCOUNT];    /**< reinitreason counters; 0: Unknown reason */
1754     uint32_t rxrtry;
1755     uint32_t rxmpdu_mu;       /**< Number of MU MPDUs received */
1756 
1757     /* detailed control/management frames */
1758     uint32_t txbar;         /**< Number of TX BAR */
1759     uint32_t rxbar;         /**< Number of RX BAR */
1760     uint32_t txpspoll;      /**< Number of TX PS-poll */
1761     uint32_t rxpspoll;      /**< Number of RX PS-poll */
1762     uint32_t txnull;        /**< Number of TX NULL_DATA */
1763     uint32_t rxnull;        /**< Number of RX NULL_DATA */
1764     uint32_t txqosnull;     /**< Number of TX NULL_QoSDATA */
1765     uint32_t rxqosnull;     /**< Number of RX NULL_QoSDATA */
1766     uint32_t txassocreq;    /**< Number of TX ASSOC request */
1767     uint32_t rxassocreq;    /**< Number of RX ASSOC request */
1768     uint32_t txreassocreq;      /**< Number of TX REASSOC request */
1769     uint32_t rxreassocreq;      /**< Number of RX REASSOC request */
1770     uint32_t txdisassoc;    /**< Number of TX DISASSOC */
1771     uint32_t rxdisassoc;    /**< Number of RX DISASSOC */
1772     uint32_t txassocrsp;    /**< Number of TX ASSOC response */
1773     uint32_t rxassocrsp;    /**< Number of RX ASSOC response */
1774     uint32_t txreassocrsp;      /**< Number of TX REASSOC response */
1775     uint32_t rxreassocrsp;      /**< Number of RX REASSOC response */
1776     uint32_t txauth;        /**< Number of TX AUTH */
1777     uint32_t rxauth;        /**< Number of RX AUTH */
1778     uint32_t txdeauth;      /**< Number of TX DEAUTH */
1779     uint32_t rxdeauth;      /**< Number of RX DEAUTH */
1780     uint32_t txprobereq;    /**< Number of TX probe request */
1781     uint32_t rxprobereq;    /**< Number of RX probe request */
1782     uint32_t txprobersp;    /**< Number of TX probe response */
1783     uint32_t rxprobersp;    /**< Number of RX probe response */
1784     uint32_t txaction;      /**< Number of TX action frame */
1785     uint32_t rxaction;      /**< Number of RX action frame */
1786     uint32_t ampdu_wds;     /**< Number of AMPDU watchdogs */
1787     uint32_t txlost;        /**< Number of lost packets reported in txs */
1788     uint32_t txdatamcast;       /**< Number of TX multicast data packets */
1789     uint32_t txdatabcast;       /**< Number of TX broadcast data packets */
1790     uint32_t psmxwds;       /**< Number of PSMx watchdogs */
1791     uint32_t rxback;
1792     uint32_t txback;
1793     uint32_t p2p_tbtt;  /**< Number of P2P TBTT Events */
1794     uint32_t p2p_tbtt_miss;     /**< Number of P2P TBTT Events Miss */
1795     uint32_t txqueue_start;
1796     uint32_t txqueue_end;
1797     uint32_t txbcast;         /* Broadcast TransmittedFrameCount */
1798     uint32_t txdropped;       /* tx dropped pkts */
1799     uint32_t rxbcast;         /* BroadcastReceivedFrameCount */
1800     uint32_t rxdropped;       /* rx dropped pkts (derived: sum of others) */
1801     /* XXX: Do not remove or rename inthe middle of this struct.
1802      * All counter variables have to be of uint32_t.
1803      * Please follow the instruction in
1804      * http://hwnbu-twiki.sj.broadcom.com/bin/view/Mwgroup/WlCounters#Counter_Edition
1805      */
1806 } wl_cnt_ver_30_t;
1807 typedef struct
1808 {
1809     uint16_t version;     /* see definition of WL_CNT_T_VERSION */
1810     uint16_t length;     /* length of entire structure */
1811 
1812     /* transmit stat counters */
1813     uint32_t txframe;     /* tx data frames */
1814     uint32_t txbyte;     /* tx data bytes */
1815     uint32_t txretrans;     /* tx mac retransmits */
1816     uint32_t txerror;     /* tx data errors (derived: sum of others) */
1817     uint32_t txctl;     /* tx management frames */
1818     uint32_t txprshort;     /* tx short preamble frames */
1819     uint32_t txserr;     /* tx status errors */
1820     uint32_t txnobuf;     /* tx out of buffers errors */
1821     uint32_t txnoassoc;     /* tx discard because we're not associated */
1822     uint32_t txrunt;     /* tx runt frames */
1823     uint32_t txchit;     /* tx header cache hit (fastpath) */
1824     uint32_t txcmiss;     /* tx header cache miss (slowpath) */
1825 
1826     /* transmit chip error counters */
1827     uint32_t txuflo;     /* tx fifo underflows */
1828     uint32_t txphyerr;     /* tx phy errors (indicated in tx status) */
1829     uint32_t txphycrs;     /* PR8861/8963 counter */
1830 
1831     /* receive stat counters */
1832     uint32_t rxframe;     /* rx data frames */
1833     uint32_t rxbyte;     /* rx data bytes */
1834     uint32_t rxerror;     /* rx data errors (derived: sum of others) */
1835     uint32_t rxctl;     /* rx management frames */
1836     uint32_t rxnobuf;     /* rx out of buffers errors */
1837     uint32_t rxnondata;     /* rx non data frames in the data channel errors */
1838     uint32_t rxbadds;     /* rx bad DS errors */
1839     uint32_t rxbadcm;     /* rx bad control or management frames */
1840     uint32_t rxfragerr;     /* rx fragmentation errors */
1841     uint32_t rxrunt;     /* rx runt frames */
1842     uint32_t rxgiant;     /* rx giant frames */
1843     uint32_t rxnoscb;     /* rx no scb error */
1844     uint32_t rxbadproto;     /* rx invalid frames */
1845     uint32_t rxbadsrcmac;     /* rx frames with Invalid Src Mac */
1846     uint32_t rxbadda;     /* rx frames tossed for invalid da */
1847     uint32_t rxfilter;     /* rx frames filtered out */
1848 
1849     /* receive chip error counters */
1850     uint32_t rxoflo;     /* rx fifo overflow errors */
1851     uint32_t rxuflo[NFIFO];     /* rx dma descriptor underflow errors */
1852 
1853     uint32_t d11cnt_txrts_off;     /* d11cnt txrts value when reset d11cnt */
1854     uint32_t d11cnt_rxcrc_off;     /* d11cnt rxcrc value when reset d11cnt */
1855     uint32_t d11cnt_txnocts_off;     /* d11cnt txnocts value when reset d11cnt */
1856 
1857     /* misc counters */
1858     uint32_t dmade;     /* tx/rx dma descriptor errors */
1859     uint32_t dmada;     /* tx/rx dma data errors */
1860     uint32_t dmape;     /* tx/rx dma descriptor protocol errors */
1861     uint32_t reset;     /* reset count */
1862     uint32_t tbtt;     /* cnts the TBTT int's */
1863     uint32_t txdmawar;     /* # occurrences of PR15420 workaround */
1864     uint32_t pkt_callback_reg_fail;     /* callbacks register failure */
1865 
1866     /* MAC counters: 32-bit version of d11.h's macstat_t */
1867     uint32_t txallfrm;     /* total number of frames sent, incl. Data, ACK, RTS, CTS,
1868                             * Control Management (includes retransmissions)
1869                             */
1870     uint32_t txrtsfrm;     /* number of RTS sent out by the MAC */
1871     uint32_t txctsfrm;     /* number of CTS sent out by the MAC */
1872     uint32_t txackfrm;     /* number of ACK frames sent out */
1873     uint32_t txdnlfrm;     /* Not used */
1874     uint32_t txbcnfrm;     /* beacons transmitted */
1875     uint32_t txfunfl[8];     /* per-fifo tx underflows */
1876     uint32_t txtplunfl;     /* Template underflows (mac was too slow to transmit ACK/CTS
1877                              * or BCN)
1878                              */
1879     uint32_t txphyerror;     /* Transmit phy error, type of error is reported in tx-status for
1880                               * driver enqueued frames
1881                               */
1882     uint32_t rxfrmtoolong;     /* Received frame longer than legal limit (2346 bytes) */
1883     uint32_t rxfrmtooshrt;     /* Received frame did not contain enough bytes for its frame type */
1884     uint32_t rxinvmachdr;     /* Either the protocol version != 0 or frame type not
1885                                * data/control/management
1886                                */
1887     uint32_t rxbadfcs;     /* number of frames for which the CRC check failed in the MAC */
1888     uint32_t rxbadplcp;     /* parity check of the PLCP header failed */
1889     uint32_t rxcrsglitch;     /* PHY was able to correlate the preamble but not the header */
1890     uint32_t rxstrt;     /* Number of received frames with a good PLCP
1891                           * (i.e. passing parity check)
1892                           */
1893     uint32_t rxdfrmucastmbss;     /* Number of received DATA frames with good FCS and matching RA */
1894     uint32_t rxmfrmucastmbss;     /* number of received mgmt frames with good FCS and matching RA */
1895     uint32_t rxcfrmucast;     /* number of received CNTRL frames with good FCS and matching RA */
1896     uint32_t rxrtsucast;     /* number of unicast RTS addressed to the MAC (good FCS) */
1897     uint32_t rxctsucast;     /* number of unicast CTS addressed to the MAC (good FCS) */
1898     uint32_t rxackucast;     /* number of ucast ACKS received (good FCS) */
1899     uint32_t rxdfrmocast;     /* number of received DATA frames (good FCS and not matching RA) */
1900     uint32_t rxmfrmocast;     /* number of received MGMT frames (good FCS and not matching RA) */
1901     uint32_t rxcfrmocast;     /* number of received CNTRL frame (good FCS and not matching RA) */
1902     uint32_t rxrtsocast;     /* number of received RTS not addressed to the MAC */
1903     uint32_t rxctsocast;     /* number of received CTS not addressed to the MAC */
1904     uint32_t rxdfrmmcast;     /* number of RX Data multicast frames received by the MAC */
1905     uint32_t rxmfrmmcast;     /* number of RX Management multicast frames received by the MAC */
1906     uint32_t rxcfrmmcast;     /* number of RX Control multicast frames received by the MAC
1907                                * (unlikely to see these)
1908                                */
1909     uint32_t rxbeaconmbss;     /* beacons received from member of BSS */
1910     uint32_t rxdfrmucastobss;     /* number of unicast frames addressed to the MAC from
1911                                    * other BSS (WDS FRAME)
1912                                    */
1913     uint32_t rxbeaconobss;     /* beacons received from other BSS */
1914     uint32_t rxrsptmout;     /* Number of response timeouts for transmitted frames
1915                               * expecting a response
1916                               */
1917     uint32_t bcntxcancl;     /* transmit beacons canceled due to receipt of beacon (IBSS) */
1918     uint32_t rxf0ovfl;     /* Number of receive fifo 0 overflows */
1919     uint32_t rxf1ovfl;     /* Number of receive fifo 1 overflows (obsolete) */
1920     uint32_t rxf2ovfl;     /* Number of receive fifo 2 overflows (obsolete) */
1921     uint32_t txsfovfl;     /* Number of transmit status fifo overflows (obsolete) */
1922     uint32_t pmqovfl;     /* Number of PMQ overflows */
1923     uint32_t rxcgprqfrm;     /* Number of received Probe requests that made it into
1924                               * the PRQ fifo
1925                               */
1926     uint32_t rxcgprsqovfl;     /* Rx Probe Request Que overflow in the AP */
1927     uint32_t txcgprsfail;     /* Tx Probe Response Fail. AP sent probe response but did
1928                                * not get ACK
1929                                */
1930     uint32_t txcgprssuc;     /* Tx Probe Response Success (ACK was received) */
1931     uint32_t prs_timeout;     /* Number of probe requests that were dropped from the PRQ
1932                                * fifo because a probe response could not be sent out within
1933                                * the time limit defined in M_PRS_MAXTIME
1934                                */
1935     uint32_t rxnack;     /* XXX Number of NACKS received (Afterburner) */
1936     uint32_t frmscons;     /* XXX Number of frames completed without transmission because of an
1937                             * Afterburner re-queue
1938                             */
1939     uint32_t txnack;     /* XXX Number of NACKs transmitted (Afterburner) */
1940     uint32_t txglitch_nack;     /* obsolete */
1941     uint32_t txburst;     /* obsolete */
1942 
1943     /* 802.11 MIB counters, pp. 614 of 802.11 reaff doc. */
1944     uint32_t txfrag;     /* dot11TransmittedFragmentCount */
1945     uint32_t txmulti;     /* dot11MulticastTransmittedFrameCount */
1946     uint32_t txfail;     /* dot11FailedCount */
1947     uint32_t txretry;     /* dot11RetryCount */
1948     uint32_t txretrie;     /* dot11MultipleRetryCount */
1949     uint32_t rxdup;     /* dot11FrameduplicateCount */
1950     uint32_t txrts;     /* dot11RTSSuccessCount */
1951     uint32_t txnocts;     /* dot11RTSFailureCount */
1952     uint32_t txnoack;     /* dot11ACKFailureCount */
1953     uint32_t rxfrag;     /* dot11ReceivedFragmentCount */
1954     uint32_t rxmulti;     /* dot11MulticastReceivedFrameCount */
1955     uint32_t rxcrc;     /* dot11FCSErrorCount */
1956     uint32_t txfrmsnt;     /* dot11TransmittedFrameCount (bogus MIB?) */
1957     uint32_t rxundec;     /* dot11WEPUndecryptableCount */
1958 
1959     /* WPA2 counters (see rxundec for DecryptFailureCount) */
1960     uint32_t tkipmicfaill;     /* TKIPLocalMICFailures */
1961     uint32_t tkipcntrmsr;     /* TKIPCounterMeasuresInvoked */
1962     uint32_t tkipreplay;     /* TKIPReplays */
1963     uint32_t ccmpfmterr;     /* CCMPFormatErrors */
1964     uint32_t ccmpreplay;     /* CCMPReplays */
1965     uint32_t ccmpundec;     /* CCMPDecryptErrors */
1966     uint32_t fourwayfail;     /* FourWayHandshakeFailures */
1967     uint32_t wepundec;     /* dot11WEPUndecryptableCount */
1968     uint32_t wepicverr;     /* dot11WEPICVErrorCount */
1969     uint32_t decsuccess;     /* DecryptSuccessCount */
1970     uint32_t tkipicverr;     /* TKIPICVErrorCount */
1971     uint32_t wepexcluded;     /* dot11WEPExcludedCount */
1972 
1973     uint32_t rxundec_mcst;     /* dot11WEPUndecryptableCount */
1974 
1975     /* WPA2 counters (see rxundec for DecryptFailureCount) */
1976     uint32_t tkipmicfaill_mcst;     /* TKIPLocalMICFailures */
1977     uint32_t tkipcntrmsr_mcst;     /* TKIPCounterMeasuresInvoked */
1978     uint32_t tkipreplay_mcst;     /* TKIPReplays */
1979     uint32_t ccmpfmterr_mcst;     /* CCMPFormatErrors */
1980     uint32_t ccmpreplay_mcst;     /* CCMPReplays */
1981     uint32_t ccmpundec_mcst;     /* CCMPDecryptErrors */
1982     uint32_t fourwayfail_mcst;     /* FourWayHandshakeFailures */
1983     uint32_t wepundec_mcst;     /* dot11WEPUndecryptableCount */
1984     uint32_t wepicverr_mcst;     /* dot11WEPICVErrorCount */
1985     uint32_t decsuccess_mcst;     /* DecryptSuccessCount */
1986     uint32_t tkipicverr_mcst;     /* TKIPICVErrorCount */
1987     uint32_t wepexcluded_mcst;     /* dot11WEPExcludedCount */
1988 
1989     uint32_t txchanrej;     /* Tx frames suppressed due to channel rejection */
1990     uint32_t txexptime;     /* Tx frames suppressed due to timer expiration */
1991     uint32_t psmwds;     /* Count PSM watchdogs */
1992     uint32_t phywatchdog;     /* Count Phy watchdogs (triggered by ucode) */
1993 
1994     /* MBSS counters, AP only */
1995     uint32_t prq_entries_handled;     /* PRQ entries read in */
1996     uint32_t prq_undirected_entries;     /*    which were bcast bss & ssid */
1997     uint32_t prq_bad_entries;     /*    which could not be translated to info */
1998     uint32_t atim_suppress_count;     /* TX suppressions on ATIM fifo */
1999     uint32_t bcn_template_not_ready;     /* Template marked in use on send bcn ... */
2000     uint32_t bcn_template_not_ready_done;     /* ...but "DMA done" interrupt rcvd */
2001     uint32_t late_tbtt_dpc;     /* TBTT DPC did not happen in time */
2002 
2003     /* per-rate receive stat counters */
2004     uint32_t rx1mbps;     /* packets rx at 1Mbps */
2005     uint32_t rx2mbps;     /* packets rx at 2Mbps */
2006     uint32_t rx5mbps5;     /* packets rx at 5.5Mbps */
2007     uint32_t rx6mbps;     /* packets rx at 6Mbps */
2008     uint32_t rx9mbps;     /* packets rx at 9Mbps */
2009     uint32_t rx11mbps;     /* packets rx at 11Mbps */
2010     uint32_t rx12mbps;     /* packets rx at 12Mbps */
2011     uint32_t rx18mbps;     /* packets rx at 18Mbps */
2012     uint32_t rx24mbps;     /* packets rx at 24Mbps */
2013     uint32_t rx36mbps;     /* packets rx at 36Mbps */
2014     uint32_t rx48mbps;     /* packets rx at 48Mbps */
2015     uint32_t rx54mbps;     /* packets rx at 54Mbps */
2016     uint32_t rx108mbps;     /* packets rx at 108mbps */
2017     uint32_t rx162mbps;     /* packets rx at 162mbps */
2018     uint32_t rx216mbps;     /* packets rx at 216 mbps */
2019     uint32_t rx270mbps;     /* packets rx at 270 mbps */
2020     uint32_t rx324mbps;     /* packets rx at 324 mbps */
2021     uint32_t rx378mbps;     /* packets rx at 378 mbps */
2022     uint32_t rx432mbps;     /* packets rx at 432 mbps */
2023     uint32_t rx486mbps;     /* packets rx at 486 mbps */
2024     uint32_t rx540mbps;     /* packets rx at 540 mbps */
2025 
2026     /* pkteng rx frame stats */
2027     uint32_t pktengrxducast;     /* unicast frames rxed by the pkteng code */
2028     uint32_t pktengrxdmcast;     /* multicast frames rxed by the pkteng code */
2029 
2030     uint32_t rfdisable;     /* count of radio disables */
2031     uint32_t bphy_rxcrsglitch;     /* PHY count of bphy glitches */
2032 
2033     uint32_t txmpdu_sgi;     /* count for sgi transmit */
2034     uint32_t rxmpdu_sgi;     /* count for sgi received */
2035     uint32_t txmpdu_stbc;     /* count for stbc transmit */
2036     uint32_t rxmpdu_stbc;     /* count for stbc received */
2037 } wl_cnt_ver_six_t;
2038 
2039 typedef struct
2040 {
2041     uint16_t version;     /* see definition of WL_CNT_T_VERSION */
2042     uint16_t length;     /* length of entire structure */
2043 
2044     /* transmit stat counters */
2045     uint32_t txframe;     /* tx data frames */
2046     uint32_t txbyte;     /* tx data bytes */
2047     uint32_t txretrans;     /* tx mac retransmits */
2048     uint32_t txerror;     /* tx data errors (derived: sum of others) */
2049     uint32_t txctl;     /* tx management frames */
2050     uint32_t txprshort;     /* tx short preamble frames */
2051     uint32_t txserr;     /* tx status errors */
2052     uint32_t txnobuf;     /* tx out of buffers errors */
2053     uint32_t txnoassoc;     /* tx discard because we're not associated */
2054     uint32_t txrunt;     /* tx runt frames */
2055     uint32_t txchit;     /* tx header cache hit (fastpath) */
2056     uint32_t txcmiss;     /* tx header cache miss (slowpath) */
2057 
2058     /* transmit chip error counters */
2059     uint32_t txuflo;     /* tx fifo underflows */
2060     uint32_t txphyerr;     /* tx phy errors (indicated in tx status) */
2061     uint32_t txphycrs;     /* PR8861/8963 counter */
2062 
2063     /* receive stat counters */
2064     uint32_t rxframe;     /* rx data frames */
2065     uint32_t rxbyte;     /* rx data bytes */
2066     uint32_t rxerror;     /* rx data errors (derived: sum of others) */
2067     uint32_t rxctl;     /* rx management frames */
2068     uint32_t rxnobuf;     /* rx out of buffers errors */
2069     uint32_t rxnondata;     /* rx non data frames in the data channel errors */
2070     uint32_t rxbadds;     /* rx bad DS errors */
2071     uint32_t rxbadcm;     /* rx bad control or management frames */
2072     uint32_t rxfragerr;     /* rx fragmentation errors */
2073     uint32_t rxrunt;     /* rx runt frames */
2074     uint32_t rxgiant;     /* rx giant frames */
2075     uint32_t rxnoscb;     /* rx no scb error */
2076     uint32_t rxbadproto;     /* rx invalid frames */
2077     uint32_t rxbadsrcmac;     /* rx frames with Invalid Src Mac */
2078     uint32_t rxbadda;     /* rx frames tossed for invalid da */
2079     uint32_t rxfilter;     /* rx frames filtered out */
2080 
2081     /* receive chip error counters */
2082     uint32_t rxoflo;     /* rx fifo overflow errors */
2083     uint32_t rxuflo[NFIFO];     /* rx dma descriptor underflow errors */
2084 
2085     uint32_t d11cnt_txrts_off;     /* d11cnt txrts value when reset d11cnt */
2086     uint32_t d11cnt_rxcrc_off;     /* d11cnt rxcrc value when reset d11cnt */
2087     uint32_t d11cnt_txnocts_off;     /* d11cnt txnocts value when reset d11cnt */
2088 
2089     /* misc counters */
2090     uint32_t dmade;     /* tx/rx dma descriptor errors */
2091     uint32_t dmada;     /* tx/rx dma data errors */
2092     uint32_t dmape;     /* tx/rx dma descriptor protocol errors */
2093     uint32_t reset;     /* reset count */
2094     uint32_t tbtt;     /* cnts the TBTT int's */
2095     uint32_t txdmawar;     /* # occurrences of PR15420 workaround */
2096     uint32_t pkt_callback_reg_fail;     /* callbacks register failure */
2097 
2098     /* MAC counters: 32-bit version of d11.h's macstat_t */
2099     uint32_t txallfrm;     /* total number of frames sent, incl. Data, ACK, RTS, CTS,
2100                             * Control Management (includes retransmissions)
2101                             */
2102     uint32_t txrtsfrm;     /* number of RTS sent out by the MAC */
2103     uint32_t txctsfrm;     /* number of CTS sent out by the MAC */
2104     uint32_t txackfrm;     /* number of ACK frames sent out */
2105     uint32_t txdnlfrm;     /* Not used */
2106     uint32_t txbcnfrm;     /* beacons transmitted */
2107     uint32_t txfunfl[8];     /* per-fifo tx underflows */
2108     uint32_t txtplunfl;     /* Template underflows (mac was too slow to transmit ACK/CTS
2109                              * or BCN)
2110                              */
2111     uint32_t txphyerror;     /* Transmit phy error, type of error is reported in tx-status for
2112                               * driver enqueued frames
2113                               */
2114     uint32_t rxfrmtoolong;     /* Received frame longer than legal limit (2346 bytes) */
2115     uint32_t rxfrmtooshrt;     /* Received frame did not contain enough bytes for its frame type */
2116     uint32_t rxinvmachdr;     /* Either the protocol version != 0 or frame type not
2117                                * data/control/management
2118                                */
2119     uint32_t rxbadfcs;     /* number of frames for which the CRC check failed in the MAC */
2120     uint32_t rxbadplcp;     /* parity check of the PLCP header failed */
2121     uint32_t rxcrsglitch;     /* PHY was able to correlate the preamble but not the header */
2122     uint32_t rxstrt;     /* Number of received frames with a good PLCP
2123                           * (i.e. passing parity check)
2124                           */
2125     uint32_t rxdfrmucastmbss;     /* Number of received DATA frames with good FCS and matching RA */
2126     uint32_t rxmfrmucastmbss;     /* number of received mgmt frames with good FCS and matching RA */
2127     uint32_t rxcfrmucast;     /* number of received CNTRL frames with good FCS and matching RA */
2128     uint32_t rxrtsucast;     /* number of unicast RTS addressed to the MAC (good FCS) */
2129     uint32_t rxctsucast;     /* number of unicast CTS addressed to the MAC (good FCS) */
2130     uint32_t rxackucast;     /* number of ucast ACKS received (good FCS) */
2131     uint32_t rxdfrmocast;     /* number of received DATA frames (good FCS and not matching RA) */
2132     uint32_t rxmfrmocast;     /* number of received MGMT frames (good FCS and not matching RA) */
2133     uint32_t rxcfrmocast;     /* number of received CNTRL frame (good FCS and not matching RA) */
2134     uint32_t rxrtsocast;     /* number of received RTS not addressed to the MAC */
2135     uint32_t rxctsocast;     /* number of received CTS not addressed to the MAC */
2136     uint32_t rxdfrmmcast;     /* number of RX Data multicast frames received by the MAC */
2137     uint32_t rxmfrmmcast;     /* number of RX Management multicast frames received by the MAC */
2138     uint32_t rxcfrmmcast;     /* number of RX Control multicast frames received by the MAC
2139                                * (unlikely to see these)
2140                                */
2141     uint32_t rxbeaconmbss;     /* beacons received from member of BSS */
2142     uint32_t rxdfrmucastobss;     /* number of unicast frames addressed to the MAC from
2143                                    * other BSS (WDS FRAME)
2144                                    */
2145     uint32_t rxbeaconobss;     /* beacons received from other BSS */
2146     uint32_t rxrsptmout;     /* Number of response timeouts for transmitted frames
2147                               * expecting a response
2148                               */
2149     uint32_t bcntxcancl;     /* transmit beacons canceled due to receipt of beacon (IBSS) */
2150     uint32_t rxf0ovfl;     /* Number of receive fifo 0 overflows */
2151     uint32_t rxf1ovfl;     /* Number of receive fifo 1 overflows (obsolete) */
2152     uint32_t rxf2ovfl;     /* Number of receive fifo 2 overflows (obsolete) */
2153     uint32_t txsfovfl;     /* Number of transmit status fifo overflows (obsolete) */
2154     uint32_t pmqovfl;     /* Number of PMQ overflows */
2155     uint32_t rxcgprqfrm;     /* Number of received Probe requests that made it into
2156                               * the PRQ fifo
2157                               */
2158     uint32_t rxcgprsqovfl;     /* Rx Probe Request Que overflow in the AP */
2159     uint32_t txcgprsfail;     /* Tx Probe Response Fail. AP sent probe response but did
2160                                * not get ACK
2161                                */
2162     uint32_t txcgprssuc;     /* Tx Probe Response Success (ACK was received) */
2163     uint32_t prs_timeout;     /* Number of probe requests that were dropped from the PRQ
2164                                * fifo because a probe response could not be sent out within
2165                                * the time limit defined in M_PRS_MAXTIME
2166                                */
2167     uint32_t rxnack;     /* obsolete */
2168     uint32_t frmscons;     /* obsolete */
2169     uint32_t txnack;     /* obsolete */
2170     uint32_t txglitch_nack;     /* obsolete */
2171     uint32_t txburst;     /* obsolete */
2172 
2173     /* 802.11 MIB counters, pp. 614 of 802.11 reaff doc. */
2174     uint32_t txfrag;     /* dot11TransmittedFragmentCount */
2175     uint32_t txmulti;     /* dot11MulticastTransmittedFrameCount */
2176     uint32_t txfail;     /* dot11FailedCount */
2177     uint32_t txretry;     /* dot11RetryCount */
2178     uint32_t txretrie;     /* dot11MultipleRetryCount */
2179     uint32_t rxdup;     /* dot11FrameduplicateCount */
2180     uint32_t txrts;     /* dot11RTSSuccessCount */
2181     uint32_t txnocts;     /* dot11RTSFailureCount */
2182     uint32_t txnoack;     /* dot11ACKFailureCount */
2183     uint32_t rxfrag;     /* dot11ReceivedFragmentCount */
2184     uint32_t rxmulti;     /* dot11MulticastReceivedFrameCount */
2185     uint32_t rxcrc;     /* dot11FCSErrorCount */
2186     uint32_t txfrmsnt;     /* dot11TransmittedFrameCount (bogus MIB?) */
2187     uint32_t rxundec;     /* dot11WEPUndecryptableCount */
2188 
2189     /* WPA2 counters (see rxundec for DecryptFailureCount) */
2190     uint32_t tkipmicfaill;     /* TKIPLocalMICFailures */
2191     uint32_t tkipcntrmsr;     /* TKIPCounterMeasuresInvoked */
2192     uint32_t tkipreplay;     /* TKIPReplays */
2193     uint32_t ccmpfmterr;     /* CCMPFormatErrors */
2194     uint32_t ccmpreplay;     /* CCMPReplays */
2195     uint32_t ccmpundec;     /* CCMPDecryptErrors */
2196     uint32_t fourwayfail;     /* FourWayHandshakeFailures */
2197     uint32_t wepundec;     /* dot11WEPUndecryptableCount */
2198     uint32_t wepicverr;     /* dot11WEPICVErrorCount */
2199     uint32_t decsuccess;     /* DecryptSuccessCount */
2200     uint32_t tkipicverr;     /* TKIPICVErrorCount */
2201     uint32_t wepexcluded;     /* dot11WEPExcludedCount */
2202 
2203     uint32_t txchanrej;     /* Tx frames suppressed due to channel rejection */
2204     uint32_t psmwds;     /* Count PSM watchdogs */
2205     uint32_t phywatchdog;     /* Count Phy watchdogs (triggered by ucode) */
2206 
2207     /* MBSS counters, AP only */
2208     uint32_t prq_entries_handled;     /* PRQ entries read in */
2209     uint32_t prq_undirected_entries;     /*    which were bcast bss & ssid */
2210     uint32_t prq_bad_entries;     /*    which could not be translated to info */
2211     uint32_t atim_suppress_count;     /* TX suppressions on ATIM fifo */
2212     uint32_t bcn_template_not_ready;     /* Template marked in use on send bcn ... */
2213     uint32_t bcn_template_not_ready_done;     /* ...but "DMA done" interrupt rcvd */
2214     uint32_t late_tbtt_dpc;     /* TBTT DPC did not happen in time */
2215 
2216     /* per-rate receive stat counters */
2217     uint32_t rx1mbps;     /* packets rx at 1Mbps */
2218     uint32_t rx2mbps;     /* packets rx at 2Mbps */
2219     uint32_t rx5mbps5;     /* packets rx at 5.5Mbps */
2220     uint32_t rx6mbps;     /* packets rx at 6Mbps */
2221     uint32_t rx9mbps;     /* packets rx at 9Mbps */
2222     uint32_t rx11mbps;     /* packets rx at 11Mbps */
2223     uint32_t rx12mbps;     /* packets rx at 12Mbps */
2224     uint32_t rx18mbps;     /* packets rx at 18Mbps */
2225     uint32_t rx24mbps;     /* packets rx at 24Mbps */
2226     uint32_t rx36mbps;     /* packets rx at 36Mbps */
2227     uint32_t rx48mbps;     /* packets rx at 48Mbps */
2228     uint32_t rx54mbps;     /* packets rx at 54Mbps */
2229     uint32_t rx108mbps;     /* packets rx at 108mbps */
2230     uint32_t rx162mbps;     /* packets rx at 162mbps */
2231     uint32_t rx216mbps;     /* packets rx at 216 mbps */
2232     uint32_t rx270mbps;     /* packets rx at 270 mbps */
2233     uint32_t rx324mbps;     /* packets rx at 324 mbps */
2234     uint32_t rx378mbps;     /* packets rx at 378 mbps */
2235     uint32_t rx432mbps;     /* packets rx at 432 mbps */
2236     uint32_t rx486mbps;     /* packets rx at 486 mbps */
2237     uint32_t rx540mbps;     /* packets rx at 540 mbps */
2238 
2239     /* pkteng rx frame stats */
2240     uint32_t pktengrxducast;     /* unicast frames rxed by the pkteng code */
2241     uint32_t pktengrxdmcast;     /* multicast frames rxed by the pkteng code */
2242 
2243     uint32_t rfdisable;     /* count of radio disables */
2244     uint32_t bphy_rxcrsglitch;     /* PHY count of bphy glitches */
2245 
2246     uint32_t txexptime;     /* Tx frames suppressed due to timer expiration */
2247 
2248     uint32_t txmpdu_sgi;     /* count for sgi transmit */
2249     uint32_t rxmpdu_sgi;     /* count for sgi received */
2250     uint32_t txmpdu_stbc;     /* count for stbc transmit */
2251     uint32_t rxmpdu_stbc;     /* count for stbc received */
2252 
2253     uint32_t rxundec_mcst;     /* dot11WEPUndecryptableCount */
2254 
2255     /* WPA2 counters (see rxundec for DecryptFailureCount) */
2256     uint32_t tkipmicfaill_mcst;     /* TKIPLocalMICFailures */
2257     uint32_t tkipcntrmsr_mcst;     /* TKIPCounterMeasuresInvoked */
2258     uint32_t tkipreplay_mcst;     /* TKIPReplays */
2259     uint32_t ccmpfmterr_mcst;     /* CCMPFormatErrors */
2260     uint32_t ccmpreplay_mcst;     /* CCMPReplays */
2261     uint32_t ccmpundec_mcst;     /* CCMPDecryptErrors */
2262     uint32_t fourwayfail_mcst;     /* FourWayHandshakeFailures */
2263     uint32_t wepundec_mcst;     /* dot11WEPUndecryptableCount */
2264     uint32_t wepicverr_mcst;     /* dot11WEPICVErrorCount */
2265     uint32_t decsuccess_mcst;     /* DecryptSuccessCount */
2266     uint32_t tkipicverr_mcst;     /* TKIPICVErrorCount */
2267     uint32_t wepexcluded_mcst;     /* dot11WEPExcludedCount */
2268 
2269     uint32_t dma_hang;     /* count for stbc received */
2270 } wl_cnt_ver_seven_t;
2271 
2272 typedef struct
2273 {
2274     uint16_t version;     /* see definition of WL_CNT_T_VERSION */
2275     uint16_t length;     /* length of entire structure */
2276 
2277     /* transmit stat counters */
2278     uint32_t txframe;     /* tx data frames */
2279     uint32_t txbyte;     /* tx data bytes */
2280     uint32_t txretrans;     /* tx mac retransmits */
2281     uint32_t txerror;     /* tx data errors (derived: sum of others) */
2282     uint32_t txctl;     /* tx management frames */
2283     uint32_t txprshort;     /* tx short preamble frames */
2284     uint32_t txserr;     /* tx status errors */
2285     uint32_t txnobuf;     /* tx out of buffers errors */
2286     uint32_t txnoassoc;     /* tx discard because we're not associated */
2287     uint32_t txrunt;     /* tx runt frames */
2288     uint32_t txchit;     /* tx header cache hit (fastpath) */
2289     uint32_t txcmiss;     /* tx header cache miss (slowpath) */
2290 
2291     /* transmit chip error counters */
2292     uint32_t txuflo;     /* tx fifo underflows */
2293     uint32_t txphyerr;     /* tx phy errors (indicated in tx status) */
2294     uint32_t txphycrs;     /* PR8861/8963 counter */
2295 
2296     /* receive stat counters */
2297     uint32_t rxframe;     /* rx data frames */
2298     uint32_t rxbyte;     /* rx data bytes */
2299     uint32_t rxerror;     /* rx data errors (derived: sum of others) */
2300     uint32_t rxctl;     /* rx management frames */
2301     uint32_t rxnobuf;     /* rx out of buffers errors */
2302     uint32_t rxnondata;     /* rx non data frames in the data channel errors */
2303     uint32_t rxbadds;     /* rx bad DS errors */
2304     uint32_t rxbadcm;     /* rx bad control or management frames */
2305     uint32_t rxfragerr;     /* rx fragmentation errors */
2306     uint32_t rxrunt;     /* rx runt frames */
2307     uint32_t rxgiant;     /* rx giant frames */
2308     uint32_t rxnoscb;     /* rx no scb error */
2309     uint32_t rxbadproto;     /* rx invalid frames */
2310     uint32_t rxbadsrcmac;     /* rx frames with Invalid Src Mac */
2311     uint32_t rxbadda;     /* rx frames tossed for invalid da */
2312     uint32_t rxfilter;     /* rx frames filtered out */
2313 
2314     /* receive chip error counters */
2315     uint32_t rxoflo;     /* rx fifo overflow errors */
2316     uint32_t rxuflo[NFIFO];     /* rx dma descriptor underflow errors */
2317 
2318     uint32_t d11cnt_txrts_off;     /* d11cnt txrts value when reset d11cnt */
2319     uint32_t d11cnt_rxcrc_off;     /* d11cnt rxcrc value when reset d11cnt */
2320     uint32_t d11cnt_txnocts_off;     /* d11cnt txnocts value when reset d11cnt */
2321 
2322     /* misc counters */
2323     uint32_t dmade;     /* tx/rx dma descriptor errors */
2324     uint32_t dmada;     /* tx/rx dma data errors */
2325     uint32_t dmape;     /* tx/rx dma descriptor protocol errors */
2326     uint32_t reset;     /* reset count */
2327     uint32_t tbtt;     /* cnts the TBTT int's */
2328     uint32_t txdmawar;     /* # occurrences of PR15420 workaround */
2329     uint32_t pkt_callback_reg_fail;     /* callbacks register failure */
2330 
2331     /* MAC counters: 32-bit version of d11.h's macstat_t */
2332     uint32_t txallfrm;     /* total number of frames sent, incl. Data, ACK, RTS, CTS,
2333                             * Control Management (includes retransmissions)
2334                             */
2335     uint32_t txrtsfrm;     /* number of RTS sent out by the MAC */
2336     uint32_t txctsfrm;     /* number of CTS sent out by the MAC */
2337     uint32_t txackfrm;     /* number of ACK frames sent out */
2338     uint32_t txdnlfrm;     /* Not used */
2339     uint32_t txbcnfrm;     /* beacons transmitted */
2340     uint32_t txfunfl[6];     /* per-fifo tx underflows */
2341     uint32_t rxtoolate;     /* receive too late */
2342     uint32_t txfbw;     /* transmit at fallback bw (dynamic bw) */
2343     uint32_t txtplunfl;     /* Template underflows (mac was too slow to transmit ACK/CTS
2344                              * or BCN)
2345                              */
2346     uint32_t txphyerror;     /* Transmit phy error, type of error is reported in tx-status for
2347                               * driver enqueued frames
2348                               */
2349     uint32_t rxfrmtoolong;     /* Received frame longer than legal limit (2346 bytes) */
2350     uint32_t rxfrmtooshrt;     /* Received frame did not contain enough bytes for its frame type */
2351     uint32_t rxinvmachdr;     /* Either the protocol version != 0 or frame type not
2352                                * data/control/management
2353                                */
2354     uint32_t rxbadfcs;     /* number of frames for which the CRC check failed in the MAC */
2355     uint32_t rxbadplcp;     /* parity check of the PLCP header failed */
2356     uint32_t rxcrsglitch;     /* PHY was able to correlate the preamble but not the header */
2357     uint32_t rxstrt;     /* Number of received frames with a good PLCP
2358                           * (i.e. passing parity check)
2359                           */
2360     uint32_t rxdfrmucastmbss;     /* Number of received DATA frames with good FCS and matching RA */
2361     uint32_t rxmfrmucastmbss;     /* number of received mgmt frames with good FCS and matching RA */
2362     uint32_t rxcfrmucast;     /* number of received CNTRL frames with good FCS and matching RA */
2363     uint32_t rxrtsucast;     /* number of unicast RTS addressed to the MAC (good FCS) */
2364     uint32_t rxctsucast;     /* number of unicast CTS addressed to the MAC (good FCS) */
2365     uint32_t rxackucast;     /* number of ucast ACKS received (good FCS) */
2366     uint32_t rxdfrmocast;     /* number of received DATA frames (good FCS and not matching RA) */
2367     uint32_t rxmfrmocast;     /* number of received MGMT frames (good FCS and not matching RA) */
2368     uint32_t rxcfrmocast;     /* number of received CNTRL frame (good FCS and not matching RA) */
2369     uint32_t rxrtsocast;     /* number of received RTS not addressed to the MAC */
2370     uint32_t rxctsocast;     /* number of received CTS not addressed to the MAC */
2371     uint32_t rxdfrmmcast;     /* number of RX Data multicast frames received by the MAC */
2372     uint32_t rxmfrmmcast;     /* number of RX Management multicast frames received by the MAC */
2373     uint32_t rxcfrmmcast;     /* number of RX Control multicast frames received by the MAC
2374                                * (unlikely to see these)
2375                                */
2376     uint32_t rxbeaconmbss;     /* beacons received from member of BSS */
2377     uint32_t rxdfrmucastobss;     /* number of unicast frames addressed to the MAC from
2378                                    * other BSS (WDS FRAME)
2379                                    */
2380     uint32_t rxbeaconobss;     /* beacons received from other BSS */
2381     uint32_t rxrsptmout;     /* Number of response timeouts for transmitted frames
2382                               * expecting a response
2383                               */
2384     uint32_t bcntxcancl;     /* transmit beacons canceled due to receipt of beacon (IBSS) */
2385     uint32_t rxf0ovfl;     /* Number of receive fifo 0 overflows */
2386     uint32_t rxf1ovfl;     /* Number of receive fifo 1 overflows (obsolete) */
2387     uint32_t rxf2ovfl;     /* Number of receive fifo 2 overflows (obsolete) */
2388     uint32_t txsfovfl;     /* Number of transmit status fifo overflows (obsolete) */
2389     uint32_t pmqovfl;     /* Number of PMQ overflows */
2390     uint32_t rxcgprqfrm;     /* Number of received Probe requests that made it into
2391                               * the PRQ fifo
2392                               */
2393     uint32_t rxcgprsqovfl;     /* Rx Probe Request Que overflow in the AP */
2394     uint32_t txcgprsfail;     /* Tx Probe Response Fail. AP sent probe response but did
2395                                * not get ACK
2396                                */
2397     uint32_t txcgprssuc;     /* Tx Probe Response Success (ACK was received) */
2398     uint32_t prs_timeout;     /* Number of probe requests that were dropped from the PRQ
2399                                * fifo because a probe response could not be sent out within
2400                                * the time limit defined in M_PRS_MAXTIME
2401                                */
2402     uint32_t rxnack;     /* obsolete */
2403     uint32_t frmscons;     /* obsolete */
2404     uint32_t txnack;     /* obsolete */
2405     uint32_t rxback;     /* blockack rxcnt */
2406     uint32_t txback;     /* blockack txcnt */
2407 
2408     /* 802.11 MIB counters, pp. 614 of 802.11 reaff doc. */
2409     uint32_t txfrag;     /* dot11TransmittedFragmentCount */
2410     uint32_t txmulti;     /* dot11MulticastTransmittedFrameCount */
2411     uint32_t txfail;     /* dot11FailedCount */
2412     uint32_t txretry;     /* dot11RetryCount */
2413     uint32_t txretrie;     /* dot11MultipleRetryCount */
2414     uint32_t rxdup;     /* dot11FrameduplicateCount */
2415     uint32_t txrts;     /* dot11RTSSuccessCount */
2416     uint32_t txnocts;     /* dot11RTSFailureCount */
2417     uint32_t txnoack;     /* dot11ACKFailureCount */
2418     uint32_t rxfrag;     /* dot11ReceivedFragmentCount */
2419     uint32_t rxmulti;     /* dot11MulticastReceivedFrameCount */
2420     uint32_t rxcrc;     /* dot11FCSErrorCount */
2421     uint32_t txfrmsnt;     /* dot11TransmittedFrameCount (bogus MIB?) */
2422     uint32_t rxundec;     /* dot11WEPUndecryptableCount */
2423 
2424     /* WPA2 counters (see rxundec for DecryptFailureCount) */
2425     uint32_t tkipmicfaill;     /* TKIPLocalMICFailures */
2426     uint32_t tkipcntrmsr;     /* TKIPCounterMeasuresInvoked */
2427     uint32_t tkipreplay;     /* TKIPReplays */
2428     uint32_t ccmpfmterr;     /* CCMPFormatErrors */
2429     uint32_t ccmpreplay;     /* CCMPReplays */
2430     uint32_t ccmpundec;     /* CCMPDecryptErrors */
2431     uint32_t fourwayfail;     /* FourWayHandshakeFailures */
2432     uint32_t wepundec;     /* dot11WEPUndecryptableCount */
2433     uint32_t wepicverr;     /* dot11WEPICVErrorCount */
2434     uint32_t decsuccess;     /* DecryptSuccessCount */
2435     uint32_t tkipicverr;     /* TKIPICVErrorCount */
2436     uint32_t wepexcluded;     /* dot11WEPExcludedCount */
2437 
2438     uint32_t txchanrej;     /* Tx frames suppressed due to channel rejection */
2439     uint32_t psmwds;     /* Count PSM watchdogs */
2440     uint32_t phywatchdog;     /* Count Phy watchdogs (triggered by ucode) */
2441 
2442     /* MBSS counters, AP only */
2443     uint32_t prq_entries_handled;     /* PRQ entries read in */
2444     uint32_t prq_undirected_entries;     /*    which were bcast bss & ssid */
2445     uint32_t prq_bad_entries;     /*    which could not be translated to info */
2446     uint32_t atim_suppress_count;     /* TX suppressions on ATIM fifo */
2447     uint32_t bcn_template_not_ready;     /* Template marked in use on send bcn ... */
2448     uint32_t bcn_template_not_ready_done;     /* ...but "DMA done" interrupt rcvd */
2449     uint32_t late_tbtt_dpc;     /* TBTT DPC did not happen in time */
2450 
2451     /* per-rate receive stat counters */
2452     uint32_t rx1mbps;     /* packets rx at 1Mbps */
2453     uint32_t rx2mbps;     /* packets rx at 2Mbps */
2454     uint32_t rx5mbps5;     /* packets rx at 5.5Mbps */
2455     uint32_t rx6mbps;     /* packets rx at 6Mbps */
2456     uint32_t rx9mbps;     /* packets rx at 9Mbps */
2457     uint32_t rx11mbps;     /* packets rx at 11Mbps */
2458     uint32_t rx12mbps;     /* packets rx at 12Mbps */
2459     uint32_t rx18mbps;     /* packets rx at 18Mbps */
2460     uint32_t rx24mbps;     /* packets rx at 24Mbps */
2461     uint32_t rx36mbps;     /* packets rx at 36Mbps */
2462     uint32_t rx48mbps;     /* packets rx at 48Mbps */
2463     uint32_t rx54mbps;     /* packets rx at 54Mbps */
2464     uint32_t rx108mbps;     /* packets rx at 108mbps */
2465     uint32_t rx162mbps;     /* packets rx at 162mbps */
2466     uint32_t rx216mbps;     /* packets rx at 216 mbps */
2467     uint32_t rx270mbps;     /* packets rx at 270 mbps */
2468     uint32_t rx324mbps;     /* packets rx at 324 mbps */
2469     uint32_t rx378mbps;     /* packets rx at 378 mbps */
2470     uint32_t rx432mbps;     /* packets rx at 432 mbps */
2471     uint32_t rx486mbps;     /* packets rx at 486 mbps */
2472     uint32_t rx540mbps;     /* packets rx at 540 mbps */
2473 
2474     /* pkteng rx frame stats */
2475     uint32_t pktengrxducast;     /* unicast frames rxed by the pkteng code */
2476     uint32_t pktengrxdmcast;     /* multicast frames rxed by the pkteng code */
2477 
2478     uint32_t rfdisable;     /* count of radio disables */
2479     uint32_t bphy_rxcrsglitch;     /* PHY count of bphy glitches */
2480     uint32_t bphy_badplcp;
2481 
2482     uint32_t txexptime;     /* Tx frames suppressed due to timer expiration */
2483 
2484     uint32_t txmpdu_sgi;     /* count for sgi transmit */
2485     uint32_t rxmpdu_sgi;     /* count for sgi received */
2486     uint32_t txmpdu_stbc;     /* count for stbc transmit */
2487     uint32_t rxmpdu_stbc;     /* count for stbc received */
2488 
2489     uint32_t rxundec_mcst;     /* dot11WEPUndecryptableCount */
2490 
2491     /* WPA2 counters (see rxundec for DecryptFailureCount) */
2492     uint32_t tkipmicfaill_mcst;     /* TKIPLocalMICFailures */
2493     uint32_t tkipcntrmsr_mcst;     /* TKIPCounterMeasuresInvoked */
2494     uint32_t tkipreplay_mcst;     /* TKIPReplays */
2495     uint32_t ccmpfmterr_mcst;     /* CCMPFormatErrors */
2496     uint32_t ccmpreplay_mcst;     /* CCMPReplays */
2497     uint32_t ccmpundec_mcst;     /* CCMPDecryptErrors */
2498     uint32_t fourwayfail_mcst;     /* FourWayHandshakeFailures */
2499     uint32_t wepundec_mcst;     /* dot11WEPUndecryptableCount */
2500     uint32_t wepicverr_mcst;     /* dot11WEPICVErrorCount */
2501     uint32_t decsuccess_mcst;     /* DecryptSuccessCount */
2502     uint32_t tkipicverr_mcst;     /* TKIPICVErrorCount */
2503     uint32_t wepexcluded_mcst;     /* dot11WEPExcludedCount */
2504 
2505     uint32_t dma_hang;     /* count for dma hang */
2506     uint32_t reinit;     /* count for reinit */
2507 
2508     uint32_t pstatxucast;     /* count of ucast frames xmitted on all psta assoc */
2509     uint32_t pstatxnoassoc;     /* count of txnoassoc frames xmitted on all psta assoc */
2510     uint32_t pstarxucast;     /* count of ucast frames received on all psta assoc */
2511     uint32_t pstarxbcmc;     /* count of bcmc frames received on all psta */
2512     uint32_t pstatxbcmc;     /* count of bcmc frames transmitted on all psta */
2513 
2514     uint32_t cso_passthrough;     /* hw cso required but passthrough */
2515     uint32_t cso_normal;     /* hw cso hdr for normal process */
2516     uint32_t chained;     /* number of frames chained */
2517     uint32_t chainedsz1;     /* number of chain size 1 frames */
2518     uint32_t unchained;     /* number of frames not chained */
2519     uint32_t maxchainsz;     /* max chain size so far */
2520     uint32_t currchainsz;     /* current chain size */
2521 
2522     uint32_t rxdrop20s;     /* drop secondary cnt */
2523 
2524 } wl_cnt_ver_eight_t;
2525 
2526 /* per-rate receive stat counters subset of full counters */
2527 typedef struct
2528 {
2529     uint32_t rx1mbps;     /* packets rx at 1Mbps */
2530     uint32_t rx2mbps;     /* packets rx at 2Mbps */
2531     uint32_t rx5mbps5;     /* packets rx at 5.5Mbps */
2532     uint32_t rx6mbps;     /* packets rx at 6Mbps */
2533     uint32_t rx9mbps;     /* packets rx at 9Mbps */
2534     uint32_t rx11mbps;     /* packets rx at 11Mbps */
2535     uint32_t rx12mbps;     /* packets rx at 12Mbps */
2536     uint32_t rx18mbps;     /* packets rx at 18Mbps */
2537     uint32_t rx24mbps;     /* packets rx at 24Mbps */
2538     uint32_t rx36mbps;     /* packets rx at 36Mbps */
2539     uint32_t rx48mbps;     /* packets rx at 48Mbps */
2540     uint32_t rx54mbps;     /* packets rx at 54Mbps */
2541     uint32_t rx108mbps;     /* packets rx at 108mbps */
2542     uint32_t rx162mbps;     /* packets rx at 162mbps */
2543     uint32_t rx216mbps;     /* packets rx at 216 mbps */
2544     uint32_t rx270mbps;     /* packets rx at 270 mbps */
2545 } whd_phyrate_counters_t;
2546 
2547 typedef struct
2548 {
2549     uint32_t count;
2550     uint8_t log[WL_PHYRATE_LOG_SIZE];
2551 } whd_phyrate_log_t;
2552 
2553 typedef struct
2554 {
2555     uint16_t version;     /* see definition of WL_CNT_T_VERSION */
2556     uint16_t length;     /* length of entire structure */
2557 
2558     /* transmit stat counters */
2559     uint32_t txframe;     /* tx data frames */
2560     uint32_t txbyte;     /* tx data bytes */
2561     uint32_t txretrans;    /* tx mac retransmits */
2562     uint32_t txerror;     /* tx data errors (derived: sum of others) */
2563     uint32_t txctl;     /* tx management frames */
2564     uint32_t txprshort;    /* tx short preamble frames */
2565     uint32_t txserr;     /* tx status errors */
2566     uint32_t txnobuf;     /* tx out of buffers errors */
2567     uint32_t txnoassoc;    /* tx discard because we're not associated */
2568     uint32_t txrunt;     /* tx runt frames */
2569     uint32_t txchit;     /* tx header cache hit (fastpath) */
2570     uint32_t txcmiss;     /* tx header cache miss (slowpath) */
2571 
2572     /* transmit chip error counters */
2573     uint32_t txuflo;     /* tx fifo underflows */
2574     uint32_t txphyerr;     /* tx phy errors (indicated in tx status) */
2575     uint32_t txphycrs;     /* PR8861/8963 counter */
2576 
2577     /* receive stat counters */
2578     uint32_t rxframe;     /* rx data frames */
2579     uint32_t rxbyte;     /* rx data bytes */
2580     uint32_t rxerror;     /* rx data errors (derived: sum of others) */
2581     uint32_t rxctl;     /* rx management frames */
2582     uint32_t rxnobuf;     /* rx out of buffers errors */
2583     uint32_t rxnondata;    /* rx non data frames in the data channel errors */
2584     uint32_t rxbadds;     /* rx bad DS errors */
2585     uint32_t rxbadcm;     /* rx bad control or management frames */
2586     uint32_t rxfragerr;    /* rx fragmentation errors */
2587     uint32_t rxrunt;     /* rx runt frames */
2588     uint32_t rxgiant;     /* rx giant frames */
2589     uint32_t rxnoscb;     /* rx no scb error */
2590     uint32_t rxbadproto;     /* rx invalid frames */
2591     uint32_t rxbadsrcmac;    /* rx frames with Invalid Src Mac */
2592     uint32_t rxbadda;     /* rx frames tossed for invalid da */
2593     uint32_t rxfilter;     /* rx frames filtered out */
2594 
2595     /* receive chip error counters */
2596     uint32_t rxoflo;     /* rx fifo overflow errors */
2597     uint32_t rxuflo[NFIFO];     /* rx dma descriptor underflow errors */
2598 
2599     uint32_t d11cnt_txrts_off;     /* d11cnt txrts value when reset d11cnt */
2600     uint32_t d11cnt_rxcrc_off;     /* d11cnt rxcrc value when reset d11cnt */
2601     uint32_t d11cnt_txnocts_off;     /* d11cnt txnocts value when reset d11cnt */
2602 
2603     /* misc counters */
2604     uint32_t dmade;     /* tx/rx dma descriptor errors */
2605     uint32_t dmada;     /* tx/rx dma data errors */
2606     uint32_t dmape;     /* tx/rx dma descriptor protocol errors */
2607     uint32_t reset;     /* reset count */
2608     uint32_t tbtt;     /* cnts the TBTT int's */
2609     uint32_t txdmawar;     /* # occurrences of PR15420 workaround */
2610     uint32_t pkt_callback_reg_fail;     /* callbacks register failure */
2611 
2612     /* MAC counters: 32-bit version of d11.h's macstat_t */
2613     uint32_t txallfrm;     /* total number of frames sent, incl. Data, ACK, RTS, CTS,
2614                             * Control Management (includes retransmissions)
2615                             */
2616     uint32_t txrtsfrm;     /* number of RTS sent out by the MAC */
2617     uint32_t txctsfrm;     /* number of CTS sent out by the MAC */
2618     uint32_t txackfrm;     /* number of ACK frames sent out */
2619     uint32_t txdnlfrm;     /* Not used */
2620     uint32_t txbcnfrm;     /* beacons transmitted */
2621     uint32_t txfunfl[6];     /* per-fifo tx underflows */
2622     uint32_t rxtoolate;     /* receive too late */
2623     uint32_t txfbw;     /* transmit at fallback bw (dynamic bw) */
2624     uint32_t txtplunfl;     /* Template underflows (mac was too slow to transmit ACK/CTS
2625                              * or BCN)
2626                              */
2627     uint32_t txphyerror;     /* Transmit phy error, type of error is reported in tx-status for
2628                               * driver enqueued frames
2629                               */
2630     uint32_t rxfrmtoolong;    /* Received frame longer than legal limit (2346 bytes) */
2631     uint32_t rxfrmtooshrt;    /* Received frame did not contain enough bytes for its frame type */
2632     uint32_t rxinvmachdr;     /* Either the protocol version != 0 or frame type not
2633                                * data/control/management
2634                                */
2635     uint32_t rxbadfcs;     /* number of frames for which the CRC check failed in the MAC */
2636     uint32_t rxbadplcp;     /* parity check of the PLCP header failed */
2637     uint32_t rxcrsglitch;    /* PHY was able to correlate the preamble but not the header */
2638     uint32_t rxstrt;     /* Number of received frames with a good PLCP
2639                           * (i.e. passing parity check)
2640                           */
2641     uint32_t rxdfrmucastmbss;     /* Number of received DATA frames with good FCS and matching RA */
2642     uint32_t rxmfrmucastmbss;     /* number of received mgmt frames with good FCS and matching RA */
2643     uint32_t rxcfrmucast;     /* number of received CNTRL frames with good FCS and matching RA */
2644     uint32_t rxrtsucast;     /* number of unicast RTS addressed to the MAC (good FCS) */
2645     uint32_t rxctsucast;     /* number of unicast CTS addressed to the MAC (good FCS) */
2646     uint32_t rxackucast;     /* number of ucast ACKS received (good FCS) */
2647     uint32_t rxdfrmocast;     /* number of received DATA frames (good FCS and not matching RA) */
2648     uint32_t rxmfrmocast;     /* number of received MGMT frames (good FCS and not matching RA) */
2649     uint32_t rxcfrmocast;     /* number of received CNTRL frame (good FCS and not matching RA) */
2650     uint32_t rxrtsocast;     /* number of received RTS not addressed to the MAC */
2651     uint32_t rxctsocast;     /* number of received CTS not addressed to the MAC */
2652     uint32_t rxdfrmmcast;     /* number of RX Data multicast frames received by the MAC */
2653     uint32_t rxmfrmmcast;     /* number of RX Management multicast frames received by the MAC */
2654     uint32_t rxcfrmmcast;     /* number of RX Control multicast frames received by the MAC
2655                                * (unlikely to see these)
2656                                */
2657     uint32_t rxbeaconmbss;     /* beacons received from member of BSS */
2658     uint32_t rxdfrmucastobss;     /* number of unicast frames addressed to the MAC from
2659                                    * other BSS (WDS FRAME)
2660                                    */
2661     uint32_t rxbeaconobss;     /* beacons received from other BSS */
2662     uint32_t rxrsptmout;     /* Number of response timeouts for transmitted frames
2663                               * expecting a response
2664                               */
2665     uint32_t bcntxcancl;     /* transmit beacons canceled due to receipt of beacon (IBSS) */
2666     uint32_t rxf0ovfl;     /* Number of receive fifo 0 overflows */
2667     uint32_t rxf1ovfl;     /* Number of receive fifo 1 overflows (obsolete) */
2668     uint32_t rxf2ovfl;     /* Number of receive fifo 2 overflows (obsolete) */
2669     uint32_t txsfovfl;     /* Number of transmit status fifo overflows (obsolete) */
2670     uint32_t pmqovfl;     /* Number of PMQ overflows */
2671     uint32_t rxcgprqfrm;     /* Number of received Probe requests that made it into
2672                               * the PRQ fifo
2673                               */
2674     uint32_t rxcgprsqovfl;     /* Rx Probe Request Que overflow in the AP */
2675     uint32_t txcgprsfail;     /* Tx Probe Response Fail. AP sent probe response but did
2676                                * not get ACK
2677                                */
2678     uint32_t txcgprssuc;     /* Tx Probe Response Success (ACK was received) */
2679     uint32_t prs_timeout;     /* Number of probe requests that were dropped from the PRQ
2680                                * fifo because a probe response could not be sent out within
2681                                * the time limit defined in M_PRS_MAXTIME
2682                                */
2683     uint32_t rxnack;     /* obsolete */
2684     uint32_t frmscons;     /* obsolete */
2685     uint32_t txnack;     /* obsolete */
2686     uint32_t rxback;     /* blockack rxcnt */
2687     uint32_t txback;     /* blockack txcnt */
2688 
2689     /* 802.11 MIB counters, pp. 614 of 802.11 reaff doc. */
2690     uint32_t txfrag;     /* dot11TransmittedFragmentCount */
2691     uint32_t txmulti;     /* dot11MulticastTransmittedFrameCount */
2692     uint32_t txfail;     /* dot11FailedCount */
2693     uint32_t txretry;     /* dot11RetryCount */
2694     uint32_t txretrie;     /* dot11MultipleRetryCount */
2695     uint32_t rxdup;     /* dot11FrameduplicateCount */
2696     uint32_t txrts;     /* dot11RTSSuccessCount */
2697     uint32_t txnocts;     /* dot11RTSFailureCount */
2698     uint32_t txnoack;     /* dot11ACKFailureCount */
2699     uint32_t rxfrag;     /* dot11ReceivedFragmentCount */
2700     uint32_t rxmulti;     /* dot11MulticastReceivedFrameCount */
2701     uint32_t rxcrc;     /* dot11FCSErrorCount */
2702     uint32_t txfrmsnt;     /* dot11TransmittedFrameCount (bogus MIB?) */
2703     uint32_t rxundec;     /* dot11WEPUndecryptableCount */
2704 
2705     /* WPA2 counters (see rxundec for DecryptFailureCount) */
2706     uint32_t tkipmicfaill;     /* TKIPLocalMICFailures */
2707     uint32_t tkipcntrmsr;     /* TKIPCounterMeasuresInvoked */
2708     uint32_t tkipreplay;     /* TKIPReplays */
2709     uint32_t ccmpfmterr;     /* CCMPFormatErrors */
2710     uint32_t ccmpreplay;     /* CCMPReplays */
2711     uint32_t ccmpundec;     /* CCMPDecryptErrors */
2712     uint32_t fourwayfail;     /* FourWayHandshakeFailures */
2713     uint32_t wepundec;     /* dot11WEPUndecryptableCount */
2714     uint32_t wepicverr;     /* dot11WEPICVErrorCount */
2715     uint32_t decsuccess;     /* DecryptSuccessCount */
2716     uint32_t tkipicverr;     /* TKIPICVErrorCount */
2717     uint32_t wepexcluded;     /* dot11WEPExcludedCount */
2718 
2719     uint32_t txchanrej;     /* Tx frames suppressed due to channel rejection */
2720     uint32_t psmwds;     /* Count PSM watchdogs */
2721     uint32_t phywatchdog;     /* Count Phy watchdogs (triggered by ucode) */
2722 
2723     /* MBSS counters, AP only */
2724     uint32_t prq_entries_handled;     /* PRQ entries read in */
2725     uint32_t prq_undirected_entries;     /*    which were bcast bss & ssid */
2726     uint32_t prq_bad_entries;     /*    which could not be translated to info */
2727     uint32_t atim_suppress_count;     /* TX suppressions on ATIM fifo */
2728     uint32_t bcn_template_not_ready;     /* Template marked in use on send bcn ... */
2729     uint32_t bcn_template_not_ready_done;     /* ...but "DMA done" interrupt rcvd */
2730     uint32_t late_tbtt_dpc;     /* TBTT DPC did not happen in time */
2731 
2732     /* per-rate receive stat counters */
2733     uint32_t rx1mbps;     /* packets rx at 1Mbps */
2734     uint32_t rx2mbps;     /* packets rx at 2Mbps */
2735     uint32_t rx5mbps5;     /* packets rx at 5.5Mbps */
2736     uint32_t rx6mbps;     /* packets rx at 6Mbps */
2737     uint32_t rx9mbps;     /* packets rx at 9Mbps */
2738     uint32_t rx11mbps;     /* packets rx at 11Mbps */
2739     uint32_t rx12mbps;     /* packets rx at 12Mbps */
2740     uint32_t rx18mbps;     /* packets rx at 18Mbps */
2741     uint32_t rx24mbps;     /* packets rx at 24Mbps */
2742     uint32_t rx36mbps;     /* packets rx at 36Mbps */
2743     uint32_t rx48mbps;     /* packets rx at 48Mbps */
2744     uint32_t rx54mbps;     /* packets rx at 54Mbps */
2745     uint32_t rx108mbps;    /* packets rx at 108mbps */
2746     uint32_t rx162mbps;    /* packets rx at 162mbps */
2747     uint32_t rx216mbps;    /* packets rx at 216 mbps */
2748     uint32_t rx270mbps;    /* packets rx at 270 mbps */
2749     uint32_t rx324mbps;    /* packets rx at 324 mbps */
2750     uint32_t rx378mbps;    /* packets rx at 378 mbps */
2751     uint32_t rx432mbps;    /* packets rx at 432 mbps */
2752     uint32_t rx486mbps;    /* packets rx at 486 mbps */
2753     uint32_t rx540mbps;    /* packets rx at 540 mbps */
2754 
2755     /* pkteng rx frame stats */
2756     uint32_t pktengrxducast;     /* unicast frames rxed by the pkteng code */
2757     uint32_t pktengrxdmcast;     /* multicast frames rxed by the pkteng code */
2758 
2759     uint32_t rfdisable;     /* count of radio disables */
2760     uint32_t bphy_rxcrsglitch;     /* PHY count of bphy glitches */
2761     uint32_t bphy_badplcp;
2762 
2763     uint32_t txexptime;     /* Tx frames suppressed due to timer expiration */
2764 
2765     uint32_t txmpdu_sgi;     /* count for sgi transmit */
2766     uint32_t rxmpdu_sgi;     /* count for sgi received */
2767     uint32_t txmpdu_stbc;     /* count for stbc transmit */
2768     uint32_t rxmpdu_stbc;     /* count for stbc received */
2769 
2770     uint32_t rxundec_mcst;     /* dot11WEPUndecryptableCount */
2771 
2772     /* WPA2 counters (see rxundec for DecryptFailureCount) */
2773     uint32_t tkipmicfaill_mcst;    /* TKIPLocalMICFailures */
2774     uint32_t tkipcntrmsr_mcst;     /* TKIPCounterMeasuresInvoked */
2775     uint32_t tkipreplay_mcst;     /* TKIPReplays */
2776     uint32_t ccmpfmterr_mcst;     /* CCMPFormatErrors */
2777     uint32_t ccmpreplay_mcst;     /* CCMPReplays */
2778     uint32_t ccmpundec_mcst;     /* CCMPDecryptErrors */
2779     uint32_t fourwayfail_mcst;     /* FourWayHandshakeFailures */
2780     uint32_t wepundec_mcst;     /* dot11WEPUndecryptableCount */
2781     uint32_t wepicverr_mcst;     /* dot11WEPICVErrorCount */
2782     uint32_t decsuccess_mcst;     /* DecryptSuccessCount */
2783     uint32_t tkipicverr_mcst;     /* TKIPICVErrorCount */
2784     uint32_t wepexcluded_mcst;     /* dot11WEPExcludedCount */
2785 
2786     uint32_t dma_hang;     /* count for dma hang */
2787     uint32_t reinit;     /* count for reinit */
2788 
2789     uint32_t pstatxucast;     /* count of ucast frames xmitted on all psta assoc */
2790     uint32_t pstatxnoassoc;     /* count of txnoassoc frames xmitted on all psta assoc */
2791     uint32_t pstarxucast;     /* count of ucast frames received on all psta assoc */
2792     uint32_t pstarxbcmc;     /* count of bcmc frames received on all psta */
2793     uint32_t pstatxbcmc;     /* count of bcmc frames transmitted on all psta */
2794 
2795     uint32_t cso_passthrough;     /* hw cso required but passthrough */
2796     uint32_t cso_normal;     /* hw cso hdr for normal process */
2797     uint32_t chained;     /* number of frames chained */
2798     uint32_t chainedsz1;     /* number of chain size 1 frames */
2799     uint32_t unchained;     /* number of frames not chained */
2800     uint32_t maxchainsz;     /* max chain size so far */
2801     uint32_t currchainsz;     /* current chain size */
2802     uint32_t rxdrop20s;     /* drop secondary cnt */
2803     uint32_t pciereset;     /* Secondary Bus Reset issued by driver */
2804     uint32_t cfgrestore;     /* configspace restore by driver */
2805     uint32_t reinitreason[8];     /* reinitreason counters; 0: Unknown reason */
2806     uint32_t rxrtry;     /* num of received packets with retry bit on */
2807 } wl_cnt_ver_ten_t;
2808 
2809 typedef struct
2810 {
2811     uint16_t version;
2812     uint16_t length;
2813     uint32_t rxampdu_sgi;
2814     uint32_t rxampdu_stbc;
2815     uint32_t rxmpdu_sgi;
2816     uint32_t rxmpdu_stbc;
2817     uint32_t rxmcs0_40M;
2818     uint32_t rxmcs1_40M;
2819     uint32_t rxmcs2_40M;
2820     uint32_t rxmcs3_40M;
2821     uint32_t rxmcs4_40M;
2822     uint32_t rxmcs5_40M;
2823     uint32_t rxmcs6_40M;
2824     uint32_t rxmcs7_40M;
2825     uint32_t rxmcs32_40M;
2826     uint32_t txfrmsnt_20Mlo;
2827     uint32_t txfrmsnt_20Mup;
2828     uint32_t txfrmsnt_40M;
2829     uint32_t rx_20ul;
2830 } wl_cnt_ext_t;
2831 #define    WL_RXDIV_STATS_T_VERSION    1
2832 typedef struct
2833 {
2834     uint16_t version;
2835     uint16_t length;
2836     uint32_t rxant[4];
2837 } wl_rxdiv_stats_t;
2838 #define    WL_DELTA_STATS_T_VERSION    1
2839 typedef struct
2840 {
2841     uint16_t version;
2842     uint16_t length;
2843     uint32_t txframe;
2844     uint32_t txbyte;
2845     uint32_t txretrans;
2846     uint32_t txfail;
2847     uint32_t rxframe;
2848     uint32_t rxbyte;
2849     uint32_t rx1mbps;
2850     uint32_t rx2mbps;
2851     uint32_t rx5mbps5;
2852     uint32_t rx6mbps;
2853     uint32_t rx9mbps;
2854     uint32_t rx11mbps;
2855     uint32_t rx12mbps;
2856     uint32_t rx18mbps;
2857     uint32_t rx24mbps;
2858     uint32_t rx36mbps;
2859     uint32_t rx48mbps;
2860     uint32_t rx54mbps;
2861     uint32_t rx108mbps;
2862     uint32_t rx162mbps;
2863     uint32_t rx216mbps;
2864     uint32_t rx270mbps;
2865     uint32_t rx324mbps;
2866     uint32_t rx378mbps;
2867     uint32_t rx432mbps;
2868     uint32_t rx486mbps;
2869     uint32_t rx540mbps;
2870 } wl_delta_stats_t;
2871 #define WL_WME_CNT_VERSION    1
2872 typedef struct
2873 {
2874     uint32_t packets;
2875     uint32_t bytes;
2876 } wl_traffic_stats_t;
2877 #define AC_COUNT        4
2878 typedef struct
2879 {
2880     uint16_t version;
2881     uint16_t length;
2882     wl_traffic_stats_t tx[AC_COUNT];
2883     wl_traffic_stats_t tx_failed[AC_COUNT];
2884     wl_traffic_stats_t rx[AC_COUNT];
2885     wl_traffic_stats_t rx_failed[AC_COUNT];
2886     wl_traffic_stats_t forward[AC_COUNT];
2887     wl_traffic_stats_t tx_expired[AC_COUNT];
2888 } wl_wme_cnt_t;
2889 
2890 #define WL_MKEEP_ALIVE_VERSION      1
2891 #define WL_MKEEP_ALIVE_FIXED_LEN    offsetof(wl_mkeep_alive_pkt_t, data)
2892 #define WL_MKEEP_ALIVE_PRECISION    500
2893 
2894 #define    WLC_BA_CNT_VERSION    1
2895 typedef struct wlc_ba_cnt
2896 {
2897     uint16_t version;
2898     uint16_t length;
2899     uint32_t txpdu;
2900     uint32_t txsdu;
2901     uint32_t txfc;
2902     uint32_t txfci;
2903     uint32_t txretrans;
2904     uint32_t txbatimer;
2905     uint32_t txdrop;
2906     uint32_t txaddbareq;
2907     uint32_t txaddbaresp;
2908     uint32_t txdelba;
2909     uint32_t txba;
2910     uint32_t txbar;
2911     uint32_t txpad[4];
2912     uint32_t rxpdu;
2913     uint32_t rxqed;
2914     uint32_t rxdup;
2915     uint32_t rxnobuf;
2916     uint32_t rxaddbareq;
2917     uint32_t rxaddbaresp;
2918     uint32_t rxdelba;
2919     uint32_t rxba;
2920     uint32_t rxbar;
2921     uint32_t rxinvba;
2922     uint32_t rxbaholes;
2923     uint32_t rxunexp;
2924     uint32_t rxpad[4];
2925 } wlc_ba_cnt_t;
2926 struct ampdu_tid_control
2927 {
2928     uint8_t tid;
2929     uint8_t enable;
2930 };
2931 struct wl_msglevel2
2932 {
2933     uint32_t low;
2934     uint32_t high;
2935 };
2936 struct ampdu_ea_tid
2937 {
2938     wl_ether_addr_t ea;
2939     uint8_t tid;
2940 };
2941 struct ampdu_retry_tid
2942 {
2943     uint8_t tid;
2944     uint8_t retry;
2945 };
2946 struct ampdu_ba_sizes
2947 {
2948     uint8_t ba_tx_wsize;
2949     uint8_t ba_rx_wsize;
2950 };
2951 #define    DPT_DISCOVERY_MANUAL    0x01
2952 #define    DPT_DISCOVERY_AUTO    0x02
2953 #define    DPT_DISCOVERY_SCAN    0x04
2954 #define DPT_PATHSEL_AUTO    0
2955 #define DPT_PATHSEL_DIRECT    1
2956 #define DPT_PATHSEL_APPATH    2
2957 #define DPT_DENY_LIST_ADD     1
2958 #define DPT_DENY_LIST_REMOVE     2
2959 #define DPT_MANUAL_EP_CREATE    1
2960 #define DPT_MANUAL_EP_MODIFY    2
2961 #define DPT_MANUAL_EP_DELETE    3
2962 typedef struct dpt_iovar
2963 {
2964     wl_ether_addr_t ea;
2965     uint8_t mode;
2966     uint32_t pad;
2967 } dpt_iovar_t;
2968 #define    DPT_STATUS_ACTIVE    0x01
2969 #define    DPT_STATUS_AES        0x02
2970 #define    DPT_STATUS_FAILED    0x04
2971 #define    DPT_FNAME_LEN        48
2972 typedef struct dpt_status
2973 {
2974     uint8_t status;
2975     uint8_t fnlen;
2976     uint8_t name[DPT_FNAME_LEN];
2977     uint32_t rssi;
2978     sta_info_t sta;
2979 } dpt_status_t;
2980 typedef struct dpt_list
2981 {
2982     uint32_t num;
2983     dpt_status_t status[1];
2984 } dpt_list_t;
2985 typedef struct dpt_fname
2986 {
2987     uint8_t len;
2988     uint8_t name[DPT_FNAME_LEN];
2989 } dpt_fname_t;
2990 #define    BDD_FNAME_LEN        32
2991 typedef struct bdd_fname
2992 {
2993     uint8_t len;
2994     uint8_t name[BDD_FNAME_LEN];
2995 } bdd_fname_t;
2996 struct ts_list
2997 {
2998     int32_t count;
2999     struct tsinfo_arg tsinfo[1];
3000 };
3001 typedef struct tspec_arg
3002 {
3003     uint16_t version;
3004     uint16_t length;
3005     uint32_t flag;
3006     struct tsinfo_arg tsinfo;
3007     uint16_t nom_msdu_size;
3008     uint16_t max_msdu_size;
3009     uint32_t min_srv_interval;
3010     uint32_t max_srv_interval;
3011     uint32_t inactivity_interval;
3012     uint32_t suspension_interval;
3013     uint32_t srv_start_time;
3014     uint32_t min_data_rate;
3015     uint32_t mean_data_rate;
3016     uint32_t peak_data_rate;
3017     uint32_t max_burst_size;
3018     uint32_t delay_bound;
3019     uint32_t min_phy_rate;
3020     uint16_t surplus_bw;
3021     uint16_t medium_time;
3022     uint8_t dialog_token;
3023 } tspec_arg_t;
3024 typedef struct tspec_per_sta_arg
3025 {
3026     wl_ether_addr_t ea;
3027     struct tspec_arg ts;
3028 } tspec_per_sta_arg_t;
3029 typedef struct wme_max_bandwidth
3030 {
3031     uint32_t ac[AC_COUNT];
3032 } wme_max_bandwidth_t;
3033 #define WL_WME_MBW_PARAMS_IO_BYTES (sizeof(wme_max_bandwidth_t) )
3034 #define    TSPEC_ARG_VERSION        2
3035 #define TSPEC_ARG_LENGTH        55
3036 #define TSPEC_DEFAULT_DIALOG_TOKEN    42
3037 #define TSPEC_DEFAULT_SBW_FACTOR    0x3000
3038 #define TSPEC_PENDING        0
3039 #define TSPEC_ACCEPTED        1
3040 #define TSPEC_REJECTED        2
3041 #define TSPEC_UNKNOWN        3
3042 #define TSPEC_STATUS_MASK    7
3043 #define WL_WLAN_ASSOC_REASON_NORMAL_NETWORK    0
3044 #define WL_WLAN_ASSOC_REASON_ROAM_FROM_CELLULAR_NETWORK    1
3045 #define WL_WLAN_ASSOC_REASON_ROAM_FROM_LAN    2
3046 #define WL_WLAN_ASSOC_REASON_MAX        2
3047 #define WL_SWFL_ABBFL        0x0001
3048 #define WL_SWFL_ABENCORE    0x0002
3049 #define WL_SWFL_NOHWRADIO    0x0004
3050 #define WL_LIFETIME_MAX 0xFFFF
3051 typedef struct wl_lifetime
3052 {
3053     uint32_t ac;
3054     uint32_t lifetime;
3055 } wl_lifetime_t;
3056 typedef struct wl_chan_switch
3057 {
3058     uint8_t mode;
3059     uint8_t count;
3060     wl_chanspec_t chspec;
3061     uint8_t reg;
3062 } wl_chan_switch_t;
3063 #define WLC_ROAM_TRIGGER_DEFAULT    0
3064 #define WLC_ROAM_TRIGGER_BANDWIDTH    1
3065 #define WLC_ROAM_TRIGGER_DISTANCE    2
3066 #define WLC_ROAM_TRIGGER_MAX_VALUE    2
3067 enum
3068 {
3069     PFN_LIST_ORDER, PFN_RSSI
3070 };
3071 #define SORT_CRITERIA_BIT       0
3072 #define AUTO_NET_SWITCH_BIT     1
3073 #define ENABLE_BKGRD_SCAN_BIT   2
3074 #define IMMEDIATE_SCAN_BIT      3
3075 #define AUTO_CONNECT_BIT        4
3076 #define IMMEDIATE_EVENT_BIT     8
3077 #define SUPPRESS_SSID_BIT       9
3078 #define ENABLE_NET_OFFLOAD_BIT  10
3079 #define SORT_CRITERIA_MASK      0x01
3080 #define AUTO_NET_SWITCH_MASK    0x02
3081 #define ENABLE_BKGRD_SCAN_MASK  0x04
3082 #define IMMEDIATE_SCAN_MASK     0x08
3083 #define AUTO_CONNECT_MASK       0x10
3084 #define PFN_VERSION             2
3085 
3086 /* PFN network info structure */
3087 typedef struct wl_pfn_subnet_info
3088 {
3089     struct ether_addr BSSID;
3090     uint8_t channel;     /* channel number only */
3091     uint8_t SSID_len;
3092     uint8_t SSID[32];
3093 } wl_pfn_subnet_info_t;
3094 
3095 typedef struct wl_pfn_net_info
3096 {
3097     wl_pfn_subnet_info_t pfnsubnet;
3098     int16_t RSSI;     /* receive signal strength (in dBm) */
3099     uint16_t timestamp;     /* age in seconds */
3100 } wl_pfn_net_info_t;
3101 
3102 /* used to report exactly one scan result */
3103 /* plus reports detailed scan info in bss_info */
3104 typedef struct wl_pfn_scanresult
3105 {
3106     uint32_t version;
3107     uint32_t status;
3108     uint32_t count;
3109     wl_pfn_net_info_t netinfo;
3110     wl_bss_info_t bss_info;
3111 } wl_pfn_scanresult_t;
3112 
3113 /* PFN data structure */
3114 typedef struct wl_pfn_param
3115 {
3116     int32_t version;     /* PNO parameters version */
3117     int32_t scan_freq;     /* Scan frequency */
3118     int32_t lost_network_timeout;     /* Timeout in sec. to declare
3119                                        * discovered network as lost
3120                                        */
3121     int16_t flags;     /* Bit field to control features
3122                         * of PFN such as sort criteria auto
3123                         * enable switch and background scan
3124                         */
3125     int16_t rssi_margin;     /* Margin to avoid jitter for choosing a
3126                               * PFN based on RSSI sort criteria
3127                               */
3128     uint8_t bestn;     /* number of best networks in each scan */
3129     uint8_t mscan;     /* number of scans recorded */
3130     uint8_t repeat;     /* Minimum number of scan intervals
3131                          * before scan frequency changes in adaptive scan
3132                          */
3133     uint8_t exp;     /* Exponent of 2 for maximum scan interval */
3134 
3135     int32_t slow_freq;     /* slow scan period */
3136 } wl_pfn_param_t;
3137 
3138 typedef struct wl_pfn_bssid
3139 {
3140     struct ether_addr macaddr;
3141     /* Bit4: suppress_lost, Bit3: suppress_found */
3142     uint16_t flags;
3143 } wl_pfn_bssid_t;
3144 
3145 typedef struct wl_pfn_cfg
3146 {
3147     uint32_t reporttype;
3148     int32_t channel_num;
3149     uint16_t channel_list[WL_NUMCHANNELS];
3150     uint32_t flags;
3151 } wl_pfn_cfg_t;
3152 
3153 /* for use with wl_pfn.flags */
3154 #define WL_PFN_HIDDEN_MASK       0x4
3155 #define WL_PFN_SUPPRESSLOST_MASK 0x10
3156 
3157 typedef struct wl_pfn
3158 {
3159     wlc_ssid_t ssid;     /* ssid name and its length */
3160     int32_t flags;     /* bit2: hidden */
3161     int32_t infra;     /* BSS Vs IBSS */
3162     int32_t auth;     /* Open Vs Closed */
3163     int32_t wpa_auth;     /* WPA type */
3164     int32_t wsec;     /* wsec value */
3165 } wl_pfn_t;
3166 
3167 #define TOE_TX_CSUM_OL        0x00000001
3168 #define TOE_RX_CSUM_OL        0x00000002
3169 #define TOE_ERRTEST_TX_CSUM    0x00000001
3170 #define TOE_ERRTEST_RX_CSUM    0x00000002
3171 #define TOE_ERRTEST_RX_CSUM2    0x00000004
3172 struct toe_ol_stats_t
3173 {
3174     uint32_t tx_summed;
3175     uint32_t tx_iph_fill;
3176     uint32_t tx_tcp_fill;
3177     uint32_t tx_udp_fill;
3178     uint32_t tx_icmp_fill;
3179     uint32_t rx_iph_good;
3180     uint32_t rx_iph_bad;
3181     uint32_t rx_tcp_good;
3182     uint32_t rx_tcp_bad;
3183     uint32_t rx_udp_good;
3184     uint32_t rx_udp_bad;
3185     uint32_t rx_icmp_good;
3186     uint32_t rx_icmp_bad;
3187     uint32_t tx_tcp_errinj;
3188     uint32_t tx_udp_errinj;
3189     uint32_t tx_icmp_errinj;
3190     uint32_t rx_tcp_errinj;
3191     uint32_t rx_udp_errinj;
3192     uint32_t rx_icmp_errinj;
3193 };
3194 #define ARP_OL_AGENT        0x00000001
3195 #define ARP_OL_SNOOP        0x00000002
3196 #define ARP_OL_HOST_AUTO_REPLY    0x00000004
3197 #define ARP_OL_PEER_AUTO_REPLY    0x00000008
3198 #define ARP_ERRTEST_REPLY_PEER    0x1
3199 #define ARP_ERRTEST_REPLY_HOST    0x2
3200 #define ARP_MULTIHOMING_MAX    8
3201 typedef struct arp_ol_stats
3202 {
3203     uint32_t host_ip_entries;
3204     uint32_t host_ip_overflow;
3205     uint32_t arp_table_entries;
3206     uint32_t arp_table_overflow;
3207     uint32_t host_request;
3208     uint32_t host_reply;
3209     uint32_t host_service;
3210     uint32_t peer_request;
3211     uint32_t peer_request_drop;
3212     uint32_t peer_reply;
3213     uint32_t peer_reply_drop;
3214     uint32_t peer_service;
3215 }arp_ol_stats_t;
3216 typedef struct wl_keep_alive_pkt
3217 {
3218     uint32_t period_msec;
3219     uint16_t len_bytes;
3220     uint8_t data[1];
3221 } wl_keep_alive_pkt_t;
3222 #define WL_KEEP_ALIVE_FIXED_LEN        offsetof(wl_keep_alive_pkt_t, data)
3223 typedef enum wl_pkt_filter_type
3224 {
3225     WL_PKT_FILTER_TYPE_PATTERN_MATCH
3226 } wl_pkt_filter_type_t;
3227 #define WL_PKT_FILTER_TYPE wl_pkt_filter_type_t
3228 typedef struct wl_pkt_filter_pattern
3229 {
3230     uint32_t offset;
3231     uint32_t size_bytes;
3232     uint8_t mask_and_pattern[1];
3233 } wl_pkt_filter_pattern_t;
3234 typedef struct wl_pkt_filter
3235 {
3236     uint32_t id;
3237     uint32_t type;
3238     uint32_t negate_match;
3239     union
3240     {
3241         wl_pkt_filter_pattern_t pattern;
3242     } u;
3243 } wl_pkt_filter_t;
3244 #define WL_PKT_FILTER_FIXED_LEN              offsetof(wl_pkt_filter_t, u)
3245 #define WL_PKT_FILTER_PATTERN_FIXED_LEN      offsetof(wl_pkt_filter_pattern_t, mask_and_pattern)
3246 typedef struct wl_pkt_filter_enable
3247 {
3248     uint32_t id;
3249     uint32_t enable;
3250 } wl_pkt_filter_enable_t;
3251 typedef struct wl_pkt_filter_list
3252 {
3253     uint32_t num;
3254     wl_pkt_filter_t filter[1];
3255 } wl_pkt_filter_list_t;
3256 #define WL_PKT_FILTER_LIST_FIXED_LEN      offsetof(wl_pkt_filter_list_t, filter)
3257 typedef struct wl_pkt_filter_stats
3258 {
3259     uint32_t num_pkts_matched;
3260     uint32_t num_pkts_forwarded;
3261     uint32_t num_pkts_discarded;
3262 } wl_pkt_filter_stats_t;
3263 typedef struct wl_seq_cmd_ioctl
3264 {
3265     uint32_t cmd;
3266     uint32_t len;
3267 } wl_seq_cmd_ioctl_t;
3268 #define WL_SEQ_CMD_ALIGN_BYTES    4
3269 #define WL_SEQ_CMDS_GET_IOCTL_FILTER(cmd) \
3270     ( ( (cmd) == WLC_GET_MAGIC )        || \
3271       ( (cmd) == WLC_GET_VERSION )        || \
3272       ( (cmd) == WLC_GET_AP )            || \
3273       ( (cmd) == WLC_GET_INSTANCE ) )
3274 #define WL_PKTENG_PER_TX_START            0x01
3275 #define WL_PKTENG_PER_TX_STOP            0x02
3276 #define WL_PKTENG_PER_RX_START            0x04
3277 #define WL_PKTENG_PER_RX_WITH_ACK_START     0x05
3278 #define WL_PKTENG_PER_TX_WITH_ACK_START     0x06
3279 #define WL_PKTENG_PER_RX_STOP            0x08
3280 #define WL_PKTENG_PER_MASK            0xff
3281 #define WL_PKTENG_SYNCHRONOUS            0x100
3282 typedef struct wl_pkteng
3283 {
3284     uint32_t flags;
3285     uint32_t delay;
3286     uint32_t nframes;
3287     uint32_t length;
3288     uint8_t seqno;
3289     wl_ether_addr_t dest;
3290     wl_ether_addr_t src;
3291 } wl_pkteng_t;
3292 #define NUM_80211b_RATES    4
3293 #define NUM_80211ag_RATES    8
3294 #define NUM_80211n_RATES    32
3295 #define NUM_80211_RATES        (NUM_80211b_RATES + NUM_80211ag_RATES + NUM_80211n_RATES)
3296 typedef struct wl_pkteng_stats
3297 {
3298     uint32_t lostfrmcnt;
3299     int32_t rssi;
3300     int32_t snr;
3301     uint16_t rxpktcnt[NUM_80211_RATES + 1];
3302 } wl_pkteng_stats_t;
3303 typedef struct wl_sslpnphy_papd_debug_data
3304 {
3305     uint8_t psat_pwr;
3306     uint8_t psat_indx;
3307     uint8_t final_idx;
3308     uint8_t start_idx;
3309     int32_t min_phase;
3310     int32_t voltage;
3311     int8_t temperature;
3312 } wl_sslpnphy_papd_debug_data_t;
3313 typedef struct wl_sslpnphy_debug_data
3314 {
3315     int16_t papdcompRe[64];
3316     int16_t papdcompIm[64];
3317 } wl_sslpnphy_debug_data_t;
3318 typedef struct wl_sslpnphy_spbdump_data
3319 {
3320     uint16_t tbl_length;
3321     int16_t spbreal[256];
3322     int16_t spbimg[256];
3323 } wl_sslpnphy_spbdump_data_t;
3324 typedef struct wl_sslpnphy_percal_debug_data
3325 {
3326     uint32_t cur_idx;
3327     uint32_t tx_drift;
3328     uint8_t prev_cal_idx;
3329     uint32_t percal_ctr;
3330     int32_t nxt_cal_idx;
3331     uint32_t force_1idxcal;
3332     uint32_t onedxacl_req;
3333     int32_t last_cal_volt;
3334     int8_t last_cal_temp;
3335     uint32_t vbat_ripple;
3336     uint32_t exit_route;
3337     int32_t volt_winner;
3338 } wl_sslpnphy_percal_debug_data_t;
3339 #define WL_WOWL_MAGIC       (1 << 0)
3340 #define WL_WOWL_NET         (1 << 1)
3341 #define WL_WOWL_DIS         (1 << 2)
3342 #define WL_WOWL_RETR        (1 << 3)
3343 #define WL_WOWL_BCN         (1 << 4)
3344 #define WL_WOWL_TST         (1 << 5)
3345 #define WL_WOWL_TRAFFIC     (1 << 12)
3346 #define WL_WOWL_BCAST       (1 << 15)
3347 #define WL_WOWL_GTK         (0x441f)
3348 #define WL_WOWL_DEAUTH      (0x1F)
3349 #define WL_WOWL_ALL         (0x541E)
3350 
3351 #define MAGIC_PKT_MINLEN 102
3352 typedef struct
3353 {
3354     uint32_t masksize;
3355     uint32_t offset;
3356     uint32_t patternoffset;
3357     uint32_t patternsize;
3358 } wl_wowl_pattern_t;
3359 typedef struct
3360 {
3361     uint32_t count;
3362     wl_wowl_pattern_t pattern[1];
3363 } wl_wowl_pattern_list_t;
3364 typedef struct
3365 {
3366     uint8_t pci_wakeind;
3367     uint16_t ucode_wakeind;
3368 } wl_wowl_wakeind_t;
3369 typedef struct wl_txrate_class
3370 {
3371     uint8_t init_rate;
3372     uint8_t min_rate;
3373     uint8_t max_rate;
3374 } wl_txrate_class_t;
3375 #define WL_DELAYMODE_DEFER    0
3376 #define WL_DELAYMODE_FORCE    1
3377 #define WL_DELAYMODE_AUTO    2
3378 #define WLC_OBSS_SCAN_PASSIVE_DWELL_DEFAULT        100
3379 #define WLC_OBSS_SCAN_PASSIVE_DWELL_MIN            5
3380 #define WLC_OBSS_SCAN_PASSIVE_DWELL_MAX            1000
3381 #define WLC_OBSS_SCAN_ACTIVE_DWELL_DEFAULT        20
3382 #define WLC_OBSS_SCAN_ACTIVE_DWELL_MIN            10
3383 #define WLC_OBSS_SCAN_ACTIVE_DWELL_MAX            1000
3384 #define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_DEFAULT    300
3385 #define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_MIN        10
3386 #define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_MAX        900
3387 #define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_DEFAULT    5
3388 #define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_MIN    5
3389 #define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_MAX    100
3390 #define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_DEFAULT    200
3391 #define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_MIN    200
3392 #define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_MAX    10000
3393 #define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_DEFAULT    20
3394 #define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_MIN    20
3395 #define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_MAX    10000
3396 #define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_DEFAULT    25
3397 #define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_MIN        0
3398 #define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_MAX        100
3399 typedef struct wl_obss_scan_arg
3400 {
3401     int16_t passive_dwell;
3402     int16_t active_dwell;
3403     int16_t bss_widthscan_interval;
3404     int16_t passive_total;
3405     int16_t active_total;
3406     int16_t chanwidth_transition_delay;
3407     int16_t activity_threshold;
3408 } wl_obss_scan_arg_t;
3409 #define WL_OBSS_SCAN_PARAM_LEN    sizeof(wl_obss_scan_arg_t)
3410 #define WL_MIN_NUM_OBSS_SCAN_ARG 7
3411 #define WL_COEX_INFO_MASK        0x07
3412 #define WL_COEX_INFO_REQ        0x01
3413 #define    WL_COEX_40MHZ_INTOLERANT    0x02
3414 #define    WL_COEX_WIDTH20            0x04
3415 typedef struct wl_action_obss_coex_req
3416 {
3417     uint8_t info;
3418     uint8_t num;
3419     uint8_t ch_list[1];
3420 } wl_action_obss_coex_req_t;
3421 #define MAX_RSSI_LEVELS 8
3422 typedef struct wl_rssi_event
3423 {
3424     uint32_t rate_limit_msec;
3425     uint8_t num_rssi_levels;
3426     int8_t rssi_levels[MAX_RSSI_LEVELS];
3427 } wl_rssi_event_t;
3428 #define WLFEATURE_DISABLE_11N        0x00000001
3429 #define WLFEATURE_DISABLE_11N_STBC_TX    0x00000002
3430 #define WLFEATURE_DISABLE_11N_STBC_RX    0x00000004
3431 #define WLFEATURE_DISABLE_11N_SGI_TX    0x00000008
3432 #define WLFEATURE_DISABLE_11N_SGI_RX    0x00000010
3433 #define WLFEATURE_DISABLE_11N_AMPDU_TX    0x00000020
3434 #define WLFEATURE_DISABLE_11N_AMPDU_RX    0x00000040
3435 #define WLFEATURE_DISABLE_11N_GF    0x00000080
3436 
3437 #pragma pack(1)
3438 
3439 typedef struct sta_prbreq_wps_ie_hdr
3440 {
3441     wl_ether_addr_t staAddr;
3442     uint16_t ieLen;
3443 } sta_prbreq_wps_ie_hdr_t;
3444 
3445 typedef struct sta_prbreq_wps_ie_data
3446 {
3447     sta_prbreq_wps_ie_hdr_t hdr;
3448     uint8_t ieData[1];
3449 } sta_prbreq_wps_ie_data_t;
3450 
3451 typedef struct sta_prbreq_wps_ie_list
3452 {
3453     uint32_t totLen;
3454     uint8_t ieDataList[1];
3455 } sta_prbreq_wps_ie_list_t;
3456 
3457 /* EDCF related items from 802.11.h */
3458 
3459 /* ACI from 802.11.h */
3460 #define EDCF_AIFSN_MIN               1           /* AIFSN minimum value */
3461 #define EDCF_AIFSN_MAX               15          /* AIFSN maximum value */
3462 #define EDCF_AIFSN_MASK              0x0f        /* AIFSN mask */
3463 #define EDCF_ACM_MASK                0x10        /* ACM mask */
3464 #define EDCF_ACI_MASK                0x60        /* ACI mask */
3465 #define EDCF_ACI_SHIFT               5           /* ACI shift */
3466 #define EDCF_AIFSN_SHIFT             12          /* 4 MSB(0xFFF) in ifs_ctl for AC idx */
3467 
3468 /* ECW from 802.11.h */
3469 #define EDCF_ECW_MIN                 0           /* cwmin/cwmax exponent minimum value */
3470 #define EDCF_ECW_MAX                 15          /* cwmin/cwmax exponent maximum value */
3471 #define EDCF_ECW2CW(exp)             ( (1 << (exp) ) - 1 )
3472 #define EDCF_ECWMIN_MASK             0x0f        /* cwmin exponent form mask */
3473 #define EDCF_ECWMAX_MASK             0xf0        /* cwmax exponent form mask */
3474 #define EDCF_ECWMAX_SHIFT            4           /* cwmax exponent form shift */
3475 
3476 /* TXOP from 802.11.h */
3477 #define EDCF_TXOP_MIN                0           /* TXOP minimum value */
3478 #define EDCF_TXOP_MAX                65535       /* TXOP maximum value */
3479 #define EDCF_TXOP2USEC(txop)         ( (txop) << 5 )
3480 
3481 #define EDCF_ACPARAM
3482 struct edcf_acparam
3483 {
3484     uint8_t ACI;
3485     uint8_t ECW;
3486     uint16_t TXOP;     /* stored in network order (ls octet first) */
3487 };
3488 typedef struct edcf_acparam edcf_acparam_t;
3489 
3490 /* Stop packing structures */
3491 #pragma pack()
3492 
3493 /* discovery state */
3494 typedef struct wl_p2p_disc_st
3495 {
3496     uint8_t state;     /* see p2p_discovery_state_t */
3497     uint16_t chanspec;     /* valid in listen state */
3498     uint16_t dwell_time_ms;     /* valid in listen state, in ms */
3499 } wl_p2p_disc_st_t;
3500 
3501 /* scan request */
3502 typedef struct wl_p2p_scan
3503 {
3504     uint8_t type;     /* 'S' for WLC_SCAN, 'E' for "escan" */
3505     uint8_t reserved[3];
3506     /* scan or escan parms... */
3507 } wl_p2p_scan_t;
3508 
3509 /* escan request */
3510 typedef struct
3511 {
3512     uint8_t type;     /* 'S' for WLC_SCAN, 'E' for "escan" */
3513     uint8_t reserved[3];
3514 
3515     /* escan params */
3516     wl_escan_params_t escan;
3517 } wl_p2p_escan_t;
3518 
3519 /* i/f request */
3520 typedef struct wl_p2p_if
3521 {
3522     struct ether_addr mac_address;
3523     uint8_t interface_type;
3524     uint16_t chan_spec;
3525 } wl_p2p_if_t;
3526 
3527 /* i/f query */
3528 typedef struct wl_p2p_ifq
3529 {
3530     uint32_t bsscfgidx;
3531     char ifname[16];
3532 } wl_p2p_ifq_t;
3533 
3534 /* OppPS & CTWindow */
3535 typedef struct wl_p2p_ops
3536 {
3537     uint8_t ops;     /* 0: disable 1: enable */
3538     uint8_t ctw;     /* >= 10 */
3539 } wl_p2p_ops_t;
3540 
3541 /* absence and presence request */
3542 typedef struct wl_p2p_sched_desc
3543 {
3544     uint32_t start;
3545     uint32_t interval;
3546     uint32_t duration;
3547     uint32_t count;     /* see count */
3548 } wl_p2p_sched_desc_t;
3549 
3550 typedef struct wl_p2p_sched
3551 {
3552     uint8_t type;     /* see schedule type */
3553     uint8_t action;     /* see schedule action */
3554     uint8_t option;     /* see schedule option */
3555     wl_p2p_sched_desc_t desc[1];
3556 } wl_p2p_sched_t;
3557 
3558 /* schedule type */
3559 #define WL_P2P_SCHED_TYPE_ABS           0       /* Scheduled Absence */
3560 #define WL_P2P_SCHED_TYPE_REQ_ABS       1       /* Requested Absence */
3561 #define WL_P2P_SCHED_TYPE_REQ_PSC       2       /* Requested Presence */
3562 
3563 /* schedule action during absence periods (for WL_P2P_SCHED_ABS type) */
3564 #define WL_P2P_SCHED_ACTION_NONE        0       /* no action */
3565 #define WL_P2P_SCHED_ACTION_DOZE        1       /* doze */
3566 #define WL_P2P_SCHED_ACTION_RESET       255     /* reset */
3567 
3568 /* schedule option - WL_P2P_SCHED_TYPE_ABS */
3569 #define WL_P2P_SCHED_OPTION_NORMAL      0       /* normal start/interval/duration/count in time */
3570 #define WL_P2P_SCHED_OPTION_BCNPCT      1       /* percentage of beacon interval */
3571 
3572 typedef struct wl_p2p_wfds_hash
3573 {
3574     uint32_t advt_id;
3575     uint16_t nw_cfg_method;
3576     uint8_t wfds_hash[6];
3577     uint8_t name_len;
3578     uint8_t service_name[MAX_WFDS_SVC_NAME_LEN];
3579 } wl_p2p_wfds_hash_t;
3580 
3581 #define P2P_IP_ALLOC_LEN            12
3582 /* Definitions for Reliable Multicast */
3583 /* NOTE: RMC structures should not be packed */
3584 
3585 #define WL_RMC_CNT_VERSION         (1)
3586 #define WL_RMC_TR_VERSION          (1)
3587 #define WL_RMC_MAX_CLIENT          (32)
3588 #define WL_RMC_FLAG_INBLACKLIST    (1)
3589 #define WL_RMC_FLAG_ACTIVEACKER    (2)
3590 #define WL_RMC_FLAG_RELMCAST       (4)
3591 #define WL_RMC_FLAG_MASTER_TX      (8)
3592 #define WL_RMC_MAX_TABLE_ENTRY     (8)
3593 
3594 #define WL_RMC_VER                 (1)
3595 #define WL_RMC_INDEX_ACK_ALL       (255)
3596 #define WL_RMC_NUM_OF_MC_STREAMS   (4)
3597 #define WL_RMC_MAX_TRS_PER_GROUP   (1)
3598 #define WL_RMC_MAX_TRS_IN_ACKALL   (1)
3599 #define WL_RMC_ACK_MCAST0          (0x02)
3600 #define WL_RMC_ACK_MCAST_ALL       (0x01)
3601 #define WL_RMC_ACTF_TIME_MIN       (300)     /* time in ms */
3602 #define WL_RMC_ACTF_TIME_MAX       (20000)   /* time in ms */
3603 #define WL_RMC_MAX_NUM_TRS         (32)      /* maximun transmitters allowed */
3604 #define WL_RMC_ARTMO_MIN           (350)     /* time in ms */
3605 #define WL_RMC_ARTMO_MAX           (40000)   /* time in ms */
3606 
3607 enum rmc_opcodes
3608 {
3609     RELMCAST_ENTRY_OP_DISABLE = 0,     /* Disable multi-cast group */
3610     RELMCAST_ENTRY_OP_DELETE = 1,     /* Delete multi-cast group */
3611     RELMCAST_ENTRY_OP_ENABLE = 2,     /* Enable multi-cast group */
3612     RELMCAST_ENTRY_OP_ACK_ALL = 3     /* Enable ACK ALL bit in AMT */
3613 };
3614 
3615 /* RMC operational modes */
3616 enum rmc_modes
3617 {
3618     WL_RMC_MODE_RECEIVER = 0,     /* Receiver mode by default */
3619     WL_RMC_MODE_TRANSMITTER = 1,     /* Transmitter mode using wl ackreq */
3620     WL_RMC_MODE_INITIATOR = 2     /* Initiator mode using wl ackreq */
3621 };
3622 
3623 /* Each RMC mcast client info */
3624 typedef struct wl_relmcast_client
3625 {
3626     uint8_t flag;     /* status of client such as AR, R, or blacklisted */
3627     int16_t rssi;     /* rssi value of RMC client */
3628     struct ether_addr addr;     /* mac address of RMC client */
3629 } wl_relmcast_client_t;
3630 
3631 /* RMC Counters */
3632 typedef struct wl_rmc_cnts
3633 {
3634     uint16_t version;     /* see definition of WL_CNT_T_VERSION */
3635     uint16_t length;     /* length of entire structure */
3636     uint16_t dupcnt;     /* counter for duplicate rmc MPDU */
3637     uint16_t ackreq_err;     /* counter for wl ackreq error    */
3638     uint16_t af_tx_err;     /* error count for action frame transmit   */
3639     uint16_t null_tx_err;     /* error count for rmc null frame transmit */
3640     uint16_t af_unicast_tx_err;     /* error count for rmc unicast frame transmit */
3641     uint16_t mc_no_amt_slot;     /* No mcast AMT entry available */
3642     /* Unused. Keep for rom compatibility */
3643     uint16_t mc_no_glb_slot;     /* No mcast entry available in global table */
3644     uint16_t mc_not_mirrored;     /* mcast group is not mirrored */
3645     uint16_t mc_existing_tr;     /* mcast group is already taken by transmitter */
3646     uint16_t mc_exist_in_amt;     /* mcast group is already programmed in amt */
3647     /* Unused. Keep for rom compatibility */
3648     uint16_t mc_not_exist_in_gbl;     /* mcast group is not in global table */
3649     uint16_t mc_not_exist_in_amt;     /* mcast group is not in AMT table */
3650     uint16_t mc_utilized;     /* mcast addressed is already taken */
3651     uint16_t mc_taken_other_tr;     /* multi-cast addressed is already taken */
3652     uint32_t rmc_rx_frames_mac;     /* no of mc frames received from mac */
3653     uint32_t rmc_tx_frames_mac;     /* no of mc frames transmitted to mac */
3654     uint32_t mc_null_ar_cnt;     /* no. of times NULL AR is received */
3655     uint32_t mc_ar_role_selected;     /* no. of times took AR role */
3656     uint32_t mc_ar_role_deleted;     /* no. of times AR role cancelled */
3657     uint32_t mc_noacktimer_expired;     /* no. of times noack timer expired */
3658     uint16_t mc_no_wl_clk;     /* no wl clk detected when trying to access amt */
3659     uint16_t mc_tr_cnt_exceeded;     /* No of transmitters in the network exceeded */
3660 } wl_rmc_cnts_t;
3661 
3662 /* RMC Status */
3663 typedef struct wl_relmcast_st
3664 {
3665     uint8_t ver;     /* version of RMC */
3666     uint8_t num;     /* number of clients detected by transmitter */
3667     wl_relmcast_client_t clients[WL_RMC_MAX_CLIENT];
3668     uint16_t err;     /* error status (used in infra) */
3669     uint16_t actf_time;     /* action frame time period */
3670 } wl_relmcast_status_t;
3671 
3672 /* Entry for each STA/node */
3673 typedef struct wl_rmc_entry
3674 {
3675     /* operation on multi-cast entry such add,
3676      * delete, ack-all
3677      */
3678     int8_t flag;
3679     struct ether_addr addr;     /* multi-cast group mac address */
3680 } wl_rmc_entry_t;
3681 
3682 /* RMC table */
3683 typedef struct wl_rmc_entry_table
3684 {
3685     uint8_t index;     /* index to a particular mac entry in table */
3686     uint8_t opcode;     /* opcodes or operation on entry */
3687     wl_rmc_entry_t entry[WL_RMC_MAX_TABLE_ENTRY];
3688 } wl_rmc_entry_table_t;
3689 
3690 typedef struct wl_rmc_trans_elem
3691 {
3692     struct ether_addr tr_mac;     /* transmitter mac */
3693     struct ether_addr ar_mac;     /* ar mac */
3694     uint16_t artmo;     /* AR timeout */
3695     uint8_t amt_idx;     /* amt table entry */
3696     uint16_t flag;     /* entry will be acked, not acked, programmed, full etc */
3697 } wl_rmc_trans_elem_t;
3698 
3699 /* RMC transmitters */
3700 typedef struct wl_rmc_trans_in_network
3701 {
3702     uint8_t ver;     /* version of RMC */
3703     uint8_t num_tr;     /* number of transmitters in the network */
3704     wl_rmc_trans_elem_t trs[WL_RMC_MAX_NUM_TRS];
3705 } wl_rmc_trans_in_network_t;
3706 
3707 /* To update vendor specific ie for RMC */
3708 typedef struct wl_rmc_vsie
3709 {
3710     uint8_t oui[3];
3711     uint16_t payload;     /* IE Data Payload */
3712 } wl_rmc_vsie_t;
3713 
3714 /* WLC_E_ULP event data */
3715 #define WL_ULP_EVENT_VERSION        1
3716 #define WL_ULP_DISABLE_CONSOLE      1   /* Disable console message on ULP entry */
3717 #define WL_ULP_UCODE_DOWNLOAD       2   /* Download ULP ucode file */
3718 #define WL_ULP_ENTRY                3   /* inform ulp entry to Host during warmboot */
3719 
3720 typedef struct wl_ulp_event
3721 {
3722     uint16_t version;
3723     uint16_t ulp_dongle_action;
3724 } wl_ulp_event_t;
3725 
3726 /* clm download */
3727 #define DLOAD_HANDLER_VER   1   /* Downloader version */
3728 #define DLOAD_FLAG_VER_MASK 0xf000  /* Downloader version mask */
3729 #define DLOAD_FLAG_VER_SHIFT    12  /* Downloader version shift */
3730 
3731 #define DL_CRC_NOT_INUSE    0x0001
3732 #define DL_BEGIN        0x0002
3733 #define DL_END          0x0004
3734 
3735 enum
3736 {
3737     DL_TYPE_UCODE = 1, DL_TYPE_CLM = 2
3738 };
3739 
3740 struct wl_dload_data
3741 {
3742     uint16_t flag;
3743     uint16_t dload_type;
3744     uint32_t len;
3745     uint32_t crc;
3746     uint8_t data[1];
3747 };
3748 typedef struct wl_dload_data wl_dload_data_t;
3749 
3750 struct wl_clm_dload_info
3751 {
3752     uint32_t ds_id;
3753     uint32_t clm_total_len;
3754     uint32_t num_chunks;
3755     uint32_t chunk_len;
3756     uint32_t chunk_offset;
3757     uint8_t data_chunk[1];
3758 };
3759 typedef struct wl_clm_dload_info wl_clm_dload_info_t;
3760 
3761 #pragma pack(1)
3762 typedef struct mesh_peer_info
3763 {
3764     uint16_t mesh_peer_prot_id;
3765     uint16_t local_link_id;
3766     uint16_t peer_link_id;
3767     uint16_t peer_aid;
3768     uint8_t state;
3769 } mesh_peer_info_t;
3770 
3771 typedef struct mesh_peer_info_ext
3772 {
3773     mesh_peer_info_t peer_info;
3774     uint16_t local_aid;
3775     struct ether_addr ea;
3776     uint32_t entry_state;
3777     int32_t rssi;
3778 } mesh_peer_info_ext_t;
3779 
3780 typedef struct mesh_peer_info_dump
3781 {
3782     uint32_t buflen;
3783     uint32_t version;
3784     uint32_t count;     /* number of results */
3785     mesh_peer_info_ext_t mpi_ext[1];
3786 } mesh_peer_info_dump_t;
3787 
3788 #define WL_CHANSPEC_CTL_SB_LLL      0x0000
3789 #define WL_CHANSPEC_CTL_SB_LLU      0x0100
3790 #define WL_CHANSPEC_CTL_SB_LUL      0x0200
3791 #define WL_CHANSPEC_CTL_SB_LUU      0x0300
3792 #define WL_CHANSPEC_CTL_SB_ULL      0x0400
3793 #define WL_CHANSPEC_CTL_SB_ULU      0x0500
3794 #define WL_CHANSPEC_CTL_SB_UUL      0x0600
3795 #define WL_CHANSPEC_CTL_SB_UUU      0x0700
3796 #define WL_CHANSPEC_CTL_SB_LL       WL_CHANSPEC_CTL_SB_LLL
3797 #define WL_CHANSPEC_CTL_SB_LU       WL_CHANSPEC_CTL_SB_LLU
3798 #define WL_CHANSPEC_CTL_SB_UL       WL_CHANSPEC_CTL_SB_LUL
3799 #define WL_CHANSPEC_CTL_SB_UU       WL_CHANSPEC_CTL_SB_LUU
3800 #define WL_CHANSPEC_CTL_SB_L        WL_CHANSPEC_CTL_SB_LLL
3801 #define WL_CHANSPEC_CTL_SB_U        WL_CHANSPEC_CTL_SB_LLU
3802 #define INVCHANSPEC            255
3803 #define WL_CHANSPEC_CTL_SB_SHIFT         8
3804 #define WL_CHANSPEC_BW_5            0x0000
3805 #define WL_CHANSPEC_BW_80        0x2000
3806 #define WL_CHANSPEC_BW_160       0x2800
3807 #define WL_CHANSPEC_BW_8080      0x3000
3808 
3809 struct ether_addr;
3810 struct wl_join_scan_params;
3811 
3812 typedef struct wl_assoc_params
3813 {
3814     struct ether_addr bssid;
3815     uint16_t bssid_cnt;
3816     uint32_t chanspec_num;
3817     chanspec_t chanspec_list[1];
3818 } wl_assoc_params_t;
3819 #define WL_ASSOC_PARAMS_FIXED_SIZE     (sizeof(wl_assoc_params_t) - sizeof(wl_chanspec_t) )
3820 typedef wl_assoc_params_t wl_reassoc_params_t;
3821 #define WL_REASSOC_PARAMS_FIXED_SIZE    WL_ASSOC_PARAMS_FIXED_SIZE
3822 typedef wl_assoc_params_t wl_join_assoc_params_t;
3823 #define WL_JOIN_ASSOC_PARAMS_FIXED_SIZE        WL_ASSOC_PARAMS_FIXED_SIZE
3824 typedef struct wl_join_params
3825 {
3826     wlc_ssid_t ssid;
3827     struct wl_assoc_params params;
3828 } wl_join_params_t;
3829 #define WL_JOIN_PARAMS_FIXED_SIZE     (sizeof(wl_join_params_t) - sizeof(wl_chanspec_t) )
3830 
3831 /* extended join params */
3832 typedef struct wl_extjoin_params
3833 {
3834     wlc_ssid_t ssid;     /* {0, ""}: wildcard scan */
3835     struct wl_join_scan_params scan_params;
3836     wl_join_assoc_params_t assoc_params;     /* optional field, but it must include the fixed portion
3837                                               * of the wl_join_assoc_params_t struct when it does
3838                                               * present.
3839                                               */
3840 } wl_extjoin_params_t;
3841 #define WL_EXTJOIN_PARAMS_FIXED_SIZE    (sizeof(wl_extjoin_params_t) - sizeof(chanspec_t) )
3842 
3843 #define WLC_SET_CUSTOM_COUNTRY             ( (uint32_t)320 )
3844 
3845 /* WLC_GET_AUTH, WLC_SET_AUTH values */
3846 #define WL_AUTH_OPEN_SYSTEM     0   /* d11 open authentication */
3847 #define WL_AUTH_SHARED_KEY      1   /* d11 shared authentication */
3848 #define WL_AUTH_OPEN_SHARED     2   /* try open, then shared if open failed w/rc 13 */
3849 #define WL_AUTH_SAE             3   /* Simultaneous Authentication of Equals (SAE) */
3850 
3851 /** ARP offload statistics */
3852 struct whd_arp_stats_s
3853 {
3854     uint32_t version;               /**< WLAN version											*/
3855     uint32_t peerage;               /**< Current peer age-out time								*/
3856     uint32_t arpoe;                 /**< Agent enabled state									*/
3857     uint32_t features_enabled;      /**< ARP Feature Flags @ref CY_ARP_OL_AGENT_ENABLE, etc.	*/
3858     arp_ol_stats_t stats;   /**< Current stats											*/
3859     uint32_t host_ip_list[ARP_MULTIHOMING_MAX];     /**< host_ip addresses in one call			*/
3860 };
3861 
3862 #pragma pack()
3863 
3864 /* TCP Keepalive offload related defintions should not be added inside
3865  * pragma pack to avoid functionality breakage.
3866  */
3867 /*
3868  * TCP keepalive offload definitions
3869  */
3870 #define MAX_TKO_CONN                 4
3871 #define IPV4_ADDR_LEN                4      /* IPV4 address length   */
3872 
3873 /* Default TCP Keepalive retry parameters.  */
3874 #define TCP_KEEPALIVE_OFFLOAD_INTERVAL_SEC       (20)
3875 #define TCP_KEEPALIVE_OFFLOAD_RETRY_COUNT        (3)
3876 #define TCP_KEEPALIVE_OFFLOAD_RETRY_INTERVAL_SEC (3)
3877 
3878 /* common iovar struct */
3879 typedef struct wl_tko
3880 {
3881     uint16_t subcmd_id;       /* subcommand id */
3882     uint16_t len;             /* total length of data[] */
3883     uint8_t data[1];          /* subcommand data */
3884 } wl_tko_t;
3885 
3886 /* subcommand ids */
3887 #define WL_TKO_SUBCMD_MAX_TCP           0       /* max TCP connections supported */
3888 #define WL_TKO_SUBCMD_PARAM             1       /* configure offload common parameters  */
3889 #define WL_TKO_SUBCMD_CONNECT           2       /* TCP connection info */
3890 #define WL_TKO_SUBCMD_ENABLE            3       /* enable/disable */
3891 #define WL_TKO_SUBCMD_STATUS            4       /* TCP connection status */
3892 
3893 /* WL_TKO_SUBCMD_MAX_CONNECT subcommand data */
3894 typedef struct wl_tko_max_tcp
3895 {
3896     uint8_t max;      /* max TCP connections supported */
3897     uint8_t pad[3];   /* 4-byte struct alignment */
3898 } wl_tko_max_tcp_t;
3899 
3900 /* WL_TKO_SUBCMD_PARAM subcommand data */
3901 typedef struct wl_tko_param
3902 {
3903     uint16_t interval;        /* keepalive tx interval (secs) */
3904     uint16_t retry_interval;  /* keepalive retry interval (secs) */
3905     uint16_t retry_count;     /* retry_count */
3906     uint8_t pad[2];           /* 4-byte struct alignment */
3907 } wl_tko_param_t;
3908 
3909 /* WL_TKO_SUBCMD_CONNECT subcommand data
3910  * invoke with unique 'index' for each TCP connection
3911  */
3912 typedef struct wl_tko_connect
3913 {
3914     uint8_t index;            /* TCP connection index, 0 to max-1 */
3915     uint8_t ip_addr_type;     /* 0 - IPv4, 1 - IPv6 */
3916     uint16_t local_port;      /* local port */
3917     uint16_t remote_port;     /* remote port */
3918     uint32_t local_seq;       /* local sequence number */
3919     uint32_t remote_seq;      /* remote sequence number */
3920     uint16_t request_len;     /* TCP keepalive request packet length */
3921     uint16_t response_len;    /* TCP keepalive response packet length */
3922     uint8_t data[1];          /* variable length field containing local/remote IPv4/IPv6,
3923                                * TCP keepalive request packet, TCP keepalive response packet
3924                                *	  For IPv4, length is 4 * 2 + request_length + response_length
3925                                *		 offset 0 - local IPv4
3926                                *		 offset 4 - remote IPv4
3927                                *		 offset 8 - TCP keepalive request packet
3928                                *		 offset 8+request_length - TCP keepalive response packet
3929                                *	  For IPv6, length is 16 * 2 + request_length + response_length
3930                                *		 offset 0 - local IPv6
3931                                *		 offset 16 - remote IPv6
3932                                *		 offset 32 - TCP keepalive request packet
3933                                *		 offset 32+request_length - TCP keepalive response packet
3934                                */
3935 } wl_tko_connect_t;
3936 
3937 /* WL_TKO_SUBCMD_CONNECT subcommand data to GET configured info for specific index */
3938 typedef struct wl_tko_get_connect
3939 {
3940     uint8_t index;            /* TCP connection index, 0 to max-1 */
3941     uint8_t pad[3];           /* 4-byte struct alignment */
3942 } wl_tko_get_connect_t;
3943 
3944 typedef struct wl_tko_enable
3945 {
3946     uint8_t enable;   /* 1 - enable, 0 - disable */
3947     uint8_t pad[3];   /* 4-byte struct alignment */
3948 } wl_tko_enable_t;
3949 
3950 /* WL_TKO_SUBCMD_STATUS subcommand data */
3951 /* must be invoked before tko is disabled else status is unavailable */
3952 typedef struct wl_tko_status
3953 {
3954     uint8_t count;        /* number of status entries (i.e. equals
3955                            * max TCP connections supported)
3956                            */
3957     uint8_t status[1];    /* variable length field contain status for
3958                            * each TCP connection index
3959                            */
3960 } wl_tko_status_t;
3961 /** Get/Set TKO intervals & retrys */
3962 struct whd_tko_retry
3963 {
3964     uint16_t tko_interval;          /**< How often to send (in seconds) */
3965     uint16_t tko_retry_count;       /**< Max times to retry if original fails */
3966     uint16_t tko_retry_interval;    /**< Wait time between retries (in seconds) */
3967 };
3968 
3969 /** Status values used in conjunction with whd_tko_status_t */
3970 typedef enum
3971 {
3972     TKO_STATUS_NORMAL                       = 0,    /**< TCP connection normal, no error */
3973     TKO_STATUS_NO_RESPONSE                  = 1,    /**< no response to TCP keepalive */
3974     TKO_STATUS_NO_TCP_ACK_FLAG              = 2,    /**< TCP ACK flag not set */
3975     TKO_STATUS_UNEXPECT_TCP_FLAG            = 3,    /**< unexpect TCP flags set other than ACK */
3976     TKO_STATUS_SEQ_NUM_INVALID              = 4,    /**< ACK != sequence number */
3977     TKO_STATUS_REMOTE_SEQ_NUM_INVALID       = 5,    /**< SEQ > remote sequence number */
3978     TKO_STATUS_TCP_DATA                     = 6,    /**< TCP data available */
3979     TKO_STATUS_UNAVAILABLE                  = 255,  /**< not used/configured */
3980 } tko_status_t;
3981 
3982 /** Status of each TCP connection */
3983 struct whd_tko_status
3984 {
3985     uint8_t count;              /**< number of status entries */
3986     uint8_t status[MAX_TKO_CONN];   /**< each TCP status */
3987 };
3988 
3989 /** Struct to query FW for current TKO configuation */
3990 struct whd_tko_connect
3991 {
3992     uint8_t index;            /**< TCP connection index, 0 to max-1 */
3993     uint8_t ip_addr_type;     /**< 0 - IPv4, 1 - IPv6 */
3994     uint16_t local_port;      /**< local port */
3995     uint16_t remote_port;     /**< remote port */
3996     uint32_t local_seq;       /**< local sequence number */
3997     uint32_t remote_seq;      /**< remote sequence number */
3998     uint16_t request_len;     /**< TCP keepalive request packet length */
3999     uint16_t response_len;    /**< TCP keepalive response packet length */
4000     uint8_t data[1];          /**< variable length field containing local/remote IPv4/IPv6,
4001                                * TCP keepalive request packet, TCP keepalive response packet
4002                                *	  For IPv4, length is 4 * 2 + request_length + response_length
4003                                *		 offset 0 - local IPv4
4004                                *		 offset 4 - remote IPv4
4005                                *		 offset 8 - TCP keepalive request packet
4006                                *		 offset 8+request_length - TCP keepalive response packet
4007                                *	  For IPv6, length is 16 * 2 + request_length + response_length
4008                                *		 offset 0 - local IPv6
4009                                *		 offset 16 - remote IPv6
4010                                *		 offset 32 - TCP keepalive request packet
4011                                *		 offset 32+request_length - TCP keepalive response packet
4012                                */
4013 };
4014 
4015 #ifdef __cplusplus
4016 } /* extern "C" */
4017 #endif
4018 
4019 #endif
4020 
4021