Commit Graph

34 Commits

Author SHA1 Message Date
Aleksander Morgado
a29610f25d plugin,port-probe: always cast SEND_DELAY value to guint64
Program received signal SIGSEGV, Segmentation fault.
    strchr () at ../sysdeps/arm/armv6/strchr.S:28
    28    ../sysdeps/arm/armv6/strchr.S: No such file or directory.
    (gdb) bt
    #0  strchr () at ../sysdeps/arm/armv6/strchr.S:28
    #1  0x76b121c8 in g_param_spec_pool_lookup () from ~/buildroot/output/staging/lib/libgobject-2.0.so.0
    #2  0x76b0cf44 in g_object_new_valist () from ~/buildroot/output/staging/lib/libgobject-2.0.so.0
    #3  0x76b0d39c in g_object_new () from ~/buildroot/output/staging/lib/libgobject-2.0.so.0
    #4  0x75f75e40 in mm_plugin_create () at ublox/mm-plugin-ublox.c:99
    #5  0x00031550 in load_plugin (path=0xe9b68 "/usr/lib/ModemManager/libmm-plugin-ublox.so") at mm-plugin-manager.c:1521
    #6  load_plugins (error=0x7efffa68, self=0xdc4f0) at mm-plugin-manager.c:1574
    #7  initable_init (initable=<optimized out>, cancellable=<optimized out>, error=0x7efffa68) at mm-plugin-manager.c:1679
    #8  0x76b9b278 in g_initable_new_valist () from ~/buildroot/output/staging/lib/libgio-2.0.so.0
    #9  0x76b9b2e0 in g_initable_new () from ~/buildroot/output/staging/lib/libgio-2.0.so.0
    #10 0x000324d0 in mm_plugin_manager_new (plugin_dir=0xe9c40 "/usr/lib/ModemManager", error=error@entry=0x7efffa68) at mm-plugin-manager.c:1620
    #11 0x0002da08 in initable_init (initable=0xddb40, cancellable=<optimized out>, error=0x7efffa68) at mm-base-manager.c:1113
    #12 0x76b9b278 in g_initable_new_valist () from ~/buildroot/output/staging/lib/libgio-2.0.so.0
    #13 0x76b9b2e0 in g_initable_new () from ~/buildroot/output/staging/lib/libgio-2.0.so.0
    #14 0x0002e81c in mm_base_manager_new (connection=connection@entry=0xe1070, plugin_dir=plugin_dir@entry=0x9efb0 "/usr/lib/ModemManager",
        auto_scan=auto_scan@entry=1, initial_kernel_events=initial_kernel_events@entry=0x0, enable_test=0, error=0x7efffa68, error@entry=0x7efffa60)
        at mm-base-manager.c:957
    #15 0x0002b6ec in bus_acquired_cb (connection=0xe1070, name=<optimized out>, user_data=<optimized out>) at main.c:87
    #16 0x76c26864 in connection_get_cb () from ~/buildroot/output/staging/lib/libgio-2.0.so.0
    #17 0x76bc76cc in g_task_return_now () from ~/buildroot/output/staging/lib/libgio-2.0.so.0
    #18 0x76bc7d50 in g_task_return () from
    ~/buildroot/output/staging/lib/libgio-2.0.so.0

