summaryrefslogtreecommitdiffstats
path: root/openwrt/target/linux/package/switch/src/switch-core.h
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-12-25 21:57:14 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-12-25 21:57:14 +0000
commit4cc40687a35b3fae6bc981b9630383abc4710dad (patch)
tree4087a0e4c0a53d14f31837265560fe4ae3af2a37 /openwrt/target/linux/package/switch/src/switch-core.h
parentb6ef8792f8af466fb45ca63e6fbf96855ac558c6 (diff)
fix kernel version detection in switch driver
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@2782 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'openwrt/target/linux/package/switch/src/switch-core.h')
-rw-r--r--openwrt/target/linux/package/switch/src/switch-core.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/openwrt/target/linux/package/switch/src/switch-core.h b/openwrt/target/linux/package/switch/src/switch-core.h
index c878d4786..9927e8519 100644
--- a/openwrt/target/linux/package/switch/src/switch-core.h
+++ b/openwrt/target/linux/package/switch/src/switch-core.h
@@ -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 {