eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit a50605a456f141ba077a1b8ba6ba40dba6c71a0d
parent 0b4dc9d8a50d2156be0ba2b2b151cc40b8e0a20a
Author: James Prestwood <prestwoj@gmail.com>
Date:   Thu, 15 Jun 2023 12:24:12 -0700

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.

Diffstat:
Msrc/wiphy.c | 13+++++++++++++
Msrc/wiphy.h | 1+
2 files changed, 14 insertions(+), 0 deletions(-)

diff --git 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 @@ -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);