Skip to content

Conversation

hanan619
Copy link
Contributor

Description:
The nRF7002 firmware supports two virtual interfaces (VIFs) that can operate in different modes (e.g., AP and STA). However, the existing Zephyr driver only utilizes a single VIF, preventing full multi-interface support.

This PR extends the nRF7002 driver to support multiple VIFs by making the following modifications:

  • VIF Context Handling: The driver already contains an array of vif_ctx_zep, but only the first element was being used. Now, a second Ethernet device is registered using vif_ctx_zep[1], enabling multi-VIF operation.
  • Tracking Interfaces: Introduced vif_ctx_cnt to keep track of active interfaces and manage their state effectively.
  • FMAC Initialization: Ensured that FMAC (Firmware MAC) is initialized only once, avoiding redundant initializations when multiple VIFs are present.

Testing:
Verified that two virtual interfaces can be registered and operate simultaneously.
Tested AP mode on one VIF and STA mode on another VIF concurrently.
Ensured that UMAC command responses are correctly matched to their respective VIFs.
Dependencies:
This PR depends on the corresponding hostap PR, which introduces multiple control channels in WPA supplicant to handle separate interfaces.

@hanan619
Copy link
Contributor Author

@krish2718
Duplicate PR of #86618

Copy link

github-actions bot commented Jun 19, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hostap zephyrproject-rtos/hostap@f707b19 zephyrproject-rtos/hostap@0798bf0 (main) zephyrproject-rtos/[email protected]
nrf_wifi zephyrproject-rtos/nrf_wifi@5fffeab zephyrproject-rtos/nrf_wifi@acb24fe (main) zephyrproject-rtos/[email protected]

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@github-actions github-actions bot added manifest manifest-hostap DNM (manifest) This PR should not be merged (controlled by action-manifest) labels Jun 19, 2025
@krish2718
Copy link
Contributor

@krish2718 Duplicate PR of #86618

Thanks, hopefully the tests will go through now.

Copy link

@krish2718
Copy link
Contributor

@MaochenWang1 I have done local testing including wpa_cli but need your help in testing CONFIG_WIFI_NM_HOSTAPD_AP + hostapd_cli (this is not supported combo for nRF70).

@github-actions github-actions bot added the DNM (manifest) This PR should not be merged (controlled by action-manifest) label Sep 15, 2025
@krish2718 krish2718 force-pushed the nrf_multiple_vif branch 2 times, most recently from 837d57a to c6bbd69 Compare September 16, 2025 09:45
MaochenWang1
MaochenWang1 previously approved these changes Sep 18, 2025
@github-actions github-actions bot removed the DNM (manifest) This PR should not be merged (controlled by action-manifest) label Sep 18, 2025
@github-actions github-actions bot added the DNM (manifest) This PR should not be merged (controlled by action-manifest) label Sep 19, 2025
…VIFs)

Description:
The nRF7002 firmware supports two virtual interfaces (VIFs) that can
operate in different modes (e.g., AP and STA). However, the existing
Zephyr driver only utilizes a single VIF, preventing full
multi-interface support.

This commit extends the nRF7002 driver to support multiple VIFs by
making the following modifications:

* The driver already contains an array of vif_ctx_zep, but only the
first item was being used. Now, a second Ethernet device is registered
using vif_ctx_zep[1], enabling multi-VIF operation.
* Introduced vif_ctx_cnt to keep track of active interfaces and manage
their state effectively.
* Ensured that FMAC (Firmware MAC) is initialized only once, avoiding
redundant initializations when multiple VIFs are present.
* The UMAC control commands previously did not associate responses with
the issuing VIF. A queue is now introduced to track the originating VIF
for each command and correctly route the response event to the
corresponding interface.

Signed-off-by: Hanan Arshad <[email protected]>
Signed-off-by: Chaitanya Tata <[email protected]>
This commit links the hostap PR required for the nrf7002 driver.
west.yml is updated

Signed-off-by: Hanan Arshad <[email protected]>
Signed-off-by: Chaitanya Tata <[email protected]>
Update WPA supplicant functions to pass the control channel (socket) as a
parameter instead of relying on a global socket. This change aligns with
the PR 80 modifications in hostap repo and ensures that each Virtual
Interface (VIF) uses its dedicated control channel for communication.

Signed-off-by: Hanan Arshad <[email protected]>
Signed-off-by: Chaitanya Tata <[email protected]>
Add second virtual interface by default to the DTS.

Signed-off-by: Chaitanya Tata <[email protected]>
In case STA + AP mode is enabled, then adjust the defaults to accomodate
the second interface.

Signed-off-by: Chaitanya Tata <[email protected]>
To handle the dual mode usage (STA + AP) increase the heap and stack
size.

Signed-off-by: Chaitanya Tata <[email protected]>
If the usage mode has AP, then automatically enable AP mode.

Signed-off-by: Chaitanya Tata <[email protected]>
Move the VIF initialization to top to do it for both VIFs, this fixes a
crash when scanning on the 2nd VIF.

Signed-off-by: Chaitanya Tata <[email protected]>
Fixes second interface bring up failure.

Signed-off-by: Chaitanya Tata <[email protected]>
For hostapd also use per-interface control connection like we do for
supplicant.

Signed-off-by: Chaitanya Tata <[email protected]>
Now that we support multiple VIFs, need to add argument for the
interface for any command.

Signed-off-by: Chaitanya Tata <[email protected]>
@github-actions github-actions bot removed the DNM (manifest) This PR should not be merged (controlled by action-manifest) label Sep 19, 2025
Copy link

@cfriedt cfriedt merged commit 3de9df0 into zephyrproject-rtos:main Sep 19, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants