blob: 32cf3cfdb432c58b80d85ba51bec0aecce92adae [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lamaa8e15a2014-02-11 23:30:06 -08002 * Copyright (c) 2012-2013 Qualcomm Atheros, Inc.
3 * All Rights Reserved.
4 * Qualcomm Atheros Confidential and Proprietary.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08005 */
Jeff Johnson295189b2012-06-20 16:38:30 -07006/******************************************************************************
7 * wlan_nlink_srv.h
8 *
9 * wlan_nlink_srv is used to RX/TX Netlink messages from user space to kernel
10 * modules and vice versa. Kernel modules must register a message handler for a
11 * message type so that the wlan_nlink_srv can invoke the corresponding msg handler
12 * whenever a Netlink message of a particular type has been received from an
13 * application. In the opposite direction, wlan_nlink_srv provides a mechanism
14 * which kernel modules can use to send Netlink messages to applications.
15 *
16 ******************************************************************************/
17
18#ifndef WLAN_NLINK_SRV_H
19#define WLAN_NLINK_SRV_H
20
21#include <linux/skbuff.h>
Jeff Johnsonf6624a42013-01-17 18:25:55 -080022#include <net/netlink.h>
Jeff Johnson295189b2012-06-20 16:38:30 -070023#include <wlan_nlink_common.h>
24
25#define NLINK_MAX_CALLBACKS (WLAN_NL_MSG_MAX - WLAN_NL_MSG_BASE)
26
27typedef int (* nl_srv_msg_callback)(struct sk_buff * skb);
28
29int nl_srv_init(void);
Leo Chang59cdc7e2013-07-10 10:08:21 -070030#ifdef WLAN_KD_READY_NOTIFIER
31void nl_srv_exit(int dst_pid);
32#else
Jeff Johnson295189b2012-06-20 16:38:30 -070033void nl_srv_exit(void);
Leo Chang59cdc7e2013-07-10 10:08:21 -070034#endif /* WLAN_KD_READY_NOTIFIER */
Jeff Johnson295189b2012-06-20 16:38:30 -070035int nl_srv_register(tWlanNlModTypes msg_type, nl_srv_msg_callback msg_handler);
36int nl_srv_unregister(tWlanNlModTypes msg_type, nl_srv_msg_callback msg_handler);
37int nl_srv_ucast(struct sk_buff * skb, int dst_pid);
38int nl_srv_bcast(struct sk_buff * skb);
Leo Chang59cdc7e2013-07-10 10:08:21 -070039#ifdef WLAN_KD_READY_NOTIFIER
40void nl_srv_nl_ready_indication(void);
41void nl_srv_nl_close_indication(int pid);
42#endif /* WLAN_KD_READY_NOTIFIER */
Jeff Johnson295189b2012-06-20 16:38:30 -070043#endif