summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* srs-client: srs_client_send: do more precise lockingHEADreplicant-11-nlnet-eu-grant-825310-replicant-updatereplicant-6.0mastermainDenis 'GNUtoo' Carikli2022-08-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | The following code: memset(&message, 0, sizeof(message)); message.command = command; message.data = data; message.size = size; srs_header_setup(&header, &message); length = header.length; buffer = calloc(1, length); memcpy(buffer, &header, sizeof(header)); if (message.data != NULL && message.size > 0) { p = (unsigned char *) buffer + sizeof(header); memcpy(p, message.data, message.size); } doesn't depend on shared data structures, so it doesn't need to be guarded by a mutex. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* srs: srs_client_send: do more precise lockingDenis 'GNUtoo' Carikli2022-08-311-1/+2
| | | | | | | | | | | | | | | | | | The following code: srs_header_setup(&header, message); length = header.length; buffer = calloc(1, length); memcpy(buffer, &header, sizeof(header)); if (message->data != NULL && message->size > 0) { p = (unsigned char *) buffer + sizeof(header); memcpy(p, message->data, message->size); } doesn't depend on shared data structures, so it doesn't need to be guarded by a mutex. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* guix.scm: libsamsung-ril: fix "Unbound variable: %build-inputs"Denis 'GNUtoo' Carikli2022-08-311-21/+22
| | | | | | | | Without that fix, we have the following build error: ERROR: In procedure %resolve-variable: Unbound variable: %build-inputs Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* guix.scm: libsamsung-ril: fix upack-coreDenis 'GNUtoo' Carikli2022-08-311-4/+2
| | | | | | | | | | | | | | | | | | | | | Without that fix we have the following error that make the build fail: [...] phase `unpack' succeeded after 0.1 seconds starting phase `unpack-core' tar: /gnu/store/[...]-android-platform-system-core-7.1.2_r36-checkout: Cannot read: Is a directory tar: At beginning of tape, quitting now tar: Error is not recoverable: exiting now [...] This is probably because for some reasons there is no more tarball of it being made, so we have to copy the data instead of extracting it. In guix a similar fix was made in commit e227b0820a93c4a264a169895948d6d2c0c37005 ("gnu: android-ext4-utils: Fix build."). Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* guix.scm: replicant-6-libhardware_legacy: fix upack-coreDenis 'GNUtoo' Carikli2022-08-311-6/+4
| | | | | | | | | | | | | | | | | | | | | Without that fix we have the following error that make the build fail: [...] phase `unpack' succeeded after 0.1 seconds starting phase `unpack-core' tar: /gnu/store/[...]-android-platform-system-core-7.1.2_r36-checkout: Cannot read: Is a directory tar: At beginning of tape, quitting now tar: Error is not recoverable: exiting now [...] This is probably because for some reasons there is no more tarball of it being made, so we have to copy the data instead of extracting it. In guix a similar fix was made in commit e227b0820a93c4a264a169895948d6d2c0c37005 ("gnu: android-ext4-utils: Fix build."). Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Android.mk: Add support for Android 11replicant-6.0-0004-transitionreplicant-6.0-0004-rc6replicant-6.0-0004-rc5-transitionreplicant-6.0-0004-rc5replicant-6.0-0004Denis 'GNUtoo' Carikli2021-02-282-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we configure Replicant 11, libsamsung-ipc and libsamsung-ril to have both libraries in /system/lib/, tools work fine on the Galaxy SIII (GT-I9300): # find -name libsamsung-ril.so 2>/dev/null ./system/lib/libsamsung-ril.so # find -name libsamsung-ipc.so 2>/dev/null ./system/lib/libsamsung-ipc.so # find -name nv_data-md5 2>/dev/null ./system/bin/nv_data-md5 # nv_data-md5 Usage: nv_data-md5 [nv_data.bin] And libsamsung-ril tries to load libsamsung-ipc from the right location in /system/lib/, but it fails due to the vendor and system separation: 01-14 15:50:57.739 1475 1475 E RILD : dlopen failed: dlopen failed: library "/system/lib/libsamsung-ril.so" needed or dlopened by "/system/vendor/bin/hw/rild" is not accessible for the namespace "(default)" Adding LOCAL_PROPRIETARY_MODULE fixes that. Note that the name of that property can be misleading here: libsamsung-ril is free software and shall remain free software. Instead we need to understand LOCAL_PROPRIETARY_MODULE as a way to tell the Android build system that libsamsung-ril is not part of the base Android code but instead that it is code that is specific to a device, set of devices and/or Android distribution. LOCAL_MODULE_RELATIVE_PATH cannot be used instead: even if the binaies end up in /vendor/bin/hw/, and that the libraries ends up in /vendor/lib/hw/, for some reasons the libraries can't be found: i9300:/ # /system/vendor/bin/hw/nv_data-md5 CANNOT LINK EXECUTABLE "/system/vendor/bin/hw/nv_data-md5": library "libsamsung-ipc.so" not found: needed by main executable And most importantly, rild has the same issue than before: E RILD : dlopen failed: dlopen failed: library "libsamsung-ipc.so" not found: needed by /system/vendor/lib/hw/libsamsung-ril.so in namespace (default) Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* utils: eventfd_recv: report errorsDenis 'GNUtoo' Carikli2021-02-281-1/+6
| | | | | | | | | | | | | | | | | | | | | | | This enables to distinguish different kind of loop failures. The loop handler comes directly from libsamsung-ipc device drivers, which in turn wrap the vendor kernel interfaces. Given that there is some possible variation between the way that the .loop implementations behaves, it's a good idea to add prints to understand better what is going on in case of issues. With the development of a new set of kernel drivers and libsamsung-ipc device driver for Replicant 11, we had a situation where that code was triggered. Note that, at the time of writing, we are not (yet) aware of any behavior difference with the different .loop implementations, but it would be worth checking if they all behave in the same way. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ipc: ipc_rfs_loop: Complete loggingDenis 'GNUtoo' Carikli2021-02-281-1/+11
| | | | | | | | | | | | | | | | | | | | | | | This enables to distinguish different kind of loop failures. The loop handler comes directly from libsamsung-ipc device drivers, which in turn wrap the vendor kernel interfaces. Given that there is some possible variation between the way that the .loop implementations behaves, it's a good idea to add prints to understand better what is going on in case of issues. With the development of a new set of kernel drivers and libsamsung-ipc device driver for Replicant 11, we had a situation where that code was triggered. Note that, at the time of writing, we are not (yet) aware of any behavior difference with the different .loop implementations, but it would be worth checking if they all behave in the same way. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ipc: ipc_fmt_loop: Complete loggingDenis 'GNUtoo' Carikli2021-02-281-1/+11
| | | | | | | | | | | | | | | | | | | | | | | This enables to distinguish different kind of loop failures. The loop handler comes directly from libsamsung-ipc device drivers, which in turn wrap the vendor kernel interfaces. Given that there is some possible variation between the way that the .loop implementations behaves, it's a good idea to add prints to understand better what is going on in case of issues. With the development of a new set of kernel drivers and libsamsung-ipc device driver for Replicant 11, we had a situation where that code was triggered. Note that, at the time of writing, we are not (yet) aware of any behavior difference with the different .loop implementations, but it would be worth checking if they all behave in the same way. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ipc: ipc_rfs_loop: be more verbose about loop failuresDenis 'GNUtoo' Carikli2021-02-281-2/+12
| | | | | | | | | | | | | | | | | | | | | | | This enables to distinguish different kind of loop failures. The loop handler comes directly from libsamsung-ipc device drivers, which in turn wrap the vendor kernel interfaces. Given that there is some possible variation between the way that the .loop implementations behaves, it's a good idea to add prints to understand better what is going on in case of issues. With the development of a new set of kernel drivers and libsamsung-ipc device driver for Replicant 11, we had a situation where that code was triggered. Note that, at the time of writing, we are not (yet) aware of any behavior difference with the different .loop implementations, but it would be worth checking if they all behave in the same way. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ipc: ipc_fmt_loop: be more verbose about loop failuresDenis 'GNUtoo' Carikli2021-02-281-2/+12
| | | | | | | | | | | | | | | | | | | | | | | This enables to distinguish different kind of loop failures. The loop handler comes directly from libsamsung-ipc device drivers, which in turn wrap the vendor kernel interfaces. Given that there is some possible variation between the way that the .loop implementations behaves, it's a good idea to add prints to understand better what is going on in case of issues. With the development of a new set of kernel drivers and libsamsung-ipc device driver for Replicant 11, we had a situation where that code was triggered. Note that, at the time of writing, we are not (yet) aware of any behavior difference with the different .loop implementations, but it would be worth checking if they all behave in the same way. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* client: be more verbose about loop failuresDenis 'GNUtoo' Carikli2021-02-281-1/+2
| | | | | | | | | | | | | | | | | | | | | The loop handler comes directly from libsamsung-ipc device drivers, which in turn wrap the vendor kernel interfaces. Given that there is some possible variation between the way that the .loop implementations behaves, it's a good idea to add prints to understand better what is going on in case of issues. With the development of a new set of kernel drivers and libsamsung-ipc device driver for Replicant 11, we had a situation where that code was triggered. Note that, at the time of writing, we are not (yet) aware of any behavior difference with the different .loop implementations, but it would be worth checking if they all behave in the same way. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* 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-282-9/+57
| | | | | | | | 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>
* Fix logging on Android 11Denis 'GNUtoo' Carikli2021-02-281-6/+18
| | | | | | | | | | | | | | | | | | | | | Without that patch, on Replicant 11, with 'adb logcat -b radio', we do not see any of the log messages that libsamsung-ril is supposed to emmit. In addition, liblog[1]'s README.md has the following: `[ASR]LOG[VDIWE]` calls are used to log to BAsic, System or Radio sub-logs [...]. So we need to use RLOG anyway, at least with Replicant 11. To avoid breaking the compatibility with older versions, we fallback on ALOG when RLOG is not available. [1]liblog is available in system/core/liblog/ in the Android source code or in liblog/ in the following git repository: https://android.googlesource.com/platform/system/core Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* call.c: Fix comments styleDenis 'GNUtoo' Carikli2021-02-281-6/+6
| | | | 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>
* ipc.c: break lines over 80 charactersDenis 'GNUtoo' Carikli2021-02-281-12/+24
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* data.c: break lines over 80 charactersDenis 'GNUtoo' Carikli2021-02-281-84/+214
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* client.c: break lines over 80 charactersDenis 'GNUtoo' Carikli2021-02-281-4/+8
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* call.c: break lines over 80 charactersDenis 'GNUtoo' Carikli2021-02-281-46/+95
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* util.c: sort #includes alphabeticallyDenis 'GNUtoo' Carikli2021-02-281-2/+4
| | | | | | | This makes it easier to spot duplicated headers, find missing headers, or check if a specific header is present. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ipc.c: sort #includes alphabeticallyDenis 'GNUtoo' Carikli2021-02-281-2/+4
| | | | | | | This makes it easier to spot duplicated headers, find missing headers, or check if a specific header is present. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Add MAINTAINERS fileDenis 'GNUtoo' Carikli2021-02-281-0/+8
| | | | | | libsamsung-ril is maintained by the Replicant project Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Add guix.scmDenis 'GNUtoo' Carikli2021-02-271-0/+325
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Libsamsung-ipc that also has a guix.scm file to build libsamsung-ipc in many different ways (with GCC, clang, from the Android.mk, Autotools and with different build flags), but it's not suited for libsamsung-ril as we just need one build configuration of libsamsung-ipc from the master branch and not from libsamsung-ipc currently checked out git tree. So it's best to have a base libsamsung-ipc package in guix and in libsamsung-ipc's guix.scm, inherit it to create all the packages variants, and in libsamsung-ril to use the Guix' libsamsung-ipc as a dependency, possibly using master as the only modification. If Guix can accept a package that uses the master branch with potentially a floating revision that could be great, but as I understand they at least discourage it. It's also unclear if they would accept it if it's not generally useful (yet) as it still requires vendor kernels at the time of writing. If we probably need the following to be done before we can merge this patch in libsamsung-ril to make libsamsung-ipc more generally useful and be able to add it to Guix: - Cleanup the Linux GT-I9300 modem driver, upstream it it possible or at least package it as an external module with DKMS. - Add support for that module in the master branch of libsamsung-ipc (so with clean code and so on). - Finish passing the ipc_client struct to all the functions in libsamsung-ipc and do all pending changes that break the API / ABI - Make a new release of libsamsung-ipc. - Include the new libsamsung-ipc release in Guix. - (In parallel convert libsamsung-ipc guix.scm to use it). - Convert this guix.scm to use the Guix' libsamsung-ipc. - Finally merge this guix.scm in libsamsung-ril. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* checkpatch: ignore files added, moved, deleted warningDenis 'GNUtoo' Carikli2021-02-251-0/+7
| | | | | | | | | | | | | | Without that patch we always have the following warning when adding, moving, or deleting files when using checkpatch.pl: WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #93: new file mode 100644 Since we have only one maintainer for now, we can safely ignore that warning and add it back as soon as we have a second co-maintainer on board. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Import checkpatch.pl from Linux v5.6 and configure it.Denis 'GNUtoo' Carikli2021-02-254-0/+8368
| | | | | | | | | This will be used to check if the patches match Linux code style. The configuration is needed because otherwise the this tool has defaults parameters which are made for Linux. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Add licenseDenis 'GNUtoo' Carikli2021-01-111-0/+674
| | | | | | | | | | | | | All the files but the include/plmn_list.h have a header stating that they are under the GPLv3 or later. The include/plmn_list.h is a file generated from include/plmn_list.sh which is also under the GPLv3 or later, and from data coming from Wikipedia, which is licensed under Wikipedia's license which at the time was (and still is) the Creative Commons Attribution-ShareAlike License. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Convert to use separate SIM statusreplicant-6.0-0004-rc4Denis '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>