Commit graph

38 commits

Author SHA1 Message Date
Rahul Gurram
9781a3531f drivers: wifi: siwx91x: Handling data packets for AP mode
In the raw data send API, the interface was hardcoded
for client mode. Now, we determine the opermode and
pass the appropriate interface to the raw data API
based on the current opermode.

Signed-off-by: Rahul Gurram <rahul.gurram@silabs.com>
2025-06-04 15:51:07 -04:00
Arunmani Alagarsamy
28be2211f4 drivers: wifi: siwx91x: Correct handling of BSSID in interface status
This commit resolves incorrect results in the interface status response.
The parameter for `sl_wifi_get_wireless_info` has changed following the
HAL Silabs update to version 3.5.0.

In AP mode, the implementation now correctly uses the `mac_address`
variable instead of `bssid`.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-06-04 17:04:24 +02:00
Arunmani Alagarsamy
de6395d5d0 drivers: wifi: siwx91x: Handle error case in power save mode
Power save is not supported in AP mode. This commit ensures that
`-EINVAL` is returned instead of success, preventing incorrect behavior.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-06-04 17:04:24 +02:00
Muzaffar Ahmed
ecaa19b71b drivers: wifi: siwx91x: Remove set credential for open mode
Removed the unnecessary set_credential API call in open security mode

Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
2025-05-27 11:51:17 +02:00
Nitin Pandey
21b20de1eb drivers: wifi: siwx91x: Fix passive scan bug
- Setting default value of passive scan
  dwell time of 400ms as SDK doesn't
  configure default value.

Signed-off-by: Nitin Pandey <nitin.pandey@silabs.com>
2025-05-26 14:17:30 +02:00
Nitin Pandey
efd9519c0a drivers: wifi: siwx91x: Fix MFP bug in wifi status
- Extracting MFP from security mode
  instead of join feature bitmap

Signed-off-by: Nitin Pandey <nitin.pandey@silabs.com>
2025-05-26 14:17:30 +02:00
Nitin Pandey
67ff90d945 drivers: wifi: siwx91x: Fix bssid value in wi-fi status
- changed the BSSID value in siwx91x_status
  from STA MAC address to MAC address of
  connected AP

Signed-off-by: Nitin Pandey <nitin.pandey@silabs.com>
2025-05-26 14:17:30 +02:00
Muzaffar Ahmed
f489670cfb drivers: wifi: siwx91x: Add twt_retry_interval
Added twt_retry_interval (set to 5, the minimum required value by 917)

Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
2025-05-26 14:17:15 +02:00
Jérôme Pouiller
c3ce29eb81 drivers: wifi: siwx91x: Add support for get_power_save_config()
We can now implement the get_power_save_config() callback.

Co-authored-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-05-23 17:20:34 +02:00
Arunmani Alagarsamy
adae16812e drivers: wifi: siwx91x: Add support for set_power_save()
Added power-save mode support to optimize station wake-up timing
and reduce power consumption. The device currently supports
only legacy power-save mode.

This feature can be tested using the Wifi shell:
  - ps: Enable the PS. By default, the device operates in fast
        PSP mode.
  - ps_exit_strategy: Updates mode if enabled; otherwise, follows
        the configured exit strategy when power-save is enabled.
  - ps_wakeup_mode: Configures the wake-up behavior.
  - ps_timeout: Defines the timeout duration for power-save mode.

Co-authored-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-05-23 17:20:34 +02:00
Arunmani Alagarsamy
88846ddc81 drivers: wifi: siwx91x: Add Wi-Fi mgmt events
- Implement event handling for AP and STA modes
- Enable configurations for security (PSK), aggregation,
  and hidden PSK credentials

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-05-20 15:24:06 +02:00
Arunmani Alagarsamy
4c1a91fa63 drivers: wifi: siwx91x: Enable AP configuration support
- Adds support for configuring client maximum inactivity timeout.
- Adds support for bandwidth, It supports 20MHZ only.
- Adds support for setting the maximum number of clients and
  hidden SSID mode by rebooting the NWP device.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-05-20 15:24:06 +02:00
Arunmani Alagarsamy
0459bd8638 drivers: wifi: siwx91x: Replace opermode flags
Replaced SL_SI91X_CLIENT_MODE and SL_SI91X_ACCESS_POINT_MODE with
WIFI_STA_MODE and WIFI_SOFTAP_MODE, respectively, for AP configuration
command intergration.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-05-20 15:24:06 +02:00
Arunmani Alagarsamy
c8a29b3038 drivers: wifi: siwx91x: Add interface state validation
This patch introduces validation checks to ensure Wi-Fi commands are
executed only when the device is in a valid operational mode.

- Restricts command execution if the device is not in an appropriate mode
- Prevents reconfiguring the device when it is already in an active state
- Enabled Advanced multiprobe setting as default.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-05-20 15:24:06 +02:00
Muzaffar Ahmed
951d60dcbc drivers: wifi: siwx91x: Add support for TWT
- Implemented `siwx91x_set_twt_setup` and `siwx91x_set_twt_teardown` for
  handling TWT setup and teardown requests.
- Added validation for TWT parameters, including negotiation type,
  device state, and operation type.
- Integrated TWT functionality into the `wifi_mgmt_ops` structure for
  seamless management via the Zephyr Wi-Fi API.

Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
2025-05-15 14:08:37 +02:00
Arunmani Alagarsamy
dd1bfa4eb9 drivers: wifi: siwx91x: Fix default scan time handling
The commit `1f73ca3` clarified that a scan time of 0 should be used to
apply the default scan timeout, as opposed to using
SL_WIFI_DEFAULT_ACTIVE_CHANNEL_SCAN_TIME, which incorrectly results in
a 65-second timeout.

However, this fix was unintentionally omitted in commit `bf22b61`
when the `sl_si91x_configure_timeout()` function was relocated.

This commit restores the behavior.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-05-07 13:32:04 +02:00
Arunmani Alagarsamy
89d6068504 drivers: wifi: siwx91x: Add param change handling for STA and AP modes
Implemented logic to detect changes in key Wi-Fi parameters (SSID, PSK,
security, channel) and disable the interface accordingly. For STA mode,
the driver disconnects before reconnecting with updated parameters. For
AP mode, it disables and re-enables the AP if changes are detected.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-05-07 13:32:04 +02:00
Arunmani Alagarsamy
98e72e9ed6 drivers: wifi: siwx91x: Relocate driver functions
Relocate the functions siwx91x_status(), siwx91x_disconnect(), and
siwx91x_ap_disable() to improve code structure and accessibility. This
reorganization prepares the codebase for upcoming integration of
connection and AP enable logic that handles parameter differences.

No functional changes are introduced in this commit.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-05-07 13:32:04 +02:00
Nitin Pandey
50e36095dd driver: wifi: siwx91x: Add roaming configuration
- Defined Kconfig macros for Roam config
- Added set roam configuration API call
  after BGSCAN

Signed-off-by: Nitin Pandey <nitin.pandey@silabs.com>
2025-04-14 23:06:20 +02:00
Nitin Pandey
bf22b61540 driver: wifi: siwx91x: Implement scan dwell time
- Verified and configured scan
  dwell time for active, passive
  and advance scan

Signed-off-by: Nitin Pandey <nitin.pandey@silabs.com>
2025-04-14 23:06:20 +02:00
Nitin Pandey
4c5dd7384b driver: wifi: siwx91x: Add support for BG Scan
- Added support for background scan
  and configured the default values
  of BG scan configuration

Signed-off-by: Nitin Pandey <nitin.pandey@silabs.com>
2025-04-14 23:06:20 +02:00
Nitin Pandey
2b8af597ce driver: wifi: siwx91x: Handle MFP configuration
- Handled MFP configuration for STA and AP modes
- Updated the MFP configuration based on security modes

Signed-off-by: Nitin Pandey <nitin.pandey@silabs.com>
2025-04-09 19:32:26 +02:00
Nitin Pandey
0259bf56c8 driver: wifi: siwx91x: Add check for SAE password
- Modified conditions in WIFI_CONNECT()
  function to reject SAE password and
  PSK based on length parameter

Signed-off-by: Nitin Pandey <nitin.pandey@silabs.com>
2025-04-09 19:32:26 +02:00
Arunmani Alagarsamy
d5b2507a13 drivers: wifi: siwx91x: Add Wi-Fi version command support
Add support for the Wi-Fi version command to retrieve
the Wi-Fi firmware and driver version information.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-04-03 13:15:55 +02:00
Nitin Pandey
5661a5b25a driver: wifi: siwx91x: Add support for WPA_AUTO_PERSONAL
- Added support for wpa-wpa2 mixed mode in ap enable
- Added support for WPA3 Transition mode in STA connect

Signed-off-by: Nitin Pandey <nitin.pandey@silabs.com>
2025-03-31 21:59:51 +02:00
Arunmani Alagarsamy
601a9fab80 drivers: wifi: siwx91x: Add Wi-Fi status and statistics
This commit adds support for Wi-Fi status and statistics
functionalities:
- wifi status	  : Displays the current mode status.
- wifi statistics : Provides details on the transmitted and
                    received packet counts.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-03-20 12:17:22 +01:00
Arunmani Alagarsamy
2f29cb67b7 drivers: wifi: siwx91x: Add AP station disconnect functionality
This commit adds support the following wifi commands:
- wifi ap disconnect: Disconnect a specific station from the AP.
- wifi ap stations: List connected devices.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-03-20 12:17:22 +01:00
Arunmani Alagarsamy
7fc0a7b2d4 drivers: wifi: siwx91x: Add Access Point (AP) mode support
This commit introduces Access Point (AP) mode support
It enables the following AP-related commands:
- ap enable: Enable the AP mode.
- ap disable: Disable the AP mode.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-03-20 12:17:22 +01:00
Arunmani Alagarsamy
b578b06970 drivers: wifi: siwx91x: Add run time opermode
This commit enables the device to change its operating mode
at runtime.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-03-20 12:17:22 +01:00
Jérôme Pouiller
1f73ca3919 driver: wifi: siwx91x: Fix scan timeout
WiseConnect documentation says:

  Default value of 100 millisecs is used when
  SL_WIFI_DEFAULT_ACTIVE_CHANNEL_SCAN_TIME is passed".

However, this is not true. Currently, DEFAULT_ACTIVE_CHANNEL_SCAN_TIME
is 0xFFFF and the scan time is set to 65 seconds.

To have the default scan time, the value '0' must be used.

Fortunately, '0' is also the value we get when the user does not specify
any default scan time. So the code can be simplified.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-03-18 16:43:44 +01:00
Nitin Pandey
652c5f42ac driver: wifi: siwx91x: Fix scan params error for 5Ghz band
- Rejected non 2.4GHz band channels from Wifi-Scan.
- Overrode the WIFI_MGMT_SCAN_CHAN_MAX_MANUAL parameter to 50.
- Added check for wrong interface and invalid states

Signed-off-by: Nitin Pandey <nitin.pandey@silabs.com>
2025-03-13 10:49:03 +01:00
rahul gurram
ae857a1585 driver: wifi: siwx917: Fix the return case gracefully
Freeing the buf when sl_wifi_send_raw_data_frame() api returns
the error instead of success

Signed-off-by: rahul gurram <rahul.gurram@silabs.com>
2025-03-04 12:19:01 +00:00
Arunmani Alagarsamy
c75fadbdeb drivers: wifi: siwx917: Set security configuration to default
- Updated Wi-Fi security configuration to use default, allowing
  the device to select the best available encryption.
- Removed unsupported security features.
- Replaced `WIFI_SECURITY_TYPE_SAE` with `WIFI_SECURITY_TYPE_SAE_AUTO`
  to enable automatic selection between SAE-HNP and SAE-H2E,
  as the device supports both modes by default.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
2025-02-20 14:54:27 +00:00
Arunmani Alagarsamy
9d64cb4186 driver: wifi: siwx91x: Add active and passive dwell time
This commit adds support for configuring dwell times for both active and
passive Wi-Fi scans. The dwell time specifies the duration the device
spends on each channel during a scan.

Co-authored-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-02-14 19:14:08 +00:00
Arunmani Alagarsamy
2e668cfc1e driver: wifi: siwx91x: Add single and multi-channel scan support
This commit introduces support for single and multi-channel Wi-Fi scans.
The device can now scan one specific channel or multiple specified
channels.

Co-authored-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-02-14 19:14:08 +00:00
Arunmani Alagarsamy
4ee4cc39a3 driver: wifi: siwx91x: Add configurable maximum BSS scan
This commit introduces support for limiting the number of BSS scan
results returned by the siwx91x Wi-Fi driver. If scan_max_bss_cnt is
specified, the driver will return up to the specified count of BSS
results. If not specified, the driver defaults to returning all
available results.

Co-authored-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-02-14 19:14:08 +00:00
Arunmani Alagarsamy
271bb8b7b0 driver: wifi: siwx91x: Add direct ssid scan support
This commit introduces support for direct SSID scans The feature allows
the device to send the probe requests and listen the beacon frame on the
specified SSID.

Co-authored-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-02-14 19:14:08 +00:00
Jérôme Pouiller
1544354862 drivers: wifi: Introduce SiWx91x WiFi driver
This driver allow to use Zephyr native IP stack or the IP stack provided
by HAL / WiseConnect.

The WiseConnect implementation may take advantage of the specific
features provided by the 917 (power consumption, speed,
validation...).

Some notable features are not available with this interface:
  - It seems Zephyr does not provide API to offload multicast membership
    management. User should be to directly call WiseConnect APIs
  - Support for ICMP frames is difficult. Note that WiseConnect
    automatically answer to ping request. It is just not possible to
    send ping requests and receive ping responses.
  - Zephyr and WiseConnect both support TLS offloading. However this
    patch does not implement it.
  - Reentrancy in the WiseConnect side is uncertain.

This implementation has been tested with samples/net/wifi/ (which relies
on subsys/net/lib/shell).

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-02-11 22:07:11 +01:00