public inbox for b43-dev@lists.infradead.org
 help / color / mirror / Atom feed
* [RFC][PATCH] b43: replace B43_BCMA_EXTRA with modparam allhwsupport
@ 2013-06-25 15:34 Rafał Miłecki
  2013-06-25 17:23 ` John W. Linville
  2013-06-25 18:01 ` Jonas Gorski
  0 siblings, 2 replies; 4+ messages in thread
From: Rafał Miłecki @ 2013-06-25 15:34 UTC (permalink / raw)
  To: linux-wireless, John W. Linville; +Cc: b43-dev, Rafał Miłecki

This allows enabling support for extra hardware with just a module
param, without kernel/module recompilation.

Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
---
 drivers/net/wireless/b43/Kconfig |    6 ------
 drivers/net/wireless/b43/main.c  |   16 ++++++++++++++--
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig
index 3f21e0b..51ff0b1 100644
--- a/drivers/net/wireless/b43/Kconfig
+++ b/drivers/net/wireless/b43/Kconfig
@@ -31,12 +31,6 @@ config B43_BCMA
 	depends on B43 && (BCMA = y || BCMA = B43)
 	default y
 
-config B43_BCMA_EXTRA
-	bool "Hardware support that overlaps with the brcmsmac driver"
-	depends on B43_BCMA
-	default n if BRCMSMAC
-	default y
-
 config B43_SSB
 	bool
 	depends on B43 && (SSB = y || SSB = B43)
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index a95b77a..583993c 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -113,13 +113,19 @@ static int b43_modparam_pio = 0;
 module_param_named(pio, b43_modparam_pio, int, 0644);
 MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO");
 
+#ifdef CONFIG_BRCMSMAC
+static int modparam_allhwsupport;
+#else
+static int modparam_allhwsupport = 1;
+#endif
+module_param_named(allhwsupport, modparam_allhwsupport, int, 0444);
+MODULE_PARM_DESC(allhwsupport, "Enable support for all hardware (even it if overlaps with the brcmsmac driver)");
+
 #ifdef CONFIG_B43_BCMA
 static const struct bcma_device_id b43_bcma_tbl[] = {
 	BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x11, BCMA_ANY_CLASS),
-#ifdef CONFIG_B43_BCMA_EXTRA
 	BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x17, BCMA_ANY_CLASS),
 	BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x18, BCMA_ANY_CLASS),
-#endif
 	BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x1D, BCMA_ANY_CLASS),
 	BCMA_CORETABLE_END
 };
@@ -5396,6 +5402,12 @@ static int b43_bcma_probe(struct bcma_device *core)
 	struct b43_wl *wl;
 	int err;
 
+	if (!modparam_allhwsupport &&
+	    (core->id.rev == 0x17 || core->id.rev == 0x18)) {
+		pr_err("Support for cores revisions 0x17 and 0x18 disabled by module param allhwsupport=0. Try b43.allhwsupport=1\n");
+		return -ENOTSUPP;
+	}
+
 	dev = b43_bus_dev_bcma_init(core);
 	if (!dev)
 		return -ENODEV;
-- 
1.7.10.4

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

* [RFC][PATCH] b43: replace B43_BCMA_EXTRA with modparam allhwsupport
  2013-06-25 15:34 [RFC][PATCH] b43: replace B43_BCMA_EXTRA with modparam allhwsupport Rafał Miłecki
@ 2013-06-25 17:23 ` John W. Linville
  2013-06-25 18:01 ` Jonas Gorski
  1 sibling, 0 replies; 4+ messages in thread
From: John W. Linville @ 2013-06-25 17:23 UTC (permalink / raw)
  To: Rafał Miłecki; +Cc: linux-wireless, b43-dev

Seems OK to me...

