probe.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
  2. /*
  3. * This file is provided under a dual BSD/GPLv2 license. When using or
  4. * redistributing this file, you may do so under either license.
  5. *
  6. * Copyright(c) 2019-2020 Intel Corporation. All rights reserved.
  7. *
  8. * Author: Cezary Rojewski <cezary.rojewski@intel.com>
  9. */
  10. #ifndef __SOF_PROBE_H
  11. #define __SOF_PROBE_H
  12. #include <sound/sof/header.h>
  13. struct snd_sof_dev;
  14. #define SOF_PROBE_INVALID_NODE_ID UINT_MAX
  15. struct sof_probe_dma {
  16. unsigned int stream_tag;
  17. unsigned int dma_buffer_size;
  18. } __packed;
  19. enum sof_connection_purpose {
  20. SOF_CONNECTION_PURPOSE_EXTRACT = 1,
  21. SOF_CONNECTION_PURPOSE_INJECT,
  22. };
  23. struct sof_probe_point_desc {
  24. unsigned int buffer_id;
  25. unsigned int purpose;
  26. unsigned int stream_tag;
  27. } __packed;
  28. struct sof_ipc_probe_dma_add_params {
  29. struct sof_ipc_cmd_hdr hdr;
  30. unsigned int num_elems;
  31. struct sof_probe_dma dma[];
  32. } __packed;
  33. struct sof_ipc_probe_info_params {
  34. struct sof_ipc_reply rhdr;
  35. unsigned int num_elems;
  36. union {
  37. struct sof_probe_dma dma[0];
  38. struct sof_probe_point_desc desc[0];
  39. };
  40. } __packed;
  41. struct sof_ipc_probe_dma_remove_params {
  42. struct sof_ipc_cmd_hdr hdr;
  43. unsigned int num_elems;
  44. unsigned int stream_tag[];
  45. } __packed;
  46. struct sof_ipc_probe_point_add_params {
  47. struct sof_ipc_cmd_hdr hdr;
  48. unsigned int num_elems;
  49. struct sof_probe_point_desc desc[];
  50. } __packed;
  51. struct sof_ipc_probe_point_remove_params {
  52. struct sof_ipc_cmd_hdr hdr;
  53. unsigned int num_elems;
  54. unsigned int buffer_id[];
  55. } __packed;
  56. int sof_ipc_probe_init(struct snd_sof_dev *sdev,
  57. u32 stream_tag, size_t buffer_size);
  58. int sof_ipc_probe_deinit(struct snd_sof_dev *sdev);
  59. int sof_ipc_probe_dma_info(struct snd_sof_dev *sdev,
  60. struct sof_probe_dma **dma, size_t *num_dma);
  61. int sof_ipc_probe_dma_add(struct snd_sof_dev *sdev,
  62. struct sof_probe_dma *dma, size_t num_dma);
  63. int sof_ipc_probe_dma_remove(struct snd_sof_dev *sdev,
  64. unsigned int *stream_tag, size_t num_stream_tag);
  65. int sof_ipc_probe_points_info(struct snd_sof_dev *sdev,
  66. struct sof_probe_point_desc **desc, size_t *num_desc);
  67. int sof_ipc_probe_points_add(struct snd_sof_dev *sdev,
  68. struct sof_probe_point_desc *desc, size_t num_desc);
  69. int sof_ipc_probe_points_remove(struct snd_sof_dev *sdev,
  70. unsigned int *buffer_id, size_t num_buffer_id);
  71. #endif