/* SPDX-License-Identifier: GPL-2.0-only */ /** * @brief Common structures and definations. */ #ifndef _LMAC_IF_ #define _LMAC_IF_ #include "lmac_if_common.h" #define MAX_DATA_SIZE_12K (12 * 1024) #ifdef BB_PKTRAM #define MAX_DATA_SIZE_2K (1600) #else #define MAX_DATA_SIZE_2K (2 * 1024) #endif #define NUM_TX_DESC 12 #ifdef BB_PKTRAM #define NUM_FRAMES_IN_TX_DESC 4 #else #define NUM_FRAMES_IN_TX_DESC 32 #endif #define INTERRUPT_BIT 0x80000000 #define MCST_ADDR_LIMIT 16 #define WLAN_ADDR_LEN 6 #define MAX_VIFS 2 #define MAX_PEERS 8 /* Additional queue for unicast frames directed to non-associated peers (for * e.g. Probe Responses etc) */ #define MAX_PEND_Q_PER_AC (MAX_PEERS + MAX_VIFS) #define MAX_CHANCTX 2 #define MAX_OFF_CHANCTX MAX_VIFS #define OFF_CHANCTX_IDX_BASE MAX_CHANCTX #define WLAN_20MHZ_OPERATION 0 #define WLAN_40MHZ_OPERATION 1 #define WLAN_80MHZ_OPERATION 2 #define WLAN_SEC_UPPER 0 #define WLAN_SEC_LOWER 1 #define PWRSAVE_STATE_AWAKE 1 #define PWRSAVE_STATE_DOZE 0 #define MAX_SSID_LEN 32 #define MAX_NUM_SSIDS 2 #define RX_SEQ_SIZE 6 #define MAX_IE_LEN 100 #define ETH_ALEN 6 #define MAX_TX_CMDS 16 #define MAX_GRAM_PAYLOAD_LEN 52 #define MAX_RF_CALIB_DATA 900 #define MAX_SLEEP_STATS 12 #define HAL_INT_EVENT_MAX_RX 64 /*! LMAC error event status */ enum LMAC_ERROR_ID { /*! LMAC internal memory full */ LMAC_FW_PEER_DATA_BASE_FULL = 0, }; /*! Channel bandwidht info enum */ enum LMAC_CHANNEL_BW { /*! NON HT 20 */ LMAC_CHAN_WIDTH_20_NOHT, /*! NON HT 20 or HT 20 */ LMAC_CHAN_WIDTH_20 = LMAC_CHAN_WIDTH_20_NOHT, /*! 40Mhz bandwidth */ LMAC_CHAN_WIDTH_40, /*! 80Mhz bandwidth */ LMAC_CHAN_WIDTH_80, }; /*! * enum LMAC_QUEUE_NUM - Queues used to transmit frames. * @LMAC_AC_BK: Queue for frames belonging to the "Background" Access Category. * @LMAC_AC_BE: Queue for frames belonging to the "Best-Effort" Access Category. * @LMAC_AC_VI: Queue for frames belonging to the "Video" Access Category. * @LMAC_AC_VO: Queue for frames belonging to the "Voice" Access Category. * @LMAC_AC_BCN: Queue for frames belonging to the "Beacon" Access Category. * @LMAC_AC_MAX_CNT: Maximum number of transmit queues supported. * * This enum represents the queues used to segregate the TX frames depending on * their QoS categories. A separate queue is used for Beacon frames / frames * transmitted during DTIM intervals. */ enum LMAC_QUEUE_NUM { LMAC_AC_BK = 0, LMAC_AC_BE, LMAC_AC_VI, LMAC_AC_VO, LMAC_AC_BCN, LMAC_AC_MAX_CNT }; /*! * enum LMAC_EVENT_ROC_STAT - Status of the Remain-On-Channel(ROC) operation. * @LMAC_ROC_STAT_STARTED: ROC has started. * @LMAC_ROC_STAT_STOPPED: ROC was stopped. * @LMAC_ROC_STAT_DONE: ROC completed. * @LMAC_ROC_STAT_ABORTED: ROC was aborted. * * This enum represents the different states in which a ROC operation can be in. * ROC is applicable only for P2P Mode. */ enum LMAC_EVENT_ROC_STAT { LMAC_ROC_STAT_STARTED, LMAC_ROC_STAT_STOPPED, LMAC_ROC_STAT_DONE, LMAC_ROC_STAT_ABORTED }; /*! * enum LMAC_VIF_CHANCTX_TYPE - Types of channel contexts. * @LMAC_VIF_CHANCTX_TYPE_OPER: Operating channel context. * @LMAC_VIF_CHANCTX_TYPE_OFF: Off-channel context. * @MAX_LMAC_VIF_CHANCTX_TYPES: Maximum number of channel context types. * * This enum represents the different types of channel contexts that are * possible during a concurrent multichannel operation. At any point of time a * channel context can be either of the type "Operating" or "Off-channel" */ enum LMAC_VIF_CHANCTX_TYPE { LMAC_VIF_CHANCTX_TYPE_OPER, LMAC_VIF_CHANCTX_TYPE_OFF, MAX_LMAC_VIF_CHANCTX_TYPES }; /*! * enum STATS_TYPE - enum to represent different stats type */ enum STATS_TYPE { STATS_TYPE_LMAC, STATS_TYPE_PHY, STATS_TYPE_MAX }; /*! * enum LMAC_CMD_TAG - LMAC command IDs. * @LMAC_CMD_RESET: LMAC bringup command. * @LMAC_CMD_SCAN: LMAC SCAN command. LMAC peforms scan operation based on lmac_cmd_scan parameters. * @LMAC_CMD_SCAN_ABORT Abort scan if host/umac intend to abort ongoing scan operation * @LMAC_CMD_SETKEY Configure session kyes in LMAC internal data base * @LMAC_CMD_TX TX frame from host. LMAC completes transmission and informs status as TX_DONE as a response * @LMAC_CMD_TX_POWER Max tx output power. Host will provide this info based on regulatory restrictions. * @LMAC_CMD_PS Power save enable/disable operation * @LMAC_CMD_PS_ECON_CFG Host power save information is passed to LMAC with this command * @LMAC_CMD_VIF_CTRL Virtual/physical mac address addition or remove * @LMAC_CMD_BA_SESSION_INFO block ack session info. Currenlty LMAC is not using this info * @LMAC_CMD_MCST_ADDR_CFG Multicast address addition/deletion * @LMAC_CMD_MCST_FLTR_CTRL multicast address filter logic can be disabled/enabled using this command. * @LMAC_CMD_ROC_CTRL Command to keep LMAC in one channel for P2P operations. * @LMAC_CMD_CHANNEL Channel programming command * @LMAC_CMD_VIF_CFG VIF configuration data * @LMAC_CMD_TXQ_PARAMS Command to update EDCA parameters in LMAC * @LMAC_CMD_MEASURE Command to perform DFS related measurements * @LMAC_CMD_CLEAR_STATS Command to clear all internal debug stats * @LMAC_CMD_TX_DEINIT Command to clear all pending tx commands in LMAC * @LMAC_CMD_STATS Command to query intenral stats to host * @LMAC_CMD_SLEEP_STATUS Command to inform sleep status from UMAC * @LMAC_CMD_RX_BUFFER Command to update rx buffer pointers. This is used by umac to update intenal buffers * @LMAC_CMD_PWR_MON Command to measure battery voltage * @LMAC_CMD_SCAN_IE SCAN ie elements are passed using this command before scan command. */ enum LMAC_CMD_TAG { LMAC_CMD_RESET = 0, LMAC_CMD_SCAN, LMAC_CMD_SCAN_ABORT, LMAC_CMD_SETKEY, LMAC_CMD_TX, LMAC_CMD_TX_POWER, LMAC_CMD_PS, LMAC_CMD_PS_ECON_CFG, LMAC_CMD_VIF_CTRL, LMAC_CMD_BA_SESSION_INFO, LMAC_CMD_MCST_ADDR_CFG, LMAC_CMD_MCST_FLTR_CTRL, LMAC_CMD_ROC_CTRL, LMAC_CMD_CHANNEL, LMAC_CMD_VIF_CFG, LMAC_CMD_TXQ_PARAMS, LMAC_CMD_MEASURE, LMAC_CMD_CLEAR_STATS, LMAC_CMD_TX_DEINIT, LMAC_CMD_STATS, LMAC_CMD_SLEEP_STATUS, LMAC_CMD_RX_BUFFER, LMAC_CMD_PWR_MON, LMAC_CMD_SCAN_IE, LMAC_CMD_CONFIG_TWT, LMAC_CMD_CONFIG_MAC_PARAMS, LMAC_CMD_PHY_SPATIAL_REUSE_PARAMS, LMAC_CMD_RFTEST, LMAC_CMD_COEX_CONFIG, }; /*! * enum LMAC_EVENT_TAG - Events that the firmware can send to the Host. *@LMAC_EVENT_RX Raised to forward received packet to upper layers *@LMAC_EVENT_TX_DONE Rresponse to TX command. this event will have tx packet status *@LMAC_EVENT_DISCONNECTED Raised if LMAC stops receiving beacons from ap in connected state. *@LMAC_EVENT_SCAN_COMPLETE Scan complete event. *@LMAC_EVENT_SCAN_ABORT_COMPLETE scan abort complete. LMAC aborts ongoing scan and generates event. *@LMAC_EVENT_RESET_COMPLETE . This event is generated after initialising system as response to LMAC_CMD_RESET *@LMAC_EVENT_NOA Indicates NOA Window in P2P mode *@LMAC_EVENT_COMMAND_PROC_DONE raised as response to received command. This helps to have flow control between lmac and upper layers *@LMAC_EVENT_CH_PROG_DONE channel programming complete event. Response to LMAC_CMD_CH command. *@LMAC_EVENT_PS_ECON_CFG_DONE : Response to LMAC_CMD_PS_ECON *@LMAC_EVENT_PS_ECON_WAKE wake up event to host *@LMAC_EVENT_MSRMNT_COMPLETE DFS measurement complete event *@LMAC_EVENT_ROC_STATUS ROC status event to UMAC *@LMAC_EVENT_FW_ERROR LMAC internal error. Generated if LMAC runs out of internal memory. *@LMAC_EVENT_TX_DEINIT_DONE Response event TX_DEINIT command *@LMAC_EVENT_STATS - Debug stats event. response to STATS command *@LMAC_EVENT_SLEEP_REQ - umac-lmac internal event. used to communicate with UMAC before going for sleep. *@LMAC_EVENT_PWR_MON */ enum LMAC_EVENT_TAG { LMAC_EVENT_RX = 0, LMAC_EVENT_TX_DONE, LMAC_EVENT_DISCONNECTED, LMAC_EVENT_SCAN_COMPLETE, LMAC_EVENT_SCAN_ABORT_COMPLETE, LMAC_EVENT_RESET_COMPLETE, LMAC_EVENT_NOA, LMAC_EVENT_COMMAND_PROC_DONE, LMAC_EVENT_CH_PROG_DONE, LMAC_EVENT_PS_ECON_CFG_DONE, LMAC_EVENT_PS_ECON_WAKE, LMAC_EVENT_MSRMNT_COMPLETE, LMAC_EVENT_ROC_STATUS, LMAC_EVENT_FW_ERROR, LMAC_EVENT_TX_DEINIT_DONE, LMAC_EVENT_STATS, LMAC_EVENT_SLEEP_REQ, LMAC_EVENT_TWT_BLOCK, LMAC_EVENT_TWT_TEARDOWN, LMAC_EVENT_PWR_MON, LMAC_EVENT_RFTEST, LMAC_EVENT_COEX_MANAGER }; /*! * enum LMAC_PS_ECON_WAKE_TRIG - Triggers which can cause a wake-up during * Economy mode operation. * @TRIG_PKT_RCV: Wake-up due to frame reception. * @TRIG_DISCONNECT: Wake-up due to a disconnection event. * * This enum represents the different triggers that can cause the wake-up after * a sleep during Economy mode operation. */ enum LMAC_PS_ECON_WAKE_TRIG { TRIG_PKT_RCV, TRIG_DISCONNECT }; /*! * enum POWER_SAVE_TAG - Options to enable/disable WLAN Power-Save. * @AWAKE: Disable Power-Save. * @SLEEP: Enable Power-Save. * * This enum represents the values that can be used to specify whether to * enable/disable WLAN power-save. */ enum POWER_SAVE_TAG { AWAKE = 0, SLEEP }; /*! * enum SCAN_TYPE_TAG - Different types of scanning operations. * @PASSIVE: Passive scan. * @ACTIVE: Active scan. * * This enum represents the different types of scanning operations. */ enum SCAN_TYPE_TAG { PASSIVE = 0, ACTIVE }; /*! * enum SCAN_MODE - scan operation mode * @AUTO: auto or legacy scan operation * @CHANNEL_MAPPING: channel mapping mode. most of parameters will come from host. * * This enum represents the different types of scanning operations. */ enum SCAN_MODE_E { AUTO = 0, CHANNEL_MAPPING }; /*! * enum TX_DEINIT_DONE_STATUS - scan operation mode * @TX_DEINIT_DONE_SUCCESS: deinit operation success * @TX_DEINIT_DONE_FAIL:deinit operation fail. * */ enum TX_DEINIT_DONE_STATUS { TX_DEINIT_DONE_SUCCESS = 0, TX_DEINIT_DONE_FAIL, }; /*! * struct lmac_msg_hdr - Header to be appended to all the Commands/Events * between Host and Firmware. * @id: Command/event ID. * @push_addr: Buffer push address * @eventsign: Signature for debug purpose * * This header contains control information about a Command/Event between Host * and Firmware. This must be present in every Command/Event. */ struct lmac_msg_hdr { unsigned int id; unsigned int push_addr; unsigned int eventsign; } __NRF_WIFI_PKD; /*! * struct host_rpu_lmac_msg_hdr - RPU-HOST message header. \n * @hal_hdr: HAL header \n * @lmac_hdr: LMAC message header \n */ struct host_rpu_lmac_msg_hdr { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; }; /*! * struct ssid - Structure to describe an SSID. * @len: Length of the SSID. * @ssid: SSID character buffer; according to IEEE it is of size varying * from 1- 32. * * This structure is used to specify an Service Set Identifier (SSID). */ struct ssid { unsigned int len; unsigned char ssid[MAX_SSID_LEN]; } __NRF_WIFI_PKD; /* Commands */ /*! * struct cmd_tx_ctrl - Command used by Host to program TX control information * for 1 (A)MPDU to the Firmware for transmission. * @hal_hdr: Host rpu hal message header * @lmac_hdr: Host-Firmware message header (id field needs to be set to * LMAC_CMD_TX). * @if_index: Virtual interface number this packet is tied to. * @queue_num: The access category to which the frame belongs. * @descriptor_id: Token ID of the transmitted frame. * @num_frames_per_desc: Number of MPDU's to be sent in this command. * @pkt_length: Packet length(s) of each MPDU being sent as part of this * command. * @more_frms: Used in AP mode operation; while transmitting a packet to a * station which is in the power save mode, if the AP has more * data in destination's station queue, this field is set to 1; * 0 in all other cases. * @force_tx: If this field is set for any packet, it needs to be transmitted * even though TX has been disabled. This field is only meaningful * in DFS. * @tx_flags: Flags to communicate special cases regarding the frame to the * Firmware * @num_rates: Used to specify the number of possible rates a TX packet can * be transmitted at (Max 4 possible rates). * @rate_protection_type: Per rate protection flags (RTS/CTS, CTS2SELF) set by * the rate control algorithm (or) /proc interface. * @rate_preamble_type: Per rate usage of short preamble as dictated by the rate * control algorithm (or) /proc interface. * @rate_retries: Number of times a packet should be transmitted at each * possible rate. Ex {(1, 3),( 5.5, 2), (36,1) }, this * example is a set of (rate, rate_retries) couple with * num_rates as 3. This means, transmit a TX packet with 3 * possible rates 1, 5.5 and 36. If the first rate is not * successful after trying 3 times, try the second rate twice. * If it is still failing it will try to transmit at rate 36 * once. * @rate: The rate value(s), at which the packet transmission needs to be * attempted as dictated by the rate control algorithm (or) /proc * interface.If the most significant bit is one it's a 11n rate. * @rate_flags: Per rate flags as dictated by the rate control algorithm * (or) /proc interface. * @num_spatial_streams: Number of spatial streams to be used per rate as * dictated by the rate control algorithm (or) * /proc interface. * @stbc_enabled: STBC enabled/disabled as dictated by the rate control * algorithm (or) /proc interface. * @bcc_or_ldpc: FEC type as dictated by the rate control algorithm (or) * /proc interface. * @aggregate_mpdu: In 11n, this field informs firmware whether to club * the packet with other packets or not. For management, * control and broadcast frames this field is not set. * Currently if num_frames > 1, then this is set by default. * @encrypt: If the frame is to be encrypted by LMAC this is * set to 1 else this is 0. * @config_mac_hdr_len: Length of the MAC header of the first MPDU in an AMPDU. * @frame_source: Is the frame residing in GRAM or Ext-RAM. For all packets from * host Ext-ram is default. GRAM is purely for testing purposes. * @config_mac_header: Complete MAC header of the first MPDU in an AMPDU. * @frame_ddr_pointer: Starting Physical address of each frame in Ext-RAM * after dma_mapping. * @per_pkt_crypto_params: Crypto parameters (sequence control, QoS control, IV) * per frame. Incremental to the MAC header sent above. * @gram_payload: MAC headers of all the frames transmitted using this * command. (unused currently) * * This command is used to transmit a TX packet. A TX packet is divided into * two parts: * * First part consists of TX control information, this also has * complete 802.11 header of first packet (config_mac_header) and incremental * information (per_pkt_crypto_params) per frame. This will be used to configure * different blocks in LMAC. * * Second part is 802.11 header and payload. This will directly streamed to * PHY for transmission using DMA controller within LMAC. * * TX done event is generated after completing packet transmission. */ struct lmac_cmd_tx { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; /* VIF number this packet belongs to */ unsigned char if_index; /* Queue no will be VO, VI, BE, BK and BCN */ unsigned char queue_num; unsigned int descriptor_id; /* number of frames in tx descriptors */ unsigned int num_frames_per_desc; /*packet lengths of frames*/ unsigned short pkt_length[MAX_TX_CMDS]; /* If more number of frames buffered at UMAC */ unsigned char more_frms; /* If this field is set for any packet, * need to be transmit even though TX has been disabled */ unsigned int force_tx; /* Flags to communicate special cases regarding the frame to the FW */ unsigned int tx_flags; unsigned char num_rates; #define USE_PROTECTION_NONE 0 #define USE_PROTECTION_RTS 1 #define USE_PROTECTION_CTS2SELF 2 unsigned char rate_protection_type[4]; #define USE_SHORT_PREAMBLE 0 #define DONT_USE_SHORT_PREAMBLE 1 unsigned char rate_preamble_type[4]; unsigned char rate_retries[4]; #define MARK_RATE_AS_MCS_INDEX 0x80 #define MARK_RATE_AS_RATE 0x00 unsigned char rate[4]; #define ENABLE_GREEN_FIELD 0x01 #define ENABLE_CHNL_WIDTH_40MHZ 0x02 #define ENABLE_SGI 0x04 #define ENABLE_11N_FORMAT 0x08 #define ENABLE_VHT_FORMAT 0x10 #define ENABLE_CHNL_WIDTH_80MHZ 0x20 #define ENABLE_HE_SU 0x40 #define ENABLE_HE_ER_SU 0x80 unsigned char rate_flags[4]; #define HE_GI_800NS 0 #define HE_GI_1600NS 1 #define HE_GI_3200NS 2 unsigned char he_gi_type[4]; unsigned char he_ltf[4]; unsigned char num_spatial_streams[4]; unsigned char stbc_enabled; unsigned char bcc_or_ldpc; #define AMPDU_AGGR_ENABLED 0x00000001 #define AMPDU_AGGR_DISABLED 0x00000000 unsigned char aggregate_mpdu; #define ENCRYPT_DISABLE 0 #define ENCRYPT_ENABLE 1 unsigned char encrypt; unsigned int config_mac_hdr_len; #define PKT_SRC_GRAM 1 #define PKT_SRC_EXTRAM 0 unsigned char frame_source; /* set 1 if frame is intended to go with HE_TB response trigger frame */ unsigned char he_tb_frame; #define MAC_HDR_SIZE 52 unsigned char config_mac_header[MAC_HDR_SIZE]; unsigned int frame_ddr_pointer[MAX_TX_CMDS]; unsigned short mpdu_seq_number[MAX_TX_CMDS]; } __NRF_WIFI_PKD; /*! * struct cmd_reset - Command used to (De-)initialize the Firmware. * @hal_hdr: Host-Firmware message header. * @lmac_hdr: lmac message header * @type: Enable/Disable the firmware. * @rf_params: RF calibration data derived using FTM. * @lmac_mode: not used . * @calib_bitmap: Number of spatial streams. * @sleepEnable: set to 1 to enable RPU sleep * @hw_bringup_time: Normal/FTM mode. * @sw_bringup_time: Antenna configuration, applicable only for 1x1. * @bcn_time_out: internal tunning parameter * @calibSleepClk: Set to 1 if rpu is expected to perform sleep clock calibration * @rx_skb_params : rx skb buffer information * This command is used to enable/disable the WLAN. A RESET_COMPLETE * event from the firmware indicates successful completion of this command. * After sending the RESET, the host should not issue further commands until a * RESET_COMPLETE is received. * @prodtest_trim : Production test TRIM OTP values * @prodctrl_disable5ghz : Disable 5GHz support(0x50FA50FA) */ struct lmac_cmd_reset { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; #define LMAC_ENABLE 0 #define LMAC_DISABLE 1 unsigned int type; unsigned char rf_params[RF_PARAMS_SIZE]; #define LMAC_MODE_NORMAL 0 #define LMAC_MODE_FTM 1 unsigned int lmac_mode; unsigned int calib_bitmap; unsigned int sleepEnable; unsigned int hw_bringup_time; unsigned int sw_bringup_time; unsigned int bcn_time_out; unsigned int calibSleepClk; struct rx_buf_pool_params rx_skb_params[MAX_NUM_OF_RX_QUEUES]; struct temp_vbat_config temp_vbat_params; #define PRODTEST_TRIM_LEN 15 unsigned int prodtest_trim[PRODTEST_TRIM_LEN]; unsigned int prodctrl_disable5ghz; } __NRF_WIFI_PKD; /*! * struct cmd_scan - Command used to initiate a scan. * @channel: channel number * @max_tx_power: operating tx power on this channel * @scan_type: scan type ( active or passive) * @probe_cnt: number of probes in current channel for active scan * @scan_duration: scan duration of this channel. */ struct scanChannelParams { /* Valid channel number */ unsigned char channel; /* Max power 0 t0 20 */ unsigned char max_tx_power; /* 0- passive 1 - active */ enum SCAN_TYPE_TAG scan_type; /* probe count - min of 1 and max of 4*/ unsigned char probe_cnt; /* Max scan duration in TU - min of 10 and max of 1 second */ unsigned short scan_duration; } __NRF_WIFI_PKD; /*! * struct cmd_scan - Command used to initiate a scan. * @hal_hdr: Host-Firmware message header. * @lmac_hdr: lmac message header * @scan_mode : scan mode informatio. set 0 to legacy/auto 1 - to channel mapping mode. * @if_index: Interface on which the scan is to be initiated. * @type: Passive/Active scan. * @n_channel: Total number of channels to scan; channel numbers will be * informed in the channel_list array. If n_channel value is 0, the * firmware scans all possible channels. * @n_ssids: Number of SSIDs to scan; ssid information will be in the ssids * array. This should always be >= 1. In case of wild card SSID, this * value is 1 and the ssid_len of the first entry in the SSID list * should be specified as 0. * @ssids: SSID list to scan. * @p2p_probe: Set in case scan command is issued as part of a P2P search * operation. Unset for normal operation. * * This command is used to initiate a scan. The frames received during scan * are sent to UMAC (beacons (or) probe responses). * * LMAC_EVENT_SCAN_COMPLETE event marks end of SCAN. */ struct lmac_cmd_scan { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; enum SCAN_MODE_E scan_mode; unsigned int if_index; enum SCAN_TYPE_TAG type; /* Total number of channels to scan; channel numbers will be * informed in channel array. if n_channel value is zero, * UMAC scans all possible channels. */ unsigned int n_channel; /* Operating or working channel when STA is connected to AP*/ unsigned short operating_ChDuration; /* Number of SSIDs to scan; ssid information will be in ssid array. * This is always >= 1. In case of wild card SSID, this value is 1 and * the ssid_len of the first entry in the SSID list should be specifie * as 0 */ #define MAX_SCAN_CHANNELS 30 unsigned int n_ssids; unsigned int p2p_probe; struct ssid ssids[MAX_NUM_SSIDS]; struct scanChannelParams scanParams[MAX_SCAN_CHANNELS]; } __NRF_WIFI_PKD; /*! * struct cmd_scan_abort - Command used to abort a scan. * @hal_hdr: Host-Firmware message header. * @hdr: Host-Firmware message header (id field needs to be set to * LMAC_CMD_SCAN_ABORT). * @if_index: Interface on which the scan is to be aborted. * * This command is used to abort a scan. */ struct lmac_cmd_scan_abort { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned int if_index; } __NRF_WIFI_PKD; /*! * struct cmd_setkey - Command used to set a security key. * @hal_hdr: Host-Firmware message header. * @hdr: Host-Firmware message header (id field needs to be set to * LMAC_CMD_SETKEY). * @if_index: Interface on which the key is to be set. * @ctrl: Add/Delete the key. * @key_type: Unicast/Broadcast key. * @cipher_type: The cipher type for which the key is to be set. * @key_id: Key index. Values (0-3) used for WEP; for other cases it can be any * value starting from zero. * @enc_key_len: Length of the Encryption/Descryption key. * @mic_key_len: Length of the mic key. (Tx MIC + Rx MIC) * @mac_addr: Peer station address for the respective key. In case of a group * key, it is set to a broadcast address, i.e. all 6 bytes are set * to 0xFF. * @enc_key: Encryption/Decryption key for Unicast/Multicast packets. Depends on * the key type. * @mic_key: MIC key (Tx MIC + Rx MIC) * * This command is used to program Pairwise/Group keys when * corresponding security modes are enabled. */ struct lmac_cmd_setkey { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned int if_index; #define KEY_CTRL_ADD 0 #define KEY_CTRL_DEL 1 unsigned int ctrl; #define KEY_TYPE_UCAST 1 #define KEY_TYPE_BCAST 2 unsigned int key_type; #define CIPHER_TYPE_WEP40 0 #define CIPHER_TYPE_WEP104 1 #define CIPHER_TYPE_TKIP 2 #define CIPHER_TYPE_CCMP 3 #define CIPHER_TYPE_WAPI 4 #define CIPHER_TYPE_GCMP 5 #define CIPHER_TYPE_CCMP_256 6 #define CIPHER_TYPE_GCMP_256 7 #define CIPHER_TYPE_TKIP_MIC 8 unsigned int cipher_type; unsigned int key_id; int enc_key_len; int mic_key_len; unsigned char mac_addr[ETH_ALEN]; #define MAX_ENC_KEY_LEN 32 #define MAX_MIC_KEY_LEN 16 unsigned char enc_key[MAX_ENC_KEY_LEN]; unsigned char mic_key[MAX_MIC_KEY_LEN]; } __NRF_WIFI_PKD; /*! * struct cmd_tx_pwr - Command used to specify maximum transmit power. * @hal_hdr: Host-Firmware message header. * @hdr: Host-Firmware message header (id field needs to be set to * LMAC_CMD_TX_POWER). * @if_index: Interface on which the maximum transmit power is to be set. * @tx_pwr: Maximum tranmit power value(in dBm). * * This command is used to specify the maximum transmit power on an interface. * It takes values from 0-20 (in dBm) in the system level and any value in * production tests. */ struct lmac_cmd_tx_pwr { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned int if_index; int tx_pwr; } __NRF_WIFI_PKD; /*! * struct cmd_mcst_addr_cfg - Command used to add or remove a multicast address * to the firmware. * @hal_hdr: Host-Firmware message header. * @hdr: Host-Firmware message header (id field needs to be set to * LMAC_CMD_MCST_ADDR_CFG). * @op: 0 to add a multicast address and 1 to remove it. * @mac_addr: The multicast address to be added or removed. * * This command is used to add/remove a multicast address to the firmware. Used * in conjunction wth the cmd_mcst_filter_ctrl for multicast filtering. */ struct lmac_cmd_mcst_addr_cfg { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; /* mcst_ctrl - * 0 -- ADD multicast address * 1 -- Remove multicast address */ #define WLAN_MCAST_ADDR_ADD 0 #define WLAN_MCAST_ADDR_REM 1 unsigned int op; /* addr to add or delete.. */ unsigned char mac_addr[6]; } __NRF_WIFI_PKD; /*! * struct cmd_mcst_filter_ctrl - Command used to enable/disable multicast * filtering in the firmware. * @hal_hdr: Host-Firmware message header. * @hdr: Host-Firmware message header (id field needs to be set to * LMAC_CMD_MCST_FLTR_CTRL). * @ctrl: 0 to disable multicast filtering and 1 to enable it. * * This command is used to enable/disable multicast filtering in firmware. If * multicast filtering is enabled, then multicast packets with MAC addresses * added using LMAC_CMD_MCST_ADDR_CFG are only allowed. If disabled all * multicast packets are received by the host. */ struct lmac_cmd_mcst_filter_ctrl { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; /* ctrl - * 0 - disable multicast filtering in LMAC * 1 - enable multicast filtering in LMAC */ #define MCAST_FILTER_DISABLE 0 #define MCAST_FILTER_ENABLE 1 unsigned int ctrl; } __NRF_WIFI_PKD; /*! * struct cmd_roc - Command used to pass the Remain-On-Channel(ROC) related * information to firmware. * @hal_hdr: Host-Firmware message header. * @hdr: Host-Firmware message header (id field needs to be set to * LMAC_CMD_ROC_CTRL). * @roc_ctrl: Start/Stop ROC * @roc_channel: The channel to be on during the ROC period. * @roc_duration: Time to remain on channel during ROC. * @roc_type: Normal/Offchannel-TX ROC. * * This command is used to start/stop a Remain-On-Channel(ROC) period. This is * also used to define whether this is a normal or a offchannel-Tx type of ROC. * ROC is applicable only for P2P Mode. */ struct lmac_cmd_roc { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; #define ROC_STOP 0 #define ROC_START 1 unsigned int roc_ctrl; unsigned int roc_channel; unsigned int roc_duration; #define ROC_TYPE_NORMAL 0 #define ROC_TYPE_OFFCHANNEL_TX 1 unsigned int roc_type; } __NRF_WIFI_PKD; /*! * struct cmd_ps - Command used to enable/disable WLAN power-save or Economy * mode on an interface. * @hal_hdr: Host-Firmware message header. * @hdr: Host-Firmware message header (id field needs to be set to * LMAC_CMD_PS/LMAC_CMD_PS_ECON_CFG). * @if_index: Interface index on which to configure the power-save. * @mode: Enable/Disable power-save. * * This command is used to enable/disable wlan power-save on an interface. * This command is only applicable for STA mode and will be ignored when not * associated when it is not in an associated state. */ struct lmac_cmd_ps { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned int if_index; enum POWER_SAVE_TAG mode; } __NRF_WIFI_PKD; /*! * struct cmd_vifctrl - Command used to add or remove a virtual interface. * @hal_hdr: Host-Firmware message header. * @hdr: Host-Firmware message header (id field needs to be set to * LMAC_CMD_VIF_CTRL). * @if_ctrl: Add/Remove interface. * @if_index: Index for the interface to be added/removed. * @mode: Operating mode of the interface. * @mac_addr: MAC address for the interface. * * This command is used to add/remove a virtual interface. The number of * interfaces supported is limited to MAX_VIFS. */ struct lmac_cmd_vifctrl { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; /* if_ctrl - * 0 - add interface address * 1 - remove interface address */ #define IF_ADD 1 #define IF_REM 2 unsigned int if_ctrl; unsigned int if_index; /* Interface mode - * 0 - STA in infrastucture mode * 1 - STA in AD-HOC mode * 2 - AP */ #define IF_MODE_STA_BSS 0 #define IF_MODE_STA_IBSS 1 #define IF_MODE_AP 2 #define IF_MODE_INVALID 3 unsigned int mode; unsigned char mac_addr[ETH_ALEN]; } __NRF_WIFI_PKD; /*! * struct cmd_ht_ba - Command used to pass Block ACK parameters to firmware. * @hal_hdr: Host-Firmware message header. * @lmac_hdr: Host-Firmware message header (id field needs to be set to * LMAC_CMD_BA_SESSION_INFO). * @if_index: Index for the interface on which the BA parameters are to be * set. * @op: BA session start/stop. * @tid: BA session traffic identifier. * @ssn: BA session startin sequence number. * @policy: BA policy (0 - Immediate BA, 1 - Delayed BA). * @vif_addr: MAC address of the virtual interface. * @peer_addr: MAC address of the peer with whom the BA session is to be * established. * * This command is used to pass Block ACK parameters to the firmware. This is * needed during the setting up of a RX A-MPDU aggregation session. */ struct lmac_cmd_ht_ba { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned int if_index; #define BLOCK_ACK_SESSION_STOP 0 #define BLOCK_ACK_SESSION_START 1 unsigned int op; unsigned int tid; unsigned int ssn; unsigned int policy; unsigned char vif_addr[ETH_ALEN]; unsigned char peer_addr[ETH_ALEN]; } __NRF_WIFI_PKD; /*! * struct cmd_channel - Command used to program a channel to the firmware. * @hal_hdr: Host-Firmware message header. * @lmac_hdr: Host-Firmware message header (id field needs to be set to * LMAC_CMD_CHANNEL). * @channel_bw: Bandwidth of the channel being configured (20/40/80/160 MHz). * @primary_ch_number: Center frequency of the primary channel. * @channel_number1: Center frequency of the total band, if total band is * contiguous. For non-contiguous bands, this is the center * frequency of the first band. * @channel_number2: Center frequency of the secondary band. Valid in an 80+80 * band, to be set to 0 for other cases. * @freq_band: The band (2.4/5 GHz) to which the channel belongs. * @vif_index: Index of the virtual interface on which channel is to be set. * * This command is used to program a channel to the firmware. An * LMAC_EVENT_CH_PROG_DONE event from the firmware indicates completion of * the channel programming. */ struct lmac_cmd_channel { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; enum LMAC_CHANNEL_BW channel_bw; unsigned int primary_ch_number; /* Center frequency of total band, if total band is contiguous. * First band center frequency for non contiguous bands, */ unsigned int channel_number1; /* center frequecny of secondary band. * This is valid in 80+80 band set to zero for other cases */ unsigned int channel_number2; /* 0 - 2.4ghz * 1 - 5ghz */ unsigned int freq_band; unsigned int vif_index; char phy_threshold; unsigned int pri_ch_offset; } __NRF_WIFI_PKD; /*! * struct cmd_vif_cfg - Command used to change configuration parameters for an * interface. * @hal_hdr: Host-Firmware message header. * @lmac_hdr: Host-Firmware message header (id field needs to be set to * LMAC_CMD_VIF_CFG). * @changed_bitmap: Bitmap of the parameters that have changed. * @basic_rate_set: Bitmap of supported basic rates. * @use_short_slot: Set to use short slot, unset to use long slot. * @atim_window: Adhoc Traffic Indication Map window. * @aid: Association ID, useful in recognizing the buffered packets at AP when * station is in power save. * @capability: The latest capability information to be programmed to firmware, * when capabilities have changed. * * @short_retry: Number of retries to be tried for "short" frames (used only * for the packets initiated by LMAC). * @long_retry: Number of retries to be tried for "long" frames (used only * for the packets initiated by LMAC). * @bcn_mode: Beacon filtering mode. * @dtim_period: This value is in terms of multiple of beacon intervals. * A station in power save mode should wake up from sleep and * listen to DTIM beacons. * @beacon_interval: This field informs the beacon sending time(in ms). * Useful in AP /IBSS mode * @if_index: Index of the interface on which the parameters are to be * configured. * @vif_addr: MAC address of the interface. * @bssid: BSSID of the network. * @smps_info: Used to configure SMPS information (SMPS enabled/SMPS mode) * @connect_state: Connection status (connected/disconnected) of the interface. * @op_channel: Operating channel of the interface. * * This Command used to program configuration parameters like basic rate set, * power save mode etc. in the firmware, for an interface. This command is * issued by the Host driver, whenever configuration parameters are changed. */ struct lmac_cmd_vif_cfg { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; /* Bitmap indicating whether value is changed or not */ #define BASICRATES_CHANGED (1<<0) #define SHORTSLOT_CHANGED (1<<1) #define POWERSAVE_CHANGED (1<<2) /* to be removed */ #define UAPSDTYPE_CHANGED (1<<3) /* to be removed */ #define ATIMWINDOW_CHANGED (1<<4) #define AID_CHANGED (1<<5) #define CAPABILITY_CHANGED (1<<6) #define SHORTRETRY_CHANGED (1<<7) #define LONGRETRY_CHANGED (1<<8) #define BSSID_CHANGED (1<<9) #define RCV_BCN_MODE_CHANGED (1<<10) #define BCN_INT_CHANGED (1<<11) #define DTIM_PERIOD_CHANGED (1<<12) #define SMPS_CHANGED (1<<13) #define CONNECT_STATE_CHANGED (1<<14) #define OP_CHAN_CHANGED (1<<15) unsigned int changed_bitmap; /* bitmap of supported basic rates */ unsigned int basic_rate_set; /* slot type - * 0 - long slot * 1 - short slot */ unsigned int use_short_slot; /* ATIM window */ unsigned int atim_window; unsigned int aid; unsigned int capability; unsigned int short_retry; unsigned int long_retry; #define RCV_ALL_BCNS 0 #define RCV_ALL_NETWORK_ONLY 1 #define RCV_NO_BCNS 2 unsigned int bcn_mode; unsigned char dtim_period; unsigned int beacon_interval; /* index of the intended interface */ unsigned int if_index; unsigned char vif_addr[ETH_ALEN]; /* bssid of interface */ unsigned char bssid[ETH_ALEN]; unsigned char mbssid_flag; unsigned char mbssid[ETH_ALEN]; /* SMPS Info * * bit0 - 0 - Disabled, 1 - Enabled * bit1 - 0 - Static, 1 - Dynamic * */ #define SMPS_ENABLED BIT(0) #define SMPS_MODE BIT(1) unsigned char smps_info; #define STA_CONN 0 #define STA_DISCONN 1 unsigned char connect_state; unsigned char op_channel; } __NRF_WIFI_PKD; /*! * struct cmd_txq_params - Command used to set transmission queue parameters. * @hal_hdr: Host-Firmware message header. * @lmac_hdr: Host-Firmware message header (id field needs to be set to * LMAC_CMD_TXQ_PARAMS). * @queue_num: The queue number for this queue. * @aifsn: Arbitration inter-frame spacing number for the queue. * @txop: Transmit Opportunity limit for the queue. * @cwmin: Minimum size of contention window * @cwmax: Maximum size of contention window * @uapsd: Power save mode (0 for legacy mode and 1 for UAPSD) * @if_index: Interface index. * @vif_addr: MAC address of the interface. * * This command is used to set transmission queue parameters. There are five * transmission queues; Background, Best Effort, Video, Voice and Beacon. */ struct lmac_cmd_txq_params { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned int queue_num; unsigned int aifsn; unsigned int txop; unsigned int cwmin; unsigned int cwmax; /* power save mode - * 0 - indicates legacy mode powersave, 1 - indicates UAPSD for the * corresponding AC. */ unsigned int uapsd; unsigned int if_index; unsigned char vif_addr[ETH_ALEN]; } __NRF_WIFI_PKD; /*! * struct cmd_msrmnt_start - Command used to initiate a measurement on a * channel. * @hal_hdr: Host-Firmware message header. * @lmac_hdr: Host-Firmware message header (id field needs to be set to * LMAC_CMD_MEASURE). * @start_time: Time when to initiate the measurement. * @msr_dur: Duration for which the measurement is to be carried out. * * This command is used to start a channel measurement. It checks for radar * detection and if radar is detected, channel measurement report is sent to * AP. This command is valid only when 802.11h (DFS) support is enabled. */ struct lmac_cmd_msrmnt_start { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned char start_time[8]; unsigned short msr_dur; } __NRF_WIFI_PKD; /*! * struct lmac_cmd_tx_deinit - command to clear pending tx packets in rpu * the Firmware. * @hal_hdr: Host-Firmware message header. * @lmac_hdr: Host-Firmware message header * @peer_addr: vif address * This command is used to provide Bluetooth related information to the Firmware * (for Bluetooth coexistence). */ struct lmac_cmd_tx_deinit { struct lmac_msg_hdr lmac_hdr; unsigned int if_index; unsigned char peer_addr[ETH_ALEN]; } __NRF_WIFI_PKD; enum LMAC_SLEEP_STATUS { SLEEP_REQ_SUCCESS = 0, SLEEP_REQ_FAIL, }; /*! * struct lmac_cmd_sleep_status - This is the command from umac in response to lmac_sleep_event * @hal_hdr: Host-Firmware message header. * @hal_hdr: Host-Firmware message header * @lmac_hdr: Host-Firmware message header (id field needs to be set to LMAC_EVENT_TX_DONE). * @status: status */ struct lmac_cmd_sleep_status { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; enum LMAC_SLEEP_STATUS status; } __NRF_WIFI_PKD; #define TWT_NEGOTIATION_TYPE_INDIVIDUAL 0 #define TWT_NEGOTIATION_TYPE_BROADCAST 2 /*! * struct lmac_cmd_config_twt - This is the command from umac to configure TWT params * @hal_hdr: Host-Firmware message header. * @lmac_hdr: Host-Firmware message header (id field needs to be set to LMAC_EVENT_TX_DONE). * @config_ctrl: Add TWT(0) or Delete TWT(1) * @negotiation_type: Individual(0) or Broadcast(2) * @flow_type: Wether STA has to send the PS-Poll/Null frame * indicating that it's in wake period(NRF_WIFI_TWT_FLOW_TYPE_ANNOUNCED) * @trigger: trigger is enabled/disabled * @twt_target_wake_interval_exponent: wake interval exponent value * @twt_target_wake_interval_mantissa: wake interval mantissa value * @target_wake_time: start of the waketime value after successful TWT negotiation * @nominal_min_twt_wake_duration: min TWT wake duration */ struct lmac_cmd_config_twt { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned char config_ctrl; unsigned char negotiation_type; unsigned char flow_type; unsigned char flow_id; unsigned char trigger; unsigned char twt_target_wake_interval_exponent; unsigned short twt_target_wake_interval_mantissa; unsigned long long target_wake_time; unsigned short nominal_min_twt_wake_duration; } __NRF_WIFI_PKD; /*! * struct lmac_event_tx_done - Event used to signal the completion of * a transmission request for one or more frames. * @hal_hdr: Host-Firmware message header * @lmac_hdr: Host-Firmware message header (id field needs to be set to * LMAC_EVENT_TX_DONE). * @pdout_voltage: Aux ADC reading. (Used only during FTM.) * @frm_status: Status of transmitted frames. * @retries_num: Number of times a frame transmission was retried. * @rate: This is the rate at which TX frame was successfully transmitted. * (rate = Units of 500 Kbps or MCS index = 0 to 7). * @queue: Access category of the transmitted frame. * @descriptor_id: Token ID of the transmitted frame, used to match to the * CMD_TX. * @reserved: Reserved bytes for padding. * * This event is used by the Firmware to signal the completion of a * tranmsission request of frame(s) to the Host. It also contains the * transmission Success/Failure information for each frame. */ struct lmac_event_tx_done { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned char pdout_voltage; /* frame_status - * 0 - success * 1 - discarded due to retry limit exceeded * 2 - discarded due to msdu lifetime expiry * 3 - discarded due to encryption key not available */ #define TX_DONE_STAT_SUCCESS (0) #define TX_DONE_STAT_ERR_RETRY_LIM (1) #define TX_DONE_STAT_MSDU_LIFETIME (2) #define TX_DONE_STAT_KEY_NOT_FOUND (3) #define TX_DONE_STAT_DISCARD (4) #define TX_DONE_STAT_DISCARD_BCN (5) #define TX_DONE_STAT_DISCARD_CHSW (6) #define TX_DONE_STAT_DISCARD_OP_TX (7) #define UNABLE_TO_PROCESS_TX (8) #define BLOCK_TX_IN_TWT_SLEEP_WINDOW (9) unsigned char frm_status[MAX_TX_CMDS]; unsigned char retries_num[MAX_TX_CMDS]; /* rate = Units of 500 Kbps or mcs index = 0 to 7 */ unsigned char rate[MAX_TX_CMDS]; unsigned char queue; unsigned int descriptor_id; unsigned char timeStamp_t1[6]; unsigned char timeStamp_t4[6]; } __NRF_WIFI_PKD; /*! * struct lmac_event_ch_prog_complete - Event used to signal the completion of * channel programming command. * @hal_hdr: Host-Firmware message header * @lmac_hdr: Host-Firmware message header (id field needs to be set to * LMAC_EVENT_CH_PROG_DONE). * * This event is used by the Firmware to inform the Host about the completion * of the channel programming action in response to the LMAC_CMD_CHANNEL * command issued before. During the channel switch the Host should not issue * any other commands. */ struct lmac_event_ch_prog_complete { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; } __NRF_WIFI_PKD; /*! * struct lmac_event_noa - Event used to notify that the P2P GO to which we are * connected has gone into Power Save mode. * @hal_hdr: Host-Firmware message header * @lmac_hdr: Host-Firmware message header (id field needs to be set to * LMAC_EVENT_NOA). * @if_index: Virtual interface index number. * @vif_addr: MAC address of the virtual interface. * @noa_active: Indicates whether NOA is active or not. * @ap_present: Indicates whether AP is present or not. * * This event is used to inform the Host about the absence of GO due to GO mode * power save in P2P. After receiving this event with ap_absent true, station * should refrain from transmitting frames. In this mode, a station can start * TX only after NOA event with ap_absent is set to false. */ struct lmac_event_noa { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned int if_index; unsigned char vif_addr[ETH_ALEN]; /* 1 indicates NoA feature is active * 0 indicates NoA feature is not active */ unsigned int noa_active; #define ABSENCE_START 0 /* Indicates AP is absent */ #define ABSENCE_STOP 1 /* Indicates AP is present */ unsigned int ap_present; } __NRF_WIFI_PKD; /*! * struct host_event_scanres - Event used to inform the Host, about completion * of the processing of the LMAC_CMD_SCAN received * before. * @hal_hdr: Host-Firmware message header * @lmac_hdr: Host-Firmware message header (id field needs to be set to * LMAC_EVENT_SCAN_COMPLETE). * @if_index: Index of the interface on which the LMAC_CMD_SCAN was processed. * @fwScanCompleteCnt : debug variable * This event is used by the Firmware to inform the Host about the completion * of the scan operation which the Host would have initiated earlier using the * LMAC_CMD_SCAN command. */ struct lmac_event_scanres { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; int if_index; unsigned int fwScanCompleteCnt; } __NRF_WIFI_PKD; /*! * struct host_event_disconnect - Event used to inform the Host, about a disconnection. * @hal_hdr: Host-Firmware message header * @lmac_hdr: Host-Firmware message header (id field needs to be set to * LMAC_EVENT_DISCONNECTED). * @if_index: Index of the interface on which the disconnection happened. * @reason_code: Reason for disconnection. * @mac_addr: MAC address of the peer which got disconnected. * * This event is used by the Firmware to inform the Host about the disconnection * of a peer along with the reason for disconnection. */ struct lmac_event_disconnect { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; int if_index; #define REASON_DEAUTH 1 #define REASON_AUTH_FAILURE 2 #define REASON_NW_LOST 3 #define REASON_AUTH_TIMEOUT 4 #define REASON_TX_TOKEN_NOTAVAIL 5 #define REASON_ASSOC_TIMEOUT 6 unsigned int reason_code; unsigned char mac_addr[ETH_ALEN]; } __NRF_WIFI_PKD; /*! * struct host_event_reset_complete - Event used to inform the Host, about a * completion of a reset command. * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: Host-Firmware message header (id field needs to be set to * LMAC_EVENT_RESET_COMPLETE). * @unused: Unused * @version: Firmware version number. * * This event is used by the Firmware to inform the Host about the completion of * a reset command (LMAC_CMD_RESET) which the Host would have sent earlier. */ struct lmac_event_reset_complete { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned int version; } __NRF_WIFI_PKD; /*! * struct lmac_event_roc_status - Event used to inform host about the status of * a Remain-On-Channel(ROC) operation. * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: Host-Firmware message header (id field needs to be set to * LMAC_EVENT_ROC_STATUS). * @roc_status: Status of the ROC operation (Started/Stopped/Done). * * This event is used by the Firmware to provide the ROC related * information to the Host i.e. whether ROC has been started, stopped or has * completed in response to the previous LMAC_CMD_ROC_CTRL command issued by the * Host. * ROC is applicable only for P2P Mode. */ struct lmac_event_roc_status { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned int roc_status; } __NRF_WIFI_PKD; /*! * struct lmac_event_ps_econ_wake - Event used by Firmware to indicate a * Economy mode wakeup event to the * host. * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: Host-Firmware message header (id field needs to be set to * LMAC_EVENT_PS_ECON_WAKE). * @trigger: Indicates the trigger event which caused the wakeup. * * This event is used to indicate an Economy mode wakeup event to the Host. It * also includes information about the actual trigger which caused the wakeup. */ struct lmac_event_ps_econ_wake { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; enum LMAC_PS_ECON_WAKE_TRIG trigger; } __NRF_WIFI_PKD; /*! * struct lmac_event_ps_econ_cfg_complete - Event used by Firmware to indicate * that the firmware has finished * processing the LMAC_CMD_PS_ECON_CFG * command. * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n * @status: Indicates the whether the LMAC_CMD_PS_ECON_CFG was processesed * successfully or not. \n * * This event indicates that the firmware has finished processing the * LMAC_CMD_PS_ECON_CFG command and the driver can return control back * to mac80211 to complete the suspend/resume. */ struct lmac_event_ps_econ_cfg_complete { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned char status; /* SUCCESS/FAILURE */ } __NRF_WIFI_PKD; /*! * struct lmac_event_msrmnt_complete - Event generated on measurement completion with measurement status \n * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n * @msrmnt_status: status code */ struct lmac_event_msrmnt_complete { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; /* MSR MNT STAUTS - * For bit representation Refer 7.3.2.22.1 of Std 802.11h-2003 */ #define LMAC_EVENT_MSRMNT_STATUS_BSS (0x01) #define LMAC_EVENT_MSRMNT_STATUS_OFDM_PREAMBLE (0x02) #define LMAC_EVENT_MSRMNT_STATUS_UNIDENTIFIED_SIGNAL (0x04) #define LMAC_EVENT_MSRMNT_STATUS_RADAR_SIGNAL (0x08) #define LMAC_EVENT_MSRMNT_STATUS_NO_MSRMNT (0x10) #define LMAC_EVENT_MSRMNT_STATUS_LATE (0x20) #define LMAC_EVENT_MSRMNT_STATUS_INCAPABLE (0x40) #define LMAC_EVENT_MSRMNT_STATUS_REFUSE (0x80) unsigned int msrmnt_status; } __NRF_WIFI_PKD; /*! * struct lmac_event_ch_switch_complete - channel programming complete event fro rpu * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n * @status: status code */ struct lmac_event_ch_switch_complete { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; int status; } __NRF_WIFI_PKD; /*! * struct lmac_event_tx_deinit_done - deinit status info from RPU to host * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n * @status: deinit status code */ struct lmac_event_tx_deinit_done { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; enum TX_DEINIT_DONE_STATUS status; } __NRF_WIFI_PKD; /*! * struct rx_mpdu_ctrl_info - per packet control info of rx event \n * @skb_pointer: skb pointer value \n * @skb_desc_no: desc number \n * @pkt_type: mac header offset \n * @rx_pkt_len: packet length \n * @rxPktStatus: rx packet decode status \n */ struct rx_mpdu_ctrl_info { /* skb data will have complete mpdu from FCF */ unsigned int skb_pointer; unsigned short skb_desc_no; /* Offset value which points to mac header of * the frame from skb_pointr */ unsigned char pkt_type; /* Packet length */ unsigned short rx_pkt_len; #define DECRYPTION_SUCCESS 0 #define CCMP_MIC_FAILURE 1 #define TKIP_MIC_FAILURE 2 #define GCMP_MIC_FAILURE 3 #define WAPI_MIC_FAILURE 4 unsigned char rxPktStatus; } __NRF_WIFI_PKD; /** * struct rx_buffer_ctrl_info - skb pointer sub structure \n * @skb_pointer: skb pointer value \n * @skb_desc_no: desc number \n */ struct rx_buffer_ctrl_info { /* skb data will have complete mpdu from FCF */ unsigned int skb_pointer; unsigned short skb_desc_no; } __NRF_WIFI_PKD; /*! * struct wlan_event_rx - RX event info from LMAC * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n * @rx_pkt_cnt: Number of rx packets in event * @dest_rx_pkt: Destination memory of the current event. Set to 1 if * the packet is stored in gram and skb_pointer * variable contains gram pointers * @skb_pointer: list of skb pointers. Wifi packet is present in this pointers * @rx_align_offset: Align offset for skbs.Firmware will align skb pointer * to have word aligned pointer for Payload * portion of mpdu * @rx_pkt_len: Rx packet lengths including mac header. * @gram_ptr: Gram pointer list for mac header. LMAC will trasfer * mac header to gram also for umac processing. * @l3_l4_chesum_status:l3 and l4 checksum status. Will have info if checksum * is calculated if yes, status of checksum * @rate_or_mcs: Most significant bit set to 1 implies rate * is MCS rate otherwise legacy rate. * @rssi: RSSI strength for this packet in dBm. * @rate_flags: Control info related to rate at which the frame is received. * @nss: Number of Spatial Streams. * @num_sts: Number of Space Time Streams. * @timestamp: Time at which the packet was received. * @stbc_enabled: Indication of whether packet is received using STBC * @ldpc_enabled: Indication of whether packet is received using LDPC * @channel: Channel number. * @mpdu_ctrl: rx buffer control info * */ struct lmac_event_rx { struct host_rpu_msg_hdr hal_hdr; /* Mostly this data is present in gram. * host has to read in soft mac case. * umac can direclty access */ struct lmac_msg_hdr lmac_hdr; /* number packets in current event min 1 * and max HAL_INT_EVENT_MAX_RX */ unsigned int rx_pkt_cnt; /* set to 0 if skb_pointer is DDR or * set to 1 if skb_pointer is GRAM. */ unsigned int dest_rx_pkt; /*Current RX packet cipher Suite mpduOvrHead is mac header and encryption lmac_hdr length will contain only mac header length for plain packets */ unsigned char mpduOvrHead; /* First 52 bytes of each packet is stored in * gram pointers for umac */ /* bit[8] = 0 - legacy data rate * = 1 - MCS index */ unsigned char rate_or_mcs; /* RSSI in dbm */ char rssi; #define ENABLE_GREEN_FIELD 0x01 #define ENABLE_CHNL_WIDTH_40MHZ 0x02 #define ENABLE_SGI 0x04 #define ENABLE_11N_FORMAT 0x08 #define ENABLE_VHT_FORMAT 0x10 #define ENABLE_CHNL_WIDTH_80MHZ 0x20 #define ENABLE_HE_SU 0x40 unsigned char rate_flags; unsigned char nss; unsigned char num_sts; unsigned char timestamp[8]; unsigned char timestamp_t2[6]; unsigned char timestamp_t3[6]; unsigned char stbc_enabled; unsigned char ldpc_enabled; unsigned char channel; struct rx_mpdu_ctrl_info mpdu_ctrl[HAL_INT_EVENT_MAX_RX]; } __NRF_WIFI_PKD; /*! * struct lmac_event_fw_error - RPU debug stats event to host \n * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n * @errorStatus: LMAC error status code */ struct lmac_event_fw_error { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; enum LMAC_ERROR_ID errorStatus; } __NRF_WIFI_PKD; /*! * struct lmac_event_stats - RPU debug stats event to host \n * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n * @type: sleep debug stats type( MAC or PHY) * @stats: debug stats */ struct lmac_event_stats { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; enum STATS_TYPE type; union rpu_stats stats; } __NRF_WIFI_PKD; /*! * struct lmac_cmd_get_stats - command to get debug stats from RPU \n * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n * @type: sleep debug stats type( MAC or PHY) */ struct lmac_cmd_get_stats { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; enum STATS_TYPE type; } __NRF_WIFI_PKD; /*! * struct lmac_sleep_event - event to inform sleep request to UMAC. umac is expected to convey sleep status back as a response \n * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n */ struct lmac_sleep_event { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; } __NRF_WIFI_PKD; /*! * struct lmac_sleep_event - event to inform sleep request to UMAC. umac is expected to convey sleep status back as a response \n * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n */ struct lmac_twt_sleep_event { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; #define TWT_BLOCK_TX 0 #define TWT_UNBLOCK_TX 1 unsigned int type; unsigned char vif_addr[ETH_ALEN]; } __NRF_WIFI_PKD; /*! * struct lmac_twt_teadrdown_event - event to inform twt sleep request to UMAC. umac is expected to convey sleep status back as a response for BLOCK_TX \n * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n */ struct lmac_twt_teardown_event { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; #define INVALID_TSF 0 #define OUT_OF_SYNC 1 #define DELAY_IN_TWT_UMAC_SLEEP_RESPONSE 2 #define INVALID_TWT_WAKE_INTERVAL 3 unsigned char reason_code; unsigned char flow_id; } __NRF_WIFI_PKD; /* struct lmacCmdSubmitRxBuffer - command to resubmit skb pointers which are used by UMAC \n * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n * @rxBufCnt: number of buffers \n * @buffCtrl: skb pointers */ struct lmacCmdSubmitRxBuffer { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned int rxBufCnt; struct rx_buffer_ctrl_info buffCtrl[HAL_INT_EVENT_MAX_RX]; } __NRF_WIFI_PKD; /*! * struct lmac_evnt_proc_done - command proc done event to host \n * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n */ struct lmac_evnt_proc_done { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; } __NRF_WIFI_PKD; /*! * struct lmac_cmd_scan_ie - Commnad to pass scan ies \n * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n * @extra_ies_len: scan ies length \n * @extra_ies: scan ies */ struct lmac_cmd_scan_ie { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned int extra_ies_len; unsigned char extra_ies[0]; } __NRF_WIFI_PKD; /*! * struct lmac_cmd_pwr_mon - Power monitor status event \n * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n * @ctrl: Control info */ struct lmac_cmd_pwr_mon { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; int ctrl; } __NRF_WIFI_PKD; /*! * struct lmac_event_pwr_mon_data - Power monitor status event \n * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n * @mon_status: Power monitor command status info \n * @data_type: Data \n * @lfc_err: lfs error info \n * @vbat_mon: vbat monitor value \n * @temp: Measured temp value \n * */ struct lmac_event_pwr_mon_data { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; int mon_status; int data_type; int lfc_err; int vbat_mon; int temp; } __NRF_WIFI_PKD; /*! * struct lmac_cmd_coex_config - \n * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n * @len: Command length \n * @cmd: command pointer \n */ struct lmac_cmd_coex_config { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned int len; unsigned char cmd[0]; } __NRF_WIFI_PKD; /*! * struct lmac_event_coexMgr - \n * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n * @len: Event length \n * @event: Event pointer \n */ struct lmac_event_coexMgr { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned int len; unsigned char event[0]; } __NRF_WIFI_PKD; struct lmac_cmd_rftest { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned int len; unsigned char cmd[0]; } __NRF_WIFI_PKD; struct lmac_event_rftest { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned int len; unsigned char event[0]; } __NRF_WIFI_PKD; /*! * struct lmac_cmd_phySpatialReuseParams - \n * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n * @coex_cmd_ctrl: Command config control\n * @bt_mode: Bt mode slave/master \n * @pta_params: config params \n * */ struct lmac_cmd_phy_spatial_reuse_params { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned int if_index; unsigned char nonSrgObssPdSrEnable; unsigned char srgObssPdSrEnable; unsigned char nonSrgObssPdLevel; unsigned char srgObssPdLevel; unsigned char srgPartialIdBitMap[8]; unsigned char srgBssColorBitMap[8]; unsigned char vhtBssColorEnable; } __NRF_WIFI_PKD; /*! * struct lmac_cmd_configMacParams - \n * @hal_hdr: Host-Firmware message header \n * @lmac_hdr: lmac message header \n * @coex_cmd_ctrl: Command config control\n * @bt_mode: Bt mode slave/master \n * @pta_params: config params \n * */ struct lmac_cmd_config_mac_params { struct host_rpu_msg_hdr hal_hdr; struct lmac_msg_hdr lmac_hdr; unsigned int if_index; unsigned short partialAid; unsigned char bssColor; unsigned short staId; unsigned short vhtBssIdPortion; } __NRF_WIFI_PKD; #endif /*_LMAC_IF_*/