diff mbox series

ath9k: keep ANI in monitor mode

Message ID 20250514180413.373876-2-elfy@ecognize.me
State New
Headers show
Series ath9k: keep ANI in monitor mode | expand

Commit Message

Oleksiy Protas May 14, 2025, 6:04 p.m. UTC
Earlier changes that made is_monitoring a separate flag as opposed to setting the opmode caused AMI to never start when monitoring
---
 drivers/net/wireless/ath/ath9k/link.c | 2 +-
 drivers/net/wireless/ath/ath9k/main.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath9k/link.c b/drivers/net/wireless/ath/ath9k/link.c
index 9d84003db800..cd2ead7b2883 100644
--- a/drivers/net/wireless/ath/ath9k/link.c
+++ b/drivers/net/wireless/ath/ath9k/link.c
@@ -468,7 +468,7 @@  void ath_check_ani(struct ath_softc *sc)
 			if (!test_bit(ATH_OP_PRIM_STA_VIF, &common->op_flags))
 				goto stop_ani;
 		}
-	} else if (ah->opmode == NL80211_IFTYPE_STATION) {
+	} else if (ah->opmode == NL80211_IFTYPE_STATION && !ah->is_monitoring) {
 		if (!test_bit(ATH_OP_PRIM_STA_VIF, &common->op_flags))
 			goto stop_ani;
 	}
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index aa271b82875e..2685aeecffad 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1530,6 +1530,7 @@  static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
 		if (conf->flags & IEEE80211_CONF_MONITOR) {
 			ath_dbg(common, CONFIG, "Monitor mode is enabled\n");
 			sc->sc_ah->is_monitoring = true;
+			ath_check_ani(sc);
 		} else {
 			ath_dbg(common, CONFIG, "Monitor mode is disabled\n");
 			sc->sc_ah->is_monitoring = false;