Commit Graph

80 Commits

Author SHA1 Message Date
Aleksander Morgado
d2544ac044 base-modem: always grab ports marked as ignored
Modems may expose ports that are either just not used (e.g. modems exposing more
than 2 functional AT ports) or explicitly avoided (e.g. WWAN ports when we don't
know how to use them).

Those kind of ports are part of the modem, but not used by ModemManager. Still,
ModemManager should list them in the list of ports available for the modem, with
IGNORED type.
2014-09-05 08:48:00 +02:00
Aleksander Morgado
08ecc14722 base-modem: quicker find matching cdc-wdm QMI or MBIM ports 2014-06-23 18:12:27 +02:00
Aleksander Morgado
7c347aa3ec port: store parent sysfs path in each MMPort 2014-06-23 18:12:27 +02:00
Ben Chan
37b0402ee5 core: minor coding style fixes 2014-05-20 09:32:29 +02:00
Aleksander Morgado
accb611e1f base-modem: if no AT primary given, try to use data port
The Cinterion PHS8 reports a single AT port to be used as data port, and no
other port as primary. In this case, recover the tty as primary AT port, instead
of failing with an error.
2014-02-26 11:52:50 +01:00
Aleksander Morgado
ba58aa42f2 base-modem: don't apply auth checks if running in the SESSION bus 2014-02-13 13:41:55 +01:00
Aleksander Morgado
c182a04f64 base-modem: allow grabbing 'virtual' AT ports 2014-02-13 13:41:39 +01:00
Aleksander Morgado
0d0f5de161 base-modem: allow looking for a subset of the available ports 2014-02-13 13:41:03 +01:00
Aleksander Morgado
2b46f65879 base-modem: allow grabbing non-tty AT ports 2014-02-13 13:41:01 +01:00
Aleksander Morgado
38ebf7c95b port-serial-at: allow specifying subsystem when creating a 'MMPortSerialAt'
Don't just assume that all AT ports are TTYs.
2014-02-13 13:40:55 +01:00
Aleksander Morgado
0c86840dde ports: rename 'libserial' to 'libport' 2014-02-13 13:40:11 +01:00
Aleksander Morgado
c236e18692 ports: rename 'MMMbimPort' to 'MMPortMbim' 2014-02-13 13:40:07 +01:00
Aleksander Morgado
403e013f15 ports: rename 'MMQmiPort' to 'MMPortQmi' 2014-02-13 13:40:04 +01:00
Aleksander Morgado
6f235b9948 ports: rename 'MMAtSerialPort' to 'MMPortSerialAt' 2014-02-13 13:40:01 +01:00
Aleksander Morgado
0d1602bf0f ports: rename 'MMQcdmSerialPort' to 'MMPortSerialQcdm' 2014-02-13 13:39:57 +01:00
Aleksander Morgado
e505ea0a58 ports: rename 'MMGpsSerialPort' to 'MMPortSerialGps' 2014-02-13 13:39:54 +01:00
Aleksander Morgado
9cde02111b ports: rename 'MMSerialPort' to 'MMPortSerial' 2014-02-13 13:39:51 +01:00
Aleksander Morgado
c30a8f67ef base-modem: also release cdc-wdm ports 2013-11-22 15:00:52 +01:00
Aleksander Morgado
fe744b4534 base-modem: fix port validity checks 2013-11-20 15:00:07 +01:00
Aleksander Morgado
3206e95663 api,introspection: new 'Ports' property in the Modem interface
We will expose a new 'Ports' property listing all ports currently known by a
given modem. Ports which are not used but are detected as being part of the
modem will be listed with an 'unknown' port type.

This change uses the new 'MMModemPortType' enum and the new 'MMModemPortInfo'
helper struct to handle these values in libmm-glib. The already available
'MMPortType' enum hasn't been re-used for the interface because it contains
values that we don't need (e.g. IGNORED).

The port list is now also included in the modem information command of mmcli:

$ sudo mmcli -m 0

/org/freedesktop/ModemManager1/Modem/0 (device id '97b7b99e3e2bea103880545b619fb05a3cc81b26')
  -------------------------
  System   |         device: '/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4'
           |        drivers: 'qcserial, qmi_wwan'
           |         plugin: 'Gobi'
           |   primary port: 'cdc-wdm0'
           |          ports: 'ttyUSB0 (qcdm), ttyUSB1 (at), cdc-wdm0 (qmi), wwp0s29u1u4 (net)'

