Skip to content

Commit 682892d

Browse files
committed
ipc4: handler: Add support for rx payload with LARGE_CONFIG_GET messages
Some LARGE_CONFIG_GET message includes payload to provide instructions to the handler modules on how to fulfill the request. The generic control messages are such examples (they are not related to VENDOR_CONFIG_PARAM messages): The payload from host includes the sof_ipc4_control_msg_payload struct to describe the ID of the control fro example. Alone the type (enum, switch or bytes) is not enough to know _which_ control's information is requested. Similarly, the control's ID does not identify the control's type. When such generic control message is received, the payload is coped from hostbox to the comp_data and the handler module can inspect it before overwriting it with the requested data. Note: currently we don't have modules which would handle generic control get functionality, but they would not worked, because the information was not available to them to decide which control's data needs to be returned. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent a1d31ff commit 682892d

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

src/ipc/ipc4/handler.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,25 @@ static int ipc4_set_get_config_module_instance(struct ipc4_message_request *ipc4
996996
return ret;
997997
}
998998

999+
__cold static void
1000+
ipc4_prepare_for_kcontrol_get(struct comp_dev *dev, uint8_t param_id,
1001+
uint32_t data_size, const char *data_in,
1002+
char *data_out)
1003+
{
1004+
switch (param_id) {
1005+
case SOF_IPC4_SWITCH_CONTROL_PARAM_ID:
1006+
case SOF_IPC4_ENUM_CONTROL_PARAM_ID:
1007+
case SOF_IPC4_BYTES_CONTROL_PARAM_ID:
1008+
break;
1009+
default:
1010+
return;
1011+
}
1012+
1013+
/* Copy the control payload header from inbox to outbox */
1014+
memcpy_s(data_out, data_size,
1015+
data_in, sizeof(struct sof_ipc4_control_msg_payload));
1016+
}
1017+
9991018
__cold static int ipc4_get_vendor_config_module_instance(struct comp_dev *dev,
10001019
const struct comp_driver *drv,
10011020
bool init_block,
@@ -1154,6 +1173,10 @@ __cold static int ipc4_get_large_config_module_instance(struct ipc4_message_requ
11541173
#if CONFIG_LIBRARY
11551174
data += sizeof(reply);
11561175
#endif
1176+
ipc4_prepare_for_kcontrol_get(dev, config.extension.r.large_param_id,
1177+
data_offset,
1178+
(const char *)MAILBOX_HOSTBOX_BASE, data);
1179+
11571180
ret = drv->ops.get_large_config(dev, config.extension.r.large_param_id,
11581181
config.extension.r.init_block,
11591182
config.extension.r.final_block,

0 commit comments

Comments
 (0)