1 /*
2 * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
3 * Copyright (c) 2022-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 /**
21 * DOC: target_if_reg_11d.h
22 * This file contains regulatory target 11d scan interface.
23 */
24
25 #ifndef __TARGET_IF_REG_11D_H__
26 #define __TARGET_IF_REG_11D_H__
27
28 #include "qdf_types.h"
29 #include "target_if.h"
30 #include <wlan_objmgr_psoc_obj.h>
31 #include "target_if_reg.h"
32 #include "wmi_unified_api.h"
33 #include "wmi_unified_reg_api.h"
34
35 #ifdef TARGET_11D_SCAN
36 /**
37 * tgt_if_regulatory_is_11d_offloaded() - Check if reg 11d is offloaded.
38 * @psoc: psoc pointer
39 *
40 * Return: true if 11d is offloaded, else false.
41 */
42 bool tgt_if_regulatory_is_11d_offloaded(struct wlan_objmgr_psoc *psoc);
43
44 /**
45 * tgt_if_regulatory_register_11d_new_cc_handler() - Register for 11d country
46 * code event ID.
47 * @psoc: psoc pointer
48 * @arg: Pointer to args.
49 *
50 * Return: QDF_STATUS
51 */
52 QDF_STATUS tgt_if_regulatory_register_11d_new_cc_handler(
53 struct wlan_objmgr_psoc *psoc, void *arg);
54
55 /**
56 * tgt_if_regulatory_unregister_11d_new_cc_handler() - Unregister 11d country
57 * code event ID.
58 * @psoc: psoc pointer
59 * @arg: Pointer to args.
60 *
61 * Return: QDF_STATUS
62 */
63 QDF_STATUS tgt_if_regulatory_unregister_11d_new_cc_handler(
64 struct wlan_objmgr_psoc *psoc, void *arg);
65
66 /**
67 * tgt_if_regulatory_start_11d_scan() - Start 11d scan.
68 * @psoc: psoc pointer
69 * @reg_start_11d_scan_req: Pointer to 11d scan start request.
70 *
71 * Return: QDF_STATUS
72 */
73 QDF_STATUS tgt_if_regulatory_start_11d_scan(
74 struct wlan_objmgr_psoc *psoc,
75 struct reg_start_11d_scan_req *reg_start_11d_scan_req);
76
77 /**
78 * tgt_if_regulatory_stop_11d_scan() - Stop 11d scan.
79 * @psoc: psoc pointer
80 * @reg_stop_11d_scan_req: Pointer to 11d scan stop request.
81 *
82 * Return: QDF_STATUS
83 */
84 QDF_STATUS tgt_if_regulatory_stop_11d_scan(
85 struct wlan_objmgr_psoc *psoc,
86 struct reg_stop_11d_scan_req *reg_stop_11d_scan_req);
87
88 #else
89
90 static inline bool
tgt_if_regulatory_is_11d_offloaded(struct wlan_objmgr_psoc * psoc)91 tgt_if_regulatory_is_11d_offloaded(struct wlan_objmgr_psoc *psoc)
92 {
93 return false;
94 }
95
96 static inline QDF_STATUS
tgt_if_regulatory_register_11d_new_cc_handler(struct wlan_objmgr_psoc * psoc,void * arg)97 tgt_if_regulatory_register_11d_new_cc_handler(struct wlan_objmgr_psoc *psoc,
98 void *arg)
99 {
100 return QDF_STATUS_SUCCESS;
101 }
102
103 static inline QDF_STATUS
tgt_if_regulatory_unregister_11d_new_cc_handler(struct wlan_objmgr_psoc * psoc,void * arg)104 tgt_if_regulatory_unregister_11d_new_cc_handler(struct wlan_objmgr_psoc *psoc,
105 void *arg)
106 {
107 return QDF_STATUS_SUCCESS;
108 }
109
tgt_if_regulatory_start_11d_scan(struct wlan_objmgr_psoc * psoc,struct reg_start_11d_scan_req * reg_start_11d_scan_req)110 static inline QDF_STATUS tgt_if_regulatory_start_11d_scan(
111 struct wlan_objmgr_psoc *psoc,
112 struct reg_start_11d_scan_req *reg_start_11d_scan_req)
113 {
114 return QDF_STATUS_SUCCESS;
115 }
116
tgt_if_regulatory_stop_11d_scan(struct wlan_objmgr_psoc * psoc,struct reg_stop_11d_scan_req * reg_stop_11d_scan_req)117 static inline QDF_STATUS tgt_if_regulatory_stop_11d_scan(
118 struct wlan_objmgr_psoc *psoc,
119 struct reg_stop_11d_scan_req *reg_stop_11d_scan_req)
120 {
121 return QDF_STATUS_SUCCESS;
122 }
123 #endif
124 #endif
125