xref: /wlan-driver/qca-wifi-host-cmn/spectral/dispatcher/inc/wlan_spectral_ucfg_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  *
6*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
7*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
8*5113495bSYour Name  * above copyright notice and this permission notice appear in all
9*5113495bSYour Name  * copies.
10*5113495bSYour Name  *
11*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
12*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
13*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
14*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
15*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
16*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
17*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
19*5113495bSYour Name  */
20*5113495bSYour Name 
21*5113495bSYour Name #ifndef _WLAN_SPECTRAL_UCFG_API_H_
22*5113495bSYour Name #define _WLAN_SPECTRAL_UCFG_API_H_
23*5113495bSYour Name 
24*5113495bSYour Name #include <wlan_objmgr_cmn.h>
25*5113495bSYour Name #include <wlan_spectral_public_structs.h>
26*5113495bSYour Name 
27*5113495bSYour Name /* Spectral specific UCFG set operations */
28*5113495bSYour Name 
29*5113495bSYour Name /**
30*5113495bSYour Name  * ucfg_spectral_control() - Carry out Spectral control operations
31*5113495bSYour Name  * @pdev: Pointer to pdev
32*5113495bSYour Name  * @sscan_req: spectral related control request
33*5113495bSYour Name  *
34*5113495bSYour Name  * Carry out Spectral specific UCFG control get/set operations
35*5113495bSYour Name  *
36*5113495bSYour Name  * Return: 0 on success, negative value on failure
37*5113495bSYour Name  */
38*5113495bSYour Name QDF_STATUS ucfg_spectral_control(struct wlan_objmgr_pdev *pdev,
39*5113495bSYour Name 				 struct spectral_cp_request *sscan_req);
40*5113495bSYour Name 
41*5113495bSYour Name /**
42*5113495bSYour Name  * ucfg_spectral_scan_set_ppid() - configure pid of spectral tool
43*5113495bSYour Name  * @pdev: Pointer to pdev
44*5113495bSYour Name  * @ppid: Spectral tool pid
45*5113495bSYour Name  *
46*5113495bSYour Name  * Configure pid of spectral tool
47*5113495bSYour Name  *
48*5113495bSYour Name  * Return: None
49*5113495bSYour Name  */
50*5113495bSYour Name void ucfg_spectral_scan_set_ppid(struct wlan_objmgr_pdev *pdev,
51*5113495bSYour Name 					uint32_t ppid);
52*5113495bSYour Name 
53*5113495bSYour Name /**
54*5113495bSYour Name  * ucfg_spectral_create_cp_req() - Create Spectral control path request
55*5113495bSYour Name  * @sscan_req: Pointer to Spectral scan request
56*5113495bSYour Name  * @indata: pointer input data
57*5113495bSYour Name  * @insize: Size of input data
58*5113495bSYour Name  *
59*5113495bSYour Name  * Create Spectral control path request structure
60*5113495bSYour Name  *
61*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE on failure
62*5113495bSYour Name  */
63*5113495bSYour Name QDF_STATUS ucfg_spectral_create_cp_req(struct spectral_cp_request *sscan_req,
64*5113495bSYour Name 				       void *indata, u_int32_t insize);
65*5113495bSYour Name 
66*5113495bSYour Name /**
67*5113495bSYour Name  * ucfg_spectral_extract_response() - Extract response from Spectral CP request
68*5113495bSYour Name  * @sscan_req: Pointer to Spectral scan request
69*5113495bSYour Name  * @outdata: pointer output data
70*5113495bSYour Name  * @outsize: Size of output data
71*5113495bSYour Name  *
72*5113495bSYour Name  * Extract response from Spectral control path request
73*5113495bSYour Name  *
74*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE on failure
75*5113495bSYour Name  */
76*5113495bSYour Name QDF_STATUS ucfg_spectral_extract_response(struct spectral_cp_request *sscan_req,
77*5113495bSYour Name 					  void *outdata, u_int32_t *outsize);
78*5113495bSYour Name 
79*5113495bSYour Name /**
80*5113495bSYour Name  * ucfg_spectral_register_to_dbr() - Register spectral to DBR
81*5113495bSYour Name  * @pdev: Pointer to pdev object
82*5113495bSYour Name  *
83*5113495bSYour Name  * Register spectral to Direct Buffer RX component
84*5113495bSYour Name  *
85*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE on failure
86*5113495bSYour Name  */
87*5113495bSYour Name QDF_STATUS ucfg_spectral_register_to_dbr(struct wlan_objmgr_pdev *pdev);
88*5113495bSYour Name 
89*5113495bSYour Name /**
90*5113495bSYour Name  * ucfg_spectral_get_version() - ucfg API to get spectral version
91*5113495bSYour Name  * @pdev: Pointer to pdev object
92*5113495bSYour Name  * @version: Pointer to return version
93*5113495bSYour Name  * @sub_version: Pointer to return sub version
94*5113495bSYour Name  *
95*5113495bSYour Name  * Since struct spectral_samp_msg may be modified, so provide API to get
96*5113495bSYour Name  * version information and make sure spectraltool compatible with host.
97*5113495bSYour Name  *
98*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE on failure
99*5113495bSYour Name  */
100*5113495bSYour Name QDF_STATUS ucfg_spectral_get_version(struct wlan_objmgr_pdev *pdev,
101*5113495bSYour Name 				     uint32_t *version, uint32_t *sub_version);
102*5113495bSYour Name #endif /* _WLAN_SPECTRAL_UCFG_API_H_ */
103