5 * Copyright (C) 2007-2008 Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 #include <connman/plugin.h>
27 #include <connman/driver.h>
28 #include <connman/log.h>
30 #include "supplicant.h"
32 static void scan_result(struct connman_element *element,
33 struct supplicant_network *network)
35 DBG("element %p name %s", element, element->name);
37 DBG("network %p identifier %s", network, network->identifier);
40 static struct supplicant_callback wifi_callback = {
41 .scan_result = scan_result,
44 static int wifi_probe(struct connman_element *element)
48 DBG("element %p name %s", element, element->name);
50 err = __supplicant_start(element, &wifi_callback);
54 __supplicant_scan(element);
59 static void wifi_remove(struct connman_element *element)
61 DBG("element %p name %s", element, element->name);
63 __supplicant_stop(element);
66 static struct connman_driver wifi_driver = {
68 .type = CONNMAN_ELEMENT_TYPE_DEVICE,
69 .subtype = CONNMAN_ELEMENT_SUBTYPE_WIFI,
71 .remove = wifi_remove,
74 static int wifi_init(void)
76 return connman_driver_register(&wifi_driver);
79 static void wifi_exit(void)
81 connman_driver_unregister(&wifi_driver);
84 CONNMAN_PLUGIN_DEFINE("WiFi", "WiFi interface plugin", VERSION,