qcacld-3.0: Handle user initiate CSA in p2p go+go concurrency

If p2p go+go concurrency exist and g_enable_go_force_scc ini sets
to 2(liberal mode) then 1st p2p go channel should move to 2nd
p2p go channel after set key. Again, when user initiates CSA to
one p2p go then the force SCC doesn't happen to other p2p go.
But the expectation is all p2p go should move to same channel
which is initiated by user.

As part of fix, move all p2p go to same channel when user
initiates.

Change-Id: I1664e5a7d545d29c32b94e8e4831c71a9cc0ae23
CRs-Fixed: 3064245
This commit is contained in:
sheenam monga
2021-11-01 16:02:10 +05:30
committed by Madan Koyyalamudi
parent c4ce0f6630
commit 14a98fd26d
6 changed files with 131 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2020, The Linux Foundation. All rights reserved. * Copyright (c) 2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@@ -26,6 +27,7 @@
#include "wlan_if_mgr_main.h" #include "wlan_if_mgr_main.h"
#include "wlan_p2p_cfg_api.h" #include "wlan_p2p_cfg_api.h"
#include "wlan_tdls_api.h" #include "wlan_tdls_api.h"
#include "wlan_p2p_api.h"
QDF_STATUS if_mgr_ap_start_bss(struct wlan_objmgr_vdev *vdev, QDF_STATUS if_mgr_ap_start_bss(struct wlan_objmgr_vdev *vdev,
struct if_mgr_event_data *event_data) struct if_mgr_event_data *event_data)
@@ -128,3 +130,25 @@ if_mgr_ap_stop_bss_complete(struct wlan_objmgr_vdev *vdev,
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
#ifdef WLAN_FEATURE_P2P_P2P_STA
QDF_STATUS
if_mgr_csa_complete(struct wlan_objmgr_vdev *vdev,
struct if_mgr_event_data *event_data)
{
struct wlan_objmgr_psoc *psoc;
struct wlan_objmgr_pdev *pdev;
QDF_STATUS status = QDF_STATUS_SUCCESS;
pdev = wlan_vdev_get_pdev(vdev);
if (!pdev)
return QDF_STATUS_E_FAILURE;
psoc = wlan_pdev_get_psoc(pdev);
if (!psoc)
return QDF_STATUS_E_FAILURE;
status = wlan_p2p_check_and_force_scc_go_plus_go(psoc, vdev);
if (QDF_IS_STATUS_ERROR(status))
ifmgr_err("force scc failure with status: %d", status);
return status;
}
#endif

View File

@@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -35,6 +36,7 @@
#include "wlan_p2p_off_chan_tx.h" #include "wlan_p2p_off_chan_tx.h"
#include "wlan_p2p_cfg.h" #include "wlan_p2p_cfg.h"
#include "cfg_ucfg_api.h" #include "cfg_ucfg_api.h"
#include "wlan_mlme_api.h"
/** /**
* p2p_get_cmd_type_str() - parse cmd to string * p2p_get_cmd_type_str() - parse cmd to string
@@ -1508,3 +1510,49 @@ QDF_STATUS p2p_status_stop_bss(struct wlan_objmgr_vdev *vdev)
} }
#endif /* WLAN_FEATURE_P2P_DEBUG */ #endif /* WLAN_FEATURE_P2P_DEBUG */
#ifdef WLAN_FEATURE_P2P_P2P_STA
QDF_STATUS p2p_check_and_force_scc_go_plus_go(struct wlan_objmgr_psoc *psoc,
struct wlan_objmgr_vdev *vdev)
{
int go_count = 0;
uint32_t existing_chan_freq, chan_freq;
enum phy_ch_width existing_ch_width, ch_width;
uint8_t existing_vdev_id = WLAN_UMAC_VDEV_ID_MAX, vdev_id;
enum policy_mgr_con_mode existing_vdev_mode = PM_MAX_NUM_OF_MODE;
bool go_force_scc = false;
go_count = policy_mgr_mode_specific_connection_count(
psoc, PM_P2P_GO_MODE, NULL);
go_force_scc = policy_mgr_go_scc_enforced(psoc);
if (go_count > 1 && go_force_scc) {
vdev_id = wlan_vdev_get_id(vdev);
chan_freq = wlan_get_operation_chan_freq(vdev);
ch_width = vdev->vdev_mlme.bss_chan->ch_width;
p2p_debug("Current vdev_id %d, chan_freq %d and ch_width %d",
vdev_id, chan_freq, ch_width);
existing_vdev_id = policy_mgr_fetch_existing_con_info(
psoc, vdev_id,
chan_freq,
&existing_vdev_mode,
&existing_chan_freq,
&existing_ch_width);
p2p_debug("Existing vdev_id %d, chan_freq %d and ch_width %d",
existing_vdev_id, existing_chan_freq,
existing_ch_width);
if (existing_vdev_id == WLAN_UMAC_VDEV_ID_MAX) {
p2p_debug("force scc not required");
return QDF_STATUS_SUCCESS;
}
if (existing_vdev_mode == PM_P2P_GO_MODE) {
policy_mgr_process_forcescc_for_go(psoc,
existing_vdev_id,
chan_freq,
ch_width,
PM_P2P_GO_MODE);
p2p_debug("CSA for vdev_id %d", existing_vdev_id);
}
}
return QDF_STATUS_SUCCESS;
}
#endif

View File

@@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -589,4 +590,22 @@ static inline QDF_STATUS p2p_status_stop_bss(struct wlan_objmgr_vdev *vdev)
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
#endif /* WLAN_FEATURE_P2P_DEBUG */ #endif /* WLAN_FEATURE_P2P_DEBUG */
#ifdef WLAN_FEATURE_P2P_P2P_STA
/**
* p2p_check_and_force_scc_go_plus_go() - Check and do force scc for
* go plus go
* @psoc: psoc object
* @vdev: vdev object
*
* This function checks whether force scc is enabled or not. If it
* is enabled then it will do force scc to remaining p2p go vdev if
* user has initiated CSA to current vdev.
*
* Return: status
*/
QDF_STATUS
p2p_check_and_force_scc_go_plus_go(struct wlan_objmgr_psoc *psoc,
struct wlan_objmgr_vdev *vdev);
#endif /* WLAN_FEATURE_P2P_P2P_STA */
#endif /* _WLAN_P2P_MAIN_H_ */ #endif /* _WLAN_P2P_MAIN_H_ */

View File

@@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -70,4 +71,22 @@ QDF_STATUS wlan_p2p_status_connect(struct wlan_objmgr_vdev *vdev);
* Return: QDF_STATUS_SUCCESS - in case of success * Return: QDF_STATUS_SUCCESS - in case of success
*/ */
QDF_STATUS wlan_p2p_abort_scan(struct wlan_objmgr_pdev *pdev); QDF_STATUS wlan_p2p_abort_scan(struct wlan_objmgr_pdev *pdev);
#ifdef WLAN_FEATURE_P2P_P2P_STA
/**
* wlan_p2p_check_and_force_scc_go_plus_go() - Check and do force scc for
* go plus go
* @psoc: psoc object
* @vdev: vdev object
*
* This function checks whether force scc is enabled or not. If it
* is enabled then it will do force scc to remaining p2p go vdev if
* user has initiated CSA to current vdev.
*
* Return: status
*/
QDF_STATUS
wlan_p2p_check_and_force_scc_go_plus_go(struct wlan_objmgr_psoc *psoc,
struct wlan_objmgr_vdev *vdev);
#endif
#endif #endif

View File

@@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -74,6 +75,20 @@ QDF_STATUS wlan_p2p_status_connect(struct wlan_objmgr_vdev *vdev)
return p2p_status_connect(vdev); return p2p_status_connect(vdev);
} }
#ifdef WLAN_FEATURE_P2P_P2P_STA
QDF_STATUS
wlan_p2p_check_and_force_scc_go_plus_go(struct wlan_objmgr_psoc *psoc,
struct wlan_objmgr_vdev *vdev)
{
if (!vdev) {
p2p_err("vdev is NULL");
return QDF_STATUS_E_INVAL;
}
return p2p_check_and_force_scc_go_plus_go(psoc, vdev);
}
#endif
static void wlan_p2p_abort_vdev_scan(struct wlan_objmgr_pdev *pdev, static void wlan_p2p_abort_vdev_scan(struct wlan_objmgr_pdev *pdev,
void *object, void *arg) void *object, void *arg)
{ {

View File

@@ -53,6 +53,9 @@
#include <wlan_scan_ucfg_api.h> #include <wlan_scan_ucfg_api.h>
#include <wlan_scan_utils_api.h> #include <wlan_scan_utils_api.h>
/* IF MGR API header file */
#include "wlan_if_mgr_ucfg_api.h"
/*---------------------------------------------------------------------------- /*----------------------------------------------------------------------------
* Preprocessor Definitions and Constants * Preprocessor Definitions and Constants
* -------------------------------------------------------------------------*/ * -------------------------------------------------------------------------*/
@@ -1146,6 +1149,9 @@ QDF_STATUS wlansap_roam_callback(void *ctx,
break; break;
case eCSR_ROAM_SET_CHANNEL_RSP: case eCSR_ROAM_SET_CHANNEL_RSP:
sap_debug("Received set channel response"); sap_debug("Received set channel response");
ucfg_if_mgr_deliver_event(sap_ctx->vdev,
WLAN_IF_MGR_EV_CSA_COMPLETE,
NULL);
break; break;
case eCSR_ROAM_CAC_COMPLETE_IND: case eCSR_ROAM_CAC_COMPLETE_IND:
sap_debug("Received cac complete indication"); sap_debug("Received cac complete indication");