Commit Graph

2638 Commits

Author SHA1 Message Date
Jonas Bonn 3beeff758d treewide: Remove superfluous use of _GNU_SOURCE
There are a large number of files in the tree that define _GNU_SOURCE
despite not actually using features hidden behind this flag.  This patch
removes all these definitions in one fell swoop...
2018-10-17 10:01:57 -05:00
Nandini Rebello 4f0ba39cbe sms: support 8 national lang in Alphabet property
Adding support for 8 additional languages for GSM 7 bit.
2018-10-15 14:09:07 -05:00
Nandini Rebello d984a59f3d util: adding 8 national sms alphabets
Adding national language tables for hindi,kannada,malayalam,
oriya,punjabi,tamil,telugu and urdu.
2018-10-15 14:07:27 -05:00
Nandini Rebello 032aaef87d sms: fix a missing entry in single shift table
Fix a missing char in the nation language set in single shift table
for a special character. Character set again validated.
2018-10-11 10:15:49 -05:00
Giacinto Cifelli 597ab6683f common: Move proto and auth_method related helpers
the following functions:
	gprs_proto_to_string
	gprs_proto_from_string
	gprs_auth_method_to_string
	gprs_auth_method_from_string

are moved from gprs.c to common.c, with related declaration in common.h
so that they can also be accessed from lte core functions
2018-10-09 15:10:25 -05:00
Giacinto Cifelli cc79162470 gprs: support for NONE auth type 2018-10-09 10:43:01 -05:00
Nandini Rebello a2168cd136 sms: support bengali and gujrati in Alphabet property 2018-10-01 14:53:11 -05:00
Nandini Rebello 7e82a2d940 util: add bengali and gujrati sms alphabets 2018-10-01 14:52:03 -05:00
Anirudh Gargi 40f5916316 sms: allow sms send for EUTRAN sms only state
Patch to be considered, if support for EUTRAN SMS states accepted.

SMS registered flag while sending sms to consider the new EUTRAN
registered status also.
2018-10-01 14:43:23 -05:00
Anirudh Gargi 88358047c8 network: add support eutran sms only states
EUTRAN SMS states mapped to registered and roaming respectively.
2018-10-01 14:42:57 -05:00
Giacinto Cifelli f6d26de613 lte: add implementation for ofono_lte_get_modem 2018-09-24 15:52:02 -05:00
Giacinto Cifelli 0e733b8b05 lte: clarify failed registration message 2018-09-24 15:17:20 -05:00
Marcel Holtmann d37c22be20 build: Remove setup of thread support 2018-09-21 20:35:18 +02:00
Giacinto Cifelli 460040f427 gprs: make sure that the context is properly released 2018-09-20 11:05:06 -05:00
Giacinto Cifelli f11633f837 main: Remove call to g_thread_init
according to g_thread documentation, this call is no longer needed,
and starting from g_thread version 2.32 it must not be used
2018-09-20 10:39:55 -05:00
Giacinto Cifelli ce6c1087a2 gprs: Fix use of invalid operator for bitwise flags 2018-09-20 10:28:15 -05:00
Slava Monich 376af6c85c plugin: Don't unload external plugins too early
Plugins may reference data structures allocated by each other.
They all need to be deinitialized first, only then it should be
safe to unload the libraries.
2018-07-23 19:57:56 -05:00
Slava Monich 3c10ae7fb3 modem: Implement ofono_modem_get_voicecall 2018-07-02 10:34:25 -05:00
Slava Monich 0caaf32117 dbus: Add D-Bus mapping for OFONO_ERROR_TYPE_ERRNO 2018-06-28 11:35:10 -05:00
Slava Monich c87e6c20a4 emulator: Handle OFONO_ERROR_TYPE_ERRNO in switch 2018-06-28 11:35:10 -05:00
Slava Monich c35fb6b1a3 dbus: Make cme_errors_mapping static const 2018-06-28 10:52:39 -05:00
Slava Monich c292d771b7 voicecall: Implement ofono_voicecall_get_modem 2018-06-25 10:26:26 -05:00
Denis Kenzior d715486525 sim: Fix not updating sim pin state
In case we try to enter the PIN/PUK and fail to enter a correct code,
the PIN/PUK retries are not rechecked as they should be.

Reported by: Florent Beillonnet <florent.beillonnet@gmail.com>
2018-06-05 12:56:05 -05:00
Slava Monich ecc3f1bf73 ussd: Cancel pending requests when unregistering
And reset state to idle before unregistering the D-Bus interface.
This may occur e.g. when we receive REFRESH from STK.
2018-05-23 10:23:25 -05:00
James Prestwood 19e8d21a7e simutil: fix bug when parsing AID type 2018-05-03 17:43:31 -05:00
Slava Monich 3cb55b65cb modem: Implement ofono_modem_get_gprs 2018-04-27 11:13:23 -05:00
Slava Monich 0f171dac45 ussd: Don't ignore data from TERMINATED response
Typically responses to USSD requests are coming with status
zero (NOTIFY) but some are coming with status 2 (TERMINATED).
If those contain data, the data should be presented to the user.
2018-04-23 13:49:36 -05:00
Denis Kenzior 8b8a760644 simfs: Fix crash in sim_fs_op_free
If an operation is in progress and an operation is canceled, we don't
actually destroy it, but simply clear out the callback.  In the case of
a context being destroyed, the operation is left on the simfs op_q with
a dangling pointer to the already freed context.  So the current logic
in sim_fs_op_free tries to access invalid memory.

