Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/pgoyette-compat]: src/sys Adapt the ieee80211_20 code to the new MP-safe...
details: https://anonhg.NetBSD.org/src/rev/e19ce2d9c914
branches: pgoyette-compat
changeset: 830736:e19ce2d9c914
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Fri Sep 21 03:42:20 2018 +0000
description:
Adapt the ieee80211_20 code to the new MP-safe mechanism
diffstat:
sys/compat/common/ieee80211_20.c | 11 +++++++----
sys/kern/compat_stub.c | 6 +-----
sys/net80211/ieee80211_ioctl.c | 14 ++++++++++++--
sys/sys/compat_stub.h | 7 +------
4 files changed, 21 insertions(+), 17 deletions(-)
diffs (124 lines):
diff -r 80a3f0a05b06 -r e19ce2d9c914 sys/compat/common/ieee80211_20.c
--- a/sys/compat/common/ieee80211_20.c Fri Sep 21 02:56:22 2018 +0000
+++ b/sys/compat/common/ieee80211_20.c Fri Sep 21 03:42:20 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ieee80211_20.c,v 1.1.2.1 2018/03/30 02:28:49 pgoyette Exp $ */
+/* $NetBSD: ieee80211_20.c,v 1.1.2.2 2018/09/21 03:42:20 pgoyette Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -36,7 +36,7 @@
__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_ioctl.c,v 1.35 2005/08/30 14:27:47 avatar Exp $");
#endif
#ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_20.c,v 1.1.2.1 2018/03/30 02:28:49 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_20.c,v 1.1.2.2 2018/09/21 03:42:20 pgoyette Exp $");
#endif
/*
@@ -94,15 +94,18 @@
return 0;
}
+MODULE_SET_HOOK(ieee80211_ostats_hook, "ieee20", ieee80211_get_ostats);
+MODULE_UNSET_HOOK(ieee80211_ostats_hook);
+
void
ieee80211_20_init(void)
{
- ieee80211_get_ostats_20 = ieee80211_get_ostats;
+ ieee80211_ostats_hook_set();
}
void
ieee80211_20_fini(void)
{
- ieee80211_get_ostats_20 = (void *)enosys;
+ ieee80211_ostats_hook_unset();
}
diff -r 80a3f0a05b06 -r e19ce2d9c914 sys/kern/compat_stub.c
--- a/sys/kern/compat_stub.c Fri Sep 21 02:56:22 2018 +0000
+++ b/sys/kern/compat_stub.c Fri Sep 21 03:42:20 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_stub.c,v 1.1.2.22 2018/09/21 02:56:22 pgoyette Exp $ */
+/* $NetBSD: compat_stub.c,v 1.1.2.23 2018/09/21 03:42:20 pgoyette Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -128,10 +128,6 @@
* ieee80211 ioctl compatability
*/
struct ieee80211_ostats_hook_t ieee80211_ostats_hook;
-struct ieee80211_get_ostats_20_hook_t ieee80211_get_ostats_20_hook;
-
-/*XXX PRG */int (*ieee80211_get_ostats_20)(struct ieee80211_ostats *,
- struct ieee80211_stats *) = (void *)enosys;
/*
* if_43 compatability
diff -r 80a3f0a05b06 -r e19ce2d9c914 sys/net80211/ieee80211_ioctl.c
--- a/sys/net80211/ieee80211_ioctl.c Fri Sep 21 02:56:22 2018 +0000
+++ b/sys/net80211/ieee80211_ioctl.c Fri Sep 21 03:42:20 2018 +0000
@@ -36,7 +36,7 @@
__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_ioctl.c,v 1.35 2005/08/30 14:27:47 avatar Exp $");
#endif
#ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_ioctl.c,v 1.60.16.2 2018/03/30 02:28:49 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_ioctl.c,v 1.60.16.3 2018/09/21 03:42:20 pgoyette Exp $");
#endif
/*
@@ -2556,6 +2556,16 @@
#endif /* __FreeBSD__ */
#ifdef __NetBSD__
+/*
+ * Compatability glue
+ */
+MODULE_CALL_HOOK_DECL(ieee80211_ostats_hook, f,
+ (struct ieee80211_ostats *ostats, struct ieee80211_stats *stats),
+ (ostats, stats), enosys());
+MODULE_CALL_HOOK(ieee80211_ostats_hook, f,
+ (struct ieee80211_ostats *ostats, struct ieee80211_stats *stats),
+ (ostats, stats), enosys());
+
int
ieee80211_ioctl(struct ieee80211com *ic, u_long cmd, void *data)
{
@@ -2855,7 +2865,7 @@
ifr = (struct ifreq *)data;
s = splnet();
- error = (*ieee80211_get_ostats_20)(&ostats, &ic->ic_stats);
+ error = ieee80211_ostats_hook_f_call(&ostats, &ic->ic_stats);
if (error == ENOSYS)
error = EINVAL;
if (error == 0)
diff -r 80a3f0a05b06 -r e19ce2d9c914 sys/sys/compat_stub.h
--- a/sys/sys/compat_stub.h Fri Sep 21 02:56:22 2018 +0000
+++ b/sys/sys/compat_stub.h Fri Sep 21 03:42:20 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_stub.h,v 1.1.2.32 2018/09/21 02:56:22 pgoyette Exp $ */
+/* $NetBSD: compat_stub.h,v 1.1.2.33 2018/09/21 03:42:20 pgoyette Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -149,17 +149,12 @@
/*
* ieee80211 ioctl compatability
- * XXX need to review this
*/
struct ieee80211_ostats;
struct ieee80211_stats;
MODULE_HOOK(ieee80211_ostats_hook, (struct ieee80211_ostats *,
struct ieee80211_stats *));
-MODULE_HOOK(ieee80211_get_ostats_20_hook, (int));
-
-/* XXX PRG*/extern int (*ieee80211_get_ostats_20)(struct ieee80211_ostats *,
- struct ieee80211_stats *);
/*
* if_43 compatability
Home |
Main Index |
Thread Index |
Old Index