1 /*
2  * Copyright (c) 2022-2023 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 /**
18  * DOC: wlan_qmi_wfds_api.h
19  *
20  * Contains QMI wrapper API declarations to connect and send messages to
21  * QMI WFDS server
22  */
23 #ifndef _WLAN_QMI_WFDS_API_H_
24 #define _WLAN_QMI_WFDS_API_H_
25 
26 #include "wlan_objmgr_psoc_obj.h"
27 #include "wlan_qmi_public_struct.h"
28 
29 #ifdef QMI_WFDS
30 /**
31  * wlan_qmi_wfds_init() - Initialize WFDS QMI client
32  * @psoc: PSOC handle
33  *
34  * Returns: QDF status
35  */
36 QDF_STATUS wlan_qmi_wfds_init(struct wlan_objmgr_psoc *psoc);
37 
38 /**
39  * wlan_qmi_wfds_deinit() - Deinitialize WFDS QMI client
40  * @psoc: PSOC handle
41  *
42  * Returns: None
43  */
44 void wlan_qmi_wfds_deinit(struct wlan_objmgr_psoc *psoc);
45 
46 /*
47  * wlan_qmi_wfds_send_config_msg() - Send config message to QMI server
48  *  to QMI server
49  * @psoc: PSOC handle
50  * @src_info: source information to be filled in QMI message
51  *
52  * Return: QDF status
53  */
54 QDF_STATUS
55 wlan_qmi_wfds_send_config_msg(struct wlan_objmgr_psoc *psoc,
56 			      struct wlan_qmi_wfds_config_req_msg *src_info);
57 
58 /*
59  * wlan_qmi_wfds_send_req_mem_msg() - Send Request Memory message to QMI server
60  * @psoc: PSOC handle
61  * @src_info: source information to be filled in QMI message
62  *
63  * Return: QDF status
64  */
65 QDF_STATUS
66 wlan_qmi_wfds_send_req_mem_msg(struct wlan_objmgr_psoc *psoc,
67 			       struct wlan_qmi_wfds_mem_req_msg *src_info);
68 
69 /*
70  * wlan_qmi_wfds_ipcc_map_n_cfg_msg() - Send the IPCC map and configure message
71  *  to QMI server
72  * @psoc: PSOC handle
73  * @src_info: source information to be filled in QMI message
74  *
75  * Return: QDF status
76  */
77 QDF_STATUS
78 wlan_qmi_wfds_ipcc_map_n_cfg_msg(struct wlan_objmgr_psoc *psoc,
79 			struct wlan_qmi_wfds_ipcc_map_n_cfg_req_msg *src_info);
80 
81 /*
82  * wlan_qmi_wfds_send_misc_req_msg() - Send the misc req message
83  *  to QMI server
84  * @psoc: PSOC handle
85  * @is_ssr: true if SSR is in progress else false
86  *
87  * Return: QDF status
88  */
89 QDF_STATUS
90 wlan_qmi_wfds_send_misc_req_msg(struct wlan_objmgr_psoc *psoc, bool is_ssr);
91 #else
92 static inline
wlan_qmi_wfds_init(struct wlan_objmgr_psoc * psoc)93 QDF_STATUS wlan_qmi_wfds_init(struct wlan_objmgr_psoc *psoc)
94 {
95 	return QDF_STATUS_E_NOSUPPORT;
96 }
97 
98 static inline
wlan_qmi_wfds_deinit(struct wlan_objmgr_psoc * psoc)99 void wlan_qmi_wfds_deinit(struct wlan_objmgr_psoc *psoc)
100 {
101 }
102 
103 static inline QDF_STATUS
104 wlan_qmi_wfds_send_config_msg(struct wlan_objmgr_psoc *psoc,
105 			      struct wlan_qmi_wfds_config_req_msg *src_info);
106 {
107 	return QDF_STATUS_E_NOSUPPORT;
108 }
109 
110 static inline QDF_STATUS
111 wlan_qmi_wfds_send_req_mem_msg(struct wlan_objmgr_psoc *psoc,
112 			       struct wlan_qmi_wfds_mem_req_msg *src_info);
113 {
114 	return QDF_STATUS_E_NOSUPPORT;
115 }
116 
117 static inline QDF_STATUS
wlan_qmi_wfds_ipcc_map_n_cfg_msg(struct wlan_objmgr_psoc * psoc,struct wlan_qmi_wfds_ipcc_map_n_cfg_req_msg * src_info)118 wlan_qmi_wfds_ipcc_map_n_cfg_msg(struct wlan_objmgr_psoc *psoc,
119 			struct wlan_qmi_wfds_ipcc_map_n_cfg_req_msg *src_info)
120 {
121 	return QDF_STATUS_E_NOSUPPORT;
122 }
123 
124 static inline QDF_STATUS
wlan_qmi_wfds_send_misc_req_msg(struct wlan_objmgr_psoc * psoc,bool is_ssr)125 wlan_qmi_wfds_send_misc_req_msg(struct wlan_objmgr_psoc *psoc, bool is_ssr)
126 {
127 	return QDF_STATUS_E_NOSUPPORT;
128 }
129 #endif
130 #endif
131