From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 4/7] wiphy: add [DriverFlags].PowerSaveDisable flag
Date: Thu, 15 Jun 2023 12:24:12 -0700 [thread overview]
Message-ID: <20230615192415.1718516-4-prestwoj@gmail.com> (raw)
In-Reply-To: <20230615192415.1718516-1-prestwoj@gmail.com>
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.
---
src/wiphy.c | 13 +++++++++++++
src/wiphy.h | 1 +
2 files changed, 14 insertions(+)
diff --git a/src/wiphy.c b/src/wiphy.c
index 6f8f6826..2c09d47a 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_disable_power_save(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..39837366 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_disable_power_save(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);
--
2.25.1
next prev parent reply other threads:[~2023-06-15 19:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-15 19:24 [PATCH 1/7] wiphy: store driver flags directly in wiphy object James Prestwood
2023-06-15 19:24 ` [PATCH 2/7] wiphy: allow for user-defined driver flags James Prestwood
2023-06-18 19:03 ` Denis Kenzior
2023-06-15 19:24 ` [PATCH 3/7] doc: document [DriverFlags] group settings James Prestwood
2023-06-15 19:24 ` James Prestwood [this message]
2023-06-18 19:07 ` [PATCH 4/7] wiphy: add [DriverFlags].PowerSaveDisable flag Denis Kenzior
2023-06-19 14:49 ` James Prestwood
2023-06-15 19:24 ` [PATCH 5/7] netdev: disable power save if required James Prestwood
2023-06-18 19:11 ` Denis Kenzior
2023-06-19 14:54 ` James Prestwood
2023-06-15 19:24 ` [PATCH 6/7] wiphy: print driver flags on startup James Prestwood
2023-06-15 19:24 ` [PATCH 7/7] doc: Document [DriverFlags].PowerSaveDisable James Prestwood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230615192415.1718516-4-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox