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

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Fri, 06 Oct 2023 14:25:10 UTC
The branch stable/14 has been updated by bz:

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

commit 753730087671551425554a28d64c898997f9bbdd
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-09-21 12:25:20 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-10-06 12:47:40 +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 ac43b1248536..04ee75eb2c68 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -2468,24 +2468,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); */