Commit Graph

108 Commits

Author SHA1 Message Date
Konrad Dybcio
60df9896b4 meson.build: Enable more warnings 2024-04-09 13:08:17 +02:00
Konrad Dybcio
dedf29cd9f qmi: fix format warnings 2024-04-09 12:58:19 +02:00
Konrad Dybcio
e96305af4e ns: fix format warnings 2024-04-09 12:58:19 +02:00
Konrad Dybcio
79e1bff341 lib: generate pkgconfig 2024-04-09 12:58:19 +02:00
Konrad Dybcio
0aa6f97771 lookup: fix format warnings 2024-04-09 12:58:19 +02:00
Konrad Dybcio
c3bdf79be2 treewide: meson
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
2024-04-09 12:58:19 +02:00
Konrad Dybcio
20d1f78be8 lookup: Add more services
42667c34e2/sec_config
2024-04-08 22:30:02 +02:00
Konrad Dybcio
2d7962efff Merge pull request #24 from a-wai/clean-service
Makefile: remove generated service file when cleaning
2024-04-08 22:25:25 +02:00
Konrad Dybcio
7777177772 Merge pull request #25 from Ristovski/patch-1
lookup: Add several new services
2024-04-08 22:24:32 +02:00
Konrad Dybcio
df4a4cbed5 Merge pull request #26 from flamingradian/ims-data-service
lookup: add IMS data service
2024-04-08 22:12:37 +02:00
Richard Acayan
22a69b4f5e lookup: add IMS data service
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>
2024-03-25 21:48:37 -04:00
Rafael Ristovski
d81b7a377c lookup: Add several new services 2023-11-01 17:14:40 +01:00
Arnaud Ferraris
936c1978d5 Makefile: remove generated service file when cleaning
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.
2023-08-17 12:16:03 +02:00
Dylan Van Assche
d0d471c96e lookup: add Snapdragon Sensor Core service
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>
2023-01-17 22:59:41 -06:00
Jami Kettunen
a4398c8bf2 Makefile: allow $(CFLAGS), $(LDFLAGS) override
The caller might have specified CFLAGS or LDFLAGS. Let's respect those.
Additionally drop LDFLAGS var definition as it is empty.
2023-01-05 11:00:29 -06:00
Bjorn Andersson
9dc7a88548 libqrtr: Zero-initialize sockaddr_qrtr
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>
v1.0
2020-12-07 08:44:31 -08:00
Bjorn Andersson
983b223423 lookup: Add TFTP to known services list
Service 4096 is a QRTR based implementation of the TFTP RFCs.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-11-16 10:38:14 -06:00
Loic Poulain
cb1a6476e6 qrtr-lookup: Add DPM service name
Data Port Mapper service is ID 47.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2020-11-06 22:09:30 -08:00
Adam Serbinski
47e48a8d93 Android: Disable "treat warnings as errors". 2020-09-28 10:21:36 -05:00
Adam Serbinski
33bf949e4f Clang: fix for arithmetic disallowed on void pointers 2020-09-28 10:21:21 -05:00
Alex Khouderchah
fef484babd libqrtr: Use size_t for offsets
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.
2020-09-28 10:18:59 -05:00
Julien Massot
2ed52a30f6 qrtr-ns.service: do not install as executable
Fix
systemd[1]: Configuration file /lib/systemd/system/qrtr-ns.service is marked executable. Please remove executable permission bits. Proceeding anyway.
2020-09-28 10:17:11 -05:00
Bjorn Andersson
7bd5cf3024 ns: Go dormant when exsting name server is found
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>
2020-03-01 18:05:04 -08:00
Amit Pundir
2afd6f87b3 ANDROID: Add Android.bp makefile
Add Android.bp makefile to build libqrtr.so, qrtr-ns,
qrtr-cfg and qrtr-lookup targets for AOSP.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-02-03 09:17:15 -08:00
Bjorn Andersson
cd6bedd5d0 qrtr-ns.service: Add systemd service
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>
2019-07-24 23:25:16 -07:00
Bjorn Andersson
111403fe72 map: Fix removal of entries from the table
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>
2019-04-18 17:29:11 -07:00
Eric Caruso
c1bdfb37db logging: add min priority and other cleanup
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.
2018-12-10 16:03:04 -08:00
Eric Caruso
c9c4a3cdbd qrtr-lookup: print better information about DIAG service
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>
2018-12-10 15:59:56 -08:00
Bjorn Andersson
a1694a1c93 libqrtr: Correct "instance" composition
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>
2018-08-03 22:01:48 -07:00
Ben Chan
f9b5b38b50 qmi: pass `const struct qrtr_packet' to qmi_decode_header()
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>
2018-07-26 06:15:57 -07:00
Arun Kumar Neelakantam
4c4987ba7d libqrtr : Add support for signed one byte enum.
Add support to encode/decode one BYTE signed enum data type.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-07-16 09:03:29 -07:00
Ben Chan
eb666db04e qrtr-ns: initialize waiter_ticket struct in waiter_wait_timeout()
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>
2018-07-05 06:58:25 -07:00
Ben Chan
0ba75091ab libqrtr: add extern "C" guard in libqrtr.h
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>
2018-06-29 12:32:29 -07:00
Bjorn Andersson
a9c50b634f qrtr-lookup: Add description of service 52
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-06-25 16:36:04 -07:00
Ben Chan
4b7025a7c7 lookup: fix service name for service type 17
Service type 17 (0x11) is Specific Absorption Rate service, while
service type 25 (0x19) is Service Access Proxy service.
2018-06-22 10:54:20 -07:00
Eric Caruso
140a462c88 ns: add -s option for logging to syslog
Signed-off-by: Eric Caruso <ejcaruso@chromium.org>
2018-05-08 17:16:33 -07:00
Eric Caruso
de5ee77b00 logging: add use_syslog to qlog_setup
This causes qlog to log to syslog instead of logging to stderr.

Signed-off-by: Eric Caruso <ejcaruso@chromium.org>
2018-05-08 17:16:33 -07:00
Eric Caruso
f64c25c8af Unify logging into one function
This prepares us to add log-to-syslog functionality by passing
all logging through one place.

Signed-off-by: Eric Caruso <ejcaruso@chromium.org>
2018-05-08 17:16:33 -07:00
Eric Caruso
516011d79f cfg, ns: factor out qrtr_set_address function
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>
2018-05-01 11:49:23 -07:00
Eric Caruso
3c60eb7e0e cfg, lookup, ns: avoid using __progname
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>
2018-05-01 11:41:34 -07:00
Eric Caruso
366003c923 lookup: alphabetize includes
Signed-off-by: Eric Caruso <ejcaruso@chromium.org>
2018-05-01 11:41:34 -07:00
Eric Caruso
43723b6424 ns: alphabetize includes
Signed-off-by: Eric Caruso <ejcaruso@chromium.org>
2018-05-01 11:41:34 -07:00
Eric Caruso
b0f8857615 qmi: remove unused include
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
2018-04-27 16:28:19 -07:00
Bjorn Andersson
7d9a2e7df9 ns: Add argument to stay in foreground
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>
2018-04-19 18:13:34 -07:00
Bjorn Andersson
bd51b700ba ns: Allow qrtr-ns to configure node id
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>
2018-04-19 18:07:18 -07:00
Bjorn Andersson
3d819eecb2 cfg: Trigger kernel module autoloading
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>
2018-04-19 18:02:00 -07:00
Ben Chan
539c83dc5b libqrtr: define AF_QIPCRTR if it isn't defined in libc header
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>
2018-03-29 08:48:55 -07:00
Bjorn Andersson
9c126920c9 Makefile: Add lib to include path of qrtr-cfg
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-05 22:03:18 -08:00
Bjorn Andersson
dbffdd0193 libqrtr: Remove depricated functions
Post-QMI clean up of old interfaces and some duplicated definitions.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-02-01 02:06:57 +00:00
Bjorn Andersson
183d33d238 libqrtr: Rename libqrtr.c for the purpose of symmetry
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-02-01 01:51:39 +00:00