Fix this by performing the watch operations in sim_fs_end_current
instead and setting the context pointer appropriately.
2018-03-29 09:46:22 -05:00
Denis Kenzior a99c0be535 simfs: Fix crash
0  0x00007ffff7b20517 in g_queue_is_empty () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
1  0x00005555556adcdd in sim_fs_op_free (pointer=0x5555559cb990) at src/simfs.c:101
2  0x00007ffff7b205fc in g_queue_foreach () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
3  0x00007ffff7b2065b in g_queue_free_full () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
4  0x00005555556add81 in sim_fs_free (fs=0x5555559c0780) at src/simfs.c:125
5  0x00005555556828f3 in sim_remove (atom=0x5555559cb000) at src/sim.c:3175
6  0x000055555564f16f in flush_atoms (modem=0x555555a8fb00, new_state=MODEM_STATE_POWER_OFF) at src/modem.c:432
7  0x000055555564f3bd in modem_change_state (modem=0x555555a8fb00, new_state=MODEM_STATE_POWER_OFF)
    at src/modem.c:510
8  0x000055555564ff99 in set_powered (modem=0x555555a8fb00, powered=0) at src/modem.c:896
9  0x000055555565074c in modem_set_property (conn=0x55555596c8d0, msg=0x55555596e460, data=0x555555a8fb00)
    at src/modem.c:1120
2018-03-19 11:50:13 -05:00
Bassem Boubaker 4e908bfcf4 cdma-netreg: Fix emission of PropertyChanged 2018-03-16 10:24:57 -05:00
Denis Kenzior 158159ecb0 lte: update to the new API 2018-03-12 09:37:58 -05:00
Denis Kenzior dca9071ffe sim-auth: Improve pending cleanup on sim_auth_remove 2018-02-28 11:28:54 -06:00
Denis Kenzior d65a2fc377 sim: Do not leak aid_list
==31530== 366 (48 direct, 318 indirect) bytes in 3 blocks are definitely lost in loss record 165 of 186
==31530==    at 0x4C2BF8F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==31530==    by 0x50BB3A3: g_malloc (gmem.c:94)
==31530==    by 0x50D62B4: g_slice_alloc (gslice.c:1025)
==31530==    by 0x50D7A1E: g_slist_prepend (gslist.c:254)
==31530==    by 0x4DD0B3: sim_parse_app_template_entries (simutil.c:1590)
==31530==    by 0x4D2242: discover_apps_cb (sim.c:1509)
==31530==    by 0x45E364: at_discover_apps_cb (sim.c:1579)
==31530==    by 0x49CB5F: at_chat_finish_command (gatchat.c:459)
==31530==    by 0x49DAC7: at_chat_handle_command_response (gatchat.c:521)
==31530==    by 0x49DAC7: have_line (gatchat.c:600)
==31530==    by 0x49DAC7: new_bytes (gatchat.c:759)
==31530==    by 0x49FCEF: received_data (gatio.c:122)
==31530==    by 0x510C2F3: g_io_unix_dispatch (giounix.c:165)
==31530==    by 0x50B2D44: g_main_dispatch (gmain.c:3203)
2018-02-28 11:22:46 -06:00
Denis Kenzior dc59351de6 sim-auth: Do not leak nai
==31530== 88 bytes in 2 blocks are definitely lost in loss record 132 of 186
==31530==    at 0x4C2BF8F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==31530==    by 0x5847B97: vasprintf (in /lib64/libc-2.23.so)
==31530==    by 0x510AE38: g_vasprintf (gprintf.c:316)
==31530==    by 0x50D8BDF: g_strdup_vprintf (gstrfuncs.c:514)
==31530==    by 0x50D8CAA: g_strdup_printf (gstrfuncs.c:540)
==31530==    by 0x4F706B: build_nai (sim-auth.c:660)
==31530==    by 0x4F706B: sim_auth_register (sim-auth.c:738)
==31530==    by 0x4F706B: ofono_sim_auth_create (sim-auth.c:768)
==31530==    by 0x4ACBB4: modem_change_state (modem.c:525)
==31530==    by 0x4AD0CD: sim_state_watch.part.5 (modem.c:720)
==31530==    by 0x4CF6D0: call_state_watches (sim.c:366)
==31530==    by 0x4CF6D0: sim_set_ready (sim.c:1475)
==31530==    by 0x4CF6D0: sim_imsi_obtained (sim.c:1577)
==31530==    by 0x45D868: at_cimi_cb (sim.c:453)
==31530==    by 0x49CB5F: at_chat_finish_command (gatchat.c:459)
==31530==    by 0x49DAC7: at_chat_handle_command_response (gatchat.c:521)
==31530==    by 0x49DAC7: have_line (gatchat.c:600)
==31530==    by 0x49DAC7: new_bytes (gatchat.c:759)
2018-02-28 11:21:45 -06:00
Denis Kenzior 134b163182 simutil: Add sim_app_record free 2018-02-28 11:08:16 -06:00
Denis Kenzior 984d88492d sim: Fix crash
aid_sessions was not properly reset to NULL when freed:

