xref: /wlan-driver/qca-wifi-host-cmn/wmi/inc/wmi_unified_ocb_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 /**
20  * DOC: Implement API's specific to OCB component.
21  */
22 
23 #ifndef _WMI_UNIFIED_DSRC_API_H_
24 #define _WMI_UNIFIED_DSRC_API_H_
25 #include <wlan_ocb_public_structs.h>
26 
27 /**
28  * wmi_unified_ocb_start_timing_advert() - start sending the timing
29  *  advertisement frames on a channel
30  * @wmi_handle: pointer to the wmi handle
31  * @timing_advert: pointer to the timing advertisement struct
32  *
33  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
34  */
35 QDF_STATUS wmi_unified_ocb_start_timing_advert(struct wmi_unified *wmi_handle,
36 			struct ocb_timing_advert_param *timing_advert);
37 
38 /**
39  * wmi_unified_ocb_stop_timing_advert() - stop sending the timing
40  *  advertisement frames on a channel
41  * @wmi_handle: pointer to the wmi handle
42  * @timing_advert: pointer to the timing advertisement struct
43  *
44  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
45  */
46 QDF_STATUS wmi_unified_ocb_stop_timing_advert(struct wmi_unified *wmi_handle,
47 			struct ocb_timing_advert_param *timing_advert);
48 
49 /**
50  * wmi_unified_ocb_set_config() - send the OCB config to the FW
51  * @wmi_handle: pointer to the wmi handle
52  * @config: the OCB configuration
53  *
54  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures
55  */
56 QDF_STATUS wmi_unified_ocb_set_config(struct wmi_unified *wmi_handle,
57 				      struct ocb_config *config);
58 
59 /**
60  * wmi_unified_ocb_get_tsf_timer() - get ocb tsf timer val
61  * @wmi_handle: pointer to the wmi handle
62  * @req: request for tsf timer
63  *
64  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
65  */
66 QDF_STATUS wmi_unified_ocb_get_tsf_timer(struct wmi_unified *wmi_handle,
67 					 struct ocb_get_tsf_timer_param *req);
68 
69 /**
70  * wmi_unified_ocb_set_utc_time_cmd() - set OCB UTC time
71  * @wmi_handle: pointer to the wmi handle
72  * @utc: UTC time
73  *
74  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
75  */
76 QDF_STATUS wmi_unified_ocb_set_utc_time_cmd(struct wmi_unified *wmi_handle,
77 					    struct ocb_utc_param *utc);
78 
79 /**
80  * wmi_unified_dcc_get_stats_cmd() - get the DCC channel stats
81  * @wmi_handle: pointer to the wmi handle
82  * @get_stats_param: pointer to the dcc stats
83  *
84  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
85  */
86 QDF_STATUS wmi_unified_dcc_get_stats_cmd(struct wmi_unified *wmi_handle,
87 		     struct ocb_dcc_get_stats_param *get_stats_param);
88 
89 /**
90  * wmi_unified_dcc_clear_stats() - command to clear the DCC stats
91  * @wmi_handle: pointer to the wmi handle
92  * @clear_stats_param: parameters to the command
93  *
94  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
95  */
96 QDF_STATUS wmi_unified_dcc_clear_stats(struct wmi_unified *wmi_handle,
97 			struct ocb_dcc_clear_stats_param *clear_stats_param);
98 
99 /**
100  * wmi_unified_dcc_update_ndl() - command to update the NDL data
101  * @wmi_handle: pointer to the wmi handle
102  * @update_ndl_param: pointer to the request parameters
103  *
104  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures
105  */
106 QDF_STATUS wmi_unified_dcc_update_ndl(struct wmi_unified *wmi_handle,
107 		       struct ocb_dcc_update_ndl_param *update_ndl_param);
108 
109 /**
110  * wmi_extract_ocb_set_channel_config_resp() - extract status from wmi event
111  * @wmi_handle: wmi handle
112  * @evt_buf: pointer to event buffer
113  * @status: status buffer
114  *
115  * Return: QDF_STATUS_SUCCESS on success
116  */
117 QDF_STATUS
118 wmi_extract_ocb_set_channel_config_resp(struct wmi_unified *wmi_handle,
119 					void *evt_buf,
120 					uint32_t *status);
121 
122 /**
123  * wmi_extract_ocb_tsf_timer() - extract tsf timer from wmi event
124  * @wmi_handle: wmi handle
125  * @evt_buf: pointer to event buffer
126  * @resp: tsf timer
127  *
128  * Return: QDF_STATUS_SUCCESS on success
129  */
130 QDF_STATUS wmi_extract_ocb_tsf_timer(struct wmi_unified *wmi_handle,
131 				     void *evt_buf,
132 				     struct ocb_get_tsf_timer_response *resp);
133 
134 /**
135  * wmi_extract_dcc_update_ndl_resp() - extract NDL update from wmi event
136  * @wmi_handle: wmi handle
137  * @evt_buf: pointer to event buffer
138  * @resp: ndl update status
139  *
140  * Return: QDF_STATUS_SUCCESS on success
141  */
142 QDF_STATUS wmi_extract_dcc_update_ndl_resp(struct wmi_unified *wmi_handle,
143 		void *evt_buf, struct ocb_dcc_update_ndl_response *resp);
144 
145 /**
146  * wmi_extract_dcc_stats() - extract DCC stats from wmi event
147  * @wmi_handle: wmi handle
148  * @evt_buf: pointer to event buffer
149  * @response: DCC stats
150  *
151  * Since length of the response is variable, response buffer will be allocated.
152  * The caller must free the response buffer.
153  *
154  * Return: QDF_STATUS_SUCCESS on success
155  */
156 QDF_STATUS wmi_extract_dcc_stats(struct wmi_unified *wmi_handle,
157 				 void *evt_buf,
158 				 struct ocb_dcc_get_stats_response **response);
159 
160 #endif /* _WMI_UNIFIED_DSRC_API_H_ */
161