static void ms_mouse_interrupt(int irq, void *dev_id, struct pt_regs * regs) { char dx, dy; unsigned char buttons; outb(MS_MSE_COMMAND_MODE, MS_MSE_CONTROL_PORT); outb((inb(MS_MSE_DATA_PORT) | 0x20), MS_MSE_DATA_PORT); outb(MS_MSE_READ_X, MS_MSE_CONTROL_PORT); dx = inb(MS_MSE_DATA_PORT); outb(MS_MSE_READ_Y, MS_MSE_CONTROL_PORT); dy = inb(MS_MSE_DATA_PORT); outb(MS_MSE_READ_BUTTONS, MS_MSE_CONTROL_PORT); buttons = ~(inb(MS_MSE_DATA_PORT)) & 0x07; outb(MS_MSE_COMMAND_MODE, MS_MSE_CONTROL_PORT); outb((inb(MS_MSE_DATA_PORT) & 0xdf), MS_MSE_DATA_PORT); /* why did the original have: * if (dx != 0 || dy != 0 || buttons != mouse.buttons || * ((~buttons) & 0x07)) * ^^^^^^^^^^^^^^^^^^^ this? */ busmouse_add_movementbuttons(msedev, dx, -dy, buttons); }
void mouse_interrupt(int irq, void *dev_id, struct pt_regs * regs) { char dx, dy, buttons; ATIXL_MSE_DISABLE_UPDATE(); /* Note that interrupts are still enabled */ outb(ATIXL_MSE_READ_X, ATIXL_MSE_CONTROL_PORT); /* Select IR1 - X movement */ dx = inb( ATIXL_MSE_DATA_PORT); outb(ATIXL_MSE_READ_Y, ATIXL_MSE_CONTROL_PORT); /* Select IR2 - Y movement */ dy = inb( ATIXL_MSE_DATA_PORT); outb(ATIXL_MSE_READ_BUTTONS, ATIXL_MSE_CONTROL_PORT); /* Select IR0 - Button Status */ buttons = inb( ATIXL_MSE_DATA_PORT); busmouse_add_movementbuttons(msedev, dx, -dy, buttons); ATIXL_MSE_ENABLE_UPDATE(); }