Program received signal SIGSEGV, Segmentation fault.
__ofono_watchlist_free (watchlist=0x0) at src/watch.c:91
91		for (l = watchlist->items; l; l = l->next) {
(gdb) bt
    func=0x4ceca0 <aid_session_free>, user_data=0x0)
    at /var/tmp/portage/dev-libs/glib-2.50.3-r1/work/glib-2.50.3/glib/gslist.c:878
    free_func=0x4ceca0 <aid_session_free>)
    at /var/tmp/portage/dev-libs/glib-2.50.3-r1/work/glib-2.50.3/glib/gslist.c:172
    at src/sim.c:2605
    user_data=<optimized out>) at plugins/phonesim.c:511
    func=0x49c8a0 <at_notify_call_callback>, user_data=0x7fffffffdbc0)
    at /var/tmp/portage/dev-libs/glib-2.50.3-r1/work/glib-2.50.3/glib/gslist.c:878
    chat=0x7b70b0) at gatchat/gatchat.c:417
2018-02-28 10:44:26 -06:00
Slava Monich b5ad34faab phonebook: Fixed double deletion of merge_list 2018-02-22 09:48:23 -06:00
Christophe Ronco 895ca91d85 modem: Add SystemPath dbus property 2018-02-20 11:09:11 -06:00
Philippe De Swert 2de1aff6bd voicecall: Add memory location dialing
Implement functionality to allow to  dial favourites/quick contacts over
bluetooth.
2018-02-13 13:05:53 -06:00
Philippe De Swert 08ac5a6e5b voicecall: Rename hfp dialing functions
Calling from memory index is very similar in functionality to dialing
the last called number. So we rename the functions so we can reuse them,
to deal with memory index calling. Function names now also reflect this
is for hfp.
2018-02-13 13:00:39 -06:00
Denis Kenzior 0e8e7346af simutil: Fix copiler warning
src/simutil.c:1573:3: warning: dereferencing type-punned pointer will break
strict-aliasing rules [-Wstrict-aliasing]
	app.type = GUINT16_FROM_BE(*((unsigned short *)(app.aid + 5)));
2018-01-19 14:12:37 -06:00
Slava Monich 0797b23c5d dbus: Use dbus_validate_path
Instead of __ofono_dbus_valid_object_path
2018-01-18 10:53:28 -06:00
Slava Monich 72758ef34b sim: Don't submit parallel EFpl reads
In addition to not doing unnecessary SIM I/O, this fixes memory leaks
like this one:

==10096== 74 (56 direct, 18 indirect) bytes in 2 blocks are definitely lost in loss record 1,252 of 1,342
==10096==    at 0x4841BF0: calloc (vg_replace_malloc.c)
==10096==    by 0x4B03117: g_malloc0 (gmem.c)
==10096==    by 0xF83DF: concat_lang_prefs (sim.c)
==10096==    by 0xF8697: sim_efpl_read_cb (sim.c)
==10096==    by 0x12CBF7: sim_fs_op_read_block_cb (simfs.c)
2017-12-08 10:23:35 -06:00
Philippe De Swert 5c0ec25353 voicecall: Fix issue with invalid dbus path
Fix an error message from dbus about the path supplied not being valid.
Related to commit f58e7685b0

ofonod[19107]: src/voicecall.c:voicecall_dial_shortcut() check position
ofonod[19107]: src/voicecall.c:synthesize_outgoing_call() Registering new call: 1
process 19107: arguments to dbus_message_iter_append_basic() were incorrect, assertion "_dbus_check_is_valid_path (*string_p)" failed in file ../../../dbus/dbus-message.c line 2759.
This is normally a bug in some application using the D-Bus library.
2017-12-08 08:26:35 -06:00
Alexander Couzens 19218065a2 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-12-05 22:06:44 -06:00
Slava Monich 94c1975801 sim-auth: Avoid using dbus_message_iter_get_element_count
It's the only thing in ofono that requires dbus 1.9.16 or later and it's
not worth it.

And don't leak DBusMessage on format error.
2017-11-27 10:08:16 -06:00
Slava Monich 399cb61d1f storage: Implement ofono_config_dir and ofono_storage_dir 2017-11-27 09:59:21 -06:00
Denis Kenzior f8d6a0a668 gprs: Add implementation of set_ipv4_prefix_length 2017-11-13 21:24:37 -06:00
Denis Kenzior 97e39299d0 gprs: Set Attached if no .read_settings
Some protocols (like MBIM) do not properly support default bearer
semantics.  Instead they want everything to function like UMTS/GSM where
the context has to be explicitly attached / activated.
2017-11-13 21:24:37 -06:00
James Prestwood d025f2c8b5 simauth: remove driver code from core simauth atom 2017-11-09 11:55:42 -06:00