Commit Graph

28 Commits

Author SHA1 Message Date
Aleksander Morgado
4e6400d3c8 zte: add port type hints for the ZTE MF195
https://bugzilla.gnome.org/show_bug.cgi?id=691480
2013-03-12 18:48:45 +01:00
Aleksander Morgado
c79d266e62 udev: update all udev rules to always match both VID/PID together
If the rules to tag specific USB interface numbers only apply on the PID, we'll
end up seeing that if the port has a parent with another PID, and that other
PID also has a rule, port will get tagged multiple times. Easier to see with an
example:

The ZTE MF637 (VID 0x19D2, PID 0x0121) had the following rules:

ATTRS{idProduct}=="0121", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1"
ATTRS{idProduct}=="0121", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1"

In our ZTE rules we also have some for the device with PID 0x0002, like:

ATTRS{idProduct}=="0002", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_ZTE_PORT_TYPE_MODEM}="1"
ATTRS{idProduct}=="0002", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_ZTE_PORT_TYPE_AUX}="1"

And it seems that we can grab multiple PIDs from a single port, i.e. from the
parent objects in the hierarchy:

udevadm info -a -n /dev/ttyUSB4 | grep idProduct
    ATTRS{idProduct}=="0121"
    ATTRS{idProduct}=="0020"
    ATTRS{idProduct}=="0002"

Where that 0x0002 idProduct is not from the modem, but from the EHCI Host
Controller (with idVendor 0x1d6b in my case).

So... we end up seeing that both set of rules will apply to the ports, and we
misleadingly get:

    (ttyUSB3) type 'at' claimed by /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2
    ZTE: AT port 'tty/ttyUSB2' flagged as primary
    (ttyUSB2) type 'at' claimed by /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2
    ZTE: AT port 'tty/ttyUSB1' flagged as secondary
    (ttyUSB1) type 'at' claimed by /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2
    ZTE: AT port 'tty/ttyUSB4' flagged as primary
    b_port(): (ttyUSB4) type 'at' claimed by /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2
    (/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2) tty/ttyUSB2 at (primary)
    (/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2) tty/ttyUSB1 at (secondary)
    (/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2) tty/ttyUSB2 data (primary)
    (/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2) tty/ttyUSB0 qcdm

Which is wrong, as ttyUSB4 should have been our primary port, not ttyUSB2.

With this patch on, the rules apply only to the VID/PID pair, and we end up
getting what we really wanted:

    (ttyUSB3) type 'at' claimed by /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2
    (ttyUSB2) type 'at' claimed by /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2
    ZTE: AT port 'tty/ttyUSB1' flagged as secondary
    (ttyUSB1) type 'at' claimed by /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2
    ZTE: AT port 'tty/ttyUSB4' flagged as primary
    b_port(): (ttyUSB4) type 'at' claimed by /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2
    (/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2) tty/ttyUSB4 at (primary)
    (/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2) tty/ttyUSB1 at (secondary)
    (/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2) tty/ttyUSB4 data (primary)
    (/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2) tty/ttyUSB0 qcdm

https://bugzilla.gnome.org/show_bug.cgi?id=694759
2013-02-26 23:22:00 +01:00
Aleksander Morgado
3f3950bd12 plugins: log about all port type hints received from udev 2013-02-26 21:02:12 +01:00
Aleksander Morgado
8fb57bb553 zte: load unlock retries with +ZPINPUK
e.g:

  AT+ZPINPUK=? |
               | ZPINPUK: 3,10
               | OK
