summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/kernel_ver.h
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2014-10-01 21:54:15 -0500
committerGreg Kroah-Hartman <greg@kroah.com>2014-10-02 21:18:41 -0700
commite88afa5811c741facff3fa695d340133ac8a1be1 (patch)
treec03b0d910285538feb295a6764e4988952dbcdbe /drivers/staging/greybus/kernel_ver.h
parentc68adb2f2c999886f8e18e98ad4e69aec14c9f32 (diff)
greybus: introduce an operation abstraction
This patch defines a new "operation" abstraction. An operation is a request from by one end of a connection to the function (or AP) on the other, coupled with a matching response returned to the requestor. The request indicates some action to be performed by the target of the request (such as "read some data"). Once the action has completed the target sends back an operation response message. Additional data can be supplied by the sender with its request, and/or by the target with its resposne message. Each request message has a unique id, generated by the sender. The sender recognizes the matching response by the presence of this id value. Each end of a connection is responsible for creating unique ids for the requests it sends. An operation also has a type, whose interpretation is dependent on the function type on the end of the connection opposite the sender. It is up to the creator of an operation to fill in the data (if any) to be sent with the request. Note that not all requests are initiated by the AP. Incoming data on a module function can result in a request message being sent from that function to the AP to notify of the data's arrival. Once the AP has processed this, it sends a response to the sender. Every operation response contains a status byte. If it's value is 0, the operation was successful. Any other value indicates an error. Add a defintion of U16_MAX to "kernel_ver.h". Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'drivers/staging/greybus/kernel_ver.h')
-rw-r--r--drivers/staging/greybus/kernel_ver.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/greybus/kernel_ver.h b/drivers/staging/greybus/kernel_ver.h
index 4aa5b83bff60..c9ea7a94f4e6 100644
--- a/drivers/staging/greybus/kernel_ver.h
+++ b/drivers/staging/greybus/kernel_ver.h
@@ -22,4 +22,8 @@
#define U8_MAX ((u8)~0U)
#endif /* ! U8_MAX */
+#ifndef U16_MAX
+#define U16_MAX ((u16)(~0U))
+#endif /* !U16_MAX */
+
#endif /* __GREYBUS_KERNEL_VER_H */