Some uBlox modems support multiple, simultaneously active contexts. These
contexts are either bridged to the network interface or handled
transparently by the modem acting like a router.
The problem with this approach is that ofono and ofono clients (e.g.
mmsd) expect a dedicated _local_ network interface for each context.
As such, it doesn't make sense for ofono to set up the multiple gprs
contexts.
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.
According to the u-blox AT Commands Manual and my tests
the response prefix of AT+UUSBCONF is "+UUSBCONF:", including
a colon. The colon was missing in the code, causing next step
to parse a number to fail, since a colon is not a number.
In a recent patch vendor family was only set if the device
did not support USBCONF, but that resulted in drivers
being registered the "generic" vendor. That caused
for instance netreg to use incorrect cmer mode and fail
on TOBY-L210.
Trying to set the networking mode to "bridge" mode in the plugin is bogus
because the setting does not apply until after the device has been
reset. Instead, the current setting should be queried.
If a user wants to set the modem networking mode, the setting should be
made outside of ofono.
The gprs-context driver has already been adjusted to query the
networking mode and to set things up accordingly.
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.
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 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.
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 HUP results in errors in gatio which will deref parts
of the AT channel. This makes it impossible to recover and
send further AT commands after the HUP.