GNU Linux-libre 4.9.309-gnu1
[releases.git] / drivers / net / wireless / broadcom / brcm80211 / brcmfmac / fwil_types.h
1 /*
2  * Copyright (c) 2012 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
18 #ifndef FWIL_TYPES_H_
19 #define FWIL_TYPES_H_
20
21 #include <linux/if_ether.h>
22
23
24 #define BRCMF_FIL_ACTION_FRAME_SIZE     1800
25
26 /* ARP Offload feature flags for arp_ol iovar */
27 #define BRCMF_ARP_OL_AGENT              0x00000001
28 #define BRCMF_ARP_OL_SNOOP              0x00000002
29 #define BRCMF_ARP_OL_HOST_AUTO_REPLY    0x00000004
30 #define BRCMF_ARP_OL_PEER_AUTO_REPLY    0x00000008
31
32 #define BRCMF_BSS_INFO_VERSION  109 /* curr ver of brcmf_bss_info_le struct */
33 #define BRCMF_BSS_RSSI_ON_CHANNEL       0x0004
34
35 #define BRCMF_STA_WME              0x00000002      /* WMM association */
36 #define BRCMF_STA_AUTHE            0x00000008      /* Authenticated */
37 #define BRCMF_STA_ASSOC            0x00000010      /* Associated */
38 #define BRCMF_STA_AUTHO            0x00000020      /* Authorized */
39 #define BRCMF_STA_SCBSTATS         0x00004000      /* Per STA debug stats */
40
41 /* size of brcmf_scan_params not including variable length array */
42 #define BRCMF_SCAN_PARAMS_FIXED_SIZE    64
43
44 /* masks for channel and ssid count */
45 #define BRCMF_SCAN_PARAMS_COUNT_MASK    0x0000ffff
46 #define BRCMF_SCAN_PARAMS_NSSID_SHIFT   16
47
48 /* scan type definitions */
49 #define BRCMF_SCANTYPE_DEFAULT          0xFF
50 #define BRCMF_SCANTYPE_ACTIVE           0
51 #define BRCMF_SCANTYPE_PASSIVE          1
52
53 /* primary (ie tx) key */
54 #define BRCMF_PRIMARY_KEY               (1 << 1)
55 #define DOT11_BSSTYPE_ANY               2
56 #define BRCMF_ESCAN_REQ_VERSION         1
57
58 #define BRCMF_MAXRATES_IN_SET           16      /* max # of rates in rateset */
59
60 /* OBSS Coex Auto/On/Off */
61 #define BRCMF_OBSS_COEX_AUTO            (-1)
62 #define BRCMF_OBSS_COEX_OFF             0
63 #define BRCMF_OBSS_COEX_ON              1
64
65 /* WOWL bits */
66 /* Wakeup on Magic packet: */
67 #define BRCMF_WOWL_MAGIC                (1 << 0)
68 /* Wakeup on Netpattern */
69 #define BRCMF_WOWL_NET                  (1 << 1)
70 /* Wakeup on loss-of-link due to Disassoc/Deauth: */
71 #define BRCMF_WOWL_DIS                  (1 << 2)
72 /* Wakeup on retrograde TSF: */
73 #define BRCMF_WOWL_RETR                 (1 << 3)
74 /* Wakeup on loss of beacon: */
75 #define BRCMF_WOWL_BCN                  (1 << 4)
76 /* Wakeup after test: */
77 #define BRCMF_WOWL_TST                  (1 << 5)
78 /* Wakeup after PTK refresh: */
79 #define BRCMF_WOWL_M1                   (1 << 6)
80 /* Wakeup after receipt of EAP-Identity Req: */
81 #define BRCMF_WOWL_EAPID                (1 << 7)
82 /* Wakeind via PME(0) or GPIO(1): */
83 #define BRCMF_WOWL_PME_GPIO             (1 << 8)
84 /* need tkip phase 1 key to be updated by the driver: */
85 #define BRCMF_WOWL_NEEDTKIP1            (1 << 9)
86 /* enable wakeup if GTK fails: */
87 #define BRCMF_WOWL_GTK_FAILURE          (1 << 10)
88 /* support extended magic packets: */
89 #define BRCMF_WOWL_EXTMAGPAT            (1 << 11)
90 /* support ARP/NS/keepalive offloading: */
91 #define BRCMF_WOWL_ARPOFFLOAD           (1 << 12)
92 /* read protocol version for EAPOL frames: */
93 #define BRCMF_WOWL_WPA2                 (1 << 13)
94 /* If the bit is set, use key rotaton: */
95 #define BRCMF_WOWL_KEYROT               (1 << 14)
96 /* If the bit is set, frm received was bcast frame: */
97 #define BRCMF_WOWL_BCAST                (1 << 15)
98 /* If the bit is set, scan offload is enabled: */
99 #define BRCMF_WOWL_SCANOL               (1 << 16)
100 /* Wakeup on tcpkeep alive timeout: */
101 #define BRCMF_WOWL_TCPKEEP_TIME         (1 << 17)
102 /* Wakeup on mDNS Conflict Resolution: */
103 #define BRCMF_WOWL_MDNS_CONFLICT        (1 << 18)
104 /* Wakeup on mDNS Service Connect: */
105 #define BRCMF_WOWL_MDNS_SERVICE         (1 << 19)
106 /* tcp keepalive got data: */
107 #define BRCMF_WOWL_TCPKEEP_DATA         (1 << 20)
108 /* Firmware died in wowl mode: */
109 #define BRCMF_WOWL_FW_HALT              (1 << 21)
110 /* Enable detection of radio button changes: */
111 #define BRCMF_WOWL_ENAB_HWRADIO         (1 << 22)
112 /* Offloads detected MIC failure(s): */
113 #define BRCMF_WOWL_MIC_FAIL             (1 << 23)
114 /* Wakeup in Unassociated state (Net/Magic Pattern): */
115 #define BRCMF_WOWL_UNASSOC              (1 << 24)
116 /* Wakeup if received matched secured pattern: */
117 #define BRCMF_WOWL_SECURE               (1 << 25)
118 /* Wakeup on finding preferred network */
119 #define BRCMF_WOWL_PFN_FOUND            (1 << 27)
120 /* Wakeup on receiving pairwise key EAP packets: */
121 #define WIPHY_WOWL_EAP_PK               (1 << 28)
122 /* Link Down indication in WoWL mode: */
123 #define BRCMF_WOWL_LINKDOWN             (1 << 31)
124
125 #define BRCMF_WOWL_MAXPATTERNS          8
126 #define BRCMF_WOWL_MAXPATTERNSIZE       128
127
128 #define BRCMF_COUNTRY_BUF_SZ            4
129 #define BRCMF_ANT_MAX                   4
130
131 #define BRCMF_MAX_ASSOCLIST             128
132
133 #define BRCMF_TXBF_SU_BFE_CAP           BIT(0)
134 #define BRCMF_TXBF_MU_BFE_CAP           BIT(1)
135 #define BRCMF_TXBF_SU_BFR_CAP           BIT(0)
136 #define BRCMF_TXBF_MU_BFR_CAP           BIT(1)
137
138 #define BRCMF_MAXPMKID                  16      /* max # PMKID cache entries */
139
140 #define BRCMF_PFN_MACADDR_CFG_VER       1
141 #define BRCMF_PFN_MAC_OUI_ONLY          BIT(0)
142 #define BRCMF_PFN_SET_MAC_UNASSOC       BIT(1)
143
144 #define BRCMF_MCSSET_LEN                16
145
146 #define BRCMF_RSN_KCK_LENGTH            16
147 #define BRCMF_RSN_KEK_LENGTH            16
148 #define BRCMF_RSN_REPLAY_LEN            8
149
150 #define BRCMF_MFP_NONE                  0
151 #define BRCMF_MFP_CAPABLE               1
152 #define BRCMF_MFP_REQUIRED              2
153
154 /* join preference types for join_pref iovar */
155 enum brcmf_join_pref_types {
156         BRCMF_JOIN_PREF_RSSI = 1,
157         BRCMF_JOIN_PREF_WPA,
158         BRCMF_JOIN_PREF_BAND,
159         BRCMF_JOIN_PREF_RSSI_DELTA,
160 };
161
162 enum brcmf_fil_p2p_if_types {
163         BRCMF_FIL_P2P_IF_CLIENT,
164         BRCMF_FIL_P2P_IF_GO,
165         BRCMF_FIL_P2P_IF_DYNBCN_GO,
166         BRCMF_FIL_P2P_IF_DEV,
167 };
168
169 enum brcmf_wowl_pattern_type {
170         BRCMF_WOWL_PATTERN_TYPE_BITMAP = 0,
171         BRCMF_WOWL_PATTERN_TYPE_ARP,
172         BRCMF_WOWL_PATTERN_TYPE_NA
173 };
174
175 struct brcmf_fil_p2p_if_le {
176         u8 addr[ETH_ALEN];
177         __le16 type;
178         __le16 chspec;
179 };
180
181 struct brcmf_fil_chan_info_le {
182         __le32 hw_channel;
183         __le32 target_channel;
184         __le32 scan_channel;
185 };
186
187 struct brcmf_fil_action_frame_le {
188         u8      da[ETH_ALEN];
189         __le16  len;
190         __le32  packet_id;
191         u8      data[BRCMF_FIL_ACTION_FRAME_SIZE];
192 };
193
194 struct brcmf_fil_af_params_le {
195         __le32                                  channel;
196         __le32                                  dwell_time;
197         u8                                      bssid[ETH_ALEN];
198         u8                                      pad[2];
199         struct brcmf_fil_action_frame_le        action_frame;
200 };
201
202 struct brcmf_fil_bss_enable_le {
203         __le32 bsscfgidx;
204         __le32 enable;
205 };
206
207 struct brcmf_fil_bwcap_le {
208         __le32 band;
209         __le32 bw_cap;
210 };
211
212 /**
213  * struct tdls_iovar - common structure for tdls iovars.
214  *
215  * @ea: ether address of peer station.
216  * @mode: mode value depending on specific tdls iovar.
217  * @chanspec: channel specification.
218  * @pad: unused (for future use).
219  */
220 struct brcmf_tdls_iovar_le {
221         u8 ea[ETH_ALEN];                /* Station address */
222         u8 mode;                        /* mode: depends on iovar */
223         __le16 chanspec;
224         __le32 pad;                     /* future */
225 };
226
227 enum brcmf_tdls_manual_ep_ops {
228         BRCMF_TDLS_MANUAL_EP_CREATE = 1,
229         BRCMF_TDLS_MANUAL_EP_DELETE = 3,
230         BRCMF_TDLS_MANUAL_EP_DISCOVERY = 6
231 };
232
233 /* Pattern matching filter. Specifies an offset within received packets to
234  * start matching, the pattern to match, the size of the pattern, and a bitmask
235  * that indicates which bits within the pattern should be matched.
236  */
237 struct brcmf_pkt_filter_pattern_le {
238         /*
239          * Offset within received packet to start pattern matching.
240          * Offset '0' is the first byte of the ethernet header.
241          */
242         __le32 offset;
243         /* Size of the pattern.  Bitmask must be the same size.*/
244         __le32 size_bytes;
245         /*
246          * Variable length mask and pattern data. mask starts at offset 0.
247          * Pattern immediately follows mask.
248          */
249         u8 mask_and_pattern[1];
250 };
251
252 /* IOVAR "pkt_filter_add" parameter. Used to install packet filters. */
253 struct brcmf_pkt_filter_le {
254         __le32 id;              /* Unique filter id, specified by app. */
255         __le32 type;            /* Filter type (WL_PKT_FILTER_TYPE_xxx). */
256         __le32 negate_match;    /* Negate the result of filter matches */
257         union {                 /* Filter definitions */
258                 struct brcmf_pkt_filter_pattern_le pattern; /* Filter pattern */
259         } u;
260 };
261
262 /* IOVAR "pkt_filter_enable" parameter. */
263 struct brcmf_pkt_filter_enable_le {
264         __le32 id;              /* Unique filter id */
265         __le32 enable;          /* Enable/disable bool */
266 };
267
268 /* BSS info structure
269  * Applications MUST CHECK ie_offset field and length field to access IEs and
270  * next bss_info structure in a vector (in struct brcmf_scan_results)
271  */
272 struct brcmf_bss_info_le {
273         __le32 version;         /* version field */
274         __le32 length;          /* byte length of data in this record,
275                                  * starting at version and including IEs
276                                  */
277         u8 BSSID[ETH_ALEN];
278         __le16 beacon_period;   /* units are Kusec */
279         __le16 capability;      /* Capability information */
280         u8 SSID_len;
281         u8 SSID[32];
282         struct {
283                 __le32 count;   /* # rates in this set */
284                 u8 rates[16]; /* rates in 500kbps units w/hi bit set if basic */
285         } rateset;              /* supported rates */
286         __le16 chanspec;        /* chanspec for bss */
287         __le16 atim_window;     /* units are Kusec */
288         u8 dtim_period; /* DTIM period */
289         __le16 RSSI;            /* receive signal strength (in dBm) */
290         s8 phy_noise;           /* noise (in dBm) */
291
292         u8 n_cap;               /* BSS is 802.11N Capable */
293         /* 802.11N BSS Capabilities (based on HT_CAP_*): */
294         __le32 nbss_cap;
295         u8 ctl_ch;              /* 802.11N BSS control channel number */
296         __le32 reserved32[1];   /* Reserved for expansion of BSS properties */
297         u8 flags;               /* flags */
298         u8 reserved[3]; /* Reserved for expansion of BSS properties */
299         u8 basic_mcs[BRCMF_MCSSET_LEN]; /* 802.11N BSS required MCS set */
300
301         __le16 ie_offset;       /* offset at which IEs start, from beginning */
302         __le32 ie_length;       /* byte length of Information Elements */
303         __le16 SNR;             /* average SNR of during frame reception */
304         /* Add new fields here */
305         /* variable length Information Elements */
306 };
307
308 struct brcm_rateset_le {
309         /* # rates in this set */
310         __le32 count;
311         /* rates in 500kbps units w/hi bit set if basic */
312         u8 rates[BRCMF_MAXRATES_IN_SET];
313 };
314
315 struct brcmf_ssid_le {
316         __le32 SSID_len;
317         unsigned char SSID[IEEE80211_MAX_SSID_LEN];
318 };
319
320 struct brcmf_scan_params_le {
321         struct brcmf_ssid_le ssid_le;   /* default: {0, ""} */
322         u8 bssid[ETH_ALEN];     /* default: bcast */
323         s8 bss_type;            /* default: any,
324                                  * DOT11_BSSTYPE_ANY/INFRASTRUCTURE/INDEPENDENT
325                                  */
326         u8 scan_type;   /* flags, 0 use default */
327         __le32 nprobes;   /* -1 use default, number of probes per channel */
328         __le32 active_time;     /* -1 use default, dwell time per channel for
329                                  * active scanning
330                                  */
331         __le32 passive_time;    /* -1 use default, dwell time per channel
332                                  * for passive scanning
333                                  */
334         __le32 home_time;       /* -1 use default, dwell time for the
335                                  * home channel between channel scans
336                                  */
337         __le32 channel_num;     /* count of channels and ssids that follow
338                                  *
339                                  * low half is count of channels in
340                                  * channel_list, 0 means default (use all
341                                  * available channels)
342                                  *
343                                  * high half is entries in struct brcmf_ssid
344                                  * array that follows channel_list, aligned for
345                                  * s32 (4 bytes) meaning an odd channel count
346                                  * implies a 2-byte pad between end of
347                                  * channel_list and first ssid
348                                  *
349                                  * if ssid count is zero, single ssid in the
350                                  * fixed parameter portion is assumed, otherwise
351                                  * ssid in the fixed portion is ignored
352                                  */
353         __le16 channel_list[1]; /* list of chanspecs */
354 };
355
356 struct brcmf_scan_results {
357         u32 buflen;
358         u32 version;
359         u32 count;
360         struct brcmf_bss_info_le bss_info_le[];
361 };
362
363 struct brcmf_escan_params_le {
364         __le32 version;
365         __le16 action;
366         __le16 sync_id;
367         struct brcmf_scan_params_le params_le;
368 };
369
370 struct brcmf_escan_result_le {
371         __le32 buflen;
372         __le32 version;
373         __le16 sync_id;
374         __le16 bss_count;
375         struct brcmf_bss_info_le bss_info_le;
376 };
377
378 #define WL_ESCAN_RESULTS_FIXED_SIZE (sizeof(struct brcmf_escan_result_le) - \
379         sizeof(struct brcmf_bss_info_le))
380
381 /* used for association with a specific BSSID and chanspec list */
382 struct brcmf_assoc_params_le {
383         /* 00:00:00:00:00:00: broadcast scan */
384         u8 bssid[ETH_ALEN];
385         /* 0: all available channels, otherwise count of chanspecs in
386          * chanspec_list */
387         __le32 chanspec_num;
388         /* list of chanspecs */
389         __le16 chanspec_list[1];
390 };
391
392 /**
393  * struct join_pref params - parameters for preferred join selection.
394  *
395  * @type: preference type (see enum brcmf_join_pref_types).
396  * @len: length of bytes following (currently always 2).
397  * @rssi_gain: signal gain for selection (only when @type is RSSI_DELTA).
398  * @band: band to which selection preference applies.
399  *      This is used if @type is BAND or RSSI_DELTA.
400  */
401 struct brcmf_join_pref_params {
402         u8 type;
403         u8 len;
404         u8 rssi_gain;
405         u8 band;
406 };
407
408 /* used for join with or without a specific bssid and channel list */
409 struct brcmf_join_params {
410         struct brcmf_ssid_le ssid_le;
411         struct brcmf_assoc_params_le params_le;
412 };
413
414 /* scan params for extended join */
415 struct brcmf_join_scan_params_le {
416         u8 scan_type;           /* 0 use default, active or passive scan */
417         __le32 nprobes;         /* -1 use default, nr of probes per channel */
418         __le32 active_time;     /* -1 use default, dwell time per channel for
419                                  * active scanning
420                                  */
421         __le32 passive_time;    /* -1 use default, dwell time per channel
422                                  * for passive scanning
423                                  */
424         __le32 home_time;       /* -1 use default, dwell time for the home
425                                  * channel between channel scans
426                                  */
427 };
428
429 /* extended join params */
430 struct brcmf_ext_join_params_le {
431         struct brcmf_ssid_le ssid_le;   /* {0, ""}: wildcard scan */
432         struct brcmf_join_scan_params_le scan_le;
433         struct brcmf_assoc_params_le assoc_le;
434 };
435
436 struct brcmf_wsec_key {
437         u32 index;              /* key index */
438         u32 len;                /* key length */
439         u8 data[WLAN_MAX_KEY_LEN];      /* key data */
440         u32 pad_1[18];
441         u32 algo;       /* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
442         u32 flags;      /* misc flags */
443         u32 pad_2[3];
444         u32 iv_initialized;     /* has IV been initialized already? */
445         u32 pad_3;
446         /* Rx IV */
447         struct {
448                 u32 hi; /* upper 32 bits of IV */
449                 u16 lo; /* lower 16 bits of IV */
450         } rxiv;
451         u32 pad_4[2];
452         u8 ea[ETH_ALEN];        /* per station */
453 };
454
455 /*
456  * dongle requires same struct as above but with fields in little endian order
457  */
458 struct brcmf_wsec_key_le {
459         __le32 index;           /* key index */
460         __le32 len;             /* key length */
461         u8 data[WLAN_MAX_KEY_LEN];      /* key data */
462         __le32 pad_1[18];
463         __le32 algo;    /* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
464         __le32 flags;   /* misc flags */
465         __le32 pad_2[3];
466         __le32 iv_initialized;  /* has IV been initialized already? */
467         __le32 pad_3;
468         /* Rx IV */
469         struct {
470                 __le32 hi;      /* upper 32 bits of IV */
471                 __le16 lo;      /* lower 16 bits of IV */
472         } rxiv;
473         __le32 pad_4[2];
474         u8 ea[ETH_ALEN];        /* per station */
475 };
476
477 /* Used to get specific STA parameters */
478 struct brcmf_scb_val_le {
479         __le32 val;
480         u8 ea[ETH_ALEN];
481 };
482
483 /* channel encoding */
484 struct brcmf_channel_info_le {
485         __le32 hw_channel;
486         __le32 target_channel;
487         __le32 scan_channel;
488 };
489
490 struct brcmf_sta_info_le {
491         __le16 ver;             /* version of this struct */
492         __le16 len;             /* length in bytes of this structure */
493         __le16 cap;             /* sta's advertised capabilities */
494         __le32 flags;           /* flags defined below */
495         __le32 idle;            /* time since data pkt rx'd from sta */
496         u8 ea[ETH_ALEN];                /* Station address */
497         __le32 count;                   /* # rates in this set */
498         u8 rates[BRCMF_MAXRATES_IN_SET];        /* rates in 500kbps units */
499                                                 /* w/hi bit set if basic */
500         __le32 in;              /* seconds elapsed since associated */
501         __le32 listen_interval_inms; /* Min Listen interval in ms for STA */
502         __le32 tx_pkts; /* # of packets transmitted */
503         __le32 tx_failures;     /* # of packets failed */
504         __le32 rx_ucast_pkts;   /* # of unicast packets received */
505         __le32 rx_mcast_pkts;   /* # of multicast packets received */
506         __le32 tx_rate; /* Rate of last successful tx frame */
507         __le32 rx_rate; /* Rate of last successful rx frame */
508         __le32 rx_decrypt_succeeds;     /* # of packet decrypted successfully */
509         __le32 rx_decrypt_failures;     /* # of packet decrypted failed */
510         __le32 tx_tot_pkts;    /* # of tx pkts (ucast + mcast) */
511         __le32 rx_tot_pkts;    /* # of data packets recvd (uni + mcast) */
512         __le32 tx_mcast_pkts;  /* # of mcast pkts txed */
513         __le64 tx_tot_bytes;   /* data bytes txed (ucast + mcast) */
514         __le64 rx_tot_bytes;   /* data bytes recvd (ucast + mcast) */
515         __le64 tx_ucast_bytes; /* data bytes txed (ucast) */
516         __le64 tx_mcast_bytes; /* # data bytes txed (mcast) */
517         __le64 rx_ucast_bytes; /* data bytes recvd (ucast) */
518         __le64 rx_mcast_bytes; /* data bytes recvd (mcast) */
519         s8 rssi[BRCMF_ANT_MAX];   /* per antenna rssi */
520         s8 nf[BRCMF_ANT_MAX];     /* per antenna noise floor */
521         __le16 aid;                    /* association ID */
522         __le16 ht_capabilities;        /* advertised ht caps */
523         __le16 vht_flags;              /* converted vht flags */
524         __le32 tx_pkts_retry_cnt;      /* # of frames where a retry was
525                                          * exhausted.
526                                          */
527         __le32 tx_pkts_retry_exhausted; /* # of user frames where a retry
528                                          * was exhausted
529                                          */
530         s8 rx_lastpkt_rssi[BRCMF_ANT_MAX]; /* Per antenna RSSI of last
531                                             * received data frame.
532                                             */
533         /* TX WLAN retry/failure statistics:
534          * Separated for host requested frames and locally generated frames.
535          * Include unicast frame only where the retries/failures can be counted.
536          */
537         __le32 tx_pkts_total;          /* # user frames sent successfully */
538         __le32 tx_pkts_retries;        /* # user frames retries */
539         __le32 tx_pkts_fw_total;       /* # FW generated sent successfully */
540         __le32 tx_pkts_fw_retries;     /* # retries for FW generated frames */
541         __le32 tx_pkts_fw_retry_exhausted;     /* # FW generated where a retry
542                                                 * was exhausted
543                                                 */
544         __le32 rx_pkts_retried;        /* # rx with retry bit set */
545         __le32 tx_rate_fallback;       /* lowest fallback TX rate */
546 };
547
548 struct brcmf_chanspec_list {
549         __le32  count;          /* # of entries */
550         __le32  element[1];     /* variable length uint32 list */
551 };
552
553 /*
554  * WLC_E_PROBRESP_MSG
555  * WLC_E_P2P_PROBREQ_MSG
556  * WLC_E_ACTION_FRAME_RX
557  */
558 struct brcmf_rx_mgmt_data {
559         __be16  version;
560         __be16  chanspec;
561         __be32  rssi;
562         __be32  mactime;
563         __be32  rate;
564 };
565
566 /**
567  * struct brcmf_fil_wowl_pattern_le - wowl pattern configuration struct.
568  *
569  * @cmd: "add", "del" or "clr".
570  * @masksize: Size of the mask in #of bytes
571  * @offset: Pattern byte offset in packet
572  * @patternoffset: Offset of start of pattern. Starting from field masksize.
573  * @patternsize: Size of the pattern itself in #of bytes
574  * @id: id
575  * @reasonsize: Size of the wakeup reason code
576  * @type: Type of pattern (enum brcmf_wowl_pattern_type)
577  */
578 struct brcmf_fil_wowl_pattern_le {
579         u8      cmd[4];
580         __le32  masksize;
581         __le32  offset;
582         __le32  patternoffset;
583         __le32  patternsize;
584         __le32  id;
585         __le32  reasonsize;
586         __le32  type;
587         /* u8 mask[] - Mask follows the structure above */
588         /* u8 pattern[] - Pattern follows the mask is at 'patternoffset' */
589 };
590
591 struct brcmf_mbss_ssid_le {
592         __le32  bsscfgidx;
593         __le32  SSID_len;
594         unsigned char SSID[32];
595 };
596
597 /**
598  * struct brcmf_fil_country_le - country configuration structure.
599  *
600  * @country_abbrev: null-terminated country code used in the country IE.
601  * @rev: revision specifier for ccode. on set, -1 indicates unspecified.
602  * @ccode: null-terminated built-in country code.
603  */
604 struct brcmf_fil_country_le {
605         char country_abbrev[BRCMF_COUNTRY_BUF_SZ];
606         __le32 rev;
607         char ccode[BRCMF_COUNTRY_BUF_SZ];
608 };
609
610 /**
611  * struct brcmf_rev_info_le - device revision info.
612  *
613  * @vendorid: PCI vendor id.
614  * @deviceid: device id of chip.
615  * @radiorev: radio revision.
616  * @chiprev: chip revision.
617  * @corerev: core revision.
618  * @boardid: board identifier (usu. PCI sub-device id).
619  * @boardvendor: board vendor (usu. PCI sub-vendor id).
620  * @boardrev: board revision.
621  * @driverrev: driver version.
622  * @ucoderev: microcode version.
623  * @bus: bus type.
624  * @chipnum: chip number.
625  * @phytype: phy type.
626  * @phyrev: phy revision.
627  * @anarev: anacore rev.
628  * @chippkg: chip package info.
629  * @nvramrev: nvram revision number.
630  */
631 struct brcmf_rev_info_le {
632         __le32 vendorid;
633         __le32 deviceid;
634         __le32 radiorev;
635         __le32 chiprev;
636         __le32 corerev;
637         __le32 boardid;
638         __le32 boardvendor;
639         __le32 boardrev;
640         __le32 driverrev;
641         __le32 ucoderev;
642         __le32 bus;
643         __le32 chipnum;
644         __le32 phytype;
645         __le32 phyrev;
646         __le32 anarev;
647         __le32 chippkg;
648         __le32 nvramrev;
649 };
650
651 /**
652  * struct brcmf_assoclist_le - request assoc list.
653  *
654  * @count: indicates number of stations.
655  * @mac: MAC addresses of stations.
656  */
657 struct brcmf_assoclist_le {
658         __le32 count;
659         u8 mac[BRCMF_MAX_ASSOCLIST][ETH_ALEN];
660 };
661
662 /**
663  * struct brcmf_wowl_wakeind_le - Wakeup indicators
664  *      Note: note both fields contain same information.
665  *
666  * @pci_wakeind: Whether PCI PMECSR PMEStatus bit was set.
667  * @ucode_wakeind: What wakeup-event indication was set by ucode
668  */
669 struct brcmf_wowl_wakeind_le {
670         __le32 pci_wakeind;
671         __le32 ucode_wakeind;
672 };
673
674 /**
675  * struct brcmf_pmksa - PMK Security Association
676  *
677  * @bssid: The AP's BSSID.
678  * @pmkid: he PMK material itself.
679  */
680 struct brcmf_pmksa {
681         u8 bssid[ETH_ALEN];
682         u8 pmkid[WLAN_PMKID_LEN];
683 };
684
685 /**
686  * struct brcmf_pmk_list_le - List of pmksa's.
687  *
688  * @npmk: Number of pmksa's.
689  * @pmk: PMK SA information.
690  */
691 struct brcmf_pmk_list_le {
692         __le32 npmk;
693         struct brcmf_pmksa pmk[BRCMF_MAXPMKID];
694 };
695
696 /**
697  * struct brcmf_pno_param_le - PNO scan configuration parameters
698  *
699  * @version: PNO parameters version.
700  * @scan_freq: scan frequency.
701  * @lost_network_timeout: #sec. to declare discovered network as lost.
702  * @flags: Bit field to control features of PFN such as sort criteria auto
703  *      enable switch and background scan.
704  * @rssi_margin: Margin to avoid jitter for choosing a PFN based on RSSI sort
705  *      criteria.
706  * @bestn: number of best networks in each scan.
707  * @mscan: number of scans recorded.
708  * @repeat: minimum number of scan intervals before scan frequency changes
709  *      in adaptive scan.
710  * @exp: exponent of 2 for maximum scan interval.
711  * @slow_freq: slow scan period.
712  */
713 struct brcmf_pno_param_le {
714         __le32 version;
715         __le32 scan_freq;
716         __le32 lost_network_timeout;
717         __le16 flags;
718         __le16 rssi_margin;
719         u8 bestn;
720         u8 mscan;
721         u8 repeat;
722         u8 exp;
723         __le32 slow_freq;
724 };
725
726 /**
727  * struct brcmf_pno_net_param_le - scan parameters per preferred network.
728  *
729  * @ssid: ssid name and its length.
730  * @flags: bit2: hidden.
731  * @infra: BSS vs IBSS.
732  * @auth: Open vs Closed.
733  * @wpa_auth: WPA type.
734  * @wsec: wsec value.
735  */
736 struct brcmf_pno_net_param_le {
737         struct brcmf_ssid_le ssid;
738         __le32 flags;
739         __le32 infra;
740         __le32 auth;
741         __le32 wpa_auth;
742         __le32 wsec;
743 };
744
745 /**
746  * struct brcmf_pno_net_info_le - information per found network.
747  *
748  * @bssid: BSS network identifier.
749  * @channel: channel number only.
750  * @SSID_len: length of ssid.
751  * @SSID: ssid characters.
752  * @RSSI: receive signal strength (in dBm).
753  * @timestamp: age in seconds.
754  */
755 struct brcmf_pno_net_info_le {
756         u8 bssid[ETH_ALEN];
757         u8 channel;
758         u8 SSID_len;
759         u8 SSID[32];
760         __le16  RSSI;
761         __le16  timestamp;
762 };
763
764 /**
765  * struct brcmf_pno_scanresults_le - result returned in PNO NET FOUND event.
766  *
767  * @version: PNO version identifier.
768  * @status: indicates completion status of PNO scan.
769  * @count: amount of brcmf_pno_net_info_le entries appended.
770  */
771 struct brcmf_pno_scanresults_le {
772         __le32 version;
773         __le32 status;
774         __le32 count;
775 };
776
777 /**
778  * struct brcmf_pno_macaddr_le - to configure PNO macaddr randomization.
779  *
780  * @version: PNO version identifier.
781  * @flags: Flags defining how mac addrss should be used.
782  * @mac: MAC address.
783  */
784 struct brcmf_pno_macaddr_le {
785         u8 version;
786         u8 flags;
787         u8 mac[ETH_ALEN];
788 };
789
790 /**
791  * struct brcmf_pktcnt_le - packet counters.
792  *
793  * @rx_good_pkt: packets (MSDUs & MMPDUs) received from this station
794  * @rx_bad_pkt: failed rx packets
795  * @tx_good_pkt: packets (MSDUs & MMPDUs) transmitted to this station
796  * @tx_bad_pkt: failed tx packets
797  * @rx_ocast_good_pkt: unicast packets destined for others
798  */
799 struct brcmf_pktcnt_le {
800         __le32 rx_good_pkt;
801         __le32 rx_bad_pkt;
802         __le32 tx_good_pkt;
803         __le32 tx_bad_pkt;
804         __le32 rx_ocast_good_pkt;
805 };
806
807 /**
808  * struct brcmf_gtk_keyinfo_le - GTP rekey data
809  *
810  * @kck: key confirmation key.
811  * @kek: key encryption key.
812  * @replay_counter: replay counter.
813  */
814 struct brcmf_gtk_keyinfo_le {
815         u8 kck[BRCMF_RSN_KCK_LENGTH];
816         u8 kek[BRCMF_RSN_KEK_LENGTH];
817         u8 replay_counter[BRCMF_RSN_REPLAY_LEN];
818 };
819
820 #endif /* FWIL_TYPES_H_ */