Skip to content

Commit c62d3dc

Browse files
committed
Move nrf_wifi_util_get_ra to utils lib
Move nrf_wifi_util_get_ra to fmac_utils lib to make it accessible across other files. Signed-off-by: Ravi Dondaputi <[email protected]>
1 parent 055143f commit c62d3dc

File tree

5 files changed

+36
-19
lines changed

5 files changed

+36
-19
lines changed

fw_if/umac_if/inc/common/fmac_util.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
#include "fmac_structs_common.h"
1515

1616
#include "fmac_structs_common.h"
17+
#ifdef NRF70_SYSTEM_MODE
18+
#include "system/fmac_structs.h"
19+
#endif /* NRF70_SYSTEM_MODE */
1720
#include "common/pack_def.h"
1821

1922

@@ -107,4 +110,9 @@ bool nrf_wifi_util_is_arr_zero(unsigned char *arr,
107110
void *wifi_fmac_priv(struct nrf_wifi_fmac_priv *def);
108111
void *wifi_dev_priv(struct nrf_wifi_fmac_dev_ctx *def);
109112

113+
#ifdef NRF70_SYSTEM_MODE
114+
unsigned char *nrf_wifi_util_get_ra(struct nrf_wifi_fmac_vif_ctx *vif,
115+
void *nwb);
116+
#endif /* NRF70_SYSTEM_MODE */
117+
110118
#endif /* __FMAC_UTIL_H__ */

fw_if/umac_if/src/common/fmac_util.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
#else
1919
#include "host_rpu_umac_if.h"
2020
#endif
21+
#ifdef NRF70_SYSTEM_MODE
22+
#include <system/fmac_structs.h>
23+
#endif /* NRF70_SYSTEM_MODE */
2124

2225
bool nrf_wifi_util_is_multicast_addr(const unsigned char *addr)
2326
{
@@ -91,6 +94,26 @@ bool nrf_wifi_util_is_arr_zero(unsigned char *arr,
9194
return true;
9295
}
9396

97+
#ifdef NRF70_SYSTEM_MODE
98+
unsigned char *nrf_wifi_util_get_ra(struct nrf_wifi_fmac_vif_ctx *vif,
99+
void *nwb)
100+
{
101+
if ((vif->if_type == NRF_WIFI_IFTYPE_STATION)
102+
#ifdef NRF70_RAW_DATA_TX
103+
|| (vif->if_type == NRF_WIFI_STA_TX_INJECTOR)
104+
#endif /* NRF70_RAW_DATA_TX */
105+
#ifdef NRF70_PROMISC_DATA_RX
106+
|| (vif->if_type == NRF_WIFI_STA_PROMISC)
107+
|| (vif->if_type == NRF_WIFI_STA_PROMISC_TX_INJECTOR)
108+
#endif
109+
) {
110+
return vif->bssid;
111+
}
112+
113+
return nrf_wifi_osal_nbuf_data_get(nwb);
114+
}
115+
#endif /* NRF70_SYSTEM_MODE */
116+
94117
void *wifi_fmac_priv(struct nrf_wifi_fmac_priv *def)
95118
{
96119
return &def->priv;

fw_if/umac_if/src/system/tx.c

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "list.h"
1313
#include "queue.h"
14+
#include "util.h"
1415
#include "system/hal_api.h"
1516
#include "system/fmac_tx.h"
1617
#include "system/fmac_api.h"
@@ -1864,25 +1865,6 @@ static int get_ac(unsigned int tid,
18641865
}
18651866

18661867

1867-
unsigned char *nrf_wifi_util_get_ra(struct nrf_wifi_fmac_vif_ctx *vif,
1868-
void *nwb)
1869-
{
1870-
if ((vif->if_type == NRF_WIFI_IFTYPE_STATION)
1871-
#ifdef NRF70_RAW_DATA_TX
1872-
|| (vif->if_type == NRF_WIFI_STA_TX_INJECTOR)
1873-
#endif /* NRF70_RAW_DATA_TX */
1874-
#ifdef NRF70_PROMISC_DATA_RX
1875-
|| (vif->if_type == NRF_WIFI_STA_PROMISC)
1876-
|| (vif->if_type == NRF_WIFI_STA_PROMISC_TX_INJECTOR)
1877-
#endif
1878-
) {
1879-
return vif->bssid;
1880-
}
1881-
1882-
return nrf_wifi_osal_nbuf_data_get(nwb);
1883-
}
1884-
1885-
18861868
#ifdef NRF70_RAW_DATA_TX
18871869
static bool nrf_wifi_raw_pkt_mode_enabled(struct nrf_wifi_fmac_vif_ctx *vif)
18881870
{

utils/inc/util.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
#else
2020
#include "host_rpu_umac_if.h"
2121
#endif
22+
#if !defined CONFIG_NRF70_OFFLOADED_RAW_TX && !defined CONFIG_NRF70_RADIO_TEST
23+
#include <system/fmac_structs.h>
24+
#endif /* !CONFIG_NRF70_OFFLOADED_RAW_TX */
2225

2326
#ifndef ARRAY_SIZE
2427
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))

utils/src/util.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <nrf71_wifi_ctrl.h>
1515
#else
1616
#include "host_rpu_data_if.h"
17+
#include <system/fmac_structs.h>
1718
#endif
1819

1920
int nrf_wifi_utils_hex_str_to_val(unsigned char *hex_arr,

0 commit comments

Comments
 (0)