Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3ff521e
[nrf fromtree] samples: net: wifi: Add TLSv1.3 support in wifi example
nxf58150 Aug 11, 2025
ef1f85e
[nrf fromtree] manifest: hostap: Pull hostap changes required for mul…
krish2718 Sep 15, 2025
d8f252f
[nrf fromtree] manifest: update hostap module to correct time.h and s…
cfriedt Sep 25, 2025
d12ff30
[nrf fromtree] manifest: update hostap revision for bgscan fix
pdgendt Sep 5, 2025
c352911
[nrf fromtree] manifest: update hostap to fix EAP-FAST connection issue
MaochenWang1 Oct 20, 2025
64612fe
[nrf fromtree] manifest: hostap: Pull fix for SoftAP start
krish2718 Oct 21, 2025
e5d30a2
[nrf fromtree] modules: hostap: Support bgscan
pdgendt Sep 4, 2025
661f6cd
[nrf fromtree] net: l2: wifi: shell: Add bgscan command
pdgendt Sep 8, 2025
22e5e94
[nrf fromlist] drivers: wifi: nrf_wifi: Set SSID for P2P discovery
rado17 Sep 8, 2025
687f361
[nrf fromlist] drivers: wifi: nrf_wifi: Set P2P capability
rado17 Oct 14, 2025
af361f8
[nrf fromlist] net: wifi: Add Wi-Fi direct P2P discovery API support
kapbh Oct 9, 2025
e76dd30
[nrf fromlist] net: wifi: Add Wi-Fi direct P2P discovery shell comman…
kapbh Oct 29, 2025
a346ad8
[nrf fromlist] manifest: Update hostap and nrf_wifi revision
rado17 Oct 14, 2025
aaeeeb5
[nrf fromlist] drivers: wifi: nrf_wifi: Add RoC support
rado17 Oct 30, 2025
d916c8a
[nrf fromlist] drivers: wifi: nrf_wifi: Allow off channel TX for prob…
rado17 Oct 30, 2025
6269cce
[nrf fromlist] drivers: wifi: nrf_wifi: Register frame without match
rado17 Oct 30, 2025
0a53640
[nrf fromlist] modules: hostap: Define heap and stack for P2P support
rado17 Oct 30, 2025
cd9840f
[nrf fromlist] modules: hostap: Remove obsolete conditional
krish2718 Oct 30, 2025
76f1972
[nrf fromlist] net: wifi: Add Wi-Fi direct P2P connect API support
kapbh Oct 31, 2025
712c6cc
[nrf fromlist] net: wifi: Add Wi-Fi direct P2P connect shell command …
kapbh Oct 31, 2025
a1b2c1d
[nrf fromtree] modules: hostap: Update WPA supplicant to use per-VIF …
krish2718 Sep 15, 2025
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
8 changes: 8 additions & 0 deletions drivers/wifi/nrf_wifi/inc/wpa_supp_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,16 @@
void nrf_wifi_supp_event_proc_get_conn_info(void *os_vif_ctx,
struct nrf_wifi_umac_event_conn_info *info,
unsigned int event_len);
void nrf_wifi_supp_event_roc_complete(void *os_vif_ctx,
struct nrf_wifi_event_remain_on_channel *info,
unsigned int event_len);
void nrf_wifi_supp_event_roc_cancel_complete(void *os_vif_ctx,
struct nrf_wifi_event_remain_on_channel *info,
unsigned int event_len);
int nrf_wifi_supp_set_country(void *if_priv, const char *alpha2);

Check notice on line 132 in drivers/wifi/nrf_wifi/inc/wpa_supp_if.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/wifi/nrf_wifi/inc/wpa_supp_if.h:132 - struct nrf_wifi_event_remain_on_channel *info, - unsigned int event_len); + struct nrf_wifi_event_remain_on_channel *info, + unsigned int event_len); void nrf_wifi_supp_event_roc_cancel_complete(void *os_vif_ctx, - struct nrf_wifi_event_remain_on_channel *info, - unsigned int event_len); + struct nrf_wifi_event_remain_on_channel *info, + unsigned int event_len);
int nrf_wifi_supp_get_country(void *if_priv, char *alpha2);
int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, unsigned int duration);
int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv);

