git: f55063e268af - stable/13 - LinuxKPI: 802.11: change ic_parent() to not call mo_stop()/mo_start()

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Wed, 29 Nov 2023 16:38:26 UTC
The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=f55063e268afa7f4e098d52afa7dc898b28899dd

commit f55063e268afa7f4e098d52afa7dc898b28899dd
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-09-21 12:25:20 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-11-29 16:36:08 +0000

    LinuxKPI: 802.11: change ic_parent() to not call mo_stop()/mo_start()
    
    Driven by net80211 we may call mac80211 ops stop() and start() mostly
    when toggling a first VAP.  While this is FreeBSD behaviour the firmware
    based LinuxKPI drivers seem to possibly clear state in the case of stop()
    triggering further errors down the line.
    We call mo_start() when starting the VAP and mo_stop() when destroying
    it now only.  In the future (e.g., in multi-VAP setups) we may need to
    re-address some of this so keep the code under #ifdef.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 8d58a0578635dc7dd1025ab08b0479f2b383e1a4)
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index bfc3e79929d7..fa22a0fce826 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -2460,24 +2460,32 @@ static void
 lkpi_ic_parent(struct ieee80211com *ic)
 {
 	struct lkpi_hw *lhw;
+#ifdef HW_START_STOP
 	struct ieee80211_hw *hw;
 	int error;
+#endif
 	bool start_all;
 
 	IMPROVE();
 
 	lhw = ic->ic_softc;
+#ifdef HW_START_STOP
 	hw = LHW_TO_HW(lhw);
+#endif
 	start_all = false;
 
 	/* IEEE80211_UNLOCK(ic); */
 	LKPI_80211_LHW_LOCK(lhw);
 	if (ic->ic_nrunning > 0) {
+#ifdef HW_START_STOP
 		error = lkpi_80211_mo_start(hw);
 		if (error == 0)
+#endif
 			start_all = true;
 	} else {
+#ifdef HW_START_STOP
 		lkpi_80211_mo_stop(hw);
+#endif
 	}
 	LKPI_80211_LHW_UNLOCK(lhw);
 	/* IEEE80211_LOCK(ic); */