qcacmn: Add API to get spectral version

Since struct spectral_samp_msg may be modified, so provide API to get
version information, then spectraltool can compatible with different
host based on version information.

Change-Id: If68dbd0d85b28f46056208d849fe2db4faea493a
CRs-Fixed: 2575818
This commit is contained in:
Wu Gao
2019-11-28 10:47:52 +08:00
committed by snandini
parent 13b4322e3b
commit 80df191a1a
3 changed files with 37 additions and 2 deletions

View File

@@ -53,6 +53,12 @@
#define SPECTRAL_GET_DEBUG_LEVEL (DFS_LAST_IOCTL + 23)
#define SPECTRAL_SET_DMA_DEBUG (DFS_LAST_IOCTL + 24)
/*
* Increase spectral sub version if struct spectral_samp_msg updated.
*/
#define SPECTRAL_VERSION (3)
#define SPECTRAL_SUB_VERSION (1)
/*
* ioctl parameter types
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -84,4 +84,18 @@ QDF_STATUS ucfg_spectral_extract_response(struct spectral_cp_request *sscan_req,
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE on failure
*/
QDF_STATUS ucfg_spectral_register_to_dbr(struct wlan_objmgr_pdev *pdev);
/**
* ucfg_spectral_get_version() - ucfg API to get spectral version
* @pdev: Pointer to pdev object
* @version: Pointer to return version
* @sub_version: Pointer to return sub version
*
* Since struct spectral_samp_msg may be modified, so provide API to get
* version information and make sure spectraltool compatible with host.
*
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE on failure
*/
QDF_STATUS ucfg_spectral_get_version(struct wlan_objmgr_pdev *pdev,
uint32_t *version, uint32_t *sub_version);
#endif /* _WLAN_SPECTRAL_UCFG_API_H_ */

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -221,3 +221,18 @@ QDF_STATUS ucfg_spectral_register_to_dbr(struct wlan_objmgr_pdev *pdev)
{
return spectral_pdev_open(pdev);
}
QDF_STATUS ucfg_spectral_get_version(struct wlan_objmgr_pdev *pdev,
uint32_t *version, uint32_t *sub_version)
{
if (!pdev || !version || !sub_version) {
spectral_err("invalid param");
return QDF_STATUS_E_INVAL;
}
*version = SPECTRAL_VERSION;
*sub_version = SPECTRAL_SUB_VERSION;
spectral_debug("Spectral get version %d:%d", *version, *sub_version);
return QDF_STATUS_SUCCESS;
}