blob: c653c95d2834d144a85ecfb02831b9384a6a04bd [file] [log] [blame]
Alex Elderc68adb22014-10-01 21:54:14 -05001/*
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
17struct 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 Eldere88afa52014-10-01 21:54:15 -050023
24 struct list_head operations;
25 atomic_t op_cycle;
Alex Elderc68adb22014-10-01 21:54:14 -050026};
27
28bool gb_connection_setup(struct greybus_host_device *hd, u16 cport_id,
29 struct gb_function *function);
30void gb_connection_teardown(struct gb_connection *connection);
31
Alex Eldere88afa52014-10-01 21:54:15 -050032u16 gb_connection_op_id(struct gb_connection *connection);
33
Alex Elderc68adb22014-10-01 21:54:14 -050034#endif /* __CONNECTION_H */