3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 06:29:23 +01:00

wiphy: add [DriverQuirks].PowerSaveDisable flag

Certain drivers do not handle power save very well resulting in
missed frames, firmware crashes, or other bad behavior. Its easy
enough to disable power save via iw, iwconfig, etc but since IWD
removes and creates the interface on startup it blows away any
previous power save setting. The setting must be done *after* IWD
creates the interface which can be done, but needs to be via some
external daemon monitoring IWD's state. For minimal systems,
e.g. without NetworkManager, it becomes difficult and annoying to
persistently disable power save.

For this reason a new driver flag POWER_SAVE_DISABLE is being
added. This can then be referenced when creating the interfaces
and if set, disable power save.
This commit is contained in:
James Prestwood 2023-06-15 12:24:12 -07:00 committed by Denis Kenzior
parent 0b4dc9d8a5
commit a50605a456
2 changed files with 14 additions and 0 deletions

View File

@ -71,6 +71,7 @@ static unsigned int wiphy_dump_id;
enum driver_flag {
DEFAULT_IF = 0x1,
FORCE_PAE = 0x2,
POWER_SAVE_DISABLE = 0x4,
};
struct driver_flag_name {
@ -101,6 +102,7 @@ static const struct driver_info driver_infos[] = {
static const struct driver_flag_name driver_flag_names[] = {
{ "DefaultInterface", DEFAULT_IF },
{ "ForcePae", FORCE_PAE },
{ "PowerSaveDisable", POWER_SAVE_DISABLE },
};
struct wiphy {
@ -723,6 +725,17 @@ bool wiphy_control_port_enabled(struct wiphy *wiphy)
return enabled;
}
bool wiphy_power_save_disabled(struct wiphy *wiphy)
{
if (wiphy->driver_flags & POWER_SAVE_DISABLE) {
l_info("Disabling power save due to driver quirks: %s",
wiphy_get_driver(wiphy));
return true;
}
return false;
}
const uint8_t *wiphy_get_permanent_address(struct wiphy *wiphy)
{
return wiphy->permanent_addr;

View File

@ -135,6 +135,7 @@ const char *wiphy_get_driver(struct wiphy *wiphy);
const char *wiphy_get_name(struct wiphy *wiphy);
bool wiphy_uses_default_if(struct wiphy *wiphy);
bool wiphy_control_port_enabled(struct wiphy *wiphy);
bool wiphy_power_save_disabled(struct wiphy *wiphy);
const uint8_t *wiphy_get_permanent_address(struct wiphy *wiphy);
const uint8_t *wiphy_get_extended_capabilities(struct wiphy *wiphy,
uint32_t iftype);