* [PATCH] iwlwifi: do not register bands with no supported channels
@ 2008-03-25 19:58 John W. Linville
2008-03-25 20:31 ` Tomas Winkler
0 siblings, 1 reply; 6+ messages in thread
From: John W. Linville @ 2008-03-25 19:58 UTC (permalink / raw)
To: linux-wireless; +Cc: reinette.chatre, John W. Linville
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
Otherwise, b/g-only devices fail in wiphy_register. Tested in Fedora
kernels for the last week or so...
drivers/net/wireless/iwlwifi/iwl3945-base.c | 8 ++++++--
drivers/net/wireless/iwlwifi/iwl4965-base.c | 8 ++++++--
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 093b863..4ba9591 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -5136,8 +5136,12 @@ static int iwl3945_init_geos(struct iwl3945_priv *priv)
priv->bands[IEEE80211_BAND_2GHZ].n_channels,
priv->bands[IEEE80211_BAND_5GHZ].n_channels);
- priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->bands[IEEE80211_BAND_2GHZ];
- priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &priv->bands[IEEE80211_BAND_5GHZ];
+ if (priv->bands[IEEE80211_BAND_2GHZ].n_channels)
+ priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
+ &priv->bands[IEEE80211_BAND_2GHZ];
+ if (priv->bands[IEEE80211_BAND_5GHZ].n_channels)
+ priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
+ &priv->bands[IEEE80211_BAND_5GHZ];
set_bit(STATUS_GEO_CONFIGURED, &priv->status);
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 44cfd02..9ae3d29 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -5001,8 +5001,12 @@ int iwl4965_init_geos(struct iwl_priv *priv)
priv->bands[IEEE80211_BAND_2GHZ].n_channels,
priv->bands[IEEE80211_BAND_5GHZ].n_channels);
- priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->bands[IEEE80211_BAND_2GHZ];
- priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &priv->bands[IEEE80211_BAND_5GHZ];
+ if (priv->bands[IEEE80211_BAND_2GHZ].n_channels)
+ priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
+ &priv->bands[IEEE80211_BAND_2GHZ];
+ if (priv->bands[IEEE80211_BAND_5GHZ].n_channels)
+ priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
+ &priv->bands[IEEE80211_BAND_5GHZ];
set_bit(STATUS_GEO_CONFIGURED, &priv->status);
--
1.5.3.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] iwlwifi: do not register bands with no supported channels
2008-03-25 19:58 [PATCH] iwlwifi: do not register bands with no supported channels John W. Linville
@ 2008-03-25 20:31 ` Tomas Winkler
2008-03-25 21:24 ` John W. Linville
0 siblings, 1 reply; 6+ messages in thread
From: Tomas Winkler @ 2008-03-25 20:31 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, reinette.chatre
On Tue, Mar 25, 2008 at 9:58 PM, John W. Linville
<linville@tuxdriver.com> wrote:
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> ---
> Otherwise, b/g-only devices fail in wiphy_register. Tested in Fedora
> kernels for the last week or so...
>
> drivers/net/wireless/iwlwifi/iwl3945-base.c | 8 ++++++--
> drivers/net/wireless/iwlwifi/iwl4965-base.c | 8 ++++++--
> 2 files changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
> index 093b863..4ba9591 100644
> --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
> +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
> @@ -5136,8 +5136,12 @@ static int iwl3945_init_geos(struct iwl3945_priv *priv)
> priv->bands[IEEE80211_BAND_2GHZ].n_channels,
> priv->bands[IEEE80211_BAND_5GHZ].n_channels);
>
> - priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->bands[IEEE80211_BAND_2GHZ];
> - priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &priv->bands[IEEE80211_BAND_5GHZ];
> + if (priv->bands[IEEE80211_BAND_2GHZ].n_channels)
> + priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
> + &priv->bands[IEEE80211_BAND_2GHZ];
> + if (priv->bands[IEEE80211_BAND_5GHZ].n_channels)
> + priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
> + &priv->bands[IEEE80211_BAND_5GHZ];
>
> set_bit(STATUS_GEO_CONFIGURED, &priv->status);
>
> diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
> index 44cfd02..9ae3d29 100644
> --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
> +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
> @@ -5001,8 +5001,12 @@ int iwl4965_init_geos(struct iwl_priv *priv)
> priv->bands[IEEE80211_BAND_2GHZ].n_channels,
> priv->bands[IEEE80211_BAND_5GHZ].n_channels);
>
> - priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->bands[IEEE80211_BAND_2GHZ];
> - priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &priv->bands[IEEE80211_BAND_5GHZ];
> + if (priv->bands[IEEE80211_BAND_2GHZ].n_channels)
> + priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
> + &priv->bands[IEEE80211_BAND_2GHZ];
> + if (priv->bands[IEEE80211_BAND_5GHZ].n_channels)
> + priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
> + &priv->bands[IEEE80211_BAND_5GHZ];
>
> set_bit(STATUS_GEO_CONFIGURED, &priv->status);
>
As there already exists condition testing this I would prefer
something like this
printk(KERN_INFO DRV_NAME
": Tunable channels: %d 802.11bg, %d 802.11a channels\n",
priv->bands[IEEE80211_BAND_2GHZ].n_channels,
priv->bands[IEEE80211_BAND_5GHZ].n_channels);
priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->bands[IEEE80211_BAND_2GHZ];
if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
priv->cfg->sku & IWL_SKU_A) {
printk(KERN_INFO DRV_NAME
": Incorrectly detected BG card as ABG. Please send "
"your PCI ID 0x%04X:0x%04X to maintainer.\n",
priv->pci_dev->device, priv->pci_dev->subsystem_device);
priv->cfg->sku &= ~IWL_SKU_A;
priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;
}
else
priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
&priv->bands[IEEE80211_BAND_5GHZ];
> 1.5.3.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] iwlwifi: do not register bands with no supported channels
2008-03-25 20:31 ` Tomas Winkler
@ 2008-03-25 21:24 ` John W. Linville
2008-03-25 23:45 ` Tomas Winkler
0 siblings, 1 reply; 6+ messages in thread
From: John W. Linville @ 2008-03-25 21:24 UTC (permalink / raw)
To: Tomas Winkler; +Cc: linux-wireless, reinette.chatre
On Tue, Mar 25, 2008 at 10:31:27PM +0200, Tomas Winkler wrote:
> On Tue, Mar 25, 2008 at 9:58 PM, John W. Linville
> <linville@tuxdriver.com> wrote:
> > Signed-off-by: John W. Linville <linville@tuxdriver.com>
> > ---
> > Otherwise, b/g-only devices fail in wiphy_register. Tested in Fedora
> > kernels for the last week or so...
> >
> > drivers/net/wireless/iwlwifi/iwl3945-base.c | 8 ++++++--
> > drivers/net/wireless/iwlwifi/iwl4965-base.c | 8 ++++++--
> > 2 files changed, 12 insertions(+), 4 deletions(-)
> > diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
> > index 44cfd02..9ae3d29 100644
> > --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
> > +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
> > @@ -5001,8 +5001,12 @@ int iwl4965_init_geos(struct iwl_priv *priv)
> > priv->bands[IEEE80211_BAND_2GHZ].n_channels,
> > priv->bands[IEEE80211_BAND_5GHZ].n_channels);
> >
> > - priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->bands[IEEE80211_BAND_2GHZ];
> > - priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &priv->bands[IEEE80211_BAND_5GHZ];
> > + if (priv->bands[IEEE80211_BAND_2GHZ].n_channels)
> > + priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
> > + &priv->bands[IEEE80211_BAND_2GHZ];
> > + if (priv->bands[IEEE80211_BAND_5GHZ].n_channels)
> > + priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
> > + &priv->bands[IEEE80211_BAND_5GHZ];
> >
> > set_bit(STATUS_GEO_CONFIGURED, &priv->status);
> >
>
> As there already exists condition testing this I would prefer
> something like this
I don't think it is the same -- yours is checking IWL_SKU_A.
> if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
> priv->cfg->sku & IWL_SKU_A) {
> printk(KERN_INFO DRV_NAME
> ": Incorrectly detected BG card as ABG. Please send "
> "your PCI ID 0x%04X:0x%04X to maintainer.\n",
> priv->pci_dev->device, priv->pci_dev->subsystem_device);
> priv->cfg->sku &= ~IWL_SKU_A;
> priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;
> }
A clause just like this exists a few lines above, yet it does not
fire for the device that prompted this patch:
https://bugzilla.redhat.com/attachment.cgi?id=298613
> else
> priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
> &priv->bands[IEEE80211_BAND_5GHZ];
I don't think your version will resolve the issue. Am I missing
something?
John
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] iwlwifi: do not register bands with no supported channels
2008-03-25 21:24 ` John W. Linville
@ 2008-03-25 23:45 ` Tomas Winkler
2008-03-27 20:53 ` John W. Linville
0 siblings, 1 reply; 6+ messages in thread
From: Tomas Winkler @ 2008-03-25 23:45 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, reinette.chatre
On Tue, Mar 25, 2008 at 11:24 PM, John W. Linville
<linville@tuxdriver.com> wrote:
> On Tue, Mar 25, 2008 at 10:31:27PM +0200, Tomas Winkler wrote:
> > On Tue, Mar 25, 2008 at 9:58 PM, John W. Linville
> > <linville@tuxdriver.com> wrote:
> > > Signed-off-by: John W. Linville <linville@tuxdriver.com>
> > > ---
> > > Otherwise, b/g-only devices fail in wiphy_register. Tested in Fedora
> > > kernels for the last week or so...
> > >
> > > drivers/net/wireless/iwlwifi/iwl3945-base.c | 8 ++++++--
> > > drivers/net/wireless/iwlwifi/iwl4965-base.c | 8 ++++++--
> > > 2 files changed, 12 insertions(+), 4 deletions(-)
>
>
> > > diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
> > > index 44cfd02..9ae3d29 100644
> > > --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
> > > +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
> > > @@ -5001,8 +5001,12 @@ int iwl4965_init_geos(struct iwl_priv *priv)
> > > priv->bands[IEEE80211_BAND_2GHZ].n_channels,
> > > priv->bands[IEEE80211_BAND_5GHZ].n_channels);
> > >
> > > - priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->bands[IEEE80211_BAND_2GHZ];
> > > - priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &priv->bands[IEEE80211_BAND_5GHZ];
> > > + if (priv->bands[IEEE80211_BAND_2GHZ].n_channels)
> > > + priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
> > > + &priv->bands[IEEE80211_BAND_2GHZ];
> > > + if (priv->bands[IEEE80211_BAND_5GHZ].n_channels)
> > > + priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
> > > + &priv->bands[IEEE80211_BAND_5GHZ];
> > >
> > > set_bit(STATUS_GEO_CONFIGURED, &priv->status);
> > >
> >
> > As there already exists condition testing this I would prefer
> > something like this
>
> I don't think it is the same -- yours is checking IWL_SKU_A.
>
>
> > if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
> > priv->cfg->sku & IWL_SKU_A) {
> > printk(KERN_INFO DRV_NAME
> > ": Incorrectly detected BG card as ABG. Please send "
> > "your PCI ID 0x%04X:0x%04X to maintainer.\n",
> > priv->pci_dev->device, priv->pci_dev->subsystem_device);
> > priv->cfg->sku &= ~IWL_SKU_A;
> > priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;
> > }
>
> A clause just like this exists a few lines above, yet it does not
> fire for the device that prompted this patch:
>
> https://bugzilla.redhat.com/attachment.cgi?id=298613
>
>
> > else
> > priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
> > &priv->bands[IEEE80211_BAND_5GHZ];
>
> I don't think your version will resolve the issue. Am I missing
> something?
Yep I was a bit snappy. my suggestion doesn't resolve the problem.
Anyhow, let me look at this tomorrow if we have other SKU issues so it
can be rolled in together.
Thanks
TOmas
> John
> --
>
>
> John W. Linville
> linville@tuxdriver.com
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] iwlwifi: do not register bands with no supported channels
2008-03-25 23:45 ` Tomas Winkler
@ 2008-03-27 20:53 ` John W. Linville
2008-03-28 1:02 ` Tomas Winkler
0 siblings, 1 reply; 6+ messages in thread
From: John W. Linville @ 2008-03-27 20:53 UTC (permalink / raw)
To: Tomas Winkler; +Cc: linux-wireless, reinette.chatre
On Wed, Mar 26, 2008 at 01:45:03AM +0200, Tomas Winkler wrote:
> > I don't think your version will resolve the issue. Am I missing
> > something?
>
> Yep I was a bit snappy. my suggestion doesn't resolve the problem.
> Anyhow, let me look at this tomorrow if we have other SKU issues so it
> can be rolled in together.
I'm going to go ahead and push mine with todays patches. Feel free
to correct it later if there is some more appropriate test.
Thanks,
John
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] iwlwifi: do not register bands with no supported channels
2008-03-27 20:53 ` John W. Linville
@ 2008-03-28 1:02 ` Tomas Winkler
0 siblings, 0 replies; 6+ messages in thread
From: Tomas Winkler @ 2008-03-28 1:02 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, reinette.chatre
On Thu, Mar 27, 2008 at 10:53 PM, John W. Linville
<linville@tuxdriver.com> wrote:
> On Wed, Mar 26, 2008 at 01:45:03AM +0200, Tomas Winkler wrote:
>
> > > I don't think your version will resolve the issue. Am I missing
> > > something?
> >
> > Yep I was a bit snappy. my suggestion doesn't resolve the problem.
> > Anyhow, let me look at this tomorrow if we have other SKU issues so it
> > can be rolled in together.
>
> I'm going to go ahead and push mine with todays patches. Feel free
> to correct it later if there is some more appropriate test.
>
> Thanks,
Fine with me. I just got the material about SKUs few hours ago so I
won't be ready with fixes till Sunday.
Tomas
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-03-28 1:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-25 19:58 [PATCH] iwlwifi: do not register bands with no supported channels John W. Linville
2008-03-25 20:31 ` Tomas Winkler
2008-03-25 21:24 ` John W. Linville
2008-03-25 23:45 ` Tomas Winkler
2008-03-27 20:53 ` John W. Linville
2008-03-28 1:02 ` Tomas Winkler
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).