]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/include/main.h
reference count for device opens added (helps while asynchronous remove
[lincan.git] / lincan / include / main.h
index e896e272a2b31b1e25f6b7ef678aa4e7645299c9..c82935bcf543cdeb95ea641dd10d7fccef2dac50 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
@@ -326,6 +330,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
+       
 };
 
 /**
@@ -537,3 +546,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);