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