Commit Graph

29 Commits

Author SHA1 Message Date
Aleksander Morgado
4804c37604 build: new `--without-qmi' configure option
For those who don't care about the QMI support through libqmi-glib, or if you're
stuck with glib 2.30 (libqmi-glib requires 2.32), this configure switch allows
disabling the QMI support completely.

The logic to detect cdc-wdm ports is still in place, but the QMI probing is
never launched at them. Also, all QMI-related objects won't be compiled.
2012-09-05 20:02:31 +02:00
Aleksander Morgado
36733aa4de base-modem: allow looking for the QMI port associated to a given data port
QMI and wwan ports come in pairs. Each wwan port has an associated control QMI
port, which is the only port allowed to send the Start|Stop Network QMI requests
to start|stop the connection in the given wwan interface.

Paired QMI and wwan interfaces (should) share the same parent udev device,
quoting Bjørn:

    "If we ignore the unfortunate 3.4 and 3.5 kernels, then a matching wwanX
     and cdc-wdmY set will always share the same parent USB interface on QMI
     devices.

     Having the same parent USB device is *not* sufficient.  You cannot control
     wwan0 using cdc-wdm1 in the above example."
2012-08-30 17:08:23 +02:00
Aleksander Morgado
14bd267e8e base-modem: allow getting/peeking all data ports 2012-08-29 17:26:46 +02:00
Aleksander Morgado
3e251129c2 base-modem: use the new `MMQmiPort' object 2012-08-29 17:14:47 +02:00
Aleksander Morgado
73a9a037be base-modem: allow getting/peeking the QMI port 2012-08-29 17:14:47 +02:00
Aleksander Morgado
0436b3e457 api,introspection: report list of drivers, not just one
Different ports of the same modem may get handled by different drivers. We
therefore need to provide a list of drivers (new `Modem.Drivers' property with
signature 'as') instead of just one (removed `Modem.Driver' property with
signature 's').

$ sudo mmcli -m 0 | grep drivers
           |        drivers: 'qcserial, qmi_wwan'
2012-08-24 13:34:51 +02:00
Aleksander Morgado
1cfab89719 base-modem: use new `MMGpsSerialPort' type for the raw GPS port 2012-03-29 09:17:53 +02:00
Aleksander Morgado
be633fd66b base-modem: handle GPS control and data ports
Plugin may specify GPS-specific port tyeps when requesting to grab the port.
These could either be an AT-based GPS control port, or the raw GPS serial port
which emits the NMEA traces.
2012-03-28 15:50:51 +02:00
Aleksander Morgado
3b481cf17f base-modem: no need for `port_grabbed()'
Subclasses can configure additional stuff in the ports just after all have been
organized, in the SETUP_PORTS initialization step in MMBroadbandModem.
2012-03-28 15:50:51 +02:00
Aleksander Morgado
29f23f2a49 base-modem: new method to check if the modem got any AT port
Required for the single-at logic in the plugins.
2012-03-16 14:53:25 +01:00
Aleksander Morgado
cdd339f802 base-modem: implement new modem-wide cancellable, and rework AT commands
Instead of the `_in_port()' variants, we'll provide more generic
`_full()' methods. These should be used either if we want to send commands
to a specific port, or if we want to use a specific user-provided GCancellable.

In addition to this user-provided GCancellable, we keep the internal modem-wide
one.
2012-03-16 14:53:23 +01:00
Aleksander Morgado
215c278082 base-modem: new modem-wide cancellable, passed to every state machine 2012-03-16 14:53:23 +01:00
Aleksander Morgado
cc6d4a97fb base-modem: new port getters and peekers
* mm_base_modem_peek_port_* () will return either a port object (no new
reference), or NULL if none available.

You would usually peek() a port if you're going to use it just in the current
method, as there is no way to that reference to get invalid (we're single
threaded).

 * mm_base_modem_get_port_* () will return either NEW references to valid
port objects, or NULL if none available.

And, you would usually get() a port, whenever you want the port object to be
valid even out of the current method, for example when keeping it in the
context of an async operation.

