Commit graph

75 commits

Author SHA1 Message Date
Maochen Wang 001ac3976a modules: hostap: fix hostap compile error and support enterprise
Fix compile error when enable enterprise security mode.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-06-20 12:47:18 +02:00
Ajay Parida e493d8c268 net: l2: wifi: Fix for typo
Typo: "RTS threashold" changed to "RTS threshold".

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2024-05-29 14:09:59 +02:00
Ajay Parida d4b22cd10e net: wifi_mgmt: Support to configure AP parameter max_num_sta
Support to set BSS parameter "max_num_sta" at compile and run time

Added support to configure `max_num_sta` BSS parameter.
Maximum number of stations allowed in station table. New stations will be
rejected after the station table is full.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2024-05-29 14:09:59 +02:00
Ajay Parida bedd38ce65 net: wifi_mgmt: Support AP parameter configuration "Skip inactivity poll"
Support for configuration of AP parameter "Skip inactivity poll".
Only build time setting is supported.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2024-05-29 14:09:59 +02:00
Ajay Parida c6d1a91372 net: wifi_mgmt: Support to configure AP mode parameter
Support to set BSS parameter at compile and run time.

Added support to configure `max_inactivity` BSS parameter.
Station inactivity timeout is the period for which AP may keep a client
in associated state while there is no traffic from that particular client.
If a non-zero value is set, AP may choose to disassociate the
client after the timeout.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2024-05-29 14:09:59 +02:00
Kapil Bhatt cc42d16b1c net: wifi: Add disconnection success code
When disconnect request is successful, the status
was taking as WIFI_REASON_DISCONN_UNSPECIFIED only.
Adding WIFI_REASON_DISCONN_SUCCESS which can be help
to determine status of disconnect request. If this status
is failed then reason can be useful.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2024-05-24 08:04:59 -04:00
Jukka Rissanen 3b56c7baf8 net: doc: wifi_mgmt.h: Improve documentation
Add missing doxygen comments for wifi_mgmt.h header file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-05-21 15:41:19 -07:00
Ajay Parida 4d4b304e03 net: wifi_mgmt: Setting RTS threshold
Support to set RTS threshold.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2024-04-18 08:42:29 -07:00
Chaitanya Tata 5997815352 wifi: Remove unused defines
When the ops for PS parameters we removed and aggregated into a single
OP, the respective defines weren't cleaned up.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-04-11 12:29:38 +02:00
Kapil Bhatt a087a40ac6 net: wifi: Remove constraints for dwell time
There is no limitations for dwell time. Just add
valid condition for positive value. So , it's better
to remove those constraints.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2024-04-09 14:21:10 +02:00
Kapil Bhatt 10d9099356 net: wifi: Add reasons for 4 way handshake failure
When there is 4 way handshake timeout, it can be because of
incorrect credential or some times when AP's signal strength
is weak. It can cause 4 way handshake fail. Adding comment
where WIFI_STATUS_CONN_WRONG_PASSWORD is defined.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2024-03-29 15:08:22 +00:00
Kapil Bhatt 6a0e6e4737 net: wifi: Replace numeric values with defines
There should be a particular defines which clarify the
use of that number. So, replacing numbers with defines
in wifi shell.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2024-03-29 15:08:00 +00:00
Kapil Bhatt 6e6f53dc8e net: wifi: Fix disconnect reason codes
The shell is printing "connected" while passing
the wrong password to connect command. If the status
value is 0, then only shell will print "connected."
The wrong password will disconnect the connection
with an unspecified reason code.

If the default value of the unspecified disconnect
reason code is 0, then status will print "connected."
By changing the default value to WIFI_STATUS_CONN_LAST_STATUS,
it will print the correct reason, like a failed request
with reason code.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2024-03-26 17:24:34 -04:00
Ravi Dondaputi 73ed81ccce net: wifi: shell: Support BSSID configuration
Add support for BSSID configuration in connect call.

Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
2024-03-26 11:13:21 -05:00
Jukka Rissanen e352a6e8e9 wifi: Have a separate wifi_drv_ops in wifi_mgmt_offload struct
There is no need to hide the wpa_supplicant interface
struct so add it directly to net_wifi_mgmt_offload struct.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-26 15:52:54 +00:00
Sandip Dalvi 4c7eb600c6 net: wifi: add wifi driver version API
Add command to query to WiFi driver/firmware revision. The API is expected
to return the firmware revision and driver version as a string, and can be
used by the user to determine what revision of the WiFi driver is in use.

Signed-off-by: Sandip Dalvi <sandip.dalvi@nxp.com>
2024-01-26 14:29:39 +01:00
Chaitanya Tata de667a7fae wifi: ap: Add support to disconnect a STA
In AP mode, this can be used to disconnect a connected station.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-01-25 11:50:59 -05:00
Ajay Parida fc959fce47 net: shell: Early wake up for TWT power save
Provision of configurable parameter for generating unblock event
ahead of TWT slot. Host application depending upon latencies can
configure this to wakeup rpu ahead of the TWT slot.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2024-01-12 15:56:56 -05:00
Ajay Parida 56de0a347e net: mgmt: Provide Regulatory channel info
Updated to provide regulatory channel information along with country
code.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2024-01-12 09:59:19 +01:00
Ajay Parida 3053484dcb net: mgmt: Update app of TWT teardown status
Update user/app status of TWT teardown sessions.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2024-01-11 15:42:50 -06:00
Chaitanya Tata 725c13bafb wifi: ap: Add client side events
These are helpful to track clients being added and deleted.
Applications can actions based on these events.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-01-11 10:03:02 +01:00
Chaitanya Tata 2703955aee wifi: ap: Add status events
These events communicate the status of AP mode operations (enable or
disable) with few pre-defined enumerations.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-01-11 10:03:02 +01:00
Chaitanya Tata ceee997c6f wifi: Add the enums to the status
This helps to demonstrate that the enumerations have to be used to
interpret the status.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-12-11 09:57:19 +01:00
Chaitanya Tata d8d4c77603 wifi: Add an enum for disconnect reasons
This can be used to interpret the "status" in the disconnect result event.
To start with a few common reasons are enumerated but can be extended in
the future.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-12-11 09:57:19 +01:00
Chaitanya Tata b3453c3f74 wifi: Add an enum for connect result status
This can be used to interpret the "status" in the connect result event.
To start with a few common reasons are enumerated but can be extended in
the future.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-12-11 09:57:19 +01:00
Maciej Zagrabski b2fb570635 net: wifi: Pass psk and sae as const
There shouldn't be any reason to be able to modify the passed psk,
and having this non-const gives application warnings if passing a
constant string.

Signed-off-by: Maciej Zagrabski <mzi@trackunit.com>
2023-11-10 10:39:43 +01:00
Jordan Yates a32e7aaa10 net: wifi_mgmt: update SSID storage type
Update the storage type of the SSID strings to pointers to the strings,
instead of needing to copy the strings into the struct. This
substantially reduces the parameter struct size.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-09-28 15:44:01 +02:00
Jordan Yates b54951b86e net: wifi_mgmt: linearise scan_params->chan arrays
Turn the nested arrays of `scan_params->chan` into a single array.
This adds the requirement to specify the band for each channel, but
eliminates the large amount of dead memory for unused bands. Overall,
this saves 50% of the RAM space for this variable.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-09-25 09:48:16 +02:00
Jordan Yates 6a428f19b6 net: wifi_mgmt: make number of scan channels configurable
Make the maximum number of channels that can be manually scanned
configurable by the application. The previous value of 233 was vastly
overallocating memory as the largest band only contains 60 allocated
channels.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-09-25 09:48:16 +02:00
Jordan Yates 8940343ead net: wifi_mgmt: avoid declaring zero length array
Zero length arrays are a GNUism not supported by all compilers. If
`zephyr/net/wifi_mgmt.h` is included by an application without WiFi
enabled, ensure array is at least one element long.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-09-25 09:48:16 +02:00
Jordan Yates dd090f06b7 net: wifi_mgmt: change type of wifi_scan_params->chan
All WiFi channel numbers fit within a 8 bit number, as the maximum
allocated channel is 233. This halves the memory requirement.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-09-18 10:54:31 +01:00
Vivekananda Uppunda 450dbb15ef net: l2: wifi: Add support for W-Fi mode setting and selection
This change brings in support for setting various Wi-Fi modes and
enables a specific Wi-Fi interface to be also placed into a sniffer
operation via monitor mode and promiscuous mode. A raw TX- packet
Injection mode is also introduced

Signed-off-by: Vivekananda Uppunda <vivekananda.uppunda@nordicsemi.no>
2023-09-13 11:47:28 +02:00
Sachin D Kulkarni 0b92327fc3 net: wifi: Fix crash in wifi_utils_parse_scan_bands
wifi_utils_parse_scan_bands could cause a crash if a constant string is
passed to it. Fix this by duplicating the input string parameter before
parsing it with strtok_r.

Signed-off-by: Sachin D Kulkarni <sachin.kulkarni@nordicsemi.no>
2023-09-12 09:24:06 +02:00
Jukka Rissanen 7d3dabf07b net: wifi: Properly namespace public APIs
The twt and ps helper functions were not namespaced (were missing
wifi_ prefix).

Also change wifi_get_twt_... to more logical wifi_twt_get...
like the other twt prefixed functions and wifi_get_ps... to
wifi_ps_get... like the other ps prefixed functions.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-08-31 10:20:07 +02:00
Noah Luskey e71840ed69 net: wifi_mgmt: Fix size calculation for net_mgmt info
net_iface_status is larger than scan_result, causing
net_iface events to be dropped due to info exceeding
NET_EVENT_INFO_MAX_SIZE.

Signed-off-by: Noah Luskey <LuskeyNoah@gmail.com>
2023-08-25 10:52:14 +02:00
Sachin D Kulkarni b572e8216a net: wifi: Add scan extension for specifying channels
Add scan extension to allow limiting the scanning to specific channels.
Only 20 MHz channel specifications are allowed presently.

Signed-off-by: Sachin D Kulkarni <sachin.kulkarni@nordicsemi.no>
2023-08-23 16:05:08 +01:00
Sachin D Kulkarni 01e167988c net: wifi: Add scan extension for limiting scan results
Add scan extension to allow limiting the scan results to a user defined
maximum number. This parameter is intended to return results with the
best RSSI. It cannot be counted upon to limit the scan times since the
Wi-Fi chips might have to scan all the channels to find APs with the
best RSSI values across all channels.

Signed-off-by: Sachin D Kulkarni <sachin.kulkarni@nordicsemi.no>
2023-08-23 16:05:08 +01:00
Sachin D Kulkarni 5c399c2d17 net: wifi: Add scan extension for filtering SSIDs
Add scan extension to scan only for specific SSIDs.

Signed-off-by: Sachin D Kulkarni <sachin.kulkarni@nordicsemi.no>
2023-08-23 16:05:08 +01:00
Sachin D Kulkarni 6328fda702 net: wifi: Add scan extension for passive channel dwell times
Add scan extension to control scanning time spent on channels where
passive scanning is used.

Signed-off-by: Sachin D Kulkarni <sachin.kulkarni@nordicsemi.no>
2023-08-23 16:05:08 +01:00
Sachin D Kulkarni 3c130b138f net: wifi: Add scan extension for active channel dwell times
Add scan extension to control time spent on active scan channels.

Signed-off-by: Sachin D Kulkarni <sachin.kulkarni@nordicsemi.no>
2023-08-23 16:05:08 +01:00
Sachin D Kulkarni ee6c81896d net: wifi: Added scan extension support for frequency bands
Added scan extension to support scanning individual Wi-Fi bands or
combinations thereof.

Signed-off-by: Sachin D Kulkarni <sachin.kulkarni@nordicsemi.no>
2023-08-23 16:05:08 +01:00
Chaitanya Tata 5ec3650d9f net: wifi: Add doxygen style comments
Fix doxygen formatting and add comments.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-07-14 15:02:29 +02:00
Chaitanya Tata a132487fec net: wifi: Move Wi-Fi ops to a separate struct
Decouple interface and Wi-Fi APIs, Wi-Fi APIs are common independent of
Wi-Fi offload or implemented natively (This is preparation for
introducing Native Wi-Fi).

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-07-11 14:55:30 +02:00
Ajay Parida 69fead1998 net: mgmt: Support for forced Passive scan
Default scan mode is Active. User can force the scan mode to passive
through Kconfig option or using 'passive' option from shell.
Using either of this option will override regulatory settings and
forces all scan channels to be passive only.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2023-06-29 21:05:41 +02:00
Chaitanya Tata a71bff7f49 net: wifi: Fix power save timeout data type
This should be an unsigned integer. Also, add a comment to explain this
feature.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-06-27 12:17:26 +00:00
Krishna T 10f3ca2e1d net: wifi: Add an event for disconnect complete
This is needed for applications that rely on WPA supplicant being
in disconnected state before issue subsequent commands (e.g., issue scan
immediately after disconnect fails, until disconnect is completed).

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
2023-05-16 13:21:10 +02:00
Ajay Parida e70bb70651 net: wifi_mgmt: Support to provide raw scan data
Support to provide raw beacon and probe response data
to registered application.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2023-05-12 10:50:21 +00:00
Ajay Parida 7f9ba751e9 net: wifi_mgmt: Handle ps command error
Failure of setting ps param is handled with error string
at user/ app level.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2023-05-09 15:04:00 +02:00
Ajay Parida 49e6b0c256 net: shell: Code cleanup for ps related commands
Setting ps_mode and ps_timeout related changes handled
in single power save op.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2023-05-09 15:04:00 +02:00
Ajay Parida bdef1bad78 net: wifi_mgmt: Configure ps wakeup mode
'ps_wakeup_mode' is used to set the wake up interval
to either 'dtim or 'listen_interval'. By default the
sta wakes up every dtim interval.
With 'ps_wakeup_mode' set to 'listen_interval' sta
will wake up for every listen interval period configured.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2023-05-09 15:04:00 +02:00