linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfg80211: fix Kconfig for users of cfg80211
@ 2009-06-03 16:30 Johannes Berg
  2009-06-03 17:18 ` Randy Dunlap
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Johannes Berg @ 2009-06-03 16:30 UTC (permalink / raw)
  To: John Linville; +Cc: Randy Dunlap, linux-wireless, Samuel Ortiz, Jussi Kivilinna

 * iwm doesn't depend on cfg80211 or wireless extensions
 * rndis wlan selects cfg80211 - needs to depend
 * mac80211 selects cfg80211 - needs to depend

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 drivers/net/wireless/Kconfig              |    2 +-
 drivers/net/wireless/iwmc3200wifi/Kconfig |    2 ++
 net/mac80211/Kconfig                      |    5 ++++-
 3 files changed, 7 insertions(+), 2 deletions(-)

--- wireless-testing.orig/net/mac80211/Kconfig	2009-06-03 18:20:06.000000000 +0200
+++ wireless-testing/net/mac80211/Kconfig	2009-06-03 18:24:58.000000000 +0200
@@ -1,16 +1,19 @@
 config MAC80211
 	tristate "Generic IEEE 802.11 Networking Stack (mac80211)"
+	depends on CFG80211
 	select CRYPTO
 	select CRYPTO_ECB
 	select CRYPTO_ARC4
 	select CRYPTO_AES
 	select CRC32
 	select WIRELESS_EXT
-	select CFG80211
 	---help---
 	  This option enables the hardware independent IEEE 802.11
 	  networking stack.
 
+comment "CFG80211 needs to be enabled for MAC80211"
+	depends on CFG80211=n
+
 config MAC80211_DEFAULT_PS
 	bool "enable powersave by default"
 	depends on MAC80211
--- wireless-testing.orig/drivers/net/wireless/iwmc3200wifi/Kconfig	2009-06-03 18:25:55.000000000 +0200
+++ wireless-testing/drivers/net/wireless/iwmc3200wifi/Kconfig	2009-06-03 18:26:29.000000000 +0200
@@ -1,6 +1,8 @@
 config IWM
 	tristate "Intel Wireless Multicomm 3200 WiFi driver"
 	depends on MMC && WLAN_80211 && EXPERIMENTAL
+	depends on CFG80211
+	select WIRELESS_EXT
 	select LIB80211
 	select FW_LOADER
 
--- wireless-testing.orig/drivers/net/wireless/Kconfig	2009-06-03 18:26:37.000000000 +0200
+++ wireless-testing/drivers/net/wireless/Kconfig	2009-06-03 18:26:46.000000000 +0200
@@ -333,11 +333,11 @@ config USB_ZD1201
 config USB_NET_RNDIS_WLAN
 	tristate "Wireless RNDIS USB support"
 	depends on USB && WLAN_80211 && EXPERIMENTAL
+	depends on CFG80211
 	select USB_USBNET
 	select USB_NET_CDCETHER
 	select USB_NET_RNDIS_HOST
 	select WIRELESS_EXT
-	select CFG80211
 	---help---
 	  This is a driver for wireless RNDIS devices.
 	  These are USB based adapters found in devices such as:



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cfg80211: fix Kconfig for users of cfg80211
  2009-06-03 16:30 [PATCH] cfg80211: fix Kconfig for users of cfg80211 Johannes Berg
@ 2009-06-03 17:18 ` Randy Dunlap
  2009-06-03 19:15 ` Dave
  2009-06-03 23:58 ` Samuel Ortiz
  2 siblings, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2009-06-03 17:18 UTC (permalink / raw)
  To: Johannes Berg
  Cc: John Linville, linux-wireless, Samuel Ortiz, Jussi Kivilinna

Johannes Berg wrote:
>  * iwm doesn't depend on cfg80211 or wireless extensions
>  * rndis wlan selects cfg80211 - needs to depend
>  * mac80211 selects cfg80211 - needs to depend
> 
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

Thanks.  This fixes the reported build errors.
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>


I'll reply to the other email thread about similar errors in wimax-land.

