4 * Copyright 2014 Google Inc.
5 * Copyright 2014 Linaro Ltd.
7 * Released under the GPLv2 only.
10 #ifndef __CONNECTION_H
11 #define __CONNECTION_H
13 #include <linux/list.h>
14 #include <linux/kfifo.h>
16 enum gb_connection_state {
17 GB_CONNECTION_STATE_INVALID = 0,
18 GB_CONNECTION_STATE_DISABLED = 1,
19 GB_CONNECTION_STATE_ENABLED = 2,
20 GB_CONNECTION_STATE_ERROR = 3,
21 GB_CONNECTION_STATE_DESTROYING = 4,
24 struct gb_connection {
25 struct gb_host_device *hd;
26 struct gb_bundle *bundle;
31 struct list_head hd_links;
32 struct list_head bundle_links;
34 struct gb_protocol *protocol;
42 enum gb_connection_state state;
43 struct list_head operations;
45 struct workqueue_struct *wq;
52 int svc_update_connection(struct gb_interface *intf,
53 struct gb_connection *connection);
54 struct gb_connection *gb_connection_create(struct gb_bundle *bundle,
55 u16 cport_id, u8 protocol_id);
56 struct gb_connection *gb_connection_create_range(struct gb_host_device *hd,
57 struct gb_bundle *bundle, struct device *parent,
58 u16 cport_id, u8 protocol_id, u32 ida_start,
60 void gb_connection_destroy(struct gb_connection *connection);
62 void greybus_data_rcvd(struct gb_host_device *hd, u16 cport_id,
63 u8 *data, size_t length);
65 int gb_connection_bind_protocol(struct gb_connection *connection);
67 void gb_connection_latency_tag_enable(struct gb_connection *connection);
68 void gb_connection_latency_tag_disable(struct gb_connection *connection);
70 #endif /* __CONNECTION_H */