Wi-Fi mode

The Wi-Fi mode is used for normal operation of the nRF70 Series device in, for example, STA mode or other modes that are supported in the future.

Header file: nrf_wifi/fw_if/umac_if/inc/default/fmac_api.h
Source file: nrf_wifi/fw_if/umac_if/src/default/fmac_api.c
group nrf_wifi_api

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

MAX_PEERS
MAX_SW_PEERS
NRF_WIFI_AC_TWT_PRIORITY_EMERGENCY
NRF_WIFI_MAGIC_NUM_RAWTX

Enums

enum nrf_wifi_fmac_ac

WLAN access categories.

Values:

enumerator NRF_WIFI_FMAC_AC_BK

Background access category.

enumerator NRF_WIFI_FMAC_AC_BE

Best-effort access category.

enumerator NRF_WIFI_FMAC_AC_VI

Video access category.

enumerator NRF_WIFI_FMAC_AC_VO

Voice access category.

enumerator NRF_WIFI_FMAC_AC_MC

Multicast access category.

enumerator NRF_WIFI_FMAC_AC_MAX

Maximum number of WLAN access categories.

enum nrf_wifi_fmac_if_op_state

The operational state of an interface.

Values:

enumerator NRF_WIFI_FMAC_IF_OP_STATE_DOWN

Interface is non-operational.

enumerator NRF_WIFI_FMAC_IF_OP_STATE_UP

Interface is operational.

enumerator NRF_WIFI_FMAC_IF_OP_STATE_INVALID

Invalid value. Used for error checks.

enum nrf_wifi_fmac_if_carr_state

The carrier state of an interface.

Values:

enumerator NRF_WIFI_FMAC_IF_CARR_STATE_OFF

Interface is not ready.

enumerator NRF_WIFI_FMAC_IF_CARR_STATE_ON

Interface is ready.

enumerator NRF_WIFI_FMAC_IF_CARR_STATE_INVALID

Invalid value. Used for error checks.

Functions

struct nrf_wifi_fmac_priv *nrf_wifi_fmac_init(struct nrf_wifi_data_config_params *data_config, struct rx_buf_pool_params *rx_buf_pools, struct nrf_wifi_fmac_callbk_fns *callbk_fns)

Initializes the UMAC IF layer.

This function initializes the UMAC IF layer. It does the following:

  • Creates and initializes the context for the UMAC IF layer.

  • Initializes the HAL layer.

  • Initializes the OS abstraction Layer.

  • Initializes TX queue token sizes.

  • Initializes the RX buffer pool.

Parameters:
  • data_config – Pointer to configuration of data queues.

  • rx_buf_pools – Pointer to configuration of Rx queue buffers. See rx_buf_pool_params

  • callbk_fns – Pointer to callback functions for addressing events from the UMAC layer. e.g. callback function to process packet received from RPU firmware, scan result etc

Returns:

Pointer to the context of the UMAC IF layer.

enum nrf_wifi_status nrf_wifi_fmac_scan(void *fmac_dev_ctx, unsigned char if_idx, struct nrf_wifi_umac_scan_info *scan_info)

Issue a scan request to the RPU firmware.

This function is used to send a command to: Instruct the RPU firmware to trigger a scan. The scan can be performed in two modes:

Auto Mode (AUTO_SCAN): In this mode, the host does not need to specify any scan specific parameters. The RPU firmware will perform the scan on all the channels permitted by and abiding by the regulations imposed by the WORLD (common denominator of all regulatory domains) regulatory domain. The scan will be performed using the wildcard SSID.

Channel Map Mode (CHANNEL_MAPPING_SCAN): In this mode the host can have fine grained control over the scan specific parameters to be used (for example, Passive/Active scan selection, Number of probe requests per active scan, Channel list to scan, Permanence on each channel, SSIDs to scan etc.). This mode expects the regulatory restrictions to be taken care by the invoker of the API.

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

  • if_idx – Index of the interface on which the scan is to be performed.

  • scan_info – The parameters needed by the RPU for scan operation.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_scan_res_get(void *fmac_dev_ctx, unsigned char if_idx, int scan_type)

