summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/operation.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-05-27 17:26:35 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2016-05-27 12:21:16 -0700
commit18079ece816b3b272b114b770e636f4e5567b028 (patch)
tree1e53c782df5333d13adb90a39cab6c42dce7b353 /drivers/staging/greybus/operation.c
parent77bbbcf6d36d7ef2054a8b0dc8396cc0f092945e (diff)
greybus: operation: add helper for creating core operations
Add a new core operation flag and a helper that core can use to create core operations. This will be used to implement the ping operations that core sends as part of connection tear down. Note that a new trace point is also added. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/operation.c')
-rw-r--r--drivers/staging/greybus/operation.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c
index 75d1231cfde5..fb4a29e2c09f 100644
--- a/drivers/staging/greybus/operation.c
+++ b/drivers/staging/greybus/operation.c
@@ -571,6 +571,26 @@ gb_operation_create_flags(struct gb_connection *connection,
}
EXPORT_SYMBOL_GPL(gb_operation_create_flags);
+struct gb_operation *
+gb_operation_create_core(struct gb_connection *connection,
+ u8 type, size_t request_size,
+ size_t response_size, unsigned long flags,
+ gfp_t gfp)
+{
+ struct gb_operation *operation;
+
+ flags |= GB_OPERATION_FLAG_CORE;
+
+ operation = gb_operation_create_common(connection, type,
+ request_size, response_size,
+ flags, gfp);
+ if (operation)
+ trace_gb_operation_create_core(operation);
+
+ return operation;
+}
+/* Do not export this function. */
+
size_t gb_operation_get_payload_size_max(struct gb_connection *connection)
{
struct gb_host_device *hd = connection->hd;