Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102838
b: refs/heads/master
c: 82a66bb
h: refs/heads/master
v: v3
  • Loading branch information
Tomas Winkler authored and John W. Linville committed Jun 3, 2008
1 parent 6588fdb commit 6c3f2af
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d2f18bfd9bc6b51c8bb72b272ecca902a88387d4
refs/heads/master: 82a66bbbe96126ca1bc6bc5ded8e67f529bcdfa4
5 changes: 2 additions & 3 deletions trunk/drivers/net/wireless/iwlwifi/iwl-eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,8 @@ void iwl_free_channel_map(struct iwl_priv *priv)
*
* Based on band and channel number.
*/
const struct iwl_channel_info *iwl_get_channel_info(
const struct iwl_priv *priv,
enum ieee80211_band band, u16 channel)
const struct iwl_channel_info *iwl_get_channel_info(const struct iwl_priv *priv,
enum ieee80211_band band, u16 channel)
{
int i;

Expand Down
23 changes: 11 additions & 12 deletions trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1084,8 +1084,8 @@ static int iwl4965_scan_initiate(struct iwl_priv *priv)
}


static void iwl4965_set_flags_for_phymode(struct iwl_priv *priv,
enum ieee80211_band band)
static void iwl_set_flags_for_band(struct iwl_priv *priv,
enum ieee80211_band band)
{
if (band == IEEE80211_BAND_5GHZ) {
priv->staging_rxon.flags &=
Expand Down Expand Up @@ -1170,7 +1170,7 @@ static void iwl4965_connection_init_rx_config(struct iwl_priv *priv)
priv->staging_rxon.channel = cpu_to_le16(ch_info->channel);
priv->band = ch_info->band;

iwl4965_set_flags_for_phymode(priv, priv->band);
iwl_set_flags_for_band(priv, priv->band);

priv->staging_rxon.ofdm_basic_rates =
(IWL_OFDM_RATES_MASK >> IWL_FIRST_OFDM_RATE) & 0xFF;
Expand Down Expand Up @@ -3823,6 +3823,7 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co
const struct iwl_channel_info *ch_info;
unsigned long flags;
int ret = 0;
u16 channel;

mutex_lock(&priv->mutex);
IWL_DEBUG_MAC80211("enter to channel %d\n", conf->channel->hw_value);
Expand All @@ -3843,33 +3844,31 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co
return 0;
}

spin_lock_irqsave(&priv->lock, flags);

ch_info = iwl_get_channel_info(priv, conf->channel->band,
ieee80211_frequency_to_channel(conf->channel->center_freq));
channel = ieee80211_frequency_to_channel(conf->channel->center_freq);
ch_info = iwl_get_channel_info(priv, conf->channel->band, channel);
if (!is_channel_valid(ch_info)) {
IWL_DEBUG_MAC80211("leave - invalid channel\n");
spin_unlock_irqrestore(&priv->lock, flags);
ret = -EINVAL;
goto out;
}

spin_lock_irqsave(&priv->lock, flags);

#ifdef CONFIG_IWL4965_HT
/* if we are switching from ht to 2.4 clear flags
* from any ht related info since 2.4 does not
* support ht */
if ((le16_to_cpu(priv->staging_rxon.channel) != conf->channel->hw_value)
if ((le16_to_cpu(priv->staging_rxon.channel) != channel)
#ifdef IEEE80211_CONF_CHANNEL_SWITCH
&& !(conf->flags & IEEE80211_CONF_CHANNEL_SWITCH)
#endif
)
priv->staging_rxon.flags = 0;
#endif /* CONFIG_IWL4965_HT */

iwl_set_rxon_channel(priv, conf->channel->band,
ieee80211_frequency_to_channel(conf->channel->center_freq));
iwl_set_rxon_channel(priv, conf->channel->band, channel);

iwl4965_set_flags_for_phymode(priv, conf->channel->band);
iwl_set_flags_for_band(priv, conf->channel->band);

/* The list of supported rates and rate mask can be different
* for each band; since the band may have changed, reset
Expand Down

0 comments on commit 6c3f2af

Please sign in to comment.