Issue a scan results request to the RPU firmware.

This function is used to send a command to:

  • Instruct the RPU firmware to return the results of a scan.

  • scan_type defines if the scan is performed for a connection request (SCAN_CONNECT) or to display the scan results to user (SCAN_DISPLAY)

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

  • if_idx – Index of the interface on which the scan results are to be fetched.

  • scan_type – The scan type (i.e. DISPLAY or CONNECT scan).

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

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

Issue abort of an ongoing scan to the RPU firmware.

This function is used to send a command to:

  • Instruct the RPU firmware to abort an ongoing scan request

  • The if_idx provides the interface index on which the ongoing scan is to be aborted

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

  • if_idx – Index of the interface on which the ongoing scan is to be aborted.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_mac_addr(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx, unsigned char *addr)

Get unused MAC address from base mac address.

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

  • addr – Memory to copy the mac address to.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

unsigned char nrf_wifi_fmac_vif_idx_get(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx)

Assign an index for a new VIF.

This function searches for an unused VIF index and returns it.

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

Returns:

Index to be used for the new VIF In case of error MAX_NUM_VIFS will be returned.

unsigned char nrf_wifi_fmac_add_vif(void *fmac_dev_ctx, void *os_vif_ctx, struct nrf_wifi_umac_add_vif_info *vif_info)

Add a new virtual interface.

This function is used to send a command to:

  • Instruct the RPU firmware to add a new interface with parameters specified by vif_info.

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

  • os_vif_ctx – Pointer to VIF context that the UMAC IF passes up the stack during invocation of callback functions like rx_frm_callbk_fn() etc.

  • vif_info – Information regarding the interface to be added.

Returns:

Index (maintained by the UMAC IF layer) of the VIF that was added. In case of error MAX_NUM_VIFS will be returned.

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

Deletes a virtual interface.

This function is used to send a command to:

  • Instruct the RPU firmware to delete an interface which was added using nrf_wifi_fmac_add_vif.

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

  • if_idx – Index of the interface to be deleted.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_chg_vif(void *fmac_dev_ctx, unsigned char if_idx, struct nrf_wifi_umac_chg_vif_attr_info *vif_info)

Change the attributes of an interface.

This function is used to change the attributes of an interface identified with if_idx.

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

  • if_idx – Index of the interface on which the functionality is to be bound.

  • vif_info – Interface specific information which needs to be passed to the RPU firmware.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_chg_vif_state(void *fmac_dev_ctx, unsigned char if_idx, struct nrf_wifi_umac_chg_vif_state_info *vif_info)

Change the state of a virtual interface.

This function is used to send a command to:

  • Instruct the RPU firmware to change the state of an interface identified by an index if_idx and parameters specified by vif_info.

  • The different states that can be configured are

    • NRF_WIFI_FMAC_IF_OP_STATE_DOWN

    • NRF_WIFI_FMAC_IF_OP_STATE_UP

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.

  • vif_info – State information to be changed for the interface.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_set_vif_macaddr(void *fmac_dev_ctx, unsigned char if_idx, unsigned char *mac_addr)

Set MAC address on interface.

This function is used to set the MAC address of an interface identified with if_idx.

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

  • if_idx – Index of the interface whose MAC address is to be changed.

  • mac_addr – MAC address to set.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_start_xmit(void *fmac_dev_ctx, unsigned char if_idx, void *netbuf)

Transmit a frame to the RPU.

This function takes care of transmitting a frame to the RPU firmware. It does the following:

   - Queues the frames to a transmit queue.
   - Based on token availability, sends one or more frames to the RPU using
     the command for transmission.
   - The firmware sends an event once the command has
     been processed to indicate whether the frame(s) have been
     transmitted/aborted.
   - The driver can cleanup the frame buffers after receiving this event.

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

  • if_idx – Index of the interface on which the frame is to be transmitted.

  • netbuf – Pointer to the OS specific network buffer.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_suspend(void *fmac_dev_ctx)

