The TOBY L2 may run in either "bridge" mode or "router" mode. For this
model, query the configured mode so that the appropriate settings are
communicated when the context is activated.
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.
Depending on the transport used on the data connection we want either
the "atmodem" (PPP) driver or the "ubloxmodem". For the "ubloxmodem",
we want to pass the model data so this patch wrangles some parameters to
make sure that right driver and right variant data are passed.
There are a couple of semi-independent changes here:
* use the 'vendor' parameter to pass the modem 'model'
* support TOBY L4 modem which uses a fixed CID for configuring the EPS
default bearer
* add the setup of authentication parameters that was recently added to
the atmodem LTE driver
ttyACM0 (USB interface 02) is reportedly unreliable (breaking DHCP setup)
so the recommended approach is to use ttyACM2 (USB interface 06)
exclusively.
Some aspects of a device are detectable at runtime, like the USB profile
detection that was added in a patch preceding this one. This patch
switches the driver over from creating a new "vendor id" for each
profile to just setting a flag. This is more easily extensible as we
detect other features of the modem.
The TOBY L2 series of modems presents a number of different
configurations with different throughtput characteristics. These
configurations are packaged up as USB profiles; moreover, changing the
profile actually changes the USB model ID so this is even more like
selecting a different "device" altogether. Nonetheless, all we need to
know is which profile is selected in order to set things up correctly
and this can be queried directly.
This patch adds a call to UUSBCONF for applicable modems in order to
query the USB configuration to find out which profile is active.
This flag should be set on devices that support multiple USB profiles
and will be used to determine whether or not querying USB profiles is
appropriate/necessary.
This patch adds a call to CGMM into the modem_enable path in order to
establish the specific device model. From this device model string, a
model-specific capabilities structure can be selected.
This sets up some device model data structures and adds some helpers for
manipulating them. These data structures are a first step to trying to
support the large number of devices that ublox produces with a common
driver structure.
Many ublox modems can sit on either the USB bus or talk directly to a
UART. The udev plugin mostly takes care of figuring out what ports to
talk to and the protocol is common for all devices after that.
This patch simplifies the setup a bit:
i) There must always be an aux channel for communication with the modem
ii) The aux channel may be found behind the string Aux for USB modems
or Device for serial modems
iii) If the Modem string is set, use it; if not set, assume it's not
available.
The 'Toby L2'-specific vendor type is used only to prevent the CMER
command from attempting to set mode '3'. For all u-blox models, mode
'3' is just an alias for mode '1'. As such, mode '1' can be used in
place of mode '3', removing the model-specific quirk in favour of a
vendor-specific quirk.
With this change, the L2-specific vendor type is no longer needed.
While adding the sim pin cache feature, pin_name could cause issue in
cases when sim pin is not there.
log:
ofonod[27810]: drivers/atmodem/sim.c:at_cpin_cb() crsm_pin_cb: READY
ofonod[27810]: src/sim.c:sim_pin_query_cb() sim->pin_type: 0, pin_type: 0
ofonod[27810]: Aborting (signal 11) [./src/ofonod]
ofonod[27810]: ++++++++ backtrace ++++++++
ofonod[27810]: #0 0x7fb7a7586cb0 in /lib/x86_64-linux-gnu/libc.so.6
ofonod[27810]: #1 0x7fb7a7693cd8 in /lib/x86_64-linux-gnu/libc.so.6
ofonod[27810]: #2 0x4d899b in sim_pin_query_cb() at src/sim.c:3174
ofonod[27810]: #3 0x4649e7 in at_cpin_cb() at drivers/atmodem/sim.c:1304
ofonod[27810]: #4 0x4a5d70 in at_chat_finish_command() at gatchat/gatchat.c:462
The if statements were over 80 characters and breaking them up made the
code look a bit uglier. So refactor the if statements to just figure
out the data path 'n' parameter or return an error. On success, form
the datapath string and return it.
Also bump the buffer size and use snprintf to be safe(r).
This patch allows a driver to set the interface only once, instead of at
every context activation. The previous way was originally designed for
PPP and RAW_IP based contexts which would have a (potentially)
differently named interface after each context activation due to use of
TUN/TAP. This also worked for static high-speed interface setups as
well, since these usually had a single interface only.
For devices that support multiple high-speed interfaces it would be
advantageous to have each gprs_context get an interface assignment right
in the modem driver and skip having to setup the interface on every
activation.
Since the commit that introduced the notification API of a SIM inserted
and initialized I can not unlock the SIM card on a WP7607 modem.
The previously mentioned commit: 54d56d763e
Adding SIM PIN caching feature to oFono. oFono now caches the SIM PIN1
type against the ICCID throughout its lifetime in a link list and
enters implicitly upon modem reset/crash.
Note, that this behavior can violate 3GPP spec 21.111, section 5.3 -
User Data stored in ME if that section is interpreted very strictly.
However, our interpretation is that firmware resets are allowed, based
on historic precedent. Helps in user experience by not barring out
cellular services unless pin is entered manually.
Handles cases of incorrect pin and sim pin changed externally.
Clear cached PIN incase modem disabled manually and selectively when
sim is removed.
Seperate 'pin_cache_enter_cb' added without dbus calls to handle
implict entering of cached pin.
For now this behavior is applicable to all modems by default. In the
future it may be needed to make this behavior opt in or otherwise
configurable.
skipping TAP/TUN support check from gprs-context probe for
xmm vendor. xmm modem does not require TAP/TUN support. Also
it is not enabled by default in enbedded yocto bsp.
After the convertion to l_uintset, the creation of new contexts fails
due to a range error being returned from l_uintset_find_unused().
The error happens because the uinset is created with a min-value of 1,
but the start-value passed to l_uintset_find_unused() is initialized as
0.
Reported-by: Martin Hundebøll <martin@geanix.com>
when the voice call driver is probing, I noticed sometimes
a CME Error with the code = 4 (operation not supported)
related to AT commands "AT+CSSN=1,1" and "AT^SLCC=1".
In the current voice call implementation for Gemalto modems
the ofono_voicecall_create() is called on the gemalto_pre_sim().
The sim is not totaly readed by the module, it is not yet
online which is causing a sporadic problem at driver
intialization also when launching some outgoing/incoming calls.
This change moves the ofono_voicecall_create() to the
gemalto_post_online() to be sure that sim is well registred
and online. Several other call related atoms are also moved to
post_online state.