summaryrefslogtreecommitdiff
path: root/openwrt/target/linux/package/switch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2005-12-25 21:57:14 +0000
committerFelix Fietkau <nbd@openwrt.org>2005-12-25 21:57:14 +0000
commitd0973506ba1d08b7e2eaa85891a5cff85abd9e50 (patch)
tree9d7851bfd2125a17a1474fda2e77ae6c2c2a3b87 /openwrt/target/linux/package/switch
parent36bde488207dad7f97621b657c0ceb516b4dd669 (diff)
downloadmtk-20170518-d0973506ba1d08b7e2eaa85891a5cff85abd9e50.zip
mtk-20170518-d0973506ba1d08b7e2eaa85891a5cff85abd9e50.tar.gz
mtk-20170518-d0973506ba1d08b7e2eaa85891a5cff85abd9e50.tar.bz2
fix kernel version detection in switch driver
SVN-Revision: 2782
Diffstat (limited to 'openwrt/target/linux/package/switch')
-rw-r--r--openwrt/target/linux/package/switch/src/Makefile3
-rw-r--r--openwrt/target/linux/package/switch/src/switch-core.h9
2 files changed, 11 insertions, 1 deletions
diff --git a/openwrt/target/linux/package/switch/src/Makefile b/openwrt/target/linux/package/switch/src/Makefile
index e4b2b7f..4c5f911 100644
--- a/openwrt/target/linux/package/switch/src/Makefile
+++ b/openwrt/target/linux/package/switch/src/Makefile
@@ -11,8 +11,9 @@
#
obj-m := switch-core.o switch-adm.o switch-robo.o
-export-objs := switch-core.o
ifeq ($(MAKING_MODULES),1)
+export-objs := switch-core.o
+
-include $(TOPDIR)/Rules.make
endif
diff --git a/openwrt/target/linux/package/switch/src/switch-core.h b/openwrt/target/linux/package/switch/src/switch-core.h
index c878d47..9927e85 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 {