Skip to content

Commit eaebd83

Browse files
rado17kapbh
authored andcommitted
Revert "[nrf fromlist] drivers: nrf_wifi: Remove station mode from monitor mode"
This reverts commit 807abfe. Signed-off-by: Ravi Dondaputi <[email protected]>
1 parent baa495e commit eaebd83

File tree

5 files changed

+38
-46
lines changed

5 files changed

+38
-46
lines changed

drivers/wifi/nrf_wifi/inc/fmac_main.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ struct nrf_wifi_vif_ctx_zep {
6262
#ifdef CONFIG_NET_STATISTICS_ETHERNET
6363
struct net_stats_eth eth_stats;
6464
#endif /* CONFIG_NET_STATISTICS_ETHERNET */
65-
#if defined(CONFIG_NRF70_STA_MODE) || defined(CONFIG_NRF70_RAW_DATA_RX)
66-
bool authorized;
67-
#endif
6865
#ifdef CONFIG_NRF70_STA_MODE
6966
unsigned int assoc_freq;
7067
enum nrf_wifi_fmac_if_carr_state if_carr_state;
@@ -75,6 +72,7 @@ struct nrf_wifi_vif_ctx_zep {
7572
unsigned char twt_flow_in_progress_map;
7673
struct wifi_ps_config *ps_info;
7774
bool ps_config_info_evnt;
75+
bool authorized;
7876
bool cookie_resp_received;
7977
#ifdef CONFIG_NRF70_DATA_TX
8078
struct k_work nrf_wifi_net_iface_work;

drivers/wifi/nrf_wifi/inc/wifi_mgmt.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#define WIFI_MGMT_DATA_CTRL_FILTER_SETTING 0xE
2323
#define WIFI_ALL_FILTER_SETTING 0xF
2424

25-
#ifdef CONFIG_NRF70_STA_MODE
2625
struct twt_interval_float {
2726
unsigned short mantissa;
2827
unsigned char exponent;
@@ -55,7 +54,6 @@ int nrf_wifi_get_power_save_config(const struct device *dev,
5554
void nrf_wifi_event_proc_get_power_save_info(void *vif_ctx,
5655
struct nrf_wifi_umac_event_power_save_info *ps_info,
5756
unsigned int event_len);
58-
#endif /* CONFIG_NRF70_STA_MODE */
5957

6058
#ifdef CONFIG_NRF70_SYSTEM_WITH_RAW_MODES
6159
int nrf_wifi_mode(const struct device *dev,

drivers/wifi/nrf_wifi/src/fmac_main.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ int nrf_wifi_reg_domain(const struct device *dev, struct wifi_reg_domain *reg_do
350350
goto out;
351351
}
352352

353-
#if defined(CONFIG_NRF70_SCAN_ONLY) || defined(CONFIG_NRF70_RAW_DATA_RX)
353+
#ifdef CONFIG_NRF70_SCAN_ONLY
354354
if (reg_domain->oper == WIFI_MGMT_SET) {
355355
memcpy(reg_domain_info.alpha2, reg_domain->country_code, WIFI_COUNTRY_CODE_LEN);
356356

@@ -739,10 +739,10 @@ static int nrf_wifi_drv_main_zep(const struct device *dev)
739739
data_config.rate_protection_type = rate_protection_type;
740740
callbk_fns.if_carr_state_chg_callbk_fn = nrf_wifi_if_carr_state_chg;
741741
callbk_fns.rx_frm_callbk_fn = nrf_wifi_if_rx_frm;
742-
#endif
743742
#if defined(CONFIG_NRF70_RAW_DATA_RX) || defined(CONFIG_NRF70_PROMISC_DATA_RX)
744743
callbk_fns.sniffer_callbk_fn = nrf_wifi_if_sniffer_rx_frm;
745744
#endif /* CONFIG_NRF70_RAW_DATA_RX || CONFIG_NRF70_PROMISC_DATA_RX */
745+
#endif
746746
rx_buf_pools[0].num_bufs = rx1_num_bufs;
747747
rx_buf_pools[1].num_bufs = rx2_num_bufs;
748748
rx_buf_pools[2].num_bufs = rx3_num_bufs;
@@ -756,7 +756,6 @@ static int nrf_wifi_drv_main_zep(const struct device *dev)
756756
callbk_fns.scan_start_callbk_fn = nrf_wifi_event_proc_scan_start_zep;
757757
callbk_fns.scan_done_callbk_fn = nrf_wifi_event_proc_scan_done_zep;
758758
callbk_fns.reg_change_callbk_fn = reg_change_callbk_fn;
759-
callbk_fns.event_get_reg = nrf_wifi_event_get_reg_zep;
760759
#ifdef CONFIG_NET_L2_WIFI_MGMT
761760
callbk_fns.disp_scan_res_callbk_fn = nrf_wifi_event_proc_disp_scan_res_zep;
762761
#endif /* CONFIG_NET_L2_WIFI_MGMT */
@@ -770,6 +769,7 @@ static int nrf_wifi_drv_main_zep(const struct device *dev)
770769
callbk_fns.twt_config_callbk_fn = nrf_wifi_event_proc_twt_setup_zep;
771770
callbk_fns.twt_teardown_callbk_fn = nrf_wifi_event_proc_twt_teardown_zep;
772771
callbk_fns.twt_sleep_callbk_fn = nrf_wifi_event_proc_twt_sleep_zep;
772+
callbk_fns.event_get_reg = nrf_wifi_event_get_reg_zep;
773773
callbk_fns.event_get_ps_info = nrf_wifi_event_proc_get_power_save_info;
774774
callbk_fns.cookie_rsp_callbk_fn = nrf_wifi_event_proc_cookie_rsp;
775775
callbk_fns.process_rssi_from_rx = nrf_wifi_process_rssi_from_rx;
@@ -858,12 +858,10 @@ static const struct wifi_mgmt_ops nrf_wifi_mgmt_ops = {
858858
.get_stats = nrf_wifi_stats_get,
859859
.reset_stats = nrf_wifi_stats_reset,
860860
#endif /* CONFIG_NET_STATISTICS_WIFI */
861-
#if defined(CONFIG_NRF70_STA_MODE) || defined(CONFIG_NRF70_RAW_DATA_RX)
862-
.reg_domain = nrf_wifi_reg_domain,
863-
#endif
864861
#ifdef CONFIG_NRF70_STA_MODE
865862
.set_power_save = nrf_wifi_set_power_save,
866863
.set_twt = nrf_wifi_set_twt,
864+
.reg_domain = nrf_wifi_reg_domain,
867865
.get_power_save_config = nrf_wifi_get_power_save_config,
868866
.set_rts_threshold = nrf_wifi_set_rts_threshold,
869867
.get_rts_threshold = nrf_wifi_get_rts_threshold,

drivers/wifi/nrf_wifi/src/net_if.c

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,39 @@ static void nrf_wifi_net_iface_work_handler(struct k_work *work)
239239
}
240240
}
241241

242+
#if defined(CONFIG_NRF70_RAW_DATA_RX) || defined(CONFIG_NRF70_PROMISC_DATA_RX)
243+
void nrf_wifi_if_sniffer_rx_frm(void *os_vif_ctx, void *frm,
244+
struct raw_rx_pkt_header *raw_rx_hdr,
245+
bool pkt_free)
246+
{
247+
struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = os_vif_ctx;
248+
struct net_if *iface = vif_ctx_zep->zep_net_if_ctx;
249+
struct net_pkt *pkt;
250+
struct nrf_wifi_ctx_zep *rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep;
251+
struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = rpu_ctx_zep->rpu_ctx;
252+
struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL;
253+
int ret;
254+
255+
sys_dev_ctx = wifi_dev_priv(fmac_dev_ctx);
256+
257+
pkt = net_raw_pkt_from_nbuf(iface, frm, sizeof(struct raw_rx_pkt_header),
258+
raw_rx_hdr,
259+
pkt_free);
260+
if (!pkt) {
261+
LOG_DBG("Failed to allocate net_pkt");
262+
return;
263+
}
264+
265+
net_capture_pkt(iface, pkt);
266+
267+
ret = net_recv_data(iface, pkt);
268+
if (ret < 0) {
269+
LOG_DBG("RCV Packet dropped by NET stack: %d", ret);
270+
net_pkt_unref(pkt);
271+
}
272+
}
273+
#endif /* CONFIG_NRF70_RAW_DATA_RX || CONFIG_NRF70_PROMISC_DATA_RX */
274+
242275
void nrf_wifi_if_rx_frm(void *os_vif_ctx, void *frm)
243276
{
244277
struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = os_vif_ctx;
@@ -308,39 +341,6 @@ static bool is_eapol(struct net_pkt *pkt)
308341
}
309342
#endif /* CONFIG_NRF70_DATA_TX */
310343

311-
#if defined(CONFIG_NRF70_RAW_DATA_RX) || defined(CONFIG_NRF70_PROMISC_DATA_RX)
312-
void nrf_wifi_if_sniffer_rx_frm(void *os_vif_ctx, void *frm,
313-
struct raw_rx_pkt_header *raw_rx_hdr,
314-
bool pkt_free)
315-
{
316-
struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = os_vif_ctx;
317-
struct net_if *iface = vif_ctx_zep->zep_net_if_ctx;
318-
struct net_pkt *pkt;
319-
struct nrf_wifi_ctx_zep *rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep;
320-
struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = rpu_ctx_zep->rpu_ctx;
321-
struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL;
322-
int ret;
323-
324-
sys_dev_ctx = wifi_dev_priv(fmac_dev_ctx);
325-
326-
pkt = net_raw_pkt_from_nbuf(iface, frm, sizeof(struct raw_rx_pkt_header),
327-
raw_rx_hdr,
328-
pkt_free);
329-
if (!pkt) {
330-
LOG_DBG("Failed to allocate net_pkt");
331-
return;
332-
}
333-
334-
net_capture_pkt(iface, pkt);
335-
336-
ret = net_recv_data(iface, pkt);
337-
if (ret < 0) {
338-
LOG_DBG("RCV Packet dropped by NET stack: %d", ret);
339-
net_pkt_unref(pkt);
340-
}
341-
}
342-
#endif /* CONFIG_NRF70_RAW_DATA_RX || CONFIG_NRF70_PROMISC_DATA_RX */
343-
344344
enum ethernet_hw_caps nrf_wifi_if_caps_get(const struct device *dev)
345345
{
346346
enum ethernet_hw_caps caps = (ETHERNET_LINK_10BASE |

drivers/wifi/nrf_wifi/src/wifi_mgmt.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL);
2525

2626
extern struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep;
2727

28-
#ifdef CONFIG_NRF70_STA_MODE
2928
int nrf_wifi_set_power_save(const struct device *dev,
3029
struct wifi_ps_params *params)
3130
{
@@ -744,7 +743,6 @@ void nrf_wifi_event_proc_twt_sleep_zep(void *vif_ctx,
744743
out:
745744
k_mutex_unlock(&vif_ctx_zep->vif_lock);
746745
}
747-
#endif /* CONFIG_NRF70_STA_MODE */
748746

749747
#ifdef CONFIG_NRF70_SYSTEM_WITH_RAW_MODES
750748
int nrf_wifi_mode(const struct device *dev,

0 commit comments

Comments
 (0)