X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/95c031e101c74ae6472a7e538f3128f67a490082..9c15427c7cf013626ad4b0e281cb602c03fb1875:/lincan/include/main.h diff --git a/lincan/include/main.h b/lincan/include/main.h index 0a12ffe..fa98bb2 100644 --- a/lincan/include/main.h +++ b/lincan/include/main.h @@ -13,13 +13,13 @@ #include "./can_queue.h" #ifdef CAN_DEBUG - #define DEBUGMSG(fmt,args...) can_printk(KERN_ERR "can.o (debug): " fmt,\ + #define DEBUGMSG(fmt,args...) can_printk(KERN_ERR "lincan (debug): " fmt,\ ##args) #else #define DEBUGMSG(fmt,args...) #endif -#define CANMSG(fmt,args...) can_printk(KERN_ERR "can.o: " fmt,##args) +#define CANMSG(fmt,args...) can_printk(KERN_ERR "lincan: " fmt,##args) extern can_spinlock_t canuser_manipulation_lock; @@ -74,12 +74,13 @@ struct candevice_t { char *hwname; /* text board type */ int candev_idx; /* board index in canhardware_t.candevice[] */ unsigned long io_addr; /* IO/physical MEM address */ - unsigned long res_addr; /* optional seset register port */ + unsigned long res_addr; /* optional reset register port */ unsigned long dev_base_addr; /* CPU translated IO/virtual MEM address */ unsigned int flags; int nr_all_chips; int nr_82527_chips; int nr_sja1000_chips; + can_spinlock_t device_lock; struct canchip_t *chip[MAX_HW_CHIPS]; struct hwspecops_t *hwspecops; @@ -320,9 +321,12 @@ struct hwspecops_t { * @enable_configuration: enable chip configuration mode * @disable_configuration: disable chip configuration mode * @set_btregs: configures bitrate registers + * @attach_to_chip: attaches to the chip, setups registers and possibly state informations + * @release_chip: called before chip structure removal if %CHIP_ATTACHED is set * @start_chip: starts chip message processing * @stop_chip: stops chip message processing * @irq_handler: interrupt service routine + * @irq_accept: optional fast irq accept routine responsible for blocking further interrupts */ struct chipspecops_t { int (*chip_config)(struct canchip_t *chip); @@ -349,9 +353,12 @@ struct chipspecops_t { int (*disable_configuration)(struct canchip_t *chip); int (*set_btregs)(struct canchip_t *chip, unsigned short btr0, unsigned short btr1); + int (*attach_to_chip)(struct canchip_t *chip); + int (*release_chip)(struct canchip_t *chip); int (*start_chip)(struct canchip_t *chip); int (*stop_chip)(struct canchip_t *chip); int (*irq_handler)(int irq, struct canchip_t *chip); + int (*irq_accept)(int irq, struct canchip_t *chip); }; struct mem_addr { @@ -372,9 +379,10 @@ extern int major; extern int minor[MAX_TOT_CHIPS]; extern int extended; extern int baudrate[MAX_TOT_CHIPS]; -extern char *hw[MAX_HW_CARDS]; extern int irq[MAX_IRQ]; +extern char *hw[MAX_HW_CARDS]; extern unsigned long io[MAX_HW_CARDS]; +extern long clockfreq[MAX_HW_CARDS]; extern int processlocal; extern struct canhardware_t *hardware_p;