Skip to content

Commit

Permalink
drivers: wifi: Add changes for regulatory domain
Browse files Browse the repository at this point in the history
Add changes for offloaded raw tx regulatory domain.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
  • Loading branch information
kapbh authored and carlescufi committed Oct 23, 2024
1 parent e7db0f8 commit 7161a7a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions drivers/wifi/nrfwifi/off_raw_tx/src/off_raw_tx_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static int bytes_from_str(uint8_t *buf, int buf_len, const char *src)
}
#endif /* CONFIG_WIFI_FIXED_MAC_ADDRESS_ENABLED */

int nrf70_off_raw_tx_init(uint8_t *mac_addr)
int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code)
{
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL;
Expand Down Expand Up @@ -206,7 +206,8 @@ int nrf70_off_raw_tx_init(uint8_t *mac_addr)
IS_ENABLED(CONFIG_NRF_WIFI_BEAMFORMING),
&ctrl_params,
&ceil_params,
&board_params);
&board_params,
country_code);
if (status != NRF_WIFI_STATUS_SUCCESS) {
LOG_ERR("%s: nRF70 firmware initialization failed", __func__);
goto err;
Expand Down
6 changes: 4 additions & 2 deletions drivers/wifi/nrfwifi/src/fmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,8 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv
IS_ENABLED(CONFIG_NRF_WIFI_BEAMFORMING),
&tx_pwr_ctrl_params,
&tx_pwr_ceil_params,
&board_params);
&board_params,
STRINGIFY(CONFIG_NRF70_REG_DOMAIN));
#else
status = nrf_wifi_fmac_dev_init(rpu_ctx_zep->rpu_ctx,
#ifdef CONFIG_NRF_WIFI_LOW_POWER
Expand All @@ -655,7 +656,8 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv
IS_ENABLED(CONFIG_NRF_WIFI_BEAMFORMING),
&tx_pwr_ctrl_params,
&tx_pwr_ceil_params,
&board_params);
&board_params,
STRINGIFY(CONFIG_NRF70_REG_DOMAIN));
#endif /* CONFIG_NRF70_RADIO_TEST */


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
#define NRF_WIFI_OFF_RAW_TX_FRAME_SIZE_MIN 26
/* Maximum frame size for raw packet transmission */
#define NRF_WIFI_OFF_RAW_TX_FRAME_SIZE_MAX 600

/* Maximum length of country code*/
#define NRF_WIFI_COUNTRY_CODE_LEN 2
/**
* @brief- Transmission rates
* Rate to be used for transmitting a packet.
Expand Down Expand Up @@ -167,6 +168,7 @@ struct nrf_wifi_off_raw_tx_conf {
/**
* @brief Initialize the nRF70 for operating in the offloaded raw TX mode.
* @param mac_addr MAC address to be used for the nRF70 device.
* @param country_code Country code to be set for regularity domain.
*
* This function is initializes the nRF70 device for offloaded raw TX mode by:
* - Powering it up,
Expand All @@ -184,7 +186,7 @@ struct nrf_wifi_off_raw_tx_conf {
* @retval 0 If the operation was successful.
* @retval -1 If the operation failed.
*/
int nrf70_off_raw_tx_init(uint8_t *mac_addr);
int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code);

/**
* @brief Initialize the nRF70 for operating in the offloaded raw TX mode.
Expand Down

0 comments on commit 7161a7a

Please sign in to comment.