Sound Open Firmware
Loading...
Searching...
No Matches
userspace_proxy_user.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 *
3 * Copyright(c) 2025 Intel Corporation. All rights reserved.
4 *
5 * Author: Adrian Warecki <adrian.warecki@intel.com>
6 */
7
8#ifndef __SOF_AUDIO_USERSPACE_PROXY_USER_H__
9#define __SOF_AUDIO_USERSPACE_PROXY_USER_H__
10
11#if CONFIG_SOF_USERSPACE_PROXY
12struct module_agent_params {
13 system_agent_start_fn start_fn;
14 struct system_agent_params params;
15 byte_array_t mod_cfg;
16 const void *out_interface;
17};
18
19struct module_large_cfg_set_params {
20 uint32_t config_id;
21 enum module_cfg_fragment_position pos;
22 uint32_t data_off_size;
23 const uint8_t *fragment;
24 size_t fragment_size;
25 uint8_t *response;
26 size_t response_size;
27};
28
29struct module_large_cfg_get_params {
30 uint32_t config_id;
31 uint32_t *data_off_size;
32 uint8_t *fragment;
33 size_t fragment_size;
34};
35
36struct module_processing_mode_params {
37 enum module_processing_mode mode;
38};
39
40struct module_process_params {
41 struct sof_source **sources;
42 int num_of_sources;
43 struct sof_sink **sinks;
44 int num_of_sinks;
45};
46
47enum userspace_proxy_cmd {
48 USER_PROXY_MOD_CMD_AGENT_START,
49 USER_PROXY_MOD_CMD_INIT,
50 USER_PROXY_MOD_CMD_PREPARE,
51 USER_PROXY_MOD_CMD_PROC_READY,
52 USER_PROXY_MOD_CMD_SET_PROCMOD,
53 USER_PROXY_MOD_CMD_GET_PROCMOD,
54 USER_PROXY_MOD_CMD_SET_CONF,
55 USER_PROXY_MOD_CMD_GET_CONF,
56 USER_PROXY_MOD_CMD_BIND,
57 USER_PROXY_MOD_CMD_UNBIND,
58 USER_PROXY_MOD_CMD_RESET,
59 USER_PROXY_MOD_CMD_FREE,
60 USER_PROXY_MOD_CMD_TRIGGER
61};
62
63struct module_params {
64 enum userspace_proxy_cmd cmd;
65 int status;
66 struct processing_module *mod;
67 struct userspace_context *context;
68 /* The field used in the union depends on the value of cmd */
69 union {
70 struct module_agent_params agent;
71 struct module_large_cfg_set_params set_conf;
72 struct module_large_cfg_get_params get_conf;
73 struct module_processing_mode_params proc_mode;
74 struct module_process_params proc;
75 const struct bind_info *bind_data;
76 int trigger_data;
77 } ext;
78};
79
80struct user_work_item {
81 struct k_work_user work_item; /* ipc worker workitem */
82 struct k_event *event; /* ipc worker done event */
83 struct module_params params;
84};
85
86void userspace_proxy_handle_request(struct processing_module *mod, struct module_params *params);
87
88void userspace_proxy_worker_handler(struct k_work_user *work_item);
89
90#endif /* CONFIG_SOF_USERSPACE_PROXY */
91
92#endif /* __SOF_AUDIO_USERSPACE_PROXY_USER_H__ */
int(* system_agent_start_fn)(const struct system_agent_params *params, const void **adapter)
Definition native_system_agent.h:23