Common

The common API is used for both normal operation and Radio Test mode.

Header file: nrf_wifi/fw_if/umac_if/inc/fmac_structs_common.h
Source file: nrf_wifi/fw_if/umac_if/src/fmac_api_common.c
group nrf_wifi_api_common

Header containing API declarations for the FMAC IF Layer of the Wi-Fi driver.

Header containing declarations for utility functions for FMAC IF Layer of the Wi-Fi driver.

Defines

MIN(a, b)
NRF_WIFI_FW_CHUNK_ID_STR_LEN
MAX_NUM_REG_CHANELS

Functions

struct nrf_wifi_fmac_dev_ctx *nrf_wifi_fmac_dev_add(struct nrf_wifi_fmac_priv *fpriv, void *os_dev_ctx)

Adds a RPU instance.

This function adds an RPU instance. This function will return the pointer to the context of the RPU instance. This pointer will need to be supplied while invoking further device specific APIs, for example, nrf_wifi_fmac_scan() etc.

Parameters:
  • fpriv – Pointer to the context of the UMAC IF layer.

  • os_dev_ctx – Pointer to the OS specific context of the RPU instance.

Returns:

Pointer to the context of the RPU instance.

enum nrf_wifi_status nrf_wifi_fmac_stats_get(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx, enum rpu_op_mode op_mode, struct rpu_op_stats *stats)

Issue a request to get stats from the RPU.

This function is used to send a command to instruct the firmware to return the current RPU statistics. The RPU will send the event with the current statistics.

Parameters:
  • fmac_dev_ctx – Pointer to the UMAC IF context for a RPU WLAN device.

  • op_mode – RPU operation mode.

  • stats – Pointer to memory where the stats are to be copied.

Returns:

Command execution status

enum nrf_wifi_status nrf_wifi_validate_fw_header(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx, struct nrf70_fw_image_info *info)

Validate the firmware header.

Parameters:
  • fmac_dev_ctx – Pointer to the UMAC IF context for a RPU WLAN device.

  • info – Pointer to the address where the firmware information needs to be copied.

Returns:

Command execution status

enum nrf_wifi_status nrf_wifi_fmac_fw_parse(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx, const void *fw_data, unsigned int fw_size, struct nrf_wifi_fmac_fw_info *fw_info)

Parse the Firmware(s) to be loaded to the RPU WLAN device.

Parameters:
  • fmac_dev_ctx – Pointer to the UMAC IF context for a RPU WLAN device, which was passed as fmac_dev_ctx parameter via the add_dev_callbk_fn() callback function.

  • fw_data – Pointer to the address where the firmware data is available.

  • fw_size – Size of the firmware data.

  • fw_info – Pointer to the address where the firmware information needs to be copied.

Returns:

Command execution status

enum nrf_wifi_status nrf_wifi_fmac_fw_reset(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx)

Reset the processors in the RPU WLAN device.

This function resets the processors in the RPU WLAN device.

Parameters:
  • fmac_dev_ctx – Pointer to the UMAC IF context for a RPU WLAN device, which was passed as fmac_dev_ctx parameter via the add_dev_callbk_fn() callback function.

Returns:

Command execution status

enum nrf_wifi_status nrf_wifi_fmac_fw_boot(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx)

Boot the Firmware(s) to the RPU WLAN device.

This function boots the FullMAC firmware(s) to the RPU WLAN device and waits for the boot to complete and validate the boot signature.

Parameters:
  • fmac_dev_ctx – Pointer to the UMAC IF context for a RPU WLAN device, which was passed as fmac_dev_ctx parameter via the add_dev_callbk_fn() callback function.

Returns:

Command execution status

enum nrf_wifi_status nrf_wifi_fmac_fw_chunk_load(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx, enum RPU_PROC_TYPE rpu_proc, struct nrf_wifi_fmac_fw_chunk_info *fw_chunk)

Load a chunk of the Firmware to the RPU WLAN device.

This function loads a chunk of the firmware to the RPU WLAN device.

Parameters:
  • fmac_dev_ctx – Pointer to the UMAC IF context for a RPU WLAN device, which was passed as fmac_dev_ctx parameter via the add_dev_callbk_fn() callback function.

  • rpu_proc – RPU processor type.

  • fw_chunk – Pointer to the address where the firmware chunk information is available.

Returns:

Command execution status

enum nrf_wifi_status nrf_wifi_fmac_fw_load(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx, struct nrf_wifi_fmac_fw_info *fmac_fw)

Loads the Firmware(s) to the RPU WLAN device.

This function loads the FullMAC firmware(s) to the RPU WLAN device.

Parameters:
  • fmac_dev_ctx – Pointer to the UMAC IF context for a RPU WLAN device, which was passed as fmac_dev_ctx parameter via the add_dev_callbk_fn() callback function.

  • fmac_fw – Information about the FullMAC firmware(s) to be loaded.

Returns:

Command execution status

enum nrf_wifi_status nrf_wifi_fmac_ver_get(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx, unsigned int *fw_ver)

Get FW versions from the RPU.

This function is used to get Firmware versions from the RPU.

Parameters:
  • fmac_dev_ctx – Pointer to the UMAC IF context for a RPU WLAN device.

  • fw_ver – Pointer to the address where the FW versions needs to be copied.

Returns:

Command execution status

enum nrf_wifi_status nrf_wifi_fmac_conf_ltf_gi(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx, unsigned char he_ltf, unsigned char he_gi, unsigned char enabled)

Configure HE LTF and GI parameters.

This function is used to send a command to RPU to configure HE LTF and GI parameters in RPU.

Parameters:
  • fmac_dev_ctx – Pointer to the UMAC IF context for a RPU WLAN device.

  • he_ltf – HE LTF parameter which will be configured in RPU.

  • he_gi – HE GI parameter which will be configured in RPU.

  • enabled – enable/disable HE LTF and GI parameter configured.

Returns:

Command execution status

enum nrf_wifi_status nrf_wifi_fmac_conf_srcoex(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx, void *cmd, unsigned int cmd_len)

Configure SR coexistence parameters in RPU.

This function is used to send a command to RPU to configure SR coexistence parameters in RPU.

Parameters:
  • fmac_dev_ctx – Pointer to the UMAC IF context for a RPU WLAN device.

  • cmd – SR coexistence parameters which will be configured in RPU.

  • cmd_len – Command length.

Returns:

Command execution status

enum nrf_wifi_status nrf_wifi_fmac_set_mcast_addr(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx, unsigned char if_idx, struct nrf_wifi_umac_mcast_cfg *mcast_info)

Set the Multicast filter address.

This function is used to send a command (NRF_WIFI_UMAC_CMD_MCAST_FILTER) to instruct the firmware to set the multicast filter address to an interface with index if_idx and parameters specified by mcast_info.

Parameters:
  • fmac_dev_ctx – Pointer to the UMAC IF context for a RPU WLAN device.

  • if_idx – Index of the interface whose state needs to be changed.

  • mcast_info – Multicast information to be set.

Returns:

Command execution status

enum nrf_wifi_status nrf_wifi_fmac_otp_mac_addr_get(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx, unsigned char vif_idx, unsigned char *mac_addr)

Fetch MAC address from OTP.

This function is used to fetch MAC address from the OTP.

Parameters:
  • fmac_dev_ctx – Pointer to the UMAC IF context for a RPU WLAN device.

  • vif_idx – Interface index for which the MAC address is to be fetched.

  • mac_addr – Pointer to the address where the MAC address needs to be copied.

Returns:

Command execution status

enum nrf_wifi_status nrf_wifi_fmac_rf_params_get(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx, struct nrf_wifi_phy_rf_params *rf_params)

Get the RF parameters to be programmed to the RPU.

This function is used to fetch RF parameters information from the RPU and update the default RF parameter with the OTP values. The updated RF parameters are then returned in the f_params.

Parameters:
  • fmac_dev_ctx – Pointer to the UMAC IF context for a RPU WLAN device.

  • rf_params – Pointer to the address where the RF params information needs to be copied.

Returns:

Command execution status

enum nrf_wifi_status nrf_wifi_fmac_set_reg(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx, struct nrf_wifi_fmac_reg_info *reg_info)

Set regulatory domain in RPU.

Parameters:
  • fmac_dev_ctx – Pointer to the UMAC IF context for a RPU WLAN device.

  • reg_info – Pointer to the address where the regulatory domain information. needs to be copied. This function is used to set regulatory domain in the RPU.

Returns:

Command execution status

enum nrf_wifi_status nrf_wifi_fmac_get_reg(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx, struct nrf_wifi_fmac_reg_info *reg_info)

Get regulatory domain from RPU.

Parameters:
  • fmac_dev_ctx – Pointer to the UMAC IF context for a RPU WLAN device.

  • reg_info – Pointer to the address where the regulatory domain information. needs to be copied. This function is used to get regulatory domain from the RPU.

Returns:

Command execution status

enum nrf_wifi_status nrf_wifi_fmac_get_power_save_info(void *fmac_dev_ctx, unsigned char if_idx)

Get the current power save information.

This function is used to send a command to RPU to Enable/Disable WLAN Power management.

Parameters:
  • fmac_dev_ctx – Pointer to the UMAC IF context for a RPU WLAN device.

  • if_idx – Index of the interface on which power management is to be set.

