Commit Graph

4666 Commits

Author SHA1 Message Date
Aleksander Morgado
c7d8ac622a udev: fix tagging per interface number
Commit 7ff57f9808 introduced a change to try to
use ATTRS{bInterfaceNumber} as a common way to match by interface number, but
this logic is broken because all the rules that we use to match by interface
number (attribute in the interface device) also require matching by idVendor
and idProduct (attributes in the physdev device), and udev rules forbid matches
from more than one parent device at a time.

We could use ATTR{bInterfaceNumber} (instead of ATTRS) to tag the actual USB
interface device, but that would require a change in all the plugins to look for
the tag not in the TTY device, but in its parent.

So, recover the original behavior, where a hidden property is created containing
the first bInterfaceNumber found in the list of parent devices, and then run
the matches against idVendor and idProduct only if the hidden property is found
with the expected value.
2016-09-18 15:43:30 +02:00
Aleksander Morgado
aa0e108107 udev: fix SUBSYSTEMS and ATTRS{idVendor} checks
Rules with a single condition where a parent property is checked with != don't
work properly. E.g.:
  SUBSYSTEMS!="usb", GOTO="end"
or:
  ATTRS{idVendor}!="abcd", GOTO="end"

Instead, we can mix both those previous parent rules and match them:
  SUBSYSTEMS=="usb",ATTRS{idVendor}=="abcd", GOTO="next"
  GOTO="end"
  LABEL="next"
  # Apply rules here
  LABEL="end"

In this case both SUBSYSTEMS and ATTRS conditions apply to the parent usb_device
(idVendor attribute is only available in the usb_device), so they apply to all
ports of the same device.
2016-09-18 14:08:20 +02:00
Dan Williams
546d33db6c broadband-modem-huawei: fix missing return in unsolicited voice message enable 2016-09-08 11:29:00 -05:00
Dan Williams
03a6d969ab broadband-modem-huawei: implement Modem.Signal extended signal info interface
Implement the detailed signal info interface for some Huawei 3GPP modems
including those based on HiSilicon chipsets like the E3276.  Known not to
work on many Qualcomm-based Huawei modems like E392, E397, and E367 as
they don't support the ^HCSQ command, but they do support QMI and so
have access to the extended signal interface via QMI.
2016-08-31 09:43:32 -05:00
Tabor Kelly
3d95a9863b blacklist: add blacklist udev rule for U-blox7 GPS/GLOSNASS USB dongle.
Signed-off-by: Tabor Kelly <t.kelly@trailtech.net>
2016-08-29 11:31:45 +02:00
Aleksander Morgado
7fb366c41a core: use MM-specific logging methods always instead of the generic GLib ones 2016-08-15 13:14:47 +02:00
Dan Williams
2306a466c8 api,signal: fix LTE signal dictionary docstring 2016-08-12 12:05:51 -05:00
Aleksander Morgado
048667ffc2 core: minor coding style changes 2016-08-10 09:49:40 +02:00
Carlo Lobrano
f670861939 telit: add support to SIM hot swap
MMBroadbandModemTelit:
 * added logic to set MMBroadbandModem's SIM_HOT_SWAP property to TRUE
 * added function to enable QSS unsolicited
 * added QSS unsolicited handler
2016-08-10 09:39:47 +02:00
Carlo Lobrano
60f4f9e57d modem: support SIM hot swap
BaseModem
  added reprobe property.

MMDevice
  added logic to recreate the modem if it is set invalid and "to reprobe"

MMBroadbandModem
 * added initialization step for SIM hot swap:
    1. keep dedicated ports open to listen to modem's unsolicited
    2. dedicated error management in case of initialization failure due to SIM missing
 * added function to be called in order to act upon SIM insertion/removal:
    1. close dedicated ports
    2. set the modem to be reprobed
    3. disable modem
 * added SIM HOT SWAP boolean property

MMIfaceModem
 * added initialization step for SIM hot swap, if supported by the plugin
 * dedicated error management in case of initialization failure due to SIM missing
