connection->bundle = bundle;
connection->handler = handler;
connection->flags = flags;
+ if (intf && (intf->quirks & GB_INTERFACE_QUIRK_NO_CPORT_FEATURES))
+ connection->flags |= GB_CONNECTION_FLAG_NO_FLOWCTRL;
connection->state = GB_CONNECTION_STATE_DISABLED;
atomic_set(&connection->op_cycle, 0);
intf = connection->intf;
/*
- * Enable either E2EFC or CSD, unless the interface does not support
- * any CPort features.
+ * Enable either E2EFC or CSD, unless no flow control is requested.
*/
cport_flags = GB_SVC_CPORT_FLAG_CSV_N;
- if (intf->quirks & GB_INTERFACE_QUIRK_NO_CPORT_FEATURES) {
+ if (gb_connection_flow_control_disabled(connection)) {
cport_flags |= GB_SVC_CPORT_FLAG_CSD_N;
} else if (gb_connection_e2efc_enabled(connection)) {
cport_flags |= GB_SVC_CPORT_FLAG_CSD_N |
#include <linux/kfifo.h>
#define GB_CONNECTION_FLAG_CSD BIT(0)
+#define GB_CONNECTION_FLAG_NO_FLOWCTRL BIT(1)
enum gb_connection_state {
GB_CONNECTION_STATE_INVALID = 0,
return !(connection->flags & GB_CONNECTION_FLAG_CSD);
}
+static inline bool
+gb_connection_flow_control_disabled(struct gb_connection *connection)
+{
+ return connection->flags & GB_CONNECTION_FLAG_NO_FLOWCTRL;
+}
+
static inline void *gb_connection_get_data(struct gb_connection *connection)
{
return connection->private;