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