Alex Elder | c68adb2 | 2014-10-01 21:54:14 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Greybus connections |
| 3 | * |
| 4 | * Copyright 2014 Google Inc. |
| 5 | * |
| 6 | * Released under the GPLv2 only. |
| 7 | */ |
| 8 | |
| 9 | #ifndef __CONNECTION_H |
| 10 | #define __CONNECTION_H |
| 11 | |
| 12 | #include <linux/list.h> |
| 13 | |
| 14 | #include "greybus.h" |
| 15 | #include "function.h" |
| 16 | |
| 17 | struct gb_connection { |
| 18 | struct gb_function *function; |
| 19 | struct greybus_host_device *hd; |
| 20 | u16 cport_id; /* Host side */ |
| 21 | |
| 22 | struct list_head host_links; |
Alex Elder | e88afa5 | 2014-10-01 21:54:15 -0500 | [diff] [blame^] | 23 | |
| 24 | struct list_head operations; |
| 25 | atomic_t op_cycle; |
Alex Elder | c68adb2 | 2014-10-01 21:54:14 -0500 | [diff] [blame] | 26 | }; |
| 27 | |
| 28 | bool gb_connection_setup(struct greybus_host_device *hd, u16 cport_id, |
| 29 | struct gb_function *function); |
| 30 | void gb_connection_teardown(struct gb_connection *connection); |
| 31 | |
Alex Elder | e88afa5 | 2014-10-01 21:54:15 -0500 | [diff] [blame^] | 32 | u16 gb_connection_op_id(struct gb_connection *connection); |
| 33 | |
Alex Elder | c68adb2 | 2014-10-01 21:54:14 -0500 | [diff] [blame] | 34 | #endif /* __CONNECTION_H */ |