X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=datapath%2Fbrcompat.c;h=f9d008399cd19434cc0cd22754e858afe09cbda7;hb=465b509c7ce1023af9665ec2553c1c7baee5963e;hp=15cec9c912d467a807ab27c98d52dfdcb0bc9c9f;hpb=f632c8fc817ff5597007a795b51574bddd32563a;p=sliver-openvswitch.git diff --git a/datapath/brcompat.c b/datapath/brcompat.c index 15cec9c91..f9d008399 100644 --- a/datapath/brcompat.c +++ b/datapath/brcompat.c @@ -18,7 +18,6 @@ #include #include "openvswitch/brcompat-netlink.h" -#include "brc_procfs.h" #include "datapath.h" static struct genl_family brc_genl_family; @@ -396,22 +395,9 @@ nla_put_failure: return err; } -static struct genl_ops brc_genl_ops_query_dp = { - .cmd = BRC_GENL_C_QUERY_MC, - .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privelege. */ - .policy = NULL, - .doit = brc_genl_query, - .dumpit = NULL -}; - /* Attribute policy: what each attribute may contain. */ static struct nla_policy brc_genl_policy[BRC_GENL_A_MAX + 1] = { [BRC_GENL_A_ERR_CODE] = { .type = NLA_U32 }, - - [BRC_GENL_A_PROC_DIR] = { .type = NLA_NUL_STRING }, - [BRC_GENL_A_PROC_NAME] = { .type = NLA_NUL_STRING }, - [BRC_GENL_A_PROC_DATA] = { .type = NLA_NUL_STRING }, - [BRC_GENL_A_FDB_DATA] = { .type = NLA_UNSPEC }, }; @@ -445,20 +431,17 @@ static int brc_genl_dp_result(struct sk_buff *skb, struct genl_info *info) return err; } -static struct genl_ops brc_genl_ops_dp_result = { - .cmd = BRC_GENL_C_DP_RESULT, - .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privelege. */ - .policy = brc_genl_policy, - .doit = brc_genl_dp_result, - .dumpit = NULL -}; - -static struct genl_ops brc_genl_ops_set_proc = { - .cmd = BRC_GENL_C_SET_PROC, - .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privelege. */ - .policy = brc_genl_policy, - .doit = brc_genl_set_proc, - .dumpit = NULL +static struct genl_ops brc_genl_ops[] = { + { .cmd = BRC_GENL_C_QUERY_MC, + .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privelege. */ + .policy = NULL, + .doit = brc_genl_query, + }, + { .cmd = BRC_GENL_C_DP_RESULT, + .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privelege. */ + .policy = brc_genl_policy, + .doit = brc_genl_dp_result, + }, }; static struct sk_buff *brc_send_command(struct sk_buff *request, @@ -531,22 +514,11 @@ static int __init brc_init(void) /* Register generic netlink family to communicate changes to * userspace. */ - err = genl_register_family(&brc_genl_family); + err = genl_register_family_with_ops(&brc_genl_family, + brc_genl_ops, ARRAY_SIZE(brc_genl_ops)); if (err) goto error; - err = genl_register_ops(&brc_genl_family, &brc_genl_ops_query_dp); - if (err != 0) - goto err_unregister; - - err = genl_register_ops(&brc_genl_family, &brc_genl_ops_dp_result); - if (err != 0) - goto err_unregister; - - err = genl_register_ops(&brc_genl_family, &brc_genl_ops_set_proc); - if (err != 0) - goto err_unregister; - strcpy(brc_mc_group.name, "brcompat"); err = genl_register_mc_group(&brc_genl_family, &brc_mc_group); if (err < 0) @@ -568,7 +540,6 @@ static void brc_cleanup(void) brioctl_set(NULL); genl_unregister_family(&brc_genl_family); - brc_procfs_exit(); } module_init(brc_init);