]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/include/main.h
Merge branch 'master' into can-usb1
[lincan.git] / lincan / include / main.h
index 5b4e0e0dbb1633aa4c383b80b558c1f28bac047b..d827594f9022db6a12f51663a8f757f2689f3249 100644 (file)
@@ -113,6 +113,10 @@ struct candevice_t {
 
        struct canhardware_t *hosthardware_p;
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10))
+       struct kref refcount;
+#endif
+       
        union {
                void *anydev;
            #ifdef CAN_ENABLE_PCI_SUPPORT
@@ -181,7 +185,7 @@ struct canchip_t {
        int chip_idx;   /* chip index in candevice_t.chip[] */
        int chip_irq;
        can_ioptr_t chip_base_addr;
-       unsigned int flags;
+       uint16_t flags;
        long clock; /* Chip clock in Hz */
        long baudrate;
 
@@ -327,6 +331,11 @@ struct hwspecops_t {
        int (*program_irq)(struct candevice_t *candev);
        void (*write_register)(unsigned data, can_ioptr_t address);
        unsigned (*read_register)(can_ioptr_t address);
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10))
+       void (*release_device)(struct kref *refcount);
+#endif
+       
 };
 
 /**
@@ -544,3 +553,7 @@ void can_filltimestamp(canmsg_tstamp_t *ptimestamp)
 #ifdef CAN_WITH_RTL
 extern int can_rtl_priority;
 #endif /*CAN_WITH_RTL*/
+
+extern struct candevice_t* register_hotplug_dev(const char *hwname,int (*chipdataregfnc)(struct canchip_t *chip,void *data),void *devdata);
+extern void deregister_hotplug_dev(struct candevice_t *dev);
+extern void cleanup_hotplug_dev(struct candevice_t *dev);