diff options
author | Jonas Bonn <jonas@norrbonn.se> | 2019-03-14 23:28:41 +0100 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2019-03-14 20:34:32 -0500 |
commit | efe1306ec21cfe3e1054fae735970e1881e7b0c5 (patch) | |
tree | 2308170a9374f235a2a80ada52285fb9271a5347 /drivers/ubloxmodem | |
parent | 5a6de9973754525ffb72f361b9913f18daf65b38 (diff) | |
download | ofono-efe1306ec21cfe3e1054fae735970e1881e7b0c5.tar.gz |
ublox: TOBY L4 supports only router mode
The TOBY L4 supports only "router mode" where the modem presents a
network interface that one can run a DHCP client against. Behind this
interface, the modem takes care of routing packets via NAT by:
i) selecting the relevant context based on destination IP
ii) using the first activated context as the default route
In order to have the connection manager, thus, do the right thing, the
context only needs to report itself as being active and with the IP
settings set to method "dhcp". There's no need for the connection manager
to know details like what IP address the context was assigned.
Tested with connman that does the right thing when it finds an active
"dhcp" context.
Diffstat (limited to 'drivers/ubloxmodem')
-rw-r--r-- | drivers/ubloxmodem/gprs-context.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/ubloxmodem/gprs-context.c b/drivers/ubloxmodem/gprs-context.c index bbf8627a..389868c1 100644 --- a/drivers/ubloxmodem/gprs-context.c +++ b/drivers/ubloxmodem/gprs-context.c @@ -240,6 +240,15 @@ static void ublox_gprs_read_settings(struct ofono_gprs_context *gc, DBG("cid %u", cid); + if (ublox_is_toby_l4(gcd->model)) { + /* Use DHCP */ + gcd->active_context = cid; + set_gprs_context_interface(gc); + ofono_gprs_context_set_ipv4_address(gc, NULL, 0); + CALLBACK_WITH_SUCCESS(cb, data); + return; + } + gcd->active_context = cid; gcd->cb = cb; gcd->cb_data = data; |