Commit Graph

2583 Commits

Author SHA1 Message Date
Alexander Couzens 828eec5e97 call-list: fix a race condition in ofono_call_list_dial_callback
If ofono_call_list_dial_callback is called later than
ofono_call_list_notify, the new call is added, removed, added
again.
2017-10-17 12:01:03 +02:00
Alexander Couzens 46f5c19f31 network: allow drivers to generate more specific error codes
For certain modems it's not clear if they support all actions or not.
In such cases use CME errors which allows generate NotSupported
messages.
2017-10-10 14:56:20 +02:00
Alexander Couzens 1056147002 Merge sysmocom/lynxis/master into sysmocom/osmo-gsm-tester
Conflicts: plugins/gobi.c
2017-10-02 08:51:51 +02:00
Alexander Couzens 3d66046ab7 call gprs_detached_notify 2017-09-12 13:08:33 +02:00
Alexander Couzens cac718f045 network: debug output the network time if updated 2017-09-12 13:08:32 +02:00
Alexander Couzens b8c75e11e1 network/ofono_netreg_status_notify: debug output lac and ci
The location are code and cell id is updated at the same time.
2017-09-12 13:08:32 +02:00
Alexander Couzens 12983c0464 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-09-12 13:08:32 +02:00
Alexander Couzens a2e9a50db3 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-09-12 13:08:32 +02:00
Alexander Couzens 7e3e504d3c 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-09-12 13:08:26 +02:00
Alexander Couzens 2089bc23c7 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-09-12 11:53:07 +02:00
Alexander Couzens 0982b4c4e8 common: create GList helper ofono_call_compare
replaces at_util_call_compare (atmodem) and
call_compare (rild).
2017-09-12 11:53:07 +02:00
Alexander Couzens e98f683309 network.c: notify_status_watches: check for NULL
In rare cases when ofono_netreg_status_notify() is called before
ofono_netreg_register() netreg->status_watches is NULL.
2017-09-11 10:39:17 -05:00
Denis Kenzior 25db45daaa netmonagent: Fix typo 2017-09-09 10:21:20 -05:00
Nishanth V bcc37ad77f netmon: core changes for network monitor agent
Added implementation for RegisterAgent and UnregisterAgent in
NetworkMonitor interface and added netmonagent source file for agent
implemention.
2017-09-08 15:06:10 -05:00
Alexander Couzens 8e6ac330a5 voicecall: use ofono_call_status_name in DBG messages
status names are more readable then integer values.
2017-09-07 17:29:46 -05:00
Alexander Couzens 9b16b2c23c voicecall,common: move call_status_to_string() to common
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-09-07 17:29:42 -05:00
Alexander Couzens d08a6043a3 gprs: use registration_status_to_string in debug messages 2017-09-07 16:50:51 -05:00
Alexander Couzens 7d27ccea5e common: move strlen(apn) check into is_valid_apn() 2017-09-05 10:41:05 -05:00
Slava Monich d9b2dbbd0b sms: Pass const pointer to dispatch_app_datagram 2017-08-21 11:36:32 -05:00
Slava Monich 980bb705d1 ussd: Switch the state from USER_ACTION to IDLE
... when a USSD notification is received. Some networks
send 0 (no further user action required) after the response
timeout expires. That should result in the user input form
getting removed from the ME screen.
2017-08-07 14:50:57 -05:00
Alexander Couzens 91ae213665 NOT-FOR-UPSTREAM: ofono.service.in: enable debug output 2017-08-01 12:51:22 +02:00
Alexander Couzens 1ff5e1ba91 NOT-FOR-UPSTREAM: ofono.serivce.in: add quad_modem_power_cycle + Restart=always 2017-08-01 12:49:23 +02:00
Alexander Couzens 80a6e46741 Merge branch 'for-sysmocom' into osmo-gsm-tester
- voice call
- ussd
- smaller fixes of ofono
2017-08-01 12:33:17 +02:00
Alexander Couzens 97f59ff76d network: debug output the network time if updated 2017-08-01 12:18:51 +02:00
Alexander Couzens 39cb87b146 network/ofono_netreg_status_notify: debug output lac and ci
The location are code and cell id is updated at the same time.
2017-08-01 12:18:51 +02:00
Alexander Couzens 2f74e7fc15 Merge remote-tracking branch 'origin/master' into osmo-gsm-tester 2017-08-01 12:17:25 +02:00
Alexander Couzens b5f179b40a 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-25 15:40:43 +02:00
Alexander Couzens e84ccdf99d 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-25 15:40:37 +02:00
Alexander Couzens 668c7d7e41 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-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
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
John Ernberg 8ad77d5e10 radio-settings: Fix typo in radio_band_umts_from_string 2017-06-29 09:11:11 -05: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
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 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
Alexander Couzens e2f5648b22 gprs/pri_set_apn: only call dbus function when msg is given
Otherwise dbus is trying to operate on a null-pointer resulting in an abort()
2017-05-05 15:31:30 +02:00
Alexander Couzens ec99b35581 move strlen(apn) > OFONO_GPRS_MAX_APN_LENGTH into is_valid_apn() 2017-05-05 15:31:20 +02: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
Jonas Bonn 526b30b7ec ofono: add missing header inclusions
This is a "leaf" header and doesn't even have header guards, but
it still seems natural that the header should pull in its own declarations
rather than relying on the including source file to ensure that they
are included.
2017-04-18 09:47:42 -05:00
Jonas Bonn 0167c3339c gprs: set driver_attached when activating automatic contexts
The ofono_gprs_cid_activated attachment machinery cannot go through
ofono_gprs_status_notify for getting the attached property set because
that would result in the automatic contexts that were just set up
being released.  As such, it needs to call gprs_set_attached_property
manually.  Doing so, however, means that the driver_attached property
never gets set, resulting in all contexts being released when the
network transitions between registered states (roaming/non-roaming).
2017-04-14 17:43:13 -05:00
Jonas Bonn 1fd419e5b4 gprs: _cid_activated is an 'attaching' state
ofono_gprs_status_notify is an asynchronous notification that messes
with the 'attached' state of the GPRS atom.  This method is normally
prevented from running while an attach is in progress because the
attachment machinery wants to finish up and make it's own determination
of attach state.

