diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-06-29 06:15:21 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-29 16:46:02 -0700 |
commit | a31f2d17b331db970259e875b7223d3aba7e3821 (patch) | |
tree | 0d10021be81446ab360f4240b0d16729f518387f /drivers/staging/gdm72xx | |
parent | dd7f36ba3ce17d4fe85987d83efd5901b0935816 (diff) |
netlink: add netlink_kernel_cfg parameter to netlink_kernel_create
This patch adds the following structure:
struct netlink_kernel_cfg {
unsigned int groups;
void (*input)(struct sk_buff *skb);
struct mutex *cb_mutex;
};
That can be passed to netlink_kernel_create to set optional configurations
for netlink kernel sockets.
I've populated this structure by looking for NULL and zero parameters at the
existing code. The remaining parameters that always need to be set are still
left in the original interface.
That includes optional parameters for the netlink socket creation. This allows
easy extensibility of this interface in the future.
This patch also adapts all callers to use this new interface.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/staging/gdm72xx')
-rw-r--r-- | drivers/staging/gdm72xx/netlink_k.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/gdm72xx/netlink_k.c b/drivers/staging/gdm72xx/netlink_k.c index 2489bb5597ca..87c3a07ed80e 100644 --- a/drivers/staging/gdm72xx/netlink_k.c +++ b/drivers/staging/gdm72xx/netlink_k.c @@ -88,13 +88,15 @@ struct sock *netlink_init(int unit, void (*cb)(struct net_device *dev, u16 type, void *msg, int len)) { struct sock *sock; + struct netlink_kernel_cfg cfg = { + .input = netlink_rcv, + }; #if !defined(DEFINE_MUTEX) init_MUTEX(&netlink_mutex); #endif - sock = netlink_kernel_create(&init_net, unit, 0, netlink_rcv, NULL, - THIS_MODULE); + sock = netlink_kernel_create(&init_net, unit, THIS_MODULE, &cfg); if (sock) rcv_cb = cb; |