This source file includes following definitions.
- mouse_open
- mouse_init
1
2
3
4
5
6
7
8
9
10
11
12
13
14 #include <linux/fs.h>
15 #include <linux/errno.h>
16 #include <linux/mouse.h>
17
18 extern struct file_operations bus_mouse_fops;
19 extern struct file_operations psaux_fops;
20 extern long bus_mouse_init(long);
21 extern long psaux_init(long);
22 extern long ms_bus_mouse_init(long);
23
24 int mse_busmouse_type;
25
26 static int mouse_open(struct inode * inode, struct file * file)
27 {
28 if (MINOR(inode->i_rdev) == BUSMOUSE_MINOR)
29 file->f_op = &bus_mouse_fops;
30 else if (MINOR(inode->i_rdev) == PSMOUSE_MINOR)
31 file->f_op = &psaux_fops;
32 else if (MINOR(inode->i_rdev) == MS_BUSMOUSE_MINOR)
33 file->f_op = &bus_mouse_fops;
34 else
35 return -ENODEV;
36 mse_busmouse_type = (int) MINOR(inode->i_rdev);
37 return file->f_op->open(inode,file);
38 }
39
40 static struct file_operations mouse_fops = {
41 NULL,
42 NULL,
43 NULL,
44 NULL,
45 NULL,
46 NULL,
47 mouse_open,
48 NULL
49 };
50
51 long mouse_init(long kmem_start)
52 {
53 kmem_start = bus_mouse_init(kmem_start);
54 kmem_start = psaux_init(kmem_start);
55 kmem_start = ms_bus_mouse_init(kmem_start);
56 mse_busmouse_type = -1;
57 chrdev_fops[10] = &mouse_fops;
58 return kmem_start;
59 }