xref: /wlan-dirver/qca-wifi-host-cmn/umac/regulatory/core/src/reg_offload_11d_scan.h (revision dd4dc88b837a295134aa9869114a2efee0f4894b)
1 /*
2  * Copyright (c) 2018-2019 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 /**
20  * DOC: Add 11d utility functions
21  */
22 
23 #ifdef TARGET_11D_SCAN
24 /**
25  * reg_run_11d_state_machine() - 11d state machine function.
26  * @psoc: soc context
27  */
28 void reg_run_11d_state_machine(struct wlan_objmgr_psoc *psoc);
29 
30 /**
31  * reg_set_11d_country() - Set the 11d regulatory country
32  * @pdev: pdev device for country information
33  * @country: country value
34  *
35  * Return: QDF_STATUS
36  */
37 QDF_STATUS reg_set_11d_country(struct wlan_objmgr_pdev *pdev, uint8_t *country);
38 
39 /**
40  * reg_is_11d_scan_inprogress() - Check 11d scan is supported
41  * @psoc: psoc ptr
42  *
43  * Return: true if 11d scan supported, else false.
44  */
45 bool reg_is_11d_scan_inprogress(struct wlan_objmgr_psoc *psoc);
46 
47 /**
48  * reg_save_new_11d_country() - Save the 11d new country
49  * @psoc: psoc for country information
50  * @country: country value
51  *
52  * Return: QDF_STATUS
53  */
54 QDF_STATUS reg_save_new_11d_country(struct wlan_objmgr_psoc *psoc,
55 				    uint8_t *country);
56 
57 /**
58  * reg_is_11d_offloaded() - whether 11d offloaded supported or not
59  * @psoc: psoc ptr
60  *
61  * Return: bool
62  */
63 bool reg_is_11d_offloaded(struct wlan_objmgr_psoc *psoc);
64 
65 /**
66  * reg_11d_enabled_on_host() - know whether 11d enabled on host
67  * @psoc: psoc ptr
68  *
69  * Return: bool
70  */
71 bool reg_11d_enabled_on_host(struct wlan_objmgr_psoc *psoc);
72 
73 /**
74  * reg_11d_vdev_created_update() - vdev obj create callback
75  * @vdev: vdev pointer
76  *
77  * updates 11d state when a vdev is created.
78  *
79  * Return: Success or Failure
80  */
81 QDF_STATUS reg_11d_vdev_created_update(struct wlan_objmgr_vdev *vdev);
82 
83 /**
84  * reg_11d_vdev_delete_update() - update 11d state upon vdev delete
85  * @vdev: vdev pointer
86  *
87  * Return: Success or Failure
88  */
89 QDF_STATUS reg_11d_vdev_delete_update(struct wlan_objmgr_vdev *vdev);
90 
91 /**
92  * reg_set_11d_offloaded() - Set 11d offloaded flag
93  * @psoc: psoc ptr
94  * @val: 11d offloaded value
95  *
96  * Return: QDF_STATUS
97  */
98 QDF_STATUS reg_set_11d_offloaded(struct wlan_objmgr_psoc *psoc, bool val);
99 
100 #else
101 
102 static inline void reg_run_11d_state_machine(struct wlan_objmgr_psoc *psoc)
103 {
104 }
105 
106 static inline QDF_STATUS reg_set_11d_country(struct wlan_objmgr_pdev *pdev,
107 					     uint8_t *country)
108 {
109 	return QDF_STATUS_SUCCESS;
110 }
111 
112 static inline bool reg_is_11d_scan_inprogress(struct wlan_objmgr_psoc *psoc)
113 {
114 	return false;
115 }
116 
117 static inline QDF_STATUS reg_save_new_11d_country(struct wlan_objmgr_psoc *psoc,
118 						  uint8_t *country)
119 {
120 	return QDF_STATUS_SUCCESS;
121 }
122 
123 static inline bool reg_is_11d_offloaded(struct wlan_objmgr_psoc *psoc)
124 {
125 	return false;
126 }
127 
128 static inline bool reg_11d_enabled_on_host(struct wlan_objmgr_psoc *psoc)
129 {
130 	return false;
131 }
132 
133 static inline QDF_STATUS reg_11d_vdev_created_update(
134 	struct wlan_objmgr_vdev *vdev)
135 {
136 	return QDF_STATUS_SUCCESS;
137 }
138 
139 static inline QDF_STATUS reg_11d_vdev_delete_update(
140 	struct wlan_objmgr_vdev *vdev)
141 {
142 	return QDF_STATUS_SUCCESS;
143 }
144 
145 static inline QDF_STATUS reg_set_11d_offloaded(struct wlan_objmgr_psoc *psoc,
146 					       bool val)
147 {
148 	return QDF_STATUS_SUCCESS;
149 }
150 #endif
151