Add vendor flag capability for sms

This commit is contained in:
Denis Kenzior 2009-09-01 17:39:29 -05:00 committed by Denis Kenzior
parent aecf42646e
commit 8d380f8fa0
6 changed files with 12 additions and 10 deletions

View File

@ -73,6 +73,7 @@ struct sms_data {
char *cnma_ack_pdu;
int cnma_ack_pdu_len;
GAtChat *chat;
int vendor;
};
struct cpms_request {
@ -956,13 +957,14 @@ out:
at_csms_set_cb, sms, NULL);
}
static int at_sms_probe(struct ofono_sms *sms)
static int at_sms_probe(struct ofono_sms *sms, int vendor, void *user)
{
GAtChat *chat = ofono_sms_get_data(sms);
GAtChat *chat = user;
struct sms_data *data;
data = g_new0(struct sms_data, 1);
data->chat = chat;
data->vendor = vendor;
ofono_sms_set_data(sms, data);

View File

@ -153,7 +153,7 @@ static int isi_modem_populate(struct ofono_modem *modem)
ofono_phonebook_create(isi->modem, 0, "isi", isi->idx);
ofono_netreg_create(isi->modem, 0, "isi", isi->idx);
ofono_voicecall_create(isi->modem, "isi", isi->idx);
ofono_sms_create(isi->modem, "isi", isi->idx);
ofono_sms_create(isi->modem, 0, "isi", isi->idx);
ofono_sim_create(isi->modem, 0, "isi", isi->idx);
ofono_ssn_create(isi->modem, "isi", isi->idx);
ofono_ussd_create(isi->modem, "isi", isi->idx);

View File

@ -65,9 +65,9 @@ static void isi_submit(struct ofono_sms *sms, unsigned char *pdu,
{
}
static int isi_sms_probe(struct ofono_sms *sms)
static int isi_sms_probe(struct ofono_sms *sms, int vendor, void *user)
{
GIsiModem *idx = ofono_sms_get_data(sms);
GIsiModem *idx = user;
struct sms_data *data = g_try_new0(struct sms_data, 1);
if (!data)

View File

@ -40,7 +40,7 @@ typedef void (*ofono_sms_sca_set_cb_t)(const struct ofono_error *error,
struct ofono_sms_driver {
const char *name;
int (*probe)(struct ofono_sms *sms);
int (*probe)(struct ofono_sms *sms, int vendor, void *data);
int (*remove)(struct ofono_sms *sms);
void (*sca_query)(struct ofono_sms *sms, ofono_sms_sca_query_cb_t cb,
void *data);
@ -60,7 +60,7 @@ void ofono_sms_status_notify(struct ofono_sms *sms, unsigned char *pdu,
int ofono_sms_driver_register(const struct ofono_sms_driver *d);
void ofono_sms_driver_unregister(const struct ofono_sms_driver *d);
struct ofono_sms *ofono_sms_create(struct ofono_modem *modem,
struct ofono_sms *ofono_sms_create(struct ofono_modem *modem, int vendor,
const char *driver, void *data);
void ofono_sms_register(struct ofono_sms *sms);

View File

@ -519,7 +519,7 @@ static int generic_at_populate(struct ofono_modem *modem)
ofono_call_meter_create(modem, 0, "generic_at", chat);
ofono_call_barring_create(modem, 0, "generic_at", chat);
ofono_ssn_create(modem, "generic_at", chat);
ofono_sms_create(modem, "generic_at", chat);
ofono_sms_create(modem, 0, "generic_at", chat);
ofono_phonebook_create(modem, 0, "generic_at", chat);
mw = ofono_message_waiting_create(modem);

View File

@ -819,6 +819,7 @@ static void sms_remove(struct ofono_atom *atom)
}
struct ofono_sms *ofono_sms_create(struct ofono_modem *modem,
int vendor,
const char *driver,
void *data)
{
@ -837,7 +838,6 @@ struct ofono_sms *ofono_sms_create(struct ofono_modem *modem,
sms->ref = 1;
sms->assembly = sms_assembly_new();
sms->txq = g_queue_new();
sms->driver_data = data;
sms->atom = __ofono_modem_add_atom(modem, OFONO_ATOM_TYPE_SMS,
sms_remove, sms);
@ -847,7 +847,7 @@ struct ofono_sms *ofono_sms_create(struct ofono_modem *modem,
if (g_strcmp0(drv->name, driver))
continue;
if (drv->probe(sms) < 0)
if (drv->probe(sms, vendor, data) < 0)
continue;
sms->driver = drv;