Commit Graph
243 Commits
Author SHA1 Message Date
Aleksander Morgado f7418da3bc huawei: avoid using the QCDM port during a voice call 2019-12-02 22:15:53 +00:00
Aleksander Morgado d5d0ed0b24 tests: print MM logs only on verbose test mode
Therefore, avoid needing ENABLE_TEST_MESSAGE_TRACES build symbol.
2019-10-14 15:30:27 +02:00
Aleksander Morgado def5c76cf9 huawei,bearer: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado 63ccd36361 huawei: cleanup/setup voice unsolicited events 2019-07-11 23:21:00 +02:00
Aleksander Morgado 24c0c7aa6b huawei: audio channel setup at modem-level
The audio channel setup is shared between all ongoing calls, so it is
a modem-level feature, not specific to a single call.
2019-07-11 23:21:00 +02:00
Aleksander Morgado 12bad162e3 huawei: voice-related URCs are not in-call
The URCs report the specific call index they apply to, so they should
be managed by the modem object and reported to the Voice interface.
2019-07-11 23:21:00 +02:00
Aleksander Morgado ed7be29111 broadband-modem,voice: disable unsolicited events 2019-07-11 23:00:50 +02:00
Ben Chan 7de6b6f2e1 core: remove unnecessary NULL checks for g_match_info_free()
g_match_info_free() already check if the given pointer is NULL and does
nothing on a NULL pointer.
2018-10-18 13:17:36 +02:00
Aleksander Morgado c9a56605ca huawei,call: check for ^CVOICE support and enable audio streaming
USB sticks only support voice if ^CVOICE returns 0.  And to enable audio
streaming on the "Application" port (whatever is returned by AT^DDSETEX=?)
we need to send AT^DDSETEX=<port> after starting the call.  After that
the serial port will send and accept signed 16-bit 8000hz PCM audio, or
whatever format is returned by ^CVOICE?.

This patch is a rework of the original implementation by:
Dan Williams <dcbw@redhat.com>
2018-10-16 17:09:21 +00:00
Aleksander Morgado 887376fe44 mm-iface-mode: provide direction and number when creating calls
Calls created from property bundles are always outgoing, while calls
created as input events from URCs during runtime are always incoming.

This change makes it mandatory to provide at least direction of the
call when the object is created, leaving the number as an optional
property that may or may not be known in advance (e.g. it would be
optional only for incoming calls).
2018-10-16 17:09:21 +00:00
Aleksander Morgado fc0feee654 huawei,call: handle in-call URCs in the call object itself
Instead of handling the URCs in the modem object and using the
MMIfaceModem as a bridge to report the status read from the URC to a
call obtained from the MMCallList... just handle the URCs in the call
object itself.
2018-10-16 17:09:21 +00:00
Aleksander Morgado f71e120fb7 huawei: ignore voice origination info URCs
These are not used for anything, so just simplify code.
2018-10-16 17:09:21 +00:00
Aleksander Morgado ae917d03fd huawei: if URCs fully ignored always, don't treat them as voice-specific 2018-10-16 17:09:21 +00:00
Aleksander Morgado 65ae18118e huawei,call: remove custom start() method
Totally equivalent to the default one in the MMBaseCall object.
2018-10-16 17:09:21 +00:00
Aleksander Morgado 0478e88b4f base-call: listen for connection error URCs in-call
In order to detect state changes while we're in-call, we have to
monitor the standard connection errors we're used to, but have them
processed as URCs instead of as responses to ATD requests.
2018-10-16 17:09:21 +00:00
Aleksander Morgado 0090124ec0 base-call: ACTIVE after start() if detailed transitions unavailable
The most detailed call state transition flow for a new outgoing call
would be:

  UNKNOWN -> DIALING -> RINGING -> ACTIVE

But, if the modem doesn't support reporting intermediate states
(e.g. DIALING or RINGING) then a successful start() should imply
getting into ACTIVE state right away.

