qcacmn: Add interface to write string of CFR stopping

Add a interface to write string of CFR stopping, and indicate to
userspace that CFR has stopped.

Change-Id: Ib1d63cb75cd311b367d5d8100c5c4eb92980392d
CRs-Fixed: 2659373
This commit is contained in:
Wu Gao 2020-04-08 00:10:09 +08:00 • committed by nshrivas
commit 6ba047a381
4 changed files with 55 additions and 1 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2019-2020 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
@ -31,6 +31,8 @@
#include <qdf_types.h>
#include <wlan_cfr_utils_api.h>
#define CFR_STOP_STR "CFR-CAPTURE-STOPPED"
/**
* wlan_cfr_psoc_obj_create_handler() - psoc object create handler for cfr
* @psoc - pointer to psoc object
@ -130,4 +132,14 @@ cfr_streamfs_write(struct pdev_cfr *pa, const void *write_data,
QDF_STATUS
cfr_streamfs_flush(struct pdev_cfr *pa);
/**
* cfr_stop_indication() - write cfr stop string
* @vdev - pointer to vdev object
*
* Write stop string and indicate to up layer.
*
* Return: status of write CFR stop string
*/
QDF_STATUS cfr_stop_indication(struct wlan_objmgr_vdev *vdev);
#endif

View file

@ -302,3 +302,25 @@ QDF_STATUS cfr_streamfs_flush(struct pdev_cfr *pa)
return QDF_STATUS_SUCCESS;
}
QDF_STATUS cfr_stop_indication(struct wlan_objmgr_vdev *vdev)
{
struct pdev_cfr *pa;
uint32_t status;
struct wlan_objmgr_pdev *pdev;
pdev = wlan_vdev_get_pdev(vdev);
pa = wlan_objmgr_pdev_get_comp_private_obj(pdev, WLAN_UMAC_COMP_CFR);
if (!pa) {
cfr_err("pdev_cfr is NULL\n");
return QDF_STATUS_E_INVAL;
}
status = cfr_streamfs_write(pa, (const void *)CFR_STOP_STR,
sizeof(CFR_STOP_STR));
status = cfr_streamfs_flush(pa);
cfr_debug("stop indication done");
return status;
}

View file

@ -96,6 +96,16 @@ int ucfg_cfr_set_timer(struct wlan_objmgr_pdev *pdev, uint32_t value);
*/
int ucfg_cfr_get_timer(struct wlan_objmgr_pdev *pdev);
/**
* ucfg_cfr_stop_indication() - User space API to write cfr stop string
* @vdev - pointer to vdev object
*
* Write stop string and indicate to up layer.
*
* Return: status of write CFR stop string
*/
QDF_STATUS ucfg_cfr_stop_indication(struct wlan_objmgr_vdev *vdev);
#ifdef WLAN_ENH_CFR_ENABLE
/* Channel capture recipe filters */
enum capture_type {

View file

@ -311,6 +311,16 @@ int ucfg_cfr_list_peers(struct wlan_objmgr_pdev *pdev)
return 0;
}
QDF_STATUS ucfg_cfr_stop_indication(struct wlan_objmgr_vdev *vdev)
{
if (!vdev) {
cfr_err("null vdev");
return QDF_STATUS_E_INVAL;
}
return cfr_stop_indication(vdev);
}
#ifdef WLAN_ENH_CFR_ENABLE
static inline