2007-04-26 09:41:04

by Johannes Berg

[permalink] [raw]
Subject: [PATCH 9/9] net_device: dont include wext bits if not required

This patch makes the wext bits in struct net_device depend on
CONFIG_WIRELESS_EXT.

Signed-off-by: Johannes Berg <[email protected]>

---
include/linux/netdevice.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- net-2.6.22.orig/include/linux/netdevice.h 2007-04-24 19:36:59.248804911 +0200
+++ net-2.6.22/include/linux/netdevice.h 2007-04-24 19:37:31.608804911 +0200
@@ -352,12 +352,13 @@ struct net_device
struct net_device_stats* (*get_stats)(struct net_device *dev);
struct net_device_stats stats;

+#ifdef CONFIG_WIRELESS_EXT
/* List of functions to handle Wireless Extensions (instead of ioctl).
* See <net/iw_handler.h> for details. Jean II */
const struct iw_handler_def * wireless_handlers;
/* Instance data managed by the core of Wireless Extensions. */
struct iw_public_data * wireless_data;
-
+#endif
const struct ethtool_ops *ethtool_ops;

/*

--



2007-04-27 01:33:28

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH 9/9] net_device: dont include wext bits if not required

On Thu, Apr 26, 2007 at 09:53:04AM -0700, Jean Tourrilhes wrote:
> On Tue, Apr 24, 2007 at 08:07:41PM +0200, Johannes Berg wrote:
> > This patch makes the wext bits in struct net_device depend on
> > CONFIG_WIRELESS_EXT.
> >
> > Signed-off-by: Johannes Berg <[email protected]>
>
> I personally would not do that. Having conditional fields in
> "struct net_device" is very bad, it's a sure way to crash on modules
> in some cases. If I remember well, Jeff Garzik has been fighting those
> over the years.

I'm not sure I understand the reasoning here. Without a doubt kernel
modules need to be built against the same configuration as the kernels
that are loading them. So, conditional component of net_device should
not cause crashes.

FWIW, there are other conditionally compiled portions of net_device
(NETPOLL, NET_POLL_CONTROLLER). I don't see the harm here.

John
--
John W. Linville
[email protected]

2007-04-26 16:53:07

by Jean Tourrilhes

[permalink] [raw]
Subject: Re: [PATCH 9/9] net_device: dont include wext bits if not required

On Tue, Apr 24, 2007 at 08:07:41PM +0200, Johannes Berg wrote:
> This patch makes the wext bits in struct net_device depend on
> CONFIG_WIRELESS_EXT.
>
> Signed-off-by: Johannes Berg <[email protected]>

I personally would not do that. Having conditional fields in
"struct net_device" is very bad, it's a sure way to crash on modules
in some cases. If I remember well, Jeff Garzik has been fighting those
over the years.

Jean

2007-04-26 17:08:41

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 9/9] net_device: dont include wext bits if not required

On Thu, 2007-04-26 at 09:53 -0700, Jean Tourrilhes wrote:

> I personally would not do that. Having conditional fields in
> "struct net_device" is very bad, it's a sure way to crash on modules
> in some cases. If I remember well, Jeff Garzik has been fighting those
> over the years.

I'm fine with posting a patch the other way around (i.e. removing the
conditional from wireless-dev) just wanted to float this. It originally
made much more sense anyway when I had wanted to do cfg80211/wext
compatibility in a different way. Now it looks like it'll just depend on
wext.

johannes


Attachments:
signature.asc (190.00 B)
This is a digitally signed message part