For now, only the Huawei plugin implements the detailed transition
support, so make them configurable via call object properties.
2018-10-16 17:09:21 +00:00
Aleksander Morgado 3bc9a2dbe2 broadband-modem,ussd: explain encoding/decoding logic 2018-08-21 16:50:15 +00:00
Aleksander Morgado 548b7f8847 base-modem: load AT port type hints when adding port
We keep the pflags input in mm_base_modem_grab_port() so that plugins
can use other methods to gather port type hints (e.g. querying with AT
commands as in Huawei/Telit or looking at sysfs properties as in HSO).

For standard udev tag port type hints, it will be the base modem
looking them up.

Note that there is no longer any need to ignore non-flagged ports for
those modems that require primary/secondary flags. They will be
implicitly ignored when mm_base_modem_organize_ports() decides which
ports to use, as the flagged ones are preferred over the non-flagged
ones.
2018-08-10 04:19:13 +00:00
Aleksander Morgado 6b0424cfac plugins: consolidate ID_MM_PORT_TYPE_AT_* flag names
We define 3 common udev tag ids to be used by all plugins:

 * ID_MM_PORT_TYPE_AT_PRIMARY: the primary modem port. It will be used
   for AT control and also as PPP if there is no other port flagged
   explicitly to do PPP.

 * ID_MM_PORT_TYPE_AT_SECONDARY: the secondary modem port. It will be
   used when/if the primary port gets connected to do PPP.

 * ID_MM_PORT_TYPE_PPP: the port to be used to do PPP only. This tag
   makes sense only when the primary port shouldn't be used for PPP,
   i.e. when there is a port dedicated to do PPP and one port
   dedicated for control.
2018-08-10 04:19:13 +00:00
Aleksander Morgado 86f840d97b port-probe: explicitly report GPS port type if port flagged
And remove all custom logic from all plugins that were doing just that.
2018-08-10 04:19:13 +00:00
Aleksander Morgado 85adbdbdd1 plugins: consolidate ID_MM_PORT_TYPE_GPS flag name
Use the same flag name across all plugins with support for
NMEA-capable TTYs.
2018-08-10 04:19:13 +00:00
Aleksander Morgado c07382a486 udev: add tags also on bind action
When a new USB device is hotplugged, e.g. a USB<->RS232 converter that
exposes a single ttyUSB0, these udev events happen:

  add  /devices/pci0000:00/0000:00:14.0/usb2/2-1 (usb/usb-device)
  add  /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0 (usb/usb-interface)
  add  /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/ttyUSB0 (usb-serial)
  add  /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/ttyUSB0/tty/ttyUSB0 (tty)
  bind /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/ttyUSB0 (usb-serial)
  bind /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0 (usb/usb-interface)
  bind /devices/pci0000:00/0000:00:14.0/usb2/2-1 (usb/usb-device)

Our udev rules in MM only added tags in the 'add' events, and it looks
like the only ones 'persistent' after this sequence are those of the
last event happening on the specific path.

This meant that all TTY subsystem rules (e.g. ID_MM_CANDIDATE) would
be stored for later check (e.g. if ModemManager is started after these
rules have been applied), which was ok. "udevadm info -p ..." would
show these tags correctly always.

But this also meant that the 'bind' udev event happening for the USB
device didn't get any of our device-specific tags, and so we would be
missing them (e.g. ID_MM_DEVICE_MANUAL_SCAN_ONLY) if MM is started
after the last event has happened. "udevadm info -p ..." would
not show these tags.

Modify all our rules to also run at the 'bind' events.

See, for context:
  https://github.com/systemd/systemd/issues/8221
2018-06-02 16:54:37 +02:00
Lubomir Rintel b39dd2ec05 all: drop unused variables
Keeps build with GCC 8 happy.

