greybus: introduce a connection abstraction
Within a UniPro network a pair of CPorts can be linked to form a
UniPro Connection. This patch creates a new abstraction to
represent an AP CPort that is connected with a CPort used by a
function within a Greybus module.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
diff --git a/drivers/staging/greybus/connection.h b/drivers/staging/greybus/connection.h
new file mode 100644
index 0000000..79b3b07
--- /dev/null
+++ b/drivers/staging/greybus/connection.h
@@ -0,0 +1,29 @@
+/*
+ * Greybus connections
+ *
+ * Copyright 2014 Google Inc.
+ *
+ * Released under the GPLv2 only.
+ */
+
+#ifndef __CONNECTION_H
+#define __CONNECTION_H
+
+#include <linux/list.h>
+
+#include "greybus.h"
+#include "function.h"
+
+struct gb_connection {
+ struct gb_function *function;
+ struct greybus_host_device *hd;
+ u16 cport_id; /* Host side */
+
+ struct list_head host_links;
+};
+
+bool gb_connection_setup(struct greybus_host_device *hd, u16 cport_id,
+ struct gb_function *function);
+void gb_connection_teardown(struct gb_connection *connection);
+
+#endif /* __CONNECTION_H */