aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/w1
diff options
context:
space:
mode:
authorDavid Fries <David@Fries.net>2014-04-08 23:37:09 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-27 16:56:21 -0400
commit8a0427d192e6043834414210dd14cc1289daff18 (patch)
tree1e76812e3744b6946a815fb94f877cc31d11b302 /Documentation/w1
parent34470e0bfae223e3f22bd2bd6e0e1dac366c9290 (diff)
w1: optional bundling of netlink kernel replies
Applications can submit a set of commands in one packet to the kernel, and in some cases it is required such as reading the temperature sensor results. This adds an option W1_CN_BUNDLE to the flags of cn_msg to request the kernel to reply in one packet for efficiency. The cn_msg flags now check for unknown flag values and return an error if one is seen. See "Proper handling of unknown flags in system calls" http://lwn.net/Articles/588444/ This corrects the ack values returned as per the protocol standard, namely the original ack for status messages and seq + 1 for all others such as the data returned from a read. Some of the common variable names have been standardized as follows. struct cn_msg *cn struct w1_netlink_msg *msg struct w1_netlink_cmd *cmd struct w1_master *dev When an argument and a function scope variable would collide, add req_ to the argument. Signed-off-by: David Fries <David@Fries.net> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation/w1')
-rw-r--r--Documentation/w1/w1.generic2
-rw-r--r--Documentation/w1/w1.netlink13
2 files changed, 9 insertions, 6 deletions
diff --git a/Documentation/w1/w1.generic b/Documentation/w1/w1.generic
index a31c5a242973..b2033c64c7da 100644
--- a/Documentation/w1/w1.generic
+++ b/Documentation/w1/w1.generic
@@ -82,7 +82,7 @@ driver - (standard) symlink to the w1 driver
82w1_master_add - Manually register a slave device 82w1_master_add - Manually register a slave device
83w1_master_attempts - the number of times a search was attempted 83w1_master_attempts - the number of times a search was attempted
84w1_master_max_slave_count 84w1_master_max_slave_count
85 - the maximum slaves that may be attached to a master 85 - maximum number of slaves to search for at a time
86w1_master_name - the name of the device (w1_bus_masterX) 86w1_master_name - the name of the device (w1_bus_masterX)
87w1_master_pullup - 5V strong pullup 0 enabled, 1 disabled 87w1_master_pullup - 5V strong pullup 0 enabled, 1 disabled
88w1_master_remove - Manually remove a slave device 88w1_master_remove - Manually remove a slave device
diff --git a/Documentation/w1/w1.netlink b/Documentation/w1/w1.netlink
index 927a52cc0519..ef2727192d69 100644
--- a/Documentation/w1/w1.netlink
+++ b/Documentation/w1/w1.netlink
@@ -30,7 +30,7 @@ Protocol.
30 W1_SLAVE_CMD 30 W1_SLAVE_CMD
31 userspace command for slave device 31 userspace command for slave device
32 (read/write/touch) 32 (read/write/touch)
33 __u8 res - reserved 33 __u8 status - error indication from kernel
34 __u16 len - size of data attached to this header data 34 __u16 len - size of data attached to this header data
35 union { 35 union {
36 __u8 id[8]; - slave unique device id 36 __u8 id[8]; - slave unique device id
@@ -44,10 +44,14 @@ Protocol.
44 __u8 cmd - command opcode. 44 __u8 cmd - command opcode.
45 W1_CMD_READ - read command 45 W1_CMD_READ - read command
46 W1_CMD_WRITE - write command 46 W1_CMD_WRITE - write command
47 W1_CMD_TOUCH - touch command
48 (write and sample data back to userspace)
49 W1_CMD_SEARCH - search command 47 W1_CMD_SEARCH - search command
50 W1_CMD_ALARM_SEARCH - alarm search command 48 W1_CMD_ALARM_SEARCH - alarm search command
49 W1_CMD_TOUCH - touch command
50 (write and sample data back to userspace)
51 W1_CMD_RESET - send bus reset
52 W1_CMD_SLAVE_ADD - add slave to kernel list
53 W1_CMD_SLAVE_REMOVE - remove slave from kernel list
54 W1_CMD_LIST_SLAVES - get slaves list from kernel
51 __u8 res - reserved 55 __u8 res - reserved
52 __u16 len - length of data for this command 56 __u16 len - length of data for this command
53 For read command data must be allocated like for write command 57 For read command data must be allocated like for write command
@@ -87,8 +91,7 @@ format:
87 id0 ... idN 91 id0 ... idN
88 92
89 Each message is at most 4k in size, so if number of master devices 93 Each message is at most 4k in size, so if number of master devices
90 exceeds this, it will be split into several messages, 94 exceeds this, it will be split into several messages.
91 cn.seq will be increased for each one.
92 95
93W1 search and alarm search commands. 96W1 search and alarm search commands.
94request: 97request: