Skip to content

Remove station mode from monitor #92226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion drivers/wifi/nrf_wifi/inc/fmac_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
10 changes: 6 additions & 4 deletions drivers/wifi/nrf_wifi/src/fmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand All @@ -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 */
Expand All @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
66 changes: 33 additions & 33 deletions drivers/wifi/nrf_wifi/src/net_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 |
Expand Down
2 changes: 2 additions & 0 deletions drivers/wifi/nrf_wifi/src/wifi_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading