aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-scan.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-10-14 20:31:54 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-10-14 20:31:54 -0400
commit6dc6472581f693b5fc95aebedf67b4960fb85cf0 (patch)
tree06a5a9a08519950575505273eabced331ed51405 /drivers/net/wireless/iwlwifi/iwl-scan.c
parentee673eaa72d8d185012b1027a05e25aba18c267f (diff)
parent8acd3a60bcca17c6d89c73cee3ad6057eb83ba1e (diff)
Merge commit 'origin'
Manual fixup of conflicts on: arch/powerpc/include/asm/dcr-regs.h drivers/net/ibm_newemac/core.h
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-scan.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c41
1 files changed, 27 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index 6c8ac3a87d54..3b0bee331a33 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -88,7 +88,7 @@ static int iwl_is_empty_essid(const char *essid, int essid_len)
88 88
89 89
90 90
91const char *iwl_escape_essid(const char *essid, u8 essid_len) 91static const char *iwl_escape_essid(const char *essid, u8 essid_len)
92{ 92{
93 static char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; 93 static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
94 const char *s = essid; 94 const char *s = essid;
@@ -111,7 +111,6 @@ const char *iwl_escape_essid(const char *essid, u8 essid_len)
111 *d = '\0'; 111 *d = '\0';
112 return escaped; 112 return escaped;
113} 113}
114EXPORT_SYMBOL(iwl_escape_essid);
115 114
116/** 115/**
117 * iwl_scan_cancel - Cancel any currently executing HW scan 116 * iwl_scan_cancel - Cancel any currently executing HW scan
@@ -464,11 +463,6 @@ void iwl_init_scan_params(struct iwl_priv *priv)
464 463
465int iwl_scan_initiate(struct iwl_priv *priv) 464int iwl_scan_initiate(struct iwl_priv *priv)
466{ 465{
467 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
468 IWL_ERROR("APs don't scan.\n");
469 return 0;
470 }
471
472 if (!iwl_is_ready_rf(priv)) { 466 if (!iwl_is_ready_rf(priv)) {
473 IWL_DEBUG_SCAN("Aborting scan due to not ready.\n"); 467 IWL_DEBUG_SCAN("Aborting scan due to not ready.\n");
474 return -EIO; 468 return -EIO;
@@ -480,8 +474,7 @@ int iwl_scan_initiate(struct iwl_priv *priv)
480 } 474 }
481 475
482 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) { 476 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
483 IWL_DEBUG_SCAN("Scan request while abort pending. " 477 IWL_DEBUG_SCAN("Scan request while abort pending\n");
484 "Queuing.\n");
485 return -EAGAIN; 478 return -EAGAIN;
486 } 479 }
487 480
@@ -710,7 +703,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
710 u16 cmd_len; 703 u16 cmd_len;
711 enum ieee80211_band band; 704 enum ieee80211_band band;
712 u8 n_probes = 2; 705 u8 n_probes = 2;
713 u8 rx_chain = 0x7; /* bitmap: ABC chains */ 706 u8 rx_chain = priv->hw_params.valid_rx_ant;
714 707
715 conf = ieee80211_get_hw_conf(priv->hw); 708 conf = ieee80211_get_hw_conf(priv->hw);
716 709
@@ -850,7 +843,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
850 843
851 /* Force use of chains B and C (0x6) for scan Rx for 4965 844 /* Force use of chains B and C (0x6) for scan Rx for 4965
852 * Avoid A (0x1) because of its off-channel reception on A-band. 845 * Avoid A (0x1) because of its off-channel reception on A-band.
853 * MIMO is not used here, but value is required */ 846 */
854 if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965) 847 if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965)
855 rx_chain = 0x6; 848 rx_chain = 0x6;
856 } else { 849 } else {
@@ -858,6 +851,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
858 goto done; 851 goto done;
859 } 852 }
860 853
854 /* MIMO is not used here, but value is required */
861 scan->rx_chain = RXON_RX_CHAIN_DRIVER_FORCE_MSK | 855 scan->rx_chain = RXON_RX_CHAIN_DRIVER_FORCE_MSK |
862 cpu_to_le16((0x7 << RXON_RX_CHAIN_VALID_POS) | 856 cpu_to_le16((0x7 << RXON_RX_CHAIN_VALID_POS) |
863 (rx_chain << RXON_RX_CHAIN_FORCE_SEL_POS) | 857 (rx_chain << RXON_RX_CHAIN_FORCE_SEL_POS) |
@@ -869,7 +863,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
869 863
870 scan->tx_cmd.len = cpu_to_le16(cmd_len); 864 scan->tx_cmd.len = cpu_to_le16(cmd_len);
871 865
872 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) 866 if (priv->iw_mode == NL80211_IFTYPE_MONITOR)
873 scan->filter_flags = RXON_FILTER_PROMISC_MSK; 867 scan->filter_flags = RXON_FILTER_PROMISC_MSK;
874 868
875 scan->filter_flags |= (RXON_FILTER_ACCEPT_GRP_MSK | 869 scan->filter_flags |= (RXON_FILTER_ACCEPT_GRP_MSK |
@@ -922,10 +916,29 @@ static void iwl_bg_abort_scan(struct work_struct *work)
922 mutex_unlock(&priv->mutex); 916 mutex_unlock(&priv->mutex);
923} 917}
924 918
919static void iwl_bg_scan_completed(struct work_struct *work)
920{
921 struct iwl_priv *priv =
922 container_of(work, struct iwl_priv, scan_completed);
923
924 IWL_DEBUG_SCAN("SCAN complete scan\n");
925
926 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
927 return;
928
929 ieee80211_scan_completed(priv->hw);
930
931 /* Since setting the TXPOWER may have been deferred while
932 * performing the scan, fire one off */
933 mutex_lock(&priv->mutex);
934 iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
935 mutex_unlock(&priv->mutex);
936}
937
938
925void iwl_setup_scan_deferred_work(struct iwl_priv *priv) 939void iwl_setup_scan_deferred_work(struct iwl_priv *priv)
926{ 940{
927 /* FIXME: move here when resolved PENDING 941 INIT_WORK(&priv->scan_completed, iwl_bg_scan_completed);
928 * INIT_WORK(&priv->scan_completed, iwl_bg_scan_completed); */
929 INIT_WORK(&priv->request_scan, iwl_bg_request_scan); 942 INIT_WORK(&priv->request_scan, iwl_bg_request_scan);
930 INIT_WORK(&priv->abort_scan, iwl_bg_abort_scan); 943 INIT_WORK(&priv->abort_scan, iwl_bg_abort_scan);
931 INIT_DELAYED_WORK(&priv->scan_check, iwl_bg_scan_check); 944 INIT_DELAYED_WORK(&priv->scan_check, iwl_bg_scan_check);