From: Denis Kenzior Date: Tue, 1 Sep 2009 23:00:58 +0000 (-0500) Subject: Add vendor flag capability to ussd X-Git-Tag: 0.4~50 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5577046f06e8501d313e669b35455399ff09585;p=platform%2Fupstream%2Fofono.git Add vendor flag capability to ussd --- diff --git a/drivers/atmodem/ussd.c b/drivers/atmodem/ussd.c index 49801f7..3f454b1 100644 --- a/drivers/atmodem/ussd.c +++ b/drivers/atmodem/ussd.c @@ -143,8 +143,11 @@ static gboolean at_ussd_register(gpointer user) return FALSE; } -static int at_ussd_probe(struct ofono_ussd *ussd) +static int at_ussd_probe(struct ofono_ussd *ussd, int vendor, void *data) { + GAtChat *chat = data; + + ofono_ussd_set_data(ussd, chat); g_idle_add(at_ussd_register, ussd); return 0; diff --git a/drivers/isimodem/isimodem.c b/drivers/isimodem/isimodem.c index 77c1a89..ba8ca6f 100644 --- a/drivers/isimodem/isimodem.c +++ b/drivers/isimodem/isimodem.c @@ -156,7 +156,7 @@ static int isi_modem_populate(struct ofono_modem *modem) ofono_sms_create(isi->modem, 0, "isi", isi->idx); ofono_sim_create(isi->modem, 0, "isi", isi->idx); ofono_ssn_create(isi->modem, 0, "isi", isi->idx); - ofono_ussd_create(isi->modem, "isi", isi->idx); + ofono_ussd_create(isi->modem, 0, "isi", isi->idx); ofono_call_forwarding_create(isi->modem, 0, "isi", isi->idx); ofono_call_settings_create(isi->modem, 0, "isi", isi->idx); ofono_call_barring_create(isi->modem, 0, "isi", isi->idx); diff --git a/drivers/isimodem/ussd.c b/drivers/isimodem/ussd.c index e2cbd60..4ba70fc 100644 --- a/drivers/isimodem/ussd.c +++ b/drivers/isimodem/ussd.c @@ -58,9 +58,9 @@ static void isi_cancel(struct ofono_ussd *ussd, { } -static int isi_ussd_probe(struct ofono_ussd *ussd) +static int isi_ussd_probe(struct ofono_ussd *ussd, int vendor, void *user) { - GIsiModem *idx = ofono_ussd_get_data(ussd); + GIsiModem *idx = user; struct ussd_data *data = g_try_new0(struct ussd_data, 1); if (!data) diff --git a/include/ussd.h b/include/ussd.h index dd961b8..feb20ce 100644 --- a/include/ussd.h +++ b/include/ussd.h @@ -34,7 +34,7 @@ typedef void (*ofono_ussd_cb_t)(const struct ofono_error *error, void *data); struct ofono_ussd_driver { const char *name; - int (*probe)(struct ofono_ussd *ussd); + int (*probe)(struct ofono_ussd *ussd, int vendor, void *data); int (*remove)(struct ofono_ussd *ussd); void (*request)(struct ofono_ussd *ussd, const char *str, ofono_ussd_cb_t, void *data); @@ -47,7 +47,7 @@ void ofono_ussd_notify(struct ofono_ussd *ussd, int status, const char *str); int ofono_ussd_driver_register(const struct ofono_ussd_driver *d); void ofono_ussd_driver_unregister(const struct ofono_ussd_driver *d); -struct ofono_ussd *ofono_ussd_create(struct ofono_modem *modem, +struct ofono_ussd *ofono_ussd_create(struct ofono_modem *modem, int vendor, const char *driver, void *data); void ofono_ussd_register(struct ofono_ussd *ussd); diff --git a/plugins/generic_at.c b/plugins/generic_at.c index 1ac35ff..d7b0504 100644 --- a/plugins/generic_at.c +++ b/plugins/generic_at.c @@ -510,7 +510,7 @@ static int generic_at_populate(struct ofono_modem *modem) struct ofono_message_waiting *mw; ofono_devinfo_create(modem, 0, "generic_at", chat); - ofono_ussd_create(modem, "generic_at", chat); + ofono_ussd_create(modem, 0, "generic_at", chat); ofono_sim_create(modem, 0, "generic_at", chat); ofono_call_forwarding_create(modem, 0, "generic_at", chat); ofono_call_settings_create(modem, 0, "generic_at", chat); diff --git a/src/ussd.c b/src/ussd.c index 33f8774..8c29f70 100644 --- a/src/ussd.c +++ b/src/ussd.c @@ -522,6 +522,7 @@ static void ussd_remove(struct ofono_atom *atom) } struct ofono_ussd *ofono_ussd_create(struct ofono_modem *modem, + int vendor, const char *driver, void *data) { @@ -536,7 +537,6 @@ struct ofono_ussd *ofono_ussd_create(struct ofono_modem *modem, if (ussd == NULL) return NULL; - ussd->driver_data = data; ussd->atom = __ofono_modem_add_atom(modem, OFONO_ATOM_TYPE_USSD, ussd_remove, ussd); @@ -546,7 +546,7 @@ struct ofono_ussd *ofono_ussd_create(struct ofono_modem *modem, if (g_strcmp0(drv->name, driver)) continue; - if (drv->probe(ussd) < 0) + if (drv->probe(ussd, vendor, data) < 0) continue; ussd->driver = drv;