summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/connection.h
diff options
context:
space:
mode:
authorJohan Hovold2016-03-03 13:34:39 +0100
committerGreg Kroah-Hartman2016-03-05 03:26:08 +0100
commit64a6d1388432704c9205fee04be8e6df45fc563b (patch)
treee61abf0fb1cc9fe7ebc18a2581e523eca236d4d2 /drivers/staging/greybus/connection.h
parentgreybus: connection: generalise CPortFlags handling (diff)
downloadkernel-qcow2-linux-64a6d1388432704c9205fee04be8e6df45fc563b.tar.gz
kernel-qcow2-linux-64a6d1388432704c9205fee04be8e6df45fc563b.tar.xz
kernel-qcow2-linux-64a6d1388432704c9205fee04be8e6df45fc563b.zip
greybus: connection: add CSD connection flag
Add CSD connection flag that can be specified when allocating a connection to enable Controlled Segment Dropping in favour of E2EFC which is enabled by default. Note that most connections are expected to have E2EFC enabled. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/connection.h')
-rw-r--r--drivers/staging/greybus/connection.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/staging/greybus/connection.h b/drivers/staging/greybus/connection.h
index d5ac1459332a..6197d45cb16a 100644
--- a/drivers/staging/greybus/connection.h
+++ b/drivers/staging/greybus/connection.h
@@ -13,6 +13,8 @@
#include <linux/list.h>
#include <linux/kfifo.h>
+#define GB_CONNECTION_FLAG_CSD BIT(0)
+
enum gb_connection_state {
GB_CONNECTION_STATE_INVALID = 0,
GB_CONNECTION_STATE_DISABLED = 1,
@@ -81,4 +83,9 @@ void greybus_data_rcvd(struct gb_host_device *hd, u16 cport_id,
void gb_connection_latency_tag_enable(struct gb_connection *connection);
void gb_connection_latency_tag_disable(struct gb_connection *connection);
+static inline bool gb_connection_e2efc_enabled(struct gb_connection *connection)
+{
+ return !(connection->flags & GB_CONNECTION_FLAG_CSD);
+}
+
#endif /* __CONNECTION_H */