Commit Graph

24 Commits

Author SHA1 Message Date
Aleksander Morgado
1f813c4e96 core: allow identifying devices by a user-provided 'uid'
All ports of the same modem reported by the kernel will all be associated with
a common 'uid' (unique id), which uniquely identifies the physical device. This
logic was already in place, what we do now is avoid calling it  the 'sysfs
path' of the physical device, because we may not want to use that to identify
a device.

This logic now also enables the possibility of "naming" the modems in a unique
way by setting the "ID_MM_PHYSDEV_UID" property in the "usb_device" that owns
all the ports.

E.g. a custom device has 4 modems in 4 different USB ports. The device path of
each USB device will always be the same, so the naming rules could go like this:

    $ vim /usr/lib/udev/rules.d/78-mm-naming.rules

    ACTION!="add|change|move", GOTO="mm_naming_rules_end"
    DEVPATH=="/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.5/4-1.5.1", ENV{ID_MM_PHYSDEV_UID}="USB-MODEM-1"
    DEVPATH=="/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.5/4-1.5.2", ENV{ID_MM_PHYSDEV_UID}="USB-MODEM-2"
    DEVPATH=="/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.5/4-1.5.3", ENV{ID_MM_PHYSDEV_UID}="USB-MODEM-3"
    DEVPATH=="/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.5/4-1.5.4", ENV{ID_MM_PHYSDEV_UID}="USB-MODEM-4"
    LABEL="mm_naming_rules_end"

Each of the modems found will have a unique UID retrieved from the previous list
of rules. Then, "mmcli" has also been updated to allow using the UID instead of
the modem DBus path or index, e.g.:

    $ sudo mmcli -m USB-MODEM-1
    /org/freedesktop/ModemManager1/Modem/0 (device id '988d83252c0598f670c2d69d5f41e077204a92fd')
      -------------------------
      Hardware |   manufacturer: 'ZTE CORPORATION'
               |          model: 'MF637'
               |       revision: 'BD_W7P673A3F3V1.0.0B04'
               |      supported: 'gsm-umts'
               |        current: 'gsm-umts'
               |   equipment id: '356516027657837'
      -------------------------
      System   |         device: 'USB-MODEM-1'
               |        drivers: 'option'
               |         plugin: 'ZTE'
               |   primary port: 'ttyUSB5'
               |          ports: 'ttyUSB5 (at)'
    ...

    $ sudo mmcli -m USB-MODEM-1 --enable
    ...
2016-09-29 15:41:21 +02:00
Ting-Yuan Huang
969189d42c plugin-manager: protect mm_plugin_{major,minor}_version
This patch makes declarations bind to definitions within the same module
to prevent the potential ambiguity if referenced directly.

AddressSanitizer think they violated one definition rule, although
those symbols are accessed by address through their modules and do
not depend on the order of the libararies loaded.
2016-05-28 13:59:54 +02:00
Aleksander Morgado
93d6e4f102 dell: new Dell plugin
For Dell-branded Novatel, Sierra and Ericsson modems.

The Novatel plugin will no longer accept every Dell-branded modem, which was
the current situation. Instead, a new Dell plugin will take care of probing for
the correct vendor string, and based on the results create a specific Novatel,
Sierra or Ericsson modem.

In order to properly support this, the Novatel, Sierra and MBM plugins now
export their implementations into non-inst libraries that the Dell plugin will
import.

Also, for now, the Dell plugin doesn't make any difference between e.g. Sierra
or Ericsson MBIM implementations, just a generic MBIM modem is created in both
cases, as that is anyway what the Ericsson MBM and Sierra plugins do already.

https://bugs.freedesktop.org/show_bug.cgi?id=86713
2015-02-16 17:33:37 +01:00
Aleksander Morgado
7c929b5cf1 novatel: move custom init method to separate source files 2015-02-16 17:30:38 +01:00
Aleksander Morgado
6fb83b5e02 novatel: remove unused custom AT probe array 2015-02-06 15:38:11 +01:00
Aleksander Morgado
d4dfd661b9 port-serial-at: use GIO Async API like methods 2014-02-13 13:40:21 +01:00
Aleksander Morgado
6f235b9948 ports: rename 'MMAtSerialPort' to 'MMPortSerialAt' 2014-02-13 13:40:01 +01:00
Ben Chan
3332333852 novatel: fix invalid comparison of unsigned expression
This patch fixes the following invalid comparison of unsigned expression:

