qcacld-3.0: Abort any ongoing p2p scans while enabling NAN

Framework disables p2p before enabling NAN as P2P+NAN concurrency
is not supported. NAN operations happens through wifihal and p2p
operations happen through wpa_supplicant which are two different
userspace components. Wifihal call to enable NAN may come to host
driver before disabling p2p through wpa_supplicant. There are high
chances for p2p scan to be in running state while NAN enable is
received. Firmware NAN state machine goes to inconsistent state
and disables NAN as p2p scan is running in such cases.
So, stop the ongoing p2p scan before enabling NAN as P2P+NAN
concurrency is not supported currently.
Also, forward the pdev to NAN component inorder to iterate through
all P2P vdevs.

Change-Id: Ibe30a5ebe90514aee4f6721cdc5476570524cad8
CRs-Fixed: 3054576
This commit is contained in:
Srinivas Dasari
2021-10-12 20:47:42 +05:30
committed by Madan Koyyalamudi
parent c7c5e7e32e
commit 3d0e41cad1
10 changed files with 88 additions and 16 deletions

View File

@@ -196,14 +196,15 @@ fail:
}
/**
* p2p_scan_abort() - Abort scan
* p2p_roc_abort() - Abort roc
* @roc_ctx: remain on channel request
*
* This function trigger an abort scan request to scan component.
* This function triggers an abort scan request to scan component to abort the
* ROC request which is running through roc_ctx.
*
* Return: QDF_STATUS_SUCCESS - in case of success
*/
static QDF_STATUS p2p_scan_abort(struct p2p_roc_context *roc_ctx)
static QDF_STATUS p2p_roc_abort(struct p2p_roc_context *roc_ctx)
{
QDF_STATUS status;
struct scan_cancel_request *req;
@@ -350,7 +351,7 @@ static QDF_STATUS p2p_execute_cancel_roc_req(
if (status != QDF_STATUS_SUCCESS)
p2p_err("Failed to stop roc timer, roc %pK", roc_ctx);
status = p2p_scan_abort(roc_ctx);
status = p2p_roc_abort(roc_ctx);
if (status != QDF_STATUS_SUCCESS) {
p2p_err("Failed to abort scan, status:%d, destroy roc %pK",
status, roc_ctx);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2019-2021 The Linux Foundation. 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
@@ -60,4 +60,14 @@ QDF_STATUS wlan_p2p_cleanup_roc_by_vdev(struct wlan_objmgr_vdev *vdev);
*/
QDF_STATUS wlan_p2p_status_connect(struct wlan_objmgr_vdev *vdev);
/**
* wlan_p2p_abort_scan() - Abort on going scan on p2p interfaces
* @pdev: pdev object
*
* This function triggers an abort scan request to scan component to abort the
* ongoing scan request on p2p vdevs.
*
* Return: QDF_STATUS_SUCCESS - in case of success
*/
QDF_STATUS wlan_p2p_abort_scan(struct wlan_objmgr_pdev *pdev);
#endif

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2019-2021 The Linux Foundation. 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
@@ -25,6 +25,8 @@
#include "wlan_p2p_public_struct.h"
#include "../../core/src/wlan_p2p_main.h"
#include "../../core/src/wlan_p2p_roc.h"
#include <cds_utils.h>
#include "wlan_scan_api.h"
bool wlan_p2p_check_oui_and_force_1x1(uint8_t *assoc_ie, uint32_t assoc_ie_len)
{
@@ -71,3 +73,51 @@ QDF_STATUS wlan_p2p_status_connect(struct wlan_objmgr_vdev *vdev)
return p2p_status_connect(vdev);
}
static void wlan_p2p_abort_vdev_scan(struct wlan_objmgr_pdev *pdev,
void *object, void *arg)
{
struct wlan_objmgr_vdev *vdev = (struct wlan_objmgr_vdev *)object;
struct scan_cancel_request *req;
struct p2p_soc_priv_obj *p2p_soc_obj;
QDF_STATUS status;
if (wlan_vdev_mlme_get_opmode(vdev) != QDF_P2P_DEVICE_MODE)
return;
p2p_soc_obj =
wlan_objmgr_psoc_get_comp_private_obj(wlan_vdev_get_psoc(vdev),
WLAN_UMAC_COMP_P2P);
if (!p2p_soc_obj) {
p2p_err("P2P soc object is NULL");
return;
}
req = qdf_mem_malloc(sizeof(*req));
if (!req)
return;
req->vdev = vdev;
req->cancel_req.requester = p2p_soc_obj->scan_req_id;
req->cancel_req.scan_id = INVALID_SCAN_ID;
req->cancel_req.vdev_id = wlan_vdev_get_id(vdev);
req->cancel_req.req_type = WLAN_SCAN_CANCEL_VDEV_ALL;
qdf_mtrace(QDF_MODULE_ID_P2P, QDF_MODULE_ID_SCAN,
req->cancel_req.req_type,
req->cancel_req.vdev_id,
req->cancel_req.scan_id);
status = wlan_scan_cancel(req);
p2p_debug("abort scan, scan req id:%d, scan id:%d, status:%d",
req->cancel_req.requester,
req->cancel_req.scan_id, status);
}
QDF_STATUS wlan_p2p_abort_scan(struct wlan_objmgr_pdev *pdev)
{
return wlan_objmgr_pdev_iterate_obj_list(pdev,
WLAN_VDEV_OP,
wlan_p2p_abort_vdev_scan,
NULL, 0, WLAN_P2P_ID);
}