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