Commit Graph
4476 Commits
Author SHA1 Message Date
Yunlian Jiang 4e00558fcb broadband-modem: fix a undifined behavior
. A shift has undefined behaviour if the mathematical result
(lhs * 2^{rhs}) doesn't fit in the range of the resulting type.
In other words, you can't left shift into the sign bit of a
signed integer type.
The error message is:

mm-broadband-modem.c:3308:15: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
SUMMARY: AddressSanitizer: undefined-behavior mm-broadband-modem.c:3308:15 in
2015-10-28 22:31:59 +01:00
Aleksander Morgado 30cbf7202c build: on configure errors, show the specific libqmi or libmbim version required 2015-10-25 15:48:42 +01:00
Aleksander Morgado 35ab3dedd6 sim-qmi: try to gather from the optional TLV whether MNC is 2 or 3 digits
We bump libqmi requiremetn to 1.13.5, which is the one with support for the new TLV.
2015-10-25 15:48:42 +01:00
Aleksander Morgado 77b6b02fd3 sim-qmi: fix building MCCMNC string
For now, use 2 digits for MNC if < 100 and 3 digits otherwise.
2015-10-25 15:15:33 +01:00
Dan Williams 3f3ad507e2 sim-qmi: load operator identifier and name from NAS home network 2015-10-25 15:11:37 +01:00
Dan Williams 267b13c231 api: correct description of SimIdentifier property
In MM 0.6 days it used to be obfuscated, but that was pointless.  Now
it's just the ICCID.
2015-10-22 17:13:31 -05:00
Aleksander Morgado a89dadcbc6 bearer-qmi: don't add auth settings if no user/pass/auth given
Auth settings will be added in a QMI message only if at least one of these is
requested:
 * An explicit auth preference is requested.
 * User string is given and isn't empty.
 * Password string is given and isn't empty.
2015-10-21 17:24:24 +02:00
Aleksander Morgado 5b568e97f8 iface-modem-3gpp: allow LAC/CID updates reported while registering
When changing from idle to registered we'll load registration info before really
reporting that we're registered (so that clients can get the new registration
info directly). During this time, we should also allow LAC/CID updates triggered
in the location interface.

E.g. when receiving this QMI message, we're not processing LAC/CID because when
they get reported, the registration state was not yet 'registered':

    [/dev/cdc-wdm0] Received message (translated)...
    >>>>>> QMUX:
    >>>>>>   length  = 67
    >>>>>>   flags   = 0x80
    >>>>>>   service = "nas"
    >>>>>>   client  = 1
    >>>>>> QMI:
    >>>>>>   flags       = "indication"
    >>>>>>   transaction = 0
    >>>>>>   tlv_length  = 55
    >>>>>>   message     = "Serving System" (0x0024)
    >>>>>> TLV:
    >>>>>>   type       = "MNC PCS Digit Include Status" (0x29)
    >>>>>>   length     = 5
    >>>>>>   value      = D6:00:01:00:00
    >>>>>>   translated = [ mcc = '214' mnc = '1' includes_pcs_digit = 'no' ]
    >>>>>> TLV:
    >>>>>>   type       = "LTE TAC" (0x25)
    >>>>>>   length     = 2
    >>>>>>   value      = 08:01
    >>>>>>   translated = 264
    >>>>>> TLV:
    >>>>>>   type       = "Detailed Service Status" (0x22)
    >>>>>>   length     = 5
    >>>>>>   value      = 02:03:00:01:00
    >>>>>>   translated = [ status = 'available' capability = 'cs-ps' hdr_status = 'none' hdr_hybrid = 'yes' forbidden = 'no' ]
    >>>>>> TLV:
    >>>>>>   type       = "CID 3GPP" (0x1e)
    >>>>>>   length     = 4
    >>>>>>   value      = 01:A1:4D:04
    >>>>>>   translated = 72196353
    >>>>>> TLV:
    >>>>>>   type       = "LAC 3GPP" (0x1d)
    >>>>>>   length     = 2
    >>>>>>   value      = FE:FF
    >>>>>>   translated = 65534
    >>>>>> TLV:
    >>>>>>   type       = "Current PLMN" (0x12)
    >>>>>>   length     = 5
    >>>>>>   value      = D6:00:01:00:00
    >>>>>>   translated = [ mcc = '214' mnc = '1' description = '' ]
    >>>>>> TLV:
    >>>>>>   type       = "Data Service Capability" (0x11)
    >>>>>>   length     = 2
    >>>>>>   value      = 01:0B
    >>>>>>   translated = { [0] = 'lte '}
    >>>>>> TLV:
    >>>>>>   type       = "Serving System" (0x01)
    >>>>>>   length     = 6
    >>>>>>   value      = 01:01:01:02:01:08
    >>>>>>   translated = [ registration_state = 'registered' cs_attach_state = 'attached' ps_attach_state = 'attached' selected_network = '3gpp' radio_interfaces = '{ [0] = 'lte '}' ]
    <debug> [1444895382.427216] Processing 3GPP info...
    <info>  [1444895382.433423] Modem /org/freedesktop/ModemManager1/Modem/3: 3GPP Registration state changed (idle -> registering)

    [ Here we tried to update LAC/CID ]

    <debug> [1444895382.439668] Modem /org/freedesktop/ModemManager1/Modem/3: 3GPP location updated (MCC: '214', MNC: '1', Location area code: '0', Cell ID: '0')
    <info>  [1444895382.446788] Modem /org/freedesktop/ModemManager1/Modem/3: 3GPP Registration state changed (registering -> home)
    <info>  [1444895382.452383] Modem /org/freedesktop/ModemManager1/Modem/3: state changed (enabled -> registered)
