Search Linux Wireless

Re: 2 compile errors: rt2x00firmware.c and mesh.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 03, 2008 at 01:32:11AM +0100, Johannes Berg wrote:
> 
> >    CC [M]
> > .../compat-wireless-2.6/drivers/net/wireless/rt2x00/rt2x00firmware.o
> > .../compat-wireless-2.6/drivers/net/wireless/rt2x00/rt2x00firmware.c:116:
> > Fehler: Redefinition von »rt2x00lib_load_firmware«
> > = Error: redefiniton of  »rt2x00lib_load_firmware«
> > 
> > When I tried to "export CONFIG_CRC_ITU_T=y" before "make", 
> > rt2x00firmware.c compiled fine. (Probably this is not a good idea. I 
> > just wanted to see, if it compiles then.)
> 
> That's odd because the latest config.mk should check for CRC_ITU_T
> before... Ivo could there be a problem with rt2x00 when crc-itu-t isn't
> available?

For now I'll disable rt2x00 in compat-wireless.

> > In /usr/src/linux-headers-2.6.22-14/include/linux/slab.h I found:
> >     struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
> > 		unsigned long,
> > 		void (*)(void *, struct kmem_cache *, unsigned long),
> > 		void (*)(void *, struct kmem_cache *, unsigned long));
> > i.e. the old, 6-parameter version.
> > 
> > So, IMHO the #define kmem_cache_create in
> > - compat-wireless-2.6/include/net/compat.h, line 120 and
> > - compat-wireless-2.6/compat/compat.h, line 120
> > should be moved 2 lines downwards into the block named
> > /* Compat work for 2.6.22 and 2.6.23 */
> > Then it compiles fine.
> 
> Ok, indeed, it should be moved then, I was working on .21 when I noticed
> that needed to be done.

OK -- this required a just slightly different approach to handle the
different kernel versions. Below is the approach I took. If you
apply this patch manually don't forget to

cp compat/compat.h include/net/compat.h

as this is what the autogeneration tool does.

Forced a new tarball out with new changes applied, would appreciate
some testing on 2.6.21, 2.6.22. You can get the tarball from the
usual place:

http://linuxwireless.org/download/compat-wireless-2.6/compat-wireless-2.6.tar.bz2

For those cloning please pull latest changes in.

diff --git a/compat/compat.h b/compat/compat.h
index ec966de..4ae26ac 100644
--- a/compat/compat.h
+++ b/compat/compat.h
@@ -130,23 +130,36 @@ static inline void pci_clear_mwi(struct pci_dev *dev)
 #define list_first_entry(ptr, type, member) \
         list_entry((ptr)->next, type, member)
 
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)) */
+
+/* Compat work for 2.6.21, 2.6.22 and 2.6.23 */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
+
 /*
  * Force link bug if constructor is used, can't be done compatibly
  * because constructor arguments were swapped since then!
  */
 extern void __incompatible_kmem_cache_create(void);
 
+/* 2.6.21 and 2.6.22 kmem_cache_create() takes 6 arguments */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23))
 #define kmem_cache_create(name, objsize, align, flags, ctor) 	\
 	({							\
 		if (ctor) __incompatible_kmem_cache_create();	\
 		kmem_cache_create((name), (objsize), (align),	\
 				  (flags), NULL, NULL);		\
 	})
-
 #endif
 
-/* Compat work for 2.6.22 and 2.6.23 */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
+/* 2.6.23 kmem_cache_create() takes 5 arguments */
+#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,6,23))
+#define kmem_cache_create(name, objsize, align, flags, ctor) 	\
+	({							\
+		if (ctor) __incompatible_kmem_cache_create();	\
+		kmem_cache_create((name), (objsize), (align),	\
+				  (flags), NULL);		\
+	})
+#endif
 
 /* From include/linux/mod_devicetable.h */
 
@@ -254,7 +267,7 @@ int compat_is_pcie(struct pci_dev *pdev);
 
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) */
 
-/* Compat work for 2.6.22 */
+/* Compat work for kernels <= 2.6.22 */
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23))
 
 /* dev_mc_list was replaced with dev_addr_list as of 2.6.23 */
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux