Skip to content
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

hostap: fix VHT channel center segment0 #82113

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/zephyr/net/wifi_mgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,8 @@ struct wifi_connect_req_params {
const uint8_t *identities[WIFI_ENT_IDENTITY_MAX_USERS];
/** User Passwords */
const uint8_t *passwords[WIFI_ENT_IDENTITY_MAX_USERS];
/** Parameter used for frequency band */
enum wifi_frequency_bandwidths bandwidth;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this commit should be the first one as VHT seg0 frequency relies on the this param

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

};

/** @brief Wi-Fi connect result codes. To be overlaid on top of \ref wifi_status
Expand Down
17 changes: 16 additions & 1 deletion subsys/net/l2/wifi/wifi_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv
{"channel", required_argument, 0, 'c'},
{"timeout", required_argument, 0, 't'},
{"anon-id", required_argument, 0, 'a'},
{"bandwidth", required_argument, 0, 'B'},
{"key1-pwd", required_argument, 0, 'K'},
{"key2-pwd", required_argument, 0, 'K'},
{"suiteb-type", required_argument, 0, 'S'},
Expand Down Expand Up @@ -620,8 +621,9 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv
params->security = WIFI_SECURITY_TYPE_NONE;
params->mfp = WIFI_MFP_OPTIONAL;
params->eap_ver = 1;
params->bandwidth = WIFI_FREQ_BANDWIDTH_20MHZ;

while ((opt = getopt_long(argc, argv, "s:p:k:e:w:b:c:m:t:a:K:S:V:I:P:Rh",
while ((opt = getopt_long(argc, argv, "s:p:k:e:w:b:c:m:t:a:B:K:S:V:I:P:Rh",
long_options, &opt_index)) != -1) {
state = getopt_state_get();
switch (opt) {
Expand Down Expand Up @@ -734,6 +736,18 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv
return -EINVAL;
}
break;
case 'B':
switch (atoi(state->optarg)) {
case 1:
case 2:
case 3:
params->bandwidth = atoi(state->optarg);
break;
default:
PR_ERROR("Invalid bandwidth: %d\n", atoi(state->optarg));
return -EINVAL;
}
break;
case 'K':
if (key_passwd_cnt >= 2) {
PR_WARNING("too many key_passwd (max 2 key_passwd)\n");
Expand Down Expand Up @@ -3138,6 +3152,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
"0:Disable, 1:Optional, 2:Required\n"
"-b --band=<band> (2 -2.6GHz, 5 - 5Ghz, 6 - 6GHz)\n"
"-m --bssid=<BSSID>\n"
"[-B, --bandwidth=<bandwidth>]: 1:20MHz, 2:40MHz, 3:80MHz\n"
"[-K, --key1-pwd for eap phase1 or --key2-pwd for eap phase2]:\n"
"Private key passwd for enterprise mode. Default no password for private key.\n"
"[-S, --suiteb-type]: 1:suiteb, 2:suiteb-192. Default 0: not suiteb mode.\n"
Expand Down