X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/b34a548a5dfd2f0b068fd835a4cd51680d851068..fb2dd0f20bd6264291dccb5e97609a23cae2fd1a:/lincan/include/main.h diff --git a/lincan/include/main.h b/lincan/include/main.h index 4d42d4d..ba01dd2 100644 --- a/lincan/include/main.h +++ b/lincan/include/main.h @@ -22,6 +22,8 @@ #define CANMSG(fmt,args...) can_printk(KERN_ERR "can.o: " fmt,##args) +extern can_spinlock_t canuser_manipulation_lock; + /** * struct canhardware_t - structure representing pointers to all CAN boards * @nr_boards: number of present boards @@ -153,9 +155,10 @@ struct chip_t { int max_objects; /* 1 for sja1000, 15 for i82527 */ + can_spinlock_t chip_lock; + #ifdef CAN_WITH_RTL pthread_t worker_thread; - rtl_spinlock_t rtl_lock; unsigned long pend_flags; #endif /*CAN_WITH_RTL*/ }; @@ -207,20 +210,33 @@ struct msgobj_t { /** * struct canuser_t - structure holding CAN user/client state + * @flags: used to distinguish Linux/RT-Linux type * @peers: for connection into list of object users * @qends: pointer to the ends structure corresponding for this user - * @file: pointer to open device file state structure * @msgobj: communication object the user is connected to * @rx_edge0: default receive queue for filter IOCTL + * @userinfo: stores user context specific information. + * The field @fileinfo.file holds pointer to open device file state structure + * for the Linux user-space client applications * @magic: magic number to check consistency when pointer is retrieved * from file private field */ struct canuser_t { + unsigned long flags; struct list_head peers; struct canque_ends_t *qends; - struct file *file; /* back ptr to file */ struct msgobj_t *msgobj; struct canque_edge_t *rx_edge0; /* simplifies IOCTL */ + union { + struct { + struct file *file; /* back ptr to file */ + } fileinfo; + #ifdef CAN_WITH_RTL + struct { + struct rtl_file *file; + } rtlinfo; + #endif /*CAN_WITH_RTL*/ + } userinfo; int magic; };