git: a5c1eed2a2a0 - releng/14.0 - LinuxKPI: 802.11: change ic_parent() to not call mo_stop()/mo_start()

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Mon, 09 Oct 2023 23:16:25 UTC
The branch releng/14.0 has been updated by bz:

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

commit a5c1eed2a2a092824ce33c8308f1805d9c40ebb9
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-09 23:14:54 +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
    Approved by:    re (gjb)
    
    (cherry picked from commit 8d58a0578635dc7dd1025ab08b0479f2b383e1a4)
    (cherry picked from commit 753730087671551425554a28d64c898997f9bbdd)
---
 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 e89979521296..8df51f2630ff 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -2486,24 +2486,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); */