Commit Graph

36 Commits

Author SHA1 Message Date
Jonas Bonn 93f03865f7 ublox: rework device initialization sequence
uBlox devices present their USB interfaces well before those interfaces
are ready to respond to any commands.  The documentation says to monitor
the 'greeting text' to detect readiness, but this 'greeting text' is not
actually specified for any device other than the TOBY L4.

What seems to work is to probe the device with 'AT' commands until the
device responds, and then to wait an additional second before
proceeding.  The TOBY L4 reliably sends its 'greeting text' (+AT: READY)
within this interval.

It would be more rigorous to actually wait for the 'READY' indication
for the TOBY L4, but that would require knowing the device model before
the device model is actually queried.  This is doable via the USB
product ID, but overkill when the above heuristic seems to work
reliably.

Before this patch, the ublox plugin was trying to achieve something like
the above with the g_at_chat_set_wakeup_command() function, but that had
some issues:

i)  it did not work reliably, in particular failing badly on the TOBY L4
with responses getting out of sync with commands
ii) it was an inappropriate use of the wakeup_command which is intended
for devices that may sleep when there is no communication during some
interval

This patch adds an init sequence that probes the device for readiness
before continuing with initialization.
2019-09-25 21:25:16 -05:00
Jonas Bonn 0b3c640971 ublox: use common close_devices when modem disabled
Just reshuffling the code a bit and the 'disable' path can use the
close_devices() helper to finish up.  This also prevents a bug should
the CFUN command fail to disable the modem whereby the 'aux' device
remains open but the 'modem' device has already been closed.
2019-09-25 21:25:16 -05:00
Jonas Bonn 4bf7671881 ublox: consolidate teardown in common function
The code for closing all the modem devices and flagging the modem as
unpowered is repeated several times in the driver... this patch puts
this code into a common helper for readability.
2019-09-25 21:25:16 -05:00
Jonas Bonn 4e4c209c0b ublox: raise call to open device 2019-09-24 09:57:39 -05:00
Jonas Bonn a39944a5c0 ublox: use custom netreg atom 2019-07-19 02:45:10 -05:00
Jonas Bonn 3a53f140cc ublox: add SMS support 2019-07-19 01:43:23 -05:00
Jonas Bonn 5559874592 ublox: add voicecall support 2019-07-19 01:42:45 -05:00
Jonas Bonn 353b7bc3e9 ublox: create only 1 gprs context
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.
2019-07-19 01:42:15 -05:00
Jonas Bonn 5b1d6f4e13 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.
2019-07-19 01:41:43 -05:00
Denis Kenzior 44e6bccf10 ublox: Use at_util_open_device 2019-05-31 11:58:39 -05:00
Richard Röjfors 2004d26cdc ublox: Correct the USBCONF reply prefix
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.
2019-04-01 09:56:40 -05:00
Richard Röjfors 4d64235f27 ublox: Do not leave vendor_family unset
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.
2019-04-01 09:52:59 -05:00
Jonas Bonn 9cba079221 ublox: do not set bridge mode for TOBY L2
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.
2019-03-14 20:34:32 -05:00
Jonas Bonn 5a6de99737 ublox: pass model_id to gprs-context driver
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.
2019-03-14 20:34:32 -05:00
Jonas Bonn e2d2712708 ublox: pass model id to LTE plugin 2019-03-13 16:44:43 -05:00
Jonas Bonn e6b7a2fd2d Separate ATE and AT+CMEE commands
The TOBY L4 doesn't seem to like seeing these two commands on the same
line...
2019-03-13 16:39:25 -05:00
Jonas Bonn 8a62ee79a9 ublox: add device flags
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.
2019-03-13 16:38:12 -05:00
Jonas Bonn 2dc053b28e ublox: query USBCONF for applicable devices
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.
2019-03-13 16:28:48 -05:00
Jonas Bonn f4b8d4d30b ublox: query device model
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.
2019-03-13 16:22:51 -05:00
Jonas Bonn 55bec598b6 ublox: make device selection more flexible
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.
2019-03-13 13:22:53 -05:00
Jonas Bonn 4f5ce95d41 ublox: drop vendor type for Toby L2 model 2019-03-13 13:20:43 -05:00
Giacinto Cifelli f9cde76095 ublox: Add voicecall support 2018-08-09 11:48:40 -05:00
Denis Kenzior 5d346349fb plugins: Update to the new LTE API 2018-03-12 09:37:58 -05:00
Richard Röjfors 5b4539fd9a ublox: Disable DCD to avoid HUP when leaving data mode.
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.
2017-10-05 11:20:05 -05:00
Marcel Holtmann 7756e3700f ublox: Add missing break statement 2017-07-11 10:46:39 -07:00
Djalal Harouni ee0ca53a33 ubloxmodem: register and initialize the netmon driver 2016-12-01 11:22:31 -06:00
Dragos Tatulea 919e0b95ac plugins: ublox: enable lte driver for tobyl2 2016-11-15 13:46:04 -06:00
Dragos Tatulea 8d8333cc21 ublox: support more internet contexts
Create multiple gprs-context instances and let the gprs core use
them as it sees fit.

Only for Toby L2.
2016-03-17 09:53:51 -05:00
Dragos Tatulea 50133ac0f4 ublox: enable ubloxmodem driver when possible
Where possible means Toby L2 in high speed mode.

The bridge mode is set before enabling the modem because the
driver requires this.
2016-03-17 09:52:23 -05:00
Dragos Tatulea 82fb20d707 ublox: give names to model ids
To make it easier to understand the code.
2016-03-17 09:40:59 -05:00
Denis Kenzior 5b6ac8c14f ublox: devinfo atom driver has no vendor behavior 2016-03-16 13:18:28 -05:00
Dragos Tatulea c0c2ae87ab ublox: use vendor from structure instead of fixed
That's because we need to differentiate between multiple ublox
devices.
2016-03-16 13:12:49 -05:00
Dragos Tatulea ae74d4ccd6 ublox: allow enabling of TOBY L2 modems
For this we need to:
* Set the vendor family based on model id.
* Not use modem interface for the TOBY L2 family.
2016-03-16 13:10:29 -05:00
Denis Kenzior 361eed7b9a ublox: Minor style cleanup 2014-07-08 08:58:48 -05:00
Denis Kenzior 864efe1add ublox: Remove unneeded VENDOR flags
devinfo and netreg atoms don't use vendor specific behavior
2014-07-08 08:56:55 -05:00
Philip Paeps 0d8a06af30 plugins: new driver for u-blox SARA-U270 modems
This driver may also work (perhaps with more or less trivial changes)
with other u-blox modems (SARA, LISA, LEON) but this hasn't been tested.
2014-07-08 08:53:13 -05:00