Lines Matching full:message
29 * The device and driver exchange messages (struct message); each message is
32 * message can be read from the device. A write exchange consists of writing a
33 * command message, immediately reading a short status packet, and then, upon
34 * receiving a GPE, reading the response message. Write exchanges cannot be
36 * write exchange is complete. Whether a received message is part of a read or
39 * A single message may be too large to fit in a single packet (which has a
113 * struct keyboard_protocol - keyboard message.
114 * message.type = 0x0110, message.length = 0x000a
121 * @crc16: crc over the whole message struct (message header +
149 * @crc16: on last finger: crc over the whole message struct
150 * (i.e. message header + this struct) minus the last
171 * struct touchpad_protocol - touchpad message.
172 * message.type = 0x0210
194 * message.type = 0x1020, message.length = 0x0000
196 * @crc16: crc over the whole message struct (message header +
205 * message.type = 0x1020, message.length = 0x006e
212 * @crc16: crc over the whole message struct (message header +
225 * message.type = 0x0252, message.length = 0x0002
228 * @crc16: crc over the whole message struct (message header +
238 * message.type = 0x0151, message.length = 0x0002
242 * @crc16: crc over the whole message struct (message header +
253 * message.type = 0xB051, message.length = 0x0006
258 * @crc16: crc over the whole message struct (message header +
269 * struct message - a complete spi message.
271 * Each message begins with fixed header, followed by a message-type specific
276 * @type: the message type
278 * @counter: incremented on each message, rolls over after 255; there is a
279 * separate counter for each message type.
285 * @length: length of the remainder of the data in the whole message
288 * of the message struct is therefore @length + 10.
290 struct message { struct
313 * the (parts of the) message in the data. But note that this does not argument
314 * necessarily contain a complete message, as in some cases (e.g. many
315 * fingers pressed) the message is split over multiple packets (see the
318 * message.
324 * message; i.e. > 0 indicates this is a continuation packet (in
325 * the second packet for a message split over multiple packets
327 * @remaining: number of message bytes remaining in subsequents packets (in
328 * the first packet of a message split over two packets this would
331 * @data: all or part of a message
334 * contrast to the crc in the message).
572 * All we need here is a delay at the beginning of the message before in applespi_setup_write_txfrs()
597 struct spi_message *message, void (*complete)(void *)) in applespi_async() argument
599 message->complete = complete; in applespi_async()
600 message->context = applespi; in applespi_async()
602 return spi_async(applespi->spi, message); in applespi_async()
741 * response message either. in applespi_async_write_complete()
752 struct message *message = (struct message *)packet->data; in applespi_send_cmd_msg() local
776 message->type = cpu_to_le16(0x1020); in applespi_send_cmd_msg()
777 msg_len = sizeof(message->tp_info_command); in applespi_send_cmd_msg()
779 message->zero = 0x02; in applespi_send_cmd_msg()
780 message->rsp_buf_len = cpu_to_le16(0x0200); in applespi_send_cmd_msg()
789 message->type = cpu_to_le16(0x0252); in applespi_send_cmd_msg()
790 msg_len = sizeof(message->init_mt_command); in applespi_send_cmd_msg()
792 message->init_mt_command.cmd = cpu_to_le16(0x0102); in applespi_send_cmd_msg()
802 message->type = cpu_to_le16(0x0151); in applespi_send_cmd_msg()
803 msg_len = sizeof(message->capsl_command); in applespi_send_cmd_msg()
805 message->capsl_command.unknown = 0x01; in applespi_send_cmd_msg()
806 message->capsl_command.led = applespi->have_cl_led_on ? 2 : 0; in applespi_send_cmd_msg()
816 message->type = cpu_to_le16(0xB051); in applespi_send_cmd_msg()
817 msg_len = sizeof(message->bl_command); in applespi_send_cmd_msg()
819 message->bl_command.const1 = cpu_to_le16(0x01B0); in applespi_send_cmd_msg()
820 message->bl_command.level = in applespi_send_cmd_msg()
824 message->bl_command.const2 = cpu_to_le16(0x01F4); in applespi_send_cmd_msg()
826 message->bl_command.const2 = cpu_to_le16(0x0001); in applespi_send_cmd_msg()
838 message->counter = applespi->cmd_msg_cntr++ % (U8_MAX + 1); in applespi_send_cmd_msg()
840 message->length = cpu_to_le16(msg_len - 2); in applespi_send_cmd_msg()
841 if (!message->rsp_buf_len) in applespi_send_cmd_msg()
842 message->rsp_buf_len = message->length; in applespi_send_cmd_msg()
844 crc = crc16(0, (u8 *)message, le16_to_cpu(packet->length) - 2); in applespi_send_cmd_msg()
845 put_unaligned_le16(crc, &message->data[msg_len - 2]); in applespi_send_cmd_msg()
1332 struct message *message) in applespi_handle_cmd_response() argument
1335 le16_to_cpu(message->type) == 0x1020) { in applespi_handle_cmd_response()
1340 applespi->rcvd_tp_info = message->tp_info; in applespi_handle_cmd_response()
1345 if (le16_to_cpu(message->length) != 0x0000) { in applespi_handle_cmd_response()
1348 le16_to_cpu(message->length)); in applespi_handle_cmd_response()
1353 le16_to_cpu(message->type) == 0x0252 && in applespi_handle_cmd_response()
1354 le16_to_cpu(message->rsp_buf_len) == 0x0002) in applespi_handle_cmd_response()
1398 struct message *message; in applespi_got_data() local
1449 "Received message too large (size %u)\n", in applespi_got_data()
1456 "Received message too large (size %u)\n", in applespi_got_data()
1467 message = (struct message *)applespi->msg_buf; in applespi_got_data()
1470 message = (struct message *)&packet->data; in applespi_got_data()
1474 /* got complete message - verify */ in applespi_got_data()
1475 if (!applespi_verify_crc(applespi, (u8 *)message, msg_len)) in applespi_got_data()
1478 if (le16_to_cpu(message->length) != msg_len - MSG_HEADER_SIZE - 2) { in applespi_got_data()
1480 "Received corrupted packet (invalid message length %u - expected %u)\n", in applespi_got_data()
1481 le16_to_cpu(message->length), in applespi_got_data()
1486 /* handle message */ in applespi_got_data()
1489 applespi_handle_keyboard_event(applespi, &message->keyboard); in applespi_got_data()
1496 tp = &message->touchpad; in applespi_got_data()
1499 if (le16_to_cpu(message->length) + 2 != tp_len) { in applespi_got_data()
1501 "Received corrupted packet (invalid message length %u - num-fingers %u, tp-len %zu)\n", in applespi_got_data()
1502 le16_to_cpu(message->length), in applespi_got_data()
1518 applespi_handle_cmd_response(applespi, packet, message); in applespi_got_data()