Пример #1
0
static void ril_post_sim(struct ofono_modem *modem)
{
	struct ril_data *rd = ofono_modem_get_data(modem);
	struct ofono_gprs *gprs;
	struct ofono_gprs_context *gc;

	if (ofono_modem_get_boolean(modem, MODEM_PROP_LTE_CAPABLE))
		ofono_sms_create(modem, 0, "rilmodem", rd->ril);
	else
		ofono_sms_create(modem, OFONO_RIL_VENDOR_IMC_SOFIA3GR,
					"rilmodem", rd->ril);

	gprs = ofono_gprs_create(modem, 0, "rilmodem", rd->ril);
	gc = ofono_gprs_context_create(modem, 0, "rilmodem", rd->ril);

	if (gc) {
		ofono_gprs_context_set_type(gc,
					OFONO_GPRS_CONTEXT_TYPE_INTERNET);
		ofono_gprs_add_context(gprs, gc);
	}

	if (ofono_modem_get_boolean(modem, MODEM_PROP_LTE_CAPABLE))
		ofono_lte_create(modem, "rilmodem", rd->ril);

	ofono_stk_create(modem, 0, "rilmodem", rd->ril);
}
Пример #2
0
static void atgen_post_sim(struct ofono_modem *modem)
{
    GAtChat *chat = ofono_modem_get_data(modem);
    struct ofono_message_waiting *mw;
    struct ofono_gprs *gprs;
    struct ofono_gprs_context *gc;

    DBG("%p", modem);

    ofono_ussd_create(modem, 0, "atmodem", chat);
    ofono_call_forwarding_create(modem, 0, "atmodem", chat);
    ofono_call_settings_create(modem, 0, "atmodem", chat);
    ofono_netreg_create(modem, 0, "atmodem", chat);
    ofono_call_meter_create(modem, 0, "atmodem", chat);
    ofono_call_barring_create(modem, 0, "atmodem", chat);
    ofono_ssn_create(modem, 0, "atmodem", chat);
    ofono_sms_create(modem, 0, "atmodem", chat);
    ofono_phonebook_create(modem, 0, "atmodem", chat);
    gprs = ofono_gprs_create(modem,0, "atmodem", chat);
    gc = ofono_gprs_context_create(modem, 0, "atmodem", chat);
    if (gprs && gc)
        ofono_gprs_add_context(gprs, gc);

    mw = ofono_message_waiting_create(modem);
    if (mw)
        ofono_message_waiting_register(mw);
}
Пример #3
0
static void ril_post_sim(struct ofono_modem *modem)
{
	DBG("");
	struct ril_data *ril = ofono_modem_get_data(modem);
	struct ofono_gprs *gprs;
	struct ofono_gprs_context *gc;
	struct ofono_message_waiting *mw;
	int i;
	/* TODO: this function should setup:
	 *  - stk ( SIM toolkit )
	 */
	ofono_sms_create(modem, 0, "rilmodem", ril->modem);

	gprs = ofono_gprs_create(modem, 0, "rilmodem", ril->modem);
	if (gprs) {
		for (i = 0; i < MAX_PDP_CONTEXTS; i++) {
			gc = ofono_gprs_context_create(modem, 0, "rilmodem",
					ril->modem);
			if (gc == NULL)
				break;

			ofono_gprs_add_context(gprs, gc);
		}
	}

	ofono_radio_settings_create(modem, 0, "rilmodem", ril->modem);
	ofono_phonebook_create(modem, 0, "rilmodem", ril->modem);
	ofono_call_forwarding_create(modem, 0, "rilmodem", ril->modem);
	ofono_call_barring_create(modem, 0, "rilmodem", ril->modem);
	ofono_stk_create(modem, 0, "rilmodem", ril->modem);

	mw = ofono_message_waiting_create(modem);
	if (mw)
		ofono_message_waiting_register(mw);
}
Пример #4
0
static void switch_sim_state_status(struct ofono_modem *modem, int status)
{
	struct telit_data *data = ofono_modem_get_data(modem);

	DBG("%p, SIM status: %d", modem, status);

	switch (status) {
	case 0:	/* SIM not inserted */
		if (data->have_sim == TRUE) {
			ofono_sim_inserted_notify(data->sim, FALSE);
			data->have_sim = FALSE;
			data->sms_phonebook_added = FALSE;
		}
		break;
	case 1:	/* SIM inserted */
	case 2:	/* SIM inserted and PIN unlocked */
		if (data->have_sim == FALSE) {
			ofono_sim_inserted_notify(data->sim, TRUE);
			data->have_sim = TRUE;
		}
		break;
	case 3:	/* SIM inserted, SMS and phonebook ready */
		if (data->sms_phonebook_added == FALSE) {
			ofono_phonebook_create(modem, 0, "atmodem", data->chat);
			ofono_sms_create(modem, 0, "atmodem", data->chat);
			data->sms_phonebook_added = TRUE;
		}
		break;
	default:
		ofono_warn("Unknown SIM state %d received", status);
		break;
	}
}
Пример #5
0
static void telit_post_sim(struct ofono_modem *modem)
{
	struct telit_data *data = ofono_modem_get_data(modem);

	DBG("%p", modem);

	ofono_sms_create(modem, 0, "atmodem", data->chat);
}
Пример #6
0
static void tc65_post_sim(struct ofono_modem *modem)
{
	GAtChat *chat = ofono_modem_get_data(modem);

	DBG("%p", modem);

	ofono_phonebook_create(modem, 0, "atmodem", chat);

	ofono_sms_create(modem, 0, "atmodem", chat);
}
Пример #7
0
static void u8500_post_online(struct ofono_modem *modem)
{
	struct isi_data *isi = ofono_modem_get_data(modem);

	DBG("(%p) with %s", modem, isi->ifname);

	ofono_netreg_create(modem, 0, "isimodem", isi->modem);
	ofono_sms_create(modem, 0, "isimodem", isi->modem);
	ofono_cbs_create(modem, 0, "isimodem", isi->modem);
	ofono_ussd_create(modem, 0, "isimodem", isi->modem);
	ofono_call_settings_create(modem, 0, "isimodem", isi->modem);
	ofono_call_barring_create(modem, 0, "isimodem", isi->modem);
	ofono_call_meter_create(modem, 0, "isimodem", isi->modem);
	ofono_gprs_create(modem, 0, "isimodem", isi->modem);
}
Пример #8
0
Файл: ifx.c Проект: intgr/ofono
static void ifx_post_sim(struct ofono_modem *modem)
{
	struct ifx_data *data = ofono_modem_get_data(modem);

	DBG("%p", modem);

	ofono_stk_create(modem, 0, "ifxmodem", data->dlcs[AUX_DLC]);
	ofono_phonebook_create(modem, OFONO_VENDOR_IFX,
					"atmodem", data->dlcs[AUX_DLC]);
	ofono_call_forwarding_create(modem, 0, "atmodem", data->dlcs[AUX_DLC]);
	ofono_radio_settings_create(modem, 0, "ifxmodem", data->dlcs[AUX_DLC]);

	ofono_sms_create(modem, OFONO_VENDOR_IFX,
					"atmodem", data->dlcs[AUX_DLC]);
}
Пример #9
0
static void phonesim_post_sim(struct ofono_modem *modem)
{
	struct phonesim_data *data = ofono_modem_get_data(modem);

	DBG("%p", modem);

	ofono_ctm_create(modem, 0, "phonesim", data->chat);
	ofono_phonebook_create(modem, 0, "atmodem", data->chat);

	if (!data->calypso)
		ofono_stk_create(modem, OFONO_VENDOR_PHONESIM,
					"atmodem", data->chat);

	ofono_call_forwarding_create(modem, 0, "atmodem", data->chat);

	if (!data->calypso)
		ofono_sms_create(modem, 0, "atmodem", data->chat);
}
Пример #10
0
void ril_post_sim(struct ofono_modem *modem)
{
	struct ril_data *rd = ofono_modem_get_data(modem);
	struct ofono_gprs *gprs;
	struct ofono_gprs_context *gc;
	struct ofono_message_waiting *mw;
	struct ril_gprs_driver_data gprs_data = { rd->ril, modem };
	struct ril_gprs_context_data
		inet_ctx = { rd->ril, modem, OFONO_GPRS_CONTEXT_TYPE_INTERNET };
	struct ril_gprs_context_data
		mms_ctx = { rd->ril, modem, OFONO_GPRS_CONTEXT_TYPE_MMS };

	/* TODO: this function should setup:
	 *  - phonebook
	 *  - stk ( SIM toolkit )
	 *  - radio_settings
	 */
	ofono_sms_create(modem, rd->vendor, RILMODEM, rd->ril);

	gprs = ofono_gprs_create(modem, rd->vendor, RILMODEM, &gprs_data);
	gc = ofono_gprs_context_create(modem, rd->vendor, RILMODEM, &inet_ctx);

	if (gc) {
		ofono_gprs_context_set_type(gc,
					OFONO_GPRS_CONTEXT_TYPE_INTERNET);
		ofono_gprs_add_context(gprs, gc);
	}

	gc = ofono_gprs_context_create(modem, rd->vendor, RILMODEM, &mms_ctx);

	if (gc) {
		ofono_gprs_context_set_type(gc,
					OFONO_GPRS_CONTEXT_TYPE_MMS);
		ofono_gprs_add_context(gprs, gc);
	}

	mw = ofono_message_waiting_create(modem);
	if (mw)
		ofono_message_waiting_register(mw);

	ofono_call_forwarding_create(modem, rd->vendor, RILMODEM, rd->ril);

	ofono_phonebook_create(modem, rd->vendor, RILMODEM, modem);
}
Пример #11
0
void ril_post_sim(struct ofono_modem *modem)
{
	struct ril_data *rd = ofono_modem_get_data(modem);
	struct ofono_message_waiting *mw;

	/* TODO: this function should setup:
	 *  - phonebook
	 *  - stk ( SIM toolkit )
	 *  - radio_settings
	 */
	ofono_sms_create(modem, rd->vendor, RILMODEM, rd->ril);

	mw = ofono_message_waiting_create(modem);
	if (mw)
		ofono_message_waiting_register(mw);

	ofono_call_forwarding_create(modem, rd->vendor, RILMODEM, rd->ril);
	ofono_stk_create(modem, rd->vendor, RILMODEM, rd->ril);
	ofono_phonebook_create(modem, rd->vendor, RILMODEM, modem);
}
Пример #12
0
static void ifx_post_sim(struct ofono_modem *modem)
{
	struct ifx_data *data = ofono_modem_get_data(modem);
	struct ofono_gprs *gprs;
	struct ofono_gprs_context *gc;

	DBG("%p", modem);

	ofono_stk_create(modem, 0, "ifxmodem", data->dlcs[AUX_DLC]);
	ofono_phonebook_create(modem, OFONO_VENDOR_IFX,
					"atmodem", data->dlcs[AUX_DLC]);
	ofono_call_forwarding_create(modem, 0, "atmodem", data->dlcs[AUX_DLC]);
	ofono_radio_settings_create(modem, 0, "ifxmodem", data->dlcs[AUX_DLC]);

	ofono_sms_create(modem, OFONO_VENDOR_IFX,
					"atmodem", data->dlcs[AUX_DLC]);

	gprs = ofono_gprs_create(modem, OFONO_VENDOR_IFX,
					"atmodem", data->dlcs[NETREG_DLC]);
	if (gprs == NULL)
		return;

	if (data->mux_ldisc < 0) {
		gc = ofono_gprs_context_create(modem, 0,
					"ifxmodem", data->dlcs[GPRS1_DLC]);
		if (gc)
			ofono_gprs_add_context(gprs, gc);

		gc = ofono_gprs_context_create(modem, 0,
					"ifxmodem", data->dlcs[GPRS2_DLC]);
		if (gc)
			ofono_gprs_add_context(gprs, gc);

		gc = ofono_gprs_context_create(modem, 0,
					"ifxmodem", data->dlcs[GPRS3_DLC]);
		if (gc)
			ofono_gprs_add_context(gprs, gc);
	}
}
Пример #13
0
static void ril_post_sim(struct ofono_modem *modem)
{
	struct ril_data *ril = ofono_modem_get_data(modem);
	struct ofono_gprs *gprs;
	struct ofono_gprs_context *gc;
	struct ofono_message_waiting *mw;

	/* TODO: this function should setup:
	 *  - phonebook
	 *  - stk ( SIM toolkit )
	 *  - radio_settings
	 */
	ofono_sms_create(modem, 0, RILMODEM, ril->modem);

	gprs = ofono_gprs_create(modem, 0, RILMODEM, ril->modem);
	gc = ofono_gprs_context_create(modem, 0, RILMODEM, ril->modem);

	if (gc) {
		ofono_gprs_context_set_type(gc,
					OFONO_GPRS_CONTEXT_TYPE_INTERNET);
		ofono_gprs_add_context(gprs, gc);
	}

	gc = ofono_gprs_context_create(modem, 0, RILMODEM, ril->modem);

	if (gc) {
		ofono_gprs_context_set_type(gc,
					OFONO_GPRS_CONTEXT_TYPE_MMS);
		ofono_gprs_add_context(gprs, gc);
	}

	mw = ofono_message_waiting_create(modem);
	if (mw)
		ofono_message_waiting_register(mw);

	ofono_call_forwarding_create(modem, 0, RILMODEM, ril->modem);
}
Пример #14
0
/*
 * sim_state_watch listens to SIM state changes and creates/removes atoms
 * accordingly. This is needed because we cannot rely on the modem core code,
 * which handles modem state transitions, to do this due to the SIM not being
 * accessible in the offline state for mtk modems. This causes a mismatch
 * between what the core thinks it can do in some states and what the mtk modem
 * can really do in those. This is a workaround to solve that.
 */
