diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-09-17 10:15:34 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-09-17 10:15:34 -0500 |
commit | 12e77a3c70dcd0ef67a9c989c1279ac308cbba70 (patch) | |
tree | 44c5595842f17d780458b2f4740db038455d752d /plugins | |
parent | 0698fc2788303385920ee3c4fb8c5b636697c6cb (diff) | |
download | ofono-12e77a3c70dcd0ef67a9c989c1279ac308cbba70.tar.bz2 |
Convert all the modem drivers to the new API
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/atgen.c | 19 | ||||
-rw-r--r-- | plugins/calypso.c | 16 | ||||
-rw-r--r-- | plugins/g1.c | 19 | ||||
-rw-r--r-- | plugins/hso.c | 15 | ||||
-rw-r--r-- | plugins/huawei.c | 13 | ||||
-rw-r--r-- | plugins/mbm.c | 15 | ||||
-rw-r--r-- | plugins/novatel.c | 13 | ||||
-rw-r--r-- | plugins/phonesim.c | 29 |
8 files changed, 109 insertions, 30 deletions
diff --git a/plugins/atgen.c b/plugins/atgen.c index 08dacce1..1388dfa7 100644 --- a/plugins/atgen.c +++ b/plugins/atgen.c @@ -101,20 +101,28 @@ static int atgen_disable(struct ofono_modem *modem) return 0; } -static void atgen_populate(struct ofono_modem *modem) +static void atgen_pre_sim(struct ofono_modem *modem) { GAtChat *chat = ofono_modem_get_data(modem); - struct ofono_message_waiting *mw; DBG("%p", modem); ofono_devinfo_create(modem, 0, "atmodem", chat); - ofono_ussd_create(modem, 0, "atmodem", chat); ofono_sim_create(modem, 0, "atmodem", chat); + ofono_voicecall_create(modem, 0, "atmodem", chat); +} + +static void atgen_post_sim(struct ofono_modem *modem) +{ + GAtChat *chat = ofono_modem_get_data(modem); + struct ofono_message_waiting *mw; + + 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_voicecall_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); @@ -132,7 +140,8 @@ static struct ofono_modem_driver atgen_driver = { .remove = atgen_remove, .enable = atgen_enable, .disable = atgen_disable, - .populate = atgen_populate, + .pre_sim = atgen_pre_sim, + .post_sim = atgen_post_sim, }; static int atgen_init(void) diff --git a/plugins/calypso.c b/plugins/calypso.c index 9dd4e1ec..095414fa 100644 --- a/plugins/calypso.c +++ b/plugins/calypso.c @@ -348,7 +348,18 @@ static int calypso_disable(struct ofono_modem *modem) return -EINVAL; } -static void calypso_populate(struct ofono_modem *modem) +static void calypso_pre_sim(struct ofono_modem *modem) +{ + struct calypso_data *data = ofono_modem_get_data(modem); + + DBG(""); + + ofono_devinfo_create(modem, 0, "atmodem", data->chat); + ofono_sim_create(modem, 0, "atmodem", data->chat); + ofono_voicecall_create(modem, 0, "calypsomodem", data->chat); +} + +static void calypso_post_sim(struct ofono_modem *modem) { struct calypso_data *data = ofono_modem_get_data(modem); struct ofono_message_waiting *mw; @@ -377,7 +388,8 @@ static struct ofono_modem_driver calypso_driver = { .remove = calypso_remove, .enable = calypso_enable, .disable = calypso_disable, - .populate = calypso_populate, + .pre_sim = calypso_pre_sim, + .post_sim = calypso_post_sim, }; static int calypso_init(void) diff --git a/plugins/g1.c b/plugins/g1.c index 8229ec53..5c53a12a 100644 --- a/plugins/g1.c +++ b/plugins/g1.c @@ -140,20 +140,28 @@ static int g1_disable(struct ofono_modem *modem) return 0; } -static void g1_populate(struct ofono_modem *modem) +static void g1_pre_sim(struct ofono_modem *modem) { GAtChat *chat = ofono_modem_get_data(modem); - struct ofono_message_waiting *mw; DBG(""); ofono_devinfo_create(modem, 0, "atmodem", chat); - ofono_ussd_create(modem, 0, "atmodem", chat); ofono_sim_create(modem, 0, "atmodem", chat); + ofono_voicecall_create(modem, 0, "atmodem", chat); +} + +static void g1_post_sim(struct ofono_modem *modem) +{ + GAtChat *chat = ofono_modem_get_data(modem); + struct ofono_message_waiting *mw; + + DBG(""); + + 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_voicecall_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); @@ -171,7 +179,8 @@ static struct ofono_modem_driver g1_driver = { .remove = g1_remove, .enable = g1_enable, .disable = g1_disable, - .populate = g1_populate, + .pre_sim = g1_pre_sim, + .post_sim = g1_post_sim, }; static int g1_init(void) diff --git a/plugins/hso.c b/plugins/hso.c index d07d1d1c..e678aab3 100644 --- a/plugins/hso.c +++ b/plugins/hso.c @@ -145,7 +145,7 @@ static int hso_disable(struct ofono_modem *modem) return 0; } -static void hso_populate(struct ofono_modem *modem) +static void hso_pre_sim(struct ofono_modem *modem) { struct hso_data *data = ofono_modem_get_data(modem); @@ -157,13 +157,24 @@ static void hso_populate(struct ofono_modem *modem) ofono_sms_create(modem, 0, "atmodem", data->chat); } +static void hso_post_sim(struct ofono_modem *modem) +{ + struct hso_data *data = ofono_modem_get_data(modem); + + DBG("%p", modem); + + ofono_netreg_create(modem, 0, "atmodem", data->chat); + ofono_sms_create(modem, 0, "atmodem", data->chat); +} + static struct ofono_modem_driver hso_driver = { .name = "hso", .probe = hso_probe, .remove = hso_remove, .enable = hso_enable, .disable = hso_disable, - .populate = hso_populate, + .pre_sim = hso_pre_sim, + .post_sim = hso_post_sim, }; static int hso_init(void) diff --git a/plugins/huawei.c b/plugins/huawei.c index d9d1497f..392804da 100644 --- a/plugins/huawei.c +++ b/plugins/huawei.c @@ -141,13 +141,21 @@ static int huawei_disable(struct ofono_modem *modem) return 0; } -static void huawei_populate(struct ofono_modem *modem) +static void huawei_pre_sim(struct ofono_modem *modem) { struct huawei_data *data = ofono_modem_get_data(modem); DBG("%p", modem); ofono_devinfo_create(modem, 0, "atmodem", data->chat); +} + +static void huawei_post_sim(struct ofono_modem *modem) +{ + struct huawei_data *data = ofono_modem_get_data(modem); + + DBG("%p", modem); + ofono_netreg_create(modem, 0, "atmodem", data->chat); } @@ -157,7 +165,8 @@ static struct ofono_modem_driver huawei_driver = { .remove = huawei_remove, .enable = huawei_enable, .disable = huawei_disable, - .populate = huawei_populate, + .pre_sim = huawei_pre_sim, + .post_sim = huawei_post_sim, }; static int huawei_init(void) diff --git a/plugins/mbm.c b/plugins/mbm.c index c07cdb69..ce27d47f 100644 --- a/plugins/mbm.c +++ b/plugins/mbm.c @@ -145,15 +145,23 @@ static int mbm_disable(struct ofono_modem *modem) return 0; } -static void mbm_populate(struct ofono_modem *modem) +static void mbm_pre_sim(struct ofono_modem *modem) { struct mbm_data *data = ofono_modem_get_data(modem); DBG("%p", modem); ofono_devinfo_create(modem, 0, "atmodem", data->chat); - ofono_netreg_create(modem, 0, "atmodem", data->chat); ofono_sim_create(modem, 0, "atmodem", data->chat); +} + +static void mbm_post_sim(struct ofono_modem *modem) +{ + struct mbm_data *data = ofono_modem_get_data(modem); + + DBG("%p", modem); + + ofono_netreg_create(modem, 0, "atmodem", data->chat); ofono_sms_create(modem, 0, "atmodem", data->chat); } @@ -163,7 +171,8 @@ static struct ofono_modem_driver mbm_driver = { .remove = mbm_remove, .enable = mbm_enable, .disable = mbm_disable, - .populate = mbm_populate, + .pre_sim = mbm_pre_sim, + .post_sim = mbm_post_sim, }; static int mbm_init(void) diff --git a/plugins/novatel.c b/plugins/novatel.c index dac8dc4c..adbb36ae 100644 --- a/plugins/novatel.c +++ b/plugins/novatel.c @@ -141,13 +141,21 @@ static int novatel_disable(struct ofono_modem *modem) return 0; } -static void novatel_populate(struct ofono_modem *modem) +static void novatel_pre_sim(struct ofono_modem *modem) { struct novatel_data *data = ofono_modem_get_data(modem); DBG("%p", modem); ofono_devinfo_create(modem, 0, "atmodem", data->chat); +} + +static void novatel_post_sim(struct ofono_modem *modem) +{ + struct novatel_data *data = ofono_modem_get_data(modem); + + DBG("%p", modem); + ofono_netreg_create(modem, 0, "atmodem", data->chat); } @@ -157,7 +165,8 @@ static struct ofono_modem_driver novatel_driver = { .remove = novatel_remove, .enable = novatel_enable, .disable = novatel_disable, - .populate = novatel_populate, + .pre_sim = novatel_pre_sim, + .post_sim = novatel_post_sim, }; static int novatel_init(void) diff --git a/plugins/phonesim.c b/plugins/phonesim.c index aea3fc51..247582be 100644 --- a/plugins/phonesim.c +++ b/plugins/phonesim.c @@ -219,27 +219,37 @@ static int phonesim_disable(struct ofono_modem *modem) return 0; } -static void phonesim_populate(struct ofono_modem *modem) +static void phonesim_pre_sim(struct ofono_modem *modem) { struct phonesim_data *data = ofono_modem_get_data(modem); - struct ofono_message_waiting *mw; DBG("%p", modem); ofono_devinfo_create(modem, 0, "atmodem", data->chat); - ofono_ussd_create(modem, 0, "atmodem", data->chat); ofono_sim_create(modem, 0, "atmodem", data->chat); + + if (data->calypso) + ofono_voicecall_create(modem, 0, "calypsomodem", data->chat); + else + ofono_voicecall_create(modem, 0, "atmodem", data->chat); +} + +static void phonesim_post_sim(struct ofono_modem *modem) +{ + struct phonesim_data *data = ofono_modem_get_data(modem); + struct ofono_message_waiting *mw; + + DBG("%p", modem); + + ofono_ussd_create(modem, 0, "atmodem", data->chat); ofono_call_forwarding_create(modem, 0, "atmodem", data->chat); ofono_call_settings_create(modem, 0, "atmodem", data->chat); - if (data->calypso) { + if (data->calypso) ofono_netreg_create(modem, OFONO_VENDOR_CALYPSO, "atmodem", data->chat); - ofono_voicecall_create(modem, 0, "calypsomodem", data->chat); - } else { + else ofono_netreg_create(modem, 0, "atmodem", data->chat); - ofono_voicecall_create(modem, 0, "atmodem", data->chat); - } ofono_call_meter_create(modem, 0, "atmodem", data->chat); ofono_call_barring_create(modem, 0, "atmodem", data->chat); @@ -262,7 +272,8 @@ static struct ofono_modem_driver phonesim_driver = { .remove = phonesim_remove, .enable = phonesim_enable, .disable = phonesim_disable, - .populate = phonesim_populate, + .pre_sim = phonesim_pre_sim, + .post_sim = phonesim_post_sim }; static int phonesim_init(void) |