https://bugzilla.gnome.org/show_bug.cgi?id=702678
2013-06-24 19:44:57 +02:00
Aleksander Morgado
a0ced36f14 base-modem: allow grabbing MBIM ports 2013-04-17 15:19:37 +02:00
Franko Fang
d56a87a3bd base-modem: keep AT port as possible data port if flagged as PPP 2013-04-09 18:41:14 +02:00
Aleksander Morgado
358fe7f906 base-modem: don't assume primary AT port is available
QMI modems may not have it.
2013-04-06 22:47:13 +02:00
Aleksander Morgado
c9b7761ed5 base-modem: don't assume all cdc-wdm ports are QMI 2013-04-01 14:12:54 +02:00
Aleksander Morgado
b6402a4e21 bearer,3gpp: dial operation specifies which data port to use
Instead of deciding in advance which data port to use, we let the dialling
operation gather it. For the generic dialling logic, ATD-based, always an
'AT' port will be used as data port, even if we grabbed a 'net' port. Those
plugins that can work with 'net' ports will grab the specific 'net' port
themselves.
2013-02-18 15:41:26 +01:00
Ben Chan
e75dba639f core: add 'hotplugged' flag to indicate if modem is newly plugged in
This patch adds a 'hotplugged' flag to MMBaseModem to indicate if a
modem is newly plugged in. A plugin can use this information to
determine if, for example, the modem needs to be soft reset using the
ATZ command.

Dan Williams <dcbw@redhat.com> contributed the idea of implementation.
2013-01-18 11:27:51 +01:00
Aleksander Morgado
f923e95861 base-modem: don't set the modem valid if we didn't export the Modem interface
If an error occurs early during the initialization (e.g. during port setup), we
would be aborting without even having exported the modem interface. So detect
that case and skip setting the modem as valid.
2012-12-27 08:48:11 +01:00
Aleksander Morgado
daf1a353c3 core: allow QMI modems without AT ports 2012-10-31 10:54:25 +01:00
Aleksander Morgado
caefbcfbd9 base-modem: new fallback when matching QMI vs data ports
If no matching found, but there is only one QMI port and only one data port,
assume that is already a valid match.
2012-10-09 16:29:37 +02:00
Aleksander Morgado
08eb8c22e8 base-modem: cleanly close the QMI port to get the CIDs released
If we end up allocating too many CIDs without releasing them new allocations
will fail with client-ids-exhausted errors. This usually happens specially
when debugging/developing as you're all the time Ctrl+C-ing the daemon without
rebooting the system.
2012-10-08 12:26:53 +02:00
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
494a70a8ff core: handle the 'usb'->'usbmisc' subsystem rename in the kernel
We'll try to cope with getting devices being reported in either 'usb' or
'usbmisc', trying to avoid the need of checking kernel version during runtime.
2012-08-29 17:26:46 +02:00
Aleksander Morgado
e9aff3ba42 base-modem: allow grabbing multiple 'net' and 'qmi' ports
All grabbed 'net' ports are added to the new list of data ports. It is a task
for the specific plugin to decide how each of the data ports should be
connected. In the case of not having 'net' ports, the list of data ports will
only contain a single AT port.

All grabbed 'qmi' ports are added to the new list of QMI ports. The first port
in the list is to be considered the 'primary' one, and will be the one used
for all services. The remaining QMI ports, if any, will only be used to for WDS,
to manage the associated 'net' 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
306b4eb509 core: allow grabbing QMI ports 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
8c84aea3f0 base-modem: disconnect internal cancellable handler while disposing 2012-03-30 16:11:14 +02:00
Aleksander Morgado
b68461c417 base-modem: plug small leaks 2012-03-30 16:09:27 +02:00
Aleksander Morgado
7518772d4b core: fatal errors in iface initializations force the modem into a FAILED state
Modems which end up being found unusable (e.g. no SIM, fatal SIM error, no
capabilities) will be exposed in DBus, but just with the Modem interface and
in a FAILED state which allows no actions.
2012-03-30 13:47:00 +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
b19f97ae7d port: new `MM_PORT_TYPE_NET' for pure net devices
Net devices will be MMPorts of type MM_PORT_TYPE_NET.
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
56e7b15f5c base-modem: ensure we cancel any ongoing operation when we're disposing 2012-03-16 14:53:24 +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