2013-02-19 15:37:43 +01:00
Aleksander Morgado
eec5d00a97 core,plugins: remove initial power down sequence
We no longer power down the modem during initialization, so remove that
implementation.
2013-01-11 10:05:46 +01:00
Aleksander Morgado
7da2a65b43 plugins: fix generic GObject related macros 2012-12-27 08:48:11 +01:00
Aleksander Morgado
4ffa871228 zte: ignore net ports in non-Icera based modems
Plain non-Icera ZTE modems will use ATD calls and PPP to establish the
connection, so ignore 'net' ports that may be found in the way (e.g. when the
modem is a QMI modem and we're not using QMI support).
2012-12-27 08:48:10 +01:00
Aleksander Morgado
9ec90d9a11 core,plugins: don't assume 'CS' supported when '2G' supported
We will not report 'CS' as a supported mode every time '2G' is supported. This
actually was forcing all plugins to handle a 'CS' fallback when they didn't have
CS-specific mode setup. So, to simplify things, we will only report 'CS' as
supported for those plugins which actually allow to select 'CS' mode (e.g. the
'wavecom' plugin).
2012-11-02 09:52:31 +01:00
Aleksander Morgado
c250fa3797 libmm-glib: remove the `libmm-common.h' header
Both the ModemManager daemon and the mmcli will now include `libmm-glib.h' only.

We also handle two new special `_LIBMM_INSIDE_MM' and `LIBMM_INSIDE_MMCLI'
symbols, which if included before the `libmm-glib.h' library allow us to:

 * Don't include the libmm-glib high level API in the ModemManager daemon, as
   the object names would clash with those in the core.

 * Define some of the methods of helper objects to be included only if compiling
   ModemManager daemon or the mmcli.
2012-10-04 10:17:12 +02:00
Aleksander Morgado
a5870ac3c6 zte: run power-down during init 2012-10-01 16:40:52 +02:00
Marius B. Kotsbak
02b71336ae zte: extend allowed modes for LTE/4G devices for +ZSNT command
Updates:
  AT+ZSNT=6 means LTE only
  AT+ZSNT to specify 2G and 3G doesn't support 2G or 3G preference in LTE modems

Tested with a ZTE MF 820D.
2012-09-06 08:40:38 +02:00
Aleksander Morgado
ab7f558a2c zte: handle Icera-based devics that use DHCP
This is the port to git master of the following commit:

commit d2654a287c309346cc46b535dd974b0a5fc06fd4
Author: Dan Williams <dcbw@redhat.com>
Date:   Tue Aug 28 12:15:30 2012 -0500

    zte: handle Icera-based devics that use DHCP

    Since we can't autodetect that the devices use DHCP, we'll need to
    tag them with udev rules for the time being.
2012-08-31 13:21:35 +02:00
Aleksander Morgado
1ca46bb4a7 port-probe: easier check for Icera support over a list of port probes 2012-08-30 13:57:56 +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
1e687337c1 zte: plug memleak
The GError wasn't properly disposed.

Reported by: Ben Chan <benchan@google.com>
2012-08-09 09:33:23 +02:00
Aleksander Morgado
4d5892204d zte: use +CFUN=4 for powering down
Icera-based ZTE already has the same functionality coming from the parent
`MMBroadbandModemIcera' modem object.
2012-08-06 20:07:50 +02:00
Aleksander Morgado
125f297434 zte: setup/cleanup unsolicited messages in Icera based modems 2012-08-06 20:07:49 +02:00
Aleksander Morgado
efe85fd1ab zte: use common unsolicited messages handler setup in Icera based modems 2012-08-06 20:07:49 +02:00
Aleksander Morgado
64dfa59c42 zte: use common unsolicited messages handler setup 2012-08-06 20:07:49 +02:00
Aleksander Morgado
a8516fa1f8 zte: new common code to setup unsolicited event handlers 2012-08-06 20:07:49 +02:00
Aleksander Morgado
1f2a7bd87c zte: try +CPMS? calls after SIM unlock until SIM gets ready 2012-08-06 20:07:49 +02:00
Aleksander Morgado
dcde1e0408 zte: carrier-detect disabled in serial ports 2012-08-06 20:07:49 +02:00
Aleksander Morgado
4cf4a98bba zte: support Icera-based modems
We request Icera support check during port probing, and we then decide which
modem object to create based on the check results.
2012-08-06 20:07:49 +02:00
Aleksander Morgado
855c0ec514 zte: implement access technology loading 2012-08-06 20:07:49 +02:00
Aleksander Morgado
169ccdf1d4 zte: implement allowed mode loading/setting 2012-08-06 20:07:49 +02:00
Aleksander Morgado
641c5aed06 zte: setup ports and unsolicited message handling 2012-08-06 20:07:49 +02:00
Aleksander Morgado
3b00c6f5ac zte: new `MMBroadbandModemZte' 2012-08-06 20:07:49 +02:00
Aleksander Morgado
bbb4ed2b0a zte: start porting the ZTE plugin 2012-08-06 20:07:49 +02:00