aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl4965-base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl4965-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c64
1 files changed, 38 insertions, 26 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 99a9f820bfd1..46a43ff51526 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -5501,11 +5501,12 @@ static int iwl4965_init_channel_map(struct iwl4965_priv *priv)
5501 ch_info->scan_power = eeprom_ch_info[ch].max_power_avg; 5501 ch_info->scan_power = eeprom_ch_info[ch].max_power_avg;
5502 ch_info->min_power = 0; 5502 ch_info->min_power = 0;
5503 5503
5504 IWL_DEBUG_INFO("Ch. %d [%sGHz] %s%s%s%s%s%s(0x%02x" 5504 IWL_DEBUG_INFO("Ch. %d [%sGHz] %s%s%s%s%s%s%s(0x%02x"
5505 " %ddBm): Ad-Hoc %ssupported\n", 5505 " %ddBm): Ad-Hoc %ssupported\n",
5506 ch_info->channel, 5506 ch_info->channel,
5507 is_channel_a_band(ch_info) ? 5507 is_channel_a_band(ch_info) ?
5508 "5.2" : "2.4", 5508 "5.2" : "2.4",
5509 CHECK_AND_PRINT(VALID),
5509 CHECK_AND_PRINT(IBSS), 5510 CHECK_AND_PRINT(IBSS),
5510 CHECK_AND_PRINT(ACTIVE), 5511 CHECK_AND_PRINT(ACTIVE),
5511 CHECK_AND_PRINT(RADAR), 5512 CHECK_AND_PRINT(RADAR),
@@ -5748,7 +5749,7 @@ static void iwl4965_init_hw_rates(struct iwl4965_priv *priv,
5748static int iwl4965_init_geos(struct iwl4965_priv *priv) 5749static int iwl4965_init_geos(struct iwl4965_priv *priv)
5749{ 5750{
5750 struct iwl4965_channel_info *ch; 5751 struct iwl4965_channel_info *ch;
5751 struct ieee80211_supported_band *band; 5752 struct ieee80211_supported_band *sband;
5752 struct ieee80211_channel *channels; 5753 struct ieee80211_channel *channels;
5753 struct ieee80211_channel *geo_ch; 5754 struct ieee80211_channel *geo_ch;
5754 struct ieee80211_rate *rates; 5755 struct ieee80211_rate *rates;
@@ -5766,7 +5767,7 @@ static int iwl4965_init_geos(struct iwl4965_priv *priv)
5766 if (!channels) 5767 if (!channels)
5767 return -ENOMEM; 5768 return -ENOMEM;
5768 5769
5769 rates = kzalloc((sizeof(struct ieee80211_rate) * (IWL_MAX_RATES + 1)), 5770 rates = kzalloc((sizeof(struct ieee80211_rate) * (IWL_RATE_COUNT + 1)),
5770 GFP_KERNEL); 5771 GFP_KERNEL);
5771 if (!rates) { 5772 if (!rates) {
5772 kfree(channels); 5773 kfree(channels);
@@ -5774,42 +5775,42 @@ static int iwl4965_init_geos(struct iwl4965_priv *priv)
5774 } 5775 }
5775 5776
5776 /* 5.2GHz channels start after the 2.4GHz channels */ 5777 /* 5.2GHz channels start after the 2.4GHz channels */
5777 band = &priv->bands[IEEE80211_BAND_5GHZ]; 5778 sband = &priv->bands[IEEE80211_BAND_5GHZ];
5778 band->channels = &channels[ARRAY_SIZE(iwl4965_eeprom_band_1)]; 5779 sband->channels = &channels[ARRAY_SIZE(iwl4965_eeprom_band_1)];
5779 band->bitrates = &rates[4]; 5780 /* just OFDM */
5780 band->n_bitrates = 8; /* just OFDM */ 5781 sband->bitrates = &rates[IWL_FIRST_OFDM_RATE];
5782 sband->n_bitrates = IWL_RATE_COUNT - IWL_FIRST_OFDM_RATE;
5781 5783
5782 iwl4965_init_ht_hw_capab(&band->ht_info, IEEE80211_BAND_5GHZ); 5784 iwl4965_init_ht_hw_capab(&sband->ht_info, IEEE80211_BAND_5GHZ);
5783 5785
5784 band = &priv->bands[IEEE80211_BAND_2GHZ]; 5786 sband = &priv->bands[IEEE80211_BAND_2GHZ];
5785 band->channels = channels; 5787 sband->channels = channels;
5786 band->bitrates = rates; 5788 /* OFDM & CCK */
5787 band->n_bitrates = 12; /* OFDM & CCK */ 5789 sband->bitrates = rates;
5790 sband->n_bitrates = IWL_RATE_COUNT;
5788 5791
5789 iwl4965_init_ht_hw_capab(&band->ht_info, IEEE80211_BAND_2GHZ); 5792 iwl4965_init_ht_hw_capab(&sband->ht_info, IEEE80211_BAND_2GHZ);
5790 5793
5791 priv->ieee_channels = channels; 5794 priv->ieee_channels = channels;
5792 priv->ieee_rates = rates; 5795 priv->ieee_rates = rates;
5793 5796
5794 iwl4965_init_hw_rates(priv, rates); 5797 iwl4965_init_hw_rates(priv, rates);
5795 5798
5796 for (i = 0, geo_ch = channels; i < priv->channel_count; i++) { 5799 for (i = 0; i < priv->channel_count; i++) {
5797 ch = &priv->channel_info[i]; 5800 ch = &priv->channel_info[i];
5798 5801
5799 if (!is_channel_valid(ch)) { 5802 /* FIXME: might be removed if scan is OK */
5800 IWL_DEBUG_INFO("Channel %d [%sGHz] is restricted -- " 5803 if (!is_channel_valid(ch))
5801 "skipping.\n",
5802 ch->channel, is_channel_a_band(ch) ?
5803 "5.2" : "2.4");
5804 continue; 5804 continue;
5805 }
5806 5805
5807 if (is_channel_a_band(ch)) { 5806 if (is_channel_a_band(ch))
5808 geo_ch = &priv->bands[IEEE80211_BAND_5GHZ].channels[priv->bands[IEEE80211_BAND_5GHZ].n_channels++]; 5807 sband = &priv->bands[IEEE80211_BAND_5GHZ];
5809 } else 5808 else
5810 geo_ch = &priv->bands[IEEE80211_BAND_2GHZ].channels[priv->bands[IEEE80211_BAND_2GHZ].n_channels++]; 5809 sband = &priv->bands[IEEE80211_BAND_2GHZ];
5811 5810
5812 geo_ch->center_freq = ieee80211chan2mhz(ch->channel); 5811 geo_ch = &sband->channels[sband->n_channels++];
5812
5813 geo_ch->center_freq = ieee80211_channel_to_frequency(ch->channel);
5813 geo_ch->max_power = ch->max_power_avg; 5814 geo_ch->max_power = ch->max_power_avg;
5814 geo_ch->max_antenna_gain = 0xff; 5815 geo_ch->max_antenna_gain = 0xff;
5815 geo_ch->hw_value = ch->channel; 5816 geo_ch->hw_value = ch->channel;
@@ -5827,8 +5828,19 @@ static int iwl4965_init_geos(struct iwl4965_priv *priv)
5827 if (ch->max_power_avg > priv->max_channel_txpower_limit) 5828 if (ch->max_power_avg > priv->max_channel_txpower_limit)
5828 priv->max_channel_txpower_limit = 5829 priv->max_channel_txpower_limit =
5829 ch->max_power_avg; 5830 ch->max_power_avg;
5830 } else 5831 } else {
5831 geo_ch->flags |= IEEE80211_CHAN_DISABLED; 5832 geo_ch->flags |= IEEE80211_CHAN_DISABLED;
5833 }
5834
5835 /* Save flags for reg domain usage */
5836 geo_ch->orig_flags = geo_ch->flags;
5837
5838 IWL_DEBUG_INFO("Channel %d Freq=%d[%sGHz] %s flag=0%X\n",
5839 ch->channel, geo_ch->center_freq,
5840 is_channel_a_band(ch) ? "5.2" : "2.4",
5841 geo_ch->flags & IEEE80211_CHAN_DISABLED ?
5842 "restricted" : "valid",
5843 geo_ch->flags);
5832 } 5844 }
5833 5845
5834 if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) && priv->is_abg) { 5846 if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) && priv->is_abg) {