1 /* 2 * Copyright (c) 2017-2021 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: This file contains the API definitions for the Unified Wireless Module 20 * Interface (WMI) which are specific to Regulatory module. 21 */ 22 23 #ifndef _WMI_UNIFIED_REG_API_H_ 24 #define _WMI_UNIFIED_REG_API_H_ 25 26 #include "reg_services_public_struct.h" 27 /** 28 * wmi_extract_reg_chan_list_update_event() - function to update channel list 29 * @wmi_handle: wmi handle 30 * @event_buf: event buffer 31 * @reg_info: regulatory info 32 * @len: length of buffer 33 * 34 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error 35 */ 36 QDF_STATUS wmi_extract_reg_chan_list_update_event( 37 wmi_unified_t wmi_handle, 38 uint8_t *evt_buf, 39 struct cur_regulatory_info *reg_info, 40 uint32_t len); 41 42 #ifdef CONFIG_BAND_6GHZ 43 /** 44 * wmi_extract_reg_chan_list_ext_update_event() - function to update the 45 * extended channel list 46 * @wmi_handle: wmi handle 47 * @evt_buf: event buffer 48 * @reg_info: regulatory info 49 * @len: length of buffer 50 * 51 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error 52 */ 53 QDF_STATUS wmi_extract_reg_chan_list_ext_update_event(wmi_unified_t wmi_handle, 54 uint8_t *evt_buf, 55 struct cur_regulatory_info *reg_info, 56 uint32_t len); 57 58 #ifdef CONFIG_AFC_SUPPORT 59 /** 60 * wmi_extract_afc_event() - function to read the contents of the AFC event 61 * @wmi_handle: wmi handle 62 * @evt_buf: event buffer 63 * @afc_info: AFC regulatory info 64 * @len: length of buffer 65 * 66 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error 67 */ 68 QDF_STATUS wmi_extract_afc_event(wmi_unified_t wmi_handle, 69 uint8_t *evt_buf, 70 struct afc_regulatory_info *afc_info, 71 uint32_t len); 72 #endif 73 #endif 74 75 /* 76 * wmi_unified_send_stop_11d_scan_cmd() - stop 11d scan 77 * @wmi_handle: wmi handle 78 * @stop_11d_scan: pointer to 11d scan stop req. 79 * 80 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error 81 */ 82 QDF_STATUS wmi_unified_send_stop_11d_scan_cmd(wmi_unified_t wmi_handle, 83 struct reg_stop_11d_scan_req *stop_11d_scan); 84 85 /* 86 * wmi_unified_send_start_11d_scan_cmd() - start 11d scan 87 * @wmi_handle: wmi handle 88 * @start_11d_scan: pointer to 11d scan start req. 89 * 90 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error 91 */ 92 QDF_STATUS wmi_unified_send_start_11d_scan_cmd(wmi_unified_t wmi_handle, 93 struct reg_start_11d_scan_req *start_11d_scan); 94 95 /** 96 * wmi_extract_reg_11d_new_cc_event() - function to extract the 11d new country 97 * @wmi_handle: wmi handle 98 * @evt_buf: event buffer 99 * @reg_11d_new_cc: pointer to new 11d country info 100 * @len: length of buffer 101 * 102 * Return: 0 for success or error code 103 */ 104 QDF_STATUS wmi_extract_reg_11d_new_cc_event( 105 wmi_unified_t wmi_handle, 106 uint8_t *evt_buf, 107 struct reg_11d_new_country *reg_11d_new_cc, 108 uint32_t len); 109 110 /** 111 * wmi_unified_set_user_country_code_cmd_send() - WMI set country function 112 * @wmi_handle: wmi handle. 113 * @pdev_id: Pdev id 114 * @rd: User country code or regdomain 115 * 116 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 117 */ 118 QDF_STATUS wmi_unified_set_user_country_code_cmd_send( 119 wmi_unified_t wmi_handle, 120 uint8_t pdev_id, struct cc_regdmn_s *rd); 121 122 /** 123 * wmi_extract_reg_ch_avoid_event() - process freq avoid event 124 * @wmi_handle: wmi handle. 125 * @evt_buf: event buffer 126 * @ch_avoid_ind: buffer pointer to save the event processed data 127 * @len: length of buffer 128 * 129 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 130 */ 131 QDF_STATUS wmi_extract_reg_ch_avoid_event( 132 wmi_unified_t wmi_handle, 133 uint8_t *evt_buf, 134 struct ch_avoid_ind_type *ch_avoid_ind, 135 uint32_t len); 136 137 #endif /* _WMI_UNIFIED_REG_API_H_ */ 138