aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ipc_client_gprs_specs handlers: pass the ipc_client structDenis 'GNUtoo' Carikli2020-02-286-14/+25
| | | | | | | | | 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>
* devices: data_create/data_destroy handlers: pass the ipc_client structDenis 'GNUtoo' Carikli2020-02-2810-22/+40
| | | | | | | | | 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>
* devices: gprs activate/deactivate handlers: pass the ipc_client structDenis 'GNUtoo' Carikli2020-02-2812-27/+47
| | | | | | | | | 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: Also ship headersDenis 'GNUtoo' Carikli2020-02-281-0/+30
| | | | | | | | | | | | | Without that, the Android components that are using libsamsung-ipc have to hardcode the location of libsamsung-ipc to be able to access the headers. LOCAL_EXPORT_C_INCLUDE_DIRS also enables the other components depending on libsamsung-ipc to automatically add the exported header directory to the header search path during compilation. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* modem: rename xmm626_sec_modem to xmm626_kernel_smdk4412Denis 'GNUtoo' Carikli2020-02-2110-183/+183
| | | | | | | | | | | | | | | | | | | | | | | | The XMM626 is the modem model, and SEC is a reference to Samsung Electronics. However, in practice the xmm626_sec_modem file and functions are tied to a specific kernel interface which is not upstream. In CyanogenMod, LineageOS and Replicant (up to the 6.0 version), most of the devices supported by libsamsung-ipc use a kernel named android_kernel_samsung_smdk4412, which implements this interface. So it is more clear to use a name that reflects that instead of using the generic xmm626_sec_modem name. Even if SMDK4412 is also a Samsung evaluation board for the Exynos 4412 System on a chip, the kernel name is probably way more known to people working on supporting devices with an XMM626 modem in libsamsung-ipc. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* modem: transport: pass the ipc_client structhistory/ipc-clientificationDenis 'GNUtoo' Carikli2020-02-218-42/+49
| | | | | | | | | 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>
* devices: transport: pass the ipc_client structDenis 'GNUtoo' Carikli2020-02-2113-85/+125
| | | | | | | | | 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>
* modem boot handlers: pass it the ipc_client structDenis 'GNUtoo' Carikli2020-02-218-85/+99
| | | | | | | | | | | This enables to use logging inside the handlers: ipc_client_log needs access to the ipc_client struct to work. 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>
* device boot handlers: pass it the ipc_client structDenis 'GNUtoo' Carikli2020-02-2112-25/+43
| | | | | | | | | | | This enables to use logging inside the handlers: ipc_client_log needs access to the ipc_client struct to work. 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>
* rfs.c: fix integer comparison sign with variableDenis 'GNUtoo' Carikli2020-02-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With: ./configure CC=clang CFLAGS=-W -Wall -Wno-unused \ --no-create --no-recursion we have: rfs.c:86:20: warning: comparison of integers of different signs: '__off_t' (aka 'long') and 'size_t' (aka 'unsigned int') [-Wsign-compare] if (st.st_size != size) { ~~~~~~~~~~ ^ ~~~~ rfs.c:146:20: warning: comparison of integers of different signs: '__off_t' (aka 'long') and 'size_t' (aka 'unsigned int') [-Wsign-compare] if (st.st_size != size) { ~~~~~~~~~~ ^ ~~~~ This is caused by the following code: size_t size; [...] rc = stat([...], &st); if (st.st_size != size) { [...] } However the type of size is wrong as the stat system call returns a stat structure which has the following field: off_t st_size; /* Total size, in bytes */ Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ipc.c: fix integer comparison signDenis 'GNUtoo' Carikli2020-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | With: ./configure CC=clang CFLAGS=-W -Wall -Wno-unused \ --no-create --no-recursion we have: CC ipc.lo ipc.c:71:16: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned int') and 'int' [-Wsign-compare] if (length == -1) ~~~~~~ ^ ~~ This is caused by the following code: size_t length; [...] length = read(fd, &buffer, sizeof(buffer)); if (length == -1) goto error; However, as per the function definition, read uses ssize_t which is the signed version of size_t: ssize_t read(int fd, void *buf, size_t count); Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* modems: xmm626: includes: add xmm626 prefixDenis 'GNUtoo' Carikli2020-02-085-6/+6
| | | | | | | This makes it more clear that the headers are specific to the xmm626 modem. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* samsung-ipc.h: fix include for timeval structDenis 'GNUtoo' Carikli2020-02-081-1/+1
| | | | | | | | | | When creating a new file which only includes samsung-ipc.h, with -Werror, we have a compilation error: error: ‘struct timeval’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror] Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: aries: fix compilation with -WerrorDenis 'GNUtoo' Carikli2020-02-081-1/+2
| | | | | | | | | | | | With -Werror we have: error: pointer targets in passing argument 6 of ‘recvfrom’ differ in signedness [-Werror=pointer-sign] [...] /usr/include/sys/socket.h:165:27: note: expected ‘socklen_t * restrict’ {aka ‘unsigned int * restrict’} but argument is of type ‘int *’ Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ipc.c: cosmetic cleanupsDenis 'GNUtoo' Carikli2020-02-081-63/+117
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ipc_device_detect: handle read errorsDenis 'GNUtoo' Carikli2020-02-081-0/+2
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ipc_device_detect: cleanup fd handlingDenis 'GNUtoo' Carikli2020-02-081-4/+0
| | | | | | | | If the open fails, then there is no need to close the file descriptor. If it succeed, it will be closed after being used. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* xmm626_sec_modem: cosmetic cleanupsDenis 'GNUtoo' Carikli2020-02-081-21/+45
| | | | | | | | | The line length was limited to 80 characters with the exception of xmm626_sec_modem_gprs_get_capabilities where it didn't make sense to try to split it as the result would look counter intuitive. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: crespo: cosmetic cleanupsDenis 'GNUtoo' Carikli2020-02-081-28/+46
| | | | | | | | | | - Whitespaces were unified to use 4 spaces as stated by the last line that has vim settings. - The line length was limited to 80 characters with the exception of the functions with only one argument where it didn't make sense to try to split it as the result would look counter intuitive. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: aries: cosmetic cleanupsDenis 'GNUtoo' Carikli2020-02-081-32/+59
| | | | | | | | | | - Whitespaces were unified to use 4 spaces as stated by the last line that has vim settings. - The line length was limited to 80 characters with the exception of the aries_gprs_get_capabilities function where it didn't make sense to try to split it as the result would look counter intuitive. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ipc.h: cosmetic cleanupsDenis 'GNUtoo' Carikli2020-02-081-3/+6
| | | | | Acked-by: Fil Lupin <fillupin@protonmail.com> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ipc_device_detect: document the code that finds the board name.Denis 'GNUtoo' Carikli2020-02-071-1/+4
| | | | | Acked-by: Fil Lupin <fillupin@protonmail.com> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: piranha: Reorder includes alphabeticallyDenis 'GNUtoo' Carikli2020-02-071-5/+5
| | | | | Acked-by: Fil Lupin <fillupin@protonmail.com> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: n7100: Reorder includes alphabeticallyDenis 'GNUtoo' Carikli2020-02-071-5/+5
| | | | | Acked-by: Fil Lupin <fillupin@protonmail.com> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: n5100: Reorder includes alphabeticallyDenis 'GNUtoo' Carikli2020-02-071-5/+5
| | | | | Acked-by: Fil Lupin <fillupin@protonmail.com> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: maguro: Reorder includes alphabeticallyDenis 'GNUtoo' Carikli2020-02-071-5/+5
| | | | | Acked-by: Fil Lupin <fillupin@protonmail.com> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: i9300: Reorder includes alphabeticallyDenis 'GNUtoo' Carikli2020-02-071-5/+5
| | | | | Acked-by: Fil Lupin <fillupin@protonmail.com> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: galaxys2: Reorder includes alphabeticallyDenis 'GNUtoo' Carikli2020-02-071-5/+5
| | | | | Acked-by: Fil Lupin <fillupin@protonmail.com> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: crespo: Reorder includes alphabeticallyDenis 'GNUtoo' Carikli2020-02-071-9/+8
| | | | | Acked-by: Fil Lupin <fillupin@protonmail.com> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: aries: Reorder includes alphabeticallyDenis 'GNUtoo' Carikli2020-02-071-11/+10
| | | | | Acked-by: Fil Lupin <fillupin@protonmail.com> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: piranha: cosmetic cleanupsDenis 'GNUtoo' Carikli2020-02-071-13/+20
| | | | | Acked-by: Fil Lupin <fillupin@protonmail.com> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: n7100: cosmetic cleanupsDenis 'GNUtoo' Carikli2020-02-071-12/+18
| | | | | Acked-by: Fil Lupin <fillupin@protonmail.com> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: n5100: cosmetic cleanupsDenis 'GNUtoo' Carikli2020-02-071-12/+18
| | | | | Acked-by: Fil Lupin <fillupin@protonmail.com> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: maguro: cosmetic cleanupsDenis 'GNUtoo' Carikli2020-02-071-15/+24
| | | | | Acked-by: Fil Lupin <fillupin@protonmail.com> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: i9300: cosmetic cleanupsDenis 'GNUtoo' Carikli2020-02-071-12/+18
| | | | | Acked-by: Fil Lupin <fillupin@protonmail.com> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: galaxys2: cosmetic cleanupsDenis 'GNUtoo' Carikli2020-02-071-12/+18
| | | | | Acked-by: Fil Lupin <fillupin@protonmail.com> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ipc_devices.c: move it in the devices directoryDenis 'GNUtoo' Carikli2020-01-304-3/+5
| | | | | | | | As the various devices are in devices/, it also makes sense to move there the structs that define which device specific implementation to use. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* modems: move them in their own directoryDenis 'GNUtoo' Carikli2020-01-3015-22/+22
| | | | | | | This improve clarity as devices typically refers to the smartphones and tablets but not the modems. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ipc_client_open: Add more loggingDenis 'GNUtoo' Carikli2020-01-301-2/+15
| | | | | | | Without that, we have no clue of what's going on when ipc_client_open fails. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* file_data_{read,write}: Add loggingDenis 'GNUtoo' Carikli2020-01-306-38/+81
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* nv_data-md5: use linebreak when printing the md5 stringDenis 'GNUtoo' Carikli2020-01-301-1/+1
| | | | | | This enables easy copy-paste from a terminal. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* nv_data-md5: use ipc_client loggingDenis 'GNUtoo' Carikli2020-01-301-2/+45
| | | | | | | | Without that, functions like ipc_nv_data_md5_calculate won't print anything as the ipc_client logging requires a valid ipc_client. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ipc_nv_data_md5_calculate: print errors when ipc_client is defined.Denis 'GNUtoo' Carikli2020-01-303-13/+20
| | | | | | | Without that, there are no ways to know the cause of failures with ipc_nv_data_md5_calculate. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Add IPC_CLIENT_TYPE_DUMMYDenis 'GNUtoo' Carikli2020-01-302-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | The libsamsung-ipc logging system depends on having a valid ipc_client struct which is created by ipc_client_create. This enable libsamsung-ipc to be reused accross software stacks that use different logging systems. For instance the libsamsung-ipc can be used by libsamsung-ril which integrates libsamsung-ipc logging to the Android logging system. However this has several side effects: - Standalone tools like nv_data-md5 that may not necessarily run on a device with a compatible modem and driver end up not printing many of the information it should be printing. - As ipc_client_create tries to autodetect hardware and software configurations, and that logging is only available after it succeed, the early intialisation prints are not forwarded to the logging system. This can be an issue on Android as users and developers expect the logging to go to 'logcat' and getting the early logs require more extesive modification of the system. This enables to create a dummy ipc_client with working logging. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* ipc-test: improve error reportingDenis 'GNUtoo' Carikli2020-01-181-9/+9
| | | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Acked-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
* Android: tools: dynamically link to libsamsung-ipcreplicant-6.0-0004-rc1Denis 'GNUtoo' Carikli2019-12-051-5/+2
| | | | | | | | | | | | | | | | | There is no point of bundling a copy of libsamsung-ipc in the tools. It's also counter-intuitive as developers do expect the tools to be able to test the same libsamsung-ipc that is used by the system and not a separate copy. Without that we also have some compilation issue with ipc-modem. external/libsamsung-ipc/samsung-ipc/rfs.c:55: error: undefined reference to 'MD5_Init' external/libsamsung-ipc/samsung-ipc/rfs.c:56: error: undefined reference to 'MD5_Update' external/libsamsung-ipc/samsung-ipc/rfs.c:57: error: undefined reference to 'MD5_Update' external/libsamsung-ipc/samsung-ipc/rfs.c:58: error: undefined reference to 'MD5_Final' Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* devices: n5100: silence unused variable warningsDenis 'GNUtoo' Carikli2019-12-051-8/+12
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* tools: get rid of unused variablesDenis 'GNUtoo' Carikli2019-12-052-4/+0
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* Silence warning about implicit declaration asprintfDenis 'GNUtoo' Carikli2019-12-053-0/+3
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
* rfs.c: silence uninitialized variable warningDenis 'GNUtoo' Carikli2019-12-051-1/+1
| | | | Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>