summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Convert to use separate SIM statusHEADreplicant-6.0-0004-rc4masterDenis 'GNUtoo' Carikli2021-01-0111-76/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-159-54/+54
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add missing stdio.h include for asprintfDenis 'GNUtoo' Carikli2020-08-274-0/+9
| | | | | | | | | | | | | | | | | | | | | | | Without that fix we have the following with clang and -Wimplicit-function-declaration when building with Guix: network.c:219:2: warning: implicit declaration of function 'asprintf' is invalid in C99 [-Wimplicit-function-declaration] asprintf(&registration[0], "%d", status); ^ The definition of _GNU_SOURCE is required to remove the warning, and it is also mentioned in the asprintf man in the SYNOPSIS: SYNOPSIS #define _GNU_SOURCE /* See feature_test_macros(7) */ #include <stdio.h> int asprintf(char **strp, const char *fmt, ...); [...] With that fix, libsamsung-ril still compiles fine without any warnings under Replicant 6.0. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* sim: ril_request_get_sim_status: remove unused variableDenis 'GNUtoo' Carikli2020-08-271-2/+0
| | | | | | | The card_status is not declared globally, so there is no point in re-requesting the data and doing nothing with it. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Wrap RIL_*_v6 to reduce ifdefsDenis 'GNUtoo' Carikli2020-08-275-136/+90
| | | | 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-279-54/+58
| | | | | | The former name of the function doesn't convey what it's supposed to do. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* network: ril2ipc_net_mode_sel function: cleanup ifdefsDenis 'GNUtoo' Carikli2020-08-271-5/+4
| | | | | | | | Since the whole content of the ril2ipc_net_mode_sel function is ifdefed, it makes more sense to wrap the whole function with ifdefs instead, in order to increase readability. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ss: ril_request_cancel_ussd: silence unused variable warningsDenis 'GNUtoo' Carikli2020-08-271-1/+3
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ss: remove unused state variableDenis 'GNUtoo' Carikli2020-08-271-1/+0
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* data: remove unused setup_data_call_response variableDenis 'GNUtoo' Carikli2020-08-271-1/+0
| | | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
* srs: include signal.hDenis 'GNUtoo' Carikli2020-08-071-0/+1
| | | | | | | | | | | | | | | | | | srs.c uses functions like signal and define like SIGPIPE, which come from the signal.h header from the C standard library. While for some reason this didn't create compilation issues in Replicant 6, compiling libsamsung-ril with Guix[1] fails because of that. References: ----------- [1]At the time of writing, the libsamsung-ril is not yet in Guix, however an unofficial package does exist, and is being worked on[2]. If srs.c is patched to include signal.h, that unofficial libsamsung-ril packages does compile successfully. [2]https://git.replicant.us/contrib/GNUtoo/guix/log/?h=libsamsung-ril Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* srs: reorder includesDenis 'GNUtoo' Carikli2020-08-071-7/+8
| | | | | | | | | | | | | | | | | | | - The includes were ordered alphabetically - #include "" is prefered over #incude <> for files relative to a given project[1] (here libsamsung-ril). References: ----------- [1]In the C standard[2], the difference of behavior of between #include <> and #include "" is implementation-defined[2]. And The GCC documentation[3] says that #include "" "is used for header files of your own program.". [2]The standard doesn't seem to be available for free, but the draft can be downloaded from the following URL: https://web.archive.org/web/20181230041359if_/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf [3]https://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Android.mk: remove hardcoded reference to external/libsamsung-ipcreplicant-6.0-0004-rc2Denis 'GNUtoo' Carikli2020-07-181-1/+0
| | | | | | | | | | | | | | | | libsamsung-ipc is already included as a dependency, and now the headers should be correctly exported with LOCAL_EXPORT_C_INCLUDE_DIRS since the following commit: d4e2afc Android.mk: remove deprecated LOCAL_COPY_HEADERS d4e2afc9735470c5b9553073a23e606b2fc5cf2c This change was tested at build time with the patch mentioned above and the following configurations: - Replicant 6.0 with the i9300 target - Replicant 4.2 with the galaxysmtd target Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Acked-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
* Adjust to libsamsung-ipc ipc_sec_lock_infomation_setup typo fixDenis 'GNUtoo' Carikli2020-07-061-4/+4
| | | | | | | | | | | | | | | | | | | | In libsamsung-ipc, ipc_sec_lock_infomation_setup was changed to ipc_sec_lock_information_setup as the former seems to be a typo. This change was made by the following libsamsung-ipc commit: 2a01d9f5af39e6cf093fc19fa1b2d7ba6849be06 2a01d9f Fix ipc_sec_lock_infomation_setup typo As IPC_GPRS_FAIL_CAUSE_UNKOWN_PDP_CONTEXT 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: hardware/replicant/libsamsung-ril/sim.c:395: error: undefined reference to 'ipc_sec_lock_infomation_setup' hardware/replicant/libsamsung-ril/sim.c:460: error: undefined reference to 'ipc_sec_lock_infomation_setup' Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Acked-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
* Adjust to libsamsung-ipc IPC_GPRS_FAIL_CAUSE_UNKOWN_PDP_CONTEXT typo fixDenis 'GNUtoo' Carikli2020-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | In libsamsung-ipc, IPC_GPRS_FAIL_CAUSE_UNKOWN_PDP_CONTEXT was changed to IPC_GPRS_FAIL_CAUSE_UNKNOWN_PDP_CONTEXT as the former seems to be a typo. This change was made by the following libsamsung-ipc commit: 82c1658cf5e3daac8aae73776235c4ca91d2f0e4 82c1658 Fix IPC_GPRS_FAIL_CAUSE_UNKOWN_PDP_CONTEXT typo As IPC_GPRS_FAIL_CAUSE_UNKOWN_PDP_CONTEXT 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/rfs.c hardware/replicant/libsamsung-ril/data.c: In function 'ipc2ril_gprs_fail_cause': hardware/replicant/libsamsung-ril/data.c:62:8: error: 'IPC_GPRS_FAIL_CAUSE_UNKOWN_PDP_CONTEXT' undeclared (first use in this function) case IPC_GPRS_FAIL_CAUSE_UNKOWN_PDP_CONTEXT: ^ Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Acked-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
* Adjust to libsamsung-ipc ipc_sec_lock_infomation_response_data typo fixDenis 'GNUtoo' Carikli2020-07-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | In libsamsung-ipc, ipc_sec_lock_infomation_response_data was changed to ipc_sec_lock_information_response_data as the former seems to be a typo. This change was made by the following libsamsung-ipc commit: cae58ae626f4dad678567e03dcfa247e05f69ddc cae58ae Fix ipc_sec_lock_infomation_response_data typo As ipc_sec_lock_infomation_response_data 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: hardware/replicant/libsamsung-ril/sim.c: In function 'ipc_sec_lock_infomation': hardware/replicant/libsamsung-ril/sim.c:1174:73: error: invalid application of 'sizeof' to incomplete type 'struct ipc_sec_lock_infomation_response_data' if (message == NULL || message->data == NULL || message->size < sizeof(struct ipc_sec_lock_infomation_response_data)) ^ Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Acked-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
* Adjust to libsamsung-ipc ipc_sec_lock_infomation_request_data typo fixDenis 'GNUtoo' Carikli2020-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | In libsamsung-ipc, ipc_sec_lock_infomation_request_data was changed to ipc_sec_lock_information_request_data as the former seems to be a typo. This change was made by the following libsamsung-ipc commit: b5c3a52dbabbb8a7bfda70b32378df68b83ce632 b5c3a52 Fix ipc_sec_lock_infomation_request_data typo As ipc_sec_lock_infomation_request_data 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: hardware/replicant/libsamsung-ril/sim.c: In function 'ipc_sec_callback': hardware/replicant/libsamsung-ril/sim.c:371:46: error: storage size of 'request_data' isn't known struct ipc_sec_lock_infomation_request_data request_data; Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Acked-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
* Adjust to libsamsung-ipc IPC_SEC_LOCK_INFOMATION typo fixDenis 'GNUtoo' Carikli2020-07-062-4/+4
| | | | | | | | | | | | | | | | | | | | 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>
* Fixed incorrect parsing of TLV datareplicant-6.0-0004-rc1Belgin ?tirbu2020-01-031-81/+1
| | | | | | | | | | | This problem prevented the SIM to be fully recognized and only incoming calls/messages worked. The issue is the code assumes tag 0x88 exists, and then assumes that the TLV right before it is the size tag. These two assumptions are sometimes wrong. The solution is to send the data as-is to the java RIL because it can also parse TLVs. Signed-off-by: Belgin Stirbu <belginstirbu@hotmail.com> Acked-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Fix undefined references to MD5_{Init,Update,Final}Denis 'GNUtoo' Carikli2019-07-241-2/+1
| | | | | | | | | | | | | | | | | | Before this change, libsamsung-ril was using libsamsung-ipc as a static library. However, libsamsung-ipc is dynamically linked to libcrypto. Statically linking libsamsung-ril to libsamsung-ipc results in the following errors, which disapear when using dynamic linking: rfs.c:50: error: undefined reference to 'MD5_Init' rfs.c:51: error: undefined reference to 'MD5_Update' rfs.c:52: error: undefined reference to 'MD5_Update' rfs.c:53: error: undefined reference to 'MD5_Final' Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Fix implicit declaration of ipv4NetmaskToPrefixLengthDenis 'GNUtoo' Carikli2019-07-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | Rationale for using extern: --------------------------- The ipv4NetmaskToPrefixLength function is implemnted in libnetutils/ifc_utils.c inside the android_system_core repository[1]. In the lineage-16.0 branch[2]: - ipv4NetmaskToPrefixLength is not declared in any headers in this repository. - In the same repository, libnetutils/dhcpclient.c uses extern for the declaration of ipv4NetmaskToPrefixLength. References: ----------- [1]https://github.com/LineageOS/android_system_core [2]At the time of writing it was at the following commit: e7f238619 healthd: make periodic battery status a debug message Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* client: Fix warning about array comparison to a null pointerDenis 'GNUtoo' Carikli2019-07-241-1/+1
| | | | | | | | | | | Without that fix we have: client.c:32:6: error: comparison of array 'ril_clients' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare] if (ril_clients == NULL || ril_clients_count == 0) ^~~~~~~~~~~ ~~~~ Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
* Silence warnings about unused parametersDenis 'GNUtoo' Carikli2019-07-248-38/+74
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Remove unused variablesDenis 'GNUtoo' Carikli2019-07-248-21/+2
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Remove unused labelsDenis 'GNUtoo' Carikli2019-06-185-11/+1
| | | | | 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-184-0/+517
| | | | | | | | | | | 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
* Add 00000 to the PLMN listWolfgang Wiedmeyer2019-06-181-0/+1
| | | | | | | | | | | Early during boot of the system, the modem answers with the string "00000" to the OPERATOR request. Samsung-RIL currently drops this response, while the proprietary RIL forwards it. Let's duplicate the behaviour of the proprietary RIL here. This seems to prevent that the RIL gets flooded with OPERATOR requests during system boot. Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
* network: Account for three-digit MNC codesWolfgang Wiedmeyer2019-06-181-1/+4
| | | | | | | Makes the OPERATOR request work in countries that use three-digit MNC codes. Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
* sms: Also check if RIL_REQUEST_SEND_SMS_EXPECT_MORE was already handledWolfgang Wiedmeyer2019-06-181-3/+4
| | | | | | This hopefully finally fixes sending of longer SMS messages. Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
* ipc_sec_pin_status: don't return too early if lockedWolfgang Wiedmeyer2019-06-181-1/+0
| | | | | | | | This fixes the issue when the PIN can't be entered successfully after it was entered incorrectly once. As a side-effect, the SIM lock screen shows much earlier. Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
* allow SIM_IO request also if the SIM is locked or absentWolfgang Wiedmeyer2019-06-181-2/+7
| | | | Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
* samsung-ril-socket: mic mute implementationWolfgang Wiedmeyer2019-06-186-0/+35
| | | | Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
* fix linker errorWolfgang Wiedmeyer2019-06-181-1/+1
| | | | Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
* network: Report emergency ability when not connectedPaul Kocialkowski2016-01-061-2/+2
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* client: RIL state update delegation, no client destroy, IPC client boot in openreplicant-4.2-0004replicant-4.2-0003Paul Kocialkowski2014-10-044-37/+42
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* 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-046-0/+194
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* misc: IMSI requires SIM ready statePaul Kocialkowski2014-08-201-1/+1
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* SamsungServiceMode can run in low power modePaul Kocialkowski2014-08-091-8/+0
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Samsung-RIL rewrite: harder, better, probably not faster but definitely strongerPaul Kocialkowski2014-08-0738-7772/+10318
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* RIL_LOG macro to log messagesreplicant-4.2-0002replicant-4.2-0001Paul Kocialkowski2013-12-2020-273/+279
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* misc: Complete NITZ reportPaul Kocialkowski2013-09-291-1/+1
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Send internal SMS to alert the user when an important crash just happenedPaul Kocialkowski2013-09-296-3/+208
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* misc: Check for IPC message type properlyPaul Kocialkowski2013-09-291-14/+16
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* Check modem state before RIL requests and properly report it on crashPaul Kocialkowski2013-09-2813-70/+198
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* sms: Write/delete SMS on SIM supportPaul Kocialkowski2013-09-013-0/+159
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* svc: Implement Samsung Service Mode OEM HookPaul Kocialkowski2013-08-254-0/+293
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* PLMN list updatePaul Kocialkowski2013-07-261-66/+123
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* ipc: Open client after power onPaul Kocialkowski2013-07-031-8/+8
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>