X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/38b6fe757ff40daaf7b1b1474be5d3b7d3f0e2e3..fe719367cdb25978d42261513dd9810c22481960:/lincan/include/main.h diff --git a/lincan/include/main.h b/lincan/include/main.h index 5b4e0e0..d827594 100644 --- a/lincan/include/main.h +++ b/lincan/include/main.h @@ -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);