| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Signed-off-by: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
Acked-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
| |
Signed-off-by: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
|
|
|
| |
Signed-off-by: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
This enables to create xz tarball from the source code with make
dist-xz.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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 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 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The way <> and "" are included are implementation defined according to
the C18 standard[1]:
A preprocessing directive of the form
# include < h-char-sequence > new-line
searches a sequence of implementation-defined places for a header
identified uniquely by the specified sequence between the < and >
delimiters, and causes the replacement of that directive by the entire
contents of the header. How the places are specified or the header
identified is implementation-defined.
A preprocessing directive of the form
# include " q-char-sequence " new-line
causes the replacement of that directive by the entire contents of the
source file identified by the specified sequence between the "
delimiters. The named source file is searched for in an
implementation-defined manner. If this search is not supported, or if
the search fails, the directive is reprocessed as if it read
And the GCC documentation has the following on #include directives[2]:
Both user and system header files are included using the preprocessing
directive ‘#include’. It has two variants:
#include <file>
This variant is used for system header files. It searches for a file
named file in a standard list of system directories. You can prepend
directories to this list with the -I option (see Invocation).
#include "file"
This variant is used for header files of your own program. It searches
for a file named file first in the directory containing the current
file, then in the quote directories and then the same directories used
for <file>. You can prepend directories to the list of quote
directories with the -iquote option.
References:
-----------
[1]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
[2]https://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
| |
xmm626_modem_prj.h uses the MAX_IPC_DEV define and the modem_link
enum which come from xmm626_modem_if.h
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
|
|
|
|
|
|
|
|
|
| |
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
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Android "Build System Best Practices" document[1] states:
"LOCAL_COPY_HEADERS is deprecated. Soong modules cannot use these
headers, and when the VNDK is enabled, System modules in Make cannot
declare or use them either."
and:
"Don't use non-local paths in your LOCAL_EXPORT_C_INCLUDE_DIRS, [...].
Non-local exported include dirs are not supported in Soong."
And having both VNDK enabled and LOCAL_COPY_HEADERS does prevent the build
on Replicant 10.
LOCAL_COPY_HEADERS was kept for compatibility reasons in the fear that
not removing it would potentially break older Replicant versions like
Replicant 4.2 which are still needed in order to test libsamsung-ipc
on devices that are not supported anymore by subsequent Replicant versions.
However since:
- LOCAL_EXPORT_C_INCLUDE_DIRS is also used in Replicant 4.2 and 6.0 as
well
- all devices currently supported by libsamsung-ipc are supported by one of
these Replicant versions[2]
it should be safe to remove all usage of LOCAL_COPY_HEADERS in Android.
This change was tested at build time with the following configurations:
- Replicant 10.0 with the i9300 target
- Replicant 6.0 with the i9300 target
- Replicant 4.2 with the galaxysmtd target
References:
-----------
[1]https://android.googlesource.com/platform/build/soong/+/master/docs/best_practices.md#headers
[2]With the exception of the Galaxy Tab which was never supported by
Replicant.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In project using autotools, autogen.sh scrips are common and
are typically used to generate the ./configure script.
While running ./configure in that script might speed up the
setup for compiling libsamsung-ipc manually, packagers that
know a bit about the autotools probably don't expect that
script to run ./configure as well, as packagers typically
run ./configure after autogen.sh.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This contains no functional changes.
"unsigned" was changed to "unsigned int" because
checkpatch.pl was printing the following warning:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
According to the C18 standard[1], "unsigned" is the same as
"unsigned int": in the "6.7 Declarations" section we have:
"- unsigned, or unsigned int" [...]
Each of the comma-separated multisets designates the same type [...]
References:
-----------
[1]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
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
| |
This contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
| |
This contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
| |
This contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
| |
This contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
| |
This contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
| |
This contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
| |
This contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
| |
This contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
| |
This contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
| |
This contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This contains no functional changes.
"unsigned" was changed to "unsigned int" because
checkpatch.pl was printing the following warning:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
According to the C18 standard[1], "unsigned" is the same as
"unsigned int": in the "6.7 Declarations" section we have:
"- unsigned, or unsigned int" [...]
Each of the comma-separated multisets designates the same type [...]
References:
-----------
[1]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
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
| |
This contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
| |
This contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
| |
This contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
| |
This contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
| |
This contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
| |
This contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|
|
|
|
|
|
|
| |
This contains no functional changes.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
|