Commit | Line | Data |
---|---|---|
6fa3eb70 S |
1 | /* |
2 | * kernel/power/tuxonice_netlink.h | |
3 | * | |
4 | * Copyright (C) 2004-2010 Nigel Cunningham (nigel at tuxonice net) | |
5 | * | |
6 | * This file is released under the GPLv2. | |
7 | * | |
8 | * Declarations for functions for communicating with a userspace helper | |
9 | * via netlink. | |
10 | */ | |
11 | ||
12 | #include <linux/netlink.h> | |
13 | #include <net/sock.h> | |
14 | ||
15 | #define NETLINK_MSG_BASE 0x10 | |
16 | ||
17 | #define NETLINK_MSG_READY 0x10 | |
18 | #define NETLINK_MSG_NOFREEZE_ME 0x16 | |
19 | #define NETLINK_MSG_GET_DEBUGGING 0x19 | |
20 | #define NETLINK_MSG_CLEANUP 0x24 | |
21 | #define NETLINK_MSG_NOFREEZE_ACK 0x27 | |
22 | #define NETLINK_MSG_IS_DEBUGGING 0x28 | |
23 | ||
24 | struct user_helper_data { | |
25 | int (*rcv_msg) (struct sk_buff *skb, struct nlmsghdr *nlh); | |
26 | void (*not_ready) (void); | |
27 | struct sock *nl; | |
28 | u32 sock_seq; | |
29 | pid_t pid; | |
30 | char *comm; | |
31 | char program[256]; | |
32 | int pool_level; | |
33 | int pool_limit; | |
34 | struct sk_buff *emerg_skbs; | |
35 | int skb_size; | |
36 | int netlink_id; | |
37 | char *name; | |
38 | struct user_helper_data *next; | |
39 | struct completion wait_for_process; | |
40 | u32 interface_version; | |
41 | int must_init; | |
42 | int debug; | |
43 | }; | |
44 | ||
45 | #ifdef CONFIG_NET | |
46 | int toi_netlink_setup(struct user_helper_data *uhd); | |
47 | void toi_netlink_close(struct user_helper_data *uhd); | |
48 | void toi_send_netlink_message(struct user_helper_data *uhd, int type, void *params, size_t len); | |
49 | void toi_netlink_close_complete(struct user_helper_data *uhd); | |
50 | #else | |
51 | static inline int toi_netlink_setup(struct user_helper_data *uhd) | |
52 | { | |
53 | return 0; | |
54 | } | |
55 | ||
56 | static inline void toi_netlink_close(struct user_helper_data *uhd) | |
57 | { | |
58 | }; | |
59 | ||
60 | static inline void toi_send_netlink_message(struct user_helper_data *uhd, | |
61 | int type, void *params, size_t len) | |
62 | { | |
63 | }; | |
64 | ||
65 | static inline void toi_netlink_close_complete(struct user_helper_data *uhd) | |
66 | { | |
67 | }; | |
68 | #endif |