X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/102b0fcc467c77d0a8f82cfee060353e3cf17261..c6d6f58c34e1b6a4c03d1e86d1abf48eeb6f5624:/lincan/include/main.h diff --git a/lincan/include/main.h b/lincan/include/main.h index 3bdc912..03ee976 100644 --- a/lincan/include/main.h +++ b/lincan/include/main.h @@ -7,13 +7,9 @@ * Version lincan-0.2 9 Jul 2003 */ -#include -#include -#include -#include -#include #include "./can.h" #include "./constants.h" +#include "./can_sysdep.h" #include "./can_queue.h" #ifdef CAN_DEBUG @@ -25,23 +21,6 @@ #define CANMSG(fmt,args...) printk(KERN_ERR "can.o: " fmt,##args) -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,7)) - -#define MINOR_NR \ - (MINOR(file->f_dentry->d_inode->i_rdev)) - -#else /* Linux kernel > 2.5.7 */ - -#define MINOR_NR \ - (minor(file->f_dentry->d_inode->i_rdev)) -#endif /* Linux kernel > 2.5.7 */ - -#if ((LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68)) && !defined(IRQ_RETVAL)) - typedef void irqreturn_t; - #define IRQ_NONE - #define IRQ_HANDLED - #define IRQ_RETVAL(x) -#endif /* <=2.5.67 */ /** * struct canhardware_t - structure representing pointers to all CAN boards @@ -113,6 +92,7 @@ struct candevice_t { * @flags: chip flags: %CHIP_CONFIGURED .. chip is configured, * %CHIP_SEGMENTED .. access to the chip is segmented (mainly for i82527 chips) * @clock: chip base clock frequency in Hz + * @baudrate: selected chip baudrate in Hz * @write_register: write chip register function copy - * @read_register: read chip register function copy * @sja_cdr_reg: SJA specific register - @@ -153,7 +133,8 @@ struct chip_t { int chip_irq; unsigned long chip_base_addr; unsigned int flags; - int clock; /* Chip clock in Hz */ + long clock; /* Chip clock in Hz */ + long baudrate; void (*write_register)(unsigned char data,unsigned long address); unsigned (*read_register)(unsigned long address); @@ -170,7 +151,7 @@ struct chip_t { struct candevice_t *hostdevice; - int max_objects; /* 1 for sja1000, 15 for */ + int max_objects; /* 1 for sja1000, 15 for i82527 */ }; /** @@ -186,6 +167,7 @@ struct chip_t { * canque_test_outslot() call and is freed by canque_free_outslot() * or rescheduled canque_again_outslot() * @tx_retry_cnt: transmission attempt counter + * @tx_timeout: can be used by chip driver to check for the transmission timeout * @rx_msg: temporary storage to hold received messages before * calling to canque_filter_msg2edges() * @hostchip: pointer to the &chip_t structure this object belongs to @@ -205,6 +187,7 @@ struct msgobj_t { struct canque_edge_t *tx_qedge; struct canque_slot_t *tx_slot; int tx_retry_cnt; + struct timer_list tx_timeout; struct canmsg_t rx_msg; @@ -320,6 +303,7 @@ struct chipspecops_t { struct mem_addr { void *address; struct mem_addr *next; + size_t size; }; /* Structure for the RTR queue */ @@ -333,7 +317,7 @@ struct rtr_id { extern int major; extern int minor[MAX_TOT_CHIPS]; extern int extended; -extern int baudrate; +extern int baudrate[MAX_TOT_CHIPS]; extern char *hw[MAX_HW_CARDS]; extern int irq[MAX_IRQ]; extern unsigned long io[MAX_HW_CARDS];