xref: /wlan-driver/qca-wifi-host-cmn/wmi/inc/wmi_unified_reg_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2017-2021 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  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name /**
20*5113495bSYour Name  * DOC: This file contains the API definitions for the Unified Wireless Module
21*5113495bSYour Name  * Interface (WMI) which are specific to Regulatory module.
22*5113495bSYour Name  */
23*5113495bSYour Name 
24*5113495bSYour Name #ifndef _WMI_UNIFIED_REG_API_H_
25*5113495bSYour Name #define _WMI_UNIFIED_REG_API_H_
26*5113495bSYour Name 
27*5113495bSYour Name #include "reg_services_public_struct.h"
28*5113495bSYour Name /**
29*5113495bSYour Name  * wmi_extract_reg_chan_list_update_event() - function to update channel list
30*5113495bSYour Name  * @wmi_handle: wmi handle
31*5113495bSYour Name  * @evt_buf: event buffer
32*5113495bSYour Name  * @reg_info: regulatory info
33*5113495bSYour Name  * @len: length of buffer
34*5113495bSYour Name  *
35*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
36*5113495bSYour Name  */
37*5113495bSYour Name QDF_STATUS wmi_extract_reg_chan_list_update_event(
38*5113495bSYour Name 		wmi_unified_t wmi_handle,
39*5113495bSYour Name 		uint8_t *evt_buf,
40*5113495bSYour Name 		struct cur_regulatory_info *reg_info,
41*5113495bSYour Name 		uint32_t len);
42*5113495bSYour Name 
43*5113495bSYour Name #ifdef CONFIG_BAND_6GHZ
44*5113495bSYour Name /**
45*5113495bSYour Name  * wmi_extract_reg_chan_list_ext_update_event() - function to update the
46*5113495bSYour Name  * extended channel list
47*5113495bSYour Name  * @wmi_handle: wmi handle
48*5113495bSYour Name  * @evt_buf: event buffer
49*5113495bSYour Name  * @reg_info: regulatory info
50*5113495bSYour Name  * @len: length of buffer
51*5113495bSYour Name  *
52*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
53*5113495bSYour Name  */
54*5113495bSYour Name QDF_STATUS wmi_extract_reg_chan_list_ext_update_event(wmi_unified_t wmi_handle,
55*5113495bSYour Name 					uint8_t *evt_buf,
56*5113495bSYour Name 					struct cur_regulatory_info *reg_info,
57*5113495bSYour Name 					uint32_t len);
58*5113495bSYour Name 
59*5113495bSYour Name #ifdef CONFIG_AFC_SUPPORT
60*5113495bSYour Name /**
61*5113495bSYour Name  * wmi_extract_afc_event() - function to read the contents of the AFC event
62*5113495bSYour Name  * @wmi_handle: wmi handle
63*5113495bSYour Name  * @evt_buf: event buffer
64*5113495bSYour Name  * @afc_info: AFC regulatory info
65*5113495bSYour Name  * @len: length of buffer
66*5113495bSYour Name  *
67*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
68*5113495bSYour Name  */
69*5113495bSYour Name QDF_STATUS wmi_extract_afc_event(wmi_unified_t wmi_handle,
70*5113495bSYour Name 				 uint8_t *evt_buf,
71*5113495bSYour Name 				 struct afc_regulatory_info *afc_info,
72*5113495bSYour Name 				 uint32_t len);
73*5113495bSYour Name #endif
74*5113495bSYour Name #endif
75*5113495bSYour Name 
76*5113495bSYour Name /*
77*5113495bSYour Name  * wmi_unified_send_stop_11d_scan_cmd() - stop 11d scan
78*5113495bSYour Name  * @wmi_handle: wmi handle
79*5113495bSYour Name  * @stop_11d_scan: pointer to 11d scan stop req.
80*5113495bSYour Name  *
81*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
82*5113495bSYour Name  */
83*5113495bSYour Name QDF_STATUS wmi_unified_send_stop_11d_scan_cmd(wmi_unified_t wmi_handle,
84*5113495bSYour Name 		struct reg_stop_11d_scan_req *stop_11d_scan);
85*5113495bSYour Name 
86*5113495bSYour Name /*
87*5113495bSYour Name  * wmi_unified_send_start_11d_scan_cmd() - start 11d scan
88*5113495bSYour Name  * @wmi_handle: wmi handle
89*5113495bSYour Name  * @start_11d_scan: pointer to 11d scan start req.
90*5113495bSYour Name  *
91*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
92*5113495bSYour Name  */
93*5113495bSYour Name QDF_STATUS wmi_unified_send_start_11d_scan_cmd(wmi_unified_t wmi_handle,
94*5113495bSYour Name 		struct reg_start_11d_scan_req *start_11d_scan);
95*5113495bSYour Name 
96*5113495bSYour Name /**
97*5113495bSYour Name  * wmi_extract_reg_11d_new_cc_event() - function to extract the 11d new country
98*5113495bSYour Name  * @wmi_handle: wmi handle
99*5113495bSYour Name  * @evt_buf: event buffer
100*5113495bSYour Name  * @reg_11d_new_cc: pointer to new 11d country info
101*5113495bSYour Name  * @len: length of buffer
102*5113495bSYour Name  *
103*5113495bSYour Name  * Return: 0 for success or error code
104*5113495bSYour Name  */
105*5113495bSYour Name QDF_STATUS wmi_extract_reg_11d_new_cc_event(
106*5113495bSYour Name 		wmi_unified_t wmi_handle,
107*5113495bSYour Name 		uint8_t *evt_buf,
108*5113495bSYour Name 		struct reg_11d_new_country *reg_11d_new_cc,
109*5113495bSYour Name 		uint32_t len);
110*5113495bSYour Name 
111*5113495bSYour Name /**
112*5113495bSYour Name  * wmi_unified_set_user_country_code_cmd_send() - WMI set country function
113*5113495bSYour Name  * @wmi_handle: wmi handle.
114*5113495bSYour Name  * @pdev_id: Pdev id
115*5113495bSYour Name  * @rd: User country code or regdomain
116*5113495bSYour Name  *
117*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
118*5113495bSYour Name  */
119*5113495bSYour Name QDF_STATUS wmi_unified_set_user_country_code_cmd_send(
120*5113495bSYour Name 		wmi_unified_t wmi_handle,
121*5113495bSYour Name 		uint8_t pdev_id, struct cc_regdmn_s *rd);
122*5113495bSYour Name 
123*5113495bSYour Name /**
124*5113495bSYour Name  * wmi_extract_reg_ch_avoid_event() - process freq avoid event
125*5113495bSYour Name  * @wmi_handle: wmi handle.
126*5113495bSYour Name  * @evt_buf: event buffer
127*5113495bSYour Name  * @ch_avoid_ind: buffer pointer to save the event processed data
128*5113495bSYour Name  * @len: length of buffer
129*5113495bSYour Name  *
130*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
131*5113495bSYour Name  */
132*5113495bSYour Name QDF_STATUS wmi_extract_reg_ch_avoid_event(
133*5113495bSYour Name 		wmi_unified_t wmi_handle,
134*5113495bSYour Name 		uint8_t *evt_buf,
135*5113495bSYour Name 		struct ch_avoid_ind_type *ch_avoid_ind,
136*5113495bSYour Name 		uint32_t len);
137*5113495bSYour Name 
138*5113495bSYour Name /**
139*5113495bSYour Name  * wmi_extract_tgtr2p_table_event() - function to read the contents of the
140*5113495bSYour Name  * rate2power update response event
141*5113495bSYour Name  * @wmi_handle: wmi handle
142*5113495bSYour Name  * @evt_buf: event buffer
143*5113495bSYour Name  * @update_status: Status object
144*5113495bSYour Name  * @len: length of buffer
145*5113495bSYour Name  *
146*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE on error
147*5113495bSYour Name  */
148*5113495bSYour Name QDF_STATUS wmi_extract_tgtr2p_table_event(wmi_unified_t wmi_handle,
149*5113495bSYour Name 		uint8_t *evt_buf,
150*5113495bSYour Name 		struct r2p_table_update_status_obj *update_status,
151*5113495bSYour Name 		uint32_t len);
152*5113495bSYour Name 
153*5113495bSYour Name #endif /* _WMI_UNIFIED_REG_API_H_ */
154