novatel/mm-plugin-novatel.c:148:29: error: comparison of unsigned
      expression >= 0 is always true [-Werror,-Wtautological-compare]
    if (ctx->nwdmat_retries >= 0) {
        ~~~~~~~~~~~~~~~~~~~ ^  ~

Bug reported on https://code.google.com/p/chromium/issues/detail?id=242150
2013-05-20 10:25:32 +02:00
Aleksander Morgado
d169c99dc9 novatel: skip $NWDMAT if the modem has QMI ports 2013-05-07 18:49:57 +02:00
Aleksander Morgado
2c83334c25 novatel: allow QMI-powered modems 2013-05-07 09:11:28 +02:00
Aleksander Morgado
031657cea5 novatel: don't filter out the USB551L
We filter the E362 because it's managed by the Novatel LTE plugin. If we also
filter out the USB551L, but it's not explicitly grabbed by any other plugin, it
will default to the Generic one.
2013-05-07 09:08:17 +02:00
Aleksander Morgado
76d97c6334 novatel: don't explicitly filter by drivers
No real need to do it; the VID filter is already enough.
2013-05-07 09:05:49 +02:00
Dan Williams
463de46e9e novatel: ignore USB551L
Just like the E362, which the USB551L is quite similar to.
2013-04-16 19:36:55 -05:00
Aleksander Morgado
b76dc134bf novatel: try to flip secondary ports to AT as soon as possible
So do it during port probing. If we send this command early enough in the
first AT port being probed, it should flip the secondary ports to AT mode
before their port probing is finished.

https://bugzilla.gnome.org/show_bug.cgi?id=696696
2013-03-28 17:05:48 +01:00
Aleksander Morgado
a1d6667df9 novatel: don't claim the Novatel E362, should be handled by `novatel-lte' 2012-08-26 23:01:50 +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
a595912d2d novatel: fix creation of the `MMBroadbandModemNovatel' object 2012-08-24 13:09:17 +02:00
Aleksander Morgado
56a7e40e37 novatel: start porting the Novatel plugin 2012-08-20 16:26:55 +02:00
Aleksander Morgado
b399a17163 novatel-lte: renamed the plugin to "Novatel LTE"
This plugin only handles the E362 right now.
2012-08-20 16:26:55 +02:00
Aleksander Morgado
1ca46cc0ec plugins: use default port grabbing on those plugins without special requirements 2012-08-06 20:06:46 +02:00
Aleksander Morgado
e5e46f489e core: merge MMPluginBase' and MMPlugin'
There's no real point in maintaining a separate `MMPlugin' interface, as all the
plugins will inherit from `MMPluginBase', so just merge them and simplify
everything.
2012-08-06 20:06:45 +02:00
Aleksander Morgado
815693661c core: compile all ports before creating the modem object
Before this, we only exported the modem to DBus when all ports were organized,
in order to make sure that we select as primary port the one we really want and
not the first AT port grabbed. Given that to get all the ports organized we also
needed to wait to get all the ports grabbed, we can now also defer the creation
of the modem object until all the ports get grabbed. This allows us to create
different types of objects based on the ports available (e.g. we can now create
QMI-supported modem objects if we see a QMI port around).
2012-08-06 20:06:44 +02:00
Nathan Williams
67698b43c4 novatel: Use the ALLOWED_SINGLE_AT property. Saves 5 seconds on probing.
Change-Id: I0b0c2cb07781eb32ba6eb4294868ed123f57fd9f
2012-05-02 21:05:05 +02:00
Nathan Williams
8e640d3adc novatel: new plugin for the Novatel E362 2012-03-16 14:53:14 +01:00