19 #include <linux/types.h>
46 #define REPLYSIZE (3 * sizeof(rms_word))
49 #define CHNLTORMSOFFSET 0
50 #define CHNLFROMRMSOFFSET 1
72 static void delete_disp(
struct disp_object *disp_obj);
75 u32 chars_in_rms_word);
77 u32 ul_bytes,
u32 *pdw_arg);
157 *dispatch_obj = disp_obj;
159 delete_disp(disp_obj);
170 delete_disp(disp_obj);
217 u32 chars_in_rms_word;
218 s32 task_args_offset;
219 s32 sio_in_def_offset;
220 s32 sio_out_def_offset;
222 s32 args_offset = -1;
246 (node_msg_args.
arg_length + chars_in_rms_word -
247 1) / chars_in_rms_word;
249 total =
sizeof(
struct rms_command) / sizeof(rms_word) +
250 sizeof(struct rms_msg_args)
251 / sizeof(rms_word) - 1 + dw_length;
254 dev_dbg(
bridge,
"%s: Message args too large for buffer! size "
255 "= %d, max = %d\n", __func__, total, max);
293 pdw_buf = (rms_word *) disp_obj->
buf;
311 total +=
sizeof(
struct rms_command) / sizeof(rms_word);
313 pmsg_args = (
struct rms_msg_args *)(pdw_buf + total);
315 pmsg_args->segid = node_msg_args.
seg_id;
316 pmsg_args->notify_type = node_msg_args.
notify_type;
317 pmsg_args->arg_length = node_msg_args.
arg_length;
318 total +=
sizeof(
struct rms_msg_args) / sizeof(rms_word) - 1;
329 task_args_offset = total;
331 1 + task_arg_obj.num_inputs + task_arg_obj.num_outputs;
334 total = task_args_offset;
346 task_arg_obj.sys_stack_size;
348 more_task_args->
heap_addr = task_arg_obj.dsp_heap_addr;
350 more_task_args->
misc = task_arg_obj.dais_arg;
352 task_arg_obj.num_inputs;
357 __func__, task_arg_obj.dsp_heap_addr,
362 sio_in_def_offset = total;
363 total += task_arg_obj.num_inputs;
364 pdw_buf[total++] = task_arg_obj.num_outputs;
365 sio_out_def_offset = total;
366 total += task_arg_obj.num_outputs;
367 sio_defs_offset = total;
369 offset = sio_defs_offset;
370 for (i = 0; i < task_arg_obj.num_inputs; i++) {
374 pdw_buf[sio_in_def_offset +
i] =
375 (offset - args_offset)
377 strm_def = task_arg_obj.strm_in_def[
i];
379 fill_stream_def(pdw_buf, &total, offset,
384 for (i = 0; (i < task_arg_obj.num_outputs) &&
386 pdw_buf[sio_out_def_offset +
i] =
387 (offset - args_offset)
389 strm_def = task_arg_obj.strm_out_def[
i];
391 fill_stream_def(pdw_buf, &total, offset,
402 ul_bytes = total *
sizeof(
rms_word);
492 static void delete_disp(
struct disp_object *disp_obj)
507 dev_dbg(bridge,
"%s: Failed to close channel "
508 "from RMS: 0x%x\n", __func__, status);
516 dev_dbg(bridge,
"%s: Failed to close channel to"
517 " RMS: 0x%x\n", __func__, status);
533 u32 chars_in_rms_word)
544 strm_def_obj = (
struct rms_strm_def *)(pdw_buf + total);
562 (dw_length + chars_in_rms_word - 1) / chars_in_rms_word;
564 if (total + name_len >= max) {
571 pdw_buf[total + name_len - 1] = 0;
587 u32 ul_bytes,
u32 *pdw_arg)
599 pbuf = disp_obj->
buf;
608 (*intf_fxns->
chnl_get_ioc) (chnl_obj, timeout, &chnl_ioc_obj);
629 (*intf_fxns->
chnl_get_ioc) (chnl_obj, timeout, &chnl_ioc_obj);
633 }
else if (chnl_ioc_obj.byte_size < ul_bytes) {
638 if (*((
int *)chnl_ioc_obj.buf) < 0) {
641 dev_dbg(bridge,
"%s: DSP-side failed:"
642 " DSP errcode = 0x%x, Kernel "
643 "errcode = %d\n", __func__,
644 *(
int *)pbuf, status);
647 (((
rms_word *) (chnl_ioc_obj.buf))[1]);