drivers: wifi: siwx91x: Handle error case in power save mode
Power save is not supported in AP mode. This commit ensures that `-EINVAL` is returned instead of success, preventing incorrect behavior. Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
This commit is contained in:
parent
112c8e6939
commit
de6395d5d0
1 changed files with 4 additions and 2 deletions
|
@ -282,11 +282,13 @@ static int siwx91x_apply_power_save(struct siwx91x_dev *sidev)
|
||||||
|
|
||||||
interface = sl_wifi_get_default_interface();
|
interface = sl_wifi_get_default_interface();
|
||||||
if (FIELD_GET(SIWX91X_INTERFACE_MASK, interface) != SL_WIFI_CLIENT_INTERFACE) {
|
if (FIELD_GET(SIWX91X_INTERFACE_MASK, interface) != SL_WIFI_CLIENT_INTERFACE) {
|
||||||
return 0;
|
LOG_ERR("Wi-Fi not in station mode");
|
||||||
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sidev->state == WIFI_STATE_INTERFACE_DISABLED) {
|
if (sidev->state == WIFI_STATE_INTERFACE_DISABLED) {
|
||||||
return 0;
|
LOG_ERR("Command given in invalid state");
|
||||||
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
sl_wifi_get_performance_profile(&sl_ps_profile);
|
sl_wifi_get_performance_profile(&sl_ps_profile);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue