Commit Graph

107 Commits

Author SHA1 Message Date
Dylan Van Assche
72734dedc2 fastrpc: hexagonrpcd: meson: move install dir to non-root 2023-05-20 08:15:41 +02:00
Richard Acayan
5e0cb90499 tools: registry: store option character as integer
The option character is being compared to -1, but this -1 is an integer.
With GCC 12.2.1 on aarch64 platforms, the 8-bit character is not
properly sign-extended to 32 bits. Store the option character as an
integer so it is properly sign-extended.

Further investigation is needed to determine whether this is an
optimization bug and what value the 8-bit signed -1 is equal to.
2023-05-02 19:31:58 -04:00
Richard Acayan
3a8ee7ca22 tools: registry: move library flag to end of compiler command
GCC is a bit picky on Alpine Linux and wants `-ljson-c` to be at the end
of the command-line arguments. Move it to the end so the tools can be
built with this requirement.
2023-05-02 18:59:10 -04:00
Richard Acayan
04c2752483 fastrpc: hexagonrpcd: apps_std: do not fail without unrelated dirs
The open_dirs() function opens common directories that are usually
requested multiple times by the remote processor. When it fails to open
a directory, the failure propagates to the remote processor. Since the
remote processor might not need every directory, silence this failure so
the daemon can serve files unrelated to any missing or inaccessible
directories.
2023-05-02 18:25:07 -04:00
Richard Acayan
ae73e4b07b fastrpc: hexagonfs: move original sensors registry path
There is currently no need for further depth in the physical path for
the sensors registry. Move this sensors registry to the newly preferred
physical path.

Link: https://gitlab.com/flamingradian/sensh/-/merge_requests/1#note_1330303036
2023-04-06 21:49:00 -04:00
Richard Acayan
279ef9c97c Merge branch 'sdm845' of https://gitlab.com/dylanvanassche/sensh
Merge request !1:

	Add SDM845 support for hexagonrpcd:

	1. Separate /dev/fastrpc-sdsp FastRPC node
	2. Different sensor registry path support
2023-03-28 17:06:02 -04:00
Dylan Van Assche
f9b5f5d346 fastrpc: hexagonrpcd: meson: specify install dir
hexagonrpcd requires root so install it in /sbin/hexagonrpcd instead
of the default /usr/bin/hexagonrpcd.
2023-03-28 19:30:11 +02:00
Dylan Van Assche
6765bfbdba fastrpc: hexagonfs: add SDM845 registry path
On SDM845, the sensor registry is located at /persist
instead of /mnt/vendor. Add this path as well and point
to the same sensor registry location as on SDM670.
2023-03-28 19:30:06 +02:00
Dylan Van Assche
d374f4c313 fastrpc: rpcd: support any FastRPC node
SDM670 uses the ADSP to interact with the sensors over FastRPC.
However, high-end SoCs like SDM845 have a separate SLPI DSP which
has its own FastRPC node e.g. /dev/fastrpc-sdsp.

Add a commandline interface to set the FastRPC node and the attachment
type.
2023-03-28 19:30:02 +02:00
Richard Acayan
ab4e82cb7a fastrpc: hexagonrpcd: move interface headers to interfaces/*.def
The definition files can be included directly so there is no need for a
header file for each FastRPC interface. While the path to the include
file is changing move these files to a separate directory so the
arbitrary `fastrpc_` prefix isn't reserved for the interfaces.
2023-03-25 16:43:09 -04:00
Richard Acayan
a247510316 fastrpc: hexagonrpcd: move static handle numbers to definition files
Defining the static handle numbers is the only special thing that the
interface headers do right now. Move them into the definition files so
the headers can be removed.
2023-03-25 16:43:01 -04:00
Richard Acayan
1c1ee1d9b9 fastrpc: hexagonrpcd: move interface definitions to one compilation unit
It is tedious to add new interfaces if they each need their own C source
files. Move the definitions to a single interfaces.c file that has each
interface on one line to make it easier to add new interfaces.
2023-03-25 16:42:55 -04:00
Richard Acayan
6f79e94f96 fastrpc: hexagonrpcd: use libhexagonrpc method definition macro
This macro is common to all interfaces defined in hexagonrpcd. Use the
new macro from libhexagonrpc to prevent code duplication.
2023-03-25 16:42:48 -04:00
Richard Acayan
8e600c41c0 fastrpc: libhexagonrpc: add remote method definition macro
This macro used for the interfaces in hexagonrpcd are useful for
anything using the fastrpc function. Add the macro in the exported
headers so other applications using libhexagonrpc can define remote
methods easily.
2023-03-25 16:42:38 -04:00
Richard Acayan
e8dfce1a67 sensh: add meson build system
The top-level Makefile is difficult to use and add new source files. Add
a new build system so that a future set of breaking changes can remove
it.
2023-03-24 22:30:44 -04:00
Richard Acayan
935b2fa39b protobuf: sns_std_sensor_event: remove unused sns_std_suid include
This is not used anywhere in the file. Remove it.
2023-03-24 22:30:34 -04:00
Richard Acayan
f47b329e45 tools: registry: only redefine O_SEARCH if necessary
This is sometimes necessary on Linux, but some C libraries define it.
Only redefine O_SEARCH if it is not defined already, otherwise the
existing macro definition can be used.
2023-03-24 22:18:21 -04:00
Richard Acayan
aede1b89f5 tools: registry: correct copyright year
This was added in 2023, not 2022.
2023-02-24 17:24:39 -05:00
Richard Acayan
aab53e525e tools: registry: remove reference to hardware_platform in debugfs
This debugfs value outputs a number. Sensor configuration matches the
platform against a textual representation for this. Since the registry
generator doesn't convert between these, hardcode this in the example
command so it isn't broken.
2023-02-24 17:20:50 -05:00
Richard Acayan
ca36e584e1 fastrpc: README: document need for acdb directory
The apps_std implementation expects an acdb directory in
/usr/lib/qcom/adsp/avs. This was not obvious when looking in the
hexagonfs files so it was initially left out of the README. Add it now
that this was noticed.
2023-02-24 17:15:23 -05:00
Richard Acayan
4a8fa3b160 protobuf: add missing sns_std_sensor_event
This protocol buffer should have been added a long time ago. Add it now
so sensh can be built again.

Fixes: 368b5330f0 ("sensh: add support for generic sensor event")
2023-02-23 17:32:55 -05:00
Richard Acayan
fbcb891082 fastrpc: README: document correct directories for this implementation
This implementation does not try to access a /etc/qcom/sensors
directory. Instead, it looks for these files/directories in /etc/qcom.
Document the directories that this implementation actually searches.
2023-02-23 17:32:46 -05:00
Richard Acayan
21969385ef add registry generator
The sensor registry is generated from the configuration on the vendor
partition. Add a registry generator so this registry can be generated,
even without access to the partition of a given device.
2023-02-23 17:27:03 -05:00
Richard Acayan
2f17e92c04 fastrpc: hexagonfs: return error for negative file descriptors
The range check does not reject negative file descriptors. A negative
file descriptor accesses the memory before the array of open files.
Avoid this behavior by rejecting negative file descriptors.
2023-02-06 18:22:31 -05:00
Richard Acayan
368b5330f0 sensh: add support for generic sensor event
Message ID 1025 is an event for "normal" sensors. Add support for
logging this event.
2023-02-03 21:05:32 -05:00