This source file includes following definitions.
- mouse_open
- mouse_init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include <linux/fs.h>
18 #include <linux/errno.h>
19 #include <linux/mouse.h>
20
21
22
23
24
25 extern struct file_operations bus_mouse_fops;
26 extern struct file_operations psaux_fops;
27 extern struct file_operations ms_bus_mouse_fops;
28 extern struct file_operations atixl_busmouse_fops;
29
30 extern unsigned long bus_mouse_init(unsigned long);
31 extern unsigned long psaux_init(unsigned long);
32 extern unsigned long ms_bus_mouse_init(unsigned long);
33 extern unsigned long atixl_busmouse_init(unsigned long);
34
35 static int mouse_open(struct inode * inode, struct file * file)
36 {
37 int minor = MINOR(inode->i_rdev);
38
39 switch (minor) {
40 #ifdef BUSMOUSE_MINOR
41 case BUSMOUSE_MINOR:
42 file->f_op = &bus_mouse_fops;
43 break;
44 #endif
45 #ifdef PSMOUSE_MINOR
46 case PSMOUSE_MINOR:
47 file->f_op = &psaux_fops;
48 break;
49 #endif
50 #ifdef MS_BUSMOUSE_MINOR
51 case MS_BUSMOUSE_MINOR:
52 file->f_op = &ms_bus_mouse_fops;
53 break;
54 #endif
55 #ifdef ATIXL_BUSMOUSE_MINOR
56 case ATIXL_BUSMOUSE_MINOR:
57 file->f_op = &atixl_busmouse_fops;
58 break;
59 #endif
60 default:
61 return -ENODEV;
62 }
63 return file->f_op->open(inode,file);
64 }
65
66 static struct file_operations mouse_fops = {
67 NULL,
68 NULL,
69 NULL,
70 NULL,
71 NULL,
72 NULL,
73 NULL,
74 mouse_open,
75 NULL
76 };
77
78 unsigned long mouse_init(unsigned long kmem_start)
79 {
80 #ifdef BUSMOUSE_MINOR
81 kmem_start = bus_mouse_init(kmem_start);
82 #endif
83 #ifdef PSMOUSE_MINOR
84 kmem_start = psaux_init(kmem_start);
85 #endif
86 #ifdef MS_BUSMOUSE_MINOR
87 kmem_start = ms_bus_mouse_init(kmem_start);
88 #endif
89 #ifdef ATIXL_BUSMOUSE_MINOR
90 kmem_start = atixl_busmouse_init(kmem_start);
91 #endif
92 chrdev_fops[10] = &mouse_fops;
93 return kmem_start;
94 }