diff --git a/src/wiphy.c b/src/wiphy.c index 68dfc448..9f4c0030 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -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; diff --git a/src/wiphy.h b/src/wiphy.h index f4f205ad..9f24d171 100644 --- a/src/wiphy.h +++ b/src/wiphy.h @@ -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);