All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Denis Vlasenko <vda@ilport.com.ua>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	"Gabriel C." <crazy@pimpmylinux.org>,
	da.crew@gmx.net, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: [-mm patch] let only ACX_PCI/ACX_USB be user-visible and select ACX accordingly
Date: Sun, 5 Feb 2006 06:02:32 +0100	[thread overview]
Message-ID: <20060205050232.GB5271@stusta.de> (raw)
In-Reply-To: <200602010857.04964.vda@ilport.com.ua>

On Wed, Feb 01, 2006 at 08:57:04AM +0200, Denis Vlasenko wrote:
> On Wednesday 01 February 2006 00:16, Adrian Bunk wrote:
> > > > > CONFIG_ACX=y
> > > > > # CONFIG_ACX_PCI is not set
> > > > > # CONFIG_ACX_USB is not set
> > > > > 
> > > > > This won't fly. You must select at least one.
> > > > > 
> > > > > Attached patch will check for this and #error out.
> > > > > Andrew, do not apply to -mm, I'll send you bigger update today.
> > > > 
> > > > Is there any way to move this into a Kconfig file?  That seems nicer
> > > > than having #ifdefs in source code to check for a configuration error.
> > > 
> > > Can't think of any at the moment.
> > 
> > There are two possible solutions ("offer" means "is user visible"):
> > - only offer ACX and always build ACX_PCI/ACX_USB depending on the
> >   availability of PCI/USB
> > - only offer ACX_PCI and ACX_USB which select ACX
> > 
> > If you tell me which you prefer I can send a patch.
> 
> Second one sounds okay to me.

The patch is below.

I've promised a bit too much, there's one small problem in this patch:

If the user says y to one option and m to the other, the driver is built 
statically supporting both.

Unfortunately, I don't see any reasonable way to implement this better 
(but I do still prefer this solution over the #error).

> vda

cu
Adrian


<--  snip  -->


Let only ACX_PCI/ACX_USB be user-visible and select ACX accordingly.


Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 drivers/net/wireless/tiacx/Kconfig      |   43 +++++++++++++-----------
 drivers/net/wireless/tiacx/Makefile     |    4 +-
 drivers/net/wireless/tiacx/acx_struct.h |   12 ++----
 drivers/net/wireless/tiacx/common.c     |    8 ++--
 4 files changed, 34 insertions(+), 33 deletions(-)


--- linux-2.6.16-rc1-mm5-full/drivers/net/wireless/tiacx/Kconfig.old	2006-02-05 03:48:32.000000000 +0100
+++ linux-2.6.16-rc1-mm5-full/drivers/net/wireless/tiacx/Kconfig	2006-02-05 05:31:54.000000000 +0100
@@ -1,25 +1,18 @@
 config ACX
-	tristate "TI acx100/acx111 802.11b/g wireless chipsets"
-	depends on NET_RADIO && EXPERIMENTAL && (USB || PCI)
+	tristate
 	select FW_LOADER
+
+config ACX_PCI
+	tristate "TI acx100/acx111 802.11b/g PCI wireless chipsets"
+	depends on NET_RADIO && EXPERIMENTAL && PCI && (USB || ACX_USB=n)
+	select ACX
+	select ACX_PCI_BOOL
 	---help---
-	A driver for 802.11b/g wireless cards based on
-	Texas Instruments acx100 and acx111 chipsets.
+	Include support for PCI and CardBus 802.11b/g wireless cards
+	based on Texas Instruments acx100 and acx111 chipsets.
 
 	This driver supports Host AP mode that allows
 	your computer to act as an IEEE 802.11 access point.
-	This driver is new and experimental.
-
-	Texas Instruments did not take part in development of this driver
-	in any way, shape or form.
-
-	The driver can be compiled as a module and will be named "acx".
-
-config ACX_PCI
-	bool "TI acx100/acx111 802.11b/g PCI"
-	depends on ACX && PCI
-	---help---
-	Include PCI and CardBus support in acx.
 
 	acx chipsets need their firmware loaded at startup.
 	You will need to provide a firmware image via hotplug.
@@ -44,11 +37,20 @@
 	Firmware files are not covered by GPL and are not distributed
 	with this driver for legal reasons.
 
+config ACX_PCI_BOOL
+	bool
+
 config ACX_USB
-	bool "TI acx100/acx111 802.11b/g USB"
-	depends on ACX && (USB=y || USB=ACX)
+	tristate "TI acx100/acx111 802.11b/g USB wireless chipsets"
+	depends on NET_RADIO && EXPERIMENTAL && USB
+	select ACX
+	select ACX_USB_BOOL
 	---help---
-	Include USB support in acx.
+	Include support for USB 802.11b/g wireless cards
+	based on Texas Instruments acx100 and acx111 chipsets.
+
+	This driver supports Host AP mode that allows
+	your computer to act as an IEEE 802.11 access point.
 
 	There is only one currently known device in this category,
 	D-Link DWL-120+, but newer devices seem to be on the horizon.
@@ -61,3 +63,6 @@
 
 	Firmware files are not covered by GPL and are not distributed
 	with this driver for legal reasons.
+
+config ACX_USB_BOOL
+	bool
--- linux-2.6.16-rc1-mm5-full/drivers/net/wireless/tiacx/Makefile.old	2006-02-05 05:25:03.000000000 +0100
+++ linux-2.6.16-rc1-mm5-full/drivers/net/wireless/tiacx/Makefile	2006-02-05 05:25:17.000000000 +0100
@@ -1,6 +1,6 @@
 obj-$(CONFIG_ACX) += acx.o
 
-acx-obj-$(CONFIG_ACX_PCI) += pci.o
-acx-obj-$(CONFIG_ACX_USB) += usb.o
+acx-obj-$(CONFIG_ACX_PCI_BOOL) += pci.o
+acx-obj-$(CONFIG_ACX_USB_BOOL) += usb.o
 
 acx-objs := wlan.o conv.o ioctl.o common.o $(acx-obj-y)
--- linux-2.6.16-rc1-mm5-full/drivers/net/wireless/tiacx/acx_struct.h.old	2006-02-05 05:37:13.000000000 +0100
+++ linux-2.6.16-rc1-mm5-full/drivers/net/wireless/tiacx/acx_struct.h	2006-02-05 05:37:35.000000000 +0100
@@ -105,12 +105,8 @@
 #define DEVTYPE_PCI		0
 #define DEVTYPE_USB		1
 
-#if !defined(CONFIG_ACX_PCI) && !defined(CONFIG_ACX_USB)
-#error Driver must include PCI and/or USB support. You selected neither.
-#endif
-
-#if defined(CONFIG_ACX_PCI)
- #if !defined(CONFIG_ACX_USB)
+#if defined(CONFIG_ACX_PCI_BOOL)
+ #if !defined(CONFIG_ACX_USB_BOOL)
   #define IS_PCI(adev)	1
  #else
   #define IS_PCI(adev)	((adev)->dev_type == DEVTYPE_PCI)
@@ -119,8 +115,8 @@
  #define IS_PCI(adev)	0
 #endif
 
-#if defined(CONFIG_ACX_USB)
- #if !defined(CONFIG_ACX_PCI)
+#if defined(CONFIG_ACX_USB_BOOL)
+ #if !defined(CONFIG_ACX_PCI_BOOL)
   #define IS_USB(adev)	1
  #else
   #define IS_USB(adev)	((adev)->dev_type == DEVTYPE_USB)
--- linux-2.6.16-rc1-mm5-full/drivers/net/wireless/tiacx/common.c.old	2006-02-05 05:37:44.000000000 +0100
+++ linux-2.6.16-rc1-mm5-full/drivers/net/wireless/tiacx/common.c	2006-02-05 05:38:58.000000000 +0100
@@ -6853,12 +6853,12 @@
 		"recommended, visit http://acx100.sf.net in case "
 		"of further questions/discussion\n");
 
