Commit graph

1151 commits

Author SHA1 Message Date
Maochen Wang
91c4482267 net: wifi: fix ap status when enabled
Add WIFI_SAP_IFACE_NO_IR state to keep same as hostapd_iface_state,
which is updated as the hostap upmerge.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-12-16 13:08:37 +01:00
Maochen Wang
10d4de5237 net: wifi: remove HAPD in Wi-Fi shell layer
For CMD 'wifi ap status', removing HAPD related definition to make it
more commonly used for non-supplicant case.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-12-16 13:08:37 +01:00
Chaitanya Tata
cf7ecb18c0 net: l2: wifi: Add a verbose option for reg_domain
Most users won't be interested in the per-channel rules but only in the
country code, so, add a verbose option to hiden per-channel rules which
are too verbose.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-12-13 21:51:02 +01:00
Chaitanya Tata
6223c4a904 net: l2: wifi: Convert reg_domain to use get_opt
In order to prepare for extending the options, convert to getopt long
for easier parsing of options.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-12-13 21:51:02 +01:00
Li Long
4d178f664c modules: hostap: add tls_cipher param
Add tls_cipher param for client WPA3 enterprise suiteb-192.
Add parameter "-T" to specify tls_cipher:
Specify "-T 1": client use ECC P384.
Specify "-T 2": client use RSA 3K.

Signed-off-by: Li Long <li.long@nxp.com>
2024-12-12 11:09:15 +01:00
Jukka Rissanen
1f2595a456 net: wifi: shell: Remove obsolete subcmd settings from commands
If a shell command does not have a sub command, then the 3rd parameter
to SHELL_SUBCMD_ADD() macro should be set to NULL so that the help
will only print information specific to that command and not all
wifi commands.

Fixes #82633

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-12-11 21:28:17 +01:00
Emil Lindqvist
6dafb5f4a9 wifi: fix warning on wifi_ps_exit_strategy_txt
This commit fixes a warning when including wifi.h:
type qualifiers ignored on function return type

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2024-12-11 15:55:03 +00:00
Marcin Niestroj
a7ceb4723f net: l2: wifi: fix handling of missing 'ap_disable'
When calling wifi_ap_disable() API specific WiFi driver implementation was
checked whether 'ap_enable' was provided, instead of 'ap_disable'. Fix
that copy-paste error.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-12-11 15:54:18 +00:00
Jukka Rissanen
1e15eec64f net: vlan: Remove useless assert
The assert is not needed and it was in wrong place anyway.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-12-10 11:09:25 +01:00
Gang Li
e73bc712cc net: wifi: add "bandwidth" parameter to "wifi ap enable" command
Add "bandwidth" parameter to "wifi ap enable" command.
Add "ht_capab" and "vht_capab" parameters to "wifi ap config" command.

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2024-12-10 11:09:09 +01:00
Rait Rääk
220c4fffd3 net: ethernet: arp: Fix incorrect adding to the pending queue
k_fifo_put is a macro that expands the call to net_pkt_ref(pending)
multiple times when CONFIG_TRACING is enabled thus causing extra
reference for the pending packet and a memory leak.
Fix by moving the referencing call to a separate line.
Signed-off-by: Rait Rääk <raitraak@gmail.com>
2024-12-06 22:21:31 +01:00
Gang Li
5a383919a0 net: wifi: change the acquisition of wifi interface
For WiFi interface, uniformly use net_if_get_wifi_sta() and
net_if_get_wifi_sap() APIs to replace net_if_get_first_wifi().

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2024-12-06 06:50:19 +01:00
Hui Bai
ae7613b2c9 wifi: add hidden SSID configuration support for SoftAP
Added hidden ssid support configuration for AP mode.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2024-12-04 12:09:59 +01:00
Arkadiusz Balys
6464ea88fe net: openthread: Allow a platform to select a Settings backend.
Removed implying of NVS by the NET_L2_OPENTHREAD, and from now a
platform can choose between ZMS and NVS as a settings backend.
NET_L2_OPENTHREAD still requires NVS or ZMS backend so the config
depends on one of those.

Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
2024-12-02 18:18:20 +01:00
Chaitanya Tata
619cdb64f4 wifi: Fix current PHY rate handling
Fix the name to include TX and also add units to the shell display.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-29 11:45:58 +01:00
Chaitanya Tata
9762c32115 wifi: Update help/notes for forcing regulatory domain
With recent changes the regulatory domain is handled via the hostap
rather than by passing and going through the driver and hostap doesn't
have any option for forcing the regulatory domain, so, add a note to
reflect that this is implementation dependent to cover both hostap as
well other offloaded implementations.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-29 05:42:03 +01:00
Ravi Dondaputi
11dae0e9eb net: l2: wifi: Add checks for cert header creation
Execute certificate headers creation rules only if Wi-Fi Enterprise mode
is enabled.

Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
2024-11-28 12:52:34 +01:00
Jukka Rissanen
c6a1af5c17 net: ethernet: bridge: Drop the cloned packet in error
We need to drop the cloned packet that was fed to the bridge instead of
returning directly from the function. Without this change we have a
buffer leak.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 12:50:36 +01:00
Jukka Rissanen
ed0dcca2fb net: ethernet: bridge: Avoid null pointer access
If the packet cloning failed, bail out in order to avoid
null pointer access.

Fixes #81992
Coverity-CID: 434493

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 12:50:36 +01:00
Jamel Arbi
70add85f9f drivers: openthread: nxp: Add a HDLC RCP communication
Add a HDLC RCP communication with its hdlc_api interface APIs
and a NXP driver.

Signed-off-by: Jamel Arbi <jamel.arbi@nxp.com>
2024-11-27 10:37:21 -05:00
Pisit Sawangvonganan
08fe69cc3c net: wifi: shell: enhance consistency in __wifi_args_to_params
Several arguments were added but have not yet been aligned with others
in the same function. Hence, use `getopt_state` to access `optarg`,
offering a better alternative to direct global access.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-27 08:17:15 +01:00
Rex Chen
b4035e83d4 net: wifi: shell: add enterprise support for sap
Add EAP-TLS, EAP-PEAP-MSCHAPv2, EAP-PEAP-GTC, EAP-TTLS-MSCHAPv2,
EAP-PEAP-TLS, EAP-TLS-SHA256 enterprise wpa2 and wpa3 suiteb
support for sap.

Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
2024-11-22 13:03:53 -06:00
Maochen Wang
13f473d7eb hostap: add WPS PBC and PIN for AP mode
add WPS PBC and PIN for AP mode.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-11-22 17:44:08 +01:00
Chaitanya Tata
0f1f01f9f4 net: l2: wifi: Fix the minimum value
802.11 doesn't have specific constraints, it just says that listen
interval should be >=0 and it a 2 byte field.

3 as a typical DTIM value from nRF chipsets, so, remove the hardware
specific line and just set a failure.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-20 15:57:06 -05:00
Jukka Rissanen
94177a200e net: ipv6: Add support for stable IID addresses
This implements support for RFC 7217 which describes a method
to have stable IPv6 Interface Identifiers to be used with IPv6
Stateless Address Autoconfiguration (SLAAC). The stable IIDs are used
to provide enhanced privacy so that an IPv6 address configured using
this method is stable within each subnet, but the corresponding
Interface Identifier changes when the host moves from one network
to another. This method is meant to be an alternative to generating
Interface Identifiers based on hardware (MAC) addresses,
such that the benefits of stable addresses can be achieved without
sacrificing the security and privacy of users.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-16 15:55:49 -05:00
Adrian Gielniewski
9fd9e231df net: openthread: Add platform message management
* Add CONFIG_OPENTHREAD_PLATFORM_MESSAGE_MANAGEMENT to allow enabling
message management by the platform.
* Add implementation of `otPlatMessagePoolInit`, `otPlatMessagePoolNew`
and `otPlatMessagePoolFree`.

Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
2024-11-16 15:21:20 -05:00
Fin Maaß
8646a6c289 net: ethernet: arp: extend error log
If a gateway is not set for a interface,
also log the destination address.

Also print the interface index instead of the
interface pointer.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-11-16 14:56:57 -05:00
Hui Bai
67980643d7 net: wifi: Fix 11k command errors
Add condition check so that the 11k flag will be updated for set
operation only.
Fix print log error when getting 11k status.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2024-11-07 18:42:15 -08:00
Chaitanya Tata
fd7fc17810 net: wifi: Fix strings for missing enumerations
Enumerations were extended but respective strings were not added.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-07 18:41:53 -08:00
Jukka Rissanen
3e1e2ea8ec net: wifi: mgmt: Use memcpy instead of strncpy
Using strncpy gives this warning

warning: 'strncpy' output may be truncated copying 32 bytes from
  a string of length 32 [-Wstringop-truncation]

 strncpy(roaming_params.neighbor_rep.neighbor_ap[idx].bssid_info,
         bssid_info,
         sizeof(roaming_params.neighbor_rep.neighbor_ap->bssid_info));

There is '\0' at the end of the allocated buffer so we can safely
use memcpy() here to avoid any warnings.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-05 10:52:29 -06:00
Jukka Rissanen
0a75809a8e net: wifi: mgmt: Check string length in sscanf
Make sure we are not able to overwrite string variables in sscanf
call. Allocate also one extra byte for null terminator character.

Fixes #80644

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-05 10:52:29 -06:00
Fengming Ye
91d9cc259d net: wifi: shell: add 80211R usage in connect command
Add 80211R fast BSS transition argument usage in connect command.

