struct gb_connection *
gb_connection_create_control(struct gb_interface *intf)
{
- return _gb_connection_create(intf->hd, -1, intf, NULL, 0, NULL, 0);
+ return _gb_connection_create(intf->hd, -1, intf, NULL, 0, NULL,
+ GB_CONNECTION_FLAG_CONTROL);
}
struct gb_connection *
return 0;
}
- control = connection->intf->control;
-
- if (connection == control->connection)
+ if (gb_connection_is_control(connection))
return 0;
+ control = connection->intf->control;
+
ret = gb_control_connected_operation(control, cport_id);
if (ret) {
dev_err(&connection->bundle->dev,
if (gb_connection_is_static(connection))
return;
- control = connection->intf->control;
-
- if (connection == control->connection)
+ if (gb_connection_is_control(connection))
return;
+ control = connection->intf->control;
+
ret = gb_control_disconnected_operation(control, cport_id);
if (ret) {
dev_warn(&connection->bundle->dev,
#define GB_CONNECTION_FLAG_NO_FLOWCTRL BIT(1)
#define GB_CONNECTION_FLAG_OFFLOADED BIT(2)
#define GB_CONNECTION_FLAG_CDSI1 BIT(3)
+#define GB_CONNECTION_FLAG_CONTROL BIT(4)
enum gb_connection_state {
GB_CONNECTION_STATE_INVALID = 0,
return connection->flags & GB_CONNECTION_FLAG_OFFLOADED;
}
+static inline bool gb_connection_is_control(struct gb_connection *connection)
+{
+ return connection->flags & GB_CONNECTION_FLAG_CONTROL;
+}
+
static inline void *gb_connection_get_data(struct gb_connection *connection)
{
return connection->private;