aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
diff options
context:
space:
mode:
authorDavid Spinadel <david.spinadel@intel.com>2015-11-22 09:37:36 -0500
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2015-12-20 16:27:40 -0500
commitc3e230b167a9d618c4eb41c0a5ba1851d33d6dbd (patch)
treea358316ee50dd9b2ded64850d9f1a6e294dc8d5c /drivers/net/wireless/intel/iwlwifi/mvm/scan.c
parentc81240707c71f343d96dae3537997682a9eb436d (diff)
iwlwifi: mvm: add extended dwell time
When doing active scan on crowded channels we are likely to miss probe responses due to collisions. To overcome this issue we use an extended dwell time on channels 1, 6 and 11; this dwell time is set to 100. In case of fragmented scan extended dwell time is the maximum out of channel time - 44 msec. Fragmented active scan will be addressed later. Extended dwell time isn't used in sched scan or p2p find. Signed-off-by: David Spinadel <david.spinadel@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/scan.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/scan.c41
1 files changed, 31 insertions, 10 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
index 87cc993f044a..bee3201c7116 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
@@ -82,6 +82,7 @@ struct iwl_mvm_scan_timing_params {
82 u32 dwell_active; 82 u32 dwell_active;
83 u32 dwell_passive; 83 u32 dwell_passive;
84 u32 dwell_fragmented; 84 u32 dwell_fragmented;
85 u32 dwell_extended;
85 u32 suspend_time; 86 u32 suspend_time;
86 u32 max_out_time; 87 u32 max_out_time;
87}; 88};
@@ -91,6 +92,7 @@ static struct iwl_mvm_scan_timing_params scan_timing[] = {
91 .dwell_active = 10, 92 .dwell_active = 10,
92 .dwell_passive = 110, 93 .dwell_passive = 110,
93 .dwell_fragmented = 44, 94 .dwell_fragmented = 44,
95 .dwell_extended = 100,
94 .suspend_time = 0, 96 .suspend_time = 0,
95 .max_out_time = 0, 97 .max_out_time = 0,
96 }, 98 },
@@ -98,6 +100,7 @@ static struct iwl_mvm_scan_timing_params scan_timing[] = {
98 .dwell_active = 10, 100 .dwell_active = 10,
99 .dwell_passive = 110, 101 .dwell_passive = 110,
100 .dwell_fragmented = 44, 102 .dwell_fragmented = 44,
103 .dwell_extended = 100,
101 .suspend_time = 30, 104 .suspend_time = 30,
102 .max_out_time = 120, 105 .max_out_time = 120,
103 }, 106 },
@@ -105,6 +108,7 @@ static struct iwl_mvm_scan_timing_params scan_timing[] = {
105 .dwell_active = 10, 108 .dwell_active = 10,
106 .dwell_passive = 110, 109 .dwell_passive = 110,
107 .dwell_fragmented = 44, 110 .dwell_fragmented = 44,
111 .dwell_extended = 100,
108 .suspend_time = 120, 112 .suspend_time = 120,
109 .max_out_time = 120, 113 .max_out_time = 120,
110 }, 114 },
@@ -112,6 +116,7 @@ static struct iwl_mvm_scan_timing_params scan_timing[] = {
112 .dwell_active = 10, 116 .dwell_active = 10,
113 .dwell_passive = 110, 117 .dwell_passive = 110,
114 .dwell_fragmented = 44, 118 .dwell_fragmented = 44,
119 .dwell_extended = 44,
115 .suspend_time = 95, 120 .suspend_time = 95,
116 .max_out_time = 44, 121 .max_out_time = 44,
117 }, 122 },
@@ -716,6 +721,7 @@ static void iwl_mvm_scan_lmac_dwell(struct iwl_mvm *mvm,
716 cmd->active_dwell = scan_timing[params->type].dwell_active; 721 cmd->active_dwell = scan_timing[params->type].dwell_active;
717 cmd->passive_dwell = scan_timing[params->type].dwell_passive; 722 cmd->passive_dwell = scan_timing[params->type].dwell_passive;
718 cmd->fragmented_dwell = scan_timing[params->type].dwell_fragmented; 723 cmd->fragmented_dwell = scan_timing[params->type].dwell_fragmented;
724 cmd->extended_dwell = scan_timing[params->type].dwell_extended;
719 cmd->max_out_time = cpu_to_le32(scan_timing[params->type].max_out_time); 725 cmd->max_out_time = cpu_to_le32(scan_timing[params->type].max_out_time);
720 cmd->suspend_time = cpu_to_le32(scan_timing[params->type].suspend_time); 726 cmd->suspend_time = cpu_to_le32(scan_timing[params->type].suspend_time);
721 cmd->scan_prio = iwl_mvm_scan_priority(mvm, IWL_SCAN_PRIORITY_EXT_6); 727 cmd->scan_prio = iwl_mvm_scan_priority(mvm, IWL_SCAN_PRIORITY_EXT_6);
@@ -749,8 +755,15 @@ static inline bool iwl_mvm_scan_use_ebs(struct iwl_mvm *mvm,
749 vif->type != NL80211_IFTYPE_P2P_DEVICE); 755 vif->type != NL80211_IFTYPE_P2P_DEVICE);
750} 756}
751 757
758static inline bool iwl_mvm_is_regular_scan(struct iwl_mvm_scan_params *params)
759{
760 return params->n_scan_plans == 1 &&
761 params->scan_plans[0].iterations == 1;
762}
763
752static int iwl_mvm_scan_lmac_flags(struct iwl_mvm *mvm, 764static int iwl_mvm_scan_lmac_flags(struct iwl_mvm *mvm,
753 struct iwl_mvm_scan_params *params) 765 struct iwl_mvm_scan_params *params,
766 struct ieee80211_vif *vif)
754{ 767{
755 int flags = 0; 768 int flags = 0;
756 769
@@ -776,6 +789,10 @@ static int iwl_mvm_scan_lmac_flags(struct iwl_mvm *mvm,
776 flags |= IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE; 789 flags |= IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE;
777#endif 790#endif
778 791
792 if (iwl_mvm_is_regular_scan(params) &&
793 vif->type != NL80211_IFTYPE_P2P_DEVICE)
794 flags |= IWL_MVM_LMAC_SCAN_FLAG_EXTENDED_DWELL;
795
779 return flags; 796 return flags;
780} 797}
781 798
@@ -804,7 +821,8 @@ static int iwl_mvm_scan_lmac(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
804 821
805 cmd->delay = cpu_to_le32(params->delay); 822 cmd->delay = cpu_to_le32(params->delay);
806 823
807 cmd->scan_flags = cpu_to_le32(iwl_mvm_scan_lmac_flags(mvm, params)); 824 cmd->scan_flags = cpu_to_le32(iwl_mvm_scan_lmac_flags(mvm, params,
825 vif));
808 826
809 cmd->flags = iwl_mvm_scan_rxon_flags(params->channels[0]->band); 827 cmd->flags = iwl_mvm_scan_rxon_flags(params->channels[0]->band);
810 cmd->filter_flags = cpu_to_le32(MAC_FILTER_ACCEPT_GRP | 828 cmd->filter_flags = cpu_to_le32(MAC_FILTER_ACCEPT_GRP |
@@ -942,6 +960,7 @@ int iwl_mvm_config_scan(struct iwl_mvm *mvm)
942 scan_config->dwell_active = scan_timing[type].dwell_active; 960 scan_config->dwell_active = scan_timing[type].dwell_active;
943 scan_config->dwell_passive = scan_timing[type].dwell_passive; 961 scan_config->dwell_passive = scan_timing[type].dwell_passive;
944 scan_config->dwell_fragmented = scan_timing[type].dwell_fragmented; 962 scan_config->dwell_fragmented = scan_timing[type].dwell_fragmented;
963 scan_config->dwell_extended = scan_timing[type].dwell_extended;
945 964
946 memcpy(&scan_config->mac_addr, &mvm->addresses[0].addr, ETH_ALEN); 965 memcpy(&scan_config->mac_addr, &mvm->addresses[0].addr, ETH_ALEN);
947 966
@@ -983,16 +1002,11 @@ static int iwl_mvm_scan_uid_by_status(struct iwl_mvm *mvm, int status)
983 return -ENOENT; 1002 return -ENOENT;
984} 1003}
985 1004
986static inline bool iwl_mvm_is_regular_scan(struct iwl_mvm_scan_params *params)
987{
988 return params->n_scan_plans == 1 &&
989 params->scan_plans[0].iterations == 1;
990}
991
992static void iwl_mvm_scan_umac_dwell(struct iwl_mvm *mvm, 1005static void iwl_mvm_scan_umac_dwell(struct iwl_mvm *mvm,
993 struct iwl_scan_req_umac *cmd, 1006 struct iwl_scan_req_umac *cmd,
994 struct iwl_mvm_scan_params *params) 1007 struct iwl_mvm_scan_params *params)
995{ 1008{
1009 cmd->extended_dwell = scan_timing[params->type].dwell_extended;
996 cmd->active_dwell = scan_timing[params->type].dwell_active; 1010 cmd->active_dwell = scan_timing[params->type].dwell_active;
997 cmd->passive_dwell = scan_timing[params->type].dwell_passive; 1011 cmd->passive_dwell = scan_timing[params->type].dwell_passive;
998 cmd->fragmented_dwell = scan_timing[params->type].dwell_fragmented; 1012 cmd->fragmented_dwell = scan_timing[params->type].dwell_fragmented;
@@ -1027,7 +1041,8 @@ iwl_mvm_umac_scan_cfg_channels(struct iwl_mvm *mvm,
1027} 1041}
1028 1042
1029static u32 iwl_mvm_scan_umac_flags(struct iwl_mvm *mvm, 1043static u32 iwl_mvm_scan_umac_flags(struct iwl_mvm *mvm,
1030 struct iwl_mvm_scan_params *params) 1044 struct iwl_mvm_scan_params *params,
1045 struct ieee80211_vif *vif)
1031{ 1046{
1032 int flags = 0; 1047 int flags = 0;
1033 1048
@@ -1055,6 +1070,11 @@ static u32 iwl_mvm_scan_umac_flags(struct iwl_mvm *mvm,
1055 if (mvm->scan_iter_notif_enabled) 1070 if (mvm->scan_iter_notif_enabled)
1056 flags |= IWL_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE; 1071 flags |= IWL_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE;
1057#endif 1072#endif
1073
1074 if (iwl_mvm_is_regular_scan(params) &&
1075 vif->type != NL80211_IFTYPE_P2P_DEVICE)
1076 flags |= IWL_UMAC_SCAN_GEN_FLAGS_EXTENDED_DWELL;
1077
1058 return flags; 1078 return flags;
1059} 1079}
1060 1080
@@ -1085,7 +1105,8 @@ static int iwl_mvm_scan_umac(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
1085 mvm->scan_uid_status[uid] = type; 1105 mvm->scan_uid_status[uid] = type;
1086 1106
1087 cmd->uid = cpu_to_le32(uid); 1107 cmd->uid = cpu_to_le32(uid);
1088 cmd->general_flags = cpu_to_le32(iwl_mvm_scan_umac_flags(mvm, params)); 1108 cmd->general_flags = cpu_to_le32(iwl_mvm_scan_umac_flags(mvm, params,
1109 vif));
1089 1110
1090 if (type == IWL_MVM_SCAN_SCHED) 1111 if (type == IWL_MVM_SCAN_SCHED)
1091 cmd->flags = cpu_to_le32(IWL_UMAC_SCAN_FLAG_PREEMPTIVE); 1112 cmd->flags = cpu_to_le32(IWL_UMAC_SCAN_FLAG_PREEMPTIVE);