From: Johannes Berg <johannes@sipsolutions.net>
To: linux-wireless@vger.kernel.org
Cc: Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH wireless-next] wifi: mac80211: remove ieee80211_sta_ps_transition() return value
Date: Sun, 2 Aug 2026 23:18:20 +0200 [thread overview]
Message-ID: <20260802211819.1738465-2-johannes@sipsolutions.net> (raw)
From: Johannes Berg <johannes.berg@intel.com>
Nothing cares, so no point calculating it. Also simplify
the "no need to do anything" check and fix some docs that
should refer to this function instead.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
include/net/mac80211.h | 18 +++++-------------
net/mac80211/rx.c | 8 +++-----
2 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 9d1fac6e8082..638b8aa5214d 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2919,8 +2919,8 @@ struct ieee80211_txq {
* autonomously manages the PS status of connected stations. When
* this flag is set mac80211 will not trigger PS mode for connected
* stations based on the PM bit of incoming frames.
- * Use ieee80211_start_ps()/ieee8021_end_ps() to manually configure
- * the PS mode of connected stations.
+ * Use ieee80211_sta_ps_transition() to manually toggle the PS mode
+ * of connected stations.
*
* @IEEE80211_HW_TX_AMPDU_SETUP_IN_HW: The device handles TX A-MPDU session
* setup strictly in HW. mac80211 should not attempt to do this in
@@ -5499,10 +5499,8 @@ static inline void ieee80211_rx_ni(struct ieee80211_hw *hw,
*
* @sta: currently connected sta
* @start: start or stop PS
- *
- * Return: 0 on success. -EINVAL when the requested PS mode is already set.
*/
-int ieee80211_sta_ps_transition(struct ieee80211_sta *sta, bool start);
+void ieee80211_sta_ps_transition(struct ieee80211_sta *sta, bool start);
/**
* ieee80211_sta_ps_transition_ni - PS transition for connected sta
@@ -5514,19 +5512,13 @@ int ieee80211_sta_ps_transition(struct ieee80211_sta *sta, bool start);
*
* @sta: currently connected sta
* @start: start or stop PS
- *
- * Return: Like ieee80211_sta_ps_transition().
*/
-static inline int ieee80211_sta_ps_transition_ni(struct ieee80211_sta *sta,
+static inline void ieee80211_sta_ps_transition_ni(struct ieee80211_sta *sta,
bool start)
{
- int ret;
-
local_bh_disable();
- ret = ieee80211_sta_ps_transition(sta, start);
+ ieee80211_sta_ps_transition(sta, start);
local_bh_enable();
-
- return ret;
}
/**
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 5e26be8e27d8..40ed03a775ba 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1744,7 +1744,7 @@ static void sta_ps_end(struct sta_info *sta)
ieee80211_sta_ps_deliver_wakeup(sta);
}
-int ieee80211_sta_ps_transition(struct ieee80211_sta *pubsta, bool start)
+void ieee80211_sta_ps_transition(struct ieee80211_sta *pubsta, bool start)
{
struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
bool in_ps;
@@ -1753,15 +1753,13 @@ int ieee80211_sta_ps_transition(struct ieee80211_sta *pubsta, bool start)
/* Don't let the same PS state be set twice */
in_ps = test_sta_flag(sta, WLAN_STA_PS_STA);
- if ((start && in_ps) || (!start && !in_ps))
- return -EINVAL;
+ if (start == in_ps)
+ return;
if (start)
sta_ps_start(sta);
else
sta_ps_end(sta);
-
- return 0;
}
EXPORT_SYMBOL(ieee80211_sta_ps_transition);
--
2.55.0
reply other threads:[~2026-08-02 21:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260802211819.1738465-2-johannes@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=johannes.berg@intel.com \
--cc=linux-wireless@vger.kernel.org \
/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