See similar bug in GStreamer:
https://bugzilla.gnome.org/show_bug.cgi?id=740191
2017-09-05 20:16:18 +02:00
Aleksander Morgado
2eb55d3224 plugins: use G_N_ELEMENTS when iterating ports array 2017-05-30 17:28:23 +02:00
Aleksander Morgado
fcd4a8c5dc altair,hso,samsung: setup send-delay=0 for probing
The Altair, Option HSO and Samsung plugins all use the send-delay=0
setting once the modem object has been created. For consistency, use
the same setting during port probing.
2017-05-30 17:18:32 +02:00
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
6f235b9948 ports: rename 'MMAtSerialPort' to 'MMPortSerialAt' 2014-02-13 13:40:01 +01:00
Aleksander Morgado
9cde02111b ports: rename 'MMSerialPort' to 'MMPortSerial' 2014-02-13 13:39:51 +01:00
Aleksander Morgado
85d5d96824 port: remove 'carrier-detect' property
It is no longer used since commit 736aa0d2d.
2013-11-15 17:25:33 +01:00
Aleksander Morgado
7da2a65b43 plugins: fix generic GObject related macros 2012-12-27 08:48:11 +01: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
5b96aa9db4 samsung: use generic power down of the Icera modem 2012-08-06 20:07:27 +02:00
Aleksander Morgado
7ad73e4fa3 samsung: make the modem object inherit from the `MMBroadbandModemIcera' 2012-08-06 20:07:27 +02:00
Dan Williams
ea024f2e52 samsung: use generic Icera band handling functions 2012-08-06 20:07:27 +02:00
Dan Williams
b1c2e0ba5f samsung: use generic Icera unlock retries checking functions 2012-08-06 20:07:27 +02:00
Aleksander Morgado
36924d8f82 samsung: add Samsung Electronics, Inc. as copyright owners
They actually wrote the original Samsung plugin in ModemManager 0.5.
2012-08-06 20:07:27 +02:00
Aleksander Morgado
2bf2b8e848 samsung: new `MMBroadbandBearerSamsung'
Based on the Icera bearer, but using DHCP in the net port.
2012-08-06 20:07:27 +02:00
Ben Chan
e18778d815 samsung: fix crash due to uninitialized GError variables
BUG=chromium-os:32475
TEST=emerge modemmanager-next

Change-Id: I8dad924dae9a249c3b9235786226b7dd40bd8819
2012-08-06 20:07:26 +02:00
Aleksander Morgado
d820ca8f27 samsung: use CFUN=4 for power down 2012-08-06 20:07:26 +02:00
Aleksander Morgado
ef217c23b0 samsung: custom configuration for AT serial ports 2012-08-06 20:07:26 +02:00
Aleksander Morgado
5fcc8d1629 samsung: use Icera-based time loading 2012-08-06 20:07:26 +02:00
Aleksander Morgado
e70fea145e samsung: user Icera-based timezone loading 2012-08-06 20:07:26 +02:00
Aleksander Morgado
268db7fe0b samsung: minor coding style fixes 2012-08-06 20:07:26 +02:00
Aleksander Morgado
d8ae69e7d1 samsung: use the generic Icera bearer 2012-08-06 20:07:26 +02:00
Aleksander Morgado
8d651dd68e samsung: use Icera-based unsolicited messages setup and access tech loading 2012-08-06 20:07:25 +02:00
Aleksander Morgado
01e85aa1ef samsung: don't hardcode supported modes
Don't try to implement supported modes loading if we're just hardcoding the
values; the proper way would be to run the %IPSYS=? test command and parse
the results.
2012-08-06 20:07:25 +02:00
Aleksander Morgado
4f0157cec4 samsung: use Icera-based allowed mode setting 2012-08-06 20:07:25 +02:00
Aleksander Morgado
f127afd402 samsung: use Icera-based initial allowed mode loading 2012-08-06 20:07:25 +02:00
Aleksander Morgado
ae22a99dab samsung: implement the `MMIfaceIcera' interface 2012-08-06 20:07:25 +02:00
Aleksander Morgado
9a068b4294 samsung: port Bearer to use the 'config' property in the MMBearer class
This saves us from requiring to implement user & password in all modems.
2012-08-06 20:07:24 +02:00
Aleksander Morgado
fc9a7dbbd9 samsung: port plugin to the refactored probing logic 2012-08-06 20:07:24 +02:00
Aleksander Morgado
03a0fee4ff samsung: minor coding style fixes 2012-08-06 20:07:24 +02:00
Aleksander Morgado
6f814bb15a samsung: plug memleak
get_port() actually increases the refcount of the returned port, use peek_port()
instead.
2012-08-06 20:07:24 +02:00
Aleksander Morgado
a80e620342 samsung: fix typo, s/recieved/received 2012-08-06 20:07:24 +02:00
Nathan Williams
f15527eecd samsung: plugin for Samsung Y3300/Y3400 UMTS modems based on the Icera/Nvidia chipset 2012-08-06 20:07:24 +02:00