Signed-off-by: Fengming Ye <frank.ye@nxp.com>
2024-10-31 09:23:48 -05:00
Hui Bai
83812f213f modules: hostap: add 11k/v/r roaming support
Added new ops and events in glue layer to support roaming.
Added new flag WIFI_NM_WPA_SUPPLICANT_ROAMING to control roaming
feature.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2024-10-25 13:53:49 +02:00
Hui Bai
91ec46e961 modules: hostap: add IEEE80211R support
Add 80211R support in hostap.
Add cmd wifi connect option '-R' to enable 80211R.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2024-10-25 13:53:49 +02:00
Hui Bai
7c167c67c3 modules: hostap: add 11k cmd support
Add 11k cmds support. User can issue 11k cmds to enable/disable 11k and
send Neighbor Report Request packet.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2024-10-25 13:53:49 +02:00
Daniel DeGrasse
e6fc2be803 net: l2: wifi: add explicit dependency on "app" target for pem headers
Generated PEM headers need to be created before we build the WiFi shell
when WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE is enabled, so add an
explicit dependency on the app target to be certain these headers are
created

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-24 09:29:21 +02:00
Gang Li
0d2f23f251 net: wifi: Fix the ap config command using the sta interface
The "wifi ap config" command uses the station interface via
net_if_get_first_wifi(), and should use the ap interface.

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2024-10-24 03:46:37 +01:00
Maximilian Deubel
e7ce0f5dab net: lib: wifi_credentials: add connect-stored feature
This patch adds a feature to directly connect to stored Wi-Fi
credentials without having to compose the NET_MGMT commands yourself.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2024-10-22 08:21:04 -04:00
Rex Chen
be151908d8 net: wifi: shell: add enterprise support for station
Add EAP-TLS, EAP-PEAP-MSCHAPv2, EAP-PEAP-GTC, EAP-TTLS-MSCHAPv2,
EAP-PEAP-TLS, EAP-TLS-SHA256  enterprise wpa2 and wpa3 suiteb
support for station.

Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
2024-10-17 09:46:02 +02:00
Ajay Parida
0ce5da6da8 wifi_mgmt: Add support for configuring PS exit strategy
If AP indicates the presence of buffered traffic, then it is up to the
STA to decide whether to stay in PS or come out of PS, add configuration
options that can be used at runtime to choose this.

This is tagged as "noup" because it's a backport and "fromlist" cannot
be used as it won't apply cleanly.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Maochen Wang
4af697ad6b net: l2: wifi: fix AP sets band failed with channel 0
Should support setting band for both STA and SAP mode.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-10-17 09:42:59 +02:00
Gaofeng Zhang
0c54a3f8c7 hostapd: add ap status in l2 wifi
add ap status in l2 wifi

Signed-off-by: Gaofeng Zhang <gaofeng.zhang@nxp.com>
2024-10-15 19:09:33 -04:00
Chaitanya Tata
4c5a72f9e0 net: wifi: Fix PEM certificate parsing errors
MbedTLS specifically checks for null-terminator, else it skips PEM
format processing and tries to parse it as DER causing parsing failures.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-15 13:53:30 +02:00
Jukka Rissanen
c6aa9e3803 wifi: shell: btm_query: Fix invalid pointer cast
The 11v_btm_query shell command was calling parse_number() using
a pointer to uint8_t. This will cause memory overwrite and possible
crash. Convert to use long temporary value to avoid this.

Fix also the output prints in case of an error.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-10-15 04:07:59 -04:00
Jukka Rissanen
8105f70d7a wifi: shell: Add missing newlines when printing error
The parse_number() did not print newline after error or warning message.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-10-15 04:07:59 -04:00
Jukka Rissanen
32aa1d634e wifi: Refactor wifi-shell to allow external subcommands
Rework the wifi-shell code so that external subcommands can be
bolted into it easily. This means that the commands should be
created using SHELL_SUBCMD_ADD().

Place the various subcommands in alphabetical order to find them
more easily.

Split long lines in order to pass CI checks.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-10-15 04:07:59 -04:00
Ayush Singh
5b5d6366e3 net: l2: ieee802154: shell: Fix stringop-truncation
- Fix the warning stringop-truncation
- Leave space for NULL terminator.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2024-10-09 13:50:00 +02:00
Chaitanya Tata
1da74ef705 net: wifi: Fix DPP disabled build
In case WPA supplicant disabled DPP, we need to compile out the
corresponding DPP code in Wi-Fi shell too.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-07 17:12:16 +01:00
Rex Chen
82ec1d7862 net: wifi: shell: add wps support
Add wps pin and wps pbc L2 layer cmd support.

Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
2024-10-05 14:07:48 -04:00
Pisit Sawangvonganan
7d1953918a net: wifi: shell: enhance consistency in cmd_wifi_dpp_ap_auth_init
The `cmd_wifi_dpp_ap_auth_init` function was added but is not yet
aligned with others.
This update enhances consistency with the following changes:
- Unified the order of declaration for `opt`, `opt_index`,
  `state`, and `long_options`.
- Wrapped lines in the `long_options` declaration to prevent them
  from extending too far to the right.
- Applied `struct option` as `static const`
- Unified the wrapping of `getopt_long` calls, regardless of
  the length of the `options` string.
- Using `getopt_state` to access `optarg` and also `optopt` offers
  a better alternative to direct global access.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-10-05 14:07:33 -04:00