When automatic context activation is relevant, as for LTE networks,
the ofono_gprs_cid_activated machinery replaces the usual set_attach
machinery for attaching to the network.  The cid_activated variant,
however, does not guard against simulatenous invocations of
ofono_gprs_status_notify.  This causes a race whereby status_notify
sets the state to 'attached' before the context is fully constructed
and set to active.  If the connection manager sees the 'attached'
state before there are any 'active' contexts, it may decide to
activate a context manually which is not the correct behaviour for
this type of network.

This patch makes the *_cid_activated machinery an 'attaching' state,
introducing the same guards that set_attached has to prevent
ofono_gprs_status_notify from running concurrently.
2017-04-14 17:28:46 -05:00
Jonas Bonn a722cef201 modem: set_online is valid for AlwaysOnline modems
Calling set_online(TRUE) for an AlwaysOnline modem should succeed; the
modem is, after all, in the requested state when the call returns.
Returning not_implemented is not necessarily wrong, but it's a bit ugly.
2017-04-03 09:23:53 -05:00
Christophe Ronco d43e48ae73 gprs: fix error check of gprs_cid_alloc function
When there is no context id available, idmap_alloc and
gprs_cid_alloc return max + 1.
2017-02-15 14:39:36 -06:00
Christophe Ronco c5fbfaa55f sim: backup driver read_imsi by IMSI via EF read
If read_imsi driver function fails, try to obtain IMSI via EF read
2017-01-09 12:25:00 -06:00
Slava Monich aaf70beb06 sim: Stop facility lock query sequence on removal
SIM card can be removed while the query is in progress. There's
still a remote possibility that SIM card is removed and inserted
back while the query is pending, that would start the second query
sequence and end up invoking sim_initialize() twice. But at least
these checks reduce the probability of something like that happening.
2017-01-06 12:25:48 -06:00