2016-08-10 09:39:27 +02:00
Aleksander Morgado
3047522b2e api,signal: Ec/Io is in dB, not dBm 2016-08-10 09:05:47 +02:00
Aleksander Morgado
7460793caa libmm-glib,helpers: don't warn when trying to read invalid match info index
We may want to use the mm_get_()_from_match_info() calls to read optional items,
so that the method returns FALSE if the item index doesn't apply. So, avoid the
implicit warning issued by g_return_val_if_fail().
2016-08-10 09:04:54 +02:00
Aleksander Morgado
f9e4e6b8f1 device: ignored ports are also owned by the device, so include them in lookup 2016-08-06 13:02:19 +02:00
Aleksander Morgado
764bfbce9d mtk,udev: single 'usb' subsystems check 2016-08-06 12:57:44 +02:00
Aleksander Morgado
c7c65e2d57 udev: simpler check for rfcomm device names
Just the same kind of match we use for cdc-wdm devices.
2016-08-06 10:41:52 +02:00
Aleksander Morgado
1ca47e4b52 zte,udev: avoid making the rules tty-only, and simplify single vendor check
The rules were matched only against devices with an exact 'tty' subsystem, and
that means that we were not properly adding additional tags on e.g. wwan or
cdc-wdm devices.
2016-08-06 10:41:52 +02:00
Aleksander Morgado
e47e654d33 simtech,udev: simplify single vendor check 2016-08-06 10:41:52 +02:00
Aleksander Morgado
d9ff08749c nokia,udev: simplify single vendor check 2016-08-06 10:41:52 +02:00
Aleksander Morgado
a5f33f0070 telit,udev: single 'usb' subsystems check and simplified single vendor check 2016-08-06 10:41:52 +02:00
Aleksander Morgado
4d53e2eb98 mbm,udev: additional per-vendor conditions for quicker processing 2016-08-06 10:41:52 +02:00
Aleksander Morgado
a66871a287 huawei,udev: single 'usb' systems check, and per-rule vendor-specific conditions 2016-08-06 10:41:52 +02:00
Aleksander Morgado
55dbb9fdb9 longcheer,udev: single 'usb' subsystems check 2016-08-06 10:41:52 +02:00
Aleksander Morgado
2a171b4951 cinterion,udev: ensure 'usb' subsystems before idVendor/idProduct rules 2016-08-06 10:41:52 +02:00
Aleksander Morgado
840143aa3d haier,udev: simplify single vendor check 2016-08-06 10:41:52 +02:00
Aleksander Morgado
6e999584be x22x,udev: single 'usb' subsystems check 2016-08-06 10:41:52 +02:00
Aleksander Morgado
7ff57f9808 udev: replace ENV{.MM_USBIFNUM} conditions with ATTRS{bInterfaceNumber} 2016-08-06 10:41:52 +02:00
Aleksander Morgado
0b35e71d46 udev: replace ENV{ID_VENDOR_ID} conditions with ATTRS{idVendor} 2016-08-06 10:41:52 +02:00
Aleksander Morgado
1a213e3b62 udev: remove ENV{DEVTYPE}!="usb_device" rules
They're actually a subcase of SUBSYSTEM!="usb", which we apply just before.
2016-08-06 10:41:52 +02:00
Dan Williams
f33ea91ccf base-call: formatting cleanups 2016-08-02 16:27:56 -05:00
Dan Williams
5350b9f568 broadband-modem/libqcdm: add signal strength from QCDM EVDO Pilot Sets log messages
When a CDMA-only modem is registered with the EVDO network, its not possible to
read signal strength in the following cases:

1) while a data connection is active on single-AT-port modems, because the AT
port is used for PPP and not available for AT+CSQ, AT+CIND or vendor-specific
signal strength commands

2) when the modem reports only CDMA 1x signal strength with AT+CSQ

Now that we have a reasonable interpretation of RSSI from the QCDM
EVDO Pilot Sets V2 log messgae, use that when other means of getting
signal strength aren't available.
2016-07-27 10:44:43 -05:00
Lubomir Rintel
30f60de7d3 blacklist: include some more Arduinos
All "2a03  dog hunter AG" devices seem to be Arduinos.

https://bugzilla.redhat.com/show_bug.cgi?id=1261040
2016-07-27 09:33:22 +02:00
Carlo Lobrano
bff43b26bf telit: adding a short delay after SIM unlock
A short delay is necessary with some SIMs when
they have just been unlocked. Using 1 second as secure margin.
2016-07-26 14:10:27 +02:00
Carlo Lobrano
43d97a4623 iface-modem: inverted steps in update_lock_info_context_step
Inverted steps UPDATE_LOCK_INFO_CONTEXT_STEP_RETRIES and
UPDATE_LOCK_INFO_CONTEXT_STEP_AFTER_UNLOCK.

Soon after the unlock, the SIM can be busy and
loading unlock retries might fail.

