]> rtime.felk.cvut.cz Git - socketcan-devel.git/commitdiff
copy 2.6 compat.h to 2.4 tree
authorhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Wed, 12 Dec 2007 12:52:01 +0000 (12:52 +0000)
committerhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Wed, 12 Dec 2007 12:52:01 +0000 (12:52 +0000)
git-svn-id: svn://svn.berlios.de//socketcan/trunk@608 030b6a49-0b11-0410-94ab-b0dab22257f2

kernel/2.4/net/can/compat.h [new file with mode: 0644]

diff --git a/kernel/2.4/net/can/compat.h b/kernel/2.4/net/can/compat.h
new file mode 100644 (file)
index 0000000..3cd4d92
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * $Id$
+ */
+
+#ifndef CAN_COMPAT_H
+#define CAN_COMPAT_H
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
+static inline void *kzalloc(size_t size, unsigned int __nocast flags)
+{
+       void *ret = kmalloc(size, flags);
+       if (ret)
+               memset(ret, 0, size);
+       return ret;
+}
+
+static inline void skb_get_timestamp(const struct sk_buff *skb,
+                                    struct timeval *stamp)
+{
+       stamp->tv_sec  = skb->stamp.tv_sec;
+       stamp->tv_usec = skb->stamp.tv_usec;
+}
+
+static inline void skb_set_timestamp(struct sk_buff *skb,
+                                    const struct timeval *stamp)
+{
+       skb->stamp.tv_sec  = stamp->tv_sec;
+       skb->stamp.tv_usec = stamp->tv_usec;
+}
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+#define round_jiffies(j) (j)
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+#define   dev_get_by_index(ns, ifindex)   dev_get_by_index(ifindex)
+#define __dev_get_by_index(ns, ifindex) __dev_get_by_index(ifindex)
+#endif
+
+#endif