Add vendor flag capability to voicecalls
authorDenis Kenzior <denis.kenzior@intel.com>
Tue, 1 Sep 2009 23:03:52 +0000 (18:03 -0500)
committerDenis Kenzior <denkenz@gmail.com>
Tue, 1 Sep 2009 23:14:59 +0000 (18:14 -0500)
drivers/atmodem/voicecall.c
drivers/isimodem/isimodem.c
drivers/isimodem/voicecall.c
include/voicecall.h
plugins/generic_at.c
src/voicecall.c

index 1a2ef00..9b115a5 100644 (file)
@@ -983,9 +983,10 @@ static void at_voicecall_initialized(gboolean ok, GAtResult *result,
        ofono_voicecall_register(vc);
 }
 
-static int at_voicecall_probe(struct ofono_voicecall *vc)
+static int at_voicecall_probe(struct ofono_voicecall *vc, int vendor,
+                               void *data)
 {
-       GAtChat *chat = ofono_voicecall_get_data(vc);
+       GAtChat *chat = data;
        struct voicecall_data *vd;
 
        vd = g_new0(struct voicecall_data, 1);
index ba8ca6f..d5000b1 100644 (file)
@@ -152,7 +152,7 @@ static int isi_modem_populate(struct ofono_modem *modem)
        ofono_devinfo_create(isi->modem, 0, "isi", isi->idx);
        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_voicecall_create(isi->modem, 0, "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, 0, "isi", isi->idx);
index 423c026..b1cee1c 100644 (file)
@@ -127,9 +127,10 @@ static void isi_send_tones(struct ofono_voicecall *vc, const char *tones,
 {
 }
 
-static int isi_voicecall_probe(struct ofono_voicecall *call)
+static int isi_voicecall_probe(struct ofono_voicecall *call, int vendor,
+                               void *user)
 {
-       GIsiModem *idx = ofono_voicecall_get_data(call);
+       GIsiModem *idx = user;
        struct voicecall_data *data = g_try_new0(struct voicecall_data, 1);
 
        if (!data)
index 2ccc554..e22b0ca 100644 (file)
@@ -46,7 +46,7 @@ typedef void (*ofono_call_list_cb_t)(const struct ofono_error *error,
  */
 struct ofono_voicecall_driver {
        const char *name;
-       int (*probe)(struct ofono_voicecall *vc);
+       int (*probe)(struct ofono_voicecall *vc, int vendor, void *data);
        int (*remove)(struct ofono_voicecall *vc);
        void (*dial)(struct ofono_voicecall *vc,
                        const struct ofono_phone_number *number,
@@ -93,6 +93,7 @@ int ofono_voicecall_driver_register(const struct ofono_voicecall_driver *d);
 void ofono_voicecall_driver_unregister(const struct ofono_voicecall_driver *d);
 
 struct ofono_voicecall *ofono_voicecall_create(struct ofono_modem *modem,
+                                       int vendor,
                                        const char *driver, void *data);
 
 void ofono_voicecall_register(struct ofono_voicecall *vc);
index d7b0504..d3e4f6a 100644 (file)
@@ -515,7 +515,7 @@ static int generic_at_populate(struct ofono_modem *modem)
        ofono_call_forwarding_create(modem, 0, "generic_at", chat);
        ofono_call_settings_create(modem, 0, "generic_at", chat);
        ofono_netreg_create(modem, 0, "generic_at", chat);
-       ofono_voicecall_create(modem, "generic_at", chat);
+       ofono_voicecall_create(modem, 0, "generic_at", chat);
        ofono_call_meter_create(modem, 0, "generic_at", chat);
        ofono_call_barring_create(modem, 0, "generic_at", chat);
        ofono_ssn_create(modem, 0, "generic_at", chat);
index 71c1ddf..367d6b1 100644 (file)
@@ -1813,8 +1813,9 @@ static void voicecall_remove(struct ofono_atom *atom)
 }
 
 struct ofono_voicecall *ofono_voicecall_create(struct ofono_modem *modem,
-                                       const char *driver,
-                                       void *data)
+                                               int vendor,
+                                               const char *driver,
+                                               void *data)
 {
        struct ofono_voicecall *vc;
        GSList *l;
@@ -1827,7 +1828,6 @@ struct ofono_voicecall *ofono_voicecall_create(struct ofono_modem *modem,
        if (vc == NULL)
                return NULL;
 
-       vc->driver_data = data;
        vc->atom = __ofono_modem_add_atom(modem, OFONO_ATOM_TYPE_VOICECALL,
                                                voicecall_remove, vc);
 
@@ -1837,7 +1837,7 @@ struct ofono_voicecall *ofono_voicecall_create(struct ofono_modem *modem,
                if (g_strcmp0(drv->name, driver))
                        continue;
 
-               if (drv->probe(vc) < 0)
+               if (drv->probe(vc, vendor, data) < 0)
                        continue;
 
                vc->driver = drv;