Commit Graph
2150 Commits
Author SHA1 Message Date
Aleksander Morgado 13c7319bff iface-modem: consolidate new unlock required check with retries
The new internal_load_unlock_required() method will take care of running the
subclassed load_unlock_required(), if available, and also retry the check up
to 6 times.

This method will be used both by the standard unlock required check and by the
check within the current capabilities loading for multimode devices.
2013-09-19 09:33:08 -05:00
Ben Chan aa74ea1aa6 iface-modem: fix MODEM_STATE_IS_INTERMEDIATE macro 2013-09-18 08:40:04 +02:00
Ben Chan 5d8efff291 iface-modem: free GError when interface initialization is cancelled
This patch fixes an assertion failure 'ctx->fatal_error == NULL' in
initialization_context_complete_and_free(), which happens if
'fatal_error' of the initialization context is set during the modem
interface initialization and the initialization is later cancelled.
2013-09-16 07:51:53 +02:00
Ben Chan 8a857b7b26 broadband-modem: use InProgress instead of WrongState when appropriate
This patch changes MMBroadbandModem to report an
org.freedesktop.ModemManager1.Error.Core.InProgress error, instead of an
org.freedesktop.ModemManager1.Error.Core.WrongState error, when one
tries to initialize a modem that is already being initialized, or to
enable a modem that is already being enabled.
2013-09-13 11:00:07 +02:00
Aleksander Morgado e755181fd5 broadband-modem: only used CIND? for signal quality if actually reported
The Huawei MU736 supports CIND? but not for signal quality reporting:

AT+CIND=?
   +CIND : ("call",(0,1)), ("message",(0,1)), ("roam",(0,1))
   OK

AT+CIND?
   +CIND:0,0,0
   OK

Which ended up with the following during execution:

ModemManager[3044]: (ttyUSB1) Could not parse CIND signal quality results;
                              signal index (255) outside received range (0-3)

Just avoid this, and make CIND? be used for signal quality retrieval only if
(1) CIND? is actually supported and (2) CIND? reports signal quality
information.
2013-09-11 17:08:27 +02:00
Aleksander Morgado 0ff4da71e3 error-helpers: don't warn when unknown errors are found
Just add the messages with debug level, so that they don't get reported at
syslog. Having this kind of warnings in syslog is not useful, specially because
we wouldn't know which was the specific command that issued the warning. Errors
due to critical issues will anyway be reported in syslog in some way or another.
2013-09-11 17:00:43 +02:00
Aleksander Morgado 4f451cf767 qmi-port: use the new qmi-proxy if available 2013-09-10 18:47:35 +02:00
Dan Williams 11a7e3dfdf core: add helper for parsing and validating the ICCID 2013-09-10 09:42:36 +02:00
Aleksander Morgado ac343d390b iface-modem-oma: fix OMA session state reporting
Reported by Arman Uguray <armansito@google.com>
2013-09-09 10:20:42 +02:00
Aleksander Morgado 03dc346add broadband-modem-qmi: implement OMA CancelSession() 2013-09-09 10:19:21 +02:00
Aleksander Morgado 76835446eb iface-modem-oma: ensure the session id is known when accepting/rejecting it 2013-09-09 10:19:20 +02:00
Aleksander Morgado 3ba2fee6fc broadband-modem-qmi: never add UNKNOWN OMA session types to the pending list 2013-09-09 10:19:20 +02:00
Aleksander Morgado 461d75dae9 broadband-modem-qmi: implement OMA AcceptNetworkInitiatedSession() 2013-09-09 10:19:20 +02:00
Aleksander Morgado 0c7def2f34 broadband-modem-qmi: implement OMA StartClientInitiatedSession() 2013-09-09 10:19:20 +02:00
Aleksander Morgado 72be4f1d57 broadband-modem-qmi: implement OMA Setup() 2013-09-09 10:19:20 +02:00
Aleksander Morgado 959c7b9cde broadband-modem-qmi: implement OMA feature loading 2013-09-09 10:19:20 +02:00
Aleksander Morgado e6a7c85661 broadband-modem-qmi: handle OMA indications 2013-09-09 10:19:20 +02:00
Aleksander Morgado df47f1ac8f broadband-modem-qmi: check support for OMA capabilities 2013-09-09 10:19:18 +02:00
Aleksander Morgado d37b21e116 iface-modem-oma: new object interface to handle the OMA DBus interface 2013-09-09 10:18:23 +02:00
Ben Chan 60e1ac6919 iface-modem: allow reset and factory reset operation in every state 2013-09-02 09:03:53 +02:00
Aleksander Morgado 2b28b7acb6 at-serial-port: avoid 'enable_disable', use just 'enable' in method name 2013-08-26 16:21:27 +02:00
Ben Chan 0f2a0aa0bc at-serial-port: allow enabling/disabling unsolicited message handlers
This patch adds an 'enable' flag in MMAtUnsolicitedMsgHandler and
mm_at_serial_port_enable_disable_unsolicited_msg_handler() to allow
enabling and disabling of unsolicited message handlers. The enable flag
is set to TRUE by mm_at_serial_port_add_unsolicited_msg_handler().
2013-08-26 15:59:29 +02:00
Aleksander Morgado 7e9ae21550 broadband-modem-qmi: avoid processing invalid TLVs in GetSignalStrength response
E.g. in the GetSignalStrength output we get EV-DO-only TLVs, even if EV-DO is
not the current access technology, what ends up generating the following:

$ sudo mmcli -m 0 --signal-get

/org/freedesktop/ModemManager1/Modem/0
  -------------------------
  Refresh rate: '5' seconds
  -------------------------
  EV-DO  | RSSI: '0.00' dBm
         | EcIo: '0.00' dBm
         | SINR: '9.00' dBm
         |   Io: '-106.00' dB
  -------------------------
  UMTS   | RSSI: '94.00' dBm
         | EcIo: '-6.00' dBm

Instead, we will now assume that the RSSI list always contains the valid access
technologies being reported, and use that list to decide whether we process some
of the per-technology TLVs. We now end up getting:

$ sudo mmcli -m 0 --signal-get

/org/freedesktop/ModemManager1/Modem/0
  -------------------------
  Refresh rate: '5' seconds
  -------------------------
  UMTS   | RSSI: '94.00' dBm
         | EcIo: '-8.00' dBm
2013-08-21 13:29:50 +02:00
Aleksander Morgado 27b739b838 broadband-modem-qmi: try with 'NAS Signal Strength' for extended signal info 2013-08-21 12:34:55 +02:00
Aleksander Morgado 71c60fc6eb iface-modem-signal: use the new 'MMSignal' in the interface implementation
Also modify the QMI-specific implementation to act as a state machine, as we'll
add more steps afterwards.
2013-08-21 12:34:54 +02:00
Aleksander Morgado 4a68e8d273 broadband-modem-qmi: extended signal support only in NAS >= 1.8 2013-08-21 12:34:54 +02:00
Aleksander Morgado 1340896b50 iface-modem-signal: explicitly check support for the Signal interface 2013-08-21 12:34:54 +02:00
Aleksander Morgado 0502646f9f api,introspection: use per-technology dictionaries in the 'Signal' interface 2013-08-21 12:34:51 +02:00
Aleksander Morgado e8ce650ed0 broadband-modem-qmi: implement extended signal quality reporting 2013-08-21 12:33:10 +02:00
Aleksander Morgado 5ef439e2d6 broadband-modem: handle the new 'Signal' interface 2013-08-21 12:33:10 +02:00
Aleksander Morgado d368d30c53 iface-modem-signal: new implementation for the 'Signal' interface 2013-08-21 12:33:10 +02:00
Aleksander Morgado ef5aae5125 iface-modem-messaging: never add UNKNOWN to the lists of supported storages 2013-08-19 09:44:20 +02:00
Ben Chan f515cd1d90 iface-modem: add mm_iface_modem_get_model helper to query model 2013-08-14 09:30:41 +02:00
Aleksander Morgado bb1d39cf7c broadband-modem-qmi: check MDN set after manual activation 2013-08-08 09:50:04 +02:00
Aleksander Morgado 512ef6970c broadband-modem-qmi: implement manual CDMA activation
We'll also now require libqmi 1.5 (git master), needed to handle the PRL TLV
in 'DMS Activate Manual'.

TODO: require 1.6 as soon as it is released.
2013-08-08 09:50:04 +02:00
Aleksander Morgado b769d48ed8 iface-modem-cdma: use the new 'MMCdmaManualActivationProperties' 2013-08-08 09:50:04 +02:00
Aleksander Morgado 5ba2c1d6cb introspection,api: document the expected parameters in Cdma.ActivateManual() 2013-08-08 09:50:04 +02:00
Ben Chan ffac6f17b5 modem-helpers: fix parsing of CREG/CGREG/CEREG responses
The format of CREG/CGREG/CEREG responses is not very precisely defined
in or strictly enforced by the 3GPP specifications. That leads to the
fact that some modems put leading zeros in integer type fields (e.g.
<n>, <stat>, <AcT>), and not all modems put double quotes around string
type fields (e.g. <lac>, <ci>) in those C*REG responses.

For example, 0001 can be a valid value for both <stat> and <lac>. The
original C*REG parsing code in ModemManager could potentially interpret
'+CREG: <stat>,<lac>,<ci>,<AcT>' as '+CREG: <n>,<stat>,<lac>,<ci>'. This
patch addresses this issue by refining the regular expressions returned
by mm_3gpp_creg_regex_get() with the following assumptions:

1. If a modem puts leading zeros in integer type fields, it puts double
   quotes around string type fields.
2. If a modem omits double quotes around string type fields, it does not
   put leading zeros in integer type fields.
2013-08-06 16:14:35 -05:00
Dan Williams 965ef76547 serial: add logging to serial port open failures 2013-07-23 10:03:27 -05:00
Aleksander Morgado d90a6309fb broadband-modem-qmi: plug memleak when listing SMS messages 2013-07-18 22:44:49 +02:00
Aleksander Morgado abce098cfe sms: initialize 'validity' property always to a default
When we're exposing not-yet-completed multipart messages, we need to provide a
correct value for the validity property, or gdbus may crash, see e.g.:

https://bugzilla.gnome.org/show_bug.cgi?id=704319
2013-07-17 09:03:16 +02:00
Ben Chan 5e82707b3f broadband-modem-qmi: fix incorrect conversions from double to gint32
This patch fixes the following incorrect conversions from double to gint32:

mm-broadband-modem-qmi.c:4785:27: error: implicit conversion from 'double' to 'gint32' (aka 'int')
changes value from 2.225073858507201E-308 to 0 [-Werror,-Wliteral-conversion]
    gint32 bs_longitude = MM_LOCATION_LONGITUDE_UNKNOWN;
           ~~~~~~~~~~~~   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

mm-broadband-modem-qmi.c:4786:26: error: implicit conversion from 'double' to 'gint32' (aka 'int')
changes value from 2.225073858507201E-308 to 0 [-Werror,-Wliteral-conversion]
    gint32 bs_latitude = MM_LOCATION_LATITUDE_UNKNOWN;
           ~~~~~~~~~~~   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
2013-07-11 08:33:37 +02:00
Ben Chan d366b28650 modem-helpers-qmi: fix enumeration type mismatches
This patch fixes the following enumeration type mismatches:

mm-modem-helpers-qmi.c:980:12: error: implicit conversion from
enumeration type 'QmiNasRatModePreference' to different
enumeration type 'QmiNasRadioTechnologyPreference' [-Werror,-Wenum-conversion]
    return qmi;
    ~~~~~~ ^~~

mm-modem-helpers-qmi.c:1082:12: error: implicit conversion from
enumeration type 'MMModemMode' to different
enumeration type 'QmiNasGsmWcdmaAcquisitionOrderPreference' [-Werror,-Wenum-conversion]
    return MM_MODEM_MODE_NONE;
    ~~~~~~ ^~~~~~~~~~~~~~~~~~

mm-modem-helpers-qmi.c:1096:16: error: implicit conversion from
enumeration type 'QmiNasRegistrationState' to different
enumeration type 'MMModem3gppRegistrationState' [-Werror,-Wenum-conversion]
    return QMI_NAS_REGISTRATION_STATE_NOT_REGISTERED;
    ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2013-07-11 07:53:33 +02:00
Ben Chan dd2b467262 serial-port: warn if ioctl(TIOCSSERIAL) fails to set closing_wait
Prints out a warning if ioctl(TIOCSSERIAL) fails to set closing_wait to
none. This helps debug issues when a serial driver does not support or
properly handle closing_wait, which may cause closing of the serial port
to block.
2013-07-08 08:46:21 +02:00
Aleksander Morgado a9ebec949e plugin-manager: handle modems where only some ports report being Icera
Icera-based Nokia modems may reply correctly to the Icera probing only in some
AT ports, not in all. In order to handle this situation we override the final
plugin selected to be the Icera-based one if we find that the mismatched plugins
have the 'icera-allowed' and 'icera-forbidden' filters.

https://bugzilla.gnome.org/show_bug.cgi?id=703022
2013-06-26 11:07:40 +02:00
Aleksander Morgado ddb9691922 iface-modem: plug memleak 2013-06-25 11:48:50 +02:00
Aleksander Morgado b4f6a4ac0b serial-parsers: plug memleak 2013-06-25 11:48:43 +02: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 e227d4af39 iface-modem: don't rely on the cached current power state value
The real power state value of the modem may be changed by other means, e.g.
rfkill. So when changing power state of the modem in MM, we better recheck
which the current power status is.

A better full approach would be to follow rfkill changes, but this fix should
help until that is done.

https://bugzilla.gnome.org/show_bug.cgi?id=702838
2013-06-24 19:40:58 +02:00
Aleksander Morgado 08ef3c81da broadband-modem-mbim: fix notification signal handling 2013-06-24 19:37:39 +02:00