static void ril_sms_remove(struct ofono_sms *sms) { int i; struct ril_sms *sd = ril_sms_get_data(sms); DBG(""); ofono_sms_set_data(sms, NULL); if (sd->sim_context) { ofono_sim_context_free(sd->sim_context); } for (i=0; i<G_N_ELEMENTS(sd->event_id); i++) { grilio_channel_remove_handler(sd->io, sd->event_id[i]); } if (sd->timer_id > 0) { g_source_remove(sd->timer_id); } grilio_channel_unref(sd->io); grilio_queue_cancel_all(sd->q, FALSE); grilio_queue_unref(sd->q); g_free(sd); }
static int ril_sms_probe(struct ofono_sms *sms, unsigned int vendor, void *user) { GRil *ril = user; struct sms_data *data; data = g_new0(struct sms_data, 1); data->ril = g_ril_clone(ril); data->vendor = vendor; ofono_sms_set_data(sms, data); /* * TODO: analyze if capability check is needed * and/or timer should be adjusted. * * ofono_sms_register() needs to be called after * the driver has been set in ofono_sms_create(), which * calls this function. Most other drivers make some * kind of capabilities query to the modem, and then * call register in the callback; we use a timer instead. */ g_timeout_add_seconds(2, ril_delayed_register, sms); return 0; }
static void ril_sms_remove(struct ofono_sms *sms) { struct sms_data *data = ofono_sms_get_data(sms); DBG(""); g_ril_unref(data->ril); g_free(data); ofono_sms_set_data(sms, NULL); }
static void at_sms_remove(struct ofono_sms *sms) { struct sms_data *data = ofono_sms_get_data(sms); g_free(data->cnma_ack_pdu); if (data->timeout_source > 0) g_source_remove(data->timeout_source); g_at_chat_unref(data->chat); g_free(data); ofono_sms_set_data(sms, NULL); }
static int at_sms_probe(struct ofono_sms *sms, unsigned int vendor, void *user) { GAtChat *chat = user; struct sms_data *data; data = g_new0(struct sms_data, 1); data->chat = g_at_chat_clone(chat); data->vendor = vendor; ofono_sms_set_data(sms, data); g_at_chat_send(data->chat, "AT+CSMS=?", csms_prefix, at_csms_query_cb, sms, NULL); return 0; }
static int ril_sms_probe(struct ofono_sms *sms, unsigned int vendor, void *data) { struct ril_modem *modem = data; struct ofono_sim *sim = ril_modem_ofono_sim(modem); struct ril_sms *sd = g_new0(struct ril_sms, 1); sd->modem = modem; sd->sms = sms; sd->io = grilio_channel_ref(ril_modem_io(modem)); sd->sim_context = ofono_sim_context_create(sim); sd->q = grilio_queue_new(sd->io); sd->timer_id = g_idle_add(ril_sms_register, sd); ofono_sms_set_data(sms, sd); GASSERT(sd->sim_context); return 0; }
static void isi_sms_remove(struct ofono_sms *sms) { struct sms_data *sd = ofono_sms_get_data(sms); if (sd == NULL) return; ofono_sms_set_data(sms, NULL); /* * Send a promiscuous routing release, so as not to * hog resources unnecessarily after being removed */ if (ISI_VERSION_AT_LEAST(&sd->version, 9, 1)) deactivate_reception(sd->client); else unset_routing(sd->client); g_isi_client_destroy(sd->client); g_isi_client_destroy(sd->sim); g_free(sd); }
static int isi_sms_probe(struct ofono_sms *sms, unsigned int vendor, void *user) { GIsiModem *modem = user; struct sms_data *sd = g_try_new0(struct sms_data, 1); if (sd == NULL) return -ENOMEM; sd->params.absent = 0xFF; sd->params.alphalen = 1; /* Includes final UCS2-coded NUL */ sd->client = g_isi_client_create(modem, PN_SMS); if (sd->client == NULL) goto nomem; sd->sim = g_isi_client_create(modem, PN_SIM); if (sd->sim == NULL) goto nomem; ofono_sms_set_data(sms, sd); g_isi_client_ind_subscribe(sd->client, SMS_MESSAGE_SEND_STATUS_IND, send_status_ind_cb, sms); g_isi_client_ind_subscribe(sd->client, SMS_RECEIVED_MSG_IND, received_msg_ind_cb, sms); g_isi_client_ntf_subscribe(sd->client, SMS_PP_ROUTING_NTF, routing_ntf_cb, sms); g_isi_client_verify(sd->client, sms_reachable_cb, sms, NULL); return 0; nomem: g_isi_client_destroy(sd->client); g_free(sd); return -ENOMEM; }