Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src-draft/trunk]: src/sys/net80211 Simplify the other locks the same way as ...



details:   https://anonhg.NetBSD.org/src-all/rev/4b154225c306
branches:  trunk
changeset: 378045:4b154225c306
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Tue Sep 27 17:08:57 2022 +0200

description:
Simplify the other locks the same way as the IC lock.

diffstat:

 sys/net80211/ieee80211_netbsd.h |  42 +++++++++++-----------------------------
 1 files changed, 12 insertions(+), 30 deletions(-)

diffs (66 lines):

diff -r 6487a4cfd703 -r 4b154225c306 sys/net80211/ieee80211_netbsd.h
--- a/sys/net80211/ieee80211_netbsd.h   Tue Sep 27 17:03:05 2022 +0200
+++ b/sys/net80211/ieee80211_netbsd.h   Tue Sep 27 17:08:57 2022 +0200
@@ -241,16 +241,10 @@ typedef kmutex_t ieee80211_com_lock_t;
  * This is a (mostly) temporary lock designed to serialise all of the
  * transmission operations throughout the stack.
  */
-typedef struct {
-       char            name[16];               /* e.g. "ath0_tx_lock" */
-       kmutex_t        mtx;
-} ieee80211_tx_lock_t;
-#define        IEEE80211_TX_LOCK_INIT(_ic, _name) do {                         \
-       ieee80211_tx_lock_t *cl = &(_ic)->ic_txlock;                    \
-       snprintf(cl->name, sizeof(cl->name), "%s_tx_lock", _name);      \
-       mutex_init(&cl->mtx, MUTEX_DEFAULT, IPL_SOFTNET);               \
-} while (0)
-#define        IEEE80211_TX_LOCK_OBJ(_ic)      (&(_ic)->ic_txlock.mtx)
+typedef kmutex_t ieee80211_tx_lock_t;
+#define        IEEE80211_TX_LOCK_INIT(_ic, _name)                              \
+       mutex_init(&(_ic)->ic_txlock, MUTEX_DEFAULT, IPL_SOFTNET)
+#define        IEEE80211_TX_LOCK_OBJ(_ic)      (&(_ic)->ic_txlock)
 #define        IEEE80211_TX_LOCK_DESTROY(_ic) mutex_destroy(IEEE80211_TX_LOCK_OBJ(_ic))
 #define        IEEE80211_TX_LOCK(_ic)     mutex_enter(IEEE80211_TX_LOCK_OBJ(_ic))
 #define        IEEE80211_TX_UNLOCK(_ic)           mutex_exit(IEEE80211_TX_LOCK_OBJ(_ic))
@@ -262,16 +256,10 @@ typedef struct {
 /*
  * Stageq / ni_tx_superg lock
  */
-typedef struct {
-       char            name[16];               /* e.g. "ath0_ff_lock" */
-       kmutex_t        mtx;
-} ieee80211_ff_lock_t;
-#define IEEE80211_FF_LOCK_INIT(_ic, _name) do {                                \
-       ieee80211_ff_lock_t *fl = &(_ic)->ic_fflock;                    \
-       snprintf(fl->name, sizeof(fl->name), "%s_ff_lock", _name);      \
-       mutex_init(&fl->mtx, MUTEX_DEFAULT, IPL_SOFTNET);               \
-} while (0)
-#define IEEE80211_FF_LOCK_OBJ(_ic)     (&(_ic)->ic_fflock.mtx)
+typedef kmutex_t ieee80211_ff_lock_t;
+#define IEEE80211_FF_LOCK_INIT(_ic, _name)                             \
+       mutex_init(&(_ic)->ic_fflock)
+#define IEEE80211_FF_LOCK_OBJ(_ic)     (&(_ic)->ic_fflock)
 #define IEEE80211_FF_LOCK_DESTROY(_ic) mutex_destroy(IEEE80211_FF_LOCK_OBJ(_ic))
 #define IEEE80211_FF_LOCK(_ic)         mutex_enter(IEEE80211_FF_LOCK_OBJ(_ic))
 #define IEEE80211_FF_UNLOCK(_ic)       mutex_exit(IEEE80211_FF_LOCK_OBJ(_ic))
@@ -281,16 +269,10 @@ typedef struct {
 /*
  * Node locking definitions.
  */
-typedef struct {
-       char            name[16];               /* e.g. "ath0_node_lock" */
-       kmutex_t        mtx;
-} ieee80211_node_lock_t;
-#define        IEEE80211_NODE_LOCK_INIT(_nt, _name) do {                       \
-       ieee80211_node_lock_t *nl = &(_nt)->nt_nodelock;                \
-       snprintf(nl->name, sizeof(nl->name), "%s_node_lock", _name);    \
-       mutex_init(&nl->mtx, MUTEX_DEFAULT, IPL_SOFTNET);               \
-} while (0)
-#define        IEEE80211_NODE_LOCK_OBJ(_nt)    (&(_nt)->nt_nodelock.mtx)
+typedef kmutex_t ieee80211_node_lock_t;
+#define        IEEE80211_NODE_LOCK_INIT(_nt, _name)                            \
+       mutex_init(&(_nt)->nt_nodelock, MUTEX_DEFAULT, IPL_SOFTNET)
+#define        IEEE80211_NODE_LOCK_OBJ(_nt)    (&(_nt)->nt_nodelock)
 #define        IEEE80211_NODE_LOCK_DESTROY(_nt) \
        mutex_destroy(IEEE80211_NODE_LOCK_OBJ(_nt))
 #define        IEEE80211_NODE_LOCK(_nt) \



Home | Main Index | Thread Index | Old Index