[PATCH] Re: Hostap and fedora

Pavel Roskin proski
Fri Apr 16 09:36:27 PDT 2004


On Fri, 16 Apr 2004, Rick Lim wrote:

> Hi there,
> I am using Fedora core 1 and trying to compile the Hostap driver 0.2.0 and I
> keep getting this error
[snip]
> driver/modules/hostap_compat.h:73: redefinition of `free_netdev'
> /usr/src/linux-2.4/include/linux/netdevice.h:877: `free_netdev' previously
> defined here

It happens because Fedora uses 2.4.22 kernel with patches that add
free_netdev(), which appeared in 2.4.23 kernel.  This problem has been
reported in many other drivers.  The solution used by Orinoco driver is to
use a macro instead of an inline function.  Nobody has complained so far.

While inline functions are better for active development because they
check the arguments and thus find errors in the new code, the macros are
safer for backwards compatibility because they can be undefined and
redefined to prevent conflicts.

The attached patch should help you.  It should also be applied to CVS.

-- 
Regards,
Pavel Roskin
-------------- next part --------------
--- driver/modules/hostap_compat.h
+++ driver/modules/hostap_compat.h
@@ -68,11 +68,7 @@
 #endif
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23))
-struct net_device;
-static inline void free_netdev(struct net_device *dev)
-{
-	kfree(dev);
-}
+#define free_netdev(dev) kfree(dev)
 #endif
 
 



More information about the Hostap mailing list