diff --git a/drivers/wifi/nrf_wifi/inc/fmac_main.h b/drivers/wifi/nrf_wifi/inc/fmac_main.h index 23f96089eb63..cfe68378ab52 100644 --- a/drivers/wifi/nrf_wifi/inc/fmac_main.h +++ b/drivers/wifi/nrf_wifi/inc/fmac_main.h @@ -62,6 +62,9 @@ struct nrf_wifi_vif_ctx_zep { #ifdef CONFIG_NET_STATISTICS_ETHERNET struct net_stats_eth eth_stats; #endif /* CONFIG_NET_STATISTICS_ETHERNET */ +#if defined(CONFIG_NRF70_STA_MODE) || defined(CONFIG_NRF70_RAW_DATA_RX) + bool authorized; +#endif #ifdef CONFIG_NRF70_STA_MODE unsigned int assoc_freq; enum nrf_wifi_fmac_if_carr_state if_carr_state; @@ -72,7 +75,6 @@ struct nrf_wifi_vif_ctx_zep { unsigned char twt_flow_in_progress_map; struct wifi_ps_config *ps_info; bool ps_config_info_evnt; - bool authorized; bool cookie_resp_received; #ifdef CONFIG_NRF70_DATA_TX struct k_work nrf_wifi_net_iface_work; diff --git a/drivers/wifi/nrf_wifi/inc/wifi_mgmt.h b/drivers/wifi/nrf_wifi/inc/wifi_mgmt.h index e2aa91caa483..0d4387008c98 100644 --- a/drivers/wifi/nrf_wifi/inc/wifi_mgmt.h +++ b/drivers/wifi/nrf_wifi/inc/wifi_mgmt.h @@ -22,6 +22,7 @@ #define WIFI_MGMT_DATA_CTRL_FILTER_SETTING 0xE #define WIFI_ALL_FILTER_SETTING 0xF +#ifndef CONFIG_NRF70_RAW_DATA_RX struct twt_interval_float { unsigned short mantissa; unsigned char exponent; @@ -54,6 +55,7 @@ int nrf_wifi_get_power_save_config(const struct device *dev, void nrf_wifi_event_proc_get_power_save_info(void *vif_ctx, struct nrf_wifi_umac_event_power_save_info *ps_info, unsigned int event_len); +#endif /* !CONFIG_NRF70_RAW_DATA_RX */ #ifdef CONFIG_NRF70_SYSTEM_WITH_RAW_MODES int nrf_wifi_mode(const struct device *dev, diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 72055fb02993..92a58be9a099 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -350,7 +350,7 @@ int nrf_wifi_reg_domain(const struct device *dev, struct wifi_reg_domain *reg_do goto out; } -#ifdef CONFIG_NRF70_SCAN_ONLY +#if defined(CONFIG_NRF70_SCAN_ONLY) || defined(CONFIG_NRF70_RAW_DATA_RX) if (reg_domain->oper == WIFI_MGMT_SET) { memcpy(reg_domain_info.alpha2, reg_domain->country_code, WIFI_COUNTRY_CODE_LEN); @@ -739,10 +739,10 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) data_config.rate_protection_type = rate_protection_type; callbk_fns.if_carr_state_chg_callbk_fn = nrf_wifi_if_carr_state_chg; callbk_fns.rx_frm_callbk_fn = nrf_wifi_if_rx_frm; +#endif #if defined(CONFIG_NRF70_RAW_DATA_RX) || defined(CONFIG_NRF70_PROMISC_DATA_RX) callbk_fns.sniffer_callbk_fn = nrf_wifi_if_sniffer_rx_frm; #endif /* CONFIG_NRF70_RAW_DATA_RX || CONFIG_NRF70_PROMISC_DATA_RX */ -#endif rx_buf_pools[0].num_bufs = rx1_num_bufs; rx_buf_pools[1].num_bufs = rx2_num_bufs; rx_buf_pools[2].num_bufs = rx3_num_bufs; @@ -756,6 +756,7 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) callbk_fns.scan_start_callbk_fn = nrf_wifi_event_proc_scan_start_zep; callbk_fns.scan_done_callbk_fn = nrf_wifi_event_proc_scan_done_zep; callbk_fns.reg_change_callbk_fn = reg_change_callbk_fn; + callbk_fns.event_get_reg = nrf_wifi_event_get_reg_zep; #ifdef CONFIG_NET_L2_WIFI_MGMT callbk_fns.disp_scan_res_callbk_fn = nrf_wifi_event_proc_disp_scan_res_zep; #endif /* CONFIG_NET_L2_WIFI_MGMT */ @@ -769,7 +770,6 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) callbk_fns.twt_config_callbk_fn = nrf_wifi_event_proc_twt_setup_zep; callbk_fns.twt_teardown_callbk_fn = nrf_wifi_event_proc_twt_teardown_zep; callbk_fns.twt_sleep_callbk_fn = nrf_wifi_event_proc_twt_sleep_zep; - callbk_fns.event_get_reg = nrf_wifi_event_get_reg_zep; callbk_fns.event_get_ps_info = nrf_wifi_event_proc_get_power_save_info; callbk_fns.cookie_rsp_callbk_fn = nrf_wifi_event_proc_cookie_rsp; callbk_fns.process_rssi_from_rx = nrf_wifi_process_rssi_from_rx; @@ -858,10 +858,12 @@ static const struct wifi_mgmt_ops nrf_wifi_mgmt_ops = { .get_stats = nrf_wifi_stats_get, .reset_stats = nrf_wifi_stats_reset, #endif /* CONFIG_NET_STATISTICS_WIFI */ +#if defined(CONFIG_NRF70_STA_MODE) || defined(CONFIG_NRF70_RAW_DATA_RX) + .reg_domain = nrf_wifi_reg_domain, +#endif #ifdef CONFIG_NRF70_STA_MODE .set_power_save = nrf_wifi_set_power_save, .set_twt = nrf_wifi_set_twt, - .reg_domain = nrf_wifi_reg_domain, .get_power_save_config = nrf_wifi_get_power_save_config, .set_rts_threshold = nrf_wifi_set_rts_threshold, .get_rts_threshold = nrf_wifi_get_rts_threshold, diff --git a/drivers/wifi/nrf_wifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c index 19101fab442e..25c9ed5da757 100644 --- a/drivers/wifi/nrf_wifi/src/net_if.c +++ b/drivers/wifi/nrf_wifi/src/net_if.c @@ -239,39 +239,6 @@ static void nrf_wifi_net_iface_work_handler(struct k_work *work) } } -#if defined(CONFIG_NRF70_RAW_DATA_RX) || defined(CONFIG_NRF70_PROMISC_DATA_RX) -void nrf_wifi_if_sniffer_rx_frm(void *os_vif_ctx, void *frm, - struct raw_rx_pkt_header *raw_rx_hdr, - bool pkt_free) -{ - struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = os_vif_ctx; - struct net_if *iface = vif_ctx_zep->zep_net_if_ctx; - struct net_pkt *pkt; - struct nrf_wifi_ctx_zep *rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; - struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = rpu_ctx_zep->rpu_ctx; - struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; - int ret; - - sys_dev_ctx = wifi_dev_priv(fmac_dev_ctx); - - pkt = net_raw_pkt_from_nbuf(iface, frm, sizeof(struct raw_rx_pkt_header), - raw_rx_hdr, - pkt_free); - if (!pkt) { - LOG_DBG("Failed to allocate net_pkt"); - return; - } - - net_capture_pkt(iface, pkt); - - ret = net_recv_data(iface, pkt); - if (ret < 0) { - LOG_DBG("RCV Packet dropped by NET stack: %d", ret); - net_pkt_unref(pkt); - } -} -#endif /* CONFIG_NRF70_RAW_DATA_RX || CONFIG_NRF70_PROMISC_DATA_RX */ - void nrf_wifi_if_rx_frm(void *os_vif_ctx, void *frm) { struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = os_vif_ctx; @@ -341,6 +308,39 @@ static bool is_eapol(struct net_pkt *pkt) } #endif /* CONFIG_NRF70_DATA_TX */ +#if defined(CONFIG_NRF70_RAW_DATA_RX) || defined(CONFIG_NRF70_PROMISC_DATA_RX) +void nrf_wifi_if_sniffer_rx_frm(void *os_vif_ctx, void *frm, + struct raw_rx_pkt_header *raw_rx_hdr, + bool pkt_free) +{ + struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = os_vif_ctx; + struct net_if *iface = vif_ctx_zep->zep_net_if_ctx; + struct net_pkt *pkt; + struct nrf_wifi_ctx_zep *rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; + struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = rpu_ctx_zep->rpu_ctx; + struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL; + int ret; + + sys_dev_ctx = wifi_dev_priv(fmac_dev_ctx); + + pkt = net_raw_pkt_from_nbuf(iface, frm, sizeof(struct raw_rx_pkt_header), + raw_rx_hdr, + pkt_free); + if (!pkt) { + LOG_DBG("Failed to allocate net_pkt"); + return; + } + + net_capture_pkt(iface, pkt); + + ret = net_recv_data(iface, pkt); + if (ret < 0) { + LOG_DBG("RCV Packet dropped by NET stack: %d", ret); + net_pkt_unref(pkt); + } +} +#endif /* CONFIG_NRF70_RAW_DATA_RX || CONFIG_NRF70_PROMISC_DATA_RX */ + enum ethernet_hw_caps nrf_wifi_if_caps_get(const struct device *dev) { enum ethernet_hw_caps caps = (ETHERNET_LINK_10BASE | diff --git a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c index 875ce786b570..32143d73b258 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c +++ b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c @@ -25,6 +25,7 @@ LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); extern struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep; +#ifndef CONFIG_NRF70_RAW_DATA_RX int nrf_wifi_set_power_save(const struct device *dev, struct wifi_ps_params *params) { @@ -748,6 +749,7 @@ void nrf_wifi_event_proc_twt_sleep_zep(void *vif_ctx, out: k_mutex_unlock(&vif_ctx_zep->vif_lock); } +#endif /* !CONFIG_NRF70_RAW_DATA_RX */ #ifdef CONFIG_NRF70_SYSTEM_WITH_RAW_MODES int nrf_wifi_mode(const struct device *dev, diff --git a/west.yml b/west.yml index 7032362af5ce..9e13f58a96c8 100644 --- a/west.yml +++ b/west.yml @@ -328,7 +328,7 @@ manifest: revision: 6e5961223f81aa2707c555db138819a5c1b7942c path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: 7cb2f44f46dfc86e4f97477ee90022944e138dd8 + revision: pull/58/head path: modules/lib/nrf_wifi - name: open-amp revision: c30a6d8b92fcebdb797fc1a7698e8729e250f637