/* warrior_interrupt() is called by the low level driver when characters are ready for us. We then buffer them for further processing, or call the packet processing routine.  */
static irqreturn_t warrior_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
/* warrior_interrupt() is called by the low level driver when characters are ready for us. We then buffer them for further processing, or call the packet processing routine.  */
static irqreturn_t warrior_interrupt(struct serio *serio, unsigned char data, unsigned int flags)
{
	struct warrior *warrior = serio_get_drvdata(serio);
	if (data & 0x80) {
		if (warrior->idx) warrior_process_packet(warrior);
		warrior->idx = 0;
		warrior->len = warrior_lengths[(data >> 4) & 7];
	}
	if (warrior->idx < warrior->len)
		warrior->data[warrior->idx++] = data;
	if (warrior->idx == warrior->len) {
		if (warrior->idx) warrior_process_packet(warrior);
		warrior->idx = 0;
		warrior->len = 0;
	}
	return IRQ_HANDLED;
}