forked from kaloz/mwlwifi
-
Notifications
You must be signed in to change notification settings - Fork 1
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
[DNM] Fix processing of power limit file #2
Draft
nhed
wants to merge
4
commits into
starry-10.3.8.0-20181031
Choose a base branch
from
nhed/txpwrlmt_cfg_issues
base: starry-10.3.8.0-20181031
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.
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
nhed
force-pushed
the
nhed/txpwrlmt_cfg_issues
branch
2 times, most recently
from
October 30, 2020 00:16
c9e96b1
to
f05b23c
Compare
mtp401
suggested changes
Oct 30, 2020
nhed
force-pushed
the
nhed/txpwrlmt_cfg_issues
branch
from
November 2, 2020 19:30
f05b23c
to
3693ddd
Compare
mtp401
previously approved these changes
Nov 3, 2020
nhed
force-pushed
the
nhed/txpwrlmt_cfg_issues
branch
from
November 19, 2020 22:09
3693ddd
to
1d7a521
Compare
The helper function mwl_fwcmd_parse_txpwrlmt_cfg could run into several errors reading input form essentially a text hexdump and converting it to binary data to send to the firmware. Adding some sanity checks to guard against: - Only the first char of a (2 char) hex byte was tested, second char was wrongfully assumed to be hex. - Unrecognized characters were silently skipped. So human error leaving a `O` instead of a `0` would have dire consequences. Prefer to abort the whole file processing. - Being able to convert less than the requested number of bytes should be a total failure. Added aborts in mwl_fwcmd_set_txpwrlmt_cfg_data if any of the invocations of the helper function above failed. Note that this allows some (lower ID) subbands to be sent to firmware while later subbands woul be skipped.
This presents the same data as mwlwifi/txpwrlmt but it is formatted as hex for consumption as the firmware file mwlwifi/txpwrlmt_cfg.conf. With this you can: 1. Save the current eeprom stored values when mwlwifi/txpwrlmt_cfg.conf is not present for manual editing (to lower values). 2. Compare (diff) against mwlwifi/txpwrlmt_cfg.conf (when it is present) to confirm that it is properly processed.
The message includes not only the subband data but also the subband header so reducing the message by the header size caused some data read from file to trashed on way to firmware. With this mod can read back same subband data as is present in the txpwrlmt_cfg.conf file.
nhed
force-pushed
the
nhed/txpwrlmt_cfg_issues
branch
from
September 24, 2022 21:23
1d7a521
to
e215a73
Compare
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.
Fix undersized
) is the actual fix!Harden parsing
, &Probably should not release mutex
) address potential issues.Add /sys/kernel
) is nice to have but function can be performed with a bash script as well (which I have).