Commit Graph

8036 Commits

Author SHA1 Message Date
Alexander Couzens 0bfb7039c9 [RFC] qmimodem: implement voice calls
The voice_generated.* files is an RFC how files should look like.
They aren't yet generated.
2017-07-27 01:53:56 +02:00
Alexander Couzens 506fec4485 voicecall: prefer release_specific() over hang_up_active/hangup_all
release_specific() has the call_id as parameter in difference to the more unspecific
calls hangup_all and hangup_active.
2017-07-27 01:53:56 +02:00
Alexander Couzens d3398f52fa network: debug output the network time if updated 2017-07-27 01:53:56 +02:00
Alexander Couzens cd98b649b5 network/ofono_netreg_status_notify: debug output lac and ci
The location are code and cell id is updated at the same time.
2017-07-27 01:53:56 +02:00
Alexander Couzens 54bcf5e3c4 qmimodem: extract network time from serving system 2017-07-27 01:12:29 +02:00
Alexander Couzens 32dac2f677 qmimodem: sync the modem on enable
The qmi sync call release all previous resources.
2017-07-27 01:12:29 +02:00
Alexander Couzens 79418076b5 NOT_FOR_MERGE: qmimodem: add strength to debug 2017-07-27 01:12:29 +02:00
Alexander Couzens ff06b899c4 plugins/allowed-apns: remove dbus interface when modem disappear
Previous a disappeared modem still shows the following methods:
org.ofono.AllowedAccessPoints.GetAllowedAccessPoints
2017-07-27 01:12:29 +02:00
Alexander Couzens 3bba30fd23 common,atmodem: rename & move at_util_call_compare_by_id to common.c
at_util_call_compare_by_id is used by several modem drivers.
2017-07-27 01:12:29 +02:00
Alexander Couzens 4c71f0ca71 common,atmodem: rename & move at_util_call_compare_by_status to common.c
at_util_call_compare_by_status is used by several modem drivers.
2017-07-27 01:12:29 +02:00
Alexander Couzens 2ae2366c26 add call-list helper to manage voice call lists
Many drivers asks the modem for a complete call list of current calls.
These list of calls can be feeded into call-list which parse the
list and notify ofono for new calls.
2017-07-27 01:12:29 +02:00
Alexander Couzens 02c9780aa8 voicecall.h: declare struct ofono_modem
Fix a warning when only voicecall.h is included:
'struct ofono_modem declared' inside parameter list will not be visible
outside of this definition or declaration struct ofono_voicecall
*ofono_voicecall_create(struct ofono_modem *modem,...
2017-07-25 15:28:28 +02:00
Alexander Couzens 996aaf3f1e voicecall: use ofono_call_status_name in DBG messages 2017-07-25 15:28:28 +02:00
Alexander Couzens 99767e9da1 voicecall,common: promote call_status_to_string() public
call_status_to_string() is useful for debug output.
Change signature to contain enum call_status
Replace default case to get compiler warning when new enums added
2017-07-25 15:28:28 +02:00
Alexander Couzens c97a48fd4b common: create GList helper ofono_call_compare
replaces at_util_call_compare (atmodem) and
call_compare (rild).
2017-07-25 15:28:28 +02:00
Alexander Couzens 1fafaee37e drivers/qmimodem: don't change the RAT when registering to an operator
When registering to an operator ofono uses the old RAT.
In the case the modem is not connected to any network, this would use
QMI_NAS_NETWORK_RAT_NONE which results in the error OP_DEVICE_UNSUPPORTED.

Use QMI_NAS_NETWORK_RAT_NO_CHANGE instead to not define any preference.
2017-07-25 15:28:23 +02:00
Marcel Holtmann f9df88a104 build: Don't report format truncation as warnings 2017-07-11 10:47:31 -07:00
Marcel Holtmann a78ceff29c ril_intel: Fix wrong pointer derference for power status 2017-07-11 10:47:11 -07:00
Marcel Holtmann 7756e3700f ublox: Add missing break statement 2017-07-11 10:46:39 -07:00
Marcel Holtmann 88ef01ea97 u8500: Add missing fall through statement 2017-07-11 10:46:13 -07:00
Marcel Holtmann 9b7a6425bd phonebook: Add missing fall through statement 2017-07-11 10:45:48 -07:00
Marcel Holtmann 9fa6f20a6f voicecall: Reword fall through statement to avoid compiler warning 2017-07-11 10:45:19 -07:00
Marcel Holtmann 38a6826228 stk: Add missing break statement for inkey duration 2017-07-11 10:44:53 -07:00
Marcel Holtmann 3472aa67a6 gatchat: Reword the fall through cases to avoid compiler warnings 2017-07-11 10:44:15 -07:00
Marcel Holtmann 9cdcf72994 ifxmodem: Fix GPRS activation command string buffer size 2017-07-11 10:43:59 -07:00
Marcel Holtmann 339e874212 telitmodem: Fix GPRS activation command string buffer size 2017-07-11 10:43:23 -07:00
Marcel Holtmann 6c936db4ae atmodem: Fix missing break statement for ublox driver 2017-07-11 10:42:59 -07:00
Slava Monich 00613b5bbc radio-settings: Fix memory leaks in radio_load_settings
Errors returned by g_key_file_get_integer have to be deallocated
by the caller to avoid leaks like these:

==13330== 104 (24 direct, 80 indirect) bytes in 2 blocks are definitely lost
==13330==    at 0x483F3EC: malloc (vg_replace_malloc.c)
==13330==    by 0x4B020DF: g_malloc (gmem.c)
==13330==    by 0x4B17F51: g_slice_alloc (gslice.c)
==13330==    by 0x4AE80B9: g_error_new_valist (gerror.c)
==13330==    by 0x4AE830B: g_set_error (gerror.c)
==13330==    by 0x4AF5681: g_key_file_get_value (gkeyfile.c)
==13330==    by 0x4AF6817: g_key_file_get_integer (gkeyfile.c)
==13330==    by 0x10CFE3: radio_load_settings (radio-settings.c)
==13330==    by 0x10D2E3: ofono_radio_settings_register (radio-settings.c)
2017-06-02 10:42:30 -05:00
Alexander Couzens 417af0eaf2 qmimodem/sms: don't check for free ME space on receive
If the ME storage is full, the modem will reject new messages
with a SMPP RP-Error 'Protocol error, unspecific'.
It seems the qmimodem is first checking the ME storage for
free space, then deliver the SMS via QMI and not saving it
to the ME anyway.
Using QMI_WMS_STORAGE_TYPE_NONE it doesn't check for free space.

Tested-on: Quectel EC20
2017-05-30 17:31:25 -05:00
Alexander Couzens b5cc57775f qmimodem: add debug helper qmi_result_print_tlvs
qmi_result_print_tlvs prints the type and length field
of a result to DBG()
2017-05-30 17:29:13 -05:00
Vincent Cesson 940db06cbd gemalto: Implement HardwareMonitor method
Use Gemalto commands ^SCTM and ^SBV to monitor temperature and voltage.
Use a single method GetStatistics to read and return both values.
2017-05-17 11:28:43 -05:00
Denis Kenzior 5c10829455 build: Add cinterion-hardware-monitor-api.txt 2017-05-16 13:23:59 -05:00
Vincent Cesson 0dda7aabc0 doc: gemalto: add cinterion.HardwareMonitor api
add documentation about interface cinterion.HardwareMonitor.

This interface exposes a single method to access temperature and supply
voltage of the modem.
2017-05-16 13:22:54 -05:00
Vincent Cesson 5e6770e38e gemalto: Prepare new interface for hardware monitoring
Gemalto modems have hardware related commands, allowing to monitor voltage
and temperature. These parameters will be accessible on DBus interface:
org.ofono.HardwareMonitor.

 - Create the DBus method table with one entry: GetStatistics. This method
would return temperature and voltage values.
 - Create a dedicated structure to handle the DBus methods.
 - Create enable/disable functions to handle DBus interface registration.
2017-05-16 13:13:48 -05:00
Slava Monich 440c9bec88 simfs: Prevent a crash in sim_fs_notify_file_watches
If no file watchers have ever been added, context->file_watches
is NULL and sim_fs_notify_file_watches() should take that into
account.
2017-05-12 14:37:26 -05:00
Denis Kenzior 2d6c4f9d02 qmi: Fix invalid memory access
When qmi_device_shutdown is used and the callback provided utilizes
qmi_device_unref, an access into already freed memory is triggered.

Sequence of events is:

1. timeout fires
2. glib calls timeout callback (e.g. shutdown_callback) which in turn
calls shutdown_func (gobi shutdown_cb) which in turn calls
qmi_device_unref()
3. qmi_device_unref calls g_source_remove, which doesn't call the
destroy callback (it is blocked)
4. qmi_device_unref then frees the memory used by device
5. glib then calls the source destroy callback (e.g. shutdown_destroy)
which results in just freed memory being used.

glib appears to always call the destroy callback, even if the source has
been removed previously.  So to work around the issue, delay the actual
g_free until the destroy callback is invoked.
2017-05-11 14:41:43 -05:00
Denis Kenzior d9cb969dcf gprs: Don't use pri_set_apn for auto activated cids
There are two problems with using pri_set_apn.  The first issue is that
this function was built to be used by the set_property handler and
assumes the presence of a pending DBusMessage.

The second issue is that it touches the settings store.

In the case of auto-activated contexts no pending message exists.  Also,
we should not be touching the settings store as the APN might
potentially be a value that has not been provisioned.  Or in some cases
bogus.
2017-05-09 11:33:07 -05:00
Denis Kenzior 24f36da04d gprs: Return after releasing pri_ctx 2017-05-09 11:33:07 -05:00
Marcel Holtmann cb1ad7ff4f Release 1.20 2017-05-05 08:21:12 +02:00
Alexander Couzens eef98e7a3f plugins/gobi: add the qmi type to the debug output of discover_cb() 2017-05-04 12:39:02 -05:00
Alexander Couzens fe8fa75691 udevng/gobi: allow to detect ec20 tty devices
The Quectel EC20 uses the same usb id as some gobi 2000 modules (05c6:9215).
2017-05-04 12:38:58 -05:00
Alexander Couzens 3b5aedc8ab udevng/gobi: use subsystem as first identification
Using kernel 4.10 with systemd 232 on archlinux the detection of
a gobi 2000 doesn't detect the qmi/cdc-wdm interface.

The device is detected as follows:

[devnode interface number label sysattr subsystem]
/dev/cdc-wdm1 255/255/255 00 (null) (null) usbmisc
wwan1 255/255/255 00 (null) (null) net
/dev/ttyUSB5 255/255/255 01 (null) (null) tty
/dev/ttyUSB6 255/255/255 02 (null) (null) tty
/dev/ttyUSB7 255/255/255 03 (null) (null) tty
2017-05-04 12:37:51 -05:00
Alexander Couzens cab919d699 udevng/gobi: improve debug output
Add info->sysattr and info->subsystem to the log message.
2017-05-04 12:37:34 -05:00
Luiz Augusto von Dentz 27afa421cf handsfree-audio: Add Acquire implementation
This adds Acquire method which can be used by agents that require
pulling the fd directly instead of waiting a NewConnection.
2017-05-04 12:34:31 -05:00
Luiz Augusto von Dentz a192f22d3e doc/handsfree-audio-api: Add Acquire method
This adds Acquire method which can be used by agents that require
pulling the fd directly instead of waiting a NewConnection.

Note: sounds servers like PulseAudio do auto suspend streams when idle
for a certain amount of time and once anything happens it will resume
the stream, though this all happens in the so called IO thread in a
blocking fashion making it impossible to receive the fd via NewConnetion
causing the stream to fail to resume. There are other forms to work
around but this seems to be most convenient as we do want the auto
suspend feature to work properly but letting the stream to fail to
resume may create unexpected artifacts while the NewConnection is
handled in main thread.
2017-05-04 12:34:31 -05:00
Luiz Augusto von Dentz 94839129d9 hfp_hf_bluez5: Rework code handling device changes
This splits the handling of device changes and modem registration so
they can be uses separately.
2017-05-04 12:34:31 -05:00
Jonas Bonn f23ea6b45f qmimodem: set APN for LTE default bearer
Apparently, an empty APN in an ofono context means that that the context
cannot be activated.  connman definitely interprets it this way.

This patch sets a default name of "automatic" for the default bearer if
no other LTE APN is supplied (which is currently the case as the LTE
atom is not in place yet).  Without this, connman happily ignores the
context, even though it has been activated by ofono.
2017-05-04 11:00:24 -05:00
Jonas Bonn 4651a70285 qmi: activate default bearer context for LTE networks
When the modem attaches to an LTE network, a default bearer is
automatically negotiated using the "defalt profile" settings.  The
QMI modem, however, does not given any explicit indication that
the bearer exists; instead, we must assume its existence based on
the network registration state.

This patch extends the GPRS atom to signal the presence of a
default bearer when it detects network connectivity on an LTE
network.
2017-05-01 12:12:08 -05:00
Jonas Bonn 10854cb459 qmi: use named status values 2017-05-01 12:08:02 -05:00
Jonas Bonn ea7691f04b qmi: use shared services
Apparently it's not legal to create a QMI service multiple times for
a device.  I've been testing with a Quectel EC21 and here it works fine
to do so, but the general case would require "shared" services across
atoms.

This patch switches the users of the NAS and WDS services over to using
a "shared" service instead of each instatiating their own instance.
2017-05-01 12:07:41 -05:00