linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: correct frequency settings
@ 2011-01-31 12:01 Stanislaw Gruszka
  2011-01-31 12:10 ` Johannes Berg
  2011-01-31 15:27 ` wwguy
  0 siblings, 2 replies; 3+ messages in thread
From: Stanislaw Gruszka @ 2011-01-31 12:01 UTC (permalink / raw)
  To: Wey-Yi Guy, Intel Linux Wireless
  Cc: Johannes Berg, linux-wireless, Stanislaw Gruszka

After commit 59eb21a6504731fc16db4cf9463065dd61093e08
"cfg80211: Extend channel to frequency mapping for 802.11j"
we use uninitialized sband->band when assign channel frequencies, what
results that 5GHz channels have erroneous (zero) center_freq value.

Patch fixes problem and simplifies code a bit.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/iwlwifi/iwl-core.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 92724cb..4ad8938 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -219,16 +219,12 @@ int iwlcore_init_geos(struct iwl_priv *priv)
 		if (!is_channel_valid(ch))
 			continue;
 
-		if (is_channel_a_band(ch))
-			sband =  &priv->bands[IEEE80211_BAND_5GHZ];
-		else
-			sband =  &priv->bands[IEEE80211_BAND_2GHZ];
+		sband =  &priv->bands[ch->band];
 
 		geo_ch = &sband->channels[sband->n_channels++];
 
 		geo_ch->center_freq =
-				ieee80211_channel_to_frequency(ch->channel,
-							       sband->band);
+			ieee80211_channel_to_frequency(ch->channel, ch->band);
 		geo_ch->max_power = ch->max_power_avg;
 		geo_ch->max_antenna_gain = 0xff;
 		geo_ch->hw_value = ch->channel;
-- 
1.7.1


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

* Re: [PATCH] iwlwifi: correct frequency settings
  2011-01-31 12:01 [PATCH] iwlwifi: correct frequency settings Stanislaw Gruszka
@ 2011-01-31 12:10 ` Johannes Berg
  2011-01-31 15:27 ` wwguy
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2011-01-31 12:10 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: Wey-Yi Guy, Intel Linux Wireless, linux-wireless

On Mon, 2011-01-31 at 13:01 +0100, Stanislaw Gruszka wrote:
> After commit 59eb21a6504731fc16db4cf9463065dd61093e08
> "cfg80211: Extend channel to frequency mapping for 802.11j"
> we use uninitialized sband->band when assign channel frequencies, what
> results that 5GHz channels have erroneous (zero) center_freq value.
> 
> Patch fixes problem and simplifies code a bit.

Reviewed-by: Johannes Berg <johannes@sipsolutions.net>

Thanks!

> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
>  drivers/net/wireless/iwlwifi/iwl-core.c |    8 ++------
>  1 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
> index 92724cb..4ad8938 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-core.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-core.c
> @@ -219,16 +219,12 @@ int iwlcore_init_geos(struct iwl_priv *priv)
>  		if (!is_channel_valid(ch))
>  			continue;
>  
> -		if (is_channel_a_band(ch))
> -			sband =  &priv->bands[IEEE80211_BAND_5GHZ];
> -		else
> -			sband =  &priv->bands[IEEE80211_BAND_2GHZ];
> +		sband =  &priv->bands[ch->band];
>  
>  		geo_ch = &sband->channels[sband->n_channels++];
>  
>  		geo_ch->center_freq =
> -				ieee80211_channel_to_frequency(ch->channel,
> -							       sband->band);
> +			ieee80211_channel_to_frequency(ch->channel, ch->band);
>  		geo_ch->max_power = ch->max_power_avg;
>  		geo_ch->max_antenna_gain = 0xff;
>  		geo_ch->hw_value = ch->channel;



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

* Re: [PATCH] iwlwifi: correct frequency settings
  2011-01-31 12:01 [PATCH] iwlwifi: correct frequency settings Stanislaw Gruszka
  2011-01-31 12:10 ` Johannes Berg
@ 2011-01-31 15:27 ` wwguy
  1 sibling, 0 replies; 3+ messages in thread
From: wwguy @ 2011-01-31 15:27 UTC (permalink / raw)
  To: Stanislaw Gruszka
  Cc: Intel Linux Wireless, Johannes Berg,
	linux-wireless@vger.kernel.org

On Mon, 2011-01-31 at 04:01 -0800, Stanislaw Gruszka wrote:
> After commit 59eb21a6504731fc16db4cf9463065dd61093e08
> "cfg80211: Extend channel to frequency mapping for 802.11j"
> we use uninitialized sband->band when assign channel frequencies, what
> results that 5GHz channels have erroneous (zero) center_freq value.
> 
> Patch fixes problem and simplifies code a bit.
> 
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>


Thanks, it make sense.

Wey


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

end of thread, other threads:[~2011-01-31 15:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-31 12:01 [PATCH] iwlwifi: correct frequency settings Stanislaw Gruszka
2011-01-31 12:10 ` Johannes Berg
2011-01-31 15:27 ` wwguy

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).