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" |
Alex Elder | c68adb2 | 2014-10-01 21:54:14 -0500 | [diff] [blame] | 15 | |
| 16 | struct gb_connection { |
| 17 | struct gb_function *function; |
| 18 | struct greybus_host_device *hd; |
| 19 | u16 cport_id; /* Host side */ |
| 20 | |
| 21 | struct list_head host_links; |
Alex Elder | e88afa5 | 2014-10-01 21:54:15 -0500 | [diff] [blame] | 22 | |
| 23 | struct list_head operations; |
| 24 | atomic_t op_cycle; |
Alex Elder | c68adb2 | 2014-10-01 21:54:14 -0500 | [diff] [blame] | 25 | }; |
| 26 | |
Alex Elder | b05890d | 2014-10-02 12:30:01 -0500 | [diff] [blame^] | 27 | struct gb_connection *gb_connection_create(struct greybus_host_device *hd, |
| 28 | u16 cport_id, struct gb_function *function); |
| 29 | void gb_connection_destroy(struct gb_connection *connection); |
Alex Elder | c68adb2 | 2014-10-01 21:54:14 -0500 | [diff] [blame] | 30 | |
Alex Elder | e88afa5 | 2014-10-01 21:54:15 -0500 | [diff] [blame] | 31 | u16 gb_connection_op_id(struct gb_connection *connection); |
| 32 | |
Alex Elder | c68adb2 | 2014-10-01 21:54:14 -0500 | [diff] [blame] | 33 | #endif /* __CONNECTION_H */ |