diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2014-11-16 00:49:45 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2014-11-16 17:28:15 +0100 |
commit | 22e801a4ac65a6e9ba517d935e5fd1951be97650 (patch) | |
tree | ebaa627566a973fd38245b0239315870ccc1c993 | |
parent | 45745ebfeff0628bd08525c4ad0d600febf9a2a3 (diff) |
backports: add genl_notify()
This is needed by mac80211_hwsim.
The code was copied from kernel 3.4.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r-- | backport/backport-include/net/genetlink.h | 5 | ||||
-rw-r--r-- | backport/compat/compat-3.3.c | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/backport/backport-include/net/genetlink.h b/backport/backport-include/net/genetlink.h index fc7eff4d..0535b0f1 100644 --- a/backport/backport-include/net/genetlink.h +++ b/backport/backport-include/net/genetlink.h @@ -1,6 +1,7 @@ #ifndef __BACKPORT_NET_GENETLINK_H #define __BACKPORT_NET_GENETLINK_H #include_next <net/genetlink.h> +#include <linux/version.h> /* this is for patches we apply */ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) @@ -85,6 +86,10 @@ _genl_register_family_with_ops_grps(struct genl_family *family, #define genl_unregister_family backport_genl_unregister_family int genl_unregister_family(struct genl_family *family); +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) +extern void genl_notify(struct sk_buff *skb, struct net *net, u32 pid, + u32 group, struct nlmsghdr *nlh, gfp_t flags); +#endif #define genl_notify(_fam, _skb, _net, _portid, _group, _nlh, _flags) \ genl_notify(_skb, _net, _portid, (_fam)->mcgrps[_group].id, \ _nlh, _flags) diff --git a/backport/compat/compat-3.3.c b/backport/compat/compat-3.3.c index 7ddc2bd2..490c29bd 100644 --- a/backport/compat/compat-3.3.c +++ b/backport/compat/compat-3.3.c @@ -224,3 +224,16 @@ void backport_destroy_workqueue(struct workqueue_struct *wq) spin_unlock(&wq_name_lock); } EXPORT_SYMBOL_GPL(backport_destroy_workqueue); + +void genl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group, + struct nlmsghdr *nlh, gfp_t flags) +{ + struct sock *sk = net->genl_sock; + int report = 0; + + if (nlh) + report = nlmsg_report(nlh); + + nlmsg_notify(sk, skb, pid, group, report, flags); +} +EXPORT_SYMBOL_GPL(genl_notify); |