summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/connection.h
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2014-10-28 19:36:00 -0500
committerGreg Kroah-Hartman <greg@kroah.com>2014-10-29 08:42:44 +0800
commit4ccb6b7abb8ee4ff6fc28468ffe893caa730ea13 (patch)
tree11269593d94714a0af62d37aa067644a21db6963 /drivers/staging/greybus/connection.h
parent7fba0079ad9a5b1b851947ad3c5b90093b2fc415 (diff)
greybus: introduce protocol abstraction
Define a protocol structure that will allow protocols to be registered dynamically. For now we just introduce a bookkeeping data structure. Upcoming patches will move protocol-related methods into the protocol structure, and will start registering protocol handlers dynamically. A list of connections using a given protocol is maintained so we can tell when a protocol is no longer in use. This may not be necessary (we could use a kref instead) but it may turn out to be a good way to clean things up. The interface is gb_protocol_get() and gb_protocol_put() for a connection, allowing the protocol to be looked up and the connection structure to be inserted into its list. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'drivers/staging/greybus/connection.h')
-rw-r--r--drivers/staging/greybus/connection.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/greybus/connection.h b/drivers/staging/greybus/connection.h
index 830abe7060ba..8056993c00ac 100644
--- a/drivers/staging/greybus/connection.h
+++ b/drivers/staging/greybus/connection.h
@@ -39,7 +39,9 @@ struct gb_connection {
struct rb_node hd_node;
struct list_head interface_links;
- u8 protocol_id;
+
+ struct gb_protocol *protocol;
+ struct list_head protocol_links;
enum gb_connection_state state;