Skip to content

hostap: Add support for multiple interfaces in WPA supplicant #80

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 1 commit into
base: main
Choose a base branch
from

Conversation

hanan619
Copy link

@hanan619 hanan619 commented Mar 4, 2025

Description:

The current WPA supplicant implementation in Zephyr does not support multiple interfaces because it uses a single global control channel for interface communication. Since each interface (wpa_s instance) operates independently, this limitation prevents proper handling of multiple virtual interfaces (VIFs).

With this change, each virtual interface can now communicate with the control layer independently, allowing the coexistence of multiple VIFs.

Testing:

  • Verified that each interface maintains its own control connection.
  • Tested WPA supplicant with two virtual interfaces in Zephyr, ensuring that AP and STA modes can operate simultaneously without conflicts.
  • Confirmed that control commands and events are correctly routed to their respective interfaces.

Dependencies:

This change is part of a broader effort to enable multi-VIF support in the nRF7002 driver. A corresponding PR in the Zephyr repository will introduce driver-level changes to utilize this functionality.

@munir-zin
Copy link

@jukkar @krish2718 @rlubos Can anyone please review this MR and let us know the changes required. We are waiting for thi PR to be verified so that we can integrate it in our application.

@jukkar
Copy link
Member

jukkar commented Mar 18, 2025

Where is the relevant manifest update in zephyr size? For example modules/hostap/src/supp_api.c in zephyr source calls zephyr_wpa_cli_cmd_resp() and you changed its prototype in this PR so there will be a compile error when this is compiled with zephyr sources.

@jukkar
Copy link
Member

jukkar commented Mar 18, 2025

Answering to myself, the PR is zephyrproject-rtos/zephyr#86618

Copy link
Collaborator

@krish2718 krish2718 left a comment

Choose a reason for hiding this comment

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

LGTM, do you plan to work on the hostapd control interface implementation too?

Copy link
Collaborator

@krish2718 krish2718 left a comment

Choose a reason for hiding this comment

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

Please split the commit in to one-commit per logical change and use appropriate tags toup or noup, check the git log for references.

@hanan619
Copy link
Author

@krish2718
This pull request contains only one logical change, which is to remove global "ctrl_conn" and use the member of wpa_s structure for communication.
Please guide further how to proceed?

@@ -700,6 +700,9 @@ struct wpa_supplicant {
unsigned char own_addr[ETH_ALEN];
unsigned char perm_addr[ETH_ALEN];
char ifname[100];
/* wpa_ctrl for each wpa_s */
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is implied as the struct is wpa_supplicant.

@krish2718
Copy link
Collaborator

@krish2718 This pull request contains only one logical change, which is to remove global "ctrl_conn" and use the member of wpa_s structure for communication. Please guide further how to proceed?

Sure, I am okay with a single commit, please add a noup tag to the commit title.

@hanan619
Copy link
Author

@jukkar Do you have any feedback on these changes?

Copy link

@jerome-pouiller jerome-pouiller left a comment

Choose a reason for hiding this comment

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

I assume you don't plan to do the same for hostapd_cli_zephyr.c?

@hanan619
Copy link
Author

@jerome-pouiller
Yes I don't think we need to update that one.

@hanan619
Copy link
Author

hanan619 commented May 5, 2025

@rlubos
Kindly approve this PR as it is a pre-requisite for another PR in zephyr
zephyrproject-rtos/zephyr#86618 (comment)

@rlubos
Copy link
Contributor

rlubos commented May 5, 2025

Approved but my ACK is not the issue here, the PR was likely not merged yet as the corresponding manifest PR (zephyrproject-rtos/zephyr#86618) has still change request on it.

Description:
The current WPA supplicant implementation in Zephyr does not support
multiple interfaces because it uses a single global control channel for
interface communication. Since each interface (wpa_s instance) operates
independently, this limitation prevents proper handling of multiple
virtual interfaces (VIFs).

This commit modifies WPA supplicant to support multiple interfaces by:

* Removing the single global control channel.
* Introducing a new ctrl_conn member in the wpa_s structure.
* Assigning a separate ctrl_conn for each interface instance, enabling
independent communication between WPA supplicant and Zephyr’s
network layer.
With this change, each virtual interface can now communicate with the
control layer independently, allowing the coexistence of multiple VIFs.

Signed-off-by: Hanan Arshad <hananarshad619@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants