Skip to content

Commit 6b16ce2

Browse files
kapbhkrish2718
authored andcommitted
[nrf fromlist] drivers: wifi: Add changes for regulatory domain
Add changes for offloaded raw tx regulatory domain. Upstream PR: zephyrproject-rtos/zephyr#80146 Signed-off-by: Kapil Bhatt <[email protected]>
1 parent aa8e661 commit 6b16ce2

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

drivers/wifi/nrfwifi/off_raw_tx/src/off_raw_tx_api.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static int bytes_from_str(uint8_t *buf, int buf_len, const char *src)
128128
}
129129
#endif /* CONFIG_WIFI_FIXED_MAC_ADDRESS_ENABLED */
130130

131-
int nrf70_off_raw_tx_init(uint8_t *mac_addr)
131+
int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code)
132132
{
133133
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
134134
struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL;
@@ -206,7 +206,8 @@ int nrf70_off_raw_tx_init(uint8_t *mac_addr)
206206
IS_ENABLED(CONFIG_NRF_WIFI_BEAMFORMING),
207207
&ctrl_params,
208208
&ceil_params,
209-
&board_params);
209+
&board_params,
210+
country_code);
210211
if (status != NRF_WIFI_STATUS_SUCCESS) {
211212
LOG_ERR("%s: nRF70 firmware initialization failed", __func__);
212213
goto err;

drivers/wifi/nrfwifi/src/fmac_main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,8 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv
644644
IS_ENABLED(CONFIG_NRF_WIFI_BEAMFORMING),
645645
&tx_pwr_ctrl_params,
646646
&tx_pwr_ceil_params,
647-
&board_params);
647+
&board_params,
648+
STRINGIFY(CONFIG_NRF70_REG_DOMAIN));
648649
#else
649650
status = nrf_wifi_fmac_dev_init(rpu_ctx_zep->rpu_ctx,
650651
#ifdef CONFIG_NRF_WIFI_LOW_POWER
@@ -655,7 +656,8 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv
655656
IS_ENABLED(CONFIG_NRF_WIFI_BEAMFORMING),
656657
&tx_pwr_ctrl_params,
657658
&tx_pwr_ceil_params,
658-
&board_params);
659+
&board_params,
660+
STRINGIFY(CONFIG_NRF70_REG_DOMAIN));
659661
#endif /* CONFIG_NRF70_RADIO_TEST */
660662

661663

include/zephyr/drivers/wifi/nrfwifi/off_raw_tx/off_raw_tx_api.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
#define NRF_WIFI_OFF_RAW_TX_FRAME_SIZE_MIN 26
2323
/* Maximum frame size for raw packet transmission */
2424
#define NRF_WIFI_OFF_RAW_TX_FRAME_SIZE_MAX 600
25-
25+
/* Maximum length of country code*/
26+
#define NRF_WIFI_COUNTRY_CODE_LEN 2
2627
/**
2728
* @brief- Transmission rates
2829
* Rate to be used for transmitting a packet.
@@ -167,6 +168,7 @@ struct nrf_wifi_off_raw_tx_conf {
167168
/**
168169
* @brief Initialize the nRF70 for operating in the offloaded raw TX mode.
169170
* @param mac_addr MAC address to be used for the nRF70 device.
171+
* @param country_code Country code to be set for regularity domain.
170172
*
171173
* This function is initializes the nRF70 device for offloaded raw TX mode by:
172174
* - Powering it up,
@@ -184,7 +186,7 @@ struct nrf_wifi_off_raw_tx_conf {
184186
* @retval 0 If the operation was successful.
185187
* @retval -1 If the operation failed.
186188
*/
187-
int nrf70_off_raw_tx_init(uint8_t *mac_addr);
189+
int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code);
188190

189191
/**
190192
* @brief Initialize the nRF70 for operating in the offloaded raw TX mode.

0 commit comments

Comments
 (0)