Skip to content

Commit 957d1a8

Browse files
kapbhkrish2718
authored andcommitted
drivers: nrfwifi: Add changes for regulatory domain
Add fmac api changes for regulatory domain in radio test, offloaded raw tx and default mode. Signed-off-by: Kapil Bhatt <[email protected]>
1 parent 5025534 commit 957d1a8

File tree

13 files changed

+114
-21
lines changed

13 files changed

+114
-21
lines changed

drivers/nrf_wifi/fw_if/umac_if/inc/default/fmac_api.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,7 @@ void nrf_wifi_fmac_dev_rem(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx);
912912
* @param tx_pwr_ctrl_params TX power control parameters to be passed to the RPU.
913913
* @param tx_pwr_ceil_params TX power ceil parameters for both frequency bands.
914914
* @param board_params Board parameters to be passed to the RPU.
915+
* @param country_code Country code to be set for regularity domain.
915916
*
916917
* This function initializes the firmware of an RPU instance. The following is addressed
917918
* - BAL layer device initialization
@@ -931,7 +932,8 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_init(struct nrf_wifi_fmac_dev_ctx *fmac_d
931932
bool beamforming,
932933
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_params,
933934
struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params,
934-
struct nrf_wifi_board_params *board_params);
935+
struct nrf_wifi_board_params *board_params,
936+
unsigned char *country_code);
935937

936938

937939
/**

drivers/nrf_wifi/fw_if/umac_if/inc/fmac_api_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
#ifndef NRF70_OFFLOADED_RAW_TX
2323
#include "host_rpu_umac_if.h"
2424
#include "host_rpu_data_if.h"
25-
#include "fmac_structs.h"
2625
#include "fmac_vif.h"
2726
#include "fmac_bb.h"
2827
#endif /* !NRF70_OFFLOADED_RAW_TX */
2928

3029
#include "fmac_cmd.h"
3130
#include "fmac_event.h"
31+
#include "fmac_structs.h"
3232

3333
#include <patch_info.h>
3434

drivers/nrf_wifi/fw_if/umac_if/inc/fmac_cmd.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ enum nrf_wifi_status umac_cmd_init(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx,
4242
enum op_band op_band,
4343
bool beamforming,
4444
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_params,
45-
struct nrf_wifi_board_params *board_params);
45+
struct nrf_wifi_board_params *board_params,
46+
unsigned char *country_code);
4647

4748
enum nrf_wifi_status umac_cmd_deinit(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx);
4849

drivers/nrf_wifi/fw_if/umac_if/inc/fmac_structs_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "osal_api.h"
2020
#include "host_rpu_umac_if.h"
21+
#include "fmac_structs.h"
2122

2223
#define NRF_WIFI_FW_CHUNK_ID_STR_LEN 16
2324

drivers/nrf_wifi/fw_if/umac_if/inc/offload_raw_tx/fmac_api.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ void nrf_wifi_fmac_off_raw_tx_dev_rem(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx
7272
* @param tx_pwr_ctrl TX power control parameters to be passed to the RPU.
7373
* @param tx_pwr_ceil_params TX power ceiling parameters to be passed to the RPU.
7474
* @param board_params Board parameters to be passed to the RPU.
75+
* @param country_code Country code to be set for regularity domain.
7576
*
7677
* This function initializes the firmware of an RPU instance.
7778
*
@@ -88,7 +89,8 @@ enum nrf_wifi_status nrf_wifi_fmac_off_raw_tx_dev_init(
8889
bool beamforming,
8990
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl,
9091
struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params,
91-
struct nrf_wifi_board_params *board_params);
92+
struct nrf_wifi_board_params *board_params,
93+
unsigned char *country_code);
9294

9395
/**
9496
* @brief Configure the offloaded raw TX parameters.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
/** @file
8+
*
9+
* @addtogroup nrf_wifi_fmac_off_raw_tx_api FMAC offloaded raw tx API
10+
* @{
11+
*
12+
* TODO: This file is not added doxygen to avoid duplicate warnings.
13+
*
14+
* @brief Header containing declarations for utility functions for
15+
* FMAC IF Layer of the Wi-Fi driver.
16+
*/
17+
18+
#ifndef __FMAC_STRUCTS_H__
19+
#define __FMAC_STRUCTS_H__
20+
21+
#include "host_rpu_sys_if.h"
22+
23+
/**
24+
* @brief Structure to hold per device context information for the UMAC IF layer.
25+
*
26+
* This structure maintains the context information necessary for
27+
* a single instance of a FullMAC-based RPU.
28+
*/
29+
struct nrf_wifi_off_raw_tx_fmac_dev_ctx {
30+
enum nrf_wifi_cmd_status off_raw_tx_cmd_status;
31+
bool off_raw_tx_cmd_done;
32+
};
33+
34+
// extern struct nrf_wifi_off_raw_tx_fmac_dev_ctx *def_dev_ctx_off_raw_tx;
35+
36+
/**
37+
* @}
38+
*/
39+
#endif /* __FMAC_STRUCTS_H__ */

