xref: /wlan-driver/qcacld-3.0/core/hdd/src/wlan_hdd_lpass.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #if !defined(WLAN_HDD_LPASS_H)
21 #define WLAN_HDD_LPASS_H
22 
23 struct cds_config_info;
24 struct wma_tgt_cfg;
25 struct hdd_context;
26 struct hdd_adapter;
27 
28 #ifdef WLAN_FEATURE_LPSS
29 /**
30  * hdd_lpass_target_config() - Handle LPASS target configuration
31  * @hdd_ctx: HDD global context where lpass information is stored
32  * @target_config: Target configuration containing lpass info
33  *
34  * This function updates the HDD context with lpass-specific
35  * information provided by the target.
36  *
37  * Return: none
38  */
39 void hdd_lpass_target_config(struct hdd_context *hdd_ctx,
40 			     struct wma_tgt_cfg *target_config);
41 
42 /**
43  * hdd_lpass_populate_cds_config() - Populate LPASS configuration
44  * @cds_config: CDS configuration to populate with lpass info
45  * @hdd_ctx: HDD global context which contains lpass information
46  *
47  * This function seeds the CDS configuration structure with
48  * lpass-specific information gleaned from the HDD context.
49  *
50  * Return: none
51  */
52 void hdd_lpass_populate_cds_config(struct cds_config_info *cds_config,
53 				   struct hdd_context *hdd_ctx);
54 
55 /**
56  * hdd_lpass_populate_pmo_config() - Populate LPASS configuration
57  * @pmo_config: PMO configuration to populate with lpass info
58  * @hdd_ctx: HDD global context which contains lpass information
59  *
60  * This function seeds the PMO configuration structure with
61  * lpass-specific information gleaned from the HDD context.
62  *
63  * Return: none
64  */
65 void hdd_lpass_populate_pmo_config(struct pmo_psoc_cfg *pmo_config,
66 				   struct hdd_context *hdd_ctx);
67 
68 /**
69  * hdd_lpass_notify_connect() - Notify LPASS of interface connect
70  * @link_info: Link info pointer in HDD adapter
71  *
72  * This function is used to notify the LPASS feature that an adapter
73  * has connected.
74  *
75  * Return: none
76  */
77 void hdd_lpass_notify_connect(struct wlan_hdd_link_info *link_info);
78 
79 /**
80  * hdd_lpass_notify_disconnect() - Notify LPASS of interface disconnect
81  * @link_info: Link info pointer in HDD adapter
82  *
83  * This function is used to notify the LPASS feature that an adapter
84  * has disconnected.
85  *
86  * Return: none
87  */
88 void hdd_lpass_notify_disconnect(struct wlan_hdd_link_info *link_info);
89 
90 /**
91  * hdd_lpass_notify_mode_change() - Notify LPASS of interface mode change
92  * @link_info: Link info pointer in HDD adapter
93  *
94  * This function is used to notify the LPASS feature that an adapter
95  * had its mode changed.
96  *
97  * Return: none
98  */
99 void hdd_lpass_notify_mode_change(struct wlan_hdd_link_info *link_info);
100 
101 /**
102  * hdd_lpass_notify_start() - Notify LPASS of driver start
103  * @link_info: Link info pointer in HDD adapter
104  *
105  * This function is used to notify the LPASS feature that the wlan
106  * driver has (re-)started.
107  *
108  * Return: none
109  */
110 void hdd_lpass_notify_start(struct wlan_hdd_link_info *link_info);
111 
112 /**
113  * hdd_lpass_notify_stop() - Notify LPASS of driver stop
114  * @hdd_ctx: The global HDD context
115  *
116  * This function is used to notify the LPASS feature that the wlan
117  * driver has stopped.
118  *
119  * Return: none
120  */
121 void hdd_lpass_notify_stop(struct hdd_context *hdd_ctx);
122 
123 /**
124  * hdd_lpass_is_supported() - Is lpass feature supported?
125  * @hdd_ctx: The global HDD context
126  *
127  * Return: true if feature is enabled and supported by firmware, false
128  * if the feature is not enabled or not supported by firmware.
129  */
130 bool hdd_lpass_is_supported(struct hdd_context *hdd_ctx);
131 
132 /*
133  * hdd_lpass_notify_wlan_version() - Notify LPASS WLAN Host/FW version
134  * @hdd_ctx: The global HDD context
135  *
136  * Notify LPASS for the WLAN host/firmware and hardware version.
137  *
138  * Return: none
139  */
140 void hdd_lpass_notify_wlan_version(struct hdd_context *hdd_ctx);
141 #else
hdd_lpass_target_config(struct hdd_context * hdd_ctx,struct wma_tgt_cfg * target_config)142 static inline void hdd_lpass_target_config(struct hdd_context *hdd_ctx,
143 					   struct wma_tgt_cfg *target_config)
144 {
145 }
146 static inline
hdd_lpass_populate_cds_config(struct cds_config_info * cds_config,struct hdd_context * hdd_ctx)147 void hdd_lpass_populate_cds_config(struct cds_config_info *cds_config,
148 				   struct hdd_context *hdd_ctx)
149 {
150 }
151 
152 static inline
hdd_lpass_populate_pmo_config(struct pmo_psoc_cfg * pmo_config,struct hdd_context * hdd_ctx)153 void hdd_lpass_populate_pmo_config(struct pmo_psoc_cfg *pmo_config,
154 				   struct hdd_context *hdd_ctx)
155 {
156 }
157 
158 static inline void
hdd_lpass_notify_connect(struct wlan_hdd_link_info * link_info)159 hdd_lpass_notify_connect(struct wlan_hdd_link_info *link_info)
160 {
161 }
162 
163 static inline void
hdd_lpass_notify_disconnect(struct wlan_hdd_link_info * link_info)164 hdd_lpass_notify_disconnect(struct wlan_hdd_link_info *link_info)
165 {
166 }
167 
168 static inline void
hdd_lpass_notify_mode_change(struct wlan_hdd_link_info * link_info)169 hdd_lpass_notify_mode_change(struct wlan_hdd_link_info *link_info)
170 {
171 }
172 
173 static inline void
hdd_lpass_notify_start(struct wlan_hdd_link_info * link_info)174 hdd_lpass_notify_start(struct wlan_hdd_link_info *link_info)
175 {
176 }
177 
hdd_lpass_notify_stop(struct hdd_context * hdd_ctx)178 static inline void hdd_lpass_notify_stop(struct hdd_context *hdd_ctx) { }
hdd_lpass_is_supported(struct hdd_context * hdd_ctx)179 static inline bool hdd_lpass_is_supported(struct hdd_context *hdd_ctx)
180 {
181 	return false;
182 }
183 
hdd_lpass_notify_wlan_version(struct hdd_context * hdd_ctx)184 static inline void hdd_lpass_notify_wlan_version(struct hdd_context *hdd_ctx)
185 {
186 }
187 
188 #endif
189 
190 #endif /* WLAN_HDD_LPASS_H */
191