diff options
Diffstat (limited to 'drivers/w1/w1_netlink.h')
-rw-r--r-- | drivers/w1/w1_netlink.h | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/drivers/w1/w1_netlink.h b/drivers/w1/w1_netlink.h index eb0c8b3152c8..5644221f9a44 100644 --- a/drivers/w1/w1_netlink.h +++ b/drivers/w1/w1_netlink.h | |||
@@ -23,37 +23,55 @@ | |||
23 | #define __W1_NETLINK_H | 23 | #define __W1_NETLINK_H |
24 | 24 | ||
25 | #include <asm/types.h> | 25 | #include <asm/types.h> |
26 | #include <linux/connector.h> | ||
26 | 27 | ||
27 | #include "w1.h" | 28 | #include "w1.h" |
28 | 29 | ||
30 | #define CN_W1_IDX 3 | ||
31 | #define CN_W1_VAL 1 | ||
32 | |||
29 | enum w1_netlink_message_types { | 33 | enum w1_netlink_message_types { |
30 | W1_SLAVE_ADD = 0, | 34 | W1_SLAVE_ADD = 0, |
31 | W1_SLAVE_REMOVE, | 35 | W1_SLAVE_REMOVE, |
32 | W1_MASTER_ADD, | 36 | W1_MASTER_ADD, |
33 | W1_MASTER_REMOVE, | 37 | W1_MASTER_REMOVE, |
38 | W1_MASTER_CMD, | ||
39 | W1_SLAVE_CMD, | ||
34 | }; | 40 | }; |
35 | 41 | ||
36 | struct w1_netlink_msg | 42 | struct w1_netlink_msg |
37 | { | 43 | { |
38 | __u8 type; | 44 | __u8 type; |
39 | __u8 reserved[3]; | 45 | __u8 reserved; |
40 | union | 46 | __u16 len; |
41 | { | 47 | union { |
42 | struct w1_reg_num id; | 48 | __u8 id[8]; |
43 | __u64 w1_id; | 49 | struct w1_mst { |
44 | struct | ||
45 | { | ||
46 | __u32 id; | 50 | __u32 id; |
47 | __u32 pid; | 51 | __u32 res; |
48 | } mst; | 52 | } mst; |
49 | } id; | 53 | } id; |
54 | __u8 data[0]; | ||
55 | }; | ||
56 | |||
57 | #define W1_CMD_READ 0x0 | ||
58 | #define W1_CMD_WRITE 0x1 | ||
59 | #define W1_CMD_SEARCH 0x2 | ||
60 | #define W1_CMD_ALARM_SEARCH 0x3 | ||
61 | |||
62 | struct w1_netlink_cmd | ||
63 | { | ||
64 | __u8 cmd; | ||
65 | __u8 res; | ||
66 | __u16 len; | ||
67 | __u8 data[0]; | ||
50 | }; | 68 | }; |
51 | 69 | ||
52 | #ifdef __KERNEL__ | 70 | #ifdef __KERNEL__ |
53 | 71 | ||
54 | void w1_netlink_send(struct w1_master *, struct w1_netlink_msg *); | 72 | void w1_netlink_send(struct w1_master *, struct w1_netlink_msg *); |
55 | int dev_init_netlink(struct w1_master *dev); | 73 | int w1_init_netlink(void); |
56 | void dev_fini_netlink(struct w1_master *dev); | 74 | void w1_fini_netlink(void); |
57 | 75 | ||
58 | #endif /* __KERNEL__ */ | 76 | #endif /* __KERNEL__ */ |
59 | #endif /* __W1_NETLINK_H */ | 77 | #endif /* __W1_NETLINK_H */ |