diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2011-06-08 09:28:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-06-10 14:57:49 -0400 |
commit | dd6d2a8aef69cfef8acf1ff7ebb22a763c9ba56f (patch) | |
tree | fef514b3dfa4755358e6549184cb45d6eed47bbb /drivers/net/wireless/iwlegacy/iwl3945-base.c | |
parent | ecaee0ff07d429a8571ea015c00a211c17a86494 (diff) |
iwlegacy: remove reset rf infrastructure
We do not reset radio anymore, hence don't need that code too.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl3945-base.c | 95 |
1 files changed, 13 insertions, 82 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl3945-base.c b/drivers/net/wireless/iwlegacy/iwl3945-base.c index 0ee6be6a9c5d..da42442106c9 100644 --- a/drivers/net/wireless/iwlegacy/iwl3945-base.c +++ b/drivers/net/wireless/iwlegacy/iwl3945-base.c | |||
@@ -1762,49 +1762,6 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv) | |||
1762 | #endif | 1762 | #endif |
1763 | } | 1763 | } |
1764 | 1764 | ||
1765 | static int iwl3945_get_single_channel_for_scan(struct iwl_priv *priv, | ||
1766 | struct ieee80211_vif *vif, | ||
1767 | enum ieee80211_band band, | ||
1768 | struct iwl3945_scan_channel *scan_ch) | ||
1769 | { | ||
1770 | const struct ieee80211_supported_band *sband; | ||
1771 | u16 passive_dwell = 0; | ||
1772 | u16 active_dwell = 0; | ||
1773 | int added = 0; | ||
1774 | u8 channel = 0; | ||
1775 | |||
1776 | sband = iwl_get_hw_mode(priv, band); | ||
1777 | if (!sband) { | ||
1778 | IWL_ERR(priv, "invalid band\n"); | ||
1779 | return added; | ||
1780 | } | ||
1781 | |||
1782 | active_dwell = iwl_legacy_get_active_dwell_time(priv, band, 0); | ||
1783 | passive_dwell = iwl_legacy_get_passive_dwell_time(priv, band, vif); | ||
1784 | |||
1785 | if (passive_dwell <= active_dwell) | ||
1786 | passive_dwell = active_dwell + 1; | ||
1787 | |||
1788 | |||
1789 | channel = iwl_legacy_get_single_channel_number(priv, band); | ||
1790 | |||
1791 | if (channel) { | ||
1792 | scan_ch->channel = channel; | ||
1793 | scan_ch->type = 0; /* passive */ | ||
1794 | scan_ch->active_dwell = cpu_to_le16(active_dwell); | ||
1795 | scan_ch->passive_dwell = cpu_to_le16(passive_dwell); | ||
1796 | /* Set txpower levels to defaults */ | ||
1797 | scan_ch->tpc.dsp_atten = 110; | ||
1798 | if (band == IEEE80211_BAND_5GHZ) | ||
1799 | scan_ch->tpc.tx_gain = ((1 << 5) | (3 << 3)) | 3; | ||
1800 | else | ||
1801 | scan_ch->tpc.tx_gain = ((1 << 5) | (5 << 3)); | ||
1802 | added++; | ||
1803 | } else | ||
1804 | IWL_ERR(priv, "no valid channel found\n"); | ||
1805 | return added; | ||
1806 | } | ||
1807 | |||
1808 | static int iwl3945_get_channels_for_scan(struct iwl_priv *priv, | 1765 | static int iwl3945_get_channels_for_scan(struct iwl_priv *priv, |
1809 | enum ieee80211_band band, | 1766 | enum ieee80211_band band, |
1810 | u8 is_active, u8 n_probes, | 1767 | u8 is_active, u8 n_probes, |
@@ -2816,6 +2773,7 @@ int iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
2816 | enum ieee80211_band band; | 2773 | enum ieee80211_band band; |
2817 | bool is_active = false; | 2774 | bool is_active = false; |
2818 | int ret; | 2775 | int ret; |
2776 | u16 len; | ||
2819 | 2777 | ||
2820 | lockdep_assert_held(&priv->mutex); | 2778 | lockdep_assert_held(&priv->mutex); |
2821 | 2779 | ||
@@ -2834,17 +2792,14 @@ int iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
2834 | scan->quiet_time = IWL_ACTIVE_QUIET_TIME; | 2792 | scan->quiet_time = IWL_ACTIVE_QUIET_TIME; |
2835 | 2793 | ||
2836 | if (iwl_legacy_is_associated(priv, IWL_RXON_CTX_BSS)) { | 2794 | if (iwl_legacy_is_associated(priv, IWL_RXON_CTX_BSS)) { |
2837 | u16 interval = 0; | 2795 | u16 interval; |
2838 | u32 extra; | 2796 | u32 extra; |
2839 | u32 suspend_time = 100; | 2797 | u32 suspend_time = 100; |
2840 | u32 scan_suspend_time = 100; | 2798 | u32 scan_suspend_time = 100; |
2841 | 2799 | ||
2842 | IWL_DEBUG_INFO(priv, "Scanning while associated...\n"); | 2800 | IWL_DEBUG_INFO(priv, "Scanning while associated...\n"); |
2843 | 2801 | ||
2844 | if (priv->is_internal_short_scan) | 2802 | interval = vif->bss_conf.beacon_int; |
2845 | interval = 0; | ||
2846 | else | ||
2847 | interval = vif->bss_conf.beacon_int; | ||
2848 | 2803 | ||
2849 | scan->suspend_time = 0; | 2804 | scan->suspend_time = 0; |
2850 | scan->max_out_time = cpu_to_le32(200 * 1024); | 2805 | scan->max_out_time = cpu_to_le32(200 * 1024); |
@@ -2866,9 +2821,7 @@ int iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
2866 | scan_suspend_time, interval); | 2821 | scan_suspend_time, interval); |
2867 | } | 2822 | } |
2868 | 2823 | ||
2869 | if (priv->is_internal_short_scan) { | 2824 | if (priv->scan_request->n_ssids) { |
2870 | IWL_DEBUG_SCAN(priv, "Start internal passive scan.\n"); | ||
2871 | } else if (priv->scan_request->n_ssids) { | ||
2872 | int i, p = 0; | 2825 | int i, p = 0; |
2873 | IWL_DEBUG_SCAN(priv, "Kicking off active scan\n"); | 2826 | IWL_DEBUG_SCAN(priv, "Kicking off active scan\n"); |
2874 | for (i = 0; i < priv->scan_request->n_ssids; i++) { | 2827 | for (i = 0; i < priv->scan_request->n_ssids; i++) { |
@@ -2919,36 +2872,17 @@ int iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
2919 | scan->good_CRC_th = is_active ? IWL_GOOD_CRC_TH_DEFAULT : | 2872 | scan->good_CRC_th = is_active ? IWL_GOOD_CRC_TH_DEFAULT : |
2920 | IWL_GOOD_CRC_TH_DISABLED; | 2873 | IWL_GOOD_CRC_TH_DISABLED; |
2921 | 2874 | ||
2922 | if (!priv->is_internal_short_scan) { | 2875 | len = iwl_legacy_fill_probe_req(priv, (struct ieee80211_mgmt *)scan->data, |
2923 | scan->tx_cmd.len = cpu_to_le16( | 2876 | vif->addr, priv->scan_request->ie, |
2924 | iwl_legacy_fill_probe_req(priv, | 2877 | priv->scan_request->ie_len, |
2925 | (struct ieee80211_mgmt *)scan->data, | 2878 | IWL_MAX_SCAN_SIZE - sizeof(*scan)); |
2926 | vif->addr, | 2879 | scan->tx_cmd.len = cpu_to_le16(len); |
2927 | priv->scan_request->ie, | 2880 | |
2928 | priv->scan_request->ie_len, | ||
2929 | IWL_MAX_SCAN_SIZE - sizeof(*scan))); | ||
2930 | } else { | ||
2931 | /* use bcast addr, will not be transmitted but must be valid */ | ||
2932 | scan->tx_cmd.len = cpu_to_le16( | ||
2933 | iwl_legacy_fill_probe_req(priv, | ||
2934 | (struct ieee80211_mgmt *)scan->data, | ||
2935 | iwlegacy_bcast_addr, NULL, 0, | ||
2936 | IWL_MAX_SCAN_SIZE - sizeof(*scan))); | ||
2937 | } | ||
2938 | /* select Rx antennas */ | 2881 | /* select Rx antennas */ |
2939 | scan->flags |= iwl3945_get_antenna_flags(priv); | 2882 | scan->flags |= iwl3945_get_antenna_flags(priv); |
2940 | 2883 | ||
2941 | if (priv->is_internal_short_scan) { | 2884 | scan->channel_count = iwl3945_get_channels_for_scan(priv, band, is_active, n_probes, |
2942 | scan->channel_count = | 2885 | (void *)&scan->data[len], vif); |
2943 | iwl3945_get_single_channel_for_scan(priv, vif, band, | ||
2944 | (void *)&scan->data[le16_to_cpu( | ||
2945 | scan->tx_cmd.len)]); | ||
2946 | } else { | ||
2947 | scan->channel_count = | ||
2948 | iwl3945_get_channels_for_scan(priv, band, is_active, n_probes, | ||
2949 | (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)], vif); | ||
2950 | } | ||
2951 | |||
2952 | if (scan->channel_count == 0) { | 2886 | if (scan->channel_count == 0) { |
2953 | IWL_DEBUG_SCAN(priv, "channel count %d\n", scan->channel_count); | 2887 | IWL_DEBUG_SCAN(priv, "channel count %d\n", scan->channel_count); |
2954 | return -EIO; | 2888 | return -EIO; |
@@ -3824,10 +3758,7 @@ static int iwl3945_init_drv(struct iwl_priv *priv) | |||
3824 | priv->missed_beacon_threshold = IWL_MISSED_BEACON_THRESHOLD_DEF; | 3758 | priv->missed_beacon_threshold = IWL_MISSED_BEACON_THRESHOLD_DEF; |
3825 | 3759 | ||
3826 | /* initialize force reset */ | 3760 | /* initialize force reset */ |
3827 | priv->force_reset[IWL_RF_RESET].reset_duration = | 3761 | priv->force_reset.reset_duration = IWL_DELAY_NEXT_FORCE_FW_RELOAD; |
3828 | IWL_DELAY_NEXT_FORCE_RF_RESET; | ||
3829 | priv->force_reset[IWL_FW_RESET].reset_duration = | ||
3830 | IWL_DELAY_NEXT_FORCE_FW_RELOAD; | ||
3831 | 3762 | ||
3832 | if (eeprom->version < EEPROM_3945_EEPROM_VERSION) { | 3763 | if (eeprom->version < EEPROM_3945_EEPROM_VERSION) { |
3833 | IWL_WARN(priv, "Unsupported EEPROM version: 0x%04X\n", | 3764 | IWL_WARN(priv, "Unsupported EEPROM version: 0x%04X\n", |