]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/include/main.h
First part of IRQ handling changes
[lincan.git] / lincan / include / main.h
index 30ae627aea6df6b60181b2d378d77944ea19912d..3af24c62bf32ba577ea53235e78d54ca07128779 100644 (file)
@@ -4,7 +4,7 @@
  * Rewritten for new CAN queues by Pavel Pisa - OCERA team member
  * email:pisa@cmp.felk.cvut.cz
  * This software is released under the GPL-License.
- * Version lincan-0.2  9 Jul 2003
+ * Version lincan-0.3  17 Jun 2004
  */
 
 #include "./can.h"
@@ -351,7 +351,7 @@ struct chipspecops_t {
                                                        unsigned short btr1);
        int (*start_chip)(struct chip_t *chip);
        int (*stop_chip)(struct chip_t *chip);
-       can_irqreturn_t (*irq_handler)(int irq, void *dev_id, struct pt_regs *regs);
+       int (*irq_handler)(int irq, struct chip_t *chip);
 };
 
 struct mem_addr {
@@ -480,6 +480,26 @@ const struct boardtype_t* boardtype_find(const char *str);
 
 int can_check_dev_taken(void *anydev);
 
+#if defined(can_gettimeofday) && defined(CAN_MSG_VERSION_2) && 1
+static inline
+void can_filltimestamp(canmsg_tstamp_t *ptimestamp)
+{
+       can_gettimeofday(ptimestamp);
+}
+#else /* No timestamp support, set field to zero */
+static inline
+void can_filltimestamp(canmsg_tstamp_t *ptimestamp)
+{
+    #ifdef CAN_MSG_VERSION_2
+       ptimestamp->tv_sec = 0;
+       ptimestamp->tv_usec = 0;
+    #else /* CAN_MSG_VERSION_2 */
+       *ptimestamp = 0;
+    #endif /* CAN_MSG_VERSION_2 */
+
+}
+#endif /* End of timestamp source selection */
+
 #ifdef CAN_WITH_RTL
 extern int can_rtl_priority;
 #endif /*CAN_WITH_RTL*/