Lines Matching defs:packet
41 #define ALPS_PS2_INTERLEAVED 0x80 /* 3-byte PS/2 packet interleaved with
42 6-byte ALPS packet */
73 * PS/2 packet format
90 * Dualpoint device -- interleaved packet format
146 unsigned char *packet = psmouse->packet;
153 left = packet[2] & 0x10;
154 right = packet[2] & 0x08;
156 x = packet[1] | ((packet[0] & 0x07) << 7);
157 y = packet[4] | ((packet[3] & 0x07) << 7);
158 z = packet[5];
160 left = packet[3] & 1;
161 right = packet[3] & 2;
162 middle = packet[3] & 4;
163 x = packet[1] | ((packet[2] & 0x78) << (7 - 3));
164 y = packet[4] | ((packet[3] & 0x70) << (7 - 4));
165 z = packet[5];
169 back = packet[0] & 0x10;
170 forward = packet[2] & 4;
174 back = packet[3] & 4;
175 forward = packet[2] & 4;
180 ges = packet[2] & 1;
181 fin = packet[2] & 2;
227 input_report_rel(dev, REL_WHEEL, ((packet[2] << 1) & 0x08) - ((packet[0] >> 4) & 0x07));
235 input_report_key(dev, BTN_0, packet[2] & 4);
236 input_report_key(dev, BTN_1, packet[0] & 0x10);
237 input_report_key(dev, BTN_2, packet[3] & 4);
238 input_report_key(dev, BTN_3, packet[0] & 0x20);
245 unsigned char packet[],
253 packet[0] & 1, packet[0] & 2, packet[0] & 4);
256 packet[1] ? packet[1] - ((packet[0] << 4) & 0x100) : 0);
258 packet[2] ? ((packet[0] << 3) & 0x100) - packet[2] : 0);
272 * Start a timer to flush the packet if it ends up last
273 * 6-byte packet in the stream. Timer needs to fire
283 if (psmouse->packet[6] & 0x80) {
287 * complete ALPS packet and this is start of the
288 * next packet or we got garbage.
291 if (((psmouse->packet[3] |
292 psmouse->packet[4] |
293 psmouse->packet[5]) & 0x80) ||
294 (!alps_is_valid_first_byte(priv->i, psmouse->packet[6]))) {
295 dbg("refusing packet %x %x %x %x "
297 psmouse->packet[3], psmouse->packet[4],
298 psmouse->packet[5], psmouse->packet[6]);
304 /* Continue with the next packet */
305 psmouse->packet[0] = psmouse->packet[6];
312 * packet in the middle of ALPS packet.
315 * packet followed by 3-byte packet from trackpoint. We
326 alps_report_bare_ps2_packet(psmouse, &psmouse->packet[3],
332 * packet again, which may happen if all buttons are
336 psmouse->packet[3] = psmouse->packet[6] & 0xf7;
354 * ALPS packet.
356 if ((psmouse->packet[3] |
357 psmouse->packet[4] |
358 psmouse->packet[5]) & 0x80) {
359 dbg("refusing packet %x %x %x "
361 psmouse->packet[3], psmouse->packet[4],
362 psmouse->packet[5]);
377 if ((psmouse->packet[0] & 0xc8) == 0x08) { /* PS/2 packet */
379 alps_report_bare_ps2_packet(psmouse, psmouse->packet,
386 /* Check for PS/2 packet stuffed in the middle of ALPS packet. */
389 psmouse->pktcnt >= 4 && (psmouse->packet[3] & 0x0f) == 0x0f) {
393 if (!alps_is_valid_first_byte(model, psmouse->packet[0])) {
394 dbg("refusing packet[0] = %x (mask0 = %x, byte0 = %x)\n",
395 psmouse->packet[0], model->mask0, model->byte0);
401 (psmouse->packet[psmouse->pktcnt - 1] & 0x80)) {
402 dbg("refusing packet[%i] = %x\n",
403 psmouse->pktcnt - 1, psmouse->packet[psmouse->pktcnt - 1]);
559 * alps_poll() - poll the touchpad for current motion packet.
588 memcpy(psmouse->packet, buf, sizeof(buf));