+ dbus_pending_call_set_notify(call, manager_get_modems_reply,
+ NULL, NULL);
+
+ dbus_message_unref(message);
+
+ return -EINPROGRESS;
+}
+
+static void ofono_connect(DBusConnection *conn, void *user_data)
+{
+ DBG("");
+
+ modem_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
+ g_free, remove_modem);
+ if (modem_hash == NULL)
+ return;
+
+ context_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
+ g_free, NULL);
+ if (context_hash == NULL) {
+ g_hash_table_destroy(modem_hash);
+ return;
+ }
+
+ manager_get_modems();
+}
+
+static void ofono_disconnect(DBusConnection *conn, void *user_data)
+{
+ DBG("");
+
+ if (modem_hash == NULL || context_hash == NULL)
+ return;
+
+ g_hash_table_destroy(modem_hash);
+ modem_hash = NULL;
+
+ g_hash_table_destroy(context_hash);
+ context_hash = NULL;
+}
+
+static int network_probe(struct connman_network *network)
+{
+ struct modem_data *modem = connman_network_get_data(network);
+
+ DBG("%s network %p", modem->path, network);
+
+ return 0;
+}
+
+static void network_remove(struct connman_network *network)
+{
+ struct modem_data *modem = connman_network_get_data(network);
+
+ DBG("%s network %p", modem->path, network);
+}
+
+static int network_connect(struct connman_network *network)
+{
+ struct modem_data *modem = connman_network_get_data(network);
+
+ DBG("%s network %p", modem->path, network);
+
+ if (has_interface(modem->interfaces, OFONO_API_CM) == TRUE)
+ return context_set_active(modem, TRUE);
+ else if (has_interface(modem->interfaces, OFONO_API_CDMA_CM) == TRUE)
+ return cdma_cm_set_powered(modem, TRUE);
+
+ connman_error("Connection manager interface not available");
+
+ return -ENOSYS;
+}
+
+static int network_disconnect(struct connman_network *network)
+{
+ struct modem_data *modem = connman_network_get_data(network);
+
+ DBG("%s network %p", modem->path, network);
+
+ if (has_interface(modem->interfaces, OFONO_API_CM) == TRUE)
+ return context_set_active(modem, FALSE);
+ else if (has_interface(modem->interfaces, OFONO_API_CDMA_CM) == TRUE)
+ return cdma_cm_set_powered(modem, FALSE);
+
+ connman_error("Connection manager interface not available");
+
+ return -ENOSYS;
+}
+
+static struct connman_network_driver network_driver = {
+ .name = "cellular",
+ .type = CONNMAN_NETWORK_TYPE_CELLULAR,
+ .probe = network_probe,
+ .remove = network_remove,
+ .connect = network_connect,
+ .disconnect = network_disconnect,
+};
+
+static int modem_probe(struct connman_device *device)
+{
+ struct modem_data *modem = connman_device_get_data(device);
+
+ DBG("%s device %p", modem->path, device);
+
+ return 0;
+}
+
+static void modem_remove(struct connman_device *device)
+{
+ struct modem_data *modem = connman_device_get_data(device);
+
+ DBG("%s device %p", modem->path, device);
+}
+
+static int modem_enable(struct connman_device *device)
+{
+ struct modem_data *modem = connman_device_get_data(device);
+
+ DBG("%s device %p", modem->path, device);
+
+ if (modem->online == TRUE)
+ return 0;
+
+ return modem_set_online(modem, TRUE);
+}
+
+static int modem_disable(struct connman_device *device)
+{
+ struct modem_data *modem = connman_device_get_data(device);
+
+ DBG("%s device %p", modem->path, device);
+
+ if (modem->online == FALSE)
+ return 0;
+
+ return modem_set_online(modem, FALSE);
+}
+
+static struct connman_device_driver modem_driver = {
+ .name = "modem",
+ .type = CONNMAN_DEVICE_TYPE_CELLULAR,
+ .probe = modem_probe,
+ .remove = modem_remove,
+ .enable = modem_enable,
+ .disable = modem_disable,
+};
+
+static int tech_probe(struct connman_technology *technology)
+{
+ return 0;
+}
+
+static void tech_remove(struct connman_technology *technology)
+{