xref: /wlan-driver/qcacld-3.0/os_if/pre_cac/inc/osif_pre_cac.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 #ifndef _OSIF_PRE_CAC_H_
18 #define _OSIF_PRE_CAC_H_
19 
20 #include "wlan_objmgr_vdev_obj.h"
21 
22 #ifdef PRE_CAC_SUPPORT
23 
24 /**
25  * typedef osif_conditional_csa_ind_legacy_cb - CSA indication callback
26  * @vdev: vdev upon which channel switch is occurring
27  * @completed: true if channel switch has completed, false if channel
28  *             switch is being initiated
29  *
30  * This callback is to send conditional channel switch status
31  *
32  * Context: Any context.
33  * Return: QDF_STATUS
34  */
35 typedef void
36 	(*osif_conditional_csa_ind_legacy_cb)(struct wlan_objmgr_vdev *vdev,
37 					      bool completed);
38 
39 /**
40  * typedef osif_pre_cac_complete_status_legacy_cb - pre cac complete callback
41  * @psoc: SOC where pre-cac is required
42  * @vdev_id: ID of the vdev where pre-cac is required
43  * @status: QDF_STATUS_SUCCESS if pre-cac was successful, otherwise an
44  *          appropriate QDF error status code
45  *
46  * This callback is used to indicate the pre cac complete status
47  *
48  * Context: Any context.
49  * Return: None
50  */
51 typedef void
52 	(*osif_pre_cac_complete_status_legacy_cb)(struct wlan_objmgr_psoc *psoc,
53 						  uint8_t vdev_id,
54 						  QDF_STATUS status);
55 
56 /**
57  * struct osif_pre_cac_legacy_ops - pre cac legacy callbacks
58  * @conditional_csa_ind_legacy_cb: Callback for CSA indication
59  * @pre_cac_complete_legacy_cb: Callback for pre cac complete status
60  */
61 struct osif_pre_cac_legacy_ops {
62 	osif_conditional_csa_ind_legacy_cb conditional_csa_ind_legacy_cb;
63 	osif_pre_cac_complete_status_legacy_cb pre_cac_complete_legacy_cb;
64 };
65 
66 /**
67  * osif_pre_cac_set_legacy_cb() - Sets legacy callbacks to osif
68  * @osif_legacy_ops:  Function pointer to legacy ops structure
69  *
70  * API to set legacy callbacks to osif
71  * Context: Any context.
72  *
73  * Return: void
74  */
75 void
76 osif_pre_cac_set_legacy_cb(struct osif_pre_cac_legacy_ops *osif_legacy_ops);
77 
78 /**
79  * osif_pre_cac_reset_legacy_cb() - Resets legacy callbacks to osif
80  *
81  * API to reset legacy callbacks to osif
82  * Context: Any context.
83  *
84  * Return: void
85  */
86 void osif_pre_cac_reset_legacy_cb(void);
87 
88 /**
89  * osif_pre_cac_register_cb() - API to register pre cac callbacks.
90  *
91  * Return: QDF_STATUS
92  */
93 QDF_STATUS osif_pre_cac_register_cb(void);
94 #endif /* PRE_CAC_SUPPORT */
95 #endif /* _OSIF_PRE_CAC_H_ */
96