The IMS data service is the service responsible for configuring a
connection used by the modem for IMS. Add the service.
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
After building the package, `make clean` doesn't delete the generated
service file. This patch ensures this file is included in the
`$(all-clean)` variable so it is removed when cleaning.
SDM845 and later expose a Snapdragon Sensor Core service (400) to access the sensors
managed by a remoteproc. Add this service to the known list of services.
Signed-off-by: Dylan Van Assche <me@dylanvanassche.be>
Valgrind complains that sockaddr_qrtr isn't properly initialized, even
though all fields are initialized. So explicitly clear the
sockaddr_qrtrs.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Currently, offsetof produces an unsigned long, while qmi_elem_info's
offset member is a uint32_t. Since this is not the same type on all
platforms, this change uses a size_t for both. stddef.h is also
included for the standard offsetof definition, which also produces a
size_t.
This change also makes similar modifications to list.h.
With the introduction of the in-kernel nameserver launching the user
space qrtr-ns will fail, but typically other services depends on its
presence. As such, go dormant instead of failing when noticed that the
name service is already present.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Add qrtr-ns.service template and install this into /lib/systemd/system
after modifying it according to $(DESTDIR) and $(prefix)
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Removing entries from an open addressed hash table creates holes in the
collision chains, preventing previous colliding entries to be found. By
inserting tombstones, rather than clearing deleted entries makes it
possible to distinguish the end of a chain from a hole.
Reviewed-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
The dprintf macro shadows a real libc symbol which is called
differently, so we should change it to something else (in this
case LOGD) and change it to use the libqrtr logging facilities.
This also means we should add a minimum priority to the logging
library so we don't log DEBUG-level messages by default.
Additionally there were some warn/warnx calls left over that
have been changed to PLOGW/LOGW respectively.
The DIAG service has its own encoding for the instance number which
is unrelated to the version. This means that the information we
show to the user in the version and instance columns of the table is
parsed incorrectly and often useless. Instead, treat the instance
number as special if the service is a DIAG service and print out a
more meaningful interpretation.
Signed-off-by: Eric Caruso <ejcaruso@chromium.org>
The "instance" id of a service is a composition of the instance id and
the version. In some plaeces in the library I made this two half words
instead of the actually expected 8 bits version + 24 bit instance. Fix
this in the library.
This was not spotted previously because all prior work has dealt with
instance id 0, but with the QRTR support in Diag this is now an issue.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Similar to qmi_decode_message(), qmi_decode_header() doesn't modify the
`struct qrtr_packet' argument. This patch makes qmi_decode_header() to
take a `const struct qrtr_packet' argument like qmi_decode_message()
does.
Contributed by Jacob Rutherford <jruthe@chromium.org>
waiter_wait_timeout() doesn't initialize the 'callback' and 'updated'
fields of the waiter_ticket struct. The 'updated' field may contain some
garbage value, which is later read in waiter_ticket_check().
Signed-off-by: Ben Chan <benchan@chromium.org>
This patch adds an extern "C" guard in libqrtr.h, so that it can be
included in both C and C++ projects.
Signed-off-by: Ben Chan <benchan@chromium.org>
This function in qrtr-ns was largely copied from the main
function of qrtr-cfg. We should just factor it out so there is
one implementation instead.
Signed-off-by: Eric Caruso <ejcaruso@chromium.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
The __progname symbol is a GNU extension and thus not portable,
but basename (from libgen.h) and argv[0] can be used portably
instead.
(qrtr-lookup already used argv[0] but did not apply basename, so
do that for consisntency.)
Signed-off-by: Eric Caruso <ejcaruso@chromium.org>
This include provides err, errx, etc. but it looks like all
error logging in qmi.c is done with fprintf, so there's no
reason to include it.
Change-Id: I4f4a71323a55fca981ef8df994fe624a590e3802
When running in Android we want to keep qrtr-ns in the foreground, so
that init's service handler can keep track of it. Add the -f flag to
skip the fork().
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Instead of calling qrtr-cfg separately to configure the local address
just pass this as an argument to qrtr-ns, allowing us to run a single
command to instantiate qrtr.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
By opening a socket before attempting to configure the address we
trigger kernel module loading, if qrtr is compiled as such.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Definition of AF_QIPCRTR was introduced in glibc in the following
commit and is only available since glibc 2.25 or later.
https://sourceware.org/git/?p=glibc.git;a=commit;h=acaff9b658720e4c887f4e44e6f28962d6f372d3
This patch modifies libqrtr.h to define AF_QIPCRTR if it isn't defined
in libc header, which allows compilation of libqrtr on a system with an
older version of glibc. The compiled libqrtr can still be used on a
system with kernel 4.7 or later with the QIPCRTR support.
Signed-off-by: Ben Chan <benchan@chromium.org>