diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-11-10 09:55:15 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-11 12:32:54 -0500 |
commit | ba4c531984d480dff554e2ccb442958052482773 (patch) | |
tree | fae5584a341413da2e23238a42ee16e93ded869d /drivers/net | |
parent | 0b7a4c788fd08ffd147b266b7d0992f6f13ccdae (diff) |
iwlwifi: move hw_scan into _mac80211 file
iwlagn_mac_hw_scan should belong to _mac80211 callback.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-mac80211.c | 46 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-scan.c | 45 |
3 files changed, 46 insertions, 48 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index ee3692adbad2..fa47f75185df 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -312,9 +312,6 @@ void iwl_init_scan_params(struct iwl_priv *priv); | |||
312 | int iwl_scan_cancel(struct iwl_priv *priv); | 312 | int iwl_scan_cancel(struct iwl_priv *priv); |
313 | void iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms); | 313 | void iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms); |
314 | void iwl_force_scan_end(struct iwl_priv *priv); | 314 | void iwl_force_scan_end(struct iwl_priv *priv); |
315 | int iwlagn_mac_hw_scan(struct ieee80211_hw *hw, | ||
316 | struct ieee80211_vif *vif, | ||
317 | struct cfg80211_scan_request *req); | ||
318 | void iwl_internal_short_hw_scan(struct iwl_priv *priv); | 315 | void iwl_internal_short_hw_scan(struct iwl_priv *priv); |
319 | int iwl_force_reset(struct iwl_priv *priv, int mode, bool external); | 316 | int iwl_force_reset(struct iwl_priv *priv, int mode, bool external); |
320 | u16 iwl_fill_probe_req(struct iwl_priv *priv, struct ieee80211_mgmt *frame, | 317 | u16 iwl_fill_probe_req(struct iwl_priv *priv, struct ieee80211_mgmt *frame, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c index 1b2dbb006adc..6df08bb63fff 100644 --- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c +++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c | |||
@@ -1801,6 +1801,52 @@ static int iwlagn_mac_change_interface(struct ieee80211_hw *hw, | |||
1801 | return err; | 1801 | return err; |
1802 | } | 1802 | } |
1803 | 1803 | ||
1804 | static int iwlagn_mac_hw_scan(struct ieee80211_hw *hw, | ||
1805 | struct ieee80211_vif *vif, | ||
1806 | struct cfg80211_scan_request *req) | ||
1807 | { | ||
1808 | struct iwl_priv *priv = hw->priv; | ||
1809 | int ret; | ||
1810 | |||
1811 | IWL_DEBUG_MAC80211(priv, "enter\n"); | ||
1812 | |||
1813 | if (req->n_channels == 0) | ||
1814 | return -EINVAL; | ||
1815 | |||
1816 | mutex_lock(&priv->shrd->mutex); | ||
1817 | |||
1818 | /* | ||
1819 | * If an internal scan is in progress, just set | ||
1820 | * up the scan_request as per above. | ||
1821 | */ | ||
1822 | if (priv->scan_type != IWL_SCAN_NORMAL) { | ||
1823 | IWL_DEBUG_SCAN(priv, | ||
1824 | "SCAN request during internal scan - defer\n"); | ||
1825 | priv->scan_request = req; | ||
1826 | priv->scan_vif = vif; | ||
1827 | ret = 0; | ||
1828 | } else { | ||
1829 | priv->scan_request = req; | ||
1830 | priv->scan_vif = vif; | ||
1831 | /* | ||
1832 | * mac80211 will only ask for one band at a time | ||
1833 | * so using channels[0] here is ok | ||
1834 | */ | ||
1835 | ret = iwl_scan_initiate(priv, vif, IWL_SCAN_NORMAL, | ||
1836 | req->channels[0]->band); | ||
1837 | if (ret) { | ||
1838 | priv->scan_request = NULL; | ||
1839 | priv->scan_vif = NULL; | ||
1840 | } | ||
1841 | } | ||
1842 | |||
1843 | IWL_DEBUG_MAC80211(priv, "leave\n"); | ||
1844 | |||
1845 | mutex_unlock(&priv->shrd->mutex); | ||
1846 | |||
1847 | return ret; | ||
1848 | } | ||
1849 | |||
1804 | struct ieee80211_ops iwlagn_hw_ops = { | 1850 | struct ieee80211_ops iwlagn_hw_ops = { |
1805 | .tx = iwlagn_mac_tx, | 1851 | .tx = iwlagn_mac_tx, |
1806 | .start = iwlagn_mac_start, | 1852 | .start = iwlagn_mac_start, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index a26fbd33a5d9..625beec4aa22 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -939,51 +939,6 @@ int __must_check iwl_scan_initiate(struct iwl_priv *priv, | |||
939 | return 0; | 939 | return 0; |
940 | } | 940 | } |
941 | 941 | ||
942 | int iwlagn_mac_hw_scan(struct ieee80211_hw *hw, | ||
943 | struct ieee80211_vif *vif, | ||
944 | struct cfg80211_scan_request *req) | ||
945 | { | ||
946 | struct iwl_priv *priv = hw->priv; | ||
947 | int ret; | ||
948 | |||
949 | IWL_DEBUG_MAC80211(priv, "enter\n"); | ||
950 | |||
951 | if (req->n_channels == 0) | ||
952 | return -EINVAL; | ||
953 | |||
954 | mutex_lock(&priv->shrd->mutex); | ||
955 | |||
956 | /* | ||
957 | * If an internal scan is in progress, just set | ||
958 | * up the scan_request as per above. | ||
959 | */ | ||
960 | if (priv->scan_type != IWL_SCAN_NORMAL) { | ||
961 | IWL_DEBUG_SCAN(priv, | ||
962 | "SCAN request during internal scan - defer\n"); | ||
963 | priv->scan_request = req; | ||
964 | priv->scan_vif = vif; | ||
965 | ret = 0; | ||
966 | } else { | ||
967 | priv->scan_request = req; | ||
968 | priv->scan_vif = vif; | ||
969 | /* | ||
970 | * mac80211 will only ask for one band at a time | ||
971 | * so using channels[0] here is ok | ||
972 | */ | ||
973 | ret = iwl_scan_initiate(priv, vif, IWL_SCAN_NORMAL, | ||
974 | req->channels[0]->band); | ||
975 | if (ret) { | ||
976 | priv->scan_request = NULL; | ||
977 | priv->scan_vif = NULL; | ||
978 | } | ||
979 | } | ||
980 | |||
981 | IWL_DEBUG_MAC80211(priv, "leave\n"); | ||
982 | |||
983 | mutex_unlock(&priv->shrd->mutex); | ||
984 | |||
985 | return ret; | ||
986 | } | ||
987 | 942 | ||
988 | /* | 943 | /* |
989 | * internal short scan, this function should only been called while associated. | 944 | * internal short scan, this function should only been called while associated. |