#endif /* CONFIG_NRF70_STA_MODE */
#ifdef CONFIG_NRF70_AP_MODE
Expand Down
4 changes: 4 additions & 0 deletions drivers/wifi/nrf_wifi/src/fmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,8 @@ static int nrf_wifi_drv_main_zep(const struct device *dev)
callbk_fns.event_get_wiphy = nrf_wifi_wpa_supp_event_get_wiphy;
callbk_fns.mgmt_rx_callbk_fn = nrf_wifi_wpa_supp_event_mgmt_rx_callbk_fn;
callbk_fns.get_conn_info_callbk_fn = nrf_wifi_supp_event_proc_get_conn_info;
callbk_fns.roc_callbk_fn = nrf_wifi_supp_event_roc_complete;
callbk_fns.roc_cancel_callbk_fn = nrf_wifi_supp_event_roc_cancel_complete;
#endif /* CONFIG_NRF70_STA_MODE */

/* The OSAL layer needs to be initialized before any other initialization
Expand Down Expand Up @@ -963,6 +965,8 @@ static const struct zep_wpa_supp_dev_ops wpa_supp_ops = {
.get_conn_info = nrf_wifi_supp_get_conn_info,
.set_country = nrf_wifi_supp_set_country,
.get_country = nrf_wifi_supp_get_country,
.remain_on_channel = nrf_wifi_supp_remain_on_channel,
.cancel_remain_on_channel = nrf_wifi_supp_cancel_remain_on_channel,
#ifdef CONFIG_NRF70_AP_MODE
.init_ap = nrf_wifi_wpa_supp_init_ap,
.start_ap = nrf_wifi_wpa_supp_start_ap,
Expand Down
170 changes: 161 additions & 9 deletions drivers/wifi/nrf_wifi/src/wpa_supp_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,16 +545,16 @@
scan_info->scan_params.num_scan_channels = indx;
}

if (params->filter_ssids) {
scan_info->scan_params.num_scan_ssids = params->num_filter_ssids;
if (params->num_ssids) {
scan_info->scan_params.num_scan_ssids = params->num_ssids;

for (indx = 0; indx < params->num_filter_ssids; indx++) {
for (indx = 0; indx < params->num_ssids; indx++) {
memcpy(scan_info->scan_params.scan_ssids[indx].nrf_wifi_ssid,
params->filter_ssids[indx].ssid,
params->filter_ssids[indx].ssid_len);
params->ssids[indx].ssid,
params->ssids[indx].ssid_len);

Check notice on line 555 in drivers/wifi/nrf_wifi/src/wpa_supp_if.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/wifi/nrf_wifi/src/wpa_supp_if.c:555 - params->ssids[indx].ssid, - params->ssids[indx].ssid_len); + params->ssids[indx].ssid, params->ssids[indx].ssid_len);
scan_info->scan_params.scan_ssids[indx].nrf_wifi_ssid_len =
params->filter_ssids[indx].ssid_len;
params->ssids[indx].ssid_len;
}
}
Comment on lines +548 to 559
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code should validate that params->ssids[indx].ssid_len does not exceed the destination buffer size before calling memcpy() to prevent buffer overflow.

Copilot uses AI. Check for mistakes.

Expand Down Expand Up @@ -1435,6 +1435,10 @@
goto out;
}

if (vif_ctx_zep->if_type == NRF_WIFI_IFTYPE_STATION) {
offchanok = 1;
}

if (offchanok) {
mgmt_tx_info->nrf_wifi_flags |= NRF_WIFI_CMD_FRAME_OFFCHANNEL_TX_OK;
}
Expand Down Expand Up @@ -1698,7 +1702,7 @@
struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL;
struct nrf_wifi_umac_mgmt_frame_info frame_info;

if (!if_priv || !match || !match_len) {
if (!if_priv) {
LOG_ERR("%s: Invalid parameters", __func__);
return -1;
}
Expand All @@ -1719,8 +1723,14 @@
memset(&frame_info, 0, sizeof(frame_info));

frame_info.frame_type = type;
frame_info.frame_match.frame_match_len = match_len;
memcpy(frame_info.frame_match.frame_match, match, match_len);
if (match_len > 0) {
if (!match) {
LOG_ERR("%s: Invalid match parameters", __func__);
goto out;
}
frame_info.frame_match.frame_match_len = match_len;
memcpy(frame_info.frame_match.frame_match, match, match_len);
}

status = nrf_wifi_sys_fmac_register_frame(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx,
&frame_info);
Expand Down Expand Up @@ -1798,6 +1808,9 @@
if (IS_ENABLED(CONFIG_NRF70_AP_MODE)) {
capa->flags |= WPA_DRIVER_FLAGS_AP;
}
if (IS_ENABLED(CONFIG_NRF70_P2P_MODE)) {
capa->flags |= WPA_DRIVER_FLAGS_P2P_CAPABLE;
}

capa->enc |= WPA_DRIVER_CAPA_ENC_WEP40 |
WPA_DRIVER_CAPA_ENC_WEP104 |
Expand Down Expand Up @@ -1983,6 +1996,145 @@
k_sem_give(&wait_for_event_sem);
}

void nrf_wifi_supp_event_roc_complete(void *if_priv,
struct nrf_wifi_event_remain_on_channel *roc_complete,

Check warning on line 2000 in drivers/wifi/nrf_wifi/src/wpa_supp_if.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LONG_LINE

drivers/wifi/nrf_wifi/src/wpa_supp_if.c:2000 line length of 101 exceeds 100 columns
unsigned int event_len)
{

Check notice on line 2002 in drivers/wifi/nrf_wifi/src/wpa_supp_if.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/wifi/nrf_wifi/src/wpa_supp_if.c:2002 - struct nrf_wifi_event_remain_on_channel *roc_complete, - unsigned int event_len) + struct nrf_wifi_event_remain_on_channel *roc_complete, + unsigned int event_len)
struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL;

if (!if_priv) {
LOG_ERR("%s: Missing interface context", __func__);
return;
}

vif_ctx_zep = if_priv;

if (!roc_complete) {
LOG_ERR("%s: Missing ROC complete event data", __func__);
return;
}

LOG_DBG("%s: ROC complete on freq %d, dur %d, vif_idx %d",
__func__, roc_complete->frequency,
roc_complete->dur, vif_ctx_zep->vif_idx);

if (vif_ctx_zep->supp_drv_if_ctx && vif_ctx_zep->supp_callbk_fns.roc_complete) {
vif_ctx_zep->supp_callbk_fns.roc_complete(vif_ctx_zep->supp_drv_if_ctx,
roc_complete->frequency,
roc_complete->dur);
}
}

void nrf_wifi_supp_event_roc_cancel_complete(void *if_priv,
struct nrf_wifi_event_remain_on_channel *roc_cancel_complete,

Check warning on line 2029 in drivers/wifi/nrf_wifi/src/wpa_supp_if.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LONG_LINE

drivers/wifi/nrf_wifi/src/wpa_supp_if.c:2029 line length of 108 exceeds 100 columns
unsigned int event_len)
{

Check notice on line 2031 in drivers/wifi/nrf_wifi/src/wpa_supp_if.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/wifi/nrf_wifi/src/wpa_supp_if.c:2031 - LOG_DBG("%s: ROC complete on freq %d, dur %d, vif_idx %d", - __func__, roc_complete->frequency, - roc_complete->dur, vif_ctx_zep->vif_idx); + LOG_DBG("%s: ROC complete on freq %d, dur %d, vif_idx %d", __func__, + roc_complete->frequency, roc_complete->dur, vif_ctx_zep->vif_idx); if (vif_ctx_zep->supp_drv_if_ctx && vif_ctx_zep->supp_callbk_fns.roc_complete) { - vif_ctx_zep->supp_callbk_fns.roc_complete(vif_ctx_zep->supp_drv_if_ctx, - roc_complete->frequency, - roc_complete->dur); - } -} - -void nrf_wifi_supp_event_roc_cancel_complete(void *if_priv, - struct nrf_wifi_event_remain_on_channel *roc_cancel_complete, - unsigned int event_len) + vif_ctx_zep->supp_callbk_fns.roc_complete( + vif_ctx_zep->supp_drv_if_ctx, roc_complete->frequency, roc_complete->dur); + } +} + +void nrf_wifi_supp_event_roc_cancel_complete( + void *if_priv, struct nrf_wifi_event_remain_on_channel *roc_cancel_complete, + unsigned int event_len)
struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL;

if (!if_priv) {
LOG_ERR("%s: Missing interface context", __func__);
return;
}

vif_ctx_zep = if_priv;

if (!roc_cancel_complete) {
LOG_ERR("%s: Missing ROC cancel complete event data", __func__);
return;
}

LOG_DBG("%s: ROC cancel complete on freq %d, vif_idx %d",
__func__, roc_cancel_complete->frequency,
vif_ctx_zep->vif_idx);

if (vif_ctx_zep->supp_drv_if_ctx && vif_ctx_zep->supp_callbk_fns.roc_cancel_complete) {
vif_ctx_zep->supp_callbk_fns.roc_cancel_complete(vif_ctx_zep->supp_drv_if_ctx,
roc_cancel_complete->frequency);
}
}

int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq,
unsigned int duration)
{

Check notice on line 2058 in drivers/wifi/nrf_wifi/src/wpa_supp_if.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/wifi/nrf_wifi/src/wpa_supp_if.c:2058 - LOG_DBG("%s: ROC cancel complete on freq %d, vif_idx %d", - __func__, roc_cancel_complete->frequency, - vif_ctx_zep->vif_idx); + LOG_DBG("%s: ROC cancel complete on freq %d, vif_idx %d", __func__, + roc_cancel_complete->frequency, vif_ctx_zep->vif_idx); if (vif_ctx_zep->supp_drv_if_ctx && vif_ctx_zep->supp_callbk_fns.roc_cancel_complete) { vif_ctx_zep->supp_callbk_fns.roc_cancel_complete(vif_ctx_zep->supp_drv_if_ctx, - roc_cancel_complete->frequency); - } -} - -int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, - unsigned int duration) + roc_cancel_complete->frequency); + } +} + +int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, unsigned int duration)
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
#ifdef NRF70_P2P_MODE
struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL;
struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL;
struct remain_on_channel_info roc_info;

if (!if_priv) {
LOG_ERR("%s: Invalid params", __func__);
return -1;
}

vif_ctx_zep = if_priv;
rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep;
if (!rpu_ctx_zep) {
LOG_ERR("%s: rpu_ctx_zep is NULL", __func__);
return -1;
}

k_mutex_lock(&vif_ctx_zep->vif_lock, K_FOREVER);
if (!rpu_ctx_zep->rpu_ctx) {
LOG_DBG("%s: RPU context not initialized", __func__);
goto out;
}

memset(&roc_info, 0, sizeof(roc_info));
roc_info.nrf_wifi_freq_params.frequency = freq;
roc_info.nrf_wifi_freq_params.channel_width = NRF_WIFI_CHAN_WIDTH_20;
roc_info.nrf_wifi_freq_params.center_frequency1 = freq;
roc_info.nrf_wifi_freq_params.center_frequency2 = 0;
roc_info.nrf_wifi_freq_params.channel_type = NRF_WIFI_CHAN_HT20;
roc_info.dur = duration;

status = nrf_wifi_sys_fmac_p2p_roc_start(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, &roc_info);

Check warning on line 2091 in drivers/wifi/nrf_wifi/src/wpa_supp_if.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LONG_LINE

drivers/wifi/nrf_wifi/src/wpa_supp_if.c:2091 line length of 104 exceeds 100 columns
if (status != NRF_WIFI_STATUS_SUCCESS) {

Check notice on line 2092 in drivers/wifi/nrf_wifi/src/wpa_supp_if.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/wifi/nrf_wifi/src/wpa_supp_if.c:2092 - status = nrf_wifi_sys_fmac_p2p_roc_start(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, &roc_info); + status = nrf_wifi_sys_fmac_p2p_roc_start(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, + &roc_info);
LOG_ERR("%s: nrf_wifi_fmac_remain_on_channel failed", __func__);
goto out;
}
out:
k_mutex_unlock(&vif_ctx_zep->vif_lock);
#endif /* NRF70_P2P_MODE */
return status;
}

