19 #include <linux/types.h>
56 #define MAX_TRACEBUFLEN 255
57 #define MAX_LOADARGS 16
59 #define MAX_STREAMS 16
63 #define DB_GET_IOC_TABLE(cmd) (DB_GET_MODULE(cmd) >> DB_MODULE_SHIFT)
72 static u32 api_c_refs;
82 static struct api_cmd mgr_cmd[] = {
92 static struct api_cmd proc_cmd[] = {
115 static struct api_cmd node_cmd[] = {
134 static struct api_cmd strm_cmd[] = {
149 static struct api_cmd cmm_cmd[] = {
157 static u8 size_cmd[] = {
165 static inline void _cp_fm_usr(
void *to,
const void __user *
from,
180 #define CP_FM_USR(to, from, err, n) \
181 _cp_fm_usr(to, from, &(err), (n) * sizeof(*(to)))
183 static inline void _cp_to_usr(
void __user *to,
const void *from,
184 int *err,
unsigned long bytes)
198 #define CP_TO_USR(to, from, err, n) \
199 _cp_to_usr(to, from, &(err), (n) * sizeof(*(from)))
213 pr_err(
"%s: Incompatible dspbridge ioctl number\n", __func__);
218 pr_err(
"%s: undefined ioctl module\n", __func__);
225 pr_err(
"%s: requested ioctl %d out of bounds for table %d\n",
232 ioctl_cmd = mgr_cmd[
i].
fxn;
235 ioctl_cmd = proc_cmd[
i].
fxn;
238 ioctl_cmd = node_cmd[
i].
fxn;
241 ioctl_cmd = strm_cmd[
i].
fxn;
244 ioctl_cmd = cmm_cmd[
i].
fxn;
249 pr_err(
"%s: requested ioctl not defined\n", __func__);
252 *result = (*ioctl_cmd) (
args, pr_ctxt);
308 struct cfg_devnode *dev_node;
327 if (drv_datap && drv_datap->
base_img)
351 if (pndb_props ==
NULL)
383 if (processor_info ==
NULL)
391 processor_info, size, &num_procs);
397 kfree(processor_info);
402 #define WRAP_MAP2CALLER(x) x
411 char *psz_path_name =
NULL;
422 if (!psz_path_name) {
428 sz_path_name, path_size);
441 (
char *)psz_path_name);
443 kfree(psz_path_name);
478 if (count > MAX_EVENTS)
485 for (i = 0; i <
count; i++) {
486 CP_FM_USR(¬ifications[i], anotifications[i], status, 1);
487 if (status || !notifications[i].
handle) {
492 anotifications[
i] = ¬ifications[
i];
510 pr_err(
"%s: deprecated dspbridge ioctl\n", __func__);
528 attr_in = &proc_attr_in;
534 &processor, pr_ctxt);
552 if (
get_user(cb_data_size, psize)) {
556 cb_data_size +=
sizeof(
u32);
584 pr_err(
"%s: deprecated dspbridge ioctl\n", __func__);
605 &num_nodes, &alloc_cnt);
779 for (i = 0; i <
count; i++) {
782 temp = (
char *)argv[i];
824 for (i = 0; envp[
i]; i++) {
826 temp = (
char *)envp[i];
848 (
const char **)argv, (
const char **)envp);
861 for (i = 0; (i <
count) && argv[i]; i++)
998 void *pr_ctxt,
void *hnode)
1015 u32 cb_data_size = 0;
1028 cb_data_size +=
sizeof(
u32);
1046 attr_in = &proc_attr_in;
1054 attr_in, &node_res, pr_ctxt);
1057 nodeid = node_res->id + 1;
1146 node1 = node_res1->node;
1155 node2 = node_res2->node;
1160 if (!node1 || !node2)
1168 cb_data_size +=
sizeof(
u32);
1171 if (pargs ==
NULL) {
1444 if (pnode_props !=
NULL) {
1460 void *pr_ctxt,
void *hstream)
1489 if (ap_buffer ==
NULL)
1494 ap_buffer, num_bufs, pr_ctxt);
1501 ap_buffer, num_bufs, pr_ctxt);
1544 if (ap_buffer ==
NULL)
1552 ap_buffer, num_bufs, pr_ctxt);
1567 pr_err(
"%s: deprecated dspbridge ioctl\n", __func__);
1684 strmid = strm_res_obj->
id + 1;
1708 &ul_bytes, &ul_buf_size, &dw_arg);
1777 strm_tab[
i] = strm_res->
stream;
1796 pr_err(
"%s: deprecated dspbridge ioctl\n", __func__);
1806 pr_err(
"%s: deprecated dspbridge ioctl\n", __func__);