Wi-Fi Transceiver#
Functions#
Start a Wi-Fi Transceiver interface.
Configure channel from the host.
This API shall be used to configure the CWmin, CWmax, and AIFSN per access category and retransmit count.
When new peer is added or deleted from the network, application shall call this API to update peer information to the MAC layer.
This API configures the multicast MAC address to filter Rx multicast packets.
This API shall flush the entire software buffer pool.
Host shall call this API to encapsulate the data with 802.11 MAC header and send it to MAC layer.
Start transmitting Continuous Wave (CW) tones on the specified Wi-Fi interface.
Stop transmitting Continuous Wave (CW) tones on the specified Wi-Fi interface.
Set the transmit power for the Wi-Fi interface.
Set the ctune configuration for the Wi-Fi interface.
Read the ctune data from the Wi-Fi interface.
Stop receiving frames on the specified Wi-Fi interface.
Add a vendor-specific IE to Wi-Fi management frames.
Remove a vendor-specific IE from Wi-Fi management frames.
Remove all vendor-specific IEs from Wi-Fi management frames.
Configures the join feature bitmap for the Wi-Fi device.
Retrieves the join feature bitmap configuration for the Wi-Fi device.
Function Documentation#
sl_wifi_transceiver_up#
sl_status_t sl_wifi_transceiver_up (sl_wifi_interface_t interface, sl_wifi_transceiver_configuration_t * config)
Start a Wi-Fi Transceiver interface.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_wifi_interface_t | [in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t |
| sl_wifi_transceiver_configuration_t * | [in] | config | Wi-Fi Transceiver configuration. See sl_wifi_transceiver_configuration_t |
Pre-conditions:
sl_wifi_init shall be called before this API.
Returns
sl_status_t. See Status Codes. Possible Error Codes:
0x11- SL_STATUS_NOT_INITIALIZED0x21- SL_STATUS_SI91X_COMMAND_GIVEN_IN_INVALID_STATE0x22- SL_STATUS_NULL_POINTER0x0B65- SL_STATUS_TRANSCEIVER_INVALID_CHANNEL0x0B67- SL_STATUS_TRANSCEIVER_INVALID_CONFIG
Note
This API is only supported in Wi-Fi Transceiver opermode (7).
sl_wifi_transceiver_upinternally calls sl_wifi_set_transceiver_parameters and sl_wifi_transceiver_set_channel. Additionally, DUT MAC address is queried using sl_wifi_get_mac_address and used as Addr2 for TX data packets.
sl_wifi_transceiver_set_channel#
sl_status_t sl_wifi_transceiver_set_channel (sl_wifi_interface_t interface, sl_wifi_transceiver_set_channel_t channel)
Configure channel from the host.
| Type | Direction | Argument Name | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| sl_wifi_interface_t | [in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t | ||||||||||
| sl_wifi_transceiver_set_channel_t | [in] | channel | Application shall decide the channel at which device operates and transmits frames. See sl_wifi_transceiver_set_channel_t.
|
Pre-conditions:
sl_wifi_init shall be called before this API.
Returns
sl_status_t. See Status Codes. Possible Error Codes:
0x11- SL_STATUS_NOT_INITIALIZED0x21- SL_STATUS_SI91X_COMMAND_GIVEN_IN_INVALID_STATE0x0B65- SL_STATUS_TRANSCEIVER_INVALID_CHANNEL
Note
This API is only supported in Wi-Fi Transceiver opermode (7).
This is a blocking API.
The effective transmit power is subject to regional and device limitations. If the specified transmit power exceeds the maximum supported value for that region, the transmission will occur at the maximum supported transmit power.
Sample command usage:
// Initialize channel
sl_wifi_transceiver_set_channel_t channel = {
.chan_info.channel = 14,
};
// Set channel
sl_wifi_transceiver_set_channel(SL_WIFI_TRANSCEIVER_INTERFACE, channel);
sl_wifi_set_transceiver_parameters#
sl_status_t sl_wifi_set_transceiver_parameters (sl_wifi_interface_t interface, sl_wifi_transceiver_parameters_t * params)
This API shall be used to configure the CWmin, CWmax, and AIFSN per access category and retransmit count.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_wifi_interface_t | [in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t |
| sl_wifi_transceiver_parameters_t * | [in] | params | Transceiver parameters as identified by sl_wifi_transceiver_parameters_t. Shall be used to set/get the contention parameters per access category and the retransmit count in MAC layer. |
Pre-conditions:
sl_wifi_init shall be called before this API.
Returns
sl_status_t. See Status Codes. Possible Error Codes:
0x11- SL_STATUS_NOT_INITIALIZED0x21- SL_STATUS_SI91X_COMMAND_GIVEN_IN_INVALID_STATE0x22- SL_STATUS_NULL_POINTER0x0B67- SL_STATUS_TRANSCEIVER_INVALID_CONFIG
Note
This API is only supported in Wi-Fi Transceiver opermode (7).
Set is allowed only once before the first call to sl_wifi_transceiver_set_channel API.
This API is optional. Default configurations are used if API is not called.
This is a blocking API.
Sample command usage:
// Initialize parameters
sl_wifi_transceiver_parameters_t params = {
.set = 1,
.retransmit_count = 15,
.cw_params[0].aifsn = 3,
};
// Set parameters
sl_wifi_set_transceiver_parameters(SL_WIFI_TRANSCEIVER_INTERFACE, ¶ms);
sl_wifi_update_transceiver_peer_list#
sl_status_t sl_wifi_update_transceiver_peer_list (sl_wifi_interface_t interface, sl_wifi_transceiver_peer_update_t peer)
When new peer is added or deleted from the network, application shall call this API to update peer information to the MAC layer.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_wifi_interface_t | [in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t |
| sl_wifi_transceiver_peer_update_t | [in] | peer | Peer to be added/deleted in MAC layer. See sl_wifi_transceiver_peer_update_t. |
Pre-conditions:
sl_wifi_transceiver_set_channel shall be called before this API.
Returns
sl_status_t. See Status Codes. Possible Error Codes:
0x11- SL_STATUS_NOT_INITIALIZED0x0B44- SL_STATUS_WIFI_INTERFACE_NOT_UP0x0B63- SL_STATUS_TRANSCEIVER_INVALID_MAC_ADDRESS0x0B66- SL_STATUS_TRANSCEIVER_INVALID_DATA_RATE0x10096- SL_STATUS_SI91X_TRANSCEIVER_PEER_DS_FEAT_DISABLED0x10097- SL_STATUS_SI91X_TRANSCEIVER_PEER_ALREADY_EXISTS0x10098- SL_STATUS_SI91X_TRANSCEIVER_MAX_PEER_LIMIT_REACHED0x10099- SL_STATUS_SI91X_TRANSCEIVER_PEER_NOT_FOUND
Note
This API is only supported in Wi-Fi Transceiver opermode (7).
This is a blocking API.
MAC layer supports storing up to 100 peers.
To add peers in MAC layer, it is mandatory to enable SL_WIFI_FEAT_TRANSCEIVER_MAC_PEER_DS_SUPPORT/BIT(13) in sl_wifi_device_configuration_t feature_bit_map passed in sl_wifi_init.
Sample command usage:
// Initialize peer
sl_wifi_transceiver_peer_update_t peer;
uint8_t peer_mac[6] = {0x00, 0x23, 0xa7, 0x20, 0x21, 0x24};
memcpy(peer.peer_mac_address, peer_mac, 6);
peer.peer_supported_rate_bitmap = PEER_DS_BITMAP_DATA_RATE_48 | PEER_DS_BITMAP_DATA_RATE_54;
peer.flags |= BIT(0)); // Set bit 0 to add peer
// Add peer
sl_wifi_update_transceiver_peer_list(SL_WIFI_TRANSCEIVER_INTERFACE, peer);
sl_wifi_set_transceiver_multicast_filter#
sl_status_t sl_wifi_set_transceiver_multicast_filter (sl_wifi_interface_t interface, sl_wifi_transceiver_mcast_filter_t mcast)
This API configures the multicast MAC address to filter Rx multicast packets.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_wifi_interface_t | [in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t |
| sl_wifi_transceiver_mcast_filter_t | [in] | mcast | Multicast MAC address to be added/deleted from MAC layer for filtering. See sl_wifi_transceiver_mcast_filter_t. |
Pre-conditions:
sl_wifi_transceiver_set_channel shall be called before this API.
Returns
sl_status_t. See Status Codes. Possible Error Codes:
0x11- SL_STATUS_NOT_INITIALIZED0x21- SL_STATUS_INVALID_PARAMETER0x0B44- SL_STATUS_WIFI_INTERFACE_NOT_UP0x0B63- SL_STATUS_TRANSCEIVER_INVALID_MAC_ADDRESS
Note
This API is only supported in Wi-Fi Transceiver opermode (7).
This API can be called dynamically.
Maximum of two multicast MAC addresses can be configured for filtering.
Sample command usage:
// Initialize multicast filter address structure
sl_wifi_transceiver_mcast_filter_t mcast;
uint8_t filter_mac[6] = { 0x01, 0x00, 0x5e, 0x00, 0x01, 0x01 };
mcast.flags |= BIT(0);
mcast.num_of_mcast_addr = 1;
memcpy(mcast.mac[0], filter_mac, 6);
// Add MAC address to be filtered
sl_wifi_set_transceiver_multicast_filter(SL_WIFI_TRANSCEIVER_INTERFACE, mcast);
sl_wifi_flush_transceiver_data#
sl_status_t sl_wifi_flush_transceiver_data (sl_wifi_interface_t interface)
This API shall flush the entire software buffer pool.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_wifi_interface_t | [in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t |
Pre-conditions:
sl_wifi_transceiver_set_channel shall be called before this API.
Returns
sl_status_t. See Status Codes. Possible Error Codes:
0x11- SL_STATUS_NOT_INITIALIZED0x0B44- SL_STATUS_WIFI_INTERFACE_NOT_UP
Note
This API is only supported in Wi-Fi Transceiver opermode (7).
All priority queues shall be flushed.
Sample command usage:
sl_wifi_flush_transceiver_data(SL_WIFI_TRANSCEIVER_INTERFACE);
sl_wifi_send_transceiver_data#
sl_status_t sl_wifi_send_transceiver_data (sl_wifi_interface_t interface, sl_wifi_transceiver_tx_data_control_t * control, const uint8_t * payload, uint16_t payload_len)
Host shall call this API to encapsulate the data with 802.11 MAC header and send it to MAC layer.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_wifi_interface_t | [in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t |
| sl_wifi_transceiver_tx_data_control_t * | [in] | control | API uses metadata for preparing data packet along with MAC header for sending to MAC layer. See sl_wifi_transceiver_tx_data_control_t. |
| const uint8_t * | [in] | payload | Pointer to payload (encrypted by host) to be sent to LMAC. |
| uint16_t | [in] | payload_len | Length of the payload. Valid range is 1 - 2020 bytes. |
Pre-conditions:
sl_wifi_transceiver_set_channel shall be called before this API.
Returns
sl_status_t. See Status Codes. Possible Error Codes:
0x11- SL_STATUS_NOT_INITIALIZED0x0B44- SL_STATUS_WIFI_INTERFACE_NOT_UP0x0B63- SL_STATUS_TRANSCEIVER_INVALID_MAC_ADDRESS0x0B64- SL_STATUS_TRANSCEIVER_INVALID_QOS_PRIORITY0x0B66- SL_STATUS_TRANSCEIVER_INVALID_DATA_RATE0x21- SL_STATUS_INVALID_PARAMETER0x22- SL_STATUS_NULL_POINTER
Format of encapsulated data sent to MAC#
Field name | Frame Control | Duration | Addr1 | Addr2 | Adddr3 | Seq Ctrl | Addr4 | QoS ctrl | Payload (LLC + Data) |
|---|---|---|---|---|---|---|---|---|---|
Size(bytes) | 2 | 2 | 6 | 6 | 6 | 2 | 6 (Optionally present) | 2 (Optionally present) | Variable |
Note
This API is only supported in Wi-Fi Transceiver opermode (7).
Once sl_wifi_send_transceiver_data() returns, the calling API is responsible for freeing control and payload. The calling API refers to the function that invoked sl_wifi_send_transceiver_data().
On chip MAC level encryption is not supported in transceiver mode.
This is not a blocking API. Callback SL_WIFI_TRANSCEIVER_TX_DATA_STATUS_CB can be registered to get the status report from firmware.
Only 11b/g rates shall be supported.
It is recommended to use basic rate for multicast/broadcast packets.
Bits 6 and 7 of ctrl_flags, bit 0 of ctrl_flags1, and the channel and tx_power fields are currently not supported.
Sample command usage:
// Prepare payload <Prepare data payload in "payload" buffer> <Initialize data control block @ref sl_wifi_transceiver_tx_data_control_t > control->ctrl_flags = BIT(0) | BIT(1) | BIT(2) | BIT(5) | BIT(6) | BIT(7); // Configure control flags to enable 4-addr MAC header, QoS frame, fixed data rate, send status report, extended information, and immediate transfer. control->priority = 2; // Voice priority queue control->rate = SL_WIFI_DATA_RATE_36; control->token = token; control->ctrl_flags1= BIT(0); // Set if it is last packet of that channel control->channel = channel_number; control->tx_power = transmission_power; @note If BIT(6) of ctrl_flags is set, then fill channel, tx_power, and ctrl_flags1 BIT(0) information. <Fill control addr1, addr2, addr3 and addr4(optionally) with 6 byte RA, NWP, DA and SA MAC addresses respectively> // Call API to encapsulate the data with 802.11 MAC header and send it to MAC layer. sl_wifi_send_transceiver_data(SL_WIFI_TRANSCEIVER_INTERFACE, control, payload, payload_len);
sl_wifi_transmit_cw_tone_start#
sl_status_t sl_wifi_transmit_cw_tone_start (sl_wifi_interface_t interface, sl_wifi_cw_tone_config_t cw_tone_config)
Start transmitting Continuous Wave (CW) tones on the specified Wi-Fi interface.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_wifi_interface_t | [in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t. |
| sl_wifi_cw_tone_config_t | [in] | cw_tone_config | Pointer to sl_wifi_cw_tone_config_t structure containing CW tone configuration. |
Returns
sl_status_t. See Status Codes. The following status codes are returned by this API:
SL_STATUS_NOT_INITIALIZED
SL_STATUS_INVALID_PARAMETER
SL_STATUS_WIFI_INTERFACE_NOT_UP
SL_STATUS_INVALID_MODE
Note
This API is supported only in PER mode.
sl_wifi_transmit_cw_tone_stop#
sl_status_t sl_wifi_transmit_cw_tone_stop (sl_wifi_interface_t interface)
Stop transmitting Continuous Wave (CW) tones on the specified Wi-Fi interface.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_wifi_interface_t | [in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t. |
This function stops the ongoing CW tone transmission on the given Wi-Fi interface. It is typically used to terminate a CW tone test initiated using the sl_wifi_transmit_cw_tone_start API.
Pre-conditions:
sl_wifi_transmit_cw_tone_start should be called before this API.
Returns
sl_status_t. See Status Codes. The following status codes are returned by this API:
SL_STATUS_NOT_INITIALIZED
SL_STATUS_INVALID_PARAMETER
SL_STATUS_WIFI_INTERFACE_NOT_UP
SL_STATUS_INVALID_MODE
Note
This API is supported only in PER mode.
sl_wifi_set_tx_powerdBm#
sl_status_t sl_wifi_set_tx_powerdBm (int16_t txPower)
Set the transmit power for the Wi-Fi interface.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| int16_t | [in] | txPower | Transmit power in dBm. Valid range is -30 to 20 dBm. |
This function sets the transmit power in dBm for the specified Wi-Fi interface.
Returns
sl_status_t. See Status Codes. The following status codes are returned by this API:
SL_STATUS_NOT_INITIALIZED
SL_STATUS_INVALID_PARAMETER
SL_STATUS_WIFI_INTERFACE_NOT_UP
SL_STATUS_INVALID_MODE
Note
This API is supported only in PER mode.
sl_wifi_config_xo_ctune#
sl_status_t sl_wifi_config_xo_ctune (sl_wifi_interface_t interface, sl_wifi_response_get_ctune_data_t * xo_ctune, uint32_t ctune_data)
Set the ctune configuration for the Wi-Fi interface.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_wifi_interface_t | [in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t. |
| sl_wifi_response_get_ctune_data_t * | [in] | xo_ctune | The ctune data to be read, as identified by sl_wifi_response_get_ctune_data_t. |
| uint32_t | [in] | ctune_data | The ctune data to be set, as a 32-bit unsigned integer. |
This function sets the ctune configuration for the specified Wi-Fi interface.
Returns
sl_status_t. See Status Codes. The following status codes are returned by this API:
SL_STATUS_NOT_INITIALIZED
SL_STATUS_INVALID_PARAMETER
SL_STATUS_WIFI_INTERFACE_NOT_UP
SL_STATUS_INVALID_MODE
Note
This API is supported only in PER mode.
sl_wifi_read_ctune#
sl_status_t sl_wifi_read_ctune (sl_wifi_interface_t interface, sl_wifi_response_get_ctune_data_t * get_xo_ctune, const uint32_t * ctune_data)
Read the ctune data from the Wi-Fi interface.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_wifi_interface_t | [in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t. |
| sl_wifi_response_get_ctune_data_t * | [in] | get_xo_ctune | The ctune data to be set, as identified by sl_wifi_response_get_ctune_data_t. |
| const uint32_t * | [out] | ctune_data | Pointer to an array of two 32-bit unsigned integers where the ctune data will be stored. |
This function reads the ctune data from the specified Wi-Fi interface.
Returns
sl_status_t. See Status Codes. The following status codes are returned by this API:
SL_STATUS_NOT_INITIALIZED
SL_STATUS_INVALID_PARAMETER
SL_STATUS_WIFI_INTERFACE_NOT_UP
SL_STATUS_INVALID_MODE
Note
This API is supported only in PER mode.
sl_wifi_stop_rx#
sl_status_t sl_wifi_stop_rx (sl_wifi_interface_t interface)
Stop receiving frames on the specified Wi-Fi interface.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_wifi_interface_t | [in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t. |
This function stops the reception of frames on the specified Wi-Fi interface. Returns
sl_status_t. See Status Codes. The following status codes are returned by this API:
SL_STATUS_NOT_INITIALIZED
SL_STATUS_INVALID_PARAMETER
SL_STATUS_WIFI_INTERFACE_NOT_UP
SL_STATUS_INVALID_MODE
Note
This API is supported only in PER mode.
sl_wifi_add_vendor_ie#
sl_status_t sl_wifi_add_vendor_ie (sl_wifi_vendor_ie_t * vendor_ie, uint8_t * fw_unique_id)
Add a vendor-specific IE to Wi-Fi management frames.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_wifi_vendor_ie_t * | [in] | vendor_ie | Details of vendor-specific IE to add. See sl_wifi_vendor_ie_t. |
| uint8_t * | [out] | fw_unique_id | Pointer to store the firmware-assigned unique ID for the added vendor IE. |
This function blocks until the network processor has added the vendor-specific IE. The status returned by the network processor is passed on in the return value of this function.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. The following status codes are returned by this API:
SL_STATUS_OK: Operation successful.
SL_STATUS_INVALID_PARAMETER: Invalid input parameter.
SL_STATUS_FAIL: Other failure.
sl_wifi_remove_vendor_ie#
sl_status_t sl_wifi_remove_vendor_ie (uint8_t unique_id)
Remove a vendor-specific IE from Wi-Fi management frames.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint8_t | [in] | unique_id | Unique identifier of vendor-specific IE to remove. |
This function blocks until the network processor has removed the vendor-specific IE. The status returned by the network processor is passed on in the return value of this function.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. The following status codes are returned by this API:
SL_STATUS_OK: Operation successful.
SL_STATUS_INVALID_PARAMETER: Invalid input parameter.
SL_STATUS_FAIL: Other failure.
sl_wifi_remove_all_vendor_ie#
sl_status_t sl_wifi_remove_all_vendor_ie (void )
Remove all vendor-specific IEs from Wi-Fi management frames.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| void | N/A |
This function blocks until the network processor has removed all vendor-specific IEs. The status returned by the network processor is passed on in the return value of this function.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. The following status codes are returned by this API:
SL_STATUS_OK: Operation successful.
SL_STATUS_FAIL: Other failure.
sl_wifi_set_join_configuration#
sl_status_t sl_wifi_set_join_configuration (sl_wifi_interface_t interface, uint8_t join_feature_bitmap)
Configures the join feature bitmap for the Wi-Fi device.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_wifi_interface_t | [in] | interface | The selected Wi-Fi interface. Refer to sl_wifi_interface_t for possible values. |
| uint8_t | [in] | join_feature_bitmap | The join feature bitmap configuration. One or more values from Join Feature Bitmap. |
This function sets the join feature bitmap configuration for the specified Wi-Fi interface.
The join feature bitmap determines various connection parameters and behaviors.
By default, the SL_WIFI_JOIN_FEAT_LISTEN_INTERVAL_VALID bitmap is enabled.
Users can call this API before calling sl_wifi_connect, sl_wifi_start_ap, sl_wifi_start_wps to overwrite the join feature bitmap.
Returns
sl_status_t. See Status Codes and WiSeConnect Status Codes for details.
sl_wifi_get_join_configuration#
sl_status_t sl_wifi_get_join_configuration (sl_wifi_interface_t interface, uint8_t * join_feature_bitmap)
Retrieves the join feature bitmap configuration for the Wi-Fi device.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_wifi_interface_t | [in] | interface | The selected Wi-Fi interface. Refer to sl_wifi_interface_t for possible values. |
| uint8_t * | [out] | join_feature_bitmap | Pointer to a variable where the current join feature bitmap configuration will be stored. One or more values from Join Feature Bitmap. |
This function gets the current join feature bitmap configuration for the specified Wi-Fi interface. The join feature bitmap determines various connection parameters and behaviors.
By default, the SL_WIFI_JOIN_FEAT_LISTEN_INTERVAL_VALID bitmap is enabled.
Returns
sl_status_t. See Status Codes and WiSeConnect Status Codes for details.