fix kernel version detection in switch driver
[openwrt.git] / openwrt / target / linux / package / switch / src / switch-core.h
index c878d47..9927e85 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __SWITCH_CORE_H
 #define __SWITCH_CORE_H
 
+#include <linux/version.h>
 #include <linux/list.h>
 #define SWITCH_MAX_BUFSZ       4096
 
@@ -8,6 +9,14 @@
 #define SWITCH_MEDIA_100       2
 #define SWITCH_MEDIA_FD                4
 
+#ifndef KERNEL_VERSION
+#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+#define LINUX_2_4
+#endif
+
 typedef int (*switch_handler)(char *buf, int nr);
 
 typedef struct {
This page took 0.019251 seconds and 4 git commands to generate.