Lines Matching full:message
113 * If no error occurs before sending the request message the only
215 static int gb_message_send(struct gb_message *message, gfp_t gfp) in gb_message_send() argument
217 struct gb_connection *connection = message->operation->connection; in gb_message_send()
219 trace_gb_message_send(message); in gb_message_send()
222 message, in gb_message_send()
227 * Cancel a message we have passed to the host device layer to be sent.
229 static void gb_message_cancel(struct gb_message *message) in gb_message_cancel() argument
231 struct gb_host_device *hd = message->operation->connection->hd; in gb_message_cancel()
233 hd->driver->message_cancel(message); in gb_message_cancel()
284 /* Cancel request message if scheduled by timeout. */ in gb_operation_work()
303 * A stuck request message will be cancelled from the in gb_operation_timeout()
311 struct gb_message *message, in gb_operation_message_init() argument
317 header = message->buffer; in gb_operation_message_init()
319 message->header = header; in gb_operation_message_init()
320 message->payload = payload_size ? header + 1 : NULL; in gb_operation_message_init()
321 message->payload_size = payload_size; in gb_operation_message_init()
324 * The type supplied for incoming message buffers will be in gb_operation_message_init()
326 * arriving data so there's no need to initialize the message header. in gb_operation_message_init()
333 * when the message is sent. For a response, it in gb_operation_message_init()
336 * The result field in a request message must be in gb_operation_message_init()
348 * Allocate a message to be used for an operation request or response.
349 * Both types of message contain a common header. The request message
350 * for an outgoing operation is outbound, as is the response message
351 * for an incoming operation. The message header for an outbound
352 * message is partially initialized here.
357 * Our message buffers have the following layout:
358 * message header \_ these combined are
359 * message payload / the message size
365 struct gb_message *message; in gb_operation_message_alloc() local
370 dev_warn(&hd->dev, "requested message size too big (%zu > %zu)\n", in gb_operation_message_alloc()
375 /* Allocate the message structure and buffer. */ in gb_operation_message_alloc()
376 message = kmem_cache_zalloc(gb_message_cache, gfp_flags); in gb_operation_message_alloc()
377 if (!message) in gb_operation_message_alloc()
380 message->buffer = kzalloc(message_size, gfp_flags); in gb_operation_message_alloc()
381 if (!message->buffer) in gb_operation_message_alloc()
384 /* Initialize the message. Operation id is filled in later. */ in gb_operation_message_alloc()
385 gb_operation_message_init(hd, message, 0, payload_size, type); in gb_operation_message_alloc()
387 return message; in gb_operation_message_alloc()
390 kmem_cache_free(gb_message_cache, message); in gb_operation_message_alloc()
395 static void gb_operation_message_free(struct gb_message *message) in gb_operation_message_free() argument
397 kfree(message->buffer); in gb_operation_message_free()
398 kmem_cache_free(gb_message_cache, message); in gb_operation_message_free()
403 * message as a single byte) to an appropriate Linux negative errno.
436 * that should represent it in a response message status sent
438 * is represented in a message as a single byte).
484 * Size and type get initialized when the message is in gb_operation_response_alloc()
487 * request message header (as-is, in little-endian order). in gb_operation_response_alloc()
502 * For outgoing requests, the request message's header will be
503 * initialized with the type of the request and the message size.
506 * response message header will eventually be overwritten, so there's
512 * no need to initialize the message header. Responsibility for
638 /* Caller has made sure we at least have a message header. */ in gb_operation_create_incoming()
705 * gb_operation_request_send() - send an operation request message
711 * The caller has filled in any payload so the request message is ready to go.
712 * The callback function supplied will be called when the response message has
820 * responsible for allocating the response message. Otherwise the
822 * allocate the response message if necessary.
846 /* Reference will be dropped when message has been sent. */ in gb_operation_response_send()
870 * This function is called when a message send request has completed.
873 struct gb_message *message, int status) in greybus_message_sent() argument
875 struct gb_operation *operation = message->operation; in greybus_message_sent()
879 * If the message was a response, we just need to drop our in greybus_message_sent()
889 if (message == operation->response) { in greybus_message_sent()
952 * message. Look up the operation, and record that we've received
963 struct gb_message *message; in gb_connection_recv_response() local
986 message = operation->response; in gb_connection_recv_response()
987 message_size = sizeof(*header) + message->payload_size; in gb_connection_recv_response()
996 message->payload_size = size - sizeof(*header); in gb_connection_recv_response()
1012 memcpy(message->buffer, data, size); in gb_connection_recv_response()
1014 trace_gb_message_recv_response(message); in gb_connection_recv_response()
1042 dev_err_ratelimited(dev, "%s: short message received\n", in gb_connection_recv()
1052 "%s: incomplete message 0x%04x of type 0x%02x received (%zu < %zu)\n", in gb_connection_recv()
1128 * operation response message has been successfully received, or an error
1186 * Initiate a unidirectional operation by sending a request message and