From: Johannes Berg <johannes@sipsolutions.net>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>
Subject: [PATCH] nl80211: use the generic netlink multicast framework
Date: Tue, 17 Jul 2007 15:18:05 +0200 [thread overview]
Message-ID: <1184678285.3773.92.camel@johannes.berg> (raw)
Generic netlink just got a framework to register multicast
groups. Use it.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
I totally misunderstood how it should be with multicast groups
in generic netlink, but it wasn't really done well in any case.
Please apply this patch as soon as you get the generic netlink multicast
I just sent to davem. If you want I can also ping you once they make it
in.
include/linux/nl80211.h | 16 ----------------
net/wireless/nl80211.c | 12 +++++++++++-
2 files changed, 11 insertions(+), 17 deletions(-)
--- wireless-dev.orig/include/linux/nl80211.h 2007-07-17 14:05:13.520964463 +0200
+++ wireless-dev/include/linux/nl80211.h 2007-07-17 14:05:32.350964463 +0200
@@ -189,22 +189,6 @@ enum nl80211_attrs {
};
#define NL80211_ATTR_MAX (__NL80211_ATTR_AFTER_LAST - 1)
-/**
- * enum nl80211_multicast_groups - multicast groups for nl80211
- * @NL80211_GROUP_CONFIG: members of this group are notified of
- * configuration changes
- */
-enum nl80211_multicast_groups {
- /* be notified of configuration changes like wiphy renames */
- NL80211_GROUP_CONFIG,
-
- /* add groups here */
-
- /* keep last */
- __NL80211_GROUP_AFTER_LAST
-};
-#define NL80211_GROUP_MAX (__NL80211_GROUP_AFTER_LAST - 1)
-
/*
* maximum length of IE(s) passed in an NL80211_ATTR_IE.
* this is an arbitrary limit, 774 means three full-length
--- wireless-dev.orig/net/wireless/nl80211.c 2007-07-17 14:05:13.550964463 +0200
+++ wireless-dev/net/wireless/nl80211.c 2007-07-17 14:05:32.350964463 +0200
@@ -944,6 +944,11 @@ void *nl80211msg_new(struct sk_buff **sk
}
EXPORT_SYMBOL_GPL(nl80211msg_new);
+/* multicast groups */
+static struct genl_multicast_group nl80211_config_mcgrp = {
+ .name = "config",
+};
+
/* notification functions */
void nl80211_notify_dev_rename(struct cfg80211_registered_device *rdev)
@@ -959,7 +964,7 @@ void nl80211_notify_dev_rename(struct cf
NLA_PUT_STRING(msg, NL80211_ATTR_WIPHY_NAME, wiphy_name(&rdev->wiphy));
genlmsg_end(msg, hdr);
- genlmsg_multicast(msg, 0, NL80211_GROUP_CONFIG, GFP_KERNEL);
+ genlmsg_multicast(msg, 0, nl80211_config_mcgrp.id, GFP_KERNEL);
return;
@@ -982,6 +987,11 @@ int nl80211_init(void)
if (err)
goto err_out;
}
+
+ err = genl_register_mc_group(&nl80211_fam, &nl80211_config_mcgrp);
+ if (err)
+ goto err_out;
+
return 0;
err_out:
genl_unregister_family(&nl80211_fam);
reply other threads:[~2007-07-17 13:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1184678285.3773.92.camel@johannes.berg \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox