Skip to content

Commit fb4e156

Browse files
holtmannjmberg-intel
authored andcommitted
nl80211: Add generic netlink module alias for cfg80211/nl80211
To support auto-loading of wireless modules from netlink users, add module alias for nl80211 family. This also adds NL80211_GENL_NAME constant to define the "nl80211" netlink family name as part of uapi. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent 55300a1 commit fb4e156

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

include/uapi/linux/nl80211.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
#include <linux/types.h>
2929

30+
#define NL80211_GENL_NAME "nl80211"
31+
3032
/**
3133
* DOC: Station handling
3234
*

net/wireless/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
MODULE_AUTHOR("Johannes Berg");
3535
MODULE_LICENSE("GPL");
3636
MODULE_DESCRIPTION("wireless configuration support");
37+
MODULE_ALIAS_GENL_FAMILY(NL80211_GENL_NAME);
3738

3839
/* RCU-protected (and cfg80211_mutex for writers) */
3940
LIST_HEAD(cfg80211_rdev_list);

net/wireless/nl80211.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ static void nl80211_post_doit(struct genl_ops *ops, struct sk_buff *skb,
3737

3838
/* the netlink family */
3939
static struct genl_family nl80211_fam = {
40-
.id = GENL_ID_GENERATE, /* don't bother with a hardcoded ID */
41-
.name = "nl80211", /* have users key off the name instead */
42-
.hdrsize = 0, /* no private header */
43-
.version = 1, /* no particular meaning now */
40+
.id = GENL_ID_GENERATE, /* don't bother with a hardcoded ID */
41+
.name = NL80211_GENL_NAME, /* have users key off the name instead */
42+
.hdrsize = 0, /* no private header */
43+
.version = 1, /* no particular meaning now */
4444
.maxattr = NL80211_ATTR_MAX,
4545
.netnsok = true,
4646
.pre_doit = nl80211_pre_doit,

0 commit comments

Comments
 (0)