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 | |
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')
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-3945.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-4965-lib.c | 79 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-4965.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-core.c | 90 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-core.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-debugfs.c | 95 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-dev.h | 25 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-scan.c | 92 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl3945-base.c | 95 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl4965-base.c | 5 |
10 files changed, 81 insertions, 407 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-3945.c b/drivers/net/wireless/iwlegacy/iwl-3945.c index 5e99584aa9af..8aa018dfa461 100644 --- a/drivers/net/wireless/iwlegacy/iwl-3945.c +++ b/drivers/net/wireless/iwlegacy/iwl-3945.c | |||
@@ -2697,7 +2697,6 @@ static struct iwl_base_params iwl3945_base_params = { | |||
2697 | .set_l0s = false, | 2697 | .set_l0s = false, |
2698 | .use_bsm = true, | 2698 | .use_bsm = true, |
2699 | .led_compensation = 64, | 2699 | .led_compensation = 64, |
2700 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, | ||
2701 | .wd_timeout = IWL_DEF_WD_TIMEOUT, | 2700 | .wd_timeout = IWL_DEF_WD_TIMEOUT, |
2702 | .max_event_log_size = 512, | 2701 | .max_event_log_size = 512, |
2703 | }; | 2702 | }; |
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-lib.c b/drivers/net/wireless/iwlegacy/iwl-4965-lib.c index a7a4739880dc..2be6d9e3b019 100644 --- a/drivers/net/wireless/iwlegacy/iwl-4965-lib.c +++ b/drivers/net/wireless/iwlegacy/iwl-4965-lib.c | |||
@@ -694,47 +694,6 @@ void iwl4965_rx_reply_rx_phy(struct iwl_priv *priv, | |||
694 | sizeof(struct iwl_rx_phy_res)); | 694 | sizeof(struct iwl_rx_phy_res)); |
695 | } | 695 | } |
696 | 696 | ||
697 | static int iwl4965_get_single_channel_for_scan(struct iwl_priv *priv, | ||
698 | struct ieee80211_vif *vif, | ||
699 | enum ieee80211_band band, | ||
700 | struct iwl_scan_channel *scan_ch) | ||
701 | { | ||
702 | const struct ieee80211_supported_band *sband; | ||
703 | u16 passive_dwell = 0; | ||
704 | u16 active_dwell = 0; | ||
705 | int added = 0; | ||
706 | u16 channel = 0; | ||
707 | |||
708 | sband = iwl_get_hw_mode(priv, band); | ||
709 | if (!sband) { | ||
710 | IWL_ERR(priv, "invalid band\n"); | ||
711 | return added; | ||
712 | } | ||
713 | |||
714 | active_dwell = iwl_legacy_get_active_dwell_time(priv, band, 0); | ||
715 | passive_dwell = iwl_legacy_get_passive_dwell_time(priv, band, vif); | ||
716 | |||
717 | if (passive_dwell <= active_dwell) | ||
718 | passive_dwell = active_dwell + 1; | ||
719 | |||
720 | channel = iwl_legacy_get_single_channel_number(priv, band); | ||
721 | if (channel) { | ||
722 | scan_ch->channel = cpu_to_le16(channel); | ||
723 | scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE; | ||
724 | scan_ch->active_dwell = cpu_to_le16(active_dwell); | ||
725 | scan_ch->passive_dwell = cpu_to_le16(passive_dwell); | ||
726 | /* Set txpower levels to defaults */ | ||
727 | scan_ch->dsp_atten = 110; | ||
728 | if (band == IEEE80211_BAND_5GHZ) | ||
729 | scan_ch->tx_gain = ((1 << 5) | (3 << 3)) | 3; | ||
730 | else | ||
731 | scan_ch->tx_gain = ((1 << 5) | (5 << 3)); | ||
732 | added++; | ||
733 | } else | ||
734 | IWL_ERR(priv, "no valid channel found\n"); | ||
735 | return added; | ||
736 | } | ||
737 | |||
738 | static int iwl4965_get_channels_for_scan(struct iwl_priv *priv, | 697 | static int iwl4965_get_channels_for_scan(struct iwl_priv *priv, |
739 | struct ieee80211_vif *vif, | 698 | struct ieee80211_vif *vif, |
740 | enum ieee80211_band band, | 699 | enum ieee80211_band band, |
@@ -858,16 +817,13 @@ int iwl4965_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
858 | scan->quiet_time = IWL_ACTIVE_QUIET_TIME; | 817 | scan->quiet_time = IWL_ACTIVE_QUIET_TIME; |
859 | 818 | ||
860 | if (iwl_legacy_is_any_associated(priv)) { | 819 | if (iwl_legacy_is_any_associated(priv)) { |
861 | u16 interval = 0; | 820 | u16 interval; |
862 | u32 extra; | 821 | u32 extra; |
863 | u32 suspend_time = 100; | 822 | u32 suspend_time = 100; |
864 | u32 scan_suspend_time = 100; | 823 | u32 scan_suspend_time = 100; |
865 | 824 | ||
866 | IWL_DEBUG_INFO(priv, "Scanning while associated...\n"); | 825 | IWL_DEBUG_INFO(priv, "Scanning while associated...\n"); |
867 | if (priv->is_internal_short_scan) | 826 | interval = vif->bss_conf.beacon_int; |
868 | interval = 0; | ||
869 | else | ||
870 | interval = vif->bss_conf.beacon_int; | ||
871 | 827 | ||
872 | scan->suspend_time = 0; | 828 | scan->suspend_time = 0; |
873 | scan->max_out_time = cpu_to_le32(200 * 1024); | 829 | scan->max_out_time = cpu_to_le32(200 * 1024); |
@@ -882,9 +838,7 @@ int iwl4965_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
882 | scan_suspend_time, interval); | 838 | scan_suspend_time, interval); |
883 | } | 839 | } |
884 | 840 | ||
885 | if (priv->is_internal_short_scan) { | 841 | if (priv->scan_request->n_ssids) { |
886 | IWL_DEBUG_SCAN(priv, "Start internal passive scan.\n"); | ||
887 | } else if (priv->scan_request->n_ssids) { | ||
888 | int i, p = 0; | 842 | int i, p = 0; |
889 | IWL_DEBUG_SCAN(priv, "Kicking off active scan\n"); | 843 | IWL_DEBUG_SCAN(priv, "Kicking off active scan\n"); |
890 | for (i = 0; i < priv->scan_request->n_ssids; i++) { | 844 | for (i = 0; i < priv->scan_request->n_ssids; i++) { |
@@ -981,38 +935,21 @@ int iwl4965_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
981 | rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_SEL_POS; | 935 | rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_SEL_POS; |
982 | rx_chain |= 0x1 << RXON_RX_CHAIN_DRIVER_FORCE_POS; | 936 | rx_chain |= 0x1 << RXON_RX_CHAIN_DRIVER_FORCE_POS; |
983 | scan->rx_chain = cpu_to_le16(rx_chain); | 937 | scan->rx_chain = cpu_to_le16(rx_chain); |
984 | if (!priv->is_internal_short_scan) { | 938 | |
985 | cmd_len = iwl_legacy_fill_probe_req(priv, | 939 | cmd_len = iwl_legacy_fill_probe_req(priv, |
986 | (struct ieee80211_mgmt *)scan->data, | 940 | (struct ieee80211_mgmt *)scan->data, |
987 | vif->addr, | 941 | vif->addr, |
988 | priv->scan_request->ie, | 942 | priv->scan_request->ie, |
989 | priv->scan_request->ie_len, | 943 | priv->scan_request->ie_len, |
990 | IWL_MAX_SCAN_SIZE - sizeof(*scan)); | 944 | IWL_MAX_SCAN_SIZE - sizeof(*scan)); |
991 | } else { | ||
992 | /* use bcast addr, will not be transmitted but must be valid */ | ||
993 | cmd_len = iwl_legacy_fill_probe_req(priv, | ||
994 | (struct ieee80211_mgmt *)scan->data, | ||
995 | iwlegacy_bcast_addr, NULL, 0, | ||
996 | IWL_MAX_SCAN_SIZE - sizeof(*scan)); | ||
997 | |||
998 | } | ||
999 | scan->tx_cmd.len = cpu_to_le16(cmd_len); | 945 | scan->tx_cmd.len = cpu_to_le16(cmd_len); |
1000 | 946 | ||
1001 | scan->filter_flags |= (RXON_FILTER_ACCEPT_GRP_MSK | | 947 | scan->filter_flags |= (RXON_FILTER_ACCEPT_GRP_MSK | |
1002 | RXON_FILTER_BCON_AWARE_MSK); | 948 | RXON_FILTER_BCON_AWARE_MSK); |
1003 | 949 | ||
1004 | if (priv->is_internal_short_scan) { | 950 | scan->channel_count = iwl4965_get_channels_for_scan(priv, vif, band, |
1005 | scan->channel_count = | 951 | is_active, n_probes, |
1006 | iwl4965_get_single_channel_for_scan(priv, vif, band, | 952 | (void *)&scan->data[cmd_len]); |
1007 | (void *)&scan->data[le16_to_cpu( | ||
1008 | scan->tx_cmd.len)]); | ||
1009 | } else { | ||
1010 | scan->channel_count = | ||
1011 | iwl4965_get_channels_for_scan(priv, vif, band, | ||
1012 | is_active, n_probes, | ||
1013 | (void *)&scan->data[le16_to_cpu( | ||
1014 | scan->tx_cmd.len)]); | ||
1015 | } | ||
1016 | if (scan->channel_count == 0) { | 953 | if (scan->channel_count == 0) { |
1017 | IWL_DEBUG_SCAN(priv, "channel count %d\n", scan->channel_count); | 954 | IWL_DEBUG_SCAN(priv, "channel count %d\n", scan->channel_count); |
1018 | return -EIO; | 955 | return -EIO; |
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965.c b/drivers/net/wireless/iwlegacy/iwl-4965.c index f59f588ca05d..59a4b53218ea 100644 --- a/drivers/net/wireless/iwlegacy/iwl-4965.c +++ b/drivers/net/wireless/iwlegacy/iwl-4965.c | |||
@@ -2149,7 +2149,6 @@ static struct iwl_base_params iwl4965_base_params = { | |||
2149 | .use_bsm = true, | 2149 | .use_bsm = true, |
2150 | .led_compensation = 61, | 2150 | .led_compensation = 61, |
2151 | .chain_noise_num_beacons = IWL4965_CAL_NUM_BEACONS, | 2151 | .chain_noise_num_beacons = IWL4965_CAL_NUM_BEACONS, |
2152 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | ||
2153 | .wd_timeout = IWL_DEF_WD_TIMEOUT, | 2152 | .wd_timeout = IWL_DEF_WD_TIMEOUT, |
2154 | .temperature_kelvin = true, | 2153 | .temperature_kelvin = true, |
2155 | .max_event_log_size = 512, | 2154 | .max_event_log_size = 512, |
diff --git a/drivers/net/wireless/iwlegacy/iwl-core.c b/drivers/net/wireless/iwlegacy/iwl-core.c index 3be76bd5499a..240d3a80c7bc 100644 --- a/drivers/net/wireless/iwlegacy/iwl-core.c +++ b/drivers/net/wireless/iwlegacy/iwl-core.c | |||
@@ -1707,41 +1707,14 @@ iwl_legacy_update_stats(struct iwl_priv *priv, bool is_tx, __le16 fc, u16 len) | |||
1707 | EXPORT_SYMBOL(iwl_legacy_update_stats); | 1707 | EXPORT_SYMBOL(iwl_legacy_update_stats); |
1708 | #endif | 1708 | #endif |
1709 | 1709 | ||
1710 | static void _iwl_legacy_force_rf_reset(struct iwl_priv *priv) | 1710 | int iwl_legacy_force_reset(struct iwl_priv *priv, bool external) |
1711 | { | ||
1712 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | ||
1713 | return; | ||
1714 | |||
1715 | if (!iwl_legacy_is_any_associated(priv)) { | ||
1716 | IWL_DEBUG_SCAN(priv, "force reset rejected: not associated\n"); | ||
1717 | return; | ||
1718 | } | ||
1719 | /* | ||
1720 | * There is no easy and better way to force reset the radio, | ||
1721 | * the only known method is switching channel which will force to | ||
1722 | * reset and tune the radio. | ||
1723 | * Use internal short scan (single channel) operation to should | ||
1724 | * achieve this objective. | ||
1725 | * Driver should reset the radio when number of consecutive missed | ||
1726 | * beacon, or any other uCode error condition detected. | ||
1727 | */ | ||
1728 | IWL_DEBUG_INFO(priv, "perform radio reset.\n"); | ||
1729 | iwl_legacy_internal_short_hw_scan(priv); | ||
1730 | } | ||
1731 | |||
1732 | |||
1733 | int iwl_legacy_force_reset(struct iwl_priv *priv, int mode, bool external) | ||
1734 | { | 1711 | { |
1735 | struct iwl_force_reset *force_reset; | 1712 | struct iwl_force_reset *force_reset; |
1736 | 1713 | ||
1737 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 1714 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
1738 | return -EINVAL; | 1715 | return -EINVAL; |
1739 | 1716 | ||
1740 | if (mode >= IWL_MAX_FORCE_RESET) { | 1717 | force_reset = &priv->force_reset; |
1741 | IWL_DEBUG_INFO(priv, "invalid reset request.\n"); | ||
1742 | return -EINVAL; | ||
1743 | } | ||
1744 | force_reset = &priv->force_reset[mode]; | ||
1745 | force_reset->reset_request_count++; | 1718 | force_reset->reset_request_count++; |
1746 | if (!external) { | 1719 | if (!external) { |
1747 | if (force_reset->last_force_reset_jiffies && | 1720 | if (force_reset->last_force_reset_jiffies && |
@@ -1754,37 +1727,34 @@ int iwl_legacy_force_reset(struct iwl_priv *priv, int mode, bool external) | |||
1754 | } | 1727 | } |
1755 | force_reset->reset_success_count++; | 1728 | force_reset->reset_success_count++; |
1756 | force_reset->last_force_reset_jiffies = jiffies; | 1729 | force_reset->last_force_reset_jiffies = jiffies; |
1757 | IWL_DEBUG_INFO(priv, "perform force reset (%d)\n", mode); | 1730 | |
1758 | switch (mode) { | 1731 | /* |
1759 | case IWL_RF_RESET: | 1732 | * if the request is from external(ex: debugfs), |
1760 | _iwl_legacy_force_rf_reset(priv); | 1733 | * then always perform the request in regardless the module |
1761 | break; | 1734 | * parameter setting |
1762 | case IWL_FW_RESET: | 1735 | * if the request is from internal (uCode error or driver |
1763 | /* | 1736 | * detect failure), then fw_restart module parameter |
1764 | * if the request is from external(ex: debugfs), | 1737 | * need to be check before performing firmware reload |
1765 | * then always perform the request in regardless the module | 1738 | */ |
1766 | * parameter setting | 1739 | |
1767 | * if the request is from internal (uCode error or driver | 1740 | if (!external && !priv->cfg->mod_params->restart_fw) { |
1768 | * detect failure), then fw_restart module parameter | 1741 | IWL_DEBUG_INFO(priv, "Cancel firmware reload based on " |
1769 | * need to be check before performing firmware reload | 1742 | "module parameter setting\n"); |
1770 | */ | 1743 | return 0; |
1771 | if (!external && !priv->cfg->mod_params->restart_fw) { | ||
1772 | IWL_DEBUG_INFO(priv, "Cancel firmware reload based on " | ||
1773 | "module parameter setting\n"); | ||
1774 | break; | ||
1775 | } | ||
1776 | IWL_ERR(priv, "On demand firmware reload\n"); | ||
1777 | /* Set the FW error flag -- cleared on iwl_down */ | ||
1778 | set_bit(STATUS_FW_ERROR, &priv->status); | ||
1779 | wake_up_interruptible(&priv->wait_command_queue); | ||
1780 | /* | ||
1781 | * Keep the restart process from trying to send host | ||
1782 | * commands by clearing the INIT status bit | ||
1783 | */ | ||
1784 | clear_bit(STATUS_READY, &priv->status); | ||
1785 | queue_work(priv->workqueue, &priv->restart); | ||
1786 | break; | ||
1787 | } | 1744 | } |
1745 | |||
1746 | IWL_ERR(priv, "On demand firmware reload\n"); | ||
1747 | |||
1748 | /* Set the FW error flag -- cleared on iwl_down */ | ||
1749 | set_bit(STATUS_FW_ERROR, &priv->status); | ||
1750 | wake_up_interruptible(&priv->wait_command_queue); | ||
1751 | /* | ||
1752 | * Keep the restart process from trying to send host | ||
1753 | * commands by clearing the INIT status bit | ||
1754 | */ | ||
1755 | clear_bit(STATUS_READY, &priv->status); | ||
1756 | queue_work(priv->workqueue, &priv->restart); | ||
1757 | |||
1788 | return 0; | 1758 | return 0; |
1789 | } | 1759 | } |
1790 | 1760 | ||
@@ -1879,7 +1849,7 @@ static int iwl_legacy_check_stuck_queue(struct iwl_priv *priv, int cnt) | |||
1879 | if (time_after(jiffies, timeout)) { | 1849 | if (time_after(jiffies, timeout)) { |
1880 | IWL_ERR(priv, "Queue %d stuck for %u ms.\n", | 1850 | IWL_ERR(priv, "Queue %d stuck for %u ms.\n", |
1881 | q->id, priv->cfg->base_params->wd_timeout); | 1851 | q->id, priv->cfg->base_params->wd_timeout); |
1882 | ret = iwl_legacy_force_reset(priv, IWL_FW_RESET, false); | 1852 | ret = iwl_legacy_force_reset(priv, false); |
1883 | return (ret == -EAGAIN) ? 0 : 1; | 1853 | return (ret == -EAGAIN) ? 0 : 1; |
1884 | } | 1854 | } |
1885 | 1855 | ||
diff --git a/drivers/net/wireless/iwlegacy/iwl-core.h b/drivers/net/wireless/iwlegacy/iwl-core.h index a821bdbe3e16..8f766e94881c 100644 --- a/drivers/net/wireless/iwlegacy/iwl-core.h +++ b/drivers/net/wireless/iwlegacy/iwl-core.h | |||
@@ -204,8 +204,6 @@ struct iwl_mod_params { | |||
204 | * to the deviation to achieve the desired led frequency. | 204 | * to the deviation to achieve the desired led frequency. |
205 | * The detail algorithm is described in iwl-led.c | 205 | * The detail algorithm is described in iwl-led.c |
206 | * @chain_noise_num_beacons: number of beacons used to compute chain noise | 206 | * @chain_noise_num_beacons: number of beacons used to compute chain noise |
207 | * @plcp_delta_threshold: plcp error rate threshold used to trigger | ||
208 | * radio tuning when there is a high receiving plcp error rate | ||
209 | * @wd_timeout: TX queues watchdog timeout | 207 | * @wd_timeout: TX queues watchdog timeout |
210 | * @temperature_kelvin: temperature report by uCode in kelvin | 208 | * @temperature_kelvin: temperature report by uCode in kelvin |
211 | * @max_event_log_size: size of event log buffer size for ucode event logging | 209 | * @max_event_log_size: size of event log buffer size for ucode event logging |
@@ -226,7 +224,6 @@ struct iwl_base_params { | |||
226 | 224 | ||
227 | u16 led_compensation; | 225 | u16 led_compensation; |
228 | int chain_noise_num_beacons; | 226 | int chain_noise_num_beacons; |
229 | u8 plcp_delta_threshold; | ||
230 | unsigned int wd_timeout; | 227 | unsigned int wd_timeout; |
231 | bool temperature_kelvin; | 228 | bool temperature_kelvin; |
232 | u32 max_event_log_size; | 229 | u32 max_event_log_size; |
@@ -438,7 +435,7 @@ int iwl_legacy_mac_hw_scan(struct ieee80211_hw *hw, | |||
438 | struct ieee80211_vif *vif, | 435 | struct ieee80211_vif *vif, |
439 | struct cfg80211_scan_request *req); | 436 | struct cfg80211_scan_request *req); |
440 | void iwl_legacy_internal_short_hw_scan(struct iwl_priv *priv); | 437 | void iwl_legacy_internal_short_hw_scan(struct iwl_priv *priv); |
441 | int iwl_legacy_force_reset(struct iwl_priv *priv, int mode, bool external); | 438 | int iwl_legacy_force_reset(struct iwl_priv *priv, bool external); |
442 | u16 iwl_legacy_fill_probe_req(struct iwl_priv *priv, | 439 | u16 iwl_legacy_fill_probe_req(struct iwl_priv *priv, |
443 | struct ieee80211_mgmt *frame, | 440 | struct ieee80211_mgmt *frame, |
444 | const u8 *ta, const u8 *ie, int ie_len, int left); | 441 | const u8 *ta, const u8 *ie, int ie_len, int left); |
diff --git a/drivers/net/wireless/iwlegacy/iwl-debugfs.c b/drivers/net/wireless/iwlegacy/iwl-debugfs.c index 2d32438b4cb8..88ffc92ef0b0 100644 --- a/drivers/net/wireless/iwlegacy/iwl-debugfs.c +++ b/drivers/net/wireless/iwlegacy/iwl-debugfs.c | |||
@@ -1236,72 +1236,31 @@ static ssize_t iwl_legacy_dbgfs_missed_beacon_write(struct file *file, | |||
1236 | return count; | 1236 | return count; |
1237 | } | 1237 | } |
1238 | 1238 | ||
1239 | static ssize_t iwl_legacy_dbgfs_plcp_delta_read(struct file *file, | ||
1240 | char __user *user_buf, | ||
1241 | size_t count, loff_t *ppos) { | ||
1242 | |||
1243 | struct iwl_priv *priv = file->private_data; | ||
1244 | int pos = 0; | ||
1245 | char buf[12]; | ||
1246 | const size_t bufsz = sizeof(buf); | ||
1247 | |||
1248 | pos += scnprintf(buf + pos, bufsz - pos, "%u\n", | ||
1249 | priv->cfg->base_params->plcp_delta_threshold); | ||
1250 | |||
1251 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); | ||
1252 | } | ||
1253 | |||
1254 | static ssize_t iwl_legacy_dbgfs_plcp_delta_write(struct file *file, | ||
1255 | const char __user *user_buf, | ||
1256 | size_t count, loff_t *ppos) { | ||
1257 | |||
1258 | struct iwl_priv *priv = file->private_data; | ||
1259 | char buf[8]; | ||
1260 | int buf_size; | ||
1261 | int plcp; | ||
1262 | |||
1263 | memset(buf, 0, sizeof(buf)); | ||
1264 | buf_size = min(count, sizeof(buf) - 1); | ||
1265 | if (copy_from_user(buf, user_buf, buf_size)) | ||
1266 | return -EFAULT; | ||
1267 | if (sscanf(buf, "%d", &plcp) != 1) | ||
1268 | return -EINVAL; | ||
1269 | if ((plcp < IWL_MAX_PLCP_ERR_THRESHOLD_MIN) || | ||
1270 | (plcp > IWL_MAX_PLCP_ERR_THRESHOLD_MAX)) | ||
1271 | priv->cfg->base_params->plcp_delta_threshold = | ||
1272 | IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE; | ||
1273 | else | ||
1274 | priv->cfg->base_params->plcp_delta_threshold = plcp; | ||
1275 | return count; | ||
1276 | } | ||
1277 | |||
1278 | static ssize_t iwl_legacy_dbgfs_force_reset_read(struct file *file, | 1239 | static ssize_t iwl_legacy_dbgfs_force_reset_read(struct file *file, |
1279 | char __user *user_buf, | 1240 | char __user *user_buf, |
1280 | size_t count, loff_t *ppos) { | 1241 | size_t count, loff_t *ppos) { |
1281 | 1242 | ||
1282 | struct iwl_priv *priv = file->private_data; | 1243 | struct iwl_priv *priv = file->private_data; |
1283 | int i, pos = 0; | 1244 | int pos = 0; |
1284 | char buf[300]; | 1245 | char buf[300]; |
1285 | const size_t bufsz = sizeof(buf); | 1246 | const size_t bufsz = sizeof(buf); |
1286 | struct iwl_force_reset *force_reset; | 1247 | struct iwl_force_reset *force_reset; |
1287 | 1248 | ||
1288 | for (i = 0; i < IWL_MAX_FORCE_RESET; i++) { | 1249 | force_reset = &priv->force_reset; |
1289 | force_reset = &priv->force_reset[i]; | 1250 | |
1290 | pos += scnprintf(buf + pos, bufsz - pos, | 1251 | pos += scnprintf(buf + pos, bufsz - pos, |
1291 | "Force reset method %d\n", i); | 1252 | "\tnumber of reset request: %d\n", |
1292 | pos += scnprintf(buf + pos, bufsz - pos, | 1253 | force_reset->reset_request_count); |
1293 | "\tnumber of reset request: %d\n", | 1254 | pos += scnprintf(buf + pos, bufsz - pos, |
1294 | force_reset->reset_request_count); | 1255 | "\tnumber of reset request success: %d\n", |
1295 | pos += scnprintf(buf + pos, bufsz - pos, | 1256 | force_reset->reset_success_count); |
1296 | "\tnumber of reset request success: %d\n", | 1257 | pos += scnprintf(buf + pos, bufsz - pos, |
1297 | force_reset->reset_success_count); | 1258 | "\tnumber of reset request reject: %d\n", |
1298 | pos += scnprintf(buf + pos, bufsz - pos, | 1259 | force_reset->reset_reject_count); |
1299 | "\tnumber of reset request reject: %d\n", | 1260 | pos += scnprintf(buf + pos, bufsz - pos, |
1300 | force_reset->reset_reject_count); | 1261 | "\treset duration: %lu\n", |
1301 | pos += scnprintf(buf + pos, bufsz - pos, | 1262 | force_reset->reset_duration); |
1302 | "\treset duration: %lu\n", | 1263 | |
1303 | force_reset->reset_duration); | ||
1304 | } | ||
1305 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 1264 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
1306 | } | 1265 | } |
1307 | 1266 | ||
@@ -1309,25 +1268,11 @@ static ssize_t iwl_legacy_dbgfs_force_reset_write(struct file *file, | |||
1309 | const char __user *user_buf, | 1268 | const char __user *user_buf, |
1310 | size_t count, loff_t *ppos) { | 1269 | size_t count, loff_t *ppos) { |
1311 | 1270 | ||
1271 | int ret; | ||
1312 | struct iwl_priv *priv = file->private_data; | 1272 | struct iwl_priv *priv = file->private_data; |
1313 | char buf[8]; | ||
1314 | int buf_size; | ||
1315 | int reset, ret; | ||
1316 | 1273 | ||
1317 | memset(buf, 0, sizeof(buf)); | 1274 | ret = iwl_legacy_force_reset(priv, true); |
1318 | buf_size = min(count, sizeof(buf) - 1); | 1275 | |
1319 | if (copy_from_user(buf, user_buf, buf_size)) | ||
1320 | return -EFAULT; | ||
1321 | if (sscanf(buf, "%d", &reset) != 1) | ||
1322 | return -EINVAL; | ||
1323 | switch (reset) { | ||
1324 | case IWL_RF_RESET: | ||
1325 | case IWL_FW_RESET: | ||
1326 | ret = iwl_legacy_force_reset(priv, reset, true); | ||
1327 | break; | ||
1328 | default: | ||
1329 | return -EINVAL; | ||
1330 | } | ||
1331 | return ret ? ret : count; | 1276 | return ret ? ret : count; |
1332 | } | 1277 | } |
1333 | 1278 | ||
@@ -1370,7 +1315,6 @@ DEBUGFS_WRITE_FILE_OPS(clear_traffic_statistics); | |||
1370 | DEBUGFS_READ_WRITE_FILE_OPS(ucode_tracing); | 1315 | DEBUGFS_READ_WRITE_FILE_OPS(ucode_tracing); |
1371 | DEBUGFS_READ_FILE_OPS(fh_reg); | 1316 | DEBUGFS_READ_FILE_OPS(fh_reg); |
1372 | DEBUGFS_READ_WRITE_FILE_OPS(missed_beacon); | 1317 | DEBUGFS_READ_WRITE_FILE_OPS(missed_beacon); |
1373 | DEBUGFS_READ_WRITE_FILE_OPS(plcp_delta); | ||
1374 | DEBUGFS_READ_WRITE_FILE_OPS(force_reset); | 1318 | DEBUGFS_READ_WRITE_FILE_OPS(force_reset); |
1375 | DEBUGFS_READ_FILE_OPS(rxon_flags); | 1319 | DEBUGFS_READ_FILE_OPS(rxon_flags); |
1376 | DEBUGFS_READ_FILE_OPS(rxon_filter_flags); | 1320 | DEBUGFS_READ_FILE_OPS(rxon_filter_flags); |
@@ -1420,7 +1364,6 @@ int iwl_legacy_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
1420 | DEBUGFS_ADD_FILE(clear_traffic_statistics, dir_debug, S_IWUSR); | 1364 | DEBUGFS_ADD_FILE(clear_traffic_statistics, dir_debug, S_IWUSR); |
1421 | DEBUGFS_ADD_FILE(fh_reg, dir_debug, S_IRUSR); | 1365 | DEBUGFS_ADD_FILE(fh_reg, dir_debug, S_IRUSR); |
1422 | DEBUGFS_ADD_FILE(missed_beacon, dir_debug, S_IWUSR); | 1366 | DEBUGFS_ADD_FILE(missed_beacon, dir_debug, S_IWUSR); |
1423 | DEBUGFS_ADD_FILE(plcp_delta, dir_debug, S_IWUSR | S_IRUSR); | ||
1424 | DEBUGFS_ADD_FILE(force_reset, dir_debug, S_IWUSR | S_IRUSR); | 1367 | DEBUGFS_ADD_FILE(force_reset, dir_debug, S_IWUSR | S_IRUSR); |
1425 | DEBUGFS_ADD_FILE(ucode_rx_stats, dir_debug, S_IRUSR); | 1368 | DEBUGFS_ADD_FILE(ucode_rx_stats, dir_debug, S_IRUSR); |
1426 | DEBUGFS_ADD_FILE(ucode_tx_stats, dir_debug, S_IRUSR); | 1369 | DEBUGFS_ADD_FILE(ucode_tx_stats, dir_debug, S_IRUSR); |
diff --git a/drivers/net/wireless/iwlegacy/iwl-dev.h b/drivers/net/wireless/iwlegacy/iwl-dev.h index ea30122669ee..c5a135a71312 100644 --- a/drivers/net/wireless/iwlegacy/iwl-dev.h +++ b/drivers/net/wireless/iwlegacy/iwl-dev.h | |||
@@ -895,18 +895,6 @@ struct iwl_event_log { | |||
895 | #define IWL_HOST_INT_CALIB_TIMEOUT_DEF (0x10) | 895 | #define IWL_HOST_INT_CALIB_TIMEOUT_DEF (0x10) |
896 | #define IWL_HOST_INT_CALIB_TIMEOUT_MIN (0x0) | 896 | #define IWL_HOST_INT_CALIB_TIMEOUT_MIN (0x0) |
897 | 897 | ||
898 | /* | ||
899 | * This is the threshold value of plcp error rate per 100mSecs. It is | ||
900 | * used to set and check for the validity of plcp_delta. | ||
901 | */ | ||
902 | #define IWL_MAX_PLCP_ERR_THRESHOLD_MIN (1) | ||
903 | #define IWL_MAX_PLCP_ERR_THRESHOLD_DEF (50) | ||
904 | #define IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF (100) | ||
905 | #define IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF (200) | ||
906 | #define IWL_MAX_PLCP_ERR_THRESHOLD_MAX (255) | ||
907 | #define IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE (0) | ||
908 | |||
909 | #define IWL_DELAY_NEXT_FORCE_RF_RESET (HZ*3) | ||
910 | #define IWL_DELAY_NEXT_FORCE_FW_RELOAD (HZ*5) | 898 | #define IWL_DELAY_NEXT_FORCE_FW_RELOAD (HZ*5) |
911 | 899 | ||
912 | /* TX queue watchdog timeouts in mSecs */ | 900 | /* TX queue watchdog timeouts in mSecs */ |
@@ -914,12 +902,6 @@ struct iwl_event_log { | |||
914 | #define IWL_LONG_WD_TIMEOUT (10000) | 902 | #define IWL_LONG_WD_TIMEOUT (10000) |
915 | #define IWL_MAX_WD_TIMEOUT (120000) | 903 | #define IWL_MAX_WD_TIMEOUT (120000) |
916 | 904 | ||
917 | enum iwl_reset { | ||
918 | IWL_RF_RESET = 0, | ||
919 | IWL_FW_RESET, | ||
920 | IWL_MAX_FORCE_RESET, | ||
921 | }; | ||
922 | |||
923 | struct iwl_force_reset { | 905 | struct iwl_force_reset { |
924 | int reset_request_count; | 906 | int reset_request_count; |
925 | int reset_success_count; | 907 | int reset_success_count; |
@@ -1032,11 +1014,8 @@ struct iwl_priv { | |||
1032 | /* track IBSS manager (last beacon) status */ | 1014 | /* track IBSS manager (last beacon) status */ |
1033 | u32 ibss_manager; | 1015 | u32 ibss_manager; |
1034 | 1016 | ||
1035 | /* storing the jiffies when the plcp error rate is received */ | ||
1036 | unsigned long plcp_jiffies; | ||
1037 | |||
1038 | /* force reset */ | 1017 | /* force reset */ |
1039 | struct iwl_force_reset force_reset[IWL_MAX_FORCE_RESET]; | 1018 | struct iwl_force_reset force_reset; |
1040 | 1019 | ||
1041 | /* we allocate array of iwl_channel_info for NIC's valid channels. | 1020 | /* we allocate array of iwl_channel_info for NIC's valid channels. |
1042 | * Access via channel # using indirect index array */ | 1021 | * Access via channel # using indirect index array */ |
@@ -1057,7 +1036,6 @@ struct iwl_priv { | |||
1057 | enum ieee80211_band scan_band; | 1036 | enum ieee80211_band scan_band; |
1058 | struct cfg80211_scan_request *scan_request; | 1037 | struct cfg80211_scan_request *scan_request; |
1059 | struct ieee80211_vif *scan_vif; | 1038 | struct ieee80211_vif *scan_vif; |
1060 | bool is_internal_short_scan; | ||
1061 | u8 scan_tx_ant[IEEE80211_NUM_BANDS]; | 1039 | u8 scan_tx_ant[IEEE80211_NUM_BANDS]; |
1062 | u8 mgmt_tx_ant; | 1040 | u8 mgmt_tx_ant; |
1063 | 1041 | ||
@@ -1256,7 +1234,6 @@ struct iwl_priv { | |||
1256 | struct iwl_rxon_context *beacon_ctx; | 1234 | struct iwl_rxon_context *beacon_ctx; |
1257 | struct sk_buff *beacon_skb; | 1235 | struct sk_buff *beacon_skb; |
1258 | 1236 | ||
1259 | struct work_struct start_internal_scan; | ||
1260 | struct work_struct tx_flush; | 1237 | struct work_struct tx_flush; |
1261 | 1238 | ||
1262 | struct tasklet_struct irq_tasklet; | 1239 | struct tasklet_struct irq_tasklet; |
diff --git a/drivers/net/wireless/iwlegacy/iwl-scan.c b/drivers/net/wireless/iwlegacy/iwl-scan.c index 353234a02c6d..a6b5222fc59e 100644 --- a/drivers/net/wireless/iwlegacy/iwl-scan.c +++ b/drivers/net/wireless/iwlegacy/iwl-scan.c | |||
@@ -101,7 +101,6 @@ static void iwl_legacy_complete_scan(struct iwl_priv *priv, bool aborted) | |||
101 | ieee80211_scan_completed(priv->hw, aborted); | 101 | ieee80211_scan_completed(priv->hw, aborted); |
102 | } | 102 | } |
103 | 103 | ||
104 | priv->is_internal_short_scan = false; | ||
105 | priv->scan_vif = NULL; | 104 | priv->scan_vif = NULL; |
106 | priv->scan_request = NULL; | 105 | priv->scan_request = NULL; |
107 | } | 106 | } |
@@ -329,10 +328,8 @@ void iwl_legacy_init_scan_params(struct iwl_priv *priv) | |||
329 | } | 328 | } |
330 | EXPORT_SYMBOL(iwl_legacy_init_scan_params); | 329 | EXPORT_SYMBOL(iwl_legacy_init_scan_params); |
331 | 330 | ||
332 | static int __must_check iwl_legacy_scan_initiate(struct iwl_priv *priv, | 331 | static int iwl_legacy_scan_initiate(struct iwl_priv *priv, |
333 | struct ieee80211_vif *vif, | 332 | struct ieee80211_vif *vif) |
334 | bool internal, | ||
335 | enum ieee80211_band band) | ||
336 | { | 333 | { |
337 | int ret; | 334 | int ret; |
338 | 335 | ||
@@ -359,18 +356,14 @@ static int __must_check iwl_legacy_scan_initiate(struct iwl_priv *priv, | |||
359 | return -EBUSY; | 356 | return -EBUSY; |
360 | } | 357 | } |
361 | 358 | ||
362 | IWL_DEBUG_SCAN(priv, "Starting %sscan...\n", | 359 | IWL_DEBUG_SCAN(priv, "Starting scan...\n"); |
363 | internal ? "internal short " : ""); | ||
364 | 360 | ||
365 | set_bit(STATUS_SCANNING, &priv->status); | 361 | set_bit(STATUS_SCANNING, &priv->status); |
366 | priv->is_internal_short_scan = internal; | ||
367 | priv->scan_start = jiffies; | 362 | priv->scan_start = jiffies; |
368 | priv->scan_band = band; | ||
369 | 363 | ||
370 | ret = priv->cfg->ops->utils->request_scan(priv, vif); | 364 | ret = priv->cfg->ops->utils->request_scan(priv, vif); |
371 | if (ret) { | 365 | if (ret) { |
372 | clear_bit(STATUS_SCANNING, &priv->status); | 366 | clear_bit(STATUS_SCANNING, &priv->status); |
373 | priv->is_internal_short_scan = false; | ||
374 | return ret; | 367 | return ret; |
375 | } | 368 | } |
376 | 369 | ||
@@ -394,8 +387,7 @@ int iwl_legacy_mac_hw_scan(struct ieee80211_hw *hw, | |||
394 | 387 | ||
395 | mutex_lock(&priv->mutex); | 388 | mutex_lock(&priv->mutex); |
396 | 389 | ||
397 | if (test_bit(STATUS_SCANNING, &priv->status) && | 390 | if (test_bit(STATUS_SCANNING, &priv->status)) { |
398 | !priv->is_internal_short_scan) { | ||
399 | IWL_DEBUG_SCAN(priv, "Scan already in progress.\n"); | 391 | IWL_DEBUG_SCAN(priv, "Scan already in progress.\n"); |
400 | ret = -EAGAIN; | 392 | ret = -EAGAIN; |
401 | goto out_unlock; | 393 | goto out_unlock; |
@@ -404,17 +396,9 @@ int iwl_legacy_mac_hw_scan(struct ieee80211_hw *hw, | |||
404 | /* mac80211 will only ask for one band at a time */ | 396 | /* mac80211 will only ask for one band at a time */ |
405 | priv->scan_request = req; | 397 | priv->scan_request = req; |
406 | priv->scan_vif = vif; | 398 | priv->scan_vif = vif; |
399 | priv->scan_band = req->channels[0]->band; | ||
407 | 400 | ||
408 | /* | 401 | ret = iwl_legacy_scan_initiate(priv, vif); |
409 | * If an internal scan is in progress, just set | ||
410 | * up the scan_request as per above. | ||
411 | */ | ||
412 | if (priv->is_internal_short_scan) { | ||
413 | IWL_DEBUG_SCAN(priv, "SCAN request during internal scan\n"); | ||
414 | ret = 0; | ||
415 | } else | ||
416 | ret = iwl_legacy_scan_initiate(priv, vif, false, | ||
417 | req->channels[0]->band); | ||
418 | 402 | ||
419 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 403 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
420 | 404 | ||
@@ -425,40 +409,6 @@ out_unlock: | |||
425 | } | 409 | } |
426 | EXPORT_SYMBOL(iwl_legacy_mac_hw_scan); | 410 | EXPORT_SYMBOL(iwl_legacy_mac_hw_scan); |
427 | 411 | ||
428 | /* | ||
429 | * internal short scan, this function should only been called while associated. | ||
430 | * It will reset and tune the radio to prevent possible RF related problem | ||
431 | */ | ||
432 | void iwl_legacy_internal_short_hw_scan(struct iwl_priv *priv) | ||
433 | { | ||
434 | queue_work(priv->workqueue, &priv->start_internal_scan); | ||
435 | } | ||
436 | |||
437 | static void iwl_legacy_bg_start_internal_scan(struct work_struct *work) | ||
438 | { | ||
439 | struct iwl_priv *priv = | ||
440 | container_of(work, struct iwl_priv, start_internal_scan); | ||
441 | |||
442 | IWL_DEBUG_SCAN(priv, "Start internal scan\n"); | ||
443 | |||
444 | mutex_lock(&priv->mutex); | ||
445 | |||
446 | if (priv->is_internal_short_scan == true) { | ||
447 | IWL_DEBUG_SCAN(priv, "Internal scan already in progress\n"); | ||
448 | goto unlock; | ||
449 | } | ||
450 | |||
451 | if (test_bit(STATUS_SCANNING, &priv->status)) { | ||
452 | IWL_DEBUG_SCAN(priv, "Scan already in progress.\n"); | ||
453 | goto unlock; | ||
454 | } | ||
455 | |||
456 | if (iwl_legacy_scan_initiate(priv, NULL, true, priv->band)) | ||
457 | IWL_DEBUG_SCAN(priv, "failed to start internal short scan\n"); | ||
458 | unlock: | ||
459 | mutex_unlock(&priv->mutex); | ||
460 | } | ||
461 | |||
462 | static void iwl_legacy_bg_scan_check(struct work_struct *data) | 412 | static void iwl_legacy_bg_scan_check(struct work_struct *data) |
463 | { | 413 | { |
464 | struct iwl_priv *priv = | 414 | struct iwl_priv *priv = |
@@ -542,8 +492,7 @@ static void iwl_legacy_bg_scan_completed(struct work_struct *work) | |||
542 | container_of(work, struct iwl_priv, scan_completed); | 492 | container_of(work, struct iwl_priv, scan_completed); |
543 | bool aborted; | 493 | bool aborted; |
544 | 494 | ||
545 | IWL_DEBUG_SCAN(priv, "Completed %sscan.\n", | 495 | IWL_DEBUG_SCAN(priv, "Completed scan.\n"); |
546 | priv->is_internal_short_scan ? "internal short " : ""); | ||
547 | 496 | ||
548 | cancel_delayed_work(&priv->scan_check); | 497 | cancel_delayed_work(&priv->scan_check); |
549 | 498 | ||
@@ -558,27 +507,6 @@ static void iwl_legacy_bg_scan_completed(struct work_struct *work) | |||
558 | goto out_settings; | 507 | goto out_settings; |
559 | } | 508 | } |
560 | 509 | ||
561 | if (priv->is_internal_short_scan && !aborted) { | ||
562 | int err; | ||
563 | |||
564 | /* Check if mac80211 requested scan during our internal scan */ | ||
565 | if (priv->scan_request == NULL) | ||
566 | goto out_complete; | ||
567 | |||
568 | /* If so request a new scan */ | ||
569 | err = iwl_legacy_scan_initiate(priv, priv->scan_vif, false, | ||
570 | priv->scan_request->channels[0]->band); | ||
571 | if (err) { | ||
572 | IWL_DEBUG_SCAN(priv, | ||
573 | "failed to initiate pending scan: %d\n", err); | ||
574 | aborted = true; | ||
575 | goto out_complete; | ||
576 | } | ||
577 | |||
578 | goto out; | ||
579 | } | ||
580 | |||
581 | out_complete: | ||
582 | iwl_legacy_complete_scan(priv, aborted); | 510 | iwl_legacy_complete_scan(priv, aborted); |
583 | 511 | ||
584 | out_settings: | 512 | out_settings: |
@@ -590,8 +518,7 @@ out_settings: | |||
590 | * We do not commit power settings while scan is pending, | 518 | * We do not commit power settings while scan is pending, |
591 | * do it now if the settings changed. | 519 | * do it now if the settings changed. |
592 | */ | 520 | */ |
593 | iwl_legacy_power_set_mode(priv, &priv->power_data.sleep_cmd_next, | 521 | iwl_legacy_power_set_mode(priv, &priv->power_data.sleep_cmd_next, false); |
594 | false); | ||
595 | iwl_legacy_set_tx_power(priv, priv->tx_power_next, false); | 522 | iwl_legacy_set_tx_power(priv, priv->tx_power_next, false); |
596 | 523 | ||
597 | priv->cfg->ops->utils->post_scan(priv); | 524 | priv->cfg->ops->utils->post_scan(priv); |
@@ -604,15 +531,12 @@ void iwl_legacy_setup_scan_deferred_work(struct iwl_priv *priv) | |||
604 | { | 531 | { |
605 | INIT_WORK(&priv->scan_completed, iwl_legacy_bg_scan_completed); | 532 | INIT_WORK(&priv->scan_completed, iwl_legacy_bg_scan_completed); |
606 | INIT_WORK(&priv->abort_scan, iwl_legacy_bg_abort_scan); | 533 | INIT_WORK(&priv->abort_scan, iwl_legacy_bg_abort_scan); |
607 | INIT_WORK(&priv->start_internal_scan, | ||
608 | iwl_legacy_bg_start_internal_scan); | ||
609 | INIT_DELAYED_WORK(&priv->scan_check, iwl_legacy_bg_scan_check); | 534 | INIT_DELAYED_WORK(&priv->scan_check, iwl_legacy_bg_scan_check); |
610 | } | 535 | } |
611 | EXPORT_SYMBOL(iwl_legacy_setup_scan_deferred_work); | 536 | EXPORT_SYMBOL(iwl_legacy_setup_scan_deferred_work); |
612 | 537 | ||
613 | void iwl_legacy_cancel_scan_deferred_work(struct iwl_priv *priv) | 538 | void iwl_legacy_cancel_scan_deferred_work(struct iwl_priv *priv) |
614 | { | 539 | { |
615 | cancel_work_sync(&priv->start_internal_scan); | ||
616 | cancel_work_sync(&priv->abort_scan); | 540 | cancel_work_sync(&priv->abort_scan); |
617 | cancel_work_sync(&priv->scan_completed); | 541 | cancel_work_sync(&priv->scan_completed); |
618 | 542 | ||
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", |
diff --git a/drivers/net/wireless/iwlegacy/iwl4965-base.c b/drivers/net/wireless/iwlegacy/iwl4965-base.c index 7157ba529680..ed86b221d067 100644 --- a/drivers/net/wireless/iwlegacy/iwl4965-base.c +++ b/drivers/net/wireless/iwlegacy/iwl4965-base.c | |||
@@ -3135,10 +3135,7 @@ static int iwl4965_init_drv(struct iwl_priv *priv) | |||
3135 | priv->_4965.agg_tids_count = 0; | 3135 | priv->_4965.agg_tids_count = 0; |
3136 | 3136 | ||
3137 | /* initialize force reset */ | 3137 | /* initialize force reset */ |
3138 | priv->force_reset[IWL_RF_RESET].reset_duration = | 3138 | priv->force_reset.reset_duration = IWL_DELAY_NEXT_FORCE_FW_RELOAD; |
3139 | IWL_DELAY_NEXT_FORCE_RF_RESET; | ||
3140 | priv->force_reset[IWL_FW_RESET].reset_duration = | ||
3141 | IWL_DELAY_NEXT_FORCE_FW_RELOAD; | ||
3142 | 3139 | ||
3143 | /* Choose which receivers/antennas to use */ | 3140 | /* Choose which receivers/antennas to use */ |
3144 | if (priv->cfg->ops->hcmd->set_rxon_chain) | 3141 | if (priv->cfg->ops->hcmd->set_rxon_chain) |