1 /*
2 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. 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: This file contains ll_sap north bound interface declarations
21 */
22
23 #ifndef _WLAN_LL_SAP_UCFG_API_H_
24 #define _WLAN_LL_SAP_UCFG_API_H_
25 #include "wlan_ll_sap_public_structs.h"
26
27 #ifdef WLAN_FEATURE_LL_LT_SAP
28
29 /**
30 * ucfg_ll_sap_init() - initializes ll_sap component
31 *
32 * Return: QDF status
33 */
34 QDF_STATUS ucfg_ll_sap_init(void);
35
36 /**
37 * ucfg_ll_sap_deinit() - De-initializes ll_sap component
38 *
39 * Return: QDF status
40 */
41 QDF_STATUS ucfg_ll_sap_deinit(void);
42
43 /**
44 * ucfg_is_ll_lt_sap_supported() - Check if ll_lt_sap is supported or not
45 *@psoc: Psoc pointer
46 *
47 * Return: True/False
48 */
49 bool ucfg_is_ll_lt_sap_supported(struct wlan_objmgr_psoc *psoc);
50
51 /**
52 * ucfg_ll_lt_sap_request_for_audio_transport_switch() - Request to switch the
53 * audio transport medium
54 * @vdev: Vdev on which the request is received
55 * @req_type: Requested transport switch type
56 *
57 * Return: Accepted/Rejected
58 */
59 QDF_STATUS ucfg_ll_lt_sap_request_for_audio_transport_switch(
60 struct wlan_objmgr_vdev *vdev,
61 enum bearer_switch_req_type req_type);
62
63 /**
64 * ucfg_ll_lt_sap_deliver_audio_transport_switch_resp() - Deliver audio
65 * transport switch response
66 * @vdev: Vdev on which the request is received
67 * @req_type: Transport switch type for which the response is received
68 * @status: Status of the response
69 *
70 * Return: None
71 */
72 void ucfg_ll_lt_sap_deliver_audio_transport_switch_resp(
73 struct wlan_objmgr_vdev *vdev,
74 enum bearer_switch_req_type req_type,
75 enum bearer_switch_status status);
76
77 /**
78 * ucfg_ll_sap_register_cb() - Register ll_sap osif callbacks
79 * @ll_sap_global_ops: Ops which needs to be registered
80 *
81 * Return: None
82 */
83 void ucfg_ll_sap_register_cb(struct ll_sap_ops *ll_sap_global_ops);
84
85 /**
86 * ucfg_ll_sap_unregister_cb() - Un-register ll_sap osif callbacks
87 *
88 * Return: None
89 */
90 void ucfg_ll_sap_unregister_cb(void);
91
92 /**
93 * ucfg_ll_sap_psoc_enable() - Enable ll_lt_sap psoc
94 * @psoc: objmgr psoc pointer
95 *
96 * Return: QDF_STATUS
97 */
98 QDF_STATUS ucfg_ll_sap_psoc_enable(struct wlan_objmgr_psoc *psoc);
99
100 /**
101 * ucfg_ll_sap_psoc_disable() - Disable ll_lt_sap psoc
102 * @psoc: objmgr psoc pointer
103 *
104 * Return: QDF_STATUS
105 */
106 QDF_STATUS ucfg_ll_sap_psoc_disable(struct wlan_objmgr_psoc *psoc);
107
108 #else
ucfg_ll_sap_init(void)109 static inline QDF_STATUS ucfg_ll_sap_init(void)
110 {
111 return QDF_STATUS_SUCCESS;
112 }
113
ucfg_ll_sap_deinit(void)114 static inline QDF_STATUS ucfg_ll_sap_deinit(void)
115 {
116 return QDF_STATUS_SUCCESS;
117 }
118
ucfg_is_ll_lt_sap_supported(struct wlan_objmgr_psoc * psoc)119 static inline bool ucfg_is_ll_lt_sap_supported(struct wlan_objmgr_psoc *psoc)
120 {
121 return false;
122 }
123
124 static inline QDF_STATUS
ucfg_ll_lt_sap_request_for_audio_transport_switch(struct wlan_objmgr_vdev * vdev,enum bearer_switch_req_type req_type)125 ucfg_ll_lt_sap_request_for_audio_transport_switch(
126 struct wlan_objmgr_vdev *vdev,
127 enum bearer_switch_req_type req_type)
128 {
129 return QDF_STATUS_E_INVAL;
130 }
131
132 static inline void
ucfg_ll_lt_sap_deliver_audio_transport_switch_resp(struct wlan_objmgr_vdev * vdev,enum bearer_switch_req_type req_type,enum bearer_switch_status status)133 ucfg_ll_lt_sap_deliver_audio_transport_switch_resp(
134 struct wlan_objmgr_vdev *vdev,
135 enum bearer_switch_req_type req_type,
136 enum bearer_switch_status status)
137 {
138 }
139
ucfg_ll_sap_register_cb(struct ll_sap_ops * ll_sap_global_ops)140 static inline void ucfg_ll_sap_register_cb(struct ll_sap_ops *ll_sap_global_ops)
141 {
142 }
143
ucfg_ll_sap_unregister_cb(void)144 static inline void ucfg_ll_sap_unregister_cb(void)
145 {
146 }
147
ucfg_ll_sap_psoc_enable(struct wlan_objmgr_psoc * psoc)148 static inline QDF_STATUS ucfg_ll_sap_psoc_enable(struct wlan_objmgr_psoc *psoc)
149 {
150 return QDF_STATUS_SUCCESS;
151 }
152
ucfg_ll_sap_psoc_disable(struct wlan_objmgr_psoc * psoc)153 static inline QDF_STATUS ucfg_ll_sap_psoc_disable(struct wlan_objmgr_psoc *psoc)
154 {
155 return QDF_STATUS_SUCCESS;
156 }
157
158 #endif /* WLAN_FEATURE_LL_LT_SAP */
159 #endif /* _WLAN_LL_SAP_UCFG_API_H_ */
160
161