From 0c2f1a6cdce4b44556dc640a7db77d1e337c10b0 Mon Sep 17 00:00:00 2001 From: Keyon Jie Date: Thu, 27 Jun 2019 17:03:36 +0800 Subject: [PATCH] sof-ctl: add header_init() for abi header initialization This will be needed for raw data(without abi header) input file. Signed-off-by: Keyon Jie --- tools/ctl/ctl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/ctl/ctl.c b/tools/ctl/ctl.c index 41d96d7a4..e436e3414 100644 --- a/tools/ctl/ctl.c +++ b/tools/ctl/ctl.c @@ -66,6 +66,16 @@ static void usage(char *name) fprintf(stdout, " -b set/get control in binary mode(e.g. for set, use binary input file, for get, dump out in hex format)\n"); } +static void header_init(struct ctl_data *ctl_data) +{ + struct sof_abi_hdr *hdr = + (struct sof_abi_hdr *)&ctl_data->buffer[2]; + + hdr->magic = SOF_ABI_MAGIC; + hdr->type = 0; + hdr->abi = SOF_ABI_VERSION; +} + static int read_setup(struct ctl_data *ctl_data) { FILE *fh;