summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/connection.h
diff options
context:
space:
mode:
authorJohan Hovold2015-11-25 15:59:11 +0100
committerGreg Kroah-Hartman2015-11-26 00:34:19 +0100
commit2566fae6a5eb29e52502a38fd816c6e994547625 (patch)
tree1a172ef387861bcbc80f7374a64e6714b4a5c6e1 /drivers/staging/greybus/connection.h
parentgreybus: interface: kill gb_create_bundle_connection (diff)
downloadkernel-qcow2-linux-2566fae6a5eb29e52502a38fd816c6e994547625.tar.gz
kernel-qcow2-linux-2566fae6a5eb29e52502a38fd816c6e994547625.tar.xz
kernel-qcow2-linux-2566fae6a5eb29e52502a38fd816c6e994547625.zip
greybus: connection: clean up connection-creation interface
Clean up the connection-creation interface by clearly separating our two types of connections: static and dynamic. Add two convenience functions for creating static and dynamic connections. A static connection is a pre-setup connection that is defined by a host device and a host-device cport id. Specifically, the remote interface or cport id need not be known. The SVC connection is a static connection. A dynamic connection is defined by a host device and a remote interface and cport id. This is our normal connections where the host-device cport is (generally) allocated dynamically. Note that the new generic interface is marked static, but can be exported later to allow dynamic connections to be created also from fixed host-device cports (e.g. for CSI). Also note that a connection of either type is uniquely identified by its host-device and host-device cport id once created. 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.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/staging/greybus/connection.h b/drivers/staging/greybus/connection.h
index 44ecfbed1d0d..c5499fcbfd13 100644
--- a/drivers/staging/greybus/connection.h
+++ b/drivers/staging/greybus/connection.h
@@ -23,6 +23,7 @@ enum gb_connection_state {
struct gb_connection {
struct gb_host_device *hd;
+ struct gb_interface *intf;
struct gb_bundle *bundle;
struct kref kref;
u16 hd_cport_id;
@@ -51,12 +52,12 @@ struct gb_connection {
int svc_update_connection(struct gb_interface *intf,
struct gb_connection *connection);
-struct gb_connection *gb_connection_create(struct gb_bundle *bundle,
- u16 cport_id, u8 protocol_id);
-struct gb_connection *gb_connection_create_range(struct gb_host_device *hd,
- struct gb_bundle *bundle,
- u16 cport_id, u8 protocol_id, u32 ida_start,
- u32 ida_end);
+
+struct gb_connection *gb_connection_create_static(struct gb_host_device *hd,
+ u16 hd_cport_id, u8 protocol_id);
+struct gb_connection *gb_connection_create_dynamic(struct gb_interface *intf,
+ struct gb_bundle *bundle, u16 cport_id,
+ u8 protocol_id);
void gb_connection_destroy(struct gb_connection *connection);
void greybus_data_rcvd(struct gb_host_device *hd, u16 cport_id,