git: 745bba174efe - stable/13 - LinuxKPI: 802.11: fix re-creation of VAP

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

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

commit 745bba174efe9f6bb4efbeb9643046acd0f6f732
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-10-03 21:14:55 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-11-29 16:36:10 +0000

    LinuxKPI: 802.11: fix re-creation of VAP
    
    After dbf7691999abe (as indicated in that commit message) EEXISTS
    errors may be seen.  From current investigation that is due to the
    single-VAP support in LinuxKPI 802.11 and the related calls to
    mo_start() and mo_stop() and them being disabled in ic_parent()
    currently.  Calling mo_stop() in lkpi_ic_vap_delete() seems to
    fix the problem and new VAPs (wlan interfaces) can be created again
    after being destroyed.
    
    Fixes:          dbf7691999abe ("improve lkpi_ic_vap_delete()")
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 6c38c6b1b917957d420902213f318bf0153214f2)
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 85965493e5ef..0a673a313c1e 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -2481,6 +2481,9 @@ lkpi_ic_vap_delete(struct ieee80211vap *vap)
 
 	lkpi_80211_mo_remove_interface(hw, vif);
 
+	/* Single VAP, so we can do this here. */
+	lkpi_80211_mo_stop(hw);
+
 	mtx_destroy(&lvif->mtx);
 	free(lvif, M_80211_VAP);
 }