* [PATCH] mac80211: fix ieee80211_set_antenna() return value
@ 2026-10-16 12:20 Christoph Rudorff
0 siblings, 0 replies; only message in thread
From: Christoph Rudorff @ 2026-10-16 12:20 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, linux-kernel, Christoph Rudorff
To set up antenna the device must be disabled, "not started".
So return -EBUSY instead of -EOPNOTSUPP
$ iw phy0 set antenna 0x3
command failed: Operation not supported (-95)
expected output:
command failed: Device or resource busy (-16)
Signed-off-by: Christoph Rudorff <chris@rudorff.com>
---
I was confused that none of my wifi devices can set_antenna.
Code review, turns out, the device must be disabled "not started".
So correct the return value and later drv_set_antenna()
handles the "not supported" case.
This is a good candidate for backport.
---
net/mac80211/cfg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index a1753335eb9d..87a9ead7c638 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -4920,7 +4920,7 @@ static int ieee80211_set_antenna(struct wiphy *wiphy, int radio_idx,
int ret;
if (local->started)
- return -EOPNOTSUPP;
+ return -EBUSY;
ret = drv_set_antenna(local, tx_ant, rx_ant);
if (ret)
---
base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
change-id: 20261016-fix-set-antenna-50205dc86cb6
Best regards,
--
Christoph Rudorff <chris@rudorff.com>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-16 12:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-16 12:20 [PATCH] mac80211: fix ieee80211_set_antenna() return value Christoph Rudorff
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®