870 lines
29 KiB
C
870 lines
29 KiB
C
/* ipwlan_broadcom.h - Structures for broadcom wlan driver */
|
|
|
|
/*
|
|
******************************************************************************
|
|
* INTERPEAK API HEADER FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipwlan_broadcom.h,v $ $Revision: 1.8 $
|
|
* $Source: /home/interpeak/CVSRoot/ipwlan/include/ipwlan_broadcom.h,v $
|
|
* $Author: ulf $ $Date: 2009-11-25 09:59:10 $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* Copyright 2000-2007 Interpeak AB (http://www.interpeak.se). All rights reserved.
|
|
* Design and implementation by Kenneth Jonsson <kenneth@interpeak.se>
|
|
******************************************************************************
|
|
*/
|
|
#ifndef IPWLAN_BROADCOM_H
|
|
#define IPWLAN_BROADCOM_H
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
DESCRIPTION
|
|
This library contains structures used by the Broadcom wlan driver
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#include <ipcom_type.h>
|
|
#include <ipcom_cstyle.h>
|
|
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#define MAX_CHANNEL_NO (sizeof(ipwlan_broadcom_freq)/sizeof(int))
|
|
#define MAX_COUNTRY_CODE (sizeof(ipwlan_broadcom_countrycodes)/sizeof(Ipcom_iw_country_code))
|
|
#define MAX_DEBUG_LEVELS (sizeof(ipwlan_broadcom_debuglevels)/sizeof(Ipcom_iw_debug_level))
|
|
#define MAX_COUNTRY_NAME_LEN 4
|
|
|
|
#define ALIGN_UP_4(a) (((a)+3)&(~0<<2))
|
|
|
|
#define MAX_IOCTL_SMLEN 256
|
|
#define MAX_IOCTL_MAXLEN 8192
|
|
|
|
#define MAX_NUMRATES 255 /* max # of rates in a rateset */
|
|
#define MAX_TEXT_LEN 100
|
|
#define MAX_WEP_KEY_INDEX 3
|
|
#define MAX_WEP_KEY_LEN 16
|
|
#define MAX_TKIP_KEY_LEN 32
|
|
#define MAX_CCMP_KEY_LEN 16
|
|
#define WEP1_KEY_LEN 5
|
|
#define WEP128_KEY_LEN 13
|
|
|
|
#define NFIFO 6
|
|
|
|
#define MAXACLLIST 32
|
|
|
|
#define IPWLAN_BROADCOM_ERR_FAILED -1
|
|
#define IPWLAN_BROADCOM_ERR_INVALID_ARG -2
|
|
|
|
#define CHANNEL_MASK(c) ((c) & 0xff)
|
|
#define NEXT_BI(b) (void *)((char *)(b) + b->length)
|
|
|
|
#define ETHER_ADDR_LEN 6
|
|
#define MCSSET_LEN 16
|
|
#define DOT11_MAX_KEY_SIZE 32 /* max size of any key */
|
|
|
|
/* Capability Information Field */
|
|
#define DOT11_CAP_ESS 0x0001 /* d11 cap. ESS */
|
|
#define DOT11_CAP_IBSS 0x0002 /* d11 cap. IBSS */
|
|
#define DOT11_CAP_PRIVACY 0x0010 /* d11 cap. privacy */
|
|
|
|
/* MAC modes */
|
|
#define DOT11_ACL_DISABLED 0
|
|
#define DOT11_ACL_DENY 1
|
|
#define DOT11_ACL_ALLOW 2
|
|
#define DOT11_MAX_ACLSIZE (WLC_IOCTL_MAXLEN - sizeof(int)) / ETHER_ADDR_LEN
|
|
|
|
/* SCAN modes */
|
|
#define DOT11_SCANTYPE_ACTIVE 0
|
|
#define DOT11_SCANTYPE_PASSIVE 1
|
|
|
|
/* Power Scale Factors. For (%) values of max power (qdBm of 127 for BCM),
|
|
* the following formula determines the (closest) qdBm value to use
|
|
* 4 * (30 + 10 * log[10](MAX_TX_PWR * val_percent / 1000))
|
|
*/
|
|
#define DOT11_TXPOWER_MAX 127
|
|
#define DOT11_TXPOWER_66 120
|
|
#define DOT11_TXPOWER_50 115
|
|
#define DOT11_TXPOWER_33 108
|
|
#define DOT11_TXPOWER_MIN 103
|
|
|
|
/* MLME Enumerations */
|
|
#define DOT11_BSSTYPE_ANY 2 /* d11 any BSS type */
|
|
|
|
#define WLC_UP 2
|
|
#define WLC_DOWN 3
|
|
#define WLC_GET_MSGLEVEL 7
|
|
#define WLC_SET_MSGLEVEL 8
|
|
#define WLC_GET_RATE 12
|
|
#define WLC_GET_INFRA 19
|
|
#define WLC_SET_INFRA 20
|
|
#define WLC_GET_AUTH 21
|
|
#define WLC_SET_AUTH 22
|
|
#define WLC_GET_BSSID 23
|
|
#define WLC_SET_BSSID 24
|
|
#define WLC_GET_SSID 25
|
|
#define WLC_SET_SSID 26
|
|
#define WLC_GET_CHANNEL 29
|
|
#define WLC_SET_CHANNEL 30
|
|
#define WLC_GET_SRL 31
|
|
#define WLC_SET_SRL 32
|
|
#define WLC_GET_LRL 33
|
|
#define WLC_SET_LRL 34
|
|
#define WLC_GET_KEY 44
|
|
#define WLC_SET_KEY 45
|
|
#define WLC_GET_REGULATORY 46
|
|
#define WLC_SET_REGULATORY 47
|
|
#define WLC_GET_PASSIVE_SCAN 48
|
|
#define WLC_SET_PASSIVE_SCAN 49
|
|
#define WLC_SCAN 50
|
|
#define WLC_SCAN_RESULTS 51
|
|
#define WLC_DISASSOC 52
|
|
#define WLC_GET_CLOSED 67
|
|
#define WLC_SET_CLOSED 68
|
|
#define WLC_GET_MACLIST 69
|
|
#define WLC_SET_MACLIST 70
|
|
#define WLC_GET_RATESET 71
|
|
#define WLC_SET_RATESET 72
|
|
#define WLC_GET_BCNPRD 75
|
|
#define WLC_SET_BCNPRD 76
|
|
#define WLC_GET_COUNTRY 83
|
|
#define WLC_SET_COUNTRY 84
|
|
#define WLC_GET_PM 85
|
|
#define WLC_SET_PM 86
|
|
#define WLC_GET_REVINFO 98
|
|
#define WLC_GET_MACMODE 105
|
|
#define WLC_SET_MACMODE 106
|
|
#define WLC_GET_GMODE 109
|
|
#define WLC_SET_GMODE 110
|
|
#define WLC_GET_CURR_RATESET 114
|
|
#define WLC_GET_AP 117
|
|
#define WLC_SET_AP 118
|
|
#define WLC_SET_EAP_RESTRICT 120
|
|
#define WLC_SCB_AUTHORIZE 121
|
|
#define WLC_SCB_DEAUTHORIZE 122
|
|
#define WLC_GET_RSSI 127
|
|
#define WLC_GET_WSEC 133
|
|
#define WLC_SET_WSEC 134
|
|
#define WLC_GET_PHY_NOISE 135
|
|
#define WLC_GET_BSS_INFO 136
|
|
#define WLC_GET_BANDLIST 140
|
|
#define WLC_GET_BAND 141
|
|
#define WLC_SET_BAND 142
|
|
#define WLC_GET_WPA_AUTH 164
|
|
#define WLC_SET_WPA_AUTH 165
|
|
#define WLC_GET_VALID_CHANNELS 217
|
|
#define WLC_SCB_DEAUTHENTICATE_FOR_REASON 201
|
|
#define WLC_GET_KEY_PRIMARY 235
|
|
#define WLC_SET_KEY_PRIMARY 236
|
|
#define WLC_SET_WSEC_PMK 268 /* hfc added */
|
|
#define WLC_GET_CHANNELS_IN_COUNTRY 260
|
|
#define WLC_GET_VAR 262 /* get value of named variable */
|
|
#define WLC_SET_VAR 263 /* set named variable to value */
|
|
#define WLC_TKIP_CM 284
|
|
#define WLC_GET_MCASTENCRYPTTYPE 285
|
|
|
|
#define WLC_IOVAR_BGRATE "bg_rate"
|
|
#define WLC_IOVAR_ARATE "a_rate"
|
|
#define WLC_IOVAR_FRAGTHRESH "fragthresh"
|
|
#define WLC_IOVAR_RTSTHRESH "rtsthresh"
|
|
#define WLC_IOVAR_NRATE "nrate"
|
|
#define WLC_IOVAR_NMODE "nmode"
|
|
#define WLC_IOVAR_TXPWR "qtxpower"
|
|
#define WLC_IOVAR_VLAN "bss"
|
|
#define WLC_IOVAR_BSSIDX "bssidx"
|
|
#define WLC_IOVAR_BSSADD "bssadd"
|
|
#define WLC_IOVAR_BSSDEL "bssdel"
|
|
#define WLC_IOVAR_SSID "ssid"
|
|
#define WLC_IOVAR_WSEC "wsec"
|
|
#define WLC_IOVAR_WSEC_KEY "wsec_key"
|
|
#define WLC_IOVAR_BSSID "bssid"
|
|
#define WLC_IOVAR_AUTH "auth"
|
|
#define WLC_IOVAR_WPA_AUTH "wpa_auth"
|
|
#define WLC_IOVAR_COUNTERS "counters"
|
|
#define WLC_IOVAR_MBSS "mbss"
|
|
#define WLC_IOVAR_AUTH_WPA "auth_wpa"
|
|
#define WLC_IOVAR_SUPP_WPA "sup_wpa"
|
|
#define WLC_IOVAR_WSEC_PMK "set_pmk"
|
|
#define WLC_IOVAR_MIMOTXBW "mimo_txbw"
|
|
#define WLC_IOVAR_CHANNELMIMO "chanspec"
|
|
#define WLC_IOVAR_WPACAP "wpa_cap"
|
|
#define WLC_IOVAR_WMM "wme"
|
|
#define WLC_IOVAR_WMM_AC_AP "wme_ac_ap"
|
|
#define WLC_IOVAR_WMM_AC_STA "wme_ac_sta"
|
|
#define WLC_IOVAR_VNDR_IE "vndr_ie"
|
|
|
|
/* WPA authentication mode bitvec */
|
|
#define WPA_AUTH_DISABLED 0x0000 /* Legacy (i.e., non-WPA) */
|
|
#define WPA_AUTH_NONE 0x0001 /* none (IBSS) */
|
|
#define WPA_AUTH_UNSPECIFIED 0x0002 /* over 802.1x */
|
|
#define WPA_AUTH_PSK 0x0004 /* Pre-shared key */
|
|
#define WPA2_AUTH_UNSPECIFIED 0x0040 /* over 802.1x */
|
|
#define WPA2_AUTH_PSK 0x0080 /* Pre-shared key */
|
|
|
|
/* Enumerate crypto algorithms */
|
|
#define CRYPTO_ALGO_OFF 0
|
|
#define CRYPTO_ALGO_WEP1 1
|
|
#define CRYPTO_ALGO_TKIP 2
|
|
#define CRYPTO_ALGO_WEP128 3
|
|
#define CRYPTO_ALGO_AES_CCM 4
|
|
#define CRYPTO_ALGO_AES_OCB_MSDU 5
|
|
#define CRYPTO_ALGO_AES_OCB_MPDU 6
|
|
#define CRYPTO_ALGO_NALG 7
|
|
|
|
/* Radio mode types */
|
|
#define GMODE_LEGACY_B 0
|
|
#define GMODE_AUTO 1
|
|
#define GMODE_ONLY 2
|
|
#define GMODE_B_DEFERRED 3
|
|
#define GMODE_PERFORMANCE 4
|
|
#define GMODE_LRS 5
|
|
#define GMODE_MAX 6
|
|
|
|
/* Supported bands */
|
|
#define WLC_BAND_AUTO 0
|
|
#define WLC_BAND_5G 1
|
|
#define WLC_BAND_2G 2
|
|
|
|
/* WPA cipher suites */
|
|
#define WPA_CIPHER_NONE 0 /* None */
|
|
#define WPA_CIPHER_WEP_40 1 /* WEP (40-bit) */
|
|
#define WPA_CIPHER_TKIP 2 /* TKIP: default for WPA */
|
|
#define WPA_CIPHER_AES_OCB 3 /* AES (OCB) */
|
|
#define WPA_CIPHER_AES_CCM 4 /* AES (CCM) */
|
|
#define WPA_CIPHER_WEP_104 5 /* WEP (104-bit) */
|
|
|
|
/* Country string is 3 bytes + NULL */
|
|
#define WLC_CNTRY_BUF_SZ 4
|
|
|
|
/* max length ioctl buffer required */
|
|
#define WLC_IOCTL_MAXLEN 8192
|
|
|
|
/* "small" length ioctl buffer required */
|
|
#define WLC_IOCTL_SMLEN 256
|
|
|
|
/* defines used by the nrate iovar */
|
|
#define NRATE_MCS_INUSE 0x00000080 /* MSC in use,indicates b0-6 holds an mcs */
|
|
#define NRATE_RATE_MASK 0x0000007f /* rate/mcs value */
|
|
#define NRATE_STF_MASK 0x0000ff00 /* stf mode mask: siso, cdd, stbc, sdm */
|
|
#define NRATE_STF_SHIFT 8 /* stf mode shift */
|
|
#define NRATE_OVERRIDE 0x80000000 /* bit indicate override both rate & mode */
|
|
#define NRATE_STF_SISO 0 /* stf mode SISO */
|
|
#define NRATE_STF_CDD 1 /* stf mode CDD */
|
|
#define NRATE_STF_STBC 2 /* stf mode STBC */
|
|
#define NRATE_STF_SDM 3 /* stf mode SDM */
|
|
#define NRATE_MIN_MIMO_MCS 7 /* MCS values greater than this enable multiple streams */
|
|
|
|
#define WLC_BSSMOD_ADD 1
|
|
#define WLC_BSSMOD_DEL 2
|
|
|
|
#define WLC_MIMO_20MHZ_LOWER 2
|
|
#define WLC_MIMO_20MHZ_UPPER 3
|
|
#define WLC_MIMO_40MHZ 4
|
|
|
|
#define WL_PRIMARY_KEY (1 << 1)
|
|
|
|
/* Debug levels */
|
|
#define WL_DEBUG_NONE 0x00000000
|
|
#define WL_ERROR_VAL 0x00000001
|
|
#define WL_TRACE_VAL 0x00000002
|
|
#define WL_PRHDRS_VAL 0x00000004
|
|
#define WL_PRPKT_VAL 0x00000008
|
|
#define WL_INFORM_VAL 0x00000010
|
|
#define WL_TMP_VAL 0x00000020
|
|
#define WL_OID_VAL 0x00000040
|
|
#define WL_RATE_VAL 0x00000080
|
|
#define WL_ASSOC_VAL 0x00000100
|
|
#define WL_PRUSR_VAL 0x00000200
|
|
#define WL_PS_VAL 0x00000400
|
|
#define WL_TXPWR_VAL 0x00000800
|
|
#define WL_GMODE_VAL 0x00001000
|
|
#define WL_DUAL_VAL 0x00002000
|
|
#define WL_WSEC_VAL 0x00004000
|
|
#define WL_WSEC_DUMP_VAL 0x00008000
|
|
#define WL_LOG_VAL 0x00010000
|
|
#define WL_NRSSI_VAL 0x00020000
|
|
#define WL_LOFT_VAL 0x00040000
|
|
#define WL_REGULATORY_VAL 0x00080000
|
|
#define WL_PHYCAL_VAL 0x00100000
|
|
#define WL_RADAR_VAL 0x00200000
|
|
#define WL_MPC_VAL 0x00400000
|
|
#define WL_APSTA_VAL 0x00800000
|
|
#define WL_DFS_VAL 0x01000000
|
|
#define WL_BA_VAL 0x02000000
|
|
#define WL_MBSS_VAL 0x04000000
|
|
#define WL_CAC_VAL 0x08000000
|
|
#define WL_AMSDU_VAL 0x10000000
|
|
#define WL_AMPDU_VAL 0x20000000
|
|
#define WL_FFPLD_VAL 0x40000000
|
|
|
|
|
|
/* 802.11 Mgmt Packet flags */
|
|
#define VNDR_IE_BEACON_FLAG 0x1
|
|
#define VNDR_IE_PRBRSP_FLAG 0x2
|
|
#define VNDR_IE_ASSOCRSP_FLAG 0x4
|
|
#define VNDR_IE_AUTHRSP_FLAG 0x8
|
|
#define VNDR_IE_PRBREQ_FLAG 0x10
|
|
#define VNDR_IE_ASSOCREQ_FLAG 0x20
|
|
|
|
#define VNDR_IE_HDR_LEN 2 /* id + len field */
|
|
#define VNDR_IE_MIN_LEN 3 /* size of the oui field */
|
|
#define VNDR_IE_MAX_LEN 256 /* verdor IE max length */
|
|
#define VNDR_IE_CMD_LENGTH 4 /* length of the set command string:
|
|
* "add", "del" (+ NULL)
|
|
*/
|
|
|
|
#define BCM_SES_OW_ENABLED 0x0040 /* to go into transition mode without setting wep */
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
typedef signed char int8;
|
|
typedef unsigned char uchar;
|
|
typedef unsigned char uint8;
|
|
typedef signed short int int16;
|
|
typedef unsigned short int uint16;
|
|
typedef unsigned int uint;
|
|
typedef signed long int int32;
|
|
typedef unsigned long int uint32;
|
|
|
|
typedef unsigned int bool;
|
|
typedef uint16 chanspec_t;
|
|
|
|
#include <ipcom_align16.h>
|
|
IP_PACKED1 struct ether_addr
|
|
{
|
|
uint8 ea[6];
|
|
} IP_PACKED2;
|
|
#include <ipcom_align16.h>
|
|
|
|
|
|
#include <ipcom_align16.h>
|
|
typedef IP_PACKED1 struct wl_wsec_key
|
|
{
|
|
uint32 index; /* key index */
|
|
uint32 len; /* key length */
|
|
uint8 data[DOT11_MAX_KEY_SIZE]; /* key data */
|
|
uint32 algo; /* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
|
|
uint32 flags; /* misc flags */
|
|
int iv_initialized; /* has IV been initialized already? */
|
|
/* Rx IV */
|
|
struct {
|
|
uint32 hi; /* upper 32 bits of IV */
|
|
uint16 lo; /* lower 16 bits of IV */
|
|
uint16 pad;
|
|
} rxiv;
|
|
struct ether_addr ea; /* per station */
|
|
} IP_PACKED2 wl_wsec_key_t;
|
|
#include <ipcom_align16.h>
|
|
|
|
/* hfc */
|
|
typedef struct {
|
|
Ip_u16 key_len; /* octets in key material */
|
|
Ip_u16 flags; /* key handling qualification */
|
|
uint8 key[DOT11_MAX_KEY_SIZE*2]; /* PMK material */
|
|
struct ether_addr ea;
|
|
} wsec_pmk_t;
|
|
#define WSEC_PASSPHRASE (1<<0)
|
|
|
|
/* hfc end */
|
|
/* channel encoding */
|
|
typedef struct channel_info
|
|
{
|
|
int hw_channel;
|
|
int target_channel;
|
|
int scan_channel;
|
|
} channel_info_t;
|
|
|
|
#include <ipcom_align16.h>
|
|
typedef IP_PACKED1 struct wlc_ssid
|
|
{
|
|
uint32 SSID_len;
|
|
uchar SSID[32];
|
|
} IP_PACKED2 wlc_ssid_t;
|
|
#include <ipcom_align16.h>
|
|
|
|
|
|
#if defined(__GNUC__)
|
|
#define PACKED __attribute__((packed))
|
|
#else
|
|
#pragma pack(1)
|
|
#define PACKED
|
|
#endif
|
|
|
|
typedef struct wl_scan_params
|
|
{
|
|
wlc_ssid_t ssid; /* default: {0, ""} */
|
|
struct ether_addr bssid; /* default: bcast */
|
|
int8 bss_type; /* default: any,
|
|
* DOT11_BSSTYPE_ANY/INFRASTRUCTURE/INDEPENDENT
|
|
*/
|
|
int8 scan_type; /* -1 use default, DOT11_SCANTYPE_ACTIVE/PASSIVE */
|
|
int32 nprobes; /* -1 use default, number of probes per channel */
|
|
int32 active_time; /* -1 use default, dwell time per channel for
|
|
* active scanning
|
|
*/
|
|
int32 passive_time; /* -1 use default, dwell time per channel
|
|
* for passive scanning
|
|
*/
|
|
int32 home_time; /* -1 use default, dwell time for the home channel
|
|
* between channel scans
|
|
*/
|
|
int32 channel_num; /* 0 use default (all available channels), count of
|
|
* channels in channel_list
|
|
*/
|
|
uint16 channel_list[1]; /* list of chanspecs */
|
|
} PACKED wl_scan_params_t;
|
|
#undef PACKED
|
|
#if !defined(__GNUC__)
|
|
#pragma pack(0,0,0)
|
|
#endif
|
|
|
|
typedef struct wl_bss_info
|
|
{
|
|
uint32 version; /* version field */
|
|
uint32 length; /* byte length of data in this record,
|
|
* starting at version and including IEs
|
|
*/
|
|
struct ether_addr BSSID;
|
|
uint16 beacon_period; /* units are Kusec */
|
|
uint16 capability; /* Capability information */
|
|
uint8 SSID_len;
|
|
uint8 SSID[32];
|
|
struct
|
|
{
|
|
uint count; /* # rates in this set */
|
|
uint8 rates[16]; /* rates in 500kbps units w/hi bit set if basic */
|
|
} rateset; /* supported rates */
|
|
chanspec_t chanspec; /* chanspec for bss */
|
|
uint16 atim_window; /* units are Kusec */
|
|
uint8 dtim_period; /* DTIM period */
|
|
int16 RSSI; /* receive signal strength (in dBm) */
|
|
int8 phy_noise; /* noise (in dBm) */
|
|
|
|
bool n_cap; /* BSS is 802.11N Capable */
|
|
uint32 nbss_cap; /* 802.11N BSS Capabilities (based on EWC_CAP_*) */
|
|
uint8 ctl_ch; /* 802.11N BSS control channel number */
|
|
uint32 reserved[2]; /* Reserved for expansion of BSS properties */
|
|
uint8 basic_mcs[MCSSET_LEN]; /* 802.11N BSS required MCS set */
|
|
|
|
uint16 ie_offset; /* offset at which IEs start, from beginning */
|
|
uint32 ie_length; /* byte length of Information Elements */
|
|
/* Add new fields here */
|
|
/* variable length Information Elements */
|
|
} wl_bss_info_t;
|
|
|
|
typedef struct wl_scan_results
|
|
{
|
|
uint32 buflen;
|
|
uint32 version;
|
|
uint32 count;
|
|
wl_bss_info_t bss_info[1];
|
|
} wl_scan_results_t;
|
|
|
|
typedef struct
|
|
{
|
|
uint32 val;
|
|
struct ether_addr ea;
|
|
} scb_val_t;
|
|
|
|
typedef struct wlc_rev_info
|
|
{
|
|
uint vendorid;
|
|
uint deviceid;
|
|
uint radiorev;
|
|
uint chiprev;
|
|
uint corerev;
|
|
uint boardid;
|
|
uint boardvendor;
|
|
uint boardrev;
|
|
uint driverrev;
|
|
uint ucoderev;
|
|
uint bus;
|
|
uint chipnum;
|
|
} wlc_rev_info_t;
|
|
|
|
typedef struct wl_rateset {
|
|
uint32 count; /* # rates in this set */
|
|
uint8 rates[MAX_NUMRATES]; /* rates in 500kbps units w/hi bit set if basic */
|
|
uint8 mcs[MCSSET_LEN]; /* supported mcs index bit map */
|
|
} wl_rateset_t;
|
|
|
|
typedef struct wl_uint32_list {
|
|
uint32 count;
|
|
uint32 element[1];
|
|
} wl_uint32_list_t;
|
|
|
|
typedef struct wl_channels_in_country {
|
|
uint32 buflen;
|
|
uint32 band;
|
|
char country_abbrev[WLC_CNTRY_BUF_SZ];
|
|
uint32 count;
|
|
uint32 channel[WLC_IOCTL_SMLEN];
|
|
} wl_channels_in_country_t;
|
|
|
|
typedef struct wl_maclist {
|
|
uint count; /* number of MAC addresses */
|
|
struct ether_addr ea[1]; /* variable length array of MAC addresses */
|
|
} wl_maclist_t;
|
|
|
|
typedef struct {
|
|
uint16 version;
|
|
uint16 length; /* length of entire structure */
|
|
|
|
/* transmit stat counters */
|
|
uint32 txframe; /* tx data frames */
|
|
uint32 txbyte; /* tx data bytes */
|
|
uint32 txretrans; /* tx mac retransmits */
|
|
uint32 txerror; /* tx data errors (derived: sum of others) */
|
|
uint32 txctl; /* tx management frames */
|
|
uint32 txprshort; /* tx short preamble frames */
|
|
uint32 txserr; /* tx status errors */
|
|
uint32 txnobuf; /* tx out of buffers errors */
|
|
uint32 txnoassoc; /* tx discard because we're not associated */
|
|
uint32 txrunt; /* tx runt frames */
|
|
uint32 txchit; /* tx header cache hit (fastpath) */
|
|
uint32 txcmiss; /* tx header cache miss (slowpath) */
|
|
|
|
/* transmit chip error counters */
|
|
uint32 txuflo; /* tx fifo underflows */
|
|
uint32 txphyerr; /* tx phy errors (indicated in tx status) */
|
|
uint32 txphycrs;
|
|
|
|
/* receive stat counters */
|
|
uint32 rxframe; /* rx data frames */
|
|
uint32 rxbyte; /* rx data bytes */
|
|
uint32 rxerror; /* rx data errors (derived: sum of others) */
|
|
uint32 rxctl; /* rx management frames */
|
|
uint32 rxnobuf; /* rx out of buffers errors */
|
|
uint32 rxnondata; /* rx non data frames in the data channel errors */
|
|
uint32 rxbadds; /* rx bad DS errors */
|
|
uint32 rxbadcm; /* rx bad control or management frames */
|
|
uint32 rxfragerr; /* rx fragmentation errors */
|
|
uint32 rxrunt; /* rx runt frames */
|
|
uint32 rxgiant; /* rx giant frames */
|
|
uint32 rxnoscb; /* rx no scb error */
|
|
uint32 rxbadproto; /* rx invalid frames */
|
|
uint32 rxbadsrcmac; /* rx frames with Invalid Src Mac */
|
|
uint32 rxbadda; /* rx frames tossed for invalid da */
|
|
uint32 rxfilter; /* rx frames filtered out */
|
|
|
|
/* receive chip error counters */
|
|
uint32 rxoflo; /* rx fifo overflow errors */
|
|
uint32 rxuflo[NFIFO]; /* rx dma descriptor underflow errors */
|
|
|
|
uint32 d11cnt_txrts_off; /* d11cnt txrts value when reset d11cnt */
|
|
uint32 d11cnt_rxcrc_off; /* d11cnt rxcrc value when reset d11cnt */
|
|
uint32 d11cnt_txnocts_off; /* d11cnt txnocts value when reset d11cnt */
|
|
|
|
/* misc counters */
|
|
uint32 dmade; /* tx/rx dma descriptor errors */
|
|
uint32 dmada; /* tx/rx dma data errors */
|
|
uint32 dmape; /* tx/rx dma descriptor protocol errors */
|
|
uint32 reset; /* reset count */
|
|
uint32 tbtt; /* cnts the TBTT int's */
|
|
uint32 txdmawar;
|
|
uint32 pkt_callback_reg_fail; /* callbacks register failure */
|
|
|
|
/* MAC counters: 32-bit version of d11.h's macstat_t */
|
|
uint32 txallfrm; /* total number of frames sent, incl. Data, ACK, RTS, CTS,
|
|
* Control Management (includes retransmissions)
|
|
*/
|
|
uint32 txrtsfrm; /* number of RTS sent out by the MAC */
|
|
uint32 txctsfrm; /* number of CTS sent out by the MAC */
|
|
uint32 txackfrm; /* number of ACK frames sent out */
|
|
uint32 txdnlfrm; /* Not used */
|
|
uint32 txbcnfrm; /* beacons transmitted */
|
|
uint32 txfunfl[8]; /* per-fifo tx underflows */
|
|
uint32 txtplunfl; /* Template underflows (mac was too slow to transmit ACK/CTS
|
|
* or BCN)
|
|
*/
|
|
uint32 txphyerror; /* Transmit phy error, type of error is reported in tx-status for
|
|
* driver enqueued frames
|
|
*/
|
|
uint32 rxfrmtoolong; /* Received frame longer than legal limit (2346 bytes) */
|
|
uint32 rxfrmtooshrt; /* Received frame did not contain enough bytes for its frame type */
|
|
uint32 rxinvmachdr; /* Either the protocol version != 0 or frame type not
|
|
* data/control/management
|
|
*/
|
|
uint32 rxbadfcs; /* number of frames for which the CRC check failed in the MAC */
|
|
uint32 rxbadplcp; /* parity check of the PLCP header failed */
|
|
uint32 rxcrsglitch; /* PHY was able to correlate the preamble but not the header */
|
|
uint32 rxstrt; /* Number of received frames with a good PLCP
|
|
* (i.e. passing parity check)
|
|
*/
|
|
uint32 rxdfrmucastmbss; /* Number of received DATA frames with good FCS and matching RA */
|
|
uint32 rxmfrmucastmbss; /* number of received mgmt frames with good FCS and matching RA */
|
|
uint32 rxcfrmucast; /* number of received CNTRL frames with good FCS and matching RA */
|
|
uint32 rxrtsucast; /* number of unicast RTS addressed to the MAC (good FCS) */
|
|
uint32 rxctsucast; /* number of unicast CTS addressed to the MAC (good FCS) */
|
|
uint32 rxackucast; /* number of ucast ACKS received (good FCS) */
|
|
uint32 rxdfrmocast; /* number of received DATA frames (good FCS and not matching RA) */
|
|
uint32 rxmfrmocast; /* number of received MGMT frames (good FCS and not matching RA) */
|
|
uint32 rxcfrmocast; /* number of received CNTRL frame (good FCS and not matching RA) */
|
|
uint32 rxrtsocast; /* number of received RTS not addressed to the MAC */
|
|
uint32 rxctsocast; /* number of received CTS not addressed to the MAC */
|
|
uint32 rxdfrmmcast; /* number of RX Data multicast frames received by the MAC */
|
|
uint32 rxmfrmmcast; /* number of RX Management multicast frames received by the MAC */
|
|
uint32 rxcfrmmcast; /* number of RX Control multicast frames received by the MAC
|
|
* (unlikely to see these)
|
|
*/
|
|
uint32 rxbeaconmbss; /* beacons received from member of BSS */
|
|
uint32 rxdfrmucastobss; /* number of unicast frames addressed to the MAC from
|
|
* other BSS (WDS FRAME)
|
|
*/
|
|
uint32 rxbeaconobss; /* beacons received from other BSS */
|
|
uint32 rxrsptmout; /* Number of response timeouts for transmitted frames
|
|
* expecting a response
|
|
*/
|
|
uint32 bcntxcancl; /* transmit beacons canceled due to receipt of beacon (IBSS) */
|
|
uint32 rxf0ovfl; /* Number of receive fifo 0 overflows */
|
|
uint32 rxf1ovfl; /* Number of receive fifo 1 overflows (obsolete) */
|
|
uint32 rxf2ovfl; /* Number of receive fifo 2 overflows (obsolete) */
|
|
uint32 txsfovfl; /* Number of transmit status fifo overflows (obsolete) */
|
|
uint32 pmqovfl; /* Number of PMQ overflows */
|
|
uint32 rxcgprqfrm; /* Number of received Probe requests that made it into
|
|
* the PRQ fifo
|
|
*/
|
|
uint32 rxcgprsqovfl; /* Rx Probe Request Que overflow in the AP */
|
|
uint32 txcgprsfail; /* Tx Probe Response Fail. AP sent probe response but did
|
|
* not get ACK
|
|
*/
|
|
uint32 txcgprssuc; /* Tx Probe Response Success (ACK was received) */
|
|
uint32 prs_timeout; /* Number of probe requests that were dropped from the PRQ
|
|
* fifo because a probe response could not be sent out within
|
|
* the time limit defined in M_PRS_MAXTIME
|
|
*/
|
|
uint32 rxnack; /* Number of NACKS received (Afterburner) */
|
|
uint32 frmscons; /* Number of frames completed without transmission because of an
|
|
* Afterburner re-queue
|
|
*/
|
|
uint32 txnack; /* Number of NACKs transmitted (Afterburner) */
|
|
uint32 txglitch_nack; /* obsolete */
|
|
uint32 txburst; /* obsolete */
|
|
|
|
/* 802.11 MIB counters, pp. 614 of 802.11 reaff doc. */
|
|
uint32 txfrag; /* dot11TransmittedFragmentCount */
|
|
uint32 txmulti; /* dot11MulticastTransmittedFrameCount */
|
|
uint32 txfail; /* dot11FailedCount */
|
|
uint32 txretry; /* dot11RetryCount */
|
|
uint32 txretrie; /* dot11MultipleRetryCount */
|
|
uint32 rxdup; /* dot11FrameduplicateCount */
|
|
uint32 txrts; /* dot11RTSSuccessCount */
|
|
uint32 txnocts; /* dot11RTSFailureCount */
|
|
uint32 txnoack; /* dot11ACKFailureCount */
|
|
uint32 rxfrag; /* dot11ReceivedFragmentCount */
|
|
uint32 rxmulti; /* dot11MulticastReceivedFrameCount */
|
|
uint32 rxcrc; /* dot11FCSErrorCount */
|
|
uint32 txfrmsnt; /* dot11TransmittedFrameCount (bogus MIB?) */
|
|
uint32 rxundec; /* dot11WEPUndecryptableCount */
|
|
|
|
/* WPA2 counters (see rxundec for DecryptFailureCount) */
|
|
uint32 tkipmicfaill; /* TKIPLocalMICFailures */
|
|
uint32 tkipcntrmsr; /* TKIPCounterMeasuresInvoked */
|
|
uint32 tkipreplay; /* TKIPReplays */
|
|
uint32 ccmpfmterr; /* CCMPFormatErrors */
|
|
uint32 ccmpreplay; /* CCMPReplays */
|
|
uint32 ccmpundec; /* CCMPDecryptErrors */
|
|
uint32 fourwayfail; /* FourWayHandshakeFailures */
|
|
uint32 wepundec; /* dot11WEPUndecryptableCount */
|
|
uint32 wepicverr; /* dot11WEPICVErrorCount */
|
|
uint32 decsuccess; /* DecryptSuccessCount */
|
|
uint32 tkipicverr; /* TKIPICVErrorCount */
|
|
uint32 wepexcluded; /* dot11WEPExcludedCount */
|
|
|
|
uint32 txchanrej; /* Tx frames suppressed due to channel rejection */
|
|
uint32 psmwds; /* Count PSM watchdogs */
|
|
uint32 phywatchdog; /* Count Phy watchdogs (triggered by ucode) */
|
|
|
|
/* MBSS counters, AP only */
|
|
uint32 prq_entries_handled; /* PRQ entries read in */
|
|
uint32 prq_undirected_entries; /* which were bcast bss & ssid */
|
|
uint32 prq_bad_entries; /* which could not be translated to info */
|
|
uint32 atim_suppress_count; /* TX suppressions on ATIM fifo */
|
|
uint32 bcn_template_not_ready; /* Template marked in use on send bcn ... */
|
|
uint32 bcn_template_not_ready_done; /* ...but "DMA done" interrupt rcvd */
|
|
uint32 late_tbtt_dpc; /* TBTT DPC did not happen in time */
|
|
} wl_cnt_t;
|
|
|
|
|
|
/* ACI */
|
|
#define EDCF_AIFSN_MIN 1 /* AIFSN minimum value */
|
|
#define EDCF_AIFSN_MAX 15 /* AIFSN maximum value */
|
|
#define EDCF_AIFSN_MASK 0x0f /* AIFSN mask */
|
|
#define EDCF_ACM_MASK 0x10 /* ACM mask */
|
|
#define EDCF_ACI_MASK 0x60 /* ACI mask */
|
|
#define EDCF_ACI_SHIFT 5 /* ACI shift */
|
|
|
|
/* ECW */
|
|
#define EDCF_ECW_MIN 0 /* cwmin/cwmax exponent minimum value */
|
|
#define EDCF_ECW_MAX 15 /* cwmin/cwmax exponent maximum value */
|
|
#define EDCF_ECW2CW(exp) ((1 << (exp)) - 1)
|
|
#define EDCF_ECWMIN_MASK 0x0f /* cwmin exponent form mask */
|
|
#define EDCF_ECWMAX_MASK 0xf0 /* cwmax exponent form mask */
|
|
#define EDCF_ECWMAX_SHIFT 4 /* cwmax exponent form shift */
|
|
|
|
/* TXOP */
|
|
#define EDCF_TXOP_MIN 0 /* TXOP minimum value */
|
|
#define EDCF_TXOP_MAX 65535 /* TXOP maximum value */
|
|
#define EDCF_TXOP2USEC(txop) ((txop) << 5)
|
|
|
|
|
|
#include <ipcom_align16.h>
|
|
typedef IP_PACKED1 struct {
|
|
Ip_u8 ACI;
|
|
Ip_u8 ECW;
|
|
Ip_u16 TXOP; /* stored in network order (ls octet first) */
|
|
} IP_PACKED2
|
|
edcf_acparam_t;
|
|
#include <ipcom_align16.h>
|
|
|
|
#include <ipcom_align16.h>
|
|
/* Vendor IE structure */
|
|
typedef IP_PACKED1 struct{
|
|
|
|
uchar id;
|
|
uchar len;
|
|
|
|
Ip_u8 oui[1];
|
|
/* uchar data [1]; */ /* Variable size data */
|
|
}IP_PACKED2
|
|
bcm_vndr_ie_t;
|
|
#include <ipcom_align16.h>
|
|
|
|
typedef struct {
|
|
uint32 pktflag; /* bitmask indicating which packet(s) contain this IE */
|
|
bcm_vndr_ie_t vndr_ie_data; /* vendor IE data */
|
|
} ie_info_t;
|
|
|
|
typedef struct {
|
|
int iecount; /* number of entries in the vndr_ie_list[] array */
|
|
ie_info_t vndr_ie_list[1]; /* variable size list of vndr_ie_info_t structs */
|
|
} ie_buffer_t;
|
|
|
|
typedef struct {
|
|
char cmd[VNDR_IE_CMD_LENGTH]; /* vndr_ie IOVar set command : "add", "del" + NULL */
|
|
ie_buffer_t vndr_ie_buffer; /* buffer containing Vendor IE list information */
|
|
} vndr_ie_cmd_buf;
|
|
|
|
/* IE */
|
|
|
|
#include <ipcom_align16.h>
|
|
/* Must match DOT1X_PORTSTATUS in "dot1xCommonIoctls.h" */
|
|
typedef IP_PACKED1 struct {
|
|
Ip_u32 status;
|
|
Ip_u8 macAddr[6];
|
|
} IP_PACKED2
|
|
DOT1X_PORTSTATUS;
|
|
#include <ipcom_align16.h>
|
|
|
|
/* 802.1X port status enumeration. Must match what's in "dot1xCommonIoctls.h"*/
|
|
typedef enum
|
|
{
|
|
DOT1X_PORTSTATUS_UNCONTROLLED = 0,
|
|
DOT1X_PORTSTATUS_CLOSED,
|
|
DOT1X_PORTSTATUS_OPEN
|
|
} DOT1X_PORT_STATUS;
|
|
|
|
#include <ipcom_align16.h>
|
|
/* Must match DOT1X_PARAMS defined value in "dot1xCommonIoctls.h" */
|
|
typedef IP_PACKED1 struct {
|
|
Ip_u32 callback; /* Callback event handler */
|
|
Ip_u32 cookie; /* private data */
|
|
} IP_PACKED2
|
|
BCM_CALLBACK_PARAMS;
|
|
#include <ipcom_align16.h>
|
|
|
|
#if 0
|
|
typedef struct {
|
|
Ip_u32 callback; /* Callback event handler */
|
|
Ip_u16 cookie1; /* private data1 */
|
|
Ip_u16 cookie2; /* private data 2 */
|
|
}BCM_DRV_CALLBACK_PARAMS;
|
|
#endif
|
|
|
|
|
|
/* used for association with a specific BSSID and chanspec list */
|
|
#include <ipcom_align16.h>
|
|
typedef IP_PACKED1 struct wl_assoc_params {
|
|
struct ether_addr bssid; /* 00:00:00:00:00:00: broadcast scan */
|
|
Ip_u32 chanspec_num; /* 0: all available channels,
|
|
* otherwise count of chanspecs in chanspec_list
|
|
*/
|
|
chanspec_t chanspec_list[1]; /* list of chanspecs */
|
|
} IP_PACKED2
|
|
wl_assoc_params_t;
|
|
#include <ipcom_align16.h>
|
|
#define WL_ASSOC_PARAMS_FIXED_SIZE (sizeof(wl_assoc_params_t) - sizeof(chanspec_t))
|
|
|
|
/* used for reassociation/roam to a specific BSSID and channel */
|
|
typedef wl_assoc_params_t wl_reassoc_params_t;
|
|
#define WL_REASSOC_PARAMS_FIXED_SIZE WL_ASSOC_PARAMS_FIXED_SIZE
|
|
|
|
/* used for join with or without a specific bssid and channel list */
|
|
typedef struct wl_join_params {
|
|
wlc_ssid_t ssid;
|
|
wl_assoc_params_t params; /* optional field, but it must include the fixed portion
|
|
* of the wl_assoc_params_t struct when it does present.
|
|
*/
|
|
} wl_join_params_t;
|
|
#define WL_JOIN_PARAMS_FIXED_SIZE (sizeof(wl_join_params_t) - sizeof(chanspec_t))
|
|
#define BSS_JOIN_MAX_WAIT_SEC 30
|
|
|
|
#define BCM_IOCPARM_MASK 0xfff /* parameters must be < 4096 bytes */
|
|
#define BCM_IOC_IN 0x80000000 /* copy in parameters */
|
|
#define BCM_IOC(inout,group,num,len) \
|
|
((int)(inout | ((len & BCM_IOCPARM_MASK) << 16) | ((group) << 8) | (num)))
|
|
#define BCM_CMN_IOCTL_OFF 0x180
|
|
#define BCM_IOW(g,n,t) BCM_IOC(BCM_IOC_IN, (g), (n), sizeof(t))
|
|
#define WIOCSAUTHCALLBACK BCM_IOW('x', 0x02, BCM_CALLBACK_PARAMS)
|
|
#define WIOCSDRVCALLBACK BCM_IOW('x', 0x05, BCM_CALLBACK_PARAMS)
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|
|
|