Commit Graph
2118 Commits
Author SHA1 Message Date
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
Aleksander Morgado 19bd63ecfd broadband-modem-mbim: log about all received notifications 2013-06-24 19:37:38 +02:00
Aleksander Morgado 697b6fdadb broadband-modem-mbim: add support for flash/alert SMS messages
My Huawei MBIM modem notifies of standard new messages using MBIM_CID_MESSAGE_STORE_STATUS
notifications, which is kind of wrong, as they should really be notified using
MBIM_SMS_READ notifications; but anyway, try to handle those.
2013-06-24 19:37:38 +02:00
Aleksander Morgado ee62806a1a broadband-modem-mbim: setup enabling and disabling of unsolicited messages 2013-06-24 19:37:38 +02:00
Aleksander Morgado 817fc43bb0 broadband-modem-mbim: rename 'notification_flags' to 'setup_flags'
We'll add 'enable_flags' later on.
2013-06-24 19:37:38 +02:00
Aleksander Morgado ac7c87c0d2 broadband-modem-mbim: rename 3GPP specific methods 2013-06-24 19:37:38 +02:00
Aleksander Morgado 67207f279b sms: don't warn about unsupported validities 2013-06-24 19:37:38 +02:00
Aleksander Morgado 347ea7cd4e broadband-modem-mbim: implement setup/cleanup messaging events 2013-06-24 19:37:38 +02:00
Aleksander Morgado 6afbcc2c27 sms-mbim: new 'MMSmsMbim' object type 2013-06-24 19:37:38 +02:00
Aleksander Morgado 73bab06049 broadband-modem-mbim: implement initial sms parts loading 2013-06-24 19:37:38 +02:00
Aleksander Morgado a09cabd48e broadband-modem-mbim: implement supported storages loading
We'll only expose 'MT' (ME+SM) as supported, as in MBIM the device doesn't
specify different storages.
2013-06-24 19:37:38 +02:00
Aleksander Morgado cb046934c3 broadband-modem-mbim: check for messaging support 2013-06-24 19:37:38 +02:00
Aleksander Morgado 6a01e51a5c tests: avoid printing in stdout by default
Tests had either their own g_print()s or they would enable a _mm_log() method to
get all g_debug()s from the libraries printed. In order to cleanup the result of
the tests run, avoid this stdout dumps by default, and only enable them if
explicitly enabled in CFLAGS, e.g.:

  $> ./configure CFLAGS="-DENABLE_TEST_MESSAGE_TRACES"
2013-06-18 17:15:03 +02:00
Aleksander Morgado 2a922f836d build: remove unneeded GLIB_CHECK_VERSION checks, 2.32 already required 2013-06-18 16:55:29 +02:00
Aleksander Morgado 2ad39277d2 build: setup gtester based tests 2013-06-18 16:50:47 +02:00
Aleksander Morgado ce84ea510f bearer-mbim: make packet service attach operation optional
Some modems do require it, but some others won't (e.g. CDMA based ones), so
just make the operation optional, but only if the modem replies NoDeviceSupport.

https://bugzilla.gnome.org/show_bug.cgi?id=702419
2013-06-17 15:48:07 +02:00
Aleksander Morgado e65f6ca2af bearer: MMBearerIpFamily is flags, not enum
Fixes the following warning...
    [mm-broadband-modem-mbim.c:1133] modem_create_bearer(): Creating MBIM bearer in MBIM modem
    GLib-GObject-CRITICAL **: g_param_spec_enum: assertion `G_TYPE_IS_ENUM (enum_type)' failed
    GLib-GObject-CRITICAL **: g_object_class_install_property: assertion `G_IS_PARAM_SPEC (pspec)' failed
2013-06-17 08:21:22 +02:00
Aleksander Morgado fcede1a80a broadband-modem-qmi: fallback to AT if WMS service not available for messaging
It is quite common to have modems handled with QMI but with very limited
services implemented, e.g. without WMS:

    [/dev/cdc-wdm0] QMI Device supports 5 services:
    [/dev/cdc-wdm0]    ctl (1.3)
    [/dev/cdc-wdm0]    wds (1.5)
    [/dev/cdc-wdm0]    dms (1.2)
    [/dev/cdc-wdm0]    nas (1.0)
    [/dev/cdc-wdm0]    cat (0.0)

We'll now fallback to use plain AT commands when no QMI WMS service is found.
2013-06-15 17:19:54 +02:00
Dan Williams dc81556914 broadband-bearer-qmi: log both IPv4 and IPv6 settings for V4V6 connections
Old code only printed one or the other; but if we have dual-stack
connectivity, print everything we can read.
2013-06-12 09:16:16 -05:00
Aleksander Morgado 6920a177d6 manager: require whitelist for devices in the 'pnp' subsystem 2013-06-10 20:30:13 +02:00
Dmitry Ivanyushin 6c098dd9f5 manager: handle PNP-connected devices too
I have a modem that is connected to motherboard's built-in serial port. Its
parent is listed in udev as "pnp" so this patch handles that situation.
2013-06-07 16:26:34 -05:00
Aleksander Morgado 4901ee8632 broadband-modem: run *CNTI=2 to when loading supported modes
It sometimes provides a much better view of the supported modes than the WS46=?
command, which is not always properly implemented. E.g.:

