if (priv->i->flags & ALPS_FW_BK) { input_report_key(dev, BTN_FORWARD, packet[0] & 0x10); input_report_key(dev, BTN_BACK, packet[2] & 0x04); 
if (priv->i->flags & (ALPS_FW_BK_1 | ALPS_FW_BK_2)) { input_report_key(dev, BTN_FORWARD, forward); input_report_key(dev, BTN_BACK, back); 
static void alps_process_packet(struct psmouse *psmouse, struct pt_regs *regs){	struct alps_data *priv = psmouse->private;	unsigned char *packet = psmouse->packet;	struct input_dev *dev = &psmouse->dev;	struct input_dev *dev2 = &priv->dev2;	int x, y, z, ges, fin, left, right, middle;	input_regs(dev, regs);	if ((packet[0] & 0xc8) == 0x08) {   /* 3-byte PS/2 packet */		input_report_key(dev2, BTN_LEFT,   packet[0] & 1);		input_report_key(dev2, BTN_RIGHT,  packet[0] & 2);		input_report_key(dev2, BTN_MIDDLE, packet[0] & 4);		input_report_rel(dev2, REL_X,			packet[1] ? packet[1] - ((packet[0] << 4) & 0x100) : 0);		input_report_rel(dev2, REL_Y,			packet[2] ? ((packet[0] << 3) & 0x100) - packet[2] : 0);		input_sync(dev2);		return;	}	if (priv->i->flags & ALPS_OLDPROTO) {		left = packet[2] & 0x08;		right = packet[2] & 0x10;		middle = 0;		x = packet[1] | ((packet[0] & 0x07) << 7);		y = packet[4] | ((packet[3] & 0x07) << 7);		z = packet[5];	} else {		left = packet[3] & 1;		right = packet[3] & 2;		middle = packet[3] & 4;		x = packet[1] | ((packet[2] & 0x78) << (7 - 3));		y = packet[4] | ((packet[3] & 0x70) << (7 - 4));		z = packet[5];	}	ges = packet[2] & 1;	fin = packet[2] & 2;	input_report_key(dev, BTN_LEFT, left);	input_report_key(dev, BTN_RIGHT, right);	input_report_key(dev, BTN_MIDDLE, middle);	if ((priv->i->flags & ALPS_DUALPOINT) && z == 127) {		input_report_rel(dev2, REL_X,  (x > 383 ? (x - 768) : x));		input_report_rel(dev2, REL_Y, -(y > 255 ? (y - 512) : y));		input_sync(dev);		input_sync(dev2);		return;	}	/* Convert hardware tap to a reasonable Z value */	if (ges && !fin) z = 40;	/*	 * A "tap and drag" operation is reported by the hardware as a transition	 * from (!fin && ges) to (fin && ges). This should be translated to the	 * sequence Z>0, Z==0, Z>0, so the Z==0 event has to be generated manually.	 */	if (ges && fin && !priv->prev_fin) {		input_report_abs(dev, ABS_X, x);		input_report_abs(dev, ABS_Y, y);		input_report_abs(dev, ABS_PRESSURE, 0);		input_report_key(dev, BTN_TOOL_FINGER, 0);		input_sync(dev);	}	priv->prev_fin = fin;	if (z > 30) input_report_key(dev, BTN_TOUCH, 1);	if (z < 25) input_report_key(dev, BTN_TOUCH, 0);	if (z > 0) {		input_report_abs(dev, ABS_X, x);		input_report_abs(dev, ABS_Y, y);	}	input_report_abs(dev, ABS_PRESSURE, z);	input_report_key(dev, BTN_TOOL_FINGER, z > 0);	if (priv->i->flags & ALPS_WHEEL)		input_report_rel(dev, REL_WHEEL, ((packet[0] >> 4) & 0x07) | ((packet[2] >> 2) & 0x08));	if (priv->i->flags & ALPS_FW_BK) {		input_report_key(dev, BTN_FORWARD, packet[0] & 0x10);		input_report_key(dev, BTN_BACK, packet[2] & 0x04);	}	input_sync(dev);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/c30b4c10d9cfe5506fd421304935d8836773c7e5/alps.c/buggy/drivers/input/mouse/alps.c