2012-01-11 21:01:07

by John W. Linville

[permalink] [raw]
Subject: [PATCH] b43: add default option to avoid duplicating device support with brcmsmac

Signed-off-by: John W. Linville <[email protected]>
---
drivers/net/wireless/b43/Kconfig | 5 +++++
drivers/net/wireless/b43/main.c | 2 ++
2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig
index b97a40e..8139fc7 100644
--- a/drivers/net/wireless/b43/Kconfig
+++ b/drivers/net/wireless/b43/Kconfig
@@ -31,6 +31,11 @@ config B43_BCMA
depends on B43 && BCMA
default y

+config B43_BCMA_EXTRA
+ bool "Support for devices also supported by brcmsmac"
+ depends on B43_BCMA
+ default n
+
config B43_SSB
bool
depends on B43 && SSB
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 989f654..e2e2d11 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -116,8 +116,10 @@ MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO");
#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
};
--
1.7.4.4



2012-01-11 21:03:40

by Arend van Spriel

[permalink] [raw]
Subject: Re: [PATCH] b43: add default option to avoid duplicating device support with brcmsmac

On 01/11/2012 09:53 PM, John W. Linville wrote:
> Signed-off-by: John W. Linville <[email protected]>
> ---
> drivers/net/wireless/b43/Kconfig | 5 +++++
> drivers/net/wireless/b43/main.c | 2 ++
> 2 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig
> +config B43_BCMA_EXTRA
> + bool "Support for devices also supported by brcmsmac"
> + depends on B43_BCMA
> + default n

If I am not mistaken the 'default n' is not really needed.

Gr. AvS


2012-01-12 16:11:51

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH] b43: add default option to avoid duplicating device support with brcmsmac

2012/1/11 John W. Linville <[email protected]>:
> +config B43_BCMA_EXTRA
> +       bool "Support for devices also supported by brcmsmac"
> +       depends on B43_BCMA
> +       default n
> +

Is this really *the* solution? I wonder if we can do whatever you're
trying to do in a better way? To let final users try both drivers
without recompiling kernel?

The description also isn't saying too much. I can't imagine anyone
taking decision advisedly other than "n, as it's the default". On
other hand, what should we put here? The whole comparison of drivers?
Can be hard, but I really think there should be more info.

--
Rafał

2012-01-11 21:16:03

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] b43: add default option to avoid duplicating device support with brcmsmac

On Wed, Jan 11, 2012 at 10:03:27PM +0100, Arend van Spriel wrote:
> On 01/11/2012 09:53 PM, John W. Linville wrote:
> > Signed-off-by: John W. Linville <[email protected]>
> > ---
> > drivers/net/wireless/b43/Kconfig | 5 +++++
> > drivers/net/wireless/b43/main.c | 2 ++
> > 2 files changed, 7 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig
> > +config B43_BCMA_EXTRA
> > + bool "Support for devices also supported by brcmsmac"
> > + depends on B43_BCMA
> > + default n
>
> If I am not mistaken the 'default n' is not really needed.

But I _really_ mean it!! :-)

I'll drop that line in the final commit...

John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2012-01-13 19:31:09

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] b43: add default option to avoid duplicating device support with brcmsmac

On Fri, Jan 13, 2012 at 01:07:03PM +1100, Julian Calaby wrote:
> 2012/1/13 Rafał Miłecki <[email protected]>:
> > 2012/1/11 John W. Linville <[email protected]>:
> >> +config B43_BCMA_EXTRA
> >> +       bool "Support for devices also supported by brcmsmac"
> >> +       depends on B43_BCMA
> >> +       default n
> >> +
> >
> > Is this really *the* solution? I wonder if we can do whatever you're
> > trying to do in a better way? To let final users try both drivers
> > without recompiling kernel?
>
> Another issue is that this should arguably be default y if brcmsmac is disabled.

Can you help by suggesting the correct Kconfig magic to implement that?

John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2012-01-16 20:31:14

by John W. Linville

[permalink] [raw]
Subject: [PATCH v2] b43: add default option to avoid duplicating device support with brcmsmac

Signed-off-by: John W. Linville <[email protected]>
---
The dual default lines were the only combination I could find that
actually defaulted to "N" if brcmsmac was already enabled and to "Y"
otherwise. If anyone knows better magic for this, then please speak-up!

drivers/net/wireless/b43/Kconfig | 6 ++++++
drivers/net/wireless/b43/main.c | 2 ++
2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig
index b97a40e..edb4ab2 100644
--- a/drivers/net/wireless/b43/Kconfig
+++ b/drivers/net/wireless/b43/Kconfig
@@ -31,6 +31,12 @@ config B43_BCMA
depends on B43 && BCMA
default y