Also, we need to consider that the primary AT port MAY BE NULL when you
peek() or get() it. This is due to the fact that we may be releasing ports
(due to device disconnection) in the middle of async operations.
2012-03-16 14:53:23 +01:00
Aleksander Morgado
3e5b42569b base-modem: use new simplified authentication setup 2012-03-16 14:53:15 +01:00
Aleksander Morgado
680e292914 build: fix header dependencies
We shouldn't depend on any header file from the previous implementation.
2012-03-16 14:28:15 +01:00
Aleksander Morgado
21a722b616 core: don't pass primary port to interface initializations
They will all get it themselves.
2012-03-15 14:15:05 +01:00
Aleksander Morgado
8b7b614105 core: rework port grabbing and organization
Make port roles more flexible.  We have modems that do PPP
on interfaces other than the primary interface, and that
wasn't possible with the old code.  So clean up all that
logic and move the port organization code into the core
so we can reduce code in the plugins.

In the new world order, the plugins say whether the port
is a QCDM port, an AT port, or ignored.  If it's an AT
port the plugins get to tag it as primary, secondary, or
PPP, or any combination of the 3.  This allows for modems
where PPP should really be done on the secondary port
(Huawei E220, Sierra devices) so that the primary port
stays open for command and status.

After all ports are grabbed by the generic classes, they get
"organized", which assigns various ports to the roles of
PRIMARY, SECONDARY, DATA, and QCDM based on specific rules
and hints that the plugin provided (which are expressed as
MMAtPortFlags).

The plugin code is responsible for determining the port
hints (ie MMAtPortFlags) at probe time, instead of having
a combination of the plugin and the modem class do the
job.  This simplifies things greatly for the plugins at
the expense of more complicated logic in the core.

This is the port of commit 96505d42ed62327101dcee7c2bf31177b0bb1c9f
to the 06-api branch.
2012-03-15 14:15:05 +01:00
Aleksander Morgado
94846a2f51 base-modem: make public the method to get best AT port
Sometimes, we want to check whether a given port is available to send commands,
and fallback to some other method if so (e.g. using a QCDM port).
2012-03-15 14:14:43 +01:00
Aleksander Morgado
c133c3284d base-modem: allow retrieving non-connected data ports
Bearers will ask for data ports that can be used for connections. Right now,
only one data port is expected to be handled, but we don't impose any
restriction in the API.
2012-03-15 14:14:34 +01:00
Aleksander Morgado
acc3e3f6da core: always pass open port to interface initializations
When the first AT port is grabbed, modem initialization is launched, using that
specific port. This port is also passed to all interface initialization methods.
2012-03-15 14:14:28 +01:00
Aleksander Morgado
8069c751a0 base-modem: new enable()' and disable()' async methods
Users will be able to enable or disable modems using the DBus interface. We will
chain up the `Enable(boolean)' call from the DBus interface to these new methods
in the base modem class.
2012-03-15 14:14:22 +01:00
Aleksander Morgado
b00c409978 base-modem: new virtual initialize() method
Whenever the first AT port is grabbed, we launch the initialize() method, which
must have been implemented by the corresponding modem subclass.
2012-03-15 14:14:22 +01:00
Aleksander Morgado
677e04be95 base-modem: new property to keep the Connection object 2012-03-15 14:14:22 +01:00
Aleksander Morgado
d32b006cce base-modem: new properties for vendor and product IDs
These will be set during modem object creation.
2012-03-15 14:14:22 +01:00
Aleksander Morgado
d5a0efc659 base-modem: getters for primary/secondary/qcdm ports 2012-03-15 14:14:22 +01:00
Aleksander Morgado
0d53a72d41 base-modem: new properties to handle Device, Driver and Plugin
They will be set when constructing the object.
2012-03-15 14:14:22 +01:00
Aleksander Morgado
b6cb5bd6da base-modem: ported all port grabbing/releasing logic to the base object 2012-03-15 14:14:22 +01:00
Aleksander Morgado
f39923c97d base-modem: expect a GDBusMethodInvocation as context of the auth request 2012-03-15 14:14:22 +01:00
Aleksander Morgado
9a72ac80d0 core: new MMBaseModem abstract type
Basically, a replacement of the MMModemBase type, being prepared to handle
multimode devices.

This object derives from a MmGdbusObjectSkeleton, which makes it suitable to be
controlled within the GDBusObjectManagerServer.
2012-03-15 14:14:21 +01:00