> ---
>  drivers/net/wireless/Kconfig              |    2 +-
>  drivers/net/wireless/iwmc3200wifi/Kconfig |    2 ++
>  net/mac80211/Kconfig                      |    5 ++++-
>  3 files changed, 7 insertions(+), 2 deletions(-)
> 
> --- wireless-testing.orig/net/mac80211/Kconfig	2009-06-03 18:20:06.000000000 +0200
> +++ wireless-testing/net/mac80211/Kconfig	2009-06-03 18:24:58.000000000 +0200
> @@ -1,16 +1,19 @@
>  config MAC80211
>  	tristate "Generic IEEE 802.11 Networking Stack (mac80211)"
> +	depends on CFG80211
>  	select CRYPTO
>  	select CRYPTO_ECB
>  	select CRYPTO_ARC4
>  	select CRYPTO_AES
>  	select CRC32
>  	select WIRELESS_EXT
> -	select CFG80211
>  	---help---
>  	  This option enables the hardware independent IEEE 802.11
>  	  networking stack.
>  
> +comment "CFG80211 needs to be enabled for MAC80211"
> +	depends on CFG80211=n
> +
>  config MAC80211_DEFAULT_PS
>  	bool "enable powersave by default"
>  	depends on MAC80211
> --- wireless-testing.orig/drivers/net/wireless/iwmc3200wifi/Kconfig	2009-06-03 18:25:55.000000000 +0200
> +++ wireless-testing/drivers/net/wireless/iwmc3200wifi/Kconfig	2009-06-03 18:26:29.000000000 +0200
> @@ -1,6 +1,8 @@
>  config IWM
>  	tristate "Intel Wireless Multicomm 3200 WiFi driver"
>  	depends on MMC && WLAN_80211 && EXPERIMENTAL
> +	depends on CFG80211
> +	select WIRELESS_EXT
>  	select LIB80211
>  	select FW_LOADER
>  
> --- wireless-testing.orig/drivers/net/wireless/Kconfig	2009-06-03 18:26:37.000000000 +0200
> +++ wireless-testing/drivers/net/wireless/Kconfig	2009-06-03 18:26:46.000000000 +0200
> @@ -333,11 +333,11 @@ config USB_ZD1201
>  config USB_NET_RNDIS_WLAN
>  	tristate "Wireless RNDIS USB support"
>  	depends on USB && WLAN_80211 && EXPERIMENTAL
> +	depends on CFG80211
>  	select USB_USBNET
>  	select USB_NET_CDCETHER
>  	select USB_NET_RNDIS_HOST
>  	select WIRELESS_EXT
> -	select CFG80211
>  	---help---
>  	  This is a driver for wireless RNDIS devices.
>  	  These are USB based adapters found in devices such as:
> 
> 


-- 
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cfg80211: fix Kconfig for users of cfg80211
  2009-06-03 16:30 [PATCH] cfg80211: fix Kconfig for users of cfg80211 Johannes Berg
  2009-06-03 17:18 ` Randy Dunlap
@ 2009-06-03 19:15 ` Dave
  2009-06-03 19:24   ` John W. Linville
  2009-06-04  6:19   ` Johannes Berg
  2009-06-03 23:58 ` Samuel Ortiz
  2 siblings, 2 replies; 7+ messages in thread
From: Dave @ 2009-06-03 19:15 UTC (permalink / raw)
  To: Johannes Berg
  Cc: John Linville, Randy Dunlap, linux-wireless, Samuel Ortiz,
	Jussi Kivilinna

Johannes Berg wrote:
>  * iwm doesn't depend on cfg80211 or wireless extensions
>  * rndis wlan selects cfg80211 - needs to depend
>  * mac80211 selects cfg80211 - needs to depend

Hmm. Consider:

1. User using a rndis_wlan device on old kernel with cfg80211 unselected.
2. Upgrades kernel with make old_config

Result: the rndis_wlan driver is no longer configured to build.

I don't think it's a big issue, as you can reconfigure and rebuild as
soon as you realise. But you may have to 'realise' without google access.

The only reason I'm thinking of this is because orinoco may be in the
same boat shortly. Ditto other wireless drivers as they get converted.
So I had a play with Kconfig. How about something like the patch below
instead?

cfg80211 should just get autoselected in the most appropriate mode, and
drivers get the same restrictions as cfg80211. The option setting
appears to work fine, but I haven't done any build testing.

It might be possible to chain things like this, so mac80211 could be
done in the same way. But I guess we wouldn't want too much of this
going on...



Dave.

---
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index a67d292..9038bd6 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -333,11 +333,12 @@ config USB_ZD1201
 config USB_NET_RNDIS_WLAN
        tristate "Wireless RNDIS USB support"
        depends on USB && WLAN_80211 && EXPERIMENTAL
+       depends on CFG80211_AS_MODULE
        select USB_USBNET
        select USB_NET_CDCETHER
        select USB_NET_RNDIS_HOST
        select WIRELESS_EXT
-       select CFG80211
+       select CFG80211_USED
        ---help---
          This is a driver for wireless RNDIS devices.
          These are USB based adapters found in devices such as:
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
index 9cbf545..2de2bd8 100644
--- a/net/mac80211/Kconfig
+++ b/net/mac80211/Kconfig
@@ -1,12 +1,14 @@
+# If cfg80211 has to be configured as a module, so do we
 config MAC80211
        tristate "Generic IEEE 802.11 Networking Stack (mac80211)"
+       depends on CFG80211_AS_MODULE
        select CRYPTO
        select CRYPTO_ECB
        select CRYPTO_ARC4
        select CRYPTO_AES
        select CRC32
        select WIRELESS_EXT
-       select CFG80211
+       select CFG80211_USED
        ---help---
          This option enables the hardware independent IEEE 802.11
          networking stack.
diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig
index 4428dd5..d3f08c4 100644
--- a/net/wireless/Kconfig
+++ b/net/wireless/Kconfig
@@ -1,6 +1,23 @@
-config CFG80211
-       tristate "Improved wireless configuration API"
+# Selected by drivers which use cfg80211
+config CFG80211_USED
+       tristate
+
+# Is cfg80211 restricted to being a module by its dependencies?
+# Drivers must depend on this so they inherit the restriction.
+#
+# Careful: m means that CFG80211 is restricted to being a module
+#          Both n and y mean there is no restriction
+config CFG80211_AS_MODULE
+       tristate
        depends on RFKILL || !RFKILL
+       default y
+
+# Avoid presenting a UI option so we inherit the value of CFG80211_USED
+# If one driver is set to m, and another to y, CFG80211_USED will be y.
+config CFG80211
+       tristate
+       depends on CFG80211_AS_MODULE
+       default CFG80211_USED

 config CFG80211_REG_DEBUG
        bool "cfg80211 regulatory debugging"


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] cfg80211: fix Kconfig for users of cfg80211
  2009-06-03 19:15 ` Dave
@ 2009-06-03 19:24   ` John W. Linville
  2009-06-04  6:19   ` Johannes Berg
  1 sibling, 0 replies; 7+ messages in thread
From: John W. Linville @ 2009-06-03 19:24 UTC (permalink / raw)
  To: Dave
  Cc: Johannes Berg, Randy Dunlap, linux-wireless, Samuel Ortiz,
	Jussi Kivilinna

On Wed, Jun 03, 2009 at 08:15:31PM +0100, Dave wrote:
> Johannes Berg wrote:
> >  * iwm doesn't depend on cfg80211 or wireless extensions
> >  * rndis wlan selects cfg80211 - needs to depend
> >  * mac80211 selects cfg80211 - needs to depend
> 
> Hmm. Consider:
> 
> 1. User using a rndis_wlan device on old kernel with cfg80211 unselected.
> 2. Upgrades kernel with make old_config
> 
> Result: the rndis_wlan driver is no longer configured to build.
> 
> I don't think it's a big issue, as you can reconfigure and rebuild as
> soon as you realise. But you may have to 'realise' without google access.
> 
> The only reason I'm thinking of this is because orinoco may be in the
> same boat shortly. Ditto other wireless drivers as they get converted.
> So I had a play with Kconfig. How about something like the patch below
> instead?
> 
> cfg80211 should just get autoselected in the most appropriate mode, and
> drivers get the same restrictions as cfg80211. The option setting
> appears to work fine, but I haven't done any build testing.
> 
> It might be possible to chain things like this, so mac80211 could be
> done in the same way. But I guess we wouldn't want too much of this
> going on...

This patch reminds me of why I hate Kconfig...

If you decide to post it for merging, please include a thorough
description of how it works for those of us with sore brains.

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cfg80211: fix Kconfig for users of cfg80211
  2009-06-03 16:30 [PATCH] cfg80211: fix Kconfig for users of cfg80211 Johannes Berg
  2009-06-03 17:18 ` Randy Dunlap
  2009-06-03 19:15 ` Dave
@ 2009-06-03 23:58 ` Samuel Ortiz
  2009-06-04  0:41   ` John W. Linville
  2 siblings, 1 reply; 7+ messages in thread
From: Samuel Ortiz @ 2009-06-03 23:58 UTC (permalink / raw)
  To: Johannes Berg
  Cc: John Linville, Randy Dunlap, linux-wireless, Jussi Kivilinna,
	yi.zhu

Hi Johannes

On Wed, 2009-06-03 at 18:30 +0200, Johannes Berg wrote:
> * iwm doesn't depend on cfg80211 or wireless extensions
This one will conflict with a patch Yi sent a week ago.
Dave Miller applied it to his net-next-2.6 tree, commit
d0fc1d5e3fe869f8a32a2bc1dd02d8383a057164.
See also:
http://marc.info/?l=linux-wireless&m=124331653022408&w=2

Cheers,
Samuel.


>  * rndis wlan selects cfg80211 - needs to depend
>  * mac80211 selects cfg80211 - needs to depend
> 
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> ---
>  drivers/net/wireless/Kconfig              |    2 +-
>  drivers/net/wireless/iwmc3200wifi/Kconfig |    2 ++
>  net/mac80211/Kconfig                      |    5 ++++-
>  3 files changed, 7 insertions(+), 2 deletions(-)
> 
> --- wireless-testing.orig/net/mac80211/Kconfig	2009-06-03 18:20:06.000000000 +0200
> +++ wireless-testing/net/mac80211/Kconfig	2009-06-03 18:24:58.000000000 +0200
> @@ -1,16 +1,19 @@
>  config MAC80211
>  	tristate "Generic IEEE 802.11 Networking Stack (mac80211)"
> +	depends on CFG80211
>  	select CRYPTO
>  	select CRYPTO_ECB
>  	select CRYPTO_ARC4
>  	select CRYPTO_AES
>  	select CRC32
>  	select WIRELESS_EXT
> -	select CFG80211
>  	---help---
>  	  This option enables the hardware independent IEEE 802.11
>  	  networking stack.
>  
> +comment "CFG80211 needs to be enabled for MAC80211"
> +	depends on CFG80211=n
> +
>  config MAC80211_DEFAULT_PS
>  	bool "enable powersave by default"
>  	depends on MAC80211
> --- wireless-testing.orig/drivers/net/wireless/iwmc3200wifi/Kconfig	2009-06-03 18:25:55.000000000 +0200
> +++ wireless-testing/drivers/net/wireless/iwmc3200wifi/Kconfig	2009-06-03 18:26:29.000000000 +0200
> @@ -1,6 +1,8 @@
>  config IWM
>  	tristate "Intel Wireless Multicomm 3200 WiFi driver"
>  	depends on MMC && WLAN_80211 && EXPERIMENTAL
> +	depends on CFG80211
> +	select WIRELESS_EXT
>  	select LIB80211
>  	select FW_LOADER
>  
> --- wireless-testing.orig/drivers/net/wireless/Kconfig	2009-06-03 18:26:37.000000000 +0200
> +++ wireless-testing/drivers/net/wireless/Kconfig	2009-06-03 18:26:46.000000000 +0200
> @@ -333,11 +333,11 @@ config USB_ZD1201
>  config USB_NET_RNDIS_WLAN
>  	tristate "Wireless RNDIS USB support"
>  	depends on USB && WLAN_80211 && EXPERIMENTAL
> +	depends on CFG80211
>  	select USB_USBNET
>  	select USB_NET_CDCETHER
>  	select USB_NET_RNDIS_HOST
>  	select WIRELESS_EXT
> -	select CFG80211
>  	---help---
>  	  This is a driver for wireless RNDIS devices.
>  	  These are USB based adapters found in devices such as:
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cfg80211: fix Kconfig for users of cfg80211
  2009-06-03 23:58 ` Samuel Ortiz
@ 2009-06-04  0:41   ` John W. Linville
  0 siblings, 0 replies; 7+ messages in thread
From: John W. Linville @ 2009-06-04  0:41 UTC (permalink / raw)
  To: Samuel Ortiz
  Cc: Johannes Berg, Randy Dunlap, linux-wireless, Jussi Kivilinna,
	yi.zhu

On Thu, Jun 04, 2009 at 01:58:09AM +0200, Samuel Ortiz wrote:
> Hi Johannes
> 
> On Wed, 2009-06-03 at 18:30 +0200, Johannes Berg wrote:
> > * iwm doesn't depend on cfg80211 or wireless extensions
> This one will conflict with a patch Yi sent a week ago.
> Dave Miller applied it to his net-next-2.6 tree, commit
> d0fc1d5e3fe869f8a32a2bc1dd02d8383a057164.
> See also:
> http://marc.info/?l=linux-wireless&m=124331653022408&w=2

Don't worry, I have the conflict resolved in wireless-next-2.6...

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cfg80211: fix Kconfig for users of cfg80211
  2009-06-03 19:15 ` Dave
  2009-06-03 19:24   ` John W. Linville
