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
114 * struct keyboard_protocol - keyboard message.
115 * message.type = 0x0110, message.length = 0x000a
122 * @crc16: crc over the whole message struct (message header +
150 * @crc16: on last finger: crc over the whole message struct
151 * (i.e. message header + this struct) minus the last
172 * struct touchpad_protocol - touchpad message.
173 * message.type = 0x0210
195 * message.type = 0x1020, message.length = 0x0000
197 * @crc16: crc over the whole message struct (message header +
206 * message.type = 0x1020, message.length = 0x006e
213 * @crc16: crc over the whole message struct (message header +
226 * message.type = 0x0252, message.length = 0x0002
229 * @crc16: crc over the whole message struct (message header +
239 * message.type = 0x0151, message.length = 0x0002
243 * @crc16: crc over the whole message struct (message header +
254 * message.type = 0xB051, message.length = 0x0006
259 * @crc16: crc over the whole message struct (message header +
270 * struct message - a complete spi message.
272 * Each message begins with fixed header, followed by a message-type specific
277 * @type: the message type
279 * @counter: incremented on each message, rolls over after 255; there is a
280 * separate counter for each message type.
286 * @length: length of the remainder of the data in the whole message
289 * of the message struct is therefore @length + 10.
291 * @keyboard: Keyboard message
292 * @touchpad: Touchpad message
300 struct message { struct
323 * the (parts of the) message in the data. But note that this does not argument
324 * necessarily contain a complete message, as in some cases (e.g. many
325 * fingers pressed) the message is split over multiple packets (see the
328 * message.
334 * message; i.e. > 0 indicates this is a continuation packet (in
335 * the second packet for a message split over multiple packets
337 * @remaining: number of message bytes remaining in subsequents packets (in
338 * the first packet of a message split over two packets this would
341 * @data: all or part of a message
344 * contrast to the crc in the message).
583 * All we need here is a delay at the beginning of the message before in applespi_setup_write_txfrs()
611 struct spi_message *message, void (*complete)(void *)) in applespi_async() argument
613 message->complete = complete; in applespi_async()
614 message->context = applespi; in applespi_async()
616 return spi_async(applespi->spi, message); in applespi_async()
753 * response message either. in applespi_async_write_complete()
764 struct message *message = (struct message *)packet->data; in applespi_send_cmd_msg() local
796 message->type = cpu_to_le16(0x1020); in applespi_send_cmd_msg()
797 msg_len = sizeof(message->tp_info_command); in applespi_send_cmd_msg()
799 message->zero = 0x02; in applespi_send_cmd_msg()
800 message->rsp_buf_len = cpu_to_le16(0x0200); in applespi_send_cmd_msg()
809 message->type = cpu_to_le16(0x0252); in applespi_send_cmd_msg()
810 msg_len = sizeof(message->init_mt_command); in applespi_send_cmd_msg()
812 message->init_mt_command.cmd = cpu_to_le16(0x0102); in applespi_send_cmd_msg()
822 message->type = cpu_to_le16(0x0151); in applespi_send_cmd_msg()
823 msg_len = sizeof(message->capsl_command); in applespi_send_cmd_msg()
825 message->capsl_command.unknown = 0x01; in applespi_send_cmd_msg()
826 message->capsl_command.led = applespi->have_cl_led_on ? 2 : 0; in applespi_send_cmd_msg()
836 message->type = cpu_to_le16(0xB051); in applespi_send_cmd_msg()
837 msg_len = sizeof(message->bl_command); in applespi_send_cmd_msg()
839 message->bl_command.const1 = cpu_to_le16(0x01B0); in applespi_send_cmd_msg()
840 message->bl_command.level = in applespi_send_cmd_msg()
844 message->bl_command.const2 = cpu_to_le16(0x01F4); in applespi_send_cmd_msg()
846 message->bl_command.const2 = cpu_to_le16(0x0001); in applespi_send_cmd_msg()
858 message->counter = applespi->cmd_msg_cntr++ % (U8_MAX + 1); in applespi_send_cmd_msg()
860 message->length = cpu_to_le16(msg_len - 2); in applespi_send_cmd_msg()
861 if (!message->rsp_buf_len) in applespi_send_cmd_msg()
862 message->rsp_buf_len = message->length; in applespi_send_cmd_msg()
864 crc = crc16(0, (u8 *)message, le16_to_cpu(packet->length) - 2); in applespi_send_cmd_msg()
865 put_unaligned_le16(crc, &message->data[msg_len - 2]); in applespi_send_cmd_msg()
1337 struct message *message) in applespi_handle_cmd_response() argument
1340 le16_to_cpu(message->type) == 0x1020) { in applespi_handle_cmd_response()
1345 applespi->rcvd_tp_info = message->tp_info; in applespi_handle_cmd_response()
1350 if (le16_to_cpu(message->length) != 0x0000) { in applespi_handle_cmd_response()
1353 le16_to_cpu(message->length)); in applespi_handle_cmd_response()
1358 le16_to_cpu(message->type) == 0x0252 && in applespi_handle_cmd_response()
1359 le16_to_cpu(message->rsp_buf_len) == 0x0002) in applespi_handle_cmd_response()
1403 struct message *message; in applespi_got_data() local
1450 "Received message too large (size %u)\n", in applespi_got_data()
1457 "Received message too large (size %u)\n", in applespi_got_data()
1468 message = (struct message *)applespi->msg_buf; in applespi_got_data()
1471 message = (struct message *)&packet->data; in applespi_got_data()
1475 /* got complete message - verify */ in applespi_got_data()
1476 if (!applespi_verify_crc(applespi, (u8 *)message, msg_len)) in applespi_got_data()
1479 if (le16_to_cpu(message->length) != msg_len - MSG_HEADER_SIZE - 2) { in applespi_got_data()
1481 "Received corrupted packet (invalid message length %u - expected %u)\n", in applespi_got_data()
1482 le16_to_cpu(message->length), in applespi_got_data()
1487 /* handle message */ in applespi_got_data()
1490 applespi_handle_keyboard_event(applespi, &message->keyboard); in applespi_got_data()
1497 tp = &message->touchpad; in applespi_got_data()
1500 if (le16_to_cpu(message->length) + 2 != tp_len) { in applespi_got_data()
1502 "Received corrupted packet (invalid message length %u - num-fingers %u, tp-len %zu)\n", in applespi_got_data()
1503 le16_to_cpu(message->length), in applespi_got_data()
1519 applespi_handle_cmd_response(applespi, packet, message); in applespi_got_data()