+config B43_BCMA_EXTRA
+ bool "Hardware support that overlaps with Broadcom-supported brcmsmac driver"
+ depends on B43_BCMA
+ default n if BRCMSMAC || BRCMSMAC_MODULE
+ default y
+
config B43_SSB
bool
depends on B43 && SSB
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 41c83d9..b1ae675 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -116,8 +116,10 @@ MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO");
#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
};
--
1.7.4.4


2012-01-13 19:31:09

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] b43: add default option to avoid duplicating device support with brcmsmac

On Fri, Jan 13, 2012 at 02:32:48AM +0100, Peter Stuge wrote:
> John W. Linville wrote:
> > The summary line could be different as well, if you can think of a
> > better way to describe the issue. I am open to suggestions.
>
> I think these terms are clear:
>
> Community b43 driver
> Broadcom brcmsmac driver
>
> How to apply them I leave up to you. :)

Maybe you think that is clear, but it doesn't do much for me.

I could say "Support for devices already supported by the
Broadcom-supported brcmsmac driver"?

John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2012-01-13 02:07:24

by Julian Calaby

[permalink] [raw]
Subject: Re: [PATCH] b43: add default option to avoid duplicating device support with brcmsmac

2012/1/13 Rafał Miłecki <[email protected]>:
> 2012/1/11 John W. Linville <[email protected]>:
>> +config B43_BCMA_EXTRA
>> +       bool "Support for devices also supported by brcmsmac"
>> +       depends on B43_BCMA
>> +       default n
>> +
>
> Is this really *the* solution? I wonder if we can do whatever you're
> trying to do in a better way? To let final users try both drivers
> without recompiling kernel?

Another issue is that this should arguably be default y if brcmsmac is disabled.

Thanks,

--
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/

2012-01-13 01:32:51

by Peter Stuge

[permalink] [raw]
Subject: Re: [PATCH] b43: add default option to avoid duplicating device support with brcmsmac

John W. Linville wrote:
> The summary line could be different as well, if you can think of a
> better way to describe the issue. I am open to suggestions.

I think these terms are clear:

Community b43 driver
Broadcom brcmsmac driver

How to apply them I leave up to you. :)


//Peter

2012-01-12 16:31:08

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] b43: add default option to avoid duplicating device support with brcmsmac

On Thu, Jan 12, 2012 at 05:11:50PM +0100, Rafał Miłecki wrote:
> 2012/1/11 John W. Linville <[email protected]>:
> > +config B43_BCMA_EXTRA
> > +       bool "Support for devices also supported by brcmsmac"
> > +       depends on B43_BCMA
> > +       default n
> > +
>
> Is this really *the* solution? I wonder if we can do whatever you're
> trying to do in a better way? To let final users try both drivers
> without recompiling kernel?

Saying "y" would let users try both drivers. That is up to the
distros or other kernel builders to choose.

At present, they have no choice but to let the two drivers race to
see who gets loaded first or whatever. I imagine that some would
prefer to have an option that prevents that.

> The description also isn't saying too much. I can't imagine anyone
> taking decision advisedly other than "n, as it's the default". On
> other hand, what should we put here? The whole comparison of drivers?
> Can be hard, but I really think there should be more info.

More info could be put in a "---help---" section. The summary line
could be different as well, if you can think of a better way to
describe the issue. I am open to suggestions.

John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2012-01-13 21:53:01

by Julian Calaby

[permalink] [raw]
Subject: Re: [PATCH] b43: add default option to avoid duplicating device support with brcmsmac

John,

On Sat, Jan 14, 2012 at 06:20, John W. Linville <[email protected]> wrote:
> On Fri, Jan 13, 2012 at 01:07:03PM +1100, Julian Calaby wrote:
>> 2012/1/13 Rafał Miłecki <[email protected]>:
>> > 2012/1/11 John W. Linville <[email protected]>:
>> >> +config B43_BCMA_EXTRA
>> >> +       bool "Support for devices also supported by brcmsmac"
>> >> +       depends on B43_BCMA
>> >> +       default n
>> >> +
>> >
>> > Is this really *the* solution? I wonder if we can do whatever you're
>> > trying to do in a better way? To let final users try both drivers
>> > without recompiling kernel?
>>
>> Another issue is that this should arguably be default y if brcmsmac is disabled.
>
> Can you help by suggesting the correct Kconfig magic to implement that?

I believe that if you change your default line to:

default y if !BRCMSMAC

it should have the desired effect.

See the FONT_8x8 config option in drivers/video/console/Kconfig (line
#150) for an example.

Thanks,

--
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/