@ 2009-06-04  6:19   ` Johannes Berg
  1 sibling, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2009-06-04  6:19 UTC (permalink / raw)
  To: Dave
  Cc: John Linville, Randy Dunlap, linux-wireless, Samuel Ortiz,
	Jussi Kivilinna

[-- Attachment #1: Type: text/plain, Size: 4000 bytes --]

On Wed, 2009-06-03 at 20:15 +0100, Dave wrote:
> Johannes Berg wrote:
> >  * iwm doesn't depend on cfg80211 or wireless extensions
> >  * rndis wlan selects cfg80211 - needs to depend
> >  * mac80211 selects cfg80211 - needs to depend
> 
> Hmm. Consider:
> 
> 1. User using a rndis_wlan device on old kernel with cfg80211 unselected.
> 2. Upgrades kernel with make old_config
> 
> Result: the rndis_wlan driver is no longer configured to build.
> 
> I don't think it's a big issue, as you can reconfigure and rebuild as
> soon as you realise. But you may have to 'realise' without google access.

Yeah, I know that can happen. That's why I added the note that gets
displayed if you _don't_ have cfg80211 instead of mac80211 when it can't
be selected. I don't think it's a huge issue.

> The only reason I'm thinking of this is because orinoco may be in the
> same boat shortly. Ditto other wireless drivers as they get converted.
> So I had a play with Kconfig. How about something like the patch below
> instead?
> 
> cfg80211 should just get autoselected in the most appropriate mode, and
> drivers get the same restrictions as cfg80211. The option setting
> appears to work fine, but I haven't done any build testing.
> 
> It might be possible to chain things like this, so mac80211 could be
> done in the same way. But I guess we wouldn't want too much of this
> going on...
> 
> 
> 
> Dave.
> 
> ---
> diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
> index a67d292..9038bd6 100644
> --- a/drivers/net/wireless/Kconfig
> +++ b/drivers/net/wireless/Kconfig
> @@ -333,11 +333,12 @@ config USB_ZD1201
>  config USB_NET_RNDIS_WLAN
>         tristate "Wireless RNDIS USB support"
>         depends on USB && WLAN_80211 && EXPERIMENTAL
> +       depends on CFG80211_AS_MODULE
>         select USB_USBNET
>         select USB_NET_CDCETHER
>         select USB_NET_RNDIS_HOST
>         select WIRELESS_EXT
> -       select CFG80211
> +       select CFG80211_USED
>         ---help---
>           This is a driver for wireless RNDIS devices.
>           These are USB based adapters found in devices such as:
> diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
> index 9cbf545..2de2bd8 100644
> --- a/net/mac80211/Kconfig
> +++ b/net/mac80211/Kconfig
> @@ -1,12 +1,14 @@
> +# If cfg80211 has to be configured as a module, so do we
>  config MAC80211
>         tristate "Generic IEEE 802.11 Networking Stack (mac80211)"
> +       depends on CFG80211_AS_MODULE
>         select CRYPTO
>         select CRYPTO_ECB
>         select CRYPTO_ARC4
>         select CRYPTO_AES
>         select CRC32
>         select WIRELESS_EXT
> -       select CFG80211
> +       select CFG80211_USED
>         ---help---
>           This option enables the hardware independent IEEE 802.11
>           networking stack.
> diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig
> index 4428dd5..d3f08c4 100644
> --- a/net/wireless/Kconfig
> +++ b/net/wireless/Kconfig
> @@ -1,6 +1,23 @@
> -config CFG80211
> -       tristate "Improved wireless configuration API"
> +# Selected by drivers which use cfg80211
> +config CFG80211_USED
> +       tristate
> +
> +# Is cfg80211 restricted to being a module by its dependencies?
> +# Drivers must depend on this so they inherit the restriction.
> +#
> +# Careful: m means that CFG80211 is restricted to being a module
> +#          Both n and y mean there is no restriction
> +config CFG80211_AS_MODULE
> +       tristate
>         depends on RFKILL || !RFKILL
> +       default y
> +
> +# Avoid presenting a UI option so we inherit the value of CFG80211_USED
> +# If one driver is set to m, and another to y, CFG80211_USED will be y.
> +config CFG80211
> +       tristate
> +       depends on CFG80211_AS_MODULE
> +       default CFG80211_USED

Doesn't that mean you cannot ever select cfg80211 by itself? That's
kinda strange too.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-06-04  6:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-03 16:30 [PATCH] cfg80211: fix Kconfig for users of cfg80211 Johannes Berg
2009-06-03 17:18 ` Randy Dunlap
2009-06-03 19:15 ` Dave
2009-06-03 19:24   ` John W. Linville
2009-06-04  6:19   ` Johannes Berg
2009-06-03 23:58 ` Samuel Ortiz
2009-06-04  0:41   ` John W. Linville

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).