Inform the RPU firmware that host is going to suspend state.

This function is used to send a command to:

  • Inform the RPU firmware that host is going to suspend state.

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

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_resume(void *fmac_dev_ctx)

Notify RPU firmware that host has resumed from a suspended state.

This function is used to send a command to:

  • Inform the RPU firmware that host has resumed from a suspended state.

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

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_get_tx_power(void *fmac_dev_ctx, unsigned int if_idx)

Get tx power.

This function is used to send a command to:

  • Get the transmit power on a particular interface given by if_idx.

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

  • if_idx – VIF index.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_get_channel(void *fmac_dev_ctx, unsigned int if_idx)

Get channel definition.

This function is used to send a command to:

  • Get the channel configured on a particular interface given by /p if_idx.

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

  • if_idx – VIF index.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_get_station(void *fmac_dev_ctx, unsigned int if_idx, unsigned char *mac)

Get station statistics.

This function is used to send a command to:

  • Get station statistics using a MAC address.

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

  • if_idx – VIF index.

  • mac – MAC address of the station.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_get_interface(void *dev_ctx, unsigned int if_idx)
enum nrf_wifi_status nrf_wifi_fmac_set_power_save(void *fmac_dev_ctx, unsigned char if_idx, bool state)

Configure WLAN power management.

This function is used to send a command to:

  • The RPU firmware 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.

  • state – Enable/Disable of WLAN power management.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_set_uapsd_queue(void *fmac_dev_ctx, unsigned char if_idx, unsigned int uapsd_queue)

Configure WLAN U-APSD queue.

This function is used to send a command (NRF_WIFI_UMAC_CMD_CONFIG_UAPSD) to:

  • The RPU firmware to set a U-APSD queue value.

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.

  • uapsd_queue – Queue to be set for U-APSD.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_set_power_save_timeout(void *fmac_dev_ctx, unsigned char if_idx, int ps_timeout)

Configure Power save timeout.

This function is used to send a command (NRF_WIFI_UMAC_CMD_SET_POWER_SAVE_TIMEOUT) to:

  • The RPU firmware to set power save inactivity time.

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.

  • ps_timeout – Power save inactivity time.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_set_qos_map(void *fmac_dev_ctx, unsigned char if_idx, struct nrf_wifi_umac_qos_map_info *qos_info)

Configure qos_map of for data.

This function is used to send a command to:

  • The RPU firmware to set QOS map information.

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

  • if_idx – Index of the interface on which the qos map be set.

  • qos_info – qos_map information.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_set_wowlan(void *fmac_dev_ctx, unsigned int var)

Configure WoWLAN.

This function is used to send a command to the RPU firmware to:

  • Configure wakeup trigger condition in RPU.

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

  • var – Wakeup trigger condition.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

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

Get PHY configuration.

This function is used to get PHY configuration from the RPU firmware.

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

  • if_idx – Index of the interface on which the CMD needs to be sent.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_register_frame(void *fmac_dev_ctx, unsigned char if_idx, struct nrf_wifi_umac_mgmt_frame_info *frame_info)

Register to get MGMT frames.

Register with the RPU firmware to receive specific MGMT frames from the RPU to the host side.

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

  • if_idx – Index of the interface on which the CMD needs to be sent.

  • frame_info – Information regarding the management frame.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_set_wiphy_params(void *fmac_dev_ctx, unsigned char if_idx, struct nrf_wifi_umac_set_wiphy_info *wiphy_info)

Set wiphy parameters.

This function is used to send a command to the RPU firmware to:

  • Configure parameters interface specific parameters on an interface identified by if_idx

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

  • if_idx – Index of the interface on which the CMD needs to be sent.

  • wiphy_info – wiphy parameters

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_twt_setup(void *fmac_dev_ctx, unsigned char if_idx, struct nrf_wifi_umac_config_twt_info *twt_info)

TWT setup command.

