summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/operation.h
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2014-12-02 17:25:11 -0600
committerGreg Kroah-Hartman <greg@kroah.com>2014-12-02 15:41:20 -0800
commitc939c2f8fe85a8099d553ae5c12b9a24ef735d05 (patch)
treebb1a32441b3400e290e959bc9dd9aca878c72db6 /drivers/staging/greybus/operation.h
parent6cd6ec55f4940bcddeed65e4eebb6190a64a4eb7 (diff)
downloadlinux-c939c2f8fe85a8099d553ae5c12b9a24ef735d05.tar.bz2
greybus: define the invalid operation type symbolically
Use a symbolic constant (rather than just "0") to represent an explicitly invalid operation type. The protocols have all reserved that value for that purpose--this just makes it explicit in the core code (since we now leverage its existence). Fix the code so it uses the new symbolic value. Define it in "operation.h" for all to see. Move the common definition of the GB_OPERATION_TYPE_RESPONSE flag mask there as well. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'drivers/staging/greybus/operation.h')
-rw-r--r--drivers/staging/greybus/operation.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/staging/greybus/operation.h b/drivers/staging/greybus/operation.h
index c60decb40539..40b2e7d68b87 100644
--- a/drivers/staging/greybus/operation.h
+++ b/drivers/staging/greybus/operation.h
@@ -13,6 +13,18 @@
struct gb_operation;
+/*
+ * No protocol may define an operation that has numeric value 0x00.
+ * It is reserved as an explicitly invalid value.
+ */
+#define GB_OPERATION_TYPE_INVALID ((u8)0x00)
+
+/*
+ * The top bit of the type in an operation message header indicates
+ * whether the message is a request (bit clear) or response (bit set)
+ */
+#define GB_OPERATION_TYPE_RESPONSE ((u8)0x80)
+
enum gb_operation_result {
GB_OP_SUCCESS = 0x00,
GB_OP_INTERRUPTED = 0x01,