RE: Build fails on 2.6.16 Fedora kernel

Richard Kennedy <[email protected]> Fri, 31 Mar 2006 20:23:19 +0100
Newsgroups gmane.linux.linux-wlan.user
Message-ID <[email protected]>
Hi
The fedora build system has a different set of kernel headers for
building user space apps. This has been giving me lots of warnings and I
have been working on a patch to remove/reduce them.
It looks like the helper apps like mkmeta* are the one that are failing
so...

Does this patch help your problem? This patch reorders wlan_compat so
that there's an #if __KERNEL__ to guard everything that needs it. And
stops gcc throwing so many warnings. Maybe it will help. 

Is that a development kernel or have I missed any update somewhere?

I'll look into this tomorrow, all being well.  :) 

HTH
richard

_______________________________________________
Linux-wlan-user mailing list
[email protected]
http://lists.linux-wlan.com/mailman/listinfo/linux-wlan-user
compat-fix.patch (text/x-patch, 8.3 KB)
Index: src/include/wlan/wlan_compat.h
===================================================================
--- src/include/wlan/wlan_compat.h	(revision 1769)
+++ src/include/wlan/wlan_compat.h	(working copy)
@@ -49,6 +49,118 @@
 #define _WLAN_COMPAT_H
 
 /*=============================================================*/
+/*------ Bit settings -----------------------------------------*/
+/*=============================================================*/
+
+#define BIT0	0x00000001
+#define BIT1	0x00000002
+#define BIT2	0x00000004
+#define BIT3	0x00000008
+#define BIT4	0x00000010
+#define BIT5	0x00000020
+#define BIT6	0x00000040
+#define BIT7	0x00000080
+#define BIT8	0x00000100
+#define BIT9	0x00000200
+#define BIT10	0x00000400
+#define BIT11	0x00000800
+#define BIT12	0x00001000
+#define BIT13	0x00002000
+#define BIT14	0x00004000
+#define BIT15	0x00008000
+#define BIT16	0x00010000
+#define BIT17	0x00020000
+#define BIT18	0x00040000
+#define BIT19	0x00080000
+#define BIT20	0x00100000
+#define BIT21	0x00200000
+#define BIT22	0x00400000
+#define BIT23	0x00800000
+#define BIT24	0x01000000
+#define BIT25	0x02000000
+#define BIT26	0x04000000
+#define BIT27	0x08000000
+#define BIT28	0x10000000
+#define BIT29	0x20000000
+#define BIT30	0x40000000
+#define BIT31	0x80000000
+
+#include <linux/types.h>
+
+typedef u_int8_t	UINT8;
+typedef u_int16_t	UINT16;
+typedef u_int32_t	UINT32;
+
+typedef int8_t		INT8;
+typedef int16_t		INT16;
+typedef int32_t		INT32;
+
+typedef unsigned int    UINT;
+typedef signed int      INT;
+
+typedef u_int64_t	UINT64;
+typedef int64_t		INT64;
+
+#define UINT8_MAX	(0xffUL)
+#define UINT16_MAX	(0xffffUL)
+#define UINT32_MAX	(0xffffffffUL)
+
+#define INT8_MAX	(0x7fL)
+#define INT16_MAX	(0x7fffL)
+#define INT32_MAX	(0x7fffffffL)
+
+/*=============================================================*/
+/*------ Compiler Portability Macros --------------------------*/
+/*=============================================================*/
+#define __WLAN_ATTRIB_PACK__		__attribute__ ((packed))
+
+/*=============================================================*/
+/*------ OS Portability Macros --------------------------------*/
+/*=============================================================*/
+
+#ifndef WLAN_DBVAR
+#define WLAN_DBVAR	wlan_debug
+#endif
+
+#define wlan_minutes2ticks(a) ((a)*(wlan_ticks_per_sec *  60))
+#define wlan_seconds2ticks(a) ((a)*(wlan_ticks_per_sec))
+
+/*=============================================================*/
+/*--- General Macros ------------------------------------------*/
+/*=============================================================*/
+
+#define wlan_max(a, b) (((a) > (b)) ? (a) : (b))
+#define wlan_min(a, b) (((a) < (b)) ? (a) : (b))
+
+#define wlan_isprint(c)	(((c) > (0x19)) && ((c) < (0x7f)))
+
+#define wlan_hexchar(x) (((x) < 0x0a) ? ('0' + (x)) : ('a' + ((x) - 0x0a)))
+
+/* Create a string of printable chars from something that might not be */
+/* It's recommended that the str be 4*len + 1 bytes long */
+#define wlan_mkprintstr(buf, buflen, str, strlen) \
+{ \
+	int i = 0; \
+	int j = 0; \
+	memset(str, 0, (strlen)); \
+	for (i = 0; i < (buflen); i++) { \
+		if ( wlan_isprint((buf)[i]) ) { \
+			(str)[j] = (buf)[i]; \
+			j++; \
+		} else { \
+			(str)[j] = '\\'; \
+			(str)[j+1] = 'x'; \
+			(str)[j+2] = wlan_hexchar(((buf)[i] & 0xf0) >> 4); \
+			(str)[j+3] = wlan_hexchar(((buf)[i] & 0x0f)); \
+			j += 4; \
+		} \
+	} \
+}
+
+
+#ifdef __KERNEL__
+
+/*=============================================================*/
 /*------ Establish Platform Identity --------------------------*/
 /*=============================================================*/
 /* Key macros: */
@@ -88,7 +200,6 @@
 #endif
 #endif
 
-#if defined(__KERNEL__)
 #if defined(__x86_64__)
 	#define WLAN_CPU_FAMILY		WLAN_x86_64
 	#define WLAN_SYSARCH		WLAN_PCAT
@@ -130,7 +241,6 @@
 #else
 	#error "No CPU identified!"
 #endif
-#endif /* __KERNEL__ */
 
 /*
    Some big endian machines implicitly do all I/O in little endian mode.
@@ -149,80 +259,7 @@
 #endif
 #endif
 
-/*=============================================================*/
-/*------ Bit settings -----------------------------------------*/
-/*=============================================================*/
 
-#define BIT0	0x00000001
-#define BIT1	0x00000002
-#define BIT2	0x00000004
-#define BIT3	0x00000008
-#define BIT4	0x00000010
-#define BIT5	0x00000020
-#define BIT6	0x00000040
-#define BIT7	0x00000080
-#define BIT8	0x00000100
-#define BIT9	0x00000200
-#define BIT10	0x00000400
-#define BIT11	0x00000800
-#define BIT12	0x00001000
-#define BIT13	0x00002000
-#define BIT14	0x00004000
-#define BIT15	0x00008000
-#define BIT16	0x00010000
-#define BIT17	0x00020000
-#define BIT18	0x00040000
-#define BIT19	0x00080000
-#define BIT20	0x00100000
-#define BIT21	0x00200000
-#define BIT22	0x00400000
-#define BIT23	0x00800000
-#define BIT24	0x01000000
-#define BIT25	0x02000000
-#define BIT26	0x04000000
-#define BIT27	0x08000000
-#define BIT28	0x10000000
-#define BIT29	0x20000000
-#define BIT30	0x40000000
-#define BIT31	0x80000000
-
-#include <linux/types.h>
-
-typedef u_int8_t	UINT8;
-typedef u_int16_t	UINT16;
-typedef u_int32_t	UINT32;
-
-typedef int8_t		INT8;
-typedef int16_t		INT16;
-typedef int32_t		INT32;
-
-typedef unsigned int    UINT;
-typedef signed int      INT;
-
-typedef u_int64_t	UINT64;
-typedef int64_t		INT64;
-
-#define UINT8_MAX	(0xffUL)
-#define UINT16_MAX	(0xffffUL)
-#define UINT32_MAX	(0xffffffffUL)
-
-#define INT8_MAX	(0x7fL)
-#define INT16_MAX	(0x7fffL)
-#define INT32_MAX	(0x7fffffffL)
-
-/*=============================================================*/
-/*------ Compiler Portability Macros --------------------------*/
-/*=============================================================*/
-#define __WLAN_ATTRIB_PACK__		__attribute__ ((packed))
-
-/*=============================================================*/
-/*------ OS Portability Macros --------------------------------*/
-/*=============================================================*/
-
-#ifndef WLAN_DBVAR
-#define WLAN_DBVAR	wlan_debug
-#endif
-
 #ifndef KERNEL_VERSION
 #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
 #endif
@@ -272,7 +309,6 @@
 #define __SMP__			1
 #endif	
 
-#if defined(__KERNEL__)
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7))
 #  define del_singleshot_timer_sync(a)  del_timer_sync(a)
@@ -535,8 +571,6 @@
 #define MODULE_DEVICE_TABLE(foo,bar)
 #endif
 
-#define wlan_minutes2ticks(a) ((a)*(wlan_ticks_per_sec *  60))
-#define wlan_seconds2ticks(a) ((a)*(wlan_ticks_per_sec))
 
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,47))
 #define NEW_MODULE_CODE
@@ -650,8 +684,6 @@
         CardServices(ReportError, handle, err)
 #endif
 
-#endif /* __KERNEL__ */
-
 /*=============================================================*/
 /*------ Hardware Portability Macros --------------------------*/
 /*=============================================================*/
@@ -677,38 +709,7 @@
        #define wlan_outw_cpu_to_le16(v,a)      outw(__cpu_to_le16((v)),(a))
 #endif
 
-/*=============================================================*/
-/*--- General Macros ------------------------------------------*/
-/*=============================================================*/
 
-#define wlan_max(a, b) (((a) > (b)) ? (a) : (b))
-#define wlan_min(a, b) (((a) < (b)) ? (a) : (b))
-
-#define wlan_isprint(c)	(((c) > (0x19)) && ((c) < (0x7f)))
-
-#define wlan_hexchar(x) (((x) < 0x0a) ? ('0' + (x)) : ('a' + ((x) - 0x0a)))
-
-/* Create a string of printable chars from something that might not be */
-/* It's recommended that the str be 4*len + 1 bytes long */
-#define wlan_mkprintstr(buf, buflen, str, strlen) \
-{ \
-	int i = 0; \
-	int j = 0; \
-	memset(str, 0, (strlen)); \
-	for (i = 0; i < (buflen); i++) { \
-		if ( wlan_isprint((buf)[i]) ) { \
-			(str)[j] = (buf)[i]; \
-			j++; \
-		} else { \
-			(str)[j] = '\\'; \
-			(str)[j+1] = 'x'; \
-			(str)[j+2] = wlan_hexchar(((buf)[i] & 0xf0) >> 4); \
-			(str)[j+3] = wlan_hexchar(((buf)[i] & 0x0f)); \
-			j += 4; \
-		} \
-	} \
-}
-
 /*=============================================================*/
 /*--- Variables -----------------------------------------------*/
 /*=============================================================*/
@@ -722,5 +723,8 @@
 /*=============================================================*/
 /*--- Functions -----------------------------------------------*/
 /*=============================================================*/
+
+#endif /*__KERNEL__ */
+
 #endif /* _WLAN_COMPAT_H */