-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
net: wifi_mgmt: reduce struct wifi_scan_params
size
#62735
Merged
carlescufi
merged 3 commits into
zephyrproject-rtos:main
from
csiro-wsn:230916_wifi_scan_size
Sep 25, 2023
Merged
net: wifi_mgmt: reduce struct wifi_scan_params
size
#62735
carlescufi
merged 3 commits into
zephyrproject-rtos:main
from
csiro-wsn:230916_wifi_scan_size
Sep 25, 2023
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
JordanYates
requested review from
rlubos,
tbursztyka and
jukkar
as code owners
September 16, 2023 06:06
krish2718
reviewed
Sep 17, 2023
jukkar
previously approved these changes
Sep 18, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
krish2718
previously approved these changes
Sep 18, 2023
Dropped the SSID conversion as this cannot be done with the existing override functionality: #62751 |
jukkar
previously approved these changes
Sep 20, 2023
krish2718
previously approved these changes
Sep 21, 2023
@JordanYates please rebase |
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>
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>
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>
rlubos
approved these changes
Sep 21, 2023
jukkar
approved these changes
Sep 22, 2023
#63009 contains follow-on work (SSID optimisations and re-adding |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
These commits reduce the overall size of
struct wifi_scan_params
in its default configuration from 1412 bytes to 20 bytes.The only driver I am aware of that implements these advanced scanning functions is the Nordic nRF700x OOT driver.
The two API changes are trivial to integrate into that driver as:
ssids
is being memcpy'ed to local memorychan
nested array is iterated over to create a linear frequency arrayShouldn't be considered a stable API change as this was introduced since the last release (#60686).
Fixes #62584.
The idea to specify channels as bitmasks was not implemented as (at least in the nRF700x driver) the channels are converted to frequencies. Converting back to frequencies from a packed bitmask would require a lookup table.