blob: 4cfa3ae155c324a008eae5cde5e7b2774093b8bc [file] [log] [blame]
Baila, Shashikala Prabhuaf7fd902017-03-17 10:21:14 +05301/*
Himanshu Batra21319222019-06-28 16:19:32 +05302 * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
Baila, Shashikala Prabhuaf7fd902017-03-17 10:21:14 +05303 *
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/**
21 * DOC: Implement API's specific to Regulatory component.
22 */
23
24#include <qdf_status.h>
Manikandan Mohan3fc65922018-03-01 16:23:30 -080025#include <qdf_module.h>
Baila, Shashikala Prabhuaf7fd902017-03-17 10:21:14 +053026#include <wmi_unified_api.h>
27#include <wmi_unified_priv.h>
28#include <wmi_unified_reg_api.h>
29
Himanshu Batra21319222019-06-28 16:19:32 +053030QDF_STATUS wmi_extract_reg_chan_list_update_event(
31 wmi_unified_t wmi_handle,
32 uint8_t *evt_buf,
33 struct cur_regulatory_info *reg_info,
34 uint32_t len)
Baila, Shashikala Prabhuaf7fd902017-03-17 10:21:14 +053035{
Vignesh Uc224b9e2018-07-26 14:08:29 +053036 if (wmi_handle && wmi_handle->ops->extract_reg_chan_list_update_event)
Baila, Shashikala Prabhuaf7fd902017-03-17 10:21:14 +053037 return wmi_handle->ops->extract_reg_chan_list_update_event
38 (wmi_handle,
39 evt_buf, reg_info, len);
40
41 return QDF_STATUS_E_FAILURE;
42}
Manikandan Mohan3fc65922018-03-01 16:23:30 -080043qdf_export_symbol(wmi_extract_reg_chan_list_update_event);
Kiran Kumar Lokere82c86452017-04-26 19:51:29 -070044
45/*
46 * wmi_unified_send_start_11d_scan_cmd() - start 11d scan
47 * @wmi_handle: wmi handle
48 * @start_11d_scan: pointer to 11d scan start req.
49 *
50 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
51 */
52QDF_STATUS wmi_unified_send_start_11d_scan_cmd(wmi_unified_t wmi_handle,
53 struct reg_start_11d_scan_req *start_11d_scan)
54{
55 if (wmi_handle->ops->send_start_11d_scan_cmd)
56 return wmi_handle->ops->send_start_11d_scan_cmd(wmi_handle,
57 start_11d_scan);
58
59 return QDF_STATUS_E_FAILURE;
60}
Manikandan Mohan3fc65922018-03-01 16:23:30 -080061qdf_export_symbol(wmi_unified_send_start_11d_scan_cmd);
Kiran Kumar Lokere82c86452017-04-26 19:51:29 -070062
63/*
64 * wmi_unified_send_stop_11d_scan_cmd() - stop 11d scan
65 * @wmi_handle: wmi handle
66 * @stop_11d_scan: pointer to 11d scan stop req.
67 *
68 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
69 */
70QDF_STATUS wmi_unified_send_stop_11d_scan_cmd(wmi_unified_t wmi_handle,
71 struct reg_stop_11d_scan_req *stop_11d_scan)
72{
73 if (wmi_handle->ops->send_stop_11d_scan_cmd)
74 return wmi_handle->ops->send_stop_11d_scan_cmd(wmi_handle,
75 stop_11d_scan);
76
77 return QDF_STATUS_E_FAILURE;
78}
Manikandan Mohan3fc65922018-03-01 16:23:30 -080079qdf_export_symbol(wmi_unified_send_stop_11d_scan_cmd);
Kiran Kumar Lokere82c86452017-04-26 19:51:29 -070080
Himanshu Batra21319222019-06-28 16:19:32 +053081QDF_STATUS wmi_extract_reg_11d_new_cc_event(
82 wmi_unified_t wmi_handle,
Kiran Kumar Lokere82c86452017-04-26 19:51:29 -070083 uint8_t *evt_buf,
84 struct reg_11d_new_country *reg_11d_new_cc,
85 uint32_t len)
86{
Vignesh Uc224b9e2018-07-26 14:08:29 +053087 if (wmi_handle && wmi_handle->ops->extract_reg_11d_new_country_event)
Kiran Kumar Lokere82c86452017-04-26 19:51:29 -070088 return wmi_handle->ops->extract_reg_11d_new_country_event(
89 wmi_handle, evt_buf, reg_11d_new_cc, len);
90
91 return QDF_STATUS_E_FAILURE;
92}
Manikandan Mohan3fc65922018-03-01 16:23:30 -080093qdf_export_symbol(wmi_extract_reg_11d_new_cc_event);
Kiran Kumar Lokere82c86452017-04-26 19:51:29 -070094
Himanshu Batra21319222019-06-28 16:19:32 +053095QDF_STATUS wmi_unified_set_user_country_code_cmd_send(
96 wmi_unified_t wmi_handle,
Abhijit Pradhan59626eb2017-06-29 12:32:20 +053097 uint8_t pdev_id, struct cc_regdmn_s *rd)
98{
Abhijit Pradhan59626eb2017-06-29 12:32:20 +053099 if (wmi_handle->ops->send_user_country_code_cmd)
100 return wmi_handle->ops->send_user_country_code_cmd(
101 wmi_handle, pdev_id, rd);
102
103 return QDF_STATUS_E_FAILURE;
104}
Manikandan Mohan3fc65922018-03-01 16:23:30 -0800105qdf_export_symbol(wmi_unified_set_user_country_code_cmd_send);
Kiran Kumar Lokerea78b4bf2017-06-30 19:13:02 -0700106
Himanshu Batra21319222019-06-28 16:19:32 +0530107QDF_STATUS wmi_extract_reg_ch_avoid_event(
108 wmi_unified_t wmi_handle,
Kiran Kumar Lokerea78b4bf2017-06-30 19:13:02 -0700109 uint8_t *evt_buf,
110 struct ch_avoid_ind_type *ch_avoid_ind,
111 uint32_t len)
112{
Vignesh Uc224b9e2018-07-26 14:08:29 +0530113 if (wmi_handle && wmi_handle->ops->extract_reg_ch_avoid_event)
Kiran Kumar Lokerea78b4bf2017-06-30 19:13:02 -0700114 return wmi_handle->ops->extract_reg_ch_avoid_event(
115 wmi_handle, evt_buf, ch_avoid_ind, len);
116
117 return QDF_STATUS_E_FAILURE;
118}
Manikandan Mohan3fc65922018-03-01 16:23:30 -0800119qdf_export_symbol(wmi_extract_reg_ch_avoid_event);