Skip to content
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

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

JordanYates
Copy link
Collaborator

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.

Looking for initial feedback before documentation updates.

Includes the commit from #84350.

`NRF70_SYSTEM_WITH_RAW_MODES` is more accurately described as an
additional option on top of `NRF70_SYSTEM_MODE`, not as a unique
choice of `NRF70_OPER_MODES`.

This allows the elimination of multiple `NRF70_SYSTEM_MODE ||
NRF70_SYSTEM_WITH_RAW_MODES` dependencies.

Signed-off-by: Jordan Yates <jordan@embeint.com>
jukkar
jukkar previously approved these changes Jan 22, 2025
@@ -40,15 +40,16 @@ config NRF70_QSPI_LOW_POWER

choice NRF70_OPER_MODES
bool "nRF70 operating modes"
default NRF70_SYSTEM_MODE if !WIFI_NRF7000
default NRF70_SCAN_ONLY if WIFI_NRF7000
default NRF70_SYSTEM_MODE if !WIFI_USAGE_MODE_SCAN_ONLY
Copy link
Collaborator

Choose a reason for hiding this comment

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

we still need a link b/w nRF7000 and WIFI_USAGE_MODE_SCAN_ONLY

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was written with the intent that WIFI_USAGE_MODE is more of a "hint" than a hard request. In that case, if WIFI_USAGE_MODE_AP is set on a nRF7000, the NRF70_OPER_MODE will fall through NRF70_SYSTEM_MODE because it isn't supported and enable NRF70_SCAN_ONLY.

If the consensus is for more explicit configuration failures, I can take a look at that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah it works fine, but I don't see any Kconfig warnings with west build -p -b nrf9160dk/nrf9160/ns samples/net/wifi/shell --shield nrf7002ek_nrf7000 --cmake-only it silently falls back to scan-only.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As I said, its currently a hint, not a hard request. Do you think it should fail to build if the driver can't support the requested mode?

Copy link
Collaborator

Choose a reason for hiding this comment

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

At least a Kconfig warning would be good to keep the users informed.

drivers/wifi/nrf_wifi/Kconfig.nrfwifi Outdated Show resolved Hide resolved
tests/drivers/wifi/nrf_wifi/testcase.yaml Show resolved Hide resolved
@@ -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?

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 <jordan@embeint.com>
Default the operation mode from the application requested Wi-Fi
features, not the nRF70 part number.

Signed-off-by: Jordan Yates <jordan@embeint.com>
Automatically enabled `ESP32_WIFI_AP_STA_MODE` if the application
specifies it wants both features.

Signed-off-by: Jordan Yates <jordan@embeint.com>
Only enable `NXP_WIFI_SOFTAP_SUPPORT` by default if the application
requests AP support (it does by default).

Signed-off-by: Jordan Yates <jordan@embeint.com>
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 <jordan@embeint.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Wi-Fi Wi-Fi platform: ESP32 Espressif ESP32 platform: nRF Nordic nRFx platform: NXP Drivers NXP Semiconductors, drivers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants