diff options
author | Jonas Bonn <jonas@norrbonn.se> | 2019-07-18 12:23:10 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2019-07-19 01:41:43 -0500 |
commit | 5b1d6f4e132f0ba7b71f92f3faa6d6e37ad69aca (patch) | |
tree | ff9c303126a5d604ca8fadb3879920260e47bc9a /plugins/ublox.c | |
parent | a86d6ffedef764a0e54137f68e6f187e9adf1c41 (diff) | |
download | ofono-5b1d6f4e132f0ba7b71f92f3faa6d6e37ad69aca.tar.gz |
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.
Diffstat (limited to 'plugins/ublox.c')
-rw-r--r-- | plugins/ublox.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/plugins/ublox.c b/plugins/ublox.c index ff08a6a1..8c8297dc 100644 --- a/plugins/ublox.c +++ b/plugins/ublox.c @@ -359,6 +359,7 @@ static void ublox_post_sim(struct ofono_modem *modem) const char *driver; /* Toby L2: Create same number of contexts as supported PDP contexts. */ int ncontexts = data->flags & UBLOX_DEVICE_F_HIGH_THROUGHPUT_MODE ? 8 : 1; + const char *iface; int variant; 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", data->aux); - if (ublox_is_toby_l4(data->model)) { + iface = ofono_modem_get_string(modem, "NetworkInterface"); + if (iface) { driver = "ubloxmodem"; 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 { driver = "atmodem"; variant = OFONO_VENDOR_UBLOX; |