Skip to content

Commit 119af89

Browse files
ranj063kv2019i
authored andcommitted
ipc4: handler: Handle the set/get large config IPCs for CONFIG_LIBRARY
Add the logic to copy the data to/from the mailbox when CONFIG_LIBRARY is enabled with the set_large_config and get_large_config IPCs. Also, make sure to copy the data to the mailbox along with the replay message. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1 parent 1956aec commit 119af89

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/ipc/ipc4/handler.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ static inline void ipc4_send_reply(struct ipc4_message_reply *reply)
8989
{
9090
struct ipc *ipc = ipc_get();
9191

92+
/* copy the extension from the message reply */
93+
reply->extension.dat = msg_reply.extension;
9294
memcpy((char *)ipc->comp_data, reply, sizeof(*reply));
9395
}
9496

@@ -1088,6 +1090,9 @@ static int ipc4_get_large_config_module_instance(struct ipc4_message_request *ip
10881090
data,
10891091
(const char *)MAILBOX_HOSTBOX_BASE);
10901092
} else {
1093+
#if CONFIG_LIBRARY
1094+
data += sizeof(reply);
1095+
#endif
10911096
ret = drv->ops.get_large_config(dev, config.extension.r.large_param_id,
10921097
config.extension.r.init_block,
10931098
config.extension.r.final_block,
@@ -1235,9 +1240,15 @@ static int ipc4_set_large_config_module_instance(struct ipc4_message_request *ip
12351240
config.extension.r.data_off_size,
12361241
(const char *)MAILBOX_HOSTBOX_BASE);
12371242
} else {
1243+
#if CONFIG_LIBRARY
1244+
struct ipc *ipc = ipc_get();
1245+
const char *data = (const char *)ipc->comp_data + sizeof(config);
1246+
#else
1247+
const char *data = (const char *)MAILBOX_HOSTBOX_BASE;
1248+
#endif
12381249
ret = drv->ops.set_large_config(dev, config.extension.r.large_param_id,
12391250
config.extension.r.init_block, config.extension.r.final_block,
1240-
config.extension.r.data_off_size, (const char *)MAILBOX_HOSTBOX_BASE);
1251+
config.extension.r.data_off_size, data);
12411252
if (ret < 0) {
12421253
ipc_cmd_err(&ipc_tr, "failed to set large_config_module_instance %x : %x",
12431254
(uint32_t)config.primary.r.module_id,

0 commit comments

Comments
 (0)