Nokia N950:
---------------
at+ws46=?
(12)
OK

at*cnti=2
*CNTI: 2,GSM,GPRS,EDGE,UMTS,HSDPA,HSUPA
OK

Sierra AC313u
---------------
at+ws46=?
ERROR

at*cnti=2
*CNTI: 2,GSM,GPRS,EDGE,UMTS,HSDPA/HSUPA,HSPA+,LTE
OK
2013-06-05 19:15:16 +02:00
Aleksander Morgado de944262b4 broadband-modem: don't set supported mode defaults based on guesses
We may be asking to load supported modes while in locked state, so the commands
may fail. In order to re-load them properly once we're unlocked, we better just
return an error instead of setting defaults.
2013-06-05 19:15:15 +02:00
Aleksander Morgado 5b08091520 api,introspection: Simple.Connect() won't change neither bands nor allowed modes
We won't allow changing modes or bands through Simple.Connect(). Applications
should instead look at the corresponding SupportedBands or SupportedModes, and
then use SetCurrentBands() or SetCurrentModes() explicitly.
2013-06-05 19:15:15 +02:00
Aleksander Morgado b41278c423 iface-modem: allow changing capabilities in every state
Same as done with the firmware switching, we allow capabilities changing even
if the modem is in FAILED state, e.g. to switch from 3GPP to 3GPP2 mode.
2013-06-05 19:15:15 +02:00
Aleksander Morgado f09eff633c iface-modem: load current modes and bands during initialization
We now load current modes and bands before enabling the modem, and we also allow
mode and bands changes while the modem is disabled.
2013-06-05 19:15:15 +02:00
Aleksander Morgado da606ef572 broadband-modem-qmi: update current capabilities loading logic
Changes being:

 * Don't rely on the band preference TLVs presence. The band preference TLVs are
   always given, even if the modem doesn't support the specific capability right
   away. E.g. a GSM/UMTS/LTE modem configured with 'gsm-umts' capability (no
   'lte') still shows the LTE band preference TLV in the SSP responses.

 * Don't automatically add LTE as current capability. We needed this when we
   were not able to change capabilities, so that we didn't lose the ability to
   set 4G mode as allowed.
2013-06-05 19:15:15 +02:00
Aleksander Morgado 83a8e08c37 broadband-modem-qmi: implement capabilities setting 2013-06-05 19:15:15 +02:00
Aleksander Morgado a902e6859e api,introspection: new 'SetCurrentCapabilities' method
For those modems which expose a valid 'SupportedCapabilities' property with more
than one item in the list, we'll allow switching between them.
2013-06-05 19:15:15 +02:00
Aleksander Morgado 700ebc5c07 api,introspection: rename 'ModemCapabilities' to 'SupportedCapabilities'
And also make it a list of masks, specifying which are the specific combinations
supported, not just one mask with all.

E.g.:
  -------------------------
  Hardware |   manufacturer: 'Sierra Wireless, Incorporated'
           |          model: 'MC7710'
           |       revision: 'SWI9200X_03.05.19.04ap r5475 carmd-en-10527 2012/09/17 17:57:14'
           |      supported: 'gsm-umts
           |                  gsm-umts, lte'
           |        current: 'gsm-umts, lte'
           |   equipment id: '358178040668164'
2013-06-05 19:15:15 +02:00
Aleksander Morgado 1c67d050cb api,introspection: merge 'AllowedModes' and 'SupportedMode' into 'CurrentModes'
We now have a single 'CurrentModes' property which contains both values in a
tuple with signature "(uu)".

Also, rename 'SetAllowedModes()' to 'SetCurrentModes()', and update the list of
arguments expected to have a single "(uu)" tuple.
2013-06-05 19:15:14 +02:00
Aleksander Morgado 45ceba7692 api,introspection: 'SupportedModes' is now a list of possible combinations
Instead of just a mask of MMModemMode values, we now provide a list of the
allowed and preferred mode combinations supported by the modem. E.g.:

$> sudo mmcli -m 0
  -------------------------
  Modes    |      supported: 'allowed: 2g; preferred: none
           |                  allowed: 3g; preferred: none
           |                  allowed: 2g, 3g; preferred: none
           |                  allowed: 2g, 3g; preferred: 2g
           |                  allowed: 2g, 3g; preferred: 3g
           |                  allowed: 4g; preferred: none
           |                  allowed: 2g, 3g, 4g; preferred: none'
2013-06-05 19:15:14 +02:00
Aleksander Morgado 212d00c529 api,instrospection: rename 'Bands' to 'CurrentBands'
... and 'SetBands()' to 'SetCurrentBands()'.

We'll keep the 'Current' keyword in those properties which also have
'Supported' values.
2013-06-05 19:15:14 +02:00