aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
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
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')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/fw-api-scan.h22
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/scan.c41
2 files changed, 45 insertions, 18 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-scan.h b/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-scan.h
index d92712d4345a..f01dab0d0dac 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-scan.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-scan.h
@@ -285,6 +285,8 @@ struct iwl_scan_channel_opt {
285 * @IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED: all passive scans will be fragmented 285 * @IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED: all passive scans will be fragmented
286 * @IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED: insert WFA vendor-specific TPC report 286 * @IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED: insert WFA vendor-specific TPC report
287 * and DS parameter set IEs into probe requests. 287 * and DS parameter set IEs into probe requests.
288 * @IWL_MVM_LMAC_SCAN_FLAG_EXTENDED_DWELL: use extended dwell time on channels
289 * 1, 6 and 11.
288 * @IWL_MVM_LMAC_SCAN_FLAG_MATCH: Send match found notification on matches 290 * @IWL_MVM_LMAC_SCAN_FLAG_MATCH: Send match found notification on matches
289 */ 291 */
290enum iwl_mvm_lmac_scan_flags { 292enum iwl_mvm_lmac_scan_flags {
@@ -295,6 +297,7 @@ enum iwl_mvm_lmac_scan_flags {
295 IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS = BIT(4), 297 IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS = BIT(4),
296 IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED = BIT(5), 298 IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED = BIT(5),
297 IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED = BIT(6), 299 IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED = BIT(6),
300 IWL_MVM_LMAC_SCAN_FLAG_EXTENDED_DWELL = BIT(7),
298 IWL_MVM_LMAC_SCAN_FLAG_MATCH = BIT(9), 301 IWL_MVM_LMAC_SCAN_FLAG_MATCH = BIT(9),
299}; 302};
300 303
@@ -322,6 +325,7 @@ enum iwl_scan_priority_ext {
322 * @active-dwell: dwell time for active channels 325 * @active-dwell: dwell time for active channels
323 * @passive-dwell: dwell time for passive channels 326 * @passive-dwell: dwell time for passive channels
324 * @fragmented-dwell: dwell time for fragmented passive scan 327 * @fragmented-dwell: dwell time for fragmented passive scan
328 * @extended_dwell: dwell time for channels 1, 6 and 11 (in certain cases)
325 * @reserved2: for alignment and future use 329 * @reserved2: for alignment and future use
326 * @rx_chain_selct: PHY_RX_CHAIN_* flags 330 * @rx_chain_selct: PHY_RX_CHAIN_* flags
327 * @scan_flags: &enum iwl_mvm_lmac_scan_flags 331 * @scan_flags: &enum iwl_mvm_lmac_scan_flags
@@ -346,7 +350,8 @@ struct iwl_scan_req_lmac {
346 u8 active_dwell; 350 u8 active_dwell;
347 u8 passive_dwell; 351 u8 passive_dwell;
348 u8 fragmented_dwell; 352 u8 fragmented_dwell;
349 __le16 reserved2; 353 u8 extended_dwell;
354 u8 reserved2;
350 __le16 rx_chain_select; 355 __le16 rx_chain_select;
351 __le32 scan_flags; 356 __le32 scan_flags;
352 __le32 max_out_time; 357 __le32 max_out_time;
@@ -490,7 +495,7 @@ enum iwl_channel_flags {
490 * @dwell_active: default dwell time for active scan 495 * @dwell_active: default dwell time for active scan
491 * @dwell_passive: default dwell time for passive scan 496 * @dwell_passive: default dwell time for passive scan
492 * @dwell_fragmented: default dwell time for fragmented scan 497 * @dwell_fragmented: default dwell time for fragmented scan
493 * @reserved: for future use and alignment 498 * @dwell_extended: default dwell time for channels 1, 6 and 11
494 * @mac_addr: default mac address to be used in probes 499 * @mac_addr: default mac address to be used in probes
495 * @bcast_sta_id: the index of the station in the fw 500 * @bcast_sta_id: the index of the station in the fw
496 * @channel_flags: default channel flags - enum iwl_channel_flags 501 * @channel_flags: default channel flags - enum iwl_channel_flags
@@ -507,7 +512,7 @@ struct iwl_scan_config {
507 u8 dwell_active; 512 u8 dwell_active;
508 u8 dwell_passive; 513 u8 dwell_passive;
509 u8 dwell_fragmented; 514 u8 dwell_fragmented;
510 u8 reserved; 515 u8 dwell_extended;
511 u8 mac_addr[ETH_ALEN]; 516 u8 mac_addr[ETH_ALEN];
512 u8 bcast_sta_id; 517 u8 bcast_sta_id;
513 u8 channel_flags; 518 u8 channel_flags;
@@ -543,7 +548,8 @@ enum iwl_umac_scan_general_flags {
543 IWL_UMAC_SCAN_GEN_FLAGS_MULTIPLE_SSID = BIT(6), 548 IWL_UMAC_SCAN_GEN_FLAGS_MULTIPLE_SSID = BIT(6),
544 IWL_UMAC_SCAN_GEN_FLAGS_FRAGMENTED = BIT(7), 549 IWL_UMAC_SCAN_GEN_FLAGS_FRAGMENTED = BIT(7),
545 IWL_UMAC_SCAN_GEN_FLAGS_RRM_ENABLED = BIT(8), 550 IWL_UMAC_SCAN_GEN_FLAGS_RRM_ENABLED = BIT(8),
546 IWL_UMAC_SCAN_GEN_FLAGS_MATCH = BIT(9) 551 IWL_UMAC_SCAN_GEN_FLAGS_MATCH = BIT(9),
552 IWL_UMAC_SCAN_GEN_FLAGS_EXTENDED_DWELL = BIT(10),
547}; 553};
548 554
549/** 555/**
@@ -597,7 +603,7 @@ struct iwl_scan_req_umac_tail {
597 * @uid: scan id, &enum iwl_umac_scan_uid_offsets 603 * @uid: scan id, &enum iwl_umac_scan_uid_offsets
598 * @ooc_priority: out of channel priority - &enum iwl_scan_priority 604 * @ooc_priority: out of channel priority - &enum iwl_scan_priority
599 * @general_flags: &enum iwl_umac_scan_general_flags 605 * @general_flags: &enum iwl_umac_scan_general_flags
600 * @reserved1: for future use and alignment 606 * @extended_dwell: dwell time for channels 1, 6 and 11
601 * @active_dwell: dwell time for active scan 607 * @active_dwell: dwell time for active scan
602 * @passive_dwell: dwell time for passive scan 608 * @passive_dwell: dwell time for passive scan
603 * @fragmented_dwell: dwell time for fragmented passive scan 609 * @fragmented_dwell: dwell time for fragmented passive scan
@@ -606,7 +612,7 @@ struct iwl_scan_req_umac_tail {
606 * @scan_priority: scan internal prioritization &enum iwl_scan_priority 612 * @scan_priority: scan internal prioritization &enum iwl_scan_priority
607 * @channel_flags: &enum iwl_scan_channel_flags 613 * @channel_flags: &enum iwl_scan_channel_flags
608 * @n_channels: num of channels in scan request 614 * @n_channels: num of channels in scan request
609 * @reserved2: for future use and alignment 615 * @reserved: for future use and alignment
610 * @data: &struct iwl_scan_channel_cfg_umac and 616 * @data: &struct iwl_scan_channel_cfg_umac and
611 * &struct iwl_scan_req_umac_tail 617 * &struct iwl_scan_req_umac_tail
612 */ 618 */
@@ -616,7 +622,7 @@ struct iwl_scan_req_umac {
616 __le32 ooc_priority; 622 __le32 ooc_priority;
617 /* SCAN_GENERAL_PARAMS_API_S_VER_1 */ 623 /* SCAN_GENERAL_PARAMS_API_S_VER_1 */
618 __le32 general_flags; 624 __le32 general_flags;
619 u8 reserved1; 625 u8 extended_dwell;
620 u8 active_dwell; 626 u8 active_dwell;
621 u8 passive_dwell; 627 u8 passive_dwell;
622 u8 fragmented_dwell; 628 u8 fragmented_dwell;
@@ -626,7 +632,7 @@ struct iwl_scan_req_umac {
626 /* SCAN_CHANNEL_PARAMS_API_S_VER_1 */ 632 /* SCAN_CHANNEL_PARAMS_API_S_VER_1 */
627 u8 channel_flags; 633 u8 channel_flags;
628 u8 n_channels; 634 u8 n_channels;
629 __le16 reserved2; 635 __le16 reserved;
630 u8 data[]; 636 u8 data[];
631} __packed; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_1 */ 637} __packed; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_1 */
632 638
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);