X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/fdda6e9262ba019da93832120a9999941e9b8f3b..3c47a7cd435662f7e2daa006596722271f5dd090:/lincan/include/main.h diff --git a/lincan/include/main.h b/lincan/include/main.h index 22fb92f..aad913d 100644 --- a/lincan/include/main.h +++ b/lincan/include/main.h @@ -116,7 +116,7 @@ struct candevice_t { #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)) struct kref refcount; #endif - + union { void *anydev; #ifdef CAN_ENABLE_PCI_SUPPORT @@ -325,6 +325,7 @@ struct hwspecops_t { int (*release_io)(struct candevice_t *candev); int (*reset)(struct candevice_t *candev); int (*init_hw_data)(struct candevice_t *candev); + void (*done_hw_data)(struct candevice_t *candev); int (*init_chip_data)(struct candevice_t *candev, int chipnr); int (*init_obj_data)(struct canchip_t *chip, int objnr); int (*program_irq)(struct candevice_t *candev); @@ -334,7 +335,7 @@ struct hwspecops_t { #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)) void (*release_device)(struct kref *refcount); #endif - + }; /** @@ -405,6 +406,7 @@ struct mem_addr { /* Structure for the RTR queue */ struct rtr_id { unsigned long id; + int ready_fl; struct canmsg_t *rtr_message; wait_queue_head_t rtr_wq; struct rtr_id *next; @@ -428,7 +430,7 @@ extern struct mem_addr *mem_head; #if defined(CONFIG_OC_LINCAN_PORTIO_ONLY) -extern inline void can_write_reg(const struct canchip_t *chip, unsigned char data, unsigned reg_offs) +extern inline void can_write_reg(const struct canchip_t *chip, unsigned data, unsigned reg_offs) { can_outb(data, chip->chip_base_addr+reg_offs); } @@ -437,7 +439,7 @@ extern inline unsigned can_read_reg(const struct canchip_t *chip, unsigned reg_o return can_inb(chip->chip_base_addr+reg_offs); } extern inline void canobj_write_reg(const struct canchip_t *chip, const struct msgobj_t *obj, - unsigned char data, unsigned reg_offs) + unsigned data, unsigned reg_offs) { can_outb(data, obj->obj_base_addr+reg_offs); } @@ -448,7 +450,7 @@ extern inline unsigned canobj_read_reg(const struct canchip_t *chip, const struc } #elif defined(CONFIG_OC_LINCAN_MEMIO_ONLY) -extern inline void can_write_reg(const struct canchip_t *chip, unsigned char data, unsigned reg_offs) +extern inline void can_write_reg(const struct canchip_t *chip, unsigned data, unsigned reg_offs) { can_writeb(data, chip->chip_base_addr+reg_offs); } @@ -457,7 +459,7 @@ extern inline unsigned can_read_reg(const struct canchip_t *chip, unsigned reg_o return can_readb(chip->chip_base_addr+reg_offs); } extern inline void canobj_write_reg(const struct canchip_t *chip, const struct msgobj_t *obj, - unsigned char data, unsigned reg_offs) + unsigned data, unsigned reg_offs) { can_writeb(data, obj->obj_base_addr+reg_offs); } @@ -475,7 +477,7 @@ extern inline unsigned canobj_read_reg(const struct canchip_t *chip, const struc /* Inline function to write to the hardware registers. The argument reg_offs is * relative to the memory map of the chip and not the absolute memory reg_offs. */ -extern inline void can_write_reg(const struct canchip_t *chip, unsigned char data, unsigned reg_offs) +extern inline void can_write_reg(const struct canchip_t *chip, unsigned data, unsigned reg_offs) { can_ioptr_t address_to_write; address_to_write = chip->chip_base_addr+reg_offs; @@ -490,7 +492,7 @@ extern inline unsigned can_read_reg(const struct canchip_t *chip, unsigned reg_o } extern inline void canobj_write_reg(const struct canchip_t *chip, const struct msgobj_t *obj, - unsigned char data, unsigned reg_offs) + unsigned data, unsigned reg_offs) { can_ioptr_t address_to_write; address_to_write = obj->obj_base_addr+reg_offs; @@ -513,6 +515,12 @@ void can_release_io_region(unsigned long start, unsigned long n); int can_request_mem_region(unsigned long start, unsigned long n, const char *name); void can_release_mem_region(unsigned long start, unsigned long n); +#ifdef CAN_ENABLE_PCI_SUPPORT +struct pci_dev *can_pci_get_next_untaken_device(unsigned int vendor, unsigned int device); +struct pci_dev *can_pci_get_next_untaken_subsyst(unsigned int vendor, unsigned int device, + unsigned int ss_vendor, unsigned int ss_device); +#endif /*CAN_ENABLE_PCI_SUPPORT*/ + struct boardtype_t { const char *boardtype; int (*board_register)(struct hwspecops_t *hwspecops);