1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
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.
6 * Copyright(c) 2019-2020 Intel Corporation. All rights reserved.
8 * Author: Cezary Rojewski <cezary.rojewski@intel.com>
14 #include <sound/sof/header.h>
18 #define SOF_PROBE_INVALID_NODE_ID UINT_MAX
20 struct sof_probe_dma {
21 unsigned int stream_tag;
22 unsigned int dma_buffer_size;
25 enum sof_connection_purpose {
26 SOF_CONNECTION_PURPOSE_EXTRACT = 1,
27 SOF_CONNECTION_PURPOSE_INJECT,
30 struct sof_probe_point_desc {
31 unsigned int buffer_id;
33 unsigned int stream_tag;
36 struct sof_ipc_probe_dma_add_params {
37 struct sof_ipc_cmd_hdr hdr;
38 unsigned int num_elems;
39 struct sof_probe_dma dma[0];
42 struct sof_ipc_probe_info_params {
43 struct sof_ipc_reply rhdr;
44 unsigned int num_elems;
46 struct sof_probe_dma dma[0];
47 struct sof_probe_point_desc desc[0];
51 struct sof_ipc_probe_dma_remove_params {
52 struct sof_ipc_cmd_hdr hdr;
53 unsigned int num_elems;
54 unsigned int stream_tag[0];
57 struct sof_ipc_probe_point_add_params {
58 struct sof_ipc_cmd_hdr hdr;
59 unsigned int num_elems;
60 struct sof_probe_point_desc desc[0];
63 struct sof_ipc_probe_point_remove_params {
64 struct sof_ipc_cmd_hdr hdr;
65 unsigned int num_elems;
66 unsigned int buffer_id[0];
69 int sof_ipc_probe_init(struct snd_sof_dev *sdev,
70 u32 stream_tag, size_t buffer_size);
71 int sof_ipc_probe_deinit(struct snd_sof_dev *sdev);
72 int sof_ipc_probe_dma_info(struct snd_sof_dev *sdev,
73 struct sof_probe_dma **dma, size_t *num_dma);
74 int sof_ipc_probe_dma_add(struct snd_sof_dev *sdev,
75 struct sof_probe_dma *dma, size_t num_dma);
76 int sof_ipc_probe_dma_remove(struct snd_sof_dev *sdev,
77 unsigned int *stream_tag, size_t num_stream_tag);
78 int sof_ipc_probe_points_info(struct snd_sof_dev *sdev,
79 struct sof_probe_point_desc **desc, size_t *num_desc);
80 int sof_ipc_probe_points_add(struct snd_sof_dev *sdev,
81 struct sof_probe_point_desc *desc, size_t num_desc);
82 int sof_ipc_probe_points_remove(struct snd_sof_dev *sdev,
83 unsigned int *buffer_id, size_t num_buffer_id);