dev_dbg(&remote->udev, 
dev_dbg(&remote->udev->dev, 
static void keyspan_check_data(struct usb_keyspan *remote, struct pt_regs *regs){	int i;	int found = 0;	struct keyspan_message message;	switch(remote->stage) {	case 0:		/*		 * In stage 0 we want to find the start of a message.  The remote sends a 0xFF as filler.		 * So the first byte that isn't a FF should be the start of a new message.		 */		for (i = 0; i < RECV_SIZE && remote->in_buffer[i] == GAP; ++i);		if (i < RECV_SIZE) {			memcpy(remote->data.buffer, remote->in_buffer, RECV_SIZE);			remote->data.len = RECV_SIZE;			remote->data.pos = 0;			remote->data.tester = 0;			remote->data.bits_left = 0;			remote->stage = 1;		}		break;	case 1:		/*		 * Stage 1 we should have 16 bytes and should be able to detect a		 * SYNC.  The SYNC is 14 bits, 7 0's and then 7 1's.		 */		memcpy(remote->data.buffer + remote->data.len, remote->in_buffer, RECV_SIZE);		remote->data.len += RECV_SIZE;		found = 0;		while ((remote->data.bits_left >= 14 || remote->data.pos < remote->data.len) && !found) {			for (i = 0; i < 8; ++i) {				if (keyspan_load_tester(remote, 14) != 0) {					remote->stage = 0;					return;				}				if ((remote->data.tester & SYNC_MASK) == SYNC) {					remote->data.tester = remote->data.tester >> 14;					remote->data.bits_left -= 14;					found = 1;					break;				} else {					remote->data.tester = remote->data.tester >> 1;					--remote->data.bits_left;				}			}		}		if (!found) {			remote->stage = 0;			remote->data.len = 0;		} else {			remote->stage = 2;		}		break;	case 2:		/*		 * Stage 2 we should have 24 bytes which will be enough for a full		 * message.  We need to parse out the system code, button code,		 * toggle code, and stop.		 */		memcpy(remote->data.buffer + remote->data.len, remote->in_buffer, RECV_SIZE);		remote->data.len += RECV_SIZE;		message.system = 0;		for (i = 0; i < 9; i++) {			keyspan_load_tester(remote, 6);			if ((remote->data.tester & ZERO_MASK) == ZERO) {				message.system = message.system << 1;				remote->data.tester = remote->data.tester >> 5;				remote->data.bits_left -= 5;			} else if ((remote->data.tester & ONE_MASK) == ONE) {				message.system = (message.system << 1) + 1;				remote->data.tester = remote->data.tester >> 6;				remote->data.bits_left -= 6;			} else {				err("%s - Unknown sequence found in system data.\n", __FUNCTION__);				remote->stage = 0;				return;			}		}		message.button = 0;		for (i = 0; i < 5; i++) {			keyspan_load_tester(remote, 6);			if ((remote->data.tester & ZERO_MASK) == ZERO) {				message.button = message.button << 1;				remote->data.tester = remote->data.tester >> 5;				remote->data.bits_left -= 5;			} else if ((remote->data.tester & ONE_MASK) == ONE) {				message.button = (message.button << 1) + 1;				remote->data.tester = remote->data.tester >> 6;				remote->data.bits_left -= 6;			} else {				err("%s - Unknown sequence found in button data.\n", __FUNCTION__);				remote->stage = 0;				return;			}		}		keyspan_load_tester(remote, 6);		if ((remote->data.tester & ZERO_MASK) == ZERO) {			message.toggle = 0;			remote->data.tester = remote->data.tester >> 5;			remote->data.bits_left -= 5;		} else if ((remote->data.tester & ONE_MASK) == ONE) {			message.toggle = 1;			remote->data.tester = remote->data.tester >> 6;			remote->data.bits_left -= 6;		} else {			err("%s - Error in message, invalid toggle.\n", __FUNCTION__);		}		keyspan_load_tester(remote, 5);		if ((remote->data.tester & STOP_MASK) == STOP) {			remote->data.tester = remote->data.tester >> 5;			remote->data.bits_left -= 5;		} else {			err("Bad message recieved, no stop bit found.\n");		}		dev_dbg(&remote->udev,			"%s found valid message: system: %d, button: %d, toggle: %d\n",			__FUNCTION__, message.system, message.button, message.toggle);		if (message.toggle != remote->toggle) {			input_regs(remote->input, regs);			input_report_key(remote->input, keyspan_key_table[message.button], 1);			input_report_key(remote->input, keyspan_key_table[message.button], 0);			input_sync(remote->input);			remote->toggle = message.toggle;		}		remote->stage = 0;		break;	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/654f31189e550cd5924b786487a5d93d9feaada9/keyspan_remote.c/clean/drivers/usb/input/keyspan_remote.c