-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
wifi: TWT improvements #82312
wifi: TWT improvements #82312
Conversation
Please update the title and add description to explain these set of changes. |
Yes, of course, updated title and changes details , changes info also in separated PRs commit mesg |
Hi @krish2718 @jukkar |
subsys/net/l2/wifi/wifi_shell.c
Outdated
@@ -3184,15 +3200,16 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_twt_ops, | |||
"<setup_cmd: 0: Request, 1: Suggest, 2: Demand>\n" | |||
"<dialog_token: 1-255> <flow_id: 0-7> <responder: 0/1> <trigger: 0/1> <implicit:0/1> " | |||
"<announce: 0/1> <twt_wake_interval: 1-262144us> <twt_interval: 1us-2^31us>.\n" | |||
"<twt_wake_ahead_duration>: 0us-2^31us>\n", | |||
"<twt_wake_ahead_duration>: 0us-2^31us>\n" |
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.
We are getting now quite many positional parameters for these commands and it looks like not very user friendly way to implement this. Could this changed to use parameter "keywords", so something like -s, --setup <cmd> ....
so like what we have in other commands?
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.
Yes, of course, will implement as comment.
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.
Hi @jukkar Updated as comment, could you review again?
d46163d
to
13ac64e
Compare
Hi @krish2718 @jukkar |
subsys/net/l2/wifi/wifi_shell.c
Outdated
params.negotiation_type = (enum wifi_twt_negotiation_type)value; | ||
case 'c': | ||
if (!parse_number(sh, &value, state->optarg, NULL, | ||
WIFI_TWT_SETUP_CMD_REQUEST, WIFI_TWT_SETUP_CMD_DEMAND)) { |
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.
Minor nit, but the indentation is wrong here and also for the other added lines.
So here the code should look like
if (!parse_number(sh, &value, state->optarg, NULL,
WIFI_TWT_SETUP_CMD_REQUEST,
WIFI_TWT_SETUP_CMD_DEMAND)) {
Is it possible to adjust your editor to indent the lines automatically?
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.
Thanks, all updated as comment
subsys/net/l2/wifi/wifi_shell.c
Outdated
params.dialog_token = (uint8_t)value; | ||
case 'f': | ||
if (!parse_number(sh, &value, state->optarg, NULL, 0, | ||
(WIFI_MAX_TWT_FLOWS - 1))) { |
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.
indentation
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.
updated as comment
subsys/net/l2/wifi/wifi_shell.c
Outdated
params.setup.announce = (bool)value; | ||
case 'w': | ||
if (!parse_number(sh, &value, state->optarg, NULL, 1, | ||
WIFI_MAX_TWT_WAKE_INTERVAL_US)) { |
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.
indentation
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.
updated as comment
subsys/net/l2/wifi/wifi_shell.c
Outdated
params.setup.twt_wake_interval = (uint32_t)value; | ||
case 'i': | ||
if (!parse_number(sh, &value, state->optarg, NULL, 1, | ||
WIFI_MAX_TWT_INTERVAL_US)) { |
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.
indentation
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.
updated as comment
subsys/net/l2/wifi/wifi_shell.c
Outdated
return -EINVAL; | ||
case 'D': | ||
if (!parse_number(sh, &value, state->optarg, NULL, 0, | ||
WIFI_MAX_TWT_WAKE_AHEAD_DURATION_US)) { |
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.
indentation
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.
updated as comment
subsys/net/l2/wifi/wifi_shell.c
Outdated
|
||
case 'e': | ||
if (!parse_number(sh, &value, state->optarg, NULL, 0, | ||
WIFI_MAX_TWT_EXPONENT)) { |
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.
indentation
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.
updated as comment
Please note we have to follow the rules here for any |
77c69bf
to
6091204
Compare
Hi @krish2718 @jukkar @MaochenWang1 |
Should we add both the options? If the user gives time we derive (exponent, mantissa) and if the user gives (exponent, mantissa) we use it directly, WDYT? |
My concern is exist multiple sets of exponent and mantissa derived from a given time, and the time calculated from the derived exponent and mantissa may not equal to the given time. Customer may complain about why time set not as expectation. |
We share the (exponent, mantissa) in the frame to the AP, so, at least AP and STA will have the same time. Anyways giving both options is better we can leave it to the users to choose the appropriate one, no? |
Okay, how can we derive a set of exponent and mantissa from a given time with high accuracy, is there any algorithm for refer? |
We took the simpler approach: https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/wifi/nrf_wifi/src/wifi_mgmt.c#L250 |
Sonnet 3.5 gave this for
|
Thanks for sharing, as Nordic driver implemented the convert of (exponent, mantissa, interval) , and need interval as argv, to compatible Nordic's exist implementation, the shell should prepare all of parameters(exponent, mantissa, interval) according to the input (exponent, mantissa) or interval, right? If you agree, I will make change. |
6091204
to
ba07eb9
Compare
Hi @krish2718 @jukkar @MaochenWang1 |
9b152d2
to
117b20d
Compare
Enhance the parse parameters code for twt. Signed-off-by: Rex Chen <[email protected]>
Add btwt_setup cmd for sap. Signed-off-by: Rex Chen <[email protected]>
Add two parameters for twt setup. Signed-off-by: Rex Chen <[email protected]>
The default exponent is 0, will cause twt setup quick failed, set exponent value derived from twt interval to fix it. Signed-off-by: Rex Chen <[email protected]>
117b20d
to
be24089
Compare
Hi @krish2718 @jukkar |
A. Add two new parameters for TWT setup
B. Fix TWT quick setup: Add default exponent value
C. Add Broadcast TWT feature support for AP
D. Convert TWT command to use
getopt