blob: 96866fb8898cef05988606931566e80bef51bbb9 [file] [log] [blame]
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001/*
2 * Copyright (c) 2010 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#ifndef _wlioctl_h_
18#define _wlioctl_h_
19
Henry Ptasinskia9533e72010-09-08 21:04:42 -070020#include <proto/ethernet.h>
Henry Ptasinskicf2b4482010-09-20 22:33:12 -070021#ifdef BRCM_FULLMAC
22#include <proto/bcmeth.h>
23#endif
Henry Ptasinskia9533e72010-09-08 21:04:42 -070024#include <proto/bcmevent.h>
25#include <proto/802.11.h>
26#include <bcmwifi.h>
27
28#ifndef INTF_NAME_SIZ
29#define INTF_NAME_SIZ 16
30#endif
31
32/* require default structure packing */
33#define BWL_DEFAULT_PACKING
34#include <packed_section_start.h>
35
36/* Legacy structure to help keep backward compatible wl tool and tray app */
37
38#define LEGACY_WL_BSS_INFO_VERSION 107 /* older version of wl_bss_info struct */
39
40typedef struct wl_bss_info_107 {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -070041 u32 version; /* version field */
42 u32 length; /* byte length of data in this record,
Henry Ptasinskia9533e72010-09-08 21:04:42 -070043 * starting at version and including IEs
44 */
45 struct ether_addr BSSID;
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -070046 u16 beacon_period; /* units are Kusec */
47 u16 capability; /* Capability information */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -070048 u8 SSID_len;
49 u8 SSID[32];
Henry Ptasinskia9533e72010-09-08 21:04:42 -070050 struct {
51 uint count; /* # rates in this set */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -070052 u8 rates[16]; /* rates in 500kbps units w/hi bit set if basic */
Henry Ptasinskia9533e72010-09-08 21:04:42 -070053 } rateset; /* supported rates */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -070054 u8 channel; /* Channel no. */
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -070055 u16 atim_window; /* units are Kusec */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -070056 u8 dtim_period; /* DTIM period */
Greg Kroah-Hartmane59fe082010-10-07 17:08:21 -070057 s16 RSSI; /* receive signal strength (in dBm) */
Greg Kroah-Hartman562c8852010-10-05 11:04:17 -070058 s8 phy_noise; /* noise (in dBm) */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -070059 u32 ie_length; /* byte length of Information Elements */
Henry Ptasinskia9533e72010-09-08 21:04:42 -070060 /* variable length Information Elements */
61} wl_bss_info_107_t;
62
63/*
64 * Per-BSS information structure.
65 */
66
67#define LEGACY2_WL_BSS_INFO_VERSION 108 /* old version of wl_bss_info struct */
68
69/* BSS info structure
70 * Applications MUST CHECK ie_offset field and length field to access IEs and
71 * next bss_info structure in a vector (in wl_scan_results_t)
72 */
73typedef struct wl_bss_info_108 {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -070074 u32 version; /* version field */
75 u32 length; /* byte length of data in this record,
Henry Ptasinskia9533e72010-09-08 21:04:42 -070076 * starting at version and including IEs
77 */
78 struct ether_addr BSSID;
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -070079 u16 beacon_period; /* units are Kusec */
80 u16 capability; /* Capability information */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -070081 u8 SSID_len;
82 u8 SSID[32];
Henry Ptasinskia9533e72010-09-08 21:04:42 -070083 struct {
84 uint count; /* # rates in this set */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -070085 u8 rates[16]; /* rates in 500kbps units w/hi bit set if basic */
Henry Ptasinskia9533e72010-09-08 21:04:42 -070086 } rateset; /* supported rates */
87 chanspec_t chanspec; /* chanspec for bss */
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -070088 u16 atim_window; /* units are Kusec */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -070089 u8 dtim_period; /* DTIM period */
Greg Kroah-Hartmane59fe082010-10-07 17:08:21 -070090 s16 RSSI; /* receive signal strength (in dBm) */
Greg Kroah-Hartman562c8852010-10-05 11:04:17 -070091 s8 phy_noise; /* noise (in dBm) */
Henry Ptasinskia9533e72010-09-08 21:04:42 -070092
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -070093 u8 n_cap; /* BSS is 802.11N Capable */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -070094 u32 nbss_cap; /* 802.11N BSS Capabilities (based on HT_CAP_*) */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -070095 u8 ctl_ch; /* 802.11N BSS control channel number */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -070096 u32 reserved32[1]; /* Reserved for expansion of BSS properties */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -070097 u8 flags; /* flags */
98 u8 reserved[3]; /* Reserved for expansion of BSS properties */
99 u8 basic_mcs[MCSSET_LEN]; /* 802.11N BSS required MCS set */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700100
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -0700101 u16 ie_offset; /* offset at which IEs start, from beginning */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700102 u32 ie_length; /* byte length of Information Elements */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700103 /* Add new fields here */
104 /* variable length Information Elements */
105} wl_bss_info_108_t;
106
Henry Ptasinskicf2b4482010-09-20 22:33:12 -0700107#ifdef BRCM_FULLMAC
108#define WL_BSS_INFO_VERSION 108 /* current ver of wl_bss_info struct */
109#else
110#define WL_BSS_INFO_VERSION 109 /* current ver of wl_bss_info struct */
111#endif
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700112
113/* BSS info structure
114 * Applications MUST CHECK ie_offset field and length field to access IEs and
115 * next bss_info structure in a vector (in wl_scan_results_t)
116 */
117typedef struct wl_bss_info {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700118 u32 version; /* version field */
119 u32 length; /* byte length of data in this record,
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700120 * starting at version and including IEs
121 */
122 struct ether_addr BSSID;
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -0700123 u16 beacon_period; /* units are Kusec */
124 u16 capability; /* Capability information */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700125 u8 SSID_len;
126 u8 SSID[32];
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700127 struct {
128 uint count; /* # rates in this set */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700129 u8 rates[16]; /* rates in 500kbps units w/hi bit set if basic */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700130 } rateset; /* supported rates */
131 chanspec_t chanspec; /* chanspec for bss */
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -0700132 u16 atim_window; /* units are Kusec */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700133 u8 dtim_period; /* DTIM period */
Greg Kroah-Hartmane59fe082010-10-07 17:08:21 -0700134 s16 RSSI; /* receive signal strength (in dBm) */
Greg Kroah-Hartman562c8852010-10-05 11:04:17 -0700135 s8 phy_noise; /* noise (in dBm) */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700136
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700137 u8 n_cap; /* BSS is 802.11N Capable */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700138 u32 nbss_cap; /* 802.11N BSS Capabilities (based on HT_CAP_*) */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700139 u8 ctl_ch; /* 802.11N BSS control channel number */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700140 u32 reserved32[1]; /* Reserved for expansion of BSS properties */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700141 u8 flags; /* flags */
142 u8 reserved[3]; /* Reserved for expansion of BSS properties */
143 u8 basic_mcs[MCSSET_LEN]; /* 802.11N BSS required MCS set */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700144
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -0700145 u16 ie_offset; /* offset at which IEs start, from beginning */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700146 u32 ie_length; /* byte length of Information Elements */
Greg Kroah-Hartmane59fe082010-10-07 17:08:21 -0700147 s16 SNR; /* average SNR of during frame reception */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700148 /* Add new fields here */
149 /* variable length Information Elements */
150} wl_bss_info_t;
151
152typedef struct wlc_ssid {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700153 u32 SSID_len;
Greg Kroah-Hartman580a0bd2010-10-05 11:09:48 -0700154 unsigned char SSID[32];
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700155} wlc_ssid_t;
156
157typedef struct chan_scandata {
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700158 u8 txpower;
159 u8 pad;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700160 chanspec_t channel; /* Channel num, bw, ctrl_sb and band */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700161 u32 channel_mintime;
162 u32 channel_maxtime;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700163} chan_scandata_t;
164
165typedef enum wl_scan_type {
166 EXTDSCAN_FOREGROUND_SCAN,
167 EXTDSCAN_BACKGROUND_SCAN,
168 EXTDSCAN_FORCEDBACKGROUND_SCAN
169} wl_scan_type_t;
170
171#define WLC_EXTDSCAN_MAX_SSID 5
172
173#define WL_BSS_FLAGS_FROM_BEACON 0x01 /* bss_info derived from beacon */
174#define WL_BSS_FLAGS_FROM_CACHE 0x02 /* bss_info collected from cache */
175#define WL_BSS_FLAGS_RSSI_ONCHANNEL 0x04 /* rssi info was received on channel (vs offchannel) */
176
177typedef struct wl_extdscan_params {
Greg Kroah-Hartman562c8852010-10-05 11:04:17 -0700178 s8 nprobes; /* 0, passive, otherwise active */
179 s8 split_scan; /* split scan */
180 s8 band; /* band */
181 s8 pad;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700182 wlc_ssid_t ssid[WLC_EXTDSCAN_MAX_SSID]; /* ssid list */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700183 u32 tx_rate; /* in 500ksec units */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700184 wl_scan_type_t scan_type; /* enum */
Greg Kroah-Hartman3e264162010-10-08 11:11:13 -0700185 s32 channel_num;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700186 chan_scandata_t channel_list[1]; /* list of chandata structs */
187} wl_extdscan_params_t;
188
189#define WL_EXTDSCAN_PARAMS_FIXED_SIZE (sizeof(wl_extdscan_params_t) - sizeof(chan_scandata_t))
190
191#define WL_BSSTYPE_INFRA 1
192#define WL_BSSTYPE_INDEP 0
193#define WL_BSSTYPE_ANY 2
194
195/* Bitmask for scan_type */
196#define WL_SCANFLAGS_PASSIVE 0x01 /* force passive scan */
197#define WL_SCANFLAGS_RESERVED 0x02 /* Reserved */
198#define WL_SCANFLAGS_PROHIBITED 0x04 /* allow scanning prohibited channels */
199
200typedef struct wl_scan_params {
201 wlc_ssid_t ssid; /* default: {0, ""} */
202 struct ether_addr bssid; /* default: bcast */
Greg Kroah-Hartman562c8852010-10-05 11:04:17 -0700203 s8 bss_type; /* default: any,
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700204 * DOT11_BSSTYPE_ANY/INFRASTRUCTURE/INDEPENDENT
205 */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700206 u8 scan_type; /* flags, 0 use default */
Greg Kroah-Hartman3e264162010-10-08 11:11:13 -0700207 s32 nprobes; /* -1 use default, number of probes per channel */
208 s32 active_time; /* -1 use default, dwell time per channel for
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700209 * active scanning
210 */
Greg Kroah-Hartman3e264162010-10-08 11:11:13 -0700211 s32 passive_time; /* -1 use default, dwell time per channel
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700212 * for passive scanning
213 */
Greg Kroah-Hartman3e264162010-10-08 11:11:13 -0700214 s32 home_time; /* -1 use default, dwell time for the home channel
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700215 * between channel scans
216 */
Greg Kroah-Hartman3e264162010-10-08 11:11:13 -0700217 s32 channel_num; /* count of channels and ssids that follow
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700218 *
219 * low half is count of channels in channel_list, 0
220 * means default (use all available channels)
221 *
222 * high half is entries in wlc_ssid_t array that
Greg Kroah-Hartman3e264162010-10-08 11:11:13 -0700223 * follows channel_list, aligned for s32 (4 bytes)
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700224 * meaning an odd channel count implies a 2-byte pad
225 * between end of channel_list and first ssid
226 *
227 * if ssid count is zero, single ssid in the fixed
228 * parameter portion is assumed, otherwise ssid in
229 * the fixed portion is ignored
230 */
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -0700231 u16 channel_list[1]; /* list of chanspecs */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700232} wl_scan_params_t;
233
234/* size of wl_scan_params not including variable length array */
235#define WL_SCAN_PARAMS_FIXED_SIZE 64
236
237/* masks for channel and ssid count */
238#define WL_SCAN_PARAMS_COUNT_MASK 0x0000ffff
239#define WL_SCAN_PARAMS_NSSID_SHIFT 16
240
241#define WL_SCAN_ACTION_START 1
242#define WL_SCAN_ACTION_CONTINUE 2
243#define WL_SCAN_ACTION_ABORT 3
244
245#define ISCAN_REQ_VERSION 1
246
247/* incremental scan struct */
248typedef struct wl_iscan_params {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700249 u32 version;
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -0700250 u16 action;
251 u16 scan_duration;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700252 wl_scan_params_t params;
253} wl_iscan_params_t;
254
255/* 3 fields + size of wl_scan_params, not including variable length array */
Greg Kroah-Hartmance0f1b82010-10-08 11:44:45 -0700256#define WL_ISCAN_PARAMS_FIXED_SIZE (offsetof(wl_iscan_params_t, params) + sizeof(wlc_ssid_t))
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700257
258typedef struct wl_scan_results {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700259 u32 buflen;
260 u32 version;
261 u32 count;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700262 wl_bss_info_t bss_info[1];
263} wl_scan_results_t;
264
265/* size of wl_scan_results not including variable length array */
266#define WL_SCAN_RESULTS_FIXED_SIZE (sizeof(wl_scan_results_t) - sizeof(wl_bss_info_t))
267
268/* wl_iscan_results status values */
269#define WL_SCAN_RESULTS_SUCCESS 0
270#define WL_SCAN_RESULTS_PARTIAL 1
271#define WL_SCAN_RESULTS_PENDING 2
272#define WL_SCAN_RESULTS_ABORTED 3
Henry Ptasinskicf2b4482010-09-20 22:33:12 -0700273#define WL_SCAN_RESULTS_NO_MEM 4
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700274
275#define ESCAN_REQ_VERSION 1
276
277typedef struct wl_escan_params {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700278 u32 version;
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -0700279 u16 action;
280 u16 sync_id;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700281 wl_scan_params_t params;
282} wl_escan_params_t;
283
Greg Kroah-Hartmance0f1b82010-10-08 11:44:45 -0700284#define WL_ESCAN_PARAMS_FIXED_SIZE (offsetof(wl_escan_params_t, params) + sizeof(wlc_ssid_t))
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700285
286typedef struct wl_escan_result {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700287 u32 buflen;
288 u32 version;
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -0700289 u16 sync_id;
290 u16 bss_count;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700291 wl_bss_info_t bss_info[1];
292} wl_escan_result_t;
293
294#define WL_ESCAN_RESULTS_FIXED_SIZE (sizeof(wl_escan_result_t) - sizeof(wl_bss_info_t))
295
296/* incremental scan results struct */
297typedef struct wl_iscan_results {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700298 u32 status;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700299 wl_scan_results_t results;
300} wl_iscan_results_t;
301
302/* size of wl_iscan_results not including variable length array */
303#define WL_ISCAN_RESULTS_FIXED_SIZE \
Greg Kroah-Hartmance0f1b82010-10-08 11:44:45 -0700304 (WL_SCAN_RESULTS_FIXED_SIZE + offsetof(wl_iscan_results_t, results))
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700305
306typedef struct wl_probe_params {
307 wlc_ssid_t ssid;
308 struct ether_addr bssid;
309 struct ether_addr mac;
310} wl_probe_params_t;
311
312#define WL_NUMRATES 16 /* max # of rates in a rateset */
313typedef struct wl_rateset {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700314 u32 count; /* # rates in this set */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700315 u8 rates[WL_NUMRATES]; /* rates in 500kbps units w/hi bit set if basic */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700316} wl_rateset_t;
317
318typedef struct wl_rateset_args {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700319 u32 count; /* # rates in this set */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700320 u8 rates[WL_NUMRATES]; /* rates in 500kbps units w/hi bit set if basic */
321 u8 mcs[MCSSET_LEN]; /* supported mcs index bit map */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700322} wl_rateset_args_t;
323
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700324/* u32 list */
325typedef struct wl_u32_list {
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700326 /* in - # of elements, out - # of entries */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700327 u32 count;
328 /* variable length u32 list */
329 u32 element[1];
330} wl_u32_list_t;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700331
332/* used for association with a specific BSSID and chanspec list */
333typedef struct wl_assoc_params {
334 struct ether_addr bssid; /* 00:00:00:00:00:00: broadcast scan */
Greg Kroah-Hartman3e264162010-10-08 11:11:13 -0700335 s32 chanspec_num; /* 0: all available channels,
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700336 * otherwise count of chanspecs in chanspec_list
337 */
338 chanspec_t chanspec_list[1]; /* list of chanspecs */
339} wl_assoc_params_t;
340#define WL_ASSOC_PARAMS_FIXED_SIZE (sizeof(wl_assoc_params_t) - sizeof(chanspec_t))
341
342/* used for reassociation/roam to a specific BSSID and channel */
343typedef wl_assoc_params_t wl_reassoc_params_t;
344#define WL_REASSOC_PARAMS_FIXED_SIZE WL_ASSOC_PARAMS_FIXED_SIZE
345
346/* used for join with or without a specific bssid and channel list */
347typedef struct wl_join_params {
348 wlc_ssid_t ssid;
349 wl_assoc_params_t params; /* optional field, but it must include the fixed portion
350 * of the wl_assoc_params_t struct when it does present.
351 */
352} wl_join_params_t;
353#define WL_JOIN_PARAMS_FIXED_SIZE (sizeof(wl_join_params_t) - sizeof(chanspec_t))
354
355/* defines used by the nrate iovar */
356#define NRATE_MCS_INUSE 0x00000080 /* MSC in use,indicates b0-6 holds an mcs */
357#define NRATE_RATE_MASK 0x0000007f /* rate/mcs value */
358#define NRATE_STF_MASK 0x0000ff00 /* stf mode mask: siso, cdd, stbc, sdm */
359#define NRATE_STF_SHIFT 8 /* stf mode shift */
360#define NRATE_OVERRIDE 0x80000000 /* bit indicates override both rate & mode */
361#define NRATE_OVERRIDE_MCS_ONLY 0x40000000 /* bit indicate to override mcs only */
362#define NRATE_SGI_MASK 0x00800000 /* sgi mode */
363#define NRATE_SGI_SHIFT 23 /* sgi mode */
364#define NRATE_LDPC_CODING 0x00400000 /* bit indicates adv coding in use */
365#define NRATE_LDPC_SHIFT 22 /* ldpc shift */
366
367#define NRATE_STF_SISO 0 /* stf mode SISO */
368#define NRATE_STF_CDD 1 /* stf mode CDD */
369#define NRATE_STF_STBC 2 /* stf mode STBC */
370#define NRATE_STF_SDM 3 /* stf mode SDM */
371
372#define ANTENNA_NUM_1 1 /* total number of antennas to be used */
373#define ANTENNA_NUM_2 2
374#define ANTENNA_NUM_3 3
375#define ANTENNA_NUM_4 4
376
377#define ANT_SELCFG_AUTO 0x80 /* bit indicates antenna sel AUTO */
378#define ANT_SELCFG_MASK 0x33 /* antenna configuration mask */
379#define ANT_SELCFG_MAX 4 /* max number of antenna configurations */
380#define ANT_SELCFG_TX_UNICAST 0 /* unicast tx antenna configuration */
381#define ANT_SELCFG_RX_UNICAST 1 /* unicast rx antenna configuration */
382#define ANT_SELCFG_TX_DEF 2 /* default tx antenna configuration */
383#define ANT_SELCFG_RX_DEF 3 /* default rx antenna configuration */
384
385#define MAX_STREAMS_SUPPORTED 4 /* max number of streams supported */
386
387typedef struct {
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700388 u8 ant_config[ANT_SELCFG_MAX]; /* antenna configuration */
389 u8 num_antcfg; /* number of available antenna configurations */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700390} wlc_antselcfg_t;
391
392#define HIGHEST_SINGLE_STREAM_MCS 7 /* MCS values greater than this enable multiple streams */
393
394#define MAX_CCA_CHANNELS 38 /* Max number of 20 Mhz wide channels */
395#define MAX_CCA_SECS 60 /* CCA keeps this many seconds history */
396
397#define IBSS_MED 15 /* Mediom in-bss congestion percentage */
398#define IBSS_HI 25 /* Hi in-bss congestion percentage */
399#define OBSS_MED 12
400#define OBSS_HI 25
401#define INTERFER_MED 5
402#define INTERFER_HI 10
403
404#define CCA_FLAG_2G_ONLY 0x01 /* Return a channel from 2.4 Ghz band */
405#define CCA_FLAG_5G_ONLY 0x02 /* Return a channel from 2.4 Ghz band */
406#define CCA_FLAG_IGNORE_DURATION 0x04 /* Ignore dwell time for each channel */
407#define CCA_FLAGS_PREFER_1_6_11 0x10
408#define CCA_FLAG_IGNORE_INTERFER 0x20 /* do not exlude channel based on interfer level */
409
410#define CCA_ERRNO_BAND 1 /* After filtering for band pref, no choices left */
411#define CCA_ERRNO_DURATION 2 /* After filtering for duration, no choices left */
412#define CCA_ERRNO_PREF_CHAN 3 /* After filtering for chan pref, no choices left */
413#define CCA_ERRNO_INTERFER 4 /* After filtering for interference, no choices left */
414#define CCA_ERRNO_TOO_FEW 5 /* Only 1 channel was input */
415
416typedef struct {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700417 u32 duration; /* millisecs spent sampling this channel */
418 u32 congest_ibss; /* millisecs in our bss (presumably this traffic will */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700419 /* move if cur bss moves channels) */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700420 u32 congest_obss; /* traffic not in our bss */
421 u32 interference; /* millisecs detecting a non 802.11 interferer. */
422 u32 timestamp; /* second timestamp */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700423} cca_congest_t;
424
425typedef struct {
426 chanspec_t chanspec; /* Which channel? */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700427 u8 num_secs; /* How many secs worth of data */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700428 cca_congest_t secs[1]; /* Data */
429} cca_congest_channel_req_t;
430
431#define WLC_CNTRY_BUF_SZ 4 /* Country string is 3 bytes + NUL */
432
433typedef struct wl_country {
434 char country_abbrev[WLC_CNTRY_BUF_SZ]; /* nul-terminated country code used in
435 * the Country IE
436 */
Greg Kroah-Hartman3e264162010-10-08 11:11:13 -0700437 s32 rev; /* revision specifier for ccode
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700438 * on set, -1 indicates unspecified.
439 * on get, rev >= 0
440 */
441 char ccode[WLC_CNTRY_BUF_SZ]; /* nul-terminated built-in country code.
442 * variable length, but fixed size in
443 * struct allows simple allocation for
444 * expected country strings <= 3 chars.
445 */
446} wl_country_t;
447
448typedef struct wl_channels_in_country {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700449 u32 buflen;
450 u32 band;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700451 char country_abbrev[WLC_CNTRY_BUF_SZ];
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700452 u32 count;
453 u32 channel[1];
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700454} wl_channels_in_country_t;
455
456typedef struct wl_country_list {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700457 u32 buflen;
458 u32 band_set;
459 u32 band;
460 u32 count;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700461 char country_abbrev[1];
462} wl_country_list_t;
463
464#define WL_NUM_RPI_BINS 8
465#define WL_RM_TYPE_BASIC 1
466#define WL_RM_TYPE_CCA 2
467#define WL_RM_TYPE_RPI 3
468
469#define WL_RM_FLAG_PARALLEL (1<<0)
470
471#define WL_RM_FLAG_LATE (1<<1)
472#define WL_RM_FLAG_INCAPABLE (1<<2)
473#define WL_RM_FLAG_REFUSED (1<<3)
474
475typedef struct wl_rm_req_elt {
Greg Kroah-Hartman562c8852010-10-05 11:04:17 -0700476 s8 type;
477 s8 flags;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700478 chanspec_t chanspec;
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700479 u32 token; /* token for this measurement */
480 u32 tsf_h; /* TSF high 32-bits of Measurement start time */
481 u32 tsf_l; /* TSF low 32-bits */
482 u32 dur; /* TUs */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700483} wl_rm_req_elt_t;
484
485typedef struct wl_rm_req {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700486 u32 token; /* overall measurement set token */
487 u32 count; /* number of measurement requests */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700488 void *cb; /* completion callback function: may be NULL */
489 void *cb_arg; /* arg to completion callback function */
490 wl_rm_req_elt_t req[1]; /* variable length block of requests */
491} wl_rm_req_t;
Greg Kroah-Hartmance0f1b82010-10-08 11:44:45 -0700492#define WL_RM_REQ_FIXED_LEN offsetof(wl_rm_req_t, req)
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700493
494typedef struct wl_rm_rep_elt {
Greg Kroah-Hartman562c8852010-10-05 11:04:17 -0700495 s8 type;
496 s8 flags;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700497 chanspec_t chanspec;
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700498 u32 token; /* token for this measurement */
499 u32 tsf_h; /* TSF high 32-bits of Measurement start time */
500 u32 tsf_l; /* TSF low 32-bits */
501 u32 dur; /* TUs */
502 u32 len; /* byte length of data block */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700503 u8 data[1]; /* variable length data block */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700504} wl_rm_rep_elt_t;
505#define WL_RM_REP_ELT_FIXED_LEN 24 /* length excluding data block */
506
507#define WL_RPI_REP_BIN_NUM 8
508typedef struct wl_rm_rpi_rep {
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700509 u8 rpi[WL_RPI_REP_BIN_NUM];
Greg Kroah-Hartman562c8852010-10-05 11:04:17 -0700510 s8 rpi_max[WL_RPI_REP_BIN_NUM];
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700511} wl_rm_rpi_rep_t;
512
513typedef struct wl_rm_rep {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700514 u32 token; /* overall measurement set token */
515 u32 len; /* length of measurement report block */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700516 wl_rm_rep_elt_t rep[1]; /* variable length block of reports */
517} wl_rm_rep_t;
518#define WL_RM_REP_FIXED_LEN 8
519
520/* Enumerate crypto algorithms */
521#define CRYPTO_ALGO_OFF 0
522#define CRYPTO_ALGO_WEP1 1
523#define CRYPTO_ALGO_TKIP 2
524#define CRYPTO_ALGO_WEP128 3
525#define CRYPTO_ALGO_AES_CCM 4
526#define CRYPTO_ALGO_AES_RESERVED1 5
527#define CRYPTO_ALGO_AES_RESERVED2 6
528#define CRYPTO_ALGO_NALG 7
529
530#define WSEC_GEN_MIC_ERROR 0x0001
531#define WSEC_GEN_REPLAY 0x0002
532#define WSEC_GEN_ICV_ERROR 0x0004
533
534#define WL_SOFT_KEY (1 << 0) /* Indicates this key is using soft encrypt */
535#define WL_PRIMARY_KEY (1 << 1) /* Indicates this key is the primary (ie tx) key */
536#define WL_KF_RES_4 (1 << 4) /* Reserved for backward compat */
537#define WL_KF_RES_5 (1 << 5) /* Reserved for backward compat */
538#define WL_IBSS_PEER_GROUP_KEY (1 << 6) /* Indicates a group key for a IBSS PEER */
539
540typedef struct wl_wsec_key {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700541 u32 index; /* key index */
542 u32 len; /* key length */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700543 u8 data[DOT11_MAX_KEY_SIZE]; /* key data */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700544 u32 pad_1[18];
545 u32 algo; /* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
546 u32 flags; /* misc flags */
547 u32 pad_2[2];
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700548 int pad_3;
549 int iv_initialized; /* has IV been initialized already? */
550 int pad_4;
551 /* Rx IV */
552 struct {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700553 u32 hi; /* upper 32 bits of IV */
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -0700554 u16 lo; /* lower 16 bits of IV */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700555 } rxiv;
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700556 u32 pad_5[2];
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700557 struct ether_addr ea; /* per station */
558} wl_wsec_key_t;
559
560#define WSEC_MIN_PSK_LEN 8
561#define WSEC_MAX_PSK_LEN 64
562
563/* Flag for key material needing passhash'ing */
564#define WSEC_PASSPHRASE (1<<0)
565
566/* receptacle for WLC_SET_WSEC_PMK parameter */
567typedef struct {
Greg Kroah-Hartmand7e50882010-10-05 11:11:46 -0700568 unsigned short key_len; /* octets in key material */
569 unsigned short flags; /* key handling qualification */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700570 u8 key[WSEC_MAX_PSK_LEN]; /* PMK material */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700571} wsec_pmk_t;
572
573/* wireless security bitvec */
574#define WEP_ENABLED 0x0001
575#define TKIP_ENABLED 0x0002
576#define AES_ENABLED 0x0004
577#define WSEC_SWFLAG 0x0008
578#define SES_OW_ENABLED 0x0040 /* to go into transition mode without setting wep */
579
580/* WPA authentication mode bitvec */
581#define WPA_AUTH_DISABLED 0x0000 /* Legacy (i.e., non-WPA) */
582#define WPA_AUTH_NONE 0x0001 /* none (IBSS) */
583#define WPA_AUTH_UNSPECIFIED 0x0002 /* over 802.1x */
584#define WPA_AUTH_PSK 0x0004 /* Pre-shared key */
585#define WPA_AUTH_RESERVED1 0x0008
586#define WPA_AUTH_RESERVED2 0x0010
587 /* #define WPA_AUTH_8021X 0x0020 *//* 802.1x, reserved */
588#define WPA2_AUTH_RESERVED1 0x0020
589#define WPA2_AUTH_UNSPECIFIED 0x0040 /* over 802.1x */
590#define WPA2_AUTH_PSK 0x0080 /* Pre-shared key */
591#define WPA2_AUTH_RESERVED3 0x0200
592#define WPA2_AUTH_RESERVED4 0x0400
593#define WPA2_AUTH_RESERVED5 0x0800
594
595/* pmkid */
596#define MAXPMKID 16
597
598typedef struct _pmkid {
599 struct ether_addr BSSID;
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700600 u8 PMKID[WPA2_PMKID_LEN];
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700601} pmkid_t;
602
603typedef struct _pmkid_list {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700604 u32 npmkid;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700605 pmkid_t pmkid[1];
606} pmkid_list_t;
607
608typedef struct _pmkid_cand {
609 struct ether_addr BSSID;
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700610 u8 preauth;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700611} pmkid_cand_t;
612
613typedef struct _pmkid_cand_list {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700614 u32 npmkid_cand;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700615 pmkid_cand_t pmkid_cand[1];
616} pmkid_cand_list_t;
617
618typedef struct wl_led_info {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700619 u32 index; /* led index */
620 u32 behavior;
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700621 u8 activehi;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700622} wl_led_info_t;
623
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700624/* flags */
625#define WLC_ASSOC_REQ_IS_REASSOC 0x01 /* assoc req was actually a reassoc */
626
627/* srom read/write struct passed through ioctl */
628typedef struct {
629 uint byteoff; /* byte offset */
630 uint nbytes; /* number of bytes */
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -0700631 u16 buf[1];
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700632} srom_rw_t;
633
634/* similar cis (srom or otp) struct [iovar: may not be aligned] */
635typedef struct {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700636 u32 source; /* cis source */
637 u32 byteoff; /* byte offset */
638 u32 nbytes; /* number of bytes */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700639 /* data follows here */
640} cis_rw_t;
641
642#define WLC_CIS_DEFAULT 0 /* built-in default */
643#define WLC_CIS_SROM 1 /* source is sprom */
644#define WLC_CIS_OTP 2 /* source is otp */
645
646/* R_REG and W_REG struct passed through ioctl */
647typedef struct {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700648 u32 byteoff; /* byte offset of the field in d11regs_t */
649 u32 val; /* read/write value of the field */
650 u32 size; /* sizeof the field */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700651 uint band; /* band (optional) */
652} rw_reg_t;
653
654/* Structure used by GET/SET_ATTEN ioctls - it controls power in b/g-band */
655/* PCL - Power Control Loop */
656/* current gain setting is replaced by user input */
657#define WL_ATTEN_APP_INPUT_PCL_OFF 0 /* turn off PCL, apply supplied input */
658#define WL_ATTEN_PCL_ON 1 /* turn on PCL */
659/* current gain setting is maintained */
660#define WL_ATTEN_PCL_OFF 2 /* turn off PCL. */
661
662typedef struct {
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -0700663 u16 auto_ctrl; /* WL_ATTEN_XX */
664 u16 bb; /* Baseband attenuation */
665 u16 radio; /* Radio attenuation */
666 u16 txctl1; /* Radio TX_CTL1 value */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700667} atten_t;
668
669/* Per-AC retry parameters */
670struct wme_tx_params_s {
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700671 u8 short_retry;
672 u8 short_fallback;
673 u8 long_retry;
674 u8 long_fallback;
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -0700675 u16 max_rate; /* In units of 512 Kbps */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700676};
677
678typedef struct wme_tx_params_s wme_tx_params_t;
679
680#define WL_WME_TX_PARAMS_IO_BYTES (sizeof(wme_tx_params_t) * AC_COUNT)
681
682/* defines used by poweridx iovar - it controls power in a-band */
683/* current gain setting is maintained */
684#define WL_PWRIDX_PCL_OFF -2 /* turn off PCL. */
685#define WL_PWRIDX_PCL_ON -1 /* turn on PCL */
686#define WL_PWRIDX_LOWER_LIMIT -2 /* lower limit */
687#define WL_PWRIDX_UPPER_LIMIT 63 /* upper limit */
688/* value >= 0 causes
689 * - input to be set to that value
690 * - PCL to be off
691 */
692
693/* Used to get specific link/ac parameters */
694typedef struct {
695 int ac;
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700696 u8 val;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700697 struct ether_addr ea;
698} link_val_t;
699
700#define BCM_MAC_STATUS_INDICATION (0x40010200L)
701
702typedef struct {
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -0700703 u16 ver; /* version of this struct */
704 u16 len; /* length in bytes of this structure */
705 u16 cap; /* sta's advertised capabilities */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700706 u32 flags; /* flags defined below */
707 u32 idle; /* time since data pkt rx'd from sta */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700708 struct ether_addr ea; /* Station address */
709 wl_rateset_t rateset; /* rateset in use */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700710 u32 in; /* seconds elapsed since associated */
711 u32 listen_interval_inms; /* Min Listen interval in ms for this STA */
712 u32 tx_pkts; /* # of packets transmitted */
713 u32 tx_failures; /* # of packets failed */
714 u32 rx_ucast_pkts; /* # of unicast packets received */
715 u32 rx_mcast_pkts; /* # of multicast packets received */
716 u32 tx_rate; /* Rate of last successful tx frame */
717 u32 rx_rate; /* Rate of last successful rx frame */
718 u32 rx_decrypt_succeeds; /* # of packet decrypted successfully */
719 u32 rx_decrypt_failures; /* # of packet decrypted unsuccessfully */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700720} sta_info_t;
721
Greg Kroah-Hartmance0f1b82010-10-08 11:44:45 -0700722#define WL_OLD_STAINFO_SIZE offsetof(sta_info_t, tx_pkts)
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700723
724#define WL_STA_VER 3
725
726/* Flags for sta_info_t indicating properties of STA */
727#define WL_STA_BRCM 0x1 /* Running a Broadcom driver */
728#define WL_STA_WME 0x2 /* WMM association */
729#define WL_STA_ABCAP 0x4
730#define WL_STA_AUTHE 0x8 /* Authenticated */
731#define WL_STA_ASSOC 0x10 /* Associated */
732#define WL_STA_AUTHO 0x20 /* Authorized */
733#define WL_STA_WDS 0x40 /* Wireless Distribution System */
734#define WL_STA_WDS_LINKUP 0x80 /* WDS traffic/probes flowing properly */
735#define WL_STA_PS 0x100 /* STA is in power save mode from AP's viewpoint */
736#define WL_STA_APSD_BE 0x200 /* APSD delv/trigger for AC_BE is default enabled */
737#define WL_STA_APSD_BK 0x400 /* APSD delv/trigger for AC_BK is default enabled */
738#define WL_STA_APSD_VI 0x800 /* APSD delv/trigger for AC_VI is default enabled */
739#define WL_STA_APSD_VO 0x1000 /* APSD delv/trigger for AC_VO is default enabled */
740#define WL_STA_N_CAP 0x2000 /* STA 802.11n capable */
741#define WL_STA_SCBSTATS 0x4000 /* Per STA debug stats */
742
743#define WL_WDS_LINKUP WL_STA_WDS_LINKUP /* deprecated */
744
745/* Used to get specific STA parameters */
746typedef struct {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -0700747 u32 val;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700748 struct ether_addr ea;
749} scb_val_t;
750
751/* channel encoding */
752typedef struct channel_info {
753 int hw_channel;
754 int target_channel;
755 int scan_channel;
756} channel_info_t;
757
758/* For ioctls that take a list of MAC addresses */
759struct maclist {
760 uint count; /* number of MAC addresses */
761 struct ether_addr ea[1]; /* variable length array of MAC addresses */
762};
763
764/* get pkt count struct passed through ioctl */
765typedef struct get_pktcnt {
766 uint rx_good_pkt;
767 uint rx_bad_pkt;
768 uint tx_good_pkt;
769 uint tx_bad_pkt;
770 uint rx_ocast_good_pkt; /* unicast packets destined for others */
771} get_pktcnt_t;
772
773/* Linux network driver ioctl encoding */
774typedef struct wl_ioctl {
775 uint cmd; /* common ioctl definition */
776 void *buf; /* pointer to user buffer */
777 uint len; /* length of user buffer */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700778 u8 set; /* get or set request (optional) */
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700779 uint used; /* bytes read or written (optional) */
780 uint needed; /* bytes needed (optional) */
781} wl_ioctl_t;
782
783/* reference to wl_ioctl_t struct used by usermode driver */
784#define ioctl_subtype set /* subtype param */
785#define ioctl_pid used /* pid param */
786#define ioctl_status needed /* status param */
787
788/*
789 * Structure for passing hardware and software
790 * revision info up from the driver.
791 */
792typedef struct wlc_rev_info {
793 uint vendorid; /* PCI vendor id */
794 uint deviceid; /* device id of chip */
795 uint radiorev; /* radio revision */
796 uint chiprev; /* chip revision */
797 uint corerev; /* core revision */
798 uint boardid; /* board identifier (usu. PCI sub-device id) */
799 uint boardvendor; /* board vendor (usu. PCI sub-vendor id) */
800 uint boardrev; /* board revision */
801 uint driverrev; /* driver version */
802 uint ucoderev; /* microcode version */
803 uint bus; /* bus type */
804 uint chipnum; /* chip number */
805 uint phytype; /* phy type */
806 uint phyrev; /* phy revision */
807 uint anarev; /* anacore rev */
808 uint chippkg; /* chip package info */
809} wlc_rev_info_t;
810
811#define WL_REV_INFO_LEGACY_LENGTH 48
812
813#define WL_BRAND_MAX 10
814typedef struct wl_instance_info {
815 uint instance;
816 char brand[WL_BRAND_MAX];
817} wl_instance_info_t;
818
819/* structure to change size of tx fifo */
820typedef struct wl_txfifo_sz {
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -0700821 u16 magic;
822 u16 fifo;
823 u16 size;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700824} wl_txfifo_sz_t;
825/* magic pattern used for mismatch driver and wl */
826#define WL_TXFIFO_SZ_MAGIC 0xa5a5
827
828/* Transfer info about an IOVar from the driver */
829/* Max supported IOV name size in bytes, + 1 for nul termination */
830#define WLC_IOV_NAME_LEN 30
831typedef struct wlc_iov_trx_s {
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -0700832 u8 module;
833 u8 type;
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700834 char name[WLC_IOV_NAME_LEN];
835} wlc_iov_trx_t;
836
837/* check this magic number */
838#define WLC_IOCTL_MAGIC 0x14e46c77
839
840#define PROC_ENTRY_NAME "brcm_debug"
841/* bump this number if you change the ioctl interface */
842#define WLC_IOCTL_VERSION 1
843
Henry Ptasinskicf2b4482010-09-20 22:33:12 -0700844#ifdef BRCM_FULLMAC
845#define WLC_IOCTL_MAXLEN 8192
846#else
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700847#define WLC_IOCTL_MAXLEN 3072 /* max length ioctl buffer required */
Henry Ptasinskicf2b4482010-09-20 22:33:12 -0700848#endif
Henry Ptasinskia9533e72010-09-08 21:04:42 -0700849#define WLC_IOCTL_SMLEN 256 /* "small" length ioctl buffer required */
850#define WLC_IOCTL_MEDLEN 1536 /* "med" length ioctl buffer required */
851#define WLC_SAMPLECOLLECT_MAXLEN 10240 /* Max Sample Collect buffer for two cores */
852
853/* common ioctl definitions */
854#define WLC_GET_MAGIC 0
855#define WLC_GET_VERSION 1
856#define WLC_UP 2
857#define WLC_DOWN 3
858#define WLC_GET_LOOP 4
859#define WLC_SET_LOOP 5
860#define WLC_DUMP 6
861#define WLC_GET_MSGLEVEL 7
862#define WLC_SET_MSGLEVEL 8
863#define WLC_GET_PROMISC 9
864#define WLC_SET_PROMISC 10
865#define WLC_OVERLAY_IOCTL 11
866#define WLC_GET_RATE 12
867 /* #define WLC_SET_RATE 13 *//* no longer supported */
868#define WLC_GET_INSTANCE 14
869 /* #define WLC_GET_FRAG 15 *//* no longer supported */
870 /* #define WLC_SET_FRAG 16 *//* no longer supported */
871 /* #define WLC_GET_RTS 17 *//* no longer supported */
872 /* #define WLC_SET_RTS 18 *//* no longer supported */
873#define WLC_GET_INFRA 19
874#define WLC_SET_INFRA 20
875#define WLC_GET_AUTH 21
876#define WLC_SET_AUTH 22
877#define WLC_GET_BSSID 23
878#define WLC_SET_BSSID 24
879#define WLC_GET_SSID 25
880#define WLC_SET_SSID 26
881#define WLC_RESTART 27
882 /* #define WLC_DUMP_SCB 28 *//* no longer supported */
883#define WLC_GET_CHANNEL 29
884#define WLC_SET_CHANNEL 30
885#define WLC_GET_SRL 31
886#define WLC_SET_SRL 32
887#define WLC_GET_LRL 33
888#define WLC_SET_LRL 34
889#define WLC_GET_PLCPHDR 35
890#define WLC_SET_PLCPHDR 36
891#define WLC_GET_RADIO 37
892#define WLC_SET_RADIO 38
893#define WLC_GET_PHYTYPE 39
894#define WLC_DUMP_RATE 40
895#define WLC_SET_RATE_PARAMS 41
896#define WLC_GET_FIXRATE 42
897#define WLC_SET_FIXRATE 43
898 /* #define WLC_GET_WEP 42 *//* no longer supported */
899 /* #define WLC_SET_WEP 43 *//* no longer supported */
900#define WLC_GET_KEY 44
901#define WLC_SET_KEY 45
902#define WLC_GET_REGULATORY 46
903#define WLC_SET_REGULATORY 47
904#define WLC_GET_PASSIVE_SCAN 48
905#define WLC_SET_PASSIVE_SCAN 49
906#define WLC_SCAN 50
907#define WLC_SCAN_RESULTS 51
908#define WLC_DISASSOC 52
909#define WLC_REASSOC 53
910#define WLC_GET_ROAM_TRIGGER 54
911#define WLC_SET_ROAM_TRIGGER 55
912#define WLC_GET_ROAM_DELTA 56
913#define WLC_SET_ROAM_DELTA 57
914#define WLC_GET_ROAM_SCAN_PERIOD 58
915#define WLC_SET_ROAM_SCAN_PERIOD 59
916#define WLC_EVM 60 /* diag */
917#define WLC_GET_TXANT 61
918#define WLC_SET_TXANT 62
919#define WLC_GET_ANTDIV 63
920#define WLC_SET_ANTDIV 64
921 /* #define WLC_GET_TXPWR 65 *//* no longer supported */
922 /* #define WLC_SET_TXPWR 66 *//* no longer supported */
923#define WLC_GET_CLOSED 67
924#define WLC_SET_CLOSED 68
925#define WLC_GET_MACLIST 69
926#define WLC_SET_MACLIST 70
927#define WLC_GET_RATESET 71
928#define WLC_SET_RATESET 72
929 /* #define WLC_GET_LOCALE 73 *//* no longer supported */
930#define WLC_LONGTRAIN 74
931#define WLC_GET_BCNPRD 75
932#define WLC_SET_BCNPRD 76
933#define WLC_GET_DTIMPRD 77
934#define WLC_SET_DTIMPRD 78
935#define WLC_GET_SROM 79
936#define WLC_SET_SROM 80
937#define WLC_GET_WEP_RESTRICT 81
938#define WLC_SET_WEP_RESTRICT 82
939#define WLC_GET_COUNTRY 83
940#define WLC_SET_COUNTRY 84
941#define WLC_GET_PM 85
942#define WLC_SET_PM 86
943#define WLC_GET_WAKE 87
944#define WLC_SET_WAKE 88
945 /* #define WLC_GET_D11CNTS 89 *//* -> "counters" iovar */
946#define WLC_GET_FORCELINK 90 /* ndis only */
947#define WLC_SET_FORCELINK 91 /* ndis only */
948#define WLC_FREQ_ACCURACY 92 /* diag */
949#define WLC_CARRIER_SUPPRESS 93 /* diag */
950#define WLC_GET_PHYREG 94
951#define WLC_SET_PHYREG 95
952#define WLC_GET_RADIOREG 96
953#define WLC_SET_RADIOREG 97
954#define WLC_GET_REVINFO 98
955#define WLC_GET_UCANTDIV 99
956#define WLC_SET_UCANTDIV 100
957#define WLC_R_REG 101
958#define WLC_W_REG 102
959/* #define WLC_DIAG_LOOPBACK 103 old tray diag */
960 /* #define WLC_RESET_D11CNTS 104 *//* -> "reset_d11cnts" iovar */
961#define WLC_GET_MACMODE 105
962#define WLC_SET_MACMODE 106
963#define WLC_GET_MONITOR 107
964#define WLC_SET_MONITOR 108
965#define WLC_GET_GMODE 109
966#define WLC_SET_GMODE 110
967#define WLC_GET_LEGACY_ERP 111
968#define WLC_SET_LEGACY_ERP 112
969#define WLC_GET_RX_ANT 113
970#define WLC_GET_CURR_RATESET 114 /* current rateset */
971#define WLC_GET_SCANSUPPRESS 115
972#define WLC_SET_SCANSUPPRESS 116
973#define WLC_GET_AP 117
974#define WLC_SET_AP 118
975#define WLC_GET_EAP_RESTRICT 119
976#define WLC_SET_EAP_RESTRICT 120
977#define WLC_SCB_AUTHORIZE 121
978#define WLC_SCB_DEAUTHORIZE 122
979#define WLC_GET_WDSLIST 123
980#define WLC_SET_WDSLIST 124
981#define WLC_GET_ATIM 125
982#define WLC_SET_ATIM 126
983#define WLC_GET_RSSI 127
984#define WLC_GET_PHYANTDIV 128
985#define WLC_SET_PHYANTDIV 129
986#define WLC_AP_RX_ONLY 130
987#define WLC_GET_TX_PATH_PWR 131
988#define WLC_SET_TX_PATH_PWR 132
989#define WLC_GET_WSEC 133
990#define WLC_SET_WSEC 134
991#define WLC_GET_PHY_NOISE 135
992#define WLC_GET_BSS_INFO 136
993#define WLC_GET_PKTCNTS 137
994#define WLC_GET_LAZYWDS 138
995#define WLC_SET_LAZYWDS 139
996#define WLC_GET_BANDLIST 140
997#define WLC_GET_BAND 141
998#define WLC_SET_BAND 142
999#define WLC_SCB_DEAUTHENTICATE 143
1000#define WLC_GET_SHORTSLOT 144
1001#define WLC_GET_SHORTSLOT_OVERRIDE 145
1002#define WLC_SET_SHORTSLOT_OVERRIDE 146
1003#define WLC_GET_SHORTSLOT_RESTRICT 147
1004#define WLC_SET_SHORTSLOT_RESTRICT 148
1005#define WLC_GET_GMODE_PROTECTION 149
1006#define WLC_GET_GMODE_PROTECTION_OVERRIDE 150
1007#define WLC_SET_GMODE_PROTECTION_OVERRIDE 151
1008#define WLC_UPGRADE 152
1009 /* #define WLC_GET_MRATE 153 *//* no longer supported */
1010 /* #define WLC_SET_MRATE 154 *//* no longer supported */
1011#define WLC_GET_IGNORE_BCNS 155
1012#define WLC_SET_IGNORE_BCNS 156
1013#define WLC_GET_SCB_TIMEOUT 157
1014#define WLC_SET_SCB_TIMEOUT 158
1015#define WLC_GET_ASSOCLIST 159
1016#define WLC_GET_CLK 160
1017#define WLC_SET_CLK 161
1018#define WLC_GET_UP 162
1019#define WLC_OUT 163
1020#define WLC_GET_WPA_AUTH 164
1021#define WLC_SET_WPA_AUTH 165
1022#define WLC_GET_UCFLAGS 166
1023#define WLC_SET_UCFLAGS 167
1024#define WLC_GET_PWRIDX 168
1025#define WLC_SET_PWRIDX 169
1026#define WLC_GET_TSSI 170
1027#define WLC_GET_SUP_RATESET_OVERRIDE 171
1028#define WLC_SET_SUP_RATESET_OVERRIDE 172
1029 /* #define WLC_SET_FAST_TIMER 173 *//* no longer supported */
1030 /* #define WLC_GET_FAST_TIMER 174 *//* no longer supported */
1031 /* #define WLC_SET_SLOW_TIMER 175 *//* no longer supported */
1032 /* #define WLC_GET_SLOW_TIMER 176 *//* no longer supported */
1033 /* #define WLC_DUMP_PHYREGS 177 *//* no longer supported */
1034#define WLC_GET_PROTECTION_CONTROL 178
1035#define WLC_SET_PROTECTION_CONTROL 179
1036#define WLC_GET_PHYLIST 180
1037#define WLC_ENCRYPT_STRENGTH 181 /* ndis only */
1038#define WLC_DECRYPT_STATUS 182 /* ndis only */
1039#define WLC_GET_KEY_SEQ 183
1040#define WLC_GET_SCAN_CHANNEL_TIME 184
1041#define WLC_SET_SCAN_CHANNEL_TIME 185
1042#define WLC_GET_SCAN_UNASSOC_TIME 186
1043#define WLC_SET_SCAN_UNASSOC_TIME 187
1044#define WLC_GET_SCAN_HOME_TIME 188
1045#define WLC_SET_SCAN_HOME_TIME 189
1046#define WLC_GET_SCAN_NPROBES 190
1047#define WLC_SET_SCAN_NPROBES 191
1048#define WLC_GET_PRB_RESP_TIMEOUT 192
1049#define WLC_SET_PRB_RESP_TIMEOUT 193
1050#define WLC_GET_ATTEN 194
1051#define WLC_SET_ATTEN 195
1052#define WLC_GET_SHMEM 196 /* diag */
1053#define WLC_SET_SHMEM 197 /* diag */
1054 /* #define WLC_GET_GMODE_PROTECTION_CTS 198 *//* no longer supported */
1055 /* #define WLC_SET_GMODE_PROTECTION_CTS 199 *//* no longer supported */
1056#define WLC_SET_WSEC_TEST 200
1057#define WLC_SCB_DEAUTHENTICATE_FOR_REASON 201
1058#define WLC_TKIP_COUNTERMEASURES 202
1059#define WLC_GET_PIOMODE 203
1060#define WLC_SET_PIOMODE 204
1061#define WLC_SET_ASSOC_PREFER 205
1062#define WLC_GET_ASSOC_PREFER 206
1063#define WLC_SET_ROAM_PREFER 207
1064#define WLC_GET_ROAM_PREFER 208
1065#define WLC_SET_LED 209
1066#define WLC_GET_LED 210
1067#define WLC_RESERVED6 211
1068#define WLC_RESERVED7 212
1069#define WLC_GET_CHANNEL_QA 213
1070#define WLC_START_CHANNEL_QA 214
1071#define WLC_GET_CHANNEL_SEL 215
1072#define WLC_START_CHANNEL_SEL 216
1073#define WLC_GET_VALID_CHANNELS 217
1074#define WLC_GET_FAKEFRAG 218
1075#define WLC_SET_FAKEFRAG 219
1076#define WLC_GET_PWROUT_PERCENTAGE 220
1077#define WLC_SET_PWROUT_PERCENTAGE 221
1078#define WLC_SET_BAD_FRAME_PREEMPT 222
1079#define WLC_GET_BAD_FRAME_PREEMPT 223
1080#define WLC_SET_LEAP_LIST 224
1081#define WLC_GET_LEAP_LIST 225
1082#define WLC_GET_CWMIN 226
1083#define WLC_SET_CWMIN 227
1084#define WLC_GET_CWMAX 228
1085#define WLC_SET_CWMAX 229
1086#define WLC_GET_WET 230
1087#define WLC_SET_WET 231
1088#define WLC_GET_PUB 232
1089 /* #define WLC_SET_GLACIAL_TIMER 233 *//* no longer supported */
1090 /* #define WLC_GET_GLACIAL_TIMER 234 *//* no longer supported */
1091#define WLC_GET_KEY_PRIMARY 235
1092#define WLC_SET_KEY_PRIMARY 236
1093 /* #define WLC_DUMP_RADIOREGS 237 *//* no longer supported */
1094#define WLC_RESERVED4 238
1095#define WLC_RESERVED5 239
1096#define WLC_UNSET_CALLBACK 240
1097#define WLC_SET_CALLBACK 241
1098#define WLC_GET_RADAR 242
1099#define WLC_SET_RADAR 243
1100#define WLC_SET_SPECT_MANAGMENT 244
1101#define WLC_GET_SPECT_MANAGMENT 245
1102#define WLC_WDS_GET_REMOTE_HWADDR 246 /* handled in wl_linux.c/wl_vx.c */
1103#define WLC_WDS_GET_WPA_SUP 247
1104#define WLC_SET_CS_SCAN_TIMER 248
1105#define WLC_GET_CS_SCAN_TIMER 249
1106#define WLC_MEASURE_REQUEST 250
1107#define WLC_INIT 251
1108#define WLC_SEND_QUIET 252
1109#define WLC_KEEPALIVE 253
1110#define WLC_SEND_PWR_CONSTRAINT 254
1111#define WLC_UPGRADE_STATUS 255
1112#define WLC_CURRENT_PWR 256
1113#define WLC_GET_SCAN_PASSIVE_TIME 257
1114#define WLC_SET_SCAN_PASSIVE_TIME 258
1115#define WLC_LEGACY_LINK_BEHAVIOR 259
1116#define WLC_GET_CHANNELS_IN_COUNTRY 260
1117#define WLC_GET_COUNTRY_LIST 261
1118#define WLC_GET_VAR 262 /* get value of named variable */
1119#define WLC_SET_VAR 263 /* set named variable to value */
1120#define WLC_NVRAM_GET 264 /* deprecated */
1121#define WLC_NVRAM_SET 265
1122#define WLC_NVRAM_DUMP 266
1123#define WLC_REBOOT 267
1124#define WLC_SET_WSEC_PMK 268
1125#define WLC_GET_AUTH_MODE 269
1126#define WLC_SET_AUTH_MODE 270
1127#define WLC_GET_WAKEENTRY 271
1128#define WLC_SET_WAKEENTRY 272
1129#define WLC_NDCONFIG_ITEM 273 /* currently handled in wl_oid.c */
1130#define WLC_NVOTPW 274
1131#define WLC_OTPW 275
1132#define WLC_IOV_BLOCK_GET 276
1133#define WLC_IOV_MODULES_GET 277
1134#define WLC_SOFT_RESET 278
1135#define WLC_GET_ALLOW_MODE 279
1136#define WLC_SET_ALLOW_MODE 280
1137#define WLC_GET_DESIRED_BSSID 281
1138#define WLC_SET_DESIRED_BSSID 282
1139#define WLC_DISASSOC_MYAP 283
1140#define WLC_GET_RESERVED10 284
1141#define WLC_GET_RESERVED11 285
1142#define WLC_GET_RESERVED12 286
1143#define WLC_GET_RESERVED13 287
1144#define WLC_GET_RESERVED14 288
1145#define WLC_SET_RESERVED15 289
1146#define WLC_SET_RESERVED16 290
1147#define WLC_GET_RESERVED17 291
1148#define WLC_GET_RESERVED18 292
1149#define WLC_GET_RESERVED19 293
1150#define WLC_SET_RESERVED1A 294
1151#define WLC_GET_RESERVED1B 295
1152#define WLC_GET_RESERVED1C 296
1153#define WLC_GET_RESERVED1D 297
1154#define WLC_SET_RESERVED1E 298
1155#define WLC_GET_RESERVED1F 299
1156#define WLC_GET_RESERVED20 300
1157#define WLC_GET_RESERVED21 301
1158#define WLC_GET_RESERVED22 302
1159#define WLC_GET_RESERVED23 303
1160#define WLC_GET_RESERVED24 304
1161#define WLC_SET_RESERVED25 305
1162#define WLC_GET_RESERVED26 306
1163#define WLC_NPHY_SAMPLE_COLLECT 307 /* Nphy sample collect mode */
1164#define WLC_UM_PRIV 308 /* for usermode driver private ioctl */
1165#define WLC_GET_CMD 309
1166 /* #define WLC_LAST 310 *//* Never used - can be reused */
1167#define WLC_RESERVED8 311
1168#define WLC_RESERVED9 312
1169#define WLC_RESERVED1 313
1170#define WLC_RESERVED2 314
1171#define WLC_RESERVED3 315
1172#define WLC_LAST 316
1173
1174#ifndef EPICTRL_COOKIE
1175#define EPICTRL_COOKIE 0xABADCEDE
1176#endif
1177
1178#define WL_DECRYPT_STATUS_SUCCESS 1
1179#define WL_DECRYPT_STATUS_FAILURE 2
1180#define WL_DECRYPT_STATUS_UNKNOWN 3
1181
1182/* allows user-mode app to poll the status of USB image upgrade */
1183#define WLC_UPGRADE_SUCCESS 0
1184#define WLC_UPGRADE_PENDING 1
1185
1186/* WLC_GET_AUTH, WLC_SET_AUTH values */
1187#define WL_AUTH_OPEN_SYSTEM 0 /* d11 open authentication */
1188#define WL_AUTH_SHARED_KEY 1 /* d11 shared authentication */
1189#define WL_AUTH_OPEN_SHARED 2 /* try open, then shared if open failed w/rc 13 */
1190
1191/* Bit masks for radio disabled status - returned by WL_GET_RADIO */
1192#define WL_RADIO_SW_DISABLE (1<<0)
1193#define WL_RADIO_HW_DISABLE (1<<1)
1194#define WL_RADIO_MPC_DISABLE (1<<2)
1195#define WL_RADIO_COUNTRY_DISABLE (1<<3) /* some countries don't support any channel */
1196
1197#define WL_SPURAVOID_OFF 0
1198#define WL_SPURAVOID_ON1 1
1199#define WL_SPURAVOID_ON2 2
1200
1201/* Override bit for WLC_SET_TXPWR. if set, ignore other level limits */
1202#define WL_TXPWR_OVERRIDE (1U<<31)
1203
1204#define WL_PHY_PAVARS_LEN 6 /* Phy type, Band range, chain, a1, b0, b1 */
1205
1206typedef struct wl_po {
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -07001207 u16 phy_type; /* Phy type */
1208 u16 band;
1209 u16 cckpo;
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001210 u32 ofdmpo;
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -07001211 u16 mcspo[8];
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001212} wl_po_t;
1213
Greg Kroah-Hartman7068c2f2010-10-08 11:34:59 -07001214/* a large TX Power as an init value to factor out of min() calculations,
Greg Kroah-Hartman562c8852010-10-05 11:04:17 -07001215 * keep low enough to fit in an s8, units are .25 dBm
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001216 */
1217#define WLC_TXPWR_MAX (127) /* ~32 dBm = 1,500 mW */
1218
1219/* "diag" iovar argument and error code */
1220#define WL_DIAG_INTERRUPT 1 /* d11 loopback interrupt test */
1221#define WL_DIAG_LOOPBACK 2 /* d11 loopback data test */
1222#define WL_DIAG_MEMORY 3 /* d11 memory test */
1223#define WL_DIAG_LED 4 /* LED test */
1224#define WL_DIAG_REG 5 /* d11/phy register test */
1225#define WL_DIAG_SROM 6 /* srom read/crc test */
1226#define WL_DIAG_DMA 7 /* DMA test */
1227
1228#define WL_DIAGERR_SUCCESS 0
1229#define WL_DIAGERR_FAIL_TO_RUN 1 /* unable to run requested diag */
1230#define WL_DIAGERR_NOT_SUPPORTED 2 /* diag requested is not supported */
1231#define WL_DIAGERR_INTERRUPT_FAIL 3 /* loopback interrupt test failed */
1232#define WL_DIAGERR_LOOPBACK_FAIL 4 /* loopback data test failed */
1233#define WL_DIAGERR_SROM_FAIL 5 /* srom read failed */
1234#define WL_DIAGERR_SROM_BADCRC 6 /* srom crc failed */
1235#define WL_DIAGERR_REG_FAIL 7 /* d11/phy register test failed */
1236#define WL_DIAGERR_MEMORY_FAIL 8 /* d11 memory test failed */
1237#define WL_DIAGERR_NOMEM 9 /* diag test failed due to no memory */
1238#define WL_DIAGERR_DMA_FAIL 10 /* DMA test failed */
1239
1240#define WL_DIAGERR_MEMORY_TIMEOUT 11 /* d11 memory test didn't finish in time */
1241#define WL_DIAGERR_MEMORY_BADPATTERN 12 /* d11 memory test result in bad pattern */
1242
1243/* band types */
1244#define WLC_BAND_AUTO 0 /* auto-select */
1245#define WLC_BAND_5G 1 /* 5 Ghz */
1246#define WLC_BAND_2G 2 /* 2.4 Ghz */
1247#define WLC_BAND_ALL 3 /* all bands */
1248
1249/* band range returned by band_range iovar */
1250#define WL_CHAN_FREQ_RANGE_2G 0
1251#define WL_CHAN_FREQ_RANGE_5GL 1
1252#define WL_CHAN_FREQ_RANGE_5GM 2
1253#define WL_CHAN_FREQ_RANGE_5GH 3
1254
1255/* phy types (returned by WLC_GET_PHYTPE) */
1256#define WLC_PHY_TYPE_A 0
1257#define WLC_PHY_TYPE_B 1
1258#define WLC_PHY_TYPE_G 2
1259#define WLC_PHY_TYPE_N 4
1260#define WLC_PHY_TYPE_LP 5
1261#define WLC_PHY_TYPE_SSN 6
1262#define WLC_PHY_TYPE_HT 7
1263#define WLC_PHY_TYPE_LCN 8
1264#define WLC_PHY_TYPE_NULL 0xf
1265
1266/* MAC list modes */
1267#define WLC_MACMODE_DISABLED 0 /* MAC list disabled */
1268#define WLC_MACMODE_DENY 1 /* Deny specified (i.e. allow unspecified) */
1269#define WLC_MACMODE_ALLOW 2 /* Allow specified (i.e. deny unspecified) */
1270
1271/*
1272 * 54g modes (basic bits may still be overridden)
1273 *
1274 * GMODE_LEGACY_B Rateset: 1b, 2b, 5.5, 11
1275 * Preamble: Long
1276 * Shortslot: Off
1277 * GMODE_AUTO Rateset: 1b, 2b, 5.5b, 11b, 18, 24, 36, 54
1278 * Extended Rateset: 6, 9, 12, 48
1279 * Preamble: Long
1280 * Shortslot: Auto
1281 * GMODE_ONLY Rateset: 1b, 2b, 5.5b, 11b, 18, 24b, 36, 54
1282 * Extended Rateset: 6b, 9, 12b, 48
1283 * Preamble: Short required
1284 * Shortslot: Auto
1285 * GMODE_B_DEFERRED Rateset: 1b, 2b, 5.5b, 11b, 18, 24, 36, 54
1286 * Extended Rateset: 6, 9, 12, 48
1287 * Preamble: Long
1288 * Shortslot: On
1289 * GMODE_PERFORMANCE Rateset: 1b, 2b, 5.5b, 6b, 9, 11b, 12b, 18, 24b, 36, 48, 54
1290 * Preamble: Short required
1291 * Shortslot: On and required
1292 * GMODE_LRS Rateset: 1b, 2b, 5.5b, 11b
1293 * Extended Rateset: 6, 9, 12, 18, 24, 36, 48, 54
1294 * Preamble: Long
1295 * Shortslot: Auto
1296 */
1297#define GMODE_LEGACY_B 0
1298#define GMODE_AUTO 1
1299#define GMODE_ONLY 2
1300#define GMODE_B_DEFERRED 3
1301#define GMODE_PERFORMANCE 4
1302#define GMODE_LRS 5
1303#define GMODE_MAX 6
1304
1305/* values for PLCPHdr_override */
1306#define WLC_PLCP_AUTO -1
1307#define WLC_PLCP_SHORT 0
1308#define WLC_PLCP_LONG 1
1309
1310/* values for g_protection_override and n_protection_override */
1311#define WLC_PROTECTION_AUTO -1
1312#define WLC_PROTECTION_OFF 0
1313#define WLC_PROTECTION_ON 1
1314#define WLC_PROTECTION_MMHDR_ONLY 2
1315#define WLC_PROTECTION_CTS_ONLY 3
1316
1317/* values for g_protection_control and n_protection_control */
1318#define WLC_PROTECTION_CTL_OFF 0
1319#define WLC_PROTECTION_CTL_LOCAL 1
1320#define WLC_PROTECTION_CTL_OVERLAP 2
1321
1322/* values for n_protection */
1323#define WLC_N_PROTECTION_OFF 0
1324#define WLC_N_PROTECTION_OPTIONAL 1
1325#define WLC_N_PROTECTION_20IN40 2
1326#define WLC_N_PROTECTION_MIXEDMODE 3
1327
1328/* values for n_preamble_type */
1329#define WLC_N_PREAMBLE_MIXEDMODE 0
1330#define WLC_N_PREAMBLE_GF 1
1331#define WLC_N_PREAMBLE_GF_BRCM 2
1332
1333/* values for band specific 40MHz capabilities */
1334#define WLC_N_BW_20ALL 0
1335#define WLC_N_BW_40ALL 1
1336#define WLC_N_BW_20IN2G_40IN5G 2
1337
1338/* values to force tx/rx chain */
1339#define WLC_N_TXRX_CHAIN0 0
1340#define WLC_N_TXRX_CHAIN1 1
1341
1342/* bitflags for SGI support (sgi_rx iovar) */
1343#define WLC_N_SGI_20 0x01
1344#define WLC_N_SGI_40 0x02
1345
1346/* Values for PM */
1347#define PM_OFF 0
1348#define PM_MAX 1
1349
1350/* interference mitigation options */
1351#define INTERFERE_OVRRIDE_OFF -1 /* interference override off */
1352#define INTERFERE_NONE 0 /* off */
1353#define NON_WLAN 1 /* foreign/non 802.11 interference, no auto detect */
1354#define WLAN_MANUAL 2 /* ACI: no auto detection */
1355#define WLAN_AUTO 3 /* ACI: auto detect */
1356#define WLAN_AUTO_W_NOISE 4 /* ACI: auto - detect and non 802.11 interference */
1357#define AUTO_ACTIVE (1 << 7) /* Auto is currently active */
1358
1359#define WL_RSSI_ANT_VERSION 1 /* current version of wl_rssi_ant_t */
1360#define WL_ANT_RX_MAX 2 /* max 2 receive antennas */
1361#define WL_ANT_HT_RX_MAX 3 /* max 3 receive antennas/cores */
1362#define WL_ANT_IDX_1 0 /* antenna index 1 */
1363#define WL_ANT_IDX_2 1 /* antenna index 2 */
1364
1365#ifndef WL_RSSI_ANT_MAX
1366#define WL_RSSI_ANT_MAX 4 /* max possible rx antennas */
1367#elif WL_RSSI_ANT_MAX != 4
1368#error "WL_RSSI_ANT_MAX does not match"
1369#endif
1370
1371/* RSSI per antenna */
1372typedef struct {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001373 u32 version; /* version field */
1374 u32 count; /* number of valid antenna rssi */
Greg Kroah-Hartman562c8852010-10-05 11:04:17 -07001375 s8 rssi_ant[WL_RSSI_ANT_MAX]; /* rssi per antenna */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001376} wl_rssi_ant_t;
1377
1378#define NUM_PWRCTRL_RATES 12
1379
1380typedef struct {
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -07001381 u8 txpwr_band_max[NUM_PWRCTRL_RATES]; /* User set target */
1382 u8 txpwr_limit[NUM_PWRCTRL_RATES]; /* reg and local power limit */
1383 u8 txpwr_local_max; /* local max according to the AP */
1384 u8 txpwr_local_constraint; /* local constraint according to the AP */
1385 u8 txpwr_chan_reg_max; /* Regulatory max for this channel */
1386 u8 txpwr_target[2][NUM_PWRCTRL_RATES]; /* Latest target for 2.4 and 5 Ghz */
1387 u8 txpwr_est_Pout[2]; /* Latest estimate for 2.4 and 5 Ghz */
1388 u8 txpwr_opo[NUM_PWRCTRL_RATES]; /* On G phy, OFDM power offset */
1389 u8 txpwr_bphy_cck_max[NUM_PWRCTRL_RATES]; /* Max CCK power for this band (SROM) */
1390 u8 txpwr_bphy_ofdm_max; /* Max OFDM power for this band (SROM) */
1391 u8 txpwr_aphy_max[NUM_PWRCTRL_RATES]; /* Max power for A band (SROM) */
Greg Kroah-Hartman562c8852010-10-05 11:04:17 -07001392 s8 txpwr_antgain[2]; /* Ant gain for each band - from SROM */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -07001393 u8 txpwr_est_Pout_gofdm; /* Pwr estimate for 2.4 OFDM */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001394} tx_power_legacy_t;
1395
1396#define WL_TX_POWER_RATES_LEGACY 45
1397#define WL_TX_POWER_MCS20_FIRST 12
1398#define WL_TX_POWER_MCS20_NUM 16
1399#define WL_TX_POWER_MCS40_FIRST 28
1400#define WL_TX_POWER_MCS40_NUM 17
1401
1402typedef struct {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001403 u32 flags;
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001404 chanspec_t chanspec; /* txpwr report for this channel */
1405 chanspec_t local_chanspec; /* channel on which we are associated */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -07001406 u8 local_max; /* local max according to the AP */
1407 u8 local_constraint; /* local constraint according to the AP */
Greg Kroah-Hartman562c8852010-10-05 11:04:17 -07001408 s8 antgain[2]; /* Ant gain for each band - from SROM */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -07001409 u8 rf_cores; /* count of RF Cores being reported */
1410 u8 est_Pout[4]; /* Latest tx power out estimate per RF
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001411 * chain without adjustment
1412 */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -07001413 u8 est_Pout_cck; /* Latest CCK tx power out estimate */
1414 u8 user_limit[WL_TX_POWER_RATES_LEGACY]; /* User limit */
1415 u8 reg_limit[WL_TX_POWER_RATES_LEGACY]; /* Regulatory power limit */
1416 u8 board_limit[WL_TX_POWER_RATES_LEGACY]; /* Max power board can support (SROM) */
1417 u8 target[WL_TX_POWER_RATES_LEGACY]; /* Latest target power */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001418} tx_power_legacy2_t;
1419
1420#define WL_TX_POWER_RATES 101
1421#define WL_TX_POWER_CCK_FIRST 0
1422#define WL_TX_POWER_CCK_NUM 4
1423#define WL_TX_POWER_OFDM_FIRST 4 /* Index for first 20MHz OFDM SISO rate */
1424#define WL_TX_POWER_OFDM20_CDD_FIRST 12 /* Index for first 20MHz OFDM CDD rate */
1425#define WL_TX_POWER_OFDM40_SISO_FIRST 52 /* Index for first 40MHz OFDM SISO rate */
1426#define WL_TX_POWER_OFDM40_CDD_FIRST 60 /* Index for first 40MHz OFDM CDD rate */
1427#define WL_TX_POWER_OFDM_NUM 8
1428#define WL_TX_POWER_MCS20_SISO_FIRST 20 /* Index for first 20MHz MCS SISO rate */
1429#define WL_TX_POWER_MCS20_CDD_FIRST 28 /* Index for first 20MHz MCS CDD rate */
1430#define WL_TX_POWER_MCS20_STBC_FIRST 36 /* Index for first 20MHz MCS STBC rate */
1431#define WL_TX_POWER_MCS20_SDM_FIRST 44 /* Index for first 20MHz MCS SDM rate */
1432#define WL_TX_POWER_MCS40_SISO_FIRST 68 /* Index for first 40MHz MCS SISO rate */
1433#define WL_TX_POWER_MCS40_CDD_FIRST 76 /* Index for first 40MHz MCS CDD rate */
1434#define WL_TX_POWER_MCS40_STBC_FIRST 84 /* Index for first 40MHz MCS STBC rate */
1435#define WL_TX_POWER_MCS40_SDM_FIRST 92 /* Index for first 40MHz MCS SDM rate */
1436#define WL_TX_POWER_MCS_1_STREAM_NUM 8
1437#define WL_TX_POWER_MCS_2_STREAM_NUM 8
1438#define WL_TX_POWER_MCS_32 100 /* Index for 40MHz rate MCS 32 */
1439#define WL_TX_POWER_MCS_32_NUM 1
1440
1441/* sslpnphy specifics */
1442#define WL_TX_POWER_MCS20_SISO_FIRST_SSN 12 /* Index for first 20MHz MCS SISO rate */
1443
1444/* tx_power_t.flags bits */
1445#define WL_TX_POWER_F_ENABLED 1
1446#define WL_TX_POWER_F_HW 2
1447#define WL_TX_POWER_F_MIMO 4
1448#define WL_TX_POWER_F_SISO 8
1449
1450typedef struct {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001451 u32 flags;
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001452 chanspec_t chanspec; /* txpwr report for this channel */
1453 chanspec_t local_chanspec; /* channel on which we are associated */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -07001454 u8 local_max; /* local max according to the AP */
1455 u8 local_constraint; /* local constraint according to the AP */
Greg Kroah-Hartman562c8852010-10-05 11:04:17 -07001456 s8 antgain[2]; /* Ant gain for each band - from SROM */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -07001457 u8 rf_cores; /* count of RF Cores being reported */
1458 u8 est_Pout[4]; /* Latest tx power out estimate per RF chain */
1459 u8 est_Pout_act[4]; /* Latest tx power out estimate per RF chain
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001460 * without adjustment
1461 */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -07001462 u8 est_Pout_cck; /* Latest CCK tx power out estimate */
1463 u8 tx_power_max[4]; /* Maximum target power among all rates */
1464 u8 tx_power_max_rate_ind[4]; /* Index of the rate with the max target power */
1465 u8 user_limit[WL_TX_POWER_RATES]; /* User limit */
1466 u8 reg_limit[WL_TX_POWER_RATES]; /* Regulatory power limit */
1467 u8 board_limit[WL_TX_POWER_RATES]; /* Max power board can support (SROM) */
1468 u8 target[WL_TX_POWER_RATES]; /* Latest target power */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001469} tx_power_t;
1470
1471typedef struct tx_inst_power {
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -07001472 u8 txpwr_est_Pout[2]; /* Latest estimate for 2.4 and 5 Ghz */
1473 u8 txpwr_est_Pout_gofdm; /* Pwr estimate for 2.4 OFDM */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001474} tx_inst_power_t;
1475
1476/* Message levels */
1477#define WL_ERROR_VAL 0x00000001
1478#define WL_TRACE_VAL 0x00000002
1479#define WL_AMPDU_VAL 0x20000000
1480#define WL_FFPLD_VAL 0x40000000
1481
1482/* maximum channels returned by the get valid channels iovar */
1483#define WL_NUMCHANNELS 64
1484#define WL_NUMCHANSPECS 100
1485
1486struct tsinfo_arg {
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -07001487 u8 octets[3];
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001488};
1489
1490#define NFIFO 6 /* # tx/rx fifopairs */
1491
1492#define WL_CNT_T_VERSION 7 /* current version of wl_cnt_t struct */
1493
1494typedef struct {
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -07001495 u16 version; /* see definition of WL_CNT_T_VERSION */
1496 u16 length; /* length of entire structure */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001497
1498 /* transmit stat counters */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001499 u32 txframe; /* tx data frames */
1500 u32 txbyte; /* tx data bytes */
1501 u32 txretrans; /* tx mac retransmits */
1502 u32 txerror; /* tx data errors (derived: sum of others) */
1503 u32 txctl; /* tx management frames */
1504 u32 txprshort; /* tx short preamble frames */
1505 u32 txserr; /* tx status errors */
1506 u32 txnobuf; /* tx out of buffers errors */
1507 u32 txnoassoc; /* tx discard because we're not associated */
1508 u32 txrunt; /* tx runt frames */
1509 u32 txchit; /* tx header cache hit (fastpath) */
1510 u32 txcmiss; /* tx header cache miss (slowpath) */
1511 u32 ieee_tx_status; /* calls to ieee80211_tx_status */
1512 u32 ieee_tx; /* tx calls frm mac0211 */
1513 u32 ieee_rx; /* calls to ieee_rx */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001514
1515 /* transmit chip error counters */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001516 u32 txuflo; /* tx fifo underflows */
1517 u32 txphyerr; /* tx phy errors (indicated in tx status) */
1518 u32 txphycrs;
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001519
1520 /* receive stat counters */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001521 u32 rxframe; /* rx data frames */
1522 u32 rxbyte; /* rx data bytes */
1523 u32 rxerror; /* rx data errors (derived: sum of others) */
1524 u32 rxctl; /* rx management frames */
1525 u32 rxnobuf; /* rx out of buffers errors */
1526 u32 rxnondata; /* rx non data frames in the data channel errors */
1527 u32 rxbadds; /* rx bad DS errors */
1528 u32 rxbadcm; /* rx bad control or management frames */
1529 u32 rxfragerr; /* rx fragmentation errors */
1530 u32 rxrunt; /* rx runt frames */
1531 u32 rxgiant; /* rx giant frames */
1532 u32 rxnoscb; /* rx no scb error */
1533 u32 rxbadproto; /* rx invalid frames */
1534 u32 rxbadsrcmac; /* rx frames with Invalid Src Mac */
1535 u32 rxbadda; /* rx frames tossed for invalid da */
1536 u32 rxfilter; /* rx frames filtered out */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001537
1538 /* receive chip error counters */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001539 u32 rxoflo; /* rx fifo overflow errors */
1540 u32 rxuflo[NFIFO]; /* rx dma descriptor underflow errors */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001541
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001542 u32 d11cnt_txrts_off; /* d11cnt txrts value when reset d11cnt */
1543 u32 d11cnt_rxcrc_off; /* d11cnt rxcrc value when reset d11cnt */
1544 u32 d11cnt_txnocts_off; /* d11cnt txnocts value when reset d11cnt */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001545
1546 /* misc counters */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001547 u32 dmade; /* tx/rx dma descriptor errors */
1548 u32 dmada; /* tx/rx dma data errors */
1549 u32 dmape; /* tx/rx dma descriptor protocol errors */
1550 u32 reset; /* reset count */
1551 u32 tbtt; /* cnts the TBTT int's */
1552 u32 txdmawar;
1553 u32 pkt_callback_reg_fail; /* callbacks register failure */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001554
1555 /* MAC counters: 32-bit version of d11.h's macstat_t */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001556 u32 txallfrm; /* total number of frames sent, incl. Data, ACK, RTS, CTS,
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001557 * Control Management (includes retransmissions)
1558 */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001559 u32 txrtsfrm; /* number of RTS sent out by the MAC */
1560 u32 txctsfrm; /* number of CTS sent out by the MAC */
1561 u32 txackfrm; /* number of ACK frames sent out */
1562 u32 txdnlfrm; /* Not used */
1563 u32 txbcnfrm; /* beacons transmitted */
1564 u32 txfunfl[8]; /* per-fifo tx underflows */
1565 u32 txtplunfl; /* Template underflows (mac was too slow to transmit ACK/CTS
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001566 * or BCN)
1567 */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001568 u32 txphyerror; /* Transmit phy error, type of error is reported in tx-status for
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001569 * driver enqueued frames
1570 */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001571 u32 rxfrmtoolong; /* Received frame longer than legal limit (2346 bytes) */
1572 u32 rxfrmtooshrt; /* Received frame did not contain enough bytes for its frame type */
1573 u32 rxinvmachdr; /* Either the protocol version != 0 or frame type not
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001574 * data/control/management
1575 */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001576 u32 rxbadfcs; /* number of frames for which the CRC check failed in the MAC */
1577 u32 rxbadplcp; /* parity check of the PLCP header failed */
1578 u32 rxcrsglitch; /* PHY was able to correlate the preamble but not the header */
1579 u32 rxstrt; /* Number of received frames with a good PLCP
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001580 * (i.e. passing parity check)
1581 */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001582 u32 rxdfrmucastmbss; /* Number of received DATA frames with good FCS and matching RA */
1583 u32 rxmfrmucastmbss; /* number of received mgmt frames with good FCS and matching RA */
1584 u32 rxcfrmucast; /* number of received CNTRL frames with good FCS and matching RA */
1585 u32 rxrtsucast; /* number of unicast RTS addressed to the MAC (good FCS) */
1586 u32 rxctsucast; /* number of unicast CTS addressed to the MAC (good FCS) */
1587 u32 rxackucast; /* number of ucast ACKS received (good FCS) */
1588 u32 rxdfrmocast; /* number of received DATA frames (good FCS and not matching RA) */
1589 u32 rxmfrmocast; /* number of received MGMT frames (good FCS and not matching RA) */
1590 u32 rxcfrmocast; /* number of received CNTRL frame (good FCS and not matching RA) */
1591 u32 rxrtsocast; /* number of received RTS not addressed to the MAC */
1592 u32 rxctsocast; /* number of received CTS not addressed to the MAC */
1593 u32 rxdfrmmcast; /* number of RX Data multicast frames received by the MAC */
1594 u32 rxmfrmmcast; /* number of RX Management multicast frames received by the MAC */
1595 u32 rxcfrmmcast; /* number of RX Control multicast frames received by the MAC
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001596 * (unlikely to see these)
1597 */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001598 u32 rxbeaconmbss; /* beacons received from member of BSS */
1599 u32 rxdfrmucastobss; /* number of unicast frames addressed to the MAC from
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001600 * other BSS (WDS FRAME)
1601 */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001602 u32 rxbeaconobss; /* beacons received from other BSS */
1603 u32 rxrsptmout; /* Number of response timeouts for transmitted frames
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001604 * expecting a response
1605 */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001606 u32 bcntxcancl; /* transmit beacons canceled due to receipt of beacon (IBSS) */
1607 u32 rxf0ovfl; /* Number of receive fifo 0 overflows */
1608 u32 rxf1ovfl; /* Number of receive fifo 1 overflows (obsolete) */
1609 u32 rxf2ovfl; /* Number of receive fifo 2 overflows (obsolete) */
1610 u32 txsfovfl; /* Number of transmit status fifo overflows (obsolete) */
1611 u32 pmqovfl; /* Number of PMQ overflows */
1612 u32 rxcgprqfrm; /* Number of received Probe requests that made it into
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001613 * the PRQ fifo
1614 */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001615 u32 rxcgprsqovfl; /* Rx Probe Request Que overflow in the AP */
1616 u32 txcgprsfail; /* Tx Probe Response Fail. AP sent probe response but did
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001617 * not get ACK
1618 */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001619 u32 txcgprssuc; /* Tx Probe Response Success (ACK was received) */
1620 u32 prs_timeout; /* Number of probe requests that were dropped from the PRQ
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001621 * fifo because a probe response could not be sent out within
1622 * the time limit defined in M_PRS_MAXTIME
1623 */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001624 u32 rxnack;
1625 u32 frmscons;
1626 u32 txnack;
1627 u32 txglitch_nack; /* obsolete */
1628 u32 txburst; /* obsolete */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001629
1630 /* 802.11 MIB counters, pp. 614 of 802.11 reaff doc. */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001631 u32 txfrag; /* dot11TransmittedFragmentCount */
1632 u32 txmulti; /* dot11MulticastTransmittedFrameCount */
1633 u32 txfail; /* dot11FailedCount */
1634 u32 txretry; /* dot11RetryCount */
1635 u32 txretrie; /* dot11MultipleRetryCount */
1636 u32 rxdup; /* dot11FrameduplicateCount */
1637 u32 txrts; /* dot11RTSSuccessCount */
1638 u32 txnocts; /* dot11RTSFailureCount */
1639 u32 txnoack; /* dot11ACKFailureCount */
1640 u32 rxfrag; /* dot11ReceivedFragmentCount */
1641 u32 rxmulti; /* dot11MulticastReceivedFrameCount */
1642 u32 rxcrc; /* dot11FCSErrorCount */
1643 u32 txfrmsnt; /* dot11TransmittedFrameCount (bogus MIB?) */
1644 u32 rxundec; /* dot11WEPUndecryptableCount */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001645
1646 /* WPA2 counters (see rxundec for DecryptFailureCount) */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001647 u32 tkipmicfaill; /* TKIPLocalMICFailures */
1648 u32 tkipcntrmsr; /* TKIPCounterMeasuresInvoked */
1649 u32 tkipreplay; /* TKIPReplays */
1650 u32 ccmpfmterr; /* CCMPFormatErrors */
1651 u32 ccmpreplay; /* CCMPReplays */
1652 u32 ccmpundec; /* CCMPDecryptErrors */
1653 u32 fourwayfail; /* FourWayHandshakeFailures */
1654 u32 wepundec; /* dot11WEPUndecryptableCount */
1655 u32 wepicverr; /* dot11WEPICVErrorCount */
1656 u32 decsuccess; /* DecryptSuccessCount */
1657 u32 tkipicverr; /* TKIPICVErrorCount */
1658 u32 wepexcluded; /* dot11WEPExcludedCount */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001659
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001660 u32 rxundec_mcst; /* dot11WEPUndecryptableCount */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001661
1662 /* WPA2 counters (see rxundec for DecryptFailureCount) */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001663 u32 tkipmicfaill_mcst; /* TKIPLocalMICFailures */
1664 u32 tkipcntrmsr_mcst; /* TKIPCounterMeasuresInvoked */
1665 u32 tkipreplay_mcst; /* TKIPReplays */
1666 u32 ccmpfmterr_mcst; /* CCMPFormatErrors */
1667 u32 ccmpreplay_mcst; /* CCMPReplays */
1668 u32 ccmpundec_mcst; /* CCMPDecryptErrors */
1669 u32 fourwayfail_mcst; /* FourWayHandshakeFailures */
1670 u32 wepundec_mcst; /* dot11WEPUndecryptableCount */
1671 u32 wepicverr_mcst; /* dot11WEPICVErrorCount */
1672 u32 decsuccess_mcst; /* DecryptSuccessCount */
1673 u32 tkipicverr_mcst; /* TKIPICVErrorCount */
1674 u32 wepexcluded_mcst; /* dot11WEPExcludedCount */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001675
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001676 u32 txchanrej; /* Tx frames suppressed due to channel rejection */
1677 u32 txexptime; /* Tx frames suppressed due to timer expiration */
1678 u32 psmwds; /* Count PSM watchdogs */
1679 u32 phywatchdog; /* Count Phy watchdogs (triggered by ucode) */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001680
1681 /* MBSS counters, AP only */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001682 u32 prq_entries_handled; /* PRQ entries read in */
1683 u32 prq_undirected_entries; /* which were bcast bss & ssid */
1684 u32 prq_bad_entries; /* which could not be translated to info */
1685 u32 atim_suppress_count; /* TX suppressions on ATIM fifo */
1686 u32 bcn_template_not_ready; /* Template marked in use on send bcn ... */
1687 u32 bcn_template_not_ready_done; /* ...but "DMA done" interrupt rcvd */
1688 u32 late_tbtt_dpc; /* TBTT DPC did not happen in time */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001689
1690 /* per-rate receive stat counters */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001691 u32 rx1mbps; /* packets rx at 1Mbps */
1692 u32 rx2mbps; /* packets rx at 2Mbps */
1693 u32 rx5mbps5; /* packets rx at 5.5Mbps */
1694 u32 rx6mbps; /* packets rx at 6Mbps */
1695 u32 rx9mbps; /* packets rx at 9Mbps */
1696 u32 rx11mbps; /* packets rx at 11Mbps */
1697 u32 rx12mbps; /* packets rx at 12Mbps */
1698 u32 rx18mbps; /* packets rx at 18Mbps */
1699 u32 rx24mbps; /* packets rx at 24Mbps */
1700 u32 rx36mbps; /* packets rx at 36Mbps */
1701 u32 rx48mbps; /* packets rx at 48Mbps */
1702 u32 rx54mbps; /* packets rx at 54Mbps */
1703 u32 rx108mbps; /* packets rx at 108mbps */
1704 u32 rx162mbps; /* packets rx at 162mbps */
1705 u32 rx216mbps; /* packets rx at 216 mbps */
1706 u32 rx270mbps; /* packets rx at 270 mbps */
1707 u32 rx324mbps; /* packets rx at 324 mbps */
1708 u32 rx378mbps; /* packets rx at 378 mbps */
1709 u32 rx432mbps; /* packets rx at 432 mbps */
1710 u32 rx486mbps; /* packets rx at 486 mbps */
1711 u32 rx540mbps; /* packets rx at 540 mbps */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001712
1713 /* pkteng rx frame stats */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001714 u32 pktengrxducast; /* unicast frames rxed by the pkteng code */
1715 u32 pktengrxdmcast; /* multicast frames rxed by the pkteng code */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001716
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001717 u32 rfdisable; /* count of radio disables */
1718 u32 bphy_rxcrsglitch; /* PHY count of bphy glitches */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001719
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001720 u32 txmpdu_sgi; /* count for sgi transmit */
1721 u32 rxmpdu_sgi; /* count for sgi received */
1722 u32 txmpdu_stbc; /* count for stbc transmit */
1723 u32 rxmpdu_stbc; /* count for stbc received */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001724} wl_cnt_t;
1725
1726#define WL_DELTA_STATS_T_VERSION 1 /* current version of wl_delta_stats_t struct */
1727
1728typedef struct {
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -07001729 u16 version; /* see definition of WL_DELTA_STATS_T_VERSION */
1730 u16 length; /* length of entire structure */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001731
1732 /* transmit stat counters */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001733 u32 txframe; /* tx data frames */
1734 u32 txbyte; /* tx data bytes */
1735 u32 txretrans; /* tx mac retransmits */
1736 u32 txfail; /* tx failures */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001737
1738 /* receive stat counters */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001739 u32 rxframe; /* rx data frames */
1740 u32 rxbyte; /* rx data bytes */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001741
1742 /* per-rate receive stat counters */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001743 u32 rx1mbps; /* packets rx at 1Mbps */
1744 u32 rx2mbps; /* packets rx at 2Mbps */
1745 u32 rx5mbps5; /* packets rx at 5.5Mbps */
1746 u32 rx6mbps; /* packets rx at 6Mbps */
1747 u32 rx9mbps; /* packets rx at 9Mbps */
1748 u32 rx11mbps; /* packets rx at 11Mbps */
1749 u32 rx12mbps; /* packets rx at 12Mbps */
1750 u32 rx18mbps; /* packets rx at 18Mbps */
1751 u32 rx24mbps; /* packets rx at 24Mbps */
1752 u32 rx36mbps; /* packets rx at 36Mbps */
1753 u32 rx48mbps; /* packets rx at 48Mbps */
1754 u32 rx54mbps; /* packets rx at 54Mbps */
1755 u32 rx108mbps; /* packets rx at 108mbps */
1756 u32 rx162mbps; /* packets rx at 162mbps */
1757 u32 rx216mbps; /* packets rx at 216 mbps */
1758 u32 rx270mbps; /* packets rx at 270 mbps */
1759 u32 rx324mbps; /* packets rx at 324 mbps */
1760 u32 rx378mbps; /* packets rx at 378 mbps */
1761 u32 rx432mbps; /* packets rx at 432 mbps */
1762 u32 rx486mbps; /* packets rx at 486 mbps */
1763 u32 rx540mbps; /* packets rx at 540 mbps */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001764} wl_delta_stats_t;
1765
1766#define WL_WME_CNT_VERSION 1 /* current version of wl_wme_cnt_t */
1767
1768typedef struct {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001769 u32 packets;
1770 u32 bytes;
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001771} wl_traffic_stats_t;
1772
1773typedef struct {
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -07001774 u16 version; /* see definition of WL_WME_CNT_VERSION */
1775 u16 length; /* length of entire structure */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001776
1777 wl_traffic_stats_t tx[AC_COUNT]; /* Packets transmitted */
1778 wl_traffic_stats_t tx_failed[AC_COUNT]; /* Packets dropped or failed to transmit */
1779 wl_traffic_stats_t rx[AC_COUNT]; /* Packets received */
1780 wl_traffic_stats_t rx_failed[AC_COUNT]; /* Packets failed to receive */
1781
1782 wl_traffic_stats_t forward[AC_COUNT]; /* Packets forwarded by AP */
1783
1784 wl_traffic_stats_t tx_expired[AC_COUNT]; /* packets dropped due to lifetime expiry */
1785
1786} wl_wme_cnt_t;
1787
1788struct wl_msglevel2 {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001789 u32 low;
1790 u32 high;
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001791};
1792
1793#ifdef WLBA
1794
1795#define WLC_BA_CNT_VERSION 1 /* current version of wlc_ba_cnt_t */
1796
1797/* block ack related stats */
1798typedef struct wlc_ba_cnt {
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -07001799 u16 version; /* WLC_BA_CNT_VERSION */
1800 u16 length; /* length of entire structure */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001801
1802 /* transmit stat counters */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001803 u32 txpdu; /* pdus sent */
1804 u32 txsdu; /* sdus sent */
1805 u32 txfc; /* tx side flow controlled packets */
1806 u32 txfci; /* tx side flow control initiated */
1807 u32 txretrans; /* retransmitted pdus */
1808 u32 txbatimer; /* ba resend due to timer */
1809 u32 txdrop; /* dropped packets */
1810 u32 txaddbareq; /* addba req sent */
1811 u32 txaddbaresp; /* addba resp sent */
1812 u32 txdelba; /* delba sent */
1813 u32 txba; /* ba sent */
1814 u32 txbar; /* bar sent */
1815 u32 txpad[4]; /* future */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001816
1817 /* receive side counters */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001818 u32 rxpdu; /* pdus recd */
1819 u32 rxqed; /* pdus buffered before sending up */
1820 u32 rxdup; /* duplicate pdus */
1821 u32 rxnobuf; /* pdus discarded due to no buf */
1822 u32 rxaddbareq; /* addba req recd */
1823 u32 rxaddbaresp; /* addba resp recd */
1824 u32 rxdelba; /* delba recd */
1825 u32 rxba; /* ba recd */
1826 u32 rxbar; /* bar recd */
1827 u32 rxinvba; /* invalid ba recd */
1828 u32 rxbaholes; /* ba recd with holes */
1829 u32 rxunexp; /* unexpected packets */
1830 u32 rxpad[4]; /* future */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001831} wlc_ba_cnt_t;
1832#endif /* WLBA */
1833
1834/* structure for per-tid ampdu control */
1835struct ampdu_tid_control {
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -07001836 u8 tid; /* tid */
1837 u8 enable; /* enable/disable */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001838};
1839
1840/* structure for identifying ea/tid for sending addba/delba */
1841struct ampdu_ea_tid {
1842 struct ether_addr ea; /* Station address */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -07001843 u8 tid; /* tid */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001844};
1845/* structure for identifying retry/tid for retry_limit_tid/rr_retry_limit_tid */
1846struct ampdu_retry_tid {
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -07001847 u8 tid; /* tid */
1848 u8 retry; /* retry value */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001849};
1850
1851/* structure for addts arguments */
1852/* For ioctls that take a list of TSPEC */
1853struct tslist {
1854 int count; /* number of tspecs */
1855 struct tsinfo_arg tsinfo[1]; /* variable length array of tsinfo */
1856};
1857
1858/* structure for addts/delts arguments */
1859typedef struct tspec_arg {
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -07001860 u16 version; /* see definition of TSPEC_ARG_VERSION */
1861 u16 length; /* length of entire structure */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001862 uint flag; /* bit field */
1863 /* TSPEC Arguments */
1864 struct tsinfo_arg tsinfo; /* TS Info bit field */
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -07001865 u16 nom_msdu_size; /* (Nominal or fixed) MSDU Size (bytes) */
1866 u16 max_msdu_size; /* Maximum MSDU Size (bytes) */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001867 uint min_srv_interval; /* Minimum Service Interval (us) */
1868 uint max_srv_interval; /* Maximum Service Interval (us) */
1869 uint inactivity_interval; /* Inactivity Interval (us) */
1870 uint suspension_interval; /* Suspension Interval (us) */
1871 uint srv_start_time; /* Service Start Time (us) */
1872 uint min_data_rate; /* Minimum Data Rate (bps) */
1873 uint mean_data_rate; /* Mean Data Rate (bps) */
1874 uint peak_data_rate; /* Peak Data Rate (bps) */
1875 uint max_burst_size; /* Maximum Burst Size (bytes) */
1876 uint delay_bound; /* Delay Bound (us) */
1877 uint min_phy_rate; /* Minimum PHY Rate (bps) */
Greg Kroah-Hartman7d4df482010-10-07 17:04:47 -07001878 u16 surplus_bw; /* Surplus Bandwidth Allowance (range 1.0 to 8.0) */
1879 u16 medium_time; /* Medium Time (32 us/s periods) */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -07001880 u8 dialog_token; /* dialog token */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001881} tspec_arg_t;
1882
1883/* tspec arg for desired station */
1884typedef struct tspec_per_sta_arg {
1885 struct ether_addr ea;
1886 struct tspec_arg ts;
1887} tspec_per_sta_arg_t;
1888
1889/* structure for max bandwidth for each access category */
1890typedef struct wme_max_bandwidth {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001891 u32 ac[AC_COUNT]; /* max bandwidth for each access category */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001892} wme_max_bandwidth_t;
1893
1894#define WL_WME_MBW_PARAMS_IO_BYTES (sizeof(wme_max_bandwidth_t))
1895
1896/* current version of wl_tspec_arg_t struct */
1897#define TSPEC_ARG_VERSION 2 /* current version of wl_tspec_arg_t struct */
1898#define TSPEC_ARG_LENGTH 55 /* argument length from tsinfo to medium_time */
1899#define TSPEC_DEFAULT_DIALOG_TOKEN 42 /* default dialog token */
1900#define TSPEC_DEFAULT_SBW_FACTOR 0x3000 /* default surplus bw */
1901
1902/* define for flag */
1903#define TSPEC_PENDING 0 /* TSPEC pending */
1904#define TSPEC_ACCEPTED 1 /* TSPEC accepted */
1905#define TSPEC_REJECTED 2 /* TSPEC rejected */
1906#define TSPEC_UNKNOWN 3 /* TSPEC unknown */
1907#define TSPEC_STATUS_MASK 7 /* TSPEC status mask */
1908
1909/* Software feature flag defines used by wlfeatureflag */
1910#define WL_SWFL_NOHWRADIO 0x0004
1911#define WL_SWFL_FLOWCONTROL 0x0008 /* Enable backpressure to OS stack */
1912#define WL_SWFL_WLBSSSORT 0x0010 /* Per-port supports sorting of BSS */
1913
1914#define WL_LIFETIME_MAX 0xFFFF /* Max value in ms */
1915
1916/*
1917 * Dongle pattern matching filter.
1918 */
1919
1920/* Packet filter types. Currently, only pattern matching is supported. */
1921typedef enum wl_pkt_filter_type {
1922 WL_PKT_FILTER_TYPE_PATTERN_MATCH /* Pattern matching filter */
1923} wl_pkt_filter_type_t;
1924
1925#define WL_PKT_FILTER_TYPE wl_pkt_filter_type_t
1926
1927/* Pattern matching filter. Specifies an offset within received packets to
1928 * start matching, the pattern to match, the size of the pattern, and a bitmask
1929 * that indicates which bits within the pattern should be matched.
1930 */
1931typedef struct wl_pkt_filter_pattern {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001932 u32 offset; /* Offset within received packet to start pattern matching.
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001933 * Offset '0' is the first byte of the ethernet header.
1934 */
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001935 u32 size_bytes; /* Size of the pattern. Bitmask must be the same size. */
Greg Kroah-Hartmande9bca62010-10-05 10:23:40 -07001936 u8 mask_and_pattern[1]; /* Variable length mask and pattern data. mask starts
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001937 * at offset 0. Pattern immediately follows mask.
1938 */
1939} wl_pkt_filter_pattern_t;
1940
1941/* IOVAR "pkt_filter_add" parameter. Used to install packet filters. */
1942typedef struct wl_pkt_filter {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001943 u32 id; /* Unique filter id, specified by app. */
1944 u32 type; /* Filter type (WL_PKT_FILTER_TYPE_xxx). */
1945 u32 negate_match; /* Negate the result of filter matches */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001946 union { /* Filter definitions */
1947 wl_pkt_filter_pattern_t pattern; /* Pattern matching filter */
1948 } u;
1949} wl_pkt_filter_t;
1950
Greg Kroah-Hartmance0f1b82010-10-08 11:44:45 -07001951#define WL_PKT_FILTER_FIXED_LEN offsetof(wl_pkt_filter_t, u)
1952#define WL_PKT_FILTER_PATTERN_FIXED_LEN offsetof(wl_pkt_filter_pattern_t, mask_and_pattern)
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001953
1954/* IOVAR "pkt_filter_enable" parameter. */
1955typedef struct wl_pkt_filter_enable {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001956 u32 id; /* Unique filter id */
1957 u32 enable; /* Enable/disable bool */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001958} wl_pkt_filter_enable_t;
1959
1960/* IOVAR "pkt_filter_list" parameter. Used to retrieve a list of installed filters. */
1961typedef struct wl_pkt_filter_list {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001962 u32 num; /* Number of installed packet filters */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001963 wl_pkt_filter_t filter[1]; /* Variable array of packet filters. */
1964} wl_pkt_filter_list_t;
1965
Greg Kroah-Hartmance0f1b82010-10-08 11:44:45 -07001966#define WL_PKT_FILTER_LIST_FIXED_LEN offsetof(wl_pkt_filter_list_t, filter)
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001967
1968/* IOVAR "pkt_filter_stats" parameter. Used to retrieve debug statistics. */
1969typedef struct wl_pkt_filter_stats {
Greg Kroah-Hartman66cbd3a2010-10-08 11:05:47 -07001970 u32 num_pkts_matched; /* # filter matches for specified filter id */
1971 u32 num_pkts_forwarded; /* # packets fwded from dongle to host for all filters */
1972 u32 num_pkts_discarded; /* # packets discarded by dongle for all filters */
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001973} wl_pkt_filter_stats_t;
1974
Henry Ptasinskia9533e72010-09-08 21:04:42 -07001975#define WLC_RSSI_INVALID 0 /* invalid RSSI value */
1976
1977/* require default structure packing */
1978#include <packed_section_end.h>
1979
1980/* n-mode support capability */
1981/* 2x2 includes both 1x1 & 2x2 devices
1982 * reserved #define 2 for future when we want to separate 1x1 & 2x2 and
1983 * control it independently
1984 */
1985#define WL_11N_2x2 1
1986#define WL_11N_3x3 3
1987#define WL_11N_4x4 4
1988
1989/* define 11n feature disable flags */
1990#define WLFEATURE_DISABLE_11N 0x00000001
1991#define WLFEATURE_DISABLE_11N_STBC_TX 0x00000002
1992#define WLFEATURE_DISABLE_11N_STBC_RX 0x00000004
1993#define WLFEATURE_DISABLE_11N_SGI_TX 0x00000008
1994#define WLFEATURE_DISABLE_11N_SGI_RX 0x00000010
1995#define WLFEATURE_DISABLE_11N_AMPDU_TX 0x00000020
1996#define WLFEATURE_DISABLE_11N_AMPDU_RX 0x00000040
1997#define WLFEATURE_DISABLE_11N_GF 0x00000080
1998
Henry Ptasinskicf2b4482010-09-20 22:33:12 -07001999#define WL_EVENTING_MASK_LEN 16
2000
2001#define TOE_TX_CSUM_OL 0x00000001
2002#define TOE_RX_CSUM_OL 0x00000002
2003
2004#define PM_OFF 0
2005#define PM_MAX 1
2006#define PM_FAST 2
2007
2008typedef enum sup_auth_status {
2009 WLC_SUP_DISCONNECTED = 0,
2010 WLC_SUP_CONNECTING,
2011 WLC_SUP_IDREQUIRED,
2012 WLC_SUP_AUTHENTICATING,
2013 WLC_SUP_AUTHENTICATED,
2014 WLC_SUP_KEYXCHANGE,
2015 WLC_SUP_KEYED,
2016 WLC_SUP_TIMEOUT,
2017 WLC_SUP_LAST_BASIC_STATE,
2018 WLC_SUP_KEYXCHANGE_WAIT_M1 = WLC_SUP_AUTHENTICATED,
2019 WLC_SUP_KEYXCHANGE_PREP_M2 = WLC_SUP_KEYXCHANGE,
2020 WLC_SUP_KEYXCHANGE_WAIT_M3 = WLC_SUP_LAST_BASIC_STATE,
2021 WLC_SUP_KEYXCHANGE_PREP_M4,
2022 WLC_SUP_KEYXCHANGE_WAIT_G1,
2023 WLC_SUP_KEYXCHANGE_PREP_G2
2024} sup_auth_status_t;
Henry Ptasinskia9533e72010-09-08 21:04:42 -07002025#endif /* _wlioctl_h_ */