#include "ipc4-priv.h"
#include "ops.h"
-#ifdef DEBUG_VERBOSE
-#define sof_ipc4_dump_payload(sdev, ipc_data, size) \
- print_hex_dump_debug("Message payload: ", \
- DUMP_PREFIX_OFFSET, \
- 16, 4, ipc_data, size, false)
-#else
-#define sof_ipc4_dump_payload(sdev, ipc_data, size) do { } while (0)
-#endif
-
static const struct sof_ipc4_fw_status {
int status;
char *msg;
}
#endif
+static void sof_ipc4_dump_payload(struct snd_sof_dev *sdev,
+ void *ipc_data, size_t size)
+{
+ print_hex_dump_debug("Message payload: ", DUMP_PREFIX_OFFSET,
+ 16, 4, ipc_data, size, false);
+}
+
static int sof_ipc4_get_reply(struct snd_sof_dev *sdev)
{
struct snd_sof_ipc_msg *msg = sdev->msg;
void *reply_data, size_t reply_bytes, bool no_pm)
{
struct snd_sof_ipc *ipc = sdev->ipc;
-#ifdef DEBUG_VERBOSE
- struct sof_ipc4_msg *msg = NULL;
-#endif
int ret;
if (!msg_data)
ret = ipc4_tx_msg_unlocked(ipc, msg_data, msg_bytes, reply_data, reply_bytes);
- mutex_unlock(&ipc->tx_mutex);
+ if (sof_debug_check_flag(SOF_DBG_DUMP_IPC_MESSAGE_PAYLOAD)) {
+ struct sof_ipc4_msg *msg = NULL;
-#ifdef DEBUG_VERBOSE
- /* payload is indicated by non zero msg/reply_bytes */
- if (msg_bytes)
- msg = msg_data;
- else if (reply_bytes)
- msg = reply_data;
+ /* payload is indicated by non zero msg/reply_bytes */
+ if (msg_bytes)
+ msg = msg_data;
+ else if (reply_bytes)
+ msg = reply_data;
- if (msg)
- sof_ipc4_dump_payload(sdev, msg->data_ptr, msg->data_size);
-#endif
+ if (msg)
+ sof_ipc4_dump_payload(sdev, msg->data_ptr, msg->data_size);
+ }
+
+ mutex_unlock(&ipc->tx_mutex);
return ret;
}
if (!set && payload_bytes != offset)
ipc4_msg->data_size = offset;
- sof_ipc4_dump_payload(sdev, ipc4_msg->data_ptr, ipc4_msg->data_size);
+ if (sof_debug_check_flag(SOF_DBG_DUMP_IPC_MESSAGE_PAYLOAD))
+ sof_ipc4_dump_payload(sdev, ipc4_msg->data_ptr, ipc4_msg->data_size);
out:
mutex_unlock(&sdev->ipc->tx_mutex);