int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv)
{
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
#ifdef NRF70_P2P_MODE
struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL;
struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL;

if (!if_priv) {
LOG_ERR("%s: Invalid params", __func__);
return -1;
}

vif_ctx_zep = if_priv;
rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep;
if (!rpu_ctx_zep) {
LOG_ERR("%s: rpu_ctx_zep is NULL", __func__);
return -1;
}

k_mutex_lock(&vif_ctx_zep->vif_lock, K_FOREVER);
if (!rpu_ctx_zep->rpu_ctx) {
LOG_DBG("%s: RPU context not initialized", __func__);
goto out;
}

status = nrf_wifi_sys_fmac_p2p_roc_stop(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, 0);
if (status != NRF_WIFI_STATUS_SUCCESS) {
LOG_ERR("%s: nrf_wifi_fmac_cancel_remain_on_channel failed", __func__);
goto out;
}
out:
k_mutex_unlock(&vif_ctx_zep->vif_lock);
#endif /* NRF70_P2P_MODE */
return status;
}

#ifdef CONFIG_NRF70_AP_MODE
static int nrf_wifi_vif_state_change(struct nrf_wifi_vif_ctx_zep *vif_ctx_zep,
enum nrf_wifi_fmac_if_op_state state)
Expand Down
Loading
Loading