Lines Matching defs:packet

262  * Dump a complete mouse movement packet to the syslog
266 psmouse_printk(KERN_DEBUG, psmouse, "PS/2 packet [%*ph]\n",
267 psmouse->pktsize, psmouse->packet);
324 unsigned char *packet = psmouse->packet;
332 fingers = ((packet[1] & 0x80) >> 7) +
333 ((packet[1] & 0x30) >> 4);
339 fingers = (packet[0] & 0xc0) >> 6;
348 elantech_debug("discarding packet\n");
361 ((packet[1] & 0x0c) << 6) | packet[2]);
363 etd->y_max - (((packet[1] & 0x03) << 8) | packet[3]));
370 psmouse_report_standard_buttons(dev, packet[0]);
375 input_report_key(dev, BTN_FORWARD, packet[0] & 0x40);
377 input_report_key(dev, BTN_BACK, packet[0] & 0x80);
412 unsigned char *packet = psmouse->packet;
417 fingers = (packet[0] & 0xc0) >> 6;
425 if (packet[3] & 0x80)
433 x1 = ((packet[1] & 0x0f) << 8) | packet[2];
438 y1 = etd->y_max - (((packet[4] & 0x0f) << 8) | packet[5]);
440 pres = (packet[1] & 0xf0) | ((packet[4] & 0xf0) >> 4);
441 width = ((packet[0] & 0x30) >> 2) | ((packet[3] & 0x30) >> 4);
451 x1 = (((packet[0] & 0x10) << 4) | packet[1]) << 2;
454 ((((packet[0] & 0x20) << 3) | packet[2]) << 2);
459 x2 = (((packet[3] & 0x10) << 4) | packet[4]) << 2;
462 ((((packet[3] & 0x20) << 3) | packet[5]) << 2);
480 psmouse_report_standard_buttons(dev, packet[0]);
509 unsigned char *packet = psmouse->packet;
513 t = get_unaligned_le32(&packet[0]);
526 if (packet[4] == 0x80 || packet[5] == 0x80 ||
527 packet[1] >> 7 == packet[4] >> 7 ||
528 packet[2] >> 7 == packet[5] >> 7) {
529 elantech_debug("discarding packet [%6ph]\n", packet);
533 x = packet[4] - (int)((packet[1]^0x80) << 1);
534 y = (int)((packet[2]^0x80) << 1) - packet[5];
536 psmouse_report_standard_buttons(tp_dev, packet[0]);
546 /* Dump unexpected packet sequences if debug=1 (default) */
563 unsigned char *packet = psmouse->packet;
568 fingers = (packet[0] & 0xc0) >> 6;
577 x1 = ((packet[1] & 0x0f) << 8) | packet[2];
582 y1 = etd->y_max - (((packet[4] & 0x0f) << 8) | packet[5]);
591 etd->mt[0].x = ((packet[1] & 0x0f) << 8) | packet[2];
597 (((packet[4] & 0x0f) << 8) | packet[5]);
599 * wait for next packet
607 x2 = ((packet[1] & 0x0f) << 8) | packet[2];
608 y2 = etd->y_max - (((packet[4] & 0x0f) << 8) | packet[5]);
612 pres = (packet[1] & 0xf0) | ((packet[4] & 0xf0) >> 4);
613 width = ((packet[0] & 0x30) >> 2) | ((packet[3] & 0x30) >> 4);
627 input_report_key(dev, BTN_LEFT, packet[0] & 0x03);
629 psmouse_report_standard_buttons(dev, packet[0]);
641 unsigned char *packet = psmouse->packet;
645 input_report_key(dev, BTN_LEFT, packet[0] & 0x03);
647 psmouse_report_standard_buttons(dev, packet[0]);
656 unsigned char *packet = psmouse->packet;
661 fingers = packet[1] & 0x1f;
676 unsigned char *packet = psmouse->packet;
680 id = ((packet[3] & 0xe0) >> 5) - 1;
684 etd->mt[id].x = ((packet[1] & 0x0f) << 8) | packet[2];
685 etd->mt[id].y = etd->y_max - (((packet[4] & 0x0f) << 8) | packet[5]);
686 pres = (packet[1] & 0xf0) | ((packet[4] & 0xf0) >> 4);
687 traces = (packet[0] & 0xf0) >> 4;
706 unsigned char *packet = psmouse->packet;
710 id = ((packet[0] & 0xe0) >> 5) - 1;
714 sid = ((packet[3] & 0xe0) >> 5) - 1;
715 weight = (packet[0] & 0x10) ? ETP_WEIGHT_VALUE : 1;
721 delta_x1 = (signed char)packet[1];
722 delta_y1 = (signed char)packet[2];
723 delta_x2 = (signed char)packet[4];
724 delta_y2 = (signed char)packet[5];
769 unsigned char *packet = psmouse->packet;
775 p1 = (packet[0] & 0x20) >> 5;
776 p2 = (packet[0] & 0x10) >> 4;
779 p1 = (packet[0] & 0x10) >> 4;
780 p2 = (packet[0] & 0x20) >> 5;
783 p3 = (packet[0] & 0x04) >> 2;
785 return etd->parity[packet[1]] == p1 &&
786 etd->parity[packet[2]] == p2 &&
787 etd->parity[packet[3]] == p3;
793 * When we encounter packet that matches this exactly, it means the
794 * hardware is in debounce status. Just ignore the whole packet.
799 unsigned char *packet = psmouse->packet;
801 return !memcmp(packet, debounce_packet, sizeof(debounce_packet));
807 unsigned char *packet = psmouse->packet;
819 return (packet[0] & 0x0c) == 0x04 &&
820 (packet[3] & 0x0f) == 0x02;
822 if ((packet[0] & 0xc0) == 0x80)
823 return (packet[0] & 0x0c) == 0x0c &&
824 (packet[3] & 0x0e) == 0x08;
826 return (packet[0] & 0x3c) == 0x3c &&
827 (packet[1] & 0xf0) == 0x00 &&
828 (packet[3] & 0x3e) == 0x38 &&
829 (packet[4] & 0xf0) == 0x00;
833 * We check the constant bits to determine what packet type we get,
834 * so packet checking is mandatory for v3 and later hardware.
842 unsigned char *packet = psmouse->packet;
848 if (!memcmp(packet, debounce_packet, sizeof(debounce_packet)))
856 if ((packet[3] & 0x09) == 0x08)
859 if ((packet[3] & 0x09) == 0x09)
862 if ((packet[0] & 0x0c) == 0x04 && (packet[3] & 0xcf) == 0x02)
865 if ((packet[0] & 0x0c) == 0x0c && (packet[3] & 0xce) == 0x0c)
867 if ((packet[3] & 0x0f) == 0x06)
877 unsigned char *packet = psmouse->packet;
878 unsigned char packet_type = packet[3] & 0x03;
882 if (etd->tp_dev && (packet[3] & 0x0f) == 0x06)
889 * Sanity check based on the constant bits of a packet.
892 * the IC body, but are the same for every packet,
896 sanity_check = ((packet[3] & 0x08) == 0x00);
898 sanity_check = ((packet[3] & 0x1c) == 0x10);
900 sanity_check = ((packet[0] & 0x08) == 0x00 &&
901 (packet[3] & 0x1c) == 0x10);
1646 /* Turn on packet checking by default */