#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
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*/
};
/**
* 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;
};