halapi: Add hal-api-manifest.xml 57/310157/2
authorYoungjae Cho <y0.cho@samsung.com>
Tue, 23 Apr 2024 06:41:20 +0000 (15:41 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Tue, 23 Apr 2024 09:28:05 +0000 (18:28 +0900)
The hal-api specifies which version it requires to a hal backend
module. The manifest file must be installed in the following directory:
 - /etc/hal-manifest/hal-api-manifest.xml

Manifest scheme:
 <manifest version="1.0" type="platform">
     <hal>
         <name>HAL_MODULE_XXX</name>
         <version>1.2</version>
         <version>2.0</version>
         <transport>passthrough</transport>
     </hal>
 </manifest>

 The above specifies that a platform has hal api version of both 1.0-2
and 2.0. The name, in this case the HAL_MODULE_XXX, must be one of an
enum hal_module. (See include/hal-common.h) It expects for hal backend
to have version that specified in <version>. Here the 'compatible' means
that backend version should have major version equal to platform, and
minor equal to or lesser than platform. At the above case, here is
compatible set of backend version:
 - Compatible backend version: 1.0, 1.1, 1.2, 2.0
 - Incompatible backend version: 1.3, 2.1, 3.0, ...

 As aforementioned, a platform must contain all set of apis as it has
specified on manifest <version>. For example, a hal api that specified
the above manifest must have all apis like below.
  // hal-xxx.h
  int hal_xxx_foo(); // Implemented as of v1.0
  int hal_xxx_bar(); // Implemented as of v1.1
  int hal_xxx_baz(); // Implemented as of v1.2
  int hal_xxx_qux(); // Implemented as of v2.0

 Note that, for backward compatibility, all functions with older minor
version as well as the latest minor version must be provided together.
And they cannot be removed as the minor bumps within the same major
version.
 It works based on which backend version would have been. If a platform
works on top of backend version of 1.1, the foo and bar will works
whereas baz and qux won't, returning not supported error, for example.
Note that even though the platform has implemented baz since v1.2, it
won't work as backend has no idea about v1.2.
 For backend version of 1.3, for example, all the foo, bar, and baz
won't work. (qux obviously won't too due to major version mismatch)
The backend v1.3 might have implemented all v1.0 ~ v1.3 functionalities
for backward compatibility though, it is possible that v1.2 platform
could not understand semantic of v1.3 that will have been given in
the future. To prevent this, platform refuses to work with backend
of future minor version.

 If a new hal api is added with major or minor version bump, fix the
manifest file through ACR process.

Change-Id: I9d191f4fe63577eb6ce08aa7fe3ac058f80f0360
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
CMakeLists.txt
hal-manifest/hal-api-manifest.xml [new file with mode: 0644]
packaging/hal-api-common.spec

index 2f9cb68154cb55b9a5b486f1943091ea4200b010..cdcc1b7cb1afe09116f4a726a4e67b17bb0aeb16 100644 (file)
@@ -64,6 +64,7 @@ INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
        FILES_MATCHING PATTERN "*.h")
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/${PROJECT_NAME}.pc
        DESTINATION ${LIBDIR}/pkgconfig)
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/hal-manifest DESTINATION /etc)
 
 ADD_SUBDIRECTORY(tests)
 
diff --git a/hal-manifest/hal-api-manifest.xml b/hal-manifest/hal-api-manifest.xml
new file mode 100644 (file)
index 0000000..331df5a
--- /dev/null
@@ -0,0 +1,132 @@
+<manifest version="1.0" type="platform">
+    <hal>
+        <name>HAL_MODULE_TBM</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_TDM</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_AUDIO</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_CAMERA</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_RADIO</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_BLUETOOTH</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_WIFI</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_NFC</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_ZIGBEE</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_UWB</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_LOCATION</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_POWER</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_SENSOR</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_DEVICE_BATTERY</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_DEVICE_BEZEL</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_DEVICE_DISPLAY</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_DEVICE_IR</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_DEVICE_TOUCHSCREEN</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_DEVICE_LED</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_DEVICE_BOARD</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_DEVICE_EXTERNAL_CONNECTION</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_DEVICE_THERMAL</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_DEVICE_HAPTIC</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_DEVICE_MEMORY</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_DEVICE_INPUT</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+    <hal>
+        <name>HAL_MODULE_DEVICE_POWER</name>
+        <version>1.0</version>
+        <transport>passthrough</transport>
+    </hal>
+</manifest>
index 9d8d7904d5de25d0e0afad1936e4efbaced52e2e..187f0696eded541d65a4ed3b7c5d729054642104 100644 (file)
@@ -97,6 +97,7 @@ rm -rf %{buildroot}
 %{_bindir}/lshal
 %{_bindir}/hal-compatibility-checker
 %{_sysconfdir}/ld.so.conf.d/libhal-api.conf
+%{_sysconfdir}/hal-manifest
 %{_systemdgeneratordir}/systemd-hal-firmware-generator
 %{_systemdgeneratordir}/systemd-hal-compatibility-checker-generator