When implemented, let run "after unlock" logic before any other step in
update lock info, when SIM is not locked this change does not have any
effect since "after unlock" is not executed.
2016-07-26 14:07:37 +02:00
Aleksander Morgado
dce9f05673 build: post release version bump to 1.7.0 2016-07-26 13:27:37 +02:00
Aleksander Morgado
397761c975 release: bump version to 1.6.0 2016-07-26 13:07:49 +02:00
Aleksander Morgado
7b4bd888f0 build: updated copyright years up to 2016 2016-07-26 13:07:49 +02:00
Aleksander Morgado
dbb05afba8 examples: avoid warning in modem-watcher-python example
PyGIWarning: ModemManager was imported without specifying a version first. Use gi.require_version('ModemManager', '1.0') before import to ensure that the right version gets loaded.
2016-07-25 13:17:48 +02:00
Aleksander Morgado
24fd3ef5fb examples: add SMS sender in python 2016-07-25 12:51:45 +02:00
Lubomir Rintel
a7942177c9 build: don't disable the aliasing checks
We now don't break the strict aliasing rules.

Also, having a compiler flag that disables a warning among the flags that are
meant to add extra sanity checking is not correct either:
--enable-extra-warnings=no would generate a bad aliasin warning while
the --enable-extra-warnings=yes would not.
2016-07-21 09:49:34 +02:00
Lubomir Rintel
488992b010 qcdm: avoid upsetting the compiler with wrong aliasing
We shouldn't be accessiing u_int8_t * as u_int16_t *. Let's construct
the 16-bit value by or-ing the 8-bit halves directly; avoiding the
endianness conversion too.
2016-07-21 09:49:34 +02:00
Dan Williams
803caab80a libqcdm: add HDR Pilot Sets V2 log item structures
Apparently I was looking at this in 2012:
https://blogs.gnome.org/dcbw/2012/11/14/got-evdo-help-me-out/

So why not at least get the structures into libqcdm and figure
out a rough correlation between pilot energy and EC/IO.
2016-07-20 11:40:42 -05:00
Aleksander Morgado
f137268ce1 iface-modem: fix checking for single capabilities
The mm_iface_modem_is_*_only() checks were validating that all the other
capabilities except for the ones being queried were unset, but the check wasn't
explicitly checking that the actual capabilities being queried were set.

This was making the check fail when capabilities == MM_MODEM_CAPABILITY_NONE.

Reported-by: Matthew Stanger <stangerm2@gmail.com>
2016-07-20 08:02:49 +02:00
Aleksander Morgado
ddbc219568 bearer-qmi: decide IP method during connection attempt
Deciding the IP method to use based on the underlying QMI port LLP should not be
done when the bearer object is created, because the QMI port in use may not
actually be open or have been opened at that time. During the connection attempt
we do make sure the QMI port is open, so we should check the LLP to use just
after that step.
2016-07-15 19:31:45 +02:00
Aleksander Morgado
46b17908ce broadband-modem-qmi: fix dhcp/static IP setting when kernel data format updated
When the logic decided that we had to update the kernel data format to match the
one configured in the WWAN network interface, we were not flagging the port LLP
with the correct value, what resulted in NetworkManager trying to use dhclient
on the raw-ip interface:

    dhclient[3257]: Unsupported device type 65534 for "wwan1"
    dhclient[3257]:
    dhclient[3257]: If you think you have received this message due to a bug rather
    dhclient[3257]: than a configuration issue please read the section on submitting
    dhclient[3257]: bugs on either our web page at www.isc.org or in the README file
    dhclient[3257]: before submitting a bug.  These pages explain the proper
    dhclient[3257]: process and the information we find helpful for debugging..
    dhclient[3257]:
    dhclient[3257]: exiting.

Fix the internal LLP flag, so that Static IP addressing is requested for all raw-ip
based interfaces.
2016-07-14 14:59:28 +02:00
Dan Williams
48f0210739 bearer-mbim: use the context IP type MM asked to be activated instead of modem response
MM never passes MBIM_CONTEXT_IP_TYPE_DEFAULT which would require paying
attention to the ip_type in the reply to figure out what type the modem
activated.  Instead, MM always specifies the ip_type it wants to activate,
and some modems (K5160) return a different type in the response.  The modem
is required to activate the type MM asks for or return an error, so if
the activation was successful we can safely assume the modem activated
the ip_type we want, and we can ignore the ip_type in the response.
2016-07-11 11:02:53 -05:00
Aleksander Morgado
d757c32b94 release: bump version to 1.5.993 (1.6-rc4) 2016-07-07 20:22:31 +02:00
Aleksander Morgado
b09b7dfc2d NEWS: update for 1.6-rc4 2016-07-07 20:22:00 +02:00
Aleksander Morgado
f5cd7476f4 broadband-modem-mbim: try to use FCC Auth through QMI-over-MBIM if power up fails 2016-07-07 19:51:28 +02:00
Dan Williams
8080be8209 broadband-bearer-mbim: log context IP type when connecting 2016-06-15 14:16:52 -05:00
Dan Williams
182cf1fa89 iface-modem-firmware: clarify log message about unsupported firmware interface 2016-06-01 12:12:47 -05:00