Skip to content

Commit

Permalink
samples: wifi: radio_test: Add command to configure PTA
Browse files Browse the repository at this point in the history
[SHEL-3396]: Add command to configure PTA for different Wi-Fi bands,
antenna modes and Short Range protocols.

Signed-off-by: Murali Thokala <Murali.Thokala@nordicsemi.no>
  • Loading branch information
muraliThokala committed Jan 15, 2025
1 parent b65f69a commit 0fbc891
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
2 changes: 2 additions & 0 deletions samples/wifi/radio_test/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ CONFIG_WIFI=y
CONFIG_WIFI_NRF70=y
CONFIG_NRF70_RADIO_TEST=y

CONFIG_NRF70_SR_COEX=y

#CONFIG_INIT_STACKS=y

# Memories
Expand Down
9 changes: 8 additions & 1 deletion samples/wifi/radio_test/radio_test_subcommands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,14 @@ Wi-Fi radio test subcommands
- 0
- Configuration
- If the channel is an edge channel, the value of <val> is subtracted from the transmit power.

* - config_pta
- | <val> - Wi-Fi operating band 0: 2.4GHz, 1: 5GHz
| <val> - Antenna mode 0: Shared, 1: Separate
| <val> - SR protocol 0: Thread, 1: Bluetooth LE
- 0
- Configuration
- Allows configuration of PTA for different Wi-Fi operating bands, antenna modes and Short
Range protocols.

.. _wifi_radio_test_stats:

Expand Down
42 changes: 41 additions & 1 deletion samples/wifi/radio_test/src/nrf_wifi_radio_test_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <nrf_wifi_radio_test_shell.h>
#include <util.h>
#include "fmac_api_common.h"

#include <coex.h>
extern struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep;
struct nrf_wifi_ctx_zep *ctx = &rpu_drv_priv_zep.rpu_ctx_zep;

Expand Down Expand Up @@ -1396,6 +1396,34 @@ static int nrf_wifi_radio_test_sr_ant_switch_ctrl(const struct shell *shell,
}
#endif /* CONFIG_NRF70_SR_COEX_RF_SWITCH */

#ifdef CONFIG_NRF70_SR_COEX
static int nrf_wifi_radio_test_config_pta(const struct shell *shell,
size_t argc,
const char *argv[])
{
bool wlan_band;
bool separate_antennas;
bool is_sr_protocol_ble;
int result_non_pta = 0;
int result_pta = 0;
int result = 0;

if (argc < 4) {
shell_fprintf(shell, SHELL_ERROR, "invalid # of args : %d\n", argc);
return -ENOEXEC;
}

wlan_band = strtoul(argv[1], NULL, 0);
separate_antennas = strtoul(argv[2], NULL, 0);
is_sr_protocol_ble = strtoul(argv[3], NULL, 0);

result_non_pta = nrf_wifi_coex_config_non_pta(separate_antennas, is_sr_protocol_ble);
result_pta = nrf_wifi_coex_config_pta(wlan_band, separate_antennas, is_sr_protocol_ble);
result = result_non_pta & result_pta;
return result;
}
#endif /* CONFIG_NRF70_SR_COEX */

static int nrf_wifi_radio_test_rx_cap(const struct shell *shell,
size_t argc,
const char *argv[])
Expand Down Expand Up @@ -2358,6 +2386,18 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
2,
0),
#endif /* CONFIG_NRF70_SR_COEX_RF_SWITCH */

#ifdef CONFIG_NRF70_SR_COEX
SHELL_CMD_ARG(config_pta,
NULL,
" - <val> - Wi-Fi operating band 0: 2.4GHz, 1: 5GHz\n"
" - <val> - Antenna mode 0: Shared, 1: Separate\n"
" - <val> - SR protocol 0: Thread, 1: Bluetooth LE\n",
nrf_wifi_radio_test_config_pta,
4,
0),
#endif /* CONFIG_NRF70_SR_COEX */

SHELL_CMD_ARG(rx_lna_gain,
NULL,
"<val> - LNA gain to be configured.\n"
Expand Down

0 comments on commit 0fbc891

Please sign in to comment.