5 * Copyright (C) 2007-2010 Intel Corporation. All rights reserved.
6 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33 #define CONNMAN_API_SUBJECT_TO_CHANGE
34 #include <connman/plugin.h>
35 #include <connman/device.h>
36 #include <connman/network.h>
37 #include <connman/dbus.h>
38 #include <connman/log.h>
40 static DBusConnection *connection;
42 static int network_probe(struct connman_network *network)
44 DBG("network %p", network);
49 static void network_remove(struct connman_network *network)
51 DBG("network %p", network);
54 static int network_connect(struct connman_network *network)
56 DBG("network %p", network);
61 static int network_disconnect(struct connman_network *network)
63 DBG("network %p", network);
68 static struct connman_network_driver network_driver = {
70 .type = CONNMAN_NETWORK_TYPE_CELLULAR,
71 .probe = network_probe,
72 .remove = network_remove,
73 .connect = network_connect,
74 .disconnect = network_disconnect,
77 static int modem_probe(struct connman_device *device)
79 DBG("device %p", device);
84 static void modem_remove(struct connman_device *device)
86 DBG("device %p", device);
89 static int modem_enable(struct connman_device *device)
91 DBG("device %p", device);
96 static int modem_disable(struct connman_device *device)
98 DBG("device %p", device);
103 static struct connman_device_driver modem_driver = {
105 .type = CONNMAN_DEVICE_TYPE_CELLULAR,
106 .probe = modem_probe,
107 .remove = modem_remove,
108 .enable = modem_enable,
109 .disable = modem_disable,
112 static int ofono_init(void)
118 connection = connman_dbus_get_connection();
119 if (connection == NULL)
122 err = connman_network_driver_register(&network_driver);
126 err = connman_device_driver_register(&modem_driver);
128 connman_network_driver_unregister(&network_driver);
135 dbus_connection_unref(connection);
140 static void ofono_exit(void)
144 connman_device_driver_unregister(&modem_driver);
145 connman_network_driver_unregister(&network_driver);
147 dbus_connection_unref(connection);
150 CONNMAN_PLUGIN_DEFINE(ofono, "oFono telephony plugin", VERSION,
151 CONNMAN_PLUGIN_PRIORITY_DEFAULT, ofono_init, ofono_exit)