Пример #1
0
static int open_mouse(struct inode * inode, struct file * file)
{
	if (request_irq(mouse_irq, ms_mouse_interrupt, 0, "MS Busmouse", NULL))
		return -EBUSY;

	outb(MS_MSE_START, MS_MSE_CONTROL_PORT);
	MS_MSE_INT_ON();	
	return 0;
}
Пример #2
0
static int open_mouse(struct inode * inode, struct file * file)
{
	if (!mouse.present)
		return -EINVAL;
	if (mouse.active++)
		return 0;
	if (request_irq(mouse_irq, ms_mouse_interrupt, 0, "MS Busmouse", NULL)) {
		mouse.active--;
		return -EBUSY;
	}
	mouse.ready = mouse.dx = mouse.dy = 0;	
	mouse.buttons = 0x80;
	outb(MS_MSE_START, MS_MSE_CONTROL_PORT);
	MOD_INC_USE_COUNT;
	MS_MSE_INT_ON();	
	return 0;
}
Пример #3
0
static int open_mouse(struct inode * inode, struct file * file)
{
	if (!mouse.present)
		return -EINVAL;
	if (mouse.active)
		return -EBUSY;
	mouse.active = 1;
	mouse.ready = mouse.dx = mouse.dy = 0;	
	mouse.buttons = 0x80;
	if (request_irq(MOUSE_IRQ, ms_mouse_interrupt, 0, "MS Busmouse")) {
		mouse.active = 0;
		return -EBUSY;
	}
	outb(MS_MSE_START, MS_MSE_CONTROL_PORT);
	MS_MSE_INT_ON();	
	return 0;
}