#include "./can_queue.h"
#ifdef CAN_DEBUG
- #define DEBUGMSG(fmt,args...) printk(KERN_ERR "can.o (debug): " fmt,\
+ #define DEBUGMSG(fmt,args...) can_printk(KERN_ERR "can.o (debug): " fmt,\
##args)
#else
#define DEBUGMSG(fmt,args...)
#endif
-#define CANMSG(fmt,args...) printk(KERN_ERR "can.o: " fmt,##args)
+#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
struct canhardware_t {
int nr_boards;
struct rtr_id *rtr_queue;
- spinlock_t rtr_lock;
+ can_spinlock_t rtr_lock;
struct candevice_t *candevice[MAX_HW_CARDS];
};
struct hwspecops_t *hwspecops;
struct canhardware_t *hosthardware_p;
+
+ union {
+ #ifdef CAN_ENABLE_PCI_SUPPORT
+ struct pci_dev *pcidev;
+ #endif /*CAN_ENABLE_PCI_SUPPORT*/
+ } sysdevptr;
+
};
/**
struct candevice_t *hostdevice;
int max_objects; /* 1 for sja1000, 15 for i82527 */
+
+ can_spinlock_t chip_lock;
+
+ #ifdef CAN_WITH_RTL
+ pthread_t worker_thread;
+ unsigned long pend_flags;
+ #endif /*CAN_WITH_RTL*/
};
/**
unsigned long obj_base_addr;
unsigned int minor; /* associated device minor number */
unsigned int object; /* object number in chip_t +1 for debug printk */
- unsigned long flags;
+ unsigned long obj_flags;
int ret;
struct canque_ends_t *qends;
/**
* 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;
};
unsigned short btr1);
int (*start_chip)(struct chip_t *chip);
int (*stop_chip)(struct chip_t *chip);
- irqreturn_t (*irq_handler)(int irq, void *dev_id, struct pt_regs *regs);
+ can_irqreturn_t (*irq_handler)(int irq, void *dev_id, struct pt_regs *regs);
};
struct mem_addr {