1 /*
2  * Copyright 2016, The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include <stdint.h>
18 #include "wifi_hal.h"
19 #include "wifi_hal_stub.h"
20 
wifi_initialize_stub(wifi_handle * handle)21 wifi_error wifi_initialize_stub(wifi_handle *handle) {
22     return WIFI_ERROR_NOT_SUPPORTED;
23 }
24 
wifi_cleanup_stub(wifi_handle handle,wifi_cleaned_up_handler handler)25 void wifi_cleanup_stub(wifi_handle handle, wifi_cleaned_up_handler handler) {
26 }
27 
wifi_event_loop_stub(wifi_handle handle)28 void wifi_event_loop_stub(wifi_handle handle) {
29 
30 }
31 
wifi_get_error_info_stub(wifi_error err,const char ** msg)32 void wifi_get_error_info_stub(wifi_error err, const char **msg) {
33     *msg = NULL;
34 }
35 
wifi_get_supported_feature_set_stub(wifi_interface_handle handle,feature_set * set)36 wifi_error wifi_get_supported_feature_set_stub(wifi_interface_handle handle, feature_set *set) {
37     return WIFI_ERROR_UNINITIALIZED;
38 }
39 
wifi_get_concurrency_matrix_stub(wifi_interface_handle handle,int max_size,feature_set * matrix,int * size)40 wifi_error wifi_get_concurrency_matrix_stub(wifi_interface_handle handle, int max_size,
41         feature_set *matrix, int *size) {
42     return WIFI_ERROR_UNINITIALIZED;
43 }
44 
wifi_set_scanning_mac_oui_stub(wifi_interface_handle handle,unsigned char * oui_data)45 wifi_error wifi_set_scanning_mac_oui_stub(wifi_interface_handle handle, unsigned char *oui_data) {
46     return WIFI_ERROR_UNINITIALIZED;
47 }
48 
49 /* List of all supported channels, including 5GHz channels */
wifi_get_supported_channels_stub(wifi_handle handle,int * size,wifi_channel * list)50 wifi_error wifi_get_supported_channels_stub(wifi_handle handle, int *size, wifi_channel *list) {
51     return WIFI_ERROR_UNINITIALIZED;
52 }
53 
54 /* Enhanced power reporting */
wifi_is_epr_supported_stub(wifi_handle handle)55 wifi_error wifi_is_epr_supported_stub(wifi_handle handle) {
56     return WIFI_ERROR_UNINITIALIZED;
57 }
58 
59 /* multiple interface support */
wifi_get_ifaces_stub(wifi_handle handle,int * num_ifaces,wifi_interface_handle ** ifaces)60 wifi_error wifi_get_ifaces_stub(wifi_handle handle, int *num_ifaces, wifi_interface_handle **ifaces) {
61     return WIFI_ERROR_UNINITIALIZED;
62 }
63 
wifi_get_iface_name_stub(wifi_interface_handle iface,char * name,size_t size)64 wifi_error wifi_get_iface_name_stub(wifi_interface_handle iface, char *name, size_t size) {
65     return WIFI_ERROR_UNINITIALIZED;
66 }
67 
wifi_set_iface_event_handler_stub(wifi_request_id id,wifi_interface_handle iface,wifi_event_handler eh)68 wifi_error wifi_set_iface_event_handler_stub(wifi_request_id id,
69             wifi_interface_handle iface, wifi_event_handler eh) {
70     return WIFI_ERROR_UNINITIALIZED;
71 }
72 
wifi_reset_iface_event_handler_stub(wifi_request_id id,wifi_interface_handle iface)73 wifi_error wifi_reset_iface_event_handler_stub(wifi_request_id id, wifi_interface_handle iface) {
74     return WIFI_ERROR_UNINITIALIZED;
75 }
76 
wifi_start_gscan_stub(wifi_request_id id,wifi_interface_handle iface,wifi_scan_cmd_params params,wifi_scan_result_handler handler)77 wifi_error wifi_start_gscan_stub(wifi_request_id id, wifi_interface_handle iface,
78         wifi_scan_cmd_params params, wifi_scan_result_handler handler) {
79     return WIFI_ERROR_UNINITIALIZED;
80 }
81 
wifi_stop_gscan_stub(wifi_request_id id,wifi_interface_handle iface)82 wifi_error wifi_stop_gscan_stub(wifi_request_id id, wifi_interface_handle iface) {
83     return WIFI_ERROR_UNINITIALIZED;
84 }
85 
wifi_get_cached_gscan_results_stub(wifi_interface_handle iface,byte flush,int max,wifi_cached_scan_results * results,int * num)86 wifi_error wifi_get_cached_gscan_results_stub(wifi_interface_handle iface, byte flush,
87         int max, wifi_cached_scan_results *results, int *num) {
88     return WIFI_ERROR_UNINITIALIZED;
89 }
90 
wifi_set_bssid_hotlist_stub(wifi_request_id id,wifi_interface_handle iface,wifi_bssid_hotlist_params params,wifi_hotlist_ap_found_handler handler)91 wifi_error wifi_set_bssid_hotlist_stub(wifi_request_id id, wifi_interface_handle iface,
92         wifi_bssid_hotlist_params params, wifi_hotlist_ap_found_handler handler) {
93     return WIFI_ERROR_UNINITIALIZED;
94 }
95 
wifi_reset_bssid_hotlist_stub(wifi_request_id id,wifi_interface_handle iface)96 wifi_error wifi_reset_bssid_hotlist_stub(wifi_request_id id, wifi_interface_handle iface) {
97     return WIFI_ERROR_UNINITIALIZED;
98 }
99 
wifi_set_significant_change_handler_stub(wifi_request_id id,wifi_interface_handle iface,wifi_significant_change_params params,wifi_significant_change_handler handler)100 wifi_error wifi_set_significant_change_handler_stub(wifi_request_id id, wifi_interface_handle iface,
101         wifi_significant_change_params params, wifi_significant_change_handler handler) {
102     return WIFI_ERROR_UNINITIALIZED;
103 }
104 
wifi_reset_significant_change_handler_stub(wifi_request_id id,wifi_interface_handle iface)105 wifi_error wifi_reset_significant_change_handler_stub(wifi_request_id id, wifi_interface_handle iface) {
106     return WIFI_ERROR_UNINITIALIZED;
107 }
108 
wifi_get_gscan_capabilities_stub(wifi_interface_handle handle,wifi_gscan_capabilities * capabilities)109 wifi_error wifi_get_gscan_capabilities_stub(wifi_interface_handle handle,
110         wifi_gscan_capabilities *capabilities) {
111     return WIFI_ERROR_UNINITIALIZED;
112 }
113 
wifi_set_link_stats_stub(wifi_interface_handle iface,wifi_link_layer_params params)114 wifi_error wifi_set_link_stats_stub(wifi_interface_handle iface, wifi_link_layer_params params) {
115     return WIFI_ERROR_UNINITIALIZED;
116 }
117 
wifi_get_link_stats_stub(wifi_request_id id,wifi_interface_handle iface,wifi_stats_result_handler handler)118 wifi_error wifi_get_link_stats_stub(wifi_request_id id,
119         wifi_interface_handle iface, wifi_stats_result_handler handler) {
120     return WIFI_ERROR_UNINITIALIZED;
121 }
122 
wifi_clear_link_stats_stub(wifi_interface_handle iface,u32 stats_clear_req_mask,u32 * stats_clear_rsp_mask,u8 stop_req,u8 * stop_rsp)123 wifi_error wifi_clear_link_stats_stub(wifi_interface_handle iface,
124       u32 stats_clear_req_mask, u32 *stats_clear_rsp_mask, u8 stop_req, u8 *stop_rsp) {
125     return WIFI_ERROR_UNINITIALIZED;
126 }
127 
wifi_get_valid_channels_stub(wifi_interface_handle handle,int band,int max_channels,wifi_channel * channels,int * num_channels)128 wifi_error wifi_get_valid_channels_stub(wifi_interface_handle handle,
129         int band, int max_channels, wifi_channel *channels, int *num_channels) {
130     return WIFI_ERROR_UNINITIALIZED;
131 }
132 
133 /* API to request RTT measurement */
wifi_rtt_range_request_stub(wifi_request_id id,wifi_interface_handle iface,unsigned num_rtt_config,wifi_rtt_config rtt_config[],wifi_rtt_event_handler handler)134 wifi_error wifi_rtt_range_request_stub(wifi_request_id id, wifi_interface_handle iface,
135         unsigned num_rtt_config, wifi_rtt_config rtt_config[], wifi_rtt_event_handler handler) {
136     return WIFI_ERROR_NOT_SUPPORTED;
137 }
138 
139 /* API to cancel RTT measurements */
wifi_rtt_range_cancel_stub(wifi_request_id id,wifi_interface_handle iface,unsigned num_devices,mac_addr addr[])140 wifi_error wifi_rtt_range_cancel_stub(wifi_request_id id,  wifi_interface_handle iface,
141         unsigned num_devices, mac_addr addr[]) {
142     return WIFI_ERROR_NOT_SUPPORTED;
143 }
144 
145 /* API to get RTT capability */
wifi_get_rtt_capabilities_stub(wifi_interface_handle iface,wifi_rtt_capabilities * capabilities)146 wifi_error wifi_get_rtt_capabilities_stub(wifi_interface_handle iface,
147         wifi_rtt_capabilities *capabilities)
148 {
149     return WIFI_ERROR_NOT_SUPPORTED;
150 }
151 
152 /* API to enable RTT responder role */
wifi_enable_responder_stub(wifi_request_id id,wifi_interface_handle iface,wifi_channel_info channel_hint,unsigned max_duration_seconds,wifi_channel_info * channel_used)153 wifi_error wifi_enable_responder_stub(wifi_request_id id, wifi_interface_handle iface,
154         wifi_channel_info channel_hint, unsigned max_duration_seconds,
155         wifi_channel_info* channel_used) {
156     return WIFI_ERROR_NOT_SUPPORTED;
157 }
158 
159 /* API to disable RTT responder role */
wifi_disable_responder_stub(wifi_request_id id,wifi_interface_handle iface)160 wifi_error wifi_disable_responder_stub(wifi_request_id id, wifi_interface_handle iface) {
161     return WIFI_ERROR_NOT_SUPPORTED;
162 }
163 
164 /* API to get available channel for RTT responder role */
wifi_rtt_get_available_channel_stub(wifi_interface_handle iface,wifi_channel_info * channel)165 wifi_error wifi_rtt_get_available_channel_stub(wifi_interface_handle iface, wifi_channel_info* channel) {
166     return WIFI_ERROR_NOT_SUPPORTED;
167 }
168 
wifi_set_nodfs_flag_stub(wifi_interface_handle iface,u32 nodfs)169 wifi_error wifi_set_nodfs_flag_stub(wifi_interface_handle iface, u32 nodfs) {
170     return WIFI_ERROR_NOT_SUPPORTED;
171 }
172 
wifi_start_logging_stub(wifi_interface_handle iface,u32 verbose_level,u32 flags,u32 max_interval_sec,u32 min_data_size,char * buffer_name)173 wifi_error wifi_start_logging_stub(wifi_interface_handle iface, u32 verbose_level, u32 flags,
174         u32 max_interval_sec, u32 min_data_size, char *buffer_name) {
175             return WIFI_ERROR_NOT_SUPPORTED;
176 }
177 
wifi_set_epno_list_stub(int id,wifi_interface_info * iface,const wifi_epno_params * params,wifi_epno_handler handler)178 wifi_error wifi_set_epno_list_stub(int id, wifi_interface_info *iface,
179         const wifi_epno_params *params, wifi_epno_handler handler) {
180     return WIFI_ERROR_NOT_SUPPORTED;
181 }
182 
wifi_reset_epno_list_stub(int id,wifi_interface_info * iface)183 wifi_error wifi_reset_epno_list_stub(int id, wifi_interface_info *iface) {
184     return WIFI_ERROR_NOT_SUPPORTED;
185 }
186 
wifi_set_country_code_stub(wifi_interface_handle iface,const char * code)187 wifi_error wifi_set_country_code_stub(wifi_interface_handle iface, const char *code) {
188     return WIFI_ERROR_NOT_SUPPORTED;
189 }
190 
wifi_get_firmware_memory_dump_stub(wifi_interface_handle iface,wifi_firmware_memory_dump_handler handler)191 wifi_error wifi_get_firmware_memory_dump_stub( wifi_interface_handle iface,
192         wifi_firmware_memory_dump_handler handler){
193     return WIFI_ERROR_NOT_SUPPORTED;
194 }
195 
wifi_set_log_handler_stub(wifi_request_id id,wifi_interface_handle iface,wifi_ring_buffer_data_handler handler)196 wifi_error wifi_set_log_handler_stub(wifi_request_id id, wifi_interface_handle iface,
197         wifi_ring_buffer_data_handler handler) {
198     return WIFI_ERROR_NOT_SUPPORTED;
199 }
200 
wifi_reset_log_handler_stub(wifi_request_id id,wifi_interface_handle iface)201 wifi_error wifi_reset_log_handler_stub(wifi_request_id id, wifi_interface_handle iface) {
202     return WIFI_ERROR_NOT_SUPPORTED;
203 }
204 
wifi_set_alert_handler_stub(wifi_request_id id,wifi_interface_handle iface,wifi_alert_handler handler)205 wifi_error wifi_set_alert_handler_stub(wifi_request_id id, wifi_interface_handle iface,
206         wifi_alert_handler handler) {
207     return WIFI_ERROR_NOT_SUPPORTED;
208 }
209 
wifi_reset_alert_handler_stub(wifi_request_id id,wifi_interface_handle iface)210 wifi_error wifi_reset_alert_handler_stub(wifi_request_id id, wifi_interface_handle iface) {
211     return WIFI_ERROR_NOT_SUPPORTED;
212 }
213 
wifi_get_firmware_version_stub(wifi_interface_handle iface,char * buffer,int buffer_size)214 wifi_error wifi_get_firmware_version_stub( wifi_interface_handle iface, char *buffer,
215         int buffer_size) {
216     return WIFI_ERROR_NOT_SUPPORTED;
217 }
218 
wifi_get_ring_buffers_status_stub(wifi_interface_handle iface,u32 * num_rings,wifi_ring_buffer_status * status)219 wifi_error wifi_get_ring_buffers_status_stub(wifi_interface_handle iface,
220         u32 *num_rings, wifi_ring_buffer_status *status) {
221     return WIFI_ERROR_NOT_SUPPORTED;
222 }
223 
wifi_get_logger_supported_feature_set_stub(wifi_interface_handle iface,unsigned int * support)224 wifi_error wifi_get_logger_supported_feature_set_stub(wifi_interface_handle iface,
225         unsigned int *support) {
226     return WIFI_ERROR_NOT_SUPPORTED;
227 }
228 
wifi_get_ring_data_stub(wifi_interface_handle iface,char * ring_name)229 wifi_error wifi_get_ring_data_stub(wifi_interface_handle iface, char *ring_name) {
230     return WIFI_ERROR_NOT_SUPPORTED;
231 }
232 
wifi_get_driver_version_stub(wifi_interface_handle iface,char * buffer,int buffer_size)233 wifi_error wifi_get_driver_version_stub(wifi_interface_handle iface, char *buffer,
234         int buffer_size) {
235     return WIFI_ERROR_NOT_SUPPORTED;
236 }
237 
wifi_enable_tdls_stub(wifi_interface_handle iface,mac_addr addr,wifi_tdls_params * params,wifi_tdls_handler handler)238 wifi_error wifi_enable_tdls_stub(wifi_interface_handle iface, mac_addr addr,
239         wifi_tdls_params *params, wifi_tdls_handler handler) {
240     return WIFI_ERROR_NOT_SUPPORTED;
241 }
242 
wifi_disable_tdls_stub(wifi_interface_handle iface,mac_addr addr)243 wifi_error wifi_disable_tdls_stub(wifi_interface_handle iface, mac_addr addr) {
244     return WIFI_ERROR_NOT_SUPPORTED;
245 }
246 
wifi_get_tdls_status_stub(wifi_interface_handle iface,mac_addr addr,wifi_tdls_status * status)247 wifi_error wifi_get_tdls_status_stub(wifi_interface_handle iface, mac_addr addr,
248         wifi_tdls_status *status) {
249     return WIFI_ERROR_NOT_SUPPORTED;
250 }
251 
wifi_get_tdls_capabilities_stub(wifi_interface_handle iface,wifi_tdls_capabilities * capabilities)252 wifi_error wifi_get_tdls_capabilities_stub(wifi_interface_handle iface,
253         wifi_tdls_capabilities *capabilities) {
254     return WIFI_ERROR_NOT_SUPPORTED;
255 }
256 
wifi_set_bssid_blacklist_stub(wifi_request_id id,wifi_interface_handle iface,wifi_bssid_params params)257 wifi_error wifi_set_bssid_blacklist_stub(wifi_request_id id, wifi_interface_handle iface,
258         wifi_bssid_params params) {
259       return WIFI_ERROR_NOT_SUPPORTED;
260 }
261 
wifi_start_sending_offloaded_packet_stub(wifi_request_id id,wifi_interface_handle iface,u8 * ip_packet,u16 ip_packet_len,u8 * src_mac_addr,u8 * dst_mac_addr,u32 period_msec)262 wifi_error wifi_start_sending_offloaded_packet_stub(wifi_request_id id,
263         wifi_interface_handle iface, u8 *ip_packet, u16 ip_packet_len,
264         u8 *src_mac_addr, u8 *dst_mac_addr, u32 period_msec) {
265     return WIFI_ERROR_NOT_SUPPORTED;
266 }
267 
wifi_stop_sending_offloaded_packet_stub(wifi_request_id id,wifi_interface_handle iface)268 wifi_error wifi_stop_sending_offloaded_packet_stub(wifi_request_id id, wifi_interface_handle iface) {
269     return WIFI_ERROR_NOT_SUPPORTED;
270 }
271 
wifi_get_wake_reason_stats_stub(wifi_interface_handle iface,WLAN_DRIVER_WAKE_REASON_CNT * wifi_wake_reason_cnt)272 wifi_error wifi_get_wake_reason_stats_stub(wifi_interface_handle iface,
273                                     WLAN_DRIVER_WAKE_REASON_CNT *wifi_wake_reason_cnt) {
274     return WIFI_ERROR_NOT_SUPPORTED;
275 }
276 
wifi_configure_nd_offload_stub(wifi_interface_handle iface,u8 enable)277 wifi_error wifi_configure_nd_offload_stub(wifi_interface_handle iface, u8 enable) {
278     return WIFI_ERROR_NOT_SUPPORTED;
279 }
280 
wifi_get_driver_memory_dump_stub(wifi_interface_handle iface,wifi_driver_memory_dump_callbacks callbacks)281 wifi_error wifi_get_driver_memory_dump_stub(wifi_interface_handle iface,
282     wifi_driver_memory_dump_callbacks callbacks)  {
283     return WIFI_ERROR_NOT_SUPPORTED;
284 }
285 
wifi_start_pkt_fate_monitoring_stub(wifi_interface_handle iface)286 wifi_error wifi_start_pkt_fate_monitoring_stub(wifi_interface_handle iface) {
287     return WIFI_ERROR_NOT_SUPPORTED;
288 }
289 
wifi_get_tx_pkt_fates_stub(wifi_interface_handle handle,wifi_tx_report * tx_report_bufs,size_t n_requested_fates,size_t * n_provided_fates)290 wifi_error wifi_get_tx_pkt_fates_stub(wifi_interface_handle handle,
291     wifi_tx_report *tx_report_bufs, size_t n_requested_fates, size_t *n_provided_fates) {
292     return WIFI_ERROR_NOT_SUPPORTED;
293 }
294 
wifi_get_rx_pkt_fates_stub(wifi_interface_handle handle,wifi_rx_report * rx_report_bufs,size_t n_requested_fates,size_t * n_provided_fates)295 wifi_error wifi_get_rx_pkt_fates_stub(wifi_interface_handle handle,
296     wifi_rx_report *rx_report_bufs, size_t n_requested_fates, size_t *n_provided_fates) {
297     return WIFI_ERROR_NOT_SUPPORTED;
298 }
wifi_nan_enable_request_stub(transaction_id id,wifi_interface_handle iface,NanEnableRequest * msg)299 wifi_error wifi_nan_enable_request_stub(transaction_id id,
300                               wifi_interface_handle iface,
301                               NanEnableRequest* msg) {
302   return WIFI_ERROR_NOT_SUPPORTED;
303 }
304 
wifi_nan_disable_request_stub(transaction_id id,wifi_interface_handle iface)305 wifi_error wifi_nan_disable_request_stub(transaction_id id,
306                                wifi_interface_handle iface) {
307   return WIFI_ERROR_NOT_SUPPORTED;
308 }
309 
wifi_nan_publish_request_stub(transaction_id id,wifi_interface_handle iface,NanPublishRequest * msg)310 wifi_error wifi_nan_publish_request_stub(transaction_id id,
311                                wifi_interface_handle iface,
312                                NanPublishRequest* msg) {
313   return WIFI_ERROR_NOT_SUPPORTED;
314 }
315 
wifi_nan_publish_cancel_request_stub(transaction_id id,wifi_interface_handle iface,NanPublishCancelRequest * msg)316 wifi_error wifi_nan_publish_cancel_request_stub(transaction_id id,
317                                       wifi_interface_handle iface,
318                                       NanPublishCancelRequest* msg) {
319   return WIFI_ERROR_NOT_SUPPORTED;
320 }
321 
wifi_nan_subscribe_request_stub(transaction_id id,wifi_interface_handle iface,NanSubscribeRequest * msg)322 wifi_error wifi_nan_subscribe_request_stub(transaction_id id,
323                                  wifi_interface_handle iface,
324                                  NanSubscribeRequest* msg) {
325   return WIFI_ERROR_NOT_SUPPORTED;
326 }
327 
wifi_nan_subscribe_cancel_request_stub(transaction_id id,wifi_interface_handle iface,NanSubscribeCancelRequest * msg)328 wifi_error wifi_nan_subscribe_cancel_request_stub(transaction_id id,
329                                         wifi_interface_handle iface,
330                                         NanSubscribeCancelRequest* msg) {
331   return WIFI_ERROR_NOT_SUPPORTED;
332 }
333 
wifi_nan_transmit_followup_request_stub(transaction_id id,wifi_interface_handle iface,NanTransmitFollowupRequest * msg)334 wifi_error wifi_nan_transmit_followup_request_stub(transaction_id id,
335                                          wifi_interface_handle iface,
336                                          NanTransmitFollowupRequest* msg) {
337   return WIFI_ERROR_NOT_SUPPORTED;
338 }
339 
wifi_nan_stats_request_stub(transaction_id id,wifi_interface_handle iface,NanStatsRequest * msg)340 wifi_error wifi_nan_stats_request_stub(transaction_id id,
341                              wifi_interface_handle iface,
342                              NanStatsRequest* msg) {
343   return WIFI_ERROR_NOT_SUPPORTED;
344 }
345 
wifi_nan_config_request_stub(transaction_id id,wifi_interface_handle iface,NanConfigRequest * msg)346 wifi_error wifi_nan_config_request_stub(transaction_id id,
347                               wifi_interface_handle iface,
348                               NanConfigRequest* msg) {
349   return WIFI_ERROR_NOT_SUPPORTED;
350 }
351 
wifi_nan_tca_request_stub(transaction_id id,wifi_interface_handle iface,NanTCARequest * msg)352 wifi_error wifi_nan_tca_request_stub(transaction_id id,
353                            wifi_interface_handle iface,
354                            NanTCARequest* msg) {
355   return WIFI_ERROR_NOT_SUPPORTED;
356 }
357 
wifi_nan_beacon_sdf_payload_request_stub(transaction_id id,wifi_interface_handle iface,NanBeaconSdfPayloadRequest * msg)358 wifi_error wifi_nan_beacon_sdf_payload_request_stub(transaction_id id,
359                                          wifi_interface_handle iface,
360                                          NanBeaconSdfPayloadRequest* msg) {
361   return WIFI_ERROR_NOT_SUPPORTED;
362 }
363 
wifi_nan_register_handler_stub(wifi_interface_handle iface,NanCallbackHandler handlers)364 wifi_error wifi_nan_register_handler_stub(wifi_interface_handle iface,
365                                 NanCallbackHandler handlers) {
366   return WIFI_ERROR_NOT_SUPPORTED;
367 }
368 
wifi_nan_get_version_stub(wifi_handle handle,NanVersion * version)369 wifi_error wifi_nan_get_version_stub(wifi_handle handle,
370                            NanVersion* version) {
371   return WIFI_ERROR_NOT_SUPPORTED;
372 }
373 
wifi_nan_get_capabilities_stub(transaction_id id,wifi_interface_handle iface)374 wifi_error wifi_nan_get_capabilities_stub(transaction_id id,
375                                 wifi_interface_handle iface) {
376   return WIFI_ERROR_NOT_SUPPORTED;
377 }
378 
wifi_get_packet_filter_capabilities_stub(wifi_interface_handle handle,u32 * version,u32 * max_len)379 wifi_error wifi_get_packet_filter_capabilities_stub(wifi_interface_handle handle,
380                                           u32 *version, u32 *max_len) {
381   return WIFI_ERROR_NOT_SUPPORTED;
382 }
383 
wifi_set_packet_filter_stub(wifi_interface_handle handle,const u8 * program,u32 len)384 wifi_error wifi_set_packet_filter_stub(wifi_interface_handle handle,
385                              const u8 *program, u32 len) {
386   return WIFI_ERROR_NOT_SUPPORTED;
387 }
388 
init_wifi_stub_hal_func_table(wifi_hal_fn * hal_fn)389 int init_wifi_stub_hal_func_table(wifi_hal_fn *hal_fn) {
390     if (hal_fn == NULL) {
391         return -1;
392     }
393     hal_fn->wifi_initialize = wifi_initialize_stub;
394     hal_fn->wifi_cleanup = wifi_cleanup_stub;
395     hal_fn->wifi_event_loop = wifi_event_loop_stub;
396     hal_fn->wifi_get_error_info = wifi_get_error_info_stub;
397     hal_fn->wifi_get_supported_feature_set = wifi_get_supported_feature_set_stub;
398     hal_fn->wifi_get_concurrency_matrix = wifi_get_concurrency_matrix_stub;
399     hal_fn->wifi_set_scanning_mac_oui =  wifi_set_scanning_mac_oui_stub;
400     hal_fn->wifi_get_supported_channels = wifi_get_supported_channels_stub;
401     hal_fn->wifi_is_epr_supported = wifi_is_epr_supported_stub;
402     hal_fn->wifi_get_ifaces = wifi_get_ifaces_stub;
403     hal_fn->wifi_get_iface_name = wifi_get_iface_name_stub;
404     hal_fn->wifi_reset_iface_event_handler = wifi_reset_iface_event_handler_stub;
405     hal_fn->wifi_start_gscan = wifi_start_gscan_stub;
406     hal_fn->wifi_stop_gscan = wifi_stop_gscan_stub;
407     hal_fn->wifi_get_cached_gscan_results = wifi_get_cached_gscan_results_stub;
408     hal_fn->wifi_set_bssid_hotlist = wifi_set_bssid_hotlist_stub;
409     hal_fn->wifi_reset_bssid_hotlist = wifi_reset_bssid_hotlist_stub;
410     hal_fn->wifi_set_significant_change_handler = wifi_set_significant_change_handler_stub;
411     hal_fn->wifi_reset_significant_change_handler = wifi_reset_significant_change_handler_stub;
412     hal_fn->wifi_get_gscan_capabilities = wifi_get_gscan_capabilities_stub;
413     hal_fn->wifi_set_link_stats = wifi_set_link_stats_stub;
414     hal_fn->wifi_get_link_stats = wifi_get_link_stats_stub;
415     hal_fn->wifi_clear_link_stats = wifi_clear_link_stats_stub;
416     hal_fn->wifi_get_valid_channels = wifi_get_valid_channels_stub;
417     hal_fn->wifi_rtt_range_request = wifi_rtt_range_request_stub;
418     hal_fn->wifi_rtt_range_cancel = wifi_rtt_range_cancel_stub;
419     hal_fn->wifi_get_rtt_capabilities = wifi_get_rtt_capabilities_stub;
420     hal_fn->wifi_start_logging = wifi_start_logging_stub;
421     hal_fn->wifi_set_epno_list = wifi_set_epno_list_stub;
422     hal_fn->wifi_set_country_code = wifi_set_country_code_stub;
423     hal_fn->wifi_enable_tdls = wifi_enable_tdls_stub;
424     hal_fn->wifi_disable_tdls = wifi_disable_tdls_stub;
425     hal_fn->wifi_get_tdls_status = wifi_get_tdls_status_stub;
426     hal_fn->wifi_get_tdls_capabilities = wifi_get_tdls_capabilities_stub;
427     hal_fn->wifi_set_nodfs_flag = wifi_set_nodfs_flag_stub;
428     hal_fn->wifi_get_firmware_memory_dump = wifi_get_firmware_memory_dump_stub;
429     hal_fn->wifi_set_log_handler = wifi_set_log_handler_stub;
430     hal_fn->wifi_reset_log_handler = wifi_reset_log_handler_stub;
431     hal_fn->wifi_set_alert_handler = wifi_set_alert_handler_stub;
432     hal_fn->wifi_reset_alert_handler = wifi_reset_alert_handler_stub;
433     hal_fn->wifi_get_firmware_version = wifi_get_firmware_version_stub;
434     hal_fn->wifi_get_ring_buffers_status = wifi_get_ring_buffers_status_stub;
435     hal_fn->wifi_get_logger_supported_feature_set = wifi_get_logger_supported_feature_set_stub;
436     hal_fn->wifi_get_ring_data = wifi_get_ring_data_stub;
437     hal_fn->wifi_get_driver_version = wifi_get_driver_version_stub;
438     hal_fn->wifi_set_bssid_blacklist = wifi_set_bssid_blacklist_stub;
439     hal_fn->wifi_start_sending_offloaded_packet = wifi_start_sending_offloaded_packet_stub;
440     hal_fn->wifi_stop_sending_offloaded_packet = wifi_stop_sending_offloaded_packet_stub;
441     hal_fn->wifi_get_wake_reason_stats = wifi_get_wake_reason_stats_stub;
442     hal_fn->wifi_configure_nd_offload = wifi_configure_nd_offload_stub;
443     hal_fn->wifi_get_driver_memory_dump = wifi_get_driver_memory_dump_stub;
444     hal_fn->wifi_start_pkt_fate_monitoring = wifi_start_pkt_fate_monitoring_stub;
445     hal_fn->wifi_get_tx_pkt_fates = wifi_get_tx_pkt_fates_stub;
446     hal_fn->wifi_get_rx_pkt_fates = wifi_get_rx_pkt_fates_stub;
447     hal_fn->wifi_nan_enable_request = wifi_nan_enable_request_stub;
448     hal_fn->wifi_nan_disable_request = wifi_nan_disable_request_stub;
449     hal_fn->wifi_nan_publish_request = wifi_nan_publish_request_stub;
450     hal_fn->wifi_nan_publish_cancel_request = wifi_nan_publish_cancel_request_stub;
451     hal_fn->wifi_nan_subscribe_request = wifi_nan_subscribe_request_stub;
452     hal_fn->wifi_nan_subscribe_cancel_request = wifi_nan_subscribe_cancel_request_stub;
453     hal_fn->wifi_nan_transmit_followup_request = wifi_nan_transmit_followup_request_stub;
454     hal_fn->wifi_nan_stats_request = wifi_nan_stats_request_stub;
455     hal_fn->wifi_nan_config_request = wifi_nan_config_request_stub;
456     hal_fn->wifi_nan_tca_request = wifi_nan_tca_request_stub;
457     hal_fn->wifi_nan_beacon_sdf_payload_request = wifi_nan_beacon_sdf_payload_request_stub;
458     hal_fn->wifi_nan_register_handler = wifi_nan_register_handler_stub;
459     hal_fn->wifi_nan_get_version = wifi_nan_get_version_stub;
460     hal_fn->wifi_get_packet_filter_capabilities = wifi_get_packet_filter_capabilities_stub;
461     hal_fn->wifi_set_packet_filter = wifi_set_packet_filter_stub;
462 
463     return 0;
464 }
465