diff options
author | David Spinadel <david.spinadel@intel.com> | 2013-08-28 02:29:43 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-10-02 12:00:39 -0400 |
commit | 35a000b7c1bbd81631097539567f24a272a2fa0f (patch) | |
tree | 7194fb17baac16320fd90f150f8d3838022d2a64 /drivers/net/wireless/iwlwifi/mvm/mac80211.c | |
parent | 20f1a5deb67f00cef89d63fb957a940c7f976cf3 (diff) |
iwlwifi: mvm: support sched scan if supported by the fw
Add support for scheduled scan according to firmware support.
Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/mac80211.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mac80211.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index 0340299b4b63..8c619151c467 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
@@ -239,6 +239,15 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) | |||
239 | else | 239 | else |
240 | hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; | 240 | hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; |
241 | 241 | ||
242 | if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_SCHED_SCAN) { | ||
243 | hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; | ||
244 | hw->wiphy->max_sched_scan_ssids = PROBE_OPTION_MAX; | ||
245 | hw->wiphy->max_match_sets = IWL_SCAN_MAX_PROFILES; | ||
246 | /* we create the 802.11 header and zero length SSID IE. */ | ||
247 | hw->wiphy->max_sched_scan_ie_len = | ||
248 | SCAN_OFFLOAD_PROBE_REQ_SIZE - 24 - 2; | ||
249 | } | ||
250 | |||
242 | hw->wiphy->features |= NL80211_FEATURE_P2P_GO_CTWIN | | 251 | hw->wiphy->features |= NL80211_FEATURE_P2P_GO_CTWIN | |
243 | NL80211_FEATURE_P2P_GO_OPPPS; | 252 | NL80211_FEATURE_P2P_GO_OPPPS; |
244 | 253 | ||
@@ -1202,6 +1211,53 @@ static void iwl_mvm_mac_mgd_prepare_tx(struct ieee80211_hw *hw, | |||
1202 | mutex_unlock(&mvm->mutex); | 1211 | mutex_unlock(&mvm->mutex); |
1203 | } | 1212 | } |
1204 | 1213 | ||
1214 | static int iwl_mvm_mac_sched_scan_start(struct ieee80211_hw *hw, | ||
1215 | struct ieee80211_vif *vif, | ||
1216 | struct cfg80211_sched_scan_request *req, | ||
1217 | struct ieee80211_sched_scan_ies *ies) | ||
1218 | { | ||
1219 | struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); | ||
1220 | int ret; | ||
1221 | |||
1222 | mutex_lock(&mvm->mutex); | ||
1223 | |||
1224 | if (mvm->scan_status != IWL_MVM_SCAN_NONE) { | ||
1225 | IWL_DEBUG_SCAN(mvm, | ||
1226 | "SCHED SCAN request during internal scan - abort\n"); | ||
1227 | ret = -EBUSY; | ||
1228 | goto out; | ||
1229 | } | ||
1230 | |||
1231 | mvm->scan_status = IWL_MVM_SCAN_SCHED; | ||
1232 | |||
1233 | ret = iwl_mvm_config_sched_scan(mvm, vif, req, ies); | ||
1234 | if (ret) | ||
1235 | goto err; | ||
1236 | |||
1237 | ret = iwl_mvm_config_sched_scan_profiles(mvm, req); | ||
1238 | if (ret) | ||
1239 | goto err; | ||
1240 | |||
1241 | ret = iwl_mvm_sched_scan_start(mvm, req); | ||
1242 | if (!ret) | ||
1243 | goto out; | ||
1244 | err: | ||
1245 | mvm->scan_status = IWL_MVM_SCAN_NONE; | ||
1246 | out: | ||
1247 | mutex_unlock(&mvm->mutex); | ||
1248 | return ret; | ||
1249 | } | ||
1250 | |||
1251 | static void iwl_mvm_mac_sched_scan_stop(struct ieee80211_hw *hw, | ||
1252 | struct ieee80211_vif *vif) | ||
1253 | { | ||
1254 | struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); | ||
1255 | |||
1256 | mutex_lock(&mvm->mutex); | ||
1257 | iwl_mvm_sched_scan_stop(mvm); | ||
1258 | mutex_unlock(&mvm->mutex); | ||
1259 | } | ||
1260 | |||
1205 | static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw, | 1261 | static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw, |
1206 | enum set_key_cmd cmd, | 1262 | enum set_key_cmd cmd, |
1207 | struct ieee80211_vif *vif, | 1263 | struct ieee80211_vif *vif, |
@@ -1671,6 +1727,8 @@ struct ieee80211_ops iwl_mvm_hw_ops = { | |||
1671 | .set_rts_threshold = iwl_mvm_mac_set_rts_threshold, | 1727 | .set_rts_threshold = iwl_mvm_mac_set_rts_threshold, |
1672 | .conf_tx = iwl_mvm_mac_conf_tx, | 1728 | .conf_tx = iwl_mvm_mac_conf_tx, |
1673 | .mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx, | 1729 | .mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx, |
1730 | .sched_scan_start = iwl_mvm_mac_sched_scan_start, | ||
1731 | .sched_scan_stop = iwl_mvm_mac_sched_scan_stop, | ||
1674 | .set_key = iwl_mvm_mac_set_key, | 1732 | .set_key = iwl_mvm_mac_set_key, |
1675 | .update_tkip_key = iwl_mvm_mac_update_tkip_key, | 1733 | .update_tkip_key = iwl_mvm_mac_update_tkip_key, |
1676 | .remain_on_channel = iwl_mvm_roc, | 1734 | .remain_on_channel = iwl_mvm_roc, |