-#if defined(CONFIG_ACX_PCI)
+#if defined(CONFIG_ACX_PCI_BOOL)
 	r1 = acxpci_e_init_module();
 #else
 	r1 = -EINVAL;
 #endif
-#if defined(CONFIG_ACX_USB)
+#if defined(CONFIG_ACX_USB_BOOL)
 	r2 = acxusb_e_init_module();
 #else
 	r2 = -EINVAL;
@@ -6872,10 +6872,10 @@
 static void __exit
 acx_e_cleanup_module(void)
 {
-#if defined(CONFIG_ACX_PCI)
+#if defined(CONFIG_ACX_PCI_BOOL)
 	acxpci_e_cleanup_module();
 #endif
-#if defined(CONFIG_ACX_USB)
+#if defined(CONFIG_ACX_USB_BOOL)
 	acxusb_e_cleanup_module();
 #endif
 }


  reply	other threads:[~2006-02-05  5:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-30 12:38 2.6.16-rc1-mm4 Gabriel C.
2006-01-30 18:10 ` 2.6.16-rc1-mm4: ACX=y, ACX_USB=n compile error Adrian Bunk
2006-01-31  6:10   ` Denis Vlasenko
2006-01-31  9:03     ` Gabriel C.
2006-01-31 12:16       ` Denis Vlasenko
2006-01-31 14:54         ` John W. Linville
2006-01-31 14:58           ` Denis Vlasenko
2006-01-31 18:34             ` Gabriel C.
2006-01-31 18:59               ` Carlos Martín
2006-01-31 22:16             ` Adrian Bunk
2006-02-01  6:57               ` Denis Vlasenko
2006-02-05  5:02                 ` Adrian Bunk [this message]
2006-01-30 18:23 ` [2.6 patch] PCMCIA=m, HOSTAP_CS=y is not a legal configuration Adrian Bunk
2006-01-30 20:30   ` Gabriel C.
2006-01-31 16:19   ` John W. Linville

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060205050232.GB5271@stusta.de \
    --to=bunk@stusta.de \
    --cc=crazy@pimpmylinux.org \
    --cc=da.crew@gmx.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=vda@ilport.com.ua \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.