From 164ce24671344a3a7d53907e7f4d28e595c3f654 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Myadam Date: Wed, 4 Aug 2021 15:06:24 +0530 Subject: [PATCH] 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