From cdfea3601e4c246191906dc2a6f85020385f3d0b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 6 Jan 2012 19:08:13 -0800 Subject: [PATCH] huawei: Create CDMA atoms if support has been detected In case the modem supports CDMA (+CIS707-A capability), then enable CDMA atoms. However only enable if GSM support is not detected. --- plugins/huawei.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/huawei.c b/plugins/huawei.c index bbaab4d..ae398d8 100644 --- a/plugins/huawei.c +++ b/plugins/huawei.c @@ -50,6 +50,8 @@ #include #include #include +#include +#include #include #include @@ -82,6 +84,7 @@ struct huawei_data { const char *offline_command; gboolean have_voice; gboolean have_gsm; + gboolean have_cdma; }; static int huawei_probe(struct ofono_modem *modem) @@ -438,6 +441,8 @@ static void gcap_support(gboolean ok, GAtResult *result, gpointer user_data) if (!strcmp(gcap, "+CGSM")) data->have_gsm = TRUE; + else if (!strcmp(gcap, "+CIS707-A")) + data->have_cdma = TRUE; } done: @@ -694,6 +699,8 @@ static void huawei_pre_sim(struct ofono_modem *modem) if (sim && data->have_sim == TRUE) ofono_sim_inserted_notify(sim, TRUE); + } else if (data->have_cdma == TRUE) { + ofono_devinfo_create(modem, 0, "cdmamodem", data->pcui); } } @@ -744,6 +751,12 @@ static void huawei_post_online(struct ofono_modem *modem) "atmodem", data->pcui); ofono_ussd_create(modem, OFONO_VENDOR_QUALCOMM_MSM, "atmodem", data->pcui); + } else if (data->have_cdma == TRUE) { + ofono_cdma_netreg_create(modem, 0, + "huaweicdmamodem", data->pcui); + + ofono_cdma_connman_create(modem, OFONO_VENDOR_HUAWEI, + "cdmamodem", data->modem); } if (data->have_voice == TRUE) { -- 2.7.4