On Tue, Jun 25, 2013 at 05:34:55PM +0200, Rafa? Mi?ecki wrote:
> This allows enabling support for extra hardware with just a module
> param, without kernel/module recompilation.
> 
> Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
> ---
>  drivers/net/wireless/b43/Kconfig |    6 ------
>  drivers/net/wireless/b43/main.c  |   16 ++++++++++++++--
>  2 files changed, 14 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig
> index 3f21e0b..51ff0b1 100644
> --- a/drivers/net/wireless/b43/Kconfig
> +++ b/drivers/net/wireless/b43/Kconfig
> @@ -31,12 +31,6 @@ config B43_BCMA
>  	depends on B43 && (BCMA = y || BCMA = B43)
>  	default y
>  
> -config B43_BCMA_EXTRA
> -	bool "Hardware support that overlaps with the brcmsmac driver"
> -	depends on B43_BCMA
> -	default n if BRCMSMAC
> -	default y
> -
>  config B43_SSB
>  	bool
>  	depends on B43 && (SSB = y || SSB = B43)
> diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
> index a95b77a..583993c 100644
> --- a/drivers/net/wireless/b43/main.c
> +++ b/drivers/net/wireless/b43/main.c
> @@ -113,13 +113,19 @@ static int b43_modparam_pio = 0;
>  module_param_named(pio, b43_modparam_pio, int, 0644);
>  MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO");
>  
> +#ifdef CONFIG_BRCMSMAC
> +static int modparam_allhwsupport;
> +#else
> +static int modparam_allhwsupport = 1;
> +#endif
> +module_param_named(allhwsupport, modparam_allhwsupport, int, 0444);
> +MODULE_PARM_DESC(allhwsupport, "Enable support for all hardware (even it if overlaps with the brcmsmac driver)");
> +
>  #ifdef CONFIG_B43_BCMA
>  static const struct bcma_device_id b43_bcma_tbl[] = {
>  	BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x11, BCMA_ANY_CLASS),
> -#ifdef CONFIG_B43_BCMA_EXTRA
>  	BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x17, BCMA_ANY_CLASS),
>  	BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x18, BCMA_ANY_CLASS),
> -#endif
>  	BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x1D, BCMA_ANY_CLASS),
>  	BCMA_CORETABLE_END
>  };
> @@ -5396,6 +5402,12 @@ static int b43_bcma_probe(struct bcma_device *core)
>  	struct b43_wl *wl;
>  	int err;
>  
> +	if (!modparam_allhwsupport &&
> +	    (core->id.rev == 0x17 || core->id.rev == 0x18)) {
> +		pr_err("Support for cores revisions 0x17 and 0x18 disabled by module param allhwsupport=0. Try b43.allhwsupport=1\n");
> +		return -ENOTSUPP;
> +	}
> +
>  	dev = b43_bus_dev_bcma_init(core);
>  	if (!dev)
>  		return -ENODEV;
> -- 
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

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

* [RFC][PATCH] b43: replace B43_BCMA_EXTRA with modparam allhwsupport
  2013-06-25 15:34 [RFC][PATCH] b43: replace B43_BCMA_EXTRA with modparam allhwsupport Rafał Miłecki
  2013-06-25 17:23 ` John W. Linville
@ 2013-06-25 18:01 ` Jonas Gorski
  2013-06-25 19:51   ` Rafał Miłecki
  1 sibling, 1 reply; 4+ messages in thread
From: Jonas Gorski @ 2013-06-25 18:01 UTC (permalink / raw)
  To: Rafał Miłecki; +Cc: linux-wireless, John W. Linville, b43-dev

On Tue, Jun 25, 2013 at 5:34 PM, Rafa? Mi?ecki <zajec5@gmail.com> wrote:
> This allows enabling support for extra hardware with just a module
> param, without kernel/module recompilation.
>
> Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
> ---
>  drivers/net/wireless/b43/Kconfig |    6 ------
>  drivers/net/wireless/b43/main.c  |   16 ++++++++++++++--
>  2 files changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig
> index 3f21e0b..51ff0b1 100644
> --- a/drivers/net/wireless/b43/Kconfig
> +++ b/drivers/net/wireless/b43/Kconfig
> @@ -31,12 +31,6 @@ config B43_BCMA
>         depends on B43 && (BCMA = y || BCMA = B43)
>         default y
>
> -config B43_BCMA_EXTRA
> -       bool "Hardware support that overlaps with the brcmsmac driver"
> -       depends on B43_BCMA
> -       default n if BRCMSMAC
> -       default y
> -
>  config B43_SSB
>         bool
>         depends on B43 && (SSB = y || SSB = B43)
> diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
> index a95b77a..583993c 100644
> --- a/drivers/net/wireless/b43/main.c
> +++ b/drivers/net/wireless/b43/main.c
> @@ -113,13 +113,19 @@ static int b43_modparam_pio = 0;
>  module_param_named(pio, b43_modparam_pio, int, 0644);
>  MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO");
>
> +#ifdef CONFIG_BRCMSMAC

This is only defined if BRCMSMAC is built-in, but not if it is built
as a module; then it's CONFIG_BRCMSMAC_MODULE, which is probably not
what you want. To easily catch both, use IS_ENABLED(CONFIG_BRCMSMAC).

> +static int modparam_allhwsupport;
> +#else
> +static int modparam_allhwsupport = 1;
> +#endif

And since IS_ENABLED returns 0 or 1 you should be able to reduce it to one line:

static int modparam_allhwsupport = !IS_ENABLED(CONFIG_BRCMSMAC);


Jonas

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

* [RFC][PATCH] b43: replace B43_BCMA_EXTRA with modparam allhwsupport
  2013-06-25 18:01 ` Jonas Gorski
@ 2013-06-25 19:51   ` Rafał Miłecki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafał Miłecki @ 2013-06-25 19:51 UTC (permalink / raw)
  To: Jonas Gorski; +Cc: linux-wireless, John W. Linville, b43-dev

2013/6/25 Jonas Gorski <jogo@openwrt.org>:
> On Tue, Jun 25, 2013 at 5:34 PM, Rafa? Mi?ecki <zajec5@gmail.com> wrote:
>> This allows enabling support for extra hardware with just a module
>> param, without kernel/module recompilation.
>>
>> Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
>> ---
>>  drivers/net/wireless/b43/Kconfig |    6 ------
>>  drivers/net/wireless/b43/main.c  |   16 ++++++++++++++--
>>  2 files changed, 14 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig
>> index 3f21e0b..51ff0b1 100644
>> --- a/drivers/net/wireless/b43/Kconfig
>> +++ b/drivers/net/wireless/b43/Kconfig
>> @@ -31,12 +31,6 @@ config B43_BCMA
>>         depends on B43 && (BCMA = y || BCMA = B43)
>>         default y
>>
>> -config B43_BCMA_EXTRA
>> -       bool "Hardware support that overlaps with the brcmsmac driver"
>> -       depends on B43_BCMA
>> -       default n if BRCMSMAC
>> -       default y
>> -
>>  config B43_SSB
>>         bool
>>         depends on B43 && (SSB = y || SSB = B43)
>> diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
>> index a95b77a..583993c 100644
>> --- a/drivers/net/wireless/b43/main.c
>> +++ b/drivers/net/wireless/b43/main.c
>> @@ -113,13 +113,19 @@ static int b43_modparam_pio = 0;
>>  module_param_named(pio, b43_modparam_pio, int, 0644);
>>  MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO");
>>
>> +#ifdef CONFIG_BRCMSMAC
>
> This is only defined if BRCMSMAC is built-in, but not if it is built
> as a module; then it's CONFIG_BRCMSMAC_MODULE, which is probably not
> what you want. To easily catch both, use IS_ENABLED(CONFIG_BRCMSMAC).
>
>> +static int modparam_allhwsupport;
>> +#else
>> +static int modparam_allhwsupport = 1;
>> +#endif
>
> And since IS_ENABLED returns 0 or 1 you should be able to reduce it to one line:
>
> static int modparam_allhwsupport = !IS_ENABLED(CONFIG_BRCMSMAC);

I love learning new tricks all the time :)

-- 
Rafa?

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

end of thread, other threads:[~2013-06-25 19:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-25 15:34 [RFC][PATCH] b43: replace B43_BCMA_EXTRA with modparam allhwsupport Rafał Miłecki
2013-06-25 17:23 ` John W. Linville
2013-06-25 18:01 ` Jonas Gorski
2013-06-25 19:51   ` Rafał Miłecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox