Commit 489111e5 authored by Johannes Berg's avatar Johannes Berg Committed by David S. Miller

genetlink: statically initialize families

Instead of providing macros/inline functions to initialize
the families, make all users initialize them statically and
get rid of the macros.

This reduces the kernel code size by about 1.6k on x86-64
(with allyesconfig).
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a07ea4d9
......@@ -83,6 +83,7 @@ static const struct genl_multicast_group acpi_event_mcgrps[] = {
};
static struct genl_family acpi_event_genl_family = {
.module = THIS_MODULE,
.name = ACPI_GENL_FAMILY_NAME,
.version = ACPI_GENL_VERSION,
.maxattr = ACPI_GENL_ATTR_MAX,
......
......@@ -1094,13 +1094,7 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info)
return 0;
}
static struct genl_family gtp_genl_family = {
.name = "gtp",
.version = 0,
.hdrsize = 0,
.maxattr = GTPA_MAX,
.netnsok = true,
};
static struct genl_family gtp_genl_family;
static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 snd_seq,
u32 type, struct pdp_ctx *pctx)
......@@ -1296,6 +1290,17 @@ static const struct genl_ops gtp_genl_ops[] = {
},
};
static struct genl_family gtp_genl_family = {
.name = "gtp",
.version = 0,
.hdrsize = 0,
.maxattr = GTPA_MAX,
.netnsok = true,
.module = THIS_MODULE,
.ops = gtp_genl_ops,
.n_ops = ARRAY_SIZE(gtp_genl_ops),
};
static int __net_init gtp_net_init(struct net *net)
{
struct gtp_net *gn = net_generic(net, gtp_net_id);
......@@ -1335,7 +1340,7 @@ static int __init gtp_init(void)
if (err < 0)
goto error_out;
err = genl_register_family_with_ops(&gtp_genl_family, gtp_genl_ops);
err = genl_register_family(&gtp_genl_family);
if (err < 0)
goto unreg_rtnl_link;
......
......@@ -1421,13 +1421,7 @@ static void clear_tx_sa(struct macsec_tx_sa *tx_sa)
macsec_txsa_put(tx_sa);
}
static struct genl_family macsec_fam = {
.name = MACSEC_GENL_NAME,
.hdrsize = 0,
.version = MACSEC_GENL_VERSION,
.maxattr = MACSEC_ATTR_MAX,
.netnsok = true,
};
static struct genl_family macsec_fam;
static struct net_device *get_dev_from_nl(struct net *net,
struct nlattr **attrs)
......@@ -2654,6 +2648,17 @@ static const struct genl_ops macsec_genl_ops[] = {
},
};
static struct genl_family macsec_fam = {
.name = MACSEC_GENL_NAME,
.hdrsize = 0,
.version = MACSEC_GENL_VERSION,
.maxattr = MACSEC_ATTR_MAX,
.netnsok = true,
.module = THIS_MODULE,
.ops = macsec_genl_ops,
.n_ops = ARRAY_SIZE(macsec_genl_ops),
};
static netdev_tx_t macsec_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{
......@@ -3461,7 +3466,7 @@ static int __init macsec_init(void)
if (err)
goto notifier;
err = genl_register_family_with_ops(&macsec_fam, macsec_genl_ops);
err = genl_register_family(&macsec_fam);
if (err)
goto rtnl;
......
......@@ -2150,12 +2150,7 @@ static struct rtnl_link_ops team_link_ops __read_mostly = {
* Generic netlink custom interface
***********************************/
static struct genl_family team_nl_family = {
.name = TEAM_GENL_NAME,
.version = TEAM_GENL_VERSION,
.maxattr = TEAM_ATTR_MAX,
.netnsok = true,
};
static struct genl_family team_nl_family;
static const struct nla_policy team_nl_policy[TEAM_ATTR_MAX + 1] = {
[TEAM_ATTR_UNSPEC] = { .type = NLA_UNSPEC, },
......@@ -2745,6 +2740,18 @@ static const struct genl_multicast_group team_nl_mcgrps[] = {
{ .name = TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME, },
};
static struct genl_family team_nl_family = {
.name = TEAM_GENL_NAME,
.version = TEAM_GENL_VERSION,
.maxattr = TEAM_ATTR_MAX,
.netnsok = true,
.module = THIS_MODULE,
.ops = team_nl_ops,
.n_ops = ARRAY_SIZE(team_nl_ops),
.mcgrps = team_nl_mcgrps,
.n_mcgrps = ARRAY_SIZE(team_nl_mcgrps),
};
static int team_nl_send_multicast(struct sk_buff *skb,
struct team *team, u32 portid)
{
......@@ -2768,8 +2775,7 @@ static int team_nl_send_event_port_get(struct team *team,
static int team_nl_init(void)
{
return genl_register_family_with_ops_groups(&team_nl_family, team_nl_ops,
team_nl_mcgrps);
return genl_register_family(&team_nl_family);
}
static void team_nl_fini(void)
......
......@@ -587,14 +587,8 @@ struct hwsim_radiotap_ack_hdr {
__le16 rt_chbitmask;
} __packed;
/* MAC80211_HWSIM netlinf family */
static struct genl_family hwsim_genl_family = {
.hdrsize = 0,
.name = "MAC80211_HWSIM",
.version = 1,
.maxattr = HWSIM_ATTR_MAX,
.netnsok = true,
};
/* MAC80211_HWSIM netlink family */
static struct genl_family hwsim_genl_family;
enum hwsim_multicast_groups {
HWSIM_MCGRP_CONFIG,
......@@ -3234,6 +3228,18 @@ static const struct genl_ops hwsim_ops[] = {
},
};
static struct genl_family hwsim_genl_family = {
.name = "MAC80211_HWSIM",
.version = 1,
.maxattr = HWSIM_ATTR_MAX,
.netnsok = true,
.module = THIS_MODULE,
.ops = hwsim_ops,
.n_ops = ARRAY_SIZE(hwsim_ops),
.mcgrps = hwsim_mcgrps,
.n_mcgrps = ARRAY_SIZE(hwsim_mcgrps),
};
static void destroy_radio(struct work_struct *work)
{
struct mac80211_hwsim_data *data =
......@@ -3287,9 +3293,7 @@ static int hwsim_init_netlink(void)
printk(KERN_INFO "mac80211_hwsim: initializing netlink\n");
rc = genl_register_family_with_ops_groups(&hwsim_genl_family,
hwsim_ops,
hwsim_mcgrps);
rc = genl_register_family(&hwsim_genl_family);
if (rc)
goto failure;
......
......@@ -1369,6 +1369,7 @@ static struct genl_multicast_group pmcraid_mcgrps[] = {
};
static struct genl_family pmcraid_event_family = {
.module = THIS_MODULE,
.name = "pmcraid",
.version = 1,
.maxattr = PMCRAID_AEN_ATTR_MAX,
......
......@@ -148,6 +148,7 @@ static const struct genl_multicast_group tcmu_mcgrps[] = {
/* Our generic netlink family */
static struct genl_family tcmu_genl_family = {
.module = THIS_MODULE,
.hdrsize = 0,
.name = "TCM-USER",
.version = 1,
......
......@@ -2164,6 +2164,7 @@ static const struct genl_multicast_group thermal_event_mcgrps[] = {
};
static struct genl_family thermal_event_genl_family = {
.module = THIS_MODULE,
.name = THERMAL_GENL_FAMILY_NAME,
.version = THERMAL_GENL_VERSION,
.maxattr = THERMAL_GENL_ATTR_MAX,
......
......@@ -16,10 +16,7 @@
static uint32_t dlm_nl_seqnum;
static uint32_t listener_nlportid;
static struct genl_family family = {
.name = DLM_GENL_NAME,
.version = DLM_GENL_VERSION,
};
static struct genl_family family;
static int prepare_data(u8 cmd, struct sk_buff **skbp, size_t size)
{
......@@ -75,9 +72,17 @@ static struct genl_ops dlm_nl_ops[] = {
},
};
static struct genl_family family = {
.name = DLM_GENL_NAME,
.version = DLM_GENL_VERSION,
.ops = dlm_nl_ops,
.n_ops = ARRAY_SIZE(dlm_nl_ops),
.module = THIS_MODULE,
};
int __init dlm_netlink_init(void)
{
return genl_register_family_with_ops(&family, dlm_nl_ops);
return genl_register_family(&family);
}
void dlm_netlink_exit(void)
......
......@@ -13,6 +13,7 @@ static const struct genl_multicast_group quota_mcgrps[] = {
/* Netlink family structure for quota */
static struct genl_family quota_genl_family = {
.module = THIS_MODULE,
.hdrsize = 0,
.name = "VFS_DQUOT",
.version = 1,
......
......@@ -67,7 +67,7 @@
* genl_magic_func.h
* generates an entry in the static genl_ops array,
* and static register/unregister functions to
* genl_register_family_with_ops().
* genl_register_family().
*
* flags and handler:
* GENL_op_init( .doit = x, .dumpit = y, .flags = something)
......
......@@ -259,15 +259,7 @@ static struct genl_ops ZZZ_genl_ops[] __read_mostly = {
* {{{2
*/
#define ZZZ_genl_family CONCAT_(GENL_MAGIC_FAMILY, _genl_family)
static struct genl_family ZZZ_genl_family __read_mostly = {
.name = __stringify(GENL_MAGIC_FAMILY),
.version = GENL_MAGIC_VERSION,
#ifdef GENL_MAGIC_FAMILY_HDRSZ
.hdrsize = NLA_ALIGN(GENL_MAGIC_FAMILY_HDRSZ),
#endif
.maxattr = ARRAY_SIZE(drbd_tla_nl_policy)-1,
};
static struct genl_family ZZZ_genl_family;
/*
* Magic: define multicast groups
* Magic: define multicast group registration helper
......@@ -301,11 +293,23 @@ static int CONCAT_(GENL_MAGIC_FAMILY, _genl_multicast_ ## group)( \
#undef GENL_mc_group
#define GENL_mc_group(group)
static struct genl_family ZZZ_genl_family __read_mostly = {
.name = __stringify(GENL_MAGIC_FAMILY),
.version = GENL_MAGIC_VERSION,
#ifdef GENL_MAGIC_FAMILY_HDRSZ
.hdrsize = NLA_ALIGN(GENL_MAGIC_FAMILY_HDRSZ),
#endif
.maxattr = ARRAY_SIZE(drbd_tla_nl_policy)-1,
.ops = ZZZ_genl_ops,
.n_ops = ARRAY_SIZE(ZZZ_genl_ops),
.mcgrps = ZZZ_genl_mcgrps,
.n_mcgrps = ARRAY_SIZE(ZZZ_genl_mcgrps),
.module = THIS_MODULE,
};
int CONCAT_(GENL_MAGIC_FAMILY, _genl_register)(void)
{
return genl_register_family_with_ops_groups(&ZZZ_genl_family, \
ZZZ_genl_ops, \
ZZZ_genl_mcgrps);
return genl_register_family(&ZZZ_genl_family);
}
void CONCAT_(GENL_MAGIC_FAMILY, _genl_unregister)(void)
......
......@@ -39,13 +39,14 @@ struct genl_info;
* Note that unbind() will not be called symmetrically if the
* generic netlink family is removed while there are still open
* sockets.
* @attrbuf: buffer to store parsed attributes
* @family_list: family list
* @mcgrps: multicast groups used by this family (private)
* @n_mcgrps: number of multicast groups (private)
* @attrbuf: buffer to store parsed attributes (private)
* @family_list: family list (private)
* @mcgrps: multicast groups used by this family
* @n_mcgrps: number of multicast groups
* @mcgrp_offset: starting number of multicast group IDs in this family
* @ops: the operations supported by this family (private)
* @n_ops: number of operations supported by this family (private)
* (private)
* @ops: the operations supported by this family
* @n_ops: number of operations supported by this family
*/
struct genl_family {
unsigned int id; /* private */
......@@ -64,10 +65,10 @@ struct genl_family {
int (*mcast_bind)(struct net *net, int group);
void (*mcast_unbind)(struct net *net, int group);
struct nlattr ** attrbuf; /* private */
const struct genl_ops * ops; /* private */
const struct genl_multicast_group *mcgrps; /* private */
unsigned int n_ops; /* private */
unsigned int n_mcgrps; /* private */
const struct genl_ops * ops;
const struct genl_multicast_group *mcgrps;
unsigned int n_ops;
unsigned int n_mcgrps;
unsigned int mcgrp_offset; /* private */
struct list_head family_list; /* private */
struct module *module;
......@@ -132,55 +133,7 @@ struct genl_ops {
u8 flags;
};
int __genl_register_family(struct genl_family *family);
static inline int genl_register_family(struct genl_family *family)
{
family->module = THIS_MODULE;
return __genl_register_family(family);
}
/**
* genl_register_family_with_ops - register a generic netlink family with ops
* @family: generic netlink family
* @ops: operations to be registered
* @n_ops: number of elements to register
*
* Registers the specified family and operations from the specified table.
* Only one family may be registered with the same family name or identifier.
*
* Either a doit or dumpit callback must be specified for every registered
* operation or the function will fail. Only one operation structure per
* command identifier may be registered.
*
* See include/net/genetlink.h for more documenation on the operations
* structure.
*
* Return 0 on success or a negative error code.
*/
static inline int
_genl_register_family_with_ops_grps(struct genl_family *family,
const struct genl_ops *ops, size_t n_ops,
const struct genl_multicast_group *mcgrps,
size_t n_mcgrps)
{
family->module = THIS_MODULE;
family->ops = ops;
family->n_ops = n_ops;
family->mcgrps = mcgrps;
family->n_mcgrps = n_mcgrps;
return __genl_register_family(family);
}
#define genl_register_family_with_ops(family, ops) \
_genl_register_family_with_ops_grps((family), \
(ops), ARRAY_SIZE(ops), \
NULL, 0)
#define genl_register_family_with_ops_groups(family, ops, grps) \
_genl_register_family_with_ops_grps((family), \
(ops), ARRAY_SIZE(ops), \
(grps), ARRAY_SIZE(grps))
int genl_register_family(struct genl_family *family);
int genl_unregister_family(struct genl_family *family);
void genl_notify(struct genl_family *family, struct sk_buff *skb,
struct genl_info *info, u32 group, gfp_t flags);
......
......@@ -41,11 +41,7 @@ static DEFINE_PER_CPU(__u32, taskstats_seqnum);
static int family_registered;
struct kmem_cache *taskstats_cache;
static struct genl_family family = {
.name = TASKSTATS_GENL_NAME,
.version = TASKSTATS_GENL_VERSION,
.maxattr = TASKSTATS_CMD_ATTR_MAX,
};
static struct genl_family family;
static const struct nla_policy taskstats_cmd_get_policy[TASKSTATS_CMD_ATTR_MAX+1] = {
[TASKSTATS_CMD_ATTR_PID] = { .type = NLA_U32 },
......@@ -650,6 +646,15 @@ static const struct genl_ops taskstats_ops[] = {
},
};
static struct genl_family family = {
.name = TASKSTATS_GENL_NAME,
.version = TASKSTATS_GENL_VERSION,
.maxattr = TASKSTATS_CMD_ATTR_MAX,
.module = THIS_MODULE,
.ops = taskstats_ops,
.n_ops = ARRAY_SIZE(taskstats_ops),
};
/* Needed early in initialization */
void __init taskstats_init_early(void)
{
......@@ -666,7 +671,7 @@ static int __init taskstats_init(void)
{
int rc;
rc = genl_register_family_with_ops(&family, taskstats_ops);
rc = genl_register_family(&family);
if (rc)
return rc;
......
......@@ -48,13 +48,7 @@
#include "tp_meter.h"
#include "translation-table.h"
struct genl_family batadv_netlink_family = {
.hdrsize = 0,
.name = BATADV_NL_NAME,
.version = 1,
.maxattr = BATADV_ATTR_MAX,
.netnsok = true,
};
struct genl_family batadv_netlink_family;
/* multicast groups */
enum batadv_netlink_multicast_groups {
......@@ -609,6 +603,19 @@ static struct genl_ops batadv_netlink_ops[] = {
};
struct genl_family batadv_netlink_family = {
.hdrsize = 0,
.name = BATADV_NL_NAME,
.version = 1,
.maxattr = BATADV_ATTR_MAX,
.netnsok = true,
.module = THIS_MODULE,
.ops = batadv_netlink_ops,
.n_ops = ARRAY_SIZE(batadv_netlink_ops),
.mcgrps = batadv_netlink_mcgrps,
.n_mcgrps = ARRAY_SIZE(batadv_netlink_mcgrps),
};
/**
* batadv_netlink_register - register batadv genl netlink family
*/
......@@ -616,9 +623,7 @@ void __init batadv_netlink_register(void)
{
int ret;
ret = genl_register_family_with_ops_groups(&batadv_netlink_family,
batadv_netlink_ops,
batadv_netlink_mcgrps);
ret = genl_register_family(&batadv_netlink_family);
if (ret)
pr_warn("unable to register netlink family");
}
......
......@@ -341,14 +341,7 @@ static void devlink_nl_post_doit(const struct genl_ops *ops,
mutex_unlock(&devlink_mutex);
}
static struct genl_family devlink_nl_family = {
.name = DEVLINK_GENL_NAME,
.version = DEVLINK_GENL_VERSION,
.maxattr = DEVLINK_ATTR_MAX,
.netnsok = true,
.pre_doit = devlink_nl_pre_doit,
.post_doit = devlink_nl_post_doit,
};
static struct genl_family devlink_nl_family;
enum devlink_multicast_groups {
DEVLINK_MCGRP_CONFIG,
......@@ -1619,6 +1612,20 @@ static const struct genl_ops devlink_nl_ops[] = {
},
};
static struct genl_family devlink_nl_family = {
.name = DEVLINK_GENL_NAME,
.version = DEVLINK_GENL_VERSION,
.maxattr = DEVLINK_ATTR_MAX,
.netnsok = true,
.pre_doit = devlink_nl_pre_doit,
.post_doit = devlink_nl_post_doit,
.module = THIS_MODULE,
.ops = devlink_nl_ops,
.n_ops = ARRAY_SIZE(devlink_nl_ops),
.mcgrps = devlink_nl_mcgrps,
.n_mcgrps = ARRAY_SIZE(devlink_nl_mcgrps),
};
/**
* devlink_alloc - Allocate new devlink instance resources
*
......@@ -1841,9 +1848,7 @@ EXPORT_SYMBOL_GPL(devlink_sb_unregister);
static int __init devlink_module_init(void)
{
return genl_register_family_with_ops_groups(&devlink_nl_family,
devlink_nl_ops,
devlink_nl_mcgrps);
return genl_register_family(&devlink_nl_family);
}
static void __exit devlink_module_exit(void)
......
......@@ -59,11 +59,7 @@ struct dm_hw_stat_delta {
unsigned long last_drop_val;
};
static struct genl_family net_drop_monitor_family = {
.hdrsize = 0,
.name = "NET_DM",
.version = 2,
};
static struct genl_family net_drop_monitor_family;
static DEFINE_PER_CPU(struct per_cpu_dm_data, dm_cpu_data);
......@@ -350,6 +346,17 @@ static const struct genl_ops dropmon_ops[] = {
},
};
static struct genl_family net_drop_monitor_family = {
.hdrsize = 0,
.name = "NET_DM",
.version = 2,
.module = THIS_MODULE,
.ops = dropmon_ops,
.n_ops = ARRAY_SIZE(dropmon_ops),
.mcgrps = dropmon_mcgrps,
.n_mcgrps = ARRAY_SIZE(dropmon_mcgrps),
};
static struct notifier_block dropmon_net_notifier = {
.notifier_call = dropmon_net_event
};
......@@ -366,8 +373,7 @@ static int __init init_net_drop_monitor(void)
return -ENOSPC;
}
rc = genl_register_family_with_ops_groups(&net_drop_monitor_family,
dropmon_ops, dropmon_mcgrps);
rc = genl_register_family(&net_drop_monitor_family);
if (rc) {
pr_err("Could not create drop monitor netlink family\n");
return rc;
......
......@@ -131,12 +131,7 @@ static const struct nla_policy hsr_genl_policy[HSR_A_MAX + 1] = {
[HSR_A_IF2_SEQ] = { .type = NLA_U16 },
};
static struct genl_family hsr_genl_family = {
.hdrsize = 0,
.name = "HSR",
.version = 1,
.maxattr = HSR_A_MAX,
};
static struct genl_family hsr_genl_family;
static const struct genl_multicast_group hsr_mcgrps[] = {
{ .name = "hsr-network", },
......@@ -466,6 +461,18 @@ static const struct genl_ops hsr_ops[] = {
},
};
static struct genl_family hsr_genl_family = {
.hdrsize = 0,
.name = "HSR",
.version = 1,
.maxattr = HSR_A_MAX,
.module = THIS_MODULE,
.ops = hsr_ops,
.n_ops = ARRAY_SIZE(hsr_ops),
.mcgrps = hsr_mcgrps,
.n_mcgrps = ARRAY_SIZE(hsr_mcgrps),
};
int __init hsr_netlink_init(void)
{
int rc;
......@@ -474,8 +481,7 @@ int __init hsr_netlink_init(void)
if (rc)
goto fail_rtnl_link_register;
rc = genl_register_family_with_ops_groups(&hsr_genl_family, hsr_ops,
hsr_mcgrps);
rc = genl_register_family(&hsr_genl_family);
if (rc)
goto fail_genl_register_family;
......
......@@ -28,13 +28,6 @@
static unsigned int ieee802154_seq_num;
static DEFINE_SPINLOCK(ieee802154_seq_lock);
struct genl_family nl802154_family = {
.hdrsize = 0,
.name = IEEE802154_NL_NAME,
.version = 1,
.maxattr = IEEE802154_ATTR_MAX,
};
/* Requests to userspace */
struct sk_buff *ieee802154_nl_create(int flags, u8 req)
{
......@@ -138,11 +131,21 @@ static const struct genl_multicast_group ieee802154_mcgrps[] = {
[IEEE802154_BEACON_MCGRP] = { .name = IEEE802154_MCAST_BEACON_NAME, },
};
struct genl_family nl802154_family = {
.hdrsize = 0,
.name = IEEE802154_NL_NAME,
.version = 1,
.maxattr = IEEE802154_ATTR_MAX,
.module = THIS_MODULE,
.ops = ieee8021154_ops,
.n_ops = ARRAY_SIZE(ieee8021154_ops),
.mcgrps = ieee802154_mcgrps,
.n_mcgrps = ARRAY_SIZE(ieee802154_mcgrps),
};
int __init ieee802154_nl_init(void)
{
return genl_register_family_with_ops_groups(&nl802154_family,
ieee8021154_ops,
ieee802154_mcgrps);
return genl_register_family(&nl802154_family);
}
void ieee802154_nl_exit(void)
......
......@@ -26,22 +26,8 @@
#include "rdev-ops.h"
#include "core.h"
static int nl802154_pre_doit(const struct genl_ops *ops, struct sk_buff *skb,
struct genl_info *info);
static void nl802154_post_doit(const struct genl_ops *ops, struct sk_buff *skb,
struct genl_info *info);
/* the netlink family */
static struct genl_family nl802154_fam = {
.name = NL802154_GENL_NAME, /* have users key off the name instead */
.hdrsize = 0, /* no private header */
.version = 1, /* no particular meaning now */
.maxattr = NL802154_ATTR_MAX,
.netnsok = true,
.pre_doit = nl802154_pre_doit,
.post_doit = nl802154_post_doit,
};
static struct genl_family nl802154_fam;
/* multicast groups */
enum nl802154_multicast_groups {
......@@ -2476,11 +2462,25 @@ static const struct genl_ops nl802154_ops[] = {
#endif /* CONFIG_IEEE802154_NL802154_EXPERIMENTAL */
};
static struct genl_family nl802154_fam = {
.name = NL802154_GENL_NAME, /* have users key off the name instead */
.hdrsize = 0, /* no private header */
.version = 1, /* no particular meaning now */
.maxattr = NL802154_ATTR_MAX,
.netnsok = true,
.pre_doit = nl802154_pre_doit,
.post_doit = nl802154_post_doit,
.module = THIS_MODULE,
.ops = nl802154_ops,
.n_ops = ARRAY_SIZE(nl802154_ops),
.mcgrps = nl802154_mcgrps,
.n_mcgrps = ARRAY_SIZE(nl802154_mcgrps),
};
/* initialisation/exit functions */
int nl802154_init(void)
{
return genl_register_family_with_ops_groups(&nl802154_fam, nl802154_ops,
nl802154_mcgrps);
return genl_register_family(&nl802154_fam);
}
void nl802154_exit(void)
......
......@@ -622,13 +622,7 @@ static int fou_destroy(struct net *net, struct fou_cfg *cfg)
return err;
}
static struct genl_family fou_nl_family = {
.hdrsize = 0,
.name = FOU_GENL_NAME,
.version = FOU_GENL_VERSION,
.maxattr = FOU_ATTR_MAX,
.netnsok = true,
};
static struct genl_family fou_nl_family;
static const struct nla_policy fou_nl_policy[FOU_ATTR_MAX + 1] = {
[FOU_ATTR_PORT] = { .type = NLA_U16, },
......@@ -830,6 +824,17 @@ static const struct genl_ops fou_nl_ops[] = {
},
};
static struct genl_family fou_nl_family = {
.hdrsize = 0,
.name = FOU_GENL_NAME,
.version = FOU_GENL_VERSION,
.maxattr = FOU_ATTR_MAX,
.netnsok = true,
.module = THIS_MODULE,
.ops = fou_nl_ops,
.n_ops = ARRAY_SIZE(fou_nl_ops),
};
size_t fou_encap_hlen(struct ip_tunnel_encap *e)
{
return sizeof(struct udphdr);
......@@ -1085,8 +1090,7 @@ static int __init fou_init(void)
if (ret)