Commit 64a6d138 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

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: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 27f25c17
...@@ -339,7 +339,7 @@ gb_connection_svc_connection_create(struct gb_connection *connection) ...@@ -339,7 +339,7 @@ gb_connection_svc_connection_create(struct gb_connection *connection)
cport_flags = GB_SVC_CPORT_FLAG_CSV_N; cport_flags = GB_SVC_CPORT_FLAG_CSV_N;
if (intf->boot_over_unipro) { if (intf->boot_over_unipro) {
cport_flags |= GB_SVC_CPORT_FLAG_CSD_N; cport_flags |= GB_SVC_CPORT_FLAG_CSD_N;
} else { } else if (gb_connection_e2efc_enabled(connection)) {
cport_flags |= GB_SVC_CPORT_FLAG_CSD_N | cport_flags |= GB_SVC_CPORT_FLAG_CSD_N |
GB_SVC_CPORT_FLAG_E2EFC; GB_SVC_CPORT_FLAG_E2EFC;
} }
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/kfifo.h> #include <linux/kfifo.h>
#define GB_CONNECTION_FLAG_CSD BIT(0)
enum gb_connection_state { enum gb_connection_state {
GB_CONNECTION_STATE_INVALID = 0, GB_CONNECTION_STATE_INVALID = 0,
GB_CONNECTION_STATE_DISABLED = 1, GB_CONNECTION_STATE_DISABLED = 1,
...@@ -81,4 +83,9 @@ void greybus_data_rcvd(struct gb_host_device *hd, u16 cport_id, ...@@ -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_enable(struct gb_connection *connection);
void gb_connection_latency_tag_disable(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 */ #endif /* __CONNECTION_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment