/* * Copyright (c) 2013 Eugene Krasnikov <k.eugene.e@gmail.com> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _HAL_H_ #define _HAL_H_
/*--------------------------------------------------------------------------- API VERSIONING INFORMATION
The RIVA API is versioned as MAJOR.MINOR.VERSION.REVISION The MAJOR is incremented for major product/architecture changes (and then MINOR/VERSION/REVISION are zeroed) The MINOR is incremented for minor product/architecture changes (and then VERSION/REVISION are zeroed) The VERSION is incremented if a significant API change occurs (and then REVISION is zeroed) The REVISION is incremented if an insignificant API change occurs or if a new API is added All values are in the range 0..255 (ie they are 8-bit values)
---------------------------------------------------------------------------*/ #define WCN36XX_HAL_VER_MAJOR 1 #define WCN36XX_HAL_VER_MINOR 4 #define WCN36XX_HAL_VER_VERSION 1 #define WCN36XX_HAL_VER_REVISION 2
/* This is to force compiler to use the maximum of an int ( 4 bytes ) */ #define WCN36XX_HAL_MAX_ENUM_SIZE 0x7FFFFFFF #define WCN36XX_HAL_MSG_TYPE_MAX_ENUM_SIZE 0x7FFF
/* Max no. of transmit categories */ #define STACFG_MAX_TC 8
/* The maximum value of access category */ #define WCN36XX_HAL_MAX_AC 4
/* each station added has a rate mode which specifies the sta attributes */ enum sta_rate_mode {
STA_TAURUS = 0,
STA_TITAN,
STA_POLARIS,
STA_11b,
STA_11bg,
STA_11a,
STA_11n,
STA_11ac,
STA_INVALID_RATE_MODE = WCN36XX_HAL_MAX_ENUM_SIZE
};
/* MAX key length when ULA is used */ #define WCN36XX_HAL_MAC_MAX_KEY_LENGTH 32 #define WCN36XX_HAL_MAC_MAX_NUM_OF_DEFAULT_KEYS 4
/* * Enum to specify whether key is used for TX only, RX only or both.
*/ enum ani_key_direction {
WCN36XX_HAL_TX_ONLY,
WCN36XX_HAL_RX_ONLY,
WCN36XX_HAL_TX_RX,
WCN36XX_HAL_TX_DEFAULT,
WCN36XX_HAL_DONOT_USE_KEY_DIRECTION = WCN36XX_HAL_MAX_ENUM_SIZE
};
/* Specify the starting bitrate, 11B and 11A/G rates can be specified in * multiples of 0.5 So for 5.5 mbps => 11. for MCS 0 - 7 rates, Bit 7 should * set to 1 and Bit 0-6 represent the MCS index. so for MCS2 => 130. * Any invalid non-zero value or unsupported rate will set the start rate * to 6 mbps.
*/ #define WCN36XX_HAL_CFG_ENABLE_DYNAMIC_RA_START_RATE 210
/* Message definitons - All the messages below need to be packed */
/* Definition for HAL API Version. */ struct wcnss_wlan_version {
u8 revision;
u8 version;
u8 minor;
u8 major;
} __packed;
/* * set_sta_key_params Moving here since it is shared by * configbss/setstakey msgs
*/ struct wcn36xx_hal_set_sta_key_params { /* STA Index */
u16 sta_index;
/* Encryption Type used with peer */ enum ani_ed_type enc_type;
/* STATIC/DYNAMIC - valid only for WEP */ enum ani_wep_type wep_type;
/* Default WEP key, valid only for static WEP, must between 0 and 3. */
u8 def_wep_idx;
/* valid only for non-static WEP encyrptions */ struct wcn36xx_hal_keys key[WCN36XX_HAL_MAC_MAX_NUM_OF_DEFAULT_KEYS];
/* * Control for Replay Count, 1= Single TID based replay count on Tx * 0 = Per TID based replay count on TX
*/
u8 single_tid_rc;
} __packed;
/* 4-byte control message header used by HAL*/ struct wcn36xx_hal_msg_header { enum wcn36xx_hal_host_msg_type msg_type:16; enum wcn36xx_hal_host_msg_version msg_version:16;
u32 len;
} __packed;
/* Config format required by HAL for each CFG item*/ struct wcn36xx_hal_cfg { /* Cfg Id. The Id required by HAL is exported by HAL
* in shared header file between UMAC and HAL.*/
u16 id;
/* Length of the Cfg. This parameter is used to go to next cfg
* in the TLV format.*/
u16 len;
/* Padding bytes for unaligned address's */
u16 pad_bytes;
/* Reserve bytes for making cfgVal to align address */
u16 reserve;
/* Following the uCfgLen field there should be a 'uCfgLen' bytes
* containing the uCfgValue ; u8 uCfgValue[uCfgLen] */
} __packed;
struct wcn36xx_hal_mac_start_parameters { /* Drive Type - Production or FTM etc */ enum driver_type type;
/* Length of the config buffer */
u32 len;
/* Following this there is a TLV formatted buffer of length * "len" bytes containing all config values. * The TLV is expected to be formatted like this: * 0 15 31 31+CFG_LEN-1 length-1 * | CFG_ID | CFG_LEN | CFG_BODY | CFG_ID |......|
*/
} __packed;
struct wcn36xx_hal_mac_start_req_msg { /* config buffer must start in TLV format just here */ struct wcn36xx_hal_msg_header header; struct wcn36xx_hal_mac_start_parameters params;
} __packed;
struct wcn36xx_hal_mac_start_rsp_params { /* success or failure */
u16 status;
/* Max number of STA supported by the device */
u8 stations;
/* Max number of BSS supported by the device */
u8 bssids;
/* API Version */ struct wcnss_wlan_version version;
/* CRM build information */
u8 crm_version[WCN36XX_HAL_VERSION_LENGTH];
/* hardware/chipset/misc version information */
u8 wlan_version[WCN36XX_HAL_VERSION_LENGTH];
struct wcn36xx_hal_update_cfg_req_msg { /* * Note: The length specified in tHalUpdateCfgReqMsg messages should be * header.msgLen = sizeof(tHalUpdateCfgReqMsg) + uConfigBufferLen
*/ struct wcn36xx_hal_msg_header header;
/* Length of the config buffer. Allows UMAC to update multiple CFGs */
u32 len;
/* * Following this there is a TLV formatted buffer of length * "uConfigBufferLen" bytes containing all config values. * The TLV is expected to be formatted like this: * 0 15 31 31+CFG_LEN-1 length-1 * | CFG_ID | CFG_LEN | CFG_BODY | CFG_ID |......|
*/
/* LEARN - AP Role
SCAN - STA Role */ enum wcn36xx_hal_sys_mode mode;
/* BSSID of the BSS */
u8 bssid[ETH_ALEN];
/* Whether BSS needs to be notified */
u8 notify;
/* Kind of frame to be used for notifying the BSS (Data Null, QoS
* Null, or CTS to Self). Must always be a valid frame type. */
u8 frame_type;
/* UMAC has the option of passing the MAC frame to be used for * notifying the BSS. If non-zero, HAL will use the MAC frame * buffer pointed to by macMgmtHdr. If zero, HAL will generate the
* appropriate MAC frame based on frameType. */
u8 frame_len;
/* Following the framelength there is a MAC frame buffer if
* frameLength is non-zero. */ struct wcn36xx_hal_mac_mgmt_hdr mac_mgmt_hdr;
/* Entry to hold number of active BSS idx's */ struct wcn36xx_hal_scan_entry scan_entry;
};
/* LEARN - AP Role
SCAN - STA Role */ enum wcn36xx_hal_sys_mode mode;
/* BSSID of the BSS */
u8 bssid[ETH_ALEN];
/* Whether BSS needs to be notified */
u8 notify;
/* Kind of frame to be used for notifying the BSS (Data Null, QoS
* Null, or CTS to Self). Must always be a valid frame type. */
u8 frame_type;
/* UMAC has the option of passing the MAC frame to be used for * notifying the BSS. If non-zero, HAL will use the MAC frame * buffer pointed to by macMgmtHdr. If zero, HAL will generate the
* appropriate MAC frame based on frameType. */
u8 frame_length;
/* Following the framelength there is a MAC frame buffer if
* frameLength is non-zero. */ struct wcn36xx_hal_mac_mgmt_hdr mac_mgmt_hdr;
/* Entry to hold number of active BSS idx's */ struct wcn36xx_hal_scan_entry scan_entry;
/* Single NoA usage in Scanning */
u8 use_noa;
/* Indicates the scan duration (in ms) */
u16 scan_duration;
/* Indicates the channel to stop scanning. Not used really. But * retained for symmetry with "start Scan" message. It can also
* help in error check if needed. */
u8 scan_channel;
} __packed;
/* Identifies the operational state of the AP/STA
* LEARN - AP Role SCAN - STA Role */ enum wcn36xx_hal_sys_mode mode;
/* Operating channel to tune to. */
u8 oper_channel;
/* Channel Bonding state If 20/40 MHz is operational, this will * indicate the 40 MHz extension channel in combination with the
* control channel */ enum phy_chan_bond_state cb_state;
/* BSSID of the BSS */
u8 bssid[ETH_ALEN];
/* Whether BSS needs to be notified */
u8 notify;
/* Kind of frame to be used for notifying the BSS (Data Null, QoS
* Null, or CTS to Self). Must always be a valid frame type. */
u8 frame_type;
/* UMAC has the option of passing the MAC frame to be used for * notifying the BSS. If non-zero, HAL will use the MAC frame * buffer pointed to by macMgmtHdr. If zero, HAL will generate the
* appropriate MAC frame based on frameType. */
u8 frame_length;
/* Following the framelength there is a MAC frame buffer if
* frameLength is non-zero. */ struct wcn36xx_hal_mac_mgmt_hdr mac_mgmt_hdr;
/* Entry to hold number of active BSS idx's */ struct wcn36xx_hal_scan_entry scan_entry;
struct wcn36xx_hal_supported_rates { /* * For Self STA Entry: this represents Self Mode. * For Peer Stations, this represents the mode of the peer. * On Station: * * --this mode is updated when PE adds the Self Entry. * * -- OR when PE sends 'ADD_BSS' message and station context in BSS * is used to indicate the mode of the AP. * * ON AP: * * -- this mode is updated when PE sends 'ADD_BSS' and Sta entry * for that BSS is used to indicate the self mode of the AP. * * -- OR when a station is associated, PE sends 'ADD_STA' message * with this mode updated.
*/
enum sta_rate_mode op_rate_mode;
/* 11b, 11a and aniLegacyRates are IE rates which gives rate in
* unit of 500Kbps */
u16 dsss_rates[WCN36XX_HAL_NUM_DSSS_RATES];
u16 ofdm_rates[WCN36XX_HAL_NUM_OFDM_RATES];
u16 legacy_rates[WCN36XX_HAL_NUM_POLARIS_RATES];
u16 reserved;
/* Taurus only supports 26 Titan Rates(no ESF/concat Rates will be * supported) First 26 bits are reserved for those Titan rates and * the last 4 bits(bit28-31) for Taurus, 2(bit26-27) bits are
* reserved. */ /* Titan and Taurus Rates */
u32 enhanced_rate_bitmap;
/* * 0-76 bits used, remaining reserved * bits 0-15 and 32 should be set.
*/
u8 supported_mcs_set[WCN36XX_HAL_MAC_MAX_SUPPORTED_MCS_SET];
/* * RX Highest Supported Data Rate defines the highest data * rate that the STA is able to receive, in unites of 1Mbps. * This value is derived from "Supported MCS Set field" inside * the HT capability element.
*/
u16 rx_highest_data_rate;
} __packed;
struct wcn36xx_hal_config_sta_params { /* BSSID of STA */
u8 bssid[ETH_ALEN];
/* Short GI support for 40Mhz packets */
u8 sgi_40mhz;
/* Short GI support for 20Mhz packets */
u8 sgi_20Mhz;
/* TODO move this parameter to the end for 3680 */ /* These rates are the intersection of peer and self capabilities. */ struct wcn36xx_hal_supported_rates supported_rates;
/* The unicast encryption type in the association */
u32 encrypt_type;
/* HAL should update the existing STA entry, if this flag is set. UMAC will set this flag in case of RE-ASSOC, where we want to reuse the
old STA ID. 0 = Add, 1 = Update */
u8 action;
/* U-APSD Flags: 1b per AC. Encoded as follows: b7 b6 b5 b4 b3 b2 b1 b0 =
X X X X BE BK VI VO */
u8 uapsd;
/* Max SP Length */
u8 max_sp_len;
/* 11n Green Field preamble support
0 - Not supported, 1 - Supported */
u8 green_field_capable;
/* MIMO Power Save mode */ enum wcn36xx_hal_ht_mimo_state mimo_ps;
/* Delayed BA Support */
u8 delayed_ba_support;
/* Max AMPDU duration in 32us */
u8 max_ampdu_duration;
/* HT STA should set it to 1 if it is enabled in BSS. HT STA should * set it to 0 if AP does not support it. This indication is sent * to HAL and HAL uses this flag to pickup up appropriate 40Mhz
* rates. */
u8 dsss_cck_mode_40mhz;
/* Valid STA Idx when action=Update. Set to 0xFF when invalid!
* Retained for backward compalibity with existing HAL code */
u8 sta_index;
/* BSSID of BSS to which station is associated. Set to 0xFF when * invalid. Retained for backward compalibity with existing HAL
* code */
u8 bssid_index;
u8 p2p;
/* TODO add this parameter for 3680. */ /* Reserved to align next field on a dword boundary */ /* u8 reserved; */
} __packed;
struct wcn36xx_hal_supported_rates_v1 { /* For Self STA Entry: this represents Self Mode. * For Peer Stations, this represents the mode of the peer. * On Station: * * --this mode is updated when PE adds the Self Entry. * * -- OR when PE sends 'ADD_BSS' message and station context in BSS * is used to indicate the mode of the AP. * * ON AP: * * -- this mode is updated when PE sends 'ADD_BSS' and Sta entry * for that BSS is used to indicate the self mode of the AP. * * -- OR when a station is associated, PE sends 'ADD_STA' message * with this mode updated.
*/
enum sta_rate_mode op_rate_mode;
/* 11b, 11a and aniLegacyRates are IE rates which gives rate in * unit of 500Kbps
*/
u16 dsss_rates[WCN36XX_HAL_NUM_DSSS_RATES];
u16 ofdm_rates[WCN36XX_HAL_NUM_OFDM_RATES];
u16 legacy_rates[WCN36XX_HAL_NUM_POLARIS_RATES];
u16 reserved;
/* Taurus only supports 26 Titan Rates(no ESF/concat Rates will be * supported) First 26 bits are reserved for those Titan rates and * the last 4 bits(bit28-31) for Taurus, 2(bit26-27) bits are * reserved * Titan and Taurus Rates
*/
u32 enhanced_rate_bitmap;
/* 0-76 bits used, remaining reserved * bits 0-15 and 32 should be set.
*/
u8 supported_mcs_set[WCN36XX_HAL_MAC_MAX_SUPPORTED_MCS_SET];
/* RX Highest Supported Data Rate defines the highest data * rate that the STA is able to receive, in unites of 1Mbps. * This value is derived from "Supported MCS Set field" inside * the HT capability element.
*/
u16 rx_highest_data_rate;
/* Indicates the Maximum MCS that can be received for each spatial * stream.
*/
u16 vht_rx_mcs_map;
/* Indicates the highest VHT data rate that the STA is able to * receive.
*/
u16 vht_rx_highest_data_rate;
/* Indicates the Maximum MCS that can be transmitted for each spatial * stream.
*/
u16 vht_tx_mcs_map;
/* Indicates the highest VHT data rate that the STA is able to * transmit.
*/
u16 vht_tx_highest_data_rate;
} __packed;
struct wcn36xx_hal_config_sta_params_v1 { /* BSSID of STA */
u8 bssid[ETH_ALEN];
/* The unicast encryption type in the association */
u32 encrypt_type;
/* HAL should update the existing STA entry, if this flag is set. UMAC will set this flag in case of RE-ASSOC, where we want to reuse the
old STA ID. 0 = Add, 1 = Update */
u8 action;
/* U-APSD Flags: 1b per AC. Encoded as follows: b7 b6 b5 b4 b3 b2 b1 b0 =
X X X X BE BK VI VO */
u8 uapsd;
/* Max SP Length */
u8 max_sp_len;
/* 11n Green Field preamble support
0 - Not supported, 1 - Supported */
u8 green_field_capable;
/* MIMO Power Save mode */ enum wcn36xx_hal_ht_mimo_state mimo_ps;
/* Delayed BA Support */
u8 delayed_ba_support;
/* Max AMPDU duration in 32us */
u8 max_ampdu_duration;
/* HT STA should set it to 1 if it is enabled in BSS. HT STA should * set it to 0 if AP does not support it. This indication is sent * to HAL and HAL uses this flag to pickup up appropriate 40Mhz
* rates. */
u8 dsss_cck_mode_40mhz;
/* Valid STA Idx when action=Update. Set to 0xFF when invalid!
* Retained for backward compalibity with existing HAL code */
u8 sta_index;
/* BSSID of BSS to which station is associated. Set to 0xFF when * invalid. Retained for backward compalibity with existing HAL
* code */
u8 bssid_index;
u8 p2p;
/* Reserved to align next field on a dword boundary */
u8 ht_ldpc_enabled:1;
u8 vht_ldpc_enabled:1;
u8 vht_tx_bf_enabled:1;
u8 vht_tx_mu_beamformee_capable:1;
u8 reserved:4;
/* These rates are the intersection of peer and self capabilities. */ struct wcn36xx_hal_supported_rates_v1 supported_rates;
/* 12 Bytes long because this structure can be used to represent rate and
* extended rate set IEs. The parser assume this to be at least 12 */ struct wcn36xx_hal_rate_set {
u8 num_rates;
u8 rate[WCN36XX_HAL_MAC_RATESET_EID_MAX];
} __packed;
/* Concurrency role. These are generic IDs that identify the various roles
* in the software system. */ enum wcn36xx_hal_con_mode {
WCN36XX_HAL_STA_MODE = 0,
/* to support softAp mode . This is misleading.
It means AP MODE only. */
WCN36XX_HAL_STA_SAP_MODE = 1,
/* This is a bit pattern to be set for each mode * bit 0 - sta mode * bit 1 - ap mode * bit 2 - p2p client mode
* bit 3 - p2p go mode */ enum wcn36xx_hal_concurrency_mode {
HAL_STA = 1,
HAL_SAP = 2,
/* to support sta, softAp mode . This means STA+AP mode */
HAL_STA_SAP = 3,
/* Extension channel for channel bonding */
u8 ext_channel;
/* Reserved to align next field on a dword boundary */
u8 reserved;
/* TODO move sta to the end for 3680 */ /* Context of the station being added in HW * Add a STA entry for "itself" - * * On AP - Add the AP itself in an "STA context" * * On STA - Add the AP to which this STA is joining in an * "STA context"
*/ struct wcn36xx_hal_config_sta_params sta; /* SSID of the BSS */ struct wcn36xx_hal_mac_ssid ssid;
/* HAL should update the existing BSS entry, if this flag is set. * UMAC will set this flag in case of reassoc, where we want to * resue the old BSSID and still return success 0 = Add, 1 =
* Update */
u8 action;
/* MAC Rate Set */ struct wcn36xx_hal_rate_set rateset;
/* Enable/Disable HT capabilities of the BSS */
u8 ht;
/* Boolean to indicate if EDCA params are valid. UMAC might not * have valid EDCA params or might not desire to apply EDCA params * during config BSS. 0 implies Not Valid ; Non-Zero implies
* valid */
u8 edca_params_valid;
/* EDCA Parameters for Best Effort Access Category */ struct wcn36xx_hal_edca_param_record acbe;
/* Extension channel for channel bonding */
u8 ext_channel;
/* Reserved to align next field on a dword boundary */
u8 reserved;
/* SSID of the BSS */ struct wcn36xx_hal_mac_ssid ssid;
/* HAL should update the existing BSS entry, if this flag is set. * UMAC will set this flag in case of reassoc, where we want to * resue the old BSSID and still return success 0 = Add, 1 =
* Update */
u8 action;
/* MAC Rate Set */ struct wcn36xx_hal_rate_set rateset;
/* Enable/Disable HT capabilities of the BSS */
u8 ht;
/* Boolean to indicate if EDCA params are valid. UMAC might not * have valid EDCA params or might not desire to apply EDCA params * during config BSS. 0 implies Not Valid ; Non-Zero implies
* valid */
u8 edca_params_valid;
/* EDCA Parameters for Best Effort Access Category */ struct wcn36xx_hal_edca_param_record acbe;
/* Ext Bss Config Msg if set */
u8 ext_set_sta_key_param_valid;
/* SetStaKeyParams for ext bss msg */ struct wcn36xx_hal_set_sta_key_params ext_set_sta_key_param;
/* Persona for the BSS can be STA,AP,GO,CLIENT value same as enum
* wcn36xx_hal_con_mode */
u8 wcn36xx_hal_persona;
u8 spectrum_mgt_enable;
/* HAL fills in the tx power used for mgmt frames in txMgmtPower */
s8 tx_mgmt_power;
/* maxTxPower has max power to be used after applying the power
* constraint if any */
s8 max_tx_power;
/* Context of the station being added in HW * Add a STA entry for "itself" - * * On AP - Add the AP itself in an "STA context" * * On STA - Add the AP to which this STA is joining in an * "STA context"
*/ struct wcn36xx_hal_config_sta_params_v1 sta;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.