]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/include/main.h
Added full RT-Linux POSIX interface to LinCAN driver, needs preparation of RT tests.
[lincan.git] / lincan / include / main.h
index 4d42d4df0624417dff0d5bb8d9f9292ffe044882..ba01dd23d89b54b767b2c5e257a24a9a4eaeed5e 100644 (file)
@@ -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;
 };