xref: /wlan-driver/qca-wifi-host-cmn/wmi/inc/wmi_unified_ocb_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2013-2018 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: Implement API's specific to OCB component.
21*5113495bSYour Name  */
22*5113495bSYour Name 
23*5113495bSYour Name #ifndef _WMI_UNIFIED_DSRC_API_H_
24*5113495bSYour Name #define _WMI_UNIFIED_DSRC_API_H_
25*5113495bSYour Name #include <wlan_ocb_public_structs.h>
26*5113495bSYour Name 
27*5113495bSYour Name /**
28*5113495bSYour Name  * wmi_unified_ocb_start_timing_advert() - start sending the timing
29*5113495bSYour Name  *  advertisement frames on a channel
30*5113495bSYour Name  * @wmi_handle: pointer to the wmi handle
31*5113495bSYour Name  * @timing_advert: pointer to the timing advertisement struct
32*5113495bSYour Name  *
33*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
34*5113495bSYour Name  */
35*5113495bSYour Name QDF_STATUS wmi_unified_ocb_start_timing_advert(struct wmi_unified *wmi_handle,
36*5113495bSYour Name 			struct ocb_timing_advert_param *timing_advert);
37*5113495bSYour Name 
38*5113495bSYour Name /**
39*5113495bSYour Name  * wmi_unified_ocb_stop_timing_advert() - stop sending the timing
40*5113495bSYour Name  *  advertisement frames on a channel
41*5113495bSYour Name  * @wmi_handle: pointer to the wmi handle
42*5113495bSYour Name  * @timing_advert: pointer to the timing advertisement struct
43*5113495bSYour Name  *
44*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
45*5113495bSYour Name  */
46*5113495bSYour Name QDF_STATUS wmi_unified_ocb_stop_timing_advert(struct wmi_unified *wmi_handle,
47*5113495bSYour Name 			struct ocb_timing_advert_param *timing_advert);
48*5113495bSYour Name 
49*5113495bSYour Name /**
50*5113495bSYour Name  * wmi_unified_ocb_set_config() - send the OCB config to the FW
51*5113495bSYour Name  * @wmi_handle: pointer to the wmi handle
52*5113495bSYour Name  * @config: the OCB configuration
53*5113495bSYour Name  *
54*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures
55*5113495bSYour Name  */
56*5113495bSYour Name QDF_STATUS wmi_unified_ocb_set_config(struct wmi_unified *wmi_handle,
57*5113495bSYour Name 				      struct ocb_config *config);
58*5113495bSYour Name 
59*5113495bSYour Name /**
60*5113495bSYour Name  * wmi_unified_ocb_get_tsf_timer() - get ocb tsf timer val
61*5113495bSYour Name  * @wmi_handle: pointer to the wmi handle
62*5113495bSYour Name  * @req: request for tsf timer
63*5113495bSYour Name  *
64*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
65*5113495bSYour Name  */
66*5113495bSYour Name QDF_STATUS wmi_unified_ocb_get_tsf_timer(struct wmi_unified *wmi_handle,
67*5113495bSYour Name 					 struct ocb_get_tsf_timer_param *req);
68*5113495bSYour Name 
69*5113495bSYour Name /**
70*5113495bSYour Name  * wmi_unified_ocb_set_utc_time_cmd() - set OCB UTC time
71*5113495bSYour Name  * @wmi_handle: pointer to the wmi handle
72*5113495bSYour Name  * @utc: UTC time
73*5113495bSYour Name  *
74*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
75*5113495bSYour Name  */
76*5113495bSYour Name QDF_STATUS wmi_unified_ocb_set_utc_time_cmd(struct wmi_unified *wmi_handle,
77*5113495bSYour Name 					    struct ocb_utc_param *utc);
78*5113495bSYour Name 
79*5113495bSYour Name /**
80*5113495bSYour Name  * wmi_unified_dcc_get_stats_cmd() - get the DCC channel stats
81*5113495bSYour Name  * @wmi_handle: pointer to the wmi handle
82*5113495bSYour Name  * @get_stats_param: pointer to the dcc stats
83*5113495bSYour Name  *
84*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
85*5113495bSYour Name  */
86*5113495bSYour Name QDF_STATUS wmi_unified_dcc_get_stats_cmd(struct wmi_unified *wmi_handle,
87*5113495bSYour Name 		     struct ocb_dcc_get_stats_param *get_stats_param);
88*5113495bSYour Name 
89*5113495bSYour Name /**
90*5113495bSYour Name  * wmi_unified_dcc_clear_stats() - command to clear the DCC stats
91*5113495bSYour Name  * @wmi_handle: pointer to the wmi handle
92*5113495bSYour Name  * @clear_stats_param: parameters to the command
93*5113495bSYour Name  *
94*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
95*5113495bSYour Name  */
96*5113495bSYour Name QDF_STATUS wmi_unified_dcc_clear_stats(struct wmi_unified *wmi_handle,
97*5113495bSYour Name 			struct ocb_dcc_clear_stats_param *clear_stats_param);
98*5113495bSYour Name 
99*5113495bSYour Name /**
100*5113495bSYour Name  * wmi_unified_dcc_update_ndl() - command to update the NDL data
101*5113495bSYour Name  * @wmi_handle: pointer to the wmi handle
102*5113495bSYour Name  * @update_ndl_param: pointer to the request parameters
103*5113495bSYour Name  *
104*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures
105*5113495bSYour Name  */
106*5113495bSYour Name QDF_STATUS wmi_unified_dcc_update_ndl(struct wmi_unified *wmi_handle,
107*5113495bSYour Name 		       struct ocb_dcc_update_ndl_param *update_ndl_param);
108*5113495bSYour Name 
109*5113495bSYour Name /**
110*5113495bSYour Name  * wmi_extract_ocb_set_channel_config_resp() - extract status from wmi event
111*5113495bSYour Name  * @wmi_handle: wmi handle
112*5113495bSYour Name  * @evt_buf: pointer to event buffer
113*5113495bSYour Name  * @status: status buffer
114*5113495bSYour Name  *
115*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success
116*5113495bSYour Name  */
117*5113495bSYour Name QDF_STATUS
118*5113495bSYour Name wmi_extract_ocb_set_channel_config_resp(struct wmi_unified *wmi_handle,
119*5113495bSYour Name 					void *evt_buf,
120*5113495bSYour Name 					uint32_t *status);
121*5113495bSYour Name 
122*5113495bSYour Name /**
123*5113495bSYour Name  * wmi_extract_ocb_tsf_timer() - extract tsf timer from wmi event
124*5113495bSYour Name  * @wmi_handle: wmi handle
125*5113495bSYour Name  * @evt_buf: pointer to event buffer
126*5113495bSYour Name  * @resp: tsf timer
127*5113495bSYour Name  *
128*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success
129*5113495bSYour Name  */
130*5113495bSYour Name QDF_STATUS wmi_extract_ocb_tsf_timer(struct wmi_unified *wmi_handle,
131*5113495bSYour Name 				     void *evt_buf,
132*5113495bSYour Name 				     struct ocb_get_tsf_timer_response *resp);
133*5113495bSYour Name 
134*5113495bSYour Name /**
135*5113495bSYour Name  * wmi_extract_dcc_update_ndl_resp() - extract NDL update from wmi event
136*5113495bSYour Name  * @wmi_handle: wmi handle
137*5113495bSYour Name  * @evt_buf: pointer to event buffer
138*5113495bSYour Name  * @resp: ndl update status
139*5113495bSYour Name  *
140*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success
141*5113495bSYour Name  */
142*5113495bSYour Name QDF_STATUS wmi_extract_dcc_update_ndl_resp(struct wmi_unified *wmi_handle,
143*5113495bSYour Name 		void *evt_buf, struct ocb_dcc_update_ndl_response *resp);
144*5113495bSYour Name 
145*5113495bSYour Name /**
146*5113495bSYour Name  * wmi_extract_dcc_stats() - extract DCC stats from wmi event
147*5113495bSYour Name  * @wmi_handle: wmi handle
148*5113495bSYour Name  * @evt_buf: pointer to event buffer
149*5113495bSYour Name  * @response: DCC stats
150*5113495bSYour Name  *
151*5113495bSYour Name  * Since length of the response is variable, response buffer will be allocated.
152*5113495bSYour Name  * The caller must free the response buffer.
153*5113495bSYour Name  *
154*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success
155*5113495bSYour Name  */
156*5113495bSYour Name QDF_STATUS wmi_extract_dcc_stats(struct wmi_unified *wmi_handle,
157*5113495bSYour Name 				 void *evt_buf,
158*5113495bSYour Name 				 struct ocb_dcc_get_stats_response **response);
159*5113495bSYour Name 
160*5113495bSYour Name #endif /* _WMI_UNIFIED_DSRC_API_H_ */
161