2 * Network Configuration Module
4 * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
22 #include "wifi-direct-oem.h"
23 #include "wfd-prd-plugin-log.h"
24 #include "wfd-prd-plugin-wpasupplicant.h"
26 static ws_sock_plugin_data_s *g_pd;
28 static int _ws_reset_plugin(ws_sock_plugin_data_s *pd)
30 __WDP_LOG_FUNC_ENTER__;
33 WDP_LOGE("Invalid parameter");
34 __WDP_LOG_FUNC_EXIT__;
40 __WDP_LOG_FUNC_EXIT__;
44 int ws_prd_init(wfd_oem_event_cbs_s *event_cbs)
46 __WDP_LOG_FUNC_ENTER__;
48 if (event_cbs == NULL) {
49 __WDP_LOG_FUNC_EXIT__;
54 _ws_reset_plugin(g_pd);
57 g_pd = (ws_sock_plugin_data_s*) g_try_malloc0(sizeof(ws_sock_plugin_data_s));
59 WDP_LOGE("Failed to allocate memory for plugin data. [%s]",
61 __WDP_LOG_FUNC_EXIT__;
65 g_pd->callback = event_cbs;
66 g_pd->initialized = TRUE;
68 __WDP_LOG_FUNC_EXIT__;
72 wfd_oem_prd_ops_s prd_ops = {
73 .prd_init = ws_prd_init,
76 int wfd_prd_plugin_load(wfd_oem_ops_s **ops)
78 __WDP_LOG_FUNC_ENTER__;
81 WDP_LOGE("Invalid parameter");
82 __WDP_LOG_FUNC_EXIT__;
86 (*ops)->extra_data = &prd_ops;
88 __WDP_LOG_FUNC_EXIT__;