drivers/nrf_wifi/fw_if/umac_if/inc/radio_test/fmac_api.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ void nrf_wifi_fmac_dev_rem_rt(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx);
238238
* @param tx_pwr_ctrl TX power control parameters to be passed to the RPU.
239239
* @param tx_pwr_ceil_params TX power ceiling parameters to be passed to the RPU.
240240
* @param board_params Board parameters to be passed to the RPU.
241+
* @param country_code Country code to be set for regularity domain.
241242
*
242243
* This function initializes the firmware of an RPU instance.
243244
*
@@ -253,7 +254,8 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_init_rt(struct nrf_wifi_fmac_dev_ctx *fma
253254
bool beamforming,
254255
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl,
255256
struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params,
256-
struct nrf_wifi_board_params *board_params);
257+
struct nrf_wifi_board_params *board_params,
258+
unsigned char *country_code);
257259

258260

259261
/**

drivers/nrf_wifi/fw_if/umac_if/inc/radio_test/fmac_structs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct nrf_wifi_fmac_dev_ctx_rt {
4040
/** Firmware RF test command is completed. */
4141
bool radio_cmd_done;
4242
/** Firmware RF test command status. */
43-
enum nrf_wifi_radio_test_err_status radio_cmd_status;
43+
enum nrf_wifi_cmd_status radio_cmd_status;
4444
/** Firmware RF test RX capture event status */
4545
unsigned char capture_status;
4646
};

drivers/nrf_wifi/fw_if/umac_if/src/cmd.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ enum nrf_wifi_status umac_cmd_init(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx,
9595
enum op_band op_band,
9696
bool beamforming,
9797
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_params,
98-
struct nrf_wifi_board_params *board_params)
98+
struct nrf_wifi_board_params *board_params,
99+
unsigned char *country_code)
99100
{
100101
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
101102
struct host_rpu_msg *umac_cmd = NULL;
@@ -201,7 +202,7 @@ enum nrf_wifi_status umac_cmd_init(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx,
201202
NUM_EDGE_BACKOFF);
202203

203204
nrf_wifi_osal_mem_cpy(umac_cmd_data->country_code,
204-
STRINGIFY(NRF70_REG_DOMAIN),
205+
country_code,
205206
NRF_WIFI_COUNTRY_CODE_LEN);
206207

207208
#ifdef NRF70_RPU_EXTEND_TWT_SP

drivers/nrf_wifi/fw_if/umac_if/src/default/fmac_api.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ static enum nrf_wifi_status nrf_wifi_fmac_fw_init(struct nrf_wifi_fmac_dev_ctx *
200200
enum op_band op_band,
201201
bool beamforming,
202202
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl,
203-
struct nrf_wifi_board_params *board_params)
203+
struct nrf_wifi_board_params *board_params,
204+
unsigned char *country_code)
204205
{
205206
unsigned long start_time_us = 0;
206207
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
@@ -240,7 +241,8 @@ static enum nrf_wifi_status nrf_wifi_fmac_fw_init(struct nrf_wifi_fmac_dev_ctx *
240241
op_band,
241242
beamforming,
242243
tx_pwr_ctrl,
243-
board_params);
244+
board_params,
245+
country_code);
244246

245247
if (status != NRF_WIFI_STATUS_SUCCESS) {
246248
nrf_wifi_osal_log_err("%s: UMAC init failed",
@@ -335,7 +337,8 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_init(struct nrf_wifi_fmac_dev_ctx *fmac_d
335337
bool beamforming,
336338
struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_params,
337339
struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params,
338-
struct nrf_wifi_board_params *board_params)
340+
struct nrf_wifi_board_params *board_params,
341+
unsigned char *country_code)
339342
{
340343
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
341344
struct nrf_wifi_fmac_otp_info otp_info;
@@ -392,7 +395,8 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_init(struct nrf_wifi_fmac_dev_ctx *fmac_d
392395
op_band,
393396
beamforming,
394397
tx_pwr_ctrl_params,
395-
board_params);
398+
board_params,
399+
country_code);
396400

397401
if (status == NRF_WIFI_STATUS_FAIL) {
398402
nrf_wifi_osal_log_err("%s: nrf_wifi_fmac_fw_init failed",

0 commit comments

Comments
 (0)