fix kernel version detection in switch driver

SVN-Revision: 2782
This commit is contained in:
Felix Fietkau 2005-12-25 21:57:14 +00:00
parent 36bde48820
commit d0973506ba
2 changed files with 11 additions and 1 deletions

View file

@ -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

View 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 {