-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
drivers: wifi: siwx91x: Add AP configuration enhancements and hidden SSID support #87570
base: main
Are you sure you want to change the base?
drivers: wifi: siwx91x: Add AP configuration enhancements and hidden SSID support #87570
Conversation
b8fcd2e
to
caac617
Compare
caac617
to
b274b59
Compare
b274b59
to
c3646d9
Compare
7963dd4
to
9b0fa49
Compare
Rebased to resolve the conflicts |
b2a1d9c
to
a7f14ec
Compare
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.
Just a couple of questions. Otherwise, it looks fine.
drivers/wifi/siwx91x/siwx91x_wifi.c
Outdated
return -ENOTSUP; | ||
} | ||
|
||
/*FIXME siwx91x_ap_cfg.channel.channel = SL_WIFI_BAND_2_4GHZ */ |
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.
I don't understand this FIXME
. SL_WIFI_BAND_2_4GHZ
does not make sense for siwx91x_ap_cfg.channel.channel
. Do you mean siwx91x_ap_cfg.channel.band
?
drivers/wifi/siwx91x/siwx91x_wifi.c
Outdated
} | ||
|
||
if (sidev->state == WIFI_STATE_COMPLETED) { | ||
return 0; |
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.
Do you know what the API expect if ap_enable()
is called twice with different parameters?
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.
Removed this change for now. We'll raise a separate PR to handle ap_enable
with different parameters
drivers/wifi/siwx91x/siwx91x_wifi.c
Outdated
|
||
siwx91x_ap_cfg.channel.bandwidth = SL_WIFI_BANDWIDTH_20MHz; | ||
|
||
if ((params->ssid_length == 0) || (params->ssid_length > WIFI_SSID_MAX_LEN)) { |
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.
Parentheses are useless in this expression.
drivers/wifi/siwx91x/siwx91x_wifi.c
Outdated
int ret; | ||
|
||
if (sidev->state == WIFI_STATE_COMPLETED) { | ||
return 0; |
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.
Do you know what the API expect if connect()
is called twice with different parameters?
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.
Removed this change for now. We'll raise a separate PR to handle connect()
with different parameters
uint8_t oper_mode; | ||
bool hidden_ssid; | ||
uint8_t max_num_sta; | ||
} siwx91x_boot_config_feature_t; |
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.
Unless you plan to add more parameters, I am not sure we need to introduce this struct. You can pass the 3 parameters to siwx91x_nwp_mode_switch()
.
a7f14ec
to
9397c68
Compare
drivers/wifi/siwx91x/siwx91x_wifi.c
Outdated
return -ENOTSUP; | ||
} | ||
|
||
siwx91x_ap_cfg.channel.bandwidth = SL_WIFI_BANDWIDTH_20MHz; |
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.
Why this field is not set during the structure initialisation as the other ones?
drivers/wifi/siwx91x/siwx91x_wifi.c
Outdated
@@ -303,7 +314,8 @@ static int siwx91x_connect(const struct device *dev, struct wifi_connect_req_par | |||
wifi_config.ssid.length = params->ssid_length, | |||
memcpy(wifi_config.ssid.value, params->ssid, params->ssid_length); | |||
|
|||
ret = sl_wifi_connect(SL_WIFI_CLIENT_INTERFACE, &wifi_config, 0); | |||
interface = sl_wifi_get_default_interface(); |
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.
Sometime interface is initialized declaration, sometime later in the code. Is it possible to uniformize that?
return -EINVAL; | ||
status = siwx91x_get_nwp_config(oper_mode, hidden_ssid, max_num_sta, &nwp_config); | ||
if (status < 0) { | ||
return status; |
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.
Can you create a specific commit for the change SL_SI91X_CLIENT_MODE/SL_SI91X_ACCESS_POINT_MODE
-> WIFI_STA_MODE/WIFI_AP_MODE
.
if (max_num_sta > AP_MAX_NUM_STA) { | ||
LOG_ERR("Exceeded maximum supported stations (%d)", AP_MAX_NUM_STA); | ||
return -EINVAL; | ||
} |
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.
Group the short paths at the start of the function:
if (wifi_oper_mode == WIFI_AP_MODE && max_num_sta > AP_MAX_NUM_STA)
return -EINVAL;
LOG_MODULE_REGISTER(siwx91x_nwp); | ||
|
||
int siwg91x_get_nwp_config(int wifi_oper_mode, sl_wifi_device_configuration_t *get_config) | ||
int siwx91x_get_nwp_config(uint8_t wifi_oper_mode, bool hidden_ssid, uint8_t max_num_sta, | ||
sl_wifi_device_configuration_t *get_config) |
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.
Usually, the returned arguments are placed first in the list of arguments. Rationale, it mimics the usual code:
memcpy(destination, source, ..);
destination = source;
} | ||
|
||
break; | ||
} |
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.
What is the purpose of a such design? why do you want to introduce a level of indirection rather than declaring two functions?
9397c68
to
fad3728
Compare
This patch introduces validation checks to ensure Wi-Fi commands are executed only when the device is in a valid operational mode. - Restricts command execution if the device is not in an appropriate mode - Prevents reconfiguring the device when it is already in an active state Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Replaced SL_SI91X_CLIENT_MODE and SL_SI91X_ACCESS_POINT_MODE with WIFI_STA_MODE and WIFI_AP_MODE, respectively, for AP configuration command intergration. Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
This patch adds support for configuring AP. It enables setting key parameters before AP mode is enabled. - Adds support for configuring client maximum inactivity timeout. - Adds support for bandwidth, It supports 20MHZ only. - Adds support for setting the maximum number of clients and hidden SSID mode by rebooting the NWP device. Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
fad3728
to
15f9f36
Compare
Rebased to resolve conflicts |
This PR introduces enhancements to the siwx91x Wi-Fi driver, including support for configuring AP settings, hidden SSID functionality, and validation checks for interface state.