static void sim_state_watch(enum ofono_sim_state new_state, void *data)
{
	struct ofono_modem *modem = data;
	struct mtk_data *md = ofono_modem_get_data(modem);

	if (new_state == OFONO_SIM_STATE_READY) {
		struct ofono_gprs_context *gc;
		struct ril_gprs_driver_data gprs_data = { md->ril, modem };
		struct ril_gprs_context_data inet_ctx =
			{ md->ril, OFONO_GPRS_CONTEXT_TYPE_INTERNET };
		struct ril_gprs_context_data mms_ctx =
			{ md->ril, OFONO_GPRS_CONTEXT_TYPE_MMS };

		DBG("SIM ready, creating more atoms");

		/*
		 * TODO: this function should setup:
		 *  - stk ( SIM toolkit )
		 */
		md->sms = ofono_sms_create(modem, OFONO_RIL_VENDOR_MTK,
						RILMODEM, md->ril);

		/* netreg needs access to the SIM (SPN, SPDI) */
		md->netreg = ofono_netreg_create(modem, OFONO_RIL_VENDOR_MTK,
							RILMODEM, md->ril);
		md->ussd = ofono_ussd_create(modem, OFONO_RIL_VENDOR_MTK,
						RILMODEM, md->ril);
		md->call_settings =
			ofono_call_settings_create(modem, OFONO_RIL_VENDOR_MTK,
							RILMODEM, md->ril);
		md->call_forwarding =
			ofono_call_forwarding_create(modem,
							OFONO_RIL_VENDOR_MTK,
							RILMODEM, md->ril);
		md->call_barring =
			ofono_call_barring_create(modem, OFONO_RIL_VENDOR_MTK,
							RILMODEM, md->ril);
		md->phonebook =
			ofono_phonebook_create(modem, OFONO_RIL_VENDOR_MTK,
						RILMODEM, modem);
		md->gprs = ofono_gprs_create(modem, OFONO_RIL_VENDOR_MTK,
						MTKMODEM, &gprs_data);

		gc = ofono_gprs_context_create(modem, OFONO_RIL_VENDOR_MTK,
						RILMODEM, &inet_ctx);
		if (gc) {
			ofono_gprs_context_set_type(gc,
					OFONO_GPRS_CONTEXT_TYPE_INTERNET);
			ofono_gprs_add_context(md->gprs, gc);
		}

		gc = ofono_gprs_context_create(modem, OFONO_RIL_VENDOR_MTK,
						RILMODEM, &mms_ctx);
		if (gc) {
			ofono_gprs_context_set_type(gc,
					OFONO_GPRS_CONTEXT_TYPE_MMS);
			ofono_gprs_add_context(md->gprs, gc);
		}

		md->message_waiting = ofono_message_waiting_create(modem);
		if (md->message_waiting)
			ofono_message_waiting_register(md->message_waiting);

		/*
		 * Now that we can access IMSI, see if a FW change is needed.
		 */

	 	md->sim_plmn_type = get_plmn_type(ofono_sim_get_imsi(md->sim));

		check_modem_fw(modem);

	} else if (new_state == OFONO_SIM_STATE_LOCKED_OUT) {

		DBG("SIM locked, removing atoms");

		if (md->message_waiting) {
			ofono_message_waiting_remove(md->message_waiting);
			md->message_waiting = NULL;
		}
		if (md->gprs) {
			ofono_gprs_remove(md->gprs);
			md->gprs = NULL;
		}
		if (md->phonebook) {
			ofono_phonebook_remove(md->phonebook);
			md->phonebook = NULL;
		}
		if (md->call_barring) {
			ofono_call_barring_remove(md->call_barring);
			md->call_barring = NULL;
		}
		if (md->call_forwarding) {
			ofono_call_forwarding_remove(md->call_forwarding);
			md->call_forwarding = NULL;
		}
		if (md->call_settings) {
			ofono_call_settings_remove(md->call_settings);
			md->call_settings = NULL;
		}
		if (md->ussd) {
			ofono_ussd_remove(md->ussd);
			md->ussd = NULL;
		}
		if (md->netreg) {
			ofono_netreg_remove(md->netreg);
			md->netreg = NULL;
		}
		if (md->sms) {
			ofono_sms_remove(md->sms);
			md->sms = NULL;
		}
	}
}