struct input_dev *dev = &sermouse->dev; 
struct input_dev *dev = sermouse->dev; 
static void sermouse_process_ms(struct sermouse *sermouse, signed char data, struct pt_regs *regs){	struct input_dev *dev = &sermouse->dev;	signed char *buf = sermouse->buf;	if (data & 0x40) sermouse->count = 0;	input_regs(dev, regs);	switch (sermouse->count) {		case 0:			buf[1] = data;			input_report_key(dev, BTN_LEFT,   (data >> 5) & 1);			input_report_key(dev, BTN_RIGHT,  (data >> 4) & 1);			break;		case 1:			buf[2] = data;			data = (signed char) (((buf[1] << 6) & 0xc0) | (data & 0x3f));			input_report_rel(dev, REL_X, data / 2);			input_report_rel(dev, REL_Y, buf[4]);			buf[3] = data - data / 2;			break;		case 2:			/* Guessing the state of the middle button on 3-button MS-protocol mice - ugly. */			if ((sermouse->type == SERIO_MS) && !data && !buf[2] && !((buf[0] & 0xf0) ^ buf[1]))				input_report_key(dev, BTN_MIDDLE, !test_bit(BTN_MIDDLE, dev->key));			buf[0] = buf[1];			data = (signed char) (((buf[1] << 4) & 0xc0) | (data & 0x3f));			input_report_rel(dev, REL_X, buf[3]);			input_report_rel(dev, REL_Y, data - buf[4]);			buf[4] = data / 2;			break;		case 3:			switch (sermouse->type) {				case SERIO_MS:					 sermouse->type = SERIO_MP;				case SERIO_MP:					if ((data >> 2) & 3) break;	/* M++ Wireless Extension packet. */					input_report_key(dev, BTN_MIDDLE, (data >> 5) & 1);					input_report_key(dev, BTN_SIDE,   (data >> 4) & 1);					break;				case SERIO_MZP:				case SERIO_MZPP:					input_report_key(dev, BTN_SIDE,   (data >> 5) & 1);				case SERIO_MZ:					input_report_key(dev, BTN_MIDDLE, (data >> 4) & 1);					input_report_rel(dev, REL_WHEEL,  (data & 8) - (data & 7));					break;			}			break;		case 4:		case 6:	/* MZ++ packet type. We can get these bytes for M++ too but we ignore them later. */			buf[1] = (data >> 2) & 0x0f;			break;		case 5:		case 7: /* Ignore anything besides MZ++ */			if (sermouse->type != SERIO_MZPP) break;			switch (buf[1]) {				case 1: /* Extra mouse info */					input_report_key(dev, BTN_SIDE, (data >> 4) & 1);					input_report_key(dev, BTN_EXTRA, (data >> 5) & 1);					input_report_rel(dev, data & 0x80 ? REL_HWHEEL : REL_WHEEL, (data & 7) - (data & 8));					break;				default: /* We don't decode anything else yet. */					printk(KERN_WARNING						"sermouse.c: Received MZ++ packet %x, don't know how to handle.\n", buf[1]);					break;			}			break;	}	input_sync(dev);	sermouse->count++;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/2e5b636bb5f8dacbb91d08544e2c41ebcad5dace/sermouse.c/clean/drivers/input/mouse/sermouse.c