aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* samsung-ipc: move Android partition handling in its own directorypatches-todo/partitions-abstractionsDenis 'GNUtoo' Carikli2021-02-164-25/+87
| | | | | | TODO: check const * const * + pointer Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* samsung-ipc: move TOC handling in its own directoryDenis 'GNUtoo' Carikli2021-02-165-32/+91
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* samsung-ipc/Makefile.am: split it in subdirectoriesDenis 'GNUtoo' Carikli2021-02-163-36/+43
| | | | | | | | | The samsung-ipc/Makefile.am became pretty big. Because of that, it's It's better to split it to have one Makefile.am per subdirectory. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Initial support for herolte (Samsung Galaxy S7 GSM).Tony Garnock-Jones2021-02-165-0/+712
| | | | | | | | | | | | | | | A previous version of this patch was tested on the herolte, however since then, several light functional changes were introduced. With the previous patch, it was possible to boot the modem and it was probably possible to send message to, and receive messages from the modem. Signed-off-by: Tony Garnock-Jones <tonyg@leastfixedpoint.com> GNUtoo: rebased, code cleanup, more debug prints, commit message content but not its summary. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* samsung-ipc/utils: add data_read and data_writeDenis 'GNUtoo' Carikli2021-02-162-0/+46
| | | | | | | | | | | | | | These wrappers are meant to handle the case where read or writes handles a smaller number of bytes than requested. This way that handling doesn't need to be duplicated everywhere in libsamsung-ipc. Having access to the ipc_client struct could enable future logging of read and writes without having to change any of the code already using data_read and data_write. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* tools: nv_data-imei: handle list-supported in a more generic wayDenis 'GNUtoo' Carikli2021-02-131-48/+48
| | | | | | | Before that, the command infrastructure wasn't used for list-supported which led to more manual parsing and more code. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* tools: nv_data-imei: fix crash with commands options without commandDenis 'GNUtoo' Carikli2021-02-111-3/+4
| | | | | | | | | | | Without that fix command can be NULL when it reaches this assert: assert(command->options & OPTION_FILE); The crash can be reproduced by running nv_data-imei with command options but without the command itself, for example with 'nv_data-imei -i 1'. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* tools: nv_data-imei: main: Fix uninitialized command and command_option structsDenis 'GNUtoo' Carikli2021-02-111-2/+2
| | | | | | | | | | | | This was spotted by compiling nv_data-imei on Replicant 6: it gave the following warning: hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:1062:15: warning: 'command' may be used uninitialized in this function [-Wmaybe-uninitialized] rc = command->func(nv_data_path, &offset); ^ Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* tools: nv_data-imei: Fix return-type compilation errors on Replicant 6.0Denis 'GNUtoo' Carikli2021-02-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Replicant 6.0 we have: hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c: In function 'main': hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:1064:1: error: control reaches end of non-void function [-Werror=return-type] In nv_data-imei's main we had: int main(int argc, char * const argv[]) { [...] assert(false); } and for some reasons the Replicant 6.0 toolchain[1] doesn't recognize that adding a 'return 0;' won't change anything, however doing that is harmless and fixes that compilation error. This issue also affected errno_to_sysexit in the same way: hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c: In function 'errno_to_sysexit': hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:837:1: error: control reaches end of non-void function [-Werror=return-type] [1] The compiler used (which is built by vendor/replicant/build-toolchain) returns the following when run with --version: arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: Add Replicant 6 TARGET_ERROR_FLAGSDenis 'GNUtoo' Carikli2021-02-101-5/+12
| | | | | | | | | | | | The TARGET_ERROR_FLAGS are available from build/core/config.mk in Replicant 6. -Werror=non-virtual-dtor was only added to CLANG because it fails to be recognized with GCC: cc1: error: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C [-Werror] Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: Add Replicant 6 COMMON_GLOBAL_CFLAGSDenis 'GNUtoo' Carikli2021-02-101-0/+3
| | | | | | | The COMMON_GLOBAL_CFLAGS are available from build/core/config.mk in Replicant 6. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* tools: nv_data-imei: get rid of "pointer of type 'void *' used in subtraction"Denis 'GNUtoo' Carikli2021-02-101-3/+3
| | | | | | | | | | | | | When building nv_data-imei in Replicant 6 we have: hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c: In function 'bruteforce_imei_offset': hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:675:18: warning: pointer of type 'void *' used in subtraction [-Wpointer-arith] (ptr - buffer), ^ Using a data type with a known size like char* avoids this error. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: reorder CLFAGSDenis 'GNUtoo' Carikli2021-02-101-1/+8
| | | | | | This enables to more easily add new flags. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Add sysexits.h for AndroidDenis 'GNUtoo' Carikli2021-02-102-1/+115
| | | | | | | | | | | | | | | | | | | | | The include has been imported from sysexits.h from Parabola i686. As Replicant 6 and Replicant 11 don't have sysexits.h, the compilation of nv_data-imei will fail if it's not provided somehow: hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:32:22: fatal error: sysexits.h: No such file or directory #include <sysexits.h> ^ compilation terminated. Being able to use sysexits.h is really interesting as it provides a standard for applications exit codes. In turn it enables to design tests that are more fine grained and to avoid too messy test code while doing that, simply by following this standard. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* scripts: guix.scm: use latest clangDenis 'GNUtoo' Carikli2021-02-101-2/+2
| | | | | | | | | | | | | | Without that, it will end up using clang-10 while we now have clang-11. This will make Guix build clang-10 which is time consuming. Instead by using the latest clang we can use binary packages (Guix calls that substitutes) of clang which speeds up the build of libsamsung-ipc a lot, since most of the time we don't need to build any dependencies. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ipc_utils: add ipc_group_stringDenis 'GNUtoo' Carikli2021-02-012-0/+51
| | | | | | | | | | | | | While ipc_group_string is not used by libsamsung-ipc (yet), it's still a good idea to add it as tools and applications using libsamsung-ipc can then use it to display the group of a command. It's also a better idea to have it in libsamsung-ipc than in each tool using it as libsamsung-ipc centralizes the knowledge about the samsung-ipc protocol, so if new groups appear at some point, the ipc_group_string function could be updated along the way. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* include: samsung-ipc.h: fix missing off_t definitionDenis 'GNUtoo' Carikli2021-02-011-0/+1
| | | | | | | | | | Including samsung-ipc.h in a file without other includes results in a compilation error: .../include/samsung-ipc.h:161:1: error: unknown type name ‘off_t’ 161 | off_t file_data_size(struct ipc_client *client, [...] | ^~~~~ Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* include: samsung-ipc.h: fix missing size_t definitionDenis 'GNUtoo' Carikli2021-02-011-0/+2
| | | | | | | | | | | | | | | | | | | Including samsung-ipc.h in a file without other includes results in a compilation error: .../include/samsung-ipc.h:51:2: error: unknown type name ‘size_t’ 51 | size_t size; | ^~~~~~ .../include/samsung-ipc.h:77:7: error: unknown type name ‘size_t’ 77 | size_t size), | ^~~~~~ .../include/samsung-ipc.h:26:1: note: ‘size_t’ is defined in header ‘<stddef.h>’; did you forget to ‘#include <stddef.h>’? 25 | #include <sys/time.h> +++ |+#include <stddef.h> 26 | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* include: samsung-ipc.h: move include inside the #ifdef/#endif guardsDenis 'GNUtoo' Carikli2021-02-011-2/+2
| | | | | | | | | | | | | | | | | This separates more what is part of the header and what is not so things are more clear to the people reading the code. In addition, having all includes statements inside the #ifdef #endif header guards avoids issues with the inclusion of headers that are missing such guards. This can happen with headers imported from vendor kernels. So while headers imported from vendor kernels are typically not included in the headers exported by libsamsung-ipc, it's still good to have a consistent code style between exported and non exported headers. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Move guix.scm to scriptsDenis 'GNUtoo' Carikli2021-01-111-6/+7
| | | | | | | | | | | | | | | | | The scripts directory already has several scripts that are not needed to use libsamsung-ipc, but all of them are (or were) useful to work on patches for libsamsung-ipc. As this also applies to the guix.scm and that scheme is a scripting language, it would be more clear to have it moved in the scripts directory. In addition it could also make it more simple for distributions to not ship these files if they aren't interested in having them and/or if they only want files compatibles with the license currently used by libsamsung-ipc (GPLv2 or later). Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ipc_nv_data_md5_calculate: handle size mismatch betterreplicant-6.0-0004-rc4Denis 'GNUtoo' Carikli2020-12-032-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently libsamsung-ipc assumes that the size of nv_data.bin files are always 0x200000. While it's supposed to be the case for all the devices we support, it is still a good idea to make sure that a meaningful error message is reported to the users of nv_data-md5. For instance if we created an empty file of 1 kB with the following command: $ ddrescue -s 1k /dev/zero zero.img and that we used nv_data-md5 on it: $ ./tools/nv_data-md5 zero.img [ipc] file_data_read: Error: rc < 0 [ipc] ipc_nv_data_md5_calculate failed: data is NULL Calculating nv_data backup md5 failed we had a completely meaningless error message. With this patch the error message looks like that instead: $ ./tools/nv_data-md5 zero.img [ipc] ipc_nv_data_md5_calculate: Checking zero.img size failed: requested size: 2097152, file size: 1000 Calculating nv_data backup md5 failed Here users have at least a fighting chance of being able to understand what is going wrong. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* tools: nv_data-md5: Add testsDenis 'GNUtoo' Carikli2020-12-032-2/+73
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Add guix.scmDenis 'GNUtoo' Carikli2020-12-031-0/+214
| | | | | | | | | | | | | | | | | | | The guix.scm file can be used to test the build in various configurations in a reproducible way. Once you have guix installed, and up to date, you can use it with the following command: $ guix build --file=guix.scm The filename (guix.scm) is a convention that is also used in other packages to also do build tests in various configurations. For more background on the use of guix.scm see the Guix days 2020 presentation about it[1]. [1]https://xana.lepiller.eu/guix-days-2020/guix-days-2020-efraim-flashner-build-it-with-guix.webm Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* tools: nv_data-imei: fix unused-labelDenis 'GNUtoo' Carikli2020-12-031-1/+0
| | | | | | | | | | | | | | Without that fix, when building libsamsung-ipc under GNU/Linux with the "-Werror -W -Wall -Wunused -Wunused-function" CFLAGS, GCC and the autotools build system, we have: nv_data-imei.c: In function ‘bruteforce_imei_offset’: nv_data-imei.c:695:1: error: label ‘complete’ defined but not used [-Werror=unused-label] complete: ^~~~~~~~ Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
* samsung-ipc: rfs: fix incorrect sign comparison for md5 file lengthJoonas Kylmälä2020-12-031-3/+5
| | | | | | | | | | | | | | | | | | When compiling with warnings (-Werror -W -Wall -Wunused -Wunused-function) enabled we get: rfs.c: In function ‘ipc_nv_data_md5_path_check’: rfs.c:115:17: error: comparison of integer expressions of different signedness: ‘__off_t’ {aka ‘long int’} and ‘long unsigned int’ [-Werror=sign-compare] if (st.st_size < 2 * sizeof(char) * MD5_DIGEST_LENGTH) { ^ This simplifies the comparison by making sure we have exactly 32 bytes (2*MD5_DIGEST_LENGTH, i.e. md5 digest in ascii) in the file we read the MD5 digest from. Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Tested-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Acked-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* checkpatch: ignore files added, moved, deleted warningDenis 'GNUtoo' Carikli2020-11-261-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>
* Cosmetic: sort #includes alphabetically in ipc_devices.hTony Garnock-Jones2020-11-261-4/+4
| | | | | | Signed-off-by: Tony Garnock-Jones <tonyg@leastfixedpoint.com> GNUtoo: rebased on top of libsamsung-ipc master Acked-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* libsamsung-ipc: improve board drivers print (issue #2150)Belgin Stirbu2020-11-234-50/+164
| | | | | | | | | | | | | | | | | | | | These are the functions and their corresponding error messages: xmm626_kernel_smdk4412_power -> "Powering on/off the modem failed" xmm626_kernel_smdk4412_hci_power -> "Powering on/off the HCI bus failed" xmm626_kernel_smdk4412_link_control_enable -> "Enabling/Disabling the modem link failed" xmm626_kernel_smdk4412_link_control_active -> "Activating/Deactivating the modem link failed" Signed-off-by: Belgin Stirbu <belginstirbu@hotmail.com> Acked-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* nv_data-imei: indicate that write-imei may or may not workDenis 'GNUtoo' Carikli2020-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | I had two Nexus S: after breaking one, I've tried moving the IMEI of the broken one on the working one: - Earlier I did some backups of the EFS. - I went into recovery mode - I removed the .nv_data.bak and .nv_data.bak.md5 files - I copied the .nv_data.bin to my computer and changed the IMEI with nv_data-imei - I copied back the .nv_data.bin and the generated .nv_data.bin.md5 and fixed the permissions. - I booted the device However not only the IMEI didn't change, but it was also set back to the old one in the file. I've also asked Paul Kocialkowski if he remembered if changing the IMEI worked in his original code or on which device he tried it, but he didn't remember. So more information is probably needed to either understand if that code is supposed to work and if so if there are conditions in which it works or doesn't work (specific EFS, devices, etc). Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* nv_data-imei: Fix get_imei return codesDenis 'GNUtoo' Carikli2020-11-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | Negative error codes are used as per the kernel coding style, however userspace, especially the tests expect positive return code compliant with sysexits.h. So here we map EINVAL (Invalid argument) from errno.h to EX_USAGE (command line usage error). Without that fix we have: $ ./tools/nv_data-imei nv_data.bin bruteforce-imei -i 12345 The '12345' IMEI is invalid as it is composed of 5 digits instead of 15. errno_to_sysexit: error: unknown error code -1. errno_to_sysexit: error code -1 needs to be implemented lt-nv_data-imei: nv_data-imei.c:836: errno_to_sysexit: Assertion `false' failed. Aborted (core dumped) instead of: $ ./tools/nv_data-imei nv_data.bin bruteforce-imei -i 12345 The '12345' IMEI is invalid as it is composed of 5 digits instead of 15. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* nv_data-imei: fix leftover from bruteforce_imei_offsetDenis 'GNUtoo' Carikli2020-11-081-7/+18
| | | | | | | | | | | | At first I tried to do a bruteforce that computed the IMEI once for each location in the file. While this was inefficient, it kept the code simple enough to validate that it worked as the code wasn't tested before. However, during the rewrite of that loop to make it more efficient I forgot to complete it. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* nv_data-imei: handle missing command line arguments errorDenis 'GNUtoo' Carikli2020-11-071-0/+2
| | | | | | | | | | | | | | | | | Without that fix we have: $ ./tools/nv_data-imei nv_data.bin bruteforce-imei IMEI option required See nv_data-imei bruteforce-imei -h for more details. errno_to_sysexit: error: unknown error code -22. errno_to_sysexit: error code -22 needs to be implemented lt-nv_data-imei: nv_data-imei.c:823: errno_to_sysexit: Assertion `false' failed. Aborted (core dumped) instead of: $ ./tools/nv_data-imei nv_data.bin bruteforce-imei IMEI option required See nv_data-imei bruteforce-imei -h for more details. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* tools: Add a new nv_data-imei tool based on rfs-imeiDenis 'GNUtoo' Carikli2020-11-036-258/+1284
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* tools: import preliminary rfs-imei implementation as-isPaul Kocialkowsk2020-11-031-0/+258
| | | | | | | | | | | | | | | | | | | | | | Knowing the format and offset of the IMEI location in nv_data.bin is a step forward to be able to to recreate nv_data.bin from scratch. This can be used to repair devices that have their EFS partition completely destroyed, without having to rely on nonfree tools to do it. When asking Paul Kocialkowsk if he knew the offset at which the IMEI were stored in the nv_data.bin files, he explained to me that he only found it for the XMM616 and also gave me an unfinished implementation for a tool to change it. In order to preserve all the information in the tool and its correct authorship, the tool source code wasn't altered. As it doesn't compile with current versions of libsamsung-ipc, it wasn't added to any of the build systems (Android.mk and autotools). This will have to be fixed in subsequent commits. Signed-off-by: Paul Kocialkowsk <contact@paulk.fr> GNUtoo: Added commit message Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* samsung-ipc/utils: file_data_write: return more precise errorsDenis 'GNUtoo' Carikli2020-11-031-6/+8
| | | | | | | | | | | | | file_data_write uses open and lseek, and both can fail. In that case, it would be a good idea to be able for the caller of file_data_write to be able to retrieve the cause of the error. To do that here, we used the same way than write uses to pass on the information to the caller: On success, the number of bytes written is returned. On error, -1 is returned, and errno is set to indicate the cause of the error. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* samsung-ipc/utils: Add file_data_sizeDenis 'GNUtoo' Carikli2020-11-032-0/+42
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* configure.ac: Add xz supportreplicant-6.0-0004-rc3Denis 'GNUtoo' Carikli2020-09-211-1/+2
| | | | | | | This enables to create xz tarball from the source code with make dist-xz. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Makefile.am: Fix xmm626_modem_if.h pathDenis 'GNUtoo' Carikli2020-09-211-1/+1
| | | | | | | | | | | According to this commit: 86d3646 modems: xmm626: includes: add xmm626 prefix 86d3646e6c2dfad59c97aa39e944d97f4b3feed5 the samsung-ipc/modems/xmm626/modem.h was renamed to samsung-ipc/modems/xmm626/xmm626_modem_if.h, however I forgot to update the Makefile.am. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Use the mailing list instead of the the private contact address.Denis 'GNUtoo' Carikli2020-09-211-1/+1
| | | | | | | | | | | | | | | | | | | Automake has support for test suites, and while trying to use that I ended up with failing a test and it printed the following message: ======================================= [...] See tools/test-suite.log Please report to replicant@osuosl.org ======================================= [...] As the contact address is only used for matters that cannot be made public, it would be better to have the bug reported on the mailing list instead, if testing is ever added in the future. Other uses of the autotools might also make the private contact address comes forward pushing users to write to this address for matters that should be public instead. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* samsung-ipc: utils.c: file_data_{read,write}: report open errorDenis 'GNUtoo' Carikli2020-09-211-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Mounting the EFS on your local computer can result in user id and permissions mismatch because the /etc/fstab doesn't always match the user ids used by Android. For instance here's the GT-N7000 EFS on my laptop: $ ls -l [...]/nv_data.bin -rwx------ 1 1001 1001 2097152 1 janv. 2000 [...]/nv_data.bin When using nv_data-md5 on it we have: $ ./tools/nv_data-md5 [...]/nv_data.bin [ipc] file_data_read: Error: fd: -1 [ipc] ipc_nv_data_md5_calculate failed: data is NULL Calculating nv_data backup md5 failed The error was too cryptic, and I ended up having to dig into the source code to understand what was going on. With this patch we now have an error message that is easier to understand: $ ./tools/nv_data-md5 [...]/nv_data.bin [ipc] file_data_read open failed with error 13: Permission denied [ipc] ipc_nv_data_md5_calculate failed: data is NULL Calculating nv_data backup md5 failed Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* samsung-ipc/utils: reorder includesDenis 'GNUtoo' Carikli2020-09-211-7/+10
| | | | | | | | | | | | | | | | | | | This reorders includes alphabetically and groups them together: - C standard library includes of depth 1 are grouped together - "System" libraries of depth > 1 age grouped together - The (lib)samsung-ipc include(s) is/are grouped together We also need to keep the inclusion of sys/socket.h before linux/netlink.h in order to prevent the following compilation error on Replicant 4.2: bionic/libc/kernel/common/linux/netlink.h:52:2: error: unknown type name 'sa_family_t' While Replicant 4.2 is not really maintained anymore, it is still being used for testing libsamsung-ipc on devices that are not supported anymore by more recent Replicant versions, so we need to keep libsamsung-ipc and libsamsung-ril working on it. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* sec: fix SIM not found due to typo while switch to Linux code styleDenis 'GNUtoo' Carikli2020-09-151-1/+1
| | | | | | | | | | | | The bug being fixed in this commit was introduced in the following commit: b98a418 samsung-ipc: sec: switch to Linux code style b98a4188db6350794e8e7139065d71a25314e18c With that bug, on Replicant 6.0 0004 RC2, the SIM card is not found anymore, but some modem functionality still worked like getting the IMEI through the settings. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* xmm626_hsic_ack_read: pass the ipc_client structDenis 'GNUtoo' Carikli2020-07-241-4/+5
| | | | | | | | | This enables to use logging inside the callbacks. At this point the ipc_client struct is already available, so it is safe to do that. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* xmm626_mipi_ack_read: pass the ipc_client structDenis 'GNUtoo' Carikli2020-07-241-6/+7
| | | | | | | | | This enables to use logging inside the callbacks. At this point the ipc_client struct is already available, so it is safe to do that. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* xmm626_hsic_modem_command_send: pass the ipc_client structDenis 'GNUtoo' Carikli2020-07-241-13/+17
| | | | | | | | | This enables to use logging inside the callbacks. At this point the ipc_client struct is already available, so it is safe to do that. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* xmm626_mipi_modem_command_send: pass the ipc_client structDenis 'GNUtoo' Carikli2020-07-241-12/+15
| | | | | | | | | This enables to use logging inside the callbacks. At this point the ipc_client struct is already available, so it is safe to do that. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* xmm626_mipi_modem_data_send: pass the ipc_client structDenis 'GNUtoo' Carikli2020-07-241-5/+7
| | | | | | | | | This enables to use logging inside the callbacks. At this point the ipc_client struct is already available, so it is safe to do that. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* xmm626_hsic_modem_data_send: pass the ipc_client structDenis 'GNUtoo' Carikli2020-07-241-4/+6
| | | | | | | | | This enables to use logging inside the callbacks. At this point the ipc_client struct is already available, so it is safe to do that. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Android.mk: add nv_data-md5Denis 'GNUtoo' Carikli2020-07-241-0/+16
| | | | | | | | | | | | | | | | | The nv_data-md5 tool can be used to create the nv_data.md5 or .nv_data.md5 files. This tool is already integrated in the Autotools build system, so it's a good idea to also add it to the Android.mk to enable to build it in Android as well if needed. As libsamsung-ipc is not packaged yet in most common GNU/Linux distributions, it might be useful to add it in the resulting Android images, but it's up to the Android distributions using libsamsung-ipc to decide that, for instance by adding nv_data-md5 to PRODUCT_PACKAGES in the repositories of various devices. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* samsung-ipc: make #include relative to samsung-ipc/Denis 'GNUtoo' Carikli2020-07-2219-51/+45
| | | | | | | | | | | | | | This has several advantages: - It makes the header context more obvious: #include "xmm626.h" could mislead people into thinking that the xmm626.h header is in the same directory than the file using that directive, while it is instead in another location. This in turn could make people suppose that there is a "xmm626.h" header specific to the galaxys2 driver. Instead the #include "modems/xmm616/xmm616.h" directive is much more clear. - We can have two headers with the same filename. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>