static int hfp_ag_init(void) { DBusConnection *conn = ofono_dbus_get_connection(); if (DBUS_TYPE_UNIX_FD < 0) return -EBADF; /* Registers External Profile handler */ if (!g_dbus_register_interface(conn, HFP_AG_EXT_PROFILE_PATH, BLUEZ_PROFILE_INTERFACE, profile_methods, NULL, NULL, NULL, NULL)) { ofono_error("Register Profile interface failed: %s", HFP_AG_EXT_PROFILE_PATH); return -EIO; } sim_hash = g_hash_table_new(g_direct_hash, g_direct_equal); modemwatch_id = __ofono_modemwatch_add(modem_watch, NULL, NULL); __ofono_modem_foreach(call_modemwatch, NULL); connection_hash = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, connection_destroy); return 0; }
static int push_notification_init(void) { DBG(""); modemwatch_id = __ofono_modemwatch_add(modem_watch, NULL, NULL); __ofono_modem_foreach(call_modemwatch, NULL); return 0; }
static int dun_gw_init(void) { DBG(""); modemwatch_id = __ofono_modemwatch_add(modem_watch, NULL, NULL); __ofono_modem_foreach(call_modemwatch, NULL); return 0; }
static int example_emulator_init(void) { DBG(""); modemwatch_id = __ofono_modemwatch_add(modem_watch, NULL, NULL); __ofono_modem_foreach(call_modemwatch, NULL); return 0; }
void ril_set_rat_mode(struct ofono_radio_settings *rs, enum ofono_radio_access_mode mode, ofono_radio_settings_rat_mode_set_cb_t cb, void *data) { struct radio_data *rd = ofono_radio_settings_get_data(rs); struct cb_data *cbd = cb_data_new(cb, data, rs); struct switch_data *sd = NULL; if (rd->switch_d != NULL) goto error; if ((rd->available_rats & mode) == 0) { if (g_ril_get_version(rd->ril) < 11) goto error; /* Check if we can switch rats with other slot */ sd = g_malloc0(sizeof (*sd)); sd->rd_1 = rd; sd->mode_to_switch = mode; sd->cbd = cbd; __ofono_modem_foreach(get_rs_with_mode, sd); if (sd->rd_2 == NULL) goto error; ofono_info("Switching radio caps between slots - START"); sd->rd_1->switch_d = sd; sd->rd_2->switch_d = sd; switch_caps(sd); } else { set_preferred_network(rd, cbd, mode); } return; error: ofono_error("%s: unable to set rat mode", __func__); g_free(sd); g_free(cbd); CALLBACK_WITH_FAILURE(cb, data); }