Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame^] | 2 | * Copyright (c) 2012-2013 Qualcomm Atheros, Inc. |
| 3 | * All Rights Reserved. |
| 4 | * Qualcomm Atheros Confidential and Proprietary. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 5 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6 | /****************************************************************************** |
| 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 Johnson | f6624a4 | 2013-01-17 18:25:55 -0800 | [diff] [blame] | 22 | #include <net/netlink.h> |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23 | #include <wlan_nlink_common.h> |
| 24 | |
| 25 | #define NLINK_MAX_CALLBACKS (WLAN_NL_MSG_MAX - WLAN_NL_MSG_BASE) |
| 26 | |
| 27 | typedef int (* nl_srv_msg_callback)(struct sk_buff * skb); |
| 28 | |
| 29 | int nl_srv_init(void); |
Leo Chang | 59cdc7e | 2013-07-10 10:08:21 -0700 | [diff] [blame] | 30 | #ifdef WLAN_KD_READY_NOTIFIER |
| 31 | void nl_srv_exit(int dst_pid); |
| 32 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 33 | void nl_srv_exit(void); |
Leo Chang | 59cdc7e | 2013-07-10 10:08:21 -0700 | [diff] [blame] | 34 | #endif /* WLAN_KD_READY_NOTIFIER */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 35 | int nl_srv_register(tWlanNlModTypes msg_type, nl_srv_msg_callback msg_handler); |
| 36 | int nl_srv_unregister(tWlanNlModTypes msg_type, nl_srv_msg_callback msg_handler); |
| 37 | int nl_srv_ucast(struct sk_buff * skb, int dst_pid); |
| 38 | int nl_srv_bcast(struct sk_buff * skb); |
Leo Chang | 59cdc7e | 2013-07-10 10:08:21 -0700 | [diff] [blame] | 39 | #ifdef WLAN_KD_READY_NOTIFIER |
| 40 | void nl_srv_nl_ready_indication(void); |
| 41 | void nl_srv_nl_close_indication(int pid); |
| 42 | #endif /* WLAN_KD_READY_NOTIFIER */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 43 | #endif |