Returns:

Command execution status

int nrf_wifi_phy_rf_params_init(struct nrf_wifi_osal_priv *opriv, struct nrf_wifi_phy_rf_params *prf, unsigned int package_info, unsigned char *str)

Initialize RF parameters.

This function is used to initialize the RF parameter structure with the XO, power ceiling info, voltage and temperature based backoffs etc.

Parameters:
  • opriv – Pointer to the OSAL context.

  • prf – Pointer to the RF parameter structure.

  • package_info – Package information, QFN, CSP etc.

  • str – String of RF params

struct rpu_host_stats
#include <fmac_structs_common.h>

Structure to hold host specific statistics.

Public Members

unsigned long long total_tx_pkts

Total number of TX frames transmitted.

unsigned long long total_tx_done_pkts

Total number of TX dones received.

unsigned long long total_tx_drop_pkts

Total number of TX frames dropped.

unsigned long long total_rx_pkts

Total number of RX frames received.

unsigned long long total_rx_drop_pkts

Total number of RX frames dropped.

struct rpu_op_stats
#include <fmac_structs_common.h>

  • Structure to hold per device host and firmware statistics.

Public Members

struct rpu_host_stats host

Host statistics.

struct rpu_fw_stats fw

Firmware statistics.

struct nrf_wifi_fw_info
#include <fmac_structs_common.h>

Structure to hold FW patch information.

Public Members

const void *data

Pointer to the FW patch data.

unsigned int size

Size of the FW patch data.

struct nrf_wifi_fmac_fw_info
#include <fmac_structs_common.h>

Structure to hold FW patch information for LMAC and UMAC.

Public Members

struct nrf_wifi_fw_info lmac_patch_pri

Primary LMAC FW patch information.

struct nrf_wifi_fw_info lmac_patch_sec

Secondary LMAC FW patch information.

struct nrf_wifi_fw_info umac_patch_pri

Primary UMAC FW patch information.

struct nrf_wifi_fw_info umac_patch_sec

Secondary UMAC FW patch information.

struct nrf_wifi_fmac_fw_chunk_info
#include <fmac_structs_common.h>

Structure to hold FW patch chunk information.

Public Members

char id_str[16]

Pointer to the FW patch chunk ID string.

const void *data

Pointer to the FW patch chunk data.

unsigned int size

Size of the FW patch chunk data.

unsigned int dest_addr

Destination address of the FW patch chunk data.

struct nrf_wifi_fmac_otp_info
#include <fmac_structs_common.h>

Structure to hold OTP region information.

Public Members

struct host_rpu_umac_info info

OTP region information.

unsigned int flags

Flags indicating which OTP regions are valid.

struct nrf_wifi_fmac_reg_info
#include <fmac_structs_common.h>

Structure to hold Regulatory parameter data.

Public Members

unsigned char alpha2[NRF_WIFI_COUNTRY_CODE_LEN]

ISO IEC Country code.

bool force

Forcefully set regulatory.

unsigned int reg_chan_count

Regulatory channels count

struct nrf_wifi_get_reg_chn_info reg_chan_info[42]

Regulatory channel attributes

struct nrf_wifi_fmac_priv
#include <fmac_structs_common.h>

Structure to hold common fmac priv parameter data.

Public Members

struct nrf_wifi_osal_priv *opriv

Handle to the OS abstraction layer.

struct nrf_wifi_hal_priv *hpriv

Handle to the HAL layer.

char priv[]

Data pointer to mode specific parameters

struct nrf_wifi_fmac_dev_ctx
#include <fmac_structs_common.h>

Structure to hold common fmac dev context parameter data.

Public Members

struct nrf_wifi_fmac_priv *fpriv

Handle to the FMAC IF abstraction layer.

void *os_dev_ctx

Handle to the OS abstraction layer.

void *hal_dev_ctx

Handle to the HAL layer.

struct rpu_fw_stats *fw_stats

Firmware statistics.

bool stats_req

Firmware statistics requested.

bool fw_boot_done

Firmware boot done.

bool fw_init_done

Firmware init done.

bool fw_deinit_done

Firmware deinit done.

bool alpha2_valid

Alpha2 valid.

unsigned char alpha2[3]

Alpha2 country code, last byte is reserved for null character.

unsigned int reg_chan_count

Regulatory channels count

struct nrf_wifi_get_reg_chn_info *reg_chan_info

Regulatory channel attributes

int reg_set_status

Regulatory set status

struct nrf_wifi_event_regulatory_change *reg_change

Regulatory change event

struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params

TX power ceiling parameters

char priv[]

Data pointer to mode specific parameters