]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/include/main.h
host driver: support access to the chip register wider then 8-bit.
[lincan.git] / lincan / include / main.h
index 22fb92f72e9be6a559dacaf4fc9b7082737ae2ef..f7a302c53d25ad219ad709cda402044578c2b9bc 100644 (file)
@@ -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
-       
+
 };
 
 /**
@@ -428,7 +429,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 +438,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 +449,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 +458,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 +476,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 +491,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 +514,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);