2 * Copyright 2004 Digi International (www.digi.com)
3 * Scott H Kilau <Scott_Kilau at digi dot com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
12 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 * PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 * NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
21 *************************************************************************
23 * This file is intended to contain all the kernel "differences" between the
24 * various kernels that we support.
26 *************************************************************************/
28 #ifndef __DGNC_KCOMPAT_H
29 #define __DGNC_KCOMPAT_H
31 #include <linux/version.h>
33 # ifndef KERNEL_VERSION
34 # define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
38 #if !defined(TTY_FLIPBUF_SIZE)
39 # define TTY_FLIPBUF_SIZE 512
49 # define __chk_user_ptr(x) (void)0
53 # define PARM_STR(VAR, INIT, PERM, DESC) \
54 static char *VAR = INIT; \
56 module_param(VAR, charp, PERM); \
57 MODULE_PARM_DESC(VAR, DESC);
59 # define PARM_INT(VAR, INIT, PERM, DESC) \
60 static int VAR = INIT; \
62 module_param(VAR, int, PERM); \
63 MODULE_PARM_DESC(VAR, DESC);
65 # define PARM_ULONG(VAR, INIT, PERM, DESC) \
66 static ulong VAR = INIT; \
68 module_param(VAR, long, PERM); \
69 MODULE_PARM_DESC(VAR, DESC);
75 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
87 # error "this driver does not support anything below the 2.6.27 kernel series."
93 #endif /* ! __DGNC_KCOMPAT_H */