This function is used to send a command to the RPU firmware to:

  • Configure TWT setup specific parameters.

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

  • if_idx – Index of the interface on which the TWT parameters be set.

  • twt_info – TWT parameters.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_twt_teardown(void *fmac_dev_ctx, unsigned char if_idx, struct nrf_wifi_umac_config_twt_info *twt_info)

TWT teardown command.

This function is used to send a command to the RPU firmware to:

  • Tear down an existing TWT session.

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

  • if_idx – Index of the interface on which the TWT parameters are to be set.

  • twt_info – TWT parameters.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

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

Get connection info from RPU.

This function is used to send a command to the RPU firmware to:

  • Fetch connection information.

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

  • if_idx – Index of the interface.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

void nrf_wifi_fmac_deinit(struct nrf_wifi_fmac_priv *fpriv)

De-initializes the UMAC IF layer.

This function de-initializes the UMAC IF layer of the RPU WLAN FullMAC driver. It does the following:

  • De-initializes the HAL layer.

  • Frees the context for the UMAC IF layer.

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

Returns:

None

void nrf_wifi_fmac_dev_rem(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx)

Removes a RPU instance.

This is a wrapper function which frees the memory for an RPU instance at the UMAC layer.

Parameters:
  • fmac_dev_ctx – Pointer to the context of the RPU instance to be removed.

Returns:

None.

enum nrf_wifi_status nrf_wifi_fmac_dev_init(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx, unsigned int phy_calib, enum op_band op_band, bool beamforming, struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_params, struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params, struct nrf_wifi_board_params *board_params)

Initializes a RPU instance.

This function initializes the firmware of an RPU instance. The following is addressed

  • BAL layer device initialization

  • HAL layer device initialization

  • FW initialization and PHY calibration data is sent to PHY

  • RX and TX buffers are initialized, tasklets assigned

Parameters:
  • fmac_dev_ctx – Pointer to the context of the RPU instance to be removed.

  • sleep_type – Type of RPU sleep.

  • phy_calib – PHY calibration flags to be passed to the RPU.

  • op_band – Operating band of the RPU.

  • beamforming – Enable/disable Wi-Fi beamforming.

  • tx_pwr_ctrl_params – TX power control parameters to be passed to the RPU.

  • tx_pwr_ceil_params – TX power ceil parameters for both frequency bands.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

void nrf_wifi_fmac_dev_deinit(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx)

De-initializes a RPU instance.

This function de-initializes the firmware of an RPU instance.

  • RPU UMAC deinitialization command is executed

  • RX and TX is deallocated for firmware via UMAC command

Parameters:
  • fmac_dev_ctx – Pointer to the context of the RPU instance to be removed.

Returns:

None.

enum nrf_wifi_status nrf_wifi_fmac_set_listen_interval(void *fmac_dev_ctx, unsigned char if_idx, unsigned short listen_interval)

Configure WLAN listen interval.

This function is used to send a command to RPU to configure listen interval. Refer section 9.4.1.6 is 802.11-2020 standard for details on listen interval

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.

  • listen_interval – listen interval to be configured.

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_fmac_set_ps_wakeup_mode(void *fmac_dev_ctx, unsigned char if_idx, bool ps_wakeup_mode)

Configure WLAN PS wakeup mode to DTIM interval or listen interval.

This function is used to configure PS wakeup mode, PS wakeup mode can be configured to:

  • DTIM interval based PS mode

  • Listen interval based PS mode Default mode is set to DTIM interval based PS mode

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.

  • ps_wakeup_mode – Enable listen interval based ps(default is DTIM based)

Return values:
  • NRF_WIFI_STATUS_SUCCESS – On success

  • NRF_WIFI_STATUS_FAIL – On failure to execute command

enum nrf_wifi_status nrf_wifi_check_mode_validity(unsigned char mode)

Check if a valid mode is being set.

This function checks the mode value attempted to be configured is a valid mode as supported by the driver. If the mode is valid, the mode will be configured to the lower layers, else an error value will be flagged.

Parameters:
  • mode – The mode value attempted to be configured.

Return values:
  • WIFI_NRF_STATUS_SUCCESS – On success

  • WIFI_NRF_STATUS_FAIL – On failure

