From 4c7d5e434f138b8af90bb06628626ed928d88e5d Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Wed, 11 Jun 2008 16:35:19 +0000 Subject: [PATCH] Removed bad hacks in vcan.c and slcan_attach.c. Giving some hints for users of older kernels than 2.6.25 that a compilation error is a normal behaviour in these cases. --- Makefile | 4 +++- slcan_attach.c | 5 ++++- vcan.c | 17 ++++++----------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 520552d..727f760 100644 --- a/Makefile +++ b/Makefile @@ -40,13 +40,15 @@ # # Send feedback to +MAKEFLAGS = -k + CFLAGS = -O2 -Wall -Wno-parentheses -I../kernel/2.6/include \ -fno-strict-aliasing \ -DPF_CAN=29 \ -DAF_CAN=PF_CAN PROGRAMS = candump cansniffer cansend canplayer canlogserver cangen\ - canbusload log2long log2asc asc2log slcan_attach vcan + canbusload log2long log2asc asc2log vcan slcan_attach all: $(PROGRAMS) diff --git a/slcan_attach.c b/slcan_attach.c index 399962e..bfeaa8e 100644 --- a/slcan_attach.c +++ b/slcan_attach.c @@ -55,7 +55,10 @@ //#include /* ldiscs for each arch up to 2.6.20 */ #ifndef N_SLCAN -#define N_SLCAN 17 /* bad hack until it's not inside the Kernel */ +#error Your kernel includes do not provide the needed line discipline. +#error This is a normal behaviour for Kernel versions < v2.6.25 . +#error You might update or patch your kernel OR you can just ignore +#error this compilation failure if you do not need the slcan driver. #endif void usage(char *name) diff --git a/vcan.c b/vcan.c index 90bd36d..80d39d5 100644 --- a/vcan.c +++ b/vcan.c @@ -28,17 +28,12 @@ #include -#if 0 -#define IFLA_LINKINFO 18 - -enum -{ - IFLA_INFO_UNSPEC, - IFLA_INFO_NAME, - IFLA_INFO_DATA, - IFLA_INFO_XSTATS, - __IFLA_INFO_MAX, -}; +#ifndef IFLA_LINKINFO +#error Your kernel includes do not provide the needed netlink interface function. +#error This is a normal behaviour for Kernel versions < v2.6.24 . +#error You don't need this tool for Kernel versions < v2.6.24 anyway, as +#error the number of vcan driver instances can be defined as a vcan.ko module +#error commandline parameter (default = 4) in older Kernels. #endif #define NLMSG_TAIL(nmsg) \ -- 2.7.4