Skip to content

drivers: wifi: options for application usage of Wi-Fi #84353

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

Merged
merged 6 commits into from
May 30, 2025

Conversation

JordanYates
Copy link
Collaborator

@JordanYates JordanYates commented Jan 22, 2025

The CONFIG_WIFI symbol currently covers a number of different use-cases of Wi-Fi, primarily:

  • Wi-Fi AP (Broadcasting a network others can connect to)
  • Wi-Fi Station (Connecting to an AP + SSID scanning)
  • Wi-Fi AP + Station (Both the above)
  • Wi-Fi SSID scanning (SSID scanning only)

Each of these application usages of Wi-Fi requires a different set of supporting options to operate correctly (WPA_SUPP, NET_CONNECTION_MANAGER, etc), and different opportunities for resource optimization (System heap, buffer counts, etc).

Currently, optimizing the Wi-Fi drivers depends on driver specific options, which can be challenging to find and are obviously not portable across different drivers.

The addition of this choice allows applications to specify in a single Kconfig option which features of Wi-Fi they use, and enable individual Wi-Fi drivers to choose defaults based on those features.

jukkar
jukkar previously approved these changes Jan 22, 2025
@@ -539,7 +539,7 @@ config NXP_WIFI_SOFTAP_SUPPORT
bool "Wi-Fi SoftAP Support"
select NET_DHCPV4_SERVER
select WIFI_NM_HOSTAPD_AP if WIFI_NM_WPA_SUPPLICANT
default y
default y if WIFI_USAGE_MODE_AP || WIFI_USAGE_MODE_STA_AP
Copy link
Collaborator

Choose a reason for hiding this comment

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

Currently NXP_WIFI_SOFTAP_SUPPORT is default enabled for NXP wifi chip, but your change will change the logic that we have to add extra WIFI_USAGE_MODE_STA_AP into the .conf, right?
Can you keep the original config logic?

Copy link
Member

@jukkar jukkar Apr 8, 2025

Choose a reason for hiding this comment

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

Currently NXP_WIFI_SOFTAP_SUPPORT is default enabled for NXP wifi chip, but your change will change the logic that we have to add extra WIFI_USAGE_MODE_STA_AP into the .conf, right?
Can you keep the original config logic?

This is changed by #87410 which disables AP mode by default.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Great, I will try and keep an eye on that PR and update this one (and address the file conflicts) once it is in.

Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Mar 24, 2025
@jukkar
Copy link
Member

jukkar commented Mar 28, 2025

This seems to have been fall through the cracks and become stale. @JordanYates is this still valid one, there did not seem to be too much resistance against it?

@github-actions github-actions bot removed the Stale label Mar 29, 2025
@krish2718 krish2718 moved this to In Progress in Wi-Fi Mar 29, 2025
@JordanYates
Copy link
Collaborator Author

This seems to have been fall through the cracks and become stale. @JordanYates is this still valid one, there did not seem to be too much resistance against it?

Yes, the desire to set what WiFi mode the application wants from the application is still valid.
I have rebased and addressed the file conflicts.

jukkar
jukkar previously approved these changes Apr 8, 2025
@@ -539,7 +539,7 @@ config NXP_WIFI_SOFTAP_SUPPORT
bool "Wi-Fi SoftAP Support"
select NET_DHCPV4_SERVER
select WIFI_NM_HOSTAPD_AP if WIFI_NM_WPA_SUPPLICANT
default y
default y if WIFI_USAGE_MODE_AP || WIFI_USAGE_MODE_STA_AP
Copy link
Member

@jukkar jukkar Apr 8, 2025

Choose a reason for hiding this comment

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

Currently NXP_WIFI_SOFTAP_SUPPORT is default enabled for NXP wifi chip, but your change will change the logic that we have to add extra WIFI_USAGE_MODE_STA_AP into the .conf, right?
Can you keep the original config logic?

This is changed by #87410 which disables AP mode by default.

@jukkar jukkar requested review from krish2718 and MaochenWang1 April 9, 2025 10:21
krish2718
krish2718 previously approved these changes Apr 9, 2025
@JordanYates JordanYates added the DNM This PR should not be merged (Do Not Merge) label Apr 9, 2025
@JordanYates JordanYates dismissed stale reviews from krish2718 and jukkar via b7c8498 April 17, 2025 00:08
@JordanYates JordanYates removed the DNM This PR should not be merged (Do Not Merge) label May 30, 2025
The `CONFIG_WIFI` symbol currently covers a number of different
use-cases of Wi-Fi, primarily:
  * Wi-Fi AP (Broadcasting a network others can connect to)
  * Wi-Fi Station (Connecting to an AP + SSID scanning)
  * Wi-Fi AP + Station (Both the above)
  * Wi-Fi SSID scanning (SSID scanning only)

Each of these application usages of Wi-Fi requires a different set of
supporting options to operate correctly (`WPA_SUPP`,
`NET_CONNECTION_MANAGER`, etc), and different opportunities for resource
optimisation (System heap, buffer counts, etc).

Currently, optimizing the Wi-Fi drivers depends on driver specific
options, which can be challenging to find and are obviously not portable
across different drivers.

The addition of this choice allows applications to specify in a single
Kconfig option which features of Wi-Fi they use, and enable individual
Wi-Fi drivers to choose defaults based on those features.

Signed-off-by: Jordan Yates <[email protected]>
Default the operation mode from the application requested Wi-Fi
features, not the nRF70 part number.

Signed-off-by: Jordan Yates <[email protected]>
Automatically enabled `ESP32_WIFI_AP_STA_MODE` if the application
specifies it wants either feature.

Signed-off-by: Jordan Yates <[email protected]>
Automatically enabled `NXP_WIFI_SOFTAP_SUPPORT` if the application
specifies it wants AP support.

Signed-off-by: Jordan Yates <[email protected]>
Reduce the number of config overrides needed for the various testcases
by only enabling the options if needed in the first place.

Signed-off-by: Jordan Yates <[email protected]>
Add docs for `WIFI_USAGE_MODE` in the Wi-Fi section and release notes.

Signed-off-by: Jordan Yates <[email protected]>
@JordanYates
Copy link
Collaborator Author

@jukkar @krish2718 this should be ready for review

@github-actions github-actions bot added area: Networking Release Notes To be mentioned in the release notes labels May 30, 2025
Copy link

@@ -58,10 +58,11 @@ config ESP32_WIFI_STA_AUTO_DHCPV4

config ESP32_WIFI_AP_STA_MODE
bool "Activates the Station/AP co-existence mode."
default y if WIFI_USAGE_MODE_STA_AP
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess CONFIG_ESP32_WIFI_AP_STA_MODE=y should be replaced to CONFIG_WIFI_USAGE_MODE_STA_AP=y in samples/net/wifi/apsta_mode/socs/esp32_procpu.conf, right?

Copy link
Collaborator

@sylvioalves sylvioalves May 30, 2025

Choose a reason for hiding this comment

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

And perhaps CONFIG_WIFI_USAGE_MODE_STA=y enabled by default in samples/net/wifi/shell/prf.conf?
I see now that default WIFI_USAGE_MODE_STA is enabled by default.

@kartben kartben merged commit a550c74 into zephyrproject-rtos:main May 30, 2025
27 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Wi-Fi May 30, 2025
@JordanYates JordanYates deleted the 250122_wifi_modes branch May 30, 2025 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking area: Wi-Fi Wi-Fi platform: ESP32 Espressif ESP32 platform: nRF Nordic nRFx platform: NXP Drivers NXP Semiconductors, drivers Release Notes To be mentioned in the release notes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants