This repository has been archived by the owner on Nov 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Use asserts as a suggestion #67
Open
krish2718
wants to merge
113
commits into
nrfconnect:main
Choose a base branch
from
krish2718:add_min_libc_ram_assert
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Modifications for building supplicant on Zephyr RTOS. Signed-off-by: Sridhar Nuvusetty <[email protected]> Signed-off-by: Sachin Kulkarni <[email protected]> Signed-off-by: Ravi Dondaputi <[email protected]> Signed-off-by: Krishna T <[email protected]> Co-authored-by: krishna T <[email protected]>
The file was removed but was still included.
sdk-nrf has a different version where these variables are not private, so, remove the private macro for build.
* Adding CODEOWNERS file .. Adding @krish2718 @sr1dh48r @rlubos @sachinthegreen Co-authored-by: krish2718 <[email protected]>
Remove uninitialized variable that is no longer needed, this causes crash in case supplicant thread exits.
* Include HOSTAP_BASE to fix header file paths * Select WEP automatically through Kconfig
nRF CI treats warnings as errors, so, this is must.
Add proper pre-processor conditions to the code that uses IPv4 API. Signed-off-by: Damian Krolik <[email protected]>
PR [1] is now up-merged to NCS, so, remove the workaround. [1] - zephyrproject-rtos/zephyr#45592 Signed-off-by: Krishna T <[email protected]>
Previous to [1] we used to get L2 header and that was used to filter unregistered frames (another bug), but now that L2 header is removed, we cannot use L2 header, so, directly parse payload and filter EAPoL frames only. [1] - zephyrproject-rtos/zephyr#45592 Signed-off-by: Krishna T <[email protected]>
Add const qualifier to the declaration. Signed-off-by: Krishna T <[email protected]>
1. Add WPA_SUPP_LOG_LEVEL_* Kconfig options to control the WPA supplicant log level the same way as other SDK components. 2. Add WPA_SUPP_DEBUG_LEVEL Kconfig option to be used for compile-time filtering of WPA supplicant debug messages. By default, it is aligned with WPA_SUPP_LOG_LEVEL. 3. Implement Zephyr variants of wpa_debug.h and wpa_debug.c files that use Zephyr logging subystem as the default output and apply compile-time filtering for the messages. Signed-off-by: Damian Krolik <[email protected]>
As per Apache-2.0 license, we need to indicate that the files have been modified, the recommended way is to add an extra copyright header. Signed-off-by: Krishna T <[email protected]>
Eloop framework in wpa_supplicant uses select with minimal timeout of all registered users, but by default it is 10secs (periodic cleanup task), so, in case of no other events all registered users will be delayed by 10secs. In Linux, select exits without waiting for full 10secs as for there is a handler registered for NL80211 sockets and whenever there is a event from Kernel select exits and processes expired events immediately. In Zephyr, we don't have such mechanism as we use direction function calls between kernel and wpa_supplicant, so, add an event socket and register it with Eloop and use this to post the event, the socket handler pass the event to wpa_supplicant. For user interface we just post a dummy message only to unblock select. This solves both problems: * Unblocking select for all interesting events immediately * Terminate driver context for events as we use sockets, so, remove mbox + thread. This significantly improves the association time from 30s to 5s. Signed-off-by: Krishna T <[email protected]>
This fixes unnecessary wait for scan results in case of failure scenarios. Signed-off-by: krishna T <[email protected]>
Scan results are allocated by driver using k_malloc Zephyr allocator but are freed by wpa_supplicant using libc free, due to changes in metadata differences between them, we free the pointer which is 8 bytes below the actual one and cause a bus and mem fault. Copy the scan results from driver before passing to the wpa_supplicant and then let driver free them using the same k_free allocator API. We can now enable the scan results free code. Signed-off-by: Krishna T <[email protected]>
This can cause allocation failures and an unnecessary prints. Signed-off-by: Krishna T <[email protected]>
Using first interface handle everywhere is not ideal, esp. when we add support for multi-VIF, so, query wpa_supplicant with the interface name to get the handle. The interface name itself is hard coded to "wlan0" everywhere for now.
Sometimes we are getting a unsolicited or spurious scan result from UMAC but we have already freed the scan results buffer, so, add a null check before processing scan result.
This print is only for debugging, so, should use DEBUG level. Signed-off-by: Krishna T <[email protected]>
These APIs will be used by nRF Wi-Fi management to interact with wpa_supplicant. Signed-off-by: Krishna T <[email protected]> Signed-off-by: Ravi Dondaputi <[email protected]>
This is now purely an internal utility, so, moved from sdk-nrf to here as it works with wpa_supplicant. Signed-off-by: Krishna T <[email protected]>
Now that display scan is natively supported using wifi_mgmt, remove it from WPA supplicant API and wpa_cli. Signed-off-by: Krishna T <[email protected]>
Using UDP sockets need an interface with properly configured IP address and then either IPv4/IPv6 enabled, UNIX socket don't need any of those and work perfectly well for IPC. This solves two bugs: * Matter doesn't enable IPv4, so, the events stop working, as the code doesn't support IPv6 sockets and also doesn't protect with IPv4 define. * Wi-Fi sample assigns IP address in the `prj.conf` but if an application doesn't do that, then socket send fails. Signed-off-by: Krishna T <[email protected]>
After every successful association, restart DHCP to get a fresh lease. For the initial association this avoid delay due to DHCP exponential retries, and also handles the case where interface has changed IP subnet. Signed-off-by: Krishna T <[email protected]>
With recent changes, WPA CLI build is broken. Signed-off-by: Krishna T <[email protected]>
All options depend on WPA_SUPP, so, add a check. Signed-off-by: Krishna T <[email protected]>
Don't use the same acronym in help. Signed-off-by: Krishna T <[email protected]>
The scan result is always freed in the driver for both success and failure cases, so, no need for wpa_supplicant to free in failure case. Signed-off-by: Krishna T <[email protected]>
If a second configuration is defined but failed to read, then the first configuration is leaked. Signed-off-by: Krishna T <[email protected]>
In some commands argv is accessed fully and relies on NULL value to exit. This causes hard to debug crash. Signed-off-by: Krishna T <[email protected]>
This is needed to manage interfaces using control interface for the upcoming hotplugging support. Signed-off-by: Krishna T <[email protected]>
Use "z_wpas_" as the prefix for all internal functions to disambiduate between wpa_supplicant APIs. Signed-off-by: Krishna T <[email protected]>
Using the network management events from the driver dynamically add/remove interfaces to the WPA supplicant, this ensures a better integration of driver and WPA supplicant rather than WPA supplicant assuming interface is administratively up. Default behaviour now would be for the interface to be administratively up but operationally down till the WPA supplicant associates and then interface will be operationally up. Signed-off-by: Krishna T <[email protected]>
errno is not applicable for malloc, so, remove and add missing logs for other error scenarios. Signed-off-by: Krishna T <[email protected]>
With the limited messages we expose 1024 should be enough, this reduces the overall stack size. Signed-off-by: Krishna T <[email protected]>
When switching to control interface, the code to configure channel from user to WPA supplicant has been removed, use the control interface to configure the channel. Signed-off-by: Krishna T <[email protected]>
This was missed in cleaning up old interface. Signed-off-by: Krishna T <[email protected]>
All these WPA cli command invocations need to be checked for return value to catch issues early. Signed-off-by: Krishna T <[email protected]>
Use proper API to print it out. Signed-off-by: Krishna T <[email protected]>
* Check for security instead of assuming psk means security (Handy in test for switching b/w PSK and None). * Use Enums and remove comments. * Specifically check for PSK. * Throw error if not matching any. Signed-off-by: Krishna T <[email protected]>
Now that we are using control interface as the primary communications this is applicable for all. Signed-off-by: Krishna T <[email protected]>
Signed-off-by: Krishna T <[email protected]>
This is needed esp. for "wifi status" as that makes a call all the way to Driver, and if its called from network management thread then more stack is needed. Signed-off-by: Krishna T <[email protected]>
EK support is still experimental. Signed-off-by: Krishna T <[email protected]>
The minimum requirement for WPA supplicant is 4. Signed-off-by: Krishna T <[email protected]>
SHEL-1269: Multiple BSSID bit is not set in Association request Implement get_ext_capab op to get MBSSID support cap. info Signed-off-by: Sridhar Nuvusetty <[email protected]>
Skip printing OK/FAIL. Signed-off-by: Krishna T <[email protected]>
Signed-off-by: Krishna T <[email protected]>
This is to catch any RAM limitations early. Signed-off-by: Krishna T <[email protected]>
Using imply makes them a suggestion not a hard requirement. Signed-off-by: Krishna T <[email protected]>
sachinthegreen
approved these changes
Feb 17, 2023
sr1dh48r
approved these changes
Feb 27, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using imply makes them a suggestion not a hard requirement.