summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/connection.h
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-01-19 12:51:02 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2016-01-19 12:12:40 -0800
commitbfa9a5e2d07937a7620d55ff6eb55b480bc13100 (patch)
tree735273bfafedadaf0ccce030267e2778a79db607 /drivers/staging/greybus/connection.h
parent1cbfab3804b185ce2744b5b8064d06ca19491e36 (diff)
downloadlinux-stable-bfa9a5e2d07937a7620d55ff6eb55b480bc13100.tar.gz
linux-stable-bfa9a5e2d07937a7620d55ff6eb55b480bc13100.tar.bz2
linux-stable-bfa9a5e2d07937a7620d55ff6eb55b480bc13100.zip
greybus: connection: add per-connection request handlers
Add a connection request-handler field to struct gb_connection that is set when the connection is enabled. This is a step towards removing the legacy protocol abstraction from core, and will also be used to implement unidirectional connection states (e.g. only outgoing operations are allowed). Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/connection.h')
-rw-r--r--drivers/staging/greybus/connection.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/staging/greybus/connection.h b/drivers/staging/greybus/connection.h
index b0a67f279fb1..ec0e46903819 100644
--- a/drivers/staging/greybus/connection.h
+++ b/drivers/staging/greybus/connection.h
@@ -20,6 +20,10 @@ enum gb_connection_state {
GB_CONNECTION_STATE_DESTROYING = 3,
};
+struct gb_operation;
+
+typedef int (*gb_request_handler_t)(struct gb_operation *);
+
struct gb_connection {
struct gb_host_device *hd;
struct gb_interface *intf;
@@ -31,6 +35,8 @@ struct gb_connection {
struct list_head hd_links;
struct list_head bundle_links;
+ gb_request_handler_t handler;
+
struct gb_protocol *protocol;
u8 protocol_id;
u8 major;
@@ -62,7 +68,8 @@ static inline bool gb_connection_is_static(struct gb_connection *connection)
return !connection->intf;
}
-int gb_connection_enable(struct gb_connection *connection);
+int gb_connection_enable(struct gb_connection *connection,
+ gb_request_handler_t handler);
void gb_connection_disable(struct gb_connection *connection);
int gb_connection_legacy_init(struct gb_connection *connection);