]> rtime.felk.cvut.cz Git - lincan.git/blob - lincan/src/fasync.c
Merge: Correction for 2.6.23-git kernel - unregister_chrdev() does not return value.
[lincan.git] / lincan / src / fasync.c
1 /* open.c
2  * Linux CAN-bus device driver.
3  * Written by Arnaud Westenberg email:arnaud@wanadoo.nl
4  * Rewritten for new CAN queues by Pavel Pisa - OCERA team member
5  * email:pisa@cmp.felk.cvut.cz
6  * This software is released under the GPL-License.
7  * Version lincan-0.3  17 Jun 2004
8  */
9
10 #include "../include/can.h"
11 #include "../include/can_sysdep.h"
12 #include "../include/main.h"
13 #include "../include/fasync.h"
14
15 #ifdef CAN_ENABLE_KERN_FASYNC
16
17 int can_fasync(int fd, struct file *file, int on)
18 {
19         int retval;
20         
21         struct canuser_t *canuser = (struct canuser_t*)(file->private_data);
22         struct canque_ends_t *qends;
23         
24         if(!canuser || (canuser->magic != CAN_USER_MAGIC)){
25                 CANMSG("can_close: bad canuser magic\n");
26                 return -ENODEV;
27         }
28         
29         qends = canuser->qends;
30
31         retval = fasync_helper(fd, file, on, &qends->endinfo.fileinfo.fasync);
32
33         if (retval < 0)
34                 return retval;
35         return 0;
36 }
37
38
39
40
41
42 #endif /*CAN_ENABLE_KERN_FASYNC*/