Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src-draft/trunk]: src/sys/net80211 Initialize ht and asssociated functions.
details: https://anonhg.NetBSD.org/src-all/rev/26f3b39d9da3
branches: trunk
changeset: 378073:26f3b39d9da3
user: Nathanial Sloss <nat%netbsd.org@localhost>
date: Sun Jul 09 23:30:47 2023 +1000
description:
Initialize ht and asssociated functions.
The init function declarations have been changed to accomodate RUN_ONCE.
Ok martin@.
diffstat:
sys/net80211/ieee80211_ht.c | 20 +++++++++++++++++++-
sys/net80211/ieee80211_hwmp.c | 16 +++++++++++++++-
sys/net80211/ieee80211_mesh.c | 17 ++++++++++++++++-
sys/net80211/ieee80211_vht.c | 19 ++++++++++++++++++-
4 files changed, 68 insertions(+), 4 deletions(-)
diffs (197 lines):
diff -r f535210ddfaf -r 26f3b39d9da3 sys/net80211/ieee80211_ht.c
--- a/sys/net80211/ieee80211_ht.c Thu Jun 29 03:18:03 2023 +1000
+++ b/sys/net80211/ieee80211_ht.c Sun Jul 09 23:30:47 2023 +1000
@@ -49,6 +49,10 @@
#include <sys/systm.h>
#include <sys/endian.h>
+#ifdef __NetBSD__
+#include <sys/once.h>
+#endif
+
#include <sys/socket.h>
#include <net/if.h>
@@ -189,7 +193,11 @@ static ieee80211_send_action_func ht_sen
static ieee80211_send_action_func ht_send_action_ba_delba;
static ieee80211_send_action_func ht_send_action_ht_txchwidth;
-static __unused void
+#ifdef __NetBSD__
+static int
+#else
+static void
+#endif
ieee80211_ht_init(void)
{
/*
@@ -221,6 +229,10 @@ ieee80211_ht_init(void)
IEEE80211_ACTION_BA_DELBA, ht_send_action_ba_delba);
ieee80211_send_action_register(IEEE80211_ACTION_CAT_HT,
IEEE80211_ACTION_HT_TXCHWIDTH, ht_send_action_ht_txchwidth);
+
+#ifdef __NetBSD__
+ return 0;
+#endif
}
SYSINIT(wlan_ht, SI_SUB_DRIVERS, SI_ORDER_FIRST, ieee80211_ht_init, NULL);
@@ -262,6 +274,12 @@ ieee80211_ht_attach(struct ieee80211com
ic->ic_htprotmode = IEEE80211_PROT_RTSCTS;
ic->ic_curhtprotmode = IEEE80211_HTINFO_OPMODE_PURE;
+
+#ifdef __NetBSD__
+ static ONCE_DECL(ht_init_once);
+
+ RUN_ONCE(&ht_init_once, ieee80211_ht_init);
+#endif
}
void
diff -r f535210ddfaf -r 26f3b39d9da3 sys/net80211/ieee80211_hwmp.c
--- a/sys/net80211/ieee80211_hwmp.c Thu Jun 29 03:18:03 2023 +1000
+++ b/sys/net80211/ieee80211_hwmp.c Sun Jul 09 23:30:47 2023 +1000
@@ -57,6 +57,9 @@
#include <sys/sockio.h>
#include <sys/endian.h>
#include <sys/errno.h>
+#ifdef __NetBSD__
+#include <sys/once.h>
+#endif
#include <sys/proc.h>
#include <sys/sysctl.h>
@@ -230,7 +233,11 @@ SYSCTL_PROC(_net_wlan_hwmp, OID_AUTO, in
"mesh route inactivity timeout (ms)");
-static __unused void
+#ifdef __NetBSD__
+static int
+#else
+static void
+#endif
ieee80211_hwmp_init(void)
{
/* Default values as per amendment */
@@ -266,6 +273,10 @@ ieee80211_hwmp_init(void)
* Register HWMP.
*/
ieee80211_mesh_register_proto_path(&mesh_proto_hwmp);
+
+#ifdef __NetBSD__
+ return 0;
+#endif
}
SYSINIT(wlan_hwmp, SI_SUB_DRIVERS, SI_ORDER_SECOND, ieee80211_hwmp_init, NULL);
@@ -287,7 +298,10 @@ hwmp_vattach(struct ieee80211vap *vap)
#if __FreeBSD__
callout_init(&hs->hs_roottimer, 1);
#elif __NetBSD__
+ static ONCE_DECL(hwmp_init_once);
+
callout_init(&hs->hs_roottimer, CALLOUT_MPSAFE);
+ RUN_ONCE(&hwmp_init_once, ieee80211_hwmp_init);
#endif
vap->iv_hwmp = hs;
}
diff -r f535210ddfaf -r 26f3b39d9da3 sys/net80211/ieee80211_mesh.c
--- a/sys/net80211/ieee80211_mesh.c Thu Jun 29 03:18:03 2023 +1000
+++ b/sys/net80211/ieee80211_mesh.c Sun Jul 09 23:30:47 2023 +1000
@@ -57,6 +57,9 @@
#include <sys/sockio.h>
#include <sys/endian.h>
#include <sys/errno.h>
+#ifdef __NetBSD__
+#include <sys/once.h>
+#endif
#include <sys/proc.h>
#include <sys/sysctl.h>
@@ -572,7 +575,11 @@ mesh_gatemode_cb(void *arg)
mesh_gatemode_setup(vap);
}
-static __unused void
+#ifdef __NetBSD__
+static int
+#else
+static void
+#endif
ieee80211_mesh_init(void)
{
@@ -626,6 +633,9 @@ ieee80211_mesh_init(void)
*/
ieee80211_mesh_register_proto_metric(&mesh_metric_airtime);
+#ifdef __NetBSD__
+ return 0;
+#endif
}
SYSINIT(wlan_mesh, SI_SUB_DRIVERS, SI_ORDER_FIRST, ieee80211_mesh_init, NULL);
@@ -633,6 +643,11 @@ void
ieee80211_mesh_attach(struct ieee80211com *ic)
{
ic->ic_vattach[IEEE80211_M_MBSS] = mesh_vattach;
+#ifdef __NetBSD__
+ static ONCE_DECL(mesh_init_once);
+
+ RUN_ONCE(&mesh_init_once, ieee80211_mesh_init);
+#endif
}
void
diff -r f535210ddfaf -r 26f3b39d9da3 sys/net80211/ieee80211_vht.c
--- a/sys/net80211/ieee80211_vht.c Thu Jun 29 03:18:03 2023 +1000
+++ b/sys/net80211/ieee80211_vht.c Sun Jul 09 23:30:47 2023 +1000
@@ -46,6 +46,10 @@
#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/endian.h>
+
+#ifdef __NetBSD__
+#include <sys/once.h>
+#endif
#include <sys/socket.h>
@@ -127,7 +131,11 @@ vht_send_action_placeholder(struct ieee8
return (EINVAL);
}
-static __unused void
+#ifdef __NetBSD__
+static int
+#else
+static void
+#endif
ieee80211_vht_init(void)
{
@@ -144,6 +152,10 @@ ieee80211_vht_init(void)
WLAN_ACTION_VHT_GROUPID_MGMT, vht_send_action_placeholder);
ieee80211_send_action_register(IEEE80211_ACTION_CAT_VHT,
WLAN_ACTION_VHT_OPMODE_NOTIF, vht_send_action_placeholder);
+
+#ifdef __NetBSD__
+ return 0;
+#endif
}
SYSINIT(wlan_vht, SI_SUB_DRIVERS, SI_ORDER_FIRST, ieee80211_vht_init, NULL);
@@ -151,6 +163,11 @@ SYSINIT(wlan_vht, SI_SUB_DRIVERS, SI_ORD
void
ieee80211_vht_attach(struct ieee80211com *ic)
{
+#ifdef __NetBSD__
+ static ONCE_DECL(vht_init_once);
+
+ RUN_ONCE(&vht_init_once, ieee80211_vht_init);
+#endif
}
void
Home |
Main Index |
Thread Index |
Old Index