mm-base-call.c:758:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
mm-base-call.c:822:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
mm-base-sms.c:908:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
mm-sms-list.c:331:25: warning: variable 'ctx' set but not used [-Wunused-but-set-variable]
mm-iface-modem-messaging.c:1210:21: warning: variable 'storage_ctx' set but not used [-Wunused-but-set-variable]
huawei/mm-plugin-huawei.c:183:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
ublox/mm-plugin-ublox.c:161:24: warning: variable 'response' set but not used [-Wunused-but-set-variable]
ublox/mm-plugin-ublox.c:159:24: warning: variable 'ctx' set but not used [-Wunused-but-set-variable]
icera/mm-modem-helpers-icera.c:218:25: warning: variable 'first_free' set but not used [-Wunused-but-set-variable]
novatel/mm-common-novatel.c:50:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
2018-04-24 18:11:15 +02:00
Ben Chan 456e1e0d0c huawei: handle optional 0x prefix on hex numbers in ^DHCP response
On Huawei ME936, the hex numbers in the response to AT^DHCP contain the 0x prefix, e.g.

  AT^DHCP?

  ^DHCP: 0xda7d0e0a,0xff000000,0xdb7d0e0a,0xdb7d0e0a,0x01261aac,0x00000000,100000000,50000000

This patch updates mm_huawei_parse_dhcp_response() to handle the
optional 0x prefix.
2018-01-27 12:13:18 -06:00
Aleksander Morgado 33583ca4de kerneldevice: allow getting interface class/subclass/protocol 2017-12-05 10:58:29 +01:00
Aleksander Morgado 4c36bd42d4 huawei: plug memleak when listing cdc-wdm AT ports
The returned list contains full references, so make sure we unref them
before going on. Note that it's ok to return a pointer to one object
inside this list even if we're unref-ing them all, because we're sure
that the caller knows it's peek-ing a port object.
2017-09-26 10:46:55 +02:00
Ben Chan d6d52b95c7 huawei: port connect_3gpp to use GTask 2017-09-08 17:45:29 +02:00
Ben Chan 1ada2d23a5 huawei: port disconnect_3gpp to use GTask 2017-09-08 17:45:29 +02:00
Ben Chan abf9d36183 huawei: port huawei_modem_create_bearer to use GTask 2017-09-08 17:45:29 +02:00
Ben Chan 7880a35b19 huawei: port huawei_custom_init to use GTask 2017-09-08 17:45:29 +02:00
Ben Chan e76015ac49 huawei: port get_detailed_registration_state to use GTask 2017-09-08 17:45:29 +02:00
Ben Chan 9c32a96578 huawei: port setup_registration_checks to use GTask 2017-09-08 17:45:29 +02:00
Ben Chan 39484765f1 huawei: port call_start to use GTask 2017-09-08 17:45:29 +02:00
Ben Chan 8df63e385c huawei: port modem_voice_disable_unsolicited_events to use GTask 2017-09-08 17:45:29 +02:00
Ben Chan 68075a23a7 huawei: port modem_voice_enable_unsolicited_events to use GTask 2017-09-08 17:45:29 +02:00
Ben Chan 5e8a7aad76 huawei: port modem_voice_{setup,cleanup}_unsolicited_events to use GTask 2017-09-08 17:45:29 +02:00
Ben Chan 46866b08be huawei: port modem_cdma_{setup,cleanup}_unsolicited_events to use GTask 2017-09-08 17:45:29 +02:00
Ben Chan 5f641afe07 huawei: port modem_3gpp_disable_unsolicited_events to use GTask 2017-09-08 17:45:29 +02:00
Ben Chan 074e0f89fc huawei: port modem_3gpp_enable_unsolicited_events to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan 02ce611d5c huawei: port modem_3gpp_{setup,cleanup}_unsolicited_events to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan 38bafe021e huawei: port {enable,disable}_location_gathering to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan 6ebc07f882 huawei: port location_load_capabilities to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan 36d975bd4e huawei: port modem_after_sim_unlock to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan 0aae6d3e35 huawei: port modem_time_check_support to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan 60129a6fde huawei: port modem_load_signal_quality to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan 0c468bb1a4 huawei: port load_sim_identifier to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan 1495fb1d1d huawei: port load_power_state to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan 046f1b3301 huawei: port load_supported_modes to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan c7ec2c4fbb huawei: port load_current_modes to use GTask 2017-09-08 17:45:28 +02:00
Ben Chan bf03f1e2d7 huawei: port set_current_modes to use GTask 2017-09-08 17:45:28 +02:00