summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/operation.h
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2014-12-03 12:27:44 -0600
committerGreg Kroah-Hartman <greg@kroah.com>2014-12-03 15:08:17 -0800
commit7cfa699556731c0c7d93793c419eb83f37107de2 (patch)
tree0818874787c97b6aa46e900e5013150a42c04822 /drivers/staging/greybus/operation.h
parent7a9366aa1e8645c12c0050b417358089c216d14f (diff)
greybus: only record message payload size
An asynchronous operation will want to know how big the response message it receives is. Rather than require the sender to record that information, expose a new field "payload_size" available to the protocol code for this purpose. An operation message consists of a header and a payload. The size of the message can be derived from the size of the payload, so record only the payload size and not the size of the whole message. Reorder the fields in a message structure. Update the description of the message header structure. 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.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/staging/greybus/operation.h b/drivers/staging/greybus/operation.h
index 3415e8b56eb6..a79e88a3b314 100644
--- a/drivers/staging/greybus/operation.h
+++ b/drivers/staging/greybus/operation.h
@@ -38,13 +38,18 @@ enum gb_operation_result {
GB_OP_MALFUNCTION = 0xff,
};
+/*
+ * Protocol code should only examine the payload and payload_size
+ * fields. All other fields are intended to be private to the
+ * operations core code.
+ */
struct gb_message {
- struct gb_operation_msg_hdr *header;
- void *payload;
- size_t size; /* header + payload */
struct gb_operation *operation;
-
void *cookie;
+ struct gb_operation_msg_hdr *header;
+
+ void *payload;
+ size_t payload_size;
u8 buffer[];
};