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