diff options
author | John W. Linville <linville@tuxdriver.com> | 2010-06-07 15:13:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-06-07 15:13:46 -0400 |
commit | 9d88477c41904127ab9ae1f3b5b4a39bf6474043 (patch) | |
tree | f50d5185ac89a9fd76d7cb087b952d5c55d5063b /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | 11b7c60988e5fbabb4e150612931cc068559af16 (diff) | |
parent | 35dd0509b21e4b5bab36b9eb80c8dab0322f5007 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Conflicts:
drivers/net/wireless/iwlwifi/iwl-core.h
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 56 |
1 files changed, 53 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index c3e9d633194a..0f16c7d518f7 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -1782,6 +1782,49 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv) | |||
1782 | #endif | 1782 | #endif |
1783 | } | 1783 | } |
1784 | 1784 | ||
1785 | static int iwl3945_get_single_channel_for_scan(struct iwl_priv *priv, | ||
1786 | struct ieee80211_vif *vif, | ||
1787 | enum ieee80211_band band, | ||
1788 | struct iwl3945_scan_channel *scan_ch) | ||
1789 | { | ||
1790 | const struct ieee80211_supported_band *sband; | ||
1791 | u16 passive_dwell = 0; | ||
1792 | u16 active_dwell = 0; | ||
1793 | int added = 0; | ||
1794 | u8 channel = 0; | ||
1795 | |||
1796 | sband = iwl_get_hw_mode(priv, band); | ||
1797 | if (!sband) { | ||
1798 | IWL_ERR(priv, "invalid band\n"); | ||
1799 | return added; | ||
1800 | } | ||
1801 | |||
1802 | active_dwell = iwl_get_active_dwell_time(priv, band, 0); | ||
1803 | passive_dwell = iwl_get_passive_dwell_time(priv, band, vif); | ||
1804 | |||
1805 | if (passive_dwell <= active_dwell) | ||
1806 | passive_dwell = active_dwell + 1; | ||
1807 | |||
1808 | |||
1809 | channel = iwl_get_single_channel_number(priv, band); | ||
1810 | |||
1811 | if (channel) { | ||
1812 | scan_ch->channel = channel; | ||
1813 | scan_ch->type = 0; /* passive */ | ||
1814 | scan_ch->active_dwell = cpu_to_le16(active_dwell); | ||
1815 | scan_ch->passive_dwell = cpu_to_le16(passive_dwell); | ||
1816 | /* Set txpower levels to defaults */ | ||
1817 | scan_ch->tpc.dsp_atten = 110; | ||
1818 | if (band == IEEE80211_BAND_5GHZ) | ||
1819 | scan_ch->tpc.tx_gain = ((1 << 5) | (3 << 3)) | 3; | ||
1820 | else | ||
1821 | scan_ch->tpc.tx_gain = ((1 << 5) | (5 << 3)); | ||
1822 | added++; | ||
1823 | } else | ||
1824 | IWL_ERR(priv, "no valid channel found\n"); | ||
1825 | return added; | ||
1826 | } | ||
1827 | |||
1785 | static int iwl3945_get_channels_for_scan(struct iwl_priv *priv, | 1828 | static int iwl3945_get_channels_for_scan(struct iwl_priv *priv, |
1786 | enum ieee80211_band band, | 1829 | enum ieee80211_band band, |
1787 | u8 is_active, u8 n_probes, | 1830 | u8 is_active, u8 n_probes, |
@@ -2932,9 +2975,16 @@ void iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
2932 | /* select Rx antennas */ | 2975 | /* select Rx antennas */ |
2933 | scan->flags |= iwl3945_get_antenna_flags(priv); | 2976 | scan->flags |= iwl3945_get_antenna_flags(priv); |
2934 | 2977 | ||
2935 | scan->channel_count = | 2978 | if (priv->is_internal_short_scan) { |
2936 | iwl3945_get_channels_for_scan(priv, band, is_active, n_probes, | 2979 | scan->channel_count = |
2937 | (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)], vif); | 2980 | iwl3945_get_single_channel_for_scan(priv, vif, band, |
2981 | (void *)&scan->data[le16_to_cpu( | ||
2982 | scan->tx_cmd.len)]); | ||
2983 | } else { | ||
2984 | scan->channel_count = | ||
2985 | iwl3945_get_channels_for_scan(priv, band, is_active, n_probes, | ||
2986 | (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)], vif); | ||
2987 | } | ||
2938 | 2988 | ||
2939 | if (scan->channel_count == 0) { | 2989 | if (scan->channel_count == 0) { |
2940 | IWL_DEBUG_SCAN(priv, "channel count %d\n", scan->channel_count); | 2990 | IWL_DEBUG_SCAN(priv, "channel count %d\n", scan->channel_count); |