ublox: determine gprs-context driver from network interface

Some u-blox devices present a USB network class device for data and some
just switch to PPP on (one of) the communication channel(s).  Whether
the atmodem or ubloxmodem gprs-context driver should be used depends on
whether or not the network interface is present; check this condition
directly when deciding which driver to us.
This commit is contained in:
Jonas Bonn 2019-07-18 12:23:10 +02:00 committed by Denis Kenzior
parent a86d6ffede
commit 5b1d6f4e13
1 changed files with 3 additions and 9 deletions

View File

@ -359,6 +359,7 @@ static void ublox_post_sim(struct ofono_modem *modem)
const char *driver; const char *driver;
/* Toby L2: Create same number of contexts as supported PDP contexts. */ /* Toby L2: Create same number of contexts as supported PDP contexts. */
int ncontexts = data->flags & UBLOX_DEVICE_F_HIGH_THROUGHPUT_MODE ? 8 : 1; int ncontexts = data->flags & UBLOX_DEVICE_F_HIGH_THROUGHPUT_MODE ? 8 : 1;
const char *iface;
int variant; int variant;
DBG("%p", modem); DBG("%p", modem);
@ -366,17 +367,10 @@ static void ublox_post_sim(struct ofono_modem *modem)
gprs = ofono_gprs_create(modem, data->vendor_family, "atmodem", gprs = ofono_gprs_create(modem, data->vendor_family, "atmodem",
data->aux); data->aux);
if (ublox_is_toby_l4(data->model)) { iface = ofono_modem_get_string(modem, "NetworkInterface");
if (iface) {
driver = "ubloxmodem"; driver = "ubloxmodem";
variant = ublox_model_to_id(data->model); variant = ublox_model_to_id(data->model);
} else if (ublox_is_toby_l2(data->model)) {
if (data->flags & UBLOX_DEVICE_F_HIGH_THROUGHPUT_MODE) {
driver = "ubloxmodem";
variant = ublox_model_to_id(data->model);
} else {
driver = "atmodem";
variant = OFONO_VENDOR_UBLOX;
}
} else { } else {
driver = "atmodem"; driver = "atmodem";
variant = OFONO_VENDOR_UBLOX; variant = OFONO_VENDOR_UBLOX;