xref: /wlan-driver/qcacld-3.0/components/pre_cac/dispatcher/inc/wlan_pre_cac_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
3*5113495bSYour Name  *
4*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for any
5*5113495bSYour Name  * purpose with or without fee is hereby granted, provided that the above
6*5113495bSYour Name  * copyright notice and this permission notice appear in all copies.
7*5113495bSYour Name  *
8*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9*5113495bSYour Name  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10*5113495bSYour Name  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11*5113495bSYour Name  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12*5113495bSYour Name  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13*5113495bSYour Name  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14*5113495bSYour Name  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*5113495bSYour Name  */
16*5113495bSYour Name 
17*5113495bSYour Name /**
18*5113495bSYour Name  * DOC: Public API declarations of pre cac called from SAP module
19*5113495bSYour Name  */
20*5113495bSYour Name 
21*5113495bSYour Name #ifndef _WLAN_PRE_CAC_API_H_
22*5113495bSYour Name #define _WLAN_PRE_CAC_API_H_
23*5113495bSYour Name 
24*5113495bSYour Name #ifdef PRE_CAC_SUPPORT
25*5113495bSYour Name /**
26*5113495bSYour Name  * wlan_pre_cac_get_status(): status of pre_cac
27*5113495bSYour Name  * @psoc: psoc object manager
28*5113495bSYour Name  *
29*5113495bSYour Name  * Return: status of pre_cac
30*5113495bSYour Name  */
31*5113495bSYour Name bool wlan_pre_cac_get_status(struct wlan_objmgr_psoc *psoc);
32*5113495bSYour Name 
33*5113495bSYour Name /**
34*5113495bSYour Name  * wlan_pre_cac_set_status() - Set pre cac status
35*5113495bSYour Name  * @vdev: vdev object manager
36*5113495bSYour Name  * @status: status of pre_cac
37*5113495bSYour Name  *
38*5113495bSYour Name  * Sets pre_cac status
39*5113495bSYour Name  *
40*5113495bSYour Name  * Return: QDF_STATUS
41*5113495bSYour Name  */
42*5113495bSYour Name QDF_STATUS wlan_pre_cac_set_status(struct wlan_objmgr_vdev *vdev, bool status);
43*5113495bSYour Name 
44*5113495bSYour Name /**
45*5113495bSYour Name  * wlan_pre_cac_handle_cac_end() - Handle pre cac end
46*5113495bSYour Name  * @vdev: vdev object manager
47*5113495bSYour Name  *
48*5113495bSYour Name  * Return: None
49*5113495bSYour Name  */
50*5113495bSYour Name void wlan_pre_cac_handle_cac_end(struct wlan_objmgr_vdev *vdev);
51*5113495bSYour Name 
52*5113495bSYour Name /**
53*5113495bSYour Name  * wlan_pre_cac_complete_set() - Set pre cac complete status
54*5113495bSYour Name  * @vdev: vdev object manager
55*5113495bSYour Name  * @status: status
56*5113495bSYour Name  *
57*5113495bSYour Name  * Return: None
58*5113495bSYour Name  */
59*5113495bSYour Name void wlan_pre_cac_complete_set(struct wlan_objmgr_vdev *vdev,
60*5113495bSYour Name 			       bool status);
61*5113495bSYour Name 
62*5113495bSYour Name /**
63*5113495bSYour Name  * wlan_pre_cac_complete_get() - Get pre cac complete status
64*5113495bSYour Name  * @vdev: vdev object manager
65*5113495bSYour Name  *
66*5113495bSYour Name  * Return: pre cac complete status
67*5113495bSYour Name  */
68*5113495bSYour Name bool wlan_pre_cac_complete_get(struct wlan_objmgr_vdev *vdev);
69*5113495bSYour Name 
70*5113495bSYour Name /**
71*5113495bSYour Name  * wlan_pre_cac_set_freq_before_pre_cac() - Set frequency before pre cac
72*5113495bSYour Name  * @vdev: vdev object manager
73*5113495bSYour Name  * @freq: frequency
74*5113495bSYour Name  *
75*5113495bSYour Name  * Return: None
76*5113495bSYour Name  */
77*5113495bSYour Name void wlan_pre_cac_set_freq_before_pre_cac(struct wlan_objmgr_vdev *vdev,
78*5113495bSYour Name 					  qdf_freq_t freq);
79*5113495bSYour Name 
80*5113495bSYour Name /**
81*5113495bSYour Name  * wlan_pre_cac_get_freq_before_pre_cac() - Get frequency before pre cac
82*5113495bSYour Name  * @vdev: vdev object manager
83*5113495bSYour Name  *
84*5113495bSYour Name  * Return: Frequency before pre cac
85*5113495bSYour Name  */
86*5113495bSYour Name qdf_freq_t
87*5113495bSYour Name wlan_pre_cac_get_freq_before_pre_cac(struct wlan_objmgr_vdev *vdev);
88*5113495bSYour Name 
89*5113495bSYour Name /**
90*5113495bSYour Name  * wlan_pre_cac_handle_radar_ind() - Handle pre cac radar indication
91*5113495bSYour Name  * @vdev: vdev object manager
92*5113495bSYour Name  *
93*5113495bSYour Name  * Return: None
94*5113495bSYour Name  */
95*5113495bSYour Name void wlan_pre_cac_handle_radar_ind(struct wlan_objmgr_vdev *vdev);
96*5113495bSYour Name #else
97*5113495bSYour Name static inline void
wlansap_pre_cac_end_notify(struct sap_context * sap_context,struct mac_context * mac,uint8_t intf)98*5113495bSYour Name wlansap_pre_cac_end_notify(struct sap_context *sap_context,
99*5113495bSYour Name 			   struct mac_context *mac,
100*5113495bSYour Name 			   uint8_t intf)
101*5113495bSYour Name {
102*5113495bSYour Name }
103*5113495bSYour Name 
wlan_pre_cac_get_status(struct wlan_objmgr_psoc * psoc)104*5113495bSYour Name static inline bool wlan_pre_cac_get_status(struct wlan_objmgr_psoc *psoc)
105*5113495bSYour Name {
106*5113495bSYour Name 	return false;
107*5113495bSYour Name }
108*5113495bSYour Name 
109*5113495bSYour Name static inline QDF_STATUS
wlan_pre_cac_set_status(struct wlan_objmgr_vdev * vdev,bool status)110*5113495bSYour Name wlan_pre_cac_set_status(struct wlan_objmgr_vdev *vdev, bool status)
111*5113495bSYour Name {
112*5113495bSYour Name 	return false;
113*5113495bSYour Name }
114*5113495bSYour Name 
115*5113495bSYour Name static inline void
wlan_pre_cac_handle_cac_end(struct wlan_objmgr_vdev * vdev)116*5113495bSYour Name wlan_pre_cac_handle_cac_end(struct wlan_objmgr_vdev *vdev)
117*5113495bSYour Name {
118*5113495bSYour Name }
119*5113495bSYour Name 
120*5113495bSYour Name static inline void
wlan_pre_cac_complete_set(struct wlan_objmgr_vdev * vdev,bool status)121*5113495bSYour Name wlan_pre_cac_complete_set(struct wlan_objmgr_vdev *vdev,
122*5113495bSYour Name 			  bool status)
123*5113495bSYour Name {
124*5113495bSYour Name }
125*5113495bSYour Name 
126*5113495bSYour Name static inline bool
wlan_pre_cac_complete_get(struct wlan_objmgr_vdev * vdev)127*5113495bSYour Name wlan_pre_cac_complete_get(struct wlan_objmgr_vdev *vdev)
128*5113495bSYour Name {
129*5113495bSYour Name 	return false;
130*5113495bSYour Name }
131*5113495bSYour Name 
132*5113495bSYour Name static inline void
wlan_pre_cac_set_freq_before_pre_cac(struct wlan_objmgr_vdev * vdev,qdf_freq_t freq)133*5113495bSYour Name wlan_pre_cac_set_freq_before_pre_cac(struct wlan_objmgr_vdev *vdev,
134*5113495bSYour Name 				     qdf_freq_t freq)
135*5113495bSYour Name {
136*5113495bSYour Name }
137*5113495bSYour Name 
138*5113495bSYour Name static inline qdf_freq_t
wlan_pre_cac_get_freq_before_pre_cac(struct wlan_objmgr_vdev * vdev)139*5113495bSYour Name wlan_pre_cac_get_freq_before_pre_cac(struct wlan_objmgr_vdev *vdev)
140*5113495bSYour Name {
141*5113495bSYour Name 	return 0;
142*5113495bSYour Name }
143*5113495bSYour Name #endif /* PRE_CAC_SUPPORT */
144*5113495bSYour Name #endif /* _WLAN_PRE_CAC_API_H_ */
145