struct nrf_wifi_fmac_callbk_fns
#include <fmac_structs.h>

Callback functions to be invoked by UMAC IF layer when a particular event occurs.

This structure contains function pointers to all the callback functions that the UMAC IF layer needs to invoke for various events.

Public Members

void (*rpu_recovery_callbk_fn)(void *os_vif_ctx, void *event_data, unsigned int event_len)

Callback function to be called when RPU recovery is required.

void (*scan_start_callbk_fn)(void *os_vif_ctx, struct nrf_wifi_umac_event_trigger_scan *scan_start_event, unsigned int event_len)

Callback function to be called when a scan is started.

void (*scan_done_callbk_fn)(void *os_vif_ctx, struct nrf_wifi_umac_event_trigger_scan *scan_done_event, unsigned int event_len)

Callback function to be called when a scan is done.

void (*scan_abort_callbk_fn)(void *os_vif_ctx, struct nrf_wifi_umac_event_trigger_scan *scan_done_event, unsigned int event_len)

Callback function to be called when a scan is aborted.

void (*scan_res_callbk_fn)(void *os_vif_ctx, struct nrf_wifi_umac_event_new_scan_results *scan_res, unsigned int event_len, bool more_res)

Callback function to be called when a scan result is received.

void (*disp_scan_res_callbk_fn)(void *os_vif_ctx, struct nrf_wifi_umac_event_new_scan_display_results *scan_res, unsigned int event_len, bool more_res)

Callback function to be called when a display scan result is received.

struct nrf_wifi_fmac_priv_def
#include <fmac_structs.h>

Structure to hold context information for the UMAC IF layer.

This structure maintains the context information necessary for the operation of the UMAC IF layer.

Public Members

struct nrf_wifi_fmac_callbk_fns callbk_fns

Callback functions to be called on various events.

struct nrf_wifi_data_config_params data_config

Data path configuration parameters.

struct rx_buf_pool_params rx_buf_pools[MAX_NUM_OF_RX_QUEUES]

RX buffer pool configuration data.

unsigned int rx_desc[MAX_NUM_OF_RX_QUEUES]

Starting RX descriptor number for a RX buffer pool.

unsigned int num_rx_bufs

Maximum number of host buffers needed for RX frames.

struct nrf_wifi_fmac_dev_ctx_def
#include <fmac_structs.h>

Structure to hold per device context information for the UMAC IF layer.

This structure maintains the context information necessary for a single instance of a FullMAC-based RPU.

Public Members

struct nrf_wifi_fmac_vif_ctx *vif_ctx[MAX_NUM_VIFS]

Array of pointers to virtual interfaces created on this device.

struct rpu_host_stats host_stats

Host statistics.

unsigned char num_sta

Number of interfaces in STA mode.

unsigned char num_ap

Number of interfaces in AP mode.

struct nrf_wifi_fmac_buf_map_info *rx_buf_info

Queue for storing mapping info of RX buffers.

struct nrf_wifi_fmac_vif_ctx
#include <fmac_structs.h>

Structure to hold per VIF context information for the UMAC IF layer.

This structure maintains the context information necessary for a single instance of an VIF.

Public Members

struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx

Handle to the FMAC IF abstraction layer.

void *os_vif_ctx

Handle to the OS abstraction layer.

char mac_addr[NRF_WIFI_ETH_ADDR_LEN]

MAC address of the VIF.

int groupwise_cipher

Groupwise cipher being used on this VIF.

bool ifflags

Interface flags related to this VIF.

int if_type

Interface type of this VIF.

unsigned char bssid[NRF_WIFI_ETH_ADDR_LEN]

BSSID of the AP to which this VIF is connected (applicable only in STA mode).

unsigned char mode

Mode setting for the current VIF

struct nrf_wifi_fmac_buf_map_info
#include <fmac_structs.h>

Structure to hold TX/RX buffer pool configuration data.

Public Members

bool mapped

Flag indicating whether the buffer is mapped or not.

unsigned long nwb

The number of words in the buffer.