summaryrefslogtreecommitdiffstats
path: root/samsung-ril.c
Commit message (Collapse)AuthorAgeFilesLines
* Make libsamsung-ril print at startupDenis 'GNUtoo' Carikli2021-02-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | If we are in a situation where there are no prints from libsamsung-ril at all with 'logcat -b radio', having it print a log in all situations helps debugging why this could be hapenning. This way even if there is nothing in the logs, we at least know it was supposed to print a message at startup. This already happened with Android 11, where before the commit 34fdca14f7fb1623f733b64954c781b7dcf520f5 ("Fix logging on Android 11") we had nothing in the logs. Knowing that it should print something already takes out of the equasion silent failures without having to read lot of code or make error prone jugements. It is also more reliable than having to go through all the error paths like it is done with the commit daa706393f381002205e35ebaaa42a586ad91e52 ("RIL_Init: Make sure there are prints for each error paths"). Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* RIL_Init: Make sure there are prints for each error pathsDenis 'GNUtoo' Carikli2021-02-281-5/+25
| | | | | | | | If libsamsung-ril didn't start (for instance due to issues or because we are porting it to a newer Android version) it is useful to know why. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* samsung-ril.c: break lines over 80 charactersDenis 'GNUtoo' Carikli2021-02-281-36/+75
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Convert to use separate SIM statusreplicant-6.0-0004-rc4Denis 'GNUtoo' Carikli2021-01-011-6/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 2001, in the RIL repository[1], the SIM states were separated from the radio states by the following commit: 2bc78d614e349574426d198c37e51ccb7455b5bb 2bc78d61 Separate SIM states from Radio States Then in 2016 the SIM states were removed from the RADIO_STATES by the following commit: 2baf72329c43d9e3f7850973f087176f535e31e8 2baf7232 Remove deprecated RADIO_STATES So to be compatible with recent rild, we need to convert the code to use separate SIM states. This was tested on Replicant 4.2 with a Galaxy SIII (GT-I9300) and a Nexus S (GT-I9023) and in both cases: - It compiled fine - Calling worked fine too: I called an invalid number I got an automatic voice reply telling me that this number was invalid. Similarly that was also tested on Replicant 6.0 0004 RC3 both by compiling it and calling an invalid number, as this commit was part of the Replicant 6.0 0004 RC3 release. Since then only the commit message was modified to add information about the tests as it didn't have them but had the following text instead: TODO: - Test this code with Replicant 4.2!!!! [1]https://android.googlesource.com/platform/hardware/ril Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* rename ril_has_reached_state to ril_radio_has_reached_stateDenis 'GNUtoo' Carikli2020-10-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | In 2001, in the RIL repository[1], the SIM states were separated from the radio states by the following commit: 2bc78d614e349574426d198c37e51ccb7455b5bb 2bc78d61 Separate SIM states from Radio States Then in 2016 the SIM states were removed from the RADIO_STATES by the following commit: 2baf72329c43d9e3f7850973f087176f535e31e8 2baf7232 Remove deprecated RADIO_STATES So to be compatible with recent rild, we need to convert the code to use separate SIM states. As at first a ril_sim_has_reached_state function will be introduced, we can rename ril_has_reached_state to ril_radio_has_reached_state in a separate patch (this patch) in order not to have too much changes at once in the same patch. [1]https://android.googlesource.com/platform/hardware/ril Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Wrap RIL_*_v6 to reduce ifdefsDenis 'GNUtoo' Carikli2020-08-271-25/+11
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ril_has_reached_state: use more meaningful variable namesDenis 'GNUtoo' Carikli2020-08-271-11/+16
| | | | | | | | | | | | As the code in this function loops over the radio_states array to match with RIL_RadioState argument, it is better to have variables names that indicate if they comes from the function argument or the radio_states array, instead of using generic names. This improves clarity by requiring less context for humans to read and understand that function. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ril_radio_state_check: rename it to ril_has_reached_state to improve clarityDenis 'GNUtoo' Carikli2020-08-271-2/+6
| | | | | | The former name of the function doesn't convey what it's supposed to do. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Adjust to libsamsung-ipc IPC_SEC_LOCK_INFOMATION typo fixDenis 'GNUtoo' Carikli2020-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | In libsamsung-ipc, IPC_SEC_LOCK_INFOMATION was changed to IPC_SEC_LOCK_INFORMATION as the former seems to be a typo. This change was made by the following libsamsung-ipc commit: 8bd15e4e5bae4ffd6a164e7db719ebb308a9db60 8bd15e4 Fix IPC_SEC_LOCK_INFOMATION typo As IPC_SEC_LOCK_INFOMATION was used in libsamsung-ril too, we need to do the change here too, as otherwise we will end with compilation errors like that while compiling Replicant 6.0: target thumb C: libsamsung-ril <= hardware/replicant/libsamsung-ril/samsung-ril.c hardware/replicant/libsamsung-ril/samsung-ril.c:124:14: error: 'IPC_SEC_LOCK_INFOMATION' undeclared here (not in a function) .command = IPC_SEC_LOCK_INFOMATION, Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Acked-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
* Silence warnings about unused parametersDenis 'GNUtoo' Carikli2019-07-241-3/+4
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Remove unused variablesDenis 'GNUtoo' Carikli2019-07-241-4/+0
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Remove unused labelsDenis 'GNUtoo' Carikli2019-06-181-4/+0
| | | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
* Add support for USSD messagesWolfgang Wiedmeyer2019-06-181-0/+14
| | | | | | | | | | | The implementation is based on the code for USSD support that was used before the rewrite of Samsung-RIL. USSD messages in GSM7 format are decoded to UTF8. The decoding code was adapted from huaweigeneric-ril[1]. Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> [1] https://github.com/DerArtem/huaweigeneric-ril
* samsung-ril-socket: mic mute implementationWolfgang Wiedmeyer2019-06-181-0/+4
| | | | Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
* RIL client open retry at RIL initPaul Kocialkowski2014-10-041-1/+11
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* samsung-ril-socket: SRS test messages implementationPaul Kocialkowski2014-10-041-0/+4
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Samsung-RIL rewrite: harder, better, probably not faster but definitely strongerPaul Kocialkowski2014-08-071-558/+1254
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* RIL_LOG macro to log messagesreplicant-4.2-0002replicant-4.2-0001Paul Kocialkowski2013-12-201-17/+17
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Check modem state before RIL requests and properly report it on crashPaul Kocialkowski2013-09-281-7/+48
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* sms: Write/delete SMS on SIM supportPaul Kocialkowski2013-09-011-0/+12
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* svc: Implement Samsung Service Mode OEM HookPaul Kocialkowski2013-08-251-0/+8
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Remove TODO listPaul Kocialkowski2013-03-311-8/+0
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Update copyright informationPaul Kocialkowski2013-03-311-2/+1
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Coding style: add spaces after switch statementsPaul Kocialkowski2013-03-311-4/+4
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Define and use RIL_TOKEN_NULLPaul Kocialkowski2013-03-311-1/+1
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Rename samsung-ril to Samsung-RIL, refactor Android.mk and comments stylePaul Kocialkowski2013-03-301-12/+12
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* pwr: Handle phone reset messagePaul Kocialkowski2013-03-071-0/+3
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* pwr: Wait for IPC_PWR_PHONE_PWR_UP to complete startupPaul Kocialkowski2013-03-061-0/+4
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* sec: Handle various SIM I/O message formats based on SIM ICC typePaul Kocialkowski2013-02-091-0/+9
| | | | | | Also make request id registration override older requests. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Change coding style: add a space after if, for and whilePaul Kocialkowski2013-02-091-35/+35
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* compat: Removed separate header: apply per-version changes in the codePaul Kocialkowski2013-02-091-1/+10
| | | | | | | | This is especially relevant when the elements of the structures changed or need a different handling in the code: that way, we don't confuse which structure is declared. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* SAT: Rename STK functions, disable STK by defaultPaul Kocialkowski2012-12-151-4/+11
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Copyright: Corrected email addressPaul Kocialkowski2012-11-191-1/+1
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* TODO: Removed implemented GPRS functionsPaul Kocialkowski2012-11-121-7/+0
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* SRS: Rework to handle multiple clients in a better wayPaul Kocialkowski2012-11-051-2/+2
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Updated copyright informationPaul Kocialkowski2012-11-041-1/+1
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* SMS: Use lists stored in ril_data instead of global tablePaul Kocialkowski2012-11-041-5/+0
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* SMS: Use lists stored in ril_data instead of global tpid tablePaul Kocialkowski2012-11-011-1/+0
| | | | | | Some strutures were also renamed to Stick to libsamsung-ipc changes Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* GPRS: Use lists stored in ril_data instead of global tablePaul Kocialkowski2012-11-011-2/+1
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* GEN: Use lists stored in ril_data instead of global tablePaul Kocialkowski2012-11-011-1/+0
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Reworked RIL requests, globals, SIM status, clientPaul Kocialkowski2012-11-011-166/+268
| | | | | | | | | | | * Handling ril requests with lists * Renamed functions to complete requests * Globals (most of them) are held in ril_data * Renamed SIM_Status to ril_sim_state * Renamed client object to data * Moved client funcs to a sub-structure Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Stick to the latest libsamsung-ipc changesPaul Kocialkowski2012-09-061-2/+2
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Rework SRS to support multiple clientsAlexander Tarasikov2012-08-271-2/+2
| | | | | | This fixes deadlocks on Galaxy Nexus (Tuna) when GPS/NFC libraries open the socket thus preventing in-call audio from functioning
* Synchronize ril and ipc notificationsAlexander Tarasikov2012-08-261-2/+24
| | | | | This fixes RSSI status and probably some other concurrency issues
* Merge remote-tracking branch 'ksys/master' into replicant-mergeAlexander Tarasikov2012-08-241-1/+1
|\ | | | | | | | | | | Conflicts: gprs.c net.c
| * Add the compat.h header to multiple Android treesAlexander Tarasikov2012-08-231-1/+1
| |
| * Hack RIL_VERSION to make voice calls work on jellybeanAlexander Tarasikov2012-07-251-1/+1
| |
* | GPRS: Improved stability with status, fail cause and per-cid handlingPaul Kocialkowski2012-07-081-3/+16
| | | | | | | | | | | | | | | | | | | | * GPRS call status handling (state and fail cause) * Last call fail cause reporting * Data call list reporting * Take GPRS call status in account before reporting connection change * Per-cid GPRS connection handling Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* | Call: Added last call fail cause supportPaul Kocialkowski2012-07-061-0/+3
|/ | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Updated ToDo listPaulK2012-04-031-3/+1
|