blob: 6094fb44b9905d1eaf043ee97c8242175fd343de [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"
Alex Elderc68adb22014-10-01 21:54:14 -050015
16struct 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 Eldere88afa52014-10-01 21:54:15 -050022
23 struct list_head operations;
24 atomic_t op_cycle;
Alex Elderc68adb22014-10-01 21:54:14 -050025};
26
Alex Elderb05890d2014-10-02 12:30:01 -050027struct gb_connection *gb_connection_create(struct greybus_host_device *hd,
28 u16 cport_id, struct gb_function *function);
29void gb_connection_destroy(struct gb_connection *connection);
Alex Elderc68adb22014-10-01 21:54:14 -050030
Alex Eldere88afa52014-10-01 21:54:15 -050031u16 gb_connection_op_id(struct gb_connection *connection);
32
Alex Elderc68adb22014-10-01 21:54:14 -050033#endif /* __CONNECTION_H */