static inline void handle_mouse_event(unsigned char scancode) { #ifdef CONFIG_PSMOUSE static unsigned char prev_code; if (mouse_reply_expected) { if (scancode == AUX_ACK) { mouse_reply_expected--; return; } mouse_reply_expected = 0; } else if(scancode == AUX_RECONNECT2 && prev_code == AUX_RECONNECT1 && aux_reconnect) { printk (KERN_INFO "PS/2 mouse reconnect detected\n"); queue->head = queue->tail = 0; /* Flush input queue */ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ return; } prev_code = scancode; add_mouse_randomness(scancode); if (aux_count) { int head = queue->head; queue->buf[head] = scancode; head = (head + 1) & (AUX_BUF_SIZE-1); if (head != queue->tail) { queue->head = head; kill_fasync(&queue->fasync, SIGIO, POLL_IN); wake_up_interruptible(&queue->proc_list); } } #endif }
static void aux_write_ack(int val) { unsigned long flags; spin_lock_irqsave(&kbd_controller_lock, flags); __aux_write_ack(val); spin_unlock_irqrestore(&kbd_controller_lock, flags); }
static inline void handle_mouse_event(unsigned char scancode) { static unsigned char prev_code; if (mouse_reply_expected) { if (scancode == AUX_ACK) { mouse_reply_expected--; return; } mouse_reply_expected = 0; } else if(scancode == AUX_RECONNECT2 && prev_code == AUX_RECONNECT1 && aux_reconnect) { printf ("PS/2 mouse reconnect detected\n"); __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ return; } prev_code = scancode; if (getenv("aux")) { printf("mouse:%x\n",scancode); } }
static void aux_write_ack(int val) { unsigned long flags; __aux_write_ack(val); }