2015-10-15 11:35:58 +02:00
Aleksander Morgado 0579ac076a mm-broadband-modem: trigger registration checks only after enabling all ifaces
Given that the Location interface requires 3GPP info reported by the 3GPP
interface, we should only trigger registration checks once the Location
interface has been already enabled and ready to be used. If we don't do this,
we'll end up e.g. getting initial MCCMNC values but never reaching the Location
interface properly.

So, fix this by triggering all registration checks (CDMA and 3GPP) only after
having enabled all interfaces.
2015-10-15 09:15:36 +02:00
Aleksander Morgado 1cb68c810e broadband-modem-qmi: LAC/CID not given in all serving system indications
LAC/CID may only be given in the serving system indications when the values
change, and therefore we shouldn't reset the values to 0 whenever they're not
reported.

This seems to happen in newer devices; older devices like the MC7710 did always
report the values in the indications.
2015-10-15 09:15:36 +02:00
Aleksander Morgado 2c0da94319 build: diagrams and logos are no longer generated during build, so don't remove them 2015-10-07 12:15:23 +02:00
Aleksander Morgado b58ff7cdf0 build: don't add PNGs in content_files, no longer needed 2015-10-07 11:57:39 +02:00
Aleksander Morgado b35de2b15f modem-helpers-qmi: remove wrong check warning
This check makes no sense. We're converting from a ModemManager enum to a QMI
enum, nothing else; i.e. 'caps' is *not* the current capabilities of the modem.
2015-09-25 22:41:25 +02:00
Dan Williams 7cb3b3faad broadband-modem-qmi: update access technology from signal info for newest QMI commands 2015-09-24 14:54:45 -05:00
Dan Williams a8666bd98f sierra: fix build error when MBIM and QMI are disabled
Found by Jean-Christian de Rivaz
2015-09-24 14:17:03 -05:00
Aleksander Morgado d281b9bddb broadband-modem-qmi: fix invalid read
Breakpoint 2, g_log (log_domain=log_domain@entry=0x7ffff6ad744e "GLib", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7ffff6ae0c1d "%s: assertion '%s' failed") at gmessages.c:1075
    1075	{
    (gdb) bt
    #0  0x00007ffff6a71b20 in g_log (log_domain=log_domain@entry=0x7ffff6ad744e "GLib", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7ffff6ae0c1d "%s: assertion '%s' failed")
        at gmessages.c:1075
    #1  0x00007ffff6a71be9 in g_return_if_fail_warning (log_domain=log_domain@entry=0x7ffff6ad744e "GLib", pretty_function=pretty_function@entry=0x7ffff6b316a0 <__FUNCTION__.5266> "g_variant_new_string", expression=expression@entry=0x7ffff6b2f1e8 "g_utf8_validate (string, -1, NULL)") at gmessages.c:1088
    #2  0x00007ffff6a9e925 in g_variant_new_string (string=0x7cf850 "260\366\377\177") at gvariant.c:1230
    #3  0x00007ffff7068cfe in g_dbus_gvalue_to_gvariant (gvalue=gvalue@entry=0x7fffffffdec0, type=0x7ffff7b9df91) at gdbusutils.c:604
    #4  0x00007ffff7b8f1eb in _mm_gdbus_modem3gpp_skeleton_handle_get_property (connection=<optimized out>, sender=sender@entry=0x0, object_path=object_path@entry=0x7bd340 "/org/freedesktop/ModemManager1/Modem/1", interface_name=interface_name@entry=0x7ffff7b97320 "org.freedesktop.ModemManager1.Modem.Modem3gpp", property_name=property_name@entry=0x7ffff7baa0a4 "OperatorCode", error=error@entry=0x0, user_data=0x799ab0)
        at mm-gdbus-modem.c:19680
    #5  0x00007ffff7b8f894 in mm_gdbus_modem3gpp_skeleton_dbus_interface_get_properties (_skeleton=<optimized out>) at mm-gdbus-modem.c:19759
    #6  0x00007ffff708e791 in g_dbus_interface_skeleton_get_properties (interface_=0x799ab0 [MmGdbusModem3gppSkeleton]) at gdbusinterfaceskeleton.c:371
    #7  0x00007ffff70937a2 in manager_method_call (connection=<optimized out>, sender=sender@entry=0x7fffe0005200 ":1.270", object_path=object_path@entry=0x7fffe0002fd0 "/org/freedesktop/ModemManager1", interface_name=interface_name@entry=0x7fffe0002dd0 "org.freedesktop.DBus.ObjectManager", method_name=method_name@entry=0x7fffe00059e0 "GetManagedObjects", parameters=parameters@entry=0x7c1e70, invocation=0x7fffe0003260 [GDBusMethodInvocation], user_data=0x713cd0) at gdbusobjectmanagerserver.c:845
    #8  0x00007ffff7076aac in call_in_idle_cb (user_data=0x7fffe0003260) at gdbusconnection.c:4884
    #9  0x00007ffff6a6a7fb in g_main_context_dispatch (context=0x713a00) at gmain.c:3111
    #10 0x00007ffff6a6a7fb in g_main_context_dispatch (context=context@entry=0x713a00) at gmain.c:3710
    #11 0x00007ffff6a6ab98 in g_main_context_iterate (context=0x713a00, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3781
    #12 0x00007ffff6a6aec2 in g_main_loop_run (loop=0x71bf50) at gmain.c:3975
    #13 0x0000000000430e57 in main (argc=<optimized out>, argv=<optimized out>) at main.c:150
2015-09-24 21:13:26 +02:00
Aleksander Morgado 51447bd06b libmm-glib: don't create a SIM object if empty path (/) given
Instead, we'll return NULL and an error set.
2015-09-24 20:43:15 +02:00
Aleksander Morgado b8245b5502 broadband-modem-qmi: don't warn on invalid ESN/MEIDs reported
The MC7304, which is a 3GPP only device, reports a ESN with value 0 in "DMS Get IDs":

    ModemManager[10121]: [/dev/cdc-wdm0] Received message (translated)...
    >>>>>> QMUX:
    >>>>>>   length  = 45
    >>>>>>   flags   = 0x80
    >>>>>>   service = "dms"
    >>>>>>   client  = 2
    >>>>>> QMI:
    >>>>>>   flags       = "response"
    >>>>>>   transaction = 6
    >>>>>>   tlv_length  = 33
    >>>>>>   message     = "Get IDs" (0x0025)
    >>>>>> TLV:
    >>>>>>   type       = "Result" (0x02)
    >>>>>>   length     = 4
    >>>>>>   value      = 00:00:00:00
    >>>>>>   translated = SUCCESS
    >>>>>> TLV:
    >>>>>>   type   = 0x13
    >>>>>>   length = 1
    >>>>>>   value  = 42
    >>>>>> TLV:
    >>>>>>   type       = "Esn" (0x10)
    >>>>>>   length     = 1
    >>>>>>   value      = 30
    >>>>>>   translated = 0
    >>>>>> TLV:
    >>>>>>   type       = "Imei" (0x11)
    >>>>>>   length     = 15
    >>>>>>   value      = <hidden>
    >>>>>>   translated = <hidden>
2015-09-23 21:24:30 +02:00
Aleksander Morgado 585320e0b4 tests: plug memleak in +CMGR response parser 2015-09-22 09:34:22 +02:00
Nick Stevens eaf65ed98d core: process SMS +CGMR response with regex
Variability in the response style from certain modems causes the parsing
of the +CGMR response to fail. For example, the Telit HE910 inserts an
empty string ("") in the second field of the response, causing the
sscanf implementation to fail.

This patch converts the parsing of the CGMR response to a regex that
allows for more flexibility and robustness, and adds unit tests around
the parsing call.

Signed-off-by: Nick Stevens <Nick.Stevens@digi.com>
2015-09-22 09:24:18 +02:00
Krzysztof Kotlenga 0ca68657fb libmm-glib, simple: add missing introspection annotations to disconnect() 2015-09-16 22:16:37 +02:00
Aleksander Morgado 8df7f83278 broadband-modem: minor coding style fixes 2015-09-15 16:34:50 +02:00
Aleksander Morgado 7f47f13673 broadband-modem: don't issue failure setting up messaging in secondary port as a warning 2015-09-15 16:33:48 +02:00
Nick Stevens 48cd903189 core: enable unsolicited messages on secondary
Previously the enable unsolicited messages command (+CNMI) was only
being sent on the primary. This patch adds support for sending the
enable on the secondary as well. If the secondary doesn't exist, or if
setting the enable causes an error, a warning is logged but no error is
propagated up.

This change is needed for proper SMS operation on the Telit HE910, which
requires that +CNMI be sent to both primary and secondary. Since a
failure to send the +CNMI command on the secondary is a non-fatal error,
it is unlikely that this will cause issues with other modems.

Signed-off-by: Nick Stevens <Nick.Stevens@digi.com>
2015-09-15 16:26:03 +02:00
Dan Williams 2034918d7b broadband-modem-mbim: disable CDMA capabilities until we actually support MBIM+CDMA
CDMA-capable modems (like a Sierra EM7355) will fail to even enable,
because the internal CDMA code tries to initialize using AT commands and
that fails because many MBIM modems don't have an AT port.  We should
figure out how to support minimal MBIM + CDMA using MBIM instead of
AT-anything.

[mm-broadband-modem.c:9000] enabling_step(): Modem has CDMA capabilities, enabling the Modem CDMA interface...
[mm-iface-modem-cdma.c:946] mm_iface_modem_cdma_run_registration_checks(): Running registration checks (CDMA1x: 'yes', EV-DO: 'yes')
[mm-broadband-modem.c:7397] setup_registration_checks_context_complete_and_free(): Will skip all QCDM-based registration checks
[mm-broadband-modem.c:7418] setup_registration_checks_context_complete_and_free(): Will skip generic detailed registration check, we don't have Sprint commands
[mm-iface-modem-cdma.c:768] registration_check_step(): Starting QCDM-based registration checks
[mm-iface-modem-cdma.c:780] registration_check_step():   Skipping all QCDM-based checks and falling back to AT-based checks
[mm-iface-modem-cdma.c:823] registration_check_step(): Starting AT-based registration checks
[mm-iface-modem-cdma.c:641] get_service_status_ready(): Could not get service status: No AT port available to run command
[mm-iface-modem.c:1392] __iface_modem_update_state_internal(): Modem /org/freedesktop/ModemManager1/Modem/0: state changed (enabling -> disabled)
2015-08-31 10:49:16 -05:00
Aleksander Morgado 0e7fc1dff9 blacklist: include MediaTek preloader
https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/1473246
2015-08-25 18:53:30 +02:00
Aleksander Morgado 707a2ef417 libmm-glib,docs: fix missing documentations 2015-08-02 12:05:51 +02:00
Aleksander Morgado 7a7fddc931 libmm-glib,docs: update types
# Extra options to supply to gtkdoc-scan
   SCAN_OPTIONS = --rebuild-types
2015-08-02 12:02:32 +02:00
Aleksander Morgado 4043edfd17 libmm-glib,docs: avoid already defined id
DOC   Building HTML
../libmm-glib-docs.xml:6: element indexdiv: validity error : ID api-index-full already defined
  DOC   Fixing cross-references
2015-08-02 12:02:32 +02:00
Aleksander Morgado c4c3afa865 libmm-glib,call: add missing 'dtmf' variable description 2015-08-02 12:02:32 +02:00
Aleksander Morgado 6fbed014db docs,libmm-glib: add missing voice/call documentation 2015-08-02 12:02:32 +02:00
Aleksander Morgado d0b0c3c3e5 api,call: fix Hangup() description
There's no MM_CALL_DIRECTION_TERMINATED enum; plus, anyway, hangup() should be
allowed regardless the direction.
2015-08-02 11:06:01 +02:00
Aleksander Morgado fcf54bd8b2 huawei: plug memleak 2015-08-02 10:49:14 +02:00
Aleksander Morgado d1dab38a06 api,call: minor documentation fix 2015-08-02 10:46:37 +02:00
Aleksander Morgado c55fcab3b3 mmcli,call: minor alignment and message fixes 2015-08-02 10:45:17 +02:00
Marco Bascetta f6779d60fe huawei,voice: ignore undocumented ^CSCHANNELINFO unsolicited command
This command is sent by Huawei ME909s-120 with firmware 23.613.61.00.00
2015-08-02 10:39:48 +02:00
Marco Bascetta 74325b547a core,libmm-glib,cli,voice: Replaced 'SendTone' method and 'ToneReceived' signal with 'SendDtmf' and 'DtmfReceived' 2015-08-02 10:39:48 +02:00
Marco Bascetta 2ac5d620c4 libmm-glib,cli: Replaced 'list call' with 'list calls' 2015-08-02 10:39:48 +02:00
Aleksander Morgado 9f3801df3f core,voice: remove explicit "NO CARRIER" response matching
This response is already managed by the generic AT serial port and translates
it into a proper error. This change also avoids the Call.Start() call to report
a timeout in the serial port, instead we get a proper no-carrier error.

Before:

    $ sudo mmcli -m 0 --voice-create-call="number=12345678"
    Successfully created new call:
	    /org/freedesktop/ModemManager1/Call/1 outgoing (unknown)
    $ sudo mmcli -o 1 --start
    error: couldn't start the call: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Serial.ResponseTimeout: Serial command timed out'

After:

    $ sudo mmcli -m 0 --voice-create-call="number=12345678"
    Successfully created new call:
	    /org/freedesktop/ModemManager1/Call/1 outgoing (unknown)
    $ sudo mmcli -o 1 --start
    error: couldn't start the call: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Connection.NoCarrier: No carrier'
2015-08-02 10:39:48 +02:00
Aleksander Morgado b600e6c9ce mmcli,voice: align values of printed Call parameters 2015-08-02 10:39:48 +02:00
Aleksander Morgado d5bc19f7db policy: fix minor typo 2015-08-02 10:39:48 +02:00
Aleksander Morgado 69585b1374 polkit: added Voice policy rule 2015-08-02 10:39:48 +02:00
Aleksander Morgado 6ca7c49d80 docs,api: add missing links to the new Voice interface and Call object 2015-08-02 10:39:48 +02:00
Aleksander Morgado 394bf91032 mmcli,voice: fix minor typo 2015-08-02 10:39:48 +02:00
Aleksander Morgado a6adf04102 docs,voice: add missing voice related enum values 2015-08-02 10:39:48 +02:00
Aleksander Morgado e75d888b51 core,voice: minor coding style fixes 2015-08-02 10:39:48 +02:00
Aleksander Morgado 61562fbe8b huawei,voice: minor coding style fixes 2015-08-02 10:39:48 +02:00
Aleksander Morgado d00fe0d628 libmm-glib,voice: minor coding style fixes 2015-08-02 10:39:47 +02:00
Aleksander Morgado ca88d6333f api,voice: minor coding style fixes 2015-08-02 10:39:47 +02:00
Aleksander Morgado c0e05dbd43 cli,voice: minor coding style fixes 2015-08-02 10:39:47 +02:00