Lines Matching defs:connection

37  * Increment operation active count and add to connection list unless the
38 * connection is going away.
44 struct gb_connection *connection = operation->connection;
47 spin_lock_irqsave(&connection->lock, flags);
48 switch (connection->state) {
64 list_add_tail(&operation->links, &connection->operations);
68 spin_unlock_irqrestore(&connection->lock, flags);
73 spin_unlock_irqrestore(&connection->lock, flags);
81 struct gb_connection *connection = operation->connection;
84 spin_lock_irqsave(&connection->lock, flags);
93 spin_unlock_irqrestore(&connection->lock, flags);
98 struct gb_connection *connection = operation->connection;
102 spin_lock_irqsave(&connection->lock, flags);
104 spin_unlock_irqrestore(&connection->lock, flags);
192 * Looks up an outgoing operation on a connection and returns a refcounted
196 gb_operation_find_outgoing(struct gb_connection *connection, u16 operation_id)
202 spin_lock_irqsave(&connection->lock, flags);
203 list_for_each_entry(operation, &connection->operations, links)
210 spin_unlock_irqrestore(&connection->lock, flags);
217 struct gb_connection *connection = message->operation->connection;
220 return connection->hd->driver->message_send(connection->hd,
221 connection->hd_cport_id,
231 struct gb_host_device *hd = message->operation->connection->hd;
238 struct gb_connection *connection = operation->connection;
242 if (connection->handler) {
243 status = connection->handler(operation);
245 dev_err(&connection->hd->dev,
247 connection->name, operation->type);
254 dev_err(&connection->hd->dev,
256 connection->name, status, operation->type, ret);
471 struct gb_host_device *hd = operation->connection->hd;
497 * Create a Greybus operation to be sent over the given connection.
519 gb_operation_create_common(struct gb_connection *connection, u8 type,
523 struct gb_host_device *hd = connection->hd;
529 operation->connection = connection;
567 * Create a new operation associated with the given connection. The
575 gb_operation_create_flags(struct gb_connection *connection,
590 operation = gb_operation_create_common(connection, type,
601 gb_operation_create_core(struct gb_connection *connection,
610 operation = gb_operation_create_common(connection, type,
621 size_t gb_operation_get_payload_size_max(struct gb_connection *connection)
623 struct gb_host_device *hd = connection->hd;
630 gb_operation_create_incoming(struct gb_connection *connection, u16 id,
643 operation = gb_operation_create_common(connection, type,
725 struct gb_connection *connection = operation->connection;
730 if (gb_connection_is_offloaded(connection))
750 cycle = (unsigned int)atomic_inc_return(&connection->op_cycle);
826 struct gb_connection *connection = operation->connection;
837 dev_err(&connection->hd->dev, "request result already set\n");
875 struct gb_connection *connection = operation->connection;
890 dev_err(&connection->hd->dev,
892 connection->name, operation->type, status);
907 * We've received data on a connection, and it doesn't look like a
913 static void gb_connection_recv_request(struct gb_connection *connection,
925 operation = gb_operation_create_incoming(connection, operation_id,
928 dev_err(&connection->hd->dev,
930 connection->name);
946 queue_work(connection->wq, &operation->work);
957 static void gb_connection_recv_response(struct gb_connection *connection,
970 dev_err_ratelimited(&connection->hd->dev,
972 connection->name);
976 operation = gb_operation_find_outgoing(connection, operation_id);
978 dev_err_ratelimited(&connection->hd->dev,
980 connection->name, operation_id);
988 dev_err_ratelimited(&connection->hd->dev,
990 connection->name, header->type,
997 dev_err_ratelimited(&connection->hd->dev,
999 connection->name, header->type,
1022 * Handle data arriving on a connection. As soon as we return the
1026 void gb_connection_recv(struct gb_connection *connection,
1030 struct device *dev = &connection->hd->dev;
1033 if (connection->state == GB_CONNECTION_STATE_DISABLED ||
1034 gb_connection_is_offloaded(connection)) {
1036 connection->name, size);
1042 connection->name);
1052 connection->name,
1059 gb_connection_recv_response(connection, &header, data,
1062 gb_connection_recv_request(connection, &header, data,
1090 * Cancel an incoming operation synchronously. Called during connection tear
1117 * @connection: the Greybus connection to send this to
1138 int gb_operation_sync_timeout(struct gb_connection *connection, int type,
1150 operation = gb_operation_create(connection, type,
1161 dev_err(&connection->hd->dev,
1163 connection->name, operation->id, type, ret);
1179 * @connection: connection to use
1189 * the request as actually reached the remote end of the connection.
1191 int gb_operation_unidirectional_timeout(struct gb_connection *connection,
1202 operation = gb_operation_create_flags(connection, type,
1214 dev_err(&connection->hd->dev,
1216 connection->name, type, ret);