2 * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <hal/hal-common.h>
24 #include "../include/hal-wifi.h"
25 #include "../include/hal-wifi-interface.h"
29 #define EXPORT __attribute__ ((visibility("default")))
32 #define ARRAY_SIZE(name) (sizeof(name)/sizeof(name[0]))
34 static hal_backend_wifi_funcs *g_wifi_funcs = NULL;
37 int hal_wifi_get_backend(void)
44 ret = hal_common_get_backend(HAL_MODULE_WIFI, (void **)&g_wifi_funcs);
46 _E("Failed to get backend\n");
54 int hal_wifi_put_backend(void)
61 ret = hal_common_put_backend(HAL_MODULE_WIFI, (void *)g_wifi_funcs);
63 _E("Failed to put backend\n");
72 int hal_wifi_sta_start(const char *ifname)
76 return g_wifi_funcs->sta_start(ifname);
80 int hal_wifi_p2p_start(const char *ifname)
84 return g_wifi_funcs->p2p_start(ifname);
88 int hal_wifi_softap_start(const char *ifname)
92 return g_wifi_funcs->softap_start(ifname);
96 int hal_wifi_stop(const char *ifname)
100 return g_wifi_funcs->stop(ifname);
104 int hal_wifi_get_mac(const char *ifname, char **mac)
108 return g_wifi_funcs->get_mac(ifname, mac);