| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
This makes it more clear that the headers are specific to the xmm626
modem.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
| |
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
| |
Acked-by: Fil Lupin <fillupin@protonmail.com>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
| |
Acked-by: Fil Lupin <fillupin@protonmail.com>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
| |
Acked-by: Fil Lupin <fillupin@protonmail.com>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
| |
Acked-by: Fil Lupin <fillupin@protonmail.com>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
| |
Acked-by: Fil Lupin <fillupin@protonmail.com>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
| |
Acked-by: Fil Lupin <fillupin@protonmail.com>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
| |
Acked-by: Fil Lupin <fillupin@protonmail.com>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
| |
Acked-by: Fil Lupin <fillupin@protonmail.com>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
| |
Acked-by: Fil Lupin <fillupin@protonmail.com>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
| |
Acked-by: Fil Lupin <fillupin@protonmail.com>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
| |
Acked-by: Fil Lupin <fillupin@protonmail.com>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
| |
Acked-by: Fil Lupin <fillupin@protonmail.com>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
| |
Acked-by: Fil Lupin <fillupin@protonmail.com>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
| |
Acked-by: Fil Lupin <fillupin@protonmail.com>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
| |
Acked-by: Fil Lupin <fillupin@protonmail.com>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
| |
Acked-by: Fil Lupin <fillupin@protonmail.com>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
| |
This enables easy copy-paste from a terminal.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
| |
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
| |
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
| |
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
| |
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
| |
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
Here the code tries to match for "Hardware", and strncmp returns
0 if there is a match, not 8.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Android, libsamsung-ipc is dynamically linked
to libcrypto.
However libsamsung-ril uses libsamsung-ipc
as a static library.
Without that fix, on Android 9, linking libsamsung-ril
to libsamsung-ipc fails with the following errors:
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>
|
|
|
|
|
|
|
|
| |
The external input comes from the kernel's /proc/cpuinfo,
so this should not have been exploitable.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Fil Bergamo <fil.bergamo@riseup.net>
|