diff --git a/plugins/ublox.c b/plugins/ublox.c index 544d4297..092ba64e 100644 --- a/plugins/ublox.c +++ b/plugins/ublox.c @@ -294,21 +294,25 @@ static void ublox_post_sim(struct ofono_modem *modem) struct ofono_gprs *gprs; struct ofono_gprs_context *gc; GAtChat *chat = data->modem ? data->modem : data->aux; + const char *driver = data->model_id == TOBYL2_HIGH_THROUGHPUT_MODE ? + "ubloxmodem" : "atmodem"; + /* Toby L2: Create same number of contexts as supported PDP contexts. */ + int ncontexts = data->model_id == TOBYL2_HIGH_THROUGHPUT_MODE ? 8 : 1; DBG("%p", modem); gprs = ofono_gprs_create(modem, data->vendor_family, "atmodem", data->aux); - if (data->model_id == TOBYL2_HIGH_THROUGHPUT_MODE) - gc = ofono_gprs_context_create(modem, data->vendor_family, - "ubloxmodem", chat); - else + while (ncontexts) { gc = ofono_gprs_context_create(modem, data->vendor_family, - "atmodem", chat); + driver, chat); - if (gprs && gc) - ofono_gprs_add_context(gprs, gc); + if (gprs && gc) + ofono_gprs_add_context(gprs, gc); + + --ncontexts; + } } static void ublox_post_online(struct ofono_modem *modem)