Lines Matching defs: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)
217 struct gb_connection *connection = message->operation->connection;
219 trace_gb_message_send(message);
222 message,
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)
231 struct gb_host_device *hd = message->operation->connection->hd;
233 hd->driver->message_cancel(message);
284 /* Cancel request message if scheduled by timeout. */
302 * A stuck request message will be cancelled from the
310 struct gb_message *message,
316 header = message->buffer;
318 message->header = header;
319 message->payload = payload_size ? header + 1 : NULL;
320 message->payload_size = payload_size;
323 * The type supplied for incoming message buffers will be
325 * arriving data so there's no need to initialize the message header.
332 * when the message is sent. For a response, it
335 * The result field in a request message must be
347 * Allocate a message to be used for an operation request or response.
348 * Both types of message contain a common header. The request message
349 * for an outgoing operation is outbound, as is the response message
350 * for an incoming operation. The message header for an outbound
351 * message is partially initialized here.
356 * Our message buffers have the following layout:
357 * message header \_ these combined are
358 * message payload / the message size
364 struct gb_message *message;
369 dev_warn(&hd->dev, "requested message size too big (%zu > %zu)\n",
374 /* Allocate the message structure and buffer. */
375 message = kmem_cache_zalloc(gb_message_cache, gfp_flags);
376 if (!message)
379 message->buffer = kzalloc(message_size, gfp_flags);
380 if (!message->buffer)
383 /* Initialize the message. Operation id is filled in later. */
384 gb_operation_message_init(hd, message, 0, payload_size, type);
386 return message;
389 kmem_cache_free(gb_message_cache, message);
394 static void gb_operation_message_free(struct gb_message *message)
396 kfree(message->buffer);
397 kmem_cache_free(gb_message_cache, message);
402 * message as a single byte) to an appropriate Linux negative errno.
435 * that should represent it in a response message status sent
437 * is represented in a message as a single byte).
483 * Size and type get initialized when the message is
486 * request message header (as-is, in little-endian order).
501 * For outgoing requests, the request message's header will be
502 * initialized with the type of the request and the message size.
505 * response message header will eventually be overwritten, so there's
511 * no need to initialize the message header. Responsibility for
637 /* Caller has made sure we at least have a message header. */
704 * gb_operation_request_send() - send an operation request message
710 * The caller has filled in any payload so the request message is ready to go.
711 * The callback function supplied will be called when the response message has
819 * responsible for allocating the response message. Otherwise the
821 * allocate the response message if necessary.
845 /* Reference will be dropped when message has been sent. */
869 * This function is called when a message send request has completed.
872 struct gb_message *message, int status)
874 struct gb_operation *operation = message->operation;
878 * If the message was a response, we just need to drop our
888 if (message == operation->response) {
951 * message. Look up the operation, and record that we've received
962 struct gb_message *message;
985 message = operation->response;
986 message_size = sizeof(*header) + message->payload_size;
995 message->payload_size = size - sizeof(*header);
1011 memcpy(message->buffer, data, size);
1013 trace_gb_message_recv_response(message);
1041 dev_err_ratelimited(dev, "%s: short message received\n",
1051 "%s: incomplete message 0x%04x of type 0x%02x received (%zu < %zu)\n",
1127 * operation response message has been successfully received, or an error
1185 * Initiate a unidirectional operation by sending a request message and