Lines Matching defs:packet

100 #define ALPS_PS2_INTERLEAVED	0x80	/* 3-byte PS/2 packet interleaved with
101 6-byte ALPS packet */
251 unsigned char *packet = psmouse->packet;
258 left = packet[2] & 0x10;
259 right = packet[2] & 0x08;
261 x = packet[1] | ((packet[0] & 0x07) << 7);
262 y = packet[4] | ((packet[3] & 0x07) << 7);
263 z = packet[5];
265 left = packet[3] & 1;
266 right = packet[3] & 2;
267 middle = packet[3] & 4;
268 x = packet[1] | ((packet[2] & 0x78) << (7 - 3));
269 y = packet[4] | ((packet[3] & 0x70) << (7 - 4));
270 z = packet[5];
274 back = packet[0] & 0x10;
275 forward = packet[2] & 4;
279 back = packet[3] & 4;
280 forward = packet[2] & 4;
285 ges = packet[2] & 1;
286 fin = packet[2] & 2;
300 left |= packet[0] & 1;
301 right |= packet[0] & 2;
302 middle |= packet[0] & 4;
339 input_report_rel(dev, REL_WHEEL, ((packet[2] << 1) & 0x08) - ((packet[0] >> 4) & 0x07));
347 input_report_key(dev, BTN_0, packet[2] & 4);
348 input_report_key(dev, BTN_1, packet[0] & 0x10);
349 input_report_key(dev, BTN_2, packet[3] & 4);
350 input_report_key(dev, BTN_3, packet[0] & 0x20);
558 unsigned char *packet = psmouse->packet;
562 /* It should be a DualPoint when received trackstick packet */
565 "Rejected trackstick packet from non DualPoint device");
569 /* Sanity check packet */
570 if (!(packet[0] & 0x40)) {
571 psmouse_dbg(psmouse, "Bad trackstick packet, discarding\n");
576 * There's a special packet that seems to indicate the end
579 if (packet[1] == 0x7f && packet[2] == 0x7f && packet[4] == 0x7f)
582 x = (s8)(((packet[0] & 0x20) << 2) | (packet[1] & 0x7f));
583 y = (s8)(((packet[0] & 0x10) << 3) | (packet[2] & 0x7f));
584 z = packet[4] & 0x7f;
603 * packet.
605 left = packet[3] & 0x01;
606 right = packet[3] & 0x02;
607 middle = packet[3] & 0x04;
728 unsigned char *packet = psmouse->packet;
735 priv->decode_fields(f, packet, psmouse);
740 * that a bitmap packet should always follow a position packet with
741 * bit 6 of packet[4] set.
745 * Sometimes a position packet will indicate a multi-packet
747 * packet. Check for this, and when it happens process the
748 * position packet as usual.
753 * Bitmap processing uses position packet's coordinate
777 memcpy(priv->multi_data, packet, sizeof(priv->multi_data));
784 * Sometimes the hardware sends a single packet with z = 0
805 unsigned char *packet = psmouse->packet;
815 if (packet[5] == 0x3f) {
826 unsigned char *packet = psmouse->packet;
832 * We can use Byte5 to distinguish if the packet is from Touchpad
837 if (packet[5] == 0x7F) {
838 /* It should be a DualPoint when received Trackpoint packet */
841 "Rejected trackstick packet from non DualPoint device");
845 /* Trackpoint packet */
846 x = packet[1] | ((packet[3] & 0x20) << 2);
847 y = packet[2] | ((packet[3] & 0x40) << 1);
848 z = packet[4];
858 psmouse_report_standard_buttons(dev2, packet[3]);
864 /* Touchpad packet */
865 x = packet[1] | ((packet[3] & 0x78) << 4);
866 y = packet[2] | ((packet[4] & 0x78) << 4);
867 z = packet[5];
883 packet[3] &= ~BIT(2);
884 psmouse_report_standard_buttons(dev2, packet[3]);
892 unsigned char *packet = psmouse->packet;
899 * track our position in the bitmap packet.
901 if (packet[6] & 0x40) {
910 priv->multi_data[offset] = packet[6];
911 priv->multi_data[offset + 1] = packet[7];
913 f->left = !!(packet[4] & 0x01);
914 f->right = !!(packet[4] & 0x02);
916 f->st.x = ((packet[1] & 0x7f) << 4) | ((packet[3] & 0x30) >> 2) |
917 ((packet[0] & 0x30) >> 4);
918 f->st.y = ((packet[2] & 0x7f) << 4) | (packet[3] & 0x0f);
919 f->pressure = packet[5] & 0x7f;
942 return (psmouse->packet[2] & 0x40) == 0x40;
944 return (psmouse->packet[3] & 0x48) == 0x48;
946 return (psmouse->packet[5] & 0x40) == 0x00;
1050 * touch coordinates we've available in the NEW packet
1053 * non NEW packet comes in
1091 unsigned char *packet = psmouse->packet;
1095 /* It should be a DualPoint when received trackstick packet */
1098 "Rejected trackstick packet from non DualPoint device");
1102 x = ((packet[2] & 0xbf)) | ((packet[3] & 0x10) << 2);
1103 y = (packet[3] & 0x07) | (packet[4] & 0xb8) |
1104 ((packet[3] & 0x20) << 1);
1105 z = (packet[5] & 0x3f) | ((packet[3] & 0x80) >> 1);
1111 psmouse_report_standard_buttons(dev2, packet[1]);
1124 if (priv->decode_fields(f, psmouse->packet, psmouse))
1140 unsigned char *packet = psmouse->packet;
1142 if (packet[0] == 0x48 && (packet[4] & 0x47) == 0x06)
1186 /* Current packet is 1Finger coordinate packet */
1317 unsigned char *packet = psmouse->packet;
1323 priv->decode_fields(f, packet, psmouse);
1326 * Sometimes the first packet will indicate a multi-packet
1327 * sequence, but sometimes the next multi-packet would not
1329 * position packet as usual.
1332 /* Now process the 1st packet */
1340 * "f.is_mp" would always be '0' after merging the 1st and 2nd packet.
1341 * When it is set, it means 2nd packet comes without 1st packet come.
1346 /* Save the first packet */
1349 memcpy(priv->multi_data, packet, sizeof(priv->multi_data));
1356 if (alps_get_pkt_id_ss4_v2(packet) == SS4_PACKET_ID_STICK) {
1359 "Rejected trackstick packet from non DualPoint device");
1363 input_report_rel(dev2, REL_X, SS4_TS_X_V2(packet));
1364 input_report_rel(dev2, REL_Y, SS4_TS_Y_V2(packet));
1365 input_report_abs(dev2, ABS_PRESSURE, SS4_TS_Z_V2(packet));
1390 if (psmouse->pktcnt == 4 && ((psmouse->packet[3] & 0x08) != 0x08))
1392 if (psmouse->pktcnt == 6 && ((psmouse->packet[5] & 0x10) != 0x0))
1467 unsigned char packet[],
1473 /* Figure out which device to use to report the bare packet */
1480 /* Register dev3 mouse if we received PS/2 packet first time */
1491 packet[0] & 1, packet[0] & 2, packet[0] & 4);
1493 psmouse_report_standard_motion(dev, packet);
1507 * Start a timer to flush the packet if it ends up last
1508 * 6-byte packet in the stream. Timer needs to fire
1518 if (psmouse->packet[6] & 0x80) {
1522 * complete ALPS packet and this is start of the
1523 * next packet or we got garbage.
1526 if (((psmouse->packet[3] |
1527 psmouse->packet[4] |
1528 psmouse->packet[5]) & 0x80) ||
1529 (!alps_is_valid_first_byte(priv, psmouse->packet[6]))) {
1531 "refusing packet %4ph (suspected interleaved ps/2)\n",
1532 psmouse->packet + 3);
1538 /* Continue with the next packet */
1539 psmouse->packet[0] = psmouse->packet[6];
1546 * packet in the middle of ALPS packet.
1549 * packet followed by 3-byte packet from trackpoint. We
1560 alps_report_bare_ps2_packet(psmouse, &psmouse->packet[3],
1566 * packet again, which may happen if all buttons are
1570 psmouse->packet[3] = psmouse->packet[6] & 0xf7;
1589 * ALPS packet.
1591 if ((psmouse->packet[3] |
1592 psmouse->packet[4] |
1593 psmouse->packet[5]) & 0x80) {
1595 "refusing packet %3ph (suspected interleaved ps/2)\n",
1596 psmouse->packet + 3);
1611 * Check if we are dealing with a bare PS/2 packet, presumably from
1615 * Can not distinguish V8's first byte from PS/2 packet's
1619 (psmouse->packet[0] & 0xc8) == 0x08) {
1622 alps_report_bare_ps2_packet(psmouse, psmouse->packet,
1629 /* Check for PS/2 packet stuffed in the middle of ALPS packet. */
1632 psmouse->pktcnt >= 4 && (psmouse->packet[3] & 0x0f) == 0x0f) {
1636 if (!alps_is_valid_first_byte(priv, psmouse->packet[0])) {
1638 "refusing packet[0] = %x (mask0 = %x, byte0 = %x)\n",
1639 psmouse->packet[0], priv->mask0, priv->byte0);
1646 (psmouse->packet[psmouse->pktcnt - 1] & 0x80)) {
1647 psmouse_dbg(psmouse, "refusing packet[%i] = %x\n",
1649 psmouse->packet[psmouse->pktcnt - 1]);
1656 * otherwise valid packet with 0xff. Given that the
1657 * next packet is very likely to be valid let's
1672 psmouse_dbg(psmouse, "refusing packet[%i] = %x\n",
1674 psmouse->packet[psmouse->pktcnt - 1]);
1984 * alps_poll() - poll the touchpad for current motion packet.
1990 unsigned char buf[sizeof(psmouse->packet)];
2013 memcpy(psmouse->packet, buf, sizeof(buf));
2204 * If bit 1 isn't set the packet format is different.
2707 /* T.B.D. Decread noise packet number, delete in the future */