From 262bcac43c0751f08be7942fea22faf1534174e8 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Myadam Date: Mon, 19 Jul 2021 16:48:13 +0530 Subject: [PATCH 01/26] qcacld-3.0: Update pcl connecton table for p2p+p2p concurrency Update pcl table for P2P + P2P concurrency for SCC,MCC and DBS scenarios. Change-Id: Ibd76db75c68a568fd60f1fece23e4e7146718628 CRs-Fixed: 2991321 --- .../src/wlan_policy_mgr_tables_2x2_dbs_i.h | 63 ++++++++----------- 1 file changed, 25 insertions(+), 38 deletions(-) diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_dbs_i.h b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_dbs_i.h index 4d1d964696e6..b5fc5f169436 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_dbs_i.h +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_dbs_i.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -570,8 +571,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_P2P_GO_SCC_24_2x2] = { [PM_STA_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_NAN_DISC_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, @@ -590,8 +590,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_P2P_GO_MCC_24_2x2] = { [PM_STA_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, - [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_NAN_DISC_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, @@ -616,8 +615,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_SAP_MODE] = { PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, PM_24G_SCC_CH_SBS_CH}, - [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_NAN_DISC_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, @@ -640,8 +638,7 @@ pm_third_connection_pcl_dbs_2x2_table = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, - [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_NAN_DISC_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, @@ -690,8 +687,8 @@ pm_third_connection_pcl_dbs_2x2_table = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, - [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, [PM_P2P_GO_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, @@ -1166,10 +1163,8 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, - [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_NAN_DISC_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -1190,10 +1185,8 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, - [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_NAN_DISC_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -1214,10 +1207,8 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, - [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_NAN_DISC_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -1238,10 +1229,8 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, - [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_NAN_DISC_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -1288,10 +1277,10 @@ pm_third_connection_pcl_dbs_2x2_table = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, - [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_GO_MODE] = {PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, [PM_NAN_DISC_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -1322,8 +1311,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_SCC_24_2x2] = { - [PM_STA_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { @@ -1349,7 +1337,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_P2P_GO_P2P_CLI_MCC_24_2x2] = { [PM_STA_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_5G, PM_5G, PM_5G}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { @@ -1374,8 +1362,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_SCC_5_2x2] = { - [PM_STA_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_STA_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { @@ -1401,7 +1388,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_P2P_GO_P2P_CLI_MCC_5_2x2] = { [PM_STA_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_24G, PM_24G, PM_24G}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { @@ -1452,8 +1439,8 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_DBS_2x2] = { - [PM_STA_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_STA_MODE] = {PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { From 372fe9ce5cc8e09c17699a988a75e7f08d1a57b9 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Myadam Date: Tue, 14 Sep 2021 23:46:10 +0530 Subject: [PATCH 02/26] qcacld-3.0: change mode to p2p device for p2p interface Currently, mode of p2p virtual interface with type managed is added as sta mode. This may cause issue during p2p find as in function p2p_vdev_check_valid probe response frames are dropped for sta mode. Fix is to convert mode to P2P DEVICE mode from STA mode in case added interface string contains p2p substring. Change-Id: I9bf9d8c44af940b42c38cd7819bcdb9c00a90a26 CRs-Fixed: 3036500 --- core/hdd/src/wlan_hdd_p2p.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 16cc1e458c3d..d947d31a71d0 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -803,7 +803,10 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy, name_assign_type, true); } else { uint8_t *device_address; - + if (strnstr(name, "p2p", 3) && mode == QDF_STA_MODE) { + hdd_debug("change mode to p2p device"); + mode = QDF_P2P_DEVICE_MODE; + } device_address = wlan_hdd_get_intf_addr(hdd_ctx, mode); if (!device_address) return ERR_PTR(-EINVAL); From 48d7479b6d5aa412f2167500443d4c16df035c14 Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Wed, 8 Feb 2023 22:58:18 -0800 Subject: [PATCH 03/26] Release 2.0.8.32M Release 2.0.8.32M Change-Id: I6abf1657cdcf371afe0c58042a9c06e8e4138e81 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index f98127f70dcc..1eb2eb413317 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "L" +#define QWLAN_VERSION_EXTRA "M" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "2.0.8.32L" +#define QWLAN_VERSIONSTR "2.0.8.32M" #endif /* QWLAN_VERSION_H */ From 9dacab89f9eda31c0e77851b02cdcdbd3953c65a Mon Sep 17 00:00:00 2001 From: Vijay Raj Date: Mon, 30 Jan 2023 01:40:00 -0800 Subject: [PATCH 04/26] qcacld-3.0: remove WLAN_ENABLE_AGEIE_ON_SCAN_RESULTS macro Remove WLAN_ENABLE_AGEIE_ON_SCAN_RESULTS macro as BSS age is calculated using NL80211_BSS_SEEN_MS_AGO Change-Id: I5473f9cea216df4968a43551875b0385605f616f CRs-Fixed: 3391078 --- Kbuild | 1 - configs/default_defconfig | 2 -- 2 files changed, 3 deletions(-) diff --git a/Kbuild b/Kbuild index 8ea27fbefa71..e7afd83959a4 100644 --- a/Kbuild +++ b/Kbuild @@ -2615,7 +2615,6 @@ cppflags-$(CONFIG_THERMAL_STATS_SUPPORT) += -DTHERMAL_STATS_SUPPORT cppflags-$(CONFIG_PTT_SOCK_SVC_ENABLE) += -DPTT_SOCK_SVC_ENABLE cppflags-$(CONFIG_FEATURE_WLAN_WAPI) += -DFEATURE_WLAN_WAPI cppflags-$(CONFIG_FEATURE_WLAN_WAPI) += -DATH_SUPPORT_WAPI -cppflags-$(CONFIG_AGEIE_ON_SCAN_RESULTS) += -DWLAN_ENABLE_AGEIE_ON_SCAN_RESULTS cppflags-$(CONFIG_SOFTAP_CHANNEL_RANGE) += -DSOFTAP_CHANNEL_RANGE cppflags-$(CONFIG_FEATURE_WLAN_SCAN_PNO) += -DFEATURE_WLAN_SCAN_PNO cppflags-$(CONFIG_WLAN_FEATURE_PACKET_FILTERING) += -DWLAN_FEATURE_PACKET_FILTERING diff --git a/configs/default_defconfig b/configs/default_defconfig index 024743284a2d..9df097858d21 100644 --- a/configs/default_defconfig +++ b/configs/default_defconfig @@ -973,8 +973,6 @@ CONFIG_FEATURE_INTEROP_ISSUES_AP := y CONFIG_FEATURE_WLAN_WAPI := y -CONFIG_AGEIE_ON_SCAN_RESULTS := y - #Flag to enable FW log parsing support feature CONFIG_FEATURE_FW_LOG_PARSING := y From 330501b50c63683512640e562736ea86fcb9e1ed Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Thu, 9 Feb 2023 01:20:07 -0800 Subject: [PATCH 05/26] Release 2.0.8.32N Release 2.0.8.32N Change-Id: Ide2989f9e07aef4c8ba7c292f99b30422200b809 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 1eb2eb413317..463ac54cb7b2 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "M" +#define QWLAN_VERSION_EXTRA "N" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "2.0.8.32M" +#define QWLAN_VERSIONSTR "2.0.8.32N" #endif /* QWLAN_VERSION_H */ From 164ce24671344a3a7d53907e7f4d28e595c3f654 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Myadam Date: Wed, 4 Aug 2021 15:06:24 +0530 Subject: [PATCH 06/26] qcacld-3.0: Limit ROC for listen to max 600 if GO present Add fixed 300ms extra ROC time instead of multiplying the ROC duration by 6 as this causes the ROC to be upto 1.5 secs if GO is present. Firmware will advertize NOA of 1.5 secs and if supplicant cancels ROC after 200 or 300ms then firmware cannot cancel NOA. So when supplicant sends next ROC it will be delayed as firmware already is running previous NOA which may cause p2p find issues if GO is present. Fix this by capping the max ROC time to 600ms when GO is present. Change-Id: I0774b06ff4db1fae7efc387388fdf3059505150e CRs-Fixed: 3025870 --- components/p2p/core/src/wlan_p2p_roc.c | 25 +++++++++++++++++++++---- components/p2p/core/src/wlan_p2p_roc.h | 4 +++- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/components/p2p/core/src/wlan_p2p_roc.c b/components/p2p/core/src/wlan_p2p_roc.c index 7fa8a6c5b6ff..7146367eae62 100644 --- a/components/p2p/core/src/wlan_p2p_roc.c +++ b/components/p2p/core/src/wlan_p2p_roc.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -136,11 +137,30 @@ static QDF_STATUS p2p_scan_start(struct p2p_roc_context *roc_ctx) is_dbs = policy_mgr_is_hw_dbs_capable(p2p_soc_obj->soc); if (go_num) - req->scan_req.dwell_time_passive *= + /* Add fixed 300ms extra ROC time instead of multiplying the + * ROC duration by const value as this causes the ROC to be + * upto 1.5 secs if GO is present. Firmware will advertize NOA + * of 1.5 secs and if supplicant cancels ROC after 200 or 300ms + * then firmware cannot cancel NOA. So when supplicant sends + * next ROC it will be delayed as firmware already is running + * previous NOA. This causes p2p find issues if GO is present. + * So add fixed duration of 300ms and also cap max ROC to 600ms + * when GO is present + */ + req->scan_req.dwell_time_passive += P2P_ROC_DURATION_MULTI_GO_PRESENT; else req->scan_req.dwell_time_passive *= P2P_ROC_DURATION_MULTI_GO_ABSENT; + if (go_num && req->scan_req.dwell_time_passive > + P2P_MAX_ROC_DURATION_GO_PRESENT) { + req->scan_req.dwell_time_passive = + P2P_MAX_ROC_DURATION_GO_PRESENT; + } else if (req->scan_req.dwell_time_passive > + P2P_MAX_ROC_DURATION) { + req->scan_req.dwell_time_passive = P2P_MAX_ROC_DURATION; + } + /* this is to protect too huge value if some customers * give a higher value from supplicant */ @@ -162,9 +182,6 @@ static QDF_STATUS p2p_scan_start(struct p2p_roc_context *roc_ctx) P2P_MAX_ROC_DURATION_NON_DBS_NAN_PRESENT) req->scan_req.dwell_time_passive = P2P_MAX_ROC_DURATION_NON_DBS_NAN_PRESENT; - } else if (req->scan_req.dwell_time_passive > - P2P_MAX_ROC_DURATION) { - req->scan_req.dwell_time_passive = P2P_MAX_ROC_DURATION; } } p2p_debug("FW requested roc duration is:%d", diff --git a/components/p2p/core/src/wlan_p2p_roc.h b/components/p2p/core/src/wlan_p2p_roc.h index cfcb586d89c3..143e01726a8f 100644 --- a/components/p2p/core/src/wlan_p2p_roc.h +++ b/components/p2p/core/src/wlan_p2p_roc.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -35,8 +36,9 @@ #define P2P_MAX_ROC_DURATION_NON_DBS_NDP_PRESENT 250 #define P2P_MAX_ROC_DURATION_DBS_NAN_PRESENT 450 #define P2P_MAX_ROC_DURATION_NON_DBS_NAN_PRESENT 300 +#define P2P_MAX_ROC_DURATION_GO_PRESENT 600 -#define P2P_ROC_DURATION_MULTI_GO_PRESENT 6 +#define P2P_ROC_DURATION_MULTI_GO_PRESENT 300 #define P2P_ROC_DURATION_MULTI_GO_ABSENT 10 #define P2P_ACTION_FRAME_DEFAULT_WAIT 200 #define P2P_ROC_DEFAULT_DURATION 200 From 23f539a6496a38f0d0e0de141d2f6d1a98efaec4 Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Thu, 9 Feb 2023 03:35:51 -0800 Subject: [PATCH 07/26] Release 2.0.8.32O Release 2.0.8.32O Change-Id: I3d0b9f514d82529c2597c4f89eb44f29939f6ed0 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 463ac54cb7b2..6e0522160b5a 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "N" +#define QWLAN_VERSION_EXTRA "O" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "2.0.8.32N" +#define QWLAN_VERSIONSTR "2.0.8.32O" #endif /* QWLAN_VERSION_H */ From f3e7ed975140ef0715677c24876e0d326ab4d6c9 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Myadam Date: Tue, 31 Aug 2021 15:11:00 +0530 Subject: [PATCH 08/26] qcacld-3.0: Don't allow GO/GC+GO/GC+STA on the same band Add support to allow/disallow three port combinations on same band based on PCL table Change-Id: Id2e9ad7d17bab6ea0aff6913b25f0eb330dc6c13 CRs-Fixed: 3028527 --- .../policy_mgr/inc/wlan_policy_mgr_api.h | 14 ++++ .../policy_mgr/src/wlan_policy_mgr_core.c | 72 ++++++++--------- .../policy_mgr/src/wlan_policy_mgr_pcl.c | 81 ++++++++++++++++++- 3 files changed, 126 insertions(+), 41 deletions(-) diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h index 11add67ba3d7..16d850df19d2 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h +++ b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h @@ -3752,4 +3752,18 @@ QDF_STATUS policy_mgr_check_mon_concurrency(struct wlan_objmgr_psoc *psoc); bool policy_mgr_is_sta_chan_valid_for_connect_and_roam( struct wlan_objmgr_pdev *pdev, qdf_freq_t freq); +/** + * policy_mgr_is_3rd_conn_on_same_band_allowed() - Check the third connection + * on same band allowed or not + * list for third connection + * @psoc: PSOC object information + * @mode: Device mode + * + * This function checks whether to allow third connection on same band or not + * based on pcl table + * + * Return: TRUE/FALSE + */ +bool policy_mgr_is_3rd_conn_on_same_band_allowed(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c index 332732690b14..f5a91a2ec465 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -2770,35 +2770,37 @@ bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc, } /** - * policy_mgr_is_multi_ap_plus_sta_3vif_conc() - Check multiple AP plus STA - * concurrency - * @mode1: policy_mgr_con_mode of connection 1 - * @mode2: policy_mgr_con_mode of connection 2 - * @mode2: policy_mgr_con_mode of connection 3 + * policy_mgr_is_3rd_conn_on_same_band() - Check whether 3rd connection is on + * same band or not + * @ch_freq: channel frequency * - * Check the 3vif concurrency is SAP(GO)+SAP(GO)+STA or not based on - * connection mode. + * Check the existing two connection are in same band or not. If it is in + * same band then check the 3rd connection is also in same band or not * * Return: True/False */ -static bool policy_mgr_is_multi_ap_plus_sta_3vif_conc( - enum policy_mgr_con_mode mode1, enum policy_mgr_con_mode mode2, - enum policy_mgr_con_mode mode3) +static bool policy_mgr_is_3rd_conn_on_same_band(uint32_t ch_freq) { - if (mode1 == PM_STA_MODE && - (mode2 == PM_SAP_MODE || mode2 == PM_P2P_GO_MODE) && - (mode3 == PM_SAP_MODE || mode3 == PM_P2P_GO_MODE)) - return true; - if (mode2 == PM_STA_MODE && - (mode1 == PM_SAP_MODE || mode1 == PM_P2P_GO_MODE) && - (mode3 == PM_SAP_MODE || mode3 == PM_P2P_GO_MODE)) - return true; - if (mode3 == PM_STA_MODE && - (mode1 == PM_SAP_MODE || mode1 == PM_P2P_GO_MODE) && - (mode2 == PM_SAP_MODE || mode2 == PM_P2P_GO_MODE)) - return true; + bool ret = false; - return false; + if (((WLAN_REG_IS_24GHZ_CH_FREQ(ch_freq)) && + (WLAN_REG_IS_24GHZ_CH_FREQ + (pm_conc_connection_list[0].freq)) && + (WLAN_REG_IS_24GHZ_CH_FREQ + (pm_conc_connection_list[1].freq))) || + (((WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq)) || + (WLAN_REG_IS_6GHZ_CHAN_FREQ(ch_freq))) && + ((WLAN_REG_IS_5GHZ_CH_FREQ + (pm_conc_connection_list[0].freq)) || + (WLAN_REG_IS_6GHZ_CHAN_FREQ + (pm_conc_connection_list[0].freq))) && + ((WLAN_REG_IS_5GHZ_CH_FREQ + (pm_conc_connection_list[1].freq)) || + (WLAN_REG_IS_6GHZ_CHAN_FREQ + (pm_conc_connection_list[1].freq))))) { + ret = true; + } + return ret; } /** @@ -2874,16 +2876,8 @@ bool policy_mgr_allow_new_home_channel( policy_mgr_rl_debug("don't allow 3rd home channel on same MAC"); status = false; } - } else if (((WLAN_REG_IS_24GHZ_CH_FREQ(ch_freq)) && - (WLAN_REG_IS_24GHZ_CH_FREQ - (pm_conc_connection_list[0].freq)) && - (WLAN_REG_IS_24GHZ_CH_FREQ - (pm_conc_connection_list[1].freq))) || - ((WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq)) && - (WLAN_REG_IS_5GHZ_CH_FREQ - (pm_conc_connection_list[0].freq)) && - (WLAN_REG_IS_5GHZ_CH_FREQ - (pm_conc_connection_list[1].freq)))) { + } else if (policy_mgr_is_3rd_conn_on_same_band( + ch_freq)) { policy_mgr_rl_debug("don't allow 3rd home channel on same MAC"); status = false; } @@ -2909,12 +2903,10 @@ bool policy_mgr_allow_new_home_channel( * and therefore a 3rd connection with the * same MAC is possible. */ - } else if (wlan_reg_is_same_band_freqs(ch_freq, - pm_conc_connection_list[0].freq) && - policy_mgr_is_multi_ap_plus_sta_3vif_conc( - pm_conc_connection_list[0].mode, - pm_conc_connection_list[1].mode, - mode)) { + } else if (policy_mgr_is_3rd_conn_on_same_band( + ch_freq) && + !(policy_mgr_is_3rd_conn_on_same_band_allowed( + psoc, mode))) { policy_mgr_rl_debug("don't allow 3rd home channel on same MAC - sta existing"); status = false; } diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c index 9c940ef8d8f1..af6e19b92fe5 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -2787,3 +2787,82 @@ bool policy_mgr_is_sta_chan_valid_for_connect_and_roam( return true; } + +bool policy_mgr_is_3rd_conn_on_same_band_allowed(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode) +{ + enum policy_mgr_pcl_type pcl = PM_NONE; + enum policy_mgr_conc_priority_mode conc_system_pref = 0; + enum policy_mgr_two_connection_mode third_index = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + bool ret = false; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("context is NULL"); + return false; + } + + policy_mgr_debug("pref:%d requested mode:%d", + pm_ctx->cur_conc_system_pref, mode); + + switch (pm_ctx->cur_conc_system_pref) { + case 0: + conc_system_pref = PM_THROUGHPUT; + break; + case 1: + conc_system_pref = PM_POWERSAVE; + break; + case 2: + conc_system_pref = PM_LATENCY; + break; + default: + policy_mgr_err("unknown cur_conc_system_pref value %d", + pm_ctx->cur_conc_system_pref); + break; + } + + third_index = policy_mgr_get_third_connection_pcl_table_index(psoc); + if (PM_MAX_TWO_CONNECTION_MODE == third_index) { + policy_mgr_err( + "couldn't find index for 3rd connection pcl table"); + return false; + } + if (policy_mgr_is_hw_dbs_capable(psoc) == true) { + pcl = (*third_connection_pcl_dbs_table) + [third_index][mode][conc_system_pref]; + } else { + pcl = (*third_connection_pcl_non_dbs_table) + [third_index][mode][conc_system_pref]; + } + + policy_mgr_debug("pcl for third connection is %d", pcl); + switch (pcl) { + case PM_SCC_CH: + case PM_SCC_CH_24G: + case PM_SCC_CH_5G: + case PM_24G_SCC_CH: + case PM_5G_SCC_CH: + case PM_SCC_ON_5_SCC_ON_24_24G: + case PM_SCC_ON_5_SCC_ON_24_5G: + case PM_SCC_ON_24_SCC_ON_5_24G: + case PM_SCC_ON_24_SCC_ON_5_5G: + case PM_SCC_ON_5_SCC_ON_24: + case PM_SCC_ON_24_SCC_ON_5: + case PM_24G_SCC_CH_SBS_CH: + case PM_24G_SCC_CH_SBS_CH_5G: + case PM_MCC_CH: + case PM_MCC_CH_24G: + case PM_MCC_CH_5G: + case PM_24G_MCC_CH: + case PM_5G_MCC_CH: + case PM_24G_SBS_CH_MCC_CH: + ret = true; + break; + default: + policy_mgr_debug("Not in SCC case"); + ret = false; + break; + } + return ret; +} From bec024af28abe17eda2a5c0c63483af8406b9bb4 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Myadam Date: Thu, 9 Sep 2021 21:42:09 +0530 Subject: [PATCH 09/26] qcacld-3.0: Argument mismatch in sta_ap work queue From the caller, the args comes as pm_ctx but in definition it's assigned as work_info which causes crash. Change-Id: I9928a2c3862407b02cb34356ad54895e1d3069c7 CRs-Fixed: 3035090 --- .../policy_mgr/src/wlan_policy_mgr_action.c | 37 ++++++------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c index d0db9e64a6fa..56e40f05c6f7 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1974,53 +1975,39 @@ end: pm_ctx->do_sap_unsafe_ch_check = false; } -static void __policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) +static void __policy_mgr_check_sta_ap_concurrent_ch_intf( + struct policy_mgr_psoc_priv_obj *pm_ctx) { - struct wlan_objmgr_psoc *psoc; - struct policy_mgr_psoc_priv_obj *pm_ctx = NULL; - struct sta_ap_intf_check_work_ctx *work_info = NULL; uint32_t mcc_to_scc_switch, cc_count = 0, i; QDF_STATUS status; uint32_t ch_freq; uint32_t op_ch_freq_list[MAX_NUMBER_OF_CONC_CONNECTIONS]; uint8_t vdev_id[MAX_NUMBER_OF_CONC_CONNECTIONS]; - work_info = data; - if (!work_info) { - policy_mgr_err("Invalid work_info"); - return; - } - - psoc = work_info->psoc; - if (!psoc) { - policy_mgr_err("Invalid psoc"); - return; - } - - pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid context"); return; } mcc_to_scc_switch = - policy_mgr_get_mcc_to_scc_switch_mode(psoc); + policy_mgr_get_mcc_to_scc_switch_mode(pm_ctx->psoc); policy_mgr_debug("Concurrent open sessions running: %d", - policy_mgr_concurrent_open_sessions_running(psoc)); + policy_mgr_concurrent_open_sessions_running( + pm_ctx->psoc)); - if (!policy_mgr_is_sap_go_existed(psoc)) + if (!policy_mgr_is_sap_go_existed(pm_ctx->psoc)) goto end; cc_count = policy_mgr_get_mode_specific_conn_info( - psoc, &op_ch_freq_list[cc_count], + pm_ctx->psoc, &op_ch_freq_list[cc_count], &vdev_id[cc_count], PM_SAP_MODE); policy_mgr_debug("Number of concurrent SAP: %d", cc_count); if (cc_count < MAX_NUMBER_OF_CONC_CONNECTIONS) cc_count = cc_count + - policy_mgr_get_mode_specific_conn_info( - psoc, &op_ch_freq_list[cc_count], - &vdev_id[cc_count], PM_P2P_GO_MODE); + policy_mgr_get_mode_specific_conn_info( + pm_ctx->psoc, &op_ch_freq_list[cc_count], + &vdev_id[cc_count], PM_P2P_GO_MODE); policy_mgr_debug("Number of beaconing entities (SAP + GO):%d", cc_count); if (!cc_count) { @@ -2046,7 +2033,7 @@ static void __policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) for (i = 0; i < cc_count; i++) { status = pm_ctx->hdd_cbacks. wlan_hdd_get_channel_for_sap_restart - (psoc, vdev_id[i], &ch_freq); + (pm_ctx->psoc, vdev_id[i], &ch_freq); if (status == QDF_STATUS_SUCCESS) { policy_mgr_debug("SAP vdev id %d restarts due to MCC->SCC switch, old ch freq :%d new ch freq: %d", vdev_id[i], From eb48431ea71030adc38338b457f9fbe48b18003d Mon Sep 17 00:00:00 2001 From: Vinod Kumar Myadam Date: Wed, 14 Jul 2021 11:29:30 +0530 Subject: [PATCH 10/26] qcacld-3.0: Check Fw capability to support p2p + p2p concurrency Check fw capability to support p2p + p2p concurrency from soc_fw_ext_caps and based on fw capability, set policy mgr concurrency for p2p + p2p. Change-Id: Ia32f81f37174e9d722911b1fae6d4897d0af9816 CRs-Fixed: 2991300 --- .../policy_mgr/inc/wlan_policy_mgr_api.h | 19 ++++++ .../src/wlan_policy_mgr_get_set_utils.c | 58 +++++++++++++------ .../mlme/dispatcher/inc/wlan_mlme_api.h | 20 ++++++- .../mlme/dispatcher/src/wlan_mlme_api.c | 11 +++- 4 files changed, 87 insertions(+), 21 deletions(-) diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h index 16d850df19d2..728d13f948cc 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h +++ b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h @@ -611,6 +611,25 @@ static inline void policy_mgr_change_sap_channel_with_csa( } #endif +#ifdef WLAN_FEATURE_P2P_P2P_STA +/** + * policy_mgr_is_p2p_p2p_conc_supported() - p2p concurrency support + * @psoc: pointer to psoc + * + * This API is used to check whether firmware supports p2p concurrency + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +bool +policy_mgr_is_p2p_p2p_conc_supported(struct wlan_objmgr_psoc *psoc); +#else +static inline bool +policy_mgr_is_p2p_p2p_conc_supported(struct wlan_objmgr_psoc *psoc) +{ + return false; +} +#endif + /** * policy_mgr_set_pcl_for_existing_combo() - SET PCL for existing combo * @psoc: PSOC object information diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c index e54d98c61b7a..c1de161d60e0 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c @@ -2616,6 +2616,13 @@ static bool policy_mgr_is_6g_channel_allowed( return true; } +#ifdef WLAN_FEATURE_P2P_P2P_STA +bool policy_mgr_is_p2p_p2p_conc_supported(struct wlan_objmgr_psoc *psoc) +{ + return wlan_mlme_get_p2p_p2p_conc_support(psoc); +} +#endif + bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, uint32_t ch_freq, @@ -2641,15 +2648,14 @@ bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc, if (num_connections && policy_mgr_is_sub_20_mhz_enabled(psoc)) { policy_mgr_rl_debug("dont allow concurrency if Sub 20 MHz is enabled"); - status = false; - goto done; + return status; } if (policy_mgr_max_concurrent_connections_reached(psoc)) { policy_mgr_rl_debug("Reached max concurrent connections: %d", pm_ctx->cfg.max_conc_cxns); policy_mgr_validate_conn_info(psoc); - goto done; + return status; } if (ch_freq) { @@ -2668,7 +2674,7 @@ bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc, if (!policy_mgr_allow_new_home_channel(psoc, mode, ch_freq, num_connections, is_dfs_ch)) - goto done; + return status; /* * 1) DFS MCC is not yet supported @@ -2685,13 +2691,13 @@ bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc, */ if (!policy_mgr_is_5g_channel_allowed(psoc, ch_freq, list, PM_P2P_GO_MODE)) - goto done; + return status; if (!policy_mgr_is_5g_channel_allowed(psoc, ch_freq, list, PM_SAP_MODE)) - goto done; + return status; if (!policy_mgr_is_6g_channel_allowed(psoc, mode, ch_freq)) - goto done; + return status; sta_sap_scc_on_dfs_chan = policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(psoc); @@ -2706,14 +2712,14 @@ bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc, } if (true == match) { policy_mgr_rl_debug("No MCC, SAP/GO about to come up on DFS channel"); - goto done; + return status; } if ((policy_mgr_is_hw_dbs_capable(psoc) != true) && num_connections) { if (WLAN_REG_IS_24GHZ_CH_FREQ(ch_freq)) { if (policy_mgr_is_sap_p2pgo_on_dfs(psoc)) { policy_mgr_rl_debug("MCC not allowed: SAP/P2PGO on DFS"); - goto done; + return status; } } } @@ -2725,21 +2731,26 @@ bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc, if (mode == PM_STA_MODE && count) { if (count >= 2) { policy_mgr_rl_debug("3rd STA isn't permitted"); - goto done; + return status; } sta_freq = pm_conc_connection_list[list[0]].freq; if (!policy_mgr_allow_multiple_sta_connections(psoc, ch_freq, sta_freq)) - goto done; + return status; } if (!policy_mgr_allow_sap_go_concurrency(psoc, mode, ch_freq, WLAN_INVALID_VDEV_ID)) { policy_mgr_rl_debug("This concurrency combination is not allowed"); - goto done; + return status; } - /* don't allow two P2P GO on same band */ - if (ch_freq && mode == PM_P2P_GO_MODE && num_connections) { + + /* + * don't allow two P2P GO on same band, if fw doesn't + * support p2p +p2p concurrency + */ + if (ch_freq && mode == PM_P2P_GO_MODE && num_connections && + !policy_mgr_is_p2p_p2p_conc_supported(psoc)) { index = 0; count = policy_mgr_mode_specific_connection_count( psoc, PM_P2P_GO_MODE, list); @@ -2750,7 +2761,7 @@ bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc, pm_conc_connection_list[list[index]].freq)) { policy_mgr_rl_debug("Don't allow P2P GO on same band"); qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); - goto done; + return status; } index++; } @@ -2759,12 +2770,11 @@ bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc, if (!policy_mgr_allow_wapi_concurrency(pm_ctx)) { policy_mgr_rl_debug("Don't allow new conn when wapi security conn existing"); - goto done; + return status; } status = true; -done: return status; } @@ -4307,8 +4317,6 @@ bool policy_mgr_allow_sap_go_concurrency(struct wlan_objmgr_psoc *psoc, if (mode != PM_SAP_MODE && mode != PM_P2P_GO_MODE) return true; - if (policy_mgr_dual_beacon_on_single_mac_mcc_capable(psoc)) - return true; dbs = policy_mgr_is_hw_dbs_capable(psoc); for (id = 0; id < MAX_NUMBER_OF_CONC_CONNECTIONS; id++) { if (!pm_conc_connection_list[id].in_use) @@ -4320,6 +4328,18 @@ bool policy_mgr_allow_sap_go_concurrency(struct wlan_objmgr_psoc *psoc, if (con_mode != PM_SAP_MODE && con_mode != PM_P2P_GO_MODE) continue; con_freq = pm_conc_connection_list[id].freq; + + if (policy_mgr_is_p2p_p2p_conc_supported(psoc) && + (mode == PM_P2P_GO_MODE) && (con_mode == PM_P2P_GO_MODE)) { + policy_mgr_debug("GO+GO scc is allowed freq = %d ", + ch_freq); + return true; + } + + if (policy_mgr_dual_beacon_on_single_mac_mcc_capable(psoc) && + (mode == PM_SAP_MODE) && (con_mode == PM_SAP_MODE)) + return true; + if (policy_mgr_dual_beacon_on_single_mac_scc_capable(psoc) && (ch_freq == con_freq)) { policy_mgr_debug("SCC enabled, 2 AP on same channel, allow 2nd AP"); diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index 020a96b617cf..1bf5978842d5 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -3242,4 +3242,22 @@ QDF_STATUS wlan_mlme_get_channel_bonding_5ghz(struct wlan_objmgr_psoc *psoc, uint32_t *value); +#ifdef WLAN_FEATURE_P2P_P2P_STA +/** + * wlan_mlme_get_p2p_p2p_conc_support() - Get p2p+p2p conc support + * + * @psoc: pointer to psoc object + * @val : value + * + * Return: Success/failure + */ +bool +wlan_mlme_get_p2p_p2p_conc_support(struct wlan_objmgr_psoc *psoc); +#else +static inline bool +wlan_mlme_get_p2p_p2p_conc_support(struct wlan_objmgr_psoc *psoc) +{ + return false; +} +#endif #endif /* _WLAN_MLME_API_H_ */ diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index ee1347cda4d7..2dc3b418de18 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -5020,3 +5020,12 @@ wlan_mlme_get_channel_bonding_5ghz(struct wlan_objmgr_psoc *psoc, *value = mlme_obj->cfg.feature_flags.channel_bonding_mode_5ghz; return QDF_STATUS_SUCCESS; } + +#ifdef WLAN_FEATURE_P2P_P2P_STA +bool +wlan_mlme_get_p2p_p2p_conc_support(struct wlan_objmgr_psoc *psoc) +{ + return wlan_psoc_nif_fw_ext_cap_get(psoc, + WLAN_SOC_EXT_P2P_P2P_CONC_SUPPORT); +} +#endif From f4a551d19ea55c9818dc5471913b768a01fabf67 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Myadam Date: Fri, 27 Aug 2021 13:32:11 +0530 Subject: [PATCH 11/26] qcacld-3.0: Enhance g_enable_go_force_scc for liberal mode INI g_enable_go_force_scc states the force MCC to SCC mode. Mode 1-strict: Implement force scc strictly as part of start bss Mode 2-liberal: Turn on p2p go on provided channel and move first p2p go to the new p2p go channel after set key. Currently for p2p-GO forceSCC, support is present where no matter what is the GO negotiated channel in start_bss, driver will force the other GO/STA/GC channel (on the same band) to the current GO channel. This is force SCC strict mode where value 1 is used for g_enable_go_force_scc ini. In this mode GC will have to do full scan as the GO channel may be different from actual negotiated channel. DUT may see some issues if GC dosent do full scan in this mode. As part of this change, add support for value 2(Liberal mode) in g_enable_go_force_scc ini. As part of this liberal mode, driver will allow the GO to start in MCC mode and after set key, it will check any other concurrent GO and will do forceSCC for that GO to the newly formed GO channel. Change-Id: Ifc7beb06335616c51dc064f48a78b825dbdbda25 CRs-Fixed: 2992098 --- .../policy_mgr/inc/wlan_policy_mgr_api.h | 100 ++++++++++++++++++ .../policy_mgr/inc/wlan_policy_mgr_cfg.h | 12 ++- .../inc/wlan_policy_mgr_public_struct.h | 19 ++++ .../policy_mgr/src/wlan_policy_mgr_action.c | 66 ++++++++++++ .../src/wlan_policy_mgr_get_set_utils.c | 57 ++++++++++ .../src/wlan_policy_mgr_init_deinit.c | 4 +- core/hdd/src/wlan_hdd_hostapd.c | 3 + core/sap/src/sap_api_link_cntl.c | 63 ++++++++++- core/sap/src/sap_fsm.c | 82 +++++++++++++- core/sap/src/sap_internal.h | 8 ++ 10 files changed, 405 insertions(+), 9 deletions(-) diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h index 728d13f948cc..429b34486e40 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h +++ b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h @@ -630,6 +630,106 @@ policy_mgr_is_p2p_p2p_conc_supported(struct wlan_objmgr_psoc *psoc) } #endif +#define GO_FORCE_SCC_DISABLE 0 +#define GO_FORCE_SCC_STRICT 1 +#define GO_FORCE_SCC_LIBERAL 2 +#ifdef WLAN_FEATURE_P2P_P2P_STA +/** + * Stay in MCC for 1 second, in case of first p2p go channel + * needs to be moved to curr go channel + */ +#define WAIT_BEFORE_GO_FORCESCC_RESTART (1000) + +/** + * policy_mgr_is_go_scc_strict() - Get GO force SCC enabled or not + * @psoc: psoc object + * + * This function checks if force SCC logic should be used on GO interface + * as a strict mode. + * + * Return: True if p2p needs o be start on provided channel only. + */ +bool policy_mgr_is_go_scc_strict(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_check_forcescc_for_other_go() - check if another p2pgo + * is present and find vdev id. + * + * @psoc: psoc object + * @vdev: vdev id + * @freq: frequency + * + * This function checks if another p2p go is there. + * + * Return: vdev_id + */ +uint8_t +policy_mgr_check_forcescc_for_other_go(struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, uint32_t curr_go_freq); + +/** + * policy_mgr_process_forcescc_for_go () - start work queue to move first p2p go + * to new p2p go's channel + * + * @psoc: PSOC object information + * @vdev_id: Vdev id + * @ch_freq: Channel frequency to change + * @ch_width: channel width to change + * + * starts delayed work queue of 1 second to move first p2p go to new + * p2p go's channel. + * + * Return: None + */ +void policy_mgr_process_forcescc_for_go( + struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, + uint32_t ch_freq, uint32_t ch_width); + +/** + * policy_mgr_do_go_plus_go_force_scc() - First p2p go + * to new p2p go's channel + * + * @psoc: PSOC object information + * @vdev_id: Vdev id + * @ch_freq: Channel frequency to change + * @ch_width: channel width to change + * + * Move first p2p go to new + * p2p go's channel. + * + * Return: None + */ +void policy_mgr_do_go_plus_go_force_scc( + struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, + uint32_t ch_freq, uint32_t ch_width); +#else +static inline +bool policy_mgr_is_go_scc_strict(struct wlan_objmgr_psoc *psoc) +{ + return false; +} + +static inline +uint8_t policy_mgr_check_forcescc_for_other_go(struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, + uint32_t curr_go_freq) +{ + return WLAN_UMAC_VDEV_ID_MAX; +} + +static inline +void policy_mgr_process_forcescc_for_go( + struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, + uint32_t ch_freq, uint32_t ch_width) +{} + +static inline +void policy_mgr_do_go_plus_go_force_scc( + struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, + uint32_t ch_freq, uint32_t ch_width) +{} +#endif + /** * policy_mgr_set_pcl_for_existing_combo() - SET PCL for existing combo * @psoc: PSOC object information diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h index cf260ed21536..ddc65f739a14 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h +++ b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -548,12 +549,19 @@ CFG_INI_UINT("g_mark_sap_indoor_as_disable", 0, 1, 0, CFG_VALUE_OR_DEFAULT, \ * * g_enable_go_force_scc - Enable/Disable force SCC on P2P GO * @Min: 0 - * @Max: 1 + * @Max: 2 * @Default: 0 * * This ini and along with "gWlanMccToSccSwitchMode" is used to enable * force SCC on P2P GO interface. * + * GO_FORCE_SCC_DISABLED (value 0): GO force scc disabled and GO can come up + * in MCC mode + * GO_FORCE_SCC_STRICT (value 1): New GO will be forced to form on existing + * GO/STA/GC channel in start bss itself. + * GO_FORCE_SCC_LIBERAL (value 2): After SET KEY is done, do force SCC for the + * first GO to move to new GO channel. + * * Supported Feature: P2P GO * * Usage: External @@ -562,7 +570,7 @@ CFG_INI_UINT("g_mark_sap_indoor_as_disable", 0, 1, 0, CFG_VALUE_OR_DEFAULT, \ */ #define CFG_P2P_GO_ENABLE_FORCE_SCC \ -CFG_INI_UINT("g_enable_go_force_scc", 0, 1, 0, CFG_VALUE_OR_DEFAULT, \ +CFG_INI_UINT("g_enable_go_force_scc", 0, 2, 0, CFG_VALUE_OR_DEFAULT, \ "Enable/Disable P2P GO force SCC") /** diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h index 9b807ad4d3d4..35b10c4fb676 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h +++ b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1284,12 +1285,30 @@ struct connection_info { uint32_t ch_freq; }; +/** + * struct go_plus_go_force_scc - structure to hold p2p go + * params for forcescc restart + * + * @vdev_id: vdev id of first p2p go which needs to do csa + * @ch_freq: ch freq of curr p2p go + * @ch_width: ch width of curr p2p go + */ +struct go_plus_go_force_scc { + uint8_t vdev_id; + uint32_t ch_freq; + uint32_t ch_width; +}; + /** * struct sta_ap_intf_check_work_ctx - sta_ap_intf_check_work * related info * @psoc: pointer to PSOC object information + * @go_plus_go_force_scc: structure to hold params of + * curr and first p2p go ctx */ struct sta_ap_intf_check_work_ctx { struct wlan_objmgr_psoc *psoc; + struct go_plus_go_force_scc go_plus_go_force_scc; }; + #endif /* __WLAN_POLICY_MGR_PUBLIC_STRUCT_H */ diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c index 56e40f05c6f7..8bddabd08af7 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c @@ -1988,6 +1988,22 @@ static void __policy_mgr_check_sta_ap_concurrent_ch_intf( policy_mgr_err("Invalid context"); return; } + /* + * Check if force scc is required for GO + GO case. vdev id will be + * valid in case of GO+GO force scc only. So, for valid vdev id move + * first GO to newly formed GO channel. + */ + policy_mgr_debug("p2p go vdev id: %d", + pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.vdev_id); + if (pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.vdev_id < + WLAN_UMAC_VDEV_ID_MAX) { + policy_mgr_do_go_plus_go_force_scc( + pm_ctx->psoc, pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.vdev_id, + pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.ch_freq, + pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.ch_width); + pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.vdev_id = WLAN_UMAC_VDEV_ID_MAX; + return; + } mcc_to_scc_switch = policy_mgr_get_mcc_to_scc_switch_mode(pm_ctx->psoc); @@ -2498,6 +2514,56 @@ void policy_mgr_change_sap_channel_with_csa(struct wlan_objmgr_psoc *psoc, } #endif +#ifdef WLAN_FEATURE_P2P_P2P_STA +void policy_mgr_do_go_plus_go_force_scc(struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, uint32_t ch_freq, + uint32_t ch_width) +{ + uint8_t total_connection; + + total_connection = policy_mgr_mode_specific_connection_count( + psoc, PM_P2P_GO_MODE, NULL); + + policy_mgr_debug("Total p2p go connection %d", total_connection); + + /* If any p2p disconnected, don't do csa */ + if (total_connection > 1) { + policy_mgr_change_sap_channel_with_csa(psoc, vdev_id, + ch_freq, ch_width, true); + } +} + +void policy_mgr_process_forcescc_for_go(struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, uint32_t ch_freq, + uint32_t ch_width) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + if (!pm_ctx->sta_ap_intf_check_work_info) { + policy_mgr_err("invalid work info"); + return; + } + pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.vdev_id = + vdev_id; + pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.ch_freq = + ch_freq; + pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.ch_width = + ch_width; + + if (!qdf_delayed_work_start(&pm_ctx->sta_ap_intf_check_work, + WAIT_BEFORE_GO_FORCESCC_RESTART)) { + policy_mgr_err("change interface request failure"); + pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.vdev_id = + WLAN_UMAC_VDEV_ID_MAX; + } +} +#endif + QDF_STATUS policy_mgr_wait_for_connection_update(struct wlan_objmgr_psoc *psoc) { QDF_STATUS status; diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c index c1de161d60e0..5661c5a03491 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c @@ -4628,6 +4628,63 @@ bool policy_mgr_go_scc_enforced(struct wlan_objmgr_psoc *psoc) return false; } +#ifdef WLAN_FEATURE_P2P_P2P_STA +uint8_t +policy_mgr_check_forcescc_for_other_go(struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, uint32_t freq) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + uint32_t conn_index; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return WLAN_UMAC_VDEV_ID_MAX; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + if (pm_conc_connection_list[conn_index].mode == + PM_P2P_GO_MODE && + pm_conc_connection_list[conn_index].in_use && + wlan_reg_is_same_band_freqs( + freq, + pm_conc_connection_list[conn_index].freq) && + freq != pm_conc_connection_list[conn_index].freq && + vdev_id != pm_conc_connection_list[conn_index].vdev_id) { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + policy_mgr_debug( + "Existing p2p go vdev_id is %d", + pm_conc_connection_list[conn_index].vdev_id); + return pm_conc_connection_list[conn_index].vdev_id; + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + return WLAN_UMAC_VDEV_ID_MAX; +} + +bool policy_mgr_is_go_scc_strict(struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + bool ret = false; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + ret = false; + goto return_val; + } + if (pm_ctx->cfg.go_force_scc & GO_FORCE_SCC_STRICT) { + ret = true; + goto return_val; + } + ret = false; +return_val: + policy_mgr_debug("ret val is %d", ret); + return ret; +} +#endif + QDF_STATUS policy_mgr_update_nan_vdev_mac_info(struct wlan_objmgr_psoc *psoc, uint8_t nan_vdev_id, uint8_t mac_id) diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c index 3a5c07f982fe..eda6605cf014 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -339,6 +339,8 @@ QDF_STATUS policy_mgr_psoc_open(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_E_FAILURE; } pm_ctx->sta_ap_intf_check_work_info->psoc = psoc; + pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.vdev_id = + WLAN_UMAC_VDEV_ID_MAX; if (QDF_IS_STATUS_ERROR(qdf_delayed_work_create( &pm_ctx->sta_ap_intf_check_work, policy_mgr_check_sta_ap_concurrent_ch_intf, diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index f5edc1c9c586..dde93a5872cb 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -6361,6 +6361,9 @@ wlan_hdd_ap_ap_force_scc_override(struct hdd_adapter *adapter, return false; } + if (adapter->device_mode == QDF_P2P_GO_MODE && + policy_mgr_is_p2p_p2p_conc_supported(hdd_ctx->psoc)) + return false; if (!policy_mgr_concurrent_beaconing_sessions_running(hdd_ctx->psoc)) return false; if (policy_mgr_dual_beacon_on_single_mac_mcc_capable(hdd_ctx->psoc)) diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c index 8bf3e659ad17..2e3860804dc9 100644 --- a/core/sap/src/sap_api_link_cntl.c +++ b/core/sap/src/sap_api_link_cntl.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -829,6 +830,51 @@ static void wlansap_update_vendor_acs_chan(struct mac_context *mac_ctx, } } +#ifdef WLAN_FEATURE_P2P_P2P_STA +/** + * sap_check_and_process_forcescc_for_other_go() - find if other p2p go is there + * and needs to be moved to current p2p go's channel. + * + * @cur_sap_ctx: current sap context + * + * Return: None + */ +static void +sap_check_and_process_forcescc_for_other_go(struct sap_context *cur_sap_ctx) +{ + struct sap_context *sap_ctx; + struct mac_context *mac_ctx; + uint8_t i; + + mac_ctx = sap_get_mac_context(); + if (!mac_ctx) { + sap_err("Invalid MAC context"); + return; + } + + for (i = 0; i < SAP_MAX_NUM_SESSION; i++) { + sap_ctx = mac_ctx->sap.sapCtxList[i].sap_context; + if (sap_ctx && + QDF_P2P_GO_MODE == mac_ctx->sap.sapCtxList[i].sapPersona && + sap_ctx->is_forcescc_restart_required) { + sap_debug("sessionId %d chan_freq %d chan_width %d", + sap_ctx->sessionId, cur_sap_ctx->chan_freq, + cur_sap_ctx->ch_params.ch_width); + policy_mgr_process_forcescc_for_go( + mac_ctx->psoc, sap_ctx->sessionId, + cur_sap_ctx->chan_freq, + cur_sap_ctx->ch_params.ch_width); + sap_ctx->is_forcescc_restart_required = false; + break; + } + } +} +#else +static void +sap_check_and_process_forcescc_for_other_go(struct sap_context *cur_sap_ctx) +{} +#endif + QDF_STATUS wlansap_roam_callback(void *ctx, struct csr_roam_info *csr_roam_info, uint32_t roam_id, @@ -1157,10 +1203,25 @@ QDF_STATUS wlansap_roam_callback(void *ctx, * disassoc event * Fill in the event structure */ - if (roam_status == eCSR_ROAM_SET_KEY_COMPLETE) + if (roam_status == eCSR_ROAM_SET_KEY_COMPLETE) { sap_signal_hdd_event(sap_ctx, csr_roam_info, eSAP_STA_SET_KEY_EVENT, (void *) eSAP_STATUS_SUCCESS); + + /* + * After set key if this is the first peer connecting to new GO + * then check for peer count (which is self peer + peer count) + * and take decision for GO+GO force SCC + */ + if (sap_ctx->vdev->vdev_mlme.vdev_opmode == + QDF_P2P_GO_MODE && + wlan_vdev_get_peer_count(sap_ctx->vdev) == 2 && + policy_mgr_mode_specific_connection_count( + mac_ctx->psoc, PM_P2P_GO_MODE, + NULL) > 1) + sap_check_and_process_forcescc_for_other_go( + sap_ctx); + } break; case eCSR_ROAM_RESULT_MAX_ASSOC_EXCEEDED: /* Fill in the event structure */ diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 681e70398140..81ab4af7735a 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -784,6 +784,41 @@ static bool is_mcc_preferred(struct sap_context *sap_context, return false; } +#ifdef WLAN_FEATURE_P2P_P2P_STA +/** + * sap_set_forcescc_required - set force scc flag for provided p2p go vdev + * + * vdev_id - vdev_id for which flag needs to be set + * + * Return: None + */ +static void sap_set_forcescc_required(uint8_t vdev_id) +{ + struct mac_context *mac_ctx; + struct sap_context *sap_ctx; + uint8_t i = 0; + + mac_ctx = sap_get_mac_context(); + if (!mac_ctx) { + sap_err("Invalid MAC context"); + return; + } + + for (i = 0; i < SAP_MAX_NUM_SESSION; i++) { + sap_ctx = mac_ctx->sap.sapCtxList[i].sap_context; + if (QDF_P2P_GO_MODE == mac_ctx->sap.sapCtxList[i].sapPersona && + sap_ctx->sessionId == vdev_id) { + sap_debug("update forcescc restart for vdev %d", + vdev_id); + sap_ctx->is_forcescc_restart_required = true; + } + } +} +#else +static void sap_set_forcescc_required(uint8_t vdev_id) +{} +#endif + QDF_STATUS sap_validate_chan(struct sap_context *sap_context, bool pre_start_bss, @@ -799,6 +834,8 @@ sap_validate_chan(struct sap_context *sap_context, uint32_t concurrent_state; bool go_force_scc; struct ch_params ch_params = {0}; + bool is_go_scc_strict = false; + uint8_t first_p2p_go_vdev_id = WLAN_UMAC_VDEV_ID_MAX; mac_handle = cds_get_context(QDF_MODULE_ID_SME); mac_ctx = MAC_CONTEXT(mac_handle); @@ -812,10 +849,45 @@ sap_validate_chan(struct sap_context *sap_context, sap_err("Invalid channel"); return QDF_STATUS_E_FAILURE; } - go_force_scc = policy_mgr_go_scc_enforced(mac_ctx->psoc); - if (sap_context->vdev && !go_force_scc && - (wlan_vdev_mlme_get_opmode(sap_context->vdev) == QDF_P2P_GO_MODE)) - goto validation_done; + + if (sap_context->vdev && + sap_context->vdev->vdev_mlme.vdev_opmode == QDF_P2P_GO_MODE) { + /* + * check whether go_force_scc is enabled or not. + * If it not enabled then don't any force scc on existing and new + * p2p go vdevs. + * Otherwise, if it is enabled then check whether it's in strict + * mode or liberal mode. + * For strict mode, do force scc on newly p2p go to existing p2p + * go channel. + * For liberal mode, first form new p2p go on requested channel. + * Once set key is done, do force scc on existing p2p go to new + * p2p go channel. + */ + go_force_scc = policy_mgr_go_scc_enforced(mac_ctx->psoc); + sap_debug("go force scc value %d", go_force_scc); + if (go_force_scc) { + is_go_scc_strict = + policy_mgr_is_go_scc_strict(mac_ctx->psoc); + if (!is_go_scc_strict) { + sap_debug("liberal mode is enabled"); + first_p2p_go_vdev_id = + policy_mgr_check_forcescc_for_other_go( + mac_ctx->psoc, + sap_context->sessionId, + sap_context->chan_freq); + + if (first_p2p_go_vdev_id < + WLAN_UMAC_VDEV_ID_MAX) { + sap_set_forcescc_required( + first_p2p_go_vdev_id); + goto validation_done; + } + } + } else { + goto validation_done; + } + } concurrent_state = policy_mgr_get_concurrency_mode(mac_ctx->psoc); if (policy_mgr_concurrent_beaconing_sessions_running(mac_ctx->psoc) || diff --git a/core/sap/src/sap_internal.h b/core/sap/src/sap_internal.h index bfad11f685b5..b13ee52c0f58 100644 --- a/core/sap/src/sap_internal.h +++ b/core/sap/src/sap_internal.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -230,6 +231,13 @@ struct sap_context { bool is_chan_change_inprogress; qdf_list_t owe_pending_assoc_ind_list; uint32_t freq_before_ch_switch; +#ifdef WLAN_FEATURE_P2P_P2P_STA +/* + *This param is used for GO+GO force scc logic where after + *setkey first GO will move to latest GO's channel + */ + bool is_forcescc_restart_required; +#endif }; /*---------------------------------------------------------------------------- From fe0fe964648dd55febec3552ecb7dea4d3366289 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Myadam Date: Wed, 14 Jul 2021 11:06:30 +0530 Subject: [PATCH 12/26] qcacld-3.0: Add WLAN_FEATURE_P2P_P2P_STA flag for p2p + p2p support Add feature flag for conditional compilation of feature to enable p2p+p2p on a device. Change-Id: I2c95b39c3db6e51213f7625383c365799fff9e31 CRs-Fixed: 2991307 --- Kbuild | 1 + configs/default_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/Kbuild b/Kbuild index e7afd83959a4..fe0d494ee7a7 100644 --- a/Kbuild +++ b/Kbuild @@ -2852,6 +2852,7 @@ cppflags-y += -DCONN_MGR_ADV_FEATURE cppflags-$(CONFIG_QCACLD_WLAN_LFR3) += -DWLAN_FEATURE_ROAM_OFFLOAD cppflags-$(CONFIG_WLAN_FEATURE_MBSSID) += -DWLAN_FEATURE_MBSSID +cppflags-$(CONFIG_WLAN_FEATURE_P2P_P2P_STA) += -DWLAN_FEATURE_P2P_P2P_STA ifeq (y,$(findstring y, $(CONFIG_CNSS_GENL) $(CONFIG_CNSS_GENL_MODULE))) cppflags-y += -DCNSS_GENL diff --git a/configs/default_defconfig b/configs/default_defconfig index 9df097858d21..1a3b0a244cdf 100644 --- a/configs/default_defconfig +++ b/configs/default_defconfig @@ -199,6 +199,7 @@ ifeq ($(CONFIG_ARCH_QCS40X), y) CONFIG_WLAN_CLD_PM_QOS := y endif CONFIG_WLAN_FEATURE_MBSSID := y +CONFIG_WLAN_FEATURE_P2P_P2P_STA := y #Flag to enable Legacy Fast Roaming3(LFR3) ifeq (y,$(findstring y,$(CONFIG_HELIUMPLUS) $(CONFIG_LITHIUM))) From 76fdddbcb77f4279a3f30bc26bbcbbdd7dc93d04 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Myadam Date: Mon, 4 Oct 2021 17:57:59 +0530 Subject: [PATCH 13/26] qcacld-3.0: Add support for 3rd mode when CLI+CLI exists Currently support is not there for 3rd mode when CLI+CLI connection is there on DUT. Update PCL table for 3rd mode when CLI+CLI exsits and add support to fetch index based on new connection band and concurrency. Change-Id: I6041c40b3208d0b33dff2b4f9dc854d2d2dc17a1 CRs-Fixed: 3050537 --- .../inc/wlan_policy_mgr_public_struct.h | 88 +++++--- .../policy_mgr/src/wlan_policy_mgr_pcl.c | 206 +++++++++++++++--- .../src/wlan_policy_mgr_tables_2x2_dbs_i.h | 176 +++++++++++++++ 3 files changed, 413 insertions(+), 57 deletions(-) diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h index 35b10c4fb676..793bd23707a3 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h +++ b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h @@ -523,6 +523,21 @@ enum policy_mgr_one_connection_mode { * 2x2 * @PM_P2P_GO_SAP_SBS_5_1x1: P2P GO & SAP connection on 5G SBS * using 1x1 + * @PM_P2P_GO_P2P_GO_SCC_24_1x1: P2P GO & P2P GO SCC on 2.4G using 1x1 + * @PM_P2P_GO_P2P_GO_SCC_24_2x2: P2P GO & P2P GO SCC on 2.4G using 2x2 + * @PM_P2P_GO_P2P_GO_MCC_24_1x1: P2P GO & P2P GO MCC on 2.4G using 1x1 + * @PM_P2P_GO_P2P_GO_MCC_24_2x2: P2P GO & P2P GO MCC on 2.4G using 2x2 + * @PM_P2P_GO_P2P_GO_SCC_5_1x1: P2P GO & P2P GO SCC on 5G using 1x1 + * @PM_P2P_GO_P2P_GO_SCC_5_2x2: P2P GO & P2P GO SCC on 5G using 2x2 + * @PM_P2P_GO_P2P_GO_MCC_5_1x1: P2P GO & P2P GO MCC on 5G using 1x1 + * @PM_P2P_GO_P2P_GO_MCC_5_2x2: P2P GO & P2P GO MCC on 5G using 2x2 + * @PM_P2P_GO_P2P_GO_MCC_24_5_1x1: P2P GO 2.4G & P2P GO 5G dual band MCC + * using 1x1 + * @PM_P2P_GO_P2P_GO_MCC_24_5_2x2: P2P GO 2.4G & P2P GO 5G dual band MCC + * using 2x2 + * @PM_P2P_GO_P2P_GO_DBS_1x1: P2P GO & P2P GO on DBS using 1x1 + * @PM_P2P_GO_P2P_GO_DBS_2x2: P2P GO & P2P GO on DBS using 2x2 + * @PM_P2P_GO_P2P_GO_SBS_5_1x1: P2P GO & P2P GO on SBS using 1x1 * @PM_P2P_CLI_SAP_SCC_24_1x1: CLI & SAP connection on SCC using * 1x1@2.4 Ghz * @PM_P2P_CLI_SAP_SCC_24_2x2: CLI & SAP connection on SCC using @@ -548,6 +563,21 @@ enum policy_mgr_one_connection_mode { * 2x2 * @PM_P2P_CLI_SAP_SBS_5_1x1: P2P CLI & SAP connection on 5G SBS * using 1x1 + * @PM_P2P_CLI_P2P_CLI_SCC_24_1x1: P2P CLI & P2P CLI SCC on 2.4G using 1x1 + * @PM_P2P_CLI_P2P_CLI_SCC_24_2x2: P2P CLI & P2P CLI SCC on 2.4G using 2x2 + * @PM_P2P_CLI_P2P_CLI_MCC_24_1x1: P2P CLI & P2P CLI MCC on 2.4G using 1x1 + * @PM_P2P_CLI_P2P_CLI_MCC_24_2x2: P2P CLI & P2P CLI MCC on 2.4G using 2x2 + * @PM_P2P_CLI_P2P_CLI_SCC_5_1x1: P2P CLI & P2P CLI SCC on 5G using 1x1 + * @PM_P2P_CLI_P2P_CLI_SCC_5_2x2: P2P CLI & P2P CLI SCC on 5G using 2x2 + * @PM_P2P_CLI_P2P_CLI_MCC_5_1x1: P2P CLI & P2P CLI MCC on 5G using 1x1 + * @PM_P2P_CLI_P2P_CLI_MCC_5_2x2: P2P CLI & P2P CLI MCC on 5G using 2x2 + * @PM_P2P_CLI_P2P_CLI_MCC_24_5_1x1: P2P CLI 2.4G & P2P CLI 5G dual band MCC + * using 1x1 + * @PM_P2P_CLI_P2P_CLI_MCC_24_5_2x2: P2P CLI 2.4G & P2P CLI 5G dual band MCC + * using 2x2 + * @PM_P2P_CLI_P2P_CLI_DBS_1x1: P2P CLI & P2P CLI on DBS using 1x1 + * @PM_P2P_CLI_P2P_CLI_DBS_2x2: P2P CLI & P2P CLI on DBS using 2x2 + * @PM_P2P_CLI_P2P_CLI_SBS_5_1x1: P2P CLI & P2P CLI on SBS using 1x1 * @PM_SAP_SAP_SCC_24_1x1: SAP & SAP connection on * SCC using 1x1@2.4 Ghz * @PM_SAP_SAP_SCC_24_2x2: SAP & SAP connection on @@ -618,21 +648,6 @@ enum policy_mgr_one_connection_mode { * @PM_NAN_DISC_NDI_MCC_24_2x2: NAN & NDI connection on MCC using 2x2 on 2.4 GHz * @PM_NAN_DISC_NDI_DBS_1x1: NAN & NDI connection on DBS using 1x1 * @PM_NAN_DISC_NDI_DBS_2x2: NAN & NDI connection on DBS using 2x2 - * @PM_P2P_GO_P2P_GO_SCC_24_1x1: P2P GO & P2P GO SCC on 2.4G using 1x1 - * @PM_P2P_GO_P2P_GO_SCC_24_2x2: P2P GO & P2P GO SCC on 2.4G using 2x2 - * @PM_P2P_GO_P2P_GO_MCC_24_1x1: P2P GO & P2P GO MCC on 2.4G using 1x1 - * @PM_P2P_GO_P2P_GO_MCC_24_2x2: P2P GO & P2P GO MCC on 2.4G using 2x2 - * @PM_P2P_GO_P2P_GO_SCC_5_1x1: P2P GO & P2P GO SCC on 5G using 1x1 - * @PM_P2P_GO_P2P_GO_SCC_5_2x2: P2P GO & P2P GO SCC on 5G using 2x2 - * @PM_P2P_GO_P2P_GO_MCC_5_1x1: P2P GO & P2P GO MCC on 5G using 1x1 - * @PM_P2P_GO_P2P_GO_MCC_5_2x2: P2P GO & P2P GO MCC on 5G using 2x2 - * @PM_P2P_GO_P2P_GO_MCC_24_5_1x1: P2P GO 2.4G & P2P GO 5G dual band MCC - * using 1x1 - * @PM_P2P_GO_P2P_GO_MCC_24_5_2x2: P2P GO 2.4G & P2P GO 5G dual band MCC - * using 2x2 - * @PM_P2P_GO_P2P_GO_DBS_1x1: P2P GO & P2P GO on DBS using 1x1 - * @PM_P2P_GO_P2P_GO_DBS_2x2: P2P GO & P2P GO on DBS using 2x2 - * @PM_P2P_GO_P2P_GO_SBS_5_1x1: P2P GO & P2P GO on SBS using 1x1 * * These are generic IDs that identify the various roles in the * software system @@ -703,6 +718,21 @@ enum policy_mgr_two_connection_mode { PM_P2P_GO_SAP_DBS_1x1, PM_P2P_GO_SAP_DBS_2x2, PM_P2P_GO_SAP_SBS_5_1x1, + PM_P2P_GO_SAP_SBS_5_2x2 = PM_P2P_GO_SAP_SBS_5_1x1, + PM_P2P_GO_P2P_GO_SCC_24_1x1, + PM_P2P_GO_P2P_GO_SCC_24_2x2, + PM_P2P_GO_P2P_GO_MCC_24_1x1, + PM_P2P_GO_P2P_GO_MCC_24_2x2, + PM_P2P_GO_P2P_GO_SCC_5_1x1, + PM_P2P_GO_P2P_GO_SCC_5_2x2, + PM_P2P_GO_P2P_GO_MCC_5_1x1, + PM_P2P_GO_P2P_GO_MCC_5_2x2, + PM_P2P_GO_P2P_GO_MCC_24_5_1x1, + PM_P2P_GO_P2P_GO_MCC_24_5_2x2, + PM_P2P_GO_P2P_GO_DBS_1x1, + PM_P2P_GO_P2P_GO_DBS_2x2, + PM_P2P_GO_P2P_GO_SBS_5_1x1, + PM_P2P_GO_P2P_GO_SBS_5_2x2 = PM_P2P_GO_P2P_GO_SBS_5_1x1, PM_P2P_CLI_SAP_SCC_24_1x1, PM_P2P_CLI_SAP_SCC_24_2x2, PM_P2P_CLI_SAP_MCC_24_1x1, @@ -716,6 +746,21 @@ enum policy_mgr_two_connection_mode { PM_P2P_CLI_SAP_DBS_1x1, PM_P2P_CLI_SAP_DBS_2x2, PM_P2P_CLI_SAP_SBS_5_1x1, + PM_P2P_CLI_SAP_SBS_5_2x2 = PM_P2P_CLI_SAP_SBS_5_1x1, + PM_P2P_CLI_P2P_CLI_SCC_24_1x1, + PM_P2P_CLI_P2P_CLI_SCC_24_2x2, + PM_P2P_CLI_P2P_CLI_MCC_24_1x1, + PM_P2P_CLI_P2P_CLI_MCC_24_2x2, + PM_P2P_CLI_P2P_CLI_SCC_5_1x1, + PM_P2P_CLI_P2P_CLI_SCC_5_2x2, + PM_P2P_CLI_P2P_CLI_MCC_5_1x1, + PM_P2P_CLI_P2P_CLI_MCC_5_2x2, + PM_P2P_CLI_P2P_CLI_MCC_24_5_1x1, + PM_P2P_CLI_P2P_CLI_MCC_24_5_2x2, + PM_P2P_CLI_P2P_CLI_DBS_1x1, + PM_P2P_CLI_P2P_CLI_DBS_2x2, + PM_P2P_CLI_P2P_CLI_SBS_5_1x1, + PM_P2P_CLI_P2P_CLI_SBS_5_2x2 = PM_P2P_CLI_P2P_CLI_SBS_5_1x1, PM_SAP_SAP_SCC_24_1x1, PM_SAP_SAP_SCC_24_2x2, PM_SAP_SAP_MCC_24_1x1, @@ -760,19 +805,6 @@ enum policy_mgr_two_connection_mode { PM_NAN_DISC_NDI_MCC_24_2x2, PM_NAN_DISC_NDI_DBS_1x1, PM_NAN_DISC_NDI_DBS_2x2, - PM_P2P_GO_P2P_GO_SCC_24_1x1, - PM_P2P_GO_P2P_GO_SCC_24_2x2, - PM_P2P_GO_P2P_GO_MCC_24_1x1, - PM_P2P_GO_P2P_GO_MCC_24_2x2, - PM_P2P_GO_P2P_GO_SCC_5_1x1, - PM_P2P_GO_P2P_GO_SCC_5_2x2, - PM_P2P_GO_P2P_GO_MCC_5_1x1, - PM_P2P_GO_P2P_GO_MCC_5_2x2, - PM_P2P_GO_P2P_GO_MCC_24_5_1x1, - PM_P2P_GO_P2P_GO_MCC_24_5_2x2, - PM_P2P_GO_P2P_GO_DBS_1x1, - PM_P2P_GO_P2P_GO_DBS_2x2, - PM_P2P_GO_P2P_GO_SBS_5_1x1, PM_MAX_TWO_CONNECTION_MODE }; diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c index af6e19b92fe5..5be8fa6d3e8d 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c @@ -1729,58 +1729,128 @@ static enum policy_mgr_two_connection_mode return index; } +/* + * policy_mgr_check_and_get_third_connection_pcl_table_index_for_scc() - + * This function checks connection mode is in scc or not and returns + * index value based on mode and prvided index inputs. + * + * @scc_2g_1x1: index of scc_2g_1x1 for provided concurrency + * @scc_2g_2x2: index of scc_2g_2x2 for provided concurrency + * @scc_5g_1x1: index of scc_5g_1x1 for provided concurrency + * @scc_5g_2x2: index of scc_5g_2x2 for provided concurrency + * + * Return: policy_mgr_two_connection_mode index + */ static enum policy_mgr_two_connection_mode - policy_mgr_get_third_connection_pcl_table_index_go_go(void) +policy_mgr_check_and_get_third_connection_pcl_table_index_for_scc( + enum policy_mgr_two_connection_mode scc_2g_1x1, + enum policy_mgr_two_connection_mode scc_2g_2x2, + enum policy_mgr_two_connection_mode scc_5g_1x1, + enum policy_mgr_two_connection_mode scc_5g_2x2) { enum policy_mgr_two_connection_mode index = PM_MAX_TWO_CONNECTION_MODE; - /* SCC */ + if (pm_conc_connection_list[0].freq == - pm_conc_connection_list[1].freq) { + pm_conc_connection_list[1].freq) { if (WLAN_REG_IS_24GHZ_CH_FREQ( - pm_conc_connection_list[0].freq)) { + pm_conc_connection_list[0].freq)) { if (POLICY_MGR_ONE_ONE == - pm_conc_connection_list[0].chain_mask) - index = PM_P2P_GO_P2P_GO_SCC_24_1x1; + pm_conc_connection_list[0].chain_mask) + index = scc_2g_1x1; else - index = PM_P2P_GO_P2P_GO_SCC_24_2x2; + index = scc_2g_2x2; } else { if (POLICY_MGR_ONE_ONE == pm_conc_connection_list[0].chain_mask) - index = PM_P2P_GO_P2P_GO_SCC_5_1x1; + index = scc_5g_1x1; else - index = PM_P2P_GO_P2P_GO_SCC_5_2x2; + index = scc_5g_2x2; } - /* MCC */ - } else if (pm_conc_connection_list[0].mac == - pm_conc_connection_list[1].mac) { + } + return index; +} + +/* + * policy_mgr_check_and_get_third_connection_pcl_table_index_for_mcc() - + * This function checks connection mode is in mcc or not and returns + * index value based on mode and prvided index inputs. + * + * @mcc_2g_1x1: index of mcc_2g_1x1 for provided concurrency + * @mcc_2g_2x2: index of mcc_2g_2x2 for provided concurrency + * @mcc_5g_1x1: index of mcc_5g_1x1 for provided concurrency + * @mcc_5g_2x2: index of mcc_5g_2x2 for provided concurrency + * @mcc_24_5_1x1: index of mcc_24_5_1x1 for provided concurrency + * @mcc_24_5_2x2: index of mcc_24_5_2x2 for provided concurrency + * + * Return: policy_mgr_two_connection_mode index + */ +static enum policy_mgr_two_connection_mode +policy_mgr_check_and_get_third_connection_pcl_table_index_for_mcc( + enum policy_mgr_two_connection_mode mcc_2g_1x1, + enum policy_mgr_two_connection_mode mcc_2g_2x2, + enum policy_mgr_two_connection_mode mcc_5g_1x1, + enum policy_mgr_two_connection_mode mcc_5g_2x2, + enum policy_mgr_two_connection_mode mcc_24_5_1x1, + enum policy_mgr_two_connection_mode mcc_24_5_2x2) +{ + enum policy_mgr_two_connection_mode index = PM_MAX_TWO_CONNECTION_MODE; + + if (pm_conc_connection_list[0].mac == pm_conc_connection_list[1].mac) { if ((WLAN_REG_IS_24GHZ_CH_FREQ( - pm_conc_connection_list[0].freq)) && - (WLAN_REG_IS_24GHZ_CH_FREQ( - pm_conc_connection_list[1].freq))) { + pm_conc_connection_list[0].freq)) && + (WLAN_REG_IS_24GHZ_CH_FREQ( + pm_conc_connection_list[1].freq))) { if (POLICY_MGR_ONE_ONE == - pm_conc_connection_list[0].chain_mask) - index = PM_P2P_GO_P2P_GO_MCC_24_1x1; + pm_conc_connection_list[0].chain_mask) + index = mcc_2g_1x1; else - index = PM_P2P_GO_P2P_GO_MCC_24_2x2; + index = mcc_2g_2x2; } else if ((WLAN_REG_IS_5GHZ_CH_FREQ( pm_conc_connection_list[0].freq)) && (WLAN_REG_IS_5GHZ_CH_FREQ( pm_conc_connection_list[1].freq))) { + } else if (!(WLAN_REG_IS_24GHZ_CH_FREQ( + pm_conc_connection_list[0].freq)) && + !(WLAN_REG_IS_24GHZ_CH_FREQ( + pm_conc_connection_list[1].freq))) { if (POLICY_MGR_ONE_ONE == - pm_conc_connection_list[0].chain_mask) - index = PM_P2P_GO_P2P_GO_MCC_5_1x1; + pm_conc_connection_list[0].chain_mask) + index = mcc_5g_1x1; else - index = PM_P2P_GO_P2P_GO_MCC_5_2x2; + index = mcc_5g_2x2; } else { if (POLICY_MGR_ONE_ONE == pm_conc_connection_list[0].chain_mask) - index = PM_P2P_GO_P2P_GO_MCC_24_5_1x1; + index = mcc_24_5_1x1; else - index = PM_P2P_GO_P2P_GO_MCC_24_5_2x2; + index = mcc_24_5_2x2; } - /* SBS or DBS */ - } else if (pm_conc_connection_list[0].mac != - pm_conc_connection_list[1].mac) { + } + return index; +} + +/* + * policy_mgr_check_and_get_third_connection_pcl_table_index_for_dbs() - + * This function checks connection mode is in dbs or sbs and returns index + * value based on mode and prvided index inputs. + * + * @sbs_5g_1x1: index of sbs_5g_1x1 for provided concurrency + * @sbs_5g_2x2: index of sbs_5g_2x2 for provided concurrency + * @dbs_1x1: index of dbs_1x1 for provided concurrency + * @dbs_2x2: index of dbs_2x2 for provided concurrency + * + * Return: policy_mgr_two_connection_mode index + */ +static enum policy_mgr_two_connection_mode +policy_mgr_check_and_get_third_connection_pcl_table_index_for_dbs( + enum policy_mgr_two_connection_mode sbs_5g_1x1, + enum policy_mgr_two_connection_mode sbs_5g_2x2, + enum policy_mgr_two_connection_mode dbs_1x1, + enum policy_mgr_two_connection_mode dbs_2x2) +{ + enum policy_mgr_two_connection_mode index = PM_MAX_TWO_CONNECTION_MODE; + + if (pm_conc_connection_list[0].mac != pm_conc_connection_list[1].mac) { /* SBS */ if ((WLAN_REG_IS_5GHZ_CH_FREQ( pm_conc_connection_list[0].freq)) && @@ -1788,16 +1858,89 @@ static enum policy_mgr_two_connection_mode pm_conc_connection_list[1].freq))) { if (POLICY_MGR_ONE_ONE == pm_conc_connection_list[0].chain_mask) - index = PM_P2P_GO_P2P_GO_SBS_5_1x1; + index = sbs_5g_1x1; + else + index = sbs_5g_2x2; } else { /* DBS */ if (POLICY_MGR_ONE_ONE == pm_conc_connection_list[0].chain_mask) - index = PM_P2P_GO_P2P_GO_DBS_1x1; + index = dbs_1x1; else - index = PM_P2P_GO_P2P_GO_DBS_2x2; + index = dbs_2x2; } } + + return index; +} + +static enum policy_mgr_two_connection_mode + policy_mgr_get_third_connection_pcl_table_index_cli_cli(void) +{ + enum policy_mgr_two_connection_mode index; + + index = + policy_mgr_check_and_get_third_connection_pcl_table_index_for_scc( + PM_P2P_CLI_P2P_CLI_SCC_24_1x1, + PM_P2P_CLI_P2P_CLI_SCC_24_2x2, + PM_P2P_CLI_P2P_CLI_SCC_5_1x1, + PM_P2P_CLI_P2P_CLI_SCC_5_2x2); + if (index != PM_MAX_TWO_CONNECTION_MODE) + return index; + + index = + policy_mgr_check_and_get_third_connection_pcl_table_index_for_mcc( + PM_P2P_CLI_P2P_CLI_MCC_24_1x1, + PM_P2P_CLI_P2P_CLI_MCC_24_2x2, + PM_P2P_CLI_P2P_CLI_MCC_5_1x1, + PM_P2P_CLI_P2P_CLI_MCC_5_2x2, + PM_P2P_CLI_P2P_CLI_MCC_24_5_1x1, + PM_P2P_CLI_P2P_CLI_MCC_24_5_2x2); + + if (index != PM_MAX_TWO_CONNECTION_MODE) + return index; + + index = + policy_mgr_check_and_get_third_connection_pcl_table_index_for_dbs( + PM_P2P_CLI_P2P_CLI_SBS_5_1x1, + PM_P2P_CLI_P2P_CLI_SBS_5_2x2, + PM_P2P_CLI_P2P_CLI_DBS_1x1, + PM_P2P_CLI_P2P_CLI_DBS_2x2); + + return index; +} + +static enum policy_mgr_two_connection_mode + policy_mgr_get_third_connection_pcl_table_index_go_go(void) +{ + enum policy_mgr_two_connection_mode index; + + index = + policy_mgr_check_and_get_third_connection_pcl_table_index_for_scc( + PM_P2P_GO_P2P_GO_SCC_24_1x1, + PM_P2P_GO_P2P_GO_SCC_24_2x2, + PM_P2P_GO_P2P_GO_SCC_5_1x1, + PM_P2P_GO_P2P_GO_SCC_5_2x2); + if (index != PM_MAX_TWO_CONNECTION_MODE) + return index; + + index = + policy_mgr_check_and_get_third_connection_pcl_table_index_for_mcc( + PM_P2P_GO_P2P_GO_MCC_24_1x1, + PM_P2P_GO_P2P_GO_MCC_24_2x2, + PM_P2P_GO_P2P_GO_MCC_5_1x1, + PM_P2P_GO_P2P_GO_MCC_5_2x2, + PM_P2P_GO_P2P_GO_MCC_24_5_1x1, + PM_P2P_GO_P2P_GO_MCC_24_5_2x2); + if (index != PM_MAX_TWO_CONNECTION_MODE) + return index; + + index = + policy_mgr_check_and_get_third_connection_pcl_table_index_for_dbs( + PM_P2P_GO_P2P_GO_SBS_5_1x1, + PM_P2P_GO_P2P_GO_SBS_5_2x2, + PM_P2P_GO_P2P_GO_DBS_1x1, + PM_P2P_GO_P2P_GO_DBS_2x2); return index; } @@ -1977,6 +2120,11 @@ enum policy_mgr_two_connection_mode index = policy_mgr_get_third_connection_pcl_table_index_go_go(); + else if ((pm_conc_connection_list[0].mode == PM_P2P_CLIENT_MODE) && + (pm_conc_connection_list[1].mode == PM_P2P_CLIENT_MODE)) + index = + policy_mgr_get_third_connection_pcl_table_index_cli_cli(); + policy_mgr_debug("mode0:%d mode1:%d freq0:%d freq1:%d chain:%d index:%d", pm_conc_connection_list[0].mode, pm_conc_connection_list[1].mode, diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_dbs_i.h b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_dbs_i.h index b5fc5f169436..fe458df7fd2d 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_dbs_i.h +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_dbs_i.h @@ -1147,6 +1147,182 @@ pm_third_connection_pcl_dbs_2x2_table = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + [PM_P2P_CLI_P2P_CLI_SCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_NAN_DISC_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_P2P_CLI_SCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_NAN_DISC_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_P2P_CLI_MCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NAN_DISC_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_P2P_CLI_MCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NAN_DISC_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_P2P_CLI_SCC_5_1x1] = { + [PM_STA_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NAN_DISC_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_P2P_CLI_SCC_5_2x2] = { + [PM_STA_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NAN_DISC_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_P2P_CLI_MCC_5_1x1] = { + [PM_STA_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NAN_DISC_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_P2P_CLI_MCC_5_2x2] = { + [PM_STA_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NAN_DISC_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_P2P_CLI_MCC_24_5_1x1] = { + [PM_STA_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NAN_DISC_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_P2P_CLI_MCC_24_5_2x2] = { + [PM_STA_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NAN_DISC_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_P2P_CLI_DBS_1x1] = { + [PM_STA_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24_5G, + PM_SCC_ON_5_SCC_ON_24_5G}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NAN_DISC_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_P2P_CLI_DBS_2x2] = { + [PM_STA_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, + PM_SCC_ON_5_SCC_ON_24_5G, + PM_SCC_ON_5_SCC_ON_24_5G}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NAN_DISC_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_P2P_CLI_SBS_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NAN_DISC_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + [PM_STA_P2P_CLI_SCC_24_1x1] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, From baf0b1d124b59b5f1ee0b2e36683148657bc1d02 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Myadam Date: Fri, 2 Jul 2021 17:51:04 +0800 Subject: [PATCH 14/26] qcacld-3.0: refine functions for getting preferred channel list Refine policy manager get PCL channel list APIs to help add new PCL type. Change-Id: I1e9d49c5f0a8c2c38f1fb5302615bc956ed6aae0 CRs-Fixed: 2998478 --- .../policy_mgr/src/wlan_policy_mgr_core.c | 749 +++++++++--------- .../policy_mgr/src/wlan_policy_mgr_i.h | 29 +- .../policy_mgr/src/wlan_policy_mgr_pcl.c | 4 +- 3 files changed, 388 insertions(+), 394 deletions(-) diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c index f5a91a2ec465..939ef9870d60 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c @@ -1806,12 +1806,13 @@ enum phy_ch_width policy_mgr_get_ch_width(enum hw_mode_bandwidth bw) /** * policy_mgr_get_sbs_channels() - provides the sbs channel(s) - * with respect to current connection(s) - * @channels: the channel(s) on which current connection(s) is - * @len: Number of channels - * @pcl_weight: Pointer to the weights of PCL - * @weight_len: Max length of the weight list - * @index: Index from which the weight list needs to be populated + * with respect to current connection(s) + * @psoc: psoc object + * @pcl_freqs: the channel(s) on which current connection(s) is + * @pcl_weights: Pointer to the weights of PCL + * @pcl_sz: Max length of the PCL list + * @index: Index from which the weight list needs to be populated, + * will increase accordingly if any channel is obtained * @group_id: Next available groups for weight assignment * @available_5g_channels: List of available 5g channels * @available_5g_channels_len: Length of the 5g channels list @@ -1823,25 +1824,34 @@ enum phy_ch_width policy_mgr_get_ch_width(enum hw_mode_bandwidth bw) * Return: QDF_STATUS */ -static QDF_STATUS policy_mgr_get_sbs_channels( - uint32_t *ch_freq_list, - uint32_t *len, uint8_t *pcl_weight, uint32_t weight_len, - uint32_t *index, enum policy_mgr_pcl_group_id group_id, - uint32_t *available_5g_ch_freqs, - uint32_t available_5g_channels_len, - bool add_5g_channels) +static QDF_STATUS +policy_mgr_get_sbs_channels(struct wlan_objmgr_psoc *psoc, uint32_t *pcl_freqs, + uint8_t *pcl_weights, uint32_t pcl_sz, + uint32_t *index, + enum policy_mgr_pcl_group_id group_id, + uint32_t *available_5g_ch_freqs, + uint32_t available_5g_channels_len, + bool add_5g_channels) { - QDF_STATUS status = QDF_STATUS_SUCCESS; - uint32_t conn_index = 0, num_channels = 0; + uint32_t conn_index = 0; uint32_t num_5g_channels = 0, cur_5g_ch_freq = 0; uint32_t remaining_5g_ch_freqs[NUM_CHANNELS] = {}; uint32_t remaining_channel_index = 0; - uint32_t j = 0, i = 0, weight1, weight2; + uint32_t j = 0, i = 0, weight1, weight2, idx; + struct policy_mgr_psoc_priv_obj *pm_ctx; - if (!ch_freq_list || !len) { + if (!policy_mgr_is_hw_sbs_capable(psoc)) + return QDF_STATUS_E_NOSUPPORT; + + if (!pcl_freqs || !pcl_weights || !index || !pcl_sz) { policy_mgr_err("channels or len is NULL"); - status = QDF_STATUS_E_FAILURE; - return status; + return QDF_STATUS_E_INVAL; + } + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; } if (group_id == POLICY_MGR_PCL_GROUP_ID1_ID2) { @@ -1855,9 +1865,11 @@ static QDF_STATUS policy_mgr_get_sbs_channels( weight2 = WEIGHT_OF_GROUP4_PCL_CHANNELS; } + idx = *index; policy_mgr_debug("weight1=%d weight2=%d index=%d ", - weight1, weight2, *index); + weight1, weight2, idx); + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { if (WLAN_REG_IS_5GHZ_CH_FREQ( pm_conc_connection_list[conn_index].freq) && @@ -1872,13 +1884,14 @@ static QDF_STATUS policy_mgr_get_sbs_channels( conn_index = 0; if (num_5g_channels > 1) { /* This case we are already in SBS so return the channels */ - while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { - ch_freq_list[num_channels++] = + while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index) && + idx < pcl_sz) { + pcl_freqs[idx] = pm_conc_connection_list[conn_index++].freq; - if (*index < weight_len) - pcl_weight[(*index)++] = weight1; + pcl_weights[idx] = weight1; + idx++; } - *len = num_channels; + /* fix duplicate issue later */ if (add_5g_channels) for (j = 0; j < available_5g_channels_len; j++) @@ -1889,33 +1902,38 @@ static QDF_STATUS policy_mgr_get_sbs_channels( /* Get list of valid sbs channels for the current * connected channel */ - for (j = 0; j < available_5g_channels_len; j++) { + for (j = 0; (j < available_5g_channels_len) && + (j < NUM_CHANNELS) && idx < pcl_sz; j++) { if (WLAN_REG_IS_FREQUENCY_VALID_5G_SBS( cur_5g_ch_freq, available_5g_ch_freqs[j])) { - ch_freq_list[num_channels++] = - available_5g_ch_freqs[j]; + pcl_freqs[idx] = available_5g_ch_freqs[j]; + pcl_weights[idx] = weight1; + idx++; } else { remaining_5g_ch_freqs[ remaining_channel_index++] = available_5g_ch_freqs[j]; continue; } - if (*index < weight_len) - pcl_weight[(*index)++] = weight1; } - *len = num_channels; } if (add_5g_channels) { - qdf_mem_copy(ch_freq_list + num_channels, remaining_5g_ch_freqs, - remaining_channel_index * sizeof(*ch_freq_list)); - *len += remaining_channel_index; - for (i = 0; ((i < remaining_channel_index) - && (i < weight_len)); i++) - pcl_weight[i] = weight2; + remaining_channel_index = + QDF_MIN(idx + remaining_channel_index, pcl_sz) - idx; + qdf_mem_copy(&pcl_freqs[idx], remaining_5g_ch_freqs, + remaining_channel_index * sizeof(*pcl_freqs)); + + for (i = idx; i < idx + remaining_channel_index; i++) + pcl_weights[i] = weight2; + + idx += remaining_channel_index; } - return status; + *index = idx; + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return QDF_STATUS_SUCCESS; } /** @@ -1923,36 +1941,37 @@ static QDF_STATUS policy_mgr_get_sbs_channels( * on which current connection(s) is * @psoc: psoc object * @mode: conn mode - * @ch_freq_list: the channel(s) on which current connection(s) is - * @len: Number of channels - * @order: no order OR 2.4 Ghz channel followed by 5 Ghz - * channel OR 5 Ghz channel followed by 2.4 Ghz channel + * @order: no order OR 2.4 Ghz channel followed by 5 Ghz channel OR + * 5 Ghz channel followed by 2.4 Ghz channel * @skip_dfs_channel: if this flag is true then skip the dfs channel - * @pcl_weight: Pointer to the weights of PCL - * @weight_len: Max length of the weight list - * @index: Index from which the weight list needs to be populated * @group_id: Next available groups for weight assignment - * + * @pcl_freqs: Pointer to the frequencies of PCL + * @pcl_weights: Pointer to the weights of PCL + * @pcl_sz: Max length of the PCL list + * @index: Index from which the PCL list needs to be populated, + * will increase accordingly if any channel is obtained * * This function provides the channel(s) on which current * connection(s) is/are * * Return: QDF_STATUS */ -static -QDF_STATUS policy_mgr_get_connection_channels(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_con_mode mode, - uint32_t *ch_freq_list, - uint32_t *len, enum policy_mgr_pcl_channel_order order, - bool skip_dfs_channel, - uint8_t *pcl_weight, uint32_t weight_len, - uint32_t *index, enum policy_mgr_pcl_group_id group_id) +static QDF_STATUS +policy_mgr_get_connection_channels(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + enum policy_mgr_pcl_channel_order order, + bool skip_dfs_channel, + enum policy_mgr_pcl_group_id group_id, + uint32_t *pcl_freqs, uint8_t *pcl_weights, + uint32_t pcl_sz, uint32_t *index) { QDF_STATUS status = QDF_STATUS_SUCCESS; - uint32_t conn_index = 0, num_channels = 0; + uint32_t conn_index = 0; uint32_t weight1, weight2; struct policy_mgr_psoc_priv_obj *pm_ctx; + struct policy_mgr_conc_connection_info *cl; bool add_6ghz = true; + uint32_t idx; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -1960,12 +1979,14 @@ QDF_STATUS policy_mgr_get_connection_channels(struct wlan_objmgr_psoc *psoc, return status; } - if (!ch_freq_list || !len) { - policy_mgr_err("channels or len is NULL"); - status = QDF_STATUS_E_FAILURE; + if (!pcl_freqs || !pcl_weights || !index || !pcl_sz) { + policy_mgr_err("list or index is NULL"); + status = QDF_STATUS_E_INVAL; return status; } + idx = *index; + /* POLICY_MGR_PCL_GROUP_ID1_ID2 indicates that all three weights are * available for assignment. i.e., WEIGHT_OF_GROUP1_PCL_CHANNELS, * WEIGHT_OF_GROUP2_PCL_CHANNELS and WEIGHT_OF_GROUP3_PCL_CHANNELS @@ -1997,52 +2018,47 @@ QDF_STATUS policy_mgr_get_connection_channels(struct wlan_objmgr_psoc *psoc, add_6ghz = false; qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + cl = pm_conc_connection_list; if (POLICY_MGR_PCL_ORDER_NONE == order) { while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { bool is_6ghz_ch = WLAN_REG_IS_6GHZ_CHAN_FREQ( - pm_conc_connection_list[conn_index].freq); + cl[conn_index].freq); if (skip_dfs_channel && wlan_reg_is_dfs_for_freq( - pm_ctx->pdev, - pm_conc_connection_list[conn_index].freq)) { + pm_ctx->pdev, cl[conn_index].freq)) { conn_index++; - } else if ((*index < weight_len) && + } else if ((idx < pcl_sz) && (!is_6ghz_ch || add_6ghz)) { - ch_freq_list[num_channels++] = - pm_conc_connection_list[ - conn_index++].freq; - pcl_weight[(*index)++] = weight1; + pcl_freqs[idx] = cl[conn_index++].freq; + pcl_weights[idx] = weight1; + idx++; } else { conn_index++; } } - *len = num_channels; } else if (POLICY_MGR_PCL_ORDER_24G_THEN_5G == order) { while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { - if (WLAN_REG_IS_24GHZ_CH_FREQ( - pm_conc_connection_list[conn_index].freq) - && (*index < weight_len)) { - ch_freq_list[num_channels++] = - pm_conc_connection_list[ - conn_index++].freq; - pcl_weight[(*index)++] = weight1; + if (WLAN_REG_IS_24GHZ_CH_FREQ(cl[conn_index].freq) && + idx < pcl_sz) { + pcl_freqs[idx] = cl[conn_index++].freq; + pcl_weights[idx] = weight1; + idx++; } else { conn_index++; } } + conn_index = 0; while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { if (skip_dfs_channel && - wlan_reg_is_dfs_for_freq( - pm_ctx->pdev, - pm_conc_connection_list[conn_index].freq)) { + wlan_reg_is_dfs_for_freq(pm_ctx->pdev, + cl[conn_index].freq)) { conn_index++; } else if (WLAN_REG_IS_5GHZ_CH_FREQ( - pm_conc_connection_list[conn_index].freq) && - (*index < weight_len)) { - ch_freq_list[num_channels++] = - pm_conc_connection_list[ - conn_index++].freq; - pcl_weight[(*index)++] = weight2; + cl[conn_index].freq) && + (idx < pcl_sz)) { + pcl_freqs[idx] = cl[conn_index++].freq; + pcl_weights[idx] = weight2; + idx++; } else { conn_index++; } @@ -2051,44 +2067,38 @@ QDF_STATUS policy_mgr_get_connection_channels(struct wlan_objmgr_psoc *psoc, while (add_6ghz && PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { bool is_6ghz_ch = WLAN_REG_IS_6GHZ_CHAN_FREQ( - pm_conc_connection_list[conn_index].freq); - if (is_6ghz_ch && (*index < weight_len)) { - ch_freq_list[num_channels++] = - pm_conc_connection_list[ - conn_index++].freq; - pcl_weight[(*index)++] = weight2; + cl[conn_index].freq); + if (is_6ghz_ch && idx < pcl_sz) { + pcl_freqs[idx] = cl[conn_index++].freq; + pcl_weights[idx] = weight2; + idx++; } else { conn_index++; } } - *len = num_channels; } else if (POLICY_MGR_PCL_ORDER_5G_THEN_2G == order) { while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { if (skip_dfs_channel && wlan_reg_is_dfs_for_freq( - pm_ctx->pdev, - pm_conc_connection_list[conn_index].freq)) { + pm_ctx->pdev, cl[conn_index].freq)) { conn_index++; } else if (WLAN_REG_IS_5GHZ_CH_FREQ( - pm_conc_connection_list[conn_index].freq) && - (*index < weight_len)) { - ch_freq_list[num_channels++] = - pm_conc_connection_list[ - conn_index++].freq; - pcl_weight[(*index)++] = weight1; + cl[conn_index].freq) && + (idx < pcl_sz)) { + pcl_freqs[idx] = cl[conn_index++].freq; + pcl_weights[idx] = weight1; + idx++; } else { conn_index++; } } conn_index = 0; while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { - if (WLAN_REG_IS_24GHZ_CH_FREQ( - pm_conc_connection_list[conn_index].freq) && - (*index < weight_len)) { - ch_freq_list[num_channels++] = - pm_conc_connection_list[ - conn_index++].freq; - pcl_weight[(*index)++] = weight2; + if (WLAN_REG_IS_24GHZ_CH_FREQ(cl[conn_index].freq) && + idx < pcl_sz) { + pcl_freqs[idx] = cl[conn_index++].freq; + pcl_weights[idx] = weight2; + idx++; } else { conn_index++; @@ -2098,21 +2108,21 @@ QDF_STATUS policy_mgr_get_connection_channels(struct wlan_objmgr_psoc *psoc, while (add_6ghz && PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { bool is_6ghz_ch = WLAN_REG_IS_6GHZ_CHAN_FREQ( - pm_conc_connection_list[conn_index].freq); - if (is_6ghz_ch && (*index < weight_len)) { - ch_freq_list[num_channels++] = - pm_conc_connection_list[ - conn_index++].freq; - pcl_weight[(*index)++] = weight2; + cl[conn_index].freq); + if (is_6ghz_ch && idx < pcl_sz) { + pcl_freqs[idx] = cl[conn_index++].freq; + pcl_weights[idx] = weight2; + idx++; } else { conn_index++; } } - *len = num_channels; } else { policy_mgr_err("unknown order %d", order); status = QDF_STATUS_E_FAILURE; } + + *index = idx; qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); return status; @@ -2181,14 +2191,28 @@ void policy_mgr_set_weight_of_dfs_passive_channels_to_zero( return; } -static void policy_mgr_add_5g_to_pcl( - struct wlan_objmgr_psoc *psoc, - uint32_t *ch_freq_list, - uint32_t *len, - uint8_t *pcl_weight, uint32_t weight_len, - uint32_t *index, enum policy_mgr_pcl_group_id group_id, - const uint32_t *chlist_5g, uint8_t chlist_5g_len, - const uint32_t *chlist_6g, uint8_t chlist_6g_len) +/** + * policy_mgr_add_5g_to_pcl() - add the 5G/6G channels into PCL + * @psoc: psoc object + * @pcl_freqs: Pointer to the frequencies of PCL + * @pcl_weights: Pointer to the weights of PCL + * @pcl_sz: Max length of the PCL list + * @index: Index from which the PCL list needs to be populated, + * will increase accordingly if any channel is obtained + * @group_id: Next available groups for weight assignment + * @chlist_5g: Pointer to the 5G channel list + * @chlist_5g_len: Length of the 5G channel list + * @chlist_6g: Pointer to the 6G channel list + * @chlist_6g_len: Length of the 6G channel list + * + * Return: None + */ +static void +policy_mgr_add_5g_to_pcl(struct wlan_objmgr_psoc *psoc, uint32_t *pcl_freqs, + uint8_t *pcl_weights, uint32_t pcl_sz, uint32_t *index, + enum policy_mgr_pcl_group_id group_id, + const uint32_t *chlist_5g, uint8_t chlist_5g_len, + const uint32_t *chlist_6g, uint8_t chlist_6g_len) { struct policy_mgr_psoc_priv_obj *pm_ctx; uint32_t weight1, weight2; @@ -2197,6 +2221,7 @@ static void policy_mgr_add_5g_to_pcl( const uint32_t *chlist2; uint8_t chlist2_len; uint32_t i; + uint32_t len = 0, idx; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -2204,6 +2229,8 @@ static void policy_mgr_add_5g_to_pcl( return; } + idx = *index; + if (group_id == POLICY_MGR_PCL_GROUP_ID1_ID2) { weight1 = WEIGHT_OF_GROUP1_PCL_CHANNELS; weight2 = WEIGHT_OF_GROUP2_PCL_CHANNELS; @@ -2225,42 +2252,74 @@ static void policy_mgr_add_5g_to_pcl( chlist2 = chlist_6g; chlist2_len = chlist_6g_len; } - if ((chlist1_len + *index) > weight_len) { + if ((chlist1_len + idx) > pcl_sz) { policy_mgr_err("no enough weight len %d chlist1_len %d %d", - weight_len, chlist1_len, *index); + pcl_sz, chlist1_len, idx); return; } - qdf_mem_copy(ch_freq_list, chlist1, chlist1_len * sizeof(*chlist1)); + qdf_mem_copy(&pcl_freqs[idx], chlist1, chlist1_len * sizeof(*chlist1)); for (i = 0; i < chlist1_len; i++) - pcl_weight[(*index)++] = weight1; + pcl_weights[idx++] = weight1; - *len += chlist1_len; + len += chlist1_len; - if ((chlist2_len + *index) > weight_len) { + if ((chlist2_len + idx) > pcl_sz) { policy_mgr_err("no enough weight len chlist2_len %d %d %d", - weight_len, chlist2_len, *index); + pcl_sz, chlist2_len, idx); return; } - qdf_mem_copy(&ch_freq_list[chlist1_len], chlist2, + qdf_mem_copy(&pcl_freqs[idx], chlist2, chlist2_len * sizeof(*chlist2)); for (i = 0; i < chlist2_len; i++) - pcl_weight[(*index)++] = weight2; - *len += chlist2_len; + pcl_weights[idx++] = weight2; + len += chlist2_len; + *index = idx; policy_mgr_debug("Add 5g chlist len %d 6g chlist len %d len %d index %d order %d", - chlist_5g_len, chlist_6g_len, *len, *index, + chlist_5g_len, chlist_6g_len, len, idx, pm_ctx->cfg.pcl_band_priority); } +/** + * policy_mgr_add_24g_to_pcl() - add the 2.4G channels into PCL + * @pcl_freqs: Pointer to the frequencies of PCL + * @pcl_weights: Pointer to the weights of PCL + * @pcl_sz: Max length of the PCL list + * @index: Index from which the PCL list needs to be populated, + * will increase accordingly if any channel is obtained + * @weight: group for weight assignment + * @chlist_24g: Pointer to the 2.4G channel list + * @chlist_24g_len: Length of the 2.4G channel list + * + * Return: None + */ +static void +policy_mgr_add_24g_to_pcl(uint32_t *pcl_freqs, uint8_t *pcl_weights, + uint32_t pcl_sz, uint32_t *index, uint32_t weight, + const uint32_t *chlist_24g, uint8_t chlist_24g_len) +{ + uint32_t num_to_add, i; + + num_to_add = QDF_MIN((*index + chlist_24g_len), pcl_sz) - *index; + qdf_mem_copy(&pcl_freqs[*index], chlist_24g, + num_to_add * sizeof(*chlist_24g)); + for (i = *index; i < *index + num_to_add; i++) + pcl_weights[i] = weight; + + *index = i; + policy_mgr_debug("Add 24g chlist len %d len %d index %d", + chlist_24g_len, num_to_add, *index); +} + /** * policy_mgr_get_channel_list() - provides the channel list * suggestion for new connection - * @pcl: The preferred channel list enum - * @pcl_channels: PCL channels - * @len: length of the PCL + * @pcl: The preferred channel list enum * @mode: concurrency mode for which channel list is requested + * @pcl_channels: PCL channels * @pcl_weights: Weights of the PCL - * @weight_len: Max length of the weight list + * @pcl_sz: Max length of the PCL list + * @len: length of the PCL obtained * * This function provides the actual channel list based on the * current regulatory domain derived using preferred channel @@ -2269,17 +2328,18 @@ static void policy_mgr_add_5g_to_pcl( * Return: Channel List */ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_pcl_type pcl, - uint32_t *pcl_channels, uint32_t *len, - enum policy_mgr_con_mode mode, - uint8_t *pcl_weights, uint32_t weight_len) + enum policy_mgr_pcl_type pcl, + enum policy_mgr_con_mode mode, + uint32_t *pcl_channels, + uint8_t *pcl_weights, + uint32_t pcl_sz, uint32_t *len) { QDF_STATUS status = QDF_STATUS_E_FAILURE; uint32_t num_channels = 0; uint32_t sbs_num_channels = 0; uint32_t chan_index_24 = 0, chan_index_5 = 0, chan_index_6 = 0; bool skip_dfs_channel = false; - uint32_t i = 0, j = 0; + uint32_t i = 0; struct policy_mgr_psoc_priv_obj *pm_ctx; uint32_t *channel_list, *channel_list_24, *channel_list_5, *sbs_channel_list, *channel_list_6; @@ -2389,323 +2449,236 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, */ switch (pcl) { case PM_24G: - chan_index_24 = QDF_MIN(chan_index_24, weight_len); - qdf_mem_copy(pcl_channels, channel_list_24, - chan_index_24 * sizeof(*pcl_channels)); - *len = chan_index_24; - for (i = 0; i < *len; i++) - pcl_weights[i] = WEIGHT_OF_GROUP1_PCL_CHANNELS; + policy_mgr_add_24g_to_pcl(pcl_channels, pcl_weights, pcl_sz, + len, WEIGHT_OF_GROUP1_PCL_CHANNELS, + channel_list_24, chan_index_24); status = QDF_STATUS_SUCCESS; break; case PM_5G: - policy_mgr_add_5g_to_pcl( - psoc, pcl_channels, len, - pcl_weights, weight_len, - &i, - POLICY_MGR_PCL_GROUP_ID1_ID2, - channel_list_5, chan_index_5, - channel_list_6, chan_index_6); + policy_mgr_add_5g_to_pcl(psoc, pcl_channels, pcl_weights, + pcl_sz, len, + POLICY_MGR_PCL_GROUP_ID1_ID2, + channel_list_5, chan_index_5, + channel_list_6, chan_index_6); status = QDF_STATUS_SUCCESS; break; case PM_SCC_CH: case PM_MCC_CH: - policy_mgr_get_connection_channels( - psoc, mode, - channel_list, &num_channels, POLICY_MGR_PCL_ORDER_NONE, - skip_dfs_channel, pcl_weights, weight_len, &i, - POLICY_MGR_PCL_GROUP_ID1_ID2); - qdf_mem_copy(pcl_channels, channel_list, - num_channels * sizeof(*pcl_channels)); - *len = num_channels; + policy_mgr_get_connection_channels(psoc, mode, + POLICY_MGR_PCL_ORDER_NONE, + skip_dfs_channel, + POLICY_MGR_PCL_GROUP_ID1_ID2, + pcl_channels, pcl_weights, + pcl_sz, len); status = QDF_STATUS_SUCCESS; break; case PM_SCC_CH_24G: case PM_MCC_CH_24G: - policy_mgr_get_connection_channels( - psoc, mode, - channel_list, &num_channels, POLICY_MGR_PCL_ORDER_NONE, - skip_dfs_channel, pcl_weights, weight_len, &i, - POLICY_MGR_PCL_GROUP_ID1_ID2); - qdf_mem_copy(pcl_channels, channel_list, - num_channels * sizeof(*pcl_channels)); - *len = num_channels; - chan_index_24 = QDF_MIN((num_channels + chan_index_24), - weight_len) - num_channels; - qdf_mem_copy(&pcl_channels[num_channels], channel_list_24, - chan_index_24 * sizeof(*pcl_channels)); - *len += chan_index_24; - for (j = 0; j < chan_index_24; i++, j++) - pcl_weights[i] = WEIGHT_OF_GROUP2_PCL_CHANNELS; - + policy_mgr_get_connection_channels(psoc, mode, + POLICY_MGR_PCL_ORDER_NONE, + skip_dfs_channel, + POLICY_MGR_PCL_GROUP_ID1_ID2, + pcl_channels, pcl_weights, + pcl_sz, len); + policy_mgr_add_24g_to_pcl(pcl_channels, pcl_weights, pcl_sz, + len, WEIGHT_OF_GROUP2_PCL_CHANNELS, + channel_list_24, chan_index_24); status = QDF_STATUS_SUCCESS; break; case PM_SCC_CH_5G: case PM_MCC_CH_5G: - policy_mgr_get_connection_channels( - psoc, mode, - channel_list, &num_channels, POLICY_MGR_PCL_ORDER_NONE, - skip_dfs_channel, pcl_weights, weight_len, &i, - POLICY_MGR_PCL_GROUP_ID1_ID2); - qdf_mem_copy(pcl_channels, channel_list, - num_channels * sizeof(*pcl_channels)); - *len = num_channels; - policy_mgr_add_5g_to_pcl( - psoc, &pcl_channels[num_channels], len, - pcl_weights, weight_len, - &i, - POLICY_MGR_PCL_GROUP_ID2_ID3, - channel_list_5, chan_index_5, - channel_list_6, chan_index_6); + policy_mgr_get_connection_channels(psoc, mode, + POLICY_MGR_PCL_ORDER_NONE, + skip_dfs_channel, + POLICY_MGR_PCL_GROUP_ID1_ID2, + pcl_channels, pcl_weights, + pcl_sz, len); + policy_mgr_add_5g_to_pcl(psoc, pcl_channels, pcl_weights, + pcl_sz, len, + POLICY_MGR_PCL_GROUP_ID2_ID3, + channel_list_5, chan_index_5, + channel_list_6, chan_index_6); status = QDF_STATUS_SUCCESS; break; case PM_24G_SCC_CH: case PM_24G_MCC_CH: - chan_index_24 = QDF_MIN(chan_index_24, weight_len); - qdf_mem_copy(pcl_channels, channel_list_24, - chan_index_24 * sizeof(*pcl_channels)); - *len = chan_index_24; - for (i = 0; i < chan_index_24; i++) - pcl_weights[i] = WEIGHT_OF_GROUP1_PCL_CHANNELS; - policy_mgr_get_connection_channels( - psoc, mode, - channel_list, &num_channels, POLICY_MGR_PCL_ORDER_NONE, - skip_dfs_channel, pcl_weights, weight_len, &i, - POLICY_MGR_PCL_GROUP_ID2_ID3); - qdf_mem_copy(&pcl_channels[chan_index_24], channel_list, - num_channels * sizeof(*pcl_channels)); - *len += num_channels; + policy_mgr_add_24g_to_pcl(pcl_channels, pcl_weights, pcl_sz, + len, WEIGHT_OF_GROUP1_PCL_CHANNELS, + channel_list_24, chan_index_24); + policy_mgr_get_connection_channels(psoc, mode, + POLICY_MGR_PCL_ORDER_NONE, + skip_dfs_channel, + POLICY_MGR_PCL_GROUP_ID2_ID3, + pcl_channels, pcl_weights, + pcl_sz, len); status = QDF_STATUS_SUCCESS; break; case PM_5G_SCC_CH: case PM_5G_MCC_CH: - policy_mgr_add_5g_to_pcl( - psoc, pcl_channels, len, - pcl_weights, weight_len, - &i, - POLICY_MGR_PCL_GROUP_ID1_ID2, - channel_list_5, chan_index_5, - channel_list_6, chan_index_6); - - policy_mgr_get_connection_channels( - psoc, mode, - channel_list, &num_channels, POLICY_MGR_PCL_ORDER_NONE, - skip_dfs_channel, pcl_weights, weight_len, &i, - POLICY_MGR_PCL_GROUP_ID3_ID4); - qdf_mem_copy(&pcl_channels[*len], channel_list, - num_channels * sizeof(*pcl_channels)); - *len += num_channels; + policy_mgr_add_5g_to_pcl(psoc, pcl_channels, pcl_weights, + pcl_sz, len, + POLICY_MGR_PCL_GROUP_ID1_ID2, + channel_list_5, chan_index_5, + channel_list_6, chan_index_6); + policy_mgr_get_connection_channels(psoc, mode, + POLICY_MGR_PCL_ORDER_NONE, + skip_dfs_channel, + POLICY_MGR_PCL_GROUP_ID3_ID4, + pcl_channels, pcl_weights, + pcl_sz, len); status = QDF_STATUS_SUCCESS; break; case PM_SCC_ON_24_SCC_ON_5: policy_mgr_get_connection_channels( - psoc, mode, - channel_list, &num_channels, - POLICY_MGR_PCL_ORDER_24G_THEN_5G, - skip_dfs_channel, pcl_weights, weight_len, &i, - POLICY_MGR_PCL_GROUP_ID1_ID2); - qdf_mem_copy(pcl_channels, channel_list, - num_channels * sizeof(*pcl_channels)); - *len = num_channels; + psoc, mode, + POLICY_MGR_PCL_ORDER_24G_THEN_5G, + skip_dfs_channel, + POLICY_MGR_PCL_GROUP_ID1_ID2, + pcl_channels, pcl_weights, pcl_sz, len); status = QDF_STATUS_SUCCESS; break; case PM_SCC_ON_5_SCC_ON_24: policy_mgr_get_connection_channels( - psoc, mode, - channel_list, &num_channels, - POLICY_MGR_PCL_ORDER_5G_THEN_2G, - skip_dfs_channel, pcl_weights, weight_len, &i, - POLICY_MGR_PCL_GROUP_ID1_ID2); - qdf_mem_copy(pcl_channels, channel_list, - num_channels * sizeof(*pcl_channels)); - *len = num_channels; + psoc, mode, + POLICY_MGR_PCL_ORDER_5G_THEN_2G, + skip_dfs_channel, + POLICY_MGR_PCL_GROUP_ID1_ID2, + pcl_channels, pcl_weights, pcl_sz, len); status = QDF_STATUS_SUCCESS; break; case PM_SCC_ON_24_SCC_ON_5_24G: policy_mgr_get_connection_channels( - psoc, mode, - channel_list, &num_channels, - POLICY_MGR_PCL_ORDER_24G_THEN_5G, - skip_dfs_channel, pcl_weights, weight_len, &i, - POLICY_MGR_PCL_GROUP_ID1_ID2); - qdf_mem_copy(pcl_channels, channel_list, - num_channels * sizeof(*pcl_channels)); - *len = num_channels; - chan_index_24 = QDF_MIN((num_channels + chan_index_24), - weight_len) - num_channels; - qdf_mem_copy(&pcl_channels[num_channels], channel_list_24, - chan_index_24 * sizeof(*pcl_channels)); - *len += chan_index_24; - for (j = 0; j < chan_index_24; i++, j++) - pcl_weights[i] = WEIGHT_OF_GROUP3_PCL_CHANNELS; + psoc, mode, + POLICY_MGR_PCL_ORDER_24G_THEN_5G, + skip_dfs_channel, + POLICY_MGR_PCL_GROUP_ID1_ID2, + pcl_channels, pcl_weights, pcl_sz, len); + policy_mgr_add_24g_to_pcl(pcl_channels, pcl_weights, pcl_sz, + len, WEIGHT_OF_GROUP3_PCL_CHANNELS, + channel_list_24, chan_index_24); status = QDF_STATUS_SUCCESS; break; case PM_SCC_ON_24_SCC_ON_5_5G: policy_mgr_get_connection_channels( - psoc, mode, - channel_list, &num_channels, - POLICY_MGR_PCL_ORDER_24G_THEN_5G, - skip_dfs_channel, pcl_weights, weight_len, &i, - POLICY_MGR_PCL_GROUP_ID1_ID2); - qdf_mem_copy(pcl_channels, channel_list, - num_channels * sizeof(*pcl_channels)); - *len = num_channels; - policy_mgr_add_5g_to_pcl( - psoc, &pcl_channels[num_channels], len, - pcl_weights, weight_len, - &i, - POLICY_MGR_PCL_GROUP_ID3_ID4, - channel_list_5, chan_index_5, - channel_list_6, chan_index_6); + psoc, mode, + POLICY_MGR_PCL_ORDER_24G_THEN_5G, + skip_dfs_channel, + POLICY_MGR_PCL_GROUP_ID1_ID2, + pcl_channels, pcl_weights, pcl_sz, len); + policy_mgr_add_5g_to_pcl(psoc, pcl_channels, pcl_weights, + pcl_sz, len, + POLICY_MGR_PCL_GROUP_ID3_ID4, + channel_list_5, chan_index_5, + channel_list_6, chan_index_6); status = QDF_STATUS_SUCCESS; break; case PM_SCC_ON_5_SCC_ON_24_24G: policy_mgr_get_connection_channels( - psoc, mode, - channel_list, &num_channels, - POLICY_MGR_PCL_ORDER_5G_THEN_2G, - skip_dfs_channel, pcl_weights, weight_len, &i, - POLICY_MGR_PCL_GROUP_ID1_ID2); - qdf_mem_copy(pcl_channels, channel_list, - num_channels * sizeof(*pcl_channels)); - *len = num_channels; - chan_index_24 = QDF_MIN((num_channels + chan_index_24), - weight_len) - num_channels; - qdf_mem_copy(&pcl_channels[num_channels], channel_list_24, - chan_index_24 * sizeof(*pcl_channels)); - *len += chan_index_24; - for (j = 0; j < chan_index_24; i++, j++) - pcl_weights[i] = WEIGHT_OF_GROUP3_PCL_CHANNELS; + psoc, mode, + POLICY_MGR_PCL_ORDER_5G_THEN_2G, + skip_dfs_channel, + POLICY_MGR_PCL_GROUP_ID1_ID2, + pcl_channels, pcl_weights, pcl_sz, len); + policy_mgr_add_24g_to_pcl(pcl_channels, pcl_weights, pcl_sz, + len, WEIGHT_OF_GROUP3_PCL_CHANNELS, + channel_list_24, chan_index_24); status = QDF_STATUS_SUCCESS; break; case PM_SCC_ON_5_SCC_ON_24_5G: policy_mgr_get_connection_channels( - psoc, mode, - channel_list, &num_channels, - POLICY_MGR_PCL_ORDER_5G_THEN_2G, - skip_dfs_channel, pcl_weights, weight_len, &i, - POLICY_MGR_PCL_GROUP_ID1_ID2); - qdf_mem_copy(pcl_channels, channel_list, - num_channels * sizeof(*pcl_channels)); - *len = num_channels; - policy_mgr_add_5g_to_pcl( - psoc, &pcl_channels[num_channels], len, - pcl_weights, weight_len, - &i, - POLICY_MGR_PCL_GROUP_ID3_ID4, - channel_list_5, chan_index_5, - channel_list_6, chan_index_6); + psoc, mode, + POLICY_MGR_PCL_ORDER_5G_THEN_2G, + skip_dfs_channel, + POLICY_MGR_PCL_GROUP_ID1_ID2, + pcl_channels, pcl_weights, pcl_sz, len); + policy_mgr_add_5g_to_pcl(psoc, pcl_channels, pcl_weights, + pcl_sz, len, + POLICY_MGR_PCL_GROUP_ID3_ID4, + channel_list_5, chan_index_5, + channel_list_6, chan_index_6); status = QDF_STATUS_SUCCESS; break; case PM_24G_SCC_CH_SBS_CH: - qdf_mem_copy(pcl_channels, channel_list_24, - chan_index_24 * sizeof(*pcl_channels)); - *len = chan_index_24; - for (i = 0; ((i < chan_index_24) && (i < weight_len)); i++) - pcl_weights[i] = WEIGHT_OF_GROUP1_PCL_CHANNELS; - policy_mgr_get_connection_channels( - psoc, mode, - channel_list, &num_channels, POLICY_MGR_PCL_ORDER_NONE, - skip_dfs_channel, pcl_weights, weight_len, &i, - POLICY_MGR_PCL_GROUP_ID2_ID3); - qdf_mem_copy(&pcl_channels[chan_index_24], channel_list, - num_channels * sizeof(*pcl_channels)); - *len += num_channels; - if (policy_mgr_is_hw_sbs_capable(psoc)) { - policy_mgr_get_sbs_channels( - sbs_channel_list, &sbs_num_channels, pcl_weights, - weight_len, &i, POLICY_MGR_PCL_GROUP_ID3_ID4, - channel_list_5, chan_index_5, false); - qdf_mem_copy( - &pcl_channels[chan_index_24 + num_channels], - sbs_channel_list, - sbs_num_channels * sizeof(*pcl_channels)); - *len += sbs_num_channels; - } + policy_mgr_add_24g_to_pcl(pcl_channels, pcl_weights, pcl_sz, + len, WEIGHT_OF_GROUP1_PCL_CHANNELS, + channel_list_24, chan_index_24); + + policy_mgr_get_connection_channels(psoc, mode, + POLICY_MGR_PCL_ORDER_NONE, + skip_dfs_channel, + POLICY_MGR_PCL_GROUP_ID2_ID3, + pcl_channels, pcl_weights, + pcl_sz, len); + + policy_mgr_get_sbs_channels(psoc, pcl_channels, pcl_weights, + pcl_sz, len, + POLICY_MGR_PCL_GROUP_ID3_ID4, + channel_list_5, chan_index_5, + false); status = QDF_STATUS_SUCCESS; break; case PM_24G_SCC_CH_SBS_CH_5G: - qdf_mem_copy(pcl_channels, channel_list_24, - chan_index_24 * sizeof(*pcl_channels)); - *len = chan_index_24; - for (i = 0; ((i < chan_index_24) && (i < weight_len)); i++) - pcl_weights[i] = WEIGHT_OF_GROUP1_PCL_CHANNELS; + policy_mgr_add_24g_to_pcl(pcl_channels, pcl_weights, pcl_sz, + len, WEIGHT_OF_GROUP1_PCL_CHANNELS, + channel_list_24, chan_index_24); policy_mgr_get_connection_channels( - psoc, mode, - channel_list, &num_channels, POLICY_MGR_PCL_ORDER_NONE, - skip_dfs_channel, pcl_weights, weight_len, &i, - POLICY_MGR_PCL_GROUP_ID2_ID3); - qdf_mem_copy(&pcl_channels[chan_index_24], channel_list, - num_channels * sizeof(*pcl_channels)); - *len += num_channels; + psoc, mode, + POLICY_MGR_PCL_ORDER_NONE, + skip_dfs_channel, + POLICY_MGR_PCL_GROUP_ID2_ID3, + pcl_channels, pcl_weights, + pcl_sz, len); if (policy_mgr_is_hw_sbs_capable(psoc)) { policy_mgr_get_sbs_channels( - sbs_channel_list, &sbs_num_channels, pcl_weights, - weight_len, &i, POLICY_MGR_PCL_GROUP_ID3_ID4, - channel_list_5, chan_index_5, true); - qdf_mem_copy( - &pcl_channels[chan_index_24 + num_channels], - sbs_channel_list, - sbs_num_channels * sizeof(*pcl_channels)); - *len += sbs_num_channels; + psoc, pcl_channels, + pcl_weights, pcl_sz, len, + POLICY_MGR_PCL_GROUP_ID3_ID4, + channel_list_5, chan_index_5, + true); } else { - policy_mgr_add_5g_to_pcl( - psoc, - &pcl_channels[chan_index_24 + num_channels], - len, - pcl_weights, weight_len, - &i, - POLICY_MGR_PCL_GROUP_ID3_ID4, - channel_list_5, chan_index_5, - channel_list_6, chan_index_6); + policy_mgr_add_5g_to_pcl(psoc, pcl_channels, + pcl_weights, pcl_sz, len, + POLICY_MGR_PCL_GROUP_ID3_ID4, + channel_list_5, chan_index_5, + channel_list_6, chan_index_6); } status = QDF_STATUS_SUCCESS; break; case PM_24G_SBS_CH_MCC_CH: - qdf_mem_copy(pcl_channels, channel_list_24, - chan_index_24 * sizeof(*pcl_channels)); - *len = chan_index_24; - for (i = 0; ((i < chan_index_24) && (i < weight_len)); i++) - pcl_weights[i] = WEIGHT_OF_GROUP1_PCL_CHANNELS; + policy_mgr_add_24g_to_pcl(pcl_channels, pcl_weights, pcl_sz, + len, WEIGHT_OF_GROUP1_PCL_CHANNELS, + channel_list_24, chan_index_24); if (policy_mgr_is_hw_sbs_capable(psoc)) { policy_mgr_get_sbs_channels( - sbs_channel_list, &sbs_num_channels, pcl_weights, - weight_len, &i, POLICY_MGR_PCL_GROUP_ID2_ID3, - channel_list_5, chan_index_5, false); - qdf_mem_copy(&pcl_channels[num_channels], - sbs_channel_list, - sbs_num_channels * sizeof(*pcl_channels)); - *len += sbs_num_channels; + psoc, pcl_channels, + pcl_weights, + pcl_sz, len, + POLICY_MGR_PCL_GROUP_ID2_ID3, + channel_list_5, chan_index_5, + false); } policy_mgr_get_connection_channels( - psoc, mode, - channel_list, &num_channels, POLICY_MGR_PCL_ORDER_NONE, - skip_dfs_channel, pcl_weights, weight_len, &i, - POLICY_MGR_PCL_GROUP_ID2_ID3); - qdf_mem_copy(&pcl_channels[chan_index_24], channel_list, - num_channels * sizeof(*pcl_channels)); - *len += num_channels; + psoc, mode, + POLICY_MGR_PCL_ORDER_NONE, + skip_dfs_channel, + POLICY_MGR_PCL_GROUP_ID2_ID3, + pcl_channels, pcl_weights, + pcl_sz, len); status = QDF_STATUS_SUCCESS; break; case PM_SBS_CH_5G: if (policy_mgr_is_hw_sbs_capable(psoc)) { policy_mgr_get_sbs_channels( - sbs_channel_list, &sbs_num_channels, pcl_weights, - weight_len, &i, POLICY_MGR_PCL_GROUP_ID1_ID2, - channel_list_5, chan_index_5, true); - qdf_mem_copy(&pcl_channels[num_channels], - sbs_channel_list, - sbs_num_channels * sizeof(*pcl_channels)); - *len += sbs_num_channels; - } else { - policy_mgr_add_5g_to_pcl( - psoc, - pcl_channels, - len, - pcl_weights, weight_len, - &i, + psoc, pcl_channels, + pcl_weights, pcl_sz, len, POLICY_MGR_PCL_GROUP_ID1_ID2, - channel_list_5, chan_index_5, - channel_list_6, chan_index_6); + channel_list_5, chan_index_5, true); + } else { + policy_mgr_add_5g_to_pcl(psoc, pcl_channels, + pcl_weights, pcl_sz, len, + POLICY_MGR_PCL_GROUP_ID1_ID2, + channel_list_5, chan_index_5, + channel_list_6, chan_index_6); } status = QDF_STATUS_SUCCESS; break; @@ -2722,10 +2695,10 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, if ((mode == PM_SAP_MODE) || (mode == PM_P2P_GO_MODE)) policy_mgr_update_with_safe_channel_list(psoc, pcl_channels, len, pcl_weights, - weight_len); + pcl_sz); policy_mgr_set_weight_of_dfs_passive_channels_to_zero(psoc, - pcl_channels, len, pcl_weights, weight_len); + pcl_channels, len, pcl_weights, pcl_sz); end: qdf_mem_free(channel_list); qdf_mem_free(channel_list_24); diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h index e70b599e774b..4caca995244f 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h @@ -571,11 +571,32 @@ void pm_dbs_opportunistic_timer_handler(void *data); enum policy_mgr_con_mode policy_mgr_get_mode(uint8_t type, uint8_t subtype); +/** + * policy_mgr_get_bw() - Convert phy_ch_width to hw_mode_bandwidth. + * @chan_width: phy_ch_width + * + * Return: hw_mode_bandwidth + */ +enum hw_mode_bandwidth policy_mgr_get_bw(enum phy_ch_width chan_width); + +/** + * policy_mgr_get_channel_list() - Get channel list based on PCL and mode + * @psoc: psoc object + * @pcl: pcl type + * @mode: interface mode + * @pcl_channels: pcl channel list buffer + * @pcl_weights: pcl weight buffer + * @pcl_sz: pcl channel list buffer size + * @len: pcl channel number returned from API + * + * Return: QDF_STATUS + */ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_pcl_type pcl, - uint32_t *pcl_channels, uint32_t *len, - enum policy_mgr_con_mode mode, - uint8_t *pcl_weights, uint32_t weight_len); + enum policy_mgr_pcl_type pcl, + enum policy_mgr_con_mode mode, + uint32_t *pcl_channels, + uint8_t *pcl_weights, + uint32_t pcl_sz, uint32_t *len); /** * policy_mgr_allow_new_home_channel() - Check for allowed number of diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c index 5be8fa6d3e8d..1ee749afad46 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c @@ -1022,8 +1022,8 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, /* once the PCL enum is obtained find out the exact channel list with * help from sme_get_cfg_valid_channels */ - status = policy_mgr_get_channel_list(psoc, pcl, pcl_channels, len, mode, - pcl_weight, weight_len); + status = policy_mgr_get_channel_list(psoc, pcl, mode, pcl_channels, + pcl_weight, weight_len, len); if (QDF_IS_STATUS_ERROR(status)) { policy_mgr_err("failed to get channel list:%d", status); return status; From a940093bbe312b166a4a289f8241fb0c1443a9e5 Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Thu, 9 Feb 2023 07:10:14 -0800 Subject: [PATCH 15/26] Release 2.0.8.32P Release 2.0.8.32P Change-Id: Iae4a5777f785018090d31d99e8b2fd3ce9ba7887 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 6e0522160b5a..5b19522dcc21 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "O" +#define QWLAN_VERSION_EXTRA "P" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "2.0.8.32O" +#define QWLAN_VERSIONSTR "2.0.8.32P" #endif /* QWLAN_VERSION_H */ From 996818009b5444b4c453c1dc7d0a26ed697bdc16 Mon Sep 17 00:00:00 2001 From: sheenam monga Date: Fri, 28 Jan 2022 00:07:57 +0530 Subject: [PATCH 16/26] qcacld-3.0: change weighed_valid_list to 0 for non-pcl entries In function wlan_hdd_populate_weigh_pcl weight is populated to 0 only if weighed_valid_list is 0 otherwise weight of non-pcl entries will be populated as 20 less than weight of last pcl entry but weighed_valid_list is set to 1 in policy_mgr_get_valid_chan_weights. So, non-pcl entries are also sent to upper layer. Fix is to change weighed_valid_list to 0, if there is existing p2p connection. Change-Id: Ic0d86021c00fd95e5bc20eeabea56e2a69658599 CRs-Fixed: 3140467 --- .../policy_mgr/src/wlan_policy_mgr_pcl.c | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c index 1ee749afad46..f2569eb908cc 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c @@ -2695,7 +2695,7 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc, if ((mode == PM_P2P_GO_MODE || mode == PM_P2P_CLIENT_MODE) || (mode == PM_STA_MODE && policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE, - NULL) > 0)) { + NULL))) { /* * Store the STA mode's parameter and temporarily delete it * from the concurrency table. This way the allow concurrency @@ -2714,10 +2714,22 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc, for (i = 0; i < weight->saved_num_chan; i++) { if (policy_mgr_is_concurrency_allowed (psoc, mode, weight->saved_chan_list[i], - HW_MODE_20_MHZ)) { + HW_MODE_20_MHZ) && + (policy_mgr_mode_specific_connection_count + (psoc, PM_P2P_GO_MODE, NULL) || + policy_mgr_mode_specific_connection_count + (psoc, PM_P2P_CLIENT_MODE, NULL)) && + policy_mgr_go_scc_enforced(psoc)) + /* + * For two port/three port connection where if one p2p + * connection is already present and force scc is enabled + * then enforce Go negotiation channels to be strictly + * based on PCL list. + */ + weight->weighed_valid_list[i] = 0; + else weight->weighed_valid_list[i] = - WEIGHT_OF_NON_PCL_CHANNELS; - } + WEIGHT_OF_NON_PCL_CHANNELS; } /* Restore the connection info */ if (mode == PM_STA_MODE) From d5e8a8be8cefbf083c008a4348f34e48f9453cbe Mon Sep 17 00:00:00 2001 From: Sheenam Monga Date: Tue, 31 May 2022 19:16:56 +0530 Subject: [PATCH 17/26] qcacld-3.0: Don't add duplicate frequencies in pcl list Currently if SCC frequencies are added in pcl list and rest 5 GHz frequencies are required to be added with lesser weightage then all 5 GHz/6 GHz frequencies are added including SCC channels. so in pcl duplicate entries are found for SCC frequencies with different weightage. Fix is not to add SCC frequencies during addition of 5 GHz/6 GHz frequencies if SCC frequencies are already present in pcl. Change-Id: I03123e4bf8caee62b0fcd0c3ae78d6cd7187c7de CRs-Fixed: 3209858 --- .../policy_mgr/src/wlan_policy_mgr_core.c | 42 +++++++++++++++---- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c index 939ef9870d60..654c4a41065e 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c @@ -2191,6 +2191,19 @@ void policy_mgr_set_weight_of_dfs_passive_channels_to_zero( return; } +static bool is_freq_present_in_pcl(uint32_t idx, uint32_t *pcl_freqs, + uint32_t chanlist_freq) +{ + uint32_t i; + + for (i = 0; i < idx; i++) { + if (pcl_freqs[i] == chanlist_freq) + return true; + } + + return false; +} + /** * policy_mgr_add_5g_to_pcl() - add the 5G/6G channels into PCL * @psoc: psoc object @@ -2218,6 +2231,7 @@ policy_mgr_add_5g_to_pcl(struct wlan_objmgr_psoc *psoc, uint32_t *pcl_freqs, uint32_t weight1, weight2; const uint32_t *chlist1; uint8_t chlist1_len; + uint8_t list_len = 0; const uint32_t *chlist2; uint8_t chlist2_len; uint32_t i; @@ -2257,22 +2271,32 @@ policy_mgr_add_5g_to_pcl(struct wlan_objmgr_psoc *psoc, uint32_t *pcl_freqs, pcl_sz, chlist1_len, idx); return; } - qdf_mem_copy(&pcl_freqs[idx], chlist1, chlist1_len * sizeof(*chlist1)); - for (i = 0; i < chlist1_len; i++) - pcl_weights[idx++] = weight1; + for (i = 0; i < chlist1_len; i++) { + if (is_freq_present_in_pcl(idx, pcl_freqs, chlist1[i])) + continue; + pcl_freqs[idx] = chlist1[i]; + pcl_weights[idx] = weight1; + idx++; + list_len++; + } - len += chlist1_len; + len += list_len; if ((chlist2_len + idx) > pcl_sz) { policy_mgr_err("no enough weight len chlist2_len %d %d %d", pcl_sz, chlist2_len, idx); return; } - qdf_mem_copy(&pcl_freqs[idx], chlist2, - chlist2_len * sizeof(*chlist2)); - for (i = 0; i < chlist2_len; i++) - pcl_weights[idx++] = weight2; - len += chlist2_len; + list_len = 0; + for (i = 0; i < chlist2_len; i++) { + if (is_freq_present_in_pcl(idx, pcl_freqs, chlist2[i])) + continue; + pcl_freqs[idx] = chlist2[i]; + pcl_weights[idx] = weight2; + idx++; + list_len++; + } + len += list_len; *index = idx; policy_mgr_debug("Add 5g chlist len %d 6g chlist len %d len %d index %d order %d", From 9ac7bc111bf89707ac1aada12bfa8f97a7dfdcb6 Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Mon, 13 Feb 2023 11:59:41 -0800 Subject: [PATCH 18/26] Release 2.0.8.32Q Release 2.0.8.32Q Change-Id: I2aa8ce758dfc46b9da5665e3735f5d4231f01607 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 5b19522dcc21..80d6f29ed0fc 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "P" +#define QWLAN_VERSION_EXTRA "Q" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "2.0.8.32P" +#define QWLAN_VERSIONSTR "2.0.8.32Q" #endif /* QWLAN_VERSION_H */ From 5298c51bdddf9ba76d4a0fabc2b3362e65dbb157 Mon Sep 17 00:00:00 2001 From: abhinav kumar Date: Thu, 17 Nov 2022 15:42:06 +0530 Subject: [PATCH 19/26] qcacld-3.0: Dont issue disconnect on STA while start/stop SAP Currently, our host logic is "If an STA connection is in progress in another adapter, driver disconnects the STA and completes the SAP operation (start BSS or stop BSS)". This is due to below reasons: In the old kernel version and for STA+SAP concurrency support from GUI, the first STA connection gets triggered and while it is in progress, SAP start/stop also comes up. Once STA association is successful, the STA connect event is sent to the kernel which gets queued in the kernel workqueue and the supplicant won't process M1 received from AP and send M2 until this NL80211_CONNECT event is received. Workqueue is not scheduled as RTNL lock is already taken by hostapd thread which has issued start_bss/stop_bss command to the driver. The driver cannot complete start_bss/stop_bss as the pending command at the head of the SME command pending list is hw_mode_update for STA session which cannot be processed as SME is in WAITforKey state for STA interface. The start_bss/stop_bss command for SAP interface is queued behind the hw_mode_update command and so it cannot be processed until hw_mode_update command is processed. This is causing a deadlock so disconnect the STA interface first if a connection or key exchange is in progress and then start or stop the SAP interface. As part of connection mgr changes, removed dependency on WAITforKey state in serialization, and h/w mode also is not sent immediately after the STA connection, So no possibility of the above deadlock scenario. The fix is to avoid disconnection on the STA interface during the start or stop of the SAP interface. Change-Id: Iad3ada091e505007cc6901a461be3b88fc051f4e CRs-Fixed: 3339784 --- core/hdd/src/wlan_hdd_assoc.c | 16 ++-------------- core/hdd/src/wlan_hdd_hostapd.c | 25 ------------------------- 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 67f3e1f93559..7fd32192150a 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -165,7 +165,7 @@ u8 ccp_rsn_oui_13[HDD_RSN_OUI_SIZE] = {0x50, 0x6F, 0x9A, 0x01}; #define HDD_PEER_AUTHORIZE_WAIT 10 -/** +/* * beacon_filter_table - table of IEs used for beacon filtering */ static const int beacon_filter_table[] = { @@ -434,18 +434,6 @@ struct hdd_adapter *hdd_get_sta_connection_in_progress( hdd_adapter_dev_put_debug(next_adapter, dbgid); return adapter; - } else if ((eConnectionState_Associated == - hdd_sta_ctx->conn_info.conn_state) && - sme_is_sta_key_exchange_in_progress( - hdd_ctx->mac_handle, - adapter->vdev_id)) { - hdd_debug("vdev_id %d: Key exchange is in progress", - adapter->vdev_id); - hdd_adapter_dev_put_debug(adapter, dbgid); - if (next_adapter) - hdd_adapter_dev_put_debug(next_adapter, - dbgid); - return adapter; } } hdd_adapter_dev_put_debug(adapter, dbgid); diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index dde93a5872cb..d1d8318f2802 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -5273,24 +5273,6 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter, return -EINVAL; } } - /* - * For STA+SAP concurrency support from GUI, first STA connection gets - * triggered and while it is in progress, SAP start also comes up. - * Once STA association is successful, STA connect event is sent to - * kernel which gets queued in kernel workqueue and supplicant won't - * process M1 received from AP and send M2 until this NL80211_CONNECT - * event is received. Workqueue is not scheduled as RTNL lock is already - * taken by hostapd thread which has issued start_bss command to driver. - * Driver cannot complete start_bss as the pending command at the head - * of the SME command pending list is hw_mode_update for STA session - * which cannot be processed as SME is in WAITforKey state for STA - * interface. The start_bss command for SAP interface is queued behind - * the hw_mode_update command and so it cannot be processed until - * hw_mode_update command is processed. This is causing a deadlock so - * disconnect the STA interface first if connection or key exchange is - * in progress and then start SAP interface. - */ - hdd_abort_ongoing_sta_connection(hdd_ctx); mac_handle = hdd_ctx->mac_handle; @@ -6070,13 +6052,6 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy, hdd_debug("Device_mode %s(%d)", qdf_opmode_str(adapter->device_mode), adapter->device_mode); - /* - * If a STA connection is in progress in another adapter, disconnect - * the STA and complete the SAP operation. STA will reconnect - * after SAP stop is done. - */ - hdd_abort_ongoing_sta_connection(hdd_ctx); - if (adapter->device_mode == QDF_SAP_MODE) { wlan_hdd_del_station(adapter); mac_handle = hdd_ctx->mac_handle; From 29620f09ddbc6caa8f8b89530cc157c6f8cb6f7b Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Fri, 24 Feb 2023 11:18:18 -0800 Subject: [PATCH 20/26] Release 2.0.8.32R Release 2.0.8.32R Change-Id: Id0cbe4ad945012993983d04209b646a34e304827 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 80d6f29ed0fc..aea31a5f4d54 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "Q" +#define QWLAN_VERSION_EXTRA "R" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "2.0.8.32Q" +#define QWLAN_VERSIONSTR "2.0.8.32R" #endif /* QWLAN_VERSION_H */ From 55fba4768d475f3f77588b9fe4a737ec7b053259 Mon Sep 17 00:00:00 2001 From: Pragaspathi Thilagaraj Date: Fri, 3 Feb 2023 13:55:49 +0530 Subject: [PATCH 21/26] qcacld-3.0: Defer messages to LIM during peer create Before sending peer create command to firmware, defer the messages to LIM so that peer create confirm event is protected from disconnect. If the messages are not defered, disconnect gets processed and the lim timers are not aborted as part of disconnect sequence and back to back connect followed by disconnect causes ANR Defer the LIM messages during peer create and allow the messages after peer create confirm is received. Change-Id: Ifffbb4897a4fa85dd83c94eb84be72295905b785 CRs-Fixed: 3421721 --- .../src/pe/lim/lim_process_mlm_req_messages.c | 18 ++++++++++++++++-- core/wma/src/wma_dev_if.c | 4 +++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c index 68196860b5d6..6234e3a2e836 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -356,6 +356,11 @@ lim_post_join_set_link_state_callback(struct mac_context *mac, uint32_t vdev_id, tLimMlmJoinCnf mlm_join_cnf; struct pe_session *session_entry; + /* + * Allow defered messages after peer create response + */ + SET_LIM_PROCESS_DEFD_MESGS(mac, true); + session_entry = pe_find_session_by_vdev_id(mac, vdev_id); if (!session_entry) { pe_err("vdev_id:%d PE session is NULL", vdev_id); @@ -406,13 +411,22 @@ static void lim_process_mlm_post_join_suspend_link(struct mac_context *mac_ctx, struct pe_session *session) { + QDF_STATUS status; + lim_deactivate_and_change_timer(mac_ctx, eLIM_JOIN_FAIL_TIMER); /* assign appropriate sessionId to the timer object */ mac_ctx->lim.lim_timers.gLimJoinFailureTimer.sessionId = session->peSessionId; - wma_add_bss_peer_sta(session->vdev_id, session->bssId, true); + /* + * Defer msgs to LIM till peer create confirm event is received + */ + SET_LIM_PROCESS_DEFD_MESGS(mac_ctx, false); + status = wma_add_bss_peer_sta(session->vdev_id, session->bssId, true); + if (status == QDF_STATUS_E_RESOURCES) + SET_LIM_PROCESS_DEFD_MESGS(mac_ctx, true); + } /** diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index f0f92e08802a..73d883382974 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1924,6 +1924,7 @@ wma_create_sta_mode_bss_peer(tp_wma_handle wma, if (!mac) { wma_err("vdev%d: Mac context is null", vdev_id); + status = QDF_STATUS_E_RESOURCES; return status; } @@ -5339,6 +5340,7 @@ QDF_STATUS wma_add_bss_peer_sta(uint8_t vdev_id, uint8_t *bssid, wma = cds_get_context(QDF_MODULE_ID_WMA); if (!wma) { wma_err("Invalid wma"); + status = QDF_STATUS_E_RESOURCES; goto err; } From 682543e640d686b34222e63a188388471e0522f0 Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Thu, 2 Mar 2023 11:03:47 -0800 Subject: [PATCH 22/26] Release 2.0.8.32S Release 2.0.8.32S Change-Id: Id9222622ca2cd5e4821695e997d933124c345102 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index aea31a5f4d54..0cd928499b0b 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "R" +#define QWLAN_VERSION_EXTRA "S" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "2.0.8.32R" +#define QWLAN_VERSIONSTR "2.0.8.32S" #endif /* QWLAN_VERSION_H */ From be0dd236406c80b84bd1585931e4848d1595f540 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Myadam Date: Thu, 22 Sep 2022 15:19:00 +0530 Subject: [PATCH 23/26] qcacld-3.0: Fix to pre CAC interface clean up If is_pre_cac_on is set, in __wlan_hdd_del_virtual_intf firstly frees the sap context by calling hdd_clean_up_interface and then frees the pre cac by calling hdd_clean_up_pre_cac_interface this will fails to access the sap context which is already freed. So, replace order of calling, firstly hdd_clean_up_pre_cac_interface and then hdd_clean_up_interface. cds flush work will cancel the work which will not delete the pre cac vdev. Replace with qdf_flush_work will wait for a work to finish, executing the last queueing instance. Assign NULL to fn and arg of pre cac work to ensure proper cleanup of work. Change-Id: I093bf627ce7a73e7c4f7c4cf30e2ec56814a80ed CRs-Fixed: 3286477 --- core/hdd/src/wlan_hdd_main.c | 17 +++++++++++++---- core/hdd/src/wlan_hdd_p2p.c | 2 +- core/hdd/src/wlan_hdd_sap_cond_chan_switch.c | 3 ++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 1c010f73e6df..69500ce5819f 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -7242,12 +7242,13 @@ static void hdd_close_pre_cac_adapter(struct hdd_context *hdd_ctx) SAP_PRE_CAC_IFNAME); if (!pre_cac_adapter) return; + hdd_ctx->sap_pre_cac_work.fn = NULL; + hdd_ctx->sap_pre_cac_work.arg = NULL; errno = osif_vdev_sync_trans_start_wait(pre_cac_adapter->dev, &vdev_sync); if (errno) return; - osif_vdev_sync_unregister(pre_cac_adapter->dev); osif_vdev_sync_wait_for_ops(vdev_sync); @@ -7475,7 +7476,7 @@ QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx, sap_ctx = WLAN_HDD_GET_SAP_CTX_PTR(adapter); if (!wlan_sap_is_pre_cac_context(sap_ctx) && (hdd_ctx->sap_pre_cac_work.fn)) - cds_flush_work(&hdd_ctx->sap_pre_cac_work); + qdf_flush_work(&hdd_ctx->sap_pre_cac_work); hdd_close_pre_cac_adapter(hdd_ctx); @@ -7652,7 +7653,7 @@ QDF_STATUS hdd_stop_all_adapters(struct hdd_context *hdd_ctx) hdd_enter(); if (hdd_ctx->sap_pre_cac_work.fn) - cds_flush_work(&hdd_ctx->sap_pre_cac_work); + qdf_flush_work(&hdd_ctx->sap_pre_cac_work); hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter, NET_DEV_HOLD_STOP_ALL_ADAPTERS) { @@ -18156,6 +18157,7 @@ void hdd_clean_up_pre_cac_interface(struct hdd_context *hdd_ctx) uint8_t vdev_id; QDF_STATUS status; struct hdd_adapter *precac_adapter; + struct sap_context *sap_ctx; status = wlan_sap_get_pre_cac_vdev_id(hdd_ctx->mac_handle, &vdev_id); if (QDF_IS_STATUS_ERROR(status)) { @@ -18169,6 +18171,13 @@ void hdd_clean_up_pre_cac_interface(struct hdd_context *hdd_ctx) return; } + sap_ctx = WLAN_HDD_GET_SAP_CTX_PTR(precac_adapter); + if (wlan_sap_is_pre_cac_context(sap_ctx) && + hdd_ctx->sap_pre_cac_work.fn) { + hdd_debug("pre_cac_work already scheduled"); + return; + } + qdf_create_work(0, &hdd_ctx->sap_pre_cac_work, wlan_hdd_sap_pre_cac_failure, (void *)precac_adapter); diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index d947d31a71d0..4743ce81ba2a 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -960,8 +960,8 @@ int __wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev) if (adapter->device_mode == QDF_SAP_MODE && wlan_sap_is_pre_cac_active(hdd_ctx->mac_handle)) { - hdd_clean_up_interface(hdd_ctx, adapter); hdd_clean_up_pre_cac_interface(hdd_ctx); + hdd_clean_up_interface(hdd_ctx, adapter); } else if (wlan_hdd_is_session_type_monitor( adapter->device_mode) && ucfg_pkt_capture_get_mode(hdd_ctx->psoc) != diff --git a/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c b/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c index 7eb6d637e1e1..4230c92baaaa 100644 --- a/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c +++ b/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -255,7 +256,7 @@ static int __wlan_hdd_request_pre_cac(struct hdd_context *hdd_ctx, if (pre_cac_adapter) { /* Flush existing pre_cac work */ if (hdd_ctx->sap_pre_cac_work.fn) - cds_flush_work(&hdd_ctx->sap_pre_cac_work); + qdf_flush_work(&hdd_ctx->sap_pre_cac_work); } else { if (policy_mgr_get_connection_count(hdd_ctx->psoc) > 1) { hdd_err("pre cac not allowed in concurrency"); From f766bd47ee8e66706710255fb640d6204b446591 Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Mon, 6 Mar 2023 23:12:40 -0800 Subject: [PATCH 24/26] Release 2.0.8.32T Release 2.0.8.32T Change-Id: Ic1c61a7e9bd5f9f4bb29dbcfb3f11f94cd70c2e1 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 0cd928499b0b..316a90e9ff78 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "S" +#define QWLAN_VERSION_EXTRA "T" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "2.0.8.32S" +#define QWLAN_VERSIONSTR "2.0.8.32T" #endif /* QWLAN_VERSION_H */ From bea7d1641b3a7d81f5388b0544833e2ff77610aa Mon Sep 17 00:00:00 2001 From: Surya Prakash Sivaraj Date: Thu, 16 Mar 2023 19:24:00 +0530 Subject: [PATCH 25/26] qcacld-3.0: Modify check to select channel switch announcement method In api sch_set_fixed_beacon_fields(), the channel switch announcement method selection was based on config "CONFIG_CHANNEL_HOPPING_ALL_BANDS" due to which peer STA may not be able to switch channel when MTP is working as SAP and doing channel switching. Modify the check in order to select the channel switch method based on nature of peer STA and operating/target frequency. Change-Id: I3deb09245496d65e6bb3ec27ed7eefd3dcaa27bc CRs-Fixed: 3293983 --- core/mac/src/pe/sch/sch_beacon_gen.c | 92 ++++++++++------------------ 1 file changed, 34 insertions(+), 58 deletions(-) diff --git a/core/mac/src/pe/sch/sch_beacon_gen.c b/core/mac/src/pe/sch/sch_beacon_gen.c index a1f9c02da179..0e9c6ae048fb 100644 --- a/core/mac/src/pe/sch/sch_beacon_gen.c +++ b/core/mac/src/pe/sch/sch_beacon_gen.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -216,6 +216,30 @@ static void sch_get_csa_ecsa_count_offset(uint8_t *ie, uint32_t ie_len, } } +static void +populate_channel_switch_ann(struct mac_context *mac_ctx, + tDot11fBeacon2 *bcn, + struct pe_session *pe_session) +{ + populate_dot11f_chan_switch_ann(mac_ctx, &bcn->ChanSwitchAnn, + pe_session); + pe_debug("csa: mode:%d chan:%d count:%d", + bcn->ChanSwitchAnn.switchMode, + bcn->ChanSwitchAnn.newChannel, + bcn->ChanSwitchAnn.switchCount); + + if (!pe_session->dfsIncludeChanWrapperIe) + return; + + populate_dot11f_chan_switch_wrapper(mac_ctx, + &bcn->ChannelSwitchWrapper, + pe_session); + pe_debug("wrapper: width:%d f0:%d f1:%d", + bcn->ChannelSwitchWrapper.WiderBWChanSwitchAnn.newChanWidth, + bcn->ChannelSwitchWrapper.WiderBWChanSwitchAnn.newCenterChanFreq0, + bcn->ChannelSwitchWrapper.WiderBWChanSwitchAnn.newCenterChanFreq1); +} + /** * sch_set_fixed_beacon_fields() - sets the fixed params in beacon frame * @mac_ctx: mac global context @@ -367,15 +391,12 @@ sch_set_fixed_beacon_fields(struct mac_context *mac_ctx, struct pe_session *sess ext_csa->new_reg_class, ext_csa->new_channel, ext_csa->switch_count); - } else { - populate_dot11f_chan_switch_ann(mac_ctx, - &bcn_2->ChanSwitchAnn, - session); - pe_debug("csa: mode:%d chan:%d count:%d", - bcn_2->ChanSwitchAnn.switchMode, - bcn_2->ChanSwitchAnn.newChannel, - bcn_2->ChanSwitchAnn.switchCount); } + + if (session->lim_non_ecsa_cap_num && + WLAN_REG_IS_24GHZ_CH_FREQ(session->curr_op_freq) && + !is_6ghz_chsw) + populate_channel_switch_ann(mac_ctx, bcn_2, session); } populate_dot11_supp_operating_classes(mac_ctx, @@ -390,55 +411,10 @@ sch_set_fixed_beacon_fields(struct mac_context *mac_ctx, struct pe_session *sess &bcn_2->PowerConstraints); populate_dot11f_tpc_report(mac_ctx, &bcn_2->TPCReport, session); /* Need to insert channel switch announcement here */ - if ((LIM_IS_AP_ROLE(session) - || LIM_IS_P2P_DEVICE_GO(session)) - && session->dfsIncludeChanSwIe == true) { - /* - * Channel switch announcement only if radar is detected - * and SAP has instructed to announce channel switch IEs - * in beacon and probe responses - */ - if (!is_6ghz_chsw) { - populate_dot11f_chan_switch_ann - (mac_ctx, &bcn_2->ChanSwitchAnn, - session); - pe_debug("csa: mode:%d chan:%d count:%d", - bcn_2->ChanSwitchAnn.switchMode, - bcn_2->ChanSwitchAnn.newChannel, - bcn_2->ChanSwitchAnn.switchCount); - } - /* - * TODO: depending the CB mode, extended channel switch - * announcement need to be called - */ - /* - populate_dot11f_ext_chan_switch_ann(mac_ctx, - &bcn_2->ExtChanSwitchAnn, session); - */ - /* - * TODO: If in 11AC mode, wider bw channel switch - * announcement needs to be called - */ - /* - populate_dot11f_wider_bw_chan_switch_ann(mac_ctx, - &bcn_2->WiderBWChanSwitchAnn, session); - */ - /* - * Populate the Channel Switch Wrapper Element if - * SAP operates in 40/80 Mhz Channel Width. - */ - if (true == session->dfsIncludeChanWrapperIe) { - populate_dot11f_chan_switch_wrapper(mac_ctx, - &bcn_2->ChannelSwitchWrapper, session); - pe_debug("wrapper: width:%d f0:%d f1:%d", - bcn_2->ChannelSwitchWrapper. - WiderBWChanSwitchAnn.newChanWidth, - bcn_2->ChannelSwitchWrapper. - WiderBWChanSwitchAnn.newCenterChanFreq0, - bcn_2->ChannelSwitchWrapper. - WiderBWChanSwitchAnn.newCenterChanFreq1 - ); - } + if ((LIM_IS_AP_ROLE(session) || + LIM_IS_P2P_DEVICE_GO(session)) && + session->dfsIncludeChanSwIe && !is_6ghz_chsw) { + populate_channel_switch_ann(mac_ctx, bcn_2, session); } } if (mac_ctx->rrm.rrmConfig.sap_rrm_enabled) From ac4df9eb9dc312ae04155d43223fb3387b1ca828 Mon Sep 17 00:00:00 2001 From: Madan Koyyalamudi Date: Thu, 16 Mar 2023 23:32:48 -0700 Subject: [PATCH 26/26] Release 2.0.8.32U Release 2.0.8.32U Change-Id: I7d790b3fe36df9f685661ae2a9697868d51c6bc8 CRs-Fixed: 774533 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 316a90e9ff78..80ef94507c93 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 2 #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 8 -#define QWLAN_VERSION_EXTRA "T" +#define QWLAN_VERSION_EXTRA "U" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "2.0.8.32T" +#define QWLAN_VERSIONSTR "2.0.8.32U" #endif /* QWLAN_VERSION_H */