git: 4eaf978df5e1 - stable/14 - net80211: add IEEE80211_IS_LOCKED()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 10 Feb 2025 14:52:46 UTC
The branch stable/14 has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=4eaf978df5e11c70c6319467fedadc7a2b27e76c
commit 4eaf978df5e11c70c6319467fedadc7a2b27e76c
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-01-15 22:50:01 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-02-10 14:52:09 +0000
net80211: add IEEE80211_IS_LOCKED()
When trying to sort out a teardown locking problem (downcall in the
driver can sleep) I found that the fan-out tree was getting too big
to fix net80211 locking per-se for this while working on entirely
different problems.
Add IEEE80211_IS_LOCKED() so the driver can check and un-/re-lock as
necessary (as we do in other cases already) to avoid panics on
debug kernels left and right.
Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D48475
(cherry picked from commit 054c5ddf587a7a0c430cf64dbf100b718eafdcc5)
---
sys/net80211/ieee80211_freebsd.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sys/net80211/ieee80211_freebsd.h b/sys/net80211/ieee80211_freebsd.h
index ec017bb21ec4..e21364884e15 100644
--- a/sys/net80211/ieee80211_freebsd.h
+++ b/sys/net80211/ieee80211_freebsd.h
@@ -73,6 +73,8 @@ typedef struct {
mtx_assert(IEEE80211_LOCK_OBJ(_ic), MA_OWNED)
#define IEEE80211_UNLOCK_ASSERT(_ic) \
mtx_assert(IEEE80211_LOCK_OBJ(_ic), MA_NOTOWNED)
+#define IEEE80211_IS_LOCKED(_ic) \
+ mtx_owned(IEEE80211_LOCK_OBJ(_ic))
/*
* Transmit lock.