header.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // Copyright 2026 Aarav Ravindra Kharade
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
  17. /*
  18. * This file is provided under a dual BSD/GPLv2 license. When using or
  19. * redistributing this file, you may do so under either license.
  20. *
  21. * Copyright(c) 2018 Intel Corporation
  22. */
  23. #ifndef __INCLUDE_UAPI_SOUND_SOF_USER_HEADER_H__
  24. #define __INCLUDE_UAPI_SOUND_SOF_USER_HEADER_H__
  25. #include <linux/types.h>
  26. /**
  27. * struct sof_abi_hdr - Header for all non IPC ABI data.
  28. * @magic: Magic number for validation
  29. * for IPC3 data: 0x00464F53 ('S', 'O', 'F', '\0')
  30. * for IPC4 data: 0x34464F53 ('S', 'O', 'F', '4')
  31. * @type: module specific parameter
  32. * for IPC3: Component specific type
  33. * for IPC4: parameter ID (param_id) of the data
  34. * @size: The size in bytes of the data, excluding this struct
  35. * @abi: SOF ABI version. The version is valid in scope of the 'magic', IPC3 and
  36. * IPC4 ABI version numbers have no relationship.
  37. * @reserved: Reserved for future use
  38. * @data: Component data - opaque to core
  39. *
  40. * Identifies data type, size and ABI.
  41. * Used by any bespoke component data structures or binary blobs.
  42. */
  43. struct sof_abi_hdr {
  44. __u32 magic;
  45. __u32 type;
  46. __u32 size;
  47. __u32 abi;
  48. __u32 reserved[4];
  49. __u32 data[];
  50. } __attribute__((packed));
  51. #define SOF_MANIFEST_DATA_TYPE_NHLT 1
  52. /**
  53. * struct sof_manifest_tlv - SOF manifest TLV data
  54. * @type: type of data
  55. * @size: data size (not including the size of this struct)
  56. * @data: payload data
  57. */
  58. struct sof_manifest_tlv {
  59. __le32 type;
  60. __le32 size;
  61. __u8 data[];
  62. };
  63. /**
  64. * struct sof_manifest - SOF topology manifest
  65. * @abi_major: Major ABI version
  66. * @abi_minor: Minor ABI version
  67. * @abi_patch: ABI patch
  68. * @count: count of tlv items
  69. * @items: consecutive variable size tlv items
  70. */
  71. struct sof_manifest {
  72. __le16 abi_major;
  73. __le16 abi_minor;
  74. __le16 abi_patch;
  75. __le16 count;
  76. struct sof_manifest_tlv items[];
  77. };
  78. #endif