From 4097c4968cd60bf5c690455466731d11149fe43f Mon Sep 17 00:00:00 2001 From: "Guzman Lugo, Fernando" Date: Tue, 26 Oct 2010 00:51:46 +0000 Subject: staging: tidspbridge: make sync_wait_on_event interruptible So that avoid non-killable process. Signed-off-by: Fernando Guzman Lugo Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/include/dspbridge/sync.h b/drivers/staging/tidspbridge/include/dspbridge/sync.h index e2651e7..df05b8f 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/sync.h +++ b/drivers/staging/tidspbridge/include/dspbridge/sync.h @@ -80,13 +80,22 @@ void sync_set_event(struct sync_object *event); * This functios will wait until @event is set or until timeout. In case of * success the function will return 0 and * in case of timeout the function will return -ETIME + * in case of signal the function will return -ERESTARTSYS */ static inline int sync_wait_on_event(struct sync_object *event, unsigned timeout) { - return wait_for_completion_timeout(&event->comp, - msecs_to_jiffies(timeout)) ? 0 : -ETIME; + int res; + + res = wait_for_completion_interruptible_timeout(&event->comp, + msecs_to_jiffies(timeout)); + if (!res) + res = -ETIME; + else if (res > 0) + res = 0; + + return res; } /** -- cgit v0.10.2 From 98d0ba892536141ba047ecbe60b32e34c11834df Mon Sep 17 00:00:00 2001 From: "Sapiens, Rene" Date: Thu, 4 Nov 2010 00:31:24 +0000 Subject: staging: tidspbridge: overwrite DSP error codes When calling the DSP's remote functions, the DSP returns error codes different from the ones managed by the kernel, the function's return value is shared with the MPU using a shared structure. This patch overwrites those error codes by kernel specifics and deletes unnecessary code. Signed-off-by: Rene Sapiens Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/rmgr/disp.c b/drivers/staging/tidspbridge/rmgr/disp.c index b7ce435..560069a 100644 --- a/drivers/staging/tidspbridge/rmgr/disp.c +++ b/drivers/staging/tidspbridge/rmgr/disp.c @@ -460,17 +460,6 @@ int disp_node_create(struct disp_object *disp_obj, DBC_ASSERT(ul_bytes < (RMS_COMMANDBUFSIZE * sizeof(rms_word))); status = send_message(disp_obj, node_get_timeout(hnode), ul_bytes, node_env); - if (status >= 0) { - /* - * Message successfully received from RMS. - * Return the status of the Node's create function - * on the DSP-side - */ - status = (((rms_word *) (disp_obj->pbuf))[0]); - if (status < 0) - dev_dbg(bridge, "%s: DSP-side failed: 0x%x\n", - __func__, status); - } } func_end: return status; @@ -513,18 +502,6 @@ int disp_node_delete(struct disp_object *disp_obj, status = send_message(disp_obj, node_get_timeout(hnode), sizeof(struct rms_command), &dw_arg); - if (status >= 0) { - /* - * Message successfully received from RMS. - * Return the status of the Node's delete - * function on the DSP-side - */ - status = (((rms_word *) (disp_obj->pbuf))[0]); - if (status < 0) - dev_dbg(bridge, "%s: DSP-side failed: " - "0x%x\n", __func__, status); - } - } } return status; @@ -566,18 +543,6 @@ int disp_node_run(struct disp_object *disp_obj, status = send_message(disp_obj, node_get_timeout(hnode), sizeof(struct rms_command), &dw_arg); - if (status >= 0) { - /* - * Message successfully received from RMS. - * Return the status of the Node's execute - * function on the DSP-side - */ - status = (((rms_word *) (disp_obj->pbuf))[0]); - if (status < 0) - dev_dbg(bridge, "%s: DSP-side failed: " - "0x%x\n", __func__, status); - } - } } @@ -739,7 +704,14 @@ static int send_message(struct disp_object *disp_obj, u32 timeout, } else { if (CHNL_IS_IO_COMPLETE(chnl_ioc_obj)) { DBC_ASSERT(chnl_ioc_obj.pbuf == pbuf); - status = (*((rms_word *) chnl_ioc_obj.pbuf)); + if (*((int *)chnl_ioc_obj.pbuf) < 0) { + /* Translate DSP's to kernel error */ + status = -EREMOTEIO; + dev_dbg(bridge, "%s: DSP-side failed:" + " DSP errcode = 0x%x, Kernel " + "errcode = %d\n", __func__, + *(int *)pbuf, status); + } *pdw_arg = (((rms_word *) (chnl_ioc_obj.pbuf))[1]); } else { -- cgit v0.10.2 From 81ea18ec22e9526b4af81e2213747e5afc48f364 Mon Sep 17 00:00:00 2001 From: Armando Uribe Date: Mon, 1 Nov 2010 17:15:50 -0600 Subject: staging: tidspbridge: Eliminate direct manipulation of OMAP_SYSC_BASE Eliminates Bridge direct manipulation of OMAP_SYSC_BASE registers Signed-off-by: Armando Uribe Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/core/dsp-clock.c b/drivers/staging/tidspbridge/core/dsp-clock.c index 46d17c7..589a055 100644 --- a/drivers/staging/tidspbridge/core/dsp-clock.c +++ b/drivers/staging/tidspbridge/core/dsp-clock.c @@ -146,54 +146,6 @@ void dsp_clk_init(void) ssi.sst_fck, ssi.ssr_fck, ssi.ick); } -#ifdef CONFIG_OMAP_MCBSP -static void mcbsp_clk_prepare(bool flag, u8 id) -{ - struct cfg_hostres *resources; - struct dev_object *hdev_object = NULL; - struct bridge_dev_context *bridge_context = NULL; - u32 val; - - hdev_object = (struct dev_object *)drv_get_first_dev_object(); - if (!hdev_object) - return; - - dev_get_bridge_context(hdev_object, &bridge_context); - if (!bridge_context) - return; - - resources = bridge_context->resources; - if (!resources) - return; - - if (flag) { - if (id == DSP_CLK_MCBSP1) { - /* set MCBSP1_CLKS, on McBSP1 ON */ - val = __raw_readl(resources->dw_sys_ctrl_base + 0x274); - val |= 1 << 2; - __raw_writel(val, resources->dw_sys_ctrl_base + 0x274); - } else if (id == DSP_CLK_MCBSP2) { - /* set MCBSP2_CLKS, on McBSP2 ON */ - val = __raw_readl(resources->dw_sys_ctrl_base + 0x274); - val |= 1 << 6; - __raw_writel(val, resources->dw_sys_ctrl_base + 0x274); - } - } else { - if (id == DSP_CLK_MCBSP1) { - /* clear MCBSP1_CLKS, on McBSP1 OFF */ - val = __raw_readl(resources->dw_sys_ctrl_base + 0x274); - val &= ~(1 << 2); - __raw_writel(val, resources->dw_sys_ctrl_base + 0x274); - } else if (id == DSP_CLK_MCBSP2) { - /* clear MCBSP2_CLKS, on McBSP2 OFF */ - val = __raw_readl(resources->dw_sys_ctrl_base + 0x274); - val &= ~(1 << 6); - __raw_writel(val, resources->dw_sys_ctrl_base + 0x274); - } - } -} -#endif - /** * dsp_gpt_wait_overflow - set gpt overflow and wait for fixed timeout * @clk_id: GP Timer clock id. @@ -257,9 +209,9 @@ int dsp_clk_enable(enum dsp_clk_id clk_id) break; #ifdef CONFIG_OMAP_MCBSP case MCBSP_CLK: - mcbsp_clk_prepare(true, clk_id); omap_mcbsp_set_io_type(MCBSP_ID(clk_id), OMAP_MCBSP_POLL_IO); omap_mcbsp_request(MCBSP_ID(clk_id)); + omap2_mcbsp_set_clks_src(MCBSP_ID(clk_id), MCBSP_CLKS_PAD_SRC); break; #endif case WDT_CLK: @@ -334,7 +286,7 @@ int dsp_clk_disable(enum dsp_clk_id clk_id) break; #ifdef CONFIG_OMAP_MCBSP case MCBSP_CLK: - mcbsp_clk_prepare(false, clk_id); + omap2_mcbsp_set_clks_src(MCBSP_ID(clk_id), MCBSP_CLKS_PRCM_SRC); omap_mcbsp_free(MCBSP_ID(clk_id)); break; #endif diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c index a3f69f6..2ae7e44 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430.c +++ b/drivers/staging/tidspbridge/core/tiomap3430.c @@ -1036,15 +1036,12 @@ static int bridge_dev_destroy(struct bridge_dev_context *dev_ctxt) iounmap((void *)host_res->dw_per_pm_base); if (host_res->dw_core_pm_base) iounmap((void *)host_res->dw_core_pm_base); - if (host_res->dw_sys_ctrl_base) - iounmap(host_res->dw_sys_ctrl_base); host_res->dw_mem_base[0] = (u32) NULL; host_res->dw_mem_base[2] = (u32) NULL; host_res->dw_mem_base[3] = (u32) NULL; host_res->dw_mem_base[4] = (u32) NULL; host_res->dw_dmmu_base = NULL; - host_res->dw_sys_ctrl_base = NULL; kfree(host_res); } diff --git a/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h b/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h index 38122db..f403c01 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h @@ -69,7 +69,6 @@ struct cfg_hostres { u32 dw_per_pm_base; u32 dw_core_pm_base; void __iomem *dw_dmmu_base; - void __iomem *dw_sys_ctrl_base; }; struct cfg_dspmemdesc { diff --git a/drivers/staging/tidspbridge/include/dspbridge/drv.h b/drivers/staging/tidspbridge/include/dspbridge/drv.h index c1f363e..37f5a45 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/drv.h +++ b/drivers/staging/tidspbridge/include/dspbridge/drv.h @@ -65,9 +65,6 @@ #define OMAP_CORE_PRM_BASE 0x48306A00 #define OMAP_CORE_PRM_SIZE 0x1000 -#define OMAP_SYSC_BASE 0x48002000 -#define OMAP_SYSC_SIZE 0x1000 - #define OMAP_DMMU_BASE 0x5D000000 #define OMAP_DMMU_SIZE 0x1000 diff --git a/drivers/staging/tidspbridge/rmgr/drv.c b/drivers/staging/tidspbridge/rmgr/drv.c index 81b1b90..c50579c 100644 --- a/drivers/staging/tidspbridge/rmgr/drv.c +++ b/drivers/staging/tidspbridge/rmgr/drv.c @@ -740,7 +740,6 @@ static int request_bridge_resources(struct cfg_hostres *res) host_res->num_mem_windows = 2; /* First window is for DSP internal memory */ - host_res->dw_sys_ctrl_base = ioremap(OMAP_SYSC_BASE, OMAP_SYSC_SIZE); dev_dbg(bridge, "dw_mem_base[0] 0x%x\n", host_res->dw_mem_base[0]); dev_dbg(bridge, "dw_mem_base[3] 0x%x\n", host_res->dw_mem_base[3]); dev_dbg(bridge, "dw_dmmu_base %p\n", host_res->dw_dmmu_base); -- cgit v0.10.2 From d723818e7c8f20af0a665f5b0c2eda909e069ffa Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Fri, 5 Nov 2010 17:01:48 +0000 Subject: staging: tidspbridge: fix mgr_enum_node_info The current code was always returning a non-zero status value to userspace applications when this ioctl was called. The error code was ENODATA, which isn't actually an error, it's always returned by dcd_enumerate_object() when it hits the end of list. Signed-off-by: Felipe Contreras Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/rmgr/mgr.c b/drivers/staging/tidspbridge/rmgr/mgr.c index 0ea89a1..2eab6a5 100644 --- a/drivers/staging/tidspbridge/rmgr/mgr.c +++ b/drivers/staging/tidspbridge/rmgr/mgr.c @@ -169,6 +169,11 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops *pndb_props, } } + + /* the last status is not 0, but neither an error */ + if (status > 0) + status = 0; + if (!status) { if (node_id > (node_index - 1)) { status = -EINVAL; -- cgit v0.10.2 From 59403c21afdcd2e89aeadc73b99ccd82d32733b3 Mon Sep 17 00:00:00 2001 From: Ionut Nicu Date: Fri, 5 Nov 2010 17:01:49 +0000 Subject: staging: tidspbridge: mgr_enum_node_info cleanup Reorganized mgr_enum_node_info code to increase its readability. Signed-off-by: Ionut Nicu Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/rmgr/mgr.c b/drivers/staging/tidspbridge/rmgr/mgr.c index 2eab6a5..16410a5 100644 --- a/drivers/staging/tidspbridge/rmgr/mgr.c +++ b/drivers/staging/tidspbridge/rmgr/mgr.c @@ -134,8 +134,7 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops *pndb_props, u32 undb_props_size, u32 *pu_num_nodes) { int status = 0; - struct dsp_uuid node_uuid, temp_uuid; - u32 temp_index = 0; + struct dsp_uuid node_uuid; u32 node_index = 0; struct dcd_genericobj gen_obj; struct mgr_object *pmgr_obj = NULL; @@ -149,24 +148,27 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops *pndb_props, *pu_num_nodes = 0; /* Get the Manager Object from the driver data */ if (!drv_datap || !drv_datap->mgr_object) { - status = -ENODATA; pr_err("%s: Failed to retrieve the object handle\n", __func__); - goto func_cont; - } else { - pmgr_obj = drv_datap->mgr_object; + return -ENODATA; } + pmgr_obj = drv_datap->mgr_object; DBC_ASSERT(pmgr_obj); /* Forever loop till we hit failed or no more items in the * Enumeration. We will exit the loop other than 0; */ - while (status == 0) { - status = dcd_enumerate_object(temp_index++, DSP_DCDNODETYPE, - &temp_uuid); - if (status == 0) { - node_index++; - if (node_id == (node_index - 1)) - node_uuid = temp_uuid; - + while (!status) { + status = dcd_enumerate_object(node_index++, DSP_DCDNODETYPE, + &node_uuid); + if (status) + break; + *pu_num_nodes = node_index; + if (node_id == (node_index - 1)) { + status = dcd_get_object_def(pmgr_obj->hdcd_mgr, + &node_uuid, DSP_DCDNODETYPE, &gen_obj); + if (status) + break; + /* Get the Obj def */ + *pndb_props = gen_obj.obj_data.node_obj.ndb_props; } } @@ -174,27 +176,6 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops *pndb_props, if (status > 0) status = 0; - if (!status) { - if (node_id > (node_index - 1)) { - status = -EINVAL; - } else { - status = dcd_get_object_def(pmgr_obj->hdcd_mgr, - (struct dsp_uuid *) - &node_uuid, DSP_DCDNODETYPE, - &gen_obj); - if (!status) { - /* Get the Obj def */ - *pndb_props = - gen_obj.obj_data.node_obj.ndb_props; - *pu_num_nodes = node_index; - } - } - } - -func_cont: - DBC_ENSURE((!status && *pu_num_nodes > 0) || - (status && *pu_num_nodes == 0)); - return status; } -- cgit v0.10.2 From 74c2d1f63f6fff26503f538ddacf0e45feb15f0d Mon Sep 17 00:00:00 2001 From: Ionut Nicu Date: Fri, 5 Nov 2010 17:01:50 +0000 Subject: staging: tidspbridge: fix kernel oops in bridge_io_get_proc_load The DSP shared memory area gets initialized only when a COFF file is loaded. If bridge_io_get_proc_load is called before loading a base image into the DSP, the shared_mem member of the io manager will be NULL, resulting in a kernel oops when it's dereferenced. Also made some coding style changes to bridge_io_create. Signed-off-by: Ionut Nicu Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index 27e0aa8..9cea3ea 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c @@ -167,57 +167,41 @@ int bridge_io_create(struct io_mgr **io_man, struct dev_object *hdev_obj, const struct io_attrs *mgr_attrts) { - int status = 0; struct io_mgr *pio_mgr = NULL; - struct shm *shared_mem = NULL; struct bridge_dev_context *hbridge_context = NULL; struct cfg_devnode *dev_node_obj; struct chnl_mgr *hchnl_mgr; u8 dev_type; /* Check requirements */ - if (!io_man || !mgr_attrts || mgr_attrts->word_size == 0) { - status = -EFAULT; - goto func_end; - } + if (!io_man || !mgr_attrts || mgr_attrts->word_size == 0) + return -EFAULT; + + *io_man = NULL; + dev_get_chnl_mgr(hdev_obj, &hchnl_mgr); - if (!hchnl_mgr || hchnl_mgr->hio_mgr) { - status = -EFAULT; - goto func_end; - } + if (!hchnl_mgr || hchnl_mgr->hio_mgr) + return -EFAULT; + /* * Message manager will be created when a file is loaded, since * size of message buffer in shared memory is configurable in * the base image. */ dev_get_bridge_context(hdev_obj, &hbridge_context); - if (!hbridge_context) { - status = -EFAULT; - goto func_end; - } + if (!hbridge_context) + return -EFAULT; + dev_get_dev_type(hdev_obj, &dev_type); - /* - * DSP shared memory area will get set properly when - * a program is loaded. They are unknown until a COFF file is - * loaded. I chose the value -1 because it was less likely to be - * a valid address than 0. - */ - shared_mem = (struct shm *)-1; /* Allocate IO manager object */ pio_mgr = kzalloc(sizeof(struct io_mgr), GFP_KERNEL); - if (pio_mgr == NULL) { - status = -ENOMEM; - goto func_end; - } + if (!pio_mgr) + return -ENOMEM; /* Initialize chnl_mgr object */ -#if defined(CONFIG_TIDSPBRIDGE_BACKTRACE) || defined(CONFIG_TIDSPBRIDGE_DEBUG) - pio_mgr->pmsg = NULL; -#endif pio_mgr->hchnl_mgr = hchnl_mgr; pio_mgr->word_size = mgr_attrts->word_size; - pio_mgr->shared_mem = shared_mem; if (dev_type == DSP_UNIT) { /* Create an IO DPC */ @@ -229,29 +213,24 @@ int bridge_io_create(struct io_mgr **io_man, spin_lock_init(&pio_mgr->dpc_lock); - status = dev_get_dev_node(hdev_obj, &dev_node_obj); + if (dev_get_dev_node(hdev_obj, &dev_node_obj)) { + bridge_io_destroy(pio_mgr); + return -EIO; + } } - if (!status) { - pio_mgr->hbridge_context = hbridge_context; - pio_mgr->shared_irq = mgr_attrts->irq_shared; - if (dsp_wdt_init()) - status = -EPERM; - } else { - status = -EIO; - } -func_end: - if (status) { - /* Cleanup */ + pio_mgr->hbridge_context = hbridge_context; + pio_mgr->shared_irq = mgr_attrts->irq_shared; + if (dsp_wdt_init()) { bridge_io_destroy(pio_mgr); - if (io_man) - *io_man = NULL; - } else { - /* Return IO manager object to caller... */ - hchnl_mgr->hio_mgr = pio_mgr; - *io_man = pio_mgr; + return -EPERM; } - return status; + + /* Return IO manager object to caller... */ + hchnl_mgr->hio_mgr = pio_mgr; + *io_man = pio_mgr; + + return 0; } /* @@ -1714,6 +1693,9 @@ int io_sh_msetting(struct io_mgr *hio_mgr, u8 desc, void *pargs) int bridge_io_get_proc_load(struct io_mgr *hio_mgr, struct dsp_procloadstat *proc_lstat) { + if (!hio_mgr->shared_mem) + return -EFAULT; + proc_lstat->curr_load = hio_mgr->shared_mem->load_mon_info.curr_dsp_load; proc_lstat->predicted_load = -- cgit v0.10.2 From 31de278078aeb869467cbde0877d7f1027ab844c Mon Sep 17 00:00:00 2001 From: Ionut Nicu Date: Sun, 21 Nov 2010 10:46:19 +0000 Subject: staging: tidspbridge: remove gs memory allocator Remove unnecessary wrappers for linux kernel memory allocation primitives. Signed-off-by: Ionut Nicu Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/Makefile b/drivers/staging/tidspbridge/Makefile index 41c644c..648e392 100644 --- a/drivers/staging/tidspbridge/Makefile +++ b/drivers/staging/tidspbridge/Makefile @@ -1,6 +1,6 @@ obj-$(CONFIG_TIDSPBRIDGE) += bridgedriver.o -libgen = gen/gb.o gen/gs.o gen/gh.o gen/uuidutil.o +libgen = gen/gb.o gen/gh.o gen/uuidutil.o libcore = core/chnl_sm.o core/msg_sm.o core/io_sm.o core/tiomap3430.o \ core/tiomap3430_pwr.o core/tiomap_io.o \ core/ue_deh.o core/wdt.o core/dsp-clock.o core/sync.o diff --git a/drivers/staging/tidspbridge/gen/gb.c b/drivers/staging/tidspbridge/gen/gb.c index 9f59023..3c0e04c 100644 --- a/drivers/staging/tidspbridge/gen/gb.c +++ b/drivers/staging/tidspbridge/gen/gb.c @@ -19,7 +19,6 @@ /* ----------------------------------- DSP/BIOS Bridge */ #include /* ----------------------------------- This */ -#include #include struct gb_t_map { @@ -52,17 +51,17 @@ struct gb_t_map *gb_create(u32 len) { struct gb_t_map *map; u32 i; - map = (struct gb_t_map *)gs_alloc(sizeof(struct gb_t_map)); + map = kzalloc(sizeof(struct gb_t_map), GFP_KERNEL); if (map != NULL) { map->len = len; map->wcnt = len / BITS_PER_LONG + 1; - map->words = (u32 *) gs_alloc(map->wcnt * sizeof(u32)); + map->words = kzalloc(map->wcnt * sizeof(u32), GFP_KERNEL); if (map->words != NULL) { for (i = 0; i < map->wcnt; i++) map->words[i] = 0L; } else { - gs_frees(map, sizeof(struct gb_t_map)); + kfree(map); map = NULL; } } @@ -78,8 +77,8 @@ struct gb_t_map *gb_create(u32 len) void gb_delete(struct gb_t_map *map) { - gs_frees(map->words, map->wcnt * sizeof(u32)); - gs_frees(map, sizeof(struct gb_t_map)); + kfree(map->words); + kfree(map); } /* diff --git a/drivers/staging/tidspbridge/gen/gh.c b/drivers/staging/tidspbridge/gen/gh.c index f72d943..cd72503 100644 --- a/drivers/staging/tidspbridge/gen/gh.c +++ b/drivers/staging/tidspbridge/gen/gh.c @@ -17,9 +17,6 @@ #include #include - -#include - #include struct element { @@ -37,8 +34,6 @@ struct gh_t_hash_tab { }; static void noop(void *p); -static s32 cur_init; -static void myfree(void *ptr, s32 size); /* * ======== gh_create ======== @@ -51,8 +46,7 @@ struct gh_t_hash_tab *gh_create(u16 max_bucket, u16 val_size, { struct gh_t_hash_tab *hash_tab; u16 i; - hash_tab = - (struct gh_t_hash_tab *)gs_alloc(sizeof(struct gh_t_hash_tab)); + hash_tab = kzalloc(sizeof(struct gh_t_hash_tab), GFP_KERNEL); if (hash_tab == NULL) return NULL; hash_tab->max_bucket = max_bucket; @@ -62,7 +56,7 @@ struct gh_t_hash_tab *gh_create(u16 max_bucket, u16 val_size, hash_tab->delete = delete == NULL ? noop : delete; hash_tab->buckets = (struct element **) - gs_alloc(sizeof(struct element *) * max_bucket); + kzalloc(sizeof(struct element *) * max_bucket, GFP_KERNEL); if (hash_tab->buckets == NULL) { gh_delete(hash_tab); return NULL; @@ -89,17 +83,14 @@ void gh_delete(struct gh_t_hash_tab *hash_tab) elem = next) { next = elem->next; (*hash_tab->delete) (elem->data); - myfree(elem, - sizeof(struct element) - 1 + - hash_tab->val_size); + kfree(elem); } } - myfree(hash_tab->buckets, sizeof(struct element *) - * hash_tab->max_bucket); + kfree(hash_tab->buckets); } - myfree(hash_tab, sizeof(struct gh_t_hash_tab)); + kfree(hash_tab); } } @@ -109,9 +100,7 @@ void gh_delete(struct gh_t_hash_tab *hash_tab) void gh_exit(void) { - if (cur_init-- == 1) - gs_exit(); - + /* Do nothing */ } /* @@ -138,8 +127,7 @@ void *gh_find(struct gh_t_hash_tab *hash_tab, void *key) void gh_init(void) { - if (cur_init++ == 0) - gs_init(); + /* Do nothing */ } /* @@ -152,8 +140,8 @@ void *gh_insert(struct gh_t_hash_tab *hash_tab, void *key, void *value) u16 i; char *src, *dst; - elem = (struct element *)gs_alloc(sizeof(struct element) - 1 + - hash_tab->val_size); + elem = kzalloc(sizeof(struct element) - 1 + hash_tab->val_size, + GFP_KERNEL); if (elem != NULL) { dst = (char *)elem->data; @@ -180,14 +168,6 @@ static void noop(void *p) p = p; /* stifle compiler warning */ } -/* - * ======== myfree ======== - */ -static void myfree(void *ptr, s32 size) -{ - gs_free(ptr); -} - #ifdef CONFIG_TIDSPBRIDGE_BACKTRACE /** * gh_iterate() - This function goes through all the elements in the hash table diff --git a/drivers/staging/tidspbridge/gen/gs.c b/drivers/staging/tidspbridge/gen/gs.c deleted file mode 100644 index 8335bf5..0000000 --- a/drivers/staging/tidspbridge/gen/gs.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * gs.c - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * General storage memory allocator services. - * - * Copyright (C) 2005-2006 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include -/* ----------------------------------- DSP/BIOS Bridge */ -#include - -/* ----------------------------------- This */ -#include - -#include - -/* ----------------------------------- Globals */ -static u32 cumsize; - -/* - * ======== gs_alloc ======== - * purpose: - * Allocates memory of the specified size. - */ -void *gs_alloc(u32 size) -{ - void *p; - - p = kzalloc(size, GFP_KERNEL); - if (p == NULL) - return NULL; - cumsize += size; - return p; -} - -/* - * ======== gs_exit ======== - * purpose: - * Discontinue the usage of the GS module. - */ -void gs_exit(void) -{ - /* Do nothing */ -} - -/* - * ======== gs_free ======== - * purpose: - * Frees the memory. - */ -void gs_free(void *ptr) -{ - kfree(ptr); - /* ack! no size info */ - /* cumsize -= size; */ -} - -/* - * ======== gs_frees ======== - * purpose: - * Frees the memory. - */ -void gs_frees(void *ptr, u32 size) -{ - kfree(ptr); - cumsize -= size; -} - -/* - * ======== gs_init ======== - * purpose: - * Initializes the GS module. - */ -void gs_init(void) -{ - /* Do nothing */ -} diff --git a/drivers/staging/tidspbridge/include/dspbridge/gs.h b/drivers/staging/tidspbridge/include/dspbridge/gs.h deleted file mode 100644 index f32d8d9..0000000 --- a/drivers/staging/tidspbridge/include/dspbridge/gs.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * gs.h - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * Memory allocation/release wrappers. This module allows clients to - * avoid OS spacific issues related to memory allocation. It also provides - * simple diagnostic capabilities to assist in the detection of memory - * leaks. - * - * Copyright (C) 2005-2006 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef GS_ -#define GS_ - -/* - * ======== gs_alloc ======== - * Alloc size bytes of space. Returns pointer to space - * allocated, otherwise NULL. - */ -extern void *gs_alloc(u32 size); - -/* - * ======== gs_exit ======== - * Module exit. Do not change to "#define gs_init()"; in - * some environments this operation must actually do some work! - */ -extern void gs_exit(void); - -/* - * ======== gs_free ======== - * Free space allocated by gs_alloc() or GS_calloc(). - */ -extern void gs_free(void *ptr); - -/* - * ======== gs_frees ======== - * Free space allocated by gs_alloc() or GS_calloc() and assert that - * the size of the allocation is size bytes. - */ -extern void gs_frees(void *ptr, u32 size); - -/* - * ======== gs_init ======== - * Module initialization. Do not change to "#define gs_init()"; in - * some environments this operation must actually do some work! - */ -extern void gs_init(void); - -#endif /*GS_ */ -- cgit v0.10.2 From ad4adcc495363fb2506d82c9cab0f71dea83ea9b Mon Sep 17 00:00:00 2001 From: Ionut Nicu Date: Sun, 21 Nov 2010 10:46:20 +0000 Subject: staging: tidspbridge: remove utildefs Remove a header file that was not very useful to the dspbridge driver. Signed-off-by: Ionut Nicu Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/include/dspbridge/utildefs.h b/drivers/staging/tidspbridge/include/dspbridge/utildefs.h deleted file mode 100644 index 8fe5414..0000000 --- a/drivers/staging/tidspbridge/include/dspbridge/utildefs.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * utildefs.h - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * Global UTIL constants and types, shared between DSP API and DSPSYS. - * - * Copyright (C) 2005-2006 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef UTILDEFS_ -#define UTILDEFS_ - -/* constants taken from configmg.h */ -#define UTIL_MAXMEMREGS 9 -#define UTIL_MAXIOPORTS 20 -#define UTIL_MAXIRQS 7 -#define UTIL_MAXDMACHNLS 7 - -/* misc. constants */ -#define UTIL_MAXARGVS 10 - -/* Platform specific important info */ -struct util_sysinfo { - /* Granularity of page protection; usually 1k or 4k */ - u32 dw_page_size; - u32 dw_allocation_granularity; /* VM granularity, usually 64K */ - u32 dw_number_of_processors; /* Used as sanity check */ -}; - -#endif /* UTILDEFS_ */ diff --git a/drivers/staging/tidspbridge/pmgr/cmm.c b/drivers/staging/tidspbridge/pmgr/cmm.c index 93a7c4f..8dbdd20 100644 --- a/drivers/staging/tidspbridge/pmgr/cmm.c +++ b/drivers/staging/tidspbridge/pmgr/cmm.c @@ -40,7 +40,6 @@ /* ----------------------------------- OS Adaptation Layer */ #include #include -#include /* ----------------------------------- Platform Manager */ #include @@ -245,7 +244,6 @@ int cmm_create(struct cmm_object **ph_cmm_mgr, { struct cmm_object *cmm_obj = NULL; int status = 0; - struct util_sysinfo sys_info; DBC_REQUIRE(refs > 0); DBC_REQUIRE(ph_cmm_mgr != NULL); @@ -261,12 +259,7 @@ int cmm_create(struct cmm_object **ph_cmm_mgr, DBC_ASSERT(mgr_attrts->ul_min_block_size >= 4); /* save away smallest block allocation for this cmm mgr */ cmm_obj->ul_min_block_size = mgr_attrts->ul_min_block_size; - /* save away the systems memory page size */ - sys_info.dw_page_size = PAGE_SIZE; - sys_info.dw_allocation_granularity = PAGE_SIZE; - sys_info.dw_number_of_processors = 1; - - cmm_obj->dw_page_size = sys_info.dw_page_size; + cmm_obj->dw_page_size = PAGE_SIZE; /* Note: DSP SM seg table(aDSPSMSegTab[]) zero'd by * MEM_ALLOC_OBJECT */ -- cgit v0.10.2 From b5a38abad033f6075e2c4cbfc4507cc7e82c36d2 Mon Sep 17 00:00:00 2001 From: Ionut Nicu Date: Sun, 21 Nov 2010 10:46:21 +0000 Subject: staging: tidspbridge: switch to linux bitmap API Replace the tidspbridge generic bitmap operations with the linux standard bitmap implementation. Signed-off-by: Ionut Nicu Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c index 1562f3c..ab35806 100644 --- a/drivers/staging/tidspbridge/rmgr/node.c +++ b/drivers/staging/tidspbridge/rmgr/node.c @@ -17,6 +17,7 @@ */ #include +#include /* ----------------------------------- Host OS */ #include @@ -50,7 +51,6 @@ #include /* ----------------------------------- Others */ -#include #include /* ----------------------------------- This */ @@ -132,11 +132,14 @@ struct node_mgr { struct lst_list *node_list; /* List of all allocated nodes */ u32 num_nodes; /* Number of nodes in node_list */ u32 num_created; /* Number of nodes *created* on DSP */ - struct gb_t_map *pipe_map; /* Pipe connection bit map */ - struct gb_t_map *pipe_done_map; /* Pipes that are half free */ - struct gb_t_map *chnl_map; /* Channel allocation bit map */ - struct gb_t_map *dma_chnl_map; /* DMA Channel allocation bit map */ - struct gb_t_map *zc_chnl_map; /* Zero-Copy Channel alloc bit map */ + DECLARE_BITMAP(pipe_map, MAXPIPES); /* Pipe connection bitmap */ + DECLARE_BITMAP(pipe_done_map, MAXPIPES); /* Pipes that are half free */ + /* Channel allocation bitmap */ + DECLARE_BITMAP(chnl_map, CHNL_MAXCHANNELS); + /* DMA Channel allocation bitmap */ + DECLARE_BITMAP(dma_chnl_map, CHNL_MAXCHANNELS); + /* Zero-Copy Channel alloc bitmap */ + DECLARE_BITMAP(zc_chnl_map, CHNL_MAXCHANNELS); struct ntfy_object *ntfy_obj; /* Manages registered notifications */ struct mutex node_mgr_lock; /* For critical sections */ u32 ul_fxn_addrs[NUMRMSFXNS]; /* RMS function addresses */ @@ -847,8 +850,8 @@ int node_connect(struct node_object *node1, u32 stream1, struct node_object *dev_node_obj; struct node_object *hnode; struct stream_chnl *pstream; - u32 pipe_id = GB_NOBITS; - u32 chnl_id = GB_NOBITS; + u32 pipe_id; + u32 chnl_id; s8 chnl_mode; u32 dw_length; int status = 0; @@ -951,10 +954,11 @@ int node_connect(struct node_object *node1, u32 stream1, && (node2_type == NODE_TASK || node2_type == NODE_DAISSOCKET))) { /* Find available pipe */ - pipe_id = gb_findandset(hnode_mgr->pipe_map); - if (pipe_id == GB_NOBITS) { + pipe_id = find_first_zero_bit(hnode_mgr->pipe_map, MAXPIPES); + if (pipe_id == MAXPIPES) { status = -ECONNREFUSED; } else { + set_bit(pipe_id, hnode_mgr->pipe_map); node1->outputs[stream1].type = NODECONNECT; node2->inputs[stream2].type = NODECONNECT; node1->outputs[stream1].dev_id = pipe_id; @@ -971,7 +975,7 @@ int node_connect(struct node_object *node1, u32 stream1, output->sz_device = NULL; input->sz_device = NULL; - gb_clear(hnode_mgr->pipe_map, pipe_id); + clear_bit(pipe_id, hnode_mgr->pipe_map); status = -ENOMEM; } else { /* Copy "/dbpipe" name to device names */ @@ -996,34 +1000,47 @@ int node_connect(struct node_object *node1, u32 stream1, * called for this node. */ if (pattrs) { if (pattrs->strm_mode == STRMMODE_RDMA) { - chnl_id = - gb_findandset(hnode_mgr->dma_chnl_map); + chnl_id = find_first_zero_bit( + hnode_mgr->dma_chnl_map, + CHNL_MAXCHANNELS); /* dma chans are 2nd transport chnl set * ids(e.g. 16-31) */ - (chnl_id != GB_NOBITS) ? - (chnl_id = - chnl_id + - hnode_mgr->ul_num_chnls) : chnl_id; + if (chnl_id != CHNL_MAXCHANNELS) { + set_bit(chnl_id, + hnode_mgr->dma_chnl_map); + chnl_id = chnl_id + + hnode_mgr->ul_num_chnls; + } } else if (pattrs->strm_mode == STRMMODE_ZEROCOPY) { - chnl_id = gb_findandset(hnode_mgr->zc_chnl_map); + chnl_id = find_first_zero_bit( + hnode_mgr->zc_chnl_map, + CHNL_MAXCHANNELS); /* zero-copy chans are 3nd transport set * (e.g. 32-47) */ - (chnl_id != GB_NOBITS) ? (chnl_id = chnl_id + - (2 * - hnode_mgr-> - ul_num_chnls)) - : chnl_id; + if (chnl_id != CHNL_MAXCHANNELS) { + set_bit(chnl_id, + hnode_mgr->zc_chnl_map); + chnl_id = chnl_id + + (2 * hnode_mgr->ul_num_chnls); + } } else { /* must be PROCCOPY */ DBC_ASSERT(pattrs->strm_mode == STRMMODE_PROCCOPY); - chnl_id = gb_findandset(hnode_mgr->chnl_map); + chnl_id = find_first_zero_bit( + hnode_mgr->chnl_map, + CHNL_MAXCHANNELS); /* e.g. 0-15 */ + if (chnl_id != CHNL_MAXCHANNELS) + set_bit(chnl_id, hnode_mgr->chnl_map); } } else { /* default to PROCCOPY */ - chnl_id = gb_findandset(hnode_mgr->chnl_map); + chnl_id = find_first_zero_bit(hnode_mgr->chnl_map, + CHNL_MAXCHANNELS); + if (chnl_id != CHNL_MAXCHANNELS) + set_bit(chnl_id, hnode_mgr->chnl_map); } - if (chnl_id == GB_NOBITS) { + if (chnl_id == CHNL_MAXCHANNELS) { status = -ECONNREFUSED; goto func_cont2; } @@ -1033,18 +1050,19 @@ int node_connect(struct node_object *node1, u32 stream1, if (pattrs) { if (pattrs->strm_mode == STRMMODE_RDMA) { - gb_clear(hnode_mgr->dma_chnl_map, chnl_id - - hnode_mgr->ul_num_chnls); + clear_bit(chnl_id - hnode_mgr->ul_num_chnls, + hnode_mgr->dma_chnl_map); } else if (pattrs->strm_mode == STRMMODE_ZEROCOPY) { - gb_clear(hnode_mgr->zc_chnl_map, chnl_id - - (2 * hnode_mgr->ul_num_chnls)); + clear_bit(chnl_id - + (2 * hnode_mgr->ul_num_chnls), + hnode_mgr->zc_chnl_map); } else { DBC_ASSERT(pattrs->strm_mode == STRMMODE_PROCCOPY); - gb_clear(hnode_mgr->chnl_map, chnl_id); + clear_bit(chnl_id, hnode_mgr->chnl_map); } } else { - gb_clear(hnode_mgr->chnl_map, chnl_id); + clear_bit(chnl_id, hnode_mgr->chnl_map); } status = -ENOMEM; func_cont2: @@ -1321,22 +1339,14 @@ int node_create_mgr(struct node_mgr **node_man, if (node_mgr_obj) { node_mgr_obj->hdev_obj = hdev_obj; node_mgr_obj->node_list = kzalloc(sizeof(struct lst_list), - GFP_KERNEL); - node_mgr_obj->pipe_map = gb_create(MAXPIPES); - node_mgr_obj->pipe_done_map = gb_create(MAXPIPES); - if (node_mgr_obj->node_list == NULL - || node_mgr_obj->pipe_map == NULL - || node_mgr_obj->pipe_done_map == NULL) { - status = -ENOMEM; - } else { - INIT_LIST_HEAD(&node_mgr_obj->node_list->head); - node_mgr_obj->ntfy_obj = kmalloc( + GFP_KERNEL); + INIT_LIST_HEAD(&node_mgr_obj->node_list->head); + node_mgr_obj->ntfy_obj = kmalloc( sizeof(struct ntfy_object), GFP_KERNEL); - if (node_mgr_obj->ntfy_obj) - ntfy_init(node_mgr_obj->ntfy_obj); - else - status = -ENOMEM; - } + if (node_mgr_obj->ntfy_obj) + ntfy_init(node_mgr_obj->ntfy_obj); + else + status = -ENOMEM; node_mgr_obj->num_created = 0; } else { status = -ENOMEM; @@ -1372,27 +1382,14 @@ int node_create_mgr(struct node_mgr **node_man, /* Get msg_ctrl queue manager */ dev_get_msg_mgr(hdev_obj, &node_mgr_obj->msg_mgr_obj); mutex_init(&node_mgr_obj->node_mgr_lock); - node_mgr_obj->chnl_map = gb_create(node_mgr_obj->ul_num_chnls); - /* dma chnl map. ul_num_chnls is # per transport */ - node_mgr_obj->dma_chnl_map = - gb_create(node_mgr_obj->ul_num_chnls); - node_mgr_obj->zc_chnl_map = - gb_create(node_mgr_obj->ul_num_chnls); - if ((node_mgr_obj->chnl_map == NULL) - || (node_mgr_obj->dma_chnl_map == NULL) - || (node_mgr_obj->zc_chnl_map == NULL)) { - status = -ENOMEM; - } else { - /* Block out reserved channels */ - for (i = 0; i < node_mgr_obj->ul_chnl_offset; i++) - gb_set(node_mgr_obj->chnl_map, i); + /* Block out reserved channels */ + for (i = 0; i < node_mgr_obj->ul_chnl_offset; i++) + set_bit(i, node_mgr_obj->chnl_map); - /* Block out channels reserved for RMS */ - gb_set(node_mgr_obj->chnl_map, - node_mgr_obj->ul_chnl_offset); - gb_set(node_mgr_obj->chnl_map, - node_mgr_obj->ul_chnl_offset + 1); - } + /* Block out channels reserved for RMS */ + set_bit(node_mgr_obj->ul_chnl_offset, node_mgr_obj->chnl_map); + set_bit(node_mgr_obj->ul_chnl_offset + 1, + node_mgr_obj->chnl_map); } if (!status) { /* NO RM Server on the IVA */ @@ -2657,21 +2654,6 @@ static void delete_node_mgr(struct node_mgr *hnode_mgr) kfree(hnode_mgr->ntfy_obj); } - if (hnode_mgr->pipe_map) - gb_delete(hnode_mgr->pipe_map); - - if (hnode_mgr->pipe_done_map) - gb_delete(hnode_mgr->pipe_done_map); - - if (hnode_mgr->chnl_map) - gb_delete(hnode_mgr->chnl_map); - - if (hnode_mgr->dma_chnl_map) - gb_delete(hnode_mgr->dma_chnl_map); - - if (hnode_mgr->zc_chnl_map) - gb_delete(hnode_mgr->zc_chnl_map); - if (hnode_mgr->disp_obj) disp_delete(hnode_mgr->disp_obj); @@ -2786,25 +2768,25 @@ static void free_stream(struct node_mgr *hnode_mgr, struct stream_chnl stream) { /* Free up the pipe id unless other node has not yet been deleted. */ if (stream.type == NODECONNECT) { - if (gb_test(hnode_mgr->pipe_done_map, stream.dev_id)) { + if (test_bit(stream.dev_id, hnode_mgr->pipe_done_map)) { /* The other node has already been deleted */ - gb_clear(hnode_mgr->pipe_done_map, stream.dev_id); - gb_clear(hnode_mgr->pipe_map, stream.dev_id); + clear_bit(stream.dev_id, hnode_mgr->pipe_done_map); + clear_bit(stream.dev_id, hnode_mgr->pipe_map); } else { /* The other node has not been deleted yet */ - gb_set(hnode_mgr->pipe_done_map, stream.dev_id); + set_bit(stream.dev_id, hnode_mgr->pipe_done_map); } } else if (stream.type == HOSTCONNECT) { if (stream.dev_id < hnode_mgr->ul_num_chnls) { - gb_clear(hnode_mgr->chnl_map, stream.dev_id); + clear_bit(stream.dev_id, hnode_mgr->chnl_map); } else if (stream.dev_id < (2 * hnode_mgr->ul_num_chnls)) { /* dsp-dma */ - gb_clear(hnode_mgr->dma_chnl_map, stream.dev_id - - (1 * hnode_mgr->ul_num_chnls)); + clear_bit(stream.dev_id - (1 * hnode_mgr->ul_num_chnls), + hnode_mgr->dma_chnl_map); } else if (stream.dev_id < (3 * hnode_mgr->ul_num_chnls)) { /* zero-copy */ - gb_clear(hnode_mgr->zc_chnl_map, stream.dev_id - - (2 * hnode_mgr->ul_num_chnls)); + clear_bit(stream.dev_id - (2 * hnode_mgr->ul_num_chnls), + hnode_mgr->zc_chnl_map); } } } -- cgit v0.10.2 From 6d7e925b88cd8436b1284158876580ea431cb954 Mon Sep 17 00:00:00 2001 From: Ionut Nicu Date: Sun, 21 Nov 2010 10:46:22 +0000 Subject: staging: tidspbridge: remove gb bitmap implementation Now that all users of gb have been converted to the standard linux bitmap API, we can remove it from the gen library. Signed-off-by: Ionut Nicu Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/Makefile b/drivers/staging/tidspbridge/Makefile index 648e392..fd6a276 100644 --- a/drivers/staging/tidspbridge/Makefile +++ b/drivers/staging/tidspbridge/Makefile @@ -1,6 +1,6 @@ obj-$(CONFIG_TIDSPBRIDGE) += bridgedriver.o -libgen = gen/gb.o gen/gh.o gen/uuidutil.o +libgen = gen/gh.o gen/uuidutil.o libcore = core/chnl_sm.o core/msg_sm.o core/io_sm.o core/tiomap3430.o \ core/tiomap3430_pwr.o core/tiomap_io.o \ core/ue_deh.o core/wdt.o core/dsp-clock.o core/sync.o diff --git a/drivers/staging/tidspbridge/gen/gb.c b/drivers/staging/tidspbridge/gen/gb.c deleted file mode 100644 index 3c0e04c..0000000 --- a/drivers/staging/tidspbridge/gen/gb.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - * gb.c - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * Generic bitmap operations. - * - * Copyright (C) 2005-2006 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* ----------------------------------- DSP/BIOS Bridge */ -#include -/* ----------------------------------- This */ -#include - -struct gb_t_map { - u32 len; - u32 wcnt; - u32 *words; -}; - -/* - * ======== gb_clear ======== - * purpose: - * Clears a bit in the bit map. - */ - -void gb_clear(struct gb_t_map *map, u32 bitn) -{ - u32 mask; - - mask = 1L << (bitn % BITS_PER_LONG); - map->words[bitn / BITS_PER_LONG] &= ~mask; -} - -/* - * ======== gb_create ======== - * purpose: - * Creates a bit map. - */ - -struct gb_t_map *gb_create(u32 len) -{ - struct gb_t_map *map; - u32 i; - map = kzalloc(sizeof(struct gb_t_map), GFP_KERNEL); - if (map != NULL) { - map->len = len; - map->wcnt = len / BITS_PER_LONG + 1; - map->words = kzalloc(map->wcnt * sizeof(u32), GFP_KERNEL); - if (map->words != NULL) { - for (i = 0; i < map->wcnt; i++) - map->words[i] = 0L; - - } else { - kfree(map); - map = NULL; - } - } - - return map; -} - -/* - * ======== gb_delete ======== - * purpose: - * Frees a bit map. - */ - -void gb_delete(struct gb_t_map *map) -{ - kfree(map->words); - kfree(map); -} - -/* - * ======== gb_findandset ======== - * purpose: - * Finds a free bit and sets it. - */ -u32 gb_findandset(struct gb_t_map *map) -{ - u32 bitn; - - bitn = gb_minclear(map); - - if (bitn != GB_NOBITS) - gb_set(map, bitn); - - return bitn; -} - -/* - * ======== gb_minclear ======== - * purpose: - * returns the location of the first unset bit in the bit map. - */ -u32 gb_minclear(struct gb_t_map *map) -{ - u32 bit_location = 0; - u32 bit_acc = 0; - u32 i; - u32 bit; - u32 *word; - - for (word = map->words, i = 0; i < map->wcnt; word++, i++) { - if (~*word) { - for (bit = 0; bit < BITS_PER_LONG; bit++, bit_acc++) { - if (bit_acc == map->len) - return GB_NOBITS; - - if (~*word & (1L << bit)) { - bit_location = i * BITS_PER_LONG + bit; - return bit_location; - } - - } - } else { - bit_acc += BITS_PER_LONG; - } - } - - return GB_NOBITS; -} - -/* - * ======== gb_set ======== - * purpose: - * Sets a bit in the bit map. - */ - -void gb_set(struct gb_t_map *map, u32 bitn) -{ - u32 mask; - - mask = 1L << (bitn % BITS_PER_LONG); - map->words[bitn / BITS_PER_LONG] |= mask; -} - -/* - * ======== gb_test ======== - * purpose: - * Returns true if the bit is set in the specified location. - */ - -bool gb_test(struct gb_t_map *map, u32 bitn) -{ - bool state; - u32 mask; - u32 word; - - mask = 1L << (bitn % BITS_PER_LONG); - word = map->words[bitn / BITS_PER_LONG]; - state = word & mask ? true : false; - - return state; -} diff --git a/drivers/staging/tidspbridge/include/dspbridge/gb.h b/drivers/staging/tidspbridge/include/dspbridge/gb.h deleted file mode 100644 index fda783a..0000000 --- a/drivers/staging/tidspbridge/include/dspbridge/gb.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * gb.h - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * Generic bitmap manager. - * - * Copyright (C) 2005-2006 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef GB_ -#define GB_ - -#define GB_NOBITS (~0) -#include - -struct gb_t_map; - -/* - * ======== gb_clear ======== - * Clear the bit in position bitn in the bitmap map. Bit positions are - * zero based. - */ - -extern void gb_clear(struct gb_t_map *map, u32 bitn); - -/* - * ======== gb_create ======== - * Create a bit map with len bits. Initially all bits are cleared. - */ - -extern struct gb_t_map *gb_create(u32 len); - -/* - * ======== gb_delete ======== - * Delete previously created bit map - */ - -extern void gb_delete(struct gb_t_map *map); - -/* - * ======== gb_findandset ======== - * Finds a clear bit, sets it, and returns the position - */ - -extern u32 gb_findandset(struct gb_t_map *map); - -/* - * ======== gb_minclear ======== - * gb_minclear returns the minimum clear bit position. If no bit is - * clear, gb_minclear returns -1. - */ -extern u32 gb_minclear(struct gb_t_map *map); - -/* - * ======== gb_set ======== - * Set the bit in position bitn in the bitmap map. Bit positions are - * zero based. - */ - -extern void gb_set(struct gb_t_map *map, u32 bitn); - -/* - * ======== gb_test ======== - * Returns TRUE if the bit in position bitn is set in map; otherwise - * gb_test returns FALSE. Bit positions are zero based. - */ - -extern bool gb_test(struct gb_t_map *map, u32 bitn); - -#endif /*GB_ */ -- cgit v0.10.2 From 3c6bf30f1e520b250242da39a493986b8b2cef53 Mon Sep 17 00:00:00 2001 From: Ionut Nicu Date: Sun, 21 Nov 2010 10:46:24 +0000 Subject: staging: tidspbridge: convert core to list_head Convert the core module of the tidspbridge driver to use struct list_head instead of struct lst_list. Signed-off-by: Ionut Nicu Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/core/_msg_sm.h b/drivers/staging/tidspbridge/core/_msg_sm.h index 556de5c..b78d1a6 100644 --- a/drivers/staging/tidspbridge/core/_msg_sm.h +++ b/drivers/staging/tidspbridge/core/_msg_sm.h @@ -20,7 +20,7 @@ #ifndef _MSG_SM_ #define _MSG_SM_ -#include +#include #include /* @@ -86,12 +86,12 @@ struct msg_mgr { struct bridge_drv_interface *intf_fxns; struct io_mgr *hio_mgr; /* IO manager */ - struct lst_list *queue_list; /* List of MSG_QUEUEs */ + struct list_head queue_list; /* List of MSG_QUEUEs */ spinlock_t msg_mgr_lock; /* For critical sections */ /* Signalled when MsgFrame is available */ struct sync_object *sync_event; - struct lst_list *msg_free_list; /* Free MsgFrames ready to be filled */ - struct lst_list *msg_used_list; /* MsgFrames ready to go to DSP */ + struct list_head msg_free_list; /* Free MsgFrames ready to be filled */ + struct list_head msg_used_list; /* MsgFrames ready to go to DSP */ u32 msgs_pending; /* # of queued messages to go to DSP */ u32 max_msgs; /* Max # of msgs that fit in buffer */ msg_onexit on_exit; /* called when RMS_EXIT is received */ @@ -111,9 +111,9 @@ struct msg_queue { struct msg_mgr *hmsg_mgr; u32 max_msgs; /* Node message depth */ u32 msgq_id; /* Node environment pointer */ - struct lst_list *msg_free_list; /* Free MsgFrames ready to be filled */ + struct list_head msg_free_list; /* Free MsgFrames ready to be filled */ /* Filled MsgFramess waiting to be read */ - struct lst_list *msg_used_list; + struct list_head msg_used_list; void *arg; /* Handle passed to mgr on_exit callback */ struct sync_object *sync_event; /* Signalled when message is ready */ struct sync_object *sync_done; /* For synchronizing cleanup */ diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c b/drivers/staging/tidspbridge/core/chnl_sm.c index 662a5b5..f955036 100644 --- a/drivers/staging/tidspbridge/core/chnl_sm.c +++ b/drivers/staging/tidspbridge/core/chnl_sm.c @@ -37,9 +37,9 @@ * which may cause timeouts and/or failure offunction sync_wait_on_event. * This invariant condition is: * - * LST_Empty(pchnl->pio_completions) ==> pchnl->sync_event is reset + * list_empty(&pchnl->pio_completions) ==> pchnl->sync_event is reset * and - * !LST_Empty(pchnl->pio_completions) ==> pchnl->sync_event is set. + * !list_empty(&pchnl->pio_completions) ==> pchnl->sync_event is set. */ #include @@ -73,11 +73,9 @@ #define MAILBOX_IRQ INT_MAIL_MPU_IRQ /* ----------------------------------- Function Prototypes */ -static struct lst_list *create_chirp_list(u32 chirps); +static int create_chirp_list(struct list_head *list, u32 chirps); -static void free_chirp_list(struct lst_list *chirp_list); - -static struct chnl_irp *make_new_chirp(void); +static void free_chirp_list(struct list_head *list); static int search_free_channel(struct chnl_mgr *chnl_mgr_obj, u32 *chnl); @@ -179,10 +177,14 @@ func_cont: } if (!status) { /* Get a free chirp: */ - chnl_packet_obj = - (struct chnl_irp *)lst_get_head(pchnl->free_packets_list); - if (chnl_packet_obj == NULL) + if (!list_empty(&pchnl->free_packets_list)) { + chnl_packet_obj = list_first_entry( + &pchnl->free_packets_list, + struct chnl_irp, link); + list_del(&chnl_packet_obj->link); + } else { status = -EIO; + } } if (!status) { @@ -206,8 +208,7 @@ func_cont: chnl_packet_obj->dw_arg = dw_arg; chnl_packet_obj->status = (is_eos ? CHNL_IOCSTATEOS : CHNL_IOCSTATCOMPLETE); - lst_put_tail(pchnl->pio_requests, - (struct list_head *)chnl_packet_obj); + list_add_tail(&chnl_packet_obj->link, &pchnl->pio_requests); pchnl->cio_reqs++; DBC_ASSERT(pchnl->cio_reqs <= pchnl->chnl_packets); /* @@ -254,7 +255,7 @@ int bridge_chnl_cancel_io(struct chnl_object *chnl_obj) struct chnl_object *pchnl = (struct chnl_object *)chnl_obj; u32 chnl_id = -1; s8 chnl_mode; - struct chnl_irp *chnl_packet_obj; + struct chnl_irp *chirp, *tmp; struct chnl_mgr *chnl_mgr_obj = NULL; /* Check args: */ @@ -272,7 +273,7 @@ int bridge_chnl_cancel_io(struct chnl_object *chnl_obj) * IORequests or dispatching. */ spin_lock_bh(&chnl_mgr_obj->chnl_mgr_lock); pchnl->dw_state |= CHNL_STATECANCEL; - if (LST_IS_EMPTY(pchnl->pio_requests)) + if (list_empty(&pchnl->pio_requests)) goto func_cont; if (pchnl->chnl_type == CHNL_PCPY) { @@ -286,18 +287,14 @@ int bridge_chnl_cancel_io(struct chnl_object *chnl_obj) } } /* Move all IOR's to IOC queue: */ - while (!LST_IS_EMPTY(pchnl->pio_requests)) { - chnl_packet_obj = - (struct chnl_irp *)lst_get_head(pchnl->pio_requests); - if (chnl_packet_obj) { - chnl_packet_obj->byte_size = 0; - chnl_packet_obj->status |= CHNL_IOCSTATCANCEL; - lst_put_tail(pchnl->pio_completions, - (struct list_head *)chnl_packet_obj); - pchnl->cio_cs++; - pchnl->cio_reqs--; - DBC_ASSERT(pchnl->cio_reqs >= 0); - } + list_for_each_entry_safe(chirp, tmp, &pchnl->pio_requests, link) { + list_del(&chirp->link); + chirp->byte_size = 0; + chirp->status |= CHNL_IOCSTATCANCEL; + list_add_tail(&chirp->link, &pchnl->pio_completions); + pchnl->cio_cs++; + pchnl->cio_reqs--; + DBC_ASSERT(pchnl->cio_reqs >= 0); } func_cont: spin_unlock_bh(&chnl_mgr_obj->chnl_mgr_lock); @@ -353,20 +350,14 @@ func_cont: pchnl->sync_event = NULL; } /* Free I/O request and I/O completion queues: */ - if (pchnl->pio_completions) { - free_chirp_list(pchnl->pio_completions); - pchnl->pio_completions = NULL; - pchnl->cio_cs = 0; - } - if (pchnl->pio_requests) { - free_chirp_list(pchnl->pio_requests); - pchnl->pio_requests = NULL; - pchnl->cio_reqs = 0; - } - if (pchnl->free_packets_list) { - free_chirp_list(pchnl->free_packets_list); - pchnl->free_packets_list = NULL; - } + free_chirp_list(&pchnl->pio_completions); + pchnl->cio_cs = 0; + + free_chirp_list(&pchnl->pio_requests); + pchnl->cio_reqs = 0; + + free_chirp_list(&pchnl->free_packets_list); + /* Release channel object. */ kfree(pchnl); pchnl = NULL; @@ -505,7 +496,7 @@ int bridge_chnl_flush_io(struct chnl_object *chnl_obj, u32 timeout) && (pchnl->chnl_type == CHNL_PCPY)) { /* Wait for IO completions, up to the specified * timeout: */ - while (!LST_IS_EMPTY(pchnl->pio_requests) && !status) { + while (!list_empty(&pchnl->pio_requests) && !status) { status = bridge_chnl_get_ioc(chnl_obj, timeout, &chnl_ioc_obj); if (status) @@ -521,7 +512,7 @@ int bridge_chnl_flush_io(struct chnl_object *chnl_obj, u32 timeout) pchnl->dw_state &= ~CHNL_STATECANCEL; } } - DBC_ENSURE(status || LST_IS_EMPTY(pchnl->pio_requests)); + DBC_ENSURE(status || list_empty(&pchnl->pio_requests)); return status; } @@ -581,7 +572,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout, if (!chan_ioc || !pchnl) { status = -EFAULT; } else if (timeout == CHNL_IOCNOWAIT) { - if (LST_IS_EMPTY(pchnl->pio_completions)) + if (list_empty(&pchnl->pio_completions)) status = -EREMOTEIO; } @@ -596,7 +587,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout, ioc.status = CHNL_IOCSTATCOMPLETE; if (timeout != - CHNL_IOCNOWAIT && LST_IS_EMPTY(pchnl->pio_completions)) { + CHNL_IOCNOWAIT && list_empty(&pchnl->pio_completions)) { if (timeout == CHNL_IOCINFINITE) timeout = SYNC_INFINITE; @@ -611,7 +602,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout, * fails due to unkown causes. */ /* Even though Wait failed, there may be something in * the Q: */ - if (LST_IS_EMPTY(pchnl->pio_completions)) { + if (list_empty(&pchnl->pio_completions)) { ioc.status |= CHNL_IOCSTATCANCEL; dequeue_ioc = false; } @@ -622,30 +613,26 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout, omap_mbox_disable_irq(dev_ctxt->mbox, IRQ_RX); if (dequeue_ioc) { /* Dequeue IOC and set chan_ioc; */ - DBC_ASSERT(!LST_IS_EMPTY(pchnl->pio_completions)); - chnl_packet_obj = - (struct chnl_irp *)lst_get_head(pchnl->pio_completions); + DBC_ASSERT(!list_empty(&pchnl->pio_completions)); + chnl_packet_obj = list_first_entry(&pchnl->pio_completions, + struct chnl_irp, link); + list_del(&chnl_packet_obj->link); /* Update chan_ioc from channel state and chirp: */ - if (chnl_packet_obj) { - pchnl->cio_cs--; - /* If this is a zero-copy channel, then set IOC's pbuf - * to the DSP's address. This DSP address will get - * translated to user's virtual addr later. */ - { - host_sys_buf = chnl_packet_obj->host_sys_buf; - ioc.pbuf = chnl_packet_obj->host_user_buf; - } - ioc.byte_size = chnl_packet_obj->byte_size; - ioc.buf_size = chnl_packet_obj->buf_size; - ioc.dw_arg = chnl_packet_obj->dw_arg; - ioc.status |= chnl_packet_obj->status; - /* Place the used chirp on the free list: */ - lst_put_tail(pchnl->free_packets_list, - (struct list_head *)chnl_packet_obj); - } else { - ioc.pbuf = NULL; - ioc.byte_size = 0; - } + pchnl->cio_cs--; + /* + * If this is a zero-copy channel, then set IOC's pbuf + * to the DSP's address. This DSP address will get + * translated to user's virtual addr later. + */ + host_sys_buf = chnl_packet_obj->host_sys_buf; + ioc.pbuf = chnl_packet_obj->host_user_buf; + ioc.byte_size = chnl_packet_obj->byte_size; + ioc.buf_size = chnl_packet_obj->buf_size; + ioc.dw_arg = chnl_packet_obj->dw_arg; + ioc.status |= chnl_packet_obj->status; + /* Place the used chirp on the free list: */ + list_add_tail(&chnl_packet_obj->link, + &pchnl->free_packets_list); } else { ioc.pbuf = NULL; ioc.byte_size = 0; @@ -653,7 +640,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout, ioc.buf_size = 0; } /* Ensure invariant: If any IOC's are queued for this channel... */ - if (!LST_IS_EMPTY(pchnl->pio_completions)) { + if (!list_empty(&pchnl->pio_completions)) { /* Since DSPStream_Reclaim() does not take a timeout * parameter, we pass the stream's timeout value to * bridge_chnl_get_ioc. We cannot determine whether or not @@ -818,9 +805,16 @@ int bridge_chnl_open(struct chnl_object **chnl, /* Protect queues from io_dpc: */ pchnl->dw_state = CHNL_STATECANCEL; /* Allocate initial IOR and IOC queues: */ - pchnl->free_packets_list = create_chirp_list(pattrs->uio_reqs); - pchnl->pio_requests = create_chirp_list(0); - pchnl->pio_completions = create_chirp_list(0); + status = create_chirp_list(&pchnl->free_packets_list, + pattrs->uio_reqs); + if (status) { + kfree(pchnl); + goto func_end; + } + + INIT_LIST_HEAD(&pchnl->pio_requests); + INIT_LIST_HEAD(&pchnl->pio_completions); + pchnl->chnl_packets = pattrs->uio_reqs; pchnl->cio_cs = 0; pchnl->cio_reqs = 0; @@ -840,40 +834,26 @@ int bridge_chnl_open(struct chnl_object **chnl, } if (!status) { - if (pchnl->pio_completions && pchnl->pio_requests && - pchnl->free_packets_list) { - /* Initialize CHNL object fields: */ - pchnl->chnl_mgr_obj = chnl_mgr_obj; - pchnl->chnl_id = ch_id; - pchnl->chnl_mode = chnl_mode; - pchnl->user_event = sync_event; - pchnl->sync_event = sync_event; - /* Get the process handle */ - pchnl->process = current->tgid; - pchnl->pcb_arg = 0; - pchnl->bytes_moved = 0; - /* Default to proc-copy */ - pchnl->chnl_type = CHNL_PCPY; - } else { - status = -ENOMEM; - } + /* Initialize CHNL object fields: */ + pchnl->chnl_mgr_obj = chnl_mgr_obj; + pchnl->chnl_id = ch_id; + pchnl->chnl_mode = chnl_mode; + pchnl->user_event = sync_event; + pchnl->sync_event = sync_event; + /* Get the process handle */ + pchnl->process = current->tgid; + pchnl->pcb_arg = 0; + pchnl->bytes_moved = 0; + /* Default to proc-copy */ + pchnl->chnl_type = CHNL_PCPY; } if (status) { /* Free memory */ - if (pchnl->pio_completions) { - free_chirp_list(pchnl->pio_completions); - pchnl->pio_completions = NULL; - pchnl->cio_cs = 0; - } - if (pchnl->pio_requests) { - free_chirp_list(pchnl->pio_requests); - pchnl->pio_requests = NULL; - } - if (pchnl->free_packets_list) { - free_chirp_list(pchnl->free_packets_list); - pchnl->free_packets_list = NULL; - } + free_chirp_list(&pchnl->pio_completions); + pchnl->cio_cs = 0; + free_chirp_list(&pchnl->pio_requests); + free_chirp_list(&pchnl->free_packets_list); kfree(sync_event); sync_event = NULL; @@ -924,37 +904,35 @@ int bridge_chnl_register_notify(struct chnl_object *chnl_obj, * Purpose: * Initialize a queue of channel I/O Request/Completion packets. * Parameters: + * list: Pointer to a list_head * chirps: Number of Chirps to allocate. * Returns: - * Pointer to queue of IRPs, or NULL. + * 0 if successful, error code otherwise. * Requires: * Ensures: */ -static struct lst_list *create_chirp_list(u32 chirps) +static int create_chirp_list(struct list_head *list, u32 chirps) { - struct lst_list *chirp_list; - struct chnl_irp *chnl_packet_obj; + struct chnl_irp *chirp; u32 i; - chirp_list = kzalloc(sizeof(struct lst_list), GFP_KERNEL); + INIT_LIST_HEAD(list); - if (chirp_list) { - INIT_LIST_HEAD(&chirp_list->head); - /* Make N chirps and place on queue. */ - for (i = 0; (i < chirps) - && ((chnl_packet_obj = make_new_chirp()) != NULL); i++) { - lst_put_tail(chirp_list, - (struct list_head *)chnl_packet_obj); - } + /* Make N chirps and place on queue. */ + for (i = 0; i < chirps; i++) { + chirp = kzalloc(sizeof(struct chnl_irp), GFP_KERNEL); + if (!chirp) + break; + list_add_tail(&chirp->link, list); + } - /* If we couldn't allocate all chirps, free those allocated: */ - if (i != chirps) { - free_chirp_list(chirp_list); - chirp_list = NULL; - } + /* If we couldn't allocate all chirps, free those allocated: */ + if (i != chirps) { + free_chirp_list(list); + return -ENOMEM; } - return chirp_list; + return 0; } /* @@ -962,31 +940,16 @@ static struct lst_list *create_chirp_list(u32 chirps) * Purpose: * Free the queue of Chirps. */ -static void free_chirp_list(struct lst_list *chirp_list) +static void free_chirp_list(struct list_head *chirp_list) { - DBC_REQUIRE(chirp_list != NULL); - - while (!LST_IS_EMPTY(chirp_list)) - kfree(lst_get_head(chirp_list)); + struct chnl_irp *chirp, *tmp; - kfree(chirp_list); -} - -/* - * ======== make_new_chirp ======== - * Allocate the memory for a new channel IRP. - */ -static struct chnl_irp *make_new_chirp(void) -{ - struct chnl_irp *chnl_packet_obj; + DBC_REQUIRE(chirp_list != NULL); - chnl_packet_obj = kzalloc(sizeof(struct chnl_irp), GFP_KERNEL); - if (chnl_packet_obj != NULL) { - /* lst_init_elem only resets the list's member values. */ - lst_init_elem(&chnl_packet_obj->link); + list_for_each_entry_safe(chirp, tmp, chirp_list, link) { + list_del(&chirp->link); + kfree(chirp); } - - return chnl_packet_obj; } /* diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index 9cea3ea..2a48f3d 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c @@ -24,6 +24,7 @@ * function. */ #include +#include /* Host OS */ #include @@ -1092,15 +1093,17 @@ static void input_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, pchnl = chnl_mgr_obj->ap_channel[chnl_id]; if ((pchnl != NULL) && CHNL_IS_INPUT(pchnl->chnl_mode)) { if ((pchnl->dw_state & ~CHNL_STATEEOS) == CHNL_STATEREADY) { - if (!pchnl->pio_requests) - goto func_end; /* Get the I/O request, and attempt a transfer */ - chnl_packet_obj = (struct chnl_irp *) - lst_get_head(pchnl->pio_requests); - if (chnl_packet_obj) { - pchnl->cio_reqs--; - if (pchnl->cio_reqs < 0) + if (!list_empty(&pchnl->pio_requests)) { + if (!pchnl->cio_reqs) goto func_end; + + chnl_packet_obj = list_first_entry( + &pchnl->pio_requests, + struct chnl_irp, link); + list_del(&chnl_packet_obj->link); + pchnl->cio_reqs--; + /* * Ensure we don't overflow the client's * buffer. @@ -1127,21 +1130,18 @@ static void input_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, * the channel state. */ chnl_packet_obj->status |= - CHNL_IOCSTATEOS; + CHNL_IOCSTATEOS; pchnl->dw_state |= CHNL_STATEEOS; /* * Notify that end of stream has * occurred. */ ntfy_notify(pchnl->ntfy_obj, - DSP_STREAMDONE); + DSP_STREAMDONE); } /* Tell DSP if no more I/O buffers available */ - if (!pchnl->pio_requests) - goto func_end; - if (LST_IS_EMPTY(pchnl->pio_requests)) { + if (list_empty(&pchnl->pio_requests)) set_chnl_free(sm, pchnl->chnl_id); - } clear_chnl = true; notify_client = true; } else { @@ -1213,21 +1213,18 @@ static void input_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr) msg.msgq_id = read_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr); msg_input += sizeof(struct msg_dspmsg); - if (!hmsg_mgr->queue_list) - goto func_end; /* Determine which queue to put the message in */ - msg_queue_obj = - (struct msg_queue *)lst_first(hmsg_mgr->queue_list); dev_dbg(bridge, "input msg: dw_cmd=0x%x dw_arg1=0x%x " - "dw_arg2=0x%x msgq_id=0x%x \n", msg.msg.dw_cmd, + "dw_arg2=0x%x msgq_id=0x%x\n", msg.msg.dw_cmd, msg.msg.dw_arg1, msg.msg.dw_arg2, msg.msgq_id); /* * Interrupt may occur before shared memory and message * input locations have been set up. If all nodes were * cleaned up, hmsg_mgr->max_msgs should be 0. */ - while (msg_queue_obj != NULL) { + list_for_each_entry(msg_queue_obj, &hmsg_mgr->queue_list, + list_elem) { if (msg.msgq_id == msg_queue_obj->msgq_id) { /* Found it */ if (msg.msg.dw_cmd == RMS_EXITACK) { @@ -1237,47 +1234,39 @@ static void input_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr) * queued. */ (*hmsg_mgr->on_exit) ((void *) - msg_queue_obj->arg, - msg.msg.dw_arg1); + msg_queue_obj->arg, + msg.msg.dw_arg1); + break; + } + /* + * Not an exit acknowledgement, queue + * the message. + */ + if (!list_empty(&msg_queue_obj-> + msg_free_list)) { + pmsg = list_first_entry( + &msg_queue_obj->msg_free_list, + struct msg_frame, list_elem); + list_del(&pmsg->list_elem); + pmsg->msg_data = msg; + list_add_tail(&pmsg->list_elem, + &msg_queue_obj->msg_used_list); + ntfy_notify + (msg_queue_obj->ntfy_obj, + DSP_NODEMESSAGEREADY); + sync_set_event + (msg_queue_obj->sync_event); } else { /* - * Not an exit acknowledgement, queue - * the message. + * No free frame to copy the + * message into. */ - if (!msg_queue_obj->msg_free_list) - goto func_end; - pmsg = (struct msg_frame *)lst_get_head - (msg_queue_obj->msg_free_list); - if (msg_queue_obj->msg_used_list - && pmsg) { - pmsg->msg_data = msg; - lst_put_tail - (msg_queue_obj->msg_used_list, - (struct list_head *)pmsg); - ntfy_notify - (msg_queue_obj->ntfy_obj, - DSP_NODEMESSAGEREADY); - sync_set_event - (msg_queue_obj->sync_event); - } else { - /* - * No free frame to copy the - * message into. - */ - pr_err("%s: no free msg frames," - " discarding msg\n", - __func__); - } + pr_err("%s: no free msg frames," + " discarding msg\n", + __func__); } break; } - - if (!hmsg_mgr->queue_list || !msg_queue_obj) - goto func_end; - msg_queue_obj = - (struct msg_queue *)lst_next(hmsg_mgr->queue_list, - (struct list_head *) - msg_queue_obj); } } /* Set the post SWI flag */ @@ -1301,8 +1290,7 @@ static void notify_chnl_complete(struct chnl_object *pchnl, { bool signal_event; - if (!pchnl || !pchnl->sync_event || - !pchnl->pio_completions || !chnl_packet_obj) + if (!pchnl || !pchnl->sync_event || !chnl_packet_obj) goto func_end; /* @@ -1311,10 +1299,9 @@ static void notify_chnl_complete(struct chnl_object *pchnl, * signalled by the only IO completion list consumer: * bridge_chnl_get_ioc(). */ - signal_event = LST_IS_EMPTY(pchnl->pio_completions); + signal_event = list_empty(&pchnl->pio_completions); /* Enqueue the IO completion info for the client */ - lst_put_tail(pchnl->pio_completions, - (struct list_head *)chnl_packet_obj); + list_add_tail(&chnl_packet_obj->link, &pchnl->pio_completions); pchnl->cio_cs++; if (pchnl->cio_cs > pchnl->chnl_packets) @@ -1361,21 +1348,23 @@ static void output_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, goto func_end; pchnl = chnl_mgr_obj->ap_channel[chnl_id]; - if (!pchnl || !pchnl->pio_requests) { + if (!pchnl || list_empty(&pchnl->pio_requests)) { /* Shouldn't get here */ goto func_end; } - /* Get the I/O request, and attempt a transfer */ - chnl_packet_obj = (struct chnl_irp *)lst_get_head(pchnl->pio_requests); - if (!chnl_packet_obj) + + if (!pchnl->cio_reqs) goto func_end; + /* Get the I/O request, and attempt a transfer */ + chnl_packet_obj = list_first_entry(&pchnl->pio_requests, + struct chnl_irp, link); + list_del(&chnl_packet_obj->link); + pchnl->cio_reqs--; - if (pchnl->cio_reqs < 0 || !pchnl->pio_requests) - goto func_end; /* Record fact that no more I/O buffers available */ - if (LST_IS_EMPTY(pchnl->pio_requests)) + if (list_empty(&pchnl->pio_requests)) chnl_mgr_obj->dw_output_mask &= ~(1 << chnl_id); /* Transfer buffer to DSP side */ @@ -1436,14 +1425,11 @@ static void output_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr) msg_output = pio_mgr->msg_output; /* Copy num_msgs messages into shared memory */ for (i = 0; i < num_msgs; i++) { - if (!hmsg_mgr->msg_used_list) { - pmsg = NULL; - goto func_end; - } else { - pmsg = (struct msg_frame *) - lst_get_head(hmsg_mgr->msg_used_list); - } - if (pmsg != NULL) { + if (!list_empty(&hmsg_mgr->msg_used_list)) { + pmsg = list_first_entry( + &hmsg_mgr->msg_used_list, + struct msg_frame, list_elem); + list_del(&pmsg->list_elem); val = (pmsg->msg_data).msgq_id; addr = (u32) &(((struct msg_dspmsg *) msg_output)->msgq_id); @@ -1465,10 +1451,8 @@ static void output_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr) write_ext32_bit_dsp_data( pio_mgr->hbridge_context, addr, val); msg_output += sizeof(struct msg_dspmsg); - if (!hmsg_mgr->msg_free_list) - goto func_end; - lst_put_tail(hmsg_mgr->msg_free_list, - (struct list_head *)pmsg); + list_add_tail(&pmsg->list_elem, + &hmsg_mgr->msg_free_list); sync_set_event(hmsg_mgr->sync_event); } } @@ -1492,8 +1476,6 @@ static void output_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr) MBX_PCPY_CLASS); } } -func_end: - return; } /* diff --git a/drivers/staging/tidspbridge/core/msg_sm.c b/drivers/staging/tidspbridge/core/msg_sm.c index 87712e2..de2cb83 100644 --- a/drivers/staging/tidspbridge/core/msg_sm.c +++ b/drivers/staging/tidspbridge/core/msg_sm.c @@ -24,7 +24,6 @@ #include /* ----------------------------------- OS Adaptation Layer */ -#include #include /* ----------------------------------- Platform Manager */ @@ -38,10 +37,10 @@ #include /* ----------------------------------- Function Prototypes */ -static int add_new_msg(struct lst_list *msg_list); +static int add_new_msg(struct list_head *msg_list); static void delete_msg_mgr(struct msg_mgr *hmsg_mgr); static void delete_msg_queue(struct msg_queue *msg_queue_obj, u32 num_to_dsp); -static void free_msg_list(struct lst_list *msg_list); +static void free_msg_list(struct list_head *msg_list); /* * ======== bridge_msg_create ======== @@ -73,25 +72,13 @@ int bridge_msg_create(struct msg_mgr **msg_man, msg_mgr_obj->on_exit = msg_callback; msg_mgr_obj->hio_mgr = hio_mgr; /* List of MSG_QUEUEs */ - msg_mgr_obj->queue_list = kzalloc(sizeof(struct lst_list), - GFP_KERNEL); + INIT_LIST_HEAD(&msg_mgr_obj->queue_list); /* Queues of message frames for messages to the DSP. Message * frames will only be added to the free queue when a * msg_queue object is created. */ - msg_mgr_obj->msg_free_list = kzalloc(sizeof(struct lst_list), - GFP_KERNEL); - msg_mgr_obj->msg_used_list = kzalloc(sizeof(struct lst_list), - GFP_KERNEL); - if (msg_mgr_obj->queue_list == NULL || - msg_mgr_obj->msg_free_list == NULL || - msg_mgr_obj->msg_used_list == NULL) { - status = -ENOMEM; - } else { - INIT_LIST_HEAD(&msg_mgr_obj->queue_list->head); - INIT_LIST_HEAD(&msg_mgr_obj->msg_free_list->head); - INIT_LIST_HEAD(&msg_mgr_obj->msg_used_list->head); - spin_lock_init(&msg_mgr_obj->msg_mgr_lock); - } + INIT_LIST_HEAD(&msg_mgr_obj->msg_free_list); + INIT_LIST_HEAD(&msg_mgr_obj->msg_used_list); + spin_lock_init(&msg_mgr_obj->msg_mgr_lock); /* Create an event to be used by bridge_msg_put() in waiting * for an available free frame from the message manager. */ @@ -128,7 +115,7 @@ int bridge_msg_create_queue(struct msg_mgr *hmsg_mgr, struct msg_queue *msg_q; int status = 0; - if (!hmsg_mgr || msgq == NULL || !hmsg_mgr->msg_free_list) { + if (!hmsg_mgr || msgq == NULL) { status = -EFAULT; goto func_end; } @@ -140,20 +127,13 @@ int bridge_msg_create_queue(struct msg_mgr *hmsg_mgr, status = -ENOMEM; goto func_end; } - lst_init_elem((struct list_head *)msg_q); msg_q->max_msgs = max_msgs; msg_q->hmsg_mgr = hmsg_mgr; msg_q->arg = arg; /* Node handle */ msg_q->msgq_id = msgq_id; /* Node env (not valid yet) */ /* Queues of Message frames for messages from the DSP */ - msg_q->msg_free_list = kzalloc(sizeof(struct lst_list), GFP_KERNEL); - msg_q->msg_used_list = kzalloc(sizeof(struct lst_list), GFP_KERNEL); - if (msg_q->msg_free_list == NULL || msg_q->msg_used_list == NULL) - status = -ENOMEM; - else { - INIT_LIST_HEAD(&msg_q->msg_free_list->head); - INIT_LIST_HEAD(&msg_q->msg_used_list->head); - } + INIT_LIST_HEAD(&msg_q->msg_free_list); + INIT_LIST_HEAD(&msg_q->msg_used_list); /* Create event that will be signalled when a message from * the DSP is available. */ @@ -204,10 +184,10 @@ int bridge_msg_create_queue(struct msg_mgr *hmsg_mgr, spin_lock_bh(&hmsg_mgr->msg_mgr_lock); /* Initialize message frames and put in appropriate queues */ for (i = 0; i < max_msgs && !status; i++) { - status = add_new_msg(hmsg_mgr->msg_free_list); + status = add_new_msg(&hmsg_mgr->msg_free_list); if (!status) { num_allocated++; - status = add_new_msg(msg_q->msg_free_list); + status = add_new_msg(&msg_q->msg_free_list); } } if (status) { @@ -215,11 +195,11 @@ int bridge_msg_create_queue(struct msg_mgr *hmsg_mgr, * of the newly allocated message frames. */ delete_msg_queue(msg_q, num_allocated); } else { - lst_put_tail(hmsg_mgr->queue_list, - (struct list_head *)msg_q); + list_add_tail(&msg_q->list_elem, + &hmsg_mgr->queue_list); *msgq = msg_q; /* Signal that free frames are now available */ - if (!LST_IS_EMPTY(hmsg_mgr->msg_free_list)) + if (!list_empty(&hmsg_mgr->msg_free_list)) sync_set_event(hmsg_mgr->sync_event); } @@ -267,15 +247,12 @@ void bridge_msg_delete_queue(struct msg_queue *msg_queue_obj) } /* Remove message queue from hmsg_mgr->queue_list */ spin_lock_bh(&hmsg_mgr->msg_mgr_lock); - lst_remove_elem(hmsg_mgr->queue_list, - (struct list_head *)msg_queue_obj); + list_del(&msg_queue_obj->list_elem); /* Free the message queue object */ delete_msg_queue(msg_queue_obj, msg_queue_obj->max_msgs); - if (!hmsg_mgr->msg_free_list) - goto func_cont; - if (LST_IS_EMPTY(hmsg_mgr->msg_free_list)) + if (list_empty(&hmsg_mgr->msg_free_list)) sync_reset_event(hmsg_mgr->sync_event); -func_cont: + spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); func_end: return; @@ -301,26 +278,21 @@ int bridge_msg_get(struct msg_queue *msg_queue_obj, } hmsg_mgr = msg_queue_obj->hmsg_mgr; - if (!msg_queue_obj->msg_used_list) { - status = -EFAULT; - goto func_end; - } /* Enter critical section */ spin_lock_bh(&hmsg_mgr->msg_mgr_lock); /* If a message is already there, get it */ - if (!LST_IS_EMPTY(msg_queue_obj->msg_used_list)) { - msg_frame_obj = (struct msg_frame *) - lst_get_head(msg_queue_obj->msg_used_list); - if (msg_frame_obj != NULL) { - *pmsg = msg_frame_obj->msg_data.msg; - lst_put_tail(msg_queue_obj->msg_free_list, - (struct list_head *)msg_frame_obj); - if (LST_IS_EMPTY(msg_queue_obj->msg_used_list)) - sync_reset_event(msg_queue_obj->sync_event); - - got_msg = true; - } + if (!list_empty(&msg_queue_obj->msg_used_list)) { + msg_frame_obj = list_first_entry(&msg_queue_obj->msg_used_list, + struct msg_frame, list_elem); + list_del(&msg_frame_obj->list_elem); + *pmsg = msg_frame_obj->msg_data.msg; + list_add_tail(&msg_frame_obj->list_elem, + &msg_queue_obj->msg_free_list); + if (list_empty(&msg_queue_obj->msg_used_list)) + sync_reset_event(msg_queue_obj->sync_event); + + got_msg = true; } else { if (msg_queue_obj->done) status = -EPERM; @@ -349,25 +321,22 @@ int bridge_msg_get(struct msg_queue *msg_queue_obj, (void)sync_set_event(msg_queue_obj->sync_done_ack); status = -EPERM; } else { - if (!status) { - DBC_ASSERT(!LST_IS_EMPTY - (msg_queue_obj->msg_used_list)); + if (!status && !list_empty(&msg_queue_obj-> + msg_used_list)) { /* Get msg from used list */ - msg_frame_obj = (struct msg_frame *) - lst_get_head(msg_queue_obj->msg_used_list); + msg_frame_obj = list_first_entry( + &msg_queue_obj->msg_used_list, + struct msg_frame, list_elem); + list_del(&msg_frame_obj->list_elem); /* Copy message into pmsg and put frame on the * free list */ - if (msg_frame_obj != NULL) { - *pmsg = msg_frame_obj->msg_data.msg; - lst_put_tail - (msg_queue_obj->msg_free_list, - (struct list_head *) - msg_frame_obj); - } + *pmsg = msg_frame_obj->msg_data.msg; + list_add_tail(&msg_frame_obj->list_elem, + &msg_queue_obj->msg_free_list); } msg_queue_obj->io_msg_pend--; /* Reset the event if there are still queued messages */ - if (!LST_IS_EMPTY(msg_queue_obj->msg_used_list)) + if (!list_empty(&msg_queue_obj->msg_used_list)) sync_set_event(msg_queue_obj->sync_event); /* Exit critical section */ @@ -397,27 +366,22 @@ int bridge_msg_put(struct msg_queue *msg_queue_obj, goto func_end; } hmsg_mgr = msg_queue_obj->hmsg_mgr; - if (!hmsg_mgr->msg_free_list) { - status = -EFAULT; - goto func_end; - } spin_lock_bh(&hmsg_mgr->msg_mgr_lock); /* If a message frame is available, use it */ - if (!LST_IS_EMPTY(hmsg_mgr->msg_free_list)) { - msg_frame_obj = - (struct msg_frame *)lst_get_head(hmsg_mgr->msg_free_list); - if (msg_frame_obj != NULL) { - msg_frame_obj->msg_data.msg = *pmsg; - msg_frame_obj->msg_data.msgq_id = - msg_queue_obj->msgq_id; - lst_put_tail(hmsg_mgr->msg_used_list, - (struct list_head *)msg_frame_obj); - hmsg_mgr->msgs_pending++; - put_msg = true; - } - if (LST_IS_EMPTY(hmsg_mgr->msg_free_list)) + if (!list_empty(&hmsg_mgr->msg_free_list)) { + msg_frame_obj = list_first_entry(&hmsg_mgr->msg_free_list, + struct msg_frame, list_elem); + list_del(&msg_frame_obj->list_elem); + msg_frame_obj->msg_data.msg = *pmsg; + msg_frame_obj->msg_data.msgq_id = + msg_queue_obj->msgq_id; + list_add_tail(&msg_frame_obj->list_elem, + &hmsg_mgr->msg_used_list); + hmsg_mgr->msgs_pending++; + put_msg = true; + if (list_empty(&hmsg_mgr->msg_free_list)) sync_reset_event(hmsg_mgr->sync_event); /* Release critical section before scheduling DPC */ @@ -452,34 +416,34 @@ int bridge_msg_put(struct msg_queue *msg_queue_obj, (void)sync_set_event(msg_queue_obj->sync_done_ack); status = -EPERM; } else { - if (LST_IS_EMPTY(hmsg_mgr->msg_free_list)) { + if (list_empty(&hmsg_mgr->msg_free_list)) { status = -EFAULT; goto func_cont; } /* Get msg from free list */ - msg_frame_obj = (struct msg_frame *) - lst_get_head(hmsg_mgr->msg_free_list); + msg_frame_obj = list_first_entry( + &hmsg_mgr->msg_free_list, + struct msg_frame, list_elem); + list_del(&msg_frame_obj->list_elem); /* * Copy message into pmsg and put frame on the * used list. */ - if (msg_frame_obj) { - msg_frame_obj->msg_data.msg = *pmsg; - msg_frame_obj->msg_data.msgq_id = - msg_queue_obj->msgq_id; - lst_put_tail(hmsg_mgr->msg_used_list, - (struct list_head *)msg_frame_obj); - hmsg_mgr->msgs_pending++; - /* - * Schedule a DPC, to do the actual - * data transfer. - */ - iosm_schedule(hmsg_mgr->hio_mgr); - } + msg_frame_obj->msg_data.msg = *pmsg; + msg_frame_obj->msg_data.msgq_id = + msg_queue_obj->msgq_id; + list_add_tail(&msg_frame_obj->list_elem, + &hmsg_mgr->msg_used_list); + hmsg_mgr->msgs_pending++; + /* + * Schedule a DPC, to do the actual + * data transfer. + */ + iosm_schedule(hmsg_mgr->hio_mgr); msg_queue_obj->io_msg_pend--; /* Reset event if there are still frames available */ - if (!LST_IS_EMPTY(hmsg_mgr->msg_free_list)) + if (!list_empty(&hmsg_mgr->msg_free_list)) sync_set_event(hmsg_mgr->sync_event); func_cont: /* Exit critical section */ @@ -551,15 +515,14 @@ void bridge_msg_set_queue_id(struct msg_queue *msg_queue_obj, u32 msgq_id) * ======== add_new_msg ======== * Must be called in message manager critical section. */ -static int add_new_msg(struct lst_list *msg_list) +static int add_new_msg(struct list_head *msg_list) { struct msg_frame *pmsg; int status = 0; pmsg = kzalloc(sizeof(struct msg_frame), GFP_ATOMIC); if (pmsg != NULL) { - lst_init_elem((struct list_head *)pmsg); - lst_put_tail(msg_list, (struct list_head *)pmsg); + list_add_tail(&pmsg->list_elem, msg_list); } else { status = -ENOMEM; } @@ -575,22 +538,9 @@ static void delete_msg_mgr(struct msg_mgr *hmsg_mgr) if (!hmsg_mgr) goto func_end; - if (hmsg_mgr->queue_list) { - if (LST_IS_EMPTY(hmsg_mgr->queue_list)) { - kfree(hmsg_mgr->queue_list); - hmsg_mgr->queue_list = NULL; - } - } - - if (hmsg_mgr->msg_free_list) { - free_msg_list(hmsg_mgr->msg_free_list); - hmsg_mgr->msg_free_list = NULL; - } - - if (hmsg_mgr->msg_used_list) { - free_msg_list(hmsg_mgr->msg_used_list); - hmsg_mgr->msg_used_list = NULL; - } + /* FIXME: free elements from queue_list? */ + free_msg_list(&hmsg_mgr->msg_free_list); + free_msg_list(&hmsg_mgr->msg_used_list); kfree(hmsg_mgr->sync_event); @@ -605,37 +555,26 @@ func_end: static void delete_msg_queue(struct msg_queue *msg_queue_obj, u32 num_to_dsp) { struct msg_mgr *hmsg_mgr; - struct msg_frame *pmsg; + struct msg_frame *pmsg, *tmp; u32 i; - if (!msg_queue_obj || - !msg_queue_obj->hmsg_mgr || !msg_queue_obj->hmsg_mgr->msg_free_list) + if (!msg_queue_obj || !msg_queue_obj->hmsg_mgr) goto func_end; hmsg_mgr = msg_queue_obj->hmsg_mgr; /* Pull off num_to_dsp message frames from Msg manager and free */ - for (i = 0; i < num_to_dsp; i++) { - - if (!LST_IS_EMPTY(hmsg_mgr->msg_free_list)) { - pmsg = (struct msg_frame *) - lst_get_head(hmsg_mgr->msg_free_list); - kfree(pmsg); - } else { - /* Cannot free all of the message frames */ + i = 0; + list_for_each_entry_safe(pmsg, tmp, &hmsg_mgr->msg_free_list, + list_elem) { + list_del(&pmsg->list_elem); + kfree(pmsg); + if (i++ >= num_to_dsp) break; - } } - if (msg_queue_obj->msg_free_list) { - free_msg_list(msg_queue_obj->msg_free_list); - msg_queue_obj->msg_free_list = NULL; - } - - if (msg_queue_obj->msg_used_list) { - free_msg_list(msg_queue_obj->msg_used_list); - msg_queue_obj->msg_used_list = NULL; - } + free_msg_list(&msg_queue_obj->msg_free_list); + free_msg_list(&msg_queue_obj->msg_used_list); if (msg_queue_obj->ntfy_obj) { ntfy_delete(msg_queue_obj->ntfy_obj); @@ -655,19 +594,18 @@ func_end: /* * ======== free_msg_list ======== */ -static void free_msg_list(struct lst_list *msg_list) +static void free_msg_list(struct list_head *msg_list) { - struct msg_frame *pmsg; + struct msg_frame *pmsg, *tmp; if (!msg_list) goto func_end; - while ((pmsg = (struct msg_frame *)lst_get_head(msg_list)) != NULL) + list_for_each_entry_safe(pmsg, tmp, msg_list, list_elem) { + list_del(&pmsg->list_elem); kfree(pmsg); + } - DBC_ASSERT(LST_IS_EMPTY(msg_list)); - - kfree(msg_list); func_end: return; } diff --git a/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h b/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h index 8efd1fb..8a22317 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include /* @@ -148,13 +148,13 @@ struct chnl_object { struct sync_object *sync_event; u32 process; /* Process which created this channel */ u32 pcb_arg; /* Argument to use with callback */ - struct lst_list *pio_requests; /* List of IOR's to driver */ + struct list_head pio_requests; /* List of IOR's to driver */ s32 cio_cs; /* Number of IOC's in queue */ s32 cio_reqs; /* Number of IORequests in queue */ s32 chnl_packets; /* Initial number of free Irps */ /* List of IOC's from driver */ - struct lst_list *pio_completions; - struct lst_list *free_packets_list; /* List of free Irps */ + struct list_head pio_completions; + struct list_head free_packets_list; /* List of free Irps */ struct ntfy_object *ntfy_obj; u32 bytes_moved; /* Total number of bytes transfered */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h b/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h index fbff372..e748ba8 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h @@ -19,7 +19,6 @@ #ifndef CMMDEFS_ #define CMMDEFS_ -#include /* Cmm attributes used in cmm_create() */ struct cmm_mgrattrs { diff --git a/drivers/staging/tidspbridge/include/dspbridge/sync.h b/drivers/staging/tidspbridge/include/dspbridge/sync.h index df05b8f..b1e75eb 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/sync.h +++ b/drivers/staging/tidspbridge/include/dspbridge/sync.h @@ -20,6 +20,7 @@ #define _SYNC_H #include +#include /* Special timeout value indicating an infinite wait: */ -- cgit v0.10.2 From 5fb45dac37615f0c33b59741d42b0853125c6f7d Mon Sep 17 00:00:00 2001 From: Ionut Nicu Date: Sun, 21 Nov 2010 10:46:25 +0000 Subject: staging: tidspbridge: convert pmgr to list_head Convert the pmgr module of the tidspbridge driver to use struct list_head instead of struct lst_list. Signed-off-by: Ionut Nicu Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/pmgr/cmm.c b/drivers/staging/tidspbridge/pmgr/cmm.c index 8dbdd20..d7ca2a4 100644 --- a/drivers/staging/tidspbridge/pmgr/cmm.c +++ b/drivers/staging/tidspbridge/pmgr/cmm.c @@ -12,7 +12,7 @@ * describes a block of physically contiguous shared memory used for * future allocations by CMM. * - * Memory is coelesced back to the appropriate heap when a buffer is + * Memory is coalesced back to the appropriate heap when a buffer is * freed. * * Notes: @@ -30,6 +30,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include +#include /* ----------------------------------- DSP/BIOS Bridge */ #include @@ -38,7 +39,6 @@ #include /* ----------------------------------- OS Adaptation Layer */ -#include #include /* ----------------------------------- Platform Manager */ @@ -73,9 +73,9 @@ struct cmm_allocator { /* sma */ u32 ul_dsp_size; /* DSP seg size in bytes */ struct cmm_object *hcmm_mgr; /* back ref to parent mgr */ /* node list of available memory */ - struct lst_list *free_list_head; + struct list_head free_list; /* node list of memory in use */ - struct lst_list *in_use_list_head; + struct list_head in_use_list; }; struct cmm_xlator { /* Pa<->Va translator object */ @@ -97,7 +97,7 @@ struct cmm_object { * Cmm Lock is used to serialize access mem manager for multi-threads. */ struct mutex cmm_lock; /* Lock to access cmm mgr */ - struct lst_list *node_free_list_head; /* Free list of memory nodes */ + struct list_head node_free_list; /* Free list of memory nodes */ u32 ul_min_block_size; /* Min SM block; default 16 bytes */ u32 dw_page_size; /* Memory Page size (1k/4k) */ /* GPP SM segment ptrs */ @@ -215,8 +215,7 @@ void *cmm_calloc_buf(struct cmm_object *hcmm_mgr, u32 usize, pnode->client_proc = current->tgid; /* put our node on InUse list */ - lst_put_tail(allocator->in_use_list_head, - (struct list_head *)pnode); + list_add_tail(&pnode->link, &allocator->in_use_list); buf_pa = (void *)pnode->dw_pa; /* physical address */ /* clear mem */ pbyte = (u8 *) pnode->dw_va; @@ -265,18 +264,9 @@ int cmm_create(struct cmm_object **ph_cmm_mgr, * MEM_ALLOC_OBJECT */ /* create node free list */ - cmm_obj->node_free_list_head = - kzalloc(sizeof(struct lst_list), - GFP_KERNEL); - if (cmm_obj->node_free_list_head == NULL) { - status = -ENOMEM; - cmm_destroy(cmm_obj, true); - } else { - INIT_LIST_HEAD(&cmm_obj-> - node_free_list_head->head); - mutex_init(&cmm_obj->cmm_lock); - *ph_cmm_mgr = cmm_obj; - } + INIT_LIST_HEAD(&cmm_obj->node_free_list); + mutex_init(&cmm_obj->cmm_lock); + *ph_cmm_mgr = cmm_obj; } else { status = -ENOMEM; } @@ -294,7 +284,7 @@ int cmm_destroy(struct cmm_object *hcmm_mgr, bool force) struct cmm_info temp_info; int status = 0; s32 slot_seg; - struct cmm_mnode *pnode; + struct cmm_mnode *node, *tmp; DBC_REQUIRE(refs > 0); if (!hcmm_mgr) { @@ -324,15 +314,10 @@ int cmm_destroy(struct cmm_object *hcmm_mgr, bool force) } } } - if (cmm_mgr_obj->node_free_list_head != NULL) { - /* Free the free nodes */ - while (!LST_IS_EMPTY(cmm_mgr_obj->node_free_list_head)) { - pnode = (struct cmm_mnode *) - lst_get_head(cmm_mgr_obj->node_free_list_head); - kfree(pnode); - } - /* delete NodeFreeList list */ - kfree(cmm_mgr_obj->node_free_list_head); + list_for_each_entry_safe(node, tmp, &cmm_mgr_obj->node_free_list, + link) { + list_del(&node->link); + kfree(node); } mutex_unlock(&cmm_mgr_obj->cmm_lock); if (!status) { @@ -366,7 +351,7 @@ int cmm_free_buf(struct cmm_object *hcmm_mgr, void *buf_pa, { struct cmm_object *cmm_mgr_obj = (struct cmm_object *)hcmm_mgr; int status = -EFAULT; - struct cmm_mnode *mnode_obj = NULL; + struct cmm_mnode *curr, *tmp; struct cmm_allocator *allocator = NULL; struct cmm_attrs *pattrs; @@ -385,22 +370,14 @@ int cmm_free_buf(struct cmm_object *hcmm_mgr, void *buf_pa, allocator = get_allocator(cmm_mgr_obj, ul_seg_id); if (allocator != NULL) { mutex_lock(&cmm_mgr_obj->cmm_lock); - mnode_obj = - (struct cmm_mnode *)lst_first(allocator->in_use_list_head); - while (mnode_obj) { - if ((u32) buf_pa == mnode_obj->dw_pa) { - /* Found it */ - lst_remove_elem(allocator->in_use_list_head, - (struct list_head *)mnode_obj); - /* back to freelist */ - add_to_free_list(allocator, mnode_obj); - status = 0; /* all right! */ + list_for_each_entry_safe(curr, tmp, &allocator->in_use_list, + link) { + if (curr->dw_pa == (u32) buf_pa) { + list_del(&curr->link); + add_to_free_list(allocator, curr); + status = 0; break; } - /* next node. */ - mnode_obj = (struct cmm_mnode *) - lst_next(allocator->in_use_list_head, - (struct list_head *)mnode_obj); } mutex_unlock(&cmm_mgr_obj->cmm_lock); } @@ -443,7 +420,7 @@ int cmm_get_info(struct cmm_object *hcmm_mgr, u32 ul_seg; int status = 0; struct cmm_allocator *altr; - struct cmm_mnode *mnode_obj = NULL; + struct cmm_mnode *curr; DBC_REQUIRE(cmm_info_obj != NULL); @@ -478,17 +455,11 @@ int cmm_get_info(struct cmm_object *hcmm_mgr, cmm_info_obj->seg_info[ul_seg - 1].dw_seg_base_va = altr->dw_vm_base - altr->ul_dsp_size; cmm_info_obj->seg_info[ul_seg - 1].ul_in_use_cnt = 0; - mnode_obj = (struct cmm_mnode *) - lst_first(altr->in_use_list_head); /* Count inUse blocks */ - while (mnode_obj) { + list_for_each_entry(curr, &altr->in_use_list, link) { cmm_info_obj->ul_total_in_use_cnt++; cmm_info_obj->seg_info[ul_seg - 1].ul_in_use_cnt++; - /* next node. */ - mnode_obj = (struct cmm_mnode *) - lst_next(altr->in_use_list_head, - (struct list_head *)mnode_obj); } } } /* end for */ @@ -578,30 +549,17 @@ int cmm_register_gppsm_seg(struct cmm_object *hcmm_mgr, /* return the actual segment identifier */ *sgmt_id = (u32) slot_seg + 1; /* create memory free list */ - psma->free_list_head = kzalloc(sizeof(struct lst_list), - GFP_KERNEL); - if (psma->free_list_head == NULL) { - status = -ENOMEM; - goto func_end; - } - INIT_LIST_HEAD(&psma->free_list_head->head); + INIT_LIST_HEAD(&psma->free_list); /* create memory in-use list */ - psma->in_use_list_head = kzalloc(sizeof(struct - lst_list), GFP_KERNEL); - if (psma->in_use_list_head == NULL) { - status = -ENOMEM; - goto func_end; - } - INIT_LIST_HEAD(&psma->in_use_list_head->head); + INIT_LIST_HEAD(&psma->in_use_list); /* Get a mem node for this hunk-o-memory */ new_node = get_node(cmm_mgr_obj, dw_gpp_base_pa, psma->dw_vm_base, ul_size); /* Place node on the SM allocator's free list */ if (new_node) { - lst_put_tail(psma->free_list_head, - (struct list_head *)new_node); + list_add_tail(&new_node->link, &psma->free_list); } else { status = -ENOMEM; goto func_end; @@ -680,41 +638,22 @@ int cmm_un_register_gppsm_seg(struct cmm_object *hcmm_mgr, */ static void un_register_gppsm_seg(struct cmm_allocator *psma) { - struct cmm_mnode *mnode_obj = NULL; - struct cmm_mnode *next_node = NULL; + struct cmm_mnode *curr, *tmp; DBC_REQUIRE(psma != NULL); - if (psma->free_list_head != NULL) { - /* free nodes on free list */ - mnode_obj = (struct cmm_mnode *)lst_first(psma->free_list_head); - while (mnode_obj) { - next_node = - (struct cmm_mnode *)lst_next(psma->free_list_head, - (struct list_head *) - mnode_obj); - lst_remove_elem(psma->free_list_head, - (struct list_head *)mnode_obj); - kfree((void *)mnode_obj); - /* next node. */ - mnode_obj = next_node; - } - kfree(psma->free_list_head); /* delete freelist */ - /* free nodes on InUse list */ - mnode_obj = - (struct cmm_mnode *)lst_first(psma->in_use_list_head); - while (mnode_obj) { - next_node = - (struct cmm_mnode *)lst_next(psma->in_use_list_head, - (struct list_head *) - mnode_obj); - lst_remove_elem(psma->in_use_list_head, - (struct list_head *)mnode_obj); - kfree((void *)mnode_obj); - /* next node. */ - mnode_obj = next_node; - } - kfree(psma->in_use_list_head); /* delete InUse list */ + + /* free nodes on free list */ + list_for_each_entry_safe(curr, tmp, &psma->free_list, link) { + list_del(&curr->link); + kfree(curr); } + + /* free nodes on InUse list */ + list_for_each_entry_safe(curr, tmp, &psma->in_use_list, link) { + list_del(&curr->link); + kfree(curr); + } + if ((void *)psma->dw_vm_base != NULL) MEM_UNMAP_LINEAR_ADDRESS((void *)psma->dw_vm_base); @@ -758,15 +697,15 @@ static struct cmm_mnode *get_node(struct cmm_object *cmm_mgr_obj, u32 dw_pa, DBC_REQUIRE(dw_va != 0); DBC_REQUIRE(ul_size != 0); /* Check cmm mgr's node freelist */ - if (LST_IS_EMPTY(cmm_mgr_obj->node_free_list_head)) { + if (list_empty(&cmm_mgr_obj->node_free_list)) { pnode = kzalloc(sizeof(struct cmm_mnode), GFP_KERNEL); } else { /* surely a valid element */ - pnode = (struct cmm_mnode *) - lst_get_head(cmm_mgr_obj->node_free_list_head); + pnode = list_first_entry(&cmm_mgr_obj->node_free_list, + struct cmm_mnode, link); + list_del(&pnode->link); } if (pnode) { - lst_init_elem((struct list_head *)pnode); /* set self */ pnode->dw_pa = dw_pa; /* Physical addr of start of block */ pnode->dw_va = dw_va; /* Virtual " " */ pnode->ul_size = ul_size; /* Size of block */ @@ -783,9 +722,7 @@ static struct cmm_mnode *get_node(struct cmm_object *cmm_mgr_obj, u32 dw_pa, static void delete_node(struct cmm_object *cmm_mgr_obj, struct cmm_mnode *pnode) { DBC_REQUIRE(pnode != NULL); - lst_init_elem((struct list_head *)pnode); /* init .self ptr */ - lst_put_tail(cmm_mgr_obj->node_free_list_head, - (struct list_head *)pnode); + list_add_tail(&pnode->link, &cmm_mgr_obj->node_free_list); } /* @@ -797,28 +734,26 @@ static void delete_node(struct cmm_object *cmm_mgr_obj, struct cmm_mnode *pnode) static struct cmm_mnode *get_free_block(struct cmm_allocator *allocator, u32 usize) { - if (allocator) { - struct cmm_mnode *mnode_obj = (struct cmm_mnode *) - lst_first(allocator->free_list_head); - while (mnode_obj) { - if (usize <= (u32) mnode_obj->ul_size) { - lst_remove_elem(allocator->free_list_head, - (struct list_head *)mnode_obj); - return mnode_obj; - } - /* next node. */ - mnode_obj = (struct cmm_mnode *) - lst_next(allocator->free_list_head, - (struct list_head *)mnode_obj); + struct cmm_mnode *node, *tmp; + + if (!allocator) + return NULL; + + list_for_each_entry_safe(node, tmp, &allocator->free_list, link) { + if (usize <= (u32) node->ul_size) { + list_del(&node->link); + return node; } + } + return NULL; } /* * ======== add_to_free_list ======== * Purpose: - * Coelesce node into the freelist in ascending size order. + * Coalesce node into the freelist in ascending size order. */ static void add_to_free_list(struct cmm_allocator *allocator, struct cmm_mnode *pnode) @@ -829,71 +764,51 @@ static void add_to_free_list(struct cmm_allocator *allocator, u32 dw_this_pa; u32 dw_next_pa; - DBC_REQUIRE(pnode != NULL); - DBC_REQUIRE(allocator != NULL); + if (!pnode) { + pr_err("%s: failed - pnode is NULL\n", __func__); + return; + } + dw_this_pa = pnode->dw_pa; dw_next_pa = NEXT_PA(pnode); - mnode_obj = (struct cmm_mnode *)lst_first(allocator->free_list_head); - while (mnode_obj) { + list_for_each_entry(mnode_obj, &allocator->free_list, link) { if (dw_this_pa == NEXT_PA(mnode_obj)) { /* found the block ahead of this one */ node_prev = mnode_obj; } else if (dw_next_pa == mnode_obj->dw_pa) { node_next = mnode_obj; } - if ((node_prev == NULL) || (node_next == NULL)) { - /* next node. */ - mnode_obj = (struct cmm_mnode *) - lst_next(allocator->free_list_head, - (struct list_head *)mnode_obj); - } else { - /* got 'em */ + if ((node_prev != NULL) && (node_next != NULL)) break; - } - } /* while */ + } if (node_prev != NULL) { /* combine with previous block */ - lst_remove_elem(allocator->free_list_head, - (struct list_head *)node_prev); + list_del(&node_prev->link); /* grow node to hold both */ pnode->ul_size += node_prev->ul_size; pnode->dw_pa = node_prev->dw_pa; pnode->dw_va = node_prev->dw_va; /* place node on mgr nodeFreeList */ - delete_node((struct cmm_object *)allocator->hcmm_mgr, - node_prev); + delete_node(allocator->hcmm_mgr, node_prev); } if (node_next != NULL) { /* combine with next block */ - lst_remove_elem(allocator->free_list_head, - (struct list_head *)node_next); + list_del(&node_next->link); /* grow da node */ pnode->ul_size += node_next->ul_size; /* place node on mgr nodeFreeList */ - delete_node((struct cmm_object *)allocator->hcmm_mgr, - node_next); + delete_node(allocator->hcmm_mgr, node_next); } /* Now, let's add to freelist in increasing size order */ - mnode_obj = (struct cmm_mnode *)lst_first(allocator->free_list_head); - while (mnode_obj) { - if (pnode->ul_size <= mnode_obj->ul_size) - break; - - /* next node. */ - mnode_obj = - (struct cmm_mnode *)lst_next(allocator->free_list_head, - (struct list_head *)mnode_obj); - } - /* if mnode_obj is NULL then add our pnode to the end of the freelist */ - if (mnode_obj == NULL) { - lst_put_tail(allocator->free_list_head, - (struct list_head *)pnode); - } else { - /* insert our node before the current traversed node */ - lst_insert_before(allocator->free_list_head, - (struct list_head *)pnode, - (struct list_head *)mnode_obj); + list_for_each_entry(mnode_obj, &allocator->free_list, link) { + if (pnode->ul_size <= mnode_obj->ul_size) { + /* insert our node before the current traversed node */ + list_add_tail(&pnode->link, &mnode_obj->link); + return; + } } + /* add our pnode to the end of the freelist */ + list_add_tail(&pnode->link, &allocator->free_list); } /* diff --git a/drivers/staging/tidspbridge/pmgr/dev.c b/drivers/staging/tidspbridge/pmgr/dev.c index 132e960..6ce3493 100644 --- a/drivers/staging/tidspbridge/pmgr/dev.c +++ b/drivers/staging/tidspbridge/pmgr/dev.c @@ -16,6 +16,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include +#include /* ----------------------------------- Host OS */ #include @@ -28,7 +29,6 @@ /* ----------------------------------- OS Adaptation Layer */ #include -#include /* ----------------------------------- Platform Manager */ #include @@ -60,7 +60,6 @@ /* The Bridge device object: */ struct dev_object { - /* LST requires "link" to be first field! */ struct list_head link; /* Link to next dev_object. */ u8 dev_type; /* Device Type */ struct cfg_devnode *dev_node_obj; /* Platform specific dev id */ @@ -79,7 +78,7 @@ struct dev_object { struct ldr_module *module_obj; /* Bridge Module handle. */ u32 word_size; /* DSP word size: quick access. */ struct drv_object *hdrv_obj; /* Driver Object */ - struct lst_list *proc_list; /* List of Proceeosr attached to + struct list_head proc_list; /* List of Processor attached to * this device */ struct node_mgr *hnode_mgr; }; @@ -255,19 +254,12 @@ int dev_create_device(struct dev_object **device_obj, (struct dev_object *)dev_obj, NULL); } /* Add the new DEV_Object to the global list: */ - if (!status) { - lst_init_elem(&dev_obj->link); + if (!status) status = drv_insert_dev_object(hdrv_obj, dev_obj); - } + /* Create the Processor List */ - if (!status) { - dev_obj->proc_list = kzalloc(sizeof(struct lst_list), - GFP_KERNEL); - if (!(dev_obj->proc_list)) - status = -EPERM; - else - INIT_LIST_HEAD(&dev_obj->proc_list->head); - } + if (!status) + INIT_LIST_HEAD(&dev_obj->proc_list); leave: /* If all went well, return a handle to the dev object; * else, cleanup and return NULL in the OUT parameter. */ @@ -275,7 +267,6 @@ leave: *device_obj = dev_obj; } else { if (dev_obj) { - kfree(dev_obj->proc_list); if (dev_obj->cod_mgr) cod_delete(dev_obj->cod_mgr); if (dev_obj->dmm_mgr) @@ -403,9 +394,6 @@ int dev_destroy_device(struct dev_object *hdev_obj) } else status = -EPERM; if (!status) { - kfree(dev_obj->proc_list); - dev_obj->proc_list = NULL; - /* Remove this DEV_Object from the global list: */ drv_remove_dev_object(dev_obj->hdrv_obj, dev_obj); /* Free The library * LDR_FreeModule @@ -801,18 +789,17 @@ bool dev_init(void) */ int dev_notify_clients(struct dev_object *hdev_obj, u32 ret) { - int status = 0; - struct dev_object *dev_obj = hdev_obj; - void *proc_obj; + struct list_head *curr; - for (proc_obj = (void *)lst_first(dev_obj->proc_list); - proc_obj != NULL; - proc_obj = (void *)lst_next(dev_obj->proc_list, - (struct list_head *)proc_obj)) - proc_notify_clients(proc_obj, (u32) ret); + /* + * FIXME: this code needs struct proc_object to have a list_head + * at the begining. If not, this can go horribly wrong. + */ + list_for_each(curr, &dev_obj->proc_list) + proc_notify_clients((void *)curr, (u32) ret); - return status; + return 0; } /* @@ -1000,15 +987,18 @@ int dev_insert_proc_object(struct dev_object *hdev_obj, DBC_REQUIRE(refs > 0); DBC_REQUIRE(dev_obj); DBC_REQUIRE(proc_obj != 0); - DBC_REQUIRE(dev_obj->proc_list != NULL); DBC_REQUIRE(already_attached != NULL); - if (!LST_IS_EMPTY(dev_obj->proc_list)) + if (!list_empty(&dev_obj->proc_list)) *already_attached = true; /* Add DevObject to tail. */ - lst_put_tail(dev_obj->proc_list, (struct list_head *)proc_obj); + /* + * FIXME: this code needs struct proc_object to have a list_head + * at the begining. If not, this can go horribly wrong. + */ + list_add_tail((struct list_head *)proc_obj, &dev_obj->proc_list); - DBC_ENSURE(!status && !LST_IS_EMPTY(dev_obj->proc_list)); + DBC_ENSURE(!status && !list_empty(&dev_obj->proc_list)); return status; } @@ -1039,15 +1029,12 @@ int dev_remove_proc_object(struct dev_object *hdev_obj, u32 proc_obj) DBC_REQUIRE(dev_obj); DBC_REQUIRE(proc_obj != 0); - DBC_REQUIRE(dev_obj->proc_list != NULL); - DBC_REQUIRE(!LST_IS_EMPTY(dev_obj->proc_list)); + DBC_REQUIRE(!list_empty(&dev_obj->proc_list)); /* Search list for dev_obj: */ - for (cur_elem = lst_first(dev_obj->proc_list); cur_elem != NULL; - cur_elem = lst_next(dev_obj->proc_list, cur_elem)) { - /* If found, remove it. */ + list_for_each(cur_elem, &dev_obj->proc_list) { if ((u32) cur_elem == proc_obj) { - lst_remove_elem(dev_obj->proc_list, cur_elem); + list_del(cur_elem); status = 0; break; } -- cgit v0.10.2 From 0005391f30a9b36e10cc9a4b6e0fa12b1db680c0 Mon Sep 17 00:00:00 2001 From: Ionut Nicu Date: Sun, 21 Nov 2010 10:46:26 +0000 Subject: staging: tidspbridge: convert rmgr to list_head Convert the rmgr module of the tidspbridge driver to use struct list_head instead of struct lst_list. Signed-off-by: Ionut Nicu Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/rmgr/drv.c b/drivers/staging/tidspbridge/rmgr/drv.c index c50579c..e0fc895 100644 --- a/drivers/staging/tidspbridge/rmgr/drv.c +++ b/drivers/staging/tidspbridge/rmgr/drv.c @@ -16,6 +16,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include +#include /* ----------------------------------- Host OS */ #include @@ -26,9 +27,6 @@ /* ----------------------------------- Trace & Debug */ #include -/* ----------------------------------- OS Adaptation Layer */ -#include - /* ----------------------------------- This */ #include #include @@ -42,8 +40,8 @@ /* ----------------------------------- Defines, Data Structures, Typedefs */ struct drv_object { - struct lst_list *dev_list; - struct lst_list *dev_node_string; + struct list_head dev_list; + struct list_head dev_node_string; }; /* @@ -316,22 +314,8 @@ int drv_create(struct drv_object **drv_obj) pdrv_object = kzalloc(sizeof(struct drv_object), GFP_KERNEL); if (pdrv_object) { /* Create and Initialize List of device objects */ - pdrv_object->dev_list = kzalloc(sizeof(struct lst_list), - GFP_KERNEL); - if (pdrv_object->dev_list) { - /* Create and Initialize List of device Extension */ - pdrv_object->dev_node_string = - kzalloc(sizeof(struct lst_list), GFP_KERNEL); - if (!(pdrv_object->dev_node_string)) { - status = -EPERM; - } else { - INIT_LIST_HEAD(&pdrv_object-> - dev_node_string->head); - INIT_LIST_HEAD(&pdrv_object->dev_list->head); - } - } else { - status = -ENOMEM; - } + INIT_LIST_HEAD(&pdrv_object->dev_list); + INIT_LIST_HEAD(&pdrv_object->dev_node_string); } else { status = -ENOMEM; } @@ -348,8 +332,6 @@ int drv_create(struct drv_object **drv_obj) if (!status) { *drv_obj = pdrv_object; } else { - kfree(pdrv_object->dev_list); - kfree(pdrv_object->dev_node_string); /* Free the DRV Object */ kfree(pdrv_object); } @@ -386,13 +368,6 @@ int drv_destroy(struct drv_object *driver_obj) DBC_REQUIRE(refs > 0); DBC_REQUIRE(pdrv_object); - /* - * Delete the List if it exists.Should not come here - * as the drv_remove_dev_object and the Last drv_request_resources - * removes the list if the lists are empty. - */ - kfree(pdrv_object->dev_list); - kfree(pdrv_object->dev_node_string); kfree(pdrv_object); /* Update the DRV Object in the driver data */ if (drv_datap) { @@ -424,7 +399,7 @@ int drv_get_dev_object(u32 index, struct drv_object *hdrv_obj, DBC_REQUIRE(device_obj != NULL); DBC_REQUIRE(index >= 0); DBC_REQUIRE(refs > 0); - DBC_ASSERT(!(LST_IS_EMPTY(pdrv_obj->dev_list))); + DBC_ASSERT(!(list_empty(&pdrv_obj->dev_list))); dev_obj = (struct dev_object *)drv_get_first_dev_object(); for (i = 0; i < index; i++) { @@ -455,9 +430,8 @@ u32 drv_get_first_dev_object(void) if (drv_datap && drv_datap->drv_object) { pdrv_obj = drv_datap->drv_object; - if ((pdrv_obj->dev_list != NULL) && - !LST_IS_EMPTY(pdrv_obj->dev_list)) - dw_dev_object = (u32) lst_first(pdrv_obj->dev_list); + if (!list_empty(&pdrv_obj->dev_list)) + dw_dev_object = (u32) pdrv_obj->dev_list.next; } else { pr_err("%s: Failed to retrieve the object handle\n", __func__); } @@ -479,10 +453,9 @@ u32 drv_get_first_dev_extension(void) if (drv_datap && drv_datap->drv_object) { pdrv_obj = drv_datap->drv_object; - if ((pdrv_obj->dev_node_string != NULL) && - !LST_IS_EMPTY(pdrv_obj->dev_node_string)) { + if (!list_empty(&pdrv_obj->dev_node_string)) { dw_dev_extension = - (u32) lst_first(pdrv_obj->dev_node_string); + (u32) pdrv_obj->dev_node_string.next; } } else { pr_err("%s: Failed to retrieve the object handle\n", __func__); @@ -503,16 +476,15 @@ u32 drv_get_next_dev_object(u32 hdev_obj) u32 dw_next_dev_object = 0; struct drv_object *pdrv_obj; struct drv_data *drv_datap = dev_get_drvdata(bridge); - - DBC_REQUIRE(hdev_obj != 0); + struct list_head *curr; if (drv_datap && drv_datap->drv_object) { pdrv_obj = drv_datap->drv_object; - if ((pdrv_obj->dev_list != NULL) && - !LST_IS_EMPTY(pdrv_obj->dev_list)) { - dw_next_dev_object = (u32) lst_next(pdrv_obj->dev_list, - (struct list_head *) - hdev_obj); + if (!list_empty(&pdrv_obj->dev_list)) { + curr = (struct list_head *)hdev_obj; + if (list_is_last(curr, &pdrv_obj->dev_list)) + return 0; + dw_next_dev_object = (u32) curr->next; } } else { pr_err("%s: Failed to retrieve the object handle\n", __func__); @@ -534,16 +506,15 @@ u32 drv_get_next_dev_extension(u32 dev_extension) u32 dw_dev_extension = 0; struct drv_object *pdrv_obj; struct drv_data *drv_datap = dev_get_drvdata(bridge); - - DBC_REQUIRE(dev_extension != 0); + struct list_head *curr; if (drv_datap && drv_datap->drv_object) { pdrv_obj = drv_datap->drv_object; - if ((pdrv_obj->dev_node_string != NULL) && - !LST_IS_EMPTY(pdrv_obj->dev_node_string)) { - dw_dev_extension = - (u32) lst_next(pdrv_obj->dev_node_string, - (struct list_head *)dev_extension); + if (!list_empty(&pdrv_obj->dev_node_string)) { + curr = (struct list_head *)dev_extension; + if (list_is_last(curr, &pdrv_obj->dev_node_string)) + return 0; + dw_dev_extension = (u32) curr->next; } } else { pr_err("%s: Failed to retrieve the object handle\n", __func__); @@ -584,11 +555,8 @@ int drv_insert_dev_object(struct drv_object *driver_obj, DBC_REQUIRE(refs > 0); DBC_REQUIRE(hdev_obj != NULL); DBC_REQUIRE(pdrv_object); - DBC_ASSERT(pdrv_object->dev_list); - - lst_put_tail(pdrv_object->dev_list, (struct list_head *)hdev_obj); - DBC_ENSURE(!LST_IS_EMPTY(pdrv_object->dev_list)); + list_add_tail((struct list_head *)hdev_obj, &pdrv_object->dev_list); return 0; } @@ -610,26 +578,17 @@ int drv_remove_dev_object(struct drv_object *driver_obj, DBC_REQUIRE(pdrv_object); DBC_REQUIRE(hdev_obj != NULL); - DBC_REQUIRE(pdrv_object->dev_list != NULL); - DBC_REQUIRE(!LST_IS_EMPTY(pdrv_object->dev_list)); + DBC_REQUIRE(!list_empty(&pdrv_object->dev_list)); /* Search list for p_proc_object: */ - for (cur_elem = lst_first(pdrv_object->dev_list); cur_elem != NULL; - cur_elem = lst_next(pdrv_object->dev_list, cur_elem)) { + list_for_each(cur_elem, &pdrv_object->dev_list) { /* If found, remove it. */ if ((struct dev_object *)cur_elem == hdev_obj) { - lst_remove_elem(pdrv_object->dev_list, cur_elem); + list_del(cur_elem); status = 0; break; } } - /* Remove list if empty. */ - if (LST_IS_EMPTY(pdrv_object->dev_list)) { - kfree(pdrv_object->dev_list); - pdrv_object->dev_list = NULL; - } - DBC_ENSURE((pdrv_object->dev_list == NULL) || - !LST_IS_EMPTY(pdrv_object->dev_list)); return status; } @@ -663,14 +622,13 @@ int drv_request_resources(u32 dw_context, u32 *dev_node_strg) if (!status) { pszdev_node = kzalloc(sizeof(struct drv_ext), GFP_KERNEL); if (pszdev_node) { - lst_init_elem(&pszdev_node->link); strncpy(pszdev_node->sz_string, (char *)dw_context, MAXREGPATHLENGTH - 1); pszdev_node->sz_string[MAXREGPATHLENGTH - 1] = '\0'; /* Update the Driver Object List */ *dev_node_strg = (u32) pszdev_node->sz_string; - lst_put_tail(pdrv_object->dev_node_string, - (struct list_head *)pszdev_node); + list_add_tail(&pszdev_node->link, + &pdrv_object->dev_node_string); } else { status = -ENOMEM; *dev_node_strg = 0; @@ -682,7 +640,7 @@ int drv_request_resources(u32 dw_context, u32 *dev_node_strg) } DBC_ENSURE((!status && dev_node_strg != NULL && - !LST_IS_EMPTY(pdrv_object->dev_node_string)) || + !list_empty(&pdrv_object->dev_node_string)) || (status && *dev_node_strg == 0)); return status; @@ -696,7 +654,6 @@ int drv_request_resources(u32 dw_context, u32 *dev_node_strg) int drv_release_resources(u32 dw_context, struct drv_object *hdrv_obj) { int status = 0; - struct drv_object *pdrv_object = (struct drv_object *)hdrv_obj; struct drv_ext *pszdev_node; /* @@ -706,23 +663,13 @@ int drv_release_resources(u32 dw_context, struct drv_object *hdrv_obj) for (pszdev_node = (struct drv_ext *)drv_get_first_dev_extension(); pszdev_node != NULL; pszdev_node = (struct drv_ext *) drv_get_next_dev_extension((u32) pszdev_node)) { - if (!pdrv_object->dev_node_string) { - /* When this could happen? */ - continue; - } if ((u32) pszdev_node == dw_context) { /* Found it */ /* Delete from the Driver object list */ - lst_remove_elem(pdrv_object->dev_node_string, - (struct list_head *)pszdev_node); - kfree((void *)pszdev_node); + list_del(&pszdev_node->link); + kfree(pszdev_node); break; } - /* Delete the List if it is empty */ - if (LST_IS_EMPTY(pdrv_object->dev_node_string)) { - kfree(pdrv_object->dev_node_string); - pdrv_object->dev_node_string = NULL; - } } return status; } diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c index ab35806..62d5c31 100644 --- a/drivers/staging/tidspbridge/rmgr/node.c +++ b/drivers/staging/tidspbridge/rmgr/node.c @@ -18,6 +18,8 @@ #include #include +#include + /* ----------------------------------- Host OS */ #include @@ -28,7 +30,6 @@ #include /* ----------------------------------- OS Adaptation Layer */ -#include #include #include #include @@ -129,7 +130,7 @@ struct node_mgr { struct bridge_drv_interface *intf_fxns; struct dcd_manager *hdcd_mgr; /* Proc/Node data manager */ struct disp_object *disp_obj; /* Node dispatcher */ - struct lst_list *node_list; /* List of all allocated nodes */ + struct list_head node_list; /* List of all allocated nodes */ u32 num_nodes; /* Number of nodes in node_list */ u32 num_created; /* Number of nodes *created* on DSP */ DECLARE_BITMAP(pipe_map, MAXPIPES); /* Pipe connection bitmap */ @@ -640,13 +641,12 @@ func_cont: if (!status) { /* Add the node to the node manager's list of allocated * nodes. */ - lst_init_elem((struct list_head *)pnode); NODE_SET_STATE(pnode, NODE_ALLOCATED); mutex_lock(&hnode_mgr->node_mgr_lock); - lst_put_tail(hnode_mgr->node_list, (struct list_head *) pnode); - ++(hnode_mgr->num_nodes); + list_add_tail(&pnode->list_elem, &hnode_mgr->node_list); + ++(hnode_mgr->num_nodes); /* Exit critical section */ mutex_unlock(&hnode_mgr->node_mgr_lock); @@ -1338,9 +1338,7 @@ int node_create_mgr(struct node_mgr **node_man, node_mgr_obj = kzalloc(sizeof(struct node_mgr), GFP_KERNEL); if (node_mgr_obj) { node_mgr_obj->hdev_obj = hdev_obj; - node_mgr_obj->node_list = kzalloc(sizeof(struct lst_list), - GFP_KERNEL); - INIT_LIST_HEAD(&node_mgr_obj->node_list->head); + INIT_LIST_HEAD(&node_mgr_obj->node_list); node_mgr_obj->ntfy_obj = kmalloc( sizeof(struct ntfy_object), GFP_KERNEL); if (node_mgr_obj->ntfy_obj) @@ -1563,7 +1561,7 @@ func_cont1: } /* Free host side resources even if a failure occurred */ /* Remove node from hnode_mgr->node_list */ - lst_remove_elem(hnode_mgr->node_list, (struct list_head *)pnode); + list_del(&pnode->list_elem); hnode_mgr->num_nodes--; /* Decrement count of nodes created on DSP */ if ((state != NODE_ALLOCATED) || ((state == NODE_ALLOCATED) && @@ -1617,7 +1615,7 @@ int node_enum_nodes(struct node_mgr *hnode_mgr, void **node_tab, u32 *pu_allocated) { struct node_object *hnode; - u32 i; + u32 i = 0; int status = 0; DBC_REQUIRE(refs > 0); DBC_REQUIRE(node_tab != NULL || node_tab_size == 0); @@ -1636,15 +1634,8 @@ int node_enum_nodes(struct node_mgr *hnode_mgr, void **node_tab, *pu_num_nodes = 0; status = -EINVAL; } else { - hnode = (struct node_object *)lst_first(hnode_mgr-> - node_list); - for (i = 0; i < hnode_mgr->num_nodes; i++) { - DBC_ASSERT(hnode); - node_tab[i] = hnode; - hnode = (struct node_object *)lst_next - (hnode_mgr->node_list, - (struct list_head *)hnode); - } + list_for_each_entry(hnode, &hnode_mgr->node_list, list_elem) + node_tab[i++] = hnode; *pu_allocated = *pu_num_nodes = hnode_mgr->num_nodes; } /* end of sync_enter_cs */ @@ -2632,7 +2623,7 @@ func_end: */ static void delete_node_mgr(struct node_mgr *hnode_mgr) { - struct node_object *hnode; + struct node_object *hnode, *tmp; if (hnode_mgr) { /* Free resources */ @@ -2640,13 +2631,10 @@ static void delete_node_mgr(struct node_mgr *hnode_mgr) dcd_destroy_manager(hnode_mgr->hdcd_mgr); /* Remove any elements remaining in lists */ - if (hnode_mgr->node_list) { - while ((hnode = (struct node_object *) - lst_get_head(hnode_mgr->node_list))) - delete_node(hnode, NULL); - - DBC_ASSERT(LST_IS_EMPTY(hnode_mgr->node_list)); - kfree(hnode_mgr->node_list); + list_for_each_entry_safe(hnode, tmp, &hnode_mgr->node_list, + list_elem) { + list_del(&hnode->list_elem); + delete_node(hnode, NULL); } mutex_destroy(&hnode_mgr->node_mgr_lock); if (hnode_mgr->ntfy_obj) { @@ -3186,23 +3174,17 @@ int node_find_addr(struct node_mgr *node_mgr, u32 sym_addr, { struct node_object *node_obj; int status = -ENOENT; - u32 n; pr_debug("%s(0x%x, 0x%x, 0x%x, 0x%x, %s)\n", __func__, (unsigned int) node_mgr, sym_addr, offset_range, (unsigned int) sym_addr_output, sym_name); - node_obj = (struct node_object *)(node_mgr->node_list->head.next); - - for (n = 0; n < node_mgr->num_nodes; n++) { + list_for_each_entry(node_obj, &node_mgr->node_list, list_elem) { status = nldr_find_addr(node_obj->nldr_node_obj, sym_addr, offset_range, sym_addr_output, sym_name); - if (!status) break; - - node_obj = (struct node_object *) (node_obj->list_elem.next); } return status; diff --git a/drivers/staging/tidspbridge/rmgr/proc.c b/drivers/staging/tidspbridge/rmgr/proc.c index b47d7aa..d5f6719 100644 --- a/drivers/staging/tidspbridge/rmgr/proc.c +++ b/drivers/staging/tidspbridge/rmgr/proc.c @@ -29,7 +29,6 @@ #include /* ----------------------------------- OS Adaptation Layer */ -#include #include #include /* ----------------------------------- Bridge Driver */ @@ -357,7 +356,6 @@ proc_attach(u32 processor_id, * Return handle to this Processor Object: * Find out if the Device is already attached to a * Processor. If so, return AlreadyAttached status */ - lst_init_elem(&p_proc_object->link); status = dev_insert_proc_object(p_proc_object->hdev_obj, (u32) p_proc_object, &p_proc_object-> diff --git a/drivers/staging/tidspbridge/rmgr/rmm.c b/drivers/staging/tidspbridge/rmgr/rmm.c index 761e8f4..aae8657 100644 --- a/drivers/staging/tidspbridge/rmgr/rmm.c +++ b/drivers/staging/tidspbridge/rmgr/rmm.c @@ -38,6 +38,10 @@ */ #include +#include + +/* ----------------------------------- Host OS */ +#include /* ----------------------------------- DSP/BIOS Bridge */ #include @@ -45,9 +49,6 @@ /* ----------------------------------- Trace & Debug */ #include -/* ----------------------------------- OS Adaptation Layer */ -#include - /* ----------------------------------- This */ #include @@ -79,7 +80,7 @@ struct rmm_target_obj { struct rmm_segment *seg_tab; struct rmm_header **free_list; u32 num_segs; - struct lst_list *ovly_list; /* List of overlay memory in use */ + struct list_head ovly_list; /* List of overlay memory in use */ }; static u32 refs; /* module reference count */ @@ -95,8 +96,7 @@ static bool free_block(struct rmm_target_obj *target, u32 segid, u32 addr, int rmm_alloc(struct rmm_target_obj *target, u32 segid, u32 size, u32 align, u32 *dsp_address, bool reserve) { - struct rmm_ovly_sect *sect; - struct rmm_ovly_sect *prev_sect = NULL; + struct rmm_ovly_sect *sect, *prev_sect = NULL; struct rmm_ovly_sect *new_sect; u32 addr; int status = 0; @@ -120,10 +120,9 @@ int rmm_alloc(struct rmm_target_obj *target, u32 segid, u32 size, /* An overlay section - See if block is already in use. If not, * insert into the list in ascending address size. */ addr = *dsp_address; - sect = (struct rmm_ovly_sect *)lst_first(target->ovly_list); /* Find place to insert new list element. List is sorted from * smallest to largest address. */ - while (sect != NULL) { + list_for_each_entry(sect, &target->ovly_list, list_elem) { if (addr <= sect->addr) { /* Check for overlap with sect */ if ((addr + size > sect->addr) || (prev_sect && @@ -135,9 +134,6 @@ int rmm_alloc(struct rmm_target_obj *target, u32 segid, u32 size, break; } prev_sect = sect; - sect = (struct rmm_ovly_sect *)lst_next(target->ovly_list, - (struct list_head *) - sect); } if (!status) { /* No overlap - allocate list element for new section. */ @@ -145,20 +141,17 @@ int rmm_alloc(struct rmm_target_obj *target, u32 segid, u32 size, if (new_sect == NULL) { status = -ENOMEM; } else { - lst_init_elem((struct list_head *)new_sect); new_sect->addr = addr; new_sect->size = size; new_sect->page = segid; - if (sect == NULL) { + if (list_is_last(sect, &target->ovly_list)) /* Put new section at the end of the list */ - lst_put_tail(target->ovly_list, - (struct list_head *)new_sect); - } else { + list_add_tail(&new_sect->list_elem, + &target->ovly_list); + else /* Put new section just before sect */ - lst_insert_before(target->ovly_list, - (struct list_head *)new_sect, - (struct list_head *)sect); - } + list_add_tail(&new_sect->list_elem, + §->list_elem); } } func_end: @@ -230,14 +223,8 @@ int rmm_create(struct rmm_target_obj **target_obj, } func_cont: /* Initialize overlay memory list */ - if (!status) { - target->ovly_list = kzalloc(sizeof(struct lst_list), - GFP_KERNEL); - if (target->ovly_list == NULL) - status = -ENOMEM; - else - INIT_LIST_HEAD(&target->ovly_list->head); - } + if (!status) + INIT_LIST_HEAD(&target->ovly_list); if (!status) { *target_obj = target; @@ -259,7 +246,7 @@ func_cont: */ void rmm_delete(struct rmm_target_obj *target) { - struct rmm_ovly_sect *ovly_section; + struct rmm_ovly_sect *sect, *tmp; struct rmm_header *hptr; struct rmm_header *next; u32 i; @@ -268,13 +255,9 @@ void rmm_delete(struct rmm_target_obj *target) kfree(target->seg_tab); - if (target->ovly_list) { - while ((ovly_section = (struct rmm_ovly_sect *)lst_get_head - (target->ovly_list))) { - kfree(ovly_section); - } - DBC_ASSERT(LST_IS_EMPTY(target->ovly_list)); - kfree(target->ovly_list); + list_for_each_entry_safe(sect, tmp, &target->ovly_list, list_elem) { + list_del(§->list_elem); + kfree(sect); } if (target->free_list != NULL) { @@ -311,8 +294,8 @@ void rmm_exit(void) bool rmm_free(struct rmm_target_obj *target, u32 segid, u32 dsp_addr, u32 size, bool reserved) { - struct rmm_ovly_sect *sect; - bool ret = true; + struct rmm_ovly_sect *sect, *tmp; + bool ret = false; DBC_REQUIRE(target); @@ -333,24 +316,16 @@ bool rmm_free(struct rmm_target_obj *target, u32 segid, u32 dsp_addr, u32 size, } else { /* Unreserve memory */ - sect = (struct rmm_ovly_sect *)lst_first(target->ovly_list); - while (sect != NULL) { + list_for_each_entry_safe(sect, tmp, &target->ovly_list, + list_elem) { if (dsp_addr == sect->addr) { DBC_ASSERT(size == sect->size); /* Remove from list */ - lst_remove_elem(target->ovly_list, - (struct list_head *)sect); + list_del(§->list_elem); kfree(sect); - break; + return true; } - sect = - (struct rmm_ovly_sect *)lst_next(target->ovly_list, - (struct list_head - *)sect); } - if (sect == NULL) - ret = false; - } return ret; } -- cgit v0.10.2 From edbeef96473fac02c7aa21db0c9de23cb6299288 Mon Sep 17 00:00:00 2001 From: Ionut Nicu Date: Sun, 21 Nov 2010 10:46:27 +0000 Subject: staging: tidspbridge: remove custom linked list Now that all users of lst_list have been converted to the standard linux list_head API, we can remove the associated header file. Signed-off-by: Ionut Nicu Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/TODO b/drivers/staging/tidspbridge/TODO index 187363f..1c51e2d 100644 --- a/drivers/staging/tidspbridge/TODO +++ b/drivers/staging/tidspbridge/TODO @@ -6,7 +6,6 @@ * Eliminate general services and libraries - use or extend existing kernel libraries instead (e.g. gcf/lcm in nldr.c, global helpers in gen/) * Eliminate direct manipulation of OMAP_SYSC_BASE -* Eliminate list.h : seem like a redundant wrapper to existing kernel lists * Eliminate DSP_SUCCEEDED macros and their imposed redundant indentations (adopt the kernel way of checking for return values) * Audit interfaces exposed to user space diff --git a/drivers/staging/tidspbridge/include/dspbridge/list.h b/drivers/staging/tidspbridge/include/dspbridge/list.h deleted file mode 100644 index 6837b61..0000000 --- a/drivers/staging/tidspbridge/include/dspbridge/list.h +++ /dev/null @@ -1,225 +0,0 @@ -/* - * list.h - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * Declarations of list management control structures and definitions - * of inline list management functions. - * - * Copyright (C) 2008 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef LIST_ -#define LIST_ - -#include -#include - -#define LST_IS_EMPTY(l) list_empty(&(l)->head) - -struct lst_list { - struct list_head head; -}; - -/* - * ======== lst_first ======== - * Purpose: - * Returns a pointer to the first element of the list, or NULL if the list - * is empty. - * Parameters: - * lst: Pointer to list control structure. - * Returns: - * Pointer to first list element, or NULL. - * Requires: - * - LST initialized. - * - lst != NULL. - * Ensures: - */ -static inline struct list_head *lst_first(struct lst_list *lst) -{ - if (lst && !list_empty(&lst->head)) - return lst->head.next; - return NULL; -} - -/* - * ======== lst_get_head ======== - * Purpose: - * Pops the head off the list and returns a pointer to it. - * Details: - * If the list is empty, returns NULL. - * Else, removes the element at the head of the list, making the next - * element the head of the list. - * The head is removed by making the tail element of the list point its - * "next" pointer at the next element after the head, and by making the - * "prev" pointer of the next element after the head point at the tail - * element. So the next element after the head becomes the new head of - * the list. - * Parameters: - * lst: Pointer to list control structure of list whose head - * element is to be removed - * Returns: - * Pointer to element that was at the head of the list (success) - * NULL No elements in list - * Requires: - * - LST initialized. - * - lst != NULL. - * Ensures: - * Notes: - * Because the tail of the list points forward (its "next" pointer) to - * the head of the list, and the head of the list points backward (its - * "prev" pointer) to the tail of the list, this list is circular. - */ -static inline struct list_head *lst_get_head(struct lst_list *lst) -{ - struct list_head *elem_list; - - if (!lst || list_empty(&lst->head)) - return NULL; - - elem_list = lst->head.next; - lst->head.next = elem_list->next; - elem_list->next->prev = &lst->head; - - return elem_list; -} - -/* - * ======== lst_init_elem ======== - * Purpose: - * Initializes a list element to default (cleared) values - * Details: - * Parameters: - * elem_list: Pointer to list element to be reset - * Returns: - * Requires: - * LST initialized. - * Ensures: - * Notes: - * This function must not be called to "reset" an element in the middle - * of a list chain -- that would break the chain. - * - */ -static inline void lst_init_elem(struct list_head *elem_list) -{ - if (elem_list) { - elem_list->next = NULL; - elem_list->prev = NULL; - } -} - -/* - * ======== lst_insert_before ======== - * Purpose: - * Insert the element before the existing element. - * Parameters: - * lst: Pointer to list control structure. - * elem_list: Pointer to element in list to insert. - * elem_existing: Pointer to existing list element. - * Returns: - * Requires: - * - LST initialized. - * - lst != NULL. - * - elem_list != NULL. - * - elem_existing != NULL. - * Ensures: - */ -static inline void lst_insert_before(struct lst_list *lst, - struct list_head *elem_list, - struct list_head *elem_existing) -{ - if (lst && elem_list && elem_existing) - list_add_tail(elem_list, elem_existing); -} - -/* - * ======== lst_next ======== - * Purpose: - * Returns a pointer to the next element of the list, or NULL if the next - * element is the head of the list or the list is empty. - * Parameters: - * lst: Pointer to list control structure. - * cur_elem: Pointer to element in list to remove. - * Returns: - * Pointer to list element, or NULL. - * Requires: - * - LST initialized. - * - lst != NULL. - * - cur_elem != NULL. - * Ensures: - */ -static inline struct list_head *lst_next(struct lst_list *lst, - struct list_head *cur_elem) -{ - if (lst && !list_empty(&lst->head) && cur_elem && - (cur_elem->next != &lst->head)) - return cur_elem->next; - return NULL; -} - -/* - * ======== lst_put_tail ======== - * Purpose: - * Adds the specified element to the tail of the list - * Details: - * Sets new element's "prev" pointer to the address previously held by - * the head element's prev pointer. This is the previous tail member of - * the list. - * Sets the new head's prev pointer to the address of the element. - * Sets next pointer of the previous tail member of the list to point to - * the new element (rather than the head, which it had been pointing at). - * Sets new element's next pointer to the address of the head element. - * Sets head's prev pointer to the address of the new element. - * Parameters: - * lst: Pointer to list control structure to which *elem_list will be - * added - * elem_list: Pointer to list element to be added - * Returns: - * Void - * Requires: - * *elem_list and *lst must both exist. - * LST initialized. - * Ensures: - * Notes: - * Because the tail is always "just before" the head of the list (the - * tail's "next" pointer points at the head of the list, and the head's - * "prev" pointer points at the tail of the list), the list is circular. - */ -static inline void lst_put_tail(struct lst_list *lst, - struct list_head *elem_list) -{ - if (lst && elem_list) - list_add_tail(elem_list, &lst->head); -} - -/* - * ======== lst_remove_elem ======== - * Purpose: - * Removes (unlinks) the given element from the list, if the list is not - * empty. Does not free the list element. - * Parameters: - * lst: Pointer to list control structure. - * cur_elem: Pointer to element in list to remove. - * Returns: - * Requires: - * - LST initialized. - * - lst != NULL. - * - cur_elem != NULL. - * Ensures: - */ -static inline void lst_remove_elem(struct lst_list *lst, - struct list_head *cur_elem) -{ - if (lst && !list_empty(&lst->head) && cur_elem) - list_del_init(cur_elem); -} - -#endif /* LIST_ */ -- cgit v0.10.2 From d65c14b3611ca5e0ed64305faddd39e604f618da Mon Sep 17 00:00:00 2001 From: Ionut Nicu Date: Sun, 21 Nov 2010 10:46:28 +0000 Subject: staging: tidspbridge: core code cleanup Reorganized some code in the core module to increase its readability. Most of the changes reduce the code indentation level and simplifiy the code. No functional changes were done. Signed-off-by: Ionut Nicu Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c b/drivers/staging/tidspbridge/core/chnl_sm.c index f955036..2d06bb0 100644 --- a/drivers/staging/tidspbridge/core/chnl_sm.c +++ b/drivers/staging/tidspbridge/core/chnl_sm.c @@ -105,35 +105,31 @@ int bridge_chnl_add_io_req(struct chnl_object *chnl_obj, void *host_buf, is_eos = (byte_size == 0); /* Validate args */ - if (!host_buf || !pchnl) { - status = -EFAULT; - } else if (is_eos && CHNL_IS_INPUT(pchnl->chnl_mode)) { - status = -EPERM; - } else { - /* - * Check the channel state: only queue chirp if channel state - * allows it. - */ - dw_state = pchnl->dw_state; - if (dw_state != CHNL_STATEREADY) { - if (dw_state & CHNL_STATECANCEL) - status = -ECANCELED; - else if ((dw_state & CHNL_STATEEOS) && - CHNL_IS_OUTPUT(pchnl->chnl_mode)) - status = -EPIPE; - else - /* No other possible states left */ - DBC_ASSERT(0); - } + if (!host_buf || !pchnl) + return -EFAULT; + + if (is_eos && CHNL_IS_INPUT(pchnl->chnl_mode)) + return -EPERM; + + /* + * Check the channel state: only queue chirp if channel state + * allows it. + */ + dw_state = pchnl->dw_state; + if (dw_state != CHNL_STATEREADY) { + if (dw_state & CHNL_STATECANCEL) + return -ECANCELED; + if ((dw_state & CHNL_STATEEOS) && + CHNL_IS_OUTPUT(pchnl->chnl_mode)) + return -EPIPE; + /* No other possible states left */ + DBC_ASSERT(0); } dev_obj = dev_get_first(); dev_get_bridge_context(dev_obj, &dev_ctxt); if (!dev_ctxt) - status = -EFAULT; - - if (status) - goto func_end; + return -EFAULT; if (pchnl->chnl_type == CHNL_PCPY && pchnl->chnl_id > 1 && host_buf) { if (!(host_buf < (void *)USERMODE_ADDR)) { @@ -142,18 +138,16 @@ int bridge_chnl_add_io_req(struct chnl_object *chnl_obj, void *host_buf, } /* if addr in user mode, then copy to kernel space */ host_sys_buf = kmalloc(buf_size, GFP_KERNEL); - if (host_sys_buf == NULL) { - status = -ENOMEM; - goto func_end; - } + if (host_sys_buf == NULL) + return -ENOMEM; + if (CHNL_IS_OUTPUT(pchnl->chnl_mode)) { status = copy_from_user(host_sys_buf, host_buf, - buf_size); + buf_size); if (status) { kfree(host_sys_buf); host_sys_buf = NULL; - status = -EFAULT; - goto func_end; + return -EFAULT; } } } @@ -167,66 +161,62 @@ func_cont: omap_mbox_disable_irq(dev_ctxt->mbox, IRQ_RX); if (pchnl->chnl_type == CHNL_PCPY) { /* This is a processor-copy channel. */ - if (!status && CHNL_IS_OUTPUT(pchnl->chnl_mode)) { + if (CHNL_IS_OUTPUT(pchnl->chnl_mode)) { /* Check buffer size on output channels for fit. */ - if (byte_size > - io_buf_size(pchnl->chnl_mgr_obj->hio_mgr)) + if (byte_size > io_buf_size( + pchnl->chnl_mgr_obj->hio_mgr)) { status = -EINVAL; - - } - } - if (!status) { - /* Get a free chirp: */ - if (!list_empty(&pchnl->free_packets_list)) { - chnl_packet_obj = list_first_entry( - &pchnl->free_packets_list, - struct chnl_irp, link); - list_del(&chnl_packet_obj->link); - } else { - status = -EIO; + goto out; + } } - } - if (!status) { - /* Enqueue the chirp on the chnl's IORequest queue: */ - chnl_packet_obj->host_user_buf = chnl_packet_obj->host_sys_buf = - host_buf; - if (pchnl->chnl_type == CHNL_PCPY && pchnl->chnl_id > 1) - chnl_packet_obj->host_sys_buf = host_sys_buf; - - /* - * Note: for dma chans dw_dsp_addr contains dsp address - * of SM buffer. - */ - DBC_ASSERT(chnl_mgr_obj->word_size != 0); - /* DSP address */ - chnl_packet_obj->dsp_tx_addr = - dw_dsp_addr / chnl_mgr_obj->word_size; - chnl_packet_obj->byte_size = byte_size; - chnl_packet_obj->buf_size = buf_size; - /* Only valid for output channel */ - chnl_packet_obj->dw_arg = dw_arg; - chnl_packet_obj->status = (is_eos ? CHNL_IOCSTATEOS : - CHNL_IOCSTATCOMPLETE); - list_add_tail(&chnl_packet_obj->link, &pchnl->pio_requests); - pchnl->cio_reqs++; - DBC_ASSERT(pchnl->cio_reqs <= pchnl->chnl_packets); - /* - * If end of stream, update the channel state to prevent - * more IOR's. - */ - if (is_eos) - pchnl->dw_state |= CHNL_STATEEOS; - /* Legacy DSM Processor-Copy */ - DBC_ASSERT(pchnl->chnl_type == CHNL_PCPY); - /* Request IO from the DSP */ - io_request_chnl(chnl_mgr_obj->hio_mgr, pchnl, - (CHNL_IS_INPUT(pchnl->chnl_mode) ? IO_INPUT : - IO_OUTPUT), &mb_val); - sched_dpc = true; - - } + /* Get a free chirp: */ + if (list_empty(&pchnl->free_packets_list)) { + status = -EIO; + goto out; + } + chnl_packet_obj = list_first_entry(&pchnl->free_packets_list, + struct chnl_irp, link); + list_del(&chnl_packet_obj->link); + + /* Enqueue the chirp on the chnl's IORequest queue: */ + chnl_packet_obj->host_user_buf = chnl_packet_obj->host_sys_buf = + host_buf; + if (pchnl->chnl_type == CHNL_PCPY && pchnl->chnl_id > 1) + chnl_packet_obj->host_sys_buf = host_sys_buf; + + /* + * Note: for dma chans dw_dsp_addr contains dsp address + * of SM buffer. + */ + DBC_ASSERT(chnl_mgr_obj->word_size != 0); + /* DSP address */ + chnl_packet_obj->dsp_tx_addr = dw_dsp_addr / chnl_mgr_obj->word_size; + chnl_packet_obj->byte_size = byte_size; + chnl_packet_obj->buf_size = buf_size; + /* Only valid for output channel */ + chnl_packet_obj->dw_arg = dw_arg; + chnl_packet_obj->status = (is_eos ? CHNL_IOCSTATEOS : + CHNL_IOCSTATCOMPLETE); + list_add_tail(&chnl_packet_obj->link, &pchnl->pio_requests); + pchnl->cio_reqs++; + DBC_ASSERT(pchnl->cio_reqs <= pchnl->chnl_packets); + /* + * If end of stream, update the channel state to prevent + * more IOR's. + */ + if (is_eos) + pchnl->dw_state |= CHNL_STATEEOS; + + /* Legacy DSM Processor-Copy */ + DBC_ASSERT(pchnl->chnl_type == CHNL_PCPY); + /* Request IO from the DSP */ + io_request_chnl(chnl_mgr_obj->hio_mgr, pchnl, + (CHNL_IS_INPUT(pchnl->chnl_mode) ? IO_INPUT : + IO_OUTPUT), &mb_val); + sched_dpc = true; +out: omap_mbox_enable_irq(dev_ctxt->mbox, IRQ_RX); spin_unlock_bh(&chnl_mgr_obj->chnl_mgr_lock); if (mb_val != 0) @@ -236,7 +226,6 @@ func_cont: if (sched_dpc) iosm_schedule(chnl_mgr_obj->hio_mgr); -func_end: return status; } @@ -251,7 +240,6 @@ func_end: */ int bridge_chnl_cancel_io(struct chnl_object *chnl_obj) { - int status = 0; struct chnl_object *pchnl = (struct chnl_object *)chnl_obj; u32 chnl_id = -1; s8 chnl_mode; @@ -259,22 +247,23 @@ int bridge_chnl_cancel_io(struct chnl_object *chnl_obj) struct chnl_mgr *chnl_mgr_obj = NULL; /* Check args: */ - if (pchnl && pchnl->chnl_mgr_obj) { - chnl_id = pchnl->chnl_id; - chnl_mode = pchnl->chnl_mode; - chnl_mgr_obj = pchnl->chnl_mgr_obj; - } else { - status = -EFAULT; - } - if (status) - goto func_end; + if (!pchnl || !pchnl->chnl_mgr_obj) + return -EFAULT; + + chnl_id = pchnl->chnl_id; + chnl_mode = pchnl->chnl_mode; + chnl_mgr_obj = pchnl->chnl_mgr_obj; /* Mark this channel as cancelled, to prevent further IORequests or * IORequests or dispatching. */ spin_lock_bh(&chnl_mgr_obj->chnl_mgr_lock); + pchnl->dw_state |= CHNL_STATECANCEL; - if (list_empty(&pchnl->pio_requests)) - goto func_cont; + + if (list_empty(&pchnl->pio_requests)) { + spin_unlock_bh(&chnl_mgr_obj->chnl_mgr_lock); + return 0; + } if (pchnl->chnl_type == CHNL_PCPY) { /* Indicate we have no more buffers available for transfer: */ @@ -296,10 +285,10 @@ int bridge_chnl_cancel_io(struct chnl_object *chnl_obj) pchnl->cio_reqs--; DBC_ASSERT(pchnl->cio_reqs >= 0); } -func_cont: + spin_unlock_bh(&chnl_mgr_obj->chnl_mgr_lock); -func_end: - return status; + + return 0; } /* @@ -316,53 +305,43 @@ int bridge_chnl_close(struct chnl_object *chnl_obj) struct chnl_object *pchnl = (struct chnl_object *)chnl_obj; /* Check args: */ - if (!pchnl) { - status = -EFAULT; - goto func_cont; + if (!pchnl) + return -EFAULT; + /* Cancel IO: this ensures no further IO requests or notifications */ + status = bridge_chnl_cancel_io(chnl_obj); + if (status) + return status; + /* Assert I/O on this channel is now cancelled: Protects from io_dpc */ + DBC_ASSERT((pchnl->dw_state & CHNL_STATECANCEL)); + /* Invalidate channel object: Protects from CHNL_GetIOCompletion() */ + /* Free the slot in the channel manager: */ + pchnl->chnl_mgr_obj->ap_channel[pchnl->chnl_id] = NULL; + spin_lock_bh(&pchnl->chnl_mgr_obj->chnl_mgr_lock); + pchnl->chnl_mgr_obj->open_channels -= 1; + spin_unlock_bh(&pchnl->chnl_mgr_obj->chnl_mgr_lock); + if (pchnl->ntfy_obj) { + ntfy_delete(pchnl->ntfy_obj); + kfree(pchnl->ntfy_obj); + pchnl->ntfy_obj = NULL; } - { - /* Cancel IO: this ensures no further IO requests or - * notifications. */ - status = bridge_chnl_cancel_io(chnl_obj); + /* Reset channel event: (NOTE: user_event freed in user context) */ + if (pchnl->sync_event) { + sync_reset_event(pchnl->sync_event); + kfree(pchnl->sync_event); + pchnl->sync_event = NULL; } -func_cont: - if (!status) { - /* Assert I/O on this channel is now cancelled: Protects - * from io_dpc. */ - DBC_ASSERT((pchnl->dw_state & CHNL_STATECANCEL)); - /* Invalidate channel object: Protects from - * CHNL_GetIOCompletion(). */ - /* Free the slot in the channel manager: */ - pchnl->chnl_mgr_obj->ap_channel[pchnl->chnl_id] = NULL; - spin_lock_bh(&pchnl->chnl_mgr_obj->chnl_mgr_lock); - pchnl->chnl_mgr_obj->open_channels -= 1; - spin_unlock_bh(&pchnl->chnl_mgr_obj->chnl_mgr_lock); - if (pchnl->ntfy_obj) { - ntfy_delete(pchnl->ntfy_obj); - kfree(pchnl->ntfy_obj); - pchnl->ntfy_obj = NULL; - } - /* Reset channel event: (NOTE: user_event freed in user - * context.). */ - if (pchnl->sync_event) { - sync_reset_event(pchnl->sync_event); - kfree(pchnl->sync_event); - pchnl->sync_event = NULL; - } - /* Free I/O request and I/O completion queues: */ - free_chirp_list(&pchnl->pio_completions); - pchnl->cio_cs = 0; + /* Free I/O request and I/O completion queues: */ + free_chirp_list(&pchnl->pio_completions); + pchnl->cio_cs = 0; - free_chirp_list(&pchnl->pio_requests); - pchnl->cio_reqs = 0; + free_chirp_list(&pchnl->pio_requests); + pchnl->cio_reqs = 0; - free_chirp_list(&pchnl->free_packets_list); + free_chirp_list(&pchnl->free_packets_list); + + /* Release channel object. */ + kfree(pchnl); - /* Release channel object. */ - kfree(pchnl); - pchnl = NULL; - } - DBC_ENSURE(status || !pchnl); return status; } @@ -697,32 +676,22 @@ func_end: int bridge_chnl_get_mgr_info(struct chnl_mgr *hchnl_mgr, u32 ch_id, struct chnl_mgrinfo *mgr_info) { - int status = 0; struct chnl_mgr *chnl_mgr_obj = (struct chnl_mgr *)hchnl_mgr; - if (mgr_info != NULL) { - if (ch_id <= CHNL_MAXCHANNELS) { - if (hchnl_mgr) { - /* Return the requested information: */ - mgr_info->chnl_obj = - chnl_mgr_obj->ap_channel[ch_id]; - mgr_info->open_channels = - chnl_mgr_obj->open_channels; - mgr_info->dw_type = chnl_mgr_obj->dw_type; - /* total # of chnls */ - mgr_info->max_channels = - chnl_mgr_obj->max_channels; - } else { - status = -EFAULT; - } - } else { - status = -ECHRNG; - } - } else { - status = -EFAULT; - } + if (!mgr_info || !hchnl_mgr) + return -EFAULT; - return status; + if (ch_id > CHNL_MAXCHANNELS) + return -ECHRNG; + + /* Return the requested information: */ + mgr_info->chnl_obj = chnl_mgr_obj->ap_channel[ch_id]; + mgr_info->open_channels = chnl_mgr_obj->open_channels; + mgr_info->dw_type = chnl_mgr_obj->dw_type; + /* total # of chnls */ + mgr_info->max_channels = chnl_mgr_obj->max_channels; + + return 0; } /* @@ -772,45 +741,41 @@ int bridge_chnl_open(struct chnl_object **chnl, DBC_REQUIRE(pattrs != NULL); DBC_REQUIRE(hchnl_mgr != NULL); *chnl = NULL; + /* Validate Args: */ - if (pattrs->uio_reqs == 0) { - status = -EINVAL; + if (!pattrs->uio_reqs) + return -EINVAL; + + if (!hchnl_mgr) + return -EFAULT; + + if (ch_id != CHNL_PICKFREE) { + if (ch_id >= chnl_mgr_obj->max_channels) + return -ECHRNG; + if (chnl_mgr_obj->ap_channel[ch_id] != NULL) + return -EALREADY; } else { - if (!hchnl_mgr) { - status = -EFAULT; - } else { - if (ch_id != CHNL_PICKFREE) { - if (ch_id >= chnl_mgr_obj->max_channels) - status = -ECHRNG; - else if (chnl_mgr_obj->ap_channel[ch_id] != - NULL) - status = -EALREADY; - } else { - /* Check for free channel */ - status = - search_free_channel(chnl_mgr_obj, &ch_id); - } - } + /* Check for free channel */ + status = search_free_channel(chnl_mgr_obj, &ch_id); + if (status) + return status; } - if (status) - goto func_end; DBC_ASSERT(ch_id < chnl_mgr_obj->max_channels); + /* Create channel object: */ pchnl = kzalloc(sizeof(struct chnl_object), GFP_KERNEL); - if (!pchnl) { - status = -ENOMEM; - goto func_end; - } + if (!pchnl) + return -ENOMEM; + /* Protect queues from io_dpc: */ pchnl->dw_state = CHNL_STATECANCEL; + /* Allocate initial IOR and IOC queues: */ status = create_chirp_list(&pchnl->free_packets_list, pattrs->uio_reqs); - if (status) { - kfree(pchnl); - goto func_end; - } + if (status) + goto out_err; INIT_LIST_HEAD(&pchnl->pio_requests); INIT_LIST_HEAD(&pchnl->pio_completions); @@ -818,63 +783,61 @@ int bridge_chnl_open(struct chnl_object **chnl, pchnl->chnl_packets = pattrs->uio_reqs; pchnl->cio_cs = 0; pchnl->cio_reqs = 0; + sync_event = kzalloc(sizeof(struct sync_object), GFP_KERNEL); - if (sync_event) - sync_init_event(sync_event); - else + if (!sync_event) { status = -ENOMEM; - - if (!status) { - pchnl->ntfy_obj = kmalloc(sizeof(struct ntfy_object), - GFP_KERNEL); - if (pchnl->ntfy_obj) - ntfy_init(pchnl->ntfy_obj); - else - status = -ENOMEM; + goto out_err; } + sync_init_event(sync_event); - if (!status) { - /* Initialize CHNL object fields: */ - pchnl->chnl_mgr_obj = chnl_mgr_obj; - pchnl->chnl_id = ch_id; - pchnl->chnl_mode = chnl_mode; - pchnl->user_event = sync_event; - pchnl->sync_event = sync_event; - /* Get the process handle */ - pchnl->process = current->tgid; - pchnl->pcb_arg = 0; - pchnl->bytes_moved = 0; - /* Default to proc-copy */ - pchnl->chnl_type = CHNL_PCPY; - } + pchnl->ntfy_obj = kmalloc(sizeof(struct ntfy_object), GFP_KERNEL); + if (!pchnl->ntfy_obj) { + status = -ENOMEM; + goto out_err; + } + ntfy_init(pchnl->ntfy_obj); + + /* Initialize CHNL object fields: */ + pchnl->chnl_mgr_obj = chnl_mgr_obj; + pchnl->chnl_id = ch_id; + pchnl->chnl_mode = chnl_mode; + pchnl->user_event = sync_event; + pchnl->sync_event = sync_event; + /* Get the process handle */ + pchnl->process = current->tgid; + pchnl->pcb_arg = 0; + pchnl->bytes_moved = 0; + /* Default to proc-copy */ + pchnl->chnl_type = CHNL_PCPY; + + /* Insert channel object in channel manager: */ + chnl_mgr_obj->ap_channel[pchnl->chnl_id] = pchnl; + spin_lock_bh(&chnl_mgr_obj->chnl_mgr_lock); + chnl_mgr_obj->open_channels++; + spin_unlock_bh(&chnl_mgr_obj->chnl_mgr_lock); + /* Return result... */ + pchnl->dw_state = CHNL_STATEREADY; + *chnl = pchnl; - if (status) { - /* Free memory */ - free_chirp_list(&pchnl->pio_completions); - pchnl->cio_cs = 0; - free_chirp_list(&pchnl->pio_requests); - free_chirp_list(&pchnl->free_packets_list); + return status; + +out_err: + /* Free memory */ + free_chirp_list(&pchnl->pio_completions); + free_chirp_list(&pchnl->pio_requests); + free_chirp_list(&pchnl->free_packets_list); + + if (sync_event) kfree(sync_event); - sync_event = NULL; - if (pchnl->ntfy_obj) { - ntfy_delete(pchnl->ntfy_obj); - kfree(pchnl->ntfy_obj); - pchnl->ntfy_obj = NULL; - } - kfree(pchnl); - } else { - /* Insert channel object in channel manager: */ - chnl_mgr_obj->ap_channel[pchnl->chnl_id] = pchnl; - spin_lock_bh(&chnl_mgr_obj->chnl_mgr_lock); - chnl_mgr_obj->open_channels++; - spin_unlock_bh(&chnl_mgr_obj->chnl_mgr_lock); - /* Return result... */ - pchnl->dw_state = CHNL_STATEREADY; - *chnl = pchnl; + if (pchnl->ntfy_obj) { + ntfy_delete(pchnl->ntfy_obj); + kfree(pchnl->ntfy_obj); + pchnl->ntfy_obj = NULL; } -func_end: - DBC_ENSURE((!status && pchnl) || (*chnl == NULL)); + kfree(pchnl); + return status; } diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index 2a48f3d..042a465 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c @@ -1195,29 +1195,29 @@ static void input_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr) input_empty = msg_ctr_obj->buf_empty; num_msgs = msg_ctr_obj->size; if (input_empty) - goto func_end; + return; msg_input = pio_mgr->msg_input; for (i = 0; i < num_msgs; i++) { /* Read the next message */ addr = (u32) &(((struct msg_dspmsg *)msg_input)->msg.dw_cmd); msg.msg.dw_cmd = - read_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr); + read_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr); addr = (u32) &(((struct msg_dspmsg *)msg_input)->msg.dw_arg1); msg.msg.dw_arg1 = - read_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr); + read_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr); addr = (u32) &(((struct msg_dspmsg *)msg_input)->msg.dw_arg2); msg.msg.dw_arg2 = - read_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr); + read_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr); addr = (u32) &(((struct msg_dspmsg *)msg_input)->msgq_id); msg.msgq_id = - read_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr); + read_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr); msg_input += sizeof(struct msg_dspmsg); /* Determine which queue to put the message in */ dev_dbg(bridge, "input msg: dw_cmd=0x%x dw_arg1=0x%x " - "dw_arg2=0x%x msgq_id=0x%x\n", msg.msg.dw_cmd, - msg.msg.dw_arg1, msg.msg.dw_arg2, msg.msgq_id); + "dw_arg2=0x%x msgq_id=0x%x\n", msg.msg.dw_cmd, + msg.msg.dw_arg1, msg.msg.dw_arg2, msg.msgq_id); /* * Interrupt may occur before shared memory and message * input locations have been set up. If all nodes were @@ -1225,48 +1225,43 @@ static void input_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr) */ list_for_each_entry(msg_queue_obj, &hmsg_mgr->queue_list, list_elem) { - if (msg.msgq_id == msg_queue_obj->msgq_id) { - /* Found it */ - if (msg.msg.dw_cmd == RMS_EXITACK) { - /* - * Call the node exit notification. - * The exit message does not get - * queued. - */ - (*hmsg_mgr->on_exit) ((void *) - msg_queue_obj->arg, - msg.msg.dw_arg1); - break; - } + if (msg.msgq_id != msg_queue_obj->msgq_id) + continue; + /* Found it */ + if (msg.msg.dw_cmd == RMS_EXITACK) { /* - * Not an exit acknowledgement, queue - * the message. + * Call the node exit notification. + * The exit message does not get + * queued. */ - if (!list_empty(&msg_queue_obj-> - msg_free_list)) { - pmsg = list_first_entry( - &msg_queue_obj->msg_free_list, - struct msg_frame, list_elem); - list_del(&pmsg->list_elem); - pmsg->msg_data = msg; - list_add_tail(&pmsg->list_elem, - &msg_queue_obj->msg_used_list); - ntfy_notify - (msg_queue_obj->ntfy_obj, - DSP_NODEMESSAGEREADY); - sync_set_event - (msg_queue_obj->sync_event); - } else { - /* - * No free frame to copy the - * message into. - */ - pr_err("%s: no free msg frames," - " discarding msg\n", - __func__); - } + (*hmsg_mgr->on_exit)(msg_queue_obj->arg, + msg.msg.dw_arg1); break; } + /* + * Not an exit acknowledgement, queue + * the message. + */ + if (list_empty(&msg_queue_obj->msg_free_list)) { + /* + * No free frame to copy the + * message into. + */ + pr_err("%s: no free msg frames," + " discarding msg\n", + __func__); + break; + } + + pmsg = list_first_entry(&msg_queue_obj->msg_free_list, + struct msg_frame, list_elem); + list_del(&pmsg->list_elem); + pmsg->msg_data = msg; + list_add_tail(&pmsg->list_elem, + &msg_queue_obj->msg_used_list); + ntfy_notify(msg_queue_obj->ntfy_obj, + DSP_NODEMESSAGEREADY); + sync_set_event(msg_queue_obj->sync_event); } } /* Set the post SWI flag */ @@ -1276,8 +1271,6 @@ static void input_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr) msg_ctr_obj->post_swi = true; sm_interrupt_dsp(pio_mgr->hbridge_context, MBX_PCPY_CLASS); } -func_end: - return; } /* @@ -1408,73 +1401,68 @@ static void output_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr) { u32 num_msgs = 0; u32 i; - u8 *msg_output; + struct msg_dspmsg *msg_output; struct msg_frame *pmsg; struct msg_ctrl *msg_ctr_obj; - u32 output_empty; u32 val; u32 addr; msg_ctr_obj = pio_mgr->msg_output_ctrl; /* Check if output has been cleared */ - output_empty = msg_ctr_obj->buf_empty; - if (output_empty) { - num_msgs = (hmsg_mgr->msgs_pending > hmsg_mgr->max_msgs) ? - hmsg_mgr->max_msgs : hmsg_mgr->msgs_pending; - msg_output = pio_mgr->msg_output; - /* Copy num_msgs messages into shared memory */ - for (i = 0; i < num_msgs; i++) { - if (!list_empty(&hmsg_mgr->msg_used_list)) { - pmsg = list_first_entry( - &hmsg_mgr->msg_used_list, - struct msg_frame, list_elem); - list_del(&pmsg->list_elem); - val = (pmsg->msg_data).msgq_id; - addr = (u32) &(((struct msg_dspmsg *) - msg_output)->msgq_id); - write_ext32_bit_dsp_data( - pio_mgr->hbridge_context, addr, val); - val = (pmsg->msg_data).msg.dw_cmd; - addr = (u32) &((((struct msg_dspmsg *) - msg_output)->msg).dw_cmd); - write_ext32_bit_dsp_data( - pio_mgr->hbridge_context, addr, val); - val = (pmsg->msg_data).msg.dw_arg1; - addr = (u32) &((((struct msg_dspmsg *) - msg_output)->msg).dw_arg1); - write_ext32_bit_dsp_data( - pio_mgr->hbridge_context, addr, val); - val = (pmsg->msg_data).msg.dw_arg2; - addr = (u32) &((((struct msg_dspmsg *) - msg_output)->msg).dw_arg2); - write_ext32_bit_dsp_data( - pio_mgr->hbridge_context, addr, val); - msg_output += sizeof(struct msg_dspmsg); - list_add_tail(&pmsg->list_elem, - &hmsg_mgr->msg_free_list); - sync_set_event(hmsg_mgr->sync_event); - } - } + if (!msg_ctr_obj->buf_empty) + return; + + num_msgs = (hmsg_mgr->msgs_pending > hmsg_mgr->max_msgs) ? + hmsg_mgr->max_msgs : hmsg_mgr->msgs_pending; + msg_output = (struct msg_dspmsg *) pio_mgr->msg_output; + + /* Copy num_msgs messages into shared memory */ + for (i = 0; i < num_msgs; i++) { + if (list_empty(&hmsg_mgr->msg_used_list)) + continue; + + pmsg = list_first_entry(&hmsg_mgr->msg_used_list, + struct msg_frame, list_elem); + list_del(&pmsg->list_elem); + + val = (pmsg->msg_data).msgq_id; + addr = (u32) &msg_output->msgq_id; + write_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr, val); + + val = (pmsg->msg_data).msg.dw_cmd; + addr = (u32) &msg_output->msg.dw_cmd; + write_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr, val); + + val = (pmsg->msg_data).msg.dw_arg1; + addr = (u32) &msg_output->msg.dw_arg1; + write_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr, val); + + val = (pmsg->msg_data).msg.dw_arg2; + addr = (u32) &msg_output->msg.dw_arg2; + write_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr, val); - if (num_msgs > 0) { - hmsg_mgr->msgs_pending -= num_msgs; + msg_output++; + list_add_tail(&pmsg->list_elem, &hmsg_mgr->msg_free_list); + sync_set_event(hmsg_mgr->sync_event); + } + + if (num_msgs > 0) { + hmsg_mgr->msgs_pending -= num_msgs; #if _CHNL_WORDSIZE == 2 - /* - * Access can be different SM access word size - * (e.g. 16/32 bit words) - */ - msg_ctr_obj->size = (u16) num_msgs; + /* + * Access can be different SM access word size + * (e.g. 16/32 bit words) + */ + msg_ctr_obj->size = (u16) num_msgs; #else - msg_ctr_obj->size = num_msgs; + msg_ctr_obj->size = num_msgs; #endif - msg_ctr_obj->buf_empty = false; - /* Set the post SWI flag */ - msg_ctr_obj->post_swi = true; - /* Tell the DSP we have written the output. */ - sm_interrupt_dsp(pio_mgr->hbridge_context, - MBX_PCPY_CLASS); - } + msg_ctr_obj->buf_empty = false; + /* Set the post SWI flag */ + msg_ctr_obj->post_swi = true; + /* Tell the DSP we have written the output. */ + sm_interrupt_dsp(pio_mgr->hbridge_context, MBX_PCPY_CLASS); } } diff --git a/drivers/staging/tidspbridge/core/msg_sm.c b/drivers/staging/tidspbridge/core/msg_sm.c index de2cb83..07103f2 100644 --- a/drivers/staging/tidspbridge/core/msg_sm.c +++ b/drivers/staging/tidspbridge/core/msg_sm.c @@ -55,49 +55,46 @@ int bridge_msg_create(struct msg_mgr **msg_man, struct io_mgr *hio_mgr; int status = 0; - if (!msg_man || !msg_callback || !hdev_obj) { - status = -EFAULT; - goto func_end; - } + if (!msg_man || !msg_callback || !hdev_obj) + return -EFAULT; + dev_get_io_mgr(hdev_obj, &hio_mgr); - if (!hio_mgr) { - status = -EFAULT; - goto func_end; - } + if (!hio_mgr) + return -EFAULT; + *msg_man = NULL; /* Allocate msg_ctrl manager object */ msg_mgr_obj = kzalloc(sizeof(struct msg_mgr), GFP_KERNEL); + if (!msg_mgr_obj) + return -ENOMEM; - if (msg_mgr_obj) { - msg_mgr_obj->on_exit = msg_callback; - msg_mgr_obj->hio_mgr = hio_mgr; - /* List of MSG_QUEUEs */ - INIT_LIST_HEAD(&msg_mgr_obj->queue_list); - /* Queues of message frames for messages to the DSP. Message - * frames will only be added to the free queue when a - * msg_queue object is created. */ - INIT_LIST_HEAD(&msg_mgr_obj->msg_free_list); - INIT_LIST_HEAD(&msg_mgr_obj->msg_used_list); - spin_lock_init(&msg_mgr_obj->msg_mgr_lock); - - /* Create an event to be used by bridge_msg_put() in waiting - * for an available free frame from the message manager. */ - msg_mgr_obj->sync_event = - kzalloc(sizeof(struct sync_object), GFP_KERNEL); - if (!msg_mgr_obj->sync_event) - status = -ENOMEM; - else - sync_init_event(msg_mgr_obj->sync_event); - - if (!status) - *msg_man = msg_mgr_obj; - else - delete_msg_mgr(msg_mgr_obj); - - } else { - status = -ENOMEM; + msg_mgr_obj->on_exit = msg_callback; + msg_mgr_obj->hio_mgr = hio_mgr; + /* List of MSG_QUEUEs */ + INIT_LIST_HEAD(&msg_mgr_obj->queue_list); + /* + * Queues of message frames for messages to the DSP. Message + * frames will only be added to the free queue when a + * msg_queue object is created. + */ + INIT_LIST_HEAD(&msg_mgr_obj->msg_free_list); + INIT_LIST_HEAD(&msg_mgr_obj->msg_used_list); + spin_lock_init(&msg_mgr_obj->msg_mgr_lock); + + /* + * Create an event to be used by bridge_msg_put() in waiting + * for an available free frame from the message manager. + */ + msg_mgr_obj->sync_event = + kzalloc(sizeof(struct sync_object), GFP_KERNEL); + if (!msg_mgr_obj->sync_event) { + kfree(msg_mgr_obj); + return -ENOMEM; } -func_end: + sync_init_event(msg_mgr_obj->sync_event); + + *msg_man = msg_mgr_obj; + return status; } @@ -106,8 +103,7 @@ func_end: * Create a msg_queue for sending/receiving messages to/from a node * on the DSP. */ -int bridge_msg_create_queue(struct msg_mgr *hmsg_mgr, - struct msg_queue **msgq, +int bridge_msg_create_queue(struct msg_mgr *hmsg_mgr, struct msg_queue **msgq, u32 msgq_id, u32 max_msgs, void *arg) { u32 i; @@ -115,18 +111,15 @@ int bridge_msg_create_queue(struct msg_mgr *hmsg_mgr, struct msg_queue *msg_q; int status = 0; - if (!hmsg_mgr || msgq == NULL) { - status = -EFAULT; - goto func_end; - } + if (!hmsg_mgr || msgq == NULL) + return -EFAULT; *msgq = NULL; /* Allocate msg_queue object */ msg_q = kzalloc(sizeof(struct msg_queue), GFP_KERNEL); - if (!msg_q) { - status = -ENOMEM; - goto func_end; - } + if (!msg_q) + return -ENOMEM; + msg_q->max_msgs = max_msgs; msg_q->hmsg_mgr = hmsg_mgr; msg_q->arg = arg; /* Node handle */ @@ -137,78 +130,68 @@ int bridge_msg_create_queue(struct msg_mgr *hmsg_mgr, /* Create event that will be signalled when a message from * the DSP is available. */ - if (!status) { - msg_q->sync_event = kzalloc(sizeof(struct sync_object), - GFP_KERNEL); - if (msg_q->sync_event) - sync_init_event(msg_q->sync_event); - else - status = -ENOMEM; + msg_q->sync_event = kzalloc(sizeof(struct sync_object), GFP_KERNEL); + if (!msg_q->sync_event) { + status = -ENOMEM; + goto out_err; + } + sync_init_event(msg_q->sync_event); /* Create a notification list for message ready notification. */ - if (!status) { - msg_q->ntfy_obj = kmalloc(sizeof(struct ntfy_object), - GFP_KERNEL); - if (msg_q->ntfy_obj) - ntfy_init(msg_q->ntfy_obj); - else - status = -ENOMEM; + msg_q->ntfy_obj = kmalloc(sizeof(struct ntfy_object), GFP_KERNEL); + if (!msg_q->ntfy_obj) { + status = -ENOMEM; + goto out_err; } + ntfy_init(msg_q->ntfy_obj); /* Create events that will be used to synchronize cleanup * when the object is deleted. sync_done will be set to * unblock threads in MSG_Put() or MSG_Get(). sync_done_ack * will be set by the unblocked thread to signal that it * is unblocked and will no longer reference the object. */ - if (!status) { - msg_q->sync_done = kzalloc(sizeof(struct sync_object), - GFP_KERNEL); - if (msg_q->sync_done) - sync_init_event(msg_q->sync_done); - else - status = -ENOMEM; + msg_q->sync_done = kzalloc(sizeof(struct sync_object), GFP_KERNEL); + if (!msg_q->sync_done) { + status = -ENOMEM; + goto out_err; } + sync_init_event(msg_q->sync_done); - if (!status) { - msg_q->sync_done_ack = kzalloc(sizeof(struct sync_object), - GFP_KERNEL); - if (msg_q->sync_done_ack) - sync_init_event(msg_q->sync_done_ack); - else - status = -ENOMEM; + msg_q->sync_done_ack = kzalloc(sizeof(struct sync_object), GFP_KERNEL); + if (!msg_q->sync_done_ack) { + status = -ENOMEM; + goto out_err; } + sync_init_event(msg_q->sync_done_ack); - if (!status) { - /* Enter critical section */ - spin_lock_bh(&hmsg_mgr->msg_mgr_lock); - /* Initialize message frames and put in appropriate queues */ - for (i = 0; i < max_msgs && !status; i++) { - status = add_new_msg(&hmsg_mgr->msg_free_list); - if (!status) { - num_allocated++; - status = add_new_msg(&msg_q->msg_free_list); - } - } - if (status) { - /* Stay inside CS to prevent others from taking any - * of the newly allocated message frames. */ - delete_msg_queue(msg_q, num_allocated); - } else { - list_add_tail(&msg_q->list_elem, - &hmsg_mgr->queue_list); - *msgq = msg_q; - /* Signal that free frames are now available */ - if (!list_empty(&hmsg_mgr->msg_free_list)) - sync_set_event(hmsg_mgr->sync_event); - + /* Enter critical section */ + spin_lock_bh(&hmsg_mgr->msg_mgr_lock); + /* Initialize message frames and put in appropriate queues */ + for (i = 0; i < max_msgs && !status; i++) { + status = add_new_msg(&hmsg_mgr->msg_free_list); + if (!status) { + num_allocated++; + status = add_new_msg(&msg_q->msg_free_list); } - /* Exit critical section */ + } + if (status) { spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); - } else { - delete_msg_queue(msg_q, 0); + goto out_err; } -func_end: + + list_add_tail(&msg_q->list_elem, &hmsg_mgr->queue_list); + *msgq = msg_q; + /* Signal that free frames are now available */ + if (!list_empty(&hmsg_mgr->msg_free_list)) + sync_set_event(hmsg_mgr->sync_event); + + /* Exit critical section */ + spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); + + return 0; +out_err: + delete_msg_queue(msg_q, num_allocated); return status; } @@ -232,7 +215,7 @@ void bridge_msg_delete_queue(struct msg_queue *msg_queue_obj) u32 io_msg_pend; if (!msg_queue_obj || !msg_queue_obj->hmsg_mgr) - goto func_end; + return; hmsg_mgr = msg_queue_obj->hmsg_mgr; msg_queue_obj->done = true; @@ -252,10 +235,7 @@ void bridge_msg_delete_queue(struct msg_queue *msg_queue_obj) delete_msg_queue(msg_queue_obj, msg_queue_obj->max_msgs); if (list_empty(&hmsg_mgr->msg_free_list)) sync_reset_event(hmsg_mgr->sync_event); - spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); -func_end: - return; } /* @@ -267,19 +247,15 @@ int bridge_msg_get(struct msg_queue *msg_queue_obj, { struct msg_frame *msg_frame_obj; struct msg_mgr *hmsg_mgr; - bool got_msg = false; struct sync_object *syncs[2]; u32 index; int status = 0; - if (!msg_queue_obj || pmsg == NULL) { - status = -ENOMEM; - goto func_end; - } + if (!msg_queue_obj || pmsg == NULL) + return -ENOMEM; hmsg_mgr = msg_queue_obj->hmsg_mgr; - /* Enter critical section */ spin_lock_bh(&hmsg_mgr->msg_mgr_lock); /* If a message is already there, get it */ if (!list_empty(&msg_queue_obj->msg_used_list)) { @@ -291,59 +267,54 @@ int bridge_msg_get(struct msg_queue *msg_queue_obj, &msg_queue_obj->msg_free_list); if (list_empty(&msg_queue_obj->msg_used_list)) sync_reset_event(msg_queue_obj->sync_event); + spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); + return 0; + } - got_msg = true; - } else { - if (msg_queue_obj->done) - status = -EPERM; - else - msg_queue_obj->io_msg_pend++; - + if (msg_queue_obj->done) { + spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); + return -EPERM; } - /* Exit critical section */ + msg_queue_obj->io_msg_pend++; spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); - if (!status && !got_msg) { - /* Wait til message is available, timeout, or done. We don't - * have to schedule the DPC, since the DSP will send messages - * when they are available. */ - syncs[0] = msg_queue_obj->sync_event; - syncs[1] = msg_queue_obj->sync_done; - status = sync_wait_on_multiple_events(syncs, 2, utimeout, - &index); - /* Enter critical section */ - spin_lock_bh(&hmsg_mgr->msg_mgr_lock); - if (msg_queue_obj->done) { - msg_queue_obj->io_msg_pend--; - /* Exit critical section */ - spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); - /* Signal that we're not going to access msg_queue_obj - * anymore, so it can be deleted. */ - (void)sync_set_event(msg_queue_obj->sync_done_ack); - status = -EPERM; - } else { - if (!status && !list_empty(&msg_queue_obj-> - msg_used_list)) { - /* Get msg from used list */ - msg_frame_obj = list_first_entry( - &msg_queue_obj->msg_used_list, - struct msg_frame, list_elem); - list_del(&msg_frame_obj->list_elem); - /* Copy message into pmsg and put frame on the - * free list */ - *pmsg = msg_frame_obj->msg_data.msg; - list_add_tail(&msg_frame_obj->list_elem, - &msg_queue_obj->msg_free_list); - } - msg_queue_obj->io_msg_pend--; - /* Reset the event if there are still queued messages */ - if (!list_empty(&msg_queue_obj->msg_used_list)) - sync_set_event(msg_queue_obj->sync_event); - - /* Exit critical section */ - spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); - } + + /* + * Wait til message is available, timeout, or done. We don't + * have to schedule the DPC, since the DSP will send messages + * when they are available. + */ + syncs[0] = msg_queue_obj->sync_event; + syncs[1] = msg_queue_obj->sync_done; + status = sync_wait_on_multiple_events(syncs, 2, utimeout, &index); + + spin_lock_bh(&hmsg_mgr->msg_mgr_lock); + if (msg_queue_obj->done) { + msg_queue_obj->io_msg_pend--; + spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); + /* + * Signal that we're not going to access msg_queue_obj + * anymore, so it can be deleted. + */ + sync_set_event(msg_queue_obj->sync_done_ack); + return -EPERM; } -func_end: + if (!status && !list_empty(&msg_queue_obj->msg_used_list)) { + /* Get msg from used list */ + msg_frame_obj = list_first_entry(&msg_queue_obj->msg_used_list, + struct msg_frame, list_elem); + list_del(&msg_frame_obj->list_elem); + /* Copy message into pmsg and put frame on the free list */ + *pmsg = msg_frame_obj->msg_data.msg; + list_add_tail(&msg_frame_obj->list_elem, + &msg_queue_obj->msg_free_list); + } + msg_queue_obj->io_msg_pend--; + /* Reset the event if there are still queued messages */ + if (!list_empty(&msg_queue_obj->msg_used_list)) + sync_set_event(msg_queue_obj->sync_event); + + spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); + return status; } @@ -356,15 +327,13 @@ int bridge_msg_put(struct msg_queue *msg_queue_obj, { struct msg_frame *msg_frame_obj; struct msg_mgr *hmsg_mgr; - bool put_msg = false; struct sync_object *syncs[2]; u32 index; - int status = 0; + int status; + + if (!msg_queue_obj || !pmsg || !msg_queue_obj->hmsg_mgr) + return -EFAULT; - if (!msg_queue_obj || !pmsg || !msg_queue_obj->hmsg_mgr) { - status = -ENOMEM; - goto func_end; - } hmsg_mgr = msg_queue_obj->hmsg_mgr; spin_lock_bh(&hmsg_mgr->msg_mgr_lock); @@ -380,7 +349,7 @@ int bridge_msg_put(struct msg_queue *msg_queue_obj, list_add_tail(&msg_frame_obj->list_elem, &hmsg_mgr->msg_used_list); hmsg_mgr->msgs_pending++; - put_msg = true; + if (list_empty(&hmsg_mgr->msg_free_list)) sync_reset_event(hmsg_mgr->sync_event); @@ -388,70 +357,70 @@ int bridge_msg_put(struct msg_queue *msg_queue_obj, spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); /* Schedule a DPC, to do the actual data transfer: */ iosm_schedule(hmsg_mgr->hio_mgr); - } else { - if (msg_queue_obj->done) - status = -EPERM; - else - msg_queue_obj->io_msg_pend++; + return 0; + } + if (msg_queue_obj->done) { spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); + return -EPERM; } - if (!status && !put_msg) { - /* Wait til a free message frame is available, timeout, - * or done */ - syncs[0] = hmsg_mgr->sync_event; - syncs[1] = msg_queue_obj->sync_done; - status = sync_wait_on_multiple_events(syncs, 2, utimeout, - &index); - if (status) - goto func_end; - /* Enter critical section */ - spin_lock_bh(&hmsg_mgr->msg_mgr_lock); - if (msg_queue_obj->done) { - msg_queue_obj->io_msg_pend--; - /* Exit critical section */ - spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); - /* Signal that we're not going to access msg_queue_obj - * anymore, so it can be deleted. */ - (void)sync_set_event(msg_queue_obj->sync_done_ack); - status = -EPERM; - } else { - if (list_empty(&hmsg_mgr->msg_free_list)) { - status = -EFAULT; - goto func_cont; - } - /* Get msg from free list */ - msg_frame_obj = list_first_entry( - &hmsg_mgr->msg_free_list, - struct msg_frame, list_elem); - list_del(&msg_frame_obj->list_elem); - /* - * Copy message into pmsg and put frame on the - * used list. - */ - msg_frame_obj->msg_data.msg = *pmsg; - msg_frame_obj->msg_data.msgq_id = - msg_queue_obj->msgq_id; - list_add_tail(&msg_frame_obj->list_elem, - &hmsg_mgr->msg_used_list); - hmsg_mgr->msgs_pending++; - /* - * Schedule a DPC, to do the actual - * data transfer. - */ - iosm_schedule(hmsg_mgr->hio_mgr); - - msg_queue_obj->io_msg_pend--; - /* Reset event if there are still frames available */ - if (!list_empty(&hmsg_mgr->msg_free_list)) - sync_set_event(hmsg_mgr->sync_event); -func_cont: - /* Exit critical section */ - spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); - } + msg_queue_obj->io_msg_pend++; + + spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); + + /* Wait til a free message frame is available, timeout, or done */ + syncs[0] = hmsg_mgr->sync_event; + syncs[1] = msg_queue_obj->sync_done; + status = sync_wait_on_multiple_events(syncs, 2, utimeout, &index); + if (status) + return status; + + /* Enter critical section */ + spin_lock_bh(&hmsg_mgr->msg_mgr_lock); + if (msg_queue_obj->done) { + msg_queue_obj->io_msg_pend--; + /* Exit critical section */ + spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); + /* + * Signal that we're not going to access msg_queue_obj + * anymore, so it can be deleted. + */ + sync_set_event(msg_queue_obj->sync_done_ack); + return -EPERM; } -func_end: - return status; + + if (list_empty(&hmsg_mgr->msg_free_list)) { + spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); + return -EFAULT; + } + + /* Get msg from free list */ + msg_frame_obj = list_first_entry(&hmsg_mgr->msg_free_list, + struct msg_frame, list_elem); + /* + * Copy message into pmsg and put frame on the + * used list. + */ + list_del(&msg_frame_obj->list_elem); + msg_frame_obj->msg_data.msg = *pmsg; + msg_frame_obj->msg_data.msgq_id = msg_queue_obj->msgq_id; + list_add_tail(&msg_frame_obj->list_elem, &hmsg_mgr->msg_used_list); + hmsg_mgr->msgs_pending++; + /* + * Schedule a DPC, to do the actual + * data transfer. + */ + iosm_schedule(hmsg_mgr->hio_mgr); + + msg_queue_obj->io_msg_pend--; + /* Reset event if there are still frames available */ + if (!list_empty(&hmsg_mgr->msg_free_list)) + sync_set_event(hmsg_mgr->sync_event); + + /* Exit critical section */ + spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); + + return 0; } /* @@ -518,16 +487,14 @@ void bridge_msg_set_queue_id(struct msg_queue *msg_queue_obj, u32 msgq_id) static int add_new_msg(struct list_head *msg_list) { struct msg_frame *pmsg; - int status = 0; pmsg = kzalloc(sizeof(struct msg_frame), GFP_ATOMIC); - if (pmsg != NULL) { - list_add_tail(&pmsg->list_elem, msg_list); - } else { - status = -ENOMEM; - } + if (!pmsg) + return -ENOMEM; - return status; + list_add_tail(&pmsg->list_elem, msg_list); + + return 0; } /* @@ -536,17 +503,13 @@ static int add_new_msg(struct list_head *msg_list) static void delete_msg_mgr(struct msg_mgr *hmsg_mgr) { if (!hmsg_mgr) - goto func_end; + return; /* FIXME: free elements from queue_list? */ free_msg_list(&hmsg_mgr->msg_free_list); free_msg_list(&hmsg_mgr->msg_used_list); - kfree(hmsg_mgr->sync_event); - kfree(hmsg_mgr); -func_end: - return; } /* @@ -559,7 +522,7 @@ static void delete_msg_queue(struct msg_queue *msg_queue_obj, u32 num_to_dsp) u32 i; if (!msg_queue_obj || !msg_queue_obj->hmsg_mgr) - goto func_end; + return; hmsg_mgr = msg_queue_obj->hmsg_mgr; @@ -586,9 +549,6 @@ static void delete_msg_queue(struct msg_queue *msg_queue_obj, u32 num_to_dsp) kfree(msg_queue_obj->sync_done_ack); kfree(msg_queue_obj); -func_end: - return; - } /* @@ -599,13 +559,10 @@ static void free_msg_list(struct list_head *msg_list) struct msg_frame *pmsg, *tmp; if (!msg_list) - goto func_end; + return; list_for_each_entry_safe(pmsg, tmp, msg_list, list_elem) { list_del(&pmsg->list_elem); kfree(pmsg); } - -func_end: - return; } -- cgit v0.10.2 From ba44df6f8875c0e56d5923d742face59d81b8dc7 Mon Sep 17 00:00:00 2001 From: Ionut Nicu Date: Sun, 21 Nov 2010 10:46:29 +0000 Subject: staging: tidspbridge: pmgr code cleanup Reorganized some code in the pmgr module to increase its readability. No functional changes were done. Signed-off-by: Ionut Nicu Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/pmgr/cmm.c b/drivers/staging/tidspbridge/pmgr/cmm.c index d7ca2a4..babe66f 100644 --- a/drivers/staging/tidspbridge/pmgr/cmm.c +++ b/drivers/staging/tidspbridge/pmgr/cmm.c @@ -250,26 +250,23 @@ int cmm_create(struct cmm_object **ph_cmm_mgr, *ph_cmm_mgr = NULL; /* create, zero, and tag a cmm mgr object */ cmm_obj = kzalloc(sizeof(struct cmm_object), GFP_KERNEL); - if (cmm_obj != NULL) { - if (mgr_attrts == NULL) - mgr_attrts = &cmm_dfltmgrattrs; /* set defaults */ - - /* 4 bytes minimum */ - DBC_ASSERT(mgr_attrts->ul_min_block_size >= 4); - /* save away smallest block allocation for this cmm mgr */ - cmm_obj->ul_min_block_size = mgr_attrts->ul_min_block_size; - cmm_obj->dw_page_size = PAGE_SIZE; - - /* Note: DSP SM seg table(aDSPSMSegTab[]) zero'd by - * MEM_ALLOC_OBJECT */ - - /* create node free list */ - INIT_LIST_HEAD(&cmm_obj->node_free_list); - mutex_init(&cmm_obj->cmm_lock); - *ph_cmm_mgr = cmm_obj; - } else { - status = -ENOMEM; - } + if (!cmm_obj) + return -ENOMEM; + + if (mgr_attrts == NULL) + mgr_attrts = &cmm_dfltmgrattrs; /* set defaults */ + + /* 4 bytes minimum */ + DBC_ASSERT(mgr_attrts->ul_min_block_size >= 4); + /* save away smallest block allocation for this cmm mgr */ + cmm_obj->ul_min_block_size = mgr_attrts->ul_min_block_size; + cmm_obj->dw_page_size = PAGE_SIZE; + + /* create node free list */ + INIT_LIST_HEAD(&cmm_obj->node_free_list); + mutex_init(&cmm_obj->cmm_lock); + *ph_cmm_mgr = cmm_obj; + return status; } @@ -346,13 +343,12 @@ void cmm_exit(void) * Purpose: * Free the given buffer. */ -int cmm_free_buf(struct cmm_object *hcmm_mgr, void *buf_pa, - u32 ul_seg_id) +int cmm_free_buf(struct cmm_object *hcmm_mgr, void *buf_pa, u32 ul_seg_id) { struct cmm_object *cmm_mgr_obj = (struct cmm_object *)hcmm_mgr; int status = -EFAULT; struct cmm_mnode *curr, *tmp; - struct cmm_allocator *allocator = NULL; + struct cmm_allocator *allocator; struct cmm_attrs *pattrs; DBC_REQUIRE(refs > 0); @@ -366,21 +362,22 @@ int cmm_free_buf(struct cmm_object *hcmm_mgr, void *buf_pa, status = -EFAULT; return status; } - /* get the allocator for this segment id */ + allocator = get_allocator(cmm_mgr_obj, ul_seg_id); - if (allocator != NULL) { - mutex_lock(&cmm_mgr_obj->cmm_lock); - list_for_each_entry_safe(curr, tmp, &allocator->in_use_list, - link) { - if (curr->dw_pa == (u32) buf_pa) { - list_del(&curr->link); - add_to_free_list(allocator, curr); - status = 0; - break; - } + if (!allocator) + return status; + + mutex_lock(&cmm_mgr_obj->cmm_lock); + list_for_each_entry_safe(curr, tmp, &allocator->in_use_list, link) { + if (curr->dw_pa == (u32) buf_pa) { + list_del(&curr->link); + add_to_free_list(allocator, curr); + status = 0; + break; } - mutex_unlock(&cmm_mgr_obj->cmm_lock); } + mutex_unlock(&cmm_mgr_obj->cmm_lock); + return status; } @@ -438,31 +435,30 @@ int cmm_get_info(struct cmm_object *hcmm_mgr, for (ul_seg = 1; ul_seg <= CMM_MAXGPPSEGS; ul_seg++) { /* get the allocator object for this segment id */ altr = get_allocator(cmm_mgr_obj, ul_seg); - if (altr != NULL) { - cmm_info_obj->ul_num_gppsm_segs++; - cmm_info_obj->seg_info[ul_seg - 1].dw_seg_base_pa = - altr->shm_base - altr->ul_dsp_size; - cmm_info_obj->seg_info[ul_seg - 1].ul_total_seg_size = - altr->ul_dsp_size + altr->ul_sm_size; - cmm_info_obj->seg_info[ul_seg - 1].dw_gpp_base_pa = - altr->shm_base; - cmm_info_obj->seg_info[ul_seg - 1].ul_gpp_size = - altr->ul_sm_size; - cmm_info_obj->seg_info[ul_seg - 1].dw_dsp_base_va = - altr->dw_dsp_base; - cmm_info_obj->seg_info[ul_seg - 1].ul_dsp_size = - altr->ul_dsp_size; - cmm_info_obj->seg_info[ul_seg - 1].dw_seg_base_va = - altr->dw_vm_base - altr->ul_dsp_size; - cmm_info_obj->seg_info[ul_seg - 1].ul_in_use_cnt = 0; - /* Count inUse blocks */ - list_for_each_entry(curr, &altr->in_use_list, link) { - cmm_info_obj->ul_total_in_use_cnt++; - cmm_info_obj->seg_info[ul_seg - - 1].ul_in_use_cnt++; - } + if (!altr) + continue; + cmm_info_obj->ul_num_gppsm_segs++; + cmm_info_obj->seg_info[ul_seg - 1].dw_seg_base_pa = + altr->shm_base - altr->ul_dsp_size; + cmm_info_obj->seg_info[ul_seg - 1].ul_total_seg_size = + altr->ul_dsp_size + altr->ul_sm_size; + cmm_info_obj->seg_info[ul_seg - 1].dw_gpp_base_pa = + altr->shm_base; + cmm_info_obj->seg_info[ul_seg - 1].ul_gpp_size = + altr->ul_sm_size; + cmm_info_obj->seg_info[ul_seg - 1].dw_dsp_base_va = + altr->dw_dsp_base; + cmm_info_obj->seg_info[ul_seg - 1].ul_dsp_size = + altr->ul_dsp_size; + cmm_info_obj->seg_info[ul_seg - 1].dw_seg_base_va = + altr->dw_vm_base - altr->ul_dsp_size; + cmm_info_obj->seg_info[ul_seg - 1].ul_in_use_cnt = 0; + + list_for_each_entry(curr, &altr->in_use_list, link) { + cmm_info_obj->ul_total_in_use_cnt++; + cmm_info_obj->seg_info[ul_seg - 1].ul_in_use_cnt++; } - } /* end for */ + } mutex_unlock(&cmm_mgr_obj->cmm_lock); return status; } @@ -508,23 +504,25 @@ int cmm_register_gppsm_seg(struct cmm_object *hcmm_mgr, DBC_REQUIRE(dw_gpp_base_pa != 0); DBC_REQUIRE(gpp_base_va != 0); DBC_REQUIRE((c_factor <= CMM_ADDTODSPPA) && - (c_factor >= CMM_SUBFROMDSPPA)); + (c_factor >= CMM_SUBFROMDSPPA)); + dev_dbg(bridge, "%s: dw_gpp_base_pa %x ul_size %x dsp_addr_offset %x " - "dw_dsp_base %x ul_dsp_size %x gpp_base_va %x\n", __func__, - dw_gpp_base_pa, ul_size, dsp_addr_offset, dw_dsp_base, - ul_dsp_size, gpp_base_va); - if (!hcmm_mgr) { - status = -EFAULT; - return status; - } + "dw_dsp_base %x ul_dsp_size %x gpp_base_va %x\n", + __func__, dw_gpp_base_pa, ul_size, dsp_addr_offset, + dw_dsp_base, ul_dsp_size, gpp_base_va); + + if (!hcmm_mgr) + return -EFAULT; + /* make sure we have room for another allocator */ mutex_lock(&cmm_mgr_obj->cmm_lock); + slot_seg = get_slot(cmm_mgr_obj); if (slot_seg < 0) { - /* get a slot number */ status = -EPERM; goto func_end; } + /* Check if input ul_size is big enough to alloc at least one block */ if (ul_size < cmm_mgr_obj->ul_min_block_size) { status = -EINVAL; @@ -533,37 +531,35 @@ int cmm_register_gppsm_seg(struct cmm_object *hcmm_mgr, /* create, zero, and tag an SM allocator object */ psma = kzalloc(sizeof(struct cmm_allocator), GFP_KERNEL); - if (psma != NULL) { - psma->hcmm_mgr = hcmm_mgr; /* ref to parent */ - psma->shm_base = dw_gpp_base_pa; /* SM Base phys */ - psma->ul_sm_size = ul_size; /* SM segment size in bytes */ - psma->dw_vm_base = gpp_base_va; - psma->dw_dsp_phys_addr_offset = dsp_addr_offset; - psma->c_factor = c_factor; - psma->dw_dsp_base = dw_dsp_base; - psma->ul_dsp_size = ul_dsp_size; - if (psma->dw_vm_base == 0) { - status = -EPERM; - goto func_end; - } - /* return the actual segment identifier */ - *sgmt_id = (u32) slot_seg + 1; - /* create memory free list */ - INIT_LIST_HEAD(&psma->free_list); - - /* create memory in-use list */ - INIT_LIST_HEAD(&psma->in_use_list); - - /* Get a mem node for this hunk-o-memory */ - new_node = get_node(cmm_mgr_obj, dw_gpp_base_pa, - psma->dw_vm_base, ul_size); - /* Place node on the SM allocator's free list */ - if (new_node) { - list_add_tail(&new_node->link, &psma->free_list); - } else { - status = -ENOMEM; - goto func_end; - } + if (!psma) { + status = -ENOMEM; + goto func_end; + } + + psma->hcmm_mgr = hcmm_mgr; /* ref to parent */ + psma->shm_base = dw_gpp_base_pa; /* SM Base phys */ + psma->ul_sm_size = ul_size; /* SM segment size in bytes */ + psma->dw_vm_base = gpp_base_va; + psma->dw_dsp_phys_addr_offset = dsp_addr_offset; + psma->c_factor = c_factor; + psma->dw_dsp_base = dw_dsp_base; + psma->ul_dsp_size = ul_dsp_size; + if (psma->dw_vm_base == 0) { + status = -EPERM; + goto func_end; + } + /* return the actual segment identifier */ + *sgmt_id = (u32) slot_seg + 1; + + INIT_LIST_HEAD(&psma->free_list); + INIT_LIST_HEAD(&psma->in_use_list); + + /* Get a mem node for this hunk-o-memory */ + new_node = get_node(cmm_mgr_obj, dw_gpp_base_pa, + psma->dw_vm_base, ul_size); + /* Place node on the SM allocator's free list */ + if (new_node) { + list_add_tail(&new_node->link, &psma->free_list); } else { status = -ENOMEM; goto func_end; @@ -572,12 +568,11 @@ int cmm_register_gppsm_seg(struct cmm_object *hcmm_mgr, cmm_mgr_obj->pa_gppsm_seg_tab[slot_seg] = psma; func_end: - if (status && psma) { - /* Cleanup allocator */ + /* Cleanup allocator */ + if (status && psma) un_register_gppsm_seg(psma); - } - mutex_unlock(&cmm_mgr_obj->cmm_lock); + return status; } @@ -595,36 +590,36 @@ int cmm_un_register_gppsm_seg(struct cmm_object *hcmm_mgr, u32 ul_id = ul_seg_id; DBC_REQUIRE(ul_seg_id > 0); - if (hcmm_mgr) { - if (ul_seg_id == CMM_ALLSEGMENTS) - ul_id = 1; - - if ((ul_id > 0) && (ul_id <= CMM_MAXGPPSEGS)) { - while (ul_id <= CMM_MAXGPPSEGS) { - mutex_lock(&cmm_mgr_obj->cmm_lock); - /* slot = seg_id-1 */ - psma = cmm_mgr_obj->pa_gppsm_seg_tab[ul_id - 1]; - if (psma != NULL) { - un_register_gppsm_seg(psma); - /* Set alctr ptr to NULL for future - * reuse */ - cmm_mgr_obj->pa_gppsm_seg_tab[ul_id - - 1] = NULL; - } else if (ul_seg_id != CMM_ALLSEGMENTS) { - status = -EPERM; - } - mutex_unlock(&cmm_mgr_obj->cmm_lock); - if (ul_seg_id != CMM_ALLSEGMENTS) - break; - - ul_id++; - } /* end while */ - } else { - status = -EINVAL; + if (!hcmm_mgr) + return -EFAULT; + + if (ul_seg_id == CMM_ALLSEGMENTS) + ul_id = 1; + + if ((ul_id <= 0) || (ul_id > CMM_MAXGPPSEGS)) + return -EINVAL; + + /* + * FIXME: CMM_MAXGPPSEGS == 1. why use a while cycle? Seems to me like + * the ul_seg_id is not needed here. It must be always 1. + */ + while (ul_id <= CMM_MAXGPPSEGS) { + mutex_lock(&cmm_mgr_obj->cmm_lock); + /* slot = seg_id-1 */ + psma = cmm_mgr_obj->pa_gppsm_seg_tab[ul_id - 1]; + if (psma != NULL) { + un_register_gppsm_seg(psma); + /* Set alctr ptr to NULL for future reuse */ + cmm_mgr_obj->pa_gppsm_seg_tab[ul_id - 1] = NULL; + } else if (ul_seg_id != CMM_ALLSEGMENTS) { + status = -EPERM; } - } else { - status = -EFAULT; - } + mutex_unlock(&cmm_mgr_obj->cmm_lock); + if (ul_seg_id != CMM_ALLSEGMENTS) + break; + + ul_id++; + } /* end while */ return status; } @@ -690,26 +685,29 @@ static s32 get_slot(struct cmm_object *cmm_mgr_obj) static struct cmm_mnode *get_node(struct cmm_object *cmm_mgr_obj, u32 dw_pa, u32 dw_va, u32 ul_size) { - struct cmm_mnode *pnode = NULL; + struct cmm_mnode *pnode; DBC_REQUIRE(cmm_mgr_obj != NULL); DBC_REQUIRE(dw_pa != 0); DBC_REQUIRE(dw_va != 0); DBC_REQUIRE(ul_size != 0); + /* Check cmm mgr's node freelist */ if (list_empty(&cmm_mgr_obj->node_free_list)) { pnode = kzalloc(sizeof(struct cmm_mnode), GFP_KERNEL); + if (!pnode) + return NULL; } else { /* surely a valid element */ pnode = list_first_entry(&cmm_mgr_obj->node_free_list, struct cmm_mnode, link); - list_del(&pnode->link); - } - if (pnode) { - pnode->dw_pa = dw_pa; /* Physical addr of start of block */ - pnode->dw_va = dw_va; /* Virtual " " */ - pnode->ul_size = ul_size; /* Size of block */ + list_del_init(&pnode->link); } + + pnode->dw_pa = dw_pa; + pnode->dw_va = dw_va; + pnode->ul_size = ul_size; + return pnode; } @@ -740,11 +738,10 @@ static struct cmm_mnode *get_free_block(struct cmm_allocator *allocator, return NULL; list_for_each_entry_safe(node, tmp, &allocator->free_list, link) { - if (usize <= (u32) node->ul_size) { + if (usize <= node->ul_size) { list_del(&node->link); return node; } - } return NULL; @@ -756,59 +753,36 @@ static struct cmm_mnode *get_free_block(struct cmm_allocator *allocator, * Coalesce node into the freelist in ascending size order. */ static void add_to_free_list(struct cmm_allocator *allocator, - struct cmm_mnode *pnode) + struct cmm_mnode *node) { - struct cmm_mnode *node_prev = NULL; - struct cmm_mnode *node_next = NULL; - struct cmm_mnode *mnode_obj; - u32 dw_this_pa; - u32 dw_next_pa; - - if (!pnode) { - pr_err("%s: failed - pnode is NULL\n", __func__); + struct cmm_mnode *curr; + + if (!node) { + pr_err("%s: failed - node is NULL\n", __func__); return; } - dw_this_pa = pnode->dw_pa; - dw_next_pa = NEXT_PA(pnode); - list_for_each_entry(mnode_obj, &allocator->free_list, link) { - if (dw_this_pa == NEXT_PA(mnode_obj)) { - /* found the block ahead of this one */ - node_prev = mnode_obj; - } else if (dw_next_pa == mnode_obj->dw_pa) { - node_next = mnode_obj; + list_for_each_entry(curr, &allocator->free_list, link) { + if (NEXT_PA(curr) == node->dw_pa) { + curr->ul_size += node->ul_size; + delete_node(allocator->hcmm_mgr, node); + return; + } + if (curr->dw_pa == NEXT_PA(node)) { + curr->dw_pa = node->dw_pa; + curr->dw_va = node->dw_va; + curr->ul_size += node->ul_size; + delete_node(allocator->hcmm_mgr, node); + return; } - if ((node_prev != NULL) && (node_next != NULL)) - break; - } - if (node_prev != NULL) { - /* combine with previous block */ - list_del(&node_prev->link); - /* grow node to hold both */ - pnode->ul_size += node_prev->ul_size; - pnode->dw_pa = node_prev->dw_pa; - pnode->dw_va = node_prev->dw_va; - /* place node on mgr nodeFreeList */ - delete_node(allocator->hcmm_mgr, node_prev); - } - if (node_next != NULL) { - /* combine with next block */ - list_del(&node_next->link); - /* grow da node */ - pnode->ul_size += node_next->ul_size; - /* place node on mgr nodeFreeList */ - delete_node(allocator->hcmm_mgr, node_next); } - /* Now, let's add to freelist in increasing size order */ - list_for_each_entry(mnode_obj, &allocator->free_list, link) { - if (pnode->ul_size <= mnode_obj->ul_size) { - /* insert our node before the current traversed node */ - list_add_tail(&pnode->link, &mnode_obj->link); + list_for_each_entry(curr, &allocator->free_list, link) { + if (curr->ul_size >= node->ul_size) { + list_add_tail(&node->link, &curr->link); return; } } - /* add our pnode to the end of the freelist */ - list_add_tail(&pnode->link, &allocator->free_list); + list_add_tail(&node->link, &allocator->free_list); } /* @@ -820,19 +794,10 @@ static void add_to_free_list(struct cmm_allocator *allocator, static struct cmm_allocator *get_allocator(struct cmm_object *cmm_mgr_obj, u32 ul_seg_id) { - struct cmm_allocator *allocator = NULL; - DBC_REQUIRE(cmm_mgr_obj != NULL); DBC_REQUIRE((ul_seg_id > 0) && (ul_seg_id <= CMM_MAXGPPSEGS)); - allocator = cmm_mgr_obj->pa_gppsm_seg_tab[ul_seg_id - 1]; - if (allocator != NULL) { - /* make sure it's for real */ - if (!allocator) { - allocator = NULL; - DBC_ASSERT(false); - } - } - return allocator; + + return cmm_mgr_obj->pa_gppsm_seg_tab[ul_seg_id - 1]; } /* diff --git a/drivers/staging/tidspbridge/pmgr/dev.c b/drivers/staging/tidspbridge/pmgr/dev.c index 6ce3493..b160b00 100644 --- a/drivers/staging/tidspbridge/pmgr/dev.c +++ b/drivers/staging/tidspbridge/pmgr/dev.c @@ -78,8 +78,8 @@ struct dev_object { struct ldr_module *module_obj; /* Bridge Module handle. */ u32 word_size; /* DSP word size: quick access. */ struct drv_object *hdrv_obj; /* Driver Object */ - struct list_head proc_list; /* List of Processor attached to - * this device */ + /* List of Processors attached to this device */ + struct list_head proc_list; struct node_mgr *hnode_mgr; }; @@ -787,9 +787,8 @@ bool dev_init(void) * Purpose: * Notify all clients of this device of a change in device status. */ -int dev_notify_clients(struct dev_object *hdev_obj, u32 ret) +int dev_notify_clients(struct dev_object *dev_obj, u32 ret) { - struct dev_object *dev_obj = hdev_obj; struct list_head *curr; /* @@ -797,7 +796,7 @@ int dev_notify_clients(struct dev_object *hdev_obj, u32 ret) * at the begining. If not, this can go horribly wrong. */ list_for_each(curr, &dev_obj->proc_list) - proc_notify_clients((void *)curr, (u32) ret); + proc_notify_clients((void *)curr, ret); return 0; } @@ -981,7 +980,6 @@ static int init_cod_mgr(struct dev_object *dev_obj) int dev_insert_proc_object(struct dev_object *hdev_obj, u32 proc_obj, bool *already_attached) { - int status = 0; struct dev_object *dev_obj = (struct dev_object *)hdev_obj; DBC_REQUIRE(refs > 0); @@ -998,9 +996,7 @@ int dev_insert_proc_object(struct dev_object *hdev_obj, */ list_add_tail((struct list_head *)proc_obj, &dev_obj->proc_list); - DBC_ENSURE(!status && !list_empty(&dev_obj->proc_list)); - - return status; + return 0; } /* @@ -1043,14 +1039,10 @@ int dev_remove_proc_object(struct dev_object *hdev_obj, u32 proc_obj) return status; } -int dev_get_dev_type(struct dev_object *device_obj, u8 *dev_type) +int dev_get_dev_type(struct dev_object *dev_obj, u8 *dev_type) { - int status = 0; - struct dev_object *dev_obj = (struct dev_object *)device_obj; - *dev_type = dev_obj->dev_type; - - return status; + return 0; } /* -- cgit v0.10.2 From a994b051b6cb246bb8843b3fbb7dea4185a01399 Mon Sep 17 00:00:00 2001 From: Omar Ramirez Luna Date: Wed, 8 Dec 2010 22:20:23 +0000 Subject: staging: tidspbridge: use the right type for list_is_last Removes the following warning: CC [M] drivers/staging/tidspbridge/rmgr/rmm.o drivers/staging/tidspbridge/rmgr/rmm.c: In function 'rmm_alloc': drivers/staging/tidspbridge/rmgr/rmm.c:147: warning: passing argument 1 of 'list_is_last' from incompatible pointer type include/linux/list.h:170: note: expected 'const struct list_head *' but argument is of type 'struct rmm_ovly_sect *' Signed-off-by: Omar Ramirez Luna Acked-by: Laurent Pinchart Acked-by: Ionut Nicu diff --git a/drivers/staging/tidspbridge/rmgr/rmm.c b/drivers/staging/tidspbridge/rmgr/rmm.c index aae8657..5a3f09c 100644 --- a/drivers/staging/tidspbridge/rmgr/rmm.c +++ b/drivers/staging/tidspbridge/rmgr/rmm.c @@ -144,7 +144,7 @@ int rmm_alloc(struct rmm_target_obj *target, u32 segid, u32 size, new_sect->addr = addr; new_sect->size = size; new_sect->page = segid; - if (list_is_last(sect, &target->ovly_list)) + if (list_is_last(§->list_elem, &target->ovly_list)) /* Put new section at the end of the list */ list_add_tail(&new_sect->list_elem, &target->ovly_list); -- cgit v0.10.2 From 57104f0fbe5bb35694eb470530850a71ef2f8063 Mon Sep 17 00:00:00 2001 From: Ionut Nicu Date: Thu, 9 Dec 2010 21:47:37 +0000 Subject: staging: tidspbridge: rmgr/node.c code cleanup Reorganized some code in rmgr/node.c to increase its readability. Most of the changes reduce the code indentation level and simplifiy the code. No functional changes were done. Signed-off-by: Ionut Nicu Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c index 62d5c31..b196a7a 100644 --- a/drivers/staging/tidspbridge/rmgr/node.c +++ b/drivers/staging/tidspbridge/rmgr/node.c @@ -236,9 +236,9 @@ struct node_object { /* Default buffer attributes */ static struct dsp_bufferattr node_dfltbufattrs = { - 0, /* cb_struct */ - 1, /* segment_id */ - 0, /* buf_alignment */ + .cb_struct = 0, + .segment_id = 1, + .buf_alignment = 0, }; static void delete_node(struct node_object *hnode, @@ -284,8 +284,7 @@ enum node_state node_get_state(void *hnode) struct node_object *pnode = (struct node_object *)hnode; if (!pnode) return -1; - else - return pnode->node_state; + return pnode->node_state; } /* @@ -844,6 +843,7 @@ int node_connect(struct node_object *node1, u32 stream1, char *pstr_dev_name = NULL; enum node_type node1_type = NODE_TASK; enum node_type node2_type = NODE_TASK; + enum dsp_strmmode strm_mode; struct node_strmdef *pstrm_def; struct node_strmdef *input = NULL; struct node_strmdef *output = NULL; @@ -857,60 +857,49 @@ int node_connect(struct node_object *node1, u32 stream1, int status = 0; DBC_REQUIRE(refs > 0); - if ((node1 != (struct node_object *)DSP_HGPPNODE && !node1) || - (node2 != (struct node_object *)DSP_HGPPNODE && !node2)) - status = -EFAULT; + if (!node1 || !node2) + return -EFAULT; - if (!status) { - /* The two nodes must be on the same processor */ - if (node1 != (struct node_object *)DSP_HGPPNODE && - node2 != (struct node_object *)DSP_HGPPNODE && - node1->hnode_mgr != node2->hnode_mgr) - status = -EPERM; - /* Cannot connect a node to itself */ - if (node1 == node2) - status = -EPERM; + /* The two nodes must be on the same processor */ + if (node1 != (struct node_object *)DSP_HGPPNODE && + node2 != (struct node_object *)DSP_HGPPNODE && + node1->hnode_mgr != node2->hnode_mgr) + return -EPERM; - } - if (!status) { - /* node_get_type() will return NODE_GPP if hnode = - * DSP_HGPPNODE. */ - node1_type = node_get_type(node1); - node2_type = node_get_type(node2); - /* Check stream indices ranges */ - if ((node1_type != NODE_GPP && node1_type != NODE_DEVICE && - stream1 >= MAX_OUTPUTS(node1)) || (node2_type != NODE_GPP - && node2_type != - NODE_DEVICE - && stream2 >= - MAX_INPUTS(node2))) - status = -EINVAL; - } - if (!status) { - /* - * Only the following types of connections are allowed: - * task/dais socket < == > task/dais socket - * task/dais socket < == > device - * task/dais socket < == > GPP - * - * ie, no message nodes, and at least one task or dais - * socket node. - */ - if (node1_type == NODE_MESSAGE || node2_type == NODE_MESSAGE || - (node1_type != NODE_TASK && node1_type != NODE_DAISSOCKET && - node2_type != NODE_TASK && node2_type != NODE_DAISSOCKET)) - status = -EPERM; - } + /* Cannot connect a node to itself */ + if (node1 == node2) + return -EPERM; + + /* node_get_type() will return NODE_GPP if hnode = DSP_HGPPNODE. */ + node1_type = node_get_type(node1); + node2_type = node_get_type(node2); + /* Check stream indices ranges */ + if ((node1_type != NODE_GPP && node1_type != NODE_DEVICE && + stream1 >= MAX_OUTPUTS(node1)) || + (node2_type != NODE_GPP && node2_type != NODE_DEVICE && + stream2 >= MAX_INPUTS(node2))) + return -EINVAL; + + /* + * Only the following types of connections are allowed: + * task/dais socket < == > task/dais socket + * task/dais socket < == > device + * task/dais socket < == > GPP + * + * ie, no message nodes, and at least one task or dais + * socket node. + */ + if (node1_type == NODE_MESSAGE || node2_type == NODE_MESSAGE || + (node1_type != NODE_TASK && + node1_type != NODE_DAISSOCKET && + node2_type != NODE_TASK && + node2_type != NODE_DAISSOCKET)) + return -EPERM; /* * Check stream mode. Default is STRMMODE_PROCCOPY. */ - if (!status && pattrs) { - if (pattrs->strm_mode != STRMMODE_PROCCOPY) - status = -EPERM; /* illegal stream mode */ - - } - if (status) - goto func_end; + if (pattrs && pattrs->strm_mode != STRMMODE_PROCCOPY) + return -EPERM; /* illegal stream mode */ if (node1_type != NODE_GPP) { hnode_mgr = node1->hnode_mgr; @@ -918,170 +907,145 @@ int node_connect(struct node_object *node1, u32 stream1, DBC_ASSERT(node2 != (struct node_object *)DSP_HGPPNODE); hnode_mgr = node2->hnode_mgr; } + /* Enter critical section */ mutex_lock(&hnode_mgr->node_mgr_lock); /* Nodes must be in the allocated state */ - if (node1_type != NODE_GPP && node_get_state(node1) != NODE_ALLOCATED) + if (node1_type != NODE_GPP && + node_get_state(node1) != NODE_ALLOCATED) { status = -EBADR; + goto out_unlock; + } - if (node2_type != NODE_GPP && node_get_state(node2) != NODE_ALLOCATED) + if (node2_type != NODE_GPP && + node_get_state(node2) != NODE_ALLOCATED) { status = -EBADR; + goto out_unlock; + } - if (!status) { - /* Check that stream indices for task and dais socket nodes - * are not already be used. (Device nodes checked later) */ - if (node1_type == NODE_TASK || node1_type == NODE_DAISSOCKET) { - output = - &(node1->create_args.asa. - task_arg_obj.strm_out_def[stream1]); - if (output->sz_device != NULL) - status = -EISCONN; - + /* + * Check that stream indices for task and dais socket nodes + * are not already be used. (Device nodes checked later) + */ + if (node1_type == NODE_TASK || node1_type == NODE_DAISSOCKET) { + output = &(node1->create_args.asa. + task_arg_obj.strm_out_def[stream1]); + if (output->sz_device) { + status = -EISCONN; + goto out_unlock; } - if (node2_type == NODE_TASK || node2_type == NODE_DAISSOCKET) { - input = - &(node2->create_args.asa. - task_arg_obj.strm_in_def[stream2]); - if (input->sz_device != NULL) - status = -EISCONN; + } + if (node2_type == NODE_TASK || node2_type == NODE_DAISSOCKET) { + input = &(node2->create_args.asa. + task_arg_obj.strm_in_def[stream2]); + if (input->sz_device) { + status = -EISCONN; + goto out_unlock; } + } /* Connecting two task nodes? */ - if (!status && ((node1_type == NODE_TASK || - node1_type == NODE_DAISSOCKET) - && (node2_type == NODE_TASK - || node2_type == NODE_DAISSOCKET))) { + if ((node1_type == NODE_TASK || node1_type == NODE_DAISSOCKET) && + (node2_type == NODE_TASK || + node2_type == NODE_DAISSOCKET)) { /* Find available pipe */ pipe_id = find_first_zero_bit(hnode_mgr->pipe_map, MAXPIPES); if (pipe_id == MAXPIPES) { status = -ECONNREFUSED; - } else { - set_bit(pipe_id, hnode_mgr->pipe_map); - node1->outputs[stream1].type = NODECONNECT; - node2->inputs[stream2].type = NODECONNECT; - node1->outputs[stream1].dev_id = pipe_id; - node2->inputs[stream2].dev_id = pipe_id; - output->sz_device = kzalloc(PIPENAMELEN + 1, - GFP_KERNEL); - input->sz_device = kzalloc(PIPENAMELEN + 1, GFP_KERNEL); - if (output->sz_device == NULL || - input->sz_device == NULL) { - /* Undo the connection */ - kfree(output->sz_device); - - kfree(input->sz_device); - - output->sz_device = NULL; - input->sz_device = NULL; - clear_bit(pipe_id, hnode_mgr->pipe_map); - status = -ENOMEM; - } else { - /* Copy "/dbpipe" name to device names */ - sprintf(output->sz_device, "%s%d", - PIPEPREFIX, pipe_id); - strcpy(input->sz_device, output->sz_device); - } + goto out_unlock; } + set_bit(pipe_id, hnode_mgr->pipe_map); + node1->outputs[stream1].type = NODECONNECT; + node2->inputs[stream2].type = NODECONNECT; + node1->outputs[stream1].dev_id = pipe_id; + node2->inputs[stream2].dev_id = pipe_id; + output->sz_device = kzalloc(PIPENAMELEN + 1, GFP_KERNEL); + input->sz_device = kzalloc(PIPENAMELEN + 1, GFP_KERNEL); + if (!output->sz_device || !input->sz_device) { + /* Undo the connection */ + kfree(output->sz_device); + kfree(input->sz_device); + clear_bit(pipe_id, hnode_mgr->pipe_map); + status = -ENOMEM; + goto out_unlock; + } + /* Copy "/dbpipe" name to device names */ + sprintf(output->sz_device, "%s%d", PIPEPREFIX, pipe_id); + strcpy(input->sz_device, output->sz_device); } /* Connecting task node to host? */ - if (!status && (node1_type == NODE_GPP || - node2_type == NODE_GPP)) { - if (node1_type == NODE_GPP) { - chnl_mode = CHNL_MODETODSP; - } else { - DBC_ASSERT(node2_type == NODE_GPP); - chnl_mode = CHNL_MODEFROMDSP; + if (node1_type == NODE_GPP || node2_type == NODE_GPP) { + pstr_dev_name = kzalloc(HOSTNAMELEN + 1, GFP_KERNEL); + if (!pstr_dev_name) { + status = -ENOMEM; + goto out_unlock; } - /* Reserve a channel id. We need to put the name "/host" + + DBC_ASSERT((node1_type == NODE_GPP) || + (node2_type == NODE_GPP)); + + chnl_mode = (node1_type == NODE_GPP) ? + CHNL_MODETODSP : CHNL_MODEFROMDSP; + + /* + * Reserve a channel id. We need to put the name "/host" * in the node's create_args, but the host * side channel will not be opened until DSPStream_Open is - * called for this node. */ - if (pattrs) { - if (pattrs->strm_mode == STRMMODE_RDMA) { - chnl_id = find_first_zero_bit( - hnode_mgr->dma_chnl_map, - CHNL_MAXCHANNELS); + * called for this node. + */ + strm_mode = pattrs ? pattrs->strm_mode : STRMMODE_PROCCOPY; + switch (strm_mode) { + case STRMMODE_RDMA: + chnl_id = find_first_zero_bit(hnode_mgr->dma_chnl_map, + CHNL_MAXCHANNELS); + if (chnl_id < CHNL_MAXCHANNELS) { + set_bit(chnl_id, hnode_mgr->dma_chnl_map); /* dma chans are 2nd transport chnl set * ids(e.g. 16-31) */ - if (chnl_id != CHNL_MAXCHANNELS) { - set_bit(chnl_id, - hnode_mgr->dma_chnl_map); - chnl_id = chnl_id + - hnode_mgr->ul_num_chnls; - } - } else if (pattrs->strm_mode == STRMMODE_ZEROCOPY) { - chnl_id = find_first_zero_bit( - hnode_mgr->zc_chnl_map, - CHNL_MAXCHANNELS); + chnl_id = chnl_id + hnode_mgr->ul_num_chnls; + } + break; + case STRMMODE_ZEROCOPY: + chnl_id = find_first_zero_bit(hnode_mgr->zc_chnl_map, + CHNL_MAXCHANNELS); + if (chnl_id < CHNL_MAXCHANNELS) { + set_bit(chnl_id, hnode_mgr->zc_chnl_map); /* zero-copy chans are 3nd transport set * (e.g. 32-47) */ - if (chnl_id != CHNL_MAXCHANNELS) { - set_bit(chnl_id, - hnode_mgr->zc_chnl_map); - chnl_id = chnl_id + - (2 * hnode_mgr->ul_num_chnls); - } - } else { /* must be PROCCOPY */ - DBC_ASSERT(pattrs->strm_mode == - STRMMODE_PROCCOPY); - chnl_id = find_first_zero_bit( - hnode_mgr->chnl_map, - CHNL_MAXCHANNELS); - /* e.g. 0-15 */ - if (chnl_id != CHNL_MAXCHANNELS) - set_bit(chnl_id, hnode_mgr->chnl_map); + chnl_id = chnl_id + + (2 * hnode_mgr->ul_num_chnls); } - } else { - /* default to PROCCOPY */ + break; + case STRMMODE_PROCCOPY: chnl_id = find_first_zero_bit(hnode_mgr->chnl_map, CHNL_MAXCHANNELS); - if (chnl_id != CHNL_MAXCHANNELS) + if (chnl_id < CHNL_MAXCHANNELS) set_bit(chnl_id, hnode_mgr->chnl_map); + break; + default: + status = -EINVAL; + goto out_unlock; } if (chnl_id == CHNL_MAXCHANNELS) { status = -ECONNREFUSED; - goto func_cont2; + goto out_unlock; } - pstr_dev_name = kzalloc(HOSTNAMELEN + 1, GFP_KERNEL); - if (pstr_dev_name != NULL) - goto func_cont2; - - if (pattrs) { - if (pattrs->strm_mode == STRMMODE_RDMA) { - clear_bit(chnl_id - hnode_mgr->ul_num_chnls, - hnode_mgr->dma_chnl_map); - } else if (pattrs->strm_mode == STRMMODE_ZEROCOPY) { - clear_bit(chnl_id - - (2 * hnode_mgr->ul_num_chnls), - hnode_mgr->zc_chnl_map); - } else { - DBC_ASSERT(pattrs->strm_mode == - STRMMODE_PROCCOPY); - clear_bit(chnl_id, hnode_mgr->chnl_map); - } + + if (node1 == (struct node_object *)DSP_HGPPNODE) { + node2->inputs[stream2].type = HOSTCONNECT; + node2->inputs[stream2].dev_id = chnl_id; + input->sz_device = pstr_dev_name; } else { - clear_bit(chnl_id, hnode_mgr->chnl_map); - } - status = -ENOMEM; -func_cont2: - if (!status) { - if (node1 == (struct node_object *)DSP_HGPPNODE) { - node2->inputs[stream2].type = HOSTCONNECT; - node2->inputs[stream2].dev_id = chnl_id; - input->sz_device = pstr_dev_name; - } else { - node1->outputs[stream1].type = HOSTCONNECT; - node1->outputs[stream1].dev_id = chnl_id; - output->sz_device = pstr_dev_name; - } - sprintf(pstr_dev_name, "%s%d", HOSTPREFIX, chnl_id); + node1->outputs[stream1].type = HOSTCONNECT; + node1->outputs[stream1].dev_id = chnl_id; + output->sz_device = pstr_dev_name; } + sprintf(pstr_dev_name, "%s%d", HOSTPREFIX, chnl_id); } /* Connecting task node to device node? */ - if (!status && ((node1_type == NODE_DEVICE) || - (node2_type == NODE_DEVICE))) { + if ((node1_type == NODE_DEVICE) || (node2_type == NODE_DEVICE)) { if (node2_type == NODE_DEVICE) { /* node1 == > device */ dev_node_obj = node2; @@ -1098,60 +1062,58 @@ func_cont2: /* Set up create args */ pstream->type = DEVICECONNECT; dw_length = strlen(dev_node_obj->pstr_dev_name); - if (conn_param != NULL) { + if (conn_param) pstrm_def->sz_device = kzalloc(dw_length + 1 + - conn_param->cb_data, - GFP_KERNEL); - } else { + conn_param->cb_data, + GFP_KERNEL); + else pstrm_def->sz_device = kzalloc(dw_length + 1, - GFP_KERNEL); - } - if (pstrm_def->sz_device == NULL) { + GFP_KERNEL); + if (!pstrm_def->sz_device) { status = -ENOMEM; - } else { - /* Copy device name */ - strncpy(pstrm_def->sz_device, + goto out_unlock; + } + /* Copy device name */ + strncpy(pstrm_def->sz_device, dev_node_obj->pstr_dev_name, dw_length); - if (conn_param != NULL) { - strncat(pstrm_def->sz_device, + if (conn_param) + strncat(pstrm_def->sz_device, (char *)conn_param->node_data, (u32) conn_param->cb_data); - } - dev_node_obj->device_owner = hnode; - } + dev_node_obj->device_owner = hnode; } - if (!status) { - /* Fill in create args */ - if (node1_type == NODE_TASK || node1_type == NODE_DAISSOCKET) { - node1->create_args.asa.task_arg_obj.num_outputs++; - fill_stream_def(node1, output, pattrs); - } - if (node2_type == NODE_TASK || node2_type == NODE_DAISSOCKET) { - node2->create_args.asa.task_arg_obj.num_inputs++; - fill_stream_def(node2, input, pattrs); - } - /* Update node1 and node2 stream_connect */ - if (node1_type != NODE_GPP && node1_type != NODE_DEVICE) { - node1->num_outputs++; - if (stream1 > node1->max_output_index) - node1->max_output_index = stream1; + /* Fill in create args */ + if (node1_type == NODE_TASK || node1_type == NODE_DAISSOCKET) { + node1->create_args.asa.task_arg_obj.num_outputs++; + fill_stream_def(node1, output, pattrs); + } + if (node2_type == NODE_TASK || node2_type == NODE_DAISSOCKET) { + node2->create_args.asa.task_arg_obj.num_inputs++; + fill_stream_def(node2, input, pattrs); + } + /* Update node1 and node2 stream_connect */ + if (node1_type != NODE_GPP && node1_type != NODE_DEVICE) { + node1->num_outputs++; + if (stream1 > node1->max_output_index) + node1->max_output_index = stream1; - } - if (node2_type != NODE_GPP && node2_type != NODE_DEVICE) { - node2->num_inputs++; - if (stream2 > node2->max_input_index) - node2->max_input_index = stream2; + } + if (node2_type != NODE_GPP && node2_type != NODE_DEVICE) { + node2->num_inputs++; + if (stream2 > node2->max_input_index) + node2->max_input_index = stream2; - } - fill_stream_connect(node1, node2, stream1, stream2); } + fill_stream_connect(node1, node2, stream1, stream2); /* end of sync_enter_cs */ /* Exit critical section */ +out_unlock: + if (status && pstr_dev_name) + kfree(pstr_dev_name); mutex_unlock(&hnode_mgr->node_mgr_lock); -func_end: dev_dbg(bridge, "%s: node1: %p stream1: %d node2: %p stream2: %d" - "pattrs: %p status: 0x%x\n", __func__, node1, - stream1, node2, stream2, pattrs, status); + "pattrs: %p status: 0x%x\n", __func__, node1, + stream1, node2, stream2, pattrs, status); return status; } @@ -1329,6 +1291,7 @@ int node_create_mgr(struct node_mgr **node_man, struct nldr_attrs nldr_attrs_obj; int status = 0; u8 dev_type; + DBC_REQUIRE(refs > 0); DBC_REQUIRE(node_man != NULL); DBC_REQUIRE(hdev_obj != NULL); @@ -1336,90 +1299,89 @@ int node_create_mgr(struct node_mgr **node_man, *node_man = NULL; /* Allocate Node manager object */ node_mgr_obj = kzalloc(sizeof(struct node_mgr), GFP_KERNEL); - if (node_mgr_obj) { - node_mgr_obj->hdev_obj = hdev_obj; - INIT_LIST_HEAD(&node_mgr_obj->node_list); - node_mgr_obj->ntfy_obj = kmalloc( - sizeof(struct ntfy_object), GFP_KERNEL); - if (node_mgr_obj->ntfy_obj) - ntfy_init(node_mgr_obj->ntfy_obj); - else - status = -ENOMEM; - node_mgr_obj->num_created = 0; - } else { + if (!node_mgr_obj) + return -ENOMEM; + + node_mgr_obj->hdev_obj = hdev_obj; + + node_mgr_obj->ntfy_obj = kmalloc(sizeof(struct ntfy_object), + GFP_KERNEL); + if (!node_mgr_obj->ntfy_obj) { status = -ENOMEM; + goto out_err; } - /* get devNodeType */ - if (!status) - status = dev_get_dev_type(hdev_obj, &dev_type); + ntfy_init(node_mgr_obj->ntfy_obj); - /* Create the DCD Manager */ - if (!status) { - status = - dcd_create_manager(sz_zl_file, &node_mgr_obj->hdcd_mgr); - if (!status) - status = get_proc_props(node_mgr_obj, hdev_obj); + INIT_LIST_HEAD(&node_mgr_obj->node_list); + + dev_get_dev_type(hdev_obj, &dev_type); + + status = dcd_create_manager(sz_zl_file, &node_mgr_obj->hdcd_mgr); + if (status) + goto out_err; + + status = get_proc_props(node_mgr_obj, hdev_obj); + if (status) + goto out_err; - } /* Create NODE Dispatcher */ - if (!status) { - disp_attr_obj.ul_chnl_offset = node_mgr_obj->ul_chnl_offset; - disp_attr_obj.ul_chnl_buf_size = node_mgr_obj->ul_chnl_buf_size; - disp_attr_obj.proc_family = node_mgr_obj->proc_family; - disp_attr_obj.proc_type = node_mgr_obj->proc_type; - status = - disp_create(&node_mgr_obj->disp_obj, hdev_obj, - &disp_attr_obj); - } + disp_attr_obj.ul_chnl_offset = node_mgr_obj->ul_chnl_offset; + disp_attr_obj.ul_chnl_buf_size = node_mgr_obj->ul_chnl_buf_size; + disp_attr_obj.proc_family = node_mgr_obj->proc_family; + disp_attr_obj.proc_type = node_mgr_obj->proc_type; + + status = disp_create(&node_mgr_obj->disp_obj, hdev_obj, &disp_attr_obj); + if (status) + goto out_err; + /* Create a STRM Manager */ - if (!status) - status = strm_create(&node_mgr_obj->strm_mgr_obj, hdev_obj); + status = strm_create(&node_mgr_obj->strm_mgr_obj, hdev_obj); + if (status) + goto out_err; - if (!status) { - dev_get_intf_fxns(hdev_obj, &node_mgr_obj->intf_fxns); - /* Get msg_ctrl queue manager */ - dev_get_msg_mgr(hdev_obj, &node_mgr_obj->msg_mgr_obj); - mutex_init(&node_mgr_obj->node_mgr_lock); - /* Block out reserved channels */ - for (i = 0; i < node_mgr_obj->ul_chnl_offset; i++) - set_bit(i, node_mgr_obj->chnl_map); - - /* Block out channels reserved for RMS */ - set_bit(node_mgr_obj->ul_chnl_offset, node_mgr_obj->chnl_map); - set_bit(node_mgr_obj->ul_chnl_offset + 1, - node_mgr_obj->chnl_map); - } - if (!status) { - /* NO RM Server on the IVA */ - if (dev_type != IVA_UNIT) { - /* Get addresses of any RMS functions loaded */ - status = get_rms_fxns(node_mgr_obj); - } + dev_get_intf_fxns(hdev_obj, &node_mgr_obj->intf_fxns); + /* Get msg_ctrl queue manager */ + dev_get_msg_mgr(hdev_obj, &node_mgr_obj->msg_mgr_obj); + mutex_init(&node_mgr_obj->node_mgr_lock); + + /* Block out reserved channels */ + for (i = 0; i < node_mgr_obj->ul_chnl_offset; i++) + set_bit(i, node_mgr_obj->chnl_map); + + /* Block out channels reserved for RMS */ + set_bit(node_mgr_obj->ul_chnl_offset, node_mgr_obj->chnl_map); + set_bit(node_mgr_obj->ul_chnl_offset + 1, node_mgr_obj->chnl_map); + + /* NO RM Server on the IVA */ + if (dev_type != IVA_UNIT) { + /* Get addresses of any RMS functions loaded */ + status = get_rms_fxns(node_mgr_obj); + if (status) + goto out_err; } /* Get loader functions and create loader */ - if (!status) - node_mgr_obj->nldr_fxns = nldr_fxns; /* Dyn loader funcs */ + node_mgr_obj->nldr_fxns = nldr_fxns; /* Dyn loader funcs */ + + nldr_attrs_obj.pfn_ovly = ovly; + nldr_attrs_obj.pfn_write = mem_write; + nldr_attrs_obj.us_dsp_word_size = node_mgr_obj->udsp_word_size; + nldr_attrs_obj.us_dsp_mau_size = node_mgr_obj->udsp_mau_size; + node_mgr_obj->loader_init = node_mgr_obj->nldr_fxns.pfn_init(); + status = node_mgr_obj->nldr_fxns.pfn_create(&node_mgr_obj->nldr_obj, + hdev_obj, + &nldr_attrs_obj); + if (status) + goto out_err; - if (!status) { - nldr_attrs_obj.pfn_ovly = ovly; - nldr_attrs_obj.pfn_write = mem_write; - nldr_attrs_obj.us_dsp_word_size = node_mgr_obj->udsp_word_size; - nldr_attrs_obj.us_dsp_mau_size = node_mgr_obj->udsp_mau_size; - node_mgr_obj->loader_init = node_mgr_obj->nldr_fxns.pfn_init(); - status = - node_mgr_obj->nldr_fxns.pfn_create(&node_mgr_obj->nldr_obj, - hdev_obj, - &nldr_attrs_obj); - } - if (!status) - *node_man = node_mgr_obj; - else - delete_node_mgr(node_mgr_obj); + *node_man = node_mgr_obj; DBC_ENSURE((status && *node_man == NULL) || (!status && *node_man)); return status; +out_err: + delete_node_mgr(node_mgr_obj); + return status; } /* @@ -1593,16 +1555,14 @@ func_end: */ int node_delete_mgr(struct node_mgr *hnode_mgr) { - int status = 0; - DBC_REQUIRE(refs > 0); - if (hnode_mgr) - delete_node_mgr(hnode_mgr); - else - status = -EFAULT; + if (!hnode_mgr) + return -EFAULT; - return status; + delete_node_mgr(hnode_mgr); + + return 0; } /* @@ -1710,38 +1670,37 @@ int node_get_attr(struct node_object *hnode, struct dsp_nodeattr *pattr, u32 attr_size) { struct node_mgr *hnode_mgr; - int status = 0; DBC_REQUIRE(refs > 0); DBC_REQUIRE(pattr != NULL); DBC_REQUIRE(attr_size >= sizeof(struct dsp_nodeattr)); - if (!hnode) { - status = -EFAULT; - } else { - hnode_mgr = hnode->hnode_mgr; - /* Enter hnode_mgr critical section (since we're accessing - * data that could be changed by node_change_priority() and - * node_connect(). */ - mutex_lock(&hnode_mgr->node_mgr_lock); - pattr->cb_struct = sizeof(struct dsp_nodeattr); - /* dsp_nodeattrin */ - pattr->in_node_attr_in.cb_struct = - sizeof(struct dsp_nodeattrin); - pattr->in_node_attr_in.prio = hnode->prio; - pattr->in_node_attr_in.utimeout = hnode->utimeout; - pattr->in_node_attr_in.heap_size = - hnode->create_args.asa.task_arg_obj.heap_size; - pattr->in_node_attr_in.pgpp_virt_addr = (void *) - hnode->create_args.asa.task_arg_obj.ugpp_heap_addr; - pattr->node_attr_inputs = hnode->num_gpp_inputs; - pattr->node_attr_outputs = hnode->num_gpp_outputs; - /* dsp_nodeinfo */ - get_node_info(hnode, &(pattr->node_info)); - /* end of sync_enter_cs */ - /* Exit critical section */ - mutex_unlock(&hnode_mgr->node_mgr_lock); - } - return status; + if (!hnode) + return -EFAULT; + + hnode_mgr = hnode->hnode_mgr; + /* Enter hnode_mgr critical section (since we're accessing + * data that could be changed by node_change_priority() and + * node_connect(). */ + mutex_lock(&hnode_mgr->node_mgr_lock); + pattr->cb_struct = sizeof(struct dsp_nodeattr); + /* dsp_nodeattrin */ + pattr->in_node_attr_in.cb_struct = + sizeof(struct dsp_nodeattrin); + pattr->in_node_attr_in.prio = hnode->prio; + pattr->in_node_attr_in.utimeout = hnode->utimeout; + pattr->in_node_attr_in.heap_size = + hnode->create_args.asa.task_arg_obj.heap_size; + pattr->in_node_attr_in.pgpp_virt_addr = (void *) + hnode->create_args.asa.task_arg_obj.ugpp_heap_addr; + pattr->node_attr_inputs = hnode->num_gpp_inputs; + pattr->node_attr_outputs = hnode->num_gpp_outputs; + /* dsp_nodeinfo */ + get_node_info(hnode, &(pattr->node_info)); + /* end of sync_enter_cs */ + /* Exit critical section */ + mutex_unlock(&hnode_mgr->node_mgr_lock); + + return 0; } /* -- cgit v0.10.2 From c378204afacc627330a9a1aeb5b5cd6e3d821717 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 12 Dec 2010 13:39:37 +0000 Subject: staging: tidspbridge: Fix atoi to support hexadecimal numbers correctly For some strange reason, the DSP base image node/object properties description string stores hexadecimal numbers with a 'h' or 'H' suffix instead of a '0x' prefix. This causes parsing issue because the dspbridge atoi() implementation relies on strict_strtoul(), which will return an error because of the trailing 'h' character. As the atoi() return value is never checked for an error anyway, replace strict_strtoul() with simple_strtoul() to ignore the suffix. This fix gets rid of the following assertion failed messages that were printed when running the dsp-dummy test application. drivers/staging/tidspbridge/rmgr/nldr.c, line 1691: Assertion (segid == MEMINTERNALID || segid == MEMEXTERNALID) failed. Signed-off-by: Laurent Pinchart Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/rmgr/dbdcd.c b/drivers/staging/tidspbridge/rmgr/dbdcd.c index 3581a55..b76f26c 100644 --- a/drivers/staging/tidspbridge/rmgr/dbdcd.c +++ b/drivers/staging/tidspbridge/rmgr/dbdcd.c @@ -1020,8 +1020,6 @@ static s32 atoi(char *psz_buf) { char *pch = psz_buf; s32 base = 0; - unsigned long res; - int ret_val; while (isspace(*pch)) pch++; @@ -1033,9 +1031,7 @@ static s32 atoi(char *psz_buf) base = 16; } - ret_val = strict_strtoul(pch, base, &res); - - return ret_val ? : res; + return simple_strtoul(pch, NULL, base); } /* -- cgit v0.10.2 From 2c36fac48587265311b015b7a36b2b860cf21ccd Mon Sep 17 00:00:00 2001 From: Armando Uribe Date: Fri, 17 Dec 2010 01:18:29 -0600 Subject: staging: tidspbridge: Remove unused defined constants Remove defined constants not being used. Signed-off-by: Armando Uribe Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/include/dspbridge/brddefs.h b/drivers/staging/tidspbridge/include/dspbridge/brddefs.h index f80d9a5..725d7b37 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/brddefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/brddefs.h @@ -24,9 +24,7 @@ #define BRD_IDLE 0x1 /* Monitor Loaded, but suspended. */ #define BRD_RUNNING 0x2 /* Monitor loaded, and executing. */ #define BRD_UNKNOWN 0x3 /* Board state is indeterminate. */ -#define BRD_SYNCINIT 0x4 #define BRD_LOADED 0x5 -#define BRD_LASTSTATE BRD_LOADED /* Set to highest legal board state. */ #define BRD_SLEEP_TRANSITION 0x6 /* Sleep transition in progress */ #define BRD_HIBERNATION 0x7 /* MPU initiated hibernation */ #define BRD_RETENTION 0x8 /* Retention mode */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h b/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h index f403c01..c3f04f8 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h @@ -19,25 +19,12 @@ #ifndef CFGDEFS_ #define CFGDEFS_ -/* Maximum length of module search path. */ -#define CFG_MAXSEARCHPATHLEN 255 - -/* Maximum length of general paths. */ -#define CFG_MAXPATH 255 - /* Host Resources: */ #define CFG_MAXMEMREGISTERS 9 -#define CFG_MAXIOPORTS 20 -#define CFG_MAXIRQS 7 -#define CFG_MAXDMACHANNELS 7 /* IRQ flag */ #define CFG_IRQSHARED 0x01 /* IRQ can be shared */ -/* DSP Resources: */ -#define CFG_DSPMAXMEMTYPES 10 -#define CFG_DEFAULT_NUM_WINDOWS 1 /* We support only one window. */ - /* A platform-related device handle: */ struct cfg_devnode; diff --git a/drivers/staging/tidspbridge/include/dspbridge/chnldefs.h b/drivers/staging/tidspbridge/include/dspbridge/chnldefs.h index 5bf5f6b..8f8f9ec 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/chnldefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/chnldefs.h @@ -22,9 +22,6 @@ /* Channel id option. */ #define CHNL_PICKFREE (~0UL) /* Let manager pick a free channel. */ -/* Channel manager limits: */ -#define CHNL_INITIOREQS 4 /* Default # of I/O requests. */ - /* Channel modes */ #define CHNL_MODETODSP 0 /* Data streaming to the DSP. */ #define CHNL_MODEFROMDSP 1 /* Data streaming from the DSP. */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/chnlpriv.h b/drivers/staging/tidspbridge/include/dspbridge/chnlpriv.h index 9292100..1785c3e 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/chnlpriv.h +++ b/drivers/staging/tidspbridge/include/dspbridge/chnlpriv.h @@ -39,12 +39,6 @@ */ #define CHNL_PCPY 0 /* Proc-copy transport 0 */ -#define CHNL_MAXIRQ 0xff /* Arbitrarily large number. */ - -/* The following modes are private: */ -#define CHNL_MODEUSEREVENT 0x1000 /* User provided the channel event. */ -#define CHNL_MODEMASK 0x1001 - /* Higher level channel states: */ #define CHNL_STATEREADY 0 /* Channel ready for I/O. */ #define CHNL_STATECANCEL 1 /* I/O was cancelled. */ @@ -56,13 +50,6 @@ /* Types of channel class libraries: */ #define CHNL_TYPESM 1 /* Shared memory driver. */ -#define CHNL_TYPEBM 2 /* Bus Mastering driver. */ - -/* Max string length of channel I/O completion event name - change if needed */ -#define CHNL_MAXEVTNAMELEN 32 - -/* Max memory pages lockable in CHNL_PrepareBuffer() - change if needed */ -#define CHNL_MAXLOCKPAGES 64 /* Channel info. */ struct chnl_info { diff --git a/drivers/staging/tidspbridge/include/dspbridge/cod.h b/drivers/staging/tidspbridge/include/dspbridge/cod.h index 42bce2e..5efea91 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/cod.h +++ b/drivers/staging/tidspbridge/include/dspbridge/cod.h @@ -27,9 +27,6 @@ #define COD_TRACEBEG "SYS_PUTCBEG" #define COD_TRACEEND "SYS_PUTCEND" #define COD_TRACECURPOS "BRIDGE_SYS_PUTC_current" -#define COD_TRACESECT "trace" -#define COD_TRACEBEGOLD "PUTCBEG" -#define COD_TRACEENDOLD "PUTCEND" #define COD_NOLOAD DBLL_NOLOAD #define COD_SYMB DBLL_SYMB diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h index 5af075d..38fffeb 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h @@ -31,9 +31,6 @@ /* API return value and calling convention */ #define DBAPI int -/* Infinite time value for the utimeout parameter to DSPStream_Select() */ -#define DSP_FOREVER (-1) - /* Maximum length of node name, used in dsp_ndbprops */ #define DSP_MAXNAMELEN 32 @@ -74,16 +71,9 @@ #define DSP_NODE_MIN_PRIORITY 1 #define DSP_NODE_MAX_PRIORITY 15 -/* Pre-Defined Message Command Codes available to user: */ -#define DSP_RMSUSERCODESTART RMS_USER /* Start of RMS user cmd codes */ -/* end of user codes */ -#define DSP_RMSUSERCODEEND (RMS_USER + RMS_MAXUSERCODES); /* msg_ctrl contains SM buffer description */ #define DSP_RMSBUFDESC RMS_BUFDESC -/* Shared memory identifier for MEM segment named "SHMSEG0" */ -#define DSP_SHMSEG0 (u32)(-1) - /* Processor ID numbers */ #define DSP_UNIT 0 #define IVA_UNIT 1 @@ -91,15 +81,6 @@ #define DSPWORD unsigned char #define DSPWORDSIZE sizeof(DSPWORD) -/* Power control enumerations */ -#define PROC_PWRCONTROL 0x8070 - -#define PROC_PWRMGT_ENABLE (PROC_PWRCONTROL + 0x3) -#define PROC_PWRMGT_DISABLE (PROC_PWRCONTROL + 0x4) - -/* Bridge Code Version */ -#define BRIDGE_VERSION_CODE 333 - #define MAX_PROFILES 16 /* DSP chip type */ @@ -501,13 +482,6 @@ bit 15 - Output (writeable) buffer #define DSPPROCTYPE_C64 6410 #define IVAPROCTYPE_ARM7 470 -#define REG_MGR_OBJECT 1 -#define REG_DRV_OBJECT 2 - -/* registry */ -#define DRVOBJECT "DrvObject" -#define MGROBJECT "MgrObject" - /* Max registry path length. Also the max registry value length. */ #define MAXREGPATHLENGTH 255 diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbldefs.h b/drivers/staging/tidspbridge/include/dspbridge/dbldefs.h index bf4fb99..9973098 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dbldefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dbldefs.h @@ -17,17 +17,6 @@ #ifndef DBLDEFS_ #define DBLDEFS_ -/* - * Bit masks for dbl_flags. - */ -#define DBL_NOLOAD 0x0 /* Don't load symbols, code, or data */ -#define DBL_SYMB 0x1 /* load symbols */ -#define DBL_CODE 0x2 /* load code */ -#define DBL_DATA 0x4 /* load data */ -#define DBL_DYNAMIC 0x8 /* dynamic load */ -#define DBL_BSS 0x20 /* Unitialized section */ - -#define DBL_MAXPATHLENGTH 255 /* * ======== dbl_flags ======== diff --git a/drivers/staging/tidspbridge/include/dspbridge/dehdefs.h b/drivers/staging/tidspbridge/include/dspbridge/dehdefs.h index 09f8bf8..5341471 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dehdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dehdefs.h @@ -26,7 +26,6 @@ struct deh_mgr; /* Magic code used to determine if DSP signaled exception. */ #define DEH_BASE MBX_DEH_BASE -#define DEH_USERS_BASE MBX_DEH_USERS_BASE #define DEH_LIMIT MBX_DEH_LIMIT #endif /* _DEHDEFS_H */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/drv.h b/drivers/staging/tidspbridge/include/dspbridge/drv.h index 37f5a45..adb28ec 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/drv.h +++ b/drivers/staging/tidspbridge/include/dspbridge/drv.h @@ -26,9 +26,6 @@ #include #include -#define DRV_ASSIGN 1 -#define DRV_RELEASE 0 - /* Provide the DSP Internal memory windows that can be accessed from L3 address * space */ @@ -38,23 +35,14 @@ /* MEM1 is L2 RAM + L2 Cache space */ #define OMAP_DSP_MEM1_BASE 0x5C7F8000 #define OMAP_DSP_MEM1_SIZE 0x18000 -#define OMAP_DSP_GEM1_BASE 0x107F8000 /* MEM2 is L1P RAM/CACHE space */ #define OMAP_DSP_MEM2_BASE 0x5CE00000 #define OMAP_DSP_MEM2_SIZE 0x8000 -#define OMAP_DSP_GEM2_BASE 0x10E00000 /* MEM3 is L1D RAM/CACHE space */ #define OMAP_DSP_MEM3_BASE 0x5CF04000 #define OMAP_DSP_MEM3_SIZE 0x14000 -#define OMAP_DSP_GEM3_BASE 0x10F04000 - -#define OMAP_IVA2_PRM_BASE 0x48306000 -#define OMAP_IVA2_PRM_SIZE 0x1000 - -#define OMAP_IVA2_CM_BASE 0x48004000 -#define OMAP_IVA2_CM_SIZE 0x1000 #define OMAP_PER_CM_BASE 0x48005000 #define OMAP_PER_CM_SIZE 0x1000 @@ -68,9 +56,6 @@ #define OMAP_DMMU_BASE 0x5D000000 #define OMAP_DMMU_SIZE 0x1000 -#define OMAP_PRCM_VDD1_DOMAIN 1 -#define OMAP_PRCM_VDD2_DOMAIN 2 - /* GPP PROCESS CLEANUP Data structures */ /* New structure (member of process context) abstracts NODE resource info */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h b/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h index 0ae7d16..2acbbb3 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h @@ -37,12 +37,6 @@ #include #include -/* - * Any IOCTLS at or above this value are reserved for standard Bridge driver - * interfaces. - */ -#define BRD_RESERVEDIOCTLBASE 0x8000 - /* Handle to Bridge driver's private device context. */ struct bridge_dev_context; diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspdrv.h b/drivers/staging/tidspbridge/include/dspbridge/dspdrv.h index 0bb250f..7adf1e7 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspdrv.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspdrv.h @@ -20,8 +20,6 @@ #if !defined _DSPDRV_H_ #define _DSPDRV_H_ -#define MAX_DEV 10 /* Max support of 10 devices */ - /* * ======== dsp_deinit ======== * Purpose: diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspioctl.h b/drivers/staging/tidspbridge/include/dspbridge/dspioctl.h index 41e0594..54552a7 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspioctl.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspioctl.h @@ -31,9 +31,6 @@ #define BRDIOCTL_CHNLREAD (BRDIOCTL_RESERVEDBASE + 0x10) #define BRDIOCTL_CHNLWRITE (BRDIOCTL_RESERVEDBASE + 0x20) -#define BRDIOCTL_GETINTRCOUNT (BRDIOCTL_RESERVEDBASE + 0x30) -#define BRDIOCTL_RESETINTRCOUNT (BRDIOCTL_RESERVEDBASE + 0x40) -#define BRDIOCTL_INTERRUPTDSP (BRDIOCTL_RESERVEDBASE + 0x50) /* DMMU */ #define BRDIOCTL_SETMMUCONFIG (BRDIOCTL_RESERVEDBASE + 0x60) /* PWR */ @@ -47,8 +44,6 @@ #define BRDIOCTL_DEEPSLEEP (BRDIOCTL_PWRCONTROL + 0x0) #define BRDIOCTL_EMERGENCYSLEEP (BRDIOCTL_PWRCONTROL + 0x1) #define BRDIOCTL_WAKEUP (BRDIOCTL_PWRCONTROL + 0x2) -#define BRDIOCTL_PWRENABLE (BRDIOCTL_PWRCONTROL + 0x3) -#define BRDIOCTL_PWRDISABLE (BRDIOCTL_PWRCONTROL + 0x4) #define BRDIOCTL_CLK_CTRL (BRDIOCTL_PWRCONTROL + 0x7) /* DSP Initiated Hibernate */ #define BRDIOCTL_PWR_HIBERNATE (BRDIOCTL_PWRCONTROL + 0x8) diff --git a/drivers/staging/tidspbridge/include/dspbridge/dynamic_loader.h b/drivers/staging/tidspbridge/include/dspbridge/dynamic_loader.h index 4b109d1..052d27e 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dynamic_loader.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dynamic_loader.h @@ -46,8 +46,6 @@ struct dynamic_loader_initialize; * Option flags to modify the behavior of module loading */ #define DLOAD_INITBSS 0x1 /* initialize BSS sections to zero */ -#define DLOAD_BIGEND 0x2 /* require big-endian load module */ -#define DLOAD_LITTLE 0x4 /* require little-endian load module */ /***************************************************************************** * Procedure dynamic_load_module diff --git a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h index 8242c70..056606a 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h @@ -28,7 +28,6 @@ #define IO_INPUT 0 #define IO_OUTPUT 1 #define IO_SERVICE 2 -#define IO_MAXSERVICE IO_SERVICE #ifdef CONFIG_TIDSPBRIDGE_DVFS /* The maximum number of OPPs that are supported */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/iodefs.h b/drivers/staging/tidspbridge/include/dspbridge/iodefs.h index 8bd10a0..31cbc9a 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/iodefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/iodefs.h @@ -19,8 +19,6 @@ #ifndef IODEFS_ #define IODEFS_ -#define IO_MAXIRQ 0xff /* Arbitrarily large number. */ - /* IO Objects: */ struct io_mgr; diff --git a/drivers/staging/tidspbridge/include/dspbridge/mbx_sh.h b/drivers/staging/tidspbridge/include/dspbridge/mbx_sh.h index 5d165cd..7424c88 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/mbx_sh.h +++ b/drivers/staging/tidspbridge/include/dspbridge/mbx_sh.h @@ -110,13 +110,7 @@ #ifndef _MBX_SH_H #define _MBX_SH_H -#define MBX_CLASS_MSK 0xFC00 /* Class bits are 10 thru 15 */ -#define MBX_VALUE_MSK 0x03FF /* Value is 0 thru 9 */ - -#define MBX_DEH_CLASS 0x0000 /* DEH owns Mbx INTR */ -#define MBX_DDMA_CLASS 0x0400 /* DSP-DMA link drvr chnls owns INTR */ #define MBX_PCPY_CLASS 0x0800 /* PROC-COPY " */ -#define MBX_ZCPY_CLASS 0x1000 /* ZERO-COPY " */ #define MBX_PM_CLASS 0x2000 /* Power Management */ #define MBX_DBG_CLASS 0x4000 /* For debugging purpose */ @@ -128,55 +122,21 @@ #define MBX_DEH_USERS_BASE 0x100 /* 256 */ #define MBX_DEH_LIMIT 0x3FF /* 1023 */ #define MBX_DEH_RESET 0x101 /* DSP RESET (DEH) */ -#define MBX_DEH_EMMU 0X103 /*DSP MMU FAULT RECOVERY */ /* * Link driver command/status codes. */ -/* DSP-DMA */ -#define MBX_DDMA_NUMCHNLBITS 5 /* # chnl Id: # bits available */ -#define MBX_DDMA_CHNLSHIFT 0 /* # of bits to shift */ -#define MBX_DDMA_CHNLMSK 0x01F /* bits 0 thru 4 */ - -#define MBX_DDMA_NUMBUFBITS 5 /* buffer index: # of bits avail */ -#define MBX_DDMA_BUFSHIFT (MBX_DDMA_NUMCHNLBITS + MBX_DDMA_CHNLSHIFT) -#define MBX_DDMA_BUFMSK 0x3E0 /* bits 5 thru 9 */ - -/* Zero-Copy */ -#define MBX_ZCPY_NUMCHNLBITS 5 /* # chnl Id: # bits available */ -#define MBX_ZCPY_CHNLSHIFT 0 /* # of bits to shift */ -#define MBX_ZCPY_CHNLMSK 0x01F /* bits 0 thru 4 */ /* Power Management Commands */ #define MBX_PM_DSPIDLE (MBX_PM_CLASS + 0x0) #define MBX_PM_DSPWAKEUP (MBX_PM_CLASS + 0x1) #define MBX_PM_EMERGENCYSLEEP (MBX_PM_CLASS + 0x2) -#define MBX_PM_SLEEPUNTILRESTART (MBX_PM_CLASS + 0x3) -#define MBX_PM_DSPGLOBALIDLE_OFF (MBX_PM_CLASS + 0x4) -#define MBX_PM_DSPGLOBALIDLE_ON (MBX_PM_CLASS + 0x5) #define MBX_PM_SETPOINT_PRENOTIFY (MBX_PM_CLASS + 0x6) #define MBX_PM_SETPOINT_POSTNOTIFY (MBX_PM_CLASS + 0x7) -#define MBX_PM_DSPRETN (MBX_PM_CLASS + 0x8) #define MBX_PM_DSPRETENTION (MBX_PM_CLASS + 0x8) #define MBX_PM_DSPHIBERNATE (MBX_PM_CLASS + 0x9) #define MBX_PM_HIBERNATE_EN (MBX_PM_CLASS + 0xA) #define MBX_PM_OPP_REQ (MBX_PM_CLASS + 0xB) -#define MBX_PM_OPP_CHG (MBX_PM_CLASS + 0xC) - -#define MBX_PM_TYPE_MASK 0x0300 -#define MBX_PM_TYPE_PWR_CHNG 0x0100 -#define MBX_PM_TYPE_OPP_PRECHNG 0x0200 -#define MBX_PM_TYPE_OPP_POSTCHNG 0x0300 -#define MBX_PM_TYPE_OPP_MASK 0x0300 -#define MBX_PM_OPP_PRECHNG (MBX_PM_CLASS | MBX_PM_TYPE_OPP_PRECHNG) -/* DSP to MPU */ -#define MBX_PM_OPP_CHNG(OPP) (MBX_PM_CLASS | MBX_PM_TYPE_OPP_PRECHNG | (OPP)) -#define MBX_PM_RET (MBX_PM_CLASS | MBX_PM_TYPE_PWR_CHNG | 0x0006) -#define MBX_PM_HIB (MBX_PM_CLASS | MBX_PM_TYPE_PWR_CHNG | 0x0002) -#define MBX_PM_OPP1 0 -#define MBX_PM_OPP2 1 -#define MBX_PM_OPP3 2 -#define MBX_PM_OPP4 3 /* Bridge Debug Commands */ #define MBX_DBG_SYSPRINTF (MBX_DBG_CLASS + 0x0) diff --git a/drivers/staging/tidspbridge/include/dspbridge/pwr_sh.h b/drivers/staging/tidspbridge/include/dspbridge/pwr_sh.h index 1b4a090..c78a1b1 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/pwr_sh.h +++ b/drivers/staging/tidspbridge/include/dspbridge/pwr_sh.h @@ -24,10 +24,6 @@ /* valid sleep command codes that can be sent by GPP via mailbox: */ #define PWR_DEEPSLEEP MBX_PM_DSPIDLE #define PWR_EMERGENCYDEEPSLEEP MBX_PM_EMERGENCYSLEEP -#define PWR_SLEEPUNTILRESTART MBX_PM_SLEEPUNTILRESTART #define PWR_WAKEUP MBX_PM_DSPWAKEUP -#define PWR_AUTOENABLE MBX_PM_PWRENABLE -#define PWR_AUTODISABLE MBX_PM_PWRDISABLE -#define PWR_RETENTION MBX_PM_DSPRETN #endif /* PWR_SH_ */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/rms_sh.h b/drivers/staging/tidspbridge/include/dspbridge/rms_sh.h index 7bc5574..ba7f478 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/rms_sh.h +++ b/drivers/staging/tidspbridge/include/dspbridge/rms_sh.h @@ -22,27 +22,18 @@ #include -/* Node Types: */ -#define RMS_TASK 1 /* Task node */ -#define RMS_DAIS 2 /* xDAIS socket node */ -#define RMS_MSG 3 /* Message node */ - /* Memory Types: */ #define RMS_CODE 0 /* Program space */ #define RMS_DATA 1 /* Data space */ -#define RMS_IO 2 /* I/O space */ /* RM Server Command and Response Buffer Sizes: */ #define RMS_COMMANDBUFSIZE 256 /* Size of command buffer */ -#define RMS_RESPONSEBUFSIZE 16 /* Size of response buffer */ /* Pre-Defined Command/Response Codes: */ #define RMS_EXIT 0x80000000 /* GPP->Node: shutdown */ #define RMS_EXITACK 0x40000000 /* Node->GPP: ack shutdown */ #define RMS_BUFDESC 0x20000000 /* Arg1 SM buf, Arg2 SM size */ #define RMS_KILLTASK 0x10000000 /* GPP->Node: Kill Task */ -#define RMS_USER 0x0 /* Start of user-defined msg codes */ -#define RMS_MAXUSERCODES 0xfff /* Maximum user defined C/R Codes */ /* RM Server RPC Command Structure: */ struct rms_command { diff --git a/drivers/staging/tidspbridge/include/dspbridge/strmdefs.h b/drivers/staging/tidspbridge/include/dspbridge/strmdefs.h index b363f79..c6abbf3 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/strmdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/strmdefs.h @@ -19,8 +19,6 @@ #ifndef STRMDEFS_ #define STRMDEFS_ -#define STRM_MAXEVTNAMELEN 32 - struct strm_mgr; struct strm_object; diff --git a/drivers/staging/tidspbridge/pmgr/dev.c b/drivers/staging/tidspbridge/pmgr/dev.c index b160b00..b95cd20 100644 --- a/drivers/staging/tidspbridge/pmgr/dev.c +++ b/drivers/staging/tidspbridge/pmgr/dev.c @@ -880,7 +880,7 @@ int dev_start_device(struct cfg_devnode *dev_node_obj) { struct dev_object *hdev_obj = NULL; /* handle to 'Bridge Device */ /* Bridge driver filename */ - char bridge_file_name[CFG_MAXSEARCHPATHLEN] = "UMA"; + char *bridge_file_name = "UMA"; int status; struct mgr_object *hmgr_obj = NULL; struct drv_data *drv_datap = dev_get_drvdata(bridge); -- cgit v0.10.2 From 57e6a9f2a8472493fe407227b047f5284d8a4540 Mon Sep 17 00:00:00 2001 From: Armando Uribe Date: Fri, 17 Dec 2010 01:18:30 -0600 Subject: staging: tidspbridge: Remove unused functions Remove functions that are not used at all, also remove the dependencies of this functions like struct members, comments and calls. Signed-off-by: Armando Uribe Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index 042a465..d4b9e14 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c @@ -1682,10 +1682,6 @@ int bridge_io_get_proc_load(struct io_mgr *hio_mgr, return 0; } -void io_sm_init(void) -{ - /* Do nothing */ -} #if defined(CONFIG_TIDSPBRIDGE_BACKTRACE) || defined(CONFIG_TIDSPBRIDGE_DEBUG) void print_dsp_debug_trace(struct io_mgr *hio_mgr) diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c index 2ae7e44..ec713ed 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430.c +++ b/drivers/staging/tidspbridge/core/tiomap3430.c @@ -259,8 +259,6 @@ void bridge_drv_entry(struct bridge_drv_interface **drv_intf, DBC_REQUIRE(driver_file_name != NULL); - io_sm_init(); /* Initialization of io_sm module */ - if (strcmp(driver_file_name, "UMA") == 0) *drv_intf = &drv_interface_fxns; else diff --git a/drivers/staging/tidspbridge/include/dspbridge/chnl.h b/drivers/staging/tidspbridge/include/dspbridge/chnl.h index 8733b3b..92f6a13 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/chnl.h +++ b/drivers/staging/tidspbridge/include/dspbridge/chnl.h @@ -25,27 +25,6 @@ #include /* - * ======== chnl_close ======== - * Purpose: - * Ensures all pending I/O on this channel is cancelled, discards all - * queued I/O completion notifications, then frees the resources allocated - * for this channel, and makes the corresponding logical channel id - * available for subsequent use. - * Parameters: - * chnl_obj: Channel object handle. - * Returns: - * 0: Success; - * -EFAULT: Invalid chnl_obj. - * Requires: - * chnl_init(void) called. - * No thread must be blocked on this channel's I/O completion event. - * Ensures: - * 0: The I/O completion event for this channel is freed. - * chnl_obj is no longer valid. - */ -extern int chnl_close(struct chnl_object *chnl_obj); - -/* * ======== chnl_create ======== * Purpose: * Create a channel manager object, responsible for opening new channels diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbll.h b/drivers/staging/tidspbridge/include/dspbridge/dbll.h index b018676..46a9e00 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dbll.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dbll.h @@ -42,18 +42,12 @@ extern bool dbll_init(void); extern int dbll_load(struct dbll_library_obj *lib, dbll_flags flags, struct dbll_attrs *attrs, u32 * entry); -extern int dbll_load_sect(struct dbll_library_obj *zl_lib, - char *sec_name, struct dbll_attrs *attrs); extern int dbll_open(struct dbll_tar_obj *target, char *file, dbll_flags flags, struct dbll_library_obj **lib_obj); extern int dbll_read_sect(struct dbll_library_obj *lib, char *name, char *buf, u32 size); -extern void dbll_set_attrs(struct dbll_tar_obj *target, - struct dbll_attrs *pattrs); extern void dbll_unload(struct dbll_library_obj *lib, struct dbll_attrs *attrs); -extern int dbll_unload_sect(struct dbll_library_obj *lib, - char *sect_name, struct dbll_attrs *attrs); #ifdef CONFIG_TIDSPBRIDGE_BACKTRACE bool dbll_find_dsp_symbol(struct dbll_library_obj *zl_lib, u32 address, u32 offset_range, u32 *sym_addr_output, char *name_output); diff --git a/drivers/staging/tidspbridge/include/dspbridge/dblldefs.h b/drivers/staging/tidspbridge/include/dspbridge/dblldefs.h index d2b4fda..81821e5 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dblldefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dblldefs.h @@ -485,12 +485,9 @@ struct dbll_fxns { dbll_get_sect_fxn get_sect_fxn; dbll_init_fxn init_fxn; dbll_load_fxn load_fxn; - dbll_load_sect_fxn load_sect_fxn; dbll_open_fxn open_fxn; dbll_read_sect_fxn read_sect_fxn; - dbll_set_attrs_fxn set_attrs_fxn; dbll_unload_fxn unload_fxn; - dbll_unload_sect_fxn unload_sect_fxn; }; #endif /* DBLDEFS_ */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/dev.h b/drivers/staging/tidspbridge/include/dspbridge/dev.h index 357458f..4d4196b 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dev.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dev.h @@ -95,43 +95,6 @@ extern int dev_create_device(struct dev_object struct cfg_devnode *dev_node_obj); /* - * ======== dev_create_iva_device ======== - * Purpose: - * Called by the operating system to load the Bridge Driver for IVA. - * Parameters: - * device_obj: Ptr to location to receive the device object handle. - * driver_file_name: Name of Bridge driver PE DLL file to load. If the - * absolute path is not provided, the file is loaded - * through 'Bridge's module search path. - * host_config: Host configuration information, to be passed down - * to the Bridge driver when bridge_dev_create() is called. - * pDspConfig: DSP resources, to be passed down to the Bridge driver - * when bridge_dev_create() is called. - * dev_node_obj: Platform specific device node. - * Returns: - * 0: Module is loaded, device object has been created - * -ENOMEM: Insufficient memory to create needed resources. - * -EPERM: Unable to find Bridge driver entry point function. - * -ESPIPE: Unable to load ZL DLL. - * Requires: - * DEV Initialized. - * device_obj != NULL. - * driver_file_name != NULL. - * host_config != NULL. - * pDspConfig != NULL. - * Ensures: - * 0: *device_obj will contain handle to the new device object. - * Otherwise, does not create the device object, ensures the Bridge driver - * module is unloaded, and sets *device_obj to NULL. - */ -extern int dev_create_iva_device(struct dev_object - **device_obj, - const char *driver_file_name, - const struct cfg_hostres - *host_config, - struct cfg_devnode *dev_node_obj); - -/* * ======== dev_create2 ======== * Purpose: * After successful loading of the image from api_init_complete2 @@ -542,24 +505,6 @@ extern void dev_exit(void); extern bool dev_init(void); /* - * ======== dev_is_locked ======== - * Purpose: - * Predicate function to determine if the device has been - * locked by a client for exclusive access. - * Parameters: - * hdev_obj: Handle to device object created with - * dev_create_device(). - * Returns: - * 0: TRUE: device has been locked. - * 0: FALSE: device not locked. - * -EFAULT: hdev_obj was invalid. - * Requires: - * DEV Initialized. - * Ensures: - */ -extern int dev_is_locked(struct dev_object *hdev_obj); - -/* * ======== dev_insert_proc_object ======== * Purpose: * Inserts the Processor Object into the List of PROC Objects diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspio.h b/drivers/staging/tidspbridge/include/dspbridge/dspio.h index 88f5f90..5c666b8 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspio.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspio.h @@ -34,7 +34,6 @@ extern int bridge_io_destroy(struct io_mgr *hio_mgr); extern int bridge_io_on_loaded(struct io_mgr *hio_mgr); -extern int iva_io_on_loaded(struct io_mgr *hio_mgr); extern int bridge_io_get_proc_load(struct io_mgr *hio_mgr, struct dsp_procloadstat *proc_lstat); diff --git a/drivers/staging/tidspbridge/include/dspbridge/host_os.h b/drivers/staging/tidspbridge/include/dspbridge/host_os.h index 6549898..b1b8acb 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/host_os.h +++ b/drivers/staging/tidspbridge/include/dspbridge/host_os.h @@ -57,13 +57,4 @@ extern struct platform_device *omap_dspbridge_dev; extern struct device *bridge; -#if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE) -extern void dspbridge_reserve_sdram(void); -#else -static inline void dspbridge_reserve_sdram(void) -{ -} -#endif - -extern unsigned long dspbridge_get_mempool_base(void); #endif diff --git a/drivers/staging/tidspbridge/include/dspbridge/io.h b/drivers/staging/tidspbridge/include/dspbridge/io.h index bc346f9..da4683c 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/io.h +++ b/drivers/staging/tidspbridge/include/dspbridge/io.h @@ -95,20 +95,4 @@ extern void io_exit(void); */ extern bool io_init(void); -/* - * ======== io_on_loaded ======== - * Purpose: - * Called when a program is loaded so IO manager can update its - * internal state. - * Parameters: - * hio_mgr: IOmanager object. - * Returns: - * 0: Success. - * -EFAULT: hio_mgr was invalid. - * Requires: - * io_init(void) called. - * Ensures: - */ -extern int io_on_loaded(struct io_mgr *hio_mgr); - #endif /* CHNL_ */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h index 056606a..6a4c441 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h @@ -115,122 +115,6 @@ extern void io_request_chnl(struct io_mgr *io_manager, extern void iosm_schedule(struct io_mgr *io_manager); /* - * DSP-DMA IO functions - */ - -/* - * ======== io_ddma_init_chnl_desc ======== - * Purpose: - * Initialize DSP DMA channel descriptor. - * Parameters: - * hio_mgr: Handle to a I/O manager. - * ddma_chnl_id: DDMA channel identifier. - * num_desc: Number of buffer descriptors(equals # of IOReqs & - * Chirps) - * dsp: Dsp address; - * Returns: - * Requires: - * ddma_chnl_id < DDMA_MAXDDMACHNLS - * num_desc > 0 - * pVa != NULL - * pDspPa != NULL - * - * Ensures: - */ -extern void io_ddma_init_chnl_desc(struct io_mgr *hio_mgr, u32 ddma_chnl_id, - u32 num_desc, void *dsp); - -/* - * ======== io_ddma_clear_chnl_desc ======== - * Purpose: - * Clear DSP DMA channel descriptor. - * Parameters: - * hio_mgr: Handle to a I/O manager. - * ddma_chnl_id: DDMA channel identifier. - * Returns: - * Requires: - * ddma_chnl_id < DDMA_MAXDDMACHNLS - * Ensures: - */ -extern void io_ddma_clear_chnl_desc(struct io_mgr *hio_mgr, u32 ddma_chnl_id); - -/* - * ======== io_ddma_request_chnl ======== - * Purpose: - * Request channel DSP-DMA from the DSP. Sets up SM descriptors and - * control fields in shared memory. - * Parameters: - * hio_mgr: Handle to a I/O manager. - * pchnl: Ptr to channel object - * chnl_packet_obj: Ptr to channel i/o request packet. - * Returns: - * Requires: - * pchnl != NULL - * pchnl->cio_reqs > 0 - * chnl_packet_obj != NULL - * Ensures: - */ -extern void io_ddma_request_chnl(struct io_mgr *hio_mgr, - struct chnl_object *pchnl, - struct chnl_irp *chnl_packet_obj, - u16 *mbx_val); - -/* - * Zero-copy IO functions - */ - -/* - * ======== io_ddzc_init_chnl_desc ======== - * Purpose: - * Initialize ZCPY channel descriptor. - * Parameters: - * hio_mgr: Handle to a I/O manager. - * zid: zero-copy channel identifier. - * Returns: - * Requires: - * ddma_chnl_id < DDMA_MAXZCPYCHNLS - * hio_mgr != Null - * Ensures: - */ -extern void io_ddzc_init_chnl_desc(struct io_mgr *hio_mgr, u32 zid); - -/* - * ======== io_ddzc_clear_chnl_desc ======== - * Purpose: - * Clear DSP ZC channel descriptor. - * Parameters: - * hio_mgr: Handle to a I/O manager. - * ch_id: ZC channel identifier. - * Returns: - * Requires: - * hio_mgr is valid - * ch_id < DDMA_MAXZCPYCHNLS - * Ensures: - */ -extern void io_ddzc_clear_chnl_desc(struct io_mgr *hio_mgr, u32 ch_id); - -/* - * ======== io_ddzc_request_chnl ======== - * Purpose: - * Request zero-copy channel transfer. Sets up SM descriptors and - * control fields in shared memory. - * Parameters: - * hio_mgr: Handle to a I/O manager. - * pchnl: Ptr to channel object - * chnl_packet_obj: Ptr to channel i/o request packet. - * Returns: - * Requires: - * pchnl != NULL - * pchnl->cio_reqs > 0 - * chnl_packet_obj != NULL - * Ensures: - */ -extern void io_ddzc_request_chnl(struct io_mgr *hio_mgr, - struct chnl_object *pchnl, - struct chnl_irp *chnl_packet_obj, - u16 *mbx_val); - -/* * ======== io_sh_msetting ======== * Purpose: * Sets the shared memory setting @@ -253,25 +137,6 @@ extern int io_sh_msetting(struct io_mgr *hio_mgr, u8 desc, void *pargs); /* Maximum channel bufsize that can be used. */ extern u32 io_buf_size(struct io_mgr *hio_mgr); -extern u32 io_read_value(struct bridge_dev_context *dev_ctxt, u32 dsp_addr); - -extern void io_write_value(struct bridge_dev_context *dev_ctxt, - u32 dsp_addr, u32 value); - -extern u32 io_read_value_long(struct bridge_dev_context *dev_ctxt, - u32 dsp_addr); - -extern void io_write_value_long(struct bridge_dev_context *dev_ctxt, - u32 dsp_addr, u32 value); - -extern void io_or_set_value(struct bridge_dev_context *dev_ctxt, - u32 dsp_addr, u32 value); - -extern void io_and_set_value(struct bridge_dev_context *dev_ctxt, - u32 dsp_addr, u32 value); - -extern void io_sm_init(void); - #ifdef CONFIG_TIDSPBRIDGE_BACKTRACE /* * ========print_dsp_trace_buffer ======== diff --git a/drivers/staging/tidspbridge/include/dspbridge/node.h b/drivers/staging/tidspbridge/include/dspbridge/node.h index 49ed5c1..4c5558c 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/node.h +++ b/drivers/staging/tidspbridge/include/dspbridge/node.h @@ -113,24 +113,6 @@ extern int node_alloc_msg_buf(struct node_object *hnode, extern int node_change_priority(struct node_object *hnode, s32 prio); /* - * ======== node_close_orphans ======== - * Purpose: - * Delete all nodes whose owning processor is being destroyed. - * Parameters: - * hnode_mgr: Node manager object. - * proc: Handle to processor object being destroyed. - * Returns: - * 0: Success. - * -EPERM: Unable to delete all nodes belonging to proc. - * Requires: - * Valid hnode_mgr. - * proc != NULL. - * Ensures: - */ -extern int node_close_orphans(struct node_mgr *hnode_mgr, - struct proc_object *proc); - -/* * ======== node_connect ======== * Purpose: * Connect two nodes on the DSP, or a node on the DSP to the GPP. In the diff --git a/drivers/staging/tidspbridge/include/dspbridge/resourcecleanup.h b/drivers/staging/tidspbridge/include/dspbridge/resourcecleanup.h index dfaf0c6..8c9c902 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/resourcecleanup.h +++ b/drivers/staging/tidspbridge/include/dspbridge/resourcecleanup.h @@ -17,23 +17,12 @@ #include #include -extern int drv_get_proc_ctxt_list(struct process_context **pctxt, - struct drv_object *hdrv_obj); - -extern int drv_insert_proc_context(struct drv_object *driver_obj, - void *process_ctxt); - extern int drv_remove_all_dmm_res_elements(void *process_ctxt); extern int drv_remove_all_node_res_elements(void *process_ctxt); -extern int drv_proc_set_pid(void *ctxt, s32 process); - extern int drv_remove_all_resources(void *process_ctxt); -extern int drv_remove_proc_context(struct drv_object *driver_obj, - void *pr_ctxt); - extern int drv_insert_node_res_element(void *hnode, void *node_resource, void *process_ctxt); diff --git a/drivers/staging/tidspbridge/include/dspbridge/strm.h b/drivers/staging/tidspbridge/include/dspbridge/strm.h index 3e4671e..613fe53 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/strm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/strm.h @@ -142,25 +142,6 @@ extern int strm_free_buffer(struct strm_res_object *strmres, struct process_context *pr_ctxt); /* - * ======== strm_get_event_handle ======== - * Purpose: - * Get stream's user event handle. This function is used when closing - * a stream, so the event can be closed. - * Parameter: - * stream_obj: Stream handle returned from strm_open(). - * ph_event: Location to store event handle on output. - * Returns: - * 0: Success. - * -EFAULT: Invalid stream_obj. - * Requires: - * strm_init(void) called. - * ph_event != NULL. - * Ensures: - */ -extern int strm_get_event_handle(struct strm_object *stream_obj, - void **ph_event); - -/* * ======== strm_get_info ======== * Purpose: * Get information about a stream. User's dsp_streaminfo is contained @@ -276,27 +257,6 @@ extern int strm_open(struct node_object *hnode, u32 dir, struct process_context *pr_ctxt); /* - * ======== strm_prepare_buffer ======== - * Purpose: - * Prepare a data buffer not allocated by DSPStream_AllocateBuffers() - * for use with a stream. - * Parameter: - * stream_obj: Stream handle returned from strm_open(). - * usize: Size (GPP bytes) of the buffer. - * pbuffer: Buffer address. - * Returns: - * 0: Success. - * -EFAULT: Invalid stream_obj. - * -EPERM: Failure occurred, unable to prepare buffer. - * Requires: - * strm_init(void) called. - * pbuffer != NULL. - * Ensures: - */ -extern int strm_prepare_buffer(struct strm_object *stream_obj, - u32 usize, u8 *pbuffer); - -/* * ======== strm_reclaim ======== * Purpose: * Request a buffer back from a stream. @@ -379,26 +339,4 @@ extern int strm_register_notify(struct strm_object *stream_obj, extern int strm_select(struct strm_object **strm_tab, u32 strms, u32 *pmask, u32 utimeout); -/* - * ======== strm_unprepare_buffer ======== - * Purpose: - * Unprepare a data buffer that was previously prepared for a stream - * with DSPStream_PrepareBuffer(), and that will no longer be used with - * the stream. - * Parameter: - * stream_obj: Stream handle returned from strm_open(). - * usize: Size (GPP bytes) of the buffer. - * pbuffer: Buffer address. - * Returns: - * 0: Success. - * -EFAULT: Invalid stream_obj. - * -EPERM: Failure occurred, unable to unprepare buffer. - * Requires: - * strm_init(void) called. - * pbuffer != NULL. - * Ensures: - */ -extern int strm_unprepare_buffer(struct strm_object *stream_obj, - u32 usize, u8 *pbuffer); - #endif /* STRM_ */ diff --git a/drivers/staging/tidspbridge/pmgr/cod.c b/drivers/staging/tidspbridge/pmgr/cod.c index 52989ab..db29a19 100644 --- a/drivers/staging/tidspbridge/pmgr/cod.c +++ b/drivers/staging/tidspbridge/pmgr/cod.c @@ -78,12 +78,9 @@ static struct dbll_fxns ldr_fxns = { (dbll_get_sect_fxn) dbll_get_sect, (dbll_init_fxn) dbll_init, (dbll_load_fxn) dbll_load, - (dbll_load_sect_fxn) dbll_load_sect, (dbll_open_fxn) dbll_open, (dbll_read_sect_fxn) dbll_read_sect, - (dbll_set_attrs_fxn) dbll_set_attrs, (dbll_unload_fxn) dbll_unload, - (dbll_unload_sect_fxn) dbll_unload_sect, }; static bool no_op(void); diff --git a/drivers/staging/tidspbridge/pmgr/dbll.c b/drivers/staging/tidspbridge/pmgr/dbll.c index 878aa50..2f46b06 100644 --- a/drivers/staging/tidspbridge/pmgr/dbll.c +++ b/drivers/staging/tidspbridge/pmgr/dbll.c @@ -568,18 +568,6 @@ int dbll_load(struct dbll_library_obj *lib, dbll_flags flags, } /* - * ======== dbll_load_sect ======== - * Not supported for COFF. - */ -int dbll_load_sect(struct dbll_library_obj *zl_lib, char *sec_name, - struct dbll_attrs *attrs) -{ - DBC_REQUIRE(zl_lib); - - return -ENOSYS; -} - -/* * ======== dbll_open ======== */ int dbll_open(struct dbll_tar_obj *target, char *file, dbll_flags flags, @@ -794,22 +782,6 @@ func_cont: } /* - * ======== dbll_set_attrs ======== - * Set the attributes of the target. - */ -void dbll_set_attrs(struct dbll_tar_obj *target, struct dbll_attrs *pattrs) -{ - struct dbll_tar_obj *zl_target = (struct dbll_tar_obj *)target; - DBC_REQUIRE(refs > 0); - DBC_REQUIRE(zl_target); - DBC_REQUIRE(pattrs != NULL); - - if ((pattrs != NULL) && (zl_target != NULL)) - zl_target->attrs = *pattrs; - -} - -/* * ======== dbll_unload ======== */ void dbll_unload(struct dbll_library_obj *lib, struct dbll_attrs *attrs) @@ -848,19 +820,6 @@ func_end: } /* - * ======== dbll_unload_sect ======== - * Not supported for COFF. - */ -int dbll_unload_sect(struct dbll_library_obj *lib, char *sec_name, - struct dbll_attrs *attrs) -{ - DBC_REQUIRE(refs > 0); - DBC_REQUIRE(sec_name != NULL); - - return -ENOSYS; -} - -/* * ======== dof_close ======== */ static void dof_close(struct dbll_library_obj *zl_lib) diff --git a/drivers/staging/tidspbridge/rmgr/nldr.c b/drivers/staging/tidspbridge/rmgr/nldr.c index 28354bb..d19cdb0 100644 --- a/drivers/staging/tidspbridge/rmgr/nldr.c +++ b/drivers/staging/tidspbridge/rmgr/nldr.c @@ -260,12 +260,9 @@ static struct dbll_fxns ldr_fxns = { (dbll_get_sect_fxn) dbll_get_sect, (dbll_init_fxn) dbll_init, (dbll_load_fxn) dbll_load, - (dbll_load_sect_fxn) dbll_load_sect, (dbll_open_fxn) dbll_open, (dbll_read_sect_fxn) dbll_read_sect, - (dbll_set_attrs_fxn) dbll_set_attrs, (dbll_unload_fxn) dbll_unload, - (dbll_unload_sect_fxn) dbll_unload_sect, }; static u32 refs; /* module reference count */ -- cgit v0.10.2 From 5db9e2bf44ec0dcf36e513499c77a294a9dc2774 Mon Sep 17 00:00:00 2001 From: Armando Uribe Date: Fri, 17 Dec 2010 01:18:31 -0600 Subject: staging: tidspbridge: Remove unused structs Remove unused structs and its dependencies, like references in other structs or as arguments of certain functions. Signed-off-by: Armando Uribe Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h b/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h index c3f04f8..0589a0a 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h @@ -58,10 +58,4 @@ struct cfg_hostres { void __iomem *dw_dmmu_base; }; -struct cfg_dspmemdesc { - u32 mem_type; /* Type of memory. */ - u32 ul_min; /* Minimum amount of memory of this type. */ - u32 ul_max; /* Maximum amount of memory of this type. */ -}; - #endif /* CFGDEFS_ */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/cod.h b/drivers/staging/tidspbridge/include/dspbridge/cod.h index 5efea91..53bd4bb 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/cod.h +++ b/drivers/staging/tidspbridge/include/dspbridge/cod.h @@ -37,11 +37,6 @@ struct cod_manager; /* COD library handle */ struct cod_libraryobj; -/* COD attributes */ -struct cod_attrs { - u32 ul_reserved; -}; - /* * Function prototypes for writing memory to a DSP system, allocating * and freeing DSP memory. @@ -76,8 +71,6 @@ extern void cod_close(struct cod_libraryobj *lib); * Parameters: * manager: created manager object * str_zl_file: ZL DLL filename, of length < COD_MAXPATHLENGTH. - * attrs: attributes to be used by this object. A NULL value - * will cause default attrs to be used. * Returns: * 0: Success. * -ESPIPE: ZL_Create failed. @@ -89,8 +82,7 @@ extern void cod_close(struct cod_libraryobj *lib); * Ensures: */ extern int cod_create(struct cod_manager **mgr, - char *str_zl_file, - const struct cod_attrs *attrs); + char *str_zl_file); /* * ======== cod_delete ======== diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbldefs.h b/drivers/staging/tidspbridge/include/dspbridge/dbldefs.h index 9973098..5cf9dad 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dbldefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dbldefs.h @@ -25,26 +25,6 @@ typedef s32 dbl_flags; /* - * ======== dbl_sect_info ======== - * For collecting info on overlay sections - */ -struct dbl_sect_info { - const char *name; /* name of section */ - u32 sect_run_addr; /* run address of section */ - u32 sect_load_addr; /* load address of section */ - u32 size; /* size of section (target MAUs) */ - dbl_flags type; /* Code, data, or BSS */ -}; - -/* - * ======== dbl_symbol ======== - * (Needed for dynamic load library) - */ -struct dbl_symbol { - u32 value; -}; - -/* * ======== dbl_alloc_fxn ======== * Allocate memory function. Allocate or reserve (if reserved == TRUE) * "size" bytes of memory from segment "space" and return the address in @@ -98,33 +78,4 @@ typedef bool(*dbl_sym_lookup) (void *handle, void *parg, void *rmm_handle, typedef s32(*dbl_write_fxn) (void *hdl, u32 dsp_address, void *buf, u32 n, s32 mtype); -/* - * ======== dbl_attrs ======== - */ -struct dbl_attrs { - dbl_alloc_fxn alloc; - dbl_free_fxn free; - void *rmm_handle; /* Handle to pass to alloc, free functions */ - dbl_write_fxn write; - void *input_params; /* Handle to pass to write, cinit function */ - - dbl_log_write_fxn log_write; - void *log_write_handle; - - /* Symbol matching function and handle to pass to it */ - dbl_sym_lookup sym_lookup; - void *sym_handle; - void *sym_arg; - - /* - * These file manipulation functions should be compatible with the - * "C" run time library functions of the same name. - */ - s32(*fread) (void *, size_t, size_t, void *); - s32(*fseek) (void *, long, int); - s32(*ftell) (void *); - s32(*fclose) (void *); - void *(*fopen) (const char *, const char *); -}; - #endif /* DBLDEFS_ */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/drv.h b/drivers/staging/tidspbridge/include/dspbridge/drv.h index adb28ec..26972ad 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/drv.h +++ b/drivers/staging/tidspbridge/include/dspbridge/drv.h @@ -96,17 +96,6 @@ struct dmm_rsv_object { u32 dsp_reserved_addr; }; -/* New structure (member of process context) abstracts DMM resource info */ -struct dspheap_res_object { - s32 heap_allocated; /* DMM status */ - u32 ul_mpu_addr; - u32 ul_dsp_addr; - u32 ul_dsp_res_addr; - u32 heap_size; - void *hprocessor; - struct dspheap_res_object *next; -}; - /* New structure (member of process context) abstracts stream resource info */ struct strm_res_object { s32 stream_allocated; /* Stream status */ @@ -151,9 +140,6 @@ struct process_context { struct list_head dmm_rsv_list; spinlock_t dmm_rsv_lock; - /* DSP Heap resources */ - struct dspheap_res_object *pdspheap_list; - /* Stream resources */ struct idr *stream_id; }; diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h b/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h index 8da5bd8..8ad9ace 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h @@ -120,10 +120,6 @@ union trapped_args { struct { void *hprocessor; - } args_proc_start; - - struct { - void *hprocessor; u32 ul_size; void *__user *pp_rsv_addr; } args_proc_rsvmem; @@ -165,10 +161,6 @@ union trapped_args { struct { void *hprocessor; - } args_proc_stop; - - struct { - void *hprocessor; void *pmpu_addr; u32 ul_size; } args_proc_invalidatememory; diff --git a/drivers/staging/tidspbridge/include/dspbridge/ldr.h b/drivers/staging/tidspbridge/include/dspbridge/ldr.h deleted file mode 100644 index 6a0269c..0000000 --- a/drivers/staging/tidspbridge/include/dspbridge/ldr.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * ldr.h - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * Provide module loading services and symbol export services. - * - * Notes: - * This service is meant to be used by modules of the DSP/BIOS Bridge - * driver. - * - * Copyright (C) 2005-2006 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef LDR_ -#define LDR_ - -/* Loader objects: */ -struct ldr_module; - -#endif /* LDR_ */ diff --git a/drivers/staging/tidspbridge/pmgr/cod.c b/drivers/staging/tidspbridge/pmgr/cod.c index db29a19..17ea57d 100644 --- a/drivers/staging/tidspbridge/pmgr/cod.c +++ b/drivers/staging/tidspbridge/pmgr/cod.c @@ -33,9 +33,6 @@ /* ----------------------------------- Trace & Debug */ #include -/* ----------------------------------- OS Adaptation Layer */ -#include - /* ----------------------------------- Platform Manager */ /* Include appropriate loader header file */ #include @@ -51,7 +48,6 @@ struct cod_manager { struct dbll_library_obj *base_lib; bool loaded; /* Base library loaded? */ u32 ul_entry; - struct ldr_module *dll_obj; struct dbll_fxns fxns; struct dbll_attrs attrs; char sz_zl_file[COD_MAXPATHLENGTH]; @@ -206,8 +202,7 @@ void cod_close(struct cod_libraryobj *lib) * dynamically loaded object files. * */ -int cod_create(struct cod_manager **mgr, char *str_zl_file, - const struct cod_attrs *attrs) +int cod_create(struct cod_manager **mgr, char *str_zl_file) { struct cod_manager *mgr_new; struct dbll_attrs zl_attrs; @@ -219,10 +214,6 @@ int cod_create(struct cod_manager **mgr, char *str_zl_file, /* assume failure */ *mgr = NULL; - /* we don't support non-default attrs yet */ - if (attrs != NULL) - return -ENOSYS; - mgr_new = kzalloc(sizeof(struct cod_manager), GFP_KERNEL); if (mgr_new == NULL) return -ENOMEM; diff --git a/drivers/staging/tidspbridge/pmgr/dev.c b/drivers/staging/tidspbridge/pmgr/dev.c index b95cd20..0f10a50 100644 --- a/drivers/staging/tidspbridge/pmgr/dev.c +++ b/drivers/staging/tidspbridge/pmgr/dev.c @@ -27,9 +27,6 @@ /* ----------------------------------- Trace & Debug */ #include -/* ----------------------------------- OS Adaptation Layer */ -#include - /* ----------------------------------- Platform Manager */ #include #include @@ -75,7 +72,6 @@ struct dev_object { struct io_mgr *hio_mgr; /* IO manager (CHNL, msg_ctrl) */ struct cmm_object *hcmm_mgr; /* SM memory manager. */ struct dmm_object *dmm_mgr; /* Dynamic memory manager. */ - struct ldr_module *module_obj; /* Bridge Module handle. */ u32 word_size; /* DSP word size: quick access. */ struct drv_object *hdrv_obj; /* Driver Object */ /* List of Processors attached to this device */ @@ -139,7 +135,6 @@ int dev_create_device(struct dev_object **device_obj, struct cfg_devnode *dev_node_obj) { struct cfg_hostres *host_res; - struct ldr_module *module_obj = NULL; struct bridge_drv_interface *drv_fxns = NULL; struct dev_object *dev_obj = NULL; struct chnl_mgrattrs mgr_attrs; @@ -179,7 +174,6 @@ int dev_create_device(struct dev_object **device_obj, if (dev_obj) { /* Fill out the rest of the Dev Object structure: */ dev_obj->dev_node_obj = dev_node_obj; - dev_obj->module_obj = module_obj; dev_obj->cod_mgr = NULL; dev_obj->hchnl_mgr = NULL; dev_obj->hdeh_mgr = NULL; @@ -953,7 +947,7 @@ static int init_cod_mgr(struct dev_object *dev_obj) DBC_REQUIRE(refs > 0); DBC_REQUIRE(!dev_obj || (dev_obj->cod_mgr == NULL)); - status = cod_create(&dev_obj->cod_mgr, sz_dummy_file, NULL); + status = cod_create(&dev_obj->cod_mgr, sz_dummy_file); return status; } diff --git a/drivers/staging/tidspbridge/rmgr/dbdcd.c b/drivers/staging/tidspbridge/rmgr/dbdcd.c index b76f26c..9e12a2c 100644 --- a/drivers/staging/tidspbridge/rmgr/dbdcd.c +++ b/drivers/staging/tidspbridge/rmgr/dbdcd.c @@ -134,7 +134,7 @@ int dcd_create_manager(char *sz_zl_dll_name, DBC_REQUIRE(refs >= 0); DBC_REQUIRE(dcd_mgr); - status = cod_create(&cod_mgr, sz_zl_dll_name, NULL); + status = cod_create(&cod_mgr, sz_zl_dll_name); if (status) goto func_end; -- cgit v0.10.2 From 77927240749e7248fd637c5dadb6893f6b0381ab Mon Sep 17 00:00:00 2001 From: Armando Uribe Date: Fri, 17 Dec 2010 01:18:32 -0600 Subject: staging: tidspbridge: Remove unused typedefs Unsed typedefs are removed, because of there are not used or because previous clean ups. Signed-off-by: Armando Uribe Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbldefs.h b/drivers/staging/tidspbridge/include/dspbridge/dbldefs.h deleted file mode 100644 index 5cf9dad..0000000 --- a/drivers/staging/tidspbridge/include/dspbridge/dbldefs.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * dbldefs.h - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * Copyright (C) 2005-2006 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef DBLDEFS_ -#define DBLDEFS_ - - -/* - * ======== dbl_flags ======== - * Specifies whether to load code, data, or symbols - */ -typedef s32 dbl_flags; - -/* - * ======== dbl_alloc_fxn ======== - * Allocate memory function. Allocate or reserve (if reserved == TRUE) - * "size" bytes of memory from segment "space" and return the address in - * *dsp_address (or starting at *dsp_address if reserve == TRUE). Returns 0 on - * success, or an error code on failure. - */ -typedef s32(*dbl_alloc_fxn) (void *hdl, s32 space, u32 size, u32 align, - u32 *dsp_address, s32 seg_id, s32 req, - bool reserved); - -/* - * ======== dbl_free_fxn ======== - * Free memory function. Free, or unreserve (if reserved == TRUE) "size" - * bytes of memory from segment "space" - */ -typedef bool(*dbl_free_fxn) (void *hdl, u32 addr, s32 space, u32 size, - bool reserved); - -/* - * ======== dbl_log_write_fxn ======== - * Function to call when writing data from a section, to log the info. - * Can be NULL if no logging is required. - */ -typedef int(*dbl_log_write_fxn) (void *handle, - struct dbl_sect_info *sect, u32 addr, - u32 bytes); - -/* - * ======== dbl_sym_lookup ======== - * Symbol lookup function - Find the symbol name and return its value. - * - * Parameters: - * handle - Opaque handle - * parg - Opaque argument. - * name - Name of symbol to lookup. - * sym - Location to store address of symbol structure. - * - * Returns: - * TRUE: Success (symbol was found). - * FALSE: Failed to find symbol. - */ -typedef bool(*dbl_sym_lookup) (void *handle, void *parg, void *rmm_handle, - const char *name, struct dbl_symbol ** sym); - -/* - * ======== dbl_write_fxn ======== - * Write memory function. Write "n" HOST bytes of memory to segment "mtype" - * starting at address "dsp_address" from the buffer "buf". The buffer is - * formatted as an array of words appropriate for the DSP. - */ -typedef s32(*dbl_write_fxn) (void *hdl, u32 dsp_address, void *buf, - u32 n, s32 mtype); - -#endif /* DBLDEFS_ */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/dblldefs.h b/drivers/staging/tidspbridge/include/dspbridge/dblldefs.h index 81821e5..30e0aa0 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dblldefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dblldefs.h @@ -348,29 +348,6 @@ typedef bool(*dbll_init_fxn) (void); typedef int(*dbll_load_fxn) (struct dbll_library_obj *lib, dbll_flags flags, struct dbll_attrs *attrs, u32 *entry); - -/* - * ======== dbll_load_sect ======== - * Load a named section from an library (for overlay support). - * Parameters: - * lib - Handle returned from dbll_open(). - * sec_name - Name of section to load. - * attrs - Contains write function and handle to pass to it. - * Returns: - * 0: Success. - * -ENXIO: Section not found. - * -ENOSYS: Function not implemented. - * Requires: - * Valid lib. - * sec_name != NULL. - * attrs != NULL. - * attrs->write != NULL. - * Ensures: - */ -typedef int(*dbll_load_sect_fxn) (struct dbll_library_obj *lib, - char *sz_sect_name, - struct dbll_attrs *attrs); - /* * ======== dbll_open ======== * dbll_open() returns a library handle that can be used to load/unload @@ -421,23 +398,6 @@ typedef int(*dbll_open_fxn) (struct dbll_tar_obj *target, char *file, typedef int(*dbll_read_sect_fxn) (struct dbll_library_obj *lib, char *name, char *content, u32 cont_size); - -/* - * ======== dbll_set_attrs ======== - * Set the attributes of the target. - * Parameters: - * target - Handle returned from dbll_create(). - * pattrs - New attributes. - * Returns: - * Requires: - * DBL initialized. - * Valid target. - * pattrs != NULL. - * Ensures: - */ -typedef void (*dbll_set_attrs_fxn) (struct dbll_tar_obj *target, - struct dbll_attrs *attrs); - /* * ======== dbll_unload ======== * Unload library loaded with dbll_load(). @@ -452,28 +412,6 @@ typedef void (*dbll_set_attrs_fxn) (struct dbll_tar_obj *target, */ typedef void (*dbll_unload_fxn) (struct dbll_library_obj *library, struct dbll_attrs *attrs); - -/* - * ======== dbll_unload_sect ======== - * Unload a named section from an library (for overlay support). - * Parameters: - * lib - Handle returned from dbll_open(). - * sec_name - Name of section to load. - * attrs - Contains free() function and handle to pass to it. - * Returns: - * 0: Success. - * -ENXIO: Named section not found. - * -ENOSYS - * Requires: - * DBL initialized. - * Valid lib. - * sec_name != NULL. - * Ensures: - */ -typedef int(*dbll_unload_sect_fxn) (struct dbll_library_obj *lib, - char *sz_sect_name, - struct dbll_attrs *attrs); - struct dbll_fxns { dbll_close_fxn close_fxn; dbll_create_fxn create_fxn; -- cgit v0.10.2 From 157bc26dacc2f30ee64fc7eea2babbdc65052803 Mon Sep 17 00:00:00 2001 From: Armando Uribe Date: Fri, 17 Dec 2010 01:18:33 -0600 Subject: staging: tidspbridge: Remove trivial header files Remove the header files that contains few declarations and can be merged onto more generic headers. Signed-off-by: Armando Uribe Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c index fb9026e..8e2b50f 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c +++ b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c @@ -29,13 +29,13 @@ /* ----------------------------------- Platform Manager */ #include #include -#include +#include /* ------------------------------------ Hardware Abstraction Layer */ #include #include -#include +#include /* ----------------------------------- Bridge Driver */ #include diff --git a/drivers/staging/tidspbridge/include/dspbridge/dehdefs.h b/drivers/staging/tidspbridge/include/dspbridge/dehdefs.h deleted file mode 100644 index 5341471..0000000 --- a/drivers/staging/tidspbridge/include/dspbridge/dehdefs.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * dehdefs.h - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * Definition for Bridge driver module DEH. - * - * Copyright (C) 2005-2006 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef DEHDEFS_ -#define DEHDEFS_ - -#include /* shared mailbox codes */ - -/* DEH object manager */ -struct deh_mgr; - -/* Magic code used to determine if DSP signaled exception. */ -#define DEH_BASE MBX_DEH_BASE -#define DEH_LIMIT MBX_DEH_LIMIT - -#endif /* _DEHDEFS_H */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/dev.h b/drivers/staging/tidspbridge/include/dspbridge/dev.h index 4d4196b..37d1fff 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dev.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dev.h @@ -23,9 +23,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/drivers/staging/tidspbridge/include/dspbridge/disp.h b/drivers/staging/tidspbridge/include/dspbridge/disp.h index 82bf721..41738c5 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/disp.h +++ b/drivers/staging/tidspbridge/include/dspbridge/disp.h @@ -22,7 +22,20 @@ #include #include #include -#include + +struct disp_object; + +/* Node Dispatcher attributes */ +struct disp_attr { + u32 ul_chnl_offset; /* Offset of channel ids reserved for RMS */ + /* Size of buffer for sending data to RMS */ + u32 ul_chnl_buf_size; + int proc_family; /* eg, 5000 */ + int proc_type; /* eg, 5510 */ + void *reserved1; /* Reserved for future use. */ + u32 reserved2; /* Reserved for future use. */ +}; + /* * ======== disp_create ======== diff --git a/drivers/staging/tidspbridge/include/dspbridge/dispdefs.h b/drivers/staging/tidspbridge/include/dspbridge/dispdefs.h deleted file mode 100644 index 946551a..0000000 --- a/drivers/staging/tidspbridge/include/dspbridge/dispdefs.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * dispdefs.h - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * Global DISP constants and types, shared by PROCESSOR, NODE, and DISP. - * - * Copyright (C) 2005-2006 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef DISPDEFS_ -#define DISPDEFS_ - -struct disp_object; - -/* Node Dispatcher attributes */ -struct disp_attr { - u32 ul_chnl_offset; /* Offset of channel ids reserved for RMS */ - /* Size of buffer for sending data to RMS */ - u32 ul_chnl_buf_size; - int proc_family; /* eg, 5000 */ - int proc_type; /* eg, 5510 */ - void *reserved1; /* Reserved for future use. */ - u32 reserved2; /* Reserved for future use. */ -}; - -#endif /* DISPDEFS_ */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/drv.h b/drivers/staging/tidspbridge/include/dspbridge/drv.h index 26972ad..bcb2817 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/drv.h +++ b/drivers/staging/tidspbridge/include/dspbridge/drv.h @@ -23,9 +23,11 @@ #include -#include #include +/* Bridge Driver Object */ +struct drv_object; + /* Provide the DSP Internal memory windows that can be accessed from L3 address * space */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/drvdefs.h b/drivers/staging/tidspbridge/include/dspbridge/drvdefs.h deleted file mode 100644 index 2920917..0000000 --- a/drivers/staging/tidspbridge/include/dspbridge/drvdefs.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * drvdefs.h - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * Definition of common struct between dspdefs.h and drv.h. - * - * Copyright (C) 2005-2006 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef DRVDEFS_ -#define DRVDEFS_ - -/* Bridge Driver Object */ -struct drv_object; - -#endif /* DRVDEFS_ */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h b/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h index 2acbbb3..4eaeb21 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h @@ -32,9 +32,9 @@ #include #include #include -#include +#include #include -#include +#include #include /* Handle to Bridge driver's private device context. */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspio.h b/drivers/staging/tidspbridge/include/dspbridge/dspio.h index 5c666b8..66b64fa 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspio.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspio.h @@ -24,7 +24,8 @@ #define DSPIO_ #include -#include +#include + extern int bridge_io_create(struct io_mgr **io_man, struct dev_object *hdev_obj, diff --git a/drivers/staging/tidspbridge/include/dspbridge/io.h b/drivers/staging/tidspbridge/include/dspbridge/io.h index da4683c..9615980 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/io.h +++ b/drivers/staging/tidspbridge/include/dspbridge/io.h @@ -22,7 +22,18 @@ #include #include -#include +/* IO Objects: */ +struct io_mgr; + +/* IO manager attributes: */ +struct io_attrs { + u8 birq; /* Channel's I/O IRQ number. */ + bool irq_shared; /* TRUE if the IRQ is shareable. */ + u32 word_size; /* DSP Word size. */ + u32 shm_base; /* Physical base address of shared memory. */ + u32 usm_length; /* Size (in bytes) of shared memory. */ +}; + /* * ======== io_create ======== diff --git a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h index 6a4c441..a054dad 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h @@ -23,7 +23,12 @@ #include #include -#include +#include +#include /* shared mailbox codes */ + +/* Magic code used to determine if DSP signaled exception. */ +#define DEH_BASE MBX_DEH_BASE +#define DEH_LIMIT MBX_DEH_LIMIT #define IO_INPUT 0 #define IO_OUTPUT 1 diff --git a/drivers/staging/tidspbridge/include/dspbridge/iodefs.h b/drivers/staging/tidspbridge/include/dspbridge/iodefs.h deleted file mode 100644 index 31cbc9a..0000000 --- a/drivers/staging/tidspbridge/include/dspbridge/iodefs.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * iodefs.h - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * System-wide channel objects and constants. - * - * Copyright (C) 2005-2006 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef IODEFS_ -#define IODEFS_ - -/* IO Objects: */ -struct io_mgr; - -/* IO manager attributes: */ -struct io_attrs { - u8 birq; /* Channel's I/O IRQ number. */ - bool irq_shared; /* TRUE if the IRQ is shareable. */ - u32 word_size; /* DSP Word size. */ - u32 shm_base; /* Physical base address of shared memory. */ - u32 usm_length; /* Size (in bytes) of shared memory. */ -}; - -#endif /* IODEFS_ */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/node.h b/drivers/staging/tidspbridge/include/dspbridge/node.h index 4c5558c..63739c8 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/node.h +++ b/drivers/staging/tidspbridge/include/dspbridge/node.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/staging/tidspbridge/include/dspbridge/pwr.h b/drivers/staging/tidspbridge/include/dspbridge/pwr.h index a6dc783..5e3ab21 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/pwr.h +++ b/drivers/staging/tidspbridge/include/dspbridge/pwr.h @@ -18,7 +18,13 @@ #define PWR_ #include -#include +#include + +/* valid sleep command codes that can be sent by GPP via mailbox: */ +#define PWR_DEEPSLEEP MBX_PM_DSPIDLE +#define PWR_EMERGENCYDEEPSLEEP MBX_PM_EMERGENCYSLEEP +#define PWR_WAKEUP MBX_PM_DSPWAKEUP + /* * ======== pwr_sleep_dsp ======== diff --git a/drivers/staging/tidspbridge/include/dspbridge/pwr_sh.h b/drivers/staging/tidspbridge/include/dspbridge/pwr_sh.h deleted file mode 100644 index c78a1b1..0000000 --- a/drivers/staging/tidspbridge/include/dspbridge/pwr_sh.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * pwr_sh.h - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * Power Manager shared definitions (used on both GPP and DSP sides). - * - * Copyright (C) 2008 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef PWR_SH_ -#define PWR_SH_ - -#include - -/* valid sleep command codes that can be sent by GPP via mailbox: */ -#define PWR_DEEPSLEEP MBX_PM_DSPIDLE -#define PWR_EMERGENCYDEEPSLEEP MBX_PM_EMERGENCYSLEEP -#define PWR_WAKEUP MBX_PM_DSPWAKEUP - -#endif /* PWR_SH_ */ diff --git a/drivers/staging/tidspbridge/pmgr/io.c b/drivers/staging/tidspbridge/pmgr/io.c index 20cbb9f..0e8843f 100644 --- a/drivers/staging/tidspbridge/pmgr/io.c +++ b/drivers/staging/tidspbridge/pmgr/io.c @@ -31,7 +31,6 @@ /* ----------------------------------- This */ #include -#include #include /* ----------------------------------- Globals */ diff --git a/drivers/staging/tidspbridge/rmgr/drv_interface.c b/drivers/staging/tidspbridge/rmgr/drv_interface.c index 324fcdf..c43c7e3 100644 --- a/drivers/staging/tidspbridge/rmgr/drv_interface.c +++ b/drivers/staging/tidspbridge/rmgr/drv_interface.c @@ -59,7 +59,6 @@ #include #include #include -#include #include #ifdef CONFIG_TIDSPBRIDGE_DVFS diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c index b196a7a..27af99d 100644 --- a/drivers/staging/tidspbridge/rmgr/node.c +++ b/drivers/staging/tidspbridge/rmgr/node.c @@ -64,7 +64,6 @@ #include #include -#include #include #include <_tiomap.h> -- cgit v0.10.2 From 92d0293038e49151367e38f751f327c8f2c066f6 Mon Sep 17 00:00:00 2001 From: "Ramos Falcon, Ernesto" Date: Mon, 20 Dec 2010 21:23:08 +0000 Subject: staging: tidspbridge: remove code referred by OPT_ZERO_COPY_LOADER Remove code referred by OPT_ZERO_COPY_LOADER since it is not used. Signed-off-by: Ernesto Ramos Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/dynload/cload.c b/drivers/staging/tidspbridge/dynload/cload.c index c85a5e8..d0cd445 100644 --- a/drivers/staging/tidspbridge/dynload/cload.c +++ b/drivers/staging/tidspbridge/dynload/cload.c @@ -1131,9 +1131,6 @@ static void dload_data(struct dload_state *dlthis) u16 curr_sect; struct doff_scnhdr_t *sptr = dlthis->sect_hdrs; struct ldr_section_info *lptr = dlthis->ldr_sections; -#ifdef OPT_ZERO_COPY_LOADER - bool zero_copy = false; -#endif u8 *dest; struct { @@ -1192,17 +1189,6 @@ static void dload_data(struct dload_state *dlthis) return; } dest = ibuf.bufr; -#ifdef OPT_ZERO_COPY_LOADER - zero_copy = false; - if (!dload_check_type(sptr, DLOAD_CINIT) { - dlthis->myio->writemem(dlthis->myio, - &dest, - lptr->load_addr + - image_offset, - lptr, 0); - zero_copy = (dest != ibuf.bufr); - } -#endif /* End of determination */ if (dlthis->strm->read_buffer(dlthis->strm, @@ -1266,33 +1252,27 @@ static void dload_data(struct dload_state *dlthis) &ibuf.ipacket); cinit_processed = true; } else { -#ifdef OPT_ZERO_COPY_LOADER - if (!zero_copy) { -#endif - /* FIXME */ - if (!dlthis->myio-> - writemem(dlthis-> - myio, - ibuf.bufr, - lptr-> - load_addr + - image_offset, - lptr, - BYTE_TO_HOST - (ibuf. - ipacket. - packet_size))) { - DL_ERROR - ("Write to " - FMT_UI32 - " failed", - lptr-> - load_addr + - image_offset); - } -#ifdef OPT_ZERO_COPY_LOADER + /* FIXME */ + if (!dlthis->myio-> + writemem(dlthis-> + myio, + ibuf.bufr, + lptr-> + load_addr + + image_offset, + lptr, + BYTE_TO_HOST + (ibuf. + ipacket. + packet_size))) { + DL_ERROR + ("Write to " + FMT_UI32 + " failed", + lptr-> + load_addr + + image_offset); } -#endif } } image_offset += -- cgit v0.10.2 From b4da7fc381c51d42c231f97de912b89dbabe8928 Mon Sep 17 00:00:00 2001 From: Rene Sapiens Date: Tue, 18 Jan 2011 03:19:03 +0000 Subject: staging: tidspbridge: set1 remove hungarian from structs hungarian notation will be removed from the elements inside structures, the next varibles will be renamed: dw_api_reg_base api_reg_base dw_brd_state brd_state dw_chnl_buf_size chnl_buf_size dw_chnl_offset chnl_offset dw_cmd cmd dw_core_pm_base core_pm_base dw_dsp_base dsp_base dw_dsp_base_va dsp_base_va dw_dsp_bufs dsp_bufs dw_dsp_buf_size dsp_buf_size dw_dsp_clk_m2_base dsp_clk_m2_base dw_dsp_ext_base_addr dsp_ext_base_addr dw_dsp_phys_addr_offset dsp_phys_addr_offset dw_dsp_start_add dsp_start_add dw_err_mask err_mask dw_gpp_base_pa gpp_base_pa dw_api_clk_base api_clk_base dw_api_reg_base api_reg_base dw_arg arg dw_arg1 arg1 dw_arg2 arg2 dw_chnl_buf_size chnl_buf_size Signed-off-by: Rene Sapiens Signed-off-by: Armando Uribe Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/core/_tiomap.h b/drivers/staging/tidspbridge/core/_tiomap.h index 1159a50..80bc4755 100644 --- a/drivers/staging/tidspbridge/core/_tiomap.h +++ b/drivers/staging/tidspbridge/core/_tiomap.h @@ -320,22 +320,22 @@ static const struct bpwr_clk_t bpwr_clks[] = { /* This Bridge driver's device context: */ struct bridge_dev_context { struct dev_object *hdev_obj; /* Handle to Bridge device object. */ - u32 dw_dsp_base_addr; /* Arm's API to DSP virt base addr */ + u32 dsp_base_addr; /* Arm's API to DSP virt base addr */ /* * DSP External memory prog address as seen virtually by the OS on * the host side. */ - u32 dw_dsp_ext_base_addr; /* See the comment above */ - u32 dw_api_reg_base; /* API mem map'd registers */ + u32 dsp_ext_base_addr; /* See the comment above */ + u32 api_reg_base; /* API mem map'd registers */ void __iomem *dw_dsp_mmu_base; /* DSP MMU Mapped registers */ - u32 dw_api_clk_base; /* CLK Registers */ - u32 dw_dsp_clk_m2_base; /* DSP Clock Module m2 */ + u32 api_clk_base; /* CLK Registers */ + u32 dsp_clk_m2_base; /* DSP Clock Module m2 */ u32 dw_public_rhea; /* Pub Rhea */ u32 dw_int_addr; /* MB INTR reg */ u32 dw_tc_endianism; /* TC Endianism register */ u32 dw_test_base; /* DSP MMU Mapped registers */ u32 dw_self_loop; /* Pointer to the selfloop */ - u32 dw_dsp_start_add; /* API Boot vector */ + u32 dsp_start_add; /* API Boot vector */ u32 dw_internal_size; /* Internal memory size */ struct omap_mbox *mbox; /* Mail box handle */ @@ -348,7 +348,7 @@ struct bridge_dev_context { */ /* DMMU TLB entries */ struct bridge_ioctl_extproc atlb_entry[BRDIOCTL_NUMOFMMUTLB]; - u32 dw_brd_state; /* Last known board state. */ + u32 brd_state; /* Last known board state. */ /* TC Settings */ bool tc_word_swap_on; /* Traffic Controller Word Swap */ diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c b/drivers/staging/tidspbridge/core/chnl_sm.c index 2d06bb0..a522627 100644 --- a/drivers/staging/tidspbridge/core/chnl_sm.c +++ b/drivers/staging/tidspbridge/core/chnl_sm.c @@ -196,7 +196,7 @@ func_cont: chnl_packet_obj->byte_size = byte_size; chnl_packet_obj->buf_size = buf_size; /* Only valid for output channel */ - chnl_packet_obj->dw_arg = dw_arg; + chnl_packet_obj->arg = dw_arg; chnl_packet_obj->status = (is_eos ? CHNL_IOCSTATEOS : CHNL_IOCSTATCOMPLETE); list_add_tail(&chnl_packet_obj->link, &pchnl->pio_requests); @@ -607,7 +607,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout, ioc.pbuf = chnl_packet_obj->host_user_buf; ioc.byte_size = chnl_packet_obj->byte_size; ioc.buf_size = chnl_packet_obj->buf_size; - ioc.dw_arg = chnl_packet_obj->dw_arg; + ioc.arg = chnl_packet_obj->arg; ioc.status |= chnl_packet_obj->status; /* Place the used chirp on the free list: */ list_add_tail(&chnl_packet_obj->link, @@ -615,7 +615,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout, } else { ioc.pbuf = NULL; ioc.byte_size = 0; - ioc.dw_arg = 0; + ioc.arg = 0; ioc.buf_size = 0; } /* Ensure invariant: If any IOC's are queued for this channel... */ diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index d4b9e14..913c768 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c @@ -1113,7 +1113,7 @@ static void input_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, pio_mgr->input, bytes); pchnl->bytes_moved += bytes; chnl_packet_obj->byte_size = bytes; - chnl_packet_obj->dw_arg = dw_arg; + chnl_packet_obj->arg = dw_arg; chnl_packet_obj->status = CHNL_IOCSTATCOMPLETE; if (bytes == 0) { @@ -1200,14 +1200,14 @@ static void input_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr) msg_input = pio_mgr->msg_input; for (i = 0; i < num_msgs; i++) { /* Read the next message */ - addr = (u32) &(((struct msg_dspmsg *)msg_input)->msg.dw_cmd); - msg.msg.dw_cmd = + addr = (u32) &(((struct msg_dspmsg *)msg_input)->msg.cmd); + msg.msg.cmd = read_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr); - addr = (u32) &(((struct msg_dspmsg *)msg_input)->msg.dw_arg1); - msg.msg.dw_arg1 = + addr = (u32) &(((struct msg_dspmsg *)msg_input)->msg.arg1); + msg.msg.arg1 = read_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr); - addr = (u32) &(((struct msg_dspmsg *)msg_input)->msg.dw_arg2); - msg.msg.dw_arg2 = + addr = (u32) &(((struct msg_dspmsg *)msg_input)->msg.arg2); + msg.msg.arg2 = read_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr); addr = (u32) &(((struct msg_dspmsg *)msg_input)->msgq_id); msg.msgq_id = @@ -1215,9 +1215,9 @@ static void input_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr) msg_input += sizeof(struct msg_dspmsg); /* Determine which queue to put the message in */ - dev_dbg(bridge, "input msg: dw_cmd=0x%x dw_arg1=0x%x " - "dw_arg2=0x%x msgq_id=0x%x\n", msg.msg.dw_cmd, - msg.msg.dw_arg1, msg.msg.dw_arg2, msg.msgq_id); + dev_dbg(bridge, "input msg: cmd=0x%x arg1=0x%x " + "arg2=0x%x msgq_id=0x%x\n", msg.msg.cmd, + msg.msg.arg1, msg.msg.arg2, msg.msgq_id); /* * Interrupt may occur before shared memory and message * input locations have been set up. If all nodes were @@ -1228,14 +1228,14 @@ static void input_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr) if (msg.msgq_id != msg_queue_obj->msgq_id) continue; /* Found it */ - if (msg.msg.dw_cmd == RMS_EXITACK) { + if (msg.msg.cmd == RMS_EXITACK) { /* * Call the node exit notification. * The exit message does not get * queued. */ (*hmsg_mgr->on_exit)(msg_queue_obj->arg, - msg.msg.dw_arg1); + msg.msg.arg1); break; } /* @@ -1367,7 +1367,7 @@ static void output_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, chnl_packet_obj->byte_size); pchnl->bytes_moved += chnl_packet_obj->byte_size; /* Write all 32 bits of arg */ - sm->arg = chnl_packet_obj->dw_arg; + sm->arg = chnl_packet_obj->arg; #if _CHNL_WORDSIZE == 2 /* Access can be different SM access word size (e.g. 16/32 bit words) */ sm->output_id = (u16) chnl_id; @@ -1430,16 +1430,16 @@ static void output_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr) addr = (u32) &msg_output->msgq_id; write_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr, val); - val = (pmsg->msg_data).msg.dw_cmd; - addr = (u32) &msg_output->msg.dw_cmd; + val = (pmsg->msg_data).msg.cmd; + addr = (u32) &msg_output->msg.cmd; write_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr, val); - val = (pmsg->msg_data).msg.dw_arg1; - addr = (u32) &msg_output->msg.dw_arg1; + val = (pmsg->msg_data).msg.arg1; + addr = (u32) &msg_output->msg.arg1; write_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr, val); - val = (pmsg->msg_data).msg.dw_arg2; - addr = (u32) &msg_output->msg.dw_arg2; + val = (pmsg->msg_data).msg.arg2; + addr = (u32) &msg_output->msg.arg2; write_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr, val); msg_output++; diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c index ec713ed..ce0556d 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430.c +++ b/drivers/staging/tidspbridge/core/tiomap3430.c @@ -229,8 +229,8 @@ static struct notifier_block dsp_mbox_notifier = { static inline void flush_all(struct bridge_dev_context *dev_context) { - if (dev_context->dw_brd_state == BRD_DSP_HIBERNATION || - dev_context->dw_brd_state == BRD_HIBERNATION) + if (dev_context->brd_state == BRD_DSP_HIBERNATION || + dev_context->brd_state == BRD_HIBERNATION) wake_dsp(dev_context, NULL); hw_mmu_tlb_flush_all(dev_context->dw_dsp_mmu_base); @@ -306,7 +306,7 @@ static int bridge_brd_monitor(struct bridge_dev_context *dev_ctxt) dsp_clk_enable(DSP_CLK_IVA2); /* set the device state to IDLE */ - dev_context->dw_brd_state = BRD_IDLE; + dev_context->brd_state = BRD_IDLE; return 0; } @@ -323,16 +323,16 @@ static int bridge_brd_read(struct bridge_dev_context *dev_ctxt, int status = 0; struct bridge_dev_context *dev_context = dev_ctxt; u32 offset; - u32 dsp_base_addr = dev_ctxt->dw_dsp_base_addr; + u32 dsp_base_addr = dev_ctxt->dsp_base_addr; - if (dsp_addr < dev_context->dw_dsp_start_add) { + if (dsp_addr < dev_context->dsp_start_add) { status = -EPERM; return status; } /* change here to account for the 3 bands of the DSP internal memory */ - if ((dsp_addr - dev_context->dw_dsp_start_add) < + if ((dsp_addr - dev_context->dsp_start_add) < dev_context->dw_internal_size) { - offset = dsp_addr - dev_context->dw_dsp_start_add; + offset = dsp_addr - dev_context->dsp_start_add; } else { status = read_ext_dsp_data(dev_context, host_buff, dsp_addr, ul_num_bytes, mem_type); @@ -354,7 +354,7 @@ static int bridge_brd_set_state(struct bridge_dev_context *dev_ctxt, int status = 0; struct bridge_dev_context *dev_context = dev_ctxt; - dev_context->dw_brd_state = brd_state; + dev_context->brd_state = brd_state; return status; } @@ -616,10 +616,10 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, __raw_writel(0XCAFECAFE, dw_sync_addr); /* update board state */ - dev_context->dw_brd_state = BRD_RUNNING; + dev_context->brd_state = BRD_RUNNING; /* (void)chnlsm_enable_interrupt(dev_context); */ } else { - dev_context->dw_brd_state = BRD_UNKNOWN; + dev_context->brd_state = BRD_UNKNOWN; } } return status; @@ -642,7 +642,7 @@ static int bridge_brd_stop(struct bridge_dev_context *dev_ctxt) struct omap_dsp_platform_data *pdata = omap_dspbridge_dev->dev.platform_data; - if (dev_context->dw_brd_state == BRD_STOPPED) + if (dev_context->brd_state == BRD_STOPPED) return status; /* as per TRM, it is advised to first drive the IVA2 to 'Standby' mode, @@ -667,10 +667,10 @@ static int bridge_brd_stop(struct bridge_dev_context *dev_ctxt) udelay(10); /* Release the Ext Base virtual Address as the next DSP Program * may have a different load address */ - if (dev_context->dw_dsp_ext_base_addr) - dev_context->dw_dsp_ext_base_addr = 0; + if (dev_context->dsp_ext_base_addr) + dev_context->dsp_ext_base_addr = 0; - dev_context->dw_brd_state = BRD_STOPPED; /* update board state */ + dev_context->brd_state = BRD_STOPPED; /* update board state */ dsp_wdt_enable(false); @@ -706,7 +706,7 @@ static int bridge_brd_status(struct bridge_dev_context *dev_ctxt, int *board_state) { struct bridge_dev_context *dev_context = dev_ctxt; - *board_state = dev_context->dw_brd_state; + *board_state = dev_context->brd_state; return 0; } @@ -721,11 +721,11 @@ static int bridge_brd_write(struct bridge_dev_context *dev_ctxt, int status = 0; struct bridge_dev_context *dev_context = dev_ctxt; - if (dsp_addr < dev_context->dw_dsp_start_add) { + if (dsp_addr < dev_context->dsp_start_add) { status = -EPERM; return status; } - if ((dsp_addr - dev_context->dw_dsp_start_add) < + if ((dsp_addr - dev_context->dsp_start_add) < dev_context->dw_internal_size) { status = write_dsp_data(dev_ctxt, host_buff, dsp_addr, ul_num_bytes, mem_type); @@ -764,7 +764,7 @@ static int bridge_dev_create(struct bridge_dev_context goto func_end; } - dev_context->dw_dsp_start_add = (u32) OMAP_GEM_BASE; + dev_context->dsp_start_add = (u32) OMAP_GEM_BASE; dev_context->dw_self_loop = (u32) NULL; dev_context->dsp_per_clks = 0; dev_context->dw_internal_size = OMAP_DSP_SIZE; @@ -774,14 +774,14 @@ static int bridge_dev_create(struct bridge_dev_context dev_context->atlb_entry[entry_ndx].ul_gpp_pa = dev_context->atlb_entry[entry_ndx].ul_dsp_va = 0; } - dev_context->dw_dsp_base_addr = (u32) MEM_LINEAR_ADDRESS((void *) + dev_context->dsp_base_addr = (u32) MEM_LINEAR_ADDRESS((void *) (config_param-> dw_mem_base [3]), config_param-> dw_mem_length [3]); - if (!dev_context->dw_dsp_base_addr) + if (!dev_context->dsp_base_addr) status = -EPERM; pt_attrs = kzalloc(sizeof(struct pg_table_attrs), GFP_KERNEL); @@ -874,7 +874,7 @@ static int bridge_dev_create(struct bridge_dev_context if (!status) { dev_context->hdev_obj = hdev_obj; /* Store current board state. */ - dev_context->dw_brd_state = BRD_UNKNOWN; + dev_context->brd_state = BRD_UNKNOWN; dev_context->resources = resources; dsp_clk_enable(DSP_CLK_IVA2); bridge_brd_stop(dev_context); @@ -1032,8 +1032,8 @@ static int bridge_dev_destroy(struct bridge_dev_context *dev_ctxt) iounmap(host_res->dw_per_base); if (host_res->dw_per_pm_base) iounmap((void *)host_res->dw_per_pm_base); - if (host_res->dw_core_pm_base) - iounmap((void *)host_res->dw_core_pm_base); + if (host_res->core_pm_base) + iounmap((void *)host_res->core_pm_base); host_res->dw_mem_base[0] = (u32) NULL; host_res->dw_mem_base[2] = (u32) NULL; @@ -1070,7 +1070,7 @@ static int bridge_brd_mem_copy(struct bridge_dev_context *dev_ctxt, status = read_ext_dsp_data(dev_ctxt, host_buf, src_addr, copy_bytes, mem_type); if (!status) { - if (dest_addr < (dev_context->dw_dsp_start_add + + if (dest_addr < (dev_context->dsp_start_add + dev_context->dw_internal_size)) { /* Write to Internal memory */ status = write_dsp_data(dev_ctxt, host_buf, @@ -1104,7 +1104,7 @@ static int bridge_brd_mem_write(struct bridge_dev_context *dev_ctxt, while (ul_remain_bytes > 0 && !status) { ul_bytes = ul_remain_bytes > BUFFERSIZE ? BUFFERSIZE : ul_remain_bytes; - if (dsp_addr < (dev_context->dw_dsp_start_add + + if (dsp_addr < (dev_context->dsp_start_add + dev_context->dw_internal_size)) { status = write_dsp_data(dev_ctxt, host_buff, dsp_addr, diff --git a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c index 8e2b50f..fff27d4 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c +++ b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c @@ -118,7 +118,7 @@ int handle_hibernation_from_dsp(struct bridge_dev_context *dev_context) if (!status) { /* Update the Bridger Driver state */ - dev_context->dw_brd_state = BRD_DSP_HIBERNATION; + dev_context->brd_state = BRD_DSP_HIBERNATION; #ifdef CONFIG_TIDSPBRIDGE_DVFS status = dev_get_io_mgr(dev_context->hdev_obj, &hio_mgr); @@ -163,7 +163,7 @@ int sleep_dsp(struct bridge_dev_context *dev_context, u32 dw_cmd, if ((dw_cmd != PWR_DEEPSLEEP) && (dw_cmd != PWR_EMERGENCYDEEPSLEEP)) return -EINVAL; - switch (dev_context->dw_brd_state) { + switch (dev_context->brd_state) { case BRD_RUNNING: omap_mbox_save_ctx(dev_context->mbox); if (dsp_test_sleepstate == PWRDM_POWER_OFF) { @@ -223,9 +223,9 @@ int sleep_dsp(struct bridge_dev_context *dev_context, u32 dw_cmd, } else { /* Update the Bridger Driver state */ if (dsp_test_sleepstate == PWRDM_POWER_OFF) - dev_context->dw_brd_state = BRD_HIBERNATION; + dev_context->brd_state = BRD_HIBERNATION; else - dev_context->dw_brd_state = BRD_RETENTION; + dev_context->brd_state = BRD_RETENTION; /* Disable wdt on hibernation. */ dsp_wdt_enable(false); @@ -258,8 +258,8 @@ int wake_dsp(struct bridge_dev_context *dev_context, void *pargs) #ifdef CONFIG_PM /* Check the board state, if it is not 'SLEEP' then return */ - if (dev_context->dw_brd_state == BRD_RUNNING || - dev_context->dw_brd_state == BRD_STOPPED) { + if (dev_context->brd_state == BRD_RUNNING || + dev_context->brd_state == BRD_STOPPED) { /* The Device is in 'RET' or 'OFF' state and Bridge state is not * 'SLEEP', this means state inconsistency, so return */ return 0; @@ -269,7 +269,7 @@ int wake_dsp(struct bridge_dev_context *dev_context, void *pargs) sm_interrupt_dsp(dev_context, MBX_PM_DSPWAKEUP); /* Set the device state to RUNNIG */ - dev_context->dw_brd_state = BRD_RUNNING; + dev_context->brd_state = BRD_RUNNING; #endif /* CONFIG_PM */ return status; } @@ -351,12 +351,12 @@ int pre_scale_dsp(struct bridge_dev_context *dev_context, void *pargs) dev_dbg(bridge, "OPP: %s voltage_domain = %x, level = 0x%x\n", __func__, voltage_domain, level); - if ((dev_context->dw_brd_state == BRD_HIBERNATION) || - (dev_context->dw_brd_state == BRD_RETENTION) || - (dev_context->dw_brd_state == BRD_DSP_HIBERNATION)) { + if ((dev_context->brd_state == BRD_HIBERNATION) || + (dev_context->brd_state == BRD_RETENTION) || + (dev_context->brd_state == BRD_DSP_HIBERNATION)) { dev_dbg(bridge, "OPP: %s IVA in sleep. No message to DSP\n"); return 0; - } else if ((dev_context->dw_brd_state == BRD_RUNNING)) { + } else if ((dev_context->brd_state == BRD_RUNNING)) { /* Send a prenotificatio to DSP */ dev_dbg(bridge, "OPP: %s sent notification to DSP\n", __func__); sm_interrupt_dsp(dev_context, MBX_PM_SETPOINT_PRENOTIFY); @@ -390,14 +390,14 @@ int post_scale_dsp(struct bridge_dev_context *dev_context, level = *((u32 *) pargs + 1); dev_dbg(bridge, "OPP: %s voltage_domain = %x, level = 0x%x\n", __func__, voltage_domain, level); - if ((dev_context->dw_brd_state == BRD_HIBERNATION) || - (dev_context->dw_brd_state == BRD_RETENTION) || - (dev_context->dw_brd_state == BRD_DSP_HIBERNATION)) { + if ((dev_context->brd_state == BRD_HIBERNATION) || + (dev_context->brd_state == BRD_RETENTION) || + (dev_context->brd_state == BRD_DSP_HIBERNATION)) { /* Update the OPP value in shared memory */ io_sh_msetting(hio_mgr, SHM_CURROPP, &level); dev_dbg(bridge, "OPP: %s IVA in sleep. Wrote to shm\n", __func__); - } else if ((dev_context->dw_brd_state == BRD_RUNNING)) { + } else if ((dev_context->brd_state == BRD_RUNNING)) { /* Update the OPP value in shared memory */ io_sh_msetting(hio_mgr, SHM_CURROPP, &level); /* Send a post notification to DSP */ @@ -486,8 +486,8 @@ void dsp_clk_wakeup_event_ctrl(u32 clock_id, bool enable) writel(mpu_grpsel, resources->dw_per_pm_base + 0xA4); break; case BPWR_MCBSP1: - iva2_grpsel = readl(resources->dw_core_pm_base + 0xA8); - mpu_grpsel = readl(resources->dw_core_pm_base + 0xA4); + iva2_grpsel = readl(resources->core_pm_base + 0xA8); + mpu_grpsel = readl(resources->core_pm_base + 0xA4); if (enable) { iva2_grpsel |= OMAP3430_GRPSEL_MCBSP1_MASK; mpu_grpsel &= ~OMAP3430_GRPSEL_MCBSP1_MASK; @@ -495,8 +495,8 @@ void dsp_clk_wakeup_event_ctrl(u32 clock_id, bool enable) mpu_grpsel |= OMAP3430_GRPSEL_MCBSP1_MASK; iva2_grpsel &= ~OMAP3430_GRPSEL_MCBSP1_MASK; } - writel(iva2_grpsel, resources->dw_core_pm_base + 0xA8); - writel(mpu_grpsel, resources->dw_core_pm_base + 0xA4); + writel(iva2_grpsel, resources->core_pm_base + 0xA8); + writel(mpu_grpsel, resources->core_pm_base + 0xA4); break; case BPWR_MCBSP2: iva2_grpsel = readl(resources->dw_per_pm_base + 0xA8); diff --git a/drivers/staging/tidspbridge/core/tiomap_io.c b/drivers/staging/tidspbridge/core/tiomap_io.c index ba29610..09c9e87 100644 --- a/drivers/staging/tidspbridge/core/tiomap_io.c +++ b/drivers/staging/tidspbridge/core/tiomap_io.c @@ -61,7 +61,7 @@ int read_ext_dsp_data(struct bridge_dev_context *dev_ctxt, u32 ul_tlb_base_virt = 0; u32 ul_shm_offset_virt = 0; u32 dw_ext_prog_virt_mem; - u32 dw_base_addr = dev_context->dw_dsp_ext_base_addr; + u32 dw_base_addr = dev_context->dsp_ext_base_addr; bool trace_read = false; if (!ul_shm_base_virt) { @@ -92,7 +92,7 @@ int read_ext_dsp_data(struct bridge_dev_context *dev_ctxt, /* If reading from TRACE, force remap/unmap */ if (trace_read && dw_base_addr) { dw_base_addr = 0; - dev_context->dw_dsp_ext_base_addr = 0; + dev_context->dsp_ext_base_addr = 0; } if (!dw_base_addr) { @@ -148,14 +148,14 @@ int read_ext_dsp_data(struct bridge_dev_context *dev_ctxt, dw_ext_prog_virt_mem -= ul_shm_offset_virt; dw_ext_prog_virt_mem += (ul_ext_base - ul_dyn_ext_base); - dev_context->dw_dsp_ext_base_addr = + dev_context->dsp_ext_base_addr = dw_ext_prog_virt_mem; /* - * This dw_dsp_ext_base_addr will get cleared + * This dsp_ext_base_addr will get cleared * only when the board is stopped. */ - if (!dev_context->dw_dsp_ext_base_addr) + if (!dev_context->dsp_ext_base_addr) status = -EPERM; } @@ -184,7 +184,7 @@ int write_dsp_data(struct bridge_dev_context *dev_context, u32 mem_type) { u32 offset; - u32 dw_base_addr = dev_context->dw_dsp_base_addr; + u32 dw_base_addr = dev_context->dsp_base_addr; struct cfg_hostres *resources = dev_context->resources; int status = 0; u32 base1, base2, base3; @@ -195,7 +195,7 @@ int write_dsp_data(struct bridge_dev_context *dev_context, if (!resources) return -EPERM; - offset = dsp_addr - dev_context->dw_dsp_start_add; + offset = dsp_addr - dev_context->dsp_start_add; if (offset < base1) { dw_base_addr = MEM_LINEAR_ADDRESS(resources->dw_mem_base[2], resources->dw_mem_length[2]); @@ -230,7 +230,7 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context, u32 ul_num_bytes, u32 mem_type, bool dynamic_load) { - u32 dw_base_addr = dev_context->dw_dsp_ext_base_addr; + u32 dw_base_addr = dev_context->dsp_ext_base_addr; u32 dw_offset = 0; u8 temp_byte1, temp_byte2; u8 remain_byte[4]; @@ -263,8 +263,8 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context, if ((dynamic_load || trace_load) && dw_base_addr) { dw_base_addr = 0; MEM_UNMAP_LINEAR_ADDRESS((void *) - dev_context->dw_dsp_ext_base_addr); - dev_context->dw_dsp_ext_base_addr = 0x0; + dev_context->dsp_ext_base_addr); + dev_context->dsp_ext_base_addr = 0x0; } if (!dw_base_addr) { if (symbols_reloaded) @@ -344,14 +344,14 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context, (ul_ext_base - ul_dyn_ext_base); } - dev_context->dw_dsp_ext_base_addr = + dev_context->dsp_ext_base_addr = (u32) MEM_LINEAR_ADDRESS((void *) dw_ext_prog_virt_mem, ul_ext_end - ul_ext_base); - dw_base_addr += dev_context->dw_dsp_ext_base_addr; - /* This dw_dsp_ext_base_addr will get cleared only when + dw_base_addr += dev_context->dsp_ext_base_addr; + /* This dsp_ext_base_addr will get cleared only when * the board is stopped. */ - if (!dev_context->dw_dsp_ext_base_addr) + if (!dev_context->dsp_ext_base_addr) ret = -EPERM; } } @@ -375,10 +375,10 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context, *((u32 *) host_buff) = dw_base_addr + dw_offset; } /* Unmap here to force remap for other Ext loads */ - if ((dynamic_load || trace_load) && dev_context->dw_dsp_ext_base_addr) { + if ((dynamic_load || trace_load) && dev_context->dsp_ext_base_addr) { MEM_UNMAP_LINEAR_ADDRESS((void *) - dev_context->dw_dsp_ext_base_addr); - dev_context->dw_dsp_ext_base_addr = 0x0; + dev_context->dsp_ext_base_addr); + dev_context->dsp_ext_base_addr = 0x0; } symbols_reloaded = false; return ret; @@ -401,8 +401,8 @@ int sm_interrupt_dsp(struct bridge_dev_context *dev_context, u16 mb_val) if (!resources) return -EPERM; - if (dev_context->dw_brd_state == BRD_DSP_HIBERNATION || - dev_context->dw_brd_state == BRD_HIBERNATION) { + if (dev_context->brd_state == BRD_DSP_HIBERNATION || + dev_context->brd_state == BRD_HIBERNATION) { #ifdef CONFIG_TIDSPBRIDGE_DVFS if (pdata->dsp_get_opp) opplevel = (*pdata->dsp_get_opp) (); @@ -439,8 +439,8 @@ int sm_interrupt_dsp(struct bridge_dev_context *dev_context, u16 mb_val) /* Access MMU SYS CONFIG register to generate a short wakeup */ temp = readl(resources->dw_dmmu_base + 0x10); - dev_context->dw_brd_state = BRD_RUNNING; - } else if (dev_context->dw_brd_state == BRD_RETENTION) { + dev_context->brd_state = BRD_RUNNING; + } else if (dev_context->brd_state == BRD_RETENTION) { /* Restart the peripheral clocks */ dsp_clock_enable_all(dev_context->dsp_per_clks); } diff --git a/drivers/staging/tidspbridge/core/ue_deh.c b/drivers/staging/tidspbridge/core/ue_deh.c index 3430418..875a65c 100644 --- a/drivers/staging/tidspbridge/core/ue_deh.c +++ b/drivers/staging/tidspbridge/core/ue_deh.c @@ -254,7 +254,7 @@ void bridge_deh_notify(struct deh_mgr *deh, int event, int info) } /* Filter subsequent notifications when an error occurs */ - if (dev_context->dw_brd_state != BRD_ERROR) { + if (dev_context->brd_state != BRD_ERROR) { ntfy_notify(deh->ntfy_obj, event); #ifdef CONFIG_TIDSPBRIDGE_RECOVERY bridge_recover_schedule(); @@ -262,7 +262,7 @@ void bridge_deh_notify(struct deh_mgr *deh, int event, int info) } /* Set the Board state as ERROR */ - dev_context->dw_brd_state = BRD_ERROR; + dev_context->brd_state = BRD_ERROR; /* Disable all the clocks that were enabled by DSP */ dsp_clock_disable_all(dev_context->dsp_per_clks); /* diff --git a/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h b/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h index 8a22317..14b0567 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h @@ -171,7 +171,7 @@ struct chnl_irp { u8 *host_user_buf; /* Buffer to be filled/emptied. (System) */ u8 *host_sys_buf; - u32 dw_arg; /* Issue/Reclaim argument. */ + u32 arg; /* Issue/Reclaim argument. */ u32 dsp_tx_addr; /* Transfer address on DSP side. */ u32 byte_size; /* Bytes transferred. */ u32 buf_size; /* Actual buffer size when allocated. */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h b/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h index 0589a0a..f7c105a 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h @@ -43,18 +43,18 @@ struct cfg_hostres { * dw_mem_base + this offset */ /* * Info needed by NODE for allocating channels to communicate with RMS: - * dw_chnl_offset: Offset of RMS channels. Lower channels are + * chnl_offset: Offset of RMS channels. Lower channels are * reserved. - * dw_chnl_buf_size: Size of channel buffer to send to RMS + * chnl_buf_size: Size of channel buffer to send to RMS * dw_num_chnls: Total number of channels * (including reserved). */ - u32 dw_chnl_offset; - u32 dw_chnl_buf_size; + u32 chnl_offset; + u32 chnl_buf_size; u32 dw_num_chnls; void __iomem *dw_per_base; u32 dw_per_pm_base; - u32 dw_core_pm_base; + u32 core_pm_base; void __iomem *dw_dmmu_base; }; diff --git a/drivers/staging/tidspbridge/include/dspbridge/chnldefs.h b/drivers/staging/tidspbridge/include/dspbridge/chnldefs.h index 8f8f9ec..2cc27b5 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/chnldefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/chnldefs.h @@ -57,7 +57,7 @@ struct chnl_ioc { u32 byte_size; /* Bytes transferred. */ u32 buf_size; /* Actual buffer size in bytes */ u32 status; /* Status of IO completion. */ - u32 dw_arg; /* User argument associated with pbuf. */ + u32 arg; /* User argument associated with pbuf. */ }; #endif /* CHNLDEFS_ */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h b/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h index e748ba8..943d91f 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h @@ -54,9 +54,9 @@ struct cmm_seginfo { u32 dw_seg_base_pa; /* Start Phys address of SM segment */ /* Total size in bytes of segment: DSP+GPP */ u32 ul_total_seg_size; - u32 dw_gpp_base_pa; /* Start Phys addr of Gpp SM seg */ + u32 gpp_base_pa; /* Start Phys addr of Gpp SM seg */ u32 ul_gpp_size; /* Size of Gpp SM seg in bytes */ - u32 dw_dsp_base_va; /* DSP virt base byte address */ + u32 dsp_base_va; /* DSP virt base byte address */ u32 ul_dsp_size; /* DSP seg size in bytes */ /* # of current GPP allocations from this segment */ u32 ul_in_use_cnt; @@ -79,8 +79,8 @@ struct cmm_info { /* XlatorCreate attributes */ struct cmm_xlatorattrs { u32 ul_seg_id; /* segment Id used for SM allocations */ - u32 dw_dsp_bufs; /* # of DSP-side bufs */ - u32 dw_dsp_buf_size; /* size of DSP-side bufs in GPP bytes */ + u32 dsp_bufs; /* # of DSP-side bufs */ + u32 dsp_buf_size; /* size of DSP-side bufs in GPP bytes */ /* Vm base address alloc'd in client process context */ void *vm_base; /* dw_vm_size must be >= (dwMaxNumBufs * dwMaxSize) */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h index 38fffeb..6ba66c5 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h @@ -244,9 +244,9 @@ struct dsp_cbdata { /* The dsp_msg structure */ struct dsp_msg { - u32 dw_cmd; - u32 dw_arg1; - u32 dw_arg2; + u32 cmd; + u32 arg1; + u32 arg2; }; /* The dsp_resourcereqmts structure for node's resource requirements */ @@ -368,7 +368,7 @@ struct dsp_processorinfo { /* Error information of last DSP exception signalled to the GPP */ struct dsp_errorinfo { - u32 dw_err_mask; + u32 err_mask; u32 dw_val1; u32 dw_val2; u32 dw_val3; diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h b/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h index 8ad9ace..bd3f885 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h @@ -68,7 +68,7 @@ union trapped_args { struct { void *hprocessor; - u32 dw_cmd; + u32 cmd; struct dsp_cbdata __user *pargs; } args_proc_ctrl; @@ -293,7 +293,7 @@ union trapped_args { u8 *pbuffer; u32 dw_bytes; u32 dw_buf_size; - u32 dw_arg; + u32 arg; } args_strm_issue; struct { diff --git a/drivers/staging/tidspbridge/pmgr/cmm.c b/drivers/staging/tidspbridge/pmgr/cmm.c index babe66f..f7542a5 100644 --- a/drivers/staging/tidspbridge/pmgr/cmm.c +++ b/drivers/staging/tidspbridge/pmgr/cmm.c @@ -66,10 +66,10 @@ struct cmm_allocator { /* sma */ u32 ul_sm_size; /* Size of SM block in bytes */ unsigned int dw_vm_base; /* Start of VM block. (Dev driver * context for 'sma') */ - u32 dw_dsp_phys_addr_offset; /* DSP PA to GPP PA offset for this + u32 dsp_phys_addr_offset; /* DSP PA to GPP PA offset for this * SM space */ s8 c_factor; /* DSPPa to GPPPa Conversion Factor */ - unsigned int dw_dsp_base; /* DSP virt base byte address */ + unsigned int dsp_base; /* DSP virt base byte address */ u32 ul_dsp_size; /* DSP seg size in bytes */ struct cmm_object *hcmm_mgr; /* back ref to parent mgr */ /* node list of available memory */ @@ -119,8 +119,8 @@ static struct cmm_attrs cmm_dfltalctattrs = { static struct cmm_xlatorattrs cmm_dfltxlatorattrs = { /* ul_seg_id, does not have to match cmm_dfltalctattrs ul_seg_id */ 1, - 0, /* dw_dsp_bufs */ - 0, /* dw_dsp_buf_size */ + 0, /* dsp_bufs */ + 0, /* dsp_buf_size */ NULL, /* vm_base */ 0, /* dw_vm_size */ }; @@ -442,12 +442,12 @@ int cmm_get_info(struct cmm_object *hcmm_mgr, altr->shm_base - altr->ul_dsp_size; cmm_info_obj->seg_info[ul_seg - 1].ul_total_seg_size = altr->ul_dsp_size + altr->ul_sm_size; - cmm_info_obj->seg_info[ul_seg - 1].dw_gpp_base_pa = + cmm_info_obj->seg_info[ul_seg - 1].gpp_base_pa = altr->shm_base; cmm_info_obj->seg_info[ul_seg - 1].ul_gpp_size = altr->ul_sm_size; - cmm_info_obj->seg_info[ul_seg - 1].dw_dsp_base_va = - altr->dw_dsp_base; + cmm_info_obj->seg_info[ul_seg - 1].dsp_base_va = + altr->dsp_base; cmm_info_obj->seg_info[ul_seg - 1].ul_dsp_size = altr->ul_dsp_size; cmm_info_obj->seg_info[ul_seg - 1].dw_seg_base_va = @@ -540,9 +540,9 @@ int cmm_register_gppsm_seg(struct cmm_object *hcmm_mgr, psma->shm_base = dw_gpp_base_pa; /* SM Base phys */ psma->ul_sm_size = ul_size; /* SM segment size in bytes */ psma->dw_vm_base = gpp_base_va; - psma->dw_dsp_phys_addr_offset = dsp_addr_offset; + psma->dsp_phys_addr_offset = dsp_addr_offset; psma->c_factor = c_factor; - psma->dw_dsp_base = dw_dsp_base; + psma->dsp_base = dw_dsp_base; psma->ul_dsp_size = ul_dsp_size; if (psma->dw_vm_base == 0) { status = -EPERM; @@ -994,14 +994,14 @@ void *cmm_xlator_translate(struct cmm_xlatorobject *xlator, void *paddr, dw_addr_xlate = GPPPA2DSPPA((allocator->shm_base - allocator->ul_dsp_size), dw_addr_xlate, - allocator->dw_dsp_phys_addr_offset * + allocator->dsp_phys_addr_offset * allocator->c_factor); } else if (xtype == CMM_DSPPA2PA) { /* Got DSP Pa, convert to GPP Pa */ dw_addr_xlate = DSPPA2GPPPA(allocator->shm_base - allocator->ul_dsp_size, dw_addr_xlate, - allocator->dw_dsp_phys_addr_offset * + allocator->dsp_phys_addr_offset * allocator->c_factor); } loop_cont: diff --git a/drivers/staging/tidspbridge/pmgr/dspapi.c b/drivers/staging/tidspbridge/pmgr/dspapi.c index 86ca785..3efe1d5 100644 --- a/drivers/staging/tidspbridge/pmgr/dspapi.c +++ b/drivers/staging/tidspbridge/pmgr/dspapi.c @@ -639,7 +639,7 @@ u32 procwrap_ctrl(union trapped_args *args, void *pr_ctxt) } if (!status) { status = proc_ctrl(hprocessor, - args->args_proc_ctrl.dw_cmd, + args->args_proc_ctrl.cmd, (struct dsp_cbdata *)pargs); } @@ -1717,7 +1717,7 @@ u32 strmwrap_issue(union trapped_args *args, void *pr_ctxt) args->args_strm_issue.pbuffer, args->args_strm_issue.dw_bytes, args->args_strm_issue.dw_buf_size, - args->args_strm_issue.dw_arg); + args->args_strm_issue.arg); return status; } diff --git a/drivers/staging/tidspbridge/rmgr/drv.c b/drivers/staging/tidspbridge/rmgr/drv.c index e0fc895..2e73302 100644 --- a/drivers/staging/tidspbridge/rmgr/drv.c +++ b/drivers/staging/tidspbridge/rmgr/drv.c @@ -699,10 +699,10 @@ static int request_bridge_resources(struct cfg_hostres *res) host_res->birq_registers = 0; host_res->birq_attrib = 0; host_res->dw_offset_for_monitor = 0; - host_res->dw_chnl_offset = 0; + host_res->chnl_offset = 0; /* CHNL_MAXCHANNELS */ host_res->dw_num_chnls = CHNL_MAXCHANNELS; - host_res->dw_chnl_buf_size = 0x400; + host_res->chnl_buf_size = 0x400; return 0; } @@ -741,7 +741,7 @@ int drv_request_bridge_res_dsp(void **phost_resources) OMAP_PER_CM_SIZE); host_res->dw_per_pm_base = (u32) ioremap(OMAP_PER_PRM_BASE, OMAP_PER_PRM_SIZE); - host_res->dw_core_pm_base = (u32) ioremap(OMAP_CORE_PRM_BASE, + host_res->core_pm_base = (u32) ioremap(OMAP_CORE_PRM_BASE, OMAP_CORE_PRM_SIZE); host_res->dw_dmmu_base = ioremap(OMAP_DMMU_BASE, OMAP_DMMU_SIZE); @@ -783,10 +783,10 @@ int drv_request_bridge_res_dsp(void **phost_resources) host_res->birq_registers = 0; host_res->birq_attrib = 0; host_res->dw_offset_for_monitor = 0; - host_res->dw_chnl_offset = 0; + host_res->chnl_offset = 0; /* CHNL_MAXCHANNELS */ host_res->dw_num_chnls = CHNL_MAXCHANNELS; - host_res->dw_chnl_buf_size = 0x400; + host_res->chnl_buf_size = 0x400; dw_buff_size = sizeof(struct cfg_hostres); } *phost_resources = host_res; diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c index 27af99d..5a045c7 100644 --- a/drivers/staging/tidspbridge/rmgr/node.c +++ b/drivers/staging/tidspbridge/rmgr/node.c @@ -1795,12 +1795,12 @@ int node_get_message(struct node_object *hnode, status = (*intf_fxns->pfn_msg_get) (hnode->msg_queue_obj, message, utimeout); /* Check if message contains SM descriptor */ - if (status || !(message->dw_cmd & DSP_RMSBUFDESC)) + if (status || !(message->cmd & DSP_RMSBUFDESC)) goto func_end; /* Translate DSP byte addr to GPP Va. */ tmp_buf = cmm_xlator_translate(hnode->xlator, - (void *)(message->dw_arg1 * + (void *)(message->arg1 * hnode->hnode_mgr-> udsp_word_size), CMM_DSPPA2PA); if (tmp_buf != NULL) { @@ -1809,8 +1809,8 @@ int node_get_message(struct node_object *hnode, CMM_PA2VA); if (tmp_buf != NULL) { /* Adjust SM size in msg */ - message->dw_arg1 = (u32) tmp_buf; - message->dw_arg2 *= hnode->hnode_mgr->udsp_word_size; + message->arg1 = (u32) tmp_buf; + message->arg2 *= hnode->hnode_mgr->udsp_word_size; } else { status = -ESRCH; } @@ -2100,19 +2100,19 @@ int node_put_message(struct node_object *hnode, /* assign pmsg values to new msg */ new_msg = *pmsg; /* Now, check if message contains a SM buffer descriptor */ - if (pmsg->dw_cmd & DSP_RMSBUFDESC) { + if (pmsg->cmd & DSP_RMSBUFDESC) { /* Translate GPP Va to DSP physical buf Ptr. */ tmp_buf = cmm_xlator_translate(hnode->xlator, - (void *)new_msg.dw_arg1, + (void *)new_msg.arg1, CMM_VA2DSPPA); if (tmp_buf != NULL) { /* got translation, convert to MAUs in msg */ if (hnode->hnode_mgr->udsp_word_size != 0) { - new_msg.dw_arg1 = + new_msg.arg1 = (u32) tmp_buf / hnode->hnode_mgr->udsp_word_size; /* MAUs */ - new_msg.dw_arg2 /= hnode->hnode_mgr-> + new_msg.arg2 /= hnode->hnode_mgr-> udsp_word_size; } else { pr_err("%s: udsp_word_size is zero!\n", @@ -2378,10 +2378,10 @@ int node_terminate(struct node_object *hnode, int *pstatus) goto func_cont; } - msg.dw_cmd = RMS_EXIT; - msg.dw_arg1 = hnode->node_env; - killmsg.dw_cmd = RMS_KILLTASK; - killmsg.dw_arg1 = hnode->node_env; + msg.cmd = RMS_EXIT; + msg.arg1 = hnode->node_env; + killmsg.cmd = RMS_KILLTASK; + killmsg.arg1 = hnode->node_env; intf_fxns = hnode_mgr->intf_fxns; if (hnode->utimeout > MAXTIMEOUT) @@ -2902,8 +2902,8 @@ static int get_proc_props(struct node_mgr *hnode_mgr, host_res = pbridge_context->resources; if (!host_res) return -EPERM; - hnode_mgr->ul_chnl_offset = host_res->dw_chnl_offset; - hnode_mgr->ul_chnl_buf_size = host_res->dw_chnl_buf_size; + hnode_mgr->ul_chnl_offset = host_res->chnl_offset; + hnode_mgr->ul_chnl_buf_size = host_res->chnl_buf_size; hnode_mgr->ul_num_chnls = host_res->dw_num_chnls; /* diff --git a/drivers/staging/tidspbridge/rmgr/strm.c b/drivers/staging/tidspbridge/rmgr/strm.c index 2e42714..d36b316 100644 --- a/drivers/staging/tidspbridge/rmgr/strm.c +++ b/drivers/staging/tidspbridge/rmgr/strm.c @@ -639,7 +639,7 @@ int strm_reclaim(struct strm_object *stream_obj, u8 ** buf_ptr, if (buff_size) *buff_size = chnl_ioc_obj.buf_size; - *pdw_arg = chnl_ioc_obj.dw_arg; + *pdw_arg = chnl_ioc_obj.arg; if (!CHNL_IS_IO_COMPLETE(chnl_ioc_obj)) { if (CHNL_IS_TIMED_OUT(chnl_ioc_obj)) { status = -ETIME; -- cgit v0.10.2 From 5108de0ae06190f2ab54b9a1da315b77b33be1e2 Mon Sep 17 00:00:00 2001 From: Rene Sapiens Date: Tue, 18 Jan 2011 03:19:04 +0000 Subject: staging: tidspbridge: set2 remove hungarian from structs hungarian notation will be removed from the elements inside structures, the next varibles will be renamed: Original: Replacement: dw_dsp_base_addr dsp_base_addr dw_dmmu_base dmmu_base dw_index index dw_int_addr int_addr dw_internal_size internal_size dw_last_output last_output dw_mem_base mem_base dw_mem_length mem_length dw_mem_phys mem_phys dw_mode mode dw_num_chnls num_chnls dw_offset_for_monitor offset_for_monitor dw_output_mask output_mask dw_page_size page_size dw_pa pa dw_per_base per_base dw_per_pm_base per_pm_base dw_public_rhea public_rhea dw_seg_base_pa seg_base_pa Signed-off-by: Rene Sapiens Signed-off-by: Armando Uribe Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/core/_tiomap.h b/drivers/staging/tidspbridge/core/_tiomap.h index 80bc4755..5a14e6f 100644 --- a/drivers/staging/tidspbridge/core/_tiomap.h +++ b/drivers/staging/tidspbridge/core/_tiomap.h @@ -327,16 +327,16 @@ struct bridge_dev_context { */ u32 dsp_ext_base_addr; /* See the comment above */ u32 api_reg_base; /* API mem map'd registers */ - void __iomem *dw_dsp_mmu_base; /* DSP MMU Mapped registers */ + void __iomem *dsp_mmu_base; /* DSP MMU Mapped registers */ u32 api_clk_base; /* CLK Registers */ u32 dsp_clk_m2_base; /* DSP Clock Module m2 */ - u32 dw_public_rhea; /* Pub Rhea */ - u32 dw_int_addr; /* MB INTR reg */ + u32 public_rhea; /* Pub Rhea */ + u32 int_addr; /* MB INTR reg */ u32 dw_tc_endianism; /* TC Endianism register */ u32 dw_test_base; /* DSP MMU Mapped registers */ u32 dw_self_loop; /* Pointer to the selfloop */ u32 dsp_start_add; /* API Boot vector */ - u32 dw_internal_size; /* Internal memory size */ + u32 internal_size; /* Internal memory size */ struct omap_mbox *mbox; /* Mail box handle */ diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c b/drivers/staging/tidspbridge/core/chnl_sm.c index a522627..59b8d55 100644 --- a/drivers/staging/tidspbridge/core/chnl_sm.c +++ b/drivers/staging/tidspbridge/core/chnl_sm.c @@ -272,7 +272,7 @@ int bridge_chnl_cancel_io(struct chnl_object *chnl_obj) } else { /* Record that we no longer have output buffers * available: */ - chnl_mgr_obj->dw_output_mask &= ~(1 << chnl_id); + chnl_mgr_obj->output_mask &= ~(1 << chnl_id); } } /* Move all IOR's to IOC queue: */ @@ -386,8 +386,8 @@ int bridge_chnl_create(struct chnl_mgr **channel_mgr, /* Total # chnls supported */ chnl_mgr_obj->max_channels = max_channels; chnl_mgr_obj->open_channels = 0; - chnl_mgr_obj->dw_output_mask = 0; - chnl_mgr_obj->dw_last_output = 0; + chnl_mgr_obj->output_mask = 0; + chnl_mgr_obj->last_output = 0; chnl_mgr_obj->hdev_obj = hdev_obj; spin_lock_init(&chnl_mgr_obj->chnl_mgr_lock); } else { @@ -511,7 +511,7 @@ int bridge_chnl_get_info(struct chnl_object *chnl_obj, channel_info->hchnl_mgr = pchnl->chnl_mgr_obj; channel_info->event_obj = pchnl->user_event; channel_info->cnhl_id = pchnl->chnl_id; - channel_info->dw_mode = pchnl->chnl_mode; + channel_info->mode = pchnl->chnl_mode; channel_info->bytes_tx = pchnl->bytes_moved; channel_info->process = pchnl->process; channel_info->sync_event = pchnl->sync_event; diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index 913c768..e89052c 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c @@ -417,8 +417,8 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) /* The first MMU TLB entry(TLB_0) in DCD is ShmBase. */ ndx = 0; - ul_gpp_pa = host_res->dw_mem_phys[1]; - ul_gpp_va = host_res->dw_mem_base[1]; + ul_gpp_pa = host_res->mem_phys[1]; + ul_gpp_va = host_res->mem_base[1]; /* This is the virtual uncached ioremapped address!!! */ /* Why can't we directly take the DSPVA from the symbols? */ ul_dsp_va = hio_mgr->ext_proc_info.ty_tlb[0].ul_dsp_virt; @@ -441,9 +441,9 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) ul_dyn_ext_base, ul_ext_end, ul_seg_size, ul_seg1_size); if ((ul_seg_size + ul_seg1_size + ul_pad_size) > - host_res->dw_mem_length[1]) { + host_res->mem_length[1]) { pr_err("%s: shm Error, reserved 0x%x required 0x%x\n", - __func__, host_res->dw_mem_length[1], + __func__, host_res->mem_length[1], ul_seg_size + ul_seg1_size + ul_pad_size); status = -ENOMEM; } @@ -993,7 +993,7 @@ void io_request_chnl(struct io_mgr *io_manager, struct chnl_object *pchnl, * Record the fact that we have a buffer available for * output. */ - chnl_mgr_obj->dw_output_mask |= (1 << pchnl->chnl_id); + chnl_mgr_obj->output_mask |= (1 << pchnl->chnl_id); } else { DBC_ASSERT(io_mode); /* Shouldn't get here. */ } @@ -1036,7 +1036,7 @@ static u32 find_ready_output(struct chnl_mgr *chnl_mgr_obj, u32 shift; id = (pchnl != - NULL ? pchnl->chnl_id : (chnl_mgr_obj->dw_last_output + 1)); + NULL ? pchnl->chnl_id : (chnl_mgr_obj->last_output + 1)); id = ((id == CHNL_MAXCHANNELS) ? 0 : id); if (id >= CHNL_MAXCHANNELS) goto func_end; @@ -1047,7 +1047,7 @@ static u32 find_ready_output(struct chnl_mgr *chnl_mgr_obj, if (mask & shift) { ret = id; if (pchnl == NULL) - chnl_mgr_obj->dw_last_output = id; + chnl_mgr_obj->last_output = id; break; } id = id + 1; @@ -1336,7 +1336,7 @@ static void output_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, dw_dsp_f_mask = sm->dsp_free_mask; chnl_id = find_ready_output(chnl_mgr_obj, pchnl, - (chnl_mgr_obj->dw_output_mask & dw_dsp_f_mask)); + (chnl_mgr_obj->output_mask & dw_dsp_f_mask)); if (chnl_id == OUTPUTNOTREADY) goto func_end; @@ -1358,7 +1358,7 @@ static void output_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, /* Record fact that no more I/O buffers available */ if (list_empty(&pchnl->pio_requests)) - chnl_mgr_obj->dw_output_mask &= ~(1 << chnl_id); + chnl_mgr_obj->output_mask &= ~(1 << chnl_id); /* Transfer buffer to DSP side */ chnl_packet_obj->byte_size = min(pio_mgr->usm_buf_size, diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c index ce0556d..5964a13 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430.c +++ b/drivers/staging/tidspbridge/core/tiomap3430.c @@ -233,7 +233,7 @@ static inline void flush_all(struct bridge_dev_context *dev_context) dev_context->brd_state == BRD_HIBERNATION) wake_dsp(dev_context, NULL); - hw_mmu_tlb_flush_all(dev_context->dw_dsp_mmu_base); + hw_mmu_tlb_flush_all(dev_context->dsp_mmu_base); } static void bad_page_dump(u32 pa, struct page *pg) @@ -331,7 +331,7 @@ static int bridge_brd_read(struct bridge_dev_context *dev_ctxt, } /* change here to account for the 3 bands of the DSP internal memory */ if ((dsp_addr - dev_context->dsp_start_add) < - dev_context->dw_internal_size) { + dev_context->internal_size) { offset = dsp_addr - dev_context->dsp_start_add; } else { status = read_ext_dsp_data(dev_context, host_buff, dsp_addr, @@ -452,9 +452,9 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, udelay(100); /* Disbale the DSP MMU */ - hw_mmu_disable(resources->dw_dmmu_base); + hw_mmu_disable(resources->dmmu_base); /* Disable TWL */ - hw_mmu_twl_disable(resources->dw_dmmu_base); + hw_mmu_twl_disable(resources->dmmu_base); /* Only make TLB entry if both addresses are non-zero */ for (entry_ndx = 0; entry_ndx < BRDIOCTL_NUMOFMMUTLB; @@ -476,7 +476,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, e->ul_dsp_va, e->ul_size); - hw_mmu_tlb_add(dev_context->dw_dsp_mmu_base, + hw_mmu_tlb_add(dev_context->dsp_mmu_base, e->ul_gpp_pa, e->ul_dsp_va, e->ul_size, @@ -490,19 +490,19 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, /* Lock the above TLB entries and get the BIOS and load monitor timer * information */ if (!status) { - hw_mmu_num_locked_set(resources->dw_dmmu_base, itmp_entry_ndx); - hw_mmu_victim_num_set(resources->dw_dmmu_base, itmp_entry_ndx); - hw_mmu_ttb_set(resources->dw_dmmu_base, + hw_mmu_num_locked_set(resources->dmmu_base, itmp_entry_ndx); + hw_mmu_victim_num_set(resources->dmmu_base, itmp_entry_ndx); + hw_mmu_ttb_set(resources->dmmu_base, dev_context->pt_attrs->l1_base_pa); - hw_mmu_twl_enable(resources->dw_dmmu_base); + hw_mmu_twl_enable(resources->dmmu_base); /* Enable the SmartIdle and AutoIdle bit for MMU_SYSCONFIG */ - temp = __raw_readl((resources->dw_dmmu_base) + 0x10); + temp = __raw_readl((resources->dmmu_base) + 0x10); temp = (temp & 0xFFFFFFEF) | 0x11; - __raw_writel(temp, (resources->dw_dmmu_base) + 0x10); + __raw_writel(temp, (resources->dmmu_base) + 0x10); /* Let the DSP MMU run */ - hw_mmu_enable(resources->dw_dmmu_base); + hw_mmu_enable(resources->dmmu_base); /* Enable the BIOS clock */ (void)dev_get_symbol(dev_context->hdev_obj, @@ -566,18 +566,18 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, } if (!status) { /*PM_IVA2GRPSEL_PER = 0xC0;*/ - temp = readl(resources->dw_per_pm_base + 0xA8); + temp = readl(resources->per_pm_base + 0xA8); temp = (temp & 0xFFFFFF30) | 0xC0; - writel(temp, resources->dw_per_pm_base + 0xA8); + writel(temp, resources->per_pm_base + 0xA8); /*PM_MPUGRPSEL_PER &= 0xFFFFFF3F; */ - temp = readl(resources->dw_per_pm_base + 0xA4); + temp = readl(resources->per_pm_base + 0xA4); temp = (temp & 0xFFFFFF3F); - writel(temp, resources->dw_per_pm_base + 0xA4); + writel(temp, resources->per_pm_base + 0xA4); /*CM_SLEEPDEP_PER |= 0x04; */ - temp = readl(resources->dw_per_base + 0x44); + temp = readl(resources->per_base + 0x44); temp = (temp & 0xFFFFFFFB) | 0x04; - writel(temp, resources->dw_per_base + 0x44); + writel(temp, resources->per_base + 0x44); /*CM_CLKSTCTRL_IVA2 = 0x00000003 -To Allow automatic transitions */ (*pdata->dsp_cm_write)(OMAP34XX_CLKSTCTRL_ENABLE_AUTO, @@ -586,7 +586,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, /* Let DSP go */ dev_dbg(bridge, "%s Unreset\n", __func__); /* Enable DSP MMU Interrupts */ - hw_mmu_event_enable(resources->dw_dmmu_base, + hw_mmu_event_enable(resources->dmmu_base, HW_MMU_ALL_INTERRUPTS); /* release the RST1, DSP starts executing now .. */ (*pdata->dsp_prm_rmw_bits)(OMAP3430_RST1_IVA2_MASK, 0, @@ -726,7 +726,7 @@ static int bridge_brd_write(struct bridge_dev_context *dev_ctxt, return status; } if ((dsp_addr - dev_context->dsp_start_add) < - dev_context->dw_internal_size) { + dev_context->internal_size) { status = write_dsp_data(dev_ctxt, host_buff, dsp_addr, ul_num_bytes, mem_type); } else { @@ -767,7 +767,7 @@ static int bridge_dev_create(struct bridge_dev_context dev_context->dsp_start_add = (u32) OMAP_GEM_BASE; dev_context->dw_self_loop = (u32) NULL; dev_context->dsp_per_clks = 0; - dev_context->dw_internal_size = OMAP_DSP_SIZE; + dev_context->internal_size = OMAP_DSP_SIZE; /* Clear dev context MMU table entries. * These get set on bridge_io_on_loaded() call after program loaded. */ for (entry_ndx = 0; entry_ndx < BRDIOCTL_NUMOFMMUTLB; entry_ndx++) { @@ -776,10 +776,10 @@ static int bridge_dev_create(struct bridge_dev_context } dev_context->dsp_base_addr = (u32) MEM_LINEAR_ADDRESS((void *) (config_param-> - dw_mem_base + mem_base [3]), config_param-> - dw_mem_length + mem_length [3]); if (!dev_context->dsp_base_addr) status = -EPERM; @@ -869,7 +869,7 @@ static int bridge_dev_create(struct bridge_dev_context udelay(5); /* MMU address is obtained from the host * resources struct */ - dev_context->dw_dsp_mmu_base = resources->dw_dmmu_base; + dev_context->dsp_mmu_base = resources->dmmu_base; } if (!status) { dev_context->hdev_obj = hdev_obj; @@ -1001,12 +1001,12 @@ static int bridge_dev_destroy(struct bridge_dev_context *dev_ctxt) host_res = dev_context->resources; shm_size = drv_datap->shm_size; if (shm_size >= 0x10000) { - if ((host_res->dw_mem_base[1]) && - (host_res->dw_mem_phys[1])) { + if ((host_res->mem_base[1]) && + (host_res->mem_phys[1])) { mem_free_phys_mem((void *) - host_res->dw_mem_base + host_res->mem_base [1], - host_res->dw_mem_phys + host_res->mem_phys [1], shm_size); } } else { @@ -1015,31 +1015,31 @@ static int bridge_dev_destroy(struct bridge_dev_context *dev_ctxt) "mem_free_phys_mem\n", __func__, status); } - host_res->dw_mem_base[1] = 0; - host_res->dw_mem_phys[1] = 0; - - if (host_res->dw_mem_base[0]) - iounmap((void *)host_res->dw_mem_base[0]); - if (host_res->dw_mem_base[2]) - iounmap((void *)host_res->dw_mem_base[2]); - if (host_res->dw_mem_base[3]) - iounmap((void *)host_res->dw_mem_base[3]); - if (host_res->dw_mem_base[4]) - iounmap((void *)host_res->dw_mem_base[4]); - if (host_res->dw_dmmu_base) - iounmap(host_res->dw_dmmu_base); - if (host_res->dw_per_base) - iounmap(host_res->dw_per_base); - if (host_res->dw_per_pm_base) - iounmap((void *)host_res->dw_per_pm_base); + host_res->mem_base[1] = 0; + host_res->mem_phys[1] = 0; + + if (host_res->mem_base[0]) + iounmap((void *)host_res->mem_base[0]); + if (host_res->mem_base[2]) + iounmap((void *)host_res->mem_base[2]); + if (host_res->mem_base[3]) + iounmap((void *)host_res->mem_base[3]); + if (host_res->mem_base[4]) + iounmap((void *)host_res->mem_base[4]); + if (host_res->dmmu_base) + iounmap(host_res->dmmu_base); + if (host_res->per_base) + iounmap(host_res->per_base); + if (host_res->per_pm_base) + iounmap((void *)host_res->per_pm_base); if (host_res->core_pm_base) iounmap((void *)host_res->core_pm_base); - host_res->dw_mem_base[0] = (u32) NULL; - host_res->dw_mem_base[2] = (u32) NULL; - host_res->dw_mem_base[3] = (u32) NULL; - host_res->dw_mem_base[4] = (u32) NULL; - host_res->dw_dmmu_base = NULL; + host_res->mem_base[0] = (u32) NULL; + host_res->mem_base[2] = (u32) NULL; + host_res->mem_base[3] = (u32) NULL; + host_res->mem_base[4] = (u32) NULL; + host_res->dmmu_base = NULL; kfree(host_res); } @@ -1071,7 +1071,7 @@ static int bridge_brd_mem_copy(struct bridge_dev_context *dev_ctxt, copy_bytes, mem_type); if (!status) { if (dest_addr < (dev_context->dsp_start_add + - dev_context->dw_internal_size)) { + dev_context->internal_size)) { /* Write to Internal memory */ status = write_dsp_data(dev_ctxt, host_buf, dest_addr, copy_bytes, @@ -1105,7 +1105,7 @@ static int bridge_brd_mem_write(struct bridge_dev_context *dev_ctxt, ul_bytes = ul_remain_bytes > BUFFERSIZE ? BUFFERSIZE : ul_remain_bytes; if (dsp_addr < (dev_context->dsp_start_add + - dev_context->dw_internal_size)) { + dev_context->internal_size)) { status = write_dsp_data(dev_ctxt, host_buff, dsp_addr, ul_bytes, mem_type); diff --git a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c index fff27d4..64ca2d2 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c +++ b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c @@ -434,8 +434,8 @@ void dsp_clk_wakeup_event_ctrl(u32 clock_id, bool enable) switch (clock_id) { case BPWR_GP_TIMER5: - iva2_grpsel = readl(resources->dw_per_pm_base + 0xA8); - mpu_grpsel = readl(resources->dw_per_pm_base + 0xA4); + iva2_grpsel = readl(resources->per_pm_base + 0xA8); + mpu_grpsel = readl(resources->per_pm_base + 0xA4); if (enable) { iva2_grpsel |= OMAP3430_GRPSEL_GPT5_MASK; mpu_grpsel &= ~OMAP3430_GRPSEL_GPT5_MASK; @@ -443,12 +443,12 @@ void dsp_clk_wakeup_event_ctrl(u32 clock_id, bool enable) mpu_grpsel |= OMAP3430_GRPSEL_GPT5_MASK; iva2_grpsel &= ~OMAP3430_GRPSEL_GPT5_MASK; } - writel(iva2_grpsel, resources->dw_per_pm_base + 0xA8); - writel(mpu_grpsel, resources->dw_per_pm_base + 0xA4); + writel(iva2_grpsel, resources->per_pm_base + 0xA8); + writel(mpu_grpsel, resources->per_pm_base + 0xA4); break; case BPWR_GP_TIMER6: - iva2_grpsel = readl(resources->dw_per_pm_base + 0xA8); - mpu_grpsel = readl(resources->dw_per_pm_base + 0xA4); + iva2_grpsel = readl(resources->per_pm_base + 0xA8); + mpu_grpsel = readl(resources->per_pm_base + 0xA4); if (enable) { iva2_grpsel |= OMAP3430_GRPSEL_GPT6_MASK; mpu_grpsel &= ~OMAP3430_GRPSEL_GPT6_MASK; @@ -456,12 +456,12 @@ void dsp_clk_wakeup_event_ctrl(u32 clock_id, bool enable) mpu_grpsel |= OMAP3430_GRPSEL_GPT6_MASK; iva2_grpsel &= ~OMAP3430_GRPSEL_GPT6_MASK; } - writel(iva2_grpsel, resources->dw_per_pm_base + 0xA8); - writel(mpu_grpsel, resources->dw_per_pm_base + 0xA4); + writel(iva2_grpsel, resources->per_pm_base + 0xA8); + writel(mpu_grpsel, resources->per_pm_base + 0xA4); break; case BPWR_GP_TIMER7: - iva2_grpsel = readl(resources->dw_per_pm_base + 0xA8); - mpu_grpsel = readl(resources->dw_per_pm_base + 0xA4); + iva2_grpsel = readl(resources->per_pm_base + 0xA8); + mpu_grpsel = readl(resources->per_pm_base + 0xA4); if (enable) { iva2_grpsel |= OMAP3430_GRPSEL_GPT7_MASK; mpu_grpsel &= ~OMAP3430_GRPSEL_GPT7_MASK; @@ -469,12 +469,12 @@ void dsp_clk_wakeup_event_ctrl(u32 clock_id, bool enable) mpu_grpsel |= OMAP3430_GRPSEL_GPT7_MASK; iva2_grpsel &= ~OMAP3430_GRPSEL_GPT7_MASK; } - writel(iva2_grpsel, resources->dw_per_pm_base + 0xA8); - writel(mpu_grpsel, resources->dw_per_pm_base + 0xA4); + writel(iva2_grpsel, resources->per_pm_base + 0xA8); + writel(mpu_grpsel, resources->per_pm_base + 0xA4); break; case BPWR_GP_TIMER8: - iva2_grpsel = readl(resources->dw_per_pm_base + 0xA8); - mpu_grpsel = readl(resources->dw_per_pm_base + 0xA4); + iva2_grpsel = readl(resources->per_pm_base + 0xA8); + mpu_grpsel = readl(resources->per_pm_base + 0xA4); if (enable) { iva2_grpsel |= OMAP3430_GRPSEL_GPT8_MASK; mpu_grpsel &= ~OMAP3430_GRPSEL_GPT8_MASK; @@ -482,8 +482,8 @@ void dsp_clk_wakeup_event_ctrl(u32 clock_id, bool enable) mpu_grpsel |= OMAP3430_GRPSEL_GPT8_MASK; iva2_grpsel &= ~OMAP3430_GRPSEL_GPT8_MASK; } - writel(iva2_grpsel, resources->dw_per_pm_base + 0xA8); - writel(mpu_grpsel, resources->dw_per_pm_base + 0xA4); + writel(iva2_grpsel, resources->per_pm_base + 0xA8); + writel(mpu_grpsel, resources->per_pm_base + 0xA4); break; case BPWR_MCBSP1: iva2_grpsel = readl(resources->core_pm_base + 0xA8); @@ -499,8 +499,8 @@ void dsp_clk_wakeup_event_ctrl(u32 clock_id, bool enable) writel(mpu_grpsel, resources->core_pm_base + 0xA4); break; case BPWR_MCBSP2: - iva2_grpsel = readl(resources->dw_per_pm_base + 0xA8); - mpu_grpsel = readl(resources->dw_per_pm_base + 0xA4); + iva2_grpsel = readl(resources->per_pm_base + 0xA8); + mpu_grpsel = readl(resources->per_pm_base + 0xA4); if (enable) { iva2_grpsel |= OMAP3430_GRPSEL_MCBSP2_MASK; mpu_grpsel &= ~OMAP3430_GRPSEL_MCBSP2_MASK; @@ -508,12 +508,12 @@ void dsp_clk_wakeup_event_ctrl(u32 clock_id, bool enable) mpu_grpsel |= OMAP3430_GRPSEL_MCBSP2_MASK; iva2_grpsel &= ~OMAP3430_GRPSEL_MCBSP2_MASK; } - writel(iva2_grpsel, resources->dw_per_pm_base + 0xA8); - writel(mpu_grpsel, resources->dw_per_pm_base + 0xA4); + writel(iva2_grpsel, resources->per_pm_base + 0xA8); + writel(mpu_grpsel, resources->per_pm_base + 0xA4); break; case BPWR_MCBSP3: - iva2_grpsel = readl(resources->dw_per_pm_base + 0xA8); - mpu_grpsel = readl(resources->dw_per_pm_base + 0xA4); + iva2_grpsel = readl(resources->per_pm_base + 0xA8); + mpu_grpsel = readl(resources->per_pm_base + 0xA4); if (enable) { iva2_grpsel |= OMAP3430_GRPSEL_MCBSP3_MASK; mpu_grpsel &= ~OMAP3430_GRPSEL_MCBSP3_MASK; @@ -521,12 +521,12 @@ void dsp_clk_wakeup_event_ctrl(u32 clock_id, bool enable) mpu_grpsel |= OMAP3430_GRPSEL_MCBSP3_MASK; iva2_grpsel &= ~OMAP3430_GRPSEL_MCBSP3_MASK; } - writel(iva2_grpsel, resources->dw_per_pm_base + 0xA8); - writel(mpu_grpsel, resources->dw_per_pm_base + 0xA4); + writel(iva2_grpsel, resources->per_pm_base + 0xA8); + writel(mpu_grpsel, resources->per_pm_base + 0xA4); break; case BPWR_MCBSP4: - iva2_grpsel = readl(resources->dw_per_pm_base + 0xA8); - mpu_grpsel = readl(resources->dw_per_pm_base + 0xA4); + iva2_grpsel = readl(resources->per_pm_base + 0xA8); + mpu_grpsel = readl(resources->per_pm_base + 0xA4); if (enable) { iva2_grpsel |= OMAP3430_GRPSEL_MCBSP4_MASK; mpu_grpsel &= ~OMAP3430_GRPSEL_MCBSP4_MASK; @@ -534,12 +534,12 @@ void dsp_clk_wakeup_event_ctrl(u32 clock_id, bool enable) mpu_grpsel |= OMAP3430_GRPSEL_MCBSP4_MASK; iva2_grpsel &= ~OMAP3430_GRPSEL_MCBSP4_MASK; } - writel(iva2_grpsel, resources->dw_per_pm_base + 0xA8); - writel(mpu_grpsel, resources->dw_per_pm_base + 0xA4); + writel(iva2_grpsel, resources->per_pm_base + 0xA8); + writel(mpu_grpsel, resources->per_pm_base + 0xA4); break; case BPWR_MCBSP5: - iva2_grpsel = readl(resources->dw_per_pm_base + 0xA8); - mpu_grpsel = readl(resources->dw_per_pm_base + 0xA4); + iva2_grpsel = readl(resources->per_pm_base + 0xA8); + mpu_grpsel = readl(resources->per_pm_base + 0xA4); if (enable) { iva2_grpsel |= OMAP3430_GRPSEL_MCBSP5_MASK; mpu_grpsel &= ~OMAP3430_GRPSEL_MCBSP5_MASK; @@ -547,8 +547,8 @@ void dsp_clk_wakeup_event_ctrl(u32 clock_id, bool enable) mpu_grpsel |= OMAP3430_GRPSEL_MCBSP5_MASK; iva2_grpsel &= ~OMAP3430_GRPSEL_MCBSP5_MASK; } - writel(iva2_grpsel, resources->dw_per_pm_base + 0xA8); - writel(mpu_grpsel, resources->dw_per_pm_base + 0xA4); + writel(iva2_grpsel, resources->per_pm_base + 0xA8); + writel(mpu_grpsel, resources->per_pm_base + 0xA4); break; } } diff --git a/drivers/staging/tidspbridge/core/tiomap_io.c b/drivers/staging/tidspbridge/core/tiomap_io.c index 09c9e87..574fead 100644 --- a/drivers/staging/tidspbridge/core/tiomap_io.c +++ b/drivers/staging/tidspbridge/core/tiomap_io.c @@ -197,16 +197,16 @@ int write_dsp_data(struct bridge_dev_context *dev_context, offset = dsp_addr - dev_context->dsp_start_add; if (offset < base1) { - dw_base_addr = MEM_LINEAR_ADDRESS(resources->dw_mem_base[2], - resources->dw_mem_length[2]); + dw_base_addr = MEM_LINEAR_ADDRESS(resources->mem_base[2], + resources->mem_length[2]); } else if (offset > base1 && offset < base2 + OMAP_DSP_MEM2_SIZE) { - dw_base_addr = MEM_LINEAR_ADDRESS(resources->dw_mem_base[3], - resources->dw_mem_length[3]); + dw_base_addr = MEM_LINEAR_ADDRESS(resources->mem_base[3], + resources->mem_length[3]); offset = offset - base2; } else if (offset >= base2 + OMAP_DSP_MEM2_SIZE && offset < base3 + OMAP_DSP_MEM3_SIZE) { - dw_base_addr = MEM_LINEAR_ADDRESS(resources->dw_mem_base[4], - resources->dw_mem_length[4]); + dw_base_addr = MEM_LINEAR_ADDRESS(resources->mem_base[4], + resources->mem_length[4]); offset = offset - base3; } else { return -EPERM; @@ -339,7 +339,7 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context, dw_ext_prog_virt_mem = dev_context->atlb_entry[0].ul_gpp_va; } else { - dw_ext_prog_virt_mem = host_res->dw_mem_base[1]; + dw_ext_prog_virt_mem = host_res->mem_base[1]; dw_ext_prog_virt_mem += (ul_ext_base - ul_dyn_ext_base); } @@ -437,7 +437,7 @@ int sm_interrupt_dsp(struct bridge_dev_context *dev_context, u16 mb_val) omap_mbox_restore_ctx(dev_context->mbox); /* Access MMU SYS CONFIG register to generate a short wakeup */ - temp = readl(resources->dw_dmmu_base + 0x10); + temp = readl(resources->dmmu_base + 0x10); dev_context->brd_state = BRD_RUNNING; } else if (dev_context->brd_state == BRD_RETENTION) { diff --git a/drivers/staging/tidspbridge/core/ue_deh.c b/drivers/staging/tidspbridge/core/ue_deh.c index 875a65c..bc2feff 100644 --- a/drivers/staging/tidspbridge/core/ue_deh.c +++ b/drivers/staging/tidspbridge/core/ue_deh.c @@ -59,9 +59,9 @@ static irqreturn_t mmu_fault_isr(int irq, void *data) return IRQ_HANDLED; } - hw_mmu_event_status(resources->dw_dmmu_base, &event); + hw_mmu_event_status(resources->dmmu_base, &event); if (event == HW_MMU_TRANSLATION_FAULT) { - hw_mmu_fault_addr_read(resources->dw_dmmu_base, &fault_addr); + hw_mmu_fault_addr_read(resources->dmmu_base, &fault_addr); dev_dbg(bridge, "%s: event=0x%x, fault_addr=0x%x\n", __func__, event, fault_addr); /* @@ -73,10 +73,10 @@ static irqreturn_t mmu_fault_isr(int irq, void *data) /* Disable the MMU events, else once we clear it will * start to raise INTs again */ - hw_mmu_event_disable(resources->dw_dmmu_base, + hw_mmu_event_disable(resources->dmmu_base, HW_MMU_TRANSLATION_FAULT); } else { - hw_mmu_event_disable(resources->dw_dmmu_base, + hw_mmu_event_disable(resources->dmmu_base, HW_MMU_ALL_INTERRUPTS); } return IRQ_HANDLED; @@ -185,10 +185,10 @@ static void mmu_fault_print_stack(struct bridge_dev_context *dev_context) * access entry #0. Then add a new entry so that the DSP OS * can continue in order to dump the stack. */ - hw_mmu_twl_disable(resources->dw_dmmu_base); - hw_mmu_tlb_flush_all(resources->dw_dmmu_base); + hw_mmu_twl_disable(resources->dmmu_base); + hw_mmu_tlb_flush_all(resources->dmmu_base); - hw_mmu_tlb_add(resources->dw_dmmu_base, + hw_mmu_tlb_add(resources->dmmu_base, virt_to_phys(dummy_va_addr), fault_addr, HW_PAGE_SIZE4KB, 1, &map_attrs, HW_SET, HW_SET); @@ -198,12 +198,12 @@ static void mmu_fault_print_stack(struct bridge_dev_context *dev_context) dsp_gpt_wait_overflow(DSP_CLK_GPT8, 0xfffffffe); /* Clear MMU interrupt */ - hw_mmu_event_ack(resources->dw_dmmu_base, + hw_mmu_event_ack(resources->dmmu_base, HW_MMU_TRANSLATION_FAULT); dump_dsp_stack(dev_context); dsp_clk_disable(DSP_CLK_GPT8); - hw_mmu_disable(resources->dw_dmmu_base); + hw_mmu_disable(resources->dmmu_base); free_page((unsigned long)dummy_va_addr); } #endif diff --git a/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h b/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h index 14b0567..ea54738 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h @@ -119,8 +119,8 @@ struct chnl_mgr { struct dev_object *hdev_obj; /* These fields initialized in bridge_chnl_create(): */ - u32 dw_output_mask; /* Host output channels w/ full buffers */ - u32 dw_last_output; /* Last output channel fired from DPC */ + u32 output_mask; /* Host output channels w/ full buffers */ + u32 last_output; /* Last output channel fired from DPC */ /* Critical section object handle */ spinlock_t chnl_mgr_lock; u32 word_size; /* Size in bytes of DSP word */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h b/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h index f7c105a..60a2781 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/cfgdefs.h @@ -34,28 +34,28 @@ struct cfg_devnode; struct cfg_hostres { u32 num_mem_windows; /* Set to default */ /* This is the base.memory */ - u32 dw_mem_base[CFG_MAXMEMREGISTERS]; /* shm virtual address */ - u32 dw_mem_length[CFG_MAXMEMREGISTERS]; /* Length of the Base */ - u32 dw_mem_phys[CFG_MAXMEMREGISTERS]; /* shm Physical address */ + u32 mem_base[CFG_MAXMEMREGISTERS]; /* shm virtual address */ + u32 mem_length[CFG_MAXMEMREGISTERS]; /* Length of the Base */ + u32 mem_phys[CFG_MAXMEMREGISTERS]; /* shm Physical address */ u8 birq_registers; /* IRQ Number */ u8 birq_attrib; /* IRQ Attribute */ - u32 dw_offset_for_monitor; /* The Shared memory starts from - * dw_mem_base + this offset */ + u32 offset_for_monitor; /* The Shared memory starts from + * mem_base + this offset */ /* * Info needed by NODE for allocating channels to communicate with RMS: * chnl_offset: Offset of RMS channels. Lower channels are * reserved. * chnl_buf_size: Size of channel buffer to send to RMS - * dw_num_chnls: Total number of channels + * num_chnls: Total number of channels * (including reserved). */ u32 chnl_offset; u32 chnl_buf_size; - u32 dw_num_chnls; - void __iomem *dw_per_base; - u32 dw_per_pm_base; + u32 num_chnls; + void __iomem *per_base; + u32 per_pm_base; u32 core_pm_base; - void __iomem *dw_dmmu_base; + void __iomem *dmmu_base; }; #endif /* CFGDEFS_ */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/chnlpriv.h b/drivers/staging/tidspbridge/include/dspbridge/chnlpriv.h index 1785c3e..29e66dd 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/chnlpriv.h +++ b/drivers/staging/tidspbridge/include/dspbridge/chnlpriv.h @@ -58,7 +58,7 @@ struct chnl_info { void *event_obj; /* Channel I/O completion event. */ /*Abstraction of I/O completion event. */ struct sync_object *sync_event; - s8 dw_mode; /* Channel mode. */ + s8 mode; /* Channel mode. */ u8 dw_state; /* Current channel state. */ u32 bytes_tx; /* Total bytes transferred. */ u32 cio_cs; /* Number of IOCs in queue. */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h b/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h index 943d91f..8cd1494 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h @@ -51,7 +51,7 @@ struct cmm_attrs { */ struct cmm_seginfo { - u32 dw_seg_base_pa; /* Start Phys address of SM segment */ + u32 seg_base_pa; /* Start Phys address of SM segment */ /* Total size in bytes of segment: DSP+GPP */ u32 ul_total_seg_size; u32 gpp_base_pa; /* Start Phys addr of Gpp SM seg */ diff --git a/drivers/staging/tidspbridge/pmgr/cmm.c b/drivers/staging/tidspbridge/pmgr/cmm.c index f7542a5..d2fb6a4 100644 --- a/drivers/staging/tidspbridge/pmgr/cmm.c +++ b/drivers/staging/tidspbridge/pmgr/cmm.c @@ -49,7 +49,7 @@ #include /* ----------------------------------- Defines, Data Structures, Typedefs */ -#define NEXT_PA(pnode) (pnode->dw_pa + pnode->ul_size) +#define NEXT_PA(pnode) (pnode->pa + pnode->ul_size) /* Other bus/platform translations */ #define DSPPA2GPPPA(base, x, y) ((x)+(y)) @@ -99,7 +99,7 @@ struct cmm_object { struct mutex cmm_lock; /* Lock to access cmm mgr */ struct list_head node_free_list; /* Free list of memory nodes */ u32 ul_min_block_size; /* Min SM block; default 16 bytes */ - u32 dw_page_size; /* Memory Page size (1k/4k) */ + u32 page_size; /* Memory Page size (1k/4k) */ /* GPP SM segment ptrs */ struct cmm_allocator *pa_gppsm_seg_tab[CMM_MAXGPPSEGS]; }; @@ -128,7 +128,7 @@ static struct cmm_xlatorattrs cmm_dfltxlatorattrs = { /* SM node representing a block of memory. */ struct cmm_mnode { struct list_head link; /* must be 1st element */ - u32 dw_pa; /* Phys addr */ + u32 pa; /* Phys addr */ u32 dw_va; /* Virtual address in device process context */ u32 ul_size; /* SM block size in bytes */ u32 client_proc; /* Process that allocated this mem block */ @@ -199,7 +199,7 @@ void *cmm_calloc_buf(struct cmm_object *hcmm_mgr, u32 usize, /* create a new block with the leftovers and * add to freelist */ new_node = - get_node(cmm_mgr_obj, pnode->dw_pa + usize, + get_node(cmm_mgr_obj, pnode->pa + usize, pnode->dw_va + usize, (u32) delta_size); /* leftovers go free */ @@ -216,7 +216,7 @@ void *cmm_calloc_buf(struct cmm_object *hcmm_mgr, u32 usize, /* put our node on InUse list */ list_add_tail(&pnode->link, &allocator->in_use_list); - buf_pa = (void *)pnode->dw_pa; /* physical address */ + buf_pa = (void *)pnode->pa; /* physical address */ /* clear mem */ pbyte = (u8 *) pnode->dw_va; for (cnt = 0; cnt < (s32) usize; cnt++, pbyte++) @@ -260,7 +260,7 @@ int cmm_create(struct cmm_object **ph_cmm_mgr, DBC_ASSERT(mgr_attrts->ul_min_block_size >= 4); /* save away smallest block allocation for this cmm mgr */ cmm_obj->ul_min_block_size = mgr_attrts->ul_min_block_size; - cmm_obj->dw_page_size = PAGE_SIZE; + cmm_obj->page_size = PAGE_SIZE; /* create node free list */ INIT_LIST_HEAD(&cmm_obj->node_free_list); @@ -369,7 +369,7 @@ int cmm_free_buf(struct cmm_object *hcmm_mgr, void *buf_pa, u32 ul_seg_id) mutex_lock(&cmm_mgr_obj->cmm_lock); list_for_each_entry_safe(curr, tmp, &allocator->in_use_list, link) { - if (curr->dw_pa == (u32) buf_pa) { + if (curr->pa == (u32) buf_pa) { list_del(&curr->link); add_to_free_list(allocator, curr); status = 0; @@ -438,7 +438,7 @@ int cmm_get_info(struct cmm_object *hcmm_mgr, if (!altr) continue; cmm_info_obj->ul_num_gppsm_segs++; - cmm_info_obj->seg_info[ul_seg - 1].dw_seg_base_pa = + cmm_info_obj->seg_info[ul_seg - 1].seg_base_pa = altr->shm_base - altr->ul_dsp_size; cmm_info_obj->seg_info[ul_seg - 1].ul_total_seg_size = altr->ul_dsp_size + altr->ul_sm_size; @@ -704,7 +704,7 @@ static struct cmm_mnode *get_node(struct cmm_object *cmm_mgr_obj, u32 dw_pa, list_del_init(&pnode->link); } - pnode->dw_pa = dw_pa; + pnode->pa = dw_pa; pnode->dw_va = dw_va; pnode->ul_size = ul_size; @@ -763,13 +763,13 @@ static void add_to_free_list(struct cmm_allocator *allocator, } list_for_each_entry(curr, &allocator->free_list, link) { - if (NEXT_PA(curr) == node->dw_pa) { + if (NEXT_PA(curr) == node->pa) { curr->ul_size += node->ul_size; delete_node(allocator->hcmm_mgr, node); return; } - if (curr->dw_pa == NEXT_PA(node)) { - curr->dw_pa = node->dw_pa; + if (curr->pa == NEXT_PA(node)) { + curr->pa = node->pa; curr->dw_va = node->dw_va; curr->ul_size += node->ul_size; delete_node(allocator->hcmm_mgr, node); diff --git a/drivers/staging/tidspbridge/pmgr/dev.c b/drivers/staging/tidspbridge/pmgr/dev.c index 0f10a50..e328dc1 100644 --- a/drivers/staging/tidspbridge/pmgr/dev.c +++ b/drivers/staging/tidspbridge/pmgr/dev.c @@ -213,11 +213,11 @@ int dev_create_device(struct dev_object **device_obj, num_windows = host_res->num_mem_windows; if (num_windows) { /* Assume last memory window is for CHNL */ - io_mgr_attrs.shm_base = host_res->dw_mem_base[1] + - host_res->dw_offset_for_monitor; + io_mgr_attrs.shm_base = host_res->mem_base[1] + + host_res->offset_for_monitor; io_mgr_attrs.usm_length = - host_res->dw_mem_length[1] - - host_res->dw_offset_for_monitor; + host_res->mem_length[1] - + host_res->offset_for_monitor; } else { io_mgr_attrs.shm_base = 0; io_mgr_attrs.usm_length = 0; diff --git a/drivers/staging/tidspbridge/pmgr/dspapi.c b/drivers/staging/tidspbridge/pmgr/dspapi.c index 3efe1d5..5752438 100644 --- a/drivers/staging/tidspbridge/pmgr/dspapi.c +++ b/drivers/staging/tidspbridge/pmgr/dspapi.c @@ -68,7 +68,7 @@ /* Device IOCtl function pointer */ struct api_cmd { u32(*fxn) (union trapped_args *args, void *pr_ctxt); - u32 dw_index; + u32 index; }; /* ----------------------------------- Globals */ diff --git a/drivers/staging/tidspbridge/rmgr/drv.c b/drivers/staging/tidspbridge/rmgr/drv.c index 2e73302..9aacbcb 100644 --- a/drivers/staging/tidspbridge/rmgr/drv.c +++ b/drivers/staging/tidspbridge/rmgr/drv.c @@ -687,9 +687,9 @@ static int request_bridge_resources(struct cfg_hostres *res) host_res->num_mem_windows = 2; /* First window is for DSP internal memory */ - dev_dbg(bridge, "dw_mem_base[0] 0x%x\n", host_res->dw_mem_base[0]); - dev_dbg(bridge, "dw_mem_base[3] 0x%x\n", host_res->dw_mem_base[3]); - dev_dbg(bridge, "dw_dmmu_base %p\n", host_res->dw_dmmu_base); + dev_dbg(bridge, "mem_base[0] 0x%x\n", host_res->mem_base[0]); + dev_dbg(bridge, "mem_base[3] 0x%x\n", host_res->mem_base[3]); + dev_dbg(bridge, "dmmu_base %p\n", host_res->dmmu_base); /* for 24xx base port is not mapping the mamory for DSP * internal memory TODO Do a ioremap here */ @@ -698,10 +698,10 @@ static int request_bridge_resources(struct cfg_hostres *res) /* These are hard-coded values */ host_res->birq_registers = 0; host_res->birq_attrib = 0; - host_res->dw_offset_for_monitor = 0; + host_res->offset_for_monitor = 0; host_res->chnl_offset = 0; /* CHNL_MAXCHANNELS */ - host_res->dw_num_chnls = CHNL_MAXCHANNELS; + host_res->num_chnls = CHNL_MAXCHANNELS; host_res->chnl_buf_size = 0x400; return 0; @@ -730,51 +730,51 @@ int drv_request_bridge_res_dsp(void **phost_resources) /* num_mem_windows must not be more than CFG_MAXMEMREGISTERS */ host_res->num_mem_windows = 4; - host_res->dw_mem_base[0] = 0; - host_res->dw_mem_base[2] = (u32) ioremap(OMAP_DSP_MEM1_BASE, + host_res->mem_base[0] = 0; + host_res->mem_base[2] = (u32) ioremap(OMAP_DSP_MEM1_BASE, OMAP_DSP_MEM1_SIZE); - host_res->dw_mem_base[3] = (u32) ioremap(OMAP_DSP_MEM2_BASE, + host_res->mem_base[3] = (u32) ioremap(OMAP_DSP_MEM2_BASE, OMAP_DSP_MEM2_SIZE); - host_res->dw_mem_base[4] = (u32) ioremap(OMAP_DSP_MEM3_BASE, + host_res->mem_base[4] = (u32) ioremap(OMAP_DSP_MEM3_BASE, OMAP_DSP_MEM3_SIZE); - host_res->dw_per_base = ioremap(OMAP_PER_CM_BASE, + host_res->per_base = ioremap(OMAP_PER_CM_BASE, OMAP_PER_CM_SIZE); - host_res->dw_per_pm_base = (u32) ioremap(OMAP_PER_PRM_BASE, + host_res->per_pm_base = (u32) ioremap(OMAP_PER_PRM_BASE, OMAP_PER_PRM_SIZE); host_res->core_pm_base = (u32) ioremap(OMAP_CORE_PRM_BASE, OMAP_CORE_PRM_SIZE); - host_res->dw_dmmu_base = ioremap(OMAP_DMMU_BASE, + host_res->dmmu_base = ioremap(OMAP_DMMU_BASE, OMAP_DMMU_SIZE); - dev_dbg(bridge, "dw_mem_base[0] 0x%x\n", - host_res->dw_mem_base[0]); - dev_dbg(bridge, "dw_mem_base[1] 0x%x\n", - host_res->dw_mem_base[1]); - dev_dbg(bridge, "dw_mem_base[2] 0x%x\n", - host_res->dw_mem_base[2]); - dev_dbg(bridge, "dw_mem_base[3] 0x%x\n", - host_res->dw_mem_base[3]); - dev_dbg(bridge, "dw_mem_base[4] 0x%x\n", - host_res->dw_mem_base[4]); - dev_dbg(bridge, "dw_dmmu_base %p\n", host_res->dw_dmmu_base); + dev_dbg(bridge, "mem_base[0] 0x%x\n", + host_res->mem_base[0]); + dev_dbg(bridge, "mem_base[1] 0x%x\n", + host_res->mem_base[1]); + dev_dbg(bridge, "mem_base[2] 0x%x\n", + host_res->mem_base[2]); + dev_dbg(bridge, "mem_base[3] 0x%x\n", + host_res->mem_base[3]); + dev_dbg(bridge, "mem_base[4] 0x%x\n", + host_res->mem_base[4]); + dev_dbg(bridge, "dmmu_base %p\n", host_res->dmmu_base); shm_size = drv_datap->shm_size; if (shm_size >= 0x10000) { /* Allocate Physically contiguous, * non-cacheable memory */ - host_res->dw_mem_base[1] = + host_res->mem_base[1] = (u32) mem_alloc_phys_mem(shm_size, 0x100000, &dma_addr); - if (host_res->dw_mem_base[1] == 0) { + if (host_res->mem_base[1] == 0) { status = -ENOMEM; pr_err("shm reservation Failed\n"); } else { - host_res->dw_mem_length[1] = shm_size; - host_res->dw_mem_phys[1] = dma_addr; + host_res->mem_length[1] = shm_size; + host_res->mem_phys[1] = dma_addr; dev_dbg(bridge, "%s: Bridge shm address 0x%x " "dma_addr %x size %x\n", __func__, - host_res->dw_mem_base[1], + host_res->mem_base[1], dma_addr, shm_size); } } @@ -782,10 +782,10 @@ int drv_request_bridge_res_dsp(void **phost_resources) /* These are hard-coded values */ host_res->birq_registers = 0; host_res->birq_attrib = 0; - host_res->dw_offset_for_monitor = 0; + host_res->offset_for_monitor = 0; host_res->chnl_offset = 0; /* CHNL_MAXCHANNELS */ - host_res->dw_num_chnls = CHNL_MAXCHANNELS; + host_res->num_chnls = CHNL_MAXCHANNELS; host_res->chnl_buf_size = 0x400; dw_buff_size = sizeof(struct cfg_hostres); } diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c index 5a045c7..454fcc8 100644 --- a/drivers/staging/tidspbridge/rmgr/node.c +++ b/drivers/staging/tidspbridge/rmgr/node.c @@ -621,7 +621,7 @@ func_cont: goto func_end; } - ul_gpp_mem_base = (u32) host_res->dw_mem_base[1]; + ul_gpp_mem_base = (u32) host_res->mem_base[1]; off_set = pul_value - dynext_base; ul_stack_seg_addr = ul_gpp_mem_base + off_set; ul_stack_seg_val = readl(ul_stack_seg_addr); @@ -2904,7 +2904,7 @@ static int get_proc_props(struct node_mgr *hnode_mgr, return -EPERM; hnode_mgr->ul_chnl_offset = host_res->chnl_offset; hnode_mgr->ul_chnl_buf_size = host_res->chnl_buf_size; - hnode_mgr->ul_num_chnls = host_res->dw_num_chnls; + hnode_mgr->ul_num_chnls = host_res->num_chnls; /* * PROC will add an API to get dsp_processorinfo. -- cgit v0.10.2 From 3c882de542f67d0a7768f2e64c017e3657b519b3 Mon Sep 17 00:00:00 2001 From: Rene Sapiens Date: Tue, 18 Jan 2011 03:19:05 +0000 Subject: staging: tidspbridge: set3 remove hungarian from structs hungarian notation will be removed from the elements inside structures, the next varibles will be renamed: Original: Replacement: dw_seg_base_va seg_base_va dw_self_loop self_loop dw_state state dw_tc_endianism tc_endianism dw_test_base test_base dw_type type dw_val1 val1 dw_val2 val2 dw_val3 val3 dw_va va dw_virt_base virt_base dw_vm_base vm_base dw_vm_size vm_size pfn_allocate allocate pfn_brd_mem_copy brd_mem_copy pfn_brd_mem_map brd_mem_map pfn_brd_mem_un_map brd_mem_un_map pfn_brd_mem_write brd_mem_write pfn_brd_monitor brd_monitor pfn_brd_read brd_read Signed-off-by: Rene Sapiens Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/core/_tiomap.h b/drivers/staging/tidspbridge/core/_tiomap.h index 5a14e6f..60d9876 100644 --- a/drivers/staging/tidspbridge/core/_tiomap.h +++ b/drivers/staging/tidspbridge/core/_tiomap.h @@ -332,9 +332,9 @@ struct bridge_dev_context { u32 dsp_clk_m2_base; /* DSP Clock Module m2 */ u32 public_rhea; /* Pub Rhea */ u32 int_addr; /* MB INTR reg */ - u32 dw_tc_endianism; /* TC Endianism register */ - u32 dw_test_base; /* DSP MMU Mapped registers */ - u32 dw_self_loop; /* Pointer to the selfloop */ + u32 tc_endianism; /* TC Endianism register */ + u32 test_base; /* DSP MMU Mapped registers */ + u32 self_loop; /* Pointer to the selfloop */ u32 dsp_start_add; /* API Boot vector */ u32 internal_size; /* Internal memory size */ diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c b/drivers/staging/tidspbridge/core/chnl_sm.c index 59b8d55..c204315 100644 --- a/drivers/staging/tidspbridge/core/chnl_sm.c +++ b/drivers/staging/tidspbridge/core/chnl_sm.c @@ -115,7 +115,7 @@ int bridge_chnl_add_io_req(struct chnl_object *chnl_obj, void *host_buf, * Check the channel state: only queue chirp if channel state * allows it. */ - dw_state = pchnl->dw_state; + dw_state = pchnl->state; if (dw_state != CHNL_STATEREADY) { if (dw_state & CHNL_STATECANCEL) return -ECANCELED; @@ -207,7 +207,7 @@ func_cont: * more IOR's. */ if (is_eos) - pchnl->dw_state |= CHNL_STATEEOS; + pchnl->state |= CHNL_STATEEOS; /* Legacy DSM Processor-Copy */ DBC_ASSERT(pchnl->chnl_type == CHNL_PCPY); @@ -258,7 +258,7 @@ int bridge_chnl_cancel_io(struct chnl_object *chnl_obj) * IORequests or dispatching. */ spin_lock_bh(&chnl_mgr_obj->chnl_mgr_lock); - pchnl->dw_state |= CHNL_STATECANCEL; + pchnl->state |= CHNL_STATECANCEL; if (list_empty(&pchnl->pio_requests)) { spin_unlock_bh(&chnl_mgr_obj->chnl_mgr_lock); @@ -312,7 +312,7 @@ int bridge_chnl_close(struct chnl_object *chnl_obj) if (status) return status; /* Assert I/O on this channel is now cancelled: Protects from io_dpc */ - DBC_ASSERT((pchnl->dw_state & CHNL_STATECANCEL)); + DBC_ASSERT((pchnl->state & CHNL_STATECANCEL)); /* Invalidate channel object: Protects from CHNL_GetIOCompletion() */ /* Free the slot in the channel manager: */ pchnl->chnl_mgr_obj->ap_channel[pchnl->chnl_id] = NULL; @@ -381,7 +381,7 @@ int bridge_chnl_create(struct chnl_mgr **channel_mgr, * max_channels, GFP_KERNEL); if (chnl_mgr_obj->ap_channel) { /* Initialize chnl_mgr object */ - chnl_mgr_obj->dw_type = CHNL_TYPESM; + chnl_mgr_obj->type = CHNL_TYPESM; chnl_mgr_obj->word_size = mgr_attrts->word_size; /* Total # chnls supported */ chnl_mgr_obj->max_channels = max_channels; @@ -488,7 +488,7 @@ int bridge_chnl_flush_io(struct chnl_object *chnl_obj, u32 timeout) } else { status = bridge_chnl_cancel_io(chnl_obj); /* Now, leave the channel in the ready state: */ - pchnl->dw_state &= ~CHNL_STATECANCEL; + pchnl->state &= ~CHNL_STATECANCEL; } } DBC_ENSURE(status || list_empty(&pchnl->pio_requests)); @@ -517,7 +517,7 @@ int bridge_chnl_get_info(struct chnl_object *chnl_obj, channel_info->sync_event = pchnl->sync_event; channel_info->cio_cs = pchnl->cio_cs; channel_info->cio_reqs = pchnl->cio_reqs; - channel_info->dw_state = pchnl->dw_state; + channel_info->state = pchnl->state; } else { status = -EFAULT; } @@ -687,7 +687,7 @@ int bridge_chnl_get_mgr_info(struct chnl_mgr *hchnl_mgr, u32 ch_id, /* Return the requested information: */ mgr_info->chnl_obj = chnl_mgr_obj->ap_channel[ch_id]; mgr_info->open_channels = chnl_mgr_obj->open_channels; - mgr_info->dw_type = chnl_mgr_obj->dw_type; + mgr_info->type = chnl_mgr_obj->type; /* total # of chnls */ mgr_info->max_channels = chnl_mgr_obj->max_channels; @@ -718,7 +718,7 @@ int bridge_chnl_idle(struct chnl_object *chnl_obj, u32 timeout, /* Reset the byte count and put channel back in ready state. */ chnl_obj->bytes_moved = 0; - chnl_obj->dw_state &= ~CHNL_STATECANCEL; + chnl_obj->state &= ~CHNL_STATECANCEL; } return status; @@ -769,7 +769,7 @@ int bridge_chnl_open(struct chnl_object **chnl, return -ENOMEM; /* Protect queues from io_dpc: */ - pchnl->dw_state = CHNL_STATECANCEL; + pchnl->state = CHNL_STATECANCEL; /* Allocate initial IOR and IOC queues: */ status = create_chirp_list(&pchnl->free_packets_list, @@ -817,7 +817,7 @@ int bridge_chnl_open(struct chnl_object **chnl, chnl_mgr_obj->open_channels++; spin_unlock_bh(&chnl_mgr_obj->chnl_mgr_lock); /* Return result... */ - pchnl->dw_state = CHNL_STATEREADY; + pchnl->state = CHNL_STATEREADY; *chnl = pchnl; return status; diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index e89052c..38c59de 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c @@ -483,7 +483,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) 1)) == 0)) { status = hio_mgr->intf_fxns-> - pfn_brd_mem_map(hio_mgr->hbridge_context, + brd_mem_map(hio_mgr->hbridge_context, pa_curr, va_curr, page_size[i], map_attrs, NULL); @@ -549,7 +549,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) } else { status = hio_mgr->intf_fxns-> - pfn_brd_mem_map(hio_mgr->hbridge_context, + brd_mem_map(hio_mgr->hbridge_context, pa_curr, va_curr, page_size[i], map_attrs, NULL); @@ -615,7 +615,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) ae_proc[ndx].ul_dsp_va); ndx++; } else { - status = hio_mgr->intf_fxns->pfn_brd_mem_map + status = hio_mgr->intf_fxns->brd_mem_map (hio_mgr->hbridge_context, hio_mgr->ext_proc_info.ty_tlb[i]. ul_gpp_phys, @@ -637,7 +637,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) /* Map the L4 peripherals */ i = 0; while (l4_peripheral_table[i].phys_addr) { - status = hio_mgr->intf_fxns->pfn_brd_mem_map + status = hio_mgr->intf_fxns->brd_mem_map (hio_mgr->hbridge_context, l4_peripheral_table[i].phys_addr, l4_peripheral_table[i].dsp_virt_addr, HW_PAGE_SIZE4KB, map_attrs, NULL); @@ -977,8 +977,8 @@ void io_request_chnl(struct io_mgr *io_manager, struct chnl_object *pchnl, * Assertion fires if CHNL_AddIOReq() called on a stream * which was cancelled, or attached to a dead board. */ - DBC_ASSERT((pchnl->dw_state == CHNL_STATEREADY) || - (pchnl->dw_state == CHNL_STATEEOS)); + DBC_ASSERT((pchnl->state == CHNL_STATEREADY) || + (pchnl->state == CHNL_STATEEOS)); /* Indicate to the DSP we have a buffer available for input */ set_chnl_busy(sm, pchnl->chnl_id); *mbx_val = MBX_PCPY_CLASS; @@ -987,7 +987,7 @@ void io_request_chnl(struct io_mgr *io_manager, struct chnl_object *pchnl, * This assertion fails if CHNL_AddIOReq() was called on a * stream which was cancelled, or attached to a dead board. */ - DBC_ASSERT((pchnl->dw_state & ~CHNL_STATEEOS) == + DBC_ASSERT((pchnl->state & ~CHNL_STATEEOS) == CHNL_STATEREADY); /* * Record the fact that we have a buffer available for @@ -1092,7 +1092,7 @@ static void input_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, } pchnl = chnl_mgr_obj->ap_channel[chnl_id]; if ((pchnl != NULL) && CHNL_IS_INPUT(pchnl->chnl_mode)) { - if ((pchnl->dw_state & ~CHNL_STATEEOS) == CHNL_STATEREADY) { + if ((pchnl->state & ~CHNL_STATEEOS) == CHNL_STATEREADY) { /* Get the I/O request, and attempt a transfer */ if (!list_empty(&pchnl->pio_requests)) { if (!pchnl->cio_reqs) @@ -1122,7 +1122,7 @@ static void input_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, * sends EOS more than once on this * channel. */ - if (pchnl->dw_state & CHNL_STATEEOS) + if (pchnl->state & CHNL_STATEEOS) goto func_end; /* * Zero bytes indicates EOS. Update @@ -1131,7 +1131,7 @@ static void input_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, */ chnl_packet_obj->status |= CHNL_IOCSTATEOS; - pchnl->dw_state |= CHNL_STATEEOS; + pchnl->state |= CHNL_STATEEOS; /* * Notify that end of stream has * occurred. @@ -1329,7 +1329,7 @@ static void output_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, if (sm->output_full) goto func_end; - if (pchnl && !((pchnl->dw_state & ~CHNL_STATEEOS) == CHNL_STATEREADY)) + if (pchnl && !((pchnl->state & ~CHNL_STATEEOS) == CHNL_STATEREADY)) goto func_end; /* Look to see if both a PC and DSP output channel are ready */ @@ -1810,7 +1810,7 @@ int print_dsp_trace_buffer(struct bridge_dev_context *hbridge_context) psz_buf = kzalloc(ul_num_bytes + 2, GFP_ATOMIC); if (psz_buf != NULL) { /* Read trace buffer data */ - status = (*intf_fxns->pfn_brd_read)(pbridge_context, + status = (*intf_fxns->brd_read)(pbridge_context, (u8 *)psz_buf, (u32)ul_trace_begin, ul_num_bytes, 0); @@ -1825,7 +1825,7 @@ int print_dsp_trace_buffer(struct bridge_dev_context *hbridge_context) __func__, psz_buf); /* Read the value at the DSP address in trace_cur_pos. */ - status = (*intf_fxns->pfn_brd_read)(pbridge_context, + status = (*intf_fxns->brd_read)(pbridge_context, (u8 *)&trace_cur_pos, (u32)trace_cur_pos, 4, 0); if (status) @@ -1992,7 +1992,7 @@ int dump_dsp_stack(struct bridge_dev_context *bridge_context) poll_cnt < POLL_MAX) { /* Read DSP dump size from the DSP trace buffer... */ - status = (*intf_fxns->pfn_brd_read)(bridge_context, + status = (*intf_fxns->brd_read)(bridge_context, (u8 *)&mmu_fault_dbg_info, (u32)trace_begin, sizeof(mmu_fault_dbg_info), 0); @@ -2028,7 +2028,7 @@ int dump_dsp_stack(struct bridge_dev_context *bridge_context) buffer_end = buffer + total_size / 4; /* Read bytes from the DSP trace buffer... */ - status = (*intf_fxns->pfn_brd_read)(bridge_context, + status = (*intf_fxns->brd_read)(bridge_context, (u8 *)buffer, (u32)trace_begin, total_size, 0); if (status) { @@ -2189,7 +2189,7 @@ void dump_dl_modules(struct bridge_dev_context *bridge_context) pr_debug("%s: _DLModules at 0x%x\n", __func__, module_dsp_addr); /* Copy the modules_header structure from DSP memory. */ - status = (*intf_fxns->pfn_brd_read)(bridge_context, (u8 *) &modules_hdr, + status = (*intf_fxns->brd_read)(bridge_context, (u8 *) &modules_hdr, (u32) module_dsp_addr, sizeof(modules_hdr), 0); if (status) { @@ -2224,7 +2224,7 @@ void dump_dl_modules(struct bridge_dev_context *bridge_context) goto func_end; } /* Copy the dll_module structure from DSP memory */ - status = (*intf_fxns->pfn_brd_read)(bridge_context, + status = (*intf_fxns->brd_read)(bridge_context, (u8 *)module_struct, module_dsp_addr, module_size, 0); if (status) { diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c index 5964a13..8f39e11 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430.c +++ b/drivers/staging/tidspbridge/core/tiomap3430.c @@ -765,7 +765,7 @@ static int bridge_dev_create(struct bridge_dev_context } dev_context->dsp_start_add = (u32) OMAP_GEM_BASE; - dev_context->dw_self_loop = (u32) NULL; + dev_context->self_loop = (u32) NULL; dev_context->dsp_per_clks = 0; dev_context->internal_size = OMAP_DSP_SIZE; /* Clear dev context MMU table entries. diff --git a/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h b/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h index ea54738..318f6b0 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h @@ -127,7 +127,7 @@ struct chnl_mgr { u8 max_channels; /* Total number of channels */ u8 open_channels; /* Total number of open channels */ struct chnl_object **ap_channel; /* Array of channels */ - u8 dw_type; /* Type of channel class library */ + u8 type; /* Type of channel class library */ /* If no shm syms, return for CHNL_Open */ int chnl_open_status; }; @@ -140,7 +140,7 @@ struct chnl_object { /* Pointer back to channel manager */ struct chnl_mgr *chnl_mgr_obj; u32 chnl_id; /* Channel id */ - u8 dw_state; /* Current channel state */ + u8 state; /* Current channel state */ s8 chnl_mode; /* Chnl mode and attributes */ /* Chnl I/O completion event (user mode) */ void *user_event; diff --git a/drivers/staging/tidspbridge/include/dspbridge/chnlpriv.h b/drivers/staging/tidspbridge/include/dspbridge/chnlpriv.h index 29e66dd..e79cbd5 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/chnlpriv.h +++ b/drivers/staging/tidspbridge/include/dspbridge/chnlpriv.h @@ -59,7 +59,7 @@ struct chnl_info { /*Abstraction of I/O completion event. */ struct sync_object *sync_event; s8 mode; /* Channel mode. */ - u8 dw_state; /* Current channel state. */ + u8 state; /* Current channel state. */ u32 bytes_tx; /* Total bytes transferred. */ u32 cio_cs; /* Number of IOCs in queue. */ u32 cio_reqs; /* Number of IO Requests in queue. */ @@ -68,7 +68,7 @@ struct chnl_info { /* Channel manager info: */ struct chnl_mgrinfo { - u8 dw_type; /* Type of channel class library. */ + u8 type; /* Type of channel class library. */ /* Channel handle, given the channel id. */ struct chnl_object *chnl_obj; u8 open_channels; /* Number of open channels. */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h b/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h index 8cd1494..719628e 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h @@ -60,7 +60,7 @@ struct cmm_seginfo { u32 ul_dsp_size; /* DSP seg size in bytes */ /* # of current GPP allocations from this segment */ u32 ul_in_use_cnt; - u32 dw_seg_base_va; /* Start Virt address of SM seg */ + u32 seg_base_va; /* Start Virt address of SM seg */ }; @@ -83,8 +83,8 @@ struct cmm_xlatorattrs { u32 dsp_buf_size; /* size of DSP-side bufs in GPP bytes */ /* Vm base address alloc'd in client process context */ void *vm_base; - /* dw_vm_size must be >= (dwMaxNumBufs * dwMaxSize) */ - u32 dw_vm_size; + /* vm_size must be >= (dwMaxNumBufs * dwMaxSize) */ + u32 vm_size; }; /* diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h index 6ba66c5..7a0573d 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h @@ -369,9 +369,9 @@ struct dsp_processorinfo { /* Error information of last DSP exception signalled to the GPP */ struct dsp_errorinfo { u32 err_mask; - u32 dw_val1; - u32 dw_val2; - u32 dw_val3; + u32 val1; + u32 val2; + u32 val3; }; /* The dsp_processorstate structure describes the state of a DSP processor */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h b/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h index 4eaeb21..380d888 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h @@ -978,17 +978,17 @@ struct bridge_drv_interface { fxn_dev_create pfn_dev_create; /* Create device context */ fxn_dev_destroy pfn_dev_destroy; /* Destroy device context */ fxn_dev_ctrl pfn_dev_cntrl; /* Optional vendor interface */ - fxn_brd_monitor pfn_brd_monitor; /* Load and/or start monitor */ + fxn_brd_monitor brd_monitor; /* Load and/or start monitor */ fxn_brd_start pfn_brd_start; /* Start DSP program. */ fxn_brd_stop pfn_brd_stop; /* Stop/reset board. */ fxn_brd_status pfn_brd_status; /* Get current board status. */ - fxn_brd_read pfn_brd_read; /* Read board memory */ + fxn_brd_read brd_read; /* Read board memory */ fxn_brd_write pfn_brd_write; /* Write board memory. */ fxn_brd_setstate pfn_brd_set_state; /* Sets the Board State */ - fxn_brd_memcopy pfn_brd_mem_copy; /* Copies DSP Memory */ - fxn_brd_memwrite pfn_brd_mem_write; /* Write DSP Memory w/o halt */ - fxn_brd_memmap pfn_brd_mem_map; /* Maps MPU mem to DSP mem */ - fxn_brd_memunmap pfn_brd_mem_un_map; /* Unmaps MPU mem to DSP mem */ + fxn_brd_memcopy brd_mem_copy; /* Copies DSP Memory */ + fxn_brd_memwrite brd_mem_write; /* Write DSP Memory w/o halt */ + fxn_brd_memmap brd_mem_map; /* Maps MPU mem to DSP mem */ + fxn_brd_memunmap brd_mem_un_map; /* Unmaps MPU mem to DSP mem */ fxn_chnl_create pfn_chnl_create; /* Create channel manager. */ fxn_chnl_destroy pfn_chnl_destroy; /* Destroy channel manager. */ fxn_chnl_open pfn_chnl_open; /* Create a new channel. */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h b/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h index c85d3da..b1a9072 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h @@ -280,7 +280,7 @@ typedef int(*nldr_unloadfxn) (struct nldr_nodeobject *nldr_node_obj, * ======== node_ldr_fxns ======== */ struct node_ldr_fxns { - nldr_allocatefxn pfn_allocate; + nldr_allocatefxn allocate; nldr_createfxn pfn_create; nldr_deletefxn pfn_delete; nldr_exitfxn pfn_exit; diff --git a/drivers/staging/tidspbridge/pmgr/cmm.c b/drivers/staging/tidspbridge/pmgr/cmm.c index d2fb6a4..bc8571b 100644 --- a/drivers/staging/tidspbridge/pmgr/cmm.c +++ b/drivers/staging/tidspbridge/pmgr/cmm.c @@ -64,7 +64,7 @@ struct cmm_allocator { /* sma */ unsigned int shm_base; /* Start of physical SM block */ u32 ul_sm_size; /* Size of SM block in bytes */ - unsigned int dw_vm_base; /* Start of VM block. (Dev driver + unsigned int vm_base; /* Start of VM block. (Dev driver * context for 'sma') */ u32 dsp_phys_addr_offset; /* DSP PA to GPP PA offset for this * SM space */ @@ -86,7 +86,7 @@ struct cmm_xlator { /* Pa<->Va translator object */ * base address for translator's ul_seg_id. * Only 1 segment ID currently supported. */ - unsigned int dw_virt_base; /* virtual base address */ + unsigned int virt_base; /* virtual base address */ u32 ul_virt_size; /* size of virt space in bytes */ u32 ul_seg_id; /* Segment Id */ }; @@ -122,14 +122,14 @@ static struct cmm_xlatorattrs cmm_dfltxlatorattrs = { 0, /* dsp_bufs */ 0, /* dsp_buf_size */ NULL, /* vm_base */ - 0, /* dw_vm_size */ + 0, /* vm_size */ }; /* SM node representing a block of memory. */ struct cmm_mnode { struct list_head link; /* must be 1st element */ u32 pa; /* Phys addr */ - u32 dw_va; /* Virtual address in device process context */ + u32 va; /* Virtual address in device process context */ u32 ul_size; /* SM block size in bytes */ u32 client_proc; /* Process that allocated this mem block */ }; @@ -200,7 +200,7 @@ void *cmm_calloc_buf(struct cmm_object *hcmm_mgr, u32 usize, * add to freelist */ new_node = get_node(cmm_mgr_obj, pnode->pa + usize, - pnode->dw_va + usize, + pnode->va + usize, (u32) delta_size); /* leftovers go free */ add_to_free_list(allocator, new_node); @@ -218,13 +218,13 @@ void *cmm_calloc_buf(struct cmm_object *hcmm_mgr, u32 usize, list_add_tail(&pnode->link, &allocator->in_use_list); buf_pa = (void *)pnode->pa; /* physical address */ /* clear mem */ - pbyte = (u8 *) pnode->dw_va; + pbyte = (u8 *) pnode->va; for (cnt = 0; cnt < (s32) usize; cnt++, pbyte++) *pbyte = 0; if (pp_buf_va != NULL) { /* Virtual address */ - *pp_buf_va = (void *)pnode->dw_va; + *pp_buf_va = (void *)pnode->va; } } mutex_unlock(&cmm_mgr_obj->cmm_lock); @@ -450,8 +450,8 @@ int cmm_get_info(struct cmm_object *hcmm_mgr, altr->dsp_base; cmm_info_obj->seg_info[ul_seg - 1].ul_dsp_size = altr->ul_dsp_size; - cmm_info_obj->seg_info[ul_seg - 1].dw_seg_base_va = - altr->dw_vm_base - altr->ul_dsp_size; + cmm_info_obj->seg_info[ul_seg - 1].seg_base_va = + altr->vm_base - altr->ul_dsp_size; cmm_info_obj->seg_info[ul_seg - 1].ul_in_use_cnt = 0; list_for_each_entry(curr, &altr->in_use_list, link) { @@ -539,12 +539,12 @@ int cmm_register_gppsm_seg(struct cmm_object *hcmm_mgr, psma->hcmm_mgr = hcmm_mgr; /* ref to parent */ psma->shm_base = dw_gpp_base_pa; /* SM Base phys */ psma->ul_sm_size = ul_size; /* SM segment size in bytes */ - psma->dw_vm_base = gpp_base_va; + psma->vm_base = gpp_base_va; psma->dsp_phys_addr_offset = dsp_addr_offset; psma->c_factor = c_factor; psma->dsp_base = dw_dsp_base; psma->ul_dsp_size = ul_dsp_size; - if (psma->dw_vm_base == 0) { + if (psma->vm_base == 0) { status = -EPERM; goto func_end; } @@ -556,7 +556,7 @@ int cmm_register_gppsm_seg(struct cmm_object *hcmm_mgr, /* Get a mem node for this hunk-o-memory */ new_node = get_node(cmm_mgr_obj, dw_gpp_base_pa, - psma->dw_vm_base, ul_size); + psma->vm_base, ul_size); /* Place node on the SM allocator's free list */ if (new_node) { list_add_tail(&new_node->link, &psma->free_list); @@ -649,8 +649,8 @@ static void un_register_gppsm_seg(struct cmm_allocator *psma) kfree(curr); } - if ((void *)psma->dw_vm_base != NULL) - MEM_UNMAP_LINEAR_ADDRESS((void *)psma->dw_vm_base); + if ((void *)psma->vm_base != NULL) + MEM_UNMAP_LINEAR_ADDRESS((void *)psma->vm_base); /* Free allocator itself */ kfree(psma); @@ -705,7 +705,7 @@ static struct cmm_mnode *get_node(struct cmm_object *cmm_mgr_obj, u32 dw_pa, } pnode->pa = dw_pa; - pnode->dw_va = dw_va; + pnode->va = dw_va; pnode->ul_size = ul_size; return pnode; @@ -770,7 +770,7 @@ static void add_to_free_list(struct cmm_allocator *allocator, } if (curr->pa == NEXT_PA(node)) { curr->pa = node->pa; - curr->dw_va = node->dw_va; + curr->va = node->va; curr->ul_size += node->ul_size; delete_node(allocator->hcmm_mgr, node); return; @@ -925,10 +925,10 @@ int cmm_xlator_info(struct cmm_xlatorobject *xlator, u8 ** paddr, if (xlator_obj) { if (set_info) { /* set translators virtual address range */ - xlator_obj->dw_virt_base = (u32) *paddr; + xlator_obj->virt_base = (u32) *paddr; xlator_obj->ul_virt_size = ul_size; } else { /* return virt base address */ - *paddr = (u8 *) xlator_obj->dw_virt_base; + *paddr = (u8 *) xlator_obj->virt_base; } } else { status = -EFAULT; @@ -969,18 +969,18 @@ void *cmm_xlator_translate(struct cmm_xlatorobject *xlator, void *paddr, dw_offset = (u8 *) paddr - (u8 *) (allocator->shm_base - allocator-> ul_dsp_size); - dw_addr_xlate = xlator_obj->dw_virt_base + dw_offset; + dw_addr_xlate = xlator_obj->virt_base + dw_offset; /* Check if translated Va base is in range */ - if ((dw_addr_xlate < xlator_obj->dw_virt_base) || + if ((dw_addr_xlate < xlator_obj->virt_base) || (dw_addr_xlate >= - (xlator_obj->dw_virt_base + + (xlator_obj->virt_base + xlator_obj->ul_virt_size))) { dw_addr_xlate = 0; /* bad address */ } } else { /* Gpp PA = Gpp Base + offset */ dw_offset = - (u8 *) paddr - (u8 *) xlator_obj->dw_virt_base; + (u8 *) paddr - (u8 *) xlator_obj->virt_base; dw_addr_xlate = allocator->shm_base - allocator->ul_dsp_size + dw_offset; diff --git a/drivers/staging/tidspbridge/pmgr/dev.c b/drivers/staging/tidspbridge/pmgr/dev.c index e328dc1..63ca8c7 100644 --- a/drivers/staging/tidspbridge/pmgr/dev.c +++ b/drivers/staging/tidspbridge/pmgr/dev.c @@ -1082,17 +1082,17 @@ static void store_interface_fxns(struct bridge_drv_interface *drv_fxns, STORE_FXN(fxn_dev_create, pfn_dev_create); STORE_FXN(fxn_dev_destroy, pfn_dev_destroy); STORE_FXN(fxn_dev_ctrl, pfn_dev_cntrl); - STORE_FXN(fxn_brd_monitor, pfn_brd_monitor); + STORE_FXN(fxn_brd_monitor, brd_monitor); STORE_FXN(fxn_brd_start, pfn_brd_start); STORE_FXN(fxn_brd_stop, pfn_brd_stop); STORE_FXN(fxn_brd_status, pfn_brd_status); - STORE_FXN(fxn_brd_read, pfn_brd_read); + STORE_FXN(fxn_brd_read, brd_read); STORE_FXN(fxn_brd_write, pfn_brd_write); STORE_FXN(fxn_brd_setstate, pfn_brd_set_state); - STORE_FXN(fxn_brd_memcopy, pfn_brd_mem_copy); - STORE_FXN(fxn_brd_memwrite, pfn_brd_mem_write); - STORE_FXN(fxn_brd_memmap, pfn_brd_mem_map); - STORE_FXN(fxn_brd_memunmap, pfn_brd_mem_un_map); + STORE_FXN(fxn_brd_memcopy, brd_mem_copy); + STORE_FXN(fxn_brd_memwrite, brd_mem_write); + STORE_FXN(fxn_brd_memmap, brd_mem_map); + STORE_FXN(fxn_brd_memunmap, brd_mem_un_map); STORE_FXN(fxn_chnl_create, pfn_chnl_create); STORE_FXN(fxn_chnl_destroy, pfn_chnl_destroy); STORE_FXN(fxn_chnl_open, pfn_chnl_open); @@ -1123,11 +1123,11 @@ static void store_interface_fxns(struct bridge_drv_interface *drv_fxns, DBC_ENSURE(intf_fxns->pfn_dev_create != NULL); DBC_ENSURE(intf_fxns->pfn_dev_destroy != NULL); DBC_ENSURE(intf_fxns->pfn_dev_cntrl != NULL); - DBC_ENSURE(intf_fxns->pfn_brd_monitor != NULL); + DBC_ENSURE(intf_fxns->brd_monitor != NULL); DBC_ENSURE(intf_fxns->pfn_brd_start != NULL); DBC_ENSURE(intf_fxns->pfn_brd_stop != NULL); DBC_ENSURE(intf_fxns->pfn_brd_status != NULL); - DBC_ENSURE(intf_fxns->pfn_brd_read != NULL); + DBC_ENSURE(intf_fxns->brd_read != NULL); DBC_ENSURE(intf_fxns->pfn_brd_write != NULL); DBC_ENSURE(intf_fxns->pfn_chnl_create != NULL); DBC_ENSURE(intf_fxns->pfn_chnl_destroy != NULL); diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c index 454fcc8..8dd0578 100644 --- a/drivers/staging/tidspbridge/rmgr/node.c +++ b/drivers/staging/tidspbridge/rmgr/node.c @@ -575,7 +575,7 @@ func_cont: if (!status) { /* Create object for dynamic loading */ - status = hnode_mgr->nldr_fxns.pfn_allocate(hnode_mgr->nldr_obj, + status = hnode_mgr->nldr_fxns.allocate(hnode_mgr->nldr_obj, (void *)pnode, &pnode->dcd_props. obj_data.node_obj, @@ -3075,7 +3075,7 @@ static u32 ovly(void *priv_ref, u32 dsp_run_addr, u32 dsp_load_addr, status = dev_get_bridge_context(hnode_mgr->hdev_obj, &hbridge_context); if (!status) { status = - (*intf_fxns->pfn_brd_mem_copy) (hbridge_context, + (*intf_fxns->brd_mem_copy) (hbridge_context, dsp_run_addr, dsp_load_addr, ul_num_bytes, (u32) mem_space); if (!status) @@ -3117,7 +3117,7 @@ static u32 mem_write(void *priv_ref, u32 dsp_add, void *pbuf, /* Call new MemWrite function */ intf_fxns = hnode_mgr->intf_fxns; status = dev_get_bridge_context(hnode_mgr->hdev_obj, &hbridge_context); - status = (*intf_fxns->pfn_brd_mem_write) (hbridge_context, pbuf, + status = (*intf_fxns->brd_mem_write) (hbridge_context, pbuf, dsp_add, ul_num_bytes, mem_sect_type); return ul_num_bytes; diff --git a/drivers/staging/tidspbridge/rmgr/proc.c b/drivers/staging/tidspbridge/rmgr/proc.c index d5f6719..03bc214 100644 --- a/drivers/staging/tidspbridge/rmgr/proc.c +++ b/drivers/staging/tidspbridge/rmgr/proc.c @@ -1397,7 +1397,7 @@ int proc_map(void *hprocessor, void *pmpu_addr, u32 ul_size, if (!map_obj) status = -ENOMEM; else - status = (*p_proc_object->intf_fxns->pfn_brd_mem_map) + status = (*p_proc_object->intf_fxns->brd_mem_map) (p_proc_object->hbridge_context, pa_align, va_align, size_align, ul_map_attr, map_obj->pages); } @@ -1720,7 +1720,7 @@ int proc_un_map(void *hprocessor, void *map_addr, status = dmm_un_map_memory(dmm_mgr, (u32) va_align, &size_align); /* Remove mapping from the page tables. */ if (!status) { - status = (*p_proc_object->intf_fxns->pfn_brd_mem_un_map) + status = (*p_proc_object->intf_fxns->brd_mem_un_map) (p_proc_object->hbridge_context, va_align, size_align); } @@ -1828,7 +1828,7 @@ static int proc_monitor(struct proc_object *proc_obj) } } /* Place the Board in the Monitor State */ - if (!((*proc_obj->intf_fxns->pfn_brd_monitor) + if (!((*proc_obj->intf_fxns->brd_monitor) (proc_obj->hbridge_context))) { status = 0; if (!((*proc_obj->intf_fxns->pfn_brd_status) diff --git a/drivers/staging/tidspbridge/rmgr/strm.c b/drivers/staging/tidspbridge/rmgr/strm.c index d36b316..4adb7a0 100644 --- a/drivers/staging/tidspbridge/rmgr/strm.c +++ b/drivers/staging/tidspbridge/rmgr/strm.c @@ -344,7 +344,7 @@ int strm_get_info(struct strm_object *stream_obj, stream_info->user_strm->ul_number_bytes = chnl_info_obj.bytes_tx; stream_info->user_strm->sync_object_handle = chnl_info_obj.event_obj; /* Determine stream state based on channel state and info */ - if (chnl_info_obj.dw_state & CHNL_STATEEOS) { + if (chnl_info_obj.state & CHNL_STATEEOS) { stream_info->user_strm->ss_stream_state = STREAM_DONE; } else { if (chnl_info_obj.cio_cs > 0) -- cgit v0.10.2 From e17ba7f2020a38b3e5bc3f7cafc595d0ac639094 Mon Sep 17 00:00:00 2001 From: Rene Sapiens Date: Tue, 18 Jan 2011 03:19:06 +0000 Subject: staging: tidspbridge: set4 remove hungarian from structs hungarian notation will be removed from the elements inside structures, the next varibles will be renamed: Original: Replacement: pfn_brd_set_state brd_set_state pfn_brd_start brd_start pfn_brd_status brd_status pfn_brd_stop brd_stop pfn_brd_write brd_write pfn_chnl_add_io_req chnl_add_io_req pfn_chnl_cancel_io chnl_cancel_io pfn_chnl_close chnl_close pfn_chnl_create chnl_create pfn_chnl_destroy chnl_destroy pfn_chnl_flush_io chnl_flush_io pfn_chnl_get_info chnl_get_info pfn_chnl_get_ioc chnl_get_ioc pfn_chnl_get_mgr_info chnl_get_mgr_info pfn_chnl_idle chnl_idle pfn_chnl_open chnl_open pfn_chnl_register_notify chnl_register_notify pfn_create create pfn_delete delete pfn_dev_cntrl dev_cntrl Signed-off-by: Rene Sapiens Signed-off-by: Armando Uribe Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index 38c59de..77ae2da 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c @@ -683,7 +683,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) */ status = - hio_mgr->intf_fxns->pfn_dev_cntrl(hio_mgr->hbridge_context, + hio_mgr->intf_fxns->dev_cntrl(hio_mgr->hbridge_context, BRDIOCTL_SETMMUCONFIG, ae_proc); if (status) @@ -829,7 +829,7 @@ static void io_dispatch_pm(struct io_mgr *pio_mgr) if (parg[0] == MBX_PM_HIBERNATE_EN) { dev_dbg(bridge, "PM: Hibernate command\n"); status = pio_mgr->intf_fxns-> - pfn_dev_cntrl(pio_mgr->hbridge_context, + dev_cntrl(pio_mgr->hbridge_context, BRDIOCTL_PWR_HIBERNATE, parg); if (status) pr_err("%s: hibernate cmd failed 0x%x\n", @@ -838,7 +838,7 @@ static void io_dispatch_pm(struct io_mgr *pio_mgr) parg[1] = pio_mgr->shared_mem->opp_request.rqst_opp_pt; dev_dbg(bridge, "PM: Requested OPP = 0x%x\n", parg[1]); status = pio_mgr->intf_fxns-> - pfn_dev_cntrl(pio_mgr->hbridge_context, + dev_cntrl(pio_mgr->hbridge_context, BRDIOCTL_CONSTRAINT_REQUEST, parg); if (status) dev_dbg(bridge, "PM: Failed to set constraint " @@ -847,7 +847,7 @@ static void io_dispatch_pm(struct io_mgr *pio_mgr) dev_dbg(bridge, "PM: clk control value of msg = 0x%x\n", parg[0]); status = pio_mgr->intf_fxns-> - pfn_dev_cntrl(pio_mgr->hbridge_context, + dev_cntrl(pio_mgr->hbridge_context, BRDIOCTL_CLK_CTRL, parg); if (status) dev_dbg(bridge, "PM: Failed to ctrl the DSP clk" diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h b/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h index 380d888..749c25e 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h @@ -977,32 +977,32 @@ struct bridge_drv_interface { u32 brd_api_minor_version; /* Set to BRD_API_MINOR_VERSION. */ fxn_dev_create pfn_dev_create; /* Create device context */ fxn_dev_destroy pfn_dev_destroy; /* Destroy device context */ - fxn_dev_ctrl pfn_dev_cntrl; /* Optional vendor interface */ + fxn_dev_ctrl dev_cntrl; /* Optional vendor interface */ fxn_brd_monitor brd_monitor; /* Load and/or start monitor */ - fxn_brd_start pfn_brd_start; /* Start DSP program. */ - fxn_brd_stop pfn_brd_stop; /* Stop/reset board. */ - fxn_brd_status pfn_brd_status; /* Get current board status. */ + fxn_brd_start brd_start; /* Start DSP program. */ + fxn_brd_stop brd_stop; /* Stop/reset board. */ + fxn_brd_status brd_status; /* Get current board status. */ fxn_brd_read brd_read; /* Read board memory */ - fxn_brd_write pfn_brd_write; /* Write board memory. */ - fxn_brd_setstate pfn_brd_set_state; /* Sets the Board State */ + fxn_brd_write brd_write; /* Write board memory. */ + fxn_brd_setstate brd_set_state; /* Sets the Board State */ fxn_brd_memcopy brd_mem_copy; /* Copies DSP Memory */ fxn_brd_memwrite brd_mem_write; /* Write DSP Memory w/o halt */ fxn_brd_memmap brd_mem_map; /* Maps MPU mem to DSP mem */ fxn_brd_memunmap brd_mem_un_map; /* Unmaps MPU mem to DSP mem */ - fxn_chnl_create pfn_chnl_create; /* Create channel manager. */ - fxn_chnl_destroy pfn_chnl_destroy; /* Destroy channel manager. */ - fxn_chnl_open pfn_chnl_open; /* Create a new channel. */ - fxn_chnl_close pfn_chnl_close; /* Close a channel. */ - fxn_chnl_addioreq pfn_chnl_add_io_req; /* Req I/O on a channel. */ - fxn_chnl_getioc pfn_chnl_get_ioc; /* Wait for I/O completion. */ - fxn_chnl_cancelio pfn_chnl_cancel_io; /* Cancl I/O on a channel. */ - fxn_chnl_flushio pfn_chnl_flush_io; /* Flush I/O. */ - fxn_chnl_getinfo pfn_chnl_get_info; /* Get channel specific info */ + fxn_chnl_create chnl_create; /* Create channel manager. */ + fxn_chnl_destroy chnl_destroy; /* Destroy channel manager. */ + fxn_chnl_open chnl_open; /* Create a new channel. */ + fxn_chnl_close chnl_close; /* Close a channel. */ + fxn_chnl_addioreq chnl_add_io_req; /* Req I/O on a channel. */ + fxn_chnl_getioc chnl_get_ioc; /* Wait for I/O completion. */ + fxn_chnl_cancelio chnl_cancel_io; /* Cancl I/O on a channel. */ + fxn_chnl_flushio chnl_flush_io; /* Flush I/O. */ + fxn_chnl_getinfo chnl_get_info; /* Get channel specific info */ /* Get channel manager info. */ - fxn_chnl_getmgrinfo pfn_chnl_get_mgr_info; - fxn_chnl_idle pfn_chnl_idle; /* Idle the channel */ + fxn_chnl_getmgrinfo chnl_get_mgr_info; + fxn_chnl_idle chnl_idle; /* Idle the channel */ /* Register for notif. */ - fxn_chnl_registernotify pfn_chnl_register_notify; + fxn_chnl_registernotify chnl_register_notify; fxn_io_create pfn_io_create; /* Create IO manager */ fxn_io_destroy pfn_io_destroy; /* Destroy IO manager */ fxn_io_onloaded pfn_io_on_loaded; /* Notify of program loaded */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h b/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h index b1a9072..b4610af 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h @@ -281,8 +281,8 @@ typedef int(*nldr_unloadfxn) (struct nldr_nodeobject *nldr_node_obj, */ struct node_ldr_fxns { nldr_allocatefxn allocate; - nldr_createfxn pfn_create; - nldr_deletefxn pfn_delete; + nldr_createfxn create; + nldr_deletefxn delete; nldr_exitfxn pfn_exit; nldr_getfxnaddrfxn pfn_get_fxn_addr; nldr_initfxn pfn_init; diff --git a/drivers/staging/tidspbridge/pmgr/chnl.c b/drivers/staging/tidspbridge/pmgr/chnl.c index 78b0d0f3..245de82 100644 --- a/drivers/staging/tidspbridge/pmgr/chnl.c +++ b/drivers/staging/tidspbridge/pmgr/chnl.c @@ -87,7 +87,7 @@ int chnl_create(struct chnl_mgr **channel_mgr, struct bridge_drv_interface *intf_fxns; dev_get_intf_fxns(hdev_obj, &intf_fxns); /* Let Bridge channel module finish the create: */ - status = (*intf_fxns->pfn_chnl_create) (&hchnl_mgr, hdev_obj, + status = (*intf_fxns->chnl_create) (&hchnl_mgr, hdev_obj, mgr_attrts); if (!status) { /* Fill in DSP API channel module's fields of the @@ -120,7 +120,7 @@ int chnl_destroy(struct chnl_mgr *hchnl_mgr) if (chnl_mgr_obj) { intf_fxns = chnl_mgr_obj->intf_fxns; /* Let Bridge channel module destroy the chnl_mgr: */ - status = (*intf_fxns->pfn_chnl_destroy) (hchnl_mgr); + status = (*intf_fxns->chnl_destroy) (hchnl_mgr); } else { status = -EFAULT; } diff --git a/drivers/staging/tidspbridge/pmgr/dev.c b/drivers/staging/tidspbridge/pmgr/dev.c index 63ca8c7..0cc6416 100644 --- a/drivers/staging/tidspbridge/pmgr/dev.c +++ b/drivers/staging/tidspbridge/pmgr/dev.c @@ -111,7 +111,7 @@ u32 dev_brd_write_fxn(void *arb, u32 dsp_add, void *host_buf, if (dev_obj) { /* Require of BrdWrite() */ DBC_ASSERT(dev_obj->hbridge_context != NULL); - status = (*dev_obj->bridge_interface.pfn_brd_write) ( + status = (*dev_obj->bridge_interface.brd_write) ( dev_obj->hbridge_context, host_buf, dsp_add, ul_num_bytes, mem_space); /* Special case of getting the address only */ @@ -1081,30 +1081,30 @@ static void store_interface_fxns(struct bridge_drv_interface *drv_fxns, if (bridge_version > 0) { STORE_FXN(fxn_dev_create, pfn_dev_create); STORE_FXN(fxn_dev_destroy, pfn_dev_destroy); - STORE_FXN(fxn_dev_ctrl, pfn_dev_cntrl); + STORE_FXN(fxn_dev_ctrl, dev_cntrl); STORE_FXN(fxn_brd_monitor, brd_monitor); - STORE_FXN(fxn_brd_start, pfn_brd_start); - STORE_FXN(fxn_brd_stop, pfn_brd_stop); - STORE_FXN(fxn_brd_status, pfn_brd_status); + STORE_FXN(fxn_brd_start, brd_start); + STORE_FXN(fxn_brd_stop, brd_stop); + STORE_FXN(fxn_brd_status, brd_status); STORE_FXN(fxn_brd_read, brd_read); - STORE_FXN(fxn_brd_write, pfn_brd_write); - STORE_FXN(fxn_brd_setstate, pfn_brd_set_state); + STORE_FXN(fxn_brd_write, brd_write); + STORE_FXN(fxn_brd_setstate, brd_set_state); STORE_FXN(fxn_brd_memcopy, brd_mem_copy); STORE_FXN(fxn_brd_memwrite, brd_mem_write); STORE_FXN(fxn_brd_memmap, brd_mem_map); STORE_FXN(fxn_brd_memunmap, brd_mem_un_map); - STORE_FXN(fxn_chnl_create, pfn_chnl_create); - STORE_FXN(fxn_chnl_destroy, pfn_chnl_destroy); - STORE_FXN(fxn_chnl_open, pfn_chnl_open); - STORE_FXN(fxn_chnl_close, pfn_chnl_close); - STORE_FXN(fxn_chnl_addioreq, pfn_chnl_add_io_req); - STORE_FXN(fxn_chnl_getioc, pfn_chnl_get_ioc); - STORE_FXN(fxn_chnl_cancelio, pfn_chnl_cancel_io); - STORE_FXN(fxn_chnl_flushio, pfn_chnl_flush_io); - STORE_FXN(fxn_chnl_getinfo, pfn_chnl_get_info); - STORE_FXN(fxn_chnl_getmgrinfo, pfn_chnl_get_mgr_info); - STORE_FXN(fxn_chnl_idle, pfn_chnl_idle); - STORE_FXN(fxn_chnl_registernotify, pfn_chnl_register_notify); + STORE_FXN(fxn_chnl_create, chnl_create); + STORE_FXN(fxn_chnl_destroy, chnl_destroy); + STORE_FXN(fxn_chnl_open, chnl_open); + STORE_FXN(fxn_chnl_close, chnl_close); + STORE_FXN(fxn_chnl_addioreq, chnl_add_io_req); + STORE_FXN(fxn_chnl_getioc, chnl_get_ioc); + STORE_FXN(fxn_chnl_cancelio, chnl_cancel_io); + STORE_FXN(fxn_chnl_flushio, chnl_flush_io); + STORE_FXN(fxn_chnl_getinfo, chnl_get_info); + STORE_FXN(fxn_chnl_getmgrinfo, chnl_get_mgr_info); + STORE_FXN(fxn_chnl_idle, chnl_idle); + STORE_FXN(fxn_chnl_registernotify, chnl_register_notify); STORE_FXN(fxn_io_create, pfn_io_create); STORE_FXN(fxn_io_destroy, pfn_io_destroy); STORE_FXN(fxn_io_onloaded, pfn_io_on_loaded); @@ -1122,25 +1122,25 @@ static void store_interface_fxns(struct bridge_drv_interface *drv_fxns, /* Ensure postcondition: */ DBC_ENSURE(intf_fxns->pfn_dev_create != NULL); DBC_ENSURE(intf_fxns->pfn_dev_destroy != NULL); - DBC_ENSURE(intf_fxns->pfn_dev_cntrl != NULL); + DBC_ENSURE(intf_fxns->dev_cntrl != NULL); DBC_ENSURE(intf_fxns->brd_monitor != NULL); - DBC_ENSURE(intf_fxns->pfn_brd_start != NULL); - DBC_ENSURE(intf_fxns->pfn_brd_stop != NULL); - DBC_ENSURE(intf_fxns->pfn_brd_status != NULL); + DBC_ENSURE(intf_fxns->brd_start != NULL); + DBC_ENSURE(intf_fxns->brd_stop != NULL); + DBC_ENSURE(intf_fxns->brd_status != NULL); DBC_ENSURE(intf_fxns->brd_read != NULL); - DBC_ENSURE(intf_fxns->pfn_brd_write != NULL); - DBC_ENSURE(intf_fxns->pfn_chnl_create != NULL); - DBC_ENSURE(intf_fxns->pfn_chnl_destroy != NULL); - DBC_ENSURE(intf_fxns->pfn_chnl_open != NULL); - DBC_ENSURE(intf_fxns->pfn_chnl_close != NULL); - DBC_ENSURE(intf_fxns->pfn_chnl_add_io_req != NULL); - DBC_ENSURE(intf_fxns->pfn_chnl_get_ioc != NULL); - DBC_ENSURE(intf_fxns->pfn_chnl_cancel_io != NULL); - DBC_ENSURE(intf_fxns->pfn_chnl_flush_io != NULL); - DBC_ENSURE(intf_fxns->pfn_chnl_get_info != NULL); - DBC_ENSURE(intf_fxns->pfn_chnl_get_mgr_info != NULL); - DBC_ENSURE(intf_fxns->pfn_chnl_idle != NULL); - DBC_ENSURE(intf_fxns->pfn_chnl_register_notify != NULL); + DBC_ENSURE(intf_fxns->brd_write != NULL); + DBC_ENSURE(intf_fxns->chnl_create != NULL); + DBC_ENSURE(intf_fxns->chnl_destroy != NULL); + DBC_ENSURE(intf_fxns->chnl_open != NULL); + DBC_ENSURE(intf_fxns->chnl_close != NULL); + DBC_ENSURE(intf_fxns->chnl_add_io_req != NULL); + DBC_ENSURE(intf_fxns->chnl_get_ioc != NULL); + DBC_ENSURE(intf_fxns->chnl_cancel_io != NULL); + DBC_ENSURE(intf_fxns->chnl_flush_io != NULL); + DBC_ENSURE(intf_fxns->chnl_get_info != NULL); + DBC_ENSURE(intf_fxns->chnl_get_mgr_info != NULL); + DBC_ENSURE(intf_fxns->chnl_idle != NULL); + DBC_ENSURE(intf_fxns->chnl_register_notify != NULL); DBC_ENSURE(intf_fxns->pfn_io_create != NULL); DBC_ENSURE(intf_fxns->pfn_io_destroy != NULL); DBC_ENSURE(intf_fxns->pfn_io_on_loaded != NULL); diff --git a/drivers/staging/tidspbridge/rmgr/disp.c b/drivers/staging/tidspbridge/rmgr/disp.c index 560069a..02fc425 100644 --- a/drivers/staging/tidspbridge/rmgr/disp.c +++ b/drivers/staging/tidspbridge/rmgr/disp.c @@ -141,7 +141,7 @@ int disp_create(struct disp_object **dispatch_obj, chnl_attr_obj.uio_reqs = CHNLIOREQS; chnl_attr_obj.event_obj = NULL; ul_chnl_id = disp_attrs->ul_chnl_offset + CHNLTORMSOFFSET; - status = (*intf_fxns->pfn_chnl_open) (&(disp_obj->chnl_to_dsp), + status = (*intf_fxns->chnl_open) (&(disp_obj->chnl_to_dsp), disp_obj->hchnl_mgr, CHNL_MODETODSP, ul_chnl_id, &chnl_attr_obj); @@ -149,7 +149,7 @@ int disp_create(struct disp_object **dispatch_obj, if (!status) { ul_chnl_id = disp_attrs->ul_chnl_offset + CHNLFROMRMSOFFSET; status = - (*intf_fxns->pfn_chnl_open) (&(disp_obj->chnl_from_dsp), + (*intf_fxns->chnl_open) (&(disp_obj->chnl_from_dsp), disp_obj->hchnl_mgr, CHNL_MODEFROMDSP, ul_chnl_id, &chnl_attr_obj); @@ -566,7 +566,7 @@ static void delete_disp(struct disp_object *disp_obj) if (disp_obj->chnl_from_dsp) { /* Channel close can fail only if the channel handle * is invalid. */ - status = (*intf_fxns->pfn_chnl_close) + status = (*intf_fxns->chnl_close) (disp_obj->chnl_from_dsp); if (status) { dev_dbg(bridge, "%s: Failed to close channel " @@ -575,7 +575,7 @@ static void delete_disp(struct disp_object *disp_obj) } if (disp_obj->chnl_to_dsp) { status = - (*intf_fxns->pfn_chnl_close) (disp_obj-> + (*intf_fxns->chnl_close) (disp_obj-> chnl_to_dsp); if (status) { dev_dbg(bridge, "%s: Failed to close channel to" @@ -667,13 +667,13 @@ static int send_message(struct disp_object *disp_obj, u32 timeout, pbuf = disp_obj->pbuf; /* Send the command */ - status = (*intf_fxns->pfn_chnl_add_io_req) (chnl_obj, pbuf, ul_bytes, 0, + status = (*intf_fxns->chnl_add_io_req) (chnl_obj, pbuf, ul_bytes, 0, 0L, dw_arg); if (status) goto func_end; status = - (*intf_fxns->pfn_chnl_get_ioc) (chnl_obj, timeout, &chnl_ioc_obj); + (*intf_fxns->chnl_get_ioc) (chnl_obj, timeout, &chnl_ioc_obj); if (!status) { if (!CHNL_IS_IO_COMPLETE(chnl_ioc_obj)) { if (CHNL_IS_TIMED_OUT(chnl_ioc_obj)) @@ -688,13 +688,13 @@ static int send_message(struct disp_object *disp_obj, u32 timeout, chnl_obj = disp_obj->chnl_from_dsp; ul_bytes = REPLYSIZE; - status = (*intf_fxns->pfn_chnl_add_io_req) (chnl_obj, pbuf, ul_bytes, + status = (*intf_fxns->chnl_add_io_req) (chnl_obj, pbuf, ul_bytes, 0, 0L, dw_arg); if (status) goto func_end; status = - (*intf_fxns->pfn_chnl_get_ioc) (chnl_obj, timeout, &chnl_ioc_obj); + (*intf_fxns->chnl_get_ioc) (chnl_obj, timeout, &chnl_ioc_obj); if (!status) { if (CHNL_IS_TIMED_OUT(chnl_ioc_obj)) { status = -ETIME; diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c index 8dd0578..bb7d307 100644 --- a/drivers/staging/tidspbridge/rmgr/node.c +++ b/drivers/staging/tidspbridge/rmgr/node.c @@ -1367,7 +1367,7 @@ int node_create_mgr(struct node_mgr **node_man, nldr_attrs_obj.us_dsp_word_size = node_mgr_obj->udsp_word_size; nldr_attrs_obj.us_dsp_mau_size = node_mgr_obj->udsp_mau_size; node_mgr_obj->loader_init = node_mgr_obj->nldr_fxns.pfn_init(); - status = node_mgr_obj->nldr_fxns.pfn_create(&node_mgr_obj->nldr_obj, + status = node_mgr_obj->nldr_fxns.create(&node_mgr_obj->nldr_obj, hdev_obj, &nldr_attrs_obj); if (status) @@ -2608,7 +2608,7 @@ static void delete_node_mgr(struct node_mgr *hnode_mgr) /* Delete the loader */ if (hnode_mgr->nldr_obj) - hnode_mgr->nldr_fxns.pfn_delete(hnode_mgr->nldr_obj); + hnode_mgr->nldr_fxns.delete(hnode_mgr->nldr_obj); if (hnode_mgr->loader_init) hnode_mgr->nldr_fxns.pfn_exit(); diff --git a/drivers/staging/tidspbridge/rmgr/proc.c b/drivers/staging/tidspbridge/rmgr/proc.c index 03bc214..8bc6924 100644 --- a/drivers/staging/tidspbridge/rmgr/proc.c +++ b/drivers/staging/tidspbridge/rmgr/proc.c @@ -540,7 +540,7 @@ int proc_ctrl(void *hprocessor, u32 dw_cmd, struct dsp_cbdata * arg) /* timeout = arg->cb_data; */ status = pwr_wake_dsp(timeout); } else - if (!((*p_proc_object->intf_fxns->pfn_dev_cntrl) + if (!((*p_proc_object->intf_fxns->dev_cntrl) (p_proc_object->hbridge_context, dw_cmd, arg))) { status = 0; @@ -995,7 +995,7 @@ int proc_get_state(void *hprocessor, if (p_proc_object) { /* First, retrieve BRD state information */ - status = (*p_proc_object->intf_fxns->pfn_brd_status) + status = (*p_proc_object->intf_fxns->brd_status) (p_proc_object->hbridge_context, &brd_status); if (!status) { switch (brd_status) { @@ -1262,7 +1262,7 @@ int proc_load(void *hprocessor, const s32 argc_index, } if (!status) { /* Update the Processor status to loaded */ - status = (*p_proc_object->intf_fxns->pfn_brd_set_state) + status = (*p_proc_object->intf_fxns->brd_set_state) (p_proc_object->hbridge_context, BRD_LOADED); if (!status) { p_proc_object->proc_state = PROC_LOADED; @@ -1304,7 +1304,7 @@ int proc_load(void *hprocessor, const s32 argc_index, kfree(new_envp); user_args[0] = pargv0; if (!status) { - if (!((*p_proc_object->intf_fxns->pfn_brd_status) + if (!((*p_proc_object->intf_fxns->brd_status) (p_proc_object->hbridge_context, &brd_state))) { pr_info("%s: Processor Loaded %s\n", __func__, pargv0); kfree(drv_datap->base_img); @@ -1580,7 +1580,7 @@ int proc_start(void *hprocessor) if (status) goto func_cont; - status = (*p_proc_object->intf_fxns->pfn_brd_start) + status = (*p_proc_object->intf_fxns->brd_start) (p_proc_object->hbridge_context, dw_dsp_addr); if (status) goto func_cont; @@ -1601,12 +1601,12 @@ int proc_start(void *hprocessor) /* Failed to Create Node Manager and DISP Object * Stop the Processor from running. Put it in STOPPED State */ (void)(*p_proc_object->intf_fxns-> - pfn_brd_stop) (p_proc_object->hbridge_context); + brd_stop) (p_proc_object->hbridge_context); p_proc_object->proc_state = PROC_STOPPED; } func_cont: if (!status) { - if (!((*p_proc_object->intf_fxns->pfn_brd_status) + if (!((*p_proc_object->intf_fxns->brd_status) (p_proc_object->hbridge_context, &brd_state))) { pr_info("%s: dsp in running state\n", __func__); DBC_ASSERT(brd_state != BRD_HIBERNATION); @@ -1659,7 +1659,7 @@ int proc_stop(void *hprocessor) /* It is OK to stop a device that does n't have nodes OR not started */ status = (*p_proc_object->intf_fxns-> - pfn_brd_stop) (p_proc_object->hbridge_context); + brd_stop) (p_proc_object->hbridge_context); if (!status) { dev_dbg(bridge, "%s: processor in standby mode\n", __func__); p_proc_object->proc_state = PROC_STOPPED; @@ -1672,7 +1672,7 @@ int proc_stop(void *hprocessor) dev_set_msg_mgr(p_proc_object->hdev_obj, NULL); } if (!((*p_proc_object-> - intf_fxns->pfn_brd_status) (p_proc_object-> + intf_fxns->brd_status) (p_proc_object-> hbridge_context, &brd_state))) DBC_ASSERT(brd_state == BRD_STOPPED); @@ -1831,7 +1831,7 @@ static int proc_monitor(struct proc_object *proc_obj) if (!((*proc_obj->intf_fxns->brd_monitor) (proc_obj->hbridge_context))) { status = 0; - if (!((*proc_obj->intf_fxns->pfn_brd_status) + if (!((*proc_obj->intf_fxns->brd_status) (proc_obj->hbridge_context, &brd_state))) DBC_ASSERT(brd_state == BRD_IDLE); } diff --git a/drivers/staging/tidspbridge/rmgr/pwr.c b/drivers/staging/tidspbridge/rmgr/pwr.c index 85cb1a2..17748df 100644 --- a/drivers/staging/tidspbridge/rmgr/pwr.c +++ b/drivers/staging/tidspbridge/rmgr/pwr.c @@ -67,7 +67,7 @@ int pwr_sleep_dsp(const u32 sleep_code, const u32 timeout) status = -EINVAL; if (status != -EINVAL) { - status = (*intf_fxns->pfn_dev_cntrl) (dw_context, + status = (*intf_fxns->dev_cntrl) (dw_context, ioctlcode, (void *)&arg); } @@ -97,7 +97,7 @@ int pwr_wake_dsp(const u32 timeout) if (!(dev_get_intf_fxns(hdev_obj, (struct bridge_drv_interface **)&intf_fxns))) { status = - (*intf_fxns->pfn_dev_cntrl) (dw_context, + (*intf_fxns->dev_cntrl) (dw_context, BRDIOCTL_WAKEUP, (void *)&arg); } @@ -131,7 +131,7 @@ int pwr_pm_pre_scale(u16 voltage_domain, u32 level) if (!(dev_get_intf_fxns(hdev_obj, (struct bridge_drv_interface **)&intf_fxns))) { status = - (*intf_fxns->pfn_dev_cntrl) (dw_context, + (*intf_fxns->dev_cntrl) (dw_context, BRDIOCTL_PRESCALE_NOTIFY, (void *)&arg); } @@ -165,7 +165,7 @@ int pwr_pm_post_scale(u16 voltage_domain, u32 level) if (!(dev_get_intf_fxns(hdev_obj, (struct bridge_drv_interface **)&intf_fxns))) { status = - (*intf_fxns->pfn_dev_cntrl) (dw_context, + (*intf_fxns->dev_cntrl) (dw_context, BRDIOCTL_POSTSCALE_NOTIFY, (void *)&arg); } diff --git a/drivers/staging/tidspbridge/rmgr/strm.c b/drivers/staging/tidspbridge/rmgr/strm.c index 4adb7a0..66c32f1 100644 --- a/drivers/staging/tidspbridge/rmgr/strm.c +++ b/drivers/staging/tidspbridge/rmgr/strm.c @@ -165,7 +165,7 @@ int strm_close(struct strm_res_object *strmres, * -EPIPE */ intf_fxns = stream_obj->strm_mgr_obj->intf_fxns; status = - (*intf_fxns->pfn_chnl_get_info) (stream_obj->chnl_obj, + (*intf_fxns->chnl_get_info) (stream_obj->chnl_obj, &chnl_info_obj); DBC_ASSERT(!status); @@ -323,7 +323,7 @@ int strm_get_info(struct strm_object *stream_obj, intf_fxns = stream_obj->strm_mgr_obj->intf_fxns; status = - (*intf_fxns->pfn_chnl_get_info) (stream_obj->chnl_obj, + (*intf_fxns->chnl_get_info) (stream_obj->chnl_obj, &chnl_info_obj); if (status) goto func_end; @@ -377,7 +377,7 @@ int strm_idle(struct strm_object *stream_obj, bool flush_data) } else { intf_fxns = stream_obj->strm_mgr_obj->intf_fxns; - status = (*intf_fxns->pfn_chnl_idle) (stream_obj->chnl_obj, + status = (*intf_fxns->chnl_idle) (stream_obj->chnl_obj, stream_obj->utimeout, flush_data); } @@ -435,7 +435,7 @@ int strm_issue(struct strm_object *stream_obj, u8 *pbuf, u32 ul_bytes, } if (!status) { - status = (*intf_fxns->pfn_chnl_add_io_req) + status = (*intf_fxns->chnl_add_io_req) (stream_obj->chnl_obj, pbuf, ul_bytes, ul_buf_size, (u32) tmp_buf, dw_arg); } @@ -557,7 +557,7 @@ func_cont: chnl_mode = (dir == DSP_TONODE) ? CHNL_MODETODSP : CHNL_MODEFROMDSP; intf_fxns = strm_mgr_obj->intf_fxns; - status = (*intf_fxns->pfn_chnl_open) (&(strm_obj->chnl_obj), + status = (*intf_fxns->chnl_open) (&(strm_obj->chnl_obj), strm_mgr_obj->hchnl_mgr, chnl_mode, ul_chnl_id, &chnl_attr_obj); @@ -631,7 +631,7 @@ int strm_reclaim(struct strm_object *stream_obj, u8 ** buf_ptr, intf_fxns = stream_obj->strm_mgr_obj->intf_fxns; status = - (*intf_fxns->pfn_chnl_get_ioc) (stream_obj->chnl_obj, + (*intf_fxns->chnl_get_ioc) (stream_obj->chnl_obj, stream_obj->utimeout, &chnl_ioc_obj); if (!status) { @@ -719,7 +719,7 @@ int strm_register_notify(struct strm_object *stream_obj, u32 event_mask, intf_fxns = stream_obj->strm_mgr_obj->intf_fxns; status = - (*intf_fxns->pfn_chnl_register_notify) (stream_obj-> + (*intf_fxns->chnl_register_notify) (stream_obj-> chnl_obj, event_mask, notify_type, @@ -765,7 +765,7 @@ int strm_select(struct strm_object **strm_tab, u32 strms, /* Determine which channels have IO ready */ for (i = 0; i < strms; i++) { intf_fxns = strm_tab[i]->strm_mgr_obj->intf_fxns; - status = (*intf_fxns->pfn_chnl_get_info) (strm_tab[i]->chnl_obj, + status = (*intf_fxns->chnl_get_info) (strm_tab[i]->chnl_obj, &chnl_info_obj); if (status) { break; @@ -786,7 +786,7 @@ int strm_select(struct strm_object **strm_tab, u32 strms, for (i = 0; i < strms; i++) { intf_fxns = strm_tab[i]->strm_mgr_obj->intf_fxns; - status = (*intf_fxns->pfn_chnl_get_info) + status = (*intf_fxns->chnl_get_info) (strm_tab[i]->chnl_obj, &chnl_info_obj); if (status) break; @@ -832,7 +832,7 @@ static int delete_strm(struct strm_object *stream_obj) intf_fxns = stream_obj->strm_mgr_obj->intf_fxns; /* Channel close can fail only if the channel handle * is invalid. */ - status = (*intf_fxns->pfn_chnl_close) + status = (*intf_fxns->chnl_close) (stream_obj->chnl_obj); } /* Free all SM address translator resources */ -- cgit v0.10.2 From 09f133045c57c479cad02d44791534df3b5b056e Mon Sep 17 00:00:00 2001 From: Rene Sapiens Date: Tue, 18 Jan 2011 03:19:07 +0000 Subject: staging: tidspbridge: set5 remove hungarian from structs hungarian notation will be removed from the elements inside structures, the next varibles will be renamed: Original: Replacement: pfn_dev_create by dev_create pfn_dev_destroy dev_destroy pfn_exit exit pfn_get_fxn_addr get_fxn_addr pfn_init init pfn_io_create io_create pfn_io_destroy io_destroy pfn_io_get_proc_load io_get_proc_load pfn_io_on_loaded io_on_loaded pfn_load load pfn_msg_create msg_create pfn_msg_create_queue msg_create_queue pfn_msg_delete msg_delete pfn_msg_delete_queue msg_delete_queue pfn_msg_get msg_get pfn_msg_put msg_put pfn_msg_register_notify msg_register_notify pfn_msg_set_queue_id msg_set_queue_id pfn_ovly ovly pfn_unload unload Signed-off-by: Rene Sapiens Signed-off-by: Armando Uribe Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h b/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h index 749c25e..7ba08ca 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h @@ -975,8 +975,8 @@ typedef void (*fxn_msg_setqueueid) (struct msg_queue *msg_queue_obj, struct bridge_drv_interface { u32 brd_api_major_version; /* Set to BRD_API_MAJOR_VERSION. */ u32 brd_api_minor_version; /* Set to BRD_API_MINOR_VERSION. */ - fxn_dev_create pfn_dev_create; /* Create device context */ - fxn_dev_destroy pfn_dev_destroy; /* Destroy device context */ + fxn_dev_create dev_create; /* Create device context */ + fxn_dev_destroy dev_destroy; /* Destroy device context */ fxn_dev_ctrl dev_cntrl; /* Optional vendor interface */ fxn_brd_monitor brd_monitor; /* Load and/or start monitor */ fxn_brd_start brd_start; /* Start DSP program. */ @@ -1003,23 +1003,23 @@ struct bridge_drv_interface { fxn_chnl_idle chnl_idle; /* Idle the channel */ /* Register for notif. */ fxn_chnl_registernotify chnl_register_notify; - fxn_io_create pfn_io_create; /* Create IO manager */ - fxn_io_destroy pfn_io_destroy; /* Destroy IO manager */ - fxn_io_onloaded pfn_io_on_loaded; /* Notify of program loaded */ + fxn_io_create io_create; /* Create IO manager */ + fxn_io_destroy io_destroy; /* Destroy IO manager */ + fxn_io_onloaded io_on_loaded; /* Notify of program loaded */ /* Get Processor's current and predicted load */ - fxn_io_getprocload pfn_io_get_proc_load; - fxn_msg_create pfn_msg_create; /* Create message manager */ + fxn_io_getprocload io_get_proc_load; + fxn_msg_create msg_create; /* Create message manager */ /* Create message queue */ - fxn_msg_createqueue pfn_msg_create_queue; - fxn_msg_delete pfn_msg_delete; /* Delete message manager */ + fxn_msg_createqueue msg_create_queue; + fxn_msg_delete msg_delete; /* Delete message manager */ /* Delete message queue */ - fxn_msg_deletequeue pfn_msg_delete_queue; - fxn_msg_get pfn_msg_get; /* Get a message */ - fxn_msg_put pfn_msg_put; /* Send a message */ + fxn_msg_deletequeue msg_delete_queue; + fxn_msg_get msg_get; /* Get a message */ + fxn_msg_put msg_put; /* Send a message */ /* Register for notif. */ - fxn_msg_registernotify pfn_msg_register_notify; + fxn_msg_registernotify msg_register_notify; /* Set message queue id */ - fxn_msg_setqueueid pfn_msg_set_queue_id; + fxn_msg_setqueueid msg_set_queue_id; }; /* diff --git a/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h b/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h index b4610af..b1cd1a4 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h @@ -82,7 +82,7 @@ typedef u32(*nldr_writefxn) (void *priv_ref, * Attributes passed to nldr_create function. */ struct nldr_attrs { - nldr_ovlyfxn pfn_ovly; + nldr_ovlyfxn ovly; nldr_writefxn pfn_write; u16 us_dsp_word_size; u16 us_dsp_mau_size; @@ -283,11 +283,11 @@ struct node_ldr_fxns { nldr_allocatefxn allocate; nldr_createfxn create; nldr_deletefxn delete; - nldr_exitfxn pfn_exit; - nldr_getfxnaddrfxn pfn_get_fxn_addr; - nldr_initfxn pfn_init; - nldr_loadfxn pfn_load; - nldr_unloadfxn pfn_unload; + nldr_exitfxn exit; + nldr_getfxnaddrfxn get_fxn_addr; + nldr_initfxn init; + nldr_loadfxn load; + nldr_unloadfxn unload; }; #endif /* NLDRDEFS_ */ diff --git a/drivers/staging/tidspbridge/pmgr/dev.c b/drivers/staging/tidspbridge/pmgr/dev.c index 0cc6416..b855e44 100644 --- a/drivers/staging/tidspbridge/pmgr/dev.c +++ b/drivers/staging/tidspbridge/pmgr/dev.c @@ -188,7 +188,7 @@ int dev_create_device(struct dev_object **device_obj, /* Call fxn_dev_create() to get the Bridge's device * context handle. */ - status = (dev_obj->bridge_interface.pfn_dev_create) + status = (dev_obj->bridge_interface.dev_create) (&dev_obj->hbridge_context, dev_obj, host_res); /* Assert bridge_dev_create()'s ensure clause: */ @@ -382,7 +382,7 @@ int dev_destroy_device(struct dev_object *hdev_obj) /* Call the driver's bridge_dev_destroy() function: */ /* Require of DevDestroy */ if (dev_obj->hbridge_context) { - status = (*dev_obj->bridge_interface.pfn_dev_destroy) + status = (*dev_obj->bridge_interface.dev_destroy) (dev_obj->hbridge_context); dev_obj->hbridge_context = NULL; } else @@ -1079,8 +1079,8 @@ static void store_interface_fxns(struct bridge_drv_interface *drv_fxns, intf_fxns->brd_api_minor_version = drv_fxns->brd_api_minor_version; /* Install functions up to DSP API version .80 (first alpha): */ if (bridge_version > 0) { - STORE_FXN(fxn_dev_create, pfn_dev_create); - STORE_FXN(fxn_dev_destroy, pfn_dev_destroy); + STORE_FXN(fxn_dev_create, dev_create); + STORE_FXN(fxn_dev_destroy, dev_destroy); STORE_FXN(fxn_dev_ctrl, dev_cntrl); STORE_FXN(fxn_brd_monitor, brd_monitor); STORE_FXN(fxn_brd_start, brd_start); @@ -1105,23 +1105,23 @@ static void store_interface_fxns(struct bridge_drv_interface *drv_fxns, STORE_FXN(fxn_chnl_getmgrinfo, chnl_get_mgr_info); STORE_FXN(fxn_chnl_idle, chnl_idle); STORE_FXN(fxn_chnl_registernotify, chnl_register_notify); - STORE_FXN(fxn_io_create, pfn_io_create); - STORE_FXN(fxn_io_destroy, pfn_io_destroy); - STORE_FXN(fxn_io_onloaded, pfn_io_on_loaded); - STORE_FXN(fxn_io_getprocload, pfn_io_get_proc_load); - STORE_FXN(fxn_msg_create, pfn_msg_create); - STORE_FXN(fxn_msg_createqueue, pfn_msg_create_queue); - STORE_FXN(fxn_msg_delete, pfn_msg_delete); - STORE_FXN(fxn_msg_deletequeue, pfn_msg_delete_queue); - STORE_FXN(fxn_msg_get, pfn_msg_get); - STORE_FXN(fxn_msg_put, pfn_msg_put); - STORE_FXN(fxn_msg_registernotify, pfn_msg_register_notify); - STORE_FXN(fxn_msg_setqueueid, pfn_msg_set_queue_id); + STORE_FXN(fxn_io_create, io_create); + STORE_FXN(fxn_io_destroy, io_destroy); + STORE_FXN(fxn_io_onloaded, io_on_loaded); + STORE_FXN(fxn_io_getprocload, io_get_proc_load); + STORE_FXN(fxn_msg_create, msg_create); + STORE_FXN(fxn_msg_createqueue, msg_create_queue); + STORE_FXN(fxn_msg_delete, msg_delete); + STORE_FXN(fxn_msg_deletequeue, msg_delete_queue); + STORE_FXN(fxn_msg_get, msg_get); + STORE_FXN(fxn_msg_put, msg_put); + STORE_FXN(fxn_msg_registernotify, msg_register_notify); + STORE_FXN(fxn_msg_setqueueid, msg_set_queue_id); } /* Add code for any additional functions in newerBridge versions here */ /* Ensure postcondition: */ - DBC_ENSURE(intf_fxns->pfn_dev_create != NULL); - DBC_ENSURE(intf_fxns->pfn_dev_destroy != NULL); + DBC_ENSURE(intf_fxns->dev_create != NULL); + DBC_ENSURE(intf_fxns->dev_destroy != NULL); DBC_ENSURE(intf_fxns->dev_cntrl != NULL); DBC_ENSURE(intf_fxns->brd_monitor != NULL); DBC_ENSURE(intf_fxns->brd_start != NULL); @@ -1141,11 +1141,11 @@ static void store_interface_fxns(struct bridge_drv_interface *drv_fxns, DBC_ENSURE(intf_fxns->chnl_get_mgr_info != NULL); DBC_ENSURE(intf_fxns->chnl_idle != NULL); DBC_ENSURE(intf_fxns->chnl_register_notify != NULL); - DBC_ENSURE(intf_fxns->pfn_io_create != NULL); - DBC_ENSURE(intf_fxns->pfn_io_destroy != NULL); - DBC_ENSURE(intf_fxns->pfn_io_on_loaded != NULL); - DBC_ENSURE(intf_fxns->pfn_io_get_proc_load != NULL); - DBC_ENSURE(intf_fxns->pfn_msg_set_queue_id != NULL); + DBC_ENSURE(intf_fxns->io_create != NULL); + DBC_ENSURE(intf_fxns->io_destroy != NULL); + DBC_ENSURE(intf_fxns->io_on_loaded != NULL); + DBC_ENSURE(intf_fxns->io_get_proc_load != NULL); + DBC_ENSURE(intf_fxns->msg_set_queue_id != NULL); #undef STORE_FXN } diff --git a/drivers/staging/tidspbridge/pmgr/io.c b/drivers/staging/tidspbridge/pmgr/io.c index 0e8843f..01ef637 100644 --- a/drivers/staging/tidspbridge/pmgr/io.c +++ b/drivers/staging/tidspbridge/pmgr/io.c @@ -67,7 +67,7 @@ int io_create(struct io_mgr **io_man, struct dev_object *hdev_obj, dev_get_intf_fxns(hdev_obj, &intf_fxns); /* Let Bridge channel module finish the create: */ - status = (*intf_fxns->pfn_io_create) (&hio_mgr, hdev_obj, + status = (*intf_fxns->io_create) (&hio_mgr, hdev_obj, mgr_attrts); if (!status) { @@ -99,7 +99,7 @@ int io_destroy(struct io_mgr *hio_mgr) intf_fxns = pio_mgr->intf_fxns; /* Let Bridge channel module destroy the io_mgr: */ - status = (*intf_fxns->pfn_io_destroy) (hio_mgr); + status = (*intf_fxns->io_destroy) (hio_mgr); return status; } diff --git a/drivers/staging/tidspbridge/pmgr/msg.c b/drivers/staging/tidspbridge/pmgr/msg.c index abd4365..a691603 100644 --- a/drivers/staging/tidspbridge/pmgr/msg.c +++ b/drivers/staging/tidspbridge/pmgr/msg.c @@ -64,7 +64,7 @@ int msg_create(struct msg_mgr **msg_man, /* Let Bridge message module finish the create: */ status = - (*intf_fxns->pfn_msg_create) (&hmsg_mgr, hdev_obj, msg_callback); + (*intf_fxns->msg_create) (&hmsg_mgr, hdev_obj, msg_callback); if (!status) { /* Fill in DSP API message module's fields of the msg_mgr @@ -96,7 +96,7 @@ void msg_delete(struct msg_mgr *hmsg_mgr) intf_fxns = msg_mgr_obj->intf_fxns; /* Let Bridge message module destroy the msg_mgr: */ - (*intf_fxns->pfn_msg_delete) (hmsg_mgr); + (*intf_fxns->msg_delete) (hmsg_mgr); } else { dev_dbg(bridge, "%s: Error hmsg_mgr handle: %p\n", __func__, hmsg_mgr); diff --git a/drivers/staging/tidspbridge/rmgr/nldr.c b/drivers/staging/tidspbridge/rmgr/nldr.c index d19cdb0..0537346 100644 --- a/drivers/staging/tidspbridge/rmgr/nldr.c +++ b/drivers/staging/tidspbridge/rmgr/nldr.c @@ -429,7 +429,7 @@ int nldr_create(struct nldr_object **nldr, DBC_REQUIRE(nldr != NULL); DBC_REQUIRE(hdev_obj != NULL); DBC_REQUIRE(pattrs != NULL); - DBC_REQUIRE(pattrs->pfn_ovly != NULL); + DBC_REQUIRE(pattrs->ovly != NULL); DBC_REQUIRE(pattrs->pfn_write != NULL); /* Allocate dynamic loader object */ @@ -534,7 +534,7 @@ int nldr_create(struct nldr_object **nldr, new_attrs.sym_lookup = (dbll_sym_lookup) get_symbol_value; new_attrs.sym_handle = nldr_obj; new_attrs.write = (dbll_write_fxn) pattrs->pfn_write; - nldr_obj->ovly_fxn = pattrs->pfn_ovly; + nldr_obj->ovly_fxn = pattrs->ovly; nldr_obj->write_fxn = pattrs->pfn_write; nldr_obj->ldr_attrs = new_attrs; } diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c index bb7d307..8008a5c 100644 --- a/drivers/staging/tidspbridge/rmgr/node.c +++ b/drivers/staging/tidspbridge/rmgr/node.c @@ -564,7 +564,7 @@ func_cont: /* Create a message queue for this node */ intf_fxns = hnode_mgr->intf_fxns; status = - (*intf_fxns->pfn_msg_create_queue) (hnode_mgr->msg_mgr_obj, + (*intf_fxns->msg_create_queue) (hnode_mgr->msg_mgr_obj, &pnode->msg_queue_obj, 0, pnode->create_args.asa. @@ -596,7 +596,7 @@ func_cont: stack_seg_name, STACKSEGLABEL) == 0) { status = hnode_mgr->nldr_fxns. - pfn_get_fxn_addr(pnode->nldr_node_obj, "DYNEXT_BEG", + get_fxn_addr(pnode->nldr_node_obj, "DYNEXT_BEG", &dynext_base); if (status) pr_err("%s: Failed to get addr for DYNEXT_BEG" @@ -604,7 +604,7 @@ func_cont: status = hnode_mgr->nldr_fxns. - pfn_get_fxn_addr(pnode->nldr_node_obj, + get_fxn_addr(pnode->nldr_node_obj, "L1DSRAM_HEAP", &pul_value); if (status) @@ -1190,7 +1190,7 @@ int node_create(struct node_object *hnode) if (pdata->cpu_set_freq) (*pdata->cpu_set_freq) (pdata->mpu_speed[VDD1_OPP3]); #endif - status = hnode_mgr->nldr_fxns.pfn_load(hnode->nldr_node_obj, + status = hnode_mgr->nldr_fxns.load(hnode->nldr_node_obj, NLDR_CREATE); /* Get address of node's create function */ if (!status) { @@ -1211,7 +1211,7 @@ int node_create(struct node_object *hnode) /* Get address of iAlg functions, if socket node */ if (!status) { if (node_type == NODE_DAISSOCKET) { - status = hnode_mgr->nldr_fxns.pfn_get_fxn_addr + status = hnode_mgr->nldr_fxns.get_fxn_addr (hnode->nldr_node_obj, hnode->dcd_props.obj_data.node_obj. pstr_i_alg_name, @@ -1232,7 +1232,7 @@ int node_create(struct node_object *hnode) /* Set the message queue id to the node env * pointer */ intf_fxns = hnode_mgr->intf_fxns; - (*intf_fxns->pfn_msg_set_queue_id) (hnode-> + (*intf_fxns->msg_set_queue_id) (hnode-> msg_queue_obj, hnode->node_env); } @@ -1243,7 +1243,7 @@ int node_create(struct node_object *hnode) if (hnode->loaded && hnode->phase_split) { /* If create code was dynamically loaded, we can now unload * it. */ - status1 = hnode_mgr->nldr_fxns.pfn_unload(hnode->nldr_node_obj, + status1 = hnode_mgr->nldr_fxns.unload(hnode->nldr_node_obj, NLDR_CREATE); hnode->loaded = false; } @@ -1362,11 +1362,11 @@ int node_create_mgr(struct node_mgr **node_man, /* Get loader functions and create loader */ node_mgr_obj->nldr_fxns = nldr_fxns; /* Dyn loader funcs */ - nldr_attrs_obj.pfn_ovly = ovly; + nldr_attrs_obj.ovly = ovly; nldr_attrs_obj.pfn_write = mem_write; nldr_attrs_obj.us_dsp_word_size = node_mgr_obj->udsp_word_size; nldr_attrs_obj.us_dsp_mau_size = node_mgr_obj->udsp_mau_size; - node_mgr_obj->loader_init = node_mgr_obj->nldr_fxns.pfn_init(); + node_mgr_obj->loader_init = node_mgr_obj->nldr_fxns.init(); status = node_mgr_obj->nldr_fxns.create(&node_mgr_obj->nldr_obj, hdev_obj, &nldr_attrs_obj); @@ -1450,7 +1450,7 @@ int node_delete(struct node_res_object *noderes, * is not * running */ status1 = hnode_mgr->nldr_fxns. - pfn_unload(pnode->nldr_node_obj, + unload(pnode->nldr_node_obj, NLDR_EXECUTE); pnode->loaded = false; NODE_SET_STATE(pnode, NODE_DONE); @@ -1461,7 +1461,7 @@ int node_delete(struct node_res_object *noderes, pnode->phase_split) { status = hnode_mgr->nldr_fxns. - pfn_load(pnode->nldr_node_obj, NLDR_DELETE); + load(pnode->nldr_node_obj, NLDR_DELETE); if (!status) pnode->loaded = true; else @@ -1502,7 +1502,7 @@ func_cont1: pnode->phase_split) { status1 = hnode_mgr->nldr_fxns. - pfn_unload(pnode->nldr_node_obj, + unload(pnode->nldr_node_obj, NLDR_EXECUTE); } if (status1) @@ -1510,7 +1510,7 @@ func_cont1: " 0x%x\n", __func__, status1); status1 = - hnode_mgr->nldr_fxns.pfn_unload(pnode-> + hnode_mgr->nldr_fxns.unload(pnode-> nldr_node_obj, NLDR_DELETE); pnode->loaded = false; @@ -1793,7 +1793,7 @@ int node_get_message(struct node_object *hnode, * available. */ intf_fxns = hnode_mgr->intf_fxns; status = - (*intf_fxns->pfn_msg_get) (hnode->msg_queue_obj, message, utimeout); + (*intf_fxns->msg_get) (hnode->msg_queue_obj, message, utimeout); /* Check if message contains SM descriptor */ if (status || !(message->cmd & DSP_RMSBUFDESC)) goto func_end; @@ -1942,7 +1942,7 @@ void node_on_exit(struct node_object *hnode, s32 node_status) NODE_SET_STATE(hnode, NODE_DONE); hnode->exit_status = node_status; if (hnode->loaded && hnode->phase_split) { - (void)hnode->hnode_mgr->nldr_fxns.pfn_unload(hnode-> + (void)hnode->hnode_mgr->nldr_fxns.unload(hnode-> nldr_node_obj, NLDR_EXECUTE); hnode->loaded = false; @@ -2125,7 +2125,7 @@ int node_put_message(struct node_object *hnode, } if (!status) { intf_fxns = hnode_mgr->intf_fxns; - status = (*intf_fxns->pfn_msg_put) (hnode->msg_queue_obj, + status = (*intf_fxns->msg_put) (hnode->msg_queue_obj, &new_msg, utimeout); } func_end: @@ -2173,7 +2173,7 @@ int node_register_notify(struct node_object *hnode, u32 event_mask, } else { /* Send Message part of event mask to msg_ctrl */ intf_fxns = hnode->hnode_mgr->intf_fxns; - status = (*intf_fxns->pfn_msg_register_notify) + status = (*intf_fxns->msg_register_notify) (hnode->msg_queue_obj, event_mask & DSP_NODEMESSAGEREADY, notify_type, hnotification); @@ -2255,7 +2255,7 @@ int node_run(struct node_object *hnode) /* If node's execute function is not loaded, load it */ if (!(hnode->loaded) && hnode->phase_split) { status = - hnode_mgr->nldr_fxns.pfn_load(hnode->nldr_node_obj, + hnode_mgr->nldr_fxns.load(hnode->nldr_node_obj, NLDR_EXECUTE); if (!status) { hnode->loaded = true; @@ -2389,7 +2389,7 @@ int node_terminate(struct node_object *hnode, int *pstatus) else kill_time_out = (hnode->utimeout) * 2; - status = (*intf_fxns->pfn_msg_put) (hnode->msg_queue_obj, &msg, + status = (*intf_fxns->msg_put) (hnode->msg_queue_obj, &msg, hnode->utimeout); if (status) goto func_cont; @@ -2405,7 +2405,7 @@ int node_terminate(struct node_object *hnode, int *pstatus) if (status != ETIME) goto func_cont; - status = (*intf_fxns->pfn_msg_put)(hnode->msg_queue_obj, + status = (*intf_fxns->msg_put)(hnode->msg_queue_obj, &killmsg, hnode->utimeout); if (status) goto func_cont; @@ -2477,7 +2477,7 @@ static void delete_node(struct node_object *hnode, /* Free msg_ctrl queue */ if (hnode->msg_queue_obj) { intf_fxns = hnode_mgr->intf_fxns; - (*intf_fxns->pfn_msg_delete_queue) (hnode-> + (*intf_fxns->msg_delete_queue) (hnode-> msg_queue_obj); hnode->msg_queue_obj = NULL; } @@ -2611,7 +2611,7 @@ static void delete_node_mgr(struct node_mgr *hnode_mgr) hnode_mgr->nldr_fxns.delete(hnode_mgr->nldr_obj); if (hnode_mgr->loader_init) - hnode_mgr->nldr_fxns.pfn_exit(); + hnode_mgr->nldr_fxns.exit(); kfree(hnode_mgr); } @@ -2772,7 +2772,7 @@ static int get_fxn_address(struct node_object *hnode, u32 * fxn_addr, } status = - hnode_mgr->nldr_fxns.pfn_get_fxn_addr(hnode->nldr_node_obj, + hnode_mgr->nldr_fxns.get_fxn_addr(hnode->nldr_node_obj, pstr_fxn_name, fxn_addr); return status; diff --git a/drivers/staging/tidspbridge/rmgr/proc.c b/drivers/staging/tidspbridge/rmgr/proc.c index 8bc6924..6840d29 100644 --- a/drivers/staging/tidspbridge/rmgr/proc.c +++ b/drivers/staging/tidspbridge/rmgr/proc.c @@ -917,7 +917,7 @@ int proc_get_resource_info(void *hprocessor, u32 resource_type, if (hio_mgr) status = p_proc_object->intf_fxns-> - pfn_io_get_proc_load(hio_mgr, + io_get_proc_load(hio_mgr, (struct dsp_procloadstat *) &(resource_info->result. proc_load_stat)); @@ -1227,7 +1227,7 @@ int proc_load(void *hprocessor, const s32 argc_index, /* Set the Device object's message manager */ status = dev_get_io_mgr(p_proc_object->hdev_obj, &hio_mgr); if (hio_mgr) - status = (*p_proc_object->intf_fxns->pfn_io_on_loaded) + status = (*p_proc_object->intf_fxns->io_on_loaded) (hio_mgr); else status = -EFAULT; -- cgit v0.10.2 From dab7f7fee09b28034af3cac527b16927e4e2a193 Mon Sep 17 00:00:00 2001 From: Rene Sapiens Date: Tue, 18 Jan 2011 03:19:08 +0000 Subject: staging: tidspbridge: set6 remove hungarian from structs hungarian notation will be removed from the elements inside structures, the next varibles will be renamed: Original: Replacement: pfn_write write pf_phase_split phase_split ul_alignment alignment ul_bufsize bufsize ul_bufsize_rms bufsize_rms ul_chnl_buf_size chnl_buf_size ul_chnl_offset chnl_offset ul_code_mem_seg_mask code_mem_seg_mask ul_dais_arg dais_arg ul_data1 data1 ul_data_mem_seg_mask data_mem_seg_mask ul_dsp_addr dsp_addr ul_dsp_res_addr dsp_res_addr ul_dsp_size dsp_size ul_dsp_va dsp_va ul_dsp_virt dsp_virt ul_entry entry ul_external_mem_size external_mem_size ul_fxn_addrs fxn_addrs ul_gpp_pa gpp_pa Signed-off-by: Rene Sapiens Signed-off-by: Armando Uribe Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index 77ae2da..5be6e0f 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c @@ -121,7 +121,7 @@ struct io_mgr { u32 ul_gpp_read_pointer; /* GPP Read pointer to Trace buffer */ u8 *pmsg; u32 ul_gpp_va; - u32 ul_dsp_va; + u32 dsp_va; #endif /* IO Dpc */ u32 dpc_req; /* Number of requested DPC's. */ @@ -421,7 +421,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) ul_gpp_va = host_res->mem_base[1]; /* This is the virtual uncached ioremapped address!!! */ /* Why can't we directly take the DSPVA from the symbols? */ - ul_dsp_va = hio_mgr->ext_proc_info.ty_tlb[0].ul_dsp_virt; + ul_dsp_va = hio_mgr->ext_proc_info.ty_tlb[0].dsp_virt; ul_seg_size = (shm0_end - ul_dsp_va) * hio_mgr->word_size; ul_seg1_size = (ul_ext_end - ul_dyn_ext_base) * hio_mgr->word_size; @@ -527,13 +527,13 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) * This is the physical address written to * DSP MMU. */ - ae_proc[ndx].ul_gpp_pa = pa_curr; + ae_proc[ndx].gpp_pa = pa_curr; /* * This is the virtual uncached ioremapped * address!!! */ ae_proc[ndx].ul_gpp_va = gpp_va_curr; - ae_proc[ndx].ul_dsp_va = + ae_proc[ndx].dsp_va = va_curr / hio_mgr->word_size; ae_proc[ndx].ul_size = page_size[i]; ae_proc[ndx].endianism = HW_LITTLE_ENDIAN; @@ -541,9 +541,9 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) ae_proc[ndx].mixed_mode = HW_MMU_CPUES; dev_dbg(bridge, "shm MMU TLB entry PA %x" " VA %x DSP_VA %x Size %x\n", - ae_proc[ndx].ul_gpp_pa, + ae_proc[ndx].gpp_pa, ae_proc[ndx].ul_gpp_va, - ae_proc[ndx].ul_dsp_va * + ae_proc[ndx].dsp_va * hio_mgr->word_size, page_size[i]); ndx++; } else { @@ -556,9 +556,9 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) dev_dbg(bridge, "shm MMU PTE entry PA %x" " VA %x DSP_VA %x Size %x\n", - ae_proc[ndx].ul_gpp_pa, + ae_proc[ndx].gpp_pa, ae_proc[ndx].ul_gpp_va, - ae_proc[ndx].ul_dsp_va * + ae_proc[ndx].dsp_va * hio_mgr->word_size, page_size[i]); if (status) goto func_end; @@ -587,32 +587,32 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) ul_gpp_pa - 0x100000 && hio_mgr->ext_proc_info.ty_tlb[i].ul_gpp_phys <= ul_gpp_pa + ul_seg_size) - || (hio_mgr->ext_proc_info.ty_tlb[i].ul_dsp_virt > + || (hio_mgr->ext_proc_info.ty_tlb[i].dsp_virt > ul_dsp_va - 0x100000 / hio_mgr->word_size - && hio_mgr->ext_proc_info.ty_tlb[i].ul_dsp_virt <= + && hio_mgr->ext_proc_info.ty_tlb[i].dsp_virt <= ul_dsp_va + ul_seg_size / hio_mgr->word_size)) { dev_dbg(bridge, "CDB MMU entry %d conflicts with " "shm.\n\tCDB: GppPa %x, DspVa %x.\n\tSHM: " "GppPa %x, DspVa %x, Bytes %x.\n", i, hio_mgr->ext_proc_info.ty_tlb[i].ul_gpp_phys, - hio_mgr->ext_proc_info.ty_tlb[i].ul_dsp_virt, + hio_mgr->ext_proc_info.ty_tlb[i].dsp_virt, ul_gpp_pa, ul_dsp_va, ul_seg_size); status = -EPERM; } else { if (ndx < MAX_LOCK_TLB_ENTRIES) { - ae_proc[ndx].ul_dsp_va = + ae_proc[ndx].dsp_va = hio_mgr->ext_proc_info.ty_tlb[i]. - ul_dsp_virt; - ae_proc[ndx].ul_gpp_pa = + dsp_virt; + ae_proc[ndx].gpp_pa = hio_mgr->ext_proc_info.ty_tlb[i]. ul_gpp_phys; ae_proc[ndx].ul_gpp_va = 0; /* 1 MB */ ae_proc[ndx].ul_size = 0x100000; dev_dbg(bridge, "shm MMU entry PA %x " - "DSP_VA 0x%x\n", ae_proc[ndx].ul_gpp_pa, - ae_proc[ndx].ul_dsp_va); + "DSP_VA 0x%x\n", ae_proc[ndx].gpp_pa, + ae_proc[ndx].dsp_va); ndx++; } else { status = hio_mgr->intf_fxns->brd_mem_map @@ -620,7 +620,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) hio_mgr->ext_proc_info.ty_tlb[i]. ul_gpp_phys, hio_mgr->ext_proc_info.ty_tlb[i]. - ul_dsp_virt, 0x100000, map_attrs, + dsp_virt, 0x100000, map_attrs, NULL); } } @@ -647,8 +647,8 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) } for (i = ndx; i < BRDIOCTL_NUMOFMMUTLB; i++) { - ae_proc[i].ul_dsp_va = 0; - ae_proc[i].ul_gpp_pa = 0; + ae_proc[i].dsp_va = 0; + ae_proc[i].gpp_pa = 0; ae_proc[i].ul_gpp_va = 0; ae_proc[i].ul_size = 0; } @@ -668,12 +668,12 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) status = -EFAULT; goto func_end; } else { - if (ae_proc[0].ul_dsp_va > ul_shm_base) { + if (ae_proc[0].dsp_va > ul_shm_base) { status = -EPERM; goto func_end; } /* ul_shm_base may not be at ul_dsp_va address */ - ul_shm_base_offset = (ul_shm_base - ae_proc[0].ul_dsp_va) * + ul_shm_base_offset = (ul_shm_base - ae_proc[0].dsp_va) * hio_mgr->word_size; /* * bridge_dev_ctrl() will set dev context dsp-mmu info. In @@ -698,7 +698,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) } /* Register SM */ status = - register_shm_segs(hio_mgr, cod_man, ae_proc[0].ul_gpp_pa); + register_shm_segs(hio_mgr, cod_man, ae_proc[0].gpp_pa); } hio_mgr->shared_mem = (struct shm *)ul_shm_base; @@ -771,7 +771,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) if (!hio_mgr->pmsg) status = -ENOMEM; - hio_mgr->ul_dsp_va = ul_dsp_va; + hio_mgr->dsp_va = ul_dsp_va; hio_mgr->ul_gpp_va = (ul_gpp_va + ul_seg1_size + ul_pad_size); #endif @@ -1544,7 +1544,7 @@ static int register_shm_segs(struct io_mgr *hio_mgr, ul_gpp_phys = hio_mgr->ext_proc_info.ty_tlb[0].ul_gpp_phys; /* Get size in bytes */ ul_dsp_virt = - hio_mgr->ext_proc_info.ty_tlb[0].ul_dsp_virt * + hio_mgr->ext_proc_info.ty_tlb[0].dsp_virt * hio_mgr->word_size; /* * Calc byte offset used to convert GPP phys <-> DSP byte @@ -1694,7 +1694,7 @@ void print_dsp_debug_trace(struct io_mgr *hio_mgr) *(u32 *) (hio_mgr->ul_trace_buffer_current); ul_gpp_cur_pointer = hio_mgr->ul_gpp_va + (ul_gpp_cur_pointer - - hio_mgr->ul_dsp_va); + hio_mgr->dsp_va); /* No new debug messages available yet */ if (ul_gpp_cur_pointer == hio_mgr->ul_gpp_read_pointer) { diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c index 8f39e11..87160bb 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430.c +++ b/drivers/staging/tidspbridge/core/tiomap3430.c @@ -401,7 +401,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, ul_shm_base_virt *= DSPWORDSIZE; DBC_ASSERT(ul_shm_base_virt != 0); /* DSP Virtual address */ - ul_tlb_base_virt = dev_context->atlb_entry[0].ul_dsp_va; + ul_tlb_base_virt = dev_context->atlb_entry[0].dsp_va; DBC_ASSERT(ul_tlb_base_virt <= ul_shm_base_virt); ul_shm_offset_virt = ul_shm_base_virt - (ul_tlb_base_virt * DSPWORDSIZE); @@ -466,19 +466,19 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, .mixed_size = e->mixed_mode, }; - if (!e->ul_gpp_pa || !e->ul_dsp_va) + if (!e->gpp_pa || !e->dsp_va) continue; dev_dbg(bridge, "MMU %d, pa: 0x%x, va: 0x%x, size: 0x%x", itmp_entry_ndx, - e->ul_gpp_pa, - e->ul_dsp_va, + e->gpp_pa, + e->dsp_va, e->ul_size); hw_mmu_tlb_add(dev_context->dsp_mmu_base, - e->ul_gpp_pa, - e->ul_dsp_va, + e->gpp_pa, + e->dsp_va, e->ul_size, itmp_entry_ndx, &map_attrs, 1, 1); @@ -771,8 +771,8 @@ static int bridge_dev_create(struct bridge_dev_context /* Clear dev context MMU table entries. * These get set on bridge_io_on_loaded() call after program loaded. */ for (entry_ndx = 0; entry_ndx < BRDIOCTL_NUMOFMMUTLB; entry_ndx++) { - dev_context->atlb_entry[entry_ndx].ul_gpp_pa = - dev_context->atlb_entry[entry_ndx].ul_dsp_va = 0; + dev_context->atlb_entry[entry_ndx].gpp_pa = + dev_context->atlb_entry[entry_ndx].dsp_va = 0; } dev_context->dsp_base_addr = (u32) MEM_LINEAR_ADDRESS((void *) (config_param-> diff --git a/drivers/staging/tidspbridge/core/tiomap_io.c b/drivers/staging/tidspbridge/core/tiomap_io.c index 574fead..c60a55d 100644 --- a/drivers/staging/tidspbridge/core/tiomap_io.c +++ b/drivers/staging/tidspbridge/core/tiomap_io.c @@ -134,7 +134,7 @@ int read_ext_dsp_data(struct bridge_dev_context *dev_ctxt, if (!status) { ul_tlb_base_virt = - dev_context->atlb_entry[0].ul_dsp_va * DSPWORDSIZE; + dev_context->atlb_entry[0].dsp_va * DSPWORDSIZE; DBC_ASSERT(ul_tlb_base_virt <= ul_shm_base_virt); dw_ext_prog_virt_mem = dev_context->atlb_entry[0].ul_gpp_va; @@ -319,7 +319,7 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context, if (!ret) { ul_tlb_base_virt = - dev_context->atlb_entry[0].ul_dsp_va * DSPWORDSIZE; + dev_context->atlb_entry[0].dsp_va * DSPWORDSIZE; DBC_ASSERT(ul_tlb_base_virt <= ul_shm_base_virt); if (symbols_reloaded) { diff --git a/drivers/staging/tidspbridge/gen/uuidutil.c b/drivers/staging/tidspbridge/gen/uuidutil.c index da39c4f..2aa9b64 100644 --- a/drivers/staging/tidspbridge/gen/uuidutil.c +++ b/drivers/staging/tidspbridge/gen/uuidutil.c @@ -45,7 +45,7 @@ void uuid_uuid_to_string(struct dsp_uuid *uuid_obj, char *sz_uuid, i = snprintf(sz_uuid, size, "%.8X_%.4X_%.4X_%.2X%.2X_%.2X%.2X%.2X%.2X%.2X%.2X", - uuid_obj->ul_data1, uuid_obj->us_data2, uuid_obj->us_data3, + uuid_obj->data1, uuid_obj->us_data2, uuid_obj->us_data3, uuid_obj->uc_data4, uuid_obj->uc_data5, uuid_obj->uc_data6[0], uuid_obj->uc_data6[1], uuid_obj->uc_data6[2], uuid_obj->uc_data6[3], @@ -79,7 +79,7 @@ void uuid_uuid_from_string(char *sz_uuid, struct dsp_uuid *uuid_obj) { s32 j; - uuid_obj->ul_data1 = uuid_hex_to_bin(sz_uuid, 8); + uuid_obj->data1 = uuid_hex_to_bin(sz_uuid, 8); sz_uuid += 8; /* Step over underscore */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h b/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h index 719628e..c00c519 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h @@ -29,7 +29,7 @@ struct cmm_mgrattrs { /* Attributes for CMM_AllocBuf() & CMM_AllocDesc() */ struct cmm_attrs { u32 ul_seg_id; /* 1,2... are SM segments. 0 is not. */ - u32 ul_alignment; /* 0,1,2,4....ul_min_block_size */ + u32 alignment; /* 0,1,2,4....ul_min_block_size */ }; /* @@ -57,7 +57,7 @@ struct cmm_seginfo { u32 gpp_base_pa; /* Start Phys addr of Gpp SM seg */ u32 ul_gpp_size; /* Size of Gpp SM seg in bytes */ u32 dsp_base_va; /* DSP virt base byte address */ - u32 ul_dsp_size; /* DSP seg size in bytes */ + u32 dsp_size; /* DSP seg size in bytes */ /* # of current GPP allocations from this segment */ u32 ul_in_use_cnt; u32 seg_base_va; /* Start Virt address of SM seg */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbdcddef.h b/drivers/staging/tidspbridge/include/dspbridge/dbdcddef.h index 1daa4b5..fc2a736 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dbdcddef.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dbdcddef.h @@ -55,8 +55,8 @@ struct dcd_nodeprops { /* Dynamic load properties */ u16 us_load_type; /* Static, dynamic, overlay */ - u32 ul_data_mem_seg_mask; /* Data memory requirements */ - u32 ul_code_mem_seg_mask; /* Code memory requirements */ + u32 data_mem_seg_mask; /* Data memory requirements */ + u32 code_mem_seg_mask; /* Code memory requirements */ }; /* DCD Generic Object Type */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h index 7a0573d..af90b6b 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h @@ -99,7 +99,7 @@ static inline bool is_valid_proc_event(u32 x) /* The Node UUID structure */ struct dsp_uuid { - u32 ul_data1; + u32 data1; u16 us_data2; u16 us_data3; u8 uc_data4; @@ -359,7 +359,7 @@ struct dsp_processorinfo { int processor_type; u32 clock_rate; u32 ul_internal_mem_size; - u32 ul_external_mem_size; + u32 external_mem_size; u32 processor_id; int ty_running_rtos; s32 node_min_priority; diff --git a/drivers/staging/tidspbridge/include/dspbridge/disp.h b/drivers/staging/tidspbridge/include/dspbridge/disp.h index 41738c5..5dfdc8c 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/disp.h +++ b/drivers/staging/tidspbridge/include/dspbridge/disp.h @@ -27,9 +27,9 @@ struct disp_object; /* Node Dispatcher attributes */ struct disp_attr { - u32 ul_chnl_offset; /* Offset of channel ids reserved for RMS */ + u32 chnl_offset; /* Offset of channel ids reserved for RMS */ /* Size of buffer for sending data to RMS */ - u32 ul_chnl_buf_size; + u32 chnl_buf_size; int proc_family; /* eg, 5000 */ int proc_type; /* eg, 5510 */ void *reserved1; /* Reserved for future use. */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspioctl.h b/drivers/staging/tidspbridge/include/dspbridge/dspioctl.h index 54552a7..bcb39bf 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspioctl.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspioctl.h @@ -55,8 +55,8 @@ #define BRDIOCTL_NUMOFMMUTLB 32 struct bridge_ioctl_extproc { - u32 ul_dsp_va; /* DSP virtual address */ - u32 ul_gpp_pa; /* GPP physical address */ + u32 dsp_va; /* DSP virtual address */ + u32 gpp_pa; /* GPP physical address */ /* GPP virtual address. __va does not work for ioremapped addresses */ u32 ul_gpp_va; u32 ul_size; /* Size of the mapped memory in bytes */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/mgrpriv.h b/drivers/staging/tidspbridge/include/dspbridge/mgrpriv.h index bca4e10..3ceeaa2 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/mgrpriv.h +++ b/drivers/staging/tidspbridge/include/dspbridge/mgrpriv.h @@ -28,7 +28,7 @@ struct mgr_object; struct mgr_tlbentry { - u32 ul_dsp_virt; /* DSP virtual address */ + u32 dsp_virt; /* DSP virtual address */ u32 ul_gpp_phys; /* GPP physical address */ }; diff --git a/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h b/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h index b1cd1a4..0108fae 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h @@ -83,7 +83,7 @@ typedef u32(*nldr_writefxn) (void *priv_ref, */ struct nldr_attrs { nldr_ovlyfxn ovly; - nldr_writefxn pfn_write; + nldr_writefxn write; u16 us_dsp_word_size; u16 us_dsp_mau_size; }; diff --git a/drivers/staging/tidspbridge/include/dspbridge/nodepriv.h b/drivers/staging/tidspbridge/include/dspbridge/nodepriv.h index 16b0233..b14f79a 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/nodepriv.h +++ b/drivers/staging/tidspbridge/include/dspbridge/nodepriv.h @@ -62,7 +62,7 @@ struct node_taskargs { u32 profile_id; /* Profile ID */ u32 num_inputs; u32 num_outputs; - u32 ul_dais_arg; /* Address of iAlg object */ + u32 dais_arg; /* Address of iAlg object */ struct node_strmdef *strm_in_def; struct node_strmdef *strm_out_def; }; diff --git a/drivers/staging/tidspbridge/pmgr/cmm.c b/drivers/staging/tidspbridge/pmgr/cmm.c index bc8571b..d217dc8 100644 --- a/drivers/staging/tidspbridge/pmgr/cmm.c +++ b/drivers/staging/tidspbridge/pmgr/cmm.c @@ -70,7 +70,7 @@ struct cmm_allocator { /* sma */ * SM space */ s8 c_factor; /* DSPPa to GPPPa Conversion Factor */ unsigned int dsp_base; /* DSP virt base byte address */ - u32 ul_dsp_size; /* DSP seg size in bytes */ + u32 dsp_size; /* DSP seg size in bytes */ struct cmm_object *hcmm_mgr; /* back ref to parent mgr */ /* node list of available memory */ struct list_head free_list; @@ -439,19 +439,19 @@ int cmm_get_info(struct cmm_object *hcmm_mgr, continue; cmm_info_obj->ul_num_gppsm_segs++; cmm_info_obj->seg_info[ul_seg - 1].seg_base_pa = - altr->shm_base - altr->ul_dsp_size; + altr->shm_base - altr->dsp_size; cmm_info_obj->seg_info[ul_seg - 1].ul_total_seg_size = - altr->ul_dsp_size + altr->ul_sm_size; + altr->dsp_size + altr->ul_sm_size; cmm_info_obj->seg_info[ul_seg - 1].gpp_base_pa = altr->shm_base; cmm_info_obj->seg_info[ul_seg - 1].ul_gpp_size = altr->ul_sm_size; cmm_info_obj->seg_info[ul_seg - 1].dsp_base_va = altr->dsp_base; - cmm_info_obj->seg_info[ul_seg - 1].ul_dsp_size = - altr->ul_dsp_size; + cmm_info_obj->seg_info[ul_seg - 1].dsp_size = + altr->dsp_size; cmm_info_obj->seg_info[ul_seg - 1].seg_base_va = - altr->vm_base - altr->ul_dsp_size; + altr->vm_base - altr->dsp_size; cmm_info_obj->seg_info[ul_seg - 1].ul_in_use_cnt = 0; list_for_each_entry(curr, &altr->in_use_list, link) { @@ -543,7 +543,7 @@ int cmm_register_gppsm_seg(struct cmm_object *hcmm_mgr, psma->dsp_phys_addr_offset = dsp_addr_offset; psma->c_factor = c_factor; psma->dsp_base = dw_dsp_base; - psma->ul_dsp_size = ul_dsp_size; + psma->dsp_size = ul_dsp_size; if (psma->vm_base == 0) { status = -EPERM; goto func_end; @@ -968,7 +968,7 @@ void *cmm_xlator_translate(struct cmm_xlatorobject *xlator, void *paddr, /* Gpp Va = Va Base + offset */ dw_offset = (u8 *) paddr - (u8 *) (allocator->shm_base - allocator-> - ul_dsp_size); + dsp_size); dw_addr_xlate = xlator_obj->virt_base + dw_offset; /* Check if translated Va base is in range */ if ((dw_addr_xlate < xlator_obj->virt_base) || @@ -982,7 +982,7 @@ void *cmm_xlator_translate(struct cmm_xlatorobject *xlator, void *paddr, dw_offset = (u8 *) paddr - (u8 *) xlator_obj->virt_base; dw_addr_xlate = - allocator->shm_base - allocator->ul_dsp_size + + allocator->shm_base - allocator->dsp_size + dw_offset; } } else { @@ -992,14 +992,14 @@ void *cmm_xlator_translate(struct cmm_xlatorobject *xlator, void *paddr, if ((xtype == CMM_VA2DSPPA) || (xtype == CMM_PA2DSPPA)) { /* Got Gpp Pa now, convert to DSP Pa */ dw_addr_xlate = - GPPPA2DSPPA((allocator->shm_base - allocator->ul_dsp_size), + GPPPA2DSPPA((allocator->shm_base - allocator->dsp_size), dw_addr_xlate, allocator->dsp_phys_addr_offset * allocator->c_factor); } else if (xtype == CMM_DSPPA2PA) { /* Got DSP Pa, convert to GPP Pa */ dw_addr_xlate = - DSPPA2GPPPA(allocator->shm_base - allocator->ul_dsp_size, + DSPPA2GPPPA(allocator->shm_base - allocator->dsp_size, dw_addr_xlate, allocator->dsp_phys_addr_offset * allocator->c_factor); diff --git a/drivers/staging/tidspbridge/pmgr/cod.c b/drivers/staging/tidspbridge/pmgr/cod.c index 17ea57d..1a29264 100644 --- a/drivers/staging/tidspbridge/pmgr/cod.c +++ b/drivers/staging/tidspbridge/pmgr/cod.c @@ -47,7 +47,7 @@ struct cod_manager { struct dbll_tar_obj *target; struct dbll_library_obj *base_lib; bool loaded; /* Base library loaded? */ - u32 ul_entry; + u32 entry; struct dbll_fxns fxns; struct dbll_attrs attrs; char sz_zl_file[COD_MAXPATHLENGTH]; @@ -346,7 +346,7 @@ int cod_get_entry(struct cod_manager *cod_mgr_obj, u32 *entry_pt) DBC_REQUIRE(cod_mgr_obj); DBC_REQUIRE(entry_pt != NULL); - *entry_pt = cod_mgr_obj->ul_entry; + *entry_pt = cod_mgr_obj->entry; return 0; } @@ -516,7 +516,7 @@ int cod_load_base(struct cod_manager *cod_mgr_obj, u32 num_argc, char *args[], flags = DBLL_CODE | DBLL_DATA | DBLL_SYMB; status = cod_mgr_obj->fxns.load_fxn(cod_mgr_obj->base_lib, flags, &new_attrs, - &cod_mgr_obj->ul_entry); + &cod_mgr_obj->entry); if (status) cod_mgr_obj->fxns.close_fxn(cod_mgr_obj->base_lib); diff --git a/drivers/staging/tidspbridge/rmgr/dbdcd.c b/drivers/staging/tidspbridge/rmgr/dbdcd.c index 9e12a2c..f0b396f 100644 --- a/drivers/staging/tidspbridge/rmgr/dbdcd.c +++ b/drivers/staging/tidspbridge/rmgr/dbdcd.c @@ -1227,14 +1227,14 @@ static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size, /* Dynamic load data requirements */ if (token) { - gen_obj->obj_data.node_obj.ul_data_mem_seg_mask = + gen_obj->obj_data.node_obj.data_mem_seg_mask = atoi(token); token = strsep(&psz_cur, seps); } /* Dynamic load code requirements */ if (token) { - gen_obj->obj_data.node_obj.ul_code_mem_seg_mask = + gen_obj->obj_data.node_obj.code_mem_seg_mask = atoi(token); token = strsep(&psz_cur, seps); } @@ -1288,7 +1288,7 @@ static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size, gen_obj->obj_data.proc_info.ul_internal_mem_size = atoi(token); token = strsep(&psz_cur, seps); - gen_obj->obj_data.proc_info.ul_external_mem_size = atoi(token); + gen_obj->obj_data.proc_info.external_mem_size = atoi(token); token = strsep(&psz_cur, seps); gen_obj->obj_data.proc_info.processor_id = atoi(token); @@ -1312,7 +1312,7 @@ static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size, token = strsep(&psz_cur, seps); gen_obj->obj_data.ext_proc_obj.ty_tlb[entry_id]. - ul_dsp_virt = atoi(token); + dsp_virt = atoi(token); } #endif diff --git a/drivers/staging/tidspbridge/rmgr/disp.c b/drivers/staging/tidspbridge/rmgr/disp.c index 02fc425..49e38f3 100644 --- a/drivers/staging/tidspbridge/rmgr/disp.c +++ b/drivers/staging/tidspbridge/rmgr/disp.c @@ -65,8 +65,8 @@ struct disp_object { struct chnl_object *chnl_to_dsp; /* Chnl for commands to RMS */ struct chnl_object *chnl_from_dsp; /* Chnl for replies from RMS */ u8 *pbuf; /* Buffer for commands, replies */ - u32 ul_bufsize; /* pbuf size in bytes */ - u32 ul_bufsize_rms; /* pbuf size in RMS words */ + u32 bufsize; /* buf size in bytes */ + u32 bufsize_rms; /* buf size in RMS words */ u32 char_size; /* Size of DSP character */ u32 word_size; /* Size of DSP word */ u32 data_mau_size; /* Size of DSP Data MAU */ @@ -140,14 +140,14 @@ int disp_create(struct disp_object **dispatch_obj, /* Open channels for communicating with the RMS */ chnl_attr_obj.uio_reqs = CHNLIOREQS; chnl_attr_obj.event_obj = NULL; - ul_chnl_id = disp_attrs->ul_chnl_offset + CHNLTORMSOFFSET; + ul_chnl_id = disp_attrs->chnl_offset + CHNLTORMSOFFSET; status = (*intf_fxns->chnl_open) (&(disp_obj->chnl_to_dsp), disp_obj->hchnl_mgr, CHNL_MODETODSP, ul_chnl_id, &chnl_attr_obj); if (!status) { - ul_chnl_id = disp_attrs->ul_chnl_offset + CHNLFROMRMSOFFSET; + ul_chnl_id = disp_attrs->chnl_offset + CHNLFROMRMSOFFSET; status = (*intf_fxns->chnl_open) (&(disp_obj->chnl_from_dsp), disp_obj->hchnl_mgr, @@ -156,9 +156,9 @@ int disp_create(struct disp_object **dispatch_obj, } if (!status) { /* Allocate buffer for commands, replies */ - disp_obj->ul_bufsize = disp_attrs->ul_chnl_buf_size; - disp_obj->ul_bufsize_rms = RMS_COMMANDBUFSIZE; - disp_obj->pbuf = kzalloc(disp_obj->ul_bufsize, GFP_KERNEL); + disp_obj->bufsize = disp_attrs->chnl_buf_size; + disp_obj->bufsize_rms = RMS_COMMANDBUFSIZE; + disp_obj->pbuf = kzalloc(disp_obj->bufsize, GFP_KERNEL); if (disp_obj->pbuf == NULL) status = -ENOMEM; } @@ -295,7 +295,7 @@ int disp_node_create(struct disp_object *disp_obj, DBC_REQUIRE(pargs != NULL); node_type = node_get_type(hnode); node_msg_args = pargs->asa.node_msg_args; - max = disp_obj->ul_bufsize_rms; /*Max # of RMS words that can be sent */ + max = disp_obj->bufsize_rms; /*Max # of RMS words that can be sent */ DBC_ASSERT(max == RMS_COMMANDBUFSIZE); chars_in_rms_word = sizeof(rms_word) / disp_obj->char_size; /* Number of RMS words needed to hold arg data */ @@ -404,7 +404,7 @@ int disp_node_create(struct disp_object *disp_obj, more_task_args->stack_seg = task_arg_obj.stack_seg; more_task_args->heap_addr = task_arg_obj.udsp_heap_addr; more_task_args->heap_size = task_arg_obj.heap_size; - more_task_args->misc = task_arg_obj.ul_dais_arg; + more_task_args->misc = task_arg_obj.dais_arg; more_task_args->num_input_streams = task_arg_obj.num_inputs; total += diff --git a/drivers/staging/tidspbridge/rmgr/nldr.c b/drivers/staging/tidspbridge/rmgr/nldr.c index 0537346..688d965 100644 --- a/drivers/staging/tidspbridge/rmgr/nldr.c +++ b/drivers/staging/tidspbridge/rmgr/nldr.c @@ -220,7 +220,7 @@ struct nldr_nodeobject { struct dsp_uuid uuid; /* Node's UUID */ bool dynamic; /* Dynamically loaded node? */ bool overlay; /* Overlay node? */ - bool *pf_phase_split; /* Multiple phase libraries? */ + bool *phase_split; /* Multiple phase libraries? */ struct lib_node root; /* Library containing node phase */ struct lib_node create_lib; /* Library with create phase lib */ struct lib_node execute_lib; /* Library with execute phase lib */ @@ -326,7 +326,7 @@ int nldr_allocate(struct nldr_object *nldr_obj, void *priv_ref, if (nldr_node_obj == NULL) { status = -ENOMEM; } else { - nldr_node_obj->pf_phase_split = pf_phase_split; + nldr_node_obj->phase_split = pf_phase_split; nldr_node_obj->pers_libs = 0; nldr_node_obj->nldr_obj = nldr_obj; nldr_node_obj->priv_ref = priv_ref; @@ -344,44 +344,44 @@ int nldr_allocate(struct nldr_object *nldr_obj, void *priv_ref, */ /* Create phase */ nldr_node_obj->seg_id[CREATEDATAFLAGBIT] = (u16) - (node_props->ul_data_mem_seg_mask >> CREATEBIT) & + (node_props->data_mem_seg_mask >> CREATEBIT) & SEGMASK; nldr_node_obj->code_data_flag_mask |= - ((node_props->ul_data_mem_seg_mask >> + ((node_props->data_mem_seg_mask >> (CREATEBIT + FLAGBIT)) & 1) << CREATEDATAFLAGBIT; nldr_node_obj->seg_id[CREATECODEFLAGBIT] = (u16) - (node_props->ul_code_mem_seg_mask >> + (node_props->code_mem_seg_mask >> CREATEBIT) & SEGMASK; nldr_node_obj->code_data_flag_mask |= - ((node_props->ul_code_mem_seg_mask >> + ((node_props->code_mem_seg_mask >> (CREATEBIT + FLAGBIT)) & 1) << CREATECODEFLAGBIT; /* Execute phase */ nldr_node_obj->seg_id[EXECUTEDATAFLAGBIT] = (u16) - (node_props->ul_data_mem_seg_mask >> + (node_props->data_mem_seg_mask >> EXECUTEBIT) & SEGMASK; nldr_node_obj->code_data_flag_mask |= - ((node_props->ul_data_mem_seg_mask >> + ((node_props->data_mem_seg_mask >> (EXECUTEBIT + FLAGBIT)) & 1) << EXECUTEDATAFLAGBIT; nldr_node_obj->seg_id[EXECUTECODEFLAGBIT] = (u16) - (node_props->ul_code_mem_seg_mask >> + (node_props->code_mem_seg_mask >> EXECUTEBIT) & SEGMASK; nldr_node_obj->code_data_flag_mask |= - ((node_props->ul_code_mem_seg_mask >> + ((node_props->code_mem_seg_mask >> (EXECUTEBIT + FLAGBIT)) & 1) << EXECUTECODEFLAGBIT; /* Delete phase */ nldr_node_obj->seg_id[DELETEDATAFLAGBIT] = (u16) - (node_props->ul_data_mem_seg_mask >> DELETEBIT) & + (node_props->data_mem_seg_mask >> DELETEBIT) & SEGMASK; nldr_node_obj->code_data_flag_mask |= - ((node_props->ul_data_mem_seg_mask >> + ((node_props->data_mem_seg_mask >> (DELETEBIT + FLAGBIT)) & 1) << DELETEDATAFLAGBIT; nldr_node_obj->seg_id[DELETECODEFLAGBIT] = (u16) - (node_props->ul_code_mem_seg_mask >> + (node_props->code_mem_seg_mask >> DELETEBIT) & SEGMASK; nldr_node_obj->code_data_flag_mask |= - ((node_props->ul_code_mem_seg_mask >> + ((node_props->code_mem_seg_mask >> (DELETEBIT + FLAGBIT)) & 1) << DELETECODEFLAGBIT; } else { /* Non-dynamically loaded nodes are part of the @@ -430,7 +430,7 @@ int nldr_create(struct nldr_object **nldr, DBC_REQUIRE(hdev_obj != NULL); DBC_REQUIRE(pattrs != NULL); DBC_REQUIRE(pattrs->ovly != NULL); - DBC_REQUIRE(pattrs->pfn_write != NULL); + DBC_REQUIRE(pattrs->write != NULL); /* Allocate dynamic loader object */ nldr_obj = kzalloc(sizeof(struct nldr_object), GFP_KERNEL); @@ -533,9 +533,9 @@ int nldr_create(struct nldr_object **nldr, new_attrs.free = (dbll_free_fxn) remote_free; new_attrs.sym_lookup = (dbll_sym_lookup) get_symbol_value; new_attrs.sym_handle = nldr_obj; - new_attrs.write = (dbll_write_fxn) pattrs->pfn_write; + new_attrs.write = (dbll_write_fxn) pattrs->write; nldr_obj->ovly_fxn = pattrs->ovly; - nldr_obj->write_fxn = pattrs->pfn_write; + nldr_obj->write_fxn = pattrs->write; nldr_obj->ldr_attrs = new_attrs; } kfree(rmm_segs); @@ -678,7 +678,7 @@ int nldr_get_fxn_addr(struct nldr_nodeobject *nldr_node_obj, nldr_obj = nldr_node_obj->nldr_obj; /* Called from node_create(), node_delete(), or node_run(). */ - if (nldr_node_obj->dynamic && *nldr_node_obj->pf_phase_split) { + if (nldr_node_obj->dynamic && *nldr_node_obj->phase_split) { switch (nldr_node_obj->phase) { case NLDR_CREATE: root = nldr_node_obj->create_lib; @@ -821,7 +821,7 @@ int nldr_load(struct nldr_nodeobject *nldr_node_obj, false, nldr_node_obj->lib_path, phase, 0); if (!status) { - if (*nldr_node_obj->pf_phase_split) { + if (*nldr_node_obj->phase_split) { switch (phase) { case NLDR_CREATE: nldr_node_obj->create_lib = @@ -868,7 +868,7 @@ int nldr_unload(struct nldr_nodeobject *nldr_node_obj, if (nldr_node_obj != NULL) { if (nldr_node_obj->dynamic) { - if (*nldr_node_obj->pf_phase_split) { + if (*nldr_node_obj->phase_split) { switch (phase) { case NLDR_CREATE: root_lib = &nldr_node_obj->create_lib; @@ -1264,7 +1264,7 @@ static int load_lib(struct nldr_nodeobject *nldr_node_obj, dcd_get_library_name(nldr_node_obj->nldr_obj-> hdcd_mgr, &uuid, psz_file_name, &dw_buf_size, phase, - nldr_node_obj->pf_phase_split); + nldr_node_obj->phase_split); } else { /* Dependent libraries are registered with a phase */ status = @@ -1314,7 +1314,7 @@ static int load_lib(struct nldr_nodeobject *nldr_node_obj, } DBC_ASSERT(nd_libs >= np_libs); if (!status) { - if (!(*nldr_node_obj->pf_phase_split)) + if (!(*nldr_node_obj->phase_split)) np_libs = 0; /* nd_libs = #of dependent libraries */ @@ -1359,7 +1359,7 @@ static int load_lib(struct nldr_nodeobject *nldr_node_obj, * is, then record it. If root library IS persistent, * the deplib is already included */ if (!root_prstnt && persistent_dep_libs[i] && - *nldr_node_obj->pf_phase_split) { + *nldr_node_obj->phase_split) { if ((nldr_node_obj->pers_libs) >= MAXLIBS) { status = -EILSEQ; break; @@ -1385,11 +1385,11 @@ static int load_lib(struct nldr_nodeobject *nldr_node_obj, if (!status) { if ((status != 0) && !root_prstnt && persistent_dep_libs[i] && - *nldr_node_obj->pf_phase_split) { + *nldr_node_obj->phase_split) { (nldr_node_obj->pers_libs)++; } else { if (!persistent_dep_libs[i] || - !(*nldr_node_obj->pf_phase_split)) { + !(*nldr_node_obj->phase_split)) { nd_libs_loaded++; } } @@ -1903,7 +1903,7 @@ int nldr_find_addr(struct nldr_nodeobject *nldr_node, u32 sym_addr, pr_debug("%s(0x%x, 0x%x, 0x%x, 0x%x, %s)\n", __func__, (u32) nldr_node, sym_addr, offset_range, (u32) offset_output, sym_name); - if (nldr_node->dynamic && *nldr_node->pf_phase_split) { + if (nldr_node->dynamic && *nldr_node->phase_split) { switch (nldr_node->phase) { case NLDR_CREATE: root = nldr_node->create_lib; diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c index 8008a5c..4e6a63e 100644 --- a/drivers/staging/tidspbridge/rmgr/node.c +++ b/drivers/staging/tidspbridge/rmgr/node.c @@ -142,13 +142,13 @@ struct node_mgr { DECLARE_BITMAP(zc_chnl_map, CHNL_MAXCHANNELS); struct ntfy_object *ntfy_obj; /* Manages registered notifications */ struct mutex node_mgr_lock; /* For critical sections */ - u32 ul_fxn_addrs[NUMRMSFXNS]; /* RMS function addresses */ + u32 fxn_addrs[NUMRMSFXNS]; /* RMS function addresses */ struct msg_mgr *msg_mgr_obj; /* Processor properties needed by Node Dispatcher */ u32 ul_num_chnls; /* Total number of channels */ - u32 ul_chnl_offset; /* Offset of chnl ids rsvd for RMS */ - u32 ul_chnl_buf_size; /* Buffer size for data to RMS */ + u32 chnl_offset; /* Offset of chnl ids rsvd for RMS */ + u32 chnl_buf_size; /* Buffer size for data to RMS */ int proc_family; /* eg, 5000 */ int proc_type; /* eg, 5510 */ u32 udsp_word_size; /* Size of DSP word on host bytes */ @@ -367,7 +367,7 @@ int node_allocate(struct proc_object *hprocessor, } /* Assuming that 0 is not a valid function address */ - if (hnode_mgr->ul_fxn_addrs[0] == 0) { + if (hnode_mgr->fxn_addrs[0] == 0) { /* No RMS on target - we currently can't handle this */ pr_err("%s: Failed, no RMS in base image\n", __func__); status = -EPERM; @@ -813,7 +813,7 @@ int node_change_priority(struct node_object *hnode, s32 prio) status = disp_node_change_priority(hnode_mgr->disp_obj, hnode, - hnode_mgr->ul_fxn_addrs + hnode_mgr->fxn_addrs [RMSCHANGENODEPRIORITY], hnode->node_env, prio); } @@ -1216,14 +1216,14 @@ int node_create(struct node_object *hnode) hnode->dcd_props.obj_data.node_obj. pstr_i_alg_name, &hnode->create_args.asa. - task_arg_obj.ul_dais_arg); + task_arg_obj.dais_arg); } } } if (!status) { if (node_type != NODE_DEVICE) { status = disp_node_create(hnode_mgr->disp_obj, hnode, - hnode_mgr->ul_fxn_addrs + hnode_mgr->fxn_addrs [RMSCREATENODE], ul_create_fxn, &(hnode->create_args), @@ -1324,8 +1324,8 @@ int node_create_mgr(struct node_mgr **node_man, goto out_err; /* Create NODE Dispatcher */ - disp_attr_obj.ul_chnl_offset = node_mgr_obj->ul_chnl_offset; - disp_attr_obj.ul_chnl_buf_size = node_mgr_obj->ul_chnl_buf_size; + disp_attr_obj.chnl_offset = node_mgr_obj->chnl_offset; + disp_attr_obj.chnl_buf_size = node_mgr_obj->chnl_buf_size; disp_attr_obj.proc_family = node_mgr_obj->proc_family; disp_attr_obj.proc_type = node_mgr_obj->proc_type; @@ -1344,12 +1344,12 @@ int node_create_mgr(struct node_mgr **node_man, mutex_init(&node_mgr_obj->node_mgr_lock); /* Block out reserved channels */ - for (i = 0; i < node_mgr_obj->ul_chnl_offset; i++) + for (i = 0; i < node_mgr_obj->chnl_offset; i++) set_bit(i, node_mgr_obj->chnl_map); /* Block out channels reserved for RMS */ - set_bit(node_mgr_obj->ul_chnl_offset, node_mgr_obj->chnl_map); - set_bit(node_mgr_obj->ul_chnl_offset + 1, node_mgr_obj->chnl_map); + set_bit(node_mgr_obj->chnl_offset, node_mgr_obj->chnl_map); + set_bit(node_mgr_obj->chnl_offset + 1, node_mgr_obj->chnl_map); /* NO RM Server on the IVA */ if (dev_type != IVA_UNIT) { @@ -1363,7 +1363,7 @@ int node_create_mgr(struct node_mgr **node_man, node_mgr_obj->nldr_fxns = nldr_fxns; /* Dyn loader funcs */ nldr_attrs_obj.ovly = ovly; - nldr_attrs_obj.pfn_write = mem_write; + nldr_attrs_obj.write = mem_write; nldr_attrs_obj.us_dsp_word_size = node_mgr_obj->udsp_word_size; nldr_attrs_obj.us_dsp_mau_size = node_mgr_obj->udsp_mau_size; node_mgr_obj->loader_init = node_mgr_obj->nldr_fxns.init(); @@ -1489,7 +1489,7 @@ func_cont1: status = disp_node_delete(disp_obj, pnode, hnode_mgr-> - ul_fxn_addrs + fxn_addrs [RMSDELETENODE], ul_delete_fxn, pnode->node_env); @@ -2012,7 +2012,7 @@ int node_pause(struct node_object *hnode) } status = disp_node_change_priority(hnode_mgr->disp_obj, hnode, - hnode_mgr->ul_fxn_addrs[RMSCHANGENODEPRIORITY], + hnode_mgr->fxn_addrs[RMSCHANGENODEPRIORITY], hnode->node_env, NODE_SUSPENDEDPRI); /* Update state */ @@ -2274,14 +2274,14 @@ int node_run(struct node_object *hnode) } } if (!status) { - ul_fxn_addr = hnode_mgr->ul_fxn_addrs[RMSEXECUTENODE]; + ul_fxn_addr = hnode_mgr->fxn_addrs[RMSEXECUTENODE]; status = disp_node_run(hnode_mgr->disp_obj, hnode, ul_fxn_addr, ul_execute_fxn, hnode->node_env); } } else if (state == NODE_PAUSED) { - ul_fxn_addr = hnode_mgr->ul_fxn_addrs[RMSCHANGENODEPRIORITY]; + ul_fxn_addr = hnode_mgr->fxn_addrs[RMSCHANGENODEPRIORITY]; status = disp_node_change_priority(hnode_mgr->disp_obj, hnode, ul_fxn_addr, hnode->node_env, NODE_GET_PRIORITY(hnode)); @@ -2902,8 +2902,8 @@ static int get_proc_props(struct node_mgr *hnode_mgr, host_res = pbridge_context->resources; if (!host_res) return -EPERM; - hnode_mgr->ul_chnl_offset = host_res->chnl_offset; - hnode_mgr->ul_chnl_buf_size = host_res->chnl_buf_size; + hnode_mgr->chnl_offset = host_res->chnl_offset; + hnode_mgr->chnl_buf_size = host_res->chnl_buf_size; hnode_mgr->ul_num_chnls = host_res->num_chnls; /* @@ -3024,7 +3024,7 @@ static int get_rms_fxns(struct node_mgr *hnode_mgr) for (i = 0; i < NUMRMSFXNS; i++) { status = dev_get_symbol(dev_obj, psz_fxns[i], - &(hnode_mgr->ul_fxn_addrs[i])); + &(hnode_mgr->fxn_addrs[i])); if (status) { if (status == -ESPIPE) { /* -- cgit v0.10.2 From 6c66e948d2c8254c8435f27eacb7f8657ce62dec Mon Sep 17 00:00:00 2001 From: Rene Sapiens Date: Tue, 18 Jan 2011 03:19:09 +0000 Subject: staging: tidspbridge: set7 remove hungarian from structs hungarian notation will be removed from the elements inside structures, the next varibles will be renamed: Original: Replacement: ul_gpp_phys gpp_phys ul_gpp_read_pointer gpp_read_pointer ul_gpp_size gpp_size ul_gpp_va gpp_va ul_heap_size heap_size ul_internal_mem_size internal_mem_size ul_in_use_cnt in_use_cnt ul_len_max_free_block len_max_free_block ul_max max ul_min_block_size min_block_size ul_min min ul_mpu_addr mpu_addr ul_n_bytes bytes ul_num_alloc_blocks num_alloc_blocks ul_number_bytes number_bytes ul_num_chnls num_chnls ul_num_free_blocks num_free_blocks ul_num_gppsm_segs num_gppsm_segs ul_pos pos ul_reserved reserved Signed-off-by: Rene Sapiens Signed-off-by: Armando Uribe Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index 5be6e0f..c923dda 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c @@ -118,9 +118,9 @@ struct io_mgr { u32 ul_trace_buffer_begin; /* Trace message start address */ u32 ul_trace_buffer_end; /* Trace message end address */ u32 ul_trace_buffer_current; /* Trace message current address */ - u32 ul_gpp_read_pointer; /* GPP Read pointer to Trace buffer */ + u32 gpp_read_pointer; /* GPP Read pointer to Trace buffer */ u8 *pmsg; - u32 ul_gpp_va; + u32 gpp_va; u32 dsp_va; #endif /* IO Dpc */ @@ -532,7 +532,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) * This is the virtual uncached ioremapped * address!!! */ - ae_proc[ndx].ul_gpp_va = gpp_va_curr; + ae_proc[ndx].gpp_va = gpp_va_curr; ae_proc[ndx].dsp_va = va_curr / hio_mgr->word_size; ae_proc[ndx].ul_size = page_size[i]; @@ -542,7 +542,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) dev_dbg(bridge, "shm MMU TLB entry PA %x" " VA %x DSP_VA %x Size %x\n", ae_proc[ndx].gpp_pa, - ae_proc[ndx].ul_gpp_va, + ae_proc[ndx].gpp_va, ae_proc[ndx].dsp_va * hio_mgr->word_size, page_size[i]); ndx++; @@ -557,7 +557,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) "shm MMU PTE entry PA %x" " VA %x DSP_VA %x Size %x\n", ae_proc[ndx].gpp_pa, - ae_proc[ndx].ul_gpp_va, + ae_proc[ndx].gpp_va, ae_proc[ndx].dsp_va * hio_mgr->word_size, page_size[i]); if (status) @@ -580,12 +580,12 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) * should not conflict with shm entries on MPU or DSP side. */ for (i = 3; i < 7 && ndx < BRDIOCTL_NUMOFMMUTLB; i++) { - if (hio_mgr->ext_proc_info.ty_tlb[i].ul_gpp_phys == 0) + if (hio_mgr->ext_proc_info.ty_tlb[i].gpp_phys == 0) continue; - if ((hio_mgr->ext_proc_info.ty_tlb[i].ul_gpp_phys > + if ((hio_mgr->ext_proc_info.ty_tlb[i].gpp_phys > ul_gpp_pa - 0x100000 - && hio_mgr->ext_proc_info.ty_tlb[i].ul_gpp_phys <= + && hio_mgr->ext_proc_info.ty_tlb[i].gpp_phys <= ul_gpp_pa + ul_seg_size) || (hio_mgr->ext_proc_info.ty_tlb[i].dsp_virt > ul_dsp_va - 0x100000 / hio_mgr->word_size @@ -595,7 +595,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) "CDB MMU entry %d conflicts with " "shm.\n\tCDB: GppPa %x, DspVa %x.\n\tSHM: " "GppPa %x, DspVa %x, Bytes %x.\n", i, - hio_mgr->ext_proc_info.ty_tlb[i].ul_gpp_phys, + hio_mgr->ext_proc_info.ty_tlb[i].gpp_phys, hio_mgr->ext_proc_info.ty_tlb[i].dsp_virt, ul_gpp_pa, ul_dsp_va, ul_seg_size); status = -EPERM; @@ -606,8 +606,8 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) dsp_virt; ae_proc[ndx].gpp_pa = hio_mgr->ext_proc_info.ty_tlb[i]. - ul_gpp_phys; - ae_proc[ndx].ul_gpp_va = 0; + gpp_phys; + ae_proc[ndx].gpp_va = 0; /* 1 MB */ ae_proc[ndx].ul_size = 0x100000; dev_dbg(bridge, "shm MMU entry PA %x " @@ -618,7 +618,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) status = hio_mgr->intf_fxns->brd_mem_map (hio_mgr->hbridge_context, hio_mgr->ext_proc_info.ty_tlb[i]. - ul_gpp_phys, + gpp_phys, hio_mgr->ext_proc_info.ty_tlb[i]. dsp_virt, 0x100000, map_attrs, NULL); @@ -649,7 +649,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) for (i = ndx; i < BRDIOCTL_NUMOFMMUTLB; i++) { ae_proc[i].dsp_va = 0; ae_proc[i].gpp_pa = 0; - ae_proc[i].ul_gpp_va = 0; + ae_proc[i].gpp_va = 0; ae_proc[i].ul_size = 0; } /* @@ -657,14 +657,14 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) * to the virtual uncached ioremapped address of shm reserved * on MPU. */ - hio_mgr->ext_proc_info.ty_tlb[0].ul_gpp_phys = + hio_mgr->ext_proc_info.ty_tlb[0].gpp_phys = (ul_gpp_va + ul_seg1_size + ul_pad_size); /* * Need shm Phys addr. IO supports only one DSP for now: * num_procs = 1. */ - if (!hio_mgr->ext_proc_info.ty_tlb[0].ul_gpp_phys || num_procs != 1) { + if (!hio_mgr->ext_proc_info.ty_tlb[0].gpp_phys || num_procs != 1) { status = -EFAULT; goto func_end; } else { @@ -688,7 +688,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) ae_proc); if (status) goto func_end; - ul_shm_base = hio_mgr->ext_proc_info.ty_tlb[0].ul_gpp_phys; + ul_shm_base = hio_mgr->ext_proc_info.ty_tlb[0].gpp_phys; ul_shm_base += ul_shm_base_offset; ul_shm_base = (u32) MEM_LINEAR_ADDRESS((void *)ul_shm_base, ul_mem_length); @@ -740,7 +740,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) goto func_end; } - hio_mgr->ul_gpp_read_pointer = hio_mgr->ul_trace_buffer_begin = + hio_mgr->gpp_read_pointer = hio_mgr->ul_trace_buffer_begin = (ul_gpp_va + ul_seg1_size + ul_pad_size) + (hio_mgr->ul_trace_buffer_begin - ul_dsp_va); /* Get the end address of trace buffer */ @@ -772,7 +772,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) status = -ENOMEM; hio_mgr->dsp_va = ul_dsp_va; - hio_mgr->ul_gpp_va = (ul_gpp_va + ul_seg1_size + ul_pad_size); + hio_mgr->gpp_va = (ul_gpp_va + ul_seg1_size + ul_pad_size); #endif func_end: @@ -1541,7 +1541,7 @@ static int register_shm_segs(struct io_mgr *hio_mgr, goto func_end; } /* First TLB entry reserved for Bridge SM use. */ - ul_gpp_phys = hio_mgr->ext_proc_info.ty_tlb[0].ul_gpp_phys; + ul_gpp_phys = hio_mgr->ext_proc_info.ty_tlb[0].gpp_phys; /* Get size in bytes */ ul_dsp_virt = hio_mgr->ext_proc_info.ty_tlb[0].dsp_virt * @@ -1693,48 +1693,48 @@ void print_dsp_debug_trace(struct io_mgr *hio_mgr) ul_gpp_cur_pointer = *(u32 *) (hio_mgr->ul_trace_buffer_current); ul_gpp_cur_pointer = - hio_mgr->ul_gpp_va + (ul_gpp_cur_pointer - + hio_mgr->gpp_va + (ul_gpp_cur_pointer - hio_mgr->dsp_va); /* No new debug messages available yet */ - if (ul_gpp_cur_pointer == hio_mgr->ul_gpp_read_pointer) { + if (ul_gpp_cur_pointer == hio_mgr->gpp_read_pointer) { break; - } else if (ul_gpp_cur_pointer > hio_mgr->ul_gpp_read_pointer) { + } else if (ul_gpp_cur_pointer > hio_mgr->gpp_read_pointer) { /* Continuous data */ ul_new_message_length = - ul_gpp_cur_pointer - hio_mgr->ul_gpp_read_pointer; + ul_gpp_cur_pointer - hio_mgr->gpp_read_pointer; memcpy(hio_mgr->pmsg, - (char *)hio_mgr->ul_gpp_read_pointer, + (char *)hio_mgr->gpp_read_pointer, ul_new_message_length); hio_mgr->pmsg[ul_new_message_length] = '\0'; /* * Advance the GPP trace pointer to DSP current * pointer. */ - hio_mgr->ul_gpp_read_pointer += ul_new_message_length; + hio_mgr->gpp_read_pointer += ul_new_message_length; /* Print the trace messages */ pr_info("DSPTrace: %s\n", hio_mgr->pmsg); - } else if (ul_gpp_cur_pointer < hio_mgr->ul_gpp_read_pointer) { + } else if (ul_gpp_cur_pointer < hio_mgr->gpp_read_pointer) { /* Handle trace buffer wraparound */ memcpy(hio_mgr->pmsg, - (char *)hio_mgr->ul_gpp_read_pointer, + (char *)hio_mgr->gpp_read_pointer, hio_mgr->ul_trace_buffer_end - - hio_mgr->ul_gpp_read_pointer); + hio_mgr->gpp_read_pointer); ul_new_message_length = ul_gpp_cur_pointer - hio_mgr->ul_trace_buffer_begin; memcpy(&hio_mgr->pmsg[hio_mgr->ul_trace_buffer_end - - hio_mgr->ul_gpp_read_pointer], + hio_mgr->gpp_read_pointer], (char *)hio_mgr->ul_trace_buffer_begin, ul_new_message_length); hio_mgr->pmsg[hio_mgr->ul_trace_buffer_end - - hio_mgr->ul_gpp_read_pointer + + hio_mgr->gpp_read_pointer + ul_new_message_length] = '\0'; /* * Advance the GPP trace pointer to DSP current * pointer. */ - hio_mgr->ul_gpp_read_pointer = + hio_mgr->gpp_read_pointer = hio_mgr->ul_trace_buffer_begin + ul_new_message_length; /* Print the trace messages */ diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c index 87160bb..2c15b03 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430.c +++ b/drivers/staging/tidspbridge/core/tiomap3430.c @@ -406,7 +406,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, ul_shm_offset_virt = ul_shm_base_virt - (ul_tlb_base_virt * DSPWORDSIZE); /* Kernel logical address */ - ul_shm_base = dev_context->atlb_entry[0].ul_gpp_va + ul_shm_offset_virt; + ul_shm_base = dev_context->atlb_entry[0].gpp_va + ul_shm_offset_virt; DBC_ASSERT(ul_shm_base != 0); /* 2nd wd is used as sync field */ diff --git a/drivers/staging/tidspbridge/core/tiomap_io.c b/drivers/staging/tidspbridge/core/tiomap_io.c index c60a55d..257052a 100644 --- a/drivers/staging/tidspbridge/core/tiomap_io.c +++ b/drivers/staging/tidspbridge/core/tiomap_io.c @@ -137,7 +137,7 @@ int read_ext_dsp_data(struct bridge_dev_context *dev_ctxt, dev_context->atlb_entry[0].dsp_va * DSPWORDSIZE; DBC_ASSERT(ul_tlb_base_virt <= ul_shm_base_virt); dw_ext_prog_virt_mem = - dev_context->atlb_entry[0].ul_gpp_va; + dev_context->atlb_entry[0].gpp_va; if (!trace_read) { ul_shm_offset_virt = @@ -337,7 +337,7 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context, ul_shm_base_virt - ul_tlb_base_virt; if (trace_load) { dw_ext_prog_virt_mem = - dev_context->atlb_entry[0].ul_gpp_va; + dev_context->atlb_entry[0].gpp_va; } else { dw_ext_prog_virt_mem = host_res->mem_base[1]; dw_ext_prog_virt_mem += diff --git a/drivers/staging/tidspbridge/include/dspbridge/cmm.h b/drivers/staging/tidspbridge/include/dspbridge/cmm.h index 6ad313f..27a21b5 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/cmm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/cmm.h @@ -81,7 +81,7 @@ extern void *cmm_calloc_buf(struct cmm_object *hcmm_mgr, * Requires: * cmm_init(void) called. * ph_cmm_mgr != NULL. - * mgr_attrts->ul_min_block_size >= 4 bytes. + * mgr_attrts->min_block_size >= 4 bytes. * Ensures: * */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h b/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h index c00c519..c995596 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h @@ -23,13 +23,13 @@ /* Cmm attributes used in cmm_create() */ struct cmm_mgrattrs { /* Minimum SM allocation; default 32 bytes. */ - u32 ul_min_block_size; + u32 min_block_size; }; /* Attributes for CMM_AllocBuf() & CMM_AllocDesc() */ struct cmm_attrs { u32 ul_seg_id; /* 1,2... are SM segments. 0 is not. */ - u32 alignment; /* 0,1,2,4....ul_min_block_size */ + u32 alignment; /* 0,1,2,4....min_block_size */ }; /* @@ -55,11 +55,11 @@ struct cmm_seginfo { /* Total size in bytes of segment: DSP+GPP */ u32 ul_total_seg_size; u32 gpp_base_pa; /* Start Phys addr of Gpp SM seg */ - u32 ul_gpp_size; /* Size of Gpp SM seg in bytes */ + u32 gpp_size; /* Size of Gpp SM seg in bytes */ u32 dsp_base_va; /* DSP virt base byte address */ u32 dsp_size; /* DSP seg size in bytes */ /* # of current GPP allocations from this segment */ - u32 ul_in_use_cnt; + u32 in_use_cnt; u32 seg_base_va; /* Start Virt address of SM seg */ }; @@ -67,11 +67,11 @@ struct cmm_seginfo { /* CMM useful information */ struct cmm_info { /* # of SM segments registered with this Cmm. */ - u32 ul_num_gppsm_segs; + u32 num_gppsm_segs; /* Total # of allocations outstanding for CMM */ u32 ul_total_in_use_cnt; /* Min SM block size allocation from cmm_create() */ - u32 ul_min_block_size; + u32 min_block_size; /* Info per registered SM segment. */ struct cmm_seginfo seg_info[CMM_MAXGPPSEGS]; }; diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h index af90b6b..efd731d 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h @@ -210,9 +210,9 @@ enum dsp_flushtype { struct dsp_memstat { u32 ul_size; u32 ul_total_free_size; - u32 ul_len_max_free_block; - u32 ul_num_free_blocks; - u32 ul_num_alloc_blocks; + u32 len_max_free_block; + u32 num_free_blocks; + u32 num_alloc_blocks; }; /* Processor Load information Values */ @@ -276,7 +276,7 @@ struct dsp_streamconnect { }; struct dsp_nodeprofs { - u32 ul_heap_size; + u32 heap_size; }; /* The dsp_ndbprops structure reports the attributes of a node */ @@ -358,7 +358,7 @@ struct dsp_processorinfo { int processor_family; int processor_type; u32 clock_rate; - u32 ul_internal_mem_size; + u32 internal_mem_size; u32 external_mem_size; u32 processor_id; int ty_running_rtos; @@ -425,7 +425,7 @@ struct dsp_streaminfo { u32 cb_struct; u32 number_bufs_allowed; u32 number_bufs_in_stream; - u32 ul_number_bytes; + u32 number_bytes; void *sync_object_handle; enum dsp_streamstate ss_stream_state; }; diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspioctl.h b/drivers/staging/tidspbridge/include/dspbridge/dspioctl.h index bcb39bf..307d1a0 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspioctl.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspioctl.h @@ -58,7 +58,7 @@ struct bridge_ioctl_extproc { u32 dsp_va; /* DSP virtual address */ u32 gpp_pa; /* GPP physical address */ /* GPP virtual address. __va does not work for ioremapped addresses */ - u32 ul_gpp_va; + u32 gpp_va; u32 ul_size; /* Size of the mapped memory in bytes */ enum hw_endianism_t endianism; enum hw_mmu_mixed_size_t mixed_mode; diff --git a/drivers/staging/tidspbridge/include/dspbridge/mgrpriv.h b/drivers/staging/tidspbridge/include/dspbridge/mgrpriv.h index 3ceeaa2..3a4e337 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/mgrpriv.h +++ b/drivers/staging/tidspbridge/include/dspbridge/mgrpriv.h @@ -29,7 +29,7 @@ struct mgr_object; struct mgr_tlbentry { u32 dsp_virt; /* DSP virtual address */ - u32 ul_gpp_phys; /* GPP physical address */ + u32 gpp_phys; /* GPP physical address */ }; /* diff --git a/drivers/staging/tidspbridge/pmgr/cmm.c b/drivers/staging/tidspbridge/pmgr/cmm.c index d217dc8..4142e9a 100644 --- a/drivers/staging/tidspbridge/pmgr/cmm.c +++ b/drivers/staging/tidspbridge/pmgr/cmm.c @@ -98,7 +98,7 @@ struct cmm_object { */ struct mutex cmm_lock; /* Lock to access cmm mgr */ struct list_head node_free_list; /* Free list of memory nodes */ - u32 ul_min_block_size; /* Min SM block; default 16 bytes */ + u32 min_block_size; /* Min SM block; default 16 bytes */ u32 page_size; /* Memory Page size (1k/4k) */ /* GPP SM segment ptrs */ struct cmm_allocator *pa_gppsm_seg_tab[CMM_MAXGPPSEGS]; @@ -106,7 +106,7 @@ struct cmm_object { /* Default CMM Mgr attributes */ static struct cmm_mgrattrs cmm_dfltmgrattrs = { - /* ul_min_block_size, min block size(bytes) allocated by cmm mgr */ + /* min_block_size, min block size(bytes) allocated by cmm mgr */ 16 }; @@ -185,17 +185,17 @@ void *cmm_calloc_buf(struct cmm_object *hcmm_mgr, u32 usize, /* get the allocator object for this segment id */ allocator = get_allocator(cmm_mgr_obj, pattrs->ul_seg_id); - /* keep block size a multiple of ul_min_block_size */ + /* keep block size a multiple of min_block_size */ usize = - ((usize - 1) & ~(cmm_mgr_obj->ul_min_block_size - + ((usize - 1) & ~(cmm_mgr_obj->min_block_size - 1)) - + cmm_mgr_obj->ul_min_block_size; + + cmm_mgr_obj->min_block_size; mutex_lock(&cmm_mgr_obj->cmm_lock); pnode = get_free_block(allocator, usize); } if (pnode) { delta_size = (pnode->ul_size - usize); - if (delta_size >= cmm_mgr_obj->ul_min_block_size) { + if (delta_size >= cmm_mgr_obj->min_block_size) { /* create a new block with the leftovers and * add to freelist */ new_node = @@ -257,9 +257,9 @@ int cmm_create(struct cmm_object **ph_cmm_mgr, mgr_attrts = &cmm_dfltmgrattrs; /* set defaults */ /* 4 bytes minimum */ - DBC_ASSERT(mgr_attrts->ul_min_block_size >= 4); + DBC_ASSERT(mgr_attrts->min_block_size >= 4); /* save away smallest block allocation for this cmm mgr */ - cmm_obj->ul_min_block_size = mgr_attrts->ul_min_block_size; + cmm_obj->min_block_size = mgr_attrts->min_block_size; cmm_obj->page_size = PAGE_SIZE; /* create node free list */ @@ -426,25 +426,25 @@ int cmm_get_info(struct cmm_object *hcmm_mgr, return status; } mutex_lock(&cmm_mgr_obj->cmm_lock); - cmm_info_obj->ul_num_gppsm_segs = 0; /* # of SM segments */ + cmm_info_obj->num_gppsm_segs = 0; /* # of SM segments */ /* Total # of outstanding alloc */ cmm_info_obj->ul_total_in_use_cnt = 0; /* min block size */ - cmm_info_obj->ul_min_block_size = cmm_mgr_obj->ul_min_block_size; + cmm_info_obj->min_block_size = cmm_mgr_obj->min_block_size; /* check SM memory segments */ for (ul_seg = 1; ul_seg <= CMM_MAXGPPSEGS; ul_seg++) { /* get the allocator object for this segment id */ altr = get_allocator(cmm_mgr_obj, ul_seg); if (!altr) continue; - cmm_info_obj->ul_num_gppsm_segs++; + cmm_info_obj->num_gppsm_segs++; cmm_info_obj->seg_info[ul_seg - 1].seg_base_pa = altr->shm_base - altr->dsp_size; cmm_info_obj->seg_info[ul_seg - 1].ul_total_seg_size = altr->dsp_size + altr->ul_sm_size; cmm_info_obj->seg_info[ul_seg - 1].gpp_base_pa = altr->shm_base; - cmm_info_obj->seg_info[ul_seg - 1].ul_gpp_size = + cmm_info_obj->seg_info[ul_seg - 1].gpp_size = altr->ul_sm_size; cmm_info_obj->seg_info[ul_seg - 1].dsp_base_va = altr->dsp_base; @@ -452,11 +452,11 @@ int cmm_get_info(struct cmm_object *hcmm_mgr, altr->dsp_size; cmm_info_obj->seg_info[ul_seg - 1].seg_base_va = altr->vm_base - altr->dsp_size; - cmm_info_obj->seg_info[ul_seg - 1].ul_in_use_cnt = 0; + cmm_info_obj->seg_info[ul_seg - 1].in_use_cnt = 0; list_for_each_entry(curr, &altr->in_use_list, link) { cmm_info_obj->ul_total_in_use_cnt++; - cmm_info_obj->seg_info[ul_seg - 1].ul_in_use_cnt++; + cmm_info_obj->seg_info[ul_seg - 1].in_use_cnt++; } } mutex_unlock(&cmm_mgr_obj->cmm_lock); @@ -524,7 +524,7 @@ int cmm_register_gppsm_seg(struct cmm_object *hcmm_mgr, } /* Check if input ul_size is big enough to alloc at least one block */ - if (ul_size < cmm_mgr_obj->ul_min_block_size) { + if (ul_size < cmm_mgr_obj->min_block_size) { status = -EINVAL; goto func_end; } diff --git a/drivers/staging/tidspbridge/pmgr/dbll.c b/drivers/staging/tidspbridge/pmgr/dbll.c index 2f46b06..2e20f78e 100644 --- a/drivers/staging/tidspbridge/pmgr/dbll.c +++ b/drivers/staging/tidspbridge/pmgr/dbll.c @@ -123,7 +123,7 @@ struct dbll_library_obj { u32 open_ref; /* Number of times opened */ u32 load_ref; /* Number of times loaded */ struct gh_t_hash_tab *sym_tab; /* Hash table of symbols */ - u32 ul_pos; + u32 pos; }; /* @@ -398,7 +398,7 @@ int dbll_get_sect(struct dbll_library_obj *lib, char *name, u32 *paddr, } else { (*(zl_lib->target_obj->attrs.fseek)) (zl_lib->fp, - zl_lib->ul_pos, + zl_lib->pos, SEEK_SET); } } else { @@ -522,7 +522,7 @@ int dbll_load(struct dbll_library_obj *lib, dbll_flags flags, } if (!status) { - zl_lib->ul_pos = (*(zl_lib->target_obj->attrs.ftell)) + zl_lib->pos = (*(zl_lib->target_obj->attrs.ftell)) (zl_lib->fp); /* Reset file cursor */ (*(zl_lib->target_obj->attrs.fseek)) (zl_lib->fp, @@ -599,7 +599,7 @@ int dbll_open(struct dbll_tar_obj *target, char *file, dbll_flags flags, if (zl_lib == NULL) { status = -ENOMEM; } else { - zl_lib->ul_pos = 0; + zl_lib->pos = 0; /* Increment ref count to allow close on failure * later on */ zl_lib->open_ref++; @@ -649,7 +649,7 @@ int dbll_open(struct dbll_tar_obj *target, char *file, dbll_flags flags, if (!status && zl_lib->fp == NULL) status = dof_open(zl_lib); - zl_lib->ul_pos = (*(zl_lib->target_obj->attrs.ftell)) (zl_lib->fp); + zl_lib->pos = (*(zl_lib->target_obj->attrs.ftell)) (zl_lib->fp); (*(zl_lib->target_obj->attrs.fseek)) (zl_lib->fp, (long)0, SEEK_SET); /* Create a hash table for symbols if flag is set */ if (zl_lib->sym_tab != NULL || !(flags & DBLL_SYMB)) @@ -738,7 +738,7 @@ int dbll_read_sect(struct dbll_library_obj *lib, char *name, } else { (*(zl_lib->target_obj->attrs.fseek)) (zl_lib->fp, - zl_lib->ul_pos, + zl_lib->pos, SEEK_SET); } } else { diff --git a/drivers/staging/tidspbridge/rmgr/dbdcd.c b/drivers/staging/tidspbridge/rmgr/dbdcd.c index f0b396f..98b88b1 100644 --- a/drivers/staging/tidspbridge/rmgr/dbdcd.c +++ b/drivers/staging/tidspbridge/rmgr/dbdcd.c @@ -1253,7 +1253,7 @@ static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size, /* Heap Size for the node */ gen_obj->obj_data.node_obj. ndb_props.node_profiles[i]. - ul_heap_size = atoi(token); + heap_size = atoi(token); } } } @@ -1285,7 +1285,7 @@ static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size, gen_obj->obj_data.proc_info.clock_rate = atoi(token); token = strsep(&psz_cur, seps); - gen_obj->obj_data.proc_info.ul_internal_mem_size = atoi(token); + gen_obj->obj_data.proc_info.internal_mem_size = atoi(token); token = strsep(&psz_cur, seps); gen_obj->obj_data.proc_info.external_mem_size = atoi(token); @@ -1308,7 +1308,7 @@ static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size, for (entry_id = 0; entry_id < 7; entry_id++) { token = strsep(&psz_cur, seps); gen_obj->obj_data.ext_proc_obj.ty_tlb[entry_id]. - ul_gpp_phys = atoi(token); + gpp_phys = atoi(token); token = strsep(&psz_cur, seps); gen_obj->obj_data.ext_proc_obj.ty_tlb[entry_id]. diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c index 4e6a63e..76166c1 100644 --- a/drivers/staging/tidspbridge/rmgr/node.c +++ b/drivers/staging/tidspbridge/rmgr/node.c @@ -146,7 +146,7 @@ struct node_mgr { struct msg_mgr *msg_mgr_obj; /* Processor properties needed by Node Dispatcher */ - u32 ul_num_chnls; /* Total number of channels */ + u32 num_chnls; /* Total number of channels */ u32 chnl_offset; /* Offset of chnl ids rsvd for RMS */ u32 chnl_buf_size; /* Buffer size for data to RMS */ int proc_family; /* eg, 5000 */ @@ -1003,7 +1003,7 @@ int node_connect(struct node_object *node1, u32 stream1, set_bit(chnl_id, hnode_mgr->dma_chnl_map); /* dma chans are 2nd transport chnl set * ids(e.g. 16-31) */ - chnl_id = chnl_id + hnode_mgr->ul_num_chnls; + chnl_id = chnl_id + hnode_mgr->num_chnls; } break; case STRMMODE_ZEROCOPY: @@ -1014,7 +1014,7 @@ int node_connect(struct node_object *node1, u32 stream1, /* zero-copy chans are 3nd transport set * (e.g. 32-47) */ chnl_id = chnl_id + - (2 * hnode_mgr->ul_num_chnls); + (2 * hnode_mgr->num_chnls); } break; case STRMMODE_PROCCOPY: @@ -2723,15 +2723,15 @@ static void free_stream(struct node_mgr *hnode_mgr, struct stream_chnl stream) set_bit(stream.dev_id, hnode_mgr->pipe_done_map); } } else if (stream.type == HOSTCONNECT) { - if (stream.dev_id < hnode_mgr->ul_num_chnls) { + if (stream.dev_id < hnode_mgr->num_chnls) { clear_bit(stream.dev_id, hnode_mgr->chnl_map); - } else if (stream.dev_id < (2 * hnode_mgr->ul_num_chnls)) { + } else if (stream.dev_id < (2 * hnode_mgr->num_chnls)) { /* dsp-dma */ - clear_bit(stream.dev_id - (1 * hnode_mgr->ul_num_chnls), + clear_bit(stream.dev_id - (1 * hnode_mgr->num_chnls), hnode_mgr->dma_chnl_map); - } else if (stream.dev_id < (3 * hnode_mgr->ul_num_chnls)) { + } else if (stream.dev_id < (3 * hnode_mgr->num_chnls)) { /* zero-copy */ - clear_bit(stream.dev_id - (2 * hnode_mgr->ul_num_chnls), + clear_bit(stream.dev_id - (2 * hnode_mgr->num_chnls), hnode_mgr->zc_chnl_map); } } @@ -2904,7 +2904,7 @@ static int get_proc_props(struct node_mgr *hnode_mgr, return -EPERM; hnode_mgr->chnl_offset = host_res->chnl_offset; hnode_mgr->chnl_buf_size = host_res->chnl_buf_size; - hnode_mgr->ul_num_chnls = host_res->num_chnls; + hnode_mgr->num_chnls = host_res->num_chnls; /* * PROC will add an API to get dsp_processorinfo. diff --git a/drivers/staging/tidspbridge/rmgr/rmm.c b/drivers/staging/tidspbridge/rmgr/rmm.c index 5a3f09c..5d5feee 100644 --- a/drivers/staging/tidspbridge/rmgr/rmm.c +++ b/drivers/staging/tidspbridge/rmgr/rmm.c @@ -371,17 +371,17 @@ bool rmm_stat(struct rmm_target_obj *target, enum dsp_memtype segid, /* ul_size */ mem_stat_buf->ul_size = target->seg_tab[segid].length; - /* ul_num_free_blocks */ - mem_stat_buf->ul_num_free_blocks = free_blocks; + /* num_free_blocks */ + mem_stat_buf->num_free_blocks = free_blocks; /* ul_total_free_size */ mem_stat_buf->ul_total_free_size = total_free_size; - /* ul_len_max_free_block */ - mem_stat_buf->ul_len_max_free_block = max_free_size; + /* len_max_free_block */ + mem_stat_buf->len_max_free_block = max_free_size; - /* ul_num_alloc_blocks */ - mem_stat_buf->ul_num_alloc_blocks = + /* num_alloc_blocks */ + mem_stat_buf->num_alloc_blocks = target->seg_tab[segid].number; ret = true; diff --git a/drivers/staging/tidspbridge/rmgr/strm.c b/drivers/staging/tidspbridge/rmgr/strm.c index 66c32f1..a8e3fe5 100644 --- a/drivers/staging/tidspbridge/rmgr/strm.c +++ b/drivers/staging/tidspbridge/rmgr/strm.c @@ -71,7 +71,7 @@ struct strm_object { u32 utimeout; u32 num_bufs; /* Max # of bufs allowed in stream */ u32 un_bufs_in_strm; /* Current # of bufs in stream */ - u32 ul_n_bytes; /* bytes transferred since idled */ + u32 bytes; /* bytes transferred since idled */ /* STREAM_IDLE, STREAM_READY, ... */ enum dsp_streamstate strm_state; void *user_event; /* Saved for strm_get_info() */ @@ -341,7 +341,7 @@ int strm_get_info(struct strm_object *stream_obj, stream_info->user_strm->number_bufs_in_stream = chnl_info_obj.cio_cs + chnl_info_obj.cio_reqs; /* # of bytes transferred since last call to DSPStream_Idle() */ - stream_info->user_strm->ul_number_bytes = chnl_info_obj.bytes_tx; + stream_info->user_strm->number_bytes = chnl_info_obj.bytes_tx; stream_info->user_strm->sync_object_handle = chnl_info_obj.event_obj; /* Determine stream state based on channel state and info */ if (chnl_info_obj.state & CHNL_STATEEOS) { -- cgit v0.10.2 From 085467b8f5e60a2fe9ef85031ab40bd8724fcac6 Mon Sep 17 00:00:00 2001 From: Rene Sapiens Date: Mon, 17 Jan 2011 18:36:52 -0600 Subject: staging: tidspbridge: set8 remove hungarian from structs hungarian notation will be removed from the elements inside structures, the next varibles will be renamed: Original: Replacement: hbridge_context bridge_context hchnl_mgr chnl_mgr hcmm_mgr cmm_mgr hdcd_mgr dcd_mgr hdeh_mgr deh_mgr hdev_obj dev_obj hdrv_obj drv_obj hmgr_obj mgr_obj hmsg_mgr msg_mgr hnode_mgr node_mgr psz_last_coff last_coff ul_resource resource ul_seg_id seg_id ul_size size ul_sm_size sm_size ul_total_free_size total_free_size ul_total_in_use_cnt total_in_use_cnt ul_total_seg_size total_seg_size ul_trace_buffer_begin trace_buffer_begin ul_trace_buffer_current trace_buffer_current ul_trace_buffer_end trace_buffer_end ul_unit unit ul_virt_size virt_size us_dsp_mau_size dsp_mau_size us_dsp_word_size dsp_word_size Signed-off-by: Rene Sapiens Signed-off-by: Armando Uribe Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/core/_deh.h b/drivers/staging/tidspbridge/core/_deh.h index 16723cd..025d343 100644 --- a/drivers/staging/tidspbridge/core/_deh.h +++ b/drivers/staging/tidspbridge/core/_deh.h @@ -25,7 +25,7 @@ /* DEH Manager: only one created per board: */ struct deh_mgr { - struct bridge_dev_context *hbridge_context; /* Bridge context. */ + struct bridge_dev_context *bridge_context; /* Bridge context. */ struct ntfy_object *ntfy_obj; /* NTFY object */ /* MMU Fault DPC */ diff --git a/drivers/staging/tidspbridge/core/_msg_sm.h b/drivers/staging/tidspbridge/core/_msg_sm.h index b78d1a6..25414e0 100644 --- a/drivers/staging/tidspbridge/core/_msg_sm.h +++ b/drivers/staging/tidspbridge/core/_msg_sm.h @@ -108,7 +108,7 @@ struct msg_mgr { */ struct msg_queue { struct list_head list_elem; - struct msg_mgr *hmsg_mgr; + struct msg_mgr *msg_mgr; u32 max_msgs; /* Node message depth */ u32 msgq_id; /* Node environment pointer */ struct list_head msg_free_list; /* Free MsgFrames ready to be filled */ diff --git a/drivers/staging/tidspbridge/core/_tiomap.h b/drivers/staging/tidspbridge/core/_tiomap.h index 60d9876..1e0273e 100644 --- a/drivers/staging/tidspbridge/core/_tiomap.h +++ b/drivers/staging/tidspbridge/core/_tiomap.h @@ -319,7 +319,7 @@ static const struct bpwr_clk_t bpwr_clks[] = { /* This Bridge driver's device context: */ struct bridge_dev_context { - struct dev_object *hdev_obj; /* Handle to Bridge device object. */ + struct dev_object *dev_obj; /* Handle to Bridge device object. */ u32 dsp_base_addr; /* Arm's API to DSP virt base addr */ /* * DSP External memory prog address as seen virtually by the OS on diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c b/drivers/staging/tidspbridge/core/chnl_sm.c index c204315..c9470d3 100644 --- a/drivers/staging/tidspbridge/core/chnl_sm.c +++ b/drivers/staging/tidspbridge/core/chnl_sm.c @@ -388,7 +388,7 @@ int bridge_chnl_create(struct chnl_mgr **channel_mgr, chnl_mgr_obj->open_channels = 0; chnl_mgr_obj->output_mask = 0; chnl_mgr_obj->last_output = 0; - chnl_mgr_obj->hdev_obj = hdev_obj; + chnl_mgr_obj->dev_obj = hdev_obj; spin_lock_init(&chnl_mgr_obj->chnl_mgr_lock); } else { status = -ENOMEM; @@ -434,7 +434,7 @@ int bridge_chnl_destroy(struct chnl_mgr *hchnl_mgr) kfree(chnl_mgr_obj->ap_channel); /* Set hchnl_mgr to NULL in device object. */ - dev_set_chnl_mgr(chnl_mgr_obj->hdev_obj, NULL); + dev_set_chnl_mgr(chnl_mgr_obj->dev_obj, NULL); /* Free this Chnl Mgr object: */ kfree(hchnl_mgr); } else { @@ -508,7 +508,7 @@ int bridge_chnl_get_info(struct chnl_object *chnl_obj, if (channel_info != NULL) { if (pchnl) { /* Return the requested information: */ - channel_info->hchnl_mgr = pchnl->chnl_mgr_obj; + channel_info->chnl_mgr = pchnl->chnl_mgr_obj; channel_info->event_obj = pchnl->user_event; channel_info->cnhl_id = pchnl->chnl_id; channel_info->mode = pchnl->chnl_mode; diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index c923dda..96dbe1a 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c @@ -89,17 +89,17 @@ struct io_mgr { /* These four fields must be the first fields in a io_mgr_ struct */ /* Bridge device context */ - struct bridge_dev_context *hbridge_context; + struct bridge_dev_context *bridge_context; /* Function interface to Bridge driver */ struct bridge_drv_interface *intf_fxns; - struct dev_object *hdev_obj; /* Device this board represents */ + struct dev_object *dev_obj; /* Device this board represents */ /* These fields initialized in bridge_io_create() */ - struct chnl_mgr *hchnl_mgr; + struct chnl_mgr *chnl_mgr; struct shm *shared_mem; /* Shared Memory control */ u8 *input; /* Address of input channel */ u8 *output; /* Address of output channel */ - struct msg_mgr *hmsg_mgr; /* Message manager */ + struct msg_mgr *msg_mgr; /* Message manager */ /* Msg control for from DSP messages */ struct msg_ctrl *msg_input_ctrl; /* Msg control for to DSP messages */ @@ -112,12 +112,12 @@ struct io_mgr { u16 intr_val; /* Interrupt value */ /* Private extnd proc info; mmu setup */ struct mgr_processorextinfo ext_proc_info; - struct cmm_object *hcmm_mgr; /* Shared Mem Mngr */ + struct cmm_object *cmm_mgr; /* Shared Mem Mngr */ struct work_struct io_workq; /* workqueue */ #if defined(CONFIG_TIDSPBRIDGE_BACKTRACE) || defined(CONFIG_TIDSPBRIDGE_DEBUG) - u32 ul_trace_buffer_begin; /* Trace message start address */ - u32 ul_trace_buffer_end; /* Trace message end address */ - u32 ul_trace_buffer_current; /* Trace message current address */ + u32 trace_buffer_begin; /* Trace message start address */ + u32 trace_buffer_end; /* Trace message end address */ + u32 trace_buffer_current; /* Trace message current address */ u32 gpp_read_pointer; /* GPP Read pointer to Trace buffer */ u8 *pmsg; u32 gpp_va; @@ -201,7 +201,7 @@ int bridge_io_create(struct io_mgr **io_man, return -ENOMEM; /* Initialize chnl_mgr object */ - pio_mgr->hchnl_mgr = hchnl_mgr; + pio_mgr->chnl_mgr = hchnl_mgr; pio_mgr->word_size = mgr_attrts->word_size; if (dev_type == DSP_UNIT) { @@ -220,7 +220,7 @@ int bridge_io_create(struct io_mgr **io_man, } } - pio_mgr->hbridge_context = hbridge_context; + pio_mgr->bridge_context = hbridge_context; pio_mgr->shared_irq = mgr_attrts->irq_shared; if (dsp_wdt_init()) { bridge_io_destroy(pio_mgr); @@ -306,7 +306,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) HW_PAGE_SIZE64KB, HW_PAGE_SIZE4KB }; - status = dev_get_bridge_context(hio_mgr->hdev_obj, &pbridge_context); + status = dev_get_bridge_context(hio_mgr->dev_obj, &pbridge_context); if (!pbridge_context) { status = -EFAULT; goto func_end; @@ -317,15 +317,15 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) status = -EFAULT; goto func_end; } - status = dev_get_cod_mgr(hio_mgr->hdev_obj, &cod_man); + status = dev_get_cod_mgr(hio_mgr->dev_obj, &cod_man); if (!cod_man) { status = -EFAULT; goto func_end; } - hchnl_mgr = hio_mgr->hchnl_mgr; + hchnl_mgr = hio_mgr->chnl_mgr; /* The message manager is destroyed when the board is stopped. */ - dev_get_msg_mgr(hio_mgr->hdev_obj, &hio_mgr->hmsg_mgr); - hmsg_mgr = hio_mgr->hmsg_mgr; + dev_get_msg_mgr(hio_mgr->dev_obj, &hio_mgr->msg_mgr); + hmsg_mgr = hio_mgr->msg_mgr; if (!hchnl_mgr || !hmsg_mgr) { status = -EFAULT; goto func_end; @@ -483,7 +483,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) 1)) == 0)) { status = hio_mgr->intf_fxns-> - brd_mem_map(hio_mgr->hbridge_context, + brd_mem_map(hio_mgr->bridge_context, pa_curr, va_curr, page_size[i], map_attrs, NULL); @@ -535,7 +535,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) ae_proc[ndx].gpp_va = gpp_va_curr; ae_proc[ndx].dsp_va = va_curr / hio_mgr->word_size; - ae_proc[ndx].ul_size = page_size[i]; + ae_proc[ndx].size = page_size[i]; ae_proc[ndx].endianism = HW_LITTLE_ENDIAN; ae_proc[ndx].elem_size = HW_ELEM_SIZE16BIT; ae_proc[ndx].mixed_mode = HW_MMU_CPUES; @@ -549,7 +549,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) } else { status = hio_mgr->intf_fxns-> - brd_mem_map(hio_mgr->hbridge_context, + brd_mem_map(hio_mgr->bridge_context, pa_curr, va_curr, page_size[i], map_attrs, NULL); @@ -609,14 +609,14 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) gpp_phys; ae_proc[ndx].gpp_va = 0; /* 1 MB */ - ae_proc[ndx].ul_size = 0x100000; + ae_proc[ndx].size = 0x100000; dev_dbg(bridge, "shm MMU entry PA %x " "DSP_VA 0x%x\n", ae_proc[ndx].gpp_pa, ae_proc[ndx].dsp_va); ndx++; } else { status = hio_mgr->intf_fxns->brd_mem_map - (hio_mgr->hbridge_context, + (hio_mgr->bridge_context, hio_mgr->ext_proc_info.ty_tlb[i]. gpp_phys, hio_mgr->ext_proc_info.ty_tlb[i]. @@ -638,7 +638,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) i = 0; while (l4_peripheral_table[i].phys_addr) { status = hio_mgr->intf_fxns->brd_mem_map - (hio_mgr->hbridge_context, l4_peripheral_table[i].phys_addr, + (hio_mgr->bridge_context, l4_peripheral_table[i].phys_addr, l4_peripheral_table[i].dsp_virt_addr, HW_PAGE_SIZE4KB, map_attrs, NULL); if (status) @@ -650,7 +650,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) ae_proc[i].dsp_va = 0; ae_proc[i].gpp_pa = 0; ae_proc[i].gpp_va = 0; - ae_proc[i].ul_size = 0; + ae_proc[i].size = 0; } /* * Set the shm physical address entry (grayed out in CDB file) @@ -683,7 +683,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) */ status = - hio_mgr->intf_fxns->dev_cntrl(hio_mgr->hbridge_context, + hio_mgr->intf_fxns->dev_cntrl(hio_mgr->bridge_context, BRDIOCTL_SETMMUCONFIG, ae_proc); if (status) @@ -734,39 +734,39 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) #if defined(CONFIG_TIDSPBRIDGE_BACKTRACE) || defined(CONFIG_TIDSPBRIDGE_DEBUG) /* Get the start address of trace buffer */ status = cod_get_sym_value(cod_man, SYS_PUTCBEG, - &hio_mgr->ul_trace_buffer_begin); + &hio_mgr->trace_buffer_begin); if (status) { status = -EFAULT; goto func_end; } - hio_mgr->gpp_read_pointer = hio_mgr->ul_trace_buffer_begin = + hio_mgr->gpp_read_pointer = hio_mgr->trace_buffer_begin = (ul_gpp_va + ul_seg1_size + ul_pad_size) + - (hio_mgr->ul_trace_buffer_begin - ul_dsp_va); + (hio_mgr->trace_buffer_begin - ul_dsp_va); /* Get the end address of trace buffer */ status = cod_get_sym_value(cod_man, SYS_PUTCEND, - &hio_mgr->ul_trace_buffer_end); + &hio_mgr->trace_buffer_end); if (status) { status = -EFAULT; goto func_end; } - hio_mgr->ul_trace_buffer_end = + hio_mgr->trace_buffer_end = (ul_gpp_va + ul_seg1_size + ul_pad_size) + - (hio_mgr->ul_trace_buffer_end - ul_dsp_va); + (hio_mgr->trace_buffer_end - ul_dsp_va); /* Get the current address of DSP write pointer */ status = cod_get_sym_value(cod_man, BRIDGE_SYS_PUTC_CURRENT, - &hio_mgr->ul_trace_buffer_current); + &hio_mgr->trace_buffer_current); if (status) { status = -EFAULT; goto func_end; } - hio_mgr->ul_trace_buffer_current = + hio_mgr->trace_buffer_current = (ul_gpp_va + ul_seg1_size + ul_pad_size) + - (hio_mgr->ul_trace_buffer_current - ul_dsp_va); + (hio_mgr->trace_buffer_current - ul_dsp_va); /* Calculate the size of trace buffer */ kfree(hio_mgr->pmsg); - hio_mgr->pmsg = kmalloc(((hio_mgr->ul_trace_buffer_end - - hio_mgr->ul_trace_buffer_begin) * + hio_mgr->pmsg = kmalloc(((hio_mgr->trace_buffer_end - + hio_mgr->trace_buffer_begin) * hio_mgr->word_size) + 2, GFP_KERNEL); if (!hio_mgr->pmsg) status = -ENOMEM; @@ -807,7 +807,7 @@ void io_cancel_chnl(struct io_mgr *hio_mgr, u32 chnl) /* Inform DSP that we have no more buffers on this channel */ set_chnl_free(sm, chnl); - sm_interrupt_dsp(pio_mgr->hbridge_context, MBX_PCPY_CLASS); + sm_interrupt_dsp(pio_mgr->bridge_context, MBX_PCPY_CLASS); func_end: return; } @@ -829,7 +829,7 @@ static void io_dispatch_pm(struct io_mgr *pio_mgr) if (parg[0] == MBX_PM_HIBERNATE_EN) { dev_dbg(bridge, "PM: Hibernate command\n"); status = pio_mgr->intf_fxns-> - dev_cntrl(pio_mgr->hbridge_context, + dev_cntrl(pio_mgr->bridge_context, BRDIOCTL_PWR_HIBERNATE, parg); if (status) pr_err("%s: hibernate cmd failed 0x%x\n", @@ -838,7 +838,7 @@ static void io_dispatch_pm(struct io_mgr *pio_mgr) parg[1] = pio_mgr->shared_mem->opp_request.rqst_opp_pt; dev_dbg(bridge, "PM: Requested OPP = 0x%x\n", parg[1]); status = pio_mgr->intf_fxns-> - dev_cntrl(pio_mgr->hbridge_context, + dev_cntrl(pio_mgr->bridge_context, BRDIOCTL_CONSTRAINT_REQUEST, parg); if (status) dev_dbg(bridge, "PM: Failed to set constraint " @@ -847,7 +847,7 @@ static void io_dispatch_pm(struct io_mgr *pio_mgr) dev_dbg(bridge, "PM: clk control value of msg = 0x%x\n", parg[0]); status = pio_mgr->intf_fxns-> - dev_cntrl(pio_mgr->hbridge_context, + dev_cntrl(pio_mgr->bridge_context, BRDIOCTL_CLK_CTRL, parg); if (status) dev_dbg(bridge, "PM: Failed to ctrl the DSP clk" @@ -872,9 +872,9 @@ void io_dpc(unsigned long ref_data) if (!pio_mgr) goto func_end; - chnl_mgr_obj = pio_mgr->hchnl_mgr; - dev_get_msg_mgr(pio_mgr->hdev_obj, &msg_mgr_obj); - dev_get_deh_mgr(pio_mgr->hdev_obj, &hdeh_mgr); + chnl_mgr_obj = pio_mgr->chnl_mgr; + dev_get_msg_mgr(pio_mgr->dev_obj, &msg_mgr_obj); + dev_get_deh_mgr(pio_mgr->dev_obj, &hdeh_mgr); if (!chnl_mgr_obj) goto func_end; @@ -970,7 +970,7 @@ void io_request_chnl(struct io_mgr *io_manager, struct chnl_object *pchnl, if (!pchnl || !mbx_val) goto func_end; - chnl_mgr_obj = io_manager->hchnl_mgr; + chnl_mgr_obj = io_manager->chnl_mgr; sm = io_manager->shared_mem; if (io_mode == IO_INPUT) { /* @@ -1076,7 +1076,7 @@ static void input_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, bool notify_client = false; sm = pio_mgr->shared_mem; - chnl_mgr_obj = pio_mgr->hchnl_mgr; + chnl_mgr_obj = pio_mgr->chnl_mgr; /* Attempt to perform input */ if (!sm->input_full) @@ -1164,7 +1164,7 @@ static void input_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, if (clear_chnl) { /* Indicate to the DSP we have read the input */ sm->input_full = 0; - sm_interrupt_dsp(pio_mgr->hbridge_context, MBX_PCPY_CLASS); + sm_interrupt_dsp(pio_mgr->bridge_context, MBX_PCPY_CLASS); } if (notify_client) { /* Notify client with IO completion record */ @@ -1202,16 +1202,16 @@ static void input_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr) /* Read the next message */ addr = (u32) &(((struct msg_dspmsg *)msg_input)->msg.cmd); msg.msg.cmd = - read_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr); + read_ext32_bit_dsp_data(pio_mgr->bridge_context, addr); addr = (u32) &(((struct msg_dspmsg *)msg_input)->msg.arg1); msg.msg.arg1 = - read_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr); + read_ext32_bit_dsp_data(pio_mgr->bridge_context, addr); addr = (u32) &(((struct msg_dspmsg *)msg_input)->msg.arg2); msg.msg.arg2 = - read_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr); + read_ext32_bit_dsp_data(pio_mgr->bridge_context, addr); addr = (u32) &(((struct msg_dspmsg *)msg_input)->msgq_id); msg.msgq_id = - read_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr); + read_ext32_bit_dsp_data(pio_mgr->bridge_context, addr); msg_input += sizeof(struct msg_dspmsg); /* Determine which queue to put the message in */ @@ -1269,7 +1269,7 @@ static void input_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr) /* Tell the DSP we've read the messages */ msg_ctr_obj->buf_empty = true; msg_ctr_obj->post_swi = true; - sm_interrupt_dsp(pio_mgr->hbridge_context, MBX_PCPY_CLASS); + sm_interrupt_dsp(pio_mgr->bridge_context, MBX_PCPY_CLASS); } } @@ -1323,7 +1323,7 @@ static void output_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, struct chnl_irp *chnl_packet_obj; u32 dw_dsp_f_mask; - chnl_mgr_obj = pio_mgr->hchnl_mgr; + chnl_mgr_obj = pio_mgr->chnl_mgr; sm = pio_mgr->shared_mem; /* Attempt to perform output */ if (sm->output_full) @@ -1381,7 +1381,7 @@ static void output_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, #endif sm->output_full = 1; /* Indicate to the DSP we have written the output */ - sm_interrupt_dsp(pio_mgr->hbridge_context, MBX_PCPY_CLASS); + sm_interrupt_dsp(pio_mgr->bridge_context, MBX_PCPY_CLASS); /* Notify client with IO completion record (keep EOS) */ chnl_packet_obj->status &= CHNL_IOCSTATEOS; notify_chnl_complete(pchnl, chnl_packet_obj); @@ -1428,19 +1428,19 @@ static void output_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr) val = (pmsg->msg_data).msgq_id; addr = (u32) &msg_output->msgq_id; - write_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr, val); + write_ext32_bit_dsp_data(pio_mgr->bridge_context, addr, val); val = (pmsg->msg_data).msg.cmd; addr = (u32) &msg_output->msg.cmd; - write_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr, val); + write_ext32_bit_dsp_data(pio_mgr->bridge_context, addr, val); val = (pmsg->msg_data).msg.arg1; addr = (u32) &msg_output->msg.arg1; - write_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr, val); + write_ext32_bit_dsp_data(pio_mgr->bridge_context, addr, val); val = (pmsg->msg_data).msg.arg2; addr = (u32) &msg_output->msg.arg2; - write_ext32_bit_dsp_data(pio_mgr->hbridge_context, addr, val); + write_ext32_bit_dsp_data(pio_mgr->bridge_context, addr, val); msg_output++; list_add_tail(&pmsg->list_elem, &hmsg_mgr->msg_free_list); @@ -1462,7 +1462,7 @@ static void output_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr) /* Set the post SWI flag */ msg_ctr_obj->post_swi = true; /* Tell the DSP we have written the output. */ - sm_interrupt_dsp(pio_mgr->hbridge_context, MBX_PCPY_CLASS); + sm_interrupt_dsp(pio_mgr->bridge_context, MBX_PCPY_CLASS); } } @@ -1518,9 +1518,9 @@ static int register_shm_segs(struct io_mgr *hio_mgr, } /* Register with CMM */ if (!status) { - status = dev_get_cmm_mgr(hio_mgr->hdev_obj, &hio_mgr->hcmm_mgr); + status = dev_get_cmm_mgr(hio_mgr->dev_obj, &hio_mgr->cmm_mgr); if (!status) { - status = cmm_un_register_gppsm_seg(hio_mgr->hcmm_mgr, + status = cmm_un_register_gppsm_seg(hio_mgr->cmm_mgr, CMM_ALLSEGMENTS); } } @@ -1575,7 +1575,7 @@ static int register_shm_segs(struct io_mgr *hio_mgr, ul_dsp_virt; /* Register SM Segment 0. */ status = - cmm_register_gppsm_seg(hio_mgr->hcmm_mgr, dw_gpp_base_pa, + cmm_register_gppsm_seg(hio_mgr->cmm_mgr, dw_gpp_base_pa, ul_rsrvd_size, dw_offset, (dw_gpp_base_pa > ul_dsp_virt) ? CMM_ADDTODSPPA : @@ -1691,7 +1691,7 @@ void print_dsp_debug_trace(struct io_mgr *hio_mgr) while (true) { /* Get the DSP current pointer */ ul_gpp_cur_pointer = - *(u32 *) (hio_mgr->ul_trace_buffer_current); + *(u32 *) (hio_mgr->trace_buffer_current); ul_gpp_cur_pointer = hio_mgr->gpp_va + (ul_gpp_cur_pointer - hio_mgr->dsp_va); @@ -1719,15 +1719,15 @@ void print_dsp_debug_trace(struct io_mgr *hio_mgr) /* Handle trace buffer wraparound */ memcpy(hio_mgr->pmsg, (char *)hio_mgr->gpp_read_pointer, - hio_mgr->ul_trace_buffer_end - + hio_mgr->trace_buffer_end - hio_mgr->gpp_read_pointer); ul_new_message_length = - ul_gpp_cur_pointer - hio_mgr->ul_trace_buffer_begin; - memcpy(&hio_mgr->pmsg[hio_mgr->ul_trace_buffer_end - + ul_gpp_cur_pointer - hio_mgr->trace_buffer_begin; + memcpy(&hio_mgr->pmsg[hio_mgr->trace_buffer_end - hio_mgr->gpp_read_pointer], - (char *)hio_mgr->ul_trace_buffer_begin, + (char *)hio_mgr->trace_buffer_begin, ul_new_message_length); - hio_mgr->pmsg[hio_mgr->ul_trace_buffer_end - + hio_mgr->pmsg[hio_mgr->trace_buffer_end - hio_mgr->gpp_read_pointer + ul_new_message_length] = '\0'; /* @@ -1735,7 +1735,7 @@ void print_dsp_debug_trace(struct io_mgr *hio_mgr) * pointer. */ hio_mgr->gpp_read_pointer = - hio_mgr->ul_trace_buffer_begin + + hio_mgr->trace_buffer_begin + ul_new_message_length; /* Print the trace messages */ pr_info("DSPTrace: %s\n", hio_mgr->pmsg); @@ -1776,7 +1776,7 @@ int print_dsp_trace_buffer(struct bridge_dev_context *hbridge_context) struct bridge_dev_context *pbridge_context = hbridge_context; struct bridge_drv_interface *intf_fxns; struct dev_object *dev_obj = (struct dev_object *) - pbridge_context->hdev_obj; + pbridge_context->dev_obj; status = dev_get_cod_mgr(dev_obj, &cod_mgr); @@ -1949,7 +1949,7 @@ int dump_dsp_stack(struct bridge_dev_context *bridge_context) "ILC", "RILC", "IER", "CSR"}; const char *exec_ctxt[] = {"Task", "SWI", "HWI", "Unknown"}; struct bridge_drv_interface *intf_fxns; - struct dev_object *dev_object = bridge_context->hdev_obj; + struct dev_object *dev_object = bridge_context->dev_obj; status = dev_get_cod_mgr(dev_object, &code_mgr); if (!code_mgr) { @@ -2155,7 +2155,7 @@ void dump_dl_modules(struct bridge_dev_context *bridge_context) struct cod_manager *code_mgr; struct bridge_drv_interface *intf_fxns; struct bridge_dev_context *bridge_ctxt = bridge_context; - struct dev_object *dev_object = bridge_ctxt->hdev_obj; + struct dev_object *dev_object = bridge_ctxt->dev_obj; struct modules_header modules_hdr; struct dll_module *module_struct = NULL; u32 module_dsp_addr; diff --git a/drivers/staging/tidspbridge/core/msg_sm.c b/drivers/staging/tidspbridge/core/msg_sm.c index 07103f2..807d556 100644 --- a/drivers/staging/tidspbridge/core/msg_sm.c +++ b/drivers/staging/tidspbridge/core/msg_sm.c @@ -121,7 +121,7 @@ int bridge_msg_create_queue(struct msg_mgr *hmsg_mgr, struct msg_queue **msgq, return -ENOMEM; msg_q->max_msgs = max_msgs; - msg_q->hmsg_mgr = hmsg_mgr; + msg_q->msg_mgr = hmsg_mgr; msg_q->arg = arg; /* Node handle */ msg_q->msgq_id = msgq_id; /* Node env (not valid yet) */ /* Queues of Message frames for messages from the DSP */ @@ -214,10 +214,10 @@ void bridge_msg_delete_queue(struct msg_queue *msg_queue_obj) struct msg_mgr *hmsg_mgr; u32 io_msg_pend; - if (!msg_queue_obj || !msg_queue_obj->hmsg_mgr) + if (!msg_queue_obj || !msg_queue_obj->msg_mgr) return; - hmsg_mgr = msg_queue_obj->hmsg_mgr; + hmsg_mgr = msg_queue_obj->msg_mgr; msg_queue_obj->done = true; /* Unblock all threads blocked in MSG_Get() or MSG_Put(). */ io_msg_pend = msg_queue_obj->io_msg_pend; @@ -254,7 +254,7 @@ int bridge_msg_get(struct msg_queue *msg_queue_obj, if (!msg_queue_obj || pmsg == NULL) return -ENOMEM; - hmsg_mgr = msg_queue_obj->hmsg_mgr; + hmsg_mgr = msg_queue_obj->msg_mgr; spin_lock_bh(&hmsg_mgr->msg_mgr_lock); /* If a message is already there, get it */ @@ -331,10 +331,10 @@ int bridge_msg_put(struct msg_queue *msg_queue_obj, u32 index; int status; - if (!msg_queue_obj || !pmsg || !msg_queue_obj->hmsg_mgr) + if (!msg_queue_obj || !pmsg || !msg_queue_obj->msg_mgr) return -EFAULT; - hmsg_mgr = msg_queue_obj->hmsg_mgr; + hmsg_mgr = msg_queue_obj->msg_mgr; spin_lock_bh(&hmsg_mgr->msg_mgr_lock); @@ -521,10 +521,10 @@ static void delete_msg_queue(struct msg_queue *msg_queue_obj, u32 num_to_dsp) struct msg_frame *pmsg, *tmp; u32 i; - if (!msg_queue_obj || !msg_queue_obj->hmsg_mgr) + if (!msg_queue_obj || !msg_queue_obj->msg_mgr) return; - hmsg_mgr = msg_queue_obj->hmsg_mgr; + hmsg_mgr = msg_queue_obj->msg_mgr; /* Pull off num_to_dsp message frames from Msg manager and free */ i = 0; diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c index 2c15b03..e1c4492 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430.c +++ b/drivers/staging/tidspbridge/core/tiomap3430.c @@ -396,7 +396,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, * last dsp base image was loaded. The first entry is always * SHMMEM base. */ /* Get SHM_BEG - convert to byte address */ - (void)dev_get_symbol(dev_context->hdev_obj, SHMBASENAME, + (void)dev_get_symbol(dev_context->dev_obj, SHMBASENAME, &ul_shm_base_virt); ul_shm_base_virt *= DSPWORDSIZE; DBC_ASSERT(ul_shm_base_virt != 0); @@ -474,12 +474,12 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, itmp_entry_ndx, e->gpp_pa, e->dsp_va, - e->ul_size); + e->size); hw_mmu_tlb_add(dev_context->dsp_mmu_base, e->gpp_pa, e->dsp_va, - e->ul_size, + e->size, itmp_entry_ndx, &map_attrs, 1, 1); @@ -505,9 +505,9 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, hw_mmu_enable(resources->dmmu_base); /* Enable the BIOS clock */ - (void)dev_get_symbol(dev_context->hdev_obj, + (void)dev_get_symbol(dev_context->dev_obj, BRIDGEINIT_BIOSGPTIMER, &ul_bios_gp_timer); - (void)dev_get_symbol(dev_context->hdev_obj, + (void)dev_get_symbol(dev_context->dev_obj, BRIDGEINIT_LOADMON_GPTIMER, &ul_load_monitor_timer); } @@ -536,7 +536,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, if (!status) { /* Set the DSP clock rate */ - (void)dev_get_symbol(dev_context->hdev_obj, + (void)dev_get_symbol(dev_context->dev_obj, "_BRIDGEINIT_DSP_FREQ", &ul_dsp_clk_addr); /*Set Autoidle Mode for IVA2 PLL */ (*pdata->dsp_cm_write)(1 << OMAP3430_AUTO_IVA2_DPLL_SHIFT, @@ -607,7 +607,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, dsp_wdt_sm_set((void *)ul_shm_base); dsp_wdt_enable(true); - status = dev_get_io_mgr(dev_context->hdev_obj, &hio_mgr); + status = dev_get_io_mgr(dev_context->dev_obj, &hio_mgr); if (hio_mgr) { io_sh_msetting(hio_mgr, SHM_OPPINFO, NULL); /* Write the synchronization bit to indicate the @@ -872,7 +872,7 @@ static int bridge_dev_create(struct bridge_dev_context dev_context->dsp_mmu_base = resources->dmmu_base; } if (!status) { - dev_context->hdev_obj = hdev_obj; + dev_context->dev_obj = hdev_obj; /* Store current board state. */ dev_context->brd_state = BRD_UNKNOWN; dev_context->resources = resources; diff --git a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c index 64ca2d2..02dd439 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c +++ b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c @@ -121,7 +121,7 @@ int handle_hibernation_from_dsp(struct bridge_dev_context *dev_context) dev_context->brd_state = BRD_DSP_HIBERNATION; #ifdef CONFIG_TIDSPBRIDGE_DVFS status = - dev_get_io_mgr(dev_context->hdev_obj, &hio_mgr); + dev_get_io_mgr(dev_context->dev_obj, &hio_mgr); if (!hio_mgr) { status = DSP_EHANDLE; return status; @@ -216,7 +216,7 @@ int sleep_dsp(struct bridge_dev_context *dev_context, u32 dw_cmd, pr_err("%s: Timed out waiting for DSP off mode, state %x\n", __func__, pwr_state); #ifdef CONFIG_TIDSPBRIDGE_NTFY_PWRERR - dev_get_deh_mgr(dev_context->hdev_obj, &hdeh_mgr); + dev_get_deh_mgr(dev_context->dev_obj, &hdeh_mgr); bridge_deh_notify(hdeh_mgr, DSP_PWRERROR, 0); #endif /* CONFIG_TIDSPBRIDGE_NTFY_PWRERR */ return -ETIMEDOUT; @@ -382,7 +382,7 @@ int post_scale_dsp(struct bridge_dev_context *dev_context, u32 voltage_domain; struct io_mgr *hio_mgr; - status = dev_get_io_mgr(dev_context->hdev_obj, &hio_mgr); + status = dev_get_io_mgr(dev_context->dev_obj, &hio_mgr); if (!hio_mgr) return -EFAULT; diff --git a/drivers/staging/tidspbridge/core/tiomap_io.c b/drivers/staging/tidspbridge/core/tiomap_io.c index 257052a..dfb356e 100644 --- a/drivers/staging/tidspbridge/core/tiomap_io.c +++ b/drivers/staging/tidspbridge/core/tiomap_io.c @@ -65,20 +65,20 @@ int read_ext_dsp_data(struct bridge_dev_context *dev_ctxt, bool trace_read = false; if (!ul_shm_base_virt) { - status = dev_get_symbol(dev_context->hdev_obj, + status = dev_get_symbol(dev_context->dev_obj, SHMBASENAME, &ul_shm_base_virt); } DBC_ASSERT(ul_shm_base_virt != 0); /* Check if it is a read of Trace section */ if (!status && !ul_trace_sec_beg) { - status = dev_get_symbol(dev_context->hdev_obj, + status = dev_get_symbol(dev_context->dev_obj, DSP_TRACESEC_BEG, &ul_trace_sec_beg); } DBC_ASSERT(ul_trace_sec_beg != 0); if (!status && !ul_trace_sec_end) { - status = dev_get_symbol(dev_context->hdev_obj, + status = dev_get_symbol(dev_context->dev_obj, DSP_TRACESEC_END, &ul_trace_sec_end); } DBC_ASSERT(ul_trace_sec_end != 0); @@ -102,19 +102,19 @@ int read_ext_dsp_data(struct bridge_dev_context *dev_ctxt, /* Get DYNEXT_BEG, EXT_BEG and EXT_END. */ if (!status && !ul_dyn_ext_base) { - status = dev_get_symbol(dev_context->hdev_obj, + status = dev_get_symbol(dev_context->dev_obj, DYNEXTBASE, &ul_dyn_ext_base); } DBC_ASSERT(ul_dyn_ext_base != 0); if (!status) { - status = dev_get_symbol(dev_context->hdev_obj, + status = dev_get_symbol(dev_context->dev_obj, EXTBASE, &ul_ext_base); } DBC_ASSERT(ul_ext_base != 0); if (!status) { - status = dev_get_symbol(dev_context->hdev_obj, + status = dev_get_symbol(dev_context->dev_obj, EXTEND, &ul_ext_end); } DBC_ASSERT(ul_ext_end != 0); @@ -246,10 +246,10 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context, if (symbols_reloaded) { /* Check if it is a load to Trace section */ - ret = dev_get_symbol(dev_context->hdev_obj, + ret = dev_get_symbol(dev_context->dev_obj, DSP_TRACESEC_BEG, &ul_trace_sec_beg); if (!ret) - ret = dev_get_symbol(dev_context->hdev_obj, + ret = dev_get_symbol(dev_context->dev_obj, DSP_TRACESEC_END, &ul_trace_sec_end); } @@ -269,7 +269,7 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context, if (!dw_base_addr) { if (symbols_reloaded) /* Get SHM_BEG EXT_BEG and EXT_END. */ - ret = dev_get_symbol(dev_context->hdev_obj, + ret = dev_get_symbol(dev_context->dev_obj, SHMBASENAME, &ul_shm_base_virt); DBC_ASSERT(ul_shm_base_virt != 0); if (dynamic_load) { @@ -277,7 +277,7 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context, if (symbols_reloaded) ret = dev_get_symbol - (dev_context->hdev_obj, DYNEXTBASE, + (dev_context->dev_obj, DYNEXTBASE, &ul_ext_base); } DBC_ASSERT(ul_ext_base != 0); @@ -289,7 +289,7 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context, if (symbols_reloaded) ret = dev_get_symbol - (dev_context->hdev_obj, EXTEND, + (dev_context->dev_obj, EXTEND, &ul_ext_end); } } else { @@ -297,13 +297,13 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context, if (!ret) ret = dev_get_symbol - (dev_context->hdev_obj, EXTBASE, + (dev_context->dev_obj, EXTBASE, &ul_ext_base); DBC_ASSERT(ul_ext_base != 0); if (!ret) ret = dev_get_symbol - (dev_context->hdev_obj, EXTEND, + (dev_context->dev_obj, EXTEND, &ul_ext_end); } } @@ -324,12 +324,12 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context, if (symbols_reloaded) { ret = dev_get_symbol - (dev_context->hdev_obj, + (dev_context->dev_obj, DSP_TRACESEC_END, &shm0_end); if (!ret) { ret = dev_get_symbol - (dev_context->hdev_obj, DYNEXTBASE, + (dev_context->dev_obj, DYNEXTBASE, &ul_dyn_ext_base); } } diff --git a/drivers/staging/tidspbridge/core/ue_deh.c b/drivers/staging/tidspbridge/core/ue_deh.c index bc2feff..006ffd7 100644 --- a/drivers/staging/tidspbridge/core/ue_deh.c +++ b/drivers/staging/tidspbridge/core/ue_deh.c @@ -52,7 +52,7 @@ static irqreturn_t mmu_fault_isr(int irq, void *data) if (!deh) return IRQ_HANDLED; - resources = deh->hbridge_context->resources; + resources = deh->bridge_context->resources; if (!resources) { dev_dbg(bridge, "%s: Failed to get Host Resources\n", __func__); @@ -113,7 +113,7 @@ int bridge_deh_create(struct deh_mgr **ret_deh, tasklet_init(&deh->dpc_tasklet, mmu_fault_dpc, (u32) deh); /* Fill in context structure */ - deh->hbridge_context = hbridge_context; + deh->bridge_context = hbridge_context; /* Install ISR function for DSP MMU fault */ status = request_irq(INT_DSP_MMU_IRQ, mmu_fault_isr, 0, @@ -228,7 +228,7 @@ void bridge_deh_notify(struct deh_mgr *deh, int event, int info) return; dev_dbg(bridge, "%s: device exception", __func__); - dev_context = deh->hbridge_context; + dev_context = deh->bridge_context; switch (event) { case DSP_SYSERROR: diff --git a/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h b/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h index 318f6b0..49326a6 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h @@ -116,7 +116,7 @@ struct chnl_mgr { struct bridge_drv_interface *intf_fxns; struct io_mgr *hio_mgr; /* IO manager */ /* Device this board represents */ - struct dev_object *hdev_obj; + struct dev_object *dev_obj; /* These fields initialized in bridge_chnl_create(): */ u32 output_mask; /* Host output channels w/ full buffers */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/chnlpriv.h b/drivers/staging/tidspbridge/include/dspbridge/chnlpriv.h index e79cbd5..4114c79 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/chnlpriv.h +++ b/drivers/staging/tidspbridge/include/dspbridge/chnlpriv.h @@ -53,7 +53,7 @@ /* Channel info. */ struct chnl_info { - struct chnl_mgr *hchnl_mgr; /* Owning channel manager. */ + struct chnl_mgr *chnl_mgr; /* Owning channel manager. */ u32 cnhl_id; /* Channel ID. */ void *event_obj; /* Channel I/O completion event. */ /*Abstraction of I/O completion event. */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h b/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h index c995596..a264fa69 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/cmmdefs.h @@ -28,7 +28,7 @@ struct cmm_mgrattrs { /* Attributes for CMM_AllocBuf() & CMM_AllocDesc() */ struct cmm_attrs { - u32 ul_seg_id; /* 1,2... are SM segments. 0 is not. */ + u32 seg_id; /* 1,2... are SM segments. 0 is not. */ u32 alignment; /* 0,1,2,4....min_block_size */ }; @@ -53,7 +53,7 @@ struct cmm_attrs { struct cmm_seginfo { u32 seg_base_pa; /* Start Phys address of SM segment */ /* Total size in bytes of segment: DSP+GPP */ - u32 ul_total_seg_size; + u32 total_seg_size; u32 gpp_base_pa; /* Start Phys addr of Gpp SM seg */ u32 gpp_size; /* Size of Gpp SM seg in bytes */ u32 dsp_base_va; /* DSP virt base byte address */ @@ -69,7 +69,7 @@ struct cmm_info { /* # of SM segments registered with this Cmm. */ u32 num_gppsm_segs; /* Total # of allocations outstanding for CMM */ - u32 ul_total_in_use_cnt; + u32 total_in_use_cnt; /* Min SM block size allocation from cmm_create() */ u32 min_block_size; /* Info per registered SM segment. */ @@ -78,7 +78,7 @@ struct cmm_info { /* XlatorCreate attributes */ struct cmm_xlatorattrs { - u32 ul_seg_id; /* segment Id used for SM allocations */ + u32 seg_id; /* segment Id used for SM allocations */ u32 dsp_bufs; /* # of DSP-side bufs */ u32 dsp_buf_size; /* size of DSP-side bufs in GPP bytes */ /* Vm base address alloc'd in client process context */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h index efd731d..82e2439 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h @@ -208,8 +208,8 @@ enum dsp_flushtype { /* Memory Segment Status Values */ struct dsp_memstat { - u32 ul_size; - u32 ul_total_free_size; + u32 size; + u32 total_free_size; u32 len_max_free_block; u32 num_free_blocks; u32 num_alloc_blocks; @@ -388,7 +388,7 @@ struct dsp_resourceinfo { u32 cb_struct; enum dsp_resourceinfotype resource_type; union { - u32 ul_resource; + u32 resource; struct dsp_memstat mem_stat; struct dsp_procloadstat proc_load_stat; } result; diff --git a/drivers/staging/tidspbridge/include/dspbridge/dev.h b/drivers/staging/tidspbridge/include/dspbridge/dev.h index 37d1fff..f41e478 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dev.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dev.h @@ -109,8 +109,8 @@ extern int dev_create_device(struct dev_object * DEV Initialized * Valid hdev_obj * Ensures: - * 0 and hdev_obj->hnode_mgr != NULL - * else hdev_obj->hnode_mgr == NULL + * 0 and hdev_obj->node_mgr != NULL + * else hdev_obj->node_mgr == NULL */ extern int dev_create2(struct dev_object *hdev_obj); @@ -127,7 +127,7 @@ extern int dev_create2(struct dev_object *hdev_obj); * DEV Initialized * Valid hdev_obj * Ensures: - * 0 and hdev_obj->hnode_mgr == NULL + * 0 and hdev_obj->node_mgr == NULL * else -EPERM. */ extern int dev_destroy2(struct dev_object *hdev_obj); diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h b/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h index bd3f885..ab20062 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h @@ -120,20 +120,20 @@ union trapped_args { struct { void *hprocessor; - u32 ul_size; + u32 size; void *__user *pp_rsv_addr; } args_proc_rsvmem; struct { void *hprocessor; - u32 ul_size; + u32 size; void *prsv_addr; } args_proc_unrsvmem; struct { void *hprocessor; void *pmpu_addr; - u32 ul_size; + u32 size; void *req_addr; void *__user *pp_map_addr; u32 ul_map_attr; @@ -141,28 +141,28 @@ union trapped_args { struct { void *hprocessor; - u32 ul_size; + u32 size; void *map_addr; } args_proc_unmapmem; struct { void *hprocessor; void *pmpu_addr; - u32 ul_size; + u32 size; u32 dir; } args_proc_dma; struct { void *hprocessor; void *pmpu_addr; - u32 ul_size; + u32 size; u32 ul_flags; } args_proc_flushmemory; struct { void *hprocessor; void *pmpu_addr; - u32 ul_size; + u32 size; } args_proc_invalidatememory; /* NODE Module */ @@ -328,14 +328,14 @@ union trapped_args { /* CMM Module */ struct { - struct cmm_object *hcmm_mgr; + struct cmm_object *cmm_mgr; u32 usize; struct cmm_attrs *pattrs; void **pp_buf_va; } args_cmm_allocbuf; struct { - struct cmm_object *hcmm_mgr; + struct cmm_object *cmm_mgr; void *buf_pa; u32 ul_seg_id; } args_cmm_freebuf; @@ -346,7 +346,7 @@ union trapped_args { } args_cmm_gethandle; struct { - struct cmm_object *hcmm_mgr; + struct cmm_object *cmm_mgr; struct cmm_info __user *cmm_info_obj; } args_cmm_getinfo; diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspioctl.h b/drivers/staging/tidspbridge/include/dspbridge/dspioctl.h index 307d1a0..0c7ec04 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspioctl.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspioctl.h @@ -59,7 +59,7 @@ struct bridge_ioctl_extproc { u32 gpp_pa; /* GPP physical address */ /* GPP virtual address. __va does not work for ioremapped addresses */ u32 gpp_va; - u32 ul_size; /* Size of the mapped memory in bytes */ + u32 size; /* Size of the mapped memory in bytes */ enum hw_endianism_t endianism; enum hw_mmu_mixed_size_t mixed_mode; enum hw_element_size_t elem_size; diff --git a/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h b/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h index 0108fae..ee3a85f 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/nldrdefs.h @@ -84,8 +84,8 @@ typedef u32(*nldr_writefxn) (void *priv_ref, struct nldr_attrs { nldr_ovlyfxn ovly; nldr_writefxn write; - u16 us_dsp_word_size; - u16 us_dsp_mau_size; + u16 dsp_word_size; + u16 dsp_mau_size; }; /* diff --git a/drivers/staging/tidspbridge/include/dspbridge/strmdefs.h b/drivers/staging/tidspbridge/include/dspbridge/strmdefs.h index c6abbf3..046259c 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/strmdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/strmdefs.h @@ -28,7 +28,7 @@ struct strm_attr { char *pstr_event_name; void *virt_base; /* Process virtual base address of * mapped SM */ - u32 ul_virt_size; /* Size of virtual space in bytes */ + u32 virt_size; /* Size of virtual space in bytes */ struct dsp_streamattrin *stream_attr_in; }; diff --git a/drivers/staging/tidspbridge/pmgr/cmm.c b/drivers/staging/tidspbridge/pmgr/cmm.c index 4142e9a..e6b2c89 100644 --- a/drivers/staging/tidspbridge/pmgr/cmm.c +++ b/drivers/staging/tidspbridge/pmgr/cmm.c @@ -49,7 +49,7 @@ #include /* ----------------------------------- Defines, Data Structures, Typedefs */ -#define NEXT_PA(pnode) (pnode->pa + pnode->ul_size) +#define NEXT_PA(pnode) (pnode->pa + pnode->size) /* Other bus/platform translations */ #define DSPPA2GPPPA(base, x, y) ((x)+(y)) @@ -63,7 +63,7 @@ */ struct cmm_allocator { /* sma */ unsigned int shm_base; /* Start of physical SM block */ - u32 ul_sm_size; /* Size of SM block in bytes */ + u32 sm_size; /* Size of SM block in bytes */ unsigned int vm_base; /* Start of VM block. (Dev driver * context for 'sma') */ u32 dsp_phys_addr_offset; /* DSP PA to GPP PA offset for this @@ -71,7 +71,7 @@ struct cmm_allocator { /* sma */ s8 c_factor; /* DSPPa to GPPPa Conversion Factor */ unsigned int dsp_base; /* DSP virt base byte address */ u32 dsp_size; /* DSP seg size in bytes */ - struct cmm_object *hcmm_mgr; /* back ref to parent mgr */ + struct cmm_object *cmm_mgr; /* back ref to parent mgr */ /* node list of available memory */ struct list_head free_list; /* node list of memory in use */ @@ -80,15 +80,15 @@ struct cmm_allocator { /* sma */ struct cmm_xlator { /* Pa<->Va translator object */ /* CMM object this translator associated */ - struct cmm_object *hcmm_mgr; + struct cmm_object *cmm_mgr; /* * Client process virtual base address that corresponds to phys SM - * base address for translator's ul_seg_id. + * base address for translator's seg_id. * Only 1 segment ID currently supported. */ unsigned int virt_base; /* virtual base address */ - u32 ul_virt_size; /* size of virt space in bytes */ - u32 ul_seg_id; /* Segment Id */ + u32 virt_size; /* size of virt space in bytes */ + u32 seg_id; /* Segment Id */ }; /* CMM Mgr */ @@ -112,12 +112,12 @@ static struct cmm_mgrattrs cmm_dfltmgrattrs = { /* Default allocation attributes */ static struct cmm_attrs cmm_dfltalctattrs = { - 1 /* ul_seg_id, default segment Id for allocator */ + 1 /* seg_id, default segment Id for allocator */ }; /* Address translator default attrs */ static struct cmm_xlatorattrs cmm_dfltxlatorattrs = { - /* ul_seg_id, does not have to match cmm_dfltalctattrs ul_seg_id */ + /* seg_id, does not have to match cmm_dfltalctattrs ul_seg_id */ 1, 0, /* dsp_bufs */ 0, /* dsp_buf_size */ @@ -130,7 +130,7 @@ struct cmm_mnode { struct list_head link; /* must be 1st element */ u32 pa; /* Phys addr */ u32 va; /* Virtual address in device process context */ - u32 ul_size; /* SM block size in bytes */ + u32 size; /* SM block size in bytes */ u32 client_proc; /* Process that allocated this mem block */ }; @@ -180,11 +180,11 @@ void *cmm_calloc_buf(struct cmm_object *hcmm_mgr, u32 usize, *pp_buf_va = NULL; if (cmm_mgr_obj && (usize != 0)) { - if (pattrs->ul_seg_id > 0) { + if (pattrs->seg_id > 0) { /* SegId > 0 is SM */ /* get the allocator object for this segment id */ allocator = - get_allocator(cmm_mgr_obj, pattrs->ul_seg_id); + get_allocator(cmm_mgr_obj, pattrs->seg_id); /* keep block size a multiple of min_block_size */ usize = ((usize - 1) & ~(cmm_mgr_obj->min_block_size - @@ -194,7 +194,7 @@ void *cmm_calloc_buf(struct cmm_object *hcmm_mgr, u32 usize, pnode = get_free_block(allocator, usize); } if (pnode) { - delta_size = (pnode->ul_size - usize); + delta_size = (pnode->size - usize); if (delta_size >= cmm_mgr_obj->min_block_size) { /* create a new block with the leftovers and * add to freelist */ @@ -205,7 +205,7 @@ void *cmm_calloc_buf(struct cmm_object *hcmm_mgr, u32 usize, /* leftovers go free */ add_to_free_list(allocator, new_node); /* adjust our node's size */ - pnode->ul_size = usize; + pnode->size = usize; } /* Tag node with client process requesting allocation * We'll need to free up a process's alloc'd SM if the @@ -294,7 +294,7 @@ int cmm_destroy(struct cmm_object *hcmm_mgr, bool force) /* Check for outstanding memory allocations */ status = cmm_get_info(hcmm_mgr, &temp_info); if (!status) { - if (temp_info.ul_total_in_use_cnt > 0) { + if (temp_info.total_in_use_cnt > 0) { /* outstanding allocations */ status = -EPERM; } @@ -356,7 +356,7 @@ int cmm_free_buf(struct cmm_object *hcmm_mgr, void *buf_pa, u32 ul_seg_id) if (ul_seg_id == 0) { pattrs = &cmm_dfltalctattrs; - ul_seg_id = pattrs->ul_seg_id; + ul_seg_id = pattrs->seg_id; } if (!hcmm_mgr || !(ul_seg_id > 0)) { status = -EFAULT; @@ -428,7 +428,7 @@ int cmm_get_info(struct cmm_object *hcmm_mgr, mutex_lock(&cmm_mgr_obj->cmm_lock); cmm_info_obj->num_gppsm_segs = 0; /* # of SM segments */ /* Total # of outstanding alloc */ - cmm_info_obj->ul_total_in_use_cnt = 0; + cmm_info_obj->total_in_use_cnt = 0; /* min block size */ cmm_info_obj->min_block_size = cmm_mgr_obj->min_block_size; /* check SM memory segments */ @@ -440,12 +440,12 @@ int cmm_get_info(struct cmm_object *hcmm_mgr, cmm_info_obj->num_gppsm_segs++; cmm_info_obj->seg_info[ul_seg - 1].seg_base_pa = altr->shm_base - altr->dsp_size; - cmm_info_obj->seg_info[ul_seg - 1].ul_total_seg_size = - altr->dsp_size + altr->ul_sm_size; + cmm_info_obj->seg_info[ul_seg - 1].total_seg_size = + altr->dsp_size + altr->sm_size; cmm_info_obj->seg_info[ul_seg - 1].gpp_base_pa = altr->shm_base; cmm_info_obj->seg_info[ul_seg - 1].gpp_size = - altr->ul_sm_size; + altr->sm_size; cmm_info_obj->seg_info[ul_seg - 1].dsp_base_va = altr->dsp_base; cmm_info_obj->seg_info[ul_seg - 1].dsp_size = @@ -455,7 +455,7 @@ int cmm_get_info(struct cmm_object *hcmm_mgr, cmm_info_obj->seg_info[ul_seg - 1].in_use_cnt = 0; list_for_each_entry(curr, &altr->in_use_list, link) { - cmm_info_obj->ul_total_in_use_cnt++; + cmm_info_obj->total_in_use_cnt++; cmm_info_obj->seg_info[ul_seg - 1].in_use_cnt++; } } @@ -536,9 +536,9 @@ int cmm_register_gppsm_seg(struct cmm_object *hcmm_mgr, goto func_end; } - psma->hcmm_mgr = hcmm_mgr; /* ref to parent */ + psma->cmm_mgr = hcmm_mgr; /* ref to parent */ psma->shm_base = dw_gpp_base_pa; /* SM Base phys */ - psma->ul_sm_size = ul_size; /* SM segment size in bytes */ + psma->sm_size = ul_size; /* SM segment size in bytes */ psma->vm_base = gpp_base_va; psma->dsp_phys_addr_offset = dsp_addr_offset; psma->c_factor = c_factor; @@ -706,7 +706,7 @@ static struct cmm_mnode *get_node(struct cmm_object *cmm_mgr_obj, u32 dw_pa, pnode->pa = dw_pa; pnode->va = dw_va; - pnode->ul_size = ul_size; + pnode->size = ul_size; return pnode; } @@ -738,7 +738,7 @@ static struct cmm_mnode *get_free_block(struct cmm_allocator *allocator, return NULL; list_for_each_entry_safe(node, tmp, &allocator->free_list, link) { - if (usize <= node->ul_size) { + if (usize <= node->size) { list_del(&node->link); return node; } @@ -764,20 +764,20 @@ static void add_to_free_list(struct cmm_allocator *allocator, list_for_each_entry(curr, &allocator->free_list, link) { if (NEXT_PA(curr) == node->pa) { - curr->ul_size += node->ul_size; - delete_node(allocator->hcmm_mgr, node); + curr->size += node->size; + delete_node(allocator->cmm_mgr, node); return; } if (curr->pa == NEXT_PA(node)) { curr->pa = node->pa; curr->va = node->va; - curr->ul_size += node->ul_size; - delete_node(allocator->hcmm_mgr, node); + curr->size += node->size; + delete_node(allocator->cmm_mgr, node); return; } } list_for_each_entry(curr, &allocator->free_list, link) { - if (curr->ul_size >= node->ul_size) { + if (curr->size >= node->size) { list_add_tail(&node->link, &curr->link); return; } @@ -828,9 +828,9 @@ int cmm_xlator_create(struct cmm_xlatorobject **xlator, xlator_object = kzalloc(sizeof(struct cmm_xlator), GFP_KERNEL); if (xlator_object != NULL) { - xlator_object->hcmm_mgr = hcmm_mgr; /* ref back to CMM */ + xlator_object->cmm_mgr = hcmm_mgr; /* ref back to CMM */ /* SM seg_id */ - xlator_object->ul_seg_id = xlator_attrs->ul_seg_id; + xlator_object->seg_id = xlator_attrs->seg_id; } else { status = -ENOMEM; } @@ -853,17 +853,17 @@ void *cmm_xlator_alloc_buf(struct cmm_xlatorobject *xlator, void *va_buf, DBC_REQUIRE(refs > 0); DBC_REQUIRE(xlator != NULL); - DBC_REQUIRE(xlator_obj->hcmm_mgr != NULL); + DBC_REQUIRE(xlator_obj->cmm_mgr != NULL); DBC_REQUIRE(va_buf != NULL); DBC_REQUIRE(pa_size > 0); - DBC_REQUIRE(xlator_obj->ul_seg_id > 0); + DBC_REQUIRE(xlator_obj->seg_id > 0); if (xlator_obj) { - attrs.ul_seg_id = xlator_obj->ul_seg_id; + attrs.seg_id = xlator_obj->seg_id; __raw_writel(0, va_buf); /* Alloc SM */ pbuf = - cmm_calloc_buf(xlator_obj->hcmm_mgr, pa_size, &attrs, NULL); + cmm_calloc_buf(xlator_obj->cmm_mgr, pa_size, &attrs, NULL); if (pbuf) { /* convert to translator(node/strm) process Virtual * address */ @@ -889,14 +889,14 @@ int cmm_xlator_free_buf(struct cmm_xlatorobject *xlator, void *buf_va) DBC_REQUIRE(refs > 0); DBC_REQUIRE(buf_va != NULL); - DBC_REQUIRE(xlator_obj->ul_seg_id > 0); + DBC_REQUIRE(xlator_obj->seg_id > 0); if (xlator_obj) { /* convert Va to Pa so we can free it. */ buf_pa = cmm_xlator_translate(xlator, buf_va, CMM_VA2PA); if (buf_pa) { - status = cmm_free_buf(xlator_obj->hcmm_mgr, buf_pa, - xlator_obj->ul_seg_id); + status = cmm_free_buf(xlator_obj->cmm_mgr, buf_pa, + xlator_obj->seg_id); if (status) { /* Uh oh, this shouldn't happen. Descriptor * gone! */ @@ -926,7 +926,7 @@ int cmm_xlator_info(struct cmm_xlatorobject *xlator, u8 ** paddr, if (set_info) { /* set translators virtual address range */ xlator_obj->virt_base = (u32) *paddr; - xlator_obj->ul_virt_size = ul_size; + xlator_obj->virt_size = ul_size; } else { /* return virt base address */ *paddr = (u8 *) xlator_obj->virt_base; } @@ -955,10 +955,10 @@ void *cmm_xlator_translate(struct cmm_xlatorobject *xlator, void *paddr, if (!xlator_obj) goto loop_cont; - cmm_mgr_obj = (struct cmm_object *)xlator_obj->hcmm_mgr; + cmm_mgr_obj = (struct cmm_object *)xlator_obj->cmm_mgr; /* get this translator's default SM allocator */ - DBC_ASSERT(xlator_obj->ul_seg_id > 0); - allocator = cmm_mgr_obj->pa_gppsm_seg_tab[xlator_obj->ul_seg_id - 1]; + DBC_ASSERT(xlator_obj->seg_id > 0); + allocator = cmm_mgr_obj->pa_gppsm_seg_tab[xlator_obj->seg_id - 1]; if (!allocator) goto loop_cont; @@ -974,7 +974,7 @@ void *cmm_xlator_translate(struct cmm_xlatorobject *xlator, void *paddr, if ((dw_addr_xlate < xlator_obj->virt_base) || (dw_addr_xlate >= (xlator_obj->virt_base + - xlator_obj->ul_virt_size))) { + xlator_obj->virt_size))) { dw_addr_xlate = 0; /* bad address */ } } else { diff --git a/drivers/staging/tidspbridge/pmgr/dev.c b/drivers/staging/tidspbridge/pmgr/dev.c index b855e44..ce7360f 100644 --- a/drivers/staging/tidspbridge/pmgr/dev.c +++ b/drivers/staging/tidspbridge/pmgr/dev.c @@ -61,22 +61,22 @@ struct dev_object { u8 dev_type; /* Device Type */ struct cfg_devnode *dev_node_obj; /* Platform specific dev id */ /* Bridge Context Handle */ - struct bridge_dev_context *hbridge_context; + struct bridge_dev_context *bridge_context; /* Function interface to Bridge driver. */ struct bridge_drv_interface bridge_interface; struct brd_object *lock_owner; /* Client with exclusive access. */ struct cod_manager *cod_mgr; /* Code manager handle. */ - struct chnl_mgr *hchnl_mgr; /* Channel manager. */ - struct deh_mgr *hdeh_mgr; /* DEH manager. */ - struct msg_mgr *hmsg_mgr; /* Message manager. */ + struct chnl_mgr *chnl_mgr; /* Channel manager. */ + struct deh_mgr *deh_mgr; /* DEH manager. */ + struct msg_mgr *msg_mgr; /* Message manager. */ struct io_mgr *hio_mgr; /* IO manager (CHNL, msg_ctrl) */ - struct cmm_object *hcmm_mgr; /* SM memory manager. */ + struct cmm_object *cmm_mgr; /* SM memory manager. */ struct dmm_object *dmm_mgr; /* Dynamic memory manager. */ u32 word_size; /* DSP word size: quick access. */ - struct drv_object *hdrv_obj; /* Driver Object */ + struct drv_object *drv_obj; /* Driver Object */ /* List of Processors attached to this device */ struct list_head proc_list; - struct node_mgr *hnode_mgr; + struct node_mgr *node_mgr; }; struct drv_ext { @@ -110,9 +110,9 @@ u32 dev_brd_write_fxn(void *arb, u32 dsp_add, void *host_buf, DBC_REQUIRE(host_buf != NULL); /* Required of BrdWrite(). */ if (dev_obj) { /* Require of BrdWrite() */ - DBC_ASSERT(dev_obj->hbridge_context != NULL); + DBC_ASSERT(dev_obj->bridge_context != NULL); status = (*dev_obj->bridge_interface.brd_write) ( - dev_obj->hbridge_context, host_buf, + dev_obj->bridge_context, host_buf, dsp_add, ul_num_bytes, mem_space); /* Special case of getting the address only */ if (ul_num_bytes == 0) @@ -175,11 +175,11 @@ int dev_create_device(struct dev_object **device_obj, /* Fill out the rest of the Dev Object structure: */ dev_obj->dev_node_obj = dev_node_obj; dev_obj->cod_mgr = NULL; - dev_obj->hchnl_mgr = NULL; - dev_obj->hdeh_mgr = NULL; + dev_obj->chnl_mgr = NULL; + dev_obj->deh_mgr = NULL; dev_obj->lock_owner = NULL; dev_obj->word_size = DSPWORDSIZE; - dev_obj->hdrv_obj = hdrv_obj; + dev_obj->drv_obj = hdrv_obj; dev_obj->dev_type = DSP_UNIT; /* Store this Bridge's interface functions, based on its * version. */ @@ -189,11 +189,11 @@ int dev_create_device(struct dev_object **device_obj, /* Call fxn_dev_create() to get the Bridge's device * context handle. */ status = (dev_obj->bridge_interface.dev_create) - (&dev_obj->hbridge_context, dev_obj, + (&dev_obj->bridge_context, dev_obj, host_res); /* Assert bridge_dev_create()'s ensure clause: */ DBC_ASSERT(status - || (dev_obj->hbridge_context != NULL)); + || (dev_obj->bridge_context != NULL)); } else { status = -ENOMEM; } @@ -224,24 +224,24 @@ int dev_create_device(struct dev_object **device_obj, pr_err("%s: No memory reserved for shared structures\n", __func__); } - status = chnl_create(&dev_obj->hchnl_mgr, dev_obj, &mgr_attrs); + status = chnl_create(&dev_obj->chnl_mgr, dev_obj, &mgr_attrs); if (status == -ENOSYS) { /* It's OK for a device not to have a channel * manager: */ status = 0; } /* Create CMM mgr even if Msg Mgr not impl. */ - status = cmm_create(&dev_obj->hcmm_mgr, + status = cmm_create(&dev_obj->cmm_mgr, (struct dev_object *)dev_obj, NULL); /* Only create IO manager if we have a channel manager */ - if (!status && dev_obj->hchnl_mgr) { + if (!status && dev_obj->chnl_mgr) { status = io_create(&dev_obj->hio_mgr, dev_obj, &io_mgr_attrs); } /* Only create DEH manager if we have an IO manager */ if (!status) { /* Instantiate the DEH module */ - status = bridge_deh_create(&dev_obj->hdeh_mgr, dev_obj); + status = bridge_deh_create(&dev_obj->deh_mgr, dev_obj); } /* Create DMM mgr . */ status = dmm_create(&dev_obj->dmm_mgr, @@ -291,13 +291,13 @@ int dev_create2(struct dev_object *hdev_obj) DBC_REQUIRE(hdev_obj); /* There can be only one Node Manager per DEV object */ - DBC_ASSERT(!dev_obj->hnode_mgr); - status = node_create_mgr(&dev_obj->hnode_mgr, hdev_obj); + DBC_ASSERT(!dev_obj->node_mgr); + status = node_create_mgr(&dev_obj->node_mgr, hdev_obj); if (status) - dev_obj->hnode_mgr = NULL; + dev_obj->node_mgr = NULL; - DBC_ENSURE((!status && dev_obj->hnode_mgr != NULL) - || (status && dev_obj->hnode_mgr == NULL)); + DBC_ENSURE((!status && dev_obj->node_mgr != NULL) + || (status && dev_obj->node_mgr == NULL)); return status; } @@ -314,15 +314,15 @@ int dev_destroy2(struct dev_object *hdev_obj) DBC_REQUIRE(refs > 0); DBC_REQUIRE(hdev_obj); - if (dev_obj->hnode_mgr) { - if (node_delete_mgr(dev_obj->hnode_mgr)) + if (dev_obj->node_mgr) { + if (node_delete_mgr(dev_obj->node_mgr)) status = -EPERM; else - dev_obj->hnode_mgr = NULL; + dev_obj->node_mgr = NULL; } - DBC_ENSURE((!status && dev_obj->hnode_mgr == NULL) || status); + DBC_ENSURE((!status && dev_obj->node_mgr == NULL) || status); return status; } @@ -345,9 +345,9 @@ int dev_destroy_device(struct dev_object *hdev_obj) dev_obj->cod_mgr = NULL; } - if (dev_obj->hnode_mgr) { - node_delete_mgr(dev_obj->hnode_mgr); - dev_obj->hnode_mgr = NULL; + if (dev_obj->node_mgr) { + node_delete_mgr(dev_obj->node_mgr); + dev_obj->node_mgr = NULL; } /* Free the io, channel, and message managers for this board: */ @@ -355,23 +355,23 @@ int dev_destroy_device(struct dev_object *hdev_obj) io_destroy(dev_obj->hio_mgr); dev_obj->hio_mgr = NULL; } - if (dev_obj->hchnl_mgr) { - chnl_destroy(dev_obj->hchnl_mgr); - dev_obj->hchnl_mgr = NULL; + if (dev_obj->chnl_mgr) { + chnl_destroy(dev_obj->chnl_mgr); + dev_obj->chnl_mgr = NULL; } - if (dev_obj->hmsg_mgr) { - msg_delete(dev_obj->hmsg_mgr); - dev_obj->hmsg_mgr = NULL; + if (dev_obj->msg_mgr) { + msg_delete(dev_obj->msg_mgr); + dev_obj->msg_mgr = NULL; } - if (dev_obj->hdeh_mgr) { + if (dev_obj->deh_mgr) { /* Uninitialize DEH module. */ - bridge_deh_destroy(dev_obj->hdeh_mgr); - dev_obj->hdeh_mgr = NULL; + bridge_deh_destroy(dev_obj->deh_mgr); + dev_obj->deh_mgr = NULL; } - if (dev_obj->hcmm_mgr) { - cmm_destroy(dev_obj->hcmm_mgr, true); - dev_obj->hcmm_mgr = NULL; + if (dev_obj->cmm_mgr) { + cmm_destroy(dev_obj->cmm_mgr, true); + dev_obj->cmm_mgr = NULL; } if (dev_obj->dmm_mgr) { @@ -381,15 +381,15 @@ int dev_destroy_device(struct dev_object *hdev_obj) /* Call the driver's bridge_dev_destroy() function: */ /* Require of DevDestroy */ - if (dev_obj->hbridge_context) { + if (dev_obj->bridge_context) { status = (*dev_obj->bridge_interface.dev_destroy) - (dev_obj->hbridge_context); - dev_obj->hbridge_context = NULL; + (dev_obj->bridge_context); + dev_obj->bridge_context = NULL; } else status = -EPERM; if (!status) { /* Remove this DEV_Object from the global list: */ - drv_remove_dev_object(dev_obj->hdrv_obj, dev_obj); + drv_remove_dev_object(dev_obj->drv_obj, dev_obj); /* Free The library * LDR_FreeModule * (dev_obj->module_obj); */ /* Free this dev object: */ @@ -419,7 +419,7 @@ int dev_get_chnl_mgr(struct dev_object *hdev_obj, DBC_REQUIRE(mgr != NULL); if (hdev_obj) { - *mgr = dev_obj->hchnl_mgr; + *mgr = dev_obj->chnl_mgr; } else { *mgr = NULL; status = -EFAULT; @@ -445,7 +445,7 @@ int dev_get_cmm_mgr(struct dev_object *hdev_obj, DBC_REQUIRE(mgr != NULL); if (hdev_obj) { - *mgr = dev_obj->hcmm_mgr; + *mgr = dev_obj->cmm_mgr; } else { *mgr = NULL; status = -EFAULT; @@ -518,7 +518,7 @@ int dev_get_deh_mgr(struct dev_object *hdev_obj, DBC_REQUIRE(deh_manager != NULL); DBC_REQUIRE(hdev_obj); if (hdev_obj) { - *deh_manager = hdev_obj->hdeh_mgr; + *deh_manager = hdev_obj->deh_mgr; } else { *deh_manager = NULL; status = -EFAULT; @@ -642,7 +642,7 @@ void dev_get_msg_mgr(struct dev_object *hdev_obj, struct msg_mgr **msg_man) DBC_REQUIRE(msg_man != NULL); DBC_REQUIRE(hdev_obj); - *msg_man = hdev_obj->hmsg_mgr; + *msg_man = hdev_obj->msg_mgr; } /* @@ -660,7 +660,7 @@ int dev_get_node_manager(struct dev_object *hdev_obj, DBC_REQUIRE(node_man != NULL); if (hdev_obj) { - *node_man = dev_obj->hnode_mgr; + *node_man = dev_obj->node_mgr; } else { *node_man = NULL; status = -EFAULT; @@ -710,7 +710,7 @@ int dev_get_bridge_context(struct dev_object *hdev_obj, DBC_REQUIRE(phbridge_context != NULL); if (hdev_obj) { - *phbridge_context = dev_obj->hbridge_context; + *phbridge_context = dev_obj->bridge_context; } else { *phbridge_context = NULL; status = -EFAULT; @@ -844,11 +844,11 @@ int dev_set_chnl_mgr(struct dev_object *hdev_obj, DBC_REQUIRE(refs > 0); if (hdev_obj) - dev_obj->hchnl_mgr = hmgr; + dev_obj->chnl_mgr = hmgr; else status = -EFAULT; - DBC_ENSURE(status || (dev_obj->hchnl_mgr == hmgr)); + DBC_ENSURE(status || (dev_obj->chnl_mgr == hmgr)); return status; } @@ -862,7 +862,7 @@ void dev_set_msg_mgr(struct dev_object *hdev_obj, struct msg_mgr *hmgr) DBC_REQUIRE(refs > 0); DBC_REQUIRE(hdev_obj); - hdev_obj->hmsg_mgr = hmgr; + hdev_obj->msg_mgr = hmgr; } /* diff --git a/drivers/staging/tidspbridge/pmgr/dspapi.c b/drivers/staging/tidspbridge/pmgr/dspapi.c index 5752438..b7ff378 100644 --- a/drivers/staging/tidspbridge/pmgr/dspapi.c +++ b/drivers/staging/tidspbridge/pmgr/dspapi.c @@ -695,7 +695,7 @@ u32 procwrap_end_dma(union trapped_args *args, void *pr_ctxt) status = proc_end_dma(pr_ctxt, args->args_proc_dma.pmpu_addr, - args->args_proc_dma.ul_size, + args->args_proc_dma.size, args->args_proc_dma.dir); return status; } @@ -709,7 +709,7 @@ u32 procwrap_begin_dma(union trapped_args *args, void *pr_ctxt) status = proc_begin_dma(pr_ctxt, args->args_proc_dma.pmpu_addr, - args->args_proc_dma.ul_size, + args->args_proc_dma.size, args->args_proc_dma.dir); return status; } @@ -727,7 +727,7 @@ u32 procwrap_flush_memory(union trapped_args *args, void *pr_ctxt) status = proc_flush_memory(pr_ctxt, args->args_proc_flushmemory.pmpu_addr, - args->args_proc_flushmemory.ul_size, + args->args_proc_flushmemory.size, args->args_proc_flushmemory.ul_flags); return status; } @@ -742,7 +742,7 @@ u32 procwrap_invalidate_memory(union trapped_args *args, void *pr_ctxt) status = proc_invalidate_memory(pr_ctxt, args->args_proc_invalidatememory.pmpu_addr, - args->args_proc_invalidatememory.ul_size); + args->args_proc_invalidatememory.size); return status; } @@ -950,12 +950,12 @@ u32 procwrap_map(union trapped_args *args, void *pr_ctxt) void *map_addr; void *hprocessor = ((struct process_context *)pr_ctxt)->hprocessor; - if (!args->args_proc_mapmem.ul_size) + if (!args->args_proc_mapmem.size) return -EINVAL; status = proc_map(args->args_proc_mapmem.hprocessor, args->args_proc_mapmem.pmpu_addr, - args->args_proc_mapmem.ul_size, + args->args_proc_mapmem.size, args->args_proc_mapmem.req_addr, &map_addr, args->args_proc_mapmem.ul_map_attr, pr_ctxt); if (!status) { @@ -999,12 +999,12 @@ u32 procwrap_reserve_memory(union trapped_args *args, void *pr_ctxt) void *prsv_addr; void *hprocessor = ((struct process_context *)pr_ctxt)->hprocessor; - if ((args->args_proc_rsvmem.ul_size <= 0) || - (args->args_proc_rsvmem.ul_size & (PG_SIZE4K - 1)) != 0) + if ((args->args_proc_rsvmem.size <= 0) || + (args->args_proc_rsvmem.size & (PG_SIZE4K - 1)) != 0) return -EINVAL; status = proc_reserve_memory(hprocessor, - args->args_proc_rsvmem.ul_size, &prsv_addr, + args->args_proc_rsvmem.size, &prsv_addr, pr_ctxt); if (!status) { if (put_user(prsv_addr, args->args_proc_rsvmem.pp_rsv_addr)) { @@ -1905,7 +1905,7 @@ u32 cmmwrap_get_info(union trapped_args *args, void *pr_ctxt) int status = 0; struct cmm_info cmm_info_obj; - status = cmm_get_info(args->args_cmm_getinfo.hcmm_mgr, &cmm_info_obj); + status = cmm_get_info(args->args_cmm_getinfo.cmm_mgr, &cmm_info_obj); CP_TO_USR(args->args_cmm_getinfo.cmm_info_obj, &cmm_info_obj, status, 1); diff --git a/drivers/staging/tidspbridge/pmgr/io.c b/drivers/staging/tidspbridge/pmgr/io.c index 01ef637..b05a772 100644 --- a/drivers/staging/tidspbridge/pmgr/io.c +++ b/drivers/staging/tidspbridge/pmgr/io.c @@ -73,7 +73,7 @@ int io_create(struct io_mgr **io_man, struct dev_object *hdev_obj, if (!status) { pio_mgr = (struct io_mgr_ *)hio_mgr; pio_mgr->intf_fxns = intf_fxns; - pio_mgr->hdev_obj = hdev_obj; + pio_mgr->dev_obj = hdev_obj; /* Return the new channel manager handle: */ *io_man = hio_mgr; diff --git a/drivers/staging/tidspbridge/pmgr/ioobj.h b/drivers/staging/tidspbridge/pmgr/ioobj.h index f46355f..7defd94 100644 --- a/drivers/staging/tidspbridge/pmgr/ioobj.h +++ b/drivers/staging/tidspbridge/pmgr/ioobj.h @@ -29,10 +29,10 @@ */ struct io_mgr_ { /* These must be the first fields in a io_mgr struct: */ - struct bridge_dev_context *hbridge_context; /* Bridge context. */ + struct bridge_dev_context *bridge_context; /* Bridge context. */ /* Function interface to Bridge driver. */ struct bridge_drv_interface *intf_fxns; - struct dev_object *hdev_obj; /* Device this board represents. */ + struct dev_object *dev_obj; /* Device this board represents. */ }; #endif /* IOOBJ_ */ diff --git a/drivers/staging/tidspbridge/rmgr/disp.c b/drivers/staging/tidspbridge/rmgr/disp.c index 49e38f3..e5af59e 100644 --- a/drivers/staging/tidspbridge/rmgr/disp.c +++ b/drivers/staging/tidspbridge/rmgr/disp.c @@ -58,10 +58,10 @@ * ======== disp_object ======== */ struct disp_object { - struct dev_object *hdev_obj; /* Device for this processor */ + struct dev_object *dev_obj; /* Device for this processor */ /* Function interface to Bridge driver */ struct bridge_drv_interface *intf_fxns; - struct chnl_mgr *hchnl_mgr; /* Channel manager */ + struct chnl_mgr *chnl_mgr; /* Channel manager */ struct chnl_object *chnl_to_dsp; /* Chnl for commands to RMS */ struct chnl_object *chnl_from_dsp; /* Chnl for replies from RMS */ u8 *pbuf; /* Buffer for commands, replies */ @@ -108,11 +108,11 @@ int disp_create(struct disp_object **dispatch_obj, if (disp_obj == NULL) status = -ENOMEM; else - disp_obj->hdev_obj = hdev_obj; + disp_obj->dev_obj = hdev_obj; /* Get Channel manager and Bridge function interface */ if (!status) { - status = dev_get_chnl_mgr(hdev_obj, &(disp_obj->hchnl_mgr)); + status = dev_get_chnl_mgr(hdev_obj, &(disp_obj->chnl_mgr)); if (!status) { (void)dev_get_intf_fxns(hdev_obj, &intf_fxns); disp_obj->intf_fxns = intf_fxns; @@ -142,7 +142,7 @@ int disp_create(struct disp_object **dispatch_obj, chnl_attr_obj.event_obj = NULL; ul_chnl_id = disp_attrs->chnl_offset + CHNLTORMSOFFSET; status = (*intf_fxns->chnl_open) (&(disp_obj->chnl_to_dsp), - disp_obj->hchnl_mgr, + disp_obj->chnl_mgr, CHNL_MODETODSP, ul_chnl_id, &chnl_attr_obj); @@ -150,7 +150,7 @@ int disp_create(struct disp_object **dispatch_obj, ul_chnl_id = disp_attrs->chnl_offset + CHNLFROMRMSOFFSET; status = (*intf_fxns->chnl_open) (&(disp_obj->chnl_from_dsp), - disp_obj->hchnl_mgr, + disp_obj->chnl_mgr, CHNL_MODEFROMDSP, ul_chnl_id, &chnl_attr_obj); } @@ -282,7 +282,7 @@ int disp_node_create(struct disp_object *disp_obj, DBC_REQUIRE(node_get_type(hnode) != NODE_DEVICE); DBC_REQUIRE(node_env != NULL); - status = dev_get_dev_type(disp_obj->hdev_obj, &dev_type); + status = dev_get_dev_type(disp_obj->dev_obj, &dev_type); if (status) goto func_end; @@ -484,7 +484,7 @@ int disp_node_delete(struct disp_object *disp_obj, DBC_REQUIRE(disp_obj); DBC_REQUIRE(hnode != NULL); - status = dev_get_dev_type(disp_obj->hdev_obj, &dev_type); + status = dev_get_dev_type(disp_obj->dev_obj, &dev_type); if (!status) { @@ -525,7 +525,7 @@ int disp_node_run(struct disp_object *disp_obj, DBC_REQUIRE(disp_obj); DBC_REQUIRE(hnode != NULL); - status = dev_get_dev_type(disp_obj->hdev_obj, &dev_type); + status = dev_get_dev_type(disp_obj->dev_obj, &dev_type); if (!status) { diff --git a/drivers/staging/tidspbridge/rmgr/mgr.c b/drivers/staging/tidspbridge/rmgr/mgr.c index 16410a5..d635c01 100644 --- a/drivers/staging/tidspbridge/rmgr/mgr.c +++ b/drivers/staging/tidspbridge/rmgr/mgr.c @@ -44,7 +44,7 @@ #define ZLDLLNAME "" struct mgr_object { - struct dcd_manager *hdcd_mgr; /* Proc/Node data manager */ + struct dcd_manager *dcd_mgr; /* Proc/Node data manager */ }; /* ----------------------------------- Globals */ @@ -67,7 +67,7 @@ int mgr_create(struct mgr_object **mgr_obj, pmgr_obj = kzalloc(sizeof(struct mgr_object), GFP_KERNEL); if (pmgr_obj) { - status = dcd_create_manager(ZLDLLNAME, &pmgr_obj->hdcd_mgr); + status = dcd_create_manager(ZLDLLNAME, &pmgr_obj->dcd_mgr); if (!status) { /* If succeeded store the handle in the MGR Object */ if (drv_datap) { @@ -81,7 +81,7 @@ int mgr_create(struct mgr_object **mgr_obj, if (!status) { *mgr_obj = pmgr_obj; } else { - dcd_destroy_manager(pmgr_obj->hdcd_mgr); + dcd_destroy_manager(pmgr_obj->dcd_mgr); kfree(pmgr_obj); } } else { @@ -110,8 +110,8 @@ int mgr_destroy(struct mgr_object *hmgr_obj) DBC_REQUIRE(hmgr_obj); /* Free resources */ - if (hmgr_obj->hdcd_mgr) - dcd_destroy_manager(hmgr_obj->hdcd_mgr); + if (hmgr_obj->dcd_mgr) + dcd_destroy_manager(hmgr_obj->dcd_mgr); kfree(pmgr_obj); /* Update the driver data with NULL for MGR Object */ @@ -163,7 +163,7 @@ int mgr_enum_node_info(u32 node_id, struct dsp_ndbprops *pndb_props, break; *pu_num_nodes = node_index; if (node_id == (node_index - 1)) { - status = dcd_get_object_def(pmgr_obj->hdcd_mgr, + status = dcd_get_object_def(pmgr_obj->dcd_mgr, &node_uuid, DSP_DCDNODETYPE, &gen_obj); if (status) break; @@ -258,7 +258,7 @@ int mgr_enum_processor_info(u32 processor_id, if (proc_detect != false) continue; - status2 = dcd_get_object_def(pmgr_obj->hdcd_mgr, + status2 = dcd_get_object_def(pmgr_obj->dcd_mgr, (struct dsp_uuid *)&temp_uuid, DSP_DCDPROCESSORTYPE, &gen_obj); if (!status2) { @@ -333,7 +333,7 @@ int mgr_get_dcd_handle(struct mgr_object *mgr_handle, *dcd_handle = (u32) NULL; if (pmgr_obj) { - *dcd_handle = (u32) pmgr_obj->hdcd_mgr; + *dcd_handle = (u32) pmgr_obj->dcd_mgr; status = 0; } DBC_ENSURE((!status && *dcd_handle != (u32) NULL) || diff --git a/drivers/staging/tidspbridge/rmgr/nldr.c b/drivers/staging/tidspbridge/rmgr/nldr.c index 688d965..7a15f63 100644 --- a/drivers/staging/tidspbridge/rmgr/nldr.c +++ b/drivers/staging/tidspbridge/rmgr/nldr.c @@ -190,8 +190,8 @@ struct ovly_node { * Overlay loader object. */ struct nldr_object { - struct dev_object *hdev_obj; /* Device object */ - struct dcd_manager *hdcd_mgr; /* Proc/Node data manager */ + struct dev_object *dev_obj; /* Device object */ + struct dcd_manager *dcd_mgr; /* Proc/Node data manager */ struct dbll_tar_obj *dbll; /* The DBL loader */ struct dbll_library_obj *base_lib; /* Base image library */ struct rmm_target_obj *rmm; /* Remote memory manager for DSP */ @@ -206,8 +206,8 @@ struct nldr_object { u32 *seg_table; /* memtypes of dynamic memory segs * indexed by segid */ - u16 us_dsp_mau_size; /* Size of DSP MAU */ - u16 us_dsp_word_size; /* Size of DSP word */ + u16 dsp_mau_size; /* Size of DSP MAU */ + u16 dsp_word_size; /* Size of DSP word */ }; /* @@ -435,7 +435,7 @@ int nldr_create(struct nldr_object **nldr, /* Allocate dynamic loader object */ nldr_obj = kzalloc(sizeof(struct nldr_object), GFP_KERNEL); if (nldr_obj) { - nldr_obj->hdev_obj = hdev_obj; + nldr_obj->dev_obj = hdev_obj; /* warning, lazy status checking alert! */ dev_get_cod_mgr(hdev_obj, &cod_mgr); if (cod_mgr) { @@ -450,8 +450,8 @@ int nldr_create(struct nldr_object **nldr, } status = 0; /* end lazy status checking */ - nldr_obj->us_dsp_mau_size = pattrs->us_dsp_mau_size; - nldr_obj->us_dsp_word_size = pattrs->us_dsp_word_size; + nldr_obj->dsp_mau_size = pattrs->dsp_mau_size; + nldr_obj->dsp_word_size = pattrs->dsp_word_size; nldr_obj->ldr_fxns = ldr_fxns; if (!(nldr_obj->ldr_fxns.init_fxn())) status = -ENOMEM; @@ -461,7 +461,7 @@ int nldr_create(struct nldr_object **nldr, } /* Create the DCD Manager */ if (!status) - status = dcd_create_manager(NULL, &nldr_obj->hdcd_mgr); + status = dcd_create_manager(NULL, &nldr_obj->dcd_mgr); /* Get dynamic loading memory sections from base lib */ if (!status) { @@ -471,7 +471,7 @@ int nldr_create(struct nldr_object **nldr, &ul_len); if (!status) { psz_coff_buf = - kzalloc(ul_len * nldr_obj->us_dsp_mau_size, + kzalloc(ul_len * nldr_obj->dsp_mau_size, GFP_KERNEL); if (!psz_coff_buf) status = -ENOMEM; @@ -550,7 +550,7 @@ int nldr_create(struct nldr_object **nldr, DBC_ASSERT(!status); /* First count number of overlay nodes */ status = - dcd_get_objects(nldr_obj->hdcd_mgr, sz_zl_file, + dcd_get_objects(nldr_obj->dcd_mgr, sz_zl_file, add_ovly_node, (void *)nldr_obj); /* Now build table of overlay nodes */ if (!status && nldr_obj->ovly_nodes > 0) { @@ -560,7 +560,7 @@ int nldr_create(struct nldr_object **nldr, nldr_obj->ovly_nodes, GFP_KERNEL); /* Put overlay nodes in the table */ nldr_obj->ovly_nid = 0; - status = dcd_get_objects(nldr_obj->hdcd_mgr, sz_zl_file, + status = dcd_get_objects(nldr_obj->dcd_mgr, sz_zl_file, add_ovly_node, (void *)nldr_obj); } @@ -604,8 +604,8 @@ void nldr_delete(struct nldr_object *nldr_obj) kfree(nldr_obj->seg_table); - if (nldr_obj->hdcd_mgr) - dcd_destroy_manager(nldr_obj->hdcd_mgr); + if (nldr_obj->dcd_mgr) + dcd_destroy_manager(nldr_obj->dcd_mgr); /* Free overlay node information */ if (nldr_obj->ovly_table) { @@ -1005,7 +1005,7 @@ static int add_ovly_node(struct dsp_uuid *uuid_obj, goto func_end; status = - dcd_get_object_def(nldr_obj->hdcd_mgr, uuid_obj, obj_type, + dcd_get_object_def(nldr_obj->dcd_mgr, uuid_obj, obj_type, &obj_def); if (status) goto func_end; @@ -1262,14 +1262,14 @@ static int load_lib(struct nldr_nodeobject *nldr_node_obj, if (depth == 0) { status = dcd_get_library_name(nldr_node_obj->nldr_obj-> - hdcd_mgr, &uuid, psz_file_name, + dcd_mgr, &uuid, psz_file_name, &dw_buf_size, phase, nldr_node_obj->phase_split); } else { /* Dependent libraries are registered with a phase */ status = dcd_get_library_name(nldr_node_obj->nldr_obj-> - hdcd_mgr, &uuid, psz_file_name, + dcd_mgr, &uuid, psz_file_name, &dw_buf_size, NLDR_NOPHASE, NULL); } @@ -1309,7 +1309,7 @@ static int load_lib(struct nldr_nodeobject *nldr_node_obj, depth++; /* Get number of dependent libraries */ status = - dcd_get_num_dep_libs(nldr_node_obj->nldr_obj->hdcd_mgr, + dcd_get_num_dep_libs(nldr_node_obj->nldr_obj->dcd_mgr, &uuid, &nd_libs, &np_libs, phase); } DBC_ASSERT(nd_libs >= np_libs); @@ -1342,7 +1342,7 @@ static int load_lib(struct nldr_nodeobject *nldr_node_obj, /* Get the dependent library UUIDs */ status = dcd_get_dep_libs(nldr_node_obj-> - nldr_obj->hdcd_mgr, &uuid, + nldr_obj->dcd_mgr, &uuid, nd_libs, dep_lib_uui_ds, persistent_dep_libs, phase); @@ -1630,8 +1630,8 @@ static int remote_alloc(void **ref, u16 mem_sect, u32 size, rmm = nldr_obj->rmm; /* Convert size to DSP words */ word_size = - (size + nldr_obj->us_dsp_word_size - - 1) / nldr_obj->us_dsp_word_size; + (size + nldr_obj->dsp_word_size - + 1) / nldr_obj->dsp_word_size; /* Modify memory 'align' to account for DSP cache line size */ align = lcm(GEM_CACHE_LINE_SIZE, align); dev_dbg(bridge, "%s: memory align to 0x%x\n", __func__, align); @@ -1742,8 +1742,8 @@ static int remote_free(void **ref, u16 space, u32 dsp_address, /* Convert size to DSP words */ word_size = - (size + nldr_obj->us_dsp_word_size - - 1) / nldr_obj->us_dsp_word_size; + (size + nldr_obj->dsp_word_size - + 1) / nldr_obj->dsp_word_size; if (rmm_free(rmm, space, dsp_address, word_size, reserve)) status = 0; diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c index 76166c1..2bfbd16 100644 --- a/drivers/staging/tidspbridge/rmgr/node.c +++ b/drivers/staging/tidspbridge/rmgr/node.c @@ -124,10 +124,10 @@ * ======== node_mgr ======== */ struct node_mgr { - struct dev_object *hdev_obj; /* Device object */ + struct dev_object *dev_obj; /* Device object */ /* Function interface to Bridge driver */ struct bridge_drv_interface *intf_fxns; - struct dcd_manager *hdcd_mgr; /* Proc/Node data manager */ + struct dcd_manager *dcd_mgr; /* Proc/Node data manager */ struct disp_object *disp_obj; /* Node dispatcher */ struct list_head node_list; /* List of all allocated nodes */ u32 num_nodes; /* Number of nodes in node_list */ @@ -188,7 +188,7 @@ struct stream_chnl { */ struct node_object { struct list_head list_elem; - struct node_mgr *hnode_mgr; /* The manager of this node */ + struct node_mgr *node_mgr; /* The manager of this node */ struct proc_object *hprocessor; /* Back pointer to processor */ struct dsp_uuid node_uuid; /* Node's ID */ s32 prio; /* Node's current priority */ @@ -389,12 +389,12 @@ int node_allocate(struct proc_object *hprocessor, status = -ENOMEM; goto func_end; } - pnode->hnode_mgr = hnode_mgr; + pnode->node_mgr = hnode_mgr; /* This critical section protects get_node_props */ mutex_lock(&hnode_mgr->node_mgr_lock); /* Get dsp_ndbprops from node database */ - status = get_node_props(hnode_mgr->hdcd_mgr, pnode, node_uuid, + status = get_node_props(hnode_mgr->dcd_mgr, pnode, node_uuid, &(pnode->dcd_props)); if (status) goto func_cont; @@ -784,10 +784,10 @@ int node_change_priority(struct node_object *hnode, s32 prio) DBC_REQUIRE(refs > 0); - if (!hnode || !hnode->hnode_mgr) { + if (!hnode || !hnode->node_mgr) { status = -EFAULT; } else { - hnode_mgr = hnode->hnode_mgr; + hnode_mgr = hnode->node_mgr; node_type = node_get_type(hnode); if (node_type != NODE_TASK && node_type != NODE_DAISSOCKET) status = -EPERM; @@ -862,7 +862,7 @@ int node_connect(struct node_object *node1, u32 stream1, /* The two nodes must be on the same processor */ if (node1 != (struct node_object *)DSP_HGPPNODE && node2 != (struct node_object *)DSP_HGPPNODE && - node1->hnode_mgr != node2->hnode_mgr) + node1->node_mgr != node2->node_mgr) return -EPERM; /* Cannot connect a node to itself */ @@ -901,10 +901,10 @@ int node_connect(struct node_object *node1, u32 stream1, return -EPERM; /* illegal stream mode */ if (node1_type != NODE_GPP) { - hnode_mgr = node1->hnode_mgr; + hnode_mgr = node1->node_mgr; } else { DBC_ASSERT(node2 != (struct node_object *)DSP_HGPPNODE); - hnode_mgr = node2->hnode_mgr; + hnode_mgr = node2->node_mgr; } /* Enter critical section */ @@ -1158,7 +1158,7 @@ int node_create(struct node_object *hnode) /* create struct dsp_cbdata struct for PWR calls */ cb_data.cb_data = PWR_TIMEOUT; node_type = node_get_type(hnode); - hnode_mgr = hnode->hnode_mgr; + hnode_mgr = hnode->node_mgr; intf_fxns = hnode_mgr->intf_fxns; /* Get access to node dispatcher */ mutex_lock(&hnode_mgr->node_mgr_lock); @@ -1301,7 +1301,7 @@ int node_create_mgr(struct node_mgr **node_man, if (!node_mgr_obj) return -ENOMEM; - node_mgr_obj->hdev_obj = hdev_obj; + node_mgr_obj->dev_obj = hdev_obj; node_mgr_obj->ntfy_obj = kmalloc(sizeof(struct ntfy_object), GFP_KERNEL); @@ -1315,7 +1315,7 @@ int node_create_mgr(struct node_mgr **node_man, dev_get_dev_type(hdev_obj, &dev_type); - status = dcd_create_manager(sz_zl_file, &node_mgr_obj->hdcd_mgr); + status = dcd_create_manager(sz_zl_file, &node_mgr_obj->dcd_mgr); if (status) goto out_err; @@ -1364,8 +1364,8 @@ int node_create_mgr(struct node_mgr **node_man, nldr_attrs_obj.ovly = ovly; nldr_attrs_obj.write = mem_write; - nldr_attrs_obj.us_dsp_word_size = node_mgr_obj->udsp_word_size; - nldr_attrs_obj.us_dsp_mau_size = node_mgr_obj->udsp_mau_size; + nldr_attrs_obj.dsp_word_size = node_mgr_obj->udsp_word_size; + nldr_attrs_obj.dsp_mau_size = node_mgr_obj->udsp_mau_size; node_mgr_obj->loader_init = node_mgr_obj->nldr_fxns.init(); status = node_mgr_obj->nldr_fxns.create(&node_mgr_obj->nldr_obj, hdev_obj, @@ -1417,7 +1417,7 @@ int node_delete(struct node_res_object *noderes, } /* create struct dsp_cbdata struct for PWR call */ cb_data.cb_data = PWR_TIMEOUT; - hnode_mgr = pnode->hnode_mgr; + hnode_mgr = pnode->node_mgr; hprocessor = pnode->hprocessor; disp_obj = hnode_mgr->disp_obj; node_type = node_get_type(pnode); @@ -1676,7 +1676,7 @@ int node_get_attr(struct node_object *hnode, if (!hnode) return -EFAULT; - hnode_mgr = hnode->hnode_mgr; + hnode_mgr = hnode->node_mgr; /* Enter hnode_mgr critical section (since we're accessing * data that could be changed by node_change_priority() and * node_connect(). */ @@ -1779,7 +1779,7 @@ int node_get_message(struct node_object *hnode, status = -EPERM; goto func_end; } - hnode_mgr = hnode->hnode_mgr; + hnode_mgr = hnode->node_mgr; node_type = node_get_type(hnode); if (node_type != NODE_MESSAGE && node_type != NODE_TASK && node_type != NODE_DAISSOCKET) { @@ -1801,7 +1801,7 @@ int node_get_message(struct node_object *hnode, /* Translate DSP byte addr to GPP Va. */ tmp_buf = cmm_xlator_translate(hnode->xlator, (void *)(message->arg1 * - hnode->hnode_mgr-> + hnode->node_mgr-> udsp_word_size), CMM_DSPPA2PA); if (tmp_buf != NULL) { /* now convert this GPP Pa to Va */ @@ -1810,7 +1810,7 @@ int node_get_message(struct node_object *hnode, if (tmp_buf != NULL) { /* Adjust SM size in msg */ message->arg1 = (u32) tmp_buf; - message->arg2 *= hnode->hnode_mgr->udsp_word_size; + message->arg2 *= hnode->node_mgr->udsp_word_size; } else { status = -ESRCH; } @@ -1857,7 +1857,7 @@ int node_get_strm_mgr(struct node_object *hnode, if (!hnode) status = -EFAULT; else - *strm_man = hnode->hnode_mgr->strm_mgr_obj; + *strm_man = hnode->node_mgr->strm_mgr_obj; return status; } @@ -1942,7 +1942,7 @@ void node_on_exit(struct node_object *hnode, s32 node_status) NODE_SET_STATE(hnode, NODE_DONE); hnode->exit_status = node_status; if (hnode->loaded && hnode->phase_split) { - (void)hnode->hnode_mgr->nldr_fxns.unload(hnode-> + (void)hnode->node_mgr->nldr_fxns.unload(hnode-> nldr_node_obj, NLDR_EXECUTE); hnode->loaded = false; @@ -1988,7 +1988,7 @@ int node_pause(struct node_object *hnode) status = -ENOSYS; if (!status) { - hnode_mgr = hnode->hnode_mgr; + hnode_mgr = hnode->node_mgr; /* Enter critical section */ mutex_lock(&hnode_mgr->node_mgr_lock); @@ -2072,7 +2072,7 @@ int node_put_message(struct node_object *hnode, status = -EPERM; goto func_end; } - hnode_mgr = hnode->hnode_mgr; + hnode_mgr = hnode->node_mgr; node_type = node_get_type(hnode); if (node_type != NODE_MESSAGE && node_type != NODE_TASK && node_type != NODE_DAISSOCKET) @@ -2107,12 +2107,12 @@ int node_put_message(struct node_object *hnode, CMM_VA2DSPPA); if (tmp_buf != NULL) { /* got translation, convert to MAUs in msg */ - if (hnode->hnode_mgr->udsp_word_size != 0) { + if (hnode->node_mgr->udsp_word_size != 0) { new_msg.arg1 = (u32) tmp_buf / - hnode->hnode_mgr->udsp_word_size; + hnode->node_mgr->udsp_word_size; /* MAUs */ - new_msg.arg2 /= hnode->hnode_mgr-> + new_msg.arg2 /= hnode->node_mgr-> udsp_word_size; } else { pr_err("%s: udsp_word_size is zero!\n", @@ -2172,7 +2172,7 @@ int node_register_notify(struct node_object *hnode, u32 event_mask, notify_type); } else { /* Send Message part of event mask to msg_ctrl */ - intf_fxns = hnode->hnode_mgr->intf_fxns; + intf_fxns = hnode->node_mgr->intf_fxns; status = (*intf_fxns->msg_register_notify) (hnode->msg_queue_obj, event_mask & DSP_NODEMESSAGEREADY, notify_type, @@ -2229,7 +2229,7 @@ int node_run(struct node_object *hnode) if (status) goto func_end; - hnode_mgr = hnode->hnode_mgr; + hnode_mgr = hnode->node_mgr; if (!hnode_mgr) { status = -EFAULT; goto func_end; @@ -2329,7 +2329,7 @@ int node_terminate(struct node_object *hnode, int *pstatus) DBC_REQUIRE(refs > 0); DBC_REQUIRE(pstatus != NULL); - if (!hnode || !hnode->hnode_mgr) { + if (!hnode || !hnode->node_mgr) { status = -EFAULT; goto func_end; } @@ -2340,7 +2340,7 @@ int node_terminate(struct node_object *hnode, int *pstatus) status = proc_get_processor_id(pnode->hprocessor, &proc_id); if (!status) { - hnode_mgr = hnode->hnode_mgr; + hnode_mgr = hnode->node_mgr; node_type = node_get_type(hnode); if (node_type != NODE_TASK && node_type != NODE_DAISSOCKET) status = -EPERM; @@ -2416,7 +2416,7 @@ int node_terminate(struct node_object *hnode, int *pstatus) * Here it goes the part of the simulation of * the DSP exception. */ - dev_get_deh_mgr(hnode_mgr->hdev_obj, &hdeh_mgr); + dev_get_deh_mgr(hnode_mgr->dev_obj, &hdeh_mgr); if (!hdeh_mgr) goto func_cont; @@ -2465,7 +2465,7 @@ static void delete_node(struct node_object *hnode, int status; if (!hnode) goto func_end; - hnode_mgr = hnode->hnode_mgr; + hnode_mgr = hnode->node_mgr; if (!hnode_mgr) goto func_end; @@ -2567,7 +2567,7 @@ static void delete_node(struct node_object *hnode, kfree(hnode->xlator); kfree(hnode->nldr_node_obj); hnode->nldr_node_obj = NULL; - hnode->hnode_mgr = NULL; + hnode->node_mgr = NULL; kfree(hnode); hnode = NULL; func_end: @@ -2585,8 +2585,8 @@ static void delete_node_mgr(struct node_mgr *hnode_mgr) if (hnode_mgr) { /* Free resources */ - if (hnode_mgr->hdcd_mgr) - dcd_destroy_manager(hnode_mgr->hdcd_mgr); + if (hnode_mgr->dcd_mgr) + dcd_destroy_manager(hnode_mgr->dcd_mgr); /* Remove any elements remaining in lists */ list_for_each_entry_safe(hnode, tmp, &hnode_mgr->node_list, @@ -2686,7 +2686,7 @@ static void fill_stream_def(struct node_object *hnode, struct node_strmdef *pstrm_def, struct dsp_strmattr *pattrs) { - struct node_mgr *hnode_mgr = hnode->hnode_mgr; + struct node_mgr *hnode_mgr = hnode->node_mgr; if (pattrs != NULL) { pstrm_def->num_bufs = pattrs->num_bufs; @@ -2746,7 +2746,7 @@ static int get_fxn_address(struct node_object *hnode, u32 * fxn_addr, u32 phase) { char *pstr_fxn_name = NULL; - struct node_mgr *hnode_mgr = hnode->hnode_mgr; + struct node_mgr *hnode_mgr = hnode->node_mgr; int status = 0; DBC_REQUIRE(node_get_type(hnode) == NODE_TASK || node_get_type(hnode) == NODE_DAISSOCKET || @@ -2979,7 +2979,7 @@ int node_get_uuid_props(void *hprocessor, dcd_node_props.pstr_delete_phase_fxn = NULL; dcd_node_props.pstr_i_alg_name = NULL; - status = dcd_get_object_def(hnode_mgr->hdcd_mgr, + status = dcd_get_object_def(hnode_mgr->dcd_mgr, (struct dsp_uuid *)node_uuid, DSP_DCDNODETYPE, (struct dcd_genericobj *)&dcd_node_props); @@ -3007,7 +3007,7 @@ func_end: static int get_rms_fxns(struct node_mgr *hnode_mgr) { s32 i; - struct dev_object *dev_obj = hnode_mgr->hdev_obj; + struct dev_object *dev_obj = hnode_mgr->dev_obj; int status = 0; static char *psz_fxns[NUMRMSFXNS] = { @@ -3065,14 +3065,14 @@ static u32 ovly(void *priv_ref, u32 dsp_run_addr, u32 dsp_load_addr, DBC_REQUIRE(hnode); - hnode_mgr = hnode->hnode_mgr; + hnode_mgr = hnode->node_mgr; ul_size = ul_num_bytes / hnode_mgr->udsp_word_size; ul_timeout = hnode->utimeout; /* Call new MemCopy function */ intf_fxns = hnode_mgr->intf_fxns; - status = dev_get_bridge_context(hnode_mgr->hdev_obj, &hbridge_context); + status = dev_get_bridge_context(hnode_mgr->dev_obj, &hbridge_context); if (!status) { status = (*intf_fxns->brd_mem_copy) (hbridge_context, @@ -3109,14 +3109,14 @@ static u32 mem_write(void *priv_ref, u32 dsp_add, void *pbuf, DBC_REQUIRE(hnode); DBC_REQUIRE(mem_space & DBLL_CODE || mem_space & DBLL_DATA); - hnode_mgr = hnode->hnode_mgr; + hnode_mgr = hnode->node_mgr; ul_timeout = hnode->utimeout; mem_sect_type = (mem_space & DBLL_CODE) ? RMS_CODE : RMS_DATA; /* Call new MemWrite function */ intf_fxns = hnode_mgr->intf_fxns; - status = dev_get_bridge_context(hnode_mgr->hdev_obj, &hbridge_context); + status = dev_get_bridge_context(hnode_mgr->dev_obj, &hbridge_context); status = (*intf_fxns->brd_mem_write) (hbridge_context, pbuf, dsp_add, ul_num_bytes, mem_sect_type); diff --git a/drivers/staging/tidspbridge/rmgr/proc.c b/drivers/staging/tidspbridge/rmgr/proc.c index 6840d29..fddbcea 100644 --- a/drivers/staging/tidspbridge/rmgr/proc.c +++ b/drivers/staging/tidspbridge/rmgr/proc.c @@ -80,24 +80,24 @@ extern struct device *bridge; /* The proc_object structure. */ struct proc_object { struct list_head link; /* Link to next proc_object */ - struct dev_object *hdev_obj; /* Device this PROC represents */ + struct dev_object *dev_obj; /* Device this PROC represents */ u32 process; /* Process owning this Processor */ - struct mgr_object *hmgr_obj; /* Manager Object Handle */ + struct mgr_object *mgr_obj; /* Manager Object Handle */ u32 attach_count; /* Processor attach count */ u32 processor_id; /* Processor number */ u32 utimeout; /* Time out count */ enum dsp_procstate proc_state; /* Processor state */ - u32 ul_unit; /* DDSP unit number */ + u32 unit; /* DDSP unit number */ bool is_already_attached; /* * True if the Device below has * GPP Client attached */ struct ntfy_object *ntfy_obj; /* Manages notifications */ /* Bridge Context Handle */ - struct bridge_dev_context *hbridge_context; + struct bridge_dev_context *bridge_context; /* Function interface to Bridge driver */ struct bridge_drv_interface *intf_fxns; - char *psz_last_coff; + char *last_coff; struct list_head proc_list; }; @@ -315,8 +315,8 @@ proc_attach(u32 processor_id, status = -ENOMEM; goto func_end; } - p_proc_object->hdev_obj = hdev_obj; - p_proc_object->hmgr_obj = hmgr_obj; + p_proc_object->dev_obj = hdev_obj; + p_proc_object->mgr_obj = hmgr_obj; p_proc_object->processor_id = dev_type; /* Store TGID instead of process handle */ p_proc_object->process = current->tgid; @@ -331,7 +331,7 @@ proc_attach(u32 processor_id, status = dev_get_intf_fxns(hdev_obj, &p_proc_object->intf_fxns); if (!status) { status = dev_get_bridge_context(hdev_obj, - &p_proc_object->hbridge_context); + &p_proc_object->bridge_context); if (status) kfree(p_proc_object); } else @@ -356,7 +356,7 @@ proc_attach(u32 processor_id, * Return handle to this Processor Object: * Find out if the Device is already attached to a * Processor. If so, return AlreadyAttached status */ - status = dev_insert_proc_object(p_proc_object->hdev_obj, + status = dev_insert_proc_object(p_proc_object->dev_obj, (u32) p_proc_object, &p_proc_object-> is_already_attached); @@ -463,12 +463,12 @@ int proc_auto_start(struct cfg_devnode *dev_node_obj, status = -ENOMEM; goto func_end; } - p_proc_object->hdev_obj = hdev_obj; - p_proc_object->hmgr_obj = hmgr_obj; + p_proc_object->dev_obj = hdev_obj; + p_proc_object->mgr_obj = hmgr_obj; status = dev_get_intf_fxns(hdev_obj, &p_proc_object->intf_fxns); if (!status) status = dev_get_bridge_context(hdev_obj, - &p_proc_object->hbridge_context); + &p_proc_object->bridge_context); if (status) goto func_cont; @@ -491,8 +491,8 @@ int proc_auto_start(struct cfg_devnode *dev_node_obj, if (!status) status = proc_start(p_proc_object); } - kfree(p_proc_object->psz_last_coff); - p_proc_object->psz_last_coff = NULL; + kfree(p_proc_object->last_coff); + p_proc_object->last_coff = NULL; func_cont: kfree(p_proc_object); func_end: @@ -541,7 +541,7 @@ int proc_ctrl(void *hprocessor, u32 dw_cmd, struct dsp_cbdata * arg) status = pwr_wake_dsp(timeout); } else if (!((*p_proc_object->intf_fxns->dev_cntrl) - (p_proc_object->hbridge_context, dw_cmd, + (p_proc_object->bridge_context, dw_cmd, arg))) { status = 0; } else { @@ -578,10 +578,10 @@ int proc_detach(struct process_context *pr_ctxt) kfree(p_proc_object->ntfy_obj); } - kfree(p_proc_object->psz_last_coff); - p_proc_object->psz_last_coff = NULL; + kfree(p_proc_object->last_coff); + p_proc_object->last_coff = NULL; /* Remove the Proc from the DEV List */ - (void)dev_remove_proc_object(p_proc_object->hdev_obj, + (void)dev_remove_proc_object(p_proc_object->dev_obj, (u32) p_proc_object); /* Free the Processor Object */ kfree(p_proc_object); @@ -613,7 +613,7 @@ int proc_enum_nodes(void *hprocessor, void **node_tab, DBC_REQUIRE(pu_allocated != NULL); if (p_proc_object) { - if (!(dev_get_node_manager(p_proc_object->hdev_obj, + if (!(dev_get_node_manager(p_proc_object->dev_obj, &hnode_mgr))) { if (hnode_mgr) { status = node_enum_nodes(hnode_mgr, node_tab, @@ -890,7 +890,7 @@ int proc_get_resource_info(void *hprocessor, u32 resource_type, case DSP_RESOURCE_DYNSARAM: case DSP_RESOURCE_DYNEXTERNAL: case DSP_RESOURCE_DYNSRAM: - status = dev_get_node_manager(p_proc_object->hdev_obj, + status = dev_get_node_manager(p_proc_object->dev_obj, &hnode_mgr); if (!hnode_mgr) { status = -EFAULT; @@ -913,7 +913,7 @@ int proc_get_resource_info(void *hprocessor, u32 resource_type, } break; case DSP_RESOURCE_PROCLOAD: - status = dev_get_io_mgr(p_proc_object->hdev_obj, &hio_mgr); + status = dev_get_io_mgr(p_proc_object->dev_obj, &hio_mgr); if (hio_mgr) status = p_proc_object->intf_fxns-> @@ -963,7 +963,7 @@ int proc_get_dev_object(void *hprocessor, DBC_REQUIRE(device_obj != NULL); if (p_proc_object) { - *device_obj = p_proc_object->hdev_obj; + *device_obj = p_proc_object->dev_obj; status = 0; } else { *device_obj = NULL; @@ -996,7 +996,7 @@ int proc_get_state(void *hprocessor, if (p_proc_object) { /* First, retrieve BRD state information */ status = (*p_proc_object->intf_fxns->brd_status) - (p_proc_object->hbridge_context, &brd_status); + (p_proc_object->bridge_context, &brd_status); if (!status) { switch (brd_status) { case BRD_STOPPED: @@ -1115,7 +1115,7 @@ int proc_load(void *hprocessor, const s32 argc_index, status = -EFAULT; goto func_end; } - dev_get_cod_mgr(p_proc_object->hdev_obj, &cod_mgr); + dev_get_cod_mgr(p_proc_object->dev_obj, &cod_mgr); if (!cod_mgr) { status = -EPERM; goto func_end; @@ -1147,7 +1147,7 @@ int proc_load(void *hprocessor, const s32 argc_index, prepend_envp(new_envp, (char **)user_envp, envp_elems, cnew_envp, sz_proc_id); /* Get the DCD Handle */ - status = mgr_get_dcd_handle(p_proc_object->hmgr_obj, + status = mgr_get_dcd_handle(p_proc_object->mgr_obj, (u32 *) &hdcd_handle); if (!status) { /* Before proceeding with new load, @@ -1156,16 +1156,16 @@ int proc_load(void *hprocessor, const s32 argc_index, * If yes, unregister nodes in previously * registered COFF. If any error occurred, * set previously registered COFF to NULL. */ - if (p_proc_object->psz_last_coff != NULL) { + if (p_proc_object->last_coff != NULL) { status = dcd_auto_unregister(hdcd_handle, p_proc_object-> - psz_last_coff); + last_coff); /* Regardless of auto unregister status, * free previously allocated * memory. */ - kfree(p_proc_object->psz_last_coff); - p_proc_object->psz_last_coff = NULL; + kfree(p_proc_object->last_coff); + p_proc_object->last_coff = NULL; } } /* On success, do cod_open_base() */ @@ -1178,7 +1178,7 @@ int proc_load(void *hprocessor, const s32 argc_index, if (!status) { /* Auto-register data base */ /* Get the DCD Handle */ - status = mgr_get_dcd_handle(p_proc_object->hmgr_obj, + status = mgr_get_dcd_handle(p_proc_object->mgr_obj, (u32 *) &hdcd_handle); if (!status) { /* Auto register nodes in specified COFF @@ -1195,15 +1195,15 @@ int proc_load(void *hprocessor, const s32 argc_index, if (status) { status = -EPERM; } else { - DBC_ASSERT(p_proc_object->psz_last_coff == + DBC_ASSERT(p_proc_object->last_coff == NULL); /* Allocate memory for pszLastCoff */ - p_proc_object->psz_last_coff = + p_proc_object->last_coff = kzalloc((strlen(user_args[0]) + 1), GFP_KERNEL); /* If memory allocated, save COFF file name */ - if (p_proc_object->psz_last_coff) { - strncpy(p_proc_object->psz_last_coff, + if (p_proc_object->last_coff) { + strncpy(p_proc_object->last_coff, (char *)user_args[0], (strlen((char *)user_args[0]) + 1)); @@ -1215,17 +1215,17 @@ int proc_load(void *hprocessor, const s32 argc_index, if (!status) { /* Create the message manager. This must be done * before calling the IOOnLoaded function. */ - dev_get_msg_mgr(p_proc_object->hdev_obj, &hmsg_mgr); + dev_get_msg_mgr(p_proc_object->dev_obj, &hmsg_mgr); if (!hmsg_mgr) { - status = msg_create(&hmsg_mgr, p_proc_object->hdev_obj, + status = msg_create(&hmsg_mgr, p_proc_object->dev_obj, (msg_onexit) node_on_exit); DBC_ASSERT(!status); - dev_set_msg_mgr(p_proc_object->hdev_obj, hmsg_mgr); + dev_set_msg_mgr(p_proc_object->dev_obj, hmsg_mgr); } } if (!status) { /* Set the Device object's message manager */ - status = dev_get_io_mgr(p_proc_object->hdev_obj, &hio_mgr); + status = dev_get_io_mgr(p_proc_object->dev_obj, &hio_mgr); if (hio_mgr) status = (*p_proc_object->intf_fxns->io_on_loaded) (hio_mgr); @@ -1242,7 +1242,7 @@ int proc_load(void *hprocessor, const s32 argc_index, #endif status = cod_load_base(cod_mgr, argc_index, (char **)user_args, dev_brd_write_fxn, - p_proc_object->hdev_obj, NULL); + p_proc_object->dev_obj, NULL); if (status) { if (status == -EBADF) { dev_dbg(bridge, "%s: Failure to Load the EXE\n", @@ -1263,7 +1263,7 @@ int proc_load(void *hprocessor, const s32 argc_index, if (!status) { /* Update the Processor status to loaded */ status = (*p_proc_object->intf_fxns->brd_set_state) - (p_proc_object->hbridge_context, BRD_LOADED); + (p_proc_object->bridge_context, BRD_LOADED); if (!status) { p_proc_object->proc_state = PROC_LOADED; if (p_proc_object->ntfy_obj) @@ -1283,7 +1283,7 @@ int proc_load(void *hprocessor, const s32 argc_index, /* Reset DMM structs and add an initial free chunk */ if (!status) { status = - dev_get_dmm_mgr(p_proc_object->hdev_obj, + dev_get_dmm_mgr(p_proc_object->dev_obj, &dmm_mgr); if (dmm_mgr) { /* Set dw_ext_end to DMM START u8 @@ -1305,7 +1305,7 @@ int proc_load(void *hprocessor, const s32 argc_index, user_args[0] = pargv0; if (!status) { if (!((*p_proc_object->intf_fxns->brd_status) - (p_proc_object->hbridge_context, &brd_state))) { + (p_proc_object->bridge_context, &brd_state))) { pr_info("%s: Processor Loaded %s\n", __func__, pargv0); kfree(drv_datap->base_img); drv_datap->base_img = kmalloc(strlen(pargv0) + 1, @@ -1398,7 +1398,7 @@ int proc_map(void *hprocessor, void *pmpu_addr, u32 ul_size, status = -ENOMEM; else status = (*p_proc_object->intf_fxns->brd_mem_map) - (p_proc_object->hbridge_context, pa_align, va_align, + (p_proc_object->bridge_context, pa_align, va_align, size_align, ul_map_attr, map_obj->pages); } if (!status) { @@ -1475,7 +1475,7 @@ int proc_register_notify(void *hprocessor, u32 event_mask, */ if ((event_mask == 0) && status) { status = - dev_get_deh_mgr(p_proc_object->hdev_obj, + dev_get_deh_mgr(p_proc_object->dev_obj, &hdeh_mgr); status = bridge_deh_register_notify(hdeh_mgr, @@ -1484,7 +1484,7 @@ int proc_register_notify(void *hprocessor, u32 event_mask, hnotification); } } else { - status = dev_get_deh_mgr(p_proc_object->hdev_obj, + status = dev_get_deh_mgr(p_proc_object->dev_obj, &hdeh_mgr); status = bridge_deh_register_notify(hdeh_mgr, @@ -1570,7 +1570,7 @@ int proc_start(void *hprocessor) status = -EBADR; goto func_end; } - status = dev_get_cod_mgr(p_proc_object->hdev_obj, &cod_mgr); + status = dev_get_cod_mgr(p_proc_object->dev_obj, &cod_mgr); if (!cod_mgr) { status = -EFAULT; goto func_cont; @@ -1581,12 +1581,12 @@ int proc_start(void *hprocessor) goto func_cont; status = (*p_proc_object->intf_fxns->brd_start) - (p_proc_object->hbridge_context, dw_dsp_addr); + (p_proc_object->bridge_context, dw_dsp_addr); if (status) goto func_cont; /* Call dev_create2 */ - status = dev_create2(p_proc_object->hdev_obj); + status = dev_create2(p_proc_object->dev_obj); if (!status) { p_proc_object->proc_state = PROC_RUNNING; /* Deep sleep switces off the peripheral clocks. @@ -1601,13 +1601,13 @@ int proc_start(void *hprocessor) /* Failed to Create Node Manager and DISP Object * Stop the Processor from running. Put it in STOPPED State */ (void)(*p_proc_object->intf_fxns-> - brd_stop) (p_proc_object->hbridge_context); + brd_stop) (p_proc_object->bridge_context); p_proc_object->proc_state = PROC_STOPPED; } func_cont: if (!status) { if (!((*p_proc_object->intf_fxns->brd_status) - (p_proc_object->hbridge_context, &brd_state))) { + (p_proc_object->bridge_context, &brd_state))) { pr_info("%s: dsp in running state\n", __func__); DBC_ASSERT(brd_state != BRD_HIBERNATION); } @@ -1645,7 +1645,7 @@ int proc_stop(void *hprocessor) goto func_end; } /* check if there are any running nodes */ - status = dev_get_node_manager(p_proc_object->hdev_obj, &hnode_mgr); + status = dev_get_node_manager(p_proc_object->dev_obj, &hnode_mgr); if (!status && hnode_mgr) { status = node_enum_nodes(hnode_mgr, &hnode, node_tab_size, &num_nodes, &nodes_allocated); @@ -1659,21 +1659,21 @@ int proc_stop(void *hprocessor) /* It is OK to stop a device that does n't have nodes OR not started */ status = (*p_proc_object->intf_fxns-> - brd_stop) (p_proc_object->hbridge_context); + brd_stop) (p_proc_object->bridge_context); if (!status) { dev_dbg(bridge, "%s: processor in standby mode\n", __func__); p_proc_object->proc_state = PROC_STOPPED; /* Destory the Node Manager, msg_ctrl Manager */ - if (!(dev_destroy2(p_proc_object->hdev_obj))) { + if (!(dev_destroy2(p_proc_object->dev_obj))) { /* Destroy the msg_ctrl by calling msg_delete */ - dev_get_msg_mgr(p_proc_object->hdev_obj, &hmsg_mgr); + dev_get_msg_mgr(p_proc_object->dev_obj, &hmsg_mgr); if (hmsg_mgr) { msg_delete(hmsg_mgr); - dev_set_msg_mgr(p_proc_object->hdev_obj, NULL); + dev_set_msg_mgr(p_proc_object->dev_obj, NULL); } if (!((*p_proc_object-> intf_fxns->brd_status) (p_proc_object-> - hbridge_context, + bridge_context, &brd_state))) DBC_ASSERT(brd_state == BRD_STOPPED); } @@ -1721,7 +1721,7 @@ int proc_un_map(void *hprocessor, void *map_addr, /* Remove mapping from the page tables. */ if (!status) { status = (*p_proc_object->intf_fxns->brd_mem_un_map) - (p_proc_object->hbridge_context, va_align, size_align); + (p_proc_object->bridge_context, va_align, size_align); } mutex_unlock(&proc_lock); @@ -1819,20 +1819,20 @@ static int proc_monitor(struct proc_object *proc_obj) /* This is needed only when Device is loaded when it is * already 'ACTIVE' */ /* Destory the Node Manager, msg_ctrl Manager */ - if (!dev_destroy2(proc_obj->hdev_obj)) { + if (!dev_destroy2(proc_obj->dev_obj)) { /* Destroy the msg_ctrl by calling msg_delete */ - dev_get_msg_mgr(proc_obj->hdev_obj, &hmsg_mgr); + dev_get_msg_mgr(proc_obj->dev_obj, &hmsg_mgr); if (hmsg_mgr) { msg_delete(hmsg_mgr); - dev_set_msg_mgr(proc_obj->hdev_obj, NULL); + dev_set_msg_mgr(proc_obj->dev_obj, NULL); } } /* Place the Board in the Monitor State */ if (!((*proc_obj->intf_fxns->brd_monitor) - (proc_obj->hbridge_context))) { + (proc_obj->bridge_context))) { status = 0; if (!((*proc_obj->intf_fxns->brd_status) - (proc_obj->hbridge_context, &brd_state))) + (proc_obj->bridge_context, &brd_state))) DBC_ASSERT(brd_state == BRD_IDLE); } @@ -1929,7 +1929,7 @@ int proc_notify_all_clients(void *proc, u32 events) goto func_end; } - dev_notify_clients(p_proc_object->hdev_obj, events); + dev_notify_clients(p_proc_object->dev_obj, events); func_end: return status; diff --git a/drivers/staging/tidspbridge/rmgr/rmm.c b/drivers/staging/tidspbridge/rmgr/rmm.c index 5d5feee..f3dc0dd 100644 --- a/drivers/staging/tidspbridge/rmgr/rmm.c +++ b/drivers/staging/tidspbridge/rmgr/rmm.c @@ -369,13 +369,13 @@ bool rmm_stat(struct rmm_target_obj *target, enum dsp_memtype segid, } /* ul_size */ - mem_stat_buf->ul_size = target->seg_tab[segid].length; + mem_stat_buf->size = target->seg_tab[segid].length; /* num_free_blocks */ mem_stat_buf->num_free_blocks = free_blocks; - /* ul_total_free_size */ - mem_stat_buf->ul_total_free_size = total_free_size; + /* total_free_size */ + mem_stat_buf->total_free_size = total_free_size; /* len_max_free_block */ mem_stat_buf->len_max_free_block = max_free_size; diff --git a/drivers/staging/tidspbridge/rmgr/strm.c b/drivers/staging/tidspbridge/rmgr/strm.c index a8e3fe5..9498b67 100644 --- a/drivers/staging/tidspbridge/rmgr/strm.c +++ b/drivers/staging/tidspbridge/rmgr/strm.c @@ -55,7 +55,7 @@ */ struct strm_mgr { struct dev_object *dev_obj; /* Device for this processor */ - struct chnl_mgr *hchnl_mgr; /* Channel manager */ + struct chnl_mgr *chnl_mgr; /* Channel manager */ /* Function interface to Bridge driver */ struct bridge_drv_interface *intf_fxns; }; @@ -213,7 +213,7 @@ int strm_create(struct strm_mgr **strm_man, /* Get Channel manager and Bridge function interface */ if (!status) { - status = dev_get_chnl_mgr(dev_obj, &(strm_mgr_obj->hchnl_mgr)); + status = dev_get_chnl_mgr(dev_obj, &(strm_mgr_obj->chnl_mgr)); if (!status) { (void)dev_get_intf_fxns(dev_obj, &(strm_mgr_obj->intf_fxns)); @@ -532,7 +532,7 @@ int strm_open(struct node_object *hnode, u32 dir, u32 index, if (status) goto func_cont; - if ((pattr->virt_base == NULL) || !(pattr->ul_virt_size > 0)) + if ((pattr->virt_base == NULL) || !(pattr->virt_size > 0)) goto func_cont; /* No System DMA */ @@ -547,7 +547,7 @@ int strm_open(struct node_object *hnode, u32 dir, u32 index, /* Set translators Virt Addr attributes */ status = cmm_xlator_info(strm_obj->xlator, (u8 **) &pattr->virt_base, - pattr->ul_virt_size, + pattr->virt_size, strm_obj->segment_id, true); } } @@ -558,7 +558,7 @@ func_cont: CHNL_MODETODSP : CHNL_MODEFROMDSP; intf_fxns = strm_mgr_obj->intf_fxns; status = (*intf_fxns->chnl_open) (&(strm_obj->chnl_obj), - strm_mgr_obj->hchnl_mgr, + strm_mgr_obj->chnl_mgr, chnl_mode, ul_chnl_id, &chnl_attr_obj); if (status) { @@ -572,7 +572,7 @@ func_cont: * We got a status that's not return-able. * Assert that we got something we were * expecting (-EFAULT isn't acceptable, - * strm_mgr_obj->hchnl_mgr better be valid or we + * strm_mgr_obj->chnl_mgr better be valid or we * assert here), and then return -EPERM. */ DBC_ASSERT(status == -ENOSR || -- cgit v0.10.2 From a534f17bd50834188b24e0a573c22c3285e7b1bb Mon Sep 17 00:00:00 2001 From: Rene Sapiens Date: Tue, 18 Jan 2011 03:19:11 +0000 Subject: staging: tidspbridge: set9 remove hungarian from structs hungarian notation will be removed from the elements inside structures, the next varibles will be renamed: Original: Replacement: hprocessor processor udma_priority dma_priority udsp_data_mau_size dsp_data_mau_size udsp_heap_addr dsp_heap_addr udsp_heap_res_addr dsp_heap_res_addr udsp_heap_virt_addr dsp_heap_virt_addr udsp_mau_size dsp_mau_size udsp_word_size dsp_word_size ugpp_heap_addr gpp_heap_addr ugpp_heap_virt_addr gpp_heap_virt_addr us_data2 data2 us_data3 data3 uc_data4 data4 uc_data5 data5 uc_data6 data6 us_load_type load_type usm_length sm_length utimeout timeout uwc_deadline wc_deadline uwc_execution_time wc_execution_time uwc_period wc_period Signed-off-by: Rene Sapiens Signed-off-by: Armando Uribe Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/gen/uuidutil.c b/drivers/staging/tidspbridge/gen/uuidutil.c index 2aa9b64..ff6ebad 100644 --- a/drivers/staging/tidspbridge/gen/uuidutil.c +++ b/drivers/staging/tidspbridge/gen/uuidutil.c @@ -45,11 +45,11 @@ void uuid_uuid_to_string(struct dsp_uuid *uuid_obj, char *sz_uuid, i = snprintf(sz_uuid, size, "%.8X_%.4X_%.4X_%.2X%.2X_%.2X%.2X%.2X%.2X%.2X%.2X", - uuid_obj->data1, uuid_obj->us_data2, uuid_obj->us_data3, - uuid_obj->uc_data4, uuid_obj->uc_data5, - uuid_obj->uc_data6[0], uuid_obj->uc_data6[1], - uuid_obj->uc_data6[2], uuid_obj->uc_data6[3], - uuid_obj->uc_data6[4], uuid_obj->uc_data6[5]); + uuid_obj->data1, uuid_obj->data2, uuid_obj->data3, + uuid_obj->data4, uuid_obj->data5, + uuid_obj->data6[0], uuid_obj->data6[1], + uuid_obj->data6[2], uuid_obj->data6[3], + uuid_obj->data6[4], uuid_obj->data6[5]); DBC_ENSURE(i != -1); } @@ -85,29 +85,29 @@ void uuid_uuid_from_string(char *sz_uuid, struct dsp_uuid *uuid_obj) /* Step over underscore */ sz_uuid++; - uuid_obj->us_data2 = (u16) uuid_hex_to_bin(sz_uuid, 4); + uuid_obj->data2 = (u16) uuid_hex_to_bin(sz_uuid, 4); sz_uuid += 4; /* Step over underscore */ sz_uuid++; - uuid_obj->us_data3 = (u16) uuid_hex_to_bin(sz_uuid, 4); + uuid_obj->data3 = (u16) uuid_hex_to_bin(sz_uuid, 4); sz_uuid += 4; /* Step over underscore */ sz_uuid++; - uuid_obj->uc_data4 = (u8) uuid_hex_to_bin(sz_uuid, 2); + uuid_obj->data4 = (u8) uuid_hex_to_bin(sz_uuid, 2); sz_uuid += 2; - uuid_obj->uc_data5 = (u8) uuid_hex_to_bin(sz_uuid, 2); + uuid_obj->data5 = (u8) uuid_hex_to_bin(sz_uuid, 2); sz_uuid += 2; /* Step over underscore */ sz_uuid++; for (j = 0; j < 6; j++) { - uuid_obj->uc_data6[j] = (u8) uuid_hex_to_bin(sz_uuid, 2); + uuid_obj->data6[j] = (u8) uuid_hex_to_bin(sz_uuid, 2); sz_uuid += 2; } } diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbdcddef.h b/drivers/staging/tidspbridge/include/dspbridge/dbdcddef.h index fc2a736..f97266c 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dbdcddef.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dbdcddef.h @@ -54,7 +54,7 @@ struct dcd_nodeprops { char *pstr_i_alg_name; /* Dynamic load properties */ - u16 us_load_type; /* Static, dynamic, overlay */ + u16 load_type; /* Static, dynamic, overlay */ u32 data_mem_seg_mask; /* Data memory requirements */ u32 code_mem_seg_mask; /* Code memory requirements */ }; diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h index 82e2439..592c16d 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h @@ -100,11 +100,11 @@ static inline bool is_valid_proc_event(u32 x) /* The Node UUID structure */ struct dsp_uuid { u32 data1; - u16 us_data2; - u16 us_data3; - u8 uc_data4; - u8 uc_data5; - u8 uc_data6[6]; + u16 data2; + u16 data3; + u8 data4; + u8 data5; + u8 data6[6]; }; /* DCD types */ @@ -229,11 +229,11 @@ struct dsp_strmattr { u32 buf_size; /* Buffer size (DSP words) */ u32 num_bufs; /* Number of buffers */ u32 buf_alignment; /* Buffer alignment */ - u32 utimeout; /* Timeout for blocking STRM calls */ + u32 timeout; /* Timeout for blocking STRM calls */ enum dsp_strmmode strm_mode; /* mode of stream when opened */ /* DMA chnl id if dsp_strmmode is LDMA or RDMA */ u32 udma_chnl_id; - u32 udma_priority; /* DMA channel priority 0=lowest, >0=high */ + u32 dma_priority; /* DMA channel priority 0=lowest, >0=high */ }; /* The dsp_cbdata structure */ @@ -255,9 +255,9 @@ struct dsp_resourcereqmts { u32 static_data_size; u32 global_data_size; u32 program_mem_size; - u32 uwc_execution_time; - u32 uwc_period; - u32 uwc_deadline; + u32 wc_execution_time; + u32 wc_period; + u32 wc_deadline; u32 avg_exection_time; u32 minimum_period; }; @@ -294,7 +294,7 @@ struct dsp_ndbprops { u32 message_depth; u32 num_input_streams; u32 num_output_streams; - u32 utimeout; + u32 timeout; u32 count_profiles; /* Number of supported profiles */ /* Array of profiles */ struct dsp_nodeprofs node_profiles[MAX_PROFILES]; @@ -306,7 +306,7 @@ struct dsp_ndbprops { struct dsp_nodeattrin { u32 cb_struct; s32 prio; - u32 utimeout; + u32 timeout; u32 profile_id; /* Reserved, for Bridge Internal use only */ u32 heap_size; @@ -347,7 +347,7 @@ struct dsp_notification { /* The dsp_processorattrin structure describes the attributes of a processor */ struct dsp_processorattrin { u32 cb_struct; - u32 utimeout; + u32 timeout; }; /* * The dsp_processorinfo structure describes basic capabilities of a @@ -401,13 +401,13 @@ struct dsp_resourceinfo { */ struct dsp_streamattrin { u32 cb_struct; - u32 utimeout; + u32 timeout; u32 segment_id; u32 buf_alignment; u32 num_bufs; enum dsp_strmmode strm_mode; u32 udma_chnl_id; - u32 udma_priority; + u32 dma_priority; }; /* The dsp_bufferattr structure describes the attributes of a data buffer */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/drv.h b/drivers/staging/tidspbridge/include/dspbridge/drv.h index bcb2817..3b98c1a 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/drv.h +++ b/drivers/staging/tidspbridge/include/dspbridge/drv.h @@ -129,7 +129,7 @@ struct process_context { enum gpp_proc_res_state res_state; /* Handle to Processor */ - void *hprocessor; + void *processor; /* DSP Node resources */ struct idr *node_id; diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h b/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h index ab20062..1511922 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h @@ -56,7 +56,7 @@ union trapped_args { struct dsp_notification __user *__user *anotifications; u32 count; u32 __user *pu_index; - u32 utimeout; + u32 timeout; } args_mgr_wait; /* PROC Module */ @@ -67,17 +67,17 @@ union trapped_args { } args_proc_attach; struct { - void *hprocessor; + void *processor; u32 cmd; struct dsp_cbdata __user *pargs; } args_proc_ctrl; struct { - void *hprocessor; + void *processor; } args_proc_detach; struct { - void *hprocessor; + void *processor; void *__user *node_tab; u32 node_tab_size; u32 __user *pu_num_nodes; @@ -85,53 +85,53 @@ union trapped_args { } args_proc_enumnode_info; struct { - void *hprocessor; + void *processor; u32 resource_type; struct dsp_resourceinfo *resource_info; u32 resource_info_size; } args_proc_enumresources; struct { - void *hprocessor; + void *processor; struct dsp_processorstate __user *proc_state_obj; u32 state_info_size; } args_proc_getstate; struct { - void *hprocessor; + void *processor; u8 __user *pbuf; u8 __user *psize; u32 max_size; } args_proc_gettrace; struct { - void *hprocessor; + void *processor; s32 argc_index; char __user *__user *user_args; char *__user *user_envp; } args_proc_load; struct { - void *hprocessor; + void *processor; u32 event_mask; u32 notify_type; struct dsp_notification __user *hnotification; } args_proc_register_notify; struct { - void *hprocessor; + void *processor; u32 size; void *__user *pp_rsv_addr; } args_proc_rsvmem; struct { - void *hprocessor; + void *processor; u32 size; void *prsv_addr; } args_proc_unrsvmem; struct { - void *hprocessor; + void *processor; void *pmpu_addr; u32 size; void *req_addr; @@ -140,34 +140,34 @@ union trapped_args { } args_proc_mapmem; struct { - void *hprocessor; + void *processor; u32 size; void *map_addr; } args_proc_unmapmem; struct { - void *hprocessor; + void *processor; void *pmpu_addr; u32 size; u32 dir; } args_proc_dma; struct { - void *hprocessor; + void *processor; void *pmpu_addr; u32 size; u32 ul_flags; } args_proc_flushmemory; struct { - void *hprocessor; + void *processor; void *pmpu_addr; u32 size; } args_proc_invalidatememory; /* NODE Module */ struct { - void *hprocessor; + void *processor; struct dsp_uuid __user *node_id_ptr; struct dsp_cbdata __user *pargs; struct dsp_nodeattrin __user *attr_in; @@ -218,7 +218,7 @@ union trapped_args { struct { void *hnode; struct dsp_msg __user *message; - u32 utimeout; + u32 timeout; } args_node_getmessage; struct { @@ -228,7 +228,7 @@ union trapped_args { struct { void *hnode; struct dsp_msg __user *message; - u32 utimeout; + u32 timeout; } args_node_putmessage; struct { @@ -248,7 +248,7 @@ union trapped_args { } args_node_terminate; struct { - void *hprocessor; + void *processor; struct dsp_uuid __user *node_id_ptr; struct dsp_ndbprops __user *node_props; } args_node_getuuidprops; @@ -323,7 +323,7 @@ union trapped_args { void *__user *stream_tab; u32 strm_num; u32 __user *pmask; - u32 utimeout; + u32 timeout; } args_strm_select; /* CMM Module */ @@ -341,7 +341,7 @@ union trapped_args { } args_cmm_freebuf; struct { - void *hprocessor; + void *processor; struct cmm_object *__user *ph_cmm_mgr; } args_cmm_gethandle; diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h b/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h index 7ba08ca..c2ba26c 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspdefs.h @@ -300,7 +300,7 @@ typedef int(*fxn_brd_write) (struct bridge_dev_context *dev_ctxt, * mgr_attrts->irq_shared: TRUE if the IRQ is shareable. * mgr_attrts->word_size: DSP Word size in equivalent PC bytes.. * mgr_attrts->shm_base: Base physical address of shared memory, if any. - * mgr_attrts->usm_length: Bytes of shared memory block. + * mgr_attrts->sm_length: Bytes of shared memory block. * Returns: * 0: Success; * -ENOMEM: Insufficient memory for requested resources. diff --git a/drivers/staging/tidspbridge/include/dspbridge/io.h b/drivers/staging/tidspbridge/include/dspbridge/io.h index 9615980..500bbd7 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/io.h +++ b/drivers/staging/tidspbridge/include/dspbridge/io.h @@ -31,7 +31,7 @@ struct io_attrs { bool irq_shared; /* TRUE if the IRQ is shareable. */ u32 word_size; /* DSP Word size. */ u32 shm_base; /* Physical base address of shared memory. */ - u32 usm_length; /* Size (in bytes) of shared memory. */ + u32 sm_length; /* Size (in bytes) of shared memory. */ }; diff --git a/drivers/staging/tidspbridge/include/dspbridge/nodepriv.h b/drivers/staging/tidspbridge/include/dspbridge/nodepriv.h index b14f79a..9c1e067 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/nodepriv.h +++ b/drivers/staging/tidspbridge/include/dspbridge/nodepriv.h @@ -43,7 +43,7 @@ struct node_strmdef { u32 buf_size; /* Size of buffers for SIO stream */ u32 num_bufs; /* max # of buffers in SIO stream at once */ u32 seg_id; /* Memory segment id to allocate buffers */ - u32 utimeout; /* Timeout for blocking SIO calls */ + u32 timeout; /* Timeout for blocking SIO calls */ u32 buf_alignment; /* Buffer alignment */ char *sz_device; /* Device name for stream */ }; @@ -55,10 +55,10 @@ struct node_taskargs { u32 stack_size; u32 sys_stack_size; u32 stack_seg; - u32 udsp_heap_res_addr; /* DSP virtual heap address */ - u32 udsp_heap_addr; /* DSP virtual heap address */ + u32 dsp_heap_res_addr; /* DSP virtual heap address */ + u32 dsp_heap_addr; /* DSP virtual heap address */ u32 heap_size; /* Heap size */ - u32 ugpp_heap_addr; /* GPP virtual heap address */ + u32 gpp_heap_addr; /* GPP virtual heap address */ u32 profile_id; /* Profile ID */ u32 num_inputs; u32 num_outputs; diff --git a/drivers/staging/tidspbridge/pmgr/dev.c b/drivers/staging/tidspbridge/pmgr/dev.c index ce7360f..d35b2ad 100644 --- a/drivers/staging/tidspbridge/pmgr/dev.c +++ b/drivers/staging/tidspbridge/pmgr/dev.c @@ -215,12 +215,12 @@ int dev_create_device(struct dev_object **device_obj, /* Assume last memory window is for CHNL */ io_mgr_attrs.shm_base = host_res->mem_base[1] + host_res->offset_for_monitor; - io_mgr_attrs.usm_length = + io_mgr_attrs.sm_length = host_res->mem_length[1] - host_res->offset_for_monitor; } else { io_mgr_attrs.shm_base = 0; - io_mgr_attrs.usm_length = 0; + io_mgr_attrs.sm_length = 0; pr_err("%s: No memory reserved for shared structures\n", __func__); } diff --git a/drivers/staging/tidspbridge/pmgr/dspapi.c b/drivers/staging/tidspbridge/pmgr/dspapi.c index b7ff378..912a1f9 100644 --- a/drivers/staging/tidspbridge/pmgr/dspapi.c +++ b/drivers/staging/tidspbridge/pmgr/dspapi.c @@ -569,7 +569,7 @@ u32 mgrwrap_wait_for_bridge_events(union trapped_args *args, void *pr_ctxt) status = mgr_wait_for_bridge_events(anotifications, count, &index, args->args_mgr_wait. - utimeout); + timeout); } CP_TO_USR(args->args_mgr_wait.pu_index, &index, status, 1); return status; @@ -620,7 +620,7 @@ u32 procwrap_ctrl(union trapped_args *args, void *pr_ctxt) args->args_proc_ctrl.pargs; u8 *pargs = NULL; int status = 0; - void *hprocessor = ((struct process_context *)pr_ctxt)->hprocessor; + void *hprocessor = ((struct process_context *)pr_ctxt)->processor; if (psize) { if (get_user(cb_data_size, psize)) { @@ -668,7 +668,7 @@ u32 procwrap_enum_node_info(union trapped_args *args, void *pr_ctxt) void *node_tab[MAX_NODES]; u32 num_nodes; u32 alloc_cnt; - void *hprocessor = ((struct process_context *)pr_ctxt)->hprocessor; + void *hprocessor = ((struct process_context *)pr_ctxt)->processor; if (!args->args_proc_enumnode_info.node_tab_size) return -EINVAL; @@ -753,7 +753,7 @@ u32 procwrap_enum_resources(union trapped_args *args, void *pr_ctxt) { int status = 0; struct dsp_resourceinfo resource_info; - void *hprocessor = ((struct process_context *)pr_ctxt)->hprocessor; + void *hprocessor = ((struct process_context *)pr_ctxt)->processor; if (args->args_proc_enumresources.resource_info_size < sizeof(struct dsp_resourceinfo)) @@ -780,7 +780,7 @@ u32 procwrap_get_state(union trapped_args *args, void *pr_ctxt) { int status; struct dsp_processorstate proc_state; - void *hprocessor = ((struct process_context *)pr_ctxt)->hprocessor; + void *hprocessor = ((struct process_context *)pr_ctxt)->processor; if (args->args_proc_getstate.state_info_size < sizeof(struct dsp_processorstate)) @@ -801,7 +801,7 @@ u32 procwrap_get_trace(union trapped_args *args, void *pr_ctxt) { int status; u8 *pbuf; - void *hprocessor = ((struct process_context *)pr_ctxt)->hprocessor; + void *hprocessor = ((struct process_context *)pr_ctxt)->processor; if (args->args_proc_gettrace.max_size > MAX_TRACEBUFLEN) return -EINVAL; @@ -830,7 +830,7 @@ u32 procwrap_load(union trapped_args *args, void *pr_ctxt) char *temp; s32 count = args->args_proc_load.argc_index; u8 **argv = NULL, **envp = NULL; - void *hprocessor = ((struct process_context *)pr_ctxt)->hprocessor; + void *hprocessor = ((struct process_context *)pr_ctxt)->processor; if (count <= 0 || count > MAX_LOADARGS) { status = -EINVAL; @@ -948,12 +948,12 @@ u32 procwrap_map(union trapped_args *args, void *pr_ctxt) { int status; void *map_addr; - void *hprocessor = ((struct process_context *)pr_ctxt)->hprocessor; + void *hprocessor = ((struct process_context *)pr_ctxt)->processor; if (!args->args_proc_mapmem.size) return -EINVAL; - status = proc_map(args->args_proc_mapmem.hprocessor, + status = proc_map(args->args_proc_mapmem.processor, args->args_proc_mapmem.pmpu_addr, args->args_proc_mapmem.size, args->args_proc_mapmem.req_addr, &map_addr, @@ -975,7 +975,7 @@ u32 procwrap_register_notify(union trapped_args *args, void *pr_ctxt) { int status; struct dsp_notification notification; - void *hprocessor = ((struct process_context *)pr_ctxt)->hprocessor; + void *hprocessor = ((struct process_context *)pr_ctxt)->processor; /* Initialize the notification data structure */ notification.ps_name = NULL; @@ -997,7 +997,7 @@ u32 procwrap_reserve_memory(union trapped_args *args, void *pr_ctxt) { int status; void *prsv_addr; - void *hprocessor = ((struct process_context *)pr_ctxt)->hprocessor; + void *hprocessor = ((struct process_context *)pr_ctxt)->processor; if ((args->args_proc_rsvmem.size <= 0) || (args->args_proc_rsvmem.size & (PG_SIZE4K - 1)) != 0) @@ -1010,7 +1010,7 @@ u32 procwrap_reserve_memory(union trapped_args *args, void *pr_ctxt) if (put_user(prsv_addr, args->args_proc_rsvmem.pp_rsv_addr)) { status = -EINVAL; proc_un_reserve_memory(args->args_proc_rsvmem. - hprocessor, prsv_addr, pr_ctxt); + processor, prsv_addr, pr_ctxt); } } return status; @@ -1023,7 +1023,7 @@ u32 procwrap_start(union trapped_args *args, void *pr_ctxt) { u32 ret; - ret = proc_start(((struct process_context *)pr_ctxt)->hprocessor); + ret = proc_start(((struct process_context *)pr_ctxt)->processor); return ret; } @@ -1034,7 +1034,7 @@ u32 procwrap_un_map(union trapped_args *args, void *pr_ctxt) { int status; - status = proc_un_map(((struct process_context *)pr_ctxt)->hprocessor, + status = proc_un_map(((struct process_context *)pr_ctxt)->processor, args->args_proc_unmapmem.map_addr, pr_ctxt); return status; } @@ -1045,7 +1045,7 @@ u32 procwrap_un_map(union trapped_args *args, void *pr_ctxt) u32 procwrap_un_reserve_memory(union trapped_args *args, void *pr_ctxt) { int status; - void *hprocessor = ((struct process_context *)pr_ctxt)->hprocessor; + void *hprocessor = ((struct process_context *)pr_ctxt)->processor; status = proc_un_reserve_memory(hprocessor, args->args_proc_unrsvmem.prsv_addr, @@ -1060,7 +1060,7 @@ u32 procwrap_stop(union trapped_args *args, void *pr_ctxt) { u32 ret; - ret = proc_stop(((struct process_context *)pr_ctxt)->hprocessor); + ret = proc_stop(((struct process_context *)pr_ctxt)->processor); return ret; } @@ -1092,7 +1092,7 @@ u32 nodewrap_allocate(union trapped_args *args, void *pr_ctxt) struct dsp_nodeattrin proc_attr_in, *attr_in = NULL; struct node_res_object *node_res; int nodeid; - void *hprocessor = ((struct process_context *)pr_ctxt)->hprocessor; + void *hprocessor = ((struct process_context *)pr_ctxt)->processor; /* Optional argument */ if (psize) { @@ -1378,7 +1378,7 @@ u32 nodewrap_get_message(union trapped_args *args, void *pr_ctxt) return -EFAULT; status = node_get_message(node_res->hnode, &msg, - args->args_node_getmessage.utimeout); + args->args_node_getmessage.timeout); CP_TO_USR(args->args_node_getmessage.message, &msg, status, 1); @@ -1422,7 +1422,7 @@ u32 nodewrap_put_message(union trapped_args *args, void *pr_ctxt) if (!status) { status = node_put_message(node_res->hnode, &msg, - args->args_node_putmessage.utimeout); + args->args_node_putmessage.timeout); } return status; @@ -1508,7 +1508,7 @@ u32 nodewrap_get_uuid_props(union trapped_args *args, void *pr_ctxt) int status = 0; struct dsp_uuid node_uuid; struct dsp_ndbprops *pnode_props = NULL; - void *hprocessor = ((struct process_context *)pr_ctxt)->hprocessor; + void *hprocessor = ((struct process_context *)pr_ctxt)->processor; CP_FM_USR(&node_uuid, args->args_node_getuuidprops.node_id_ptr, status, 1); @@ -1853,7 +1853,7 @@ u32 strmwrap_select(union trapped_args *args, void *pr_ctxt) if (!status) { status = strm_select(strm_tab, args->args_strm_select.strm_num, - &mask, args->args_strm_select.utimeout); + &mask, args->args_strm_select.timeout); } CP_TO_USR(args->args_strm_select.pmask, &mask, status, 1); return status; @@ -1888,7 +1888,7 @@ u32 cmmwrap_get_handle(union trapped_args *args, void *pr_ctxt) { int status = 0; struct cmm_object *hcmm_mgr; - void *hprocessor = ((struct process_context *)pr_ctxt)->hprocessor; + void *hprocessor = ((struct process_context *)pr_ctxt)->processor; status = cmm_get_handle(hprocessor, &hcmm_mgr); diff --git a/drivers/staging/tidspbridge/pmgr/io.c b/drivers/staging/tidspbridge/pmgr/io.c index b05a772..65245f3 100644 --- a/drivers/staging/tidspbridge/pmgr/io.c +++ b/drivers/staging/tidspbridge/pmgr/io.c @@ -57,7 +57,7 @@ int io_create(struct io_mgr **io_man, struct dev_object *hdev_obj, *io_man = NULL; /* A memory base of 0 implies no memory base: */ - if ((mgr_attrts->shm_base != 0) && (mgr_attrts->usm_length == 0)) + if ((mgr_attrts->shm_base != 0) && (mgr_attrts->sm_length == 0)) status = -EINVAL; if (mgr_attrts->word_size == 0) diff --git a/drivers/staging/tidspbridge/rmgr/dbdcd.c b/drivers/staging/tidspbridge/rmgr/dbdcd.c index 98b88b1..1e77c12 100644 --- a/drivers/staging/tidspbridge/rmgr/dbdcd.c +++ b/drivers/staging/tidspbridge/rmgr/dbdcd.c @@ -1112,14 +1112,14 @@ static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size, dsp_resource_reqmts.program_mem_size = atoi(token); token = strsep(&psz_cur, seps); gen_obj->obj_data.node_obj.ndb_props. - dsp_resource_reqmts.uwc_execution_time = atoi(token); + dsp_resource_reqmts.wc_execution_time = atoi(token); token = strsep(&psz_cur, seps); gen_obj->obj_data.node_obj.ndb_props. - dsp_resource_reqmts.uwc_period = atoi(token); + dsp_resource_reqmts.wc_period = atoi(token); token = strsep(&psz_cur, seps); gen_obj->obj_data.node_obj.ndb_props. - dsp_resource_reqmts.uwc_deadline = atoi(token); + dsp_resource_reqmts.wc_deadline = atoi(token); token = strsep(&psz_cur, seps); gen_obj->obj_data.node_obj.ndb_props. @@ -1162,8 +1162,8 @@ static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size, atoi(token); token = strsep(&psz_cur, seps); - /* u32 utimeout */ - gen_obj->obj_data.node_obj.ndb_props.utimeout = atoi(token); + /* u32 timeout */ + gen_obj->obj_data.node_obj.ndb_props.timeout = atoi(token); token = strsep(&psz_cur, seps); /* char *pstr_create_phase_fxn */ @@ -1221,7 +1221,7 @@ static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size, /* Load type (static, dynamic, or overlay) */ if (token) { - gen_obj->obj_data.node_obj.us_load_type = atoi(token); + gen_obj->obj_data.node_obj.load_type = atoi(token); token = strsep(&psz_cur, seps); } diff --git a/drivers/staging/tidspbridge/rmgr/disp.c b/drivers/staging/tidspbridge/rmgr/disp.c index e5af59e..d38ea2d 100644 --- a/drivers/staging/tidspbridge/rmgr/disp.c +++ b/drivers/staging/tidspbridge/rmgr/disp.c @@ -402,7 +402,7 @@ int disp_node_create(struct disp_object *disp_obj, more_task_args->sysstack_size = task_arg_obj.sys_stack_size; more_task_args->stack_seg = task_arg_obj.stack_seg; - more_task_args->heap_addr = task_arg_obj.udsp_heap_addr; + more_task_args->heap_addr = task_arg_obj.dsp_heap_addr; more_task_args->heap_size = task_arg_obj.heap_size; more_task_args->misc = task_arg_obj.dais_arg; more_task_args->num_input_streams = @@ -410,8 +410,8 @@ int disp_node_create(struct disp_object *disp_obj, total += sizeof(struct rms_more_task_args) / sizeof(rms_word); - dev_dbg(bridge, "%s: udsp_heap_addr %x, heap_size %x\n", - __func__, task_arg_obj.udsp_heap_addr, + dev_dbg(bridge, "%s: dsp_heap_addr %x, heap_size %x\n", + __func__, task_arg_obj.dsp_heap_addr, task_arg_obj.heap_size); /* Keep track of pSIOInDef[] and pSIOOutDef[] * positions in the buffer, since this needs to be @@ -611,7 +611,7 @@ static int fill_stream_def(rms_word *pdw_buf, u32 *ptotal, u32 offset, strm_def_obj->nbufs = strm_def.num_bufs; strm_def_obj->segid = strm_def.seg_id; strm_def_obj->align = strm_def.buf_alignment; - strm_def_obj->timeout = strm_def.utimeout; + strm_def_obj->timeout = strm_def.timeout; } if (!status) { diff --git a/drivers/staging/tidspbridge/rmgr/drv.c b/drivers/staging/tidspbridge/rmgr/drv.c index 9aacbcb..ce5f398 100644 --- a/drivers/staging/tidspbridge/rmgr/drv.c +++ b/drivers/staging/tidspbridge/rmgr/drv.c @@ -148,7 +148,7 @@ int drv_remove_all_dmm_res_elements(void *process_ctxt) /* Free DMM mapped memory resources */ list_for_each_entry_safe(map_obj, temp_map, &ctxt->dmm_map_list, link) { - status = proc_un_map(ctxt->hprocessor, + status = proc_un_map(ctxt->processor, (void *)map_obj->dsp_addr, ctxt); if (status) pr_err("%s: proc_un_map failed!" @@ -157,7 +157,7 @@ int drv_remove_all_dmm_res_elements(void *process_ctxt) /* Free DMM reserved memory resources */ list_for_each_entry_safe(rsv_obj, temp_rsv, &ctxt->dmm_rsv_list, link) { - status = proc_un_reserve_memory(ctxt->hprocessor, (void *) + status = proc_un_reserve_memory(ctxt->processor, (void *) rsv_obj->dsp_reserved_addr, ctxt); if (status) diff --git a/drivers/staging/tidspbridge/rmgr/nldr.c b/drivers/staging/tidspbridge/rmgr/nldr.c index 7a15f63..e711970 100644 --- a/drivers/staging/tidspbridge/rmgr/nldr.c +++ b/drivers/staging/tidspbridge/rmgr/nldr.c @@ -336,7 +336,7 @@ int nldr_allocate(struct nldr_object *nldr_obj, void *priv_ref, * Determine if node is a dynamically loaded node from * ndb_props. */ - if (node_props->us_load_type == NLDR_DYNAMICLOAD) { + if (node_props->load_type == NLDR_DYNAMICLOAD) { /* Dynamic node */ nldr_node_obj->dynamic = true; /* @@ -388,7 +388,7 @@ int nldr_allocate(struct nldr_object *nldr_obj, void *priv_ref, * base image */ nldr_node_obj->root.lib = nldr_obj->base_lib; /* Check for overlay node */ - if (node_props->us_load_type == NLDR_OVLYLOAD) + if (node_props->load_type == NLDR_OVLYLOAD) nldr_node_obj->overlay = true; } @@ -1011,7 +1011,7 @@ static int add_ovly_node(struct dsp_uuid *uuid_obj, goto func_end; /* If overlay node, add to the list */ - if (obj_def.obj_data.node_obj.us_load_type == NLDR_OVLYLOAD) { + if (obj_def.obj_data.node_obj.load_type == NLDR_OVLYLOAD) { if (nldr_obj->ovly_table == NULL) { nldr_obj->ovly_nodes++; } else { diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c index 2bfbd16..c627560 100644 --- a/drivers/staging/tidspbridge/rmgr/node.c +++ b/drivers/staging/tidspbridge/rmgr/node.c @@ -151,9 +151,9 @@ struct node_mgr { u32 chnl_buf_size; /* Buffer size for data to RMS */ int proc_family; /* eg, 5000 */ int proc_type; /* eg, 5510 */ - u32 udsp_word_size; /* Size of DSP word on host bytes */ - u32 udsp_data_mau_size; /* Size of DSP data MAU */ - u32 udsp_mau_size; /* Size of MAU */ + u32 dsp_word_size; /* Size of DSP word on host bytes */ + u32 dsp_data_mau_size; /* Size of DSP data MAU */ + u32 dsp_mau_size; /* Size of MAU */ s32 min_pri; /* Minimum runtime priority for node */ s32 max_pri; /* Maximum runtime priority for node */ @@ -189,13 +189,13 @@ struct stream_chnl { struct node_object { struct list_head list_elem; struct node_mgr *node_mgr; /* The manager of this node */ - struct proc_object *hprocessor; /* Back pointer to processor */ + struct proc_object *processor; /* Back pointer to processor */ struct dsp_uuid node_uuid; /* Node's ID */ s32 prio; /* Node's current priority */ - u32 utimeout; /* Timeout for blocking NODE calls */ + u32 timeout; /* Timeout for blocking NODE calls */ u32 heap_size; /* Heap Size */ - u32 udsp_heap_virt_addr; /* Heap Size */ - u32 ugpp_heap_virt_addr; /* Heap Size */ + u32 dsp_heap_virt_addr; /* Heap Size */ + u32 gpp_heap_virt_addr; /* Heap Size */ enum node_type ntype; /* Type of node: message, task, etc */ enum node_state node_state; /* NODE_ALLOCATED, NODE_CREATED, ... */ u32 num_inputs; /* Current number of inputs */ @@ -400,17 +400,17 @@ int node_allocate(struct proc_object *hprocessor, goto func_cont; pnode->node_uuid = *node_uuid; - pnode->hprocessor = hprocessor; + pnode->processor = hprocessor; pnode->ntype = pnode->dcd_props.obj_data.node_obj.ndb_props.ntype; - pnode->utimeout = pnode->dcd_props.obj_data.node_obj.ndb_props.utimeout; + pnode->timeout = pnode->dcd_props.obj_data.node_obj.ndb_props.timeout; pnode->prio = pnode->dcd_props.obj_data.node_obj.ndb_props.prio; /* Currently only C64 DSP builds support Node Dynamic * heaps */ /* Allocate memory for node heap */ pnode->create_args.asa.task_arg_obj.heap_size = 0; - pnode->create_args.asa.task_arg_obj.udsp_heap_addr = 0; - pnode->create_args.asa.task_arg_obj.udsp_heap_res_addr = 0; - pnode->create_args.asa.task_arg_obj.ugpp_heap_addr = 0; + pnode->create_args.asa.task_arg_obj.dsp_heap_addr = 0; + pnode->create_args.asa.task_arg_obj.dsp_heap_res_addr = 0; + pnode->create_args.asa.task_arg_obj.gpp_heap_addr = 0; if (!attr_in) goto func_cont; @@ -426,7 +426,7 @@ int node_allocate(struct proc_object *hprocessor, } else { pnode->create_args.asa.task_arg_obj.heap_size = attr_in->heap_size; - pnode->create_args.asa.task_arg_obj.ugpp_heap_addr = + pnode->create_args.asa.task_arg_obj.gpp_heap_addr = (u32) attr_in->pgpp_virt_addr; } if (status) @@ -436,7 +436,7 @@ int node_allocate(struct proc_object *hprocessor, pnode->create_args.asa.task_arg_obj. heap_size + PAGE_SIZE, (void **)&(pnode->create_args.asa. - task_arg_obj.udsp_heap_res_addr), + task_arg_obj.dsp_heap_res_addr), pr_ctxt); if (status) { pr_err("%s: Failed to reserve memory for heap: 0x%x\n", @@ -459,20 +459,20 @@ int node_allocate(struct proc_object *hprocessor, status = proc_map(hprocessor, (void *)attr_in->pgpp_virt_addr, pnode->create_args.asa.task_arg_obj.heap_size, (void *)pnode->create_args.asa.task_arg_obj. - udsp_heap_res_addr, (void **)&mapped_addr, map_attrs, + dsp_heap_res_addr, (void **)&mapped_addr, map_attrs, pr_ctxt); if (status) pr_err("%s: Failed to map memory for Heap: 0x%x\n", __func__, status); else - pnode->create_args.asa.task_arg_obj.udsp_heap_addr = + pnode->create_args.asa.task_arg_obj.dsp_heap_addr = (u32) mapped_addr; func_cont: mutex_unlock(&hnode_mgr->node_mgr_lock); if (attr_in != NULL) { /* Overrides of NBD properties */ - pnode->utimeout = attr_in->utimeout; + pnode->timeout = attr_in->timeout; pnode->prio = attr_in->prio; } /* Create object to manage notifications */ @@ -712,7 +712,7 @@ DBAPI node_alloc_msg_buf(struct node_object *hnode, u32 usize, if (pattr == NULL) pattr = &node_dfltbufattrs; /* set defaults */ - status = proc_get_processor_id(pnode->hprocessor, &proc_id); + status = proc_get_processor_id(pnode->processor, &proc_id); if (proc_id != DSP_UNIT) { DBC_ASSERT(NULL); goto func_end; @@ -808,7 +808,7 @@ int node_change_priority(struct node_object *hnode, s32 prio) status = -EBADR; goto func_cont; } - status = proc_get_processor_id(pnode->hprocessor, &proc_id); + status = proc_get_processor_id(pnode->processor, &proc_id); if (proc_id == DSP_UNIT) { status = disp_node_change_priority(hnode_mgr->disp_obj, @@ -1144,7 +1144,7 @@ int node_create(struct node_object *hnode) status = -EFAULT; goto func_end; } - hprocessor = hnode->hprocessor; + hprocessor = hnode->processor; status = proc_get_state(hprocessor, &proc_state, sizeof(struct dsp_processorstate)); if (status) @@ -1168,7 +1168,7 @@ int node_create(struct node_object *hnode) status = -EBADR; if (!status) - status = proc_get_processor_id(pnode->hprocessor, &proc_id); + status = proc_get_processor_id(pnode->processor, &proc_id); if (status) goto func_cont2; @@ -1266,7 +1266,7 @@ func_cont: mutex_unlock(&hnode_mgr->node_mgr_lock); func_end: if (status >= 0) { - proc_notify_clients(hnode->hprocessor, DSP_NODESTATECHANGE); + proc_notify_clients(hnode->processor, DSP_NODESTATECHANGE); ntfy_notify(hnode->ntfy_obj, DSP_NODESTATECHANGE); } @@ -1364,8 +1364,8 @@ int node_create_mgr(struct node_mgr **node_man, nldr_attrs_obj.ovly = ovly; nldr_attrs_obj.write = mem_write; - nldr_attrs_obj.dsp_word_size = node_mgr_obj->udsp_word_size; - nldr_attrs_obj.dsp_mau_size = node_mgr_obj->udsp_mau_size; + nldr_attrs_obj.dsp_word_size = node_mgr_obj->dsp_word_size; + nldr_attrs_obj.dsp_mau_size = node_mgr_obj->dsp_mau_size; node_mgr_obj->loader_init = node_mgr_obj->nldr_fxns.init(); status = node_mgr_obj->nldr_fxns.create(&node_mgr_obj->nldr_obj, hdev_obj, @@ -1418,7 +1418,7 @@ int node_delete(struct node_res_object *noderes, /* create struct dsp_cbdata struct for PWR call */ cb_data.cb_data = PWR_TIMEOUT; hnode_mgr = pnode->node_mgr; - hprocessor = pnode->hprocessor; + hprocessor = pnode->processor; disp_obj = hnode_mgr->disp_obj; node_type = node_get_type(pnode); intf_fxns = hnode_mgr->intf_fxns; @@ -1433,7 +1433,7 @@ int node_delete(struct node_res_object *noderes, * code must be executed. */ if (!(state == NODE_ALLOCATED && pnode->node_env == (u32) NULL) && node_type != NODE_DEVICE) { - status = proc_get_processor_id(pnode->hprocessor, &proc_id); + status = proc_get_processor_id(pnode->processor, &proc_id); if (status) goto func_cont1; @@ -1638,7 +1638,7 @@ int node_free_msg_buf(struct node_object *hnode, u8 * pbuffer, status = -EFAULT; goto func_end; } - status = proc_get_processor_id(pnode->hprocessor, &proc_id); + status = proc_get_processor_id(pnode->processor, &proc_id); if (proc_id == DSP_UNIT) { if (!status) { if (pattr == NULL) { @@ -1686,11 +1686,11 @@ int node_get_attr(struct node_object *hnode, pattr->in_node_attr_in.cb_struct = sizeof(struct dsp_nodeattrin); pattr->in_node_attr_in.prio = hnode->prio; - pattr->in_node_attr_in.utimeout = hnode->utimeout; + pattr->in_node_attr_in.timeout = hnode->timeout; pattr->in_node_attr_in.heap_size = hnode->create_args.asa.task_arg_obj.heap_size; pattr->in_node_attr_in.pgpp_virt_addr = (void *) - hnode->create_args.asa.task_arg_obj.ugpp_heap_addr; + hnode->create_args.asa.task_arg_obj.gpp_heap_addr; pattr->node_attr_inputs = hnode->num_gpp_inputs; pattr->node_attr_outputs = hnode->num_gpp_outputs; /* dsp_nodeinfo */ @@ -1768,7 +1768,7 @@ int node_get_message(struct node_object *hnode, status = -EFAULT; goto func_end; } - hprocessor = hnode->hprocessor; + hprocessor = hnode->processor; status = proc_get_state(hprocessor, &proc_state, sizeof(struct dsp_processorstate)); if (status) @@ -1802,7 +1802,7 @@ int node_get_message(struct node_object *hnode, tmp_buf = cmm_xlator_translate(hnode->xlator, (void *)(message->arg1 * hnode->node_mgr-> - udsp_word_size), CMM_DSPPA2PA); + dsp_word_size), CMM_DSPPA2PA); if (tmp_buf != NULL) { /* now convert this GPP Pa to Va */ tmp_buf = cmm_xlator_translate(hnode->xlator, tmp_buf, @@ -1810,7 +1810,7 @@ int node_get_message(struct node_object *hnode, if (tmp_buf != NULL) { /* Adjust SM size in msg */ message->arg1 = (u32) tmp_buf; - message->arg2 *= hnode->node_mgr->udsp_word_size; + message->arg2 *= hnode->node_mgr->dsp_word_size; } else { status = -ESRCH; } @@ -1873,7 +1873,7 @@ enum nldr_loadtype node_get_load_type(struct node_object *hnode) dev_dbg(bridge, "%s: Failed. hnode: %p\n", __func__, hnode); return -1; } else { - return hnode->dcd_props.obj_data.node_obj.us_load_type; + return hnode->dcd_props.obj_data.node_obj.load_type; } } @@ -1890,7 +1890,7 @@ u32 node_get_timeout(struct node_object *hnode) dev_dbg(bridge, "%s: failed. hnode: %p\n", __func__, hnode); return 0; } else { - return hnode->utimeout; + return hnode->timeout; } } @@ -1950,7 +1950,7 @@ void node_on_exit(struct node_object *hnode, s32 node_status) /* Unblock call to node_terminate */ (void)sync_set_event(hnode->sync_done); /* Notify clients */ - proc_notify_clients(hnode->hprocessor, DSP_NODESTATECHANGE); + proc_notify_clients(hnode->processor, DSP_NODESTATECHANGE); ntfy_notify(hnode->ntfy_obj, DSP_NODESTATECHANGE); } @@ -1982,7 +1982,7 @@ int node_pause(struct node_object *hnode) if (status) goto func_end; - status = proc_get_processor_id(pnode->hprocessor, &proc_id); + status = proc_get_processor_id(pnode->processor, &proc_id); if (proc_id == IVA_UNIT) status = -ENOSYS; @@ -1999,7 +1999,7 @@ int node_pause(struct node_object *hnode) if (status) goto func_cont; - hprocessor = hnode->hprocessor; + hprocessor = hnode->processor; status = proc_get_state(hprocessor, &proc_state, sizeof(struct dsp_processorstate)); if (status) @@ -2024,7 +2024,7 @@ func_cont: /* Leave critical section */ mutex_unlock(&hnode_mgr->node_mgr_lock); if (status >= 0) { - proc_notify_clients(hnode->hprocessor, + proc_notify_clients(hnode->processor, DSP_NODESTATECHANGE); ntfy_notify(hnode->ntfy_obj, DSP_NODESTATECHANGE); } @@ -2061,7 +2061,7 @@ int node_put_message(struct node_object *hnode, status = -EFAULT; goto func_end; } - hprocessor = hnode->hprocessor; + hprocessor = hnode->processor; status = proc_get_state(hprocessor, &proc_state, sizeof(struct dsp_processorstate)); if (status) @@ -2107,15 +2107,15 @@ int node_put_message(struct node_object *hnode, CMM_VA2DSPPA); if (tmp_buf != NULL) { /* got translation, convert to MAUs in msg */ - if (hnode->node_mgr->udsp_word_size != 0) { + if (hnode->node_mgr->dsp_word_size != 0) { new_msg.arg1 = (u32) tmp_buf / - hnode->node_mgr->udsp_word_size; + hnode->node_mgr->dsp_word_size; /* MAUs */ new_msg.arg2 /= hnode->node_mgr-> - udsp_word_size; + dsp_word_size; } else { - pr_err("%s: udsp_word_size is zero!\n", + pr_err("%s: dsp_word_size is zero!\n", __func__); status = -EPERM; /* bad DSPWordSize */ } @@ -2213,7 +2213,7 @@ int node_run(struct node_object *hnode) status = -EFAULT; goto func_end; } - hprocessor = hnode->hprocessor; + hprocessor = hnode->processor; status = proc_get_state(hprocessor, &proc_state, sizeof(struct dsp_processorstate)); if (status) @@ -2243,7 +2243,7 @@ int node_run(struct node_object *hnode) status = -EBADR; if (!status) - status = proc_get_processor_id(pnode->hprocessor, &proc_id); + status = proc_get_processor_id(pnode->processor, &proc_id); if (status) goto func_cont1; @@ -2299,7 +2299,7 @@ func_cont1: /* Exit critical section */ mutex_unlock(&hnode_mgr->node_mgr_lock); if (status >= 0) { - proc_notify_clients(hnode->hprocessor, DSP_NODESTATECHANGE); + proc_notify_clients(hnode->processor, DSP_NODESTATECHANGE); ntfy_notify(hnode->ntfy_obj, DSP_NODESTATECHANGE); } func_end: @@ -2333,11 +2333,11 @@ int node_terminate(struct node_object *hnode, int *pstatus) status = -EFAULT; goto func_end; } - if (pnode->hprocessor == NULL) { + if (pnode->processor == NULL) { status = -EFAULT; goto func_end; } - status = proc_get_processor_id(pnode->hprocessor, &proc_id); + status = proc_get_processor_id(pnode->processor, &proc_id); if (!status) { hnode_mgr = hnode->node_mgr; @@ -2367,7 +2367,7 @@ int node_terminate(struct node_object *hnode, int *pstatus) * Send exit message. Do not change state to NODE_DONE * here. That will be done in callback. */ - status = proc_get_state(pnode->hprocessor, &proc_state, + status = proc_get_state(pnode->processor, &proc_state, sizeof(struct dsp_processorstate)); if (status) goto func_cont; @@ -2384,13 +2384,13 @@ int node_terminate(struct node_object *hnode, int *pstatus) killmsg.arg1 = hnode->node_env; intf_fxns = hnode_mgr->intf_fxns; - if (hnode->utimeout > MAXTIMEOUT) + if (hnode->timeout > MAXTIMEOUT) kill_time_out = MAXTIMEOUT; else - kill_time_out = (hnode->utimeout) * 2; + kill_time_out = (hnode->timeout) * 2; status = (*intf_fxns->msg_put) (hnode->msg_queue_obj, &msg, - hnode->utimeout); + hnode->timeout); if (status) goto func_cont; @@ -2406,7 +2406,7 @@ int node_terminate(struct node_object *hnode, int *pstatus) goto func_cont; status = (*intf_fxns->msg_put)(hnode->msg_queue_obj, - &killmsg, hnode->utimeout); + &killmsg, hnode->timeout); if (status) goto func_cont; status = sync_wait_on_event(hnode->sync_done, @@ -2460,7 +2460,7 @@ static void delete_node(struct node_object *hnode, #ifdef DSP_DMM_DEBUG struct dmm_object *dmm_mgr; struct proc_object *p_proc_object = - (struct proc_object *)hnode->hprocessor; + (struct proc_object *)hnode->processor; #endif int status; if (!hnode) @@ -2518,15 +2518,15 @@ static void delete_node(struct node_object *hnode, kfree(task_arg_obj.strm_out_def); task_arg_obj.strm_out_def = NULL; } - if (task_arg_obj.udsp_heap_res_addr) { - status = proc_un_map(hnode->hprocessor, (void *) - task_arg_obj.udsp_heap_addr, + if (task_arg_obj.dsp_heap_res_addr) { + status = proc_un_map(hnode->processor, (void *) + task_arg_obj.dsp_heap_addr, pr_ctxt); - status = proc_un_reserve_memory(hnode->hprocessor, + status = proc_un_reserve_memory(hnode->processor, (void *) task_arg_obj. - udsp_heap_res_addr, + dsp_heap_res_addr, pr_ctxt); #ifdef DSP_DMM_DEBUG status = dmm_get_handle(p_proc_object, &dmm_mgr); @@ -2691,17 +2691,17 @@ static void fill_stream_def(struct node_object *hnode, if (pattrs != NULL) { pstrm_def->num_bufs = pattrs->num_bufs; pstrm_def->buf_size = - pattrs->buf_size / hnode_mgr->udsp_data_mau_size; + pattrs->buf_size / hnode_mgr->dsp_data_mau_size; pstrm_def->seg_id = pattrs->seg_id; pstrm_def->buf_alignment = pattrs->buf_alignment; - pstrm_def->utimeout = pattrs->utimeout; + pstrm_def->timeout = pattrs->timeout; } else { pstrm_def->num_bufs = DEFAULTNBUFS; pstrm_def->buf_size = - DEFAULTBUFSIZE / hnode_mgr->udsp_data_mau_size; + DEFAULTBUFSIZE / hnode_mgr->dsp_data_mau_size; pstrm_def->seg_id = DEFAULTSEGID; pstrm_def->buf_alignment = DEFAULTALIGNMENT; - pstrm_def->utimeout = DEFAULTTIMEOUT; + pstrm_def->timeout = DEFAULTTIMEOUT; } } @@ -2915,9 +2915,9 @@ static int get_proc_props(struct node_mgr *hnode_mgr, hnode_mgr->proc_type = 6410; hnode_mgr->min_pri = DSP_NODE_MIN_PRIORITY; hnode_mgr->max_pri = DSP_NODE_MAX_PRIORITY; - hnode_mgr->udsp_word_size = DSPWORDSIZE; - hnode_mgr->udsp_data_mau_size = DSPWORDSIZE; - hnode_mgr->udsp_mau_size = 1; + hnode_mgr->dsp_word_size = DSPWORDSIZE; + hnode_mgr->dsp_data_mau_size = DSPWORDSIZE; + hnode_mgr->dsp_mau_size = 1; } return status; @@ -3067,8 +3067,8 @@ static u32 ovly(void *priv_ref, u32 dsp_run_addr, u32 dsp_load_addr, hnode_mgr = hnode->node_mgr; - ul_size = ul_num_bytes / hnode_mgr->udsp_word_size; - ul_timeout = hnode->utimeout; + ul_size = ul_num_bytes / hnode_mgr->dsp_word_size; + ul_timeout = hnode->timeout; /* Call new MemCopy function */ intf_fxns = hnode_mgr->intf_fxns; @@ -3111,7 +3111,7 @@ static u32 mem_write(void *priv_ref, u32 dsp_add, void *pbuf, hnode_mgr = hnode->node_mgr; - ul_timeout = hnode->utimeout; + ul_timeout = hnode->timeout; mem_sect_type = (mem_space & DBLL_CODE) ? RMS_CODE : RMS_DATA; /* Call new MemWrite function */ diff --git a/drivers/staging/tidspbridge/rmgr/proc.c b/drivers/staging/tidspbridge/rmgr/proc.c index fddbcea..54f6133 100644 --- a/drivers/staging/tidspbridge/rmgr/proc.c +++ b/drivers/staging/tidspbridge/rmgr/proc.c @@ -85,7 +85,7 @@ struct proc_object { struct mgr_object *mgr_obj; /* Manager Object Handle */ u32 attach_count; /* Processor attach count */ u32 processor_id; /* Processor number */ - u32 utimeout; /* Time out count */ + u32 timeout; /* Time out count */ enum dsp_procstate proc_state; /* Processor state */ u32 unit; /* DDSP unit number */ bool is_already_attached; /* @@ -284,8 +284,8 @@ proc_attach(u32 processor_id, DBC_REQUIRE(refs > 0); DBC_REQUIRE(ph_processor != NULL); - if (pr_ctxt->hprocessor) { - *ph_processor = pr_ctxt->hprocessor; + if (pr_ctxt->processor) { + *ph_processor = pr_ctxt->processor; return status; } @@ -324,9 +324,9 @@ proc_attach(u32 processor_id, INIT_LIST_HEAD(&p_proc_object->proc_list); if (attr_in) - p_proc_object->utimeout = attr_in->utimeout; + p_proc_object->timeout = attr_in->timeout; else - p_proc_object->utimeout = PROC_DFLT_TIMEOUT; + p_proc_object->timeout = PROC_DFLT_TIMEOUT; status = dev_get_intf_fxns(hdev_obj, &p_proc_object->intf_fxns); if (!status) { @@ -373,7 +373,7 @@ proc_attach(u32 processor_id, } if (!status) { *ph_processor = (void *)p_proc_object; - pr_ctxt->hprocessor = *ph_processor; + pr_ctxt->processor = *ph_processor; (void)proc_notify_clients(p_proc_object, DSP_PROCESSORATTACH); } @@ -567,7 +567,7 @@ int proc_detach(struct process_context *pr_ctxt) DBC_REQUIRE(refs > 0); - p_proc_object = (struct proc_object *)pr_ctxt->hprocessor; + p_proc_object = (struct proc_object *)pr_ctxt->processor; if (p_proc_object) { /* Notify the Client */ @@ -585,7 +585,7 @@ int proc_detach(struct process_context *pr_ctxt) (u32) p_proc_object); /* Free the Processor Object */ kfree(p_proc_object); - pr_ctxt->hprocessor = NULL; + pr_ctxt->processor = NULL; } else { status = -EFAULT; } diff --git a/drivers/staging/tidspbridge/rmgr/strm.c b/drivers/staging/tidspbridge/rmgr/strm.c index 9498b67..cc7370c 100644 --- a/drivers/staging/tidspbridge/rmgr/strm.c +++ b/drivers/staging/tidspbridge/rmgr/strm.c @@ -68,7 +68,7 @@ struct strm_object { struct strm_mgr *strm_mgr_obj; struct chnl_object *chnl_obj; u32 dir; /* DSP_TONODE or DSP_FROMNODE */ - u32 utimeout; + u32 timeout; u32 num_bufs; /* Max # of bufs allowed in stream */ u32 un_bufs_in_strm; /* Current # of bufs in stream */ u32 bytes; /* bytes transferred since idled */ @@ -77,7 +77,7 @@ struct strm_object { void *user_event; /* Saved for strm_get_info() */ enum dsp_strmmode strm_mode; /* STRMMODE_[PROCCOPY][ZEROCOPY]... */ u32 udma_chnl_id; /* DMA chnl id */ - u32 udma_priority; /* DMA priority:DMAPRI_[LOW][HIGH] */ + u32 dma_priority; /* DMA priority:DMAPRI_[LOW][HIGH] */ u32 segment_id; /* >0 is SM segment.=0 is local heap */ u32 buf_alignment; /* Alignment for stream bufs */ /* Stream's SM address translator */ @@ -378,7 +378,7 @@ int strm_idle(struct strm_object *stream_obj, bool flush_data) intf_fxns = stream_obj->strm_mgr_obj->intf_fxns; status = (*intf_fxns->chnl_idle) (stream_obj->chnl_obj, - stream_obj->utimeout, + stream_obj->timeout, flush_data); } @@ -494,8 +494,8 @@ int strm_open(struct node_object *hnode, u32 dir, u32 index, strm_obj->strm_state = STREAM_IDLE; strm_obj->user_event = pattr->user_event; if (pattr->stream_attr_in != NULL) { - strm_obj->utimeout = - pattr->stream_attr_in->utimeout; + strm_obj->timeout = + pattr->stream_attr_in->timeout; strm_obj->num_bufs = pattr->stream_attr_in->num_bufs; strm_obj->strm_mode = @@ -506,23 +506,23 @@ int strm_open(struct node_object *hnode, u32 dir, u32 index, pattr->stream_attr_in->buf_alignment; strm_obj->udma_chnl_id = pattr->stream_attr_in->udma_chnl_id; - strm_obj->udma_priority = - pattr->stream_attr_in->udma_priority; + strm_obj->dma_priority = + pattr->stream_attr_in->dma_priority; chnl_attr_obj.uio_reqs = pattr->stream_attr_in->num_bufs; } else { - strm_obj->utimeout = DEFAULTTIMEOUT; + strm_obj->timeout = DEFAULTTIMEOUT; strm_obj->num_bufs = DEFAULTNUMBUFS; strm_obj->strm_mode = STRMMODE_PROCCOPY; strm_obj->segment_id = 0; /* local mem */ strm_obj->buf_alignment = 0; strm_obj->udma_chnl_id = 0; - strm_obj->udma_priority = 0; + strm_obj->dma_priority = 0; chnl_attr_obj.uio_reqs = DEFAULTNUMBUFS; } chnl_attr_obj.reserved1 = NULL; /* DMA chnl flush timeout */ - chnl_attr_obj.reserved2 = strm_obj->utimeout; + chnl_attr_obj.reserved2 = strm_obj->timeout; chnl_attr_obj.event_obj = NULL; if (pattr->user_event != NULL) chnl_attr_obj.event_obj = pattr->user_event; @@ -632,7 +632,7 @@ int strm_reclaim(struct strm_object *stream_obj, u8 ** buf_ptr, status = (*intf_fxns->chnl_get_ioc) (stream_obj->chnl_obj, - stream_obj->utimeout, + stream_obj->timeout, &chnl_ioc_obj); if (!status) { *nbytes = chnl_ioc_obj.byte_size; -- cgit v0.10.2 From ee4317f78c24cf85efd067f4c09319e281c4fa4a Mon Sep 17 00:00:00 2001 From: Rene Sapiens Date: Tue, 18 Jan 2011 03:19:12 +0000 Subject: staging: tidspbridge: set10 remove hungarian from structs hungarian notation will be removed from the elements inside structures, the next varibles will be renamed: Original: Replacement: hnext next hnode node hprev prev hroot root hstream stream pbuf buf pcb_arg cb_arg pdspheap_list dspheap_list pmsg msg ps_name name pstr_create_phase_fxn str_create_phase_fxn pstr_delete_phase_fxn str_delete_phase_fxn pstr_dev_name str_dev_name pstr_event_name str_event_name pstr_execute_phase_fxn str_execute_phase_fxn pstr_i_alg_name str_i_alg_name udma_chnl_id dma_chnl_id un_bufs_in_strm bufs_in_strm usm_buf_size sm_buf_size Signed-off-by: Rene Sapiens Signed-off-by: Armando Uribe Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c b/drivers/staging/tidspbridge/core/chnl_sm.c index c9470d3..0986d87 100644 --- a/drivers/staging/tidspbridge/core/chnl_sm.c +++ b/drivers/staging/tidspbridge/core/chnl_sm.c @@ -604,7 +604,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout, * translated to user's virtual addr later. */ host_sys_buf = chnl_packet_obj->host_sys_buf; - ioc.pbuf = chnl_packet_obj->host_user_buf; + ioc.buf = chnl_packet_obj->host_user_buf; ioc.byte_size = chnl_packet_obj->byte_size; ioc.buf_size = chnl_packet_obj->buf_size; ioc.arg = chnl_packet_obj->arg; @@ -613,7 +613,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout, list_add_tail(&chnl_packet_obj->link, &pchnl->free_packets_list); } else { - ioc.pbuf = NULL; + ioc.buf = NULL; ioc.byte_size = 0; ioc.arg = 0; ioc.buf_size = 0; @@ -640,11 +640,11 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout, spin_unlock_bh(&pchnl->chnl_mgr_obj->chnl_mgr_lock); if (dequeue_ioc && (pchnl->chnl_type == CHNL_PCPY && pchnl->chnl_id > 1)) { - if (!(ioc.pbuf < (void *)USERMODE_ADDR)) + if (!(ioc.buf < (void *)USERMODE_ADDR)) goto func_cont; /* If the addr is in user mode, then copy it */ - if (!host_sys_buf || !ioc.pbuf) { + if (!host_sys_buf || !ioc.buf) { status = -EFAULT; goto func_cont; } @@ -652,7 +652,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout, goto func_cont1; /*host_user_buf */ - status = copy_to_user(ioc.pbuf, host_sys_buf, ioc.byte_size); + status = copy_to_user(ioc.buf, host_sys_buf, ioc.byte_size); if (status) { if (current->flags & PF_EXITING) status = 0; @@ -806,7 +806,7 @@ int bridge_chnl_open(struct chnl_object **chnl, pchnl->sync_event = sync_event; /* Get the process handle */ pchnl->process = current->tgid; - pchnl->pcb_arg = 0; + pchnl->cb_arg = 0; pchnl->bytes_moved = 0; /* Default to proc-copy */ pchnl->chnl_type = CHNL_PCPY; diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index 96dbe1a..db8a438 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c @@ -106,7 +106,7 @@ struct io_mgr { struct msg_ctrl *msg_output_ctrl; u8 *msg_input; /* Address of input messages */ u8 *msg_output; /* Address of output messages */ - u32 usm_buf_size; /* Size of a shared memory I/O channel */ + u32 sm_buf_size; /* Size of a shared memory I/O channel */ bool shared_irq; /* Is this IRQ shared? */ u32 word_size; /* Size in bytes of DSP word */ u16 intr_val; /* Interrupt value */ @@ -119,7 +119,7 @@ struct io_mgr { u32 trace_buffer_end; /* Trace message end address */ u32 trace_buffer_current; /* Trace message current address */ u32 gpp_read_pointer; /* GPP Read pointer to Trace buffer */ - u8 *pmsg; + u8 *msg; u32 gpp_va; u32 dsp_va; #endif @@ -247,7 +247,7 @@ int bridge_io_destroy(struct io_mgr *hio_mgr) tasklet_kill(&hio_mgr->dpc_tasklet); #if defined(CONFIG_TIDSPBRIDGE_BACKTRACE) || defined(CONFIG_TIDSPBRIDGE_DEBUG) - kfree(hio_mgr->pmsg); + kfree(hio_mgr->msg); #endif dsp_wdt_exit(); /* Free this IO manager object */ @@ -705,7 +705,7 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) hio_mgr->input = (u8 *) hio_mgr->shared_mem + sizeof(struct shm); hio_mgr->output = hio_mgr->input + (ul_shm_length - sizeof(struct shm)) / 2; - hio_mgr->usm_buf_size = hio_mgr->output - hio_mgr->input; + hio_mgr->sm_buf_size = hio_mgr->output - hio_mgr->input; /* Set up Shared memory addresses for messaging. */ hio_mgr->msg_input_ctrl = (struct msg_ctrl *)((u8 *) hio_mgr->shared_mem @@ -764,11 +764,11 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) (ul_gpp_va + ul_seg1_size + ul_pad_size) + (hio_mgr->trace_buffer_current - ul_dsp_va); /* Calculate the size of trace buffer */ - kfree(hio_mgr->pmsg); - hio_mgr->pmsg = kmalloc(((hio_mgr->trace_buffer_end - + kfree(hio_mgr->msg); + hio_mgr->msg = kmalloc(((hio_mgr->trace_buffer_end - hio_mgr->trace_buffer_begin) * hio_mgr->word_size) + 2, GFP_KERNEL); - if (!hio_mgr->pmsg) + if (!hio_mgr->msg) status = -ENOMEM; hio_mgr->dsp_va = ul_dsp_va; @@ -786,7 +786,7 @@ func_end: u32 io_buf_size(struct io_mgr *hio_mgr) { if (hio_mgr) - return hio_mgr->usm_buf_size; + return hio_mgr->sm_buf_size; else return 0; } @@ -1361,7 +1361,7 @@ static void output_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, chnl_mgr_obj->output_mask &= ~(1 << chnl_id); /* Transfer buffer to DSP side */ - chnl_packet_obj->byte_size = min(pio_mgr->usm_buf_size, + chnl_packet_obj->byte_size = min(pio_mgr->sm_buf_size, chnl_packet_obj->byte_size); memcpy(pio_mgr->output, chnl_packet_obj->host_sys_buf, chnl_packet_obj->byte_size); @@ -1704,30 +1704,30 @@ void print_dsp_debug_trace(struct io_mgr *hio_mgr) ul_new_message_length = ul_gpp_cur_pointer - hio_mgr->gpp_read_pointer; - memcpy(hio_mgr->pmsg, + memcpy(hio_mgr->msg, (char *)hio_mgr->gpp_read_pointer, ul_new_message_length); - hio_mgr->pmsg[ul_new_message_length] = '\0'; + hio_mgr->msg[ul_new_message_length] = '\0'; /* * Advance the GPP trace pointer to DSP current * pointer. */ hio_mgr->gpp_read_pointer += ul_new_message_length; /* Print the trace messages */ - pr_info("DSPTrace: %s\n", hio_mgr->pmsg); + pr_info("DSPTrace: %s\n", hio_mgr->msg); } else if (ul_gpp_cur_pointer < hio_mgr->gpp_read_pointer) { /* Handle trace buffer wraparound */ - memcpy(hio_mgr->pmsg, + memcpy(hio_mgr->msg, (char *)hio_mgr->gpp_read_pointer, hio_mgr->trace_buffer_end - hio_mgr->gpp_read_pointer); ul_new_message_length = ul_gpp_cur_pointer - hio_mgr->trace_buffer_begin; - memcpy(&hio_mgr->pmsg[hio_mgr->trace_buffer_end - + memcpy(&hio_mgr->msg[hio_mgr->trace_buffer_end - hio_mgr->gpp_read_pointer], (char *)hio_mgr->trace_buffer_begin, ul_new_message_length); - hio_mgr->pmsg[hio_mgr->trace_buffer_end - + hio_mgr->msg[hio_mgr->trace_buffer_end - hio_mgr->gpp_read_pointer + ul_new_message_length] = '\0'; /* @@ -1738,7 +1738,7 @@ void print_dsp_debug_trace(struct io_mgr *hio_mgr) hio_mgr->trace_buffer_begin + ul_new_message_length; /* Print the trace messages */ - pr_info("DSPTrace: %s\n", hio_mgr->pmsg); + pr_info("DSPTrace: %s\n", hio_mgr->msg); } } } diff --git a/drivers/staging/tidspbridge/dynload/cload.c b/drivers/staging/tidspbridge/dynload/cload.c index d0cd445..3900409 100644 --- a/drivers/staging/tidspbridge/dynload/cload.c +++ b/drivers/staging/tidspbridge/dynload/cload.c @@ -498,8 +498,8 @@ static void allocate_sections(struct dload_state *dlthis) return; } /* initialize the handle header */ - hndl->dm.hnext = hndl->dm.hprev = hndl; /* circular list */ - hndl->dm.hroot = NULL; + hndl->dm.next = hndl->dm.prev = hndl; /* circular list */ + hndl->dm.root = NULL; hndl->dm.dbthis = 0; dlthis->myhandle = hndl; /* save away for return */ /* pointer to the section list of allocated sections */ @@ -1626,7 +1626,7 @@ static void init_module_handle(struct dload_state *dlthis) DL_ERROR(err_alloc, sizeof(struct dbg_mirror_root)); return; } - mlst->hnext = NULL; + mlst->next = NULL; mlst->changes = 0; mlst->refcount = 0; mlst->dbthis = TDATA_TO_TADDR(dlmodsym->value); @@ -1651,7 +1651,7 @@ static void init_module_handle(struct dload_state *dlthis) #else mlist = (struct dbg_mirror_root *)&debug_list_header; #endif - hndl->dm.hroot = mlist; /* set pointer to root into our handle */ + hndl->dm.root = mlist; /* set pointer to root into our handle */ if (!dlthis->allocated_secn_count) return; /* no load addresses to be recorded */ /* reuse temporary symbol storage */ @@ -1702,9 +1702,9 @@ static void init_module_handle(struct dload_state *dlthis) dllview_info.context = 0; hndl->dm.context = 0; /* fill in next pointer and size */ - if (mlist->hnext) { - dbmod->next_module = TADDR_TO_TDATA(mlist->hnext->dm.dbthis); - dbmod->next_module_size = mlist->hnext->dm.dbsiz; + if (mlist->next) { + dbmod->next_module = TADDR_TO_TDATA(mlist->next->dm.dbthis); + dbmod->next_module_size = mlist->next->dm.dbsiz; } else { dbmod->next_module_size = 0; dbmod->next_module = 0; @@ -1750,11 +1750,11 @@ static void init_module_handle(struct dload_state *dlthis) } /* Add the module handle to this processor's list of handles with debug info */ - hndl->dm.hnext = mlist->hnext; - if (hndl->dm.hnext) - hndl->dm.hnext->dm.hprev = hndl; - hndl->dm.hprev = (struct my_handle *)mlist; - mlist->hnext = hndl; /* insert after root */ + hndl->dm.next = mlist->next; + if (hndl->dm.next) + hndl->dm.next->dm.prev = hndl; + hndl->dm.prev = (struct my_handle *)mlist; + mlist->next = hndl; /* insert after root */ } /* init_module_handle */ /************************************************************************* @@ -1810,7 +1810,7 @@ int dynamic_unload_module(void *mhandle, asecs->name = NULL; alloc->dload_deallocate(alloc, asecs++); } - root = hndl->dm.hroot; + root = hndl->dm.root; if (!root) { /* there is a debug list containing this module */ goto func_end; @@ -1820,20 +1820,20 @@ int dynamic_unload_module(void *mhandle, } /* Retrieve memory context in which .dllview was allocated */ dllview_info.context = hndl->dm.context; - if (hndl->dm.hprev == hndl) + if (hndl->dm.prev == hndl) goto exitunltgt; /* target-side dllview record is in list */ /* dequeue this record from our GPP-side mirror list */ - hndl->dm.hprev->dm.hnext = hndl->dm.hnext; - if (hndl->dm.hnext) - hndl->dm.hnext->dm.hprev = hndl->dm.hprev; + hndl->dm.prev->dm.next = hndl->dm.next; + if (hndl->dm.next) + hndl->dm.next->dm.prev = hndl->dm.prev; /* Update next_module of previous entry in target list * We are using mhdr here as a surrogate for either a struct modules_header or a dll_module */ - if (hndl->dm.hnext) { - mhdr.first_module = TADDR_TO_TDATA(hndl->dm.hnext->dm.dbthis); - mhdr.first_module_size = hndl->dm.hnext->dm.dbsiz; + if (hndl->dm.next) { + mhdr.first_module = TADDR_TO_TDATA(hndl->dm.next->dm.dbthis); + mhdr.first_module_size = hndl->dm.next->dm.dbsiz; } else { mhdr.first_module = 0; mhdr.first_module_size = 0; @@ -1851,7 +1851,7 @@ int dynamic_unload_module(void *mhandle, swap_words(&mhdr, sizeof(struct modules_header) - sizeof(u16), MODULES_HEADER_BITMAP); } - if (!init->writemem(init, &mhdr, hndl->dm.hprev->dm.dbthis, + if (!init->writemem(init, &mhdr, hndl->dm.prev->dm.dbthis, &dllview_info, sizeof(struct modules_header) - sizeof(mhdr.update_flag))) { dload_syms_error(syms, dlvwrite); diff --git a/drivers/staging/tidspbridge/dynload/dload_internal.h b/drivers/staging/tidspbridge/dynload/dload_internal.h index 302a7c5..7b77573 100644 --- a/drivers/staging/tidspbridge/dynload/dload_internal.h +++ b/drivers/staging/tidspbridge/dynload/dload_internal.h @@ -78,15 +78,15 @@ struct my_handle; struct dbg_mirror_root { /* must be same as dbg_mirror_list; __DLModules address on target */ u32 dbthis; - struct my_handle *hnext; /* must be same as dbg_mirror_list */ + struct my_handle *next; /* must be same as dbg_mirror_list */ u16 changes; /* change counter */ u16 refcount; /* number of modules referencing this root */ }; struct dbg_mirror_list { u32 dbthis; - struct my_handle *hnext, *hprev; - struct dbg_mirror_root *hroot; + struct my_handle *next, *prev; + struct dbg_mirror_root *root; u16 dbsiz; u32 context; /* Save context for .dllview memory allocation */ }; diff --git a/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h b/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h index 49326a6..9110cab 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h @@ -147,7 +147,7 @@ struct chnl_object { /* Abstract syncronization object */ struct sync_object *sync_event; u32 process; /* Process which created this channel */ - u32 pcb_arg; /* Argument to use with callback */ + u32 cb_arg; /* Argument to use with callback */ struct list_head pio_requests; /* List of IOR's to driver */ s32 cio_cs; /* Number of IOC's in queue */ s32 cio_reqs; /* Number of IORequests in queue */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/chnldefs.h b/drivers/staging/tidspbridge/include/dspbridge/chnldefs.h index 2cc27b5..cb67c30 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/chnldefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/chnldefs.h @@ -45,7 +45,7 @@ struct chnl_attr { u32 uio_reqs; /* Max # of preallocated I/O requests. */ void *event_obj; /* User supplied auto-reset event object. */ - char *pstr_event_name; /* Ptr to name of user event object. */ + char *str_event_name; /* Ptr to name of user event object. */ void *reserved1; /* Reserved for future use. */ u32 reserved2; /* Reserved for future use. */ @@ -53,11 +53,11 @@ struct chnl_attr { /* I/O completion record: */ struct chnl_ioc { - void *pbuf; /* Buffer to be filled/emptied. */ + void *buf; /* Buffer to be filled/emptied. */ u32 byte_size; /* Bytes transferred. */ u32 buf_size; /* Actual buffer size in bytes */ u32 status; /* Status of IO completion. */ - u32 arg; /* User argument associated with pbuf. */ + u32 arg; /* User argument associated with buf. */ }; #endif /* CHNLDEFS_ */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbdcddef.h b/drivers/staging/tidspbridge/include/dspbridge/dbdcddef.h index f97266c..bc201b3 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dbdcddef.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dbdcddef.h @@ -48,10 +48,10 @@ struct dcd_nodeprops { struct dsp_ndbprops ndb_props; u32 msg_segid; u32 msg_notify_type; - char *pstr_create_phase_fxn; - char *pstr_delete_phase_fxn; - char *pstr_execute_phase_fxn; - char *pstr_i_alg_name; + char *str_create_phase_fxn; + char *str_delete_phase_fxn; + char *str_execute_phase_fxn; + char *str_i_alg_name; /* Dynamic load properties */ u16 load_type; /* Static, dynamic, overlay */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h index 592c16d..c8f4645 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h @@ -232,7 +232,7 @@ struct dsp_strmattr { u32 timeout; /* Timeout for blocking STRM calls */ enum dsp_strmmode strm_mode; /* mode of stream when opened */ /* DMA chnl id if dsp_strmmode is LDMA or RDMA */ - u32 udma_chnl_id; + u32 dma_chnl_id; u32 dma_priority; /* DMA channel priority 0=lowest, >0=high */ }; @@ -340,7 +340,7 @@ struct dsp_nodeattr { * window handle. */ struct dsp_notification { - char *ps_name; + char *name; void *handle; }; @@ -406,7 +406,7 @@ struct dsp_streamattrin { u32 buf_alignment; u32 num_bufs; enum dsp_strmmode strm_mode; - u32 udma_chnl_id; + u32 dma_chnl_id; u32 dma_priority; }; diff --git a/drivers/staging/tidspbridge/include/dspbridge/drv.h b/drivers/staging/tidspbridge/include/dspbridge/drv.h index 3b98c1a..bb04409 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/drv.h +++ b/drivers/staging/tidspbridge/include/dspbridge/drv.h @@ -62,7 +62,7 @@ struct drv_object; /* New structure (member of process context) abstracts NODE resource info */ struct node_res_object { - void *hnode; + void *node; s32 node_allocated; /* Node status */ s32 heap_allocated; /* Heap status */ s32 streams_allocated; /* Streams status */ @@ -101,7 +101,7 @@ struct dmm_rsv_object { /* New structure (member of process context) abstracts stream resource info */ struct strm_res_object { s32 stream_allocated; /* Stream status */ - void *hstream; + void *stream; u32 num_bufs; u32 dir; int id; diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h b/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h index 1511922..f43b3ed 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h @@ -99,7 +99,7 @@ union trapped_args { struct { void *processor; - u8 __user *pbuf; + u8 __user *buf; u8 __user *psize; u32 max_size; } args_proc_gettrace; @@ -175,19 +175,19 @@ union trapped_args { } args_node_allocate; struct { - void *hnode; + void *node; u32 usize; struct dsp_bufferattr __user *pattr; - u8 *__user *pbuffer; + u8 *__user *buffer; } args_node_allocmsgbuf; struct { - void *hnode; + void *node; s32 prio; } args_node_changepriority; struct { - void *hnode; + void *node; u32 stream_id; void *other_node; u32 other_stream; @@ -196,54 +196,54 @@ union trapped_args { } args_node_connect; struct { - void *hnode; + void *node; } args_node_create; struct { - void *hnode; + void *node; } args_node_delete; struct { - void *hnode; + void *node; struct dsp_bufferattr __user *pattr; - u8 *pbuffer; + u8 *buffer; } args_node_freemsgbuf; struct { - void *hnode; + void *node; struct dsp_nodeattr __user *pattr; u32 attr_size; } args_node_getattr; struct { - void *hnode; + void *node; struct dsp_msg __user *message; u32 timeout; } args_node_getmessage; struct { - void *hnode; + void *node; } args_node_pause; struct { - void *hnode; + void *node; struct dsp_msg __user *message; u32 timeout; } args_node_putmessage; struct { - void *hnode; + void *node; u32 event_mask; u32 notify_type; struct dsp_notification __user *hnotification; } args_node_registernotify; struct { - void *hnode; + void *node; } args_node_run; struct { - void *hnode; + void *node; int __user *pstatus; } args_node_terminate; @@ -256,48 +256,48 @@ union trapped_args { /* STRM module */ struct { - void *hstream; + void *stream; u32 usize; u8 *__user *ap_buffer; u32 num_bufs; } args_strm_allocatebuffer; struct { - void *hstream; + void *stream; } args_strm_close; struct { - void *hstream; + void *stream; u8 *__user *ap_buffer; u32 num_bufs; } args_strm_freebuffer; struct { - void *hstream; + void *stream; void **ph_event; } args_strm_geteventhandle; struct { - void *hstream; + void *stream; struct stream_info __user *stream_info; u32 stream_info_size; } args_strm_getinfo; struct { - void *hstream; + void *stream; bool flush_flag; } args_strm_idle; struct { - void *hstream; - u8 *pbuffer; + void *stream; + u8 *buffer; u32 dw_bytes; u32 dw_buf_size; u32 arg; } args_strm_issue; struct { - void *hnode; + void *node; u32 direction; u32 index; struct strm_attr __user *attr_in; @@ -305,7 +305,7 @@ union trapped_args { } args_strm_open; struct { - void *hstream; + void *stream; u8 *__user *buf_ptr; u32 __user *bytes; u32 __user *buf_size_ptr; @@ -313,7 +313,7 @@ union trapped_args { } args_strm_reclaim; struct { - void *hstream; + void *stream; u32 event_mask; u32 notify_type; struct dsp_notification __user *hnotification; diff --git a/drivers/staging/tidspbridge/include/dspbridge/strmdefs.h b/drivers/staging/tidspbridge/include/dspbridge/strmdefs.h index 046259c..4f90e6b 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/strmdefs.h +++ b/drivers/staging/tidspbridge/include/dspbridge/strmdefs.h @@ -25,7 +25,7 @@ struct strm_object; struct strm_attr { void *user_event; - char *pstr_event_name; + char *str_event_name; void *virt_base; /* Process virtual base address of * mapped SM */ u32 virt_size; /* Size of virtual space in bytes */ diff --git a/drivers/staging/tidspbridge/pmgr/dspapi.c b/drivers/staging/tidspbridge/pmgr/dspapi.c index 912a1f9..1d86bd1 100644 --- a/drivers/staging/tidspbridge/pmgr/dspapi.c +++ b/drivers/staging/tidspbridge/pmgr/dspapi.c @@ -813,7 +813,7 @@ u32 procwrap_get_trace(union trapped_args *args, void *pr_ctxt) } else { status = -ENOMEM; } - CP_TO_USR(args->args_proc_gettrace.pbuf, pbuf, status, + CP_TO_USR(args->args_proc_gettrace.buf, pbuf, status, args->args_proc_gettrace.max_size); kfree(pbuf); @@ -978,7 +978,7 @@ u32 procwrap_register_notify(union trapped_args *args, void *pr_ctxt) void *hprocessor = ((struct process_context *)pr_ctxt)->processor; /* Initialize the notification data structure */ - notification.ps_name = NULL; + notification.name = NULL; notification.handle = NULL; status = proc_register_notify(hprocessor, @@ -1154,7 +1154,7 @@ u32 nodewrap_alloc_msg_buf(union trapped_args *args, void *pr_ctxt) struct node_res_object *node_res; find_node_handle(&node_res, pr_ctxt, - args->args_node_allocmsgbuf.hnode); + args->args_node_allocmsgbuf.node); if (!node_res) return -EFAULT; @@ -1169,13 +1169,13 @@ u32 nodewrap_alloc_msg_buf(union trapped_args *args, void *pr_ctxt) } /* argument */ - CP_FM_USR(&pbuffer, args->args_node_allocmsgbuf.pbuffer, status, 1); + CP_FM_USR(&pbuffer, args->args_node_allocmsgbuf.buffer, status, 1); if (!status) { - status = node_alloc_msg_buf(node_res->hnode, + status = node_alloc_msg_buf(node_res->node, args->args_node_allocmsgbuf.usize, pattr, &pbuffer); } - CP_TO_USR(args->args_node_allocmsgbuf.pbuffer, &pbuffer, status, 1); + CP_TO_USR(args->args_node_allocmsgbuf.buffer, &pbuffer, status, 1); return status; } @@ -1188,12 +1188,12 @@ u32 nodewrap_change_priority(union trapped_args *args, void *pr_ctxt) struct node_res_object *node_res; find_node_handle(&node_res, pr_ctxt, - args->args_node_changepriority.hnode); + args->args_node_changepriority.node); if (!node_res) return -EFAULT; - ret = node_change_priority(node_res->hnode, + ret = node_change_priority(node_res->node, args->args_node_changepriority.prio); return ret; @@ -1213,20 +1213,20 @@ u32 nodewrap_connect(union trapped_args *args, void *pr_ctxt) struct node_res_object *node_res1, *node_res2; struct node_object *node1 = NULL, *node2 = NULL; - if ((int)args->args_node_connect.hnode != DSP_HGPPNODE) { + if ((int)args->args_node_connect.node != DSP_HGPPNODE) { find_node_handle(&node_res1, pr_ctxt, - args->args_node_connect.hnode); + args->args_node_connect.node); if (node_res1) - node1 = node_res1->hnode; + node1 = node_res1->node; } else { - node1 = args->args_node_connect.hnode; + node1 = args->args_node_connect.node; } if ((int)args->args_node_connect.other_node != DSP_HGPPNODE) { find_node_handle(&node_res2, pr_ctxt, args->args_node_connect.other_node); if (node_res2) - node2 = node_res2->hnode; + node2 = node_res2->node; } else { node2 = args->args_node_connect.other_node; } @@ -1280,12 +1280,12 @@ u32 nodewrap_create(union trapped_args *args, void *pr_ctxt) u32 ret; struct node_res_object *node_res; - find_node_handle(&node_res, pr_ctxt, args->args_node_create.hnode); + find_node_handle(&node_res, pr_ctxt, args->args_node_create.node); if (!node_res) return -EFAULT; - ret = node_create(node_res->hnode); + ret = node_create(node_res->node); return ret; } @@ -1298,7 +1298,7 @@ u32 nodewrap_delete(union trapped_args *args, void *pr_ctxt) u32 ret; struct node_res_object *node_res; - find_node_handle(&node_res, pr_ctxt, args->args_node_delete.hnode); + find_node_handle(&node_res, pr_ctxt, args->args_node_delete.node); if (!node_res) return -EFAULT; @@ -1318,7 +1318,7 @@ u32 nodewrap_free_msg_buf(union trapped_args *args, void *pr_ctxt) struct dsp_bufferattr attr; struct node_res_object *node_res; - find_node_handle(&node_res, pr_ctxt, args->args_node_freemsgbuf.hnode); + find_node_handle(&node_res, pr_ctxt, args->args_node_freemsgbuf.node); if (!node_res) return -EFAULT; @@ -1330,12 +1330,12 @@ u32 nodewrap_free_msg_buf(union trapped_args *args, void *pr_ctxt) } - if (!args->args_node_freemsgbuf.pbuffer) + if (!args->args_node_freemsgbuf.buffer) return -EFAULT; if (!status) { - status = node_free_msg_buf(node_res->hnode, - args->args_node_freemsgbuf.pbuffer, + status = node_free_msg_buf(node_res->node, + args->args_node_freemsgbuf.buffer, pattr); } @@ -1351,12 +1351,12 @@ u32 nodewrap_get_attr(union trapped_args *args, void *pr_ctxt) struct dsp_nodeattr attr; struct node_res_object *node_res; - find_node_handle(&node_res, pr_ctxt, args->args_node_getattr.hnode); + find_node_handle(&node_res, pr_ctxt, args->args_node_getattr.node); if (!node_res) return -EFAULT; - status = node_get_attr(node_res->hnode, &attr, + status = node_get_attr(node_res->node, &attr, args->args_node_getattr.attr_size); CP_TO_USR(args->args_node_getattr.pattr, &attr, status, 1); @@ -1372,12 +1372,12 @@ u32 nodewrap_get_message(union trapped_args *args, void *pr_ctxt) struct dsp_msg msg; struct node_res_object *node_res; - find_node_handle(&node_res, pr_ctxt, args->args_node_getmessage.hnode); + find_node_handle(&node_res, pr_ctxt, args->args_node_getmessage.node); if (!node_res) return -EFAULT; - status = node_get_message(node_res->hnode, &msg, + status = node_get_message(node_res->node, &msg, args->args_node_getmessage.timeout); CP_TO_USR(args->args_node_getmessage.message, &msg, status, 1); @@ -1393,12 +1393,12 @@ u32 nodewrap_pause(union trapped_args *args, void *pr_ctxt) u32 ret; struct node_res_object *node_res; - find_node_handle(&node_res, pr_ctxt, args->args_node_pause.hnode); + find_node_handle(&node_res, pr_ctxt, args->args_node_pause.node); if (!node_res) return -EFAULT; - ret = node_pause(node_res->hnode); + ret = node_pause(node_res->node); return ret; } @@ -1412,7 +1412,7 @@ u32 nodewrap_put_message(union trapped_args *args, void *pr_ctxt) struct dsp_msg msg; struct node_res_object *node_res; - find_node_handle(&node_res, pr_ctxt, args->args_node_putmessage.hnode); + find_node_handle(&node_res, pr_ctxt, args->args_node_putmessage.node); if (!node_res) return -EFAULT; @@ -1421,7 +1421,7 @@ u32 nodewrap_put_message(union trapped_args *args, void *pr_ctxt) if (!status) { status = - node_put_message(node_res->hnode, &msg, + node_put_message(node_res->node, &msg, args->args_node_putmessage.timeout); } @@ -1438,13 +1438,13 @@ u32 nodewrap_register_notify(union trapped_args *args, void *pr_ctxt) struct node_res_object *node_res; find_node_handle(&node_res, pr_ctxt, - args->args_node_registernotify.hnode); + args->args_node_registernotify.node); if (!node_res) return -EFAULT; /* Initialize the notification data structure */ - notification.ps_name = NULL; + notification.name = NULL; notification.handle = NULL; if (!args->args_proc_register_notify.event_mask) @@ -1452,7 +1452,7 @@ u32 nodewrap_register_notify(union trapped_args *args, void *pr_ctxt) args->args_proc_register_notify.hnotification, status, 1); - status = node_register_notify(node_res->hnode, + status = node_register_notify(node_res->node, args->args_node_registernotify.event_mask, args->args_node_registernotify. notify_type, ¬ification); @@ -1469,12 +1469,12 @@ u32 nodewrap_run(union trapped_args *args, void *pr_ctxt) u32 ret; struct node_res_object *node_res; - find_node_handle(&node_res, pr_ctxt, args->args_node_run.hnode); + find_node_handle(&node_res, pr_ctxt, args->args_node_run.node); if (!node_res) return -EFAULT; - ret = node_run(node_res->hnode); + ret = node_run(node_res->node); return ret; } @@ -1488,12 +1488,12 @@ u32 nodewrap_terminate(union trapped_args *args, void *pr_ctxt) int tempstatus; struct node_res_object *node_res; - find_node_handle(&node_res, pr_ctxt, args->args_node_terminate.hnode); + find_node_handle(&node_res, pr_ctxt, args->args_node_terminate.node); if (!node_res) return -EFAULT; - status = node_terminate(node_res->hnode, &tempstatus); + status = node_terminate(node_res->node, &tempstatus); CP_TO_USR(args->args_node_terminate.pstatus, &tempstatus, status, 1); @@ -1551,7 +1551,7 @@ u32 strmwrap_allocate_buffer(union trapped_args *args, void *pr_ctxt) struct strm_res_object *strm_res; find_strm_handle(&strm_res, pr_ctxt, - args->args_strm_allocatebuffer.hstream); + args->args_strm_allocatebuffer.stream); if (!strm_res) return -EFAULT; @@ -1587,7 +1587,7 @@ u32 strmwrap_close(union trapped_args *args, void *pr_ctxt) { struct strm_res_object *strm_res; - find_strm_handle(&strm_res, pr_ctxt, args->args_strm_close.hstream); + find_strm_handle(&strm_res, pr_ctxt, args->args_strm_close.stream); if (!strm_res) return -EFAULT; @@ -1606,7 +1606,7 @@ u32 strmwrap_free_buffer(union trapped_args *args, void *pr_ctxt) struct strm_res_object *strm_res; find_strm_handle(&strm_res, pr_ctxt, - args->args_strm_freebuffer.hstream); + args->args_strm_freebuffer.stream); if (!strm_res) return -EFAULT; @@ -1654,7 +1654,7 @@ u32 strmwrap_get_info(union trapped_args *args, void *pr_ctxt) struct strm_res_object *strm_res; find_strm_handle(&strm_res, pr_ctxt, - args->args_strm_getinfo.hstream); + args->args_strm_getinfo.stream); if (!strm_res) return -EFAULT; @@ -1665,7 +1665,7 @@ u32 strmwrap_get_info(union trapped_args *args, void *pr_ctxt) strm_info.user_strm = &user; if (!status) { - status = strm_get_info(strm_res->hstream, + status = strm_get_info(strm_res->stream, &strm_info, args->args_strm_getinfo. stream_info_size); @@ -1684,12 +1684,12 @@ u32 strmwrap_idle(union trapped_args *args, void *pr_ctxt) u32 ret; struct strm_res_object *strm_res; - find_strm_handle(&strm_res, pr_ctxt, args->args_strm_idle.hstream); + find_strm_handle(&strm_res, pr_ctxt, args->args_strm_idle.stream); if (!strm_res) return -EFAULT; - ret = strm_idle(strm_res->hstream, args->args_strm_idle.flush_flag); + ret = strm_idle(strm_res->stream, args->args_strm_idle.flush_flag); return ret; } @@ -1702,19 +1702,19 @@ u32 strmwrap_issue(union trapped_args *args, void *pr_ctxt) int status = 0; struct strm_res_object *strm_res; - find_strm_handle(&strm_res, pr_ctxt, args->args_strm_issue.hstream); + find_strm_handle(&strm_res, pr_ctxt, args->args_strm_issue.stream); if (!strm_res) return -EFAULT; - if (!args->args_strm_issue.pbuffer) + if (!args->args_strm_issue.buffer) return -EFAULT; /* No need of doing CP_FM_USR for the user buffer (pbuffer) as this is done in Bridge internal function bridge_chnl_add_io_req in chnl_sm.c */ - status = strm_issue(strm_res->hstream, - args->args_strm_issue.pbuffer, + status = strm_issue(strm_res->stream, + args->args_strm_issue.buffer, args->args_strm_issue.dw_bytes, args->args_strm_issue.dw_buf_size, args->args_strm_issue.arg); @@ -1734,7 +1734,7 @@ u32 strmwrap_open(union trapped_args *args, void *pr_ctxt) struct node_res_object *node_res; int strmid; - find_node_handle(&node_res, pr_ctxt, args->args_strm_open.hnode); + find_node_handle(&node_res, pr_ctxt, args->args_strm_open.node); if (!node_res) return -EFAULT; @@ -1750,7 +1750,7 @@ u32 strmwrap_open(union trapped_args *args, void *pr_ctxt) } } - status = strm_open(node_res->hnode, + status = strm_open(node_res->node, args->args_strm_open.direction, args->args_strm_open.index, &attr, &strm_res_obj, pr_ctxt); @@ -1773,12 +1773,12 @@ u32 strmwrap_reclaim(union trapped_args *args, void *pr_ctxt) u32 ul_buf_size; struct strm_res_object *strm_res; - find_strm_handle(&strm_res, pr_ctxt, args->args_strm_reclaim.hstream); + find_strm_handle(&strm_res, pr_ctxt, args->args_strm_reclaim.stream); if (!strm_res) return -EFAULT; - status = strm_reclaim(strm_res->hstream, &buf_ptr, + status = strm_reclaim(strm_res->stream, &buf_ptr, &ul_bytes, &ul_buf_size, &dw_arg); CP_TO_USR(args->args_strm_reclaim.buf_ptr, &buf_ptr, status, 1); CP_TO_USR(args->args_strm_reclaim.bytes, &ul_bytes, status, 1); @@ -1802,16 +1802,16 @@ u32 strmwrap_register_notify(union trapped_args *args, void *pr_ctxt) struct strm_res_object *strm_res; find_strm_handle(&strm_res, pr_ctxt, - args->args_strm_registernotify.hstream); + args->args_strm_registernotify.stream); if (!strm_res) return -EFAULT; /* Initialize the notification data structure */ - notification.ps_name = NULL; + notification.name = NULL; notification.handle = NULL; - status = strm_register_notify(strm_res->hstream, + status = strm_register_notify(strm_res->stream, args->args_strm_registernotify.event_mask, args->args_strm_registernotify. notify_type, ¬ification); @@ -1848,7 +1848,7 @@ u32 strmwrap_select(union trapped_args *args, void *pr_ctxt) if (!strm_res) return -EFAULT; - strm_tab[i] = strm_res->hstream; + strm_tab[i] = strm_res->stream; } if (!status) { diff --git a/drivers/staging/tidspbridge/rmgr/dbdcd.c b/drivers/staging/tidspbridge/rmgr/dbdcd.c index 1e77c12..a7e407e 100644 --- a/drivers/staging/tidspbridge/rmgr/dbdcd.c +++ b/drivers/staging/tidspbridge/rmgr/dbdcd.c @@ -1166,36 +1166,36 @@ static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size, gen_obj->obj_data.node_obj.ndb_props.timeout = atoi(token); token = strsep(&psz_cur, seps); - /* char *pstr_create_phase_fxn */ + /* char *str_create_phase_fxn */ DBC_REQUIRE(token); token_len = strlen(token); - gen_obj->obj_data.node_obj.pstr_create_phase_fxn = + gen_obj->obj_data.node_obj.str_create_phase_fxn = kzalloc(token_len + 1, GFP_KERNEL); - strncpy(gen_obj->obj_data.node_obj.pstr_create_phase_fxn, + strncpy(gen_obj->obj_data.node_obj.str_create_phase_fxn, token, token_len); - gen_obj->obj_data.node_obj.pstr_create_phase_fxn[token_len] = + gen_obj->obj_data.node_obj.str_create_phase_fxn[token_len] = '\0'; token = strsep(&psz_cur, seps); - /* char *pstr_execute_phase_fxn */ + /* char *str_execute_phase_fxn */ DBC_REQUIRE(token); token_len = strlen(token); - gen_obj->obj_data.node_obj.pstr_execute_phase_fxn = + gen_obj->obj_data.node_obj.str_execute_phase_fxn = kzalloc(token_len + 1, GFP_KERNEL); - strncpy(gen_obj->obj_data.node_obj.pstr_execute_phase_fxn, + strncpy(gen_obj->obj_data.node_obj.str_execute_phase_fxn, token, token_len); - gen_obj->obj_data.node_obj.pstr_execute_phase_fxn[token_len] = + gen_obj->obj_data.node_obj.str_execute_phase_fxn[token_len] = '\0'; token = strsep(&psz_cur, seps); - /* char *pstr_delete_phase_fxn */ + /* char *str_delete_phase_fxn */ DBC_REQUIRE(token); token_len = strlen(token); - gen_obj->obj_data.node_obj.pstr_delete_phase_fxn = + gen_obj->obj_data.node_obj.str_delete_phase_fxn = kzalloc(token_len + 1, GFP_KERNEL); - strncpy(gen_obj->obj_data.node_obj.pstr_delete_phase_fxn, + strncpy(gen_obj->obj_data.node_obj.str_delete_phase_fxn, token, token_len); - gen_obj->obj_data.node_obj.pstr_delete_phase_fxn[token_len] = + gen_obj->obj_data.node_obj.str_delete_phase_fxn[token_len] = '\0'; token = strsep(&psz_cur, seps); @@ -1207,14 +1207,14 @@ static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size, gen_obj->obj_data.node_obj.msg_notify_type = atoi(token); token = strsep(&psz_cur, seps); - /* char *pstr_i_alg_name */ + /* char *str_i_alg_name */ if (token) { token_len = strlen(token); - gen_obj->obj_data.node_obj.pstr_i_alg_name = + gen_obj->obj_data.node_obj.str_i_alg_name = kzalloc(token_len + 1, GFP_KERNEL); - strncpy(gen_obj->obj_data.node_obj.pstr_i_alg_name, + strncpy(gen_obj->obj_data.node_obj.str_i_alg_name, token, token_len); - gen_obj->obj_data.node_obj.pstr_i_alg_name[token_len] = + gen_obj->obj_data.node_obj.str_i_alg_name[token_len] = '\0'; token = strsep(&psz_cur, seps); } diff --git a/drivers/staging/tidspbridge/rmgr/disp.c b/drivers/staging/tidspbridge/rmgr/disp.c index d38ea2d..a9aa22f 100644 --- a/drivers/staging/tidspbridge/rmgr/disp.c +++ b/drivers/staging/tidspbridge/rmgr/disp.c @@ -64,7 +64,7 @@ struct disp_object { struct chnl_mgr *chnl_mgr; /* Channel manager */ struct chnl_object *chnl_to_dsp; /* Chnl for commands to RMS */ struct chnl_object *chnl_from_dsp; /* Chnl for replies from RMS */ - u8 *pbuf; /* Buffer for commands, replies */ + u8 *buf; /* Buffer for commands, replies */ u32 bufsize; /* buf size in bytes */ u32 bufsize_rms; /* buf size in RMS words */ u32 char_size; /* Size of DSP character */ @@ -158,8 +158,8 @@ int disp_create(struct disp_object **dispatch_obj, /* Allocate buffer for commands, replies */ disp_obj->bufsize = disp_attrs->chnl_buf_size; disp_obj->bufsize_rms = RMS_COMMANDBUFSIZE; - disp_obj->pbuf = kzalloc(disp_obj->bufsize, GFP_KERNEL); - if (disp_obj->pbuf == NULL) + disp_obj->buf = kzalloc(disp_obj->bufsize, GFP_KERNEL); + if (disp_obj->buf == NULL) status = -ENOMEM; } func_cont: @@ -232,7 +232,7 @@ int disp_node_change_priority(struct disp_object *disp_obj, DBC_REQUIRE(hnode != NULL); /* Send message to RMS to change priority */ - rms_cmd = (struct rms_command *)(disp_obj->pbuf); + rms_cmd = (struct rms_command *)(disp_obj->buf); rms_cmd->fxn = (rms_word) (rms_fxn); rms_cmd->arg1 = (rms_word) node_env; rms_cmd->arg2 = prio; @@ -347,7 +347,7 @@ int disp_node_create(struct disp_object *disp_obj, */ if (!status) { total = 0; /* Total number of words in buffer so far */ - pdw_buf = (rms_word *) disp_obj->pbuf; + pdw_buf = (rms_word *) disp_obj->buf; rms_cmd = (struct rms_command *)pdw_buf; rms_cmd->fxn = (rms_word) (rms_fxn); rms_cmd->arg1 = (rms_word) (ul_create_fxn); @@ -493,7 +493,7 @@ int disp_node_delete(struct disp_object *disp_obj, /* * Fill in buffer to send to RMS */ - rms_cmd = (struct rms_command *)disp_obj->pbuf; + rms_cmd = (struct rms_command *)disp_obj->buf; rms_cmd->fxn = (rms_word) (rms_fxn); rms_cmd->arg1 = (rms_word) node_env; rms_cmd->arg2 = (rms_word) (ul_delete_fxn); @@ -534,7 +534,7 @@ int disp_node_run(struct disp_object *disp_obj, /* * Fill in buffer to send to RMS. */ - rms_cmd = (struct rms_command *)disp_obj->pbuf; + rms_cmd = (struct rms_command *)disp_obj->buf; rms_cmd->fxn = (rms_word) (rms_fxn); rms_cmd->arg1 = (rms_word) node_env; rms_cmd->arg2 = (rms_word) (ul_execute_fxn); @@ -582,7 +582,7 @@ static void delete_disp(struct disp_object *disp_obj) " RMS: 0x%x\n", __func__, status); } } - kfree(disp_obj->pbuf); + kfree(disp_obj->buf); kfree(disp_obj); } @@ -664,7 +664,7 @@ static int send_message(struct disp_object *disp_obj, u32 timeout, *pdw_arg = (u32) NULL; intf_fxns = disp_obj->intf_fxns; chnl_obj = disp_obj->chnl_to_dsp; - pbuf = disp_obj->pbuf; + pbuf = disp_obj->buf; /* Send the command */ status = (*intf_fxns->chnl_add_io_req) (chnl_obj, pbuf, ul_bytes, 0, @@ -703,8 +703,8 @@ static int send_message(struct disp_object *disp_obj, u32 timeout, status = -EPERM; } else { if (CHNL_IS_IO_COMPLETE(chnl_ioc_obj)) { - DBC_ASSERT(chnl_ioc_obj.pbuf == pbuf); - if (*((int *)chnl_ioc_obj.pbuf) < 0) { + DBC_ASSERT(chnl_ioc_obj.buf == pbuf); + if (*((int *)chnl_ioc_obj.buf) < 0) { /* Translate DSP's to kernel error */ status = -EREMOTEIO; dev_dbg(bridge, "%s: DSP-side failed:" @@ -713,7 +713,7 @@ static int send_message(struct disp_object *disp_obj, u32 timeout, *(int *)pbuf, status); } *pdw_arg = - (((rms_word *) (chnl_ioc_obj.pbuf))[1]); + (((rms_word *) (chnl_ioc_obj.buf))[1]); } else { status = -EPERM; } diff --git a/drivers/staging/tidspbridge/rmgr/drv.c b/drivers/staging/tidspbridge/rmgr/drv.c index ce5f398..8c88583 100644 --- a/drivers/staging/tidspbridge/rmgr/drv.c +++ b/drivers/staging/tidspbridge/rmgr/drv.c @@ -89,7 +89,7 @@ int drv_insert_node_res_element(void *hnode, void *node_resource, goto func_end; } - (*node_res_obj)->hnode = hnode; + (*node_res_obj)->node = hnode; retval = idr_get_new(ctxt->node_id, *node_res_obj, &(*node_res_obj)->id); if (retval == -EAGAIN) { @@ -123,13 +123,13 @@ static int drv_proc_free_node_res(int id, void *p, void *data) u32 node_state; if (node_res_obj->node_allocated) { - node_state = node_get_state(node_res_obj->hnode); + node_state = node_get_state(node_res_obj->node); if (node_state <= NODE_DELETING) { if ((node_state == NODE_RUNNING) || (node_state == NODE_PAUSED) || (node_state == NODE_TERMINATING)) node_terminate - (node_res_obj->hnode, &status); + (node_res_obj->node, &status); node_delete(node_res_obj, ctxt); } @@ -216,7 +216,7 @@ int drv_proc_insert_strm_res_element(void *stream_obj, goto func_end; } - (*pstrm_res)->hstream = stream_obj; + (*pstrm_res)->stream = stream_obj; retval = idr_get_new(ctxt->stream_id, *pstrm_res, &(*pstrm_res)->id); if (retval == -EAGAIN) { @@ -263,9 +263,9 @@ static int drv_proc_free_strm_res(int id, void *p, void *process_ctxt) } strm_info.user_strm = &user; user.number_bufs_in_stream = 0; - strm_get_info(strm_res->hstream, &strm_info, sizeof(strm_info)); + strm_get_info(strm_res->stream, &strm_info, sizeof(strm_info)); while (user.number_bufs_in_stream--) - strm_reclaim(strm_res->hstream, &buf_ptr, &ul_bytes, + strm_reclaim(strm_res->stream, &buf_ptr, &ul_bytes, (u32 *) &ul_buf_size, &dw_arg); strm_close(strm_res, ctxt); return 0; diff --git a/drivers/staging/tidspbridge/rmgr/nldr.c b/drivers/staging/tidspbridge/rmgr/nldr.c index e711970..fb5c2ba 100644 --- a/drivers/staging/tidspbridge/rmgr/nldr.c +++ b/drivers/staging/tidspbridge/rmgr/nldr.c @@ -1035,13 +1035,13 @@ static int add_ovly_node(struct dsp_uuid *uuid_obj, } } /* These were allocated in dcd_get_object_def */ - kfree(obj_def.obj_data.node_obj.pstr_create_phase_fxn); + kfree(obj_def.obj_data.node_obj.str_create_phase_fxn); - kfree(obj_def.obj_data.node_obj.pstr_execute_phase_fxn); + kfree(obj_def.obj_data.node_obj.str_execute_phase_fxn); - kfree(obj_def.obj_data.node_obj.pstr_delete_phase_fxn); + kfree(obj_def.obj_data.node_obj.str_delete_phase_fxn); - kfree(obj_def.obj_data.node_obj.pstr_i_alg_name); + kfree(obj_def.obj_data.node_obj.str_i_alg_name); func_end: return status; diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c index c627560..5653837 100644 --- a/drivers/staging/tidspbridge/rmgr/node.c +++ b/drivers/staging/tidspbridge/rmgr/node.c @@ -209,7 +209,7 @@ struct node_object { struct dcd_genericobj dcd_props; /* Node properties from DCD */ struct dsp_cbdata *pargs; /* Optional args to pass to node */ struct ntfy_object *ntfy_obj; /* Manages registered notifications */ - char *pstr_dev_name; /* device name, if device node */ + char *str_dev_name; /* device name, if device node */ struct sync_object *sync_done; /* Synchronize node_terminate */ s32 exit_status; /* execute function return status */ @@ -1060,7 +1060,7 @@ int node_connect(struct node_object *node1, u32 stream1, } /* Set up create args */ pstream->type = DEVICECONNECT; - dw_length = strlen(dev_node_obj->pstr_dev_name); + dw_length = strlen(dev_node_obj->str_dev_name); if (conn_param) pstrm_def->sz_device = kzalloc(dw_length + 1 + conn_param->cb_data, @@ -1074,7 +1074,7 @@ int node_connect(struct node_object *node1, u32 stream1, } /* Copy device name */ strncpy(pstrm_def->sz_device, - dev_node_obj->pstr_dev_name, dw_length); + dev_node_obj->str_dev_name, dw_length); if (conn_param) strncat(pstrm_def->sz_device, (char *)conn_param->node_data, @@ -1214,7 +1214,7 @@ int node_create(struct node_object *hnode) status = hnode_mgr->nldr_fxns.get_fxn_addr (hnode->nldr_node_obj, hnode->dcd_props.obj_data.node_obj. - pstr_i_alg_name, + str_i_alg_name, &hnode->create_args.asa. task_arg_obj.dais_arg); } @@ -1393,7 +1393,7 @@ out_err: int node_delete(struct node_res_object *noderes, struct process_context *pr_ctxt) { - struct node_object *pnode = noderes->hnode; + struct node_object *pnode = noderes->node; struct node_mgr *hnode_mgr; struct proc_object *hprocessor; struct disp_object *disp_obj; @@ -2541,8 +2541,8 @@ static void delete_node(struct node_object *hnode, kfree(hnode->stream_connect); hnode->stream_connect = NULL; } - kfree(hnode->pstr_dev_name); - hnode->pstr_dev_name = NULL; + kfree(hnode->str_dev_name); + hnode->str_dev_name = NULL; if (hnode->ntfy_obj) { ntfy_delete(hnode->ntfy_obj); @@ -2551,17 +2551,17 @@ static void delete_node(struct node_object *hnode, } /* These were allocated in dcd_get_object_def (via node_allocate) */ - kfree(hnode->dcd_props.obj_data.node_obj.pstr_create_phase_fxn); - hnode->dcd_props.obj_data.node_obj.pstr_create_phase_fxn = NULL; + kfree(hnode->dcd_props.obj_data.node_obj.str_create_phase_fxn); + hnode->dcd_props.obj_data.node_obj.str_create_phase_fxn = NULL; - kfree(hnode->dcd_props.obj_data.node_obj.pstr_execute_phase_fxn); - hnode->dcd_props.obj_data.node_obj.pstr_execute_phase_fxn = NULL; + kfree(hnode->dcd_props.obj_data.node_obj.str_execute_phase_fxn); + hnode->dcd_props.obj_data.node_obj.str_execute_phase_fxn = NULL; - kfree(hnode->dcd_props.obj_data.node_obj.pstr_delete_phase_fxn); - hnode->dcd_props.obj_data.node_obj.pstr_delete_phase_fxn = NULL; + kfree(hnode->dcd_props.obj_data.node_obj.str_delete_phase_fxn); + hnode->dcd_props.obj_data.node_obj.str_delete_phase_fxn = NULL; - kfree(hnode->dcd_props.obj_data.node_obj.pstr_i_alg_name); - hnode->dcd_props.obj_data.node_obj.pstr_i_alg_name = NULL; + kfree(hnode->dcd_props.obj_data.node_obj.str_i_alg_name); + hnode->dcd_props.obj_data.node_obj.str_i_alg_name = NULL; /* Free all SM address translator resources */ kfree(hnode->xlator); @@ -2755,15 +2755,15 @@ static int get_fxn_address(struct node_object *hnode, u32 * fxn_addr, switch (phase) { case CREATEPHASE: pstr_fxn_name = - hnode->dcd_props.obj_data.node_obj.pstr_create_phase_fxn; + hnode->dcd_props.obj_data.node_obj.str_create_phase_fxn; break; case EXECUTEPHASE: pstr_fxn_name = - hnode->dcd_props.obj_data.node_obj.pstr_execute_phase_fxn; + hnode->dcd_props.obj_data.node_obj.str_execute_phase_fxn; break; case DELETEPHASE: pstr_fxn_name = - hnode->dcd_props.obj_data.node_obj.pstr_delete_phase_fxn; + hnode->dcd_props.obj_data.node_obj.str_delete_phase_fxn; break; default: /* Should never get here */ @@ -2851,11 +2851,11 @@ static int get_node_props(struct dcd_manager *hdcd_mgr, DBC_REQUIRE(pndb_props->ac_name); len = strlen(pndb_props->ac_name); DBC_ASSERT(len < MAXDEVNAMELEN); - hnode->pstr_dev_name = kzalloc(len + 1, GFP_KERNEL); - if (hnode->pstr_dev_name == NULL) { + hnode->str_dev_name = kzalloc(len + 1, GFP_KERNEL); + if (hnode->str_dev_name == NULL) { status = -ENOMEM; } else { - strncpy(hnode->pstr_dev_name, + strncpy(hnode->str_dev_name, pndb_props->ac_name, len); } } @@ -2974,10 +2974,10 @@ int node_get_uuid_props(void *hprocessor, */ mutex_lock(&hnode_mgr->node_mgr_lock); - dcd_node_props.pstr_create_phase_fxn = NULL; - dcd_node_props.pstr_execute_phase_fxn = NULL; - dcd_node_props.pstr_delete_phase_fxn = NULL; - dcd_node_props.pstr_i_alg_name = NULL; + dcd_node_props.str_create_phase_fxn = NULL; + dcd_node_props.str_execute_phase_fxn = NULL; + dcd_node_props.str_delete_phase_fxn = NULL; + dcd_node_props.str_i_alg_name = NULL; status = dcd_get_object_def(hnode_mgr->dcd_mgr, (struct dsp_uuid *)node_uuid, DSP_DCDNODETYPE, @@ -2985,13 +2985,13 @@ int node_get_uuid_props(void *hprocessor, if (!status) { *node_props = dcd_node_props.ndb_props; - kfree(dcd_node_props.pstr_create_phase_fxn); + kfree(dcd_node_props.str_create_phase_fxn); - kfree(dcd_node_props.pstr_execute_phase_fxn); + kfree(dcd_node_props.str_execute_phase_fxn); - kfree(dcd_node_props.pstr_delete_phase_fxn); + kfree(dcd_node_props.str_delete_phase_fxn); - kfree(dcd_node_props.pstr_i_alg_name); + kfree(dcd_node_props.str_i_alg_name); } /* Leave the critical section, we're done. */ mutex_unlock(&hnode_mgr->node_mgr_lock); diff --git a/drivers/staging/tidspbridge/rmgr/strm.c b/drivers/staging/tidspbridge/rmgr/strm.c index cc7370c..3fae0e9 100644 --- a/drivers/staging/tidspbridge/rmgr/strm.c +++ b/drivers/staging/tidspbridge/rmgr/strm.c @@ -70,13 +70,13 @@ struct strm_object { u32 dir; /* DSP_TONODE or DSP_FROMNODE */ u32 timeout; u32 num_bufs; /* Max # of bufs allowed in stream */ - u32 un_bufs_in_strm; /* Current # of bufs in stream */ + u32 bufs_in_strm; /* Current # of bufs in stream */ u32 bytes; /* bytes transferred since idled */ /* STREAM_IDLE, STREAM_READY, ... */ enum dsp_streamstate strm_state; void *user_event; /* Saved for strm_get_info() */ enum dsp_strmmode strm_mode; /* STRMMODE_[PROCCOPY][ZEROCOPY]... */ - u32 udma_chnl_id; /* DMA chnl id */ + u32 dma_chnl_id; /* DMA chnl id */ u32 dma_priority; /* DMA priority:DMAPRI_[LOW][HIGH] */ u32 segment_id; /* >0 is SM segment.=0 is local heap */ u32 buf_alignment; /* Alignment for stream bufs */ @@ -102,7 +102,7 @@ int strm_allocate_buffer(struct strm_res_object *strmres, u32 usize, int status = 0; u32 alloc_cnt = 0; u32 i; - struct strm_object *stream_obj = strmres->hstream; + struct strm_object *stream_obj = strmres->stream; DBC_REQUIRE(refs > 0); DBC_REQUIRE(ap_buffer != NULL); @@ -154,7 +154,7 @@ int strm_close(struct strm_res_object *strmres, struct bridge_drv_interface *intf_fxns; struct chnl_info chnl_info_obj; int status = 0; - struct strm_object *stream_obj = strmres->hstream; + struct strm_object *stream_obj = strmres->stream; DBC_REQUIRE(refs > 0); @@ -268,7 +268,7 @@ int strm_free_buffer(struct strm_res_object *strmres, u8 ** ap_buffer, { int status = 0; u32 i = 0; - struct strm_object *stream_obj = strmres->hstream; + struct strm_object *stream_obj = strmres->stream; DBC_REQUIRE(refs > 0); DBC_REQUIRE(ap_buffer != NULL); @@ -504,8 +504,8 @@ int strm_open(struct node_object *hnode, u32 dir, u32 index, pattr->stream_attr_in->segment_id; strm_obj->buf_alignment = pattr->stream_attr_in->buf_alignment; - strm_obj->udma_chnl_id = - pattr->stream_attr_in->udma_chnl_id; + strm_obj->dma_chnl_id = + pattr->stream_attr_in->dma_chnl_id; strm_obj->dma_priority = pattr->stream_attr_in->dma_priority; chnl_attr_obj.uio_reqs = @@ -516,7 +516,7 @@ int strm_open(struct node_object *hnode, u32 dir, u32 index, strm_obj->strm_mode = STRMMODE_PROCCOPY; strm_obj->segment_id = 0; /* local mem */ strm_obj->buf_alignment = 0; - strm_obj->udma_chnl_id = 0; + strm_obj->dma_chnl_id = 0; strm_obj->dma_priority = 0; chnl_attr_obj.uio_reqs = DEFAULTNUMBUFS; } @@ -655,14 +655,14 @@ int strm_reclaim(struct strm_object *stream_obj, u8 ** buf_ptr, && (!CHNL_IS_IO_CANCELLED(chnl_ioc_obj)) && (stream_obj->strm_mode == STRMMODE_ZEROCOPY)) { /* - * This is a zero-copy channel so chnl_ioc_obj.pbuf + * This is a zero-copy channel so chnl_ioc_obj.buf * contains the DSP address of SM. We need to * translate it to a virtual address for the user * thread to access. * Note: Could add CMM_DSPPA2VA to CMM in the future. */ tmp_buf = cmm_xlator_translate(stream_obj->xlator, - chnl_ioc_obj.pbuf, + chnl_ioc_obj.buf, CMM_DSPPA2PA); if (tmp_buf != NULL) { /* now convert this GPP Pa to Va */ @@ -674,9 +674,9 @@ int strm_reclaim(struct strm_object *stream_obj, u8 ** buf_ptr, if (tmp_buf == NULL) status = -ESRCH; - chnl_ioc_obj.pbuf = tmp_buf; + chnl_ioc_obj.buf = tmp_buf; } - *buf_ptr = chnl_ioc_obj.pbuf; + *buf_ptr = chnl_ioc_obj.buf; } func_end: /* ensure we return a documented return code */ -- cgit v0.10.2 From 121e8f9b9fca6a05602cea1245450e653f0d4ba1 Mon Sep 17 00:00:00 2001 From: Rene Sapiens Date: Tue, 18 Jan 2011 03:19:13 +0000 Subject: staging: tidspbridge: set11 remove hungarian from structs hungarian notation will be removed from the elements inside structures, the next varibles will be renamed: Original: Replacement: hio_mgr io_mgr dw_api_reg_base api_reg_base dw_api_clk_base api_clk_base ap_channel channels pio_requests io_requests pio_completions io_completions pndb_props ndb_props pndb_props_size ndb_props_size pu_num_nodes num_nodes pu_num_procs num_procs psz_path_name sz_path_name pu_index index pargs args pu_allocated allocated psize size hnotification notification pp_rsv_addr rsv_addr prsv_addr rsv_addr pmpu_addr mpu_addr pp_map_addr map_addr ul_map_attr map_attr undb_props_size ndb_props_size Signed-off-by: Rene Sapiens Signed-off-by: Armando Uribe Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/core/_msg_sm.h b/drivers/staging/tidspbridge/core/_msg_sm.h index 25414e0..f6e58e3 100644 --- a/drivers/staging/tidspbridge/core/_msg_sm.h +++ b/drivers/staging/tidspbridge/core/_msg_sm.h @@ -85,7 +85,7 @@ struct msg_mgr { /* Function interface to Bridge driver */ struct bridge_drv_interface *intf_fxns; - struct io_mgr *hio_mgr; /* IO manager */ + struct io_mgr *iomgr; /* IO manager */ struct list_head queue_list; /* List of MSG_QUEUEs */ spinlock_t msg_mgr_lock; /* For critical sections */ /* Signalled when MsgFrame is available */ diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c b/drivers/staging/tidspbridge/core/chnl_sm.c index 0986d87..3c05d7c 100644 --- a/drivers/staging/tidspbridge/core/chnl_sm.c +++ b/drivers/staging/tidspbridge/core/chnl_sm.c @@ -37,9 +37,9 @@ * which may cause timeouts and/or failure offunction sync_wait_on_event. * This invariant condition is: * - * list_empty(&pchnl->pio_completions) ==> pchnl->sync_event is reset + * list_empty(&pchnl->io_completions) ==> pchnl->sync_event is reset * and - * !list_empty(&pchnl->pio_completions) ==> pchnl->sync_event is set. + * !list_empty(&pchnl->io_completions) ==> pchnl->sync_event is set. */ #include @@ -164,7 +164,7 @@ func_cont: if (CHNL_IS_OUTPUT(pchnl->chnl_mode)) { /* Check buffer size on output channels for fit. */ if (byte_size > io_buf_size( - pchnl->chnl_mgr_obj->hio_mgr)) { + pchnl->chnl_mgr_obj->iomgr)) { status = -EINVAL; goto out; } @@ -199,7 +199,7 @@ func_cont: chnl_packet_obj->arg = dw_arg; chnl_packet_obj->status = (is_eos ? CHNL_IOCSTATEOS : CHNL_IOCSTATCOMPLETE); - list_add_tail(&chnl_packet_obj->link, &pchnl->pio_requests); + list_add_tail(&chnl_packet_obj->link, &pchnl->io_requests); pchnl->cio_reqs++; DBC_ASSERT(pchnl->cio_reqs <= pchnl->chnl_packets); /* @@ -212,7 +212,7 @@ func_cont: /* Legacy DSM Processor-Copy */ DBC_ASSERT(pchnl->chnl_type == CHNL_PCPY); /* Request IO from the DSP */ - io_request_chnl(chnl_mgr_obj->hio_mgr, pchnl, + io_request_chnl(chnl_mgr_obj->iomgr, pchnl, (CHNL_IS_INPUT(pchnl->chnl_mode) ? IO_INPUT : IO_OUTPUT), &mb_val); sched_dpc = true; @@ -224,7 +224,7 @@ out: /* Schedule a DPC, to do the actual data transfer */ if (sched_dpc) - iosm_schedule(chnl_mgr_obj->hio_mgr); + iosm_schedule(chnl_mgr_obj->iomgr); return status; } @@ -260,7 +260,7 @@ int bridge_chnl_cancel_io(struct chnl_object *chnl_obj) pchnl->state |= CHNL_STATECANCEL; - if (list_empty(&pchnl->pio_requests)) { + if (list_empty(&pchnl->io_requests)) { spin_unlock_bh(&chnl_mgr_obj->chnl_mgr_lock); return 0; } @@ -268,7 +268,7 @@ int bridge_chnl_cancel_io(struct chnl_object *chnl_obj) if (pchnl->chnl_type == CHNL_PCPY) { /* Indicate we have no more buffers available for transfer: */ if (CHNL_IS_INPUT(pchnl->chnl_mode)) { - io_cancel_chnl(chnl_mgr_obj->hio_mgr, chnl_id); + io_cancel_chnl(chnl_mgr_obj->iomgr, chnl_id); } else { /* Record that we no longer have output buffers * available: */ @@ -276,11 +276,11 @@ int bridge_chnl_cancel_io(struct chnl_object *chnl_obj) } } /* Move all IOR's to IOC queue: */ - list_for_each_entry_safe(chirp, tmp, &pchnl->pio_requests, link) { + list_for_each_entry_safe(chirp, tmp, &pchnl->io_requests, link) { list_del(&chirp->link); chirp->byte_size = 0; chirp->status |= CHNL_IOCSTATCANCEL; - list_add_tail(&chirp->link, &pchnl->pio_completions); + list_add_tail(&chirp->link, &pchnl->io_completions); pchnl->cio_cs++; pchnl->cio_reqs--; DBC_ASSERT(pchnl->cio_reqs >= 0); @@ -315,7 +315,7 @@ int bridge_chnl_close(struct chnl_object *chnl_obj) DBC_ASSERT((pchnl->state & CHNL_STATECANCEL)); /* Invalidate channel object: Protects from CHNL_GetIOCompletion() */ /* Free the slot in the channel manager: */ - pchnl->chnl_mgr_obj->ap_channel[pchnl->chnl_id] = NULL; + pchnl->chnl_mgr_obj->channels[pchnl->chnl_id] = NULL; spin_lock_bh(&pchnl->chnl_mgr_obj->chnl_mgr_lock); pchnl->chnl_mgr_obj->open_channels -= 1; spin_unlock_bh(&pchnl->chnl_mgr_obj->chnl_mgr_lock); @@ -331,10 +331,10 @@ int bridge_chnl_close(struct chnl_object *chnl_obj) pchnl->sync_event = NULL; } /* Free I/O request and I/O completion queues: */ - free_chirp_list(&pchnl->pio_completions); + free_chirp_list(&pchnl->io_completions); pchnl->cio_cs = 0; - free_chirp_list(&pchnl->pio_requests); + free_chirp_list(&pchnl->io_requests); pchnl->cio_reqs = 0; free_chirp_list(&pchnl->free_packets_list); @@ -377,9 +377,9 @@ int bridge_chnl_create(struct chnl_mgr **channel_mgr, DBC_ASSERT(mgr_attrts->max_channels == CHNL_MAXCHANNELS); max_channels = CHNL_MAXCHANNELS + CHNL_MAXCHANNELS * CHNL_PCPY; /* Create array of channels */ - chnl_mgr_obj->ap_channel = kzalloc(sizeof(struct chnl_object *) + chnl_mgr_obj->channels = kzalloc(sizeof(struct chnl_object *) * max_channels, GFP_KERNEL); - if (chnl_mgr_obj->ap_channel) { + if (chnl_mgr_obj->channels) { /* Initialize chnl_mgr object */ chnl_mgr_obj->type = CHNL_TYPESM; chnl_mgr_obj->word_size = mgr_attrts->word_size; @@ -423,7 +423,7 @@ int bridge_chnl_destroy(struct chnl_mgr *hchnl_mgr) for (chnl_id = 0; chnl_id < chnl_mgr_obj->max_channels; chnl_id++) { status = - bridge_chnl_close(chnl_mgr_obj->ap_channel + bridge_chnl_close(chnl_mgr_obj->channels [chnl_id]); if (status) dev_dbg(bridge, "%s: Error status 0x%x\n", @@ -431,7 +431,7 @@ int bridge_chnl_destroy(struct chnl_mgr *hchnl_mgr) } /* Free channel manager object: */ - kfree(chnl_mgr_obj->ap_channel); + kfree(chnl_mgr_obj->channels); /* Set hchnl_mgr to NULL in device object. */ dev_set_chnl_mgr(chnl_mgr_obj->dev_obj, NULL); @@ -475,7 +475,7 @@ int bridge_chnl_flush_io(struct chnl_object *chnl_obj, u32 timeout) && (pchnl->chnl_type == CHNL_PCPY)) { /* Wait for IO completions, up to the specified * timeout: */ - while (!list_empty(&pchnl->pio_requests) && !status) { + while (!list_empty(&pchnl->io_requests) && !status) { status = bridge_chnl_get_ioc(chnl_obj, timeout, &chnl_ioc_obj); if (status) @@ -491,7 +491,7 @@ int bridge_chnl_flush_io(struct chnl_object *chnl_obj, u32 timeout) pchnl->state &= ~CHNL_STATECANCEL; } } - DBC_ENSURE(status || list_empty(&pchnl->pio_requests)); + DBC_ENSURE(status || list_empty(&pchnl->io_requests)); return status; } @@ -551,7 +551,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout, if (!chan_ioc || !pchnl) { status = -EFAULT; } else if (timeout == CHNL_IOCNOWAIT) { - if (list_empty(&pchnl->pio_completions)) + if (list_empty(&pchnl->io_completions)) status = -EREMOTEIO; } @@ -566,7 +566,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout, ioc.status = CHNL_IOCSTATCOMPLETE; if (timeout != - CHNL_IOCNOWAIT && list_empty(&pchnl->pio_completions)) { + CHNL_IOCNOWAIT && list_empty(&pchnl->io_completions)) { if (timeout == CHNL_IOCINFINITE) timeout = SYNC_INFINITE; @@ -581,7 +581,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout, * fails due to unkown causes. */ /* Even though Wait failed, there may be something in * the Q: */ - if (list_empty(&pchnl->pio_completions)) { + if (list_empty(&pchnl->io_completions)) { ioc.status |= CHNL_IOCSTATCANCEL; dequeue_ioc = false; } @@ -592,8 +592,8 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout, omap_mbox_disable_irq(dev_ctxt->mbox, IRQ_RX); if (dequeue_ioc) { /* Dequeue IOC and set chan_ioc; */ - DBC_ASSERT(!list_empty(&pchnl->pio_completions)); - chnl_packet_obj = list_first_entry(&pchnl->pio_completions, + DBC_ASSERT(!list_empty(&pchnl->io_completions)); + chnl_packet_obj = list_first_entry(&pchnl->io_completions, struct chnl_irp, link); list_del(&chnl_packet_obj->link); /* Update chan_ioc from channel state and chirp: */ @@ -619,7 +619,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout, ioc.buf_size = 0; } /* Ensure invariant: If any IOC's are queued for this channel... */ - if (!list_empty(&pchnl->pio_completions)) { + if (!list_empty(&pchnl->io_completions)) { /* Since DSPStream_Reclaim() does not take a timeout * parameter, we pass the stream's timeout value to * bridge_chnl_get_ioc. We cannot determine whether or not @@ -685,7 +685,7 @@ int bridge_chnl_get_mgr_info(struct chnl_mgr *hchnl_mgr, u32 ch_id, return -ECHRNG; /* Return the requested information: */ - mgr_info->chnl_obj = chnl_mgr_obj->ap_channel[ch_id]; + mgr_info->chnl_obj = chnl_mgr_obj->channels[ch_id]; mgr_info->open_channels = chnl_mgr_obj->open_channels; mgr_info->type = chnl_mgr_obj->type; /* total # of chnls */ @@ -752,7 +752,7 @@ int bridge_chnl_open(struct chnl_object **chnl, if (ch_id != CHNL_PICKFREE) { if (ch_id >= chnl_mgr_obj->max_channels) return -ECHRNG; - if (chnl_mgr_obj->ap_channel[ch_id] != NULL) + if (chnl_mgr_obj->channels[ch_id] != NULL) return -EALREADY; } else { /* Check for free channel */ @@ -777,8 +777,8 @@ int bridge_chnl_open(struct chnl_object **chnl, if (status) goto out_err; - INIT_LIST_HEAD(&pchnl->pio_requests); - INIT_LIST_HEAD(&pchnl->pio_completions); + INIT_LIST_HEAD(&pchnl->io_requests); + INIT_LIST_HEAD(&pchnl->io_completions); pchnl->chnl_packets = pattrs->uio_reqs; pchnl->cio_cs = 0; @@ -812,7 +812,7 @@ int bridge_chnl_open(struct chnl_object **chnl, pchnl->chnl_type = CHNL_PCPY; /* Insert channel object in channel manager: */ - chnl_mgr_obj->ap_channel[pchnl->chnl_id] = pchnl; + chnl_mgr_obj->channels[pchnl->chnl_id] = pchnl; spin_lock_bh(&chnl_mgr_obj->chnl_mgr_lock); chnl_mgr_obj->open_channels++; spin_unlock_bh(&chnl_mgr_obj->chnl_mgr_lock); @@ -824,8 +824,8 @@ int bridge_chnl_open(struct chnl_object **chnl, out_err: /* Free memory */ - free_chirp_list(&pchnl->pio_completions); - free_chirp_list(&pchnl->pio_requests); + free_chirp_list(&pchnl->io_completions); + free_chirp_list(&pchnl->io_requests); free_chirp_list(&pchnl->free_packets_list); if (sync_event) @@ -928,7 +928,7 @@ static int search_free_channel(struct chnl_mgr *chnl_mgr_obj, DBC_REQUIRE(chnl_mgr_obj); for (i = 0; i < chnl_mgr_obj->max_channels; i++) { - if (chnl_mgr_obj->ap_channel[i] == NULL) { + if (chnl_mgr_obj->channels[i] == NULL) { status = 0; *chnl = i; break; diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index db8a438..694c0e5 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c @@ -181,7 +181,7 @@ int bridge_io_create(struct io_mgr **io_man, *io_man = NULL; dev_get_chnl_mgr(hdev_obj, &hchnl_mgr); - if (!hchnl_mgr || hchnl_mgr->hio_mgr) + if (!hchnl_mgr || hchnl_mgr->iomgr) return -EFAULT; /* @@ -228,7 +228,7 @@ int bridge_io_create(struct io_mgr **io_man, } /* Return IO manager object to caller... */ - hchnl_mgr->hio_mgr = pio_mgr; + hchnl_mgr->iomgr = pio_mgr; *io_man = pio_mgr; return 0; @@ -1090,16 +1090,16 @@ static void input_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, DBC_ASSERT(chnl_id); goto func_end; } - pchnl = chnl_mgr_obj->ap_channel[chnl_id]; + pchnl = chnl_mgr_obj->channels[chnl_id]; if ((pchnl != NULL) && CHNL_IS_INPUT(pchnl->chnl_mode)) { if ((pchnl->state & ~CHNL_STATEEOS) == CHNL_STATEREADY) { /* Get the I/O request, and attempt a transfer */ - if (!list_empty(&pchnl->pio_requests)) { + if (!list_empty(&pchnl->io_requests)) { if (!pchnl->cio_reqs) goto func_end; chnl_packet_obj = list_first_entry( - &pchnl->pio_requests, + &pchnl->io_requests, struct chnl_irp, link); list_del(&chnl_packet_obj->link); pchnl->cio_reqs--; @@ -1140,7 +1140,7 @@ static void input_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, DSP_STREAMDONE); } /* Tell DSP if no more I/O buffers available */ - if (list_empty(&pchnl->pio_requests)) + if (list_empty(&pchnl->io_requests)) set_chnl_free(sm, pchnl->chnl_id); clear_chnl = true; notify_client = true; @@ -1292,9 +1292,9 @@ static void notify_chnl_complete(struct chnl_object *pchnl, * signalled by the only IO completion list consumer: * bridge_chnl_get_ioc(). */ - signal_event = list_empty(&pchnl->pio_completions); + signal_event = list_empty(&pchnl->io_completions); /* Enqueue the IO completion info for the client */ - list_add_tail(&chnl_packet_obj->link, &pchnl->pio_completions); + list_add_tail(&chnl_packet_obj->link, &pchnl->io_completions); pchnl->cio_cs++; if (pchnl->cio_cs > pchnl->chnl_packets) @@ -1340,8 +1340,8 @@ static void output_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, if (chnl_id == OUTPUTNOTREADY) goto func_end; - pchnl = chnl_mgr_obj->ap_channel[chnl_id]; - if (!pchnl || list_empty(&pchnl->pio_requests)) { + pchnl = chnl_mgr_obj->channels[chnl_id]; + if (!pchnl || list_empty(&pchnl->io_requests)) { /* Shouldn't get here */ goto func_end; } @@ -1350,14 +1350,14 @@ static void output_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, goto func_end; /* Get the I/O request, and attempt a transfer */ - chnl_packet_obj = list_first_entry(&pchnl->pio_requests, + chnl_packet_obj = list_first_entry(&pchnl->io_requests, struct chnl_irp, link); list_del(&chnl_packet_obj->link); pchnl->cio_reqs--; /* Record fact that no more I/O buffers available */ - if (list_empty(&pchnl->pio_requests)) + if (list_empty(&pchnl->io_requests)) chnl_mgr_obj->output_mask &= ~(1 << chnl_id); /* Transfer buffer to DSP side */ diff --git a/drivers/staging/tidspbridge/core/msg_sm.c b/drivers/staging/tidspbridge/core/msg_sm.c index 807d556..94d9e04 100644 --- a/drivers/staging/tidspbridge/core/msg_sm.c +++ b/drivers/staging/tidspbridge/core/msg_sm.c @@ -69,7 +69,7 @@ int bridge_msg_create(struct msg_mgr **msg_man, return -ENOMEM; msg_mgr_obj->on_exit = msg_callback; - msg_mgr_obj->hio_mgr = hio_mgr; + msg_mgr_obj->iomgr = hio_mgr; /* List of MSG_QUEUEs */ INIT_LIST_HEAD(&msg_mgr_obj->queue_list); /* @@ -356,7 +356,7 @@ int bridge_msg_put(struct msg_queue *msg_queue_obj, /* Release critical section before scheduling DPC */ spin_unlock_bh(&hmsg_mgr->msg_mgr_lock); /* Schedule a DPC, to do the actual data transfer: */ - iosm_schedule(hmsg_mgr->hio_mgr); + iosm_schedule(hmsg_mgr->iomgr); return 0; } @@ -410,7 +410,7 @@ int bridge_msg_put(struct msg_queue *msg_queue_obj, * Schedule a DPC, to do the actual * data transfer. */ - iosm_schedule(hmsg_mgr->hio_mgr); + iosm_schedule(hmsg_mgr->iomgr); msg_queue_obj->io_msg_pend--; /* Reset event if there are still frames available */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h b/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h index 9110cab..d60e252 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/_chnl_sm.h @@ -114,7 +114,7 @@ struct shm { struct chnl_mgr { /* Function interface to Bridge driver */ struct bridge_drv_interface *intf_fxns; - struct io_mgr *hio_mgr; /* IO manager */ + struct io_mgr *iomgr; /* IO manager */ /* Device this board represents */ struct dev_object *dev_obj; @@ -126,7 +126,7 @@ struct chnl_mgr { u32 word_size; /* Size in bytes of DSP word */ u8 max_channels; /* Total number of channels */ u8 open_channels; /* Total number of open channels */ - struct chnl_object **ap_channel; /* Array of channels */ + struct chnl_object **channels; /* Array of channels */ u8 type; /* Type of channel class library */ /* If no shm syms, return for CHNL_Open */ int chnl_open_status; @@ -148,12 +148,12 @@ struct chnl_object { struct sync_object *sync_event; u32 process; /* Process which created this channel */ u32 cb_arg; /* Argument to use with callback */ - struct list_head pio_requests; /* List of IOR's to driver */ + struct list_head io_requests; /* List of IOR's to driver */ s32 cio_cs; /* Number of IOC's in queue */ s32 cio_reqs; /* Number of IORequests in queue */ s32 chnl_packets; /* Initial number of free Irps */ /* List of IOC's from driver */ - struct list_head pio_completions; + struct list_head io_completions; struct list_head free_packets_list; /* List of free Irps */ struct ntfy_object *ntfy_obj; u32 bytes_moved; /* Total number of bytes transfered */ diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h b/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h index f43b3ed..6d1e33e 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h @@ -29,22 +29,22 @@ union trapped_args { /* MGR Module */ struct { u32 node_id; - struct dsp_ndbprops __user *pndb_props; - u32 undb_props_size; - u32 __user *pu_num_nodes; + struct dsp_ndbprops __user *ndb_props; + u32 ndb_props_size; + u32 __user *num_nodes; } args_mgr_enumnode_info; struct { u32 processor_id; struct dsp_processorinfo __user *processor_info; u32 processor_info_size; - u32 __user *pu_num_procs; + u32 __user *num_procs; } args_mgr_enumproc_info; struct { struct dsp_uuid *uuid_obj; enum dsp_dcdobjtype obj_type; - char *psz_path_name; + char *sz_path_name; } args_mgr_registerobject; struct { @@ -55,7 +55,7 @@ union trapped_args { struct { struct dsp_notification __user *__user *anotifications; u32 count; - u32 __user *pu_index; + u32 __user *index; u32 timeout; } args_mgr_wait; @@ -69,7 +69,7 @@ union trapped_args { struct { void *processor; u32 cmd; - struct dsp_cbdata __user *pargs; + struct dsp_cbdata __user *args; } args_proc_ctrl; struct { @@ -80,8 +80,8 @@ union trapped_args { void *processor; void *__user *node_tab; u32 node_tab_size; - u32 __user *pu_num_nodes; - u32 __user *pu_allocated; + u32 __user *num_nodes; + u32 __user *allocated; } args_proc_enumnode_info; struct { @@ -100,7 +100,7 @@ union trapped_args { struct { void *processor; u8 __user *buf; - u8 __user *psize; + u8 __user *size; u32 max_size; } args_proc_gettrace; @@ -115,28 +115,28 @@ union trapped_args { void *processor; u32 event_mask; u32 notify_type; - struct dsp_notification __user *hnotification; + struct dsp_notification __user *notification; } args_proc_register_notify; struct { void *processor; u32 size; - void *__user *pp_rsv_addr; + void *__user *rsv_addr; } args_proc_rsvmem; struct { void *processor; u32 size; - void *prsv_addr; + void *rsv_addr; } args_proc_unrsvmem; struct { void *processor; - void *pmpu_addr; + void *mpu_addr; u32 size; void *req_addr; - void *__user *pp_map_addr; - u32 ul_map_attr; + void *__user *map_addr; + u32 map_attr; } args_proc_mapmem; struct { @@ -147,21 +147,21 @@ union trapped_args { struct { void *processor; - void *pmpu_addr; + void *mpu_addr; u32 size; u32 dir; } args_proc_dma; struct { void *processor; - void *pmpu_addr; + void *mpu_addr; u32 size; u32 ul_flags; } args_proc_flushmemory; struct { void *processor; - void *pmpu_addr; + void *mpu_addr; u32 size; } args_proc_invalidatememory; @@ -169,7 +169,7 @@ union trapped_args { struct { void *processor; struct dsp_uuid __user *node_id_ptr; - struct dsp_cbdata __user *pargs; + struct dsp_cbdata __user *args; struct dsp_nodeattrin __user *attr_in; void *__user *ph_node; } args_node_allocate; @@ -235,7 +235,7 @@ union trapped_args { void *node; u32 event_mask; u32 notify_type; - struct dsp_notification __user *hnotification; + struct dsp_notification __user *notification; } args_node_registernotify; struct { @@ -316,7 +316,7 @@ union trapped_args { void *stream; u32 event_mask; u32 notify_type; - struct dsp_notification __user *hnotification; + struct dsp_notification __user *notification; } args_strm_registernotify; struct { diff --git a/drivers/staging/tidspbridge/pmgr/dev.c b/drivers/staging/tidspbridge/pmgr/dev.c index d35b2ad..9a38d86 100644 --- a/drivers/staging/tidspbridge/pmgr/dev.c +++ b/drivers/staging/tidspbridge/pmgr/dev.c @@ -69,7 +69,7 @@ struct dev_object { struct chnl_mgr *chnl_mgr; /* Channel manager. */ struct deh_mgr *deh_mgr; /* DEH manager. */ struct msg_mgr *msg_mgr; /* Message manager. */ - struct io_mgr *hio_mgr; /* IO manager (CHNL, msg_ctrl) */ + struct io_mgr *iomgr; /* IO manager (CHNL, msg_ctrl) */ struct cmm_object *cmm_mgr; /* SM memory manager. */ struct dmm_object *dmm_mgr; /* Dynamic memory manager. */ u32 word_size; /* DSP word size: quick access. */ @@ -235,7 +235,7 @@ int dev_create_device(struct dev_object **device_obj, (struct dev_object *)dev_obj, NULL); /* Only create IO manager if we have a channel manager */ if (!status && dev_obj->chnl_mgr) { - status = io_create(&dev_obj->hio_mgr, dev_obj, + status = io_create(&dev_obj->iomgr, dev_obj, &io_mgr_attrs); } /* Only create DEH manager if we have an IO manager */ @@ -351,9 +351,9 @@ int dev_destroy_device(struct dev_object *hdev_obj) } /* Free the io, channel, and message managers for this board: */ - if (dev_obj->hio_mgr) { - io_destroy(dev_obj->hio_mgr); - dev_obj->hio_mgr = NULL; + if (dev_obj->iomgr) { + io_destroy(dev_obj->iomgr); + dev_obj->iomgr = NULL; } if (dev_obj->chnl_mgr) { chnl_destroy(dev_obj->chnl_mgr); @@ -605,7 +605,7 @@ int dev_get_io_mgr(struct dev_object *hdev_obj, DBC_REQUIRE(hdev_obj); if (hdev_obj) { - *io_man = hdev_obj->hio_mgr; + *io_man = hdev_obj->iomgr; } else { *io_man = NULL; status = -EFAULT; diff --git a/drivers/staging/tidspbridge/pmgr/dspapi.c b/drivers/staging/tidspbridge/pmgr/dspapi.c index 1d86bd1..52717d9 100644 --- a/drivers/staging/tidspbridge/pmgr/dspapi.c +++ b/drivers/staging/tidspbridge/pmgr/dspapi.c @@ -416,7 +416,7 @@ u32 mgrwrap_enum_node_info(union trapped_args *args, void *pr_ctxt) u8 *pndb_props; u32 num_nodes; int status = 0; - u32 size = args->args_mgr_enumnode_info.undb_props_size; + u32 size = args->args_mgr_enumnode_info.ndb_props_size; if (size < sizeof(struct dsp_ndbprops)) return -EINVAL; @@ -431,9 +431,9 @@ u32 mgrwrap_enum_node_info(union trapped_args *args, void *pr_ctxt) (struct dsp_ndbprops *)pndb_props, size, &num_nodes); } - CP_TO_USR(args->args_mgr_enumnode_info.pndb_props, pndb_props, status, + CP_TO_USR(args->args_mgr_enumnode_info.ndb_props, pndb_props, status, size); - CP_TO_USR(args->args_mgr_enumnode_info.pu_num_nodes, &num_nodes, status, + CP_TO_USR(args->args_mgr_enumnode_info.num_nodes, &num_nodes, status, 1); kfree(pndb_props); @@ -466,7 +466,7 @@ u32 mgrwrap_enum_proc_info(union trapped_args *args, void *pr_ctxt) } CP_TO_USR(args->args_mgr_enumproc_info.processor_info, processor_info, status, size); - CP_TO_USR(args->args_mgr_enumproc_info.pu_num_procs, &num_procs, + CP_TO_USR(args->args_mgr_enumproc_info.num_procs, &num_procs, status, 1); kfree(processor_info); @@ -490,7 +490,7 @@ u32 mgrwrap_register_object(union trapped_args *args, void *pr_ctxt) goto func_end; /* path_size is increased by 1 to accommodate NULL */ path_size = strlen_user((char *) - args->args_mgr_registerobject.psz_path_name) + + args->args_mgr_registerobject.sz_path_name) + 1; psz_path_name = kmalloc(path_size, GFP_KERNEL); if (!psz_path_name) { @@ -499,7 +499,7 @@ u32 mgrwrap_register_object(union trapped_args *args, void *pr_ctxt) } ret = strncpy_from_user(psz_path_name, (char *)args->args_mgr_registerobject. - psz_path_name, path_size); + sz_path_name, path_size); if (!ret) { status = -EFAULT; goto func_end; @@ -571,7 +571,7 @@ u32 mgrwrap_wait_for_bridge_events(union trapped_args *args, void *pr_ctxt) args->args_mgr_wait. timeout); } - CP_TO_USR(args->args_mgr_wait.pu_index, &index, status, 1); + CP_TO_USR(args->args_mgr_wait.index, &index, status, 1); return status; } @@ -617,7 +617,7 @@ func_end: u32 procwrap_ctrl(union trapped_args *args, void *pr_ctxt) { u32 cb_data_size, __user * psize = (u32 __user *) - args->args_proc_ctrl.pargs; + args->args_proc_ctrl.args; u8 *pargs = NULL; int status = 0; void *hprocessor = ((struct process_context *)pr_ctxt)->processor; @@ -634,7 +634,7 @@ u32 procwrap_ctrl(union trapped_args *args, void *pr_ctxt) goto func_end; } - CP_FM_USR(pargs, args->args_proc_ctrl.pargs, status, + CP_FM_USR(pargs, args->args_proc_ctrl.args, status, cb_data_size); } if (!status) { @@ -643,7 +643,7 @@ u32 procwrap_ctrl(union trapped_args *args, void *pr_ctxt) (struct dsp_cbdata *)pargs); } - /* CP_TO_USR(args->args_proc_ctrl.pargs, pargs, status, 1); */ + /* CP_TO_USR(args->args_proc_ctrl.args, pargs, status, 1); */ kfree(pargs); func_end: return status; @@ -679,9 +679,9 @@ u32 procwrap_enum_node_info(union trapped_args *args, void *pr_ctxt) &num_nodes, &alloc_cnt); CP_TO_USR(args->args_proc_enumnode_info.node_tab, node_tab, status, num_nodes); - CP_TO_USR(args->args_proc_enumnode_info.pu_num_nodes, &num_nodes, + CP_TO_USR(args->args_proc_enumnode_info.num_nodes, &num_nodes, status, 1); - CP_TO_USR(args->args_proc_enumnode_info.pu_allocated, &alloc_cnt, + CP_TO_USR(args->args_proc_enumnode_info.allocated, &alloc_cnt, status, 1); return status; } @@ -694,7 +694,7 @@ u32 procwrap_end_dma(union trapped_args *args, void *pr_ctxt) return -EINVAL; status = proc_end_dma(pr_ctxt, - args->args_proc_dma.pmpu_addr, + args->args_proc_dma.mpu_addr, args->args_proc_dma.size, args->args_proc_dma.dir); return status; @@ -708,7 +708,7 @@ u32 procwrap_begin_dma(union trapped_args *args, void *pr_ctxt) return -EINVAL; status = proc_begin_dma(pr_ctxt, - args->args_proc_dma.pmpu_addr, + args->args_proc_dma.mpu_addr, args->args_proc_dma.size, args->args_proc_dma.dir); return status; @@ -726,7 +726,7 @@ u32 procwrap_flush_memory(union trapped_args *args, void *pr_ctxt) return -EINVAL; status = proc_flush_memory(pr_ctxt, - args->args_proc_flushmemory.pmpu_addr, + args->args_proc_flushmemory.mpu_addr, args->args_proc_flushmemory.size, args->args_proc_flushmemory.ul_flags); return status; @@ -741,7 +741,7 @@ u32 procwrap_invalidate_memory(union trapped_args *args, void *pr_ctxt) status = proc_invalidate_memory(pr_ctxt, - args->args_proc_invalidatememory.pmpu_addr, + args->args_proc_invalidatememory.mpu_addr, args->args_proc_invalidatememory.size); return status; } @@ -954,12 +954,12 @@ u32 procwrap_map(union trapped_args *args, void *pr_ctxt) return -EINVAL; status = proc_map(args->args_proc_mapmem.processor, - args->args_proc_mapmem.pmpu_addr, + args->args_proc_mapmem.mpu_addr, args->args_proc_mapmem.size, args->args_proc_mapmem.req_addr, &map_addr, - args->args_proc_mapmem.ul_map_attr, pr_ctxt); + args->args_proc_mapmem.map_attr, pr_ctxt); if (!status) { - if (put_user(map_addr, args->args_proc_mapmem.pp_map_addr)) { + if (put_user(map_addr, args->args_proc_mapmem.map_addr)) { status = -EINVAL; proc_un_map(hprocessor, map_addr, pr_ctxt); } @@ -985,7 +985,7 @@ u32 procwrap_register_notify(union trapped_args *args, void *pr_ctxt) args->args_proc_register_notify.event_mask, args->args_proc_register_notify.notify_type, ¬ification); - CP_TO_USR(args->args_proc_register_notify.hnotification, ¬ification, + CP_TO_USR(args->args_proc_register_notify.notification, ¬ification, status, 1); return status; } @@ -1007,7 +1007,7 @@ u32 procwrap_reserve_memory(union trapped_args *args, void *pr_ctxt) args->args_proc_rsvmem.size, &prsv_addr, pr_ctxt); if (!status) { - if (put_user(prsv_addr, args->args_proc_rsvmem.pp_rsv_addr)) { + if (put_user(prsv_addr, args->args_proc_rsvmem.rsv_addr)) { status = -EINVAL; proc_un_reserve_memory(args->args_proc_rsvmem. processor, prsv_addr, pr_ctxt); @@ -1048,7 +1048,7 @@ u32 procwrap_un_reserve_memory(union trapped_args *args, void *pr_ctxt) void *hprocessor = ((struct process_context *)pr_ctxt)->processor; status = proc_un_reserve_memory(hprocessor, - args->args_proc_unrsvmem.prsv_addr, + args->args_proc_unrsvmem.rsv_addr, pr_ctxt); return status; } @@ -1087,7 +1087,7 @@ u32 nodewrap_allocate(union trapped_args *args, void *pr_ctxt) int status = 0; struct dsp_uuid node_uuid; u32 cb_data_size = 0; - u32 __user *psize = (u32 __user *) args->args_node_allocate.pargs; + u32 __user *psize = (u32 __user *) args->args_node_allocate.args; u8 *pargs = NULL; struct dsp_nodeattrin proc_attr_in, *attr_in = NULL; struct node_res_object *node_res; @@ -1106,7 +1106,7 @@ u32 nodewrap_allocate(union trapped_args *args, void *pr_ctxt) status = -ENOMEM; } - CP_FM_USR(pargs, args->args_node_allocate.pargs, status, + CP_FM_USR(pargs, args->args_node_allocate.args, status, cb_data_size); } CP_FM_USR(&node_uuid, args->args_node_allocate.node_id_ptr, status, 1); @@ -1449,14 +1449,14 @@ u32 nodewrap_register_notify(union trapped_args *args, void *pr_ctxt) if (!args->args_proc_register_notify.event_mask) CP_FM_USR(¬ification, - args->args_proc_register_notify.hnotification, + args->args_proc_register_notify.notification, status, 1); status = node_register_notify(node_res->node, args->args_node_registernotify.event_mask, args->args_node_registernotify. notify_type, ¬ification); - CP_TO_USR(args->args_node_registernotify.hnotification, ¬ification, + CP_TO_USR(args->args_node_registernotify.notification, ¬ification, status, 1); return status; } @@ -1815,7 +1815,7 @@ u32 strmwrap_register_notify(union trapped_args *args, void *pr_ctxt) args->args_strm_registernotify.event_mask, args->args_strm_registernotify. notify_type, ¬ification); - CP_TO_USR(args->args_strm_registernotify.hnotification, ¬ification, + CP_TO_USR(args->args_strm_registernotify.notification, ¬ification, status, 1); return status; diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c index 5653837..5dadaa4 100644 --- a/drivers/staging/tidspbridge/rmgr/node.c +++ b/drivers/staging/tidspbridge/rmgr/node.c @@ -207,7 +207,7 @@ struct node_object { struct node_createargs create_args; /* Args for node create func */ nodeenv node_env; /* Environment returned by RMS */ struct dcd_genericobj dcd_props; /* Node properties from DCD */ - struct dsp_cbdata *pargs; /* Optional args to pass to node */ + struct dsp_cbdata *args; /* Optional args to pass to node */ struct ntfy_object *ntfy_obj; /* Manages registered notifications */ char *str_dev_name; /* device name, if device node */ struct sync_object *sync_done; /* Synchronize node_terminate */ -- cgit v0.10.2 From fbbb4959eee4762a2fa60c6352be2284ebb1cb67 Mon Sep 17 00:00:00 2001 From: Rene Sapiens Date: Tue, 18 Jan 2011 03:19:14 +0000 Subject: staging: tidspbridge: set12 remove hungarian from structs hungarian notation will be removed from the elements inside structures, the next varibles will be renamed: Original: Replacement: dw_buf_size buf_size dw_bytes bytes pattr attr pdw_arg arg ph_cmm_mgr cmm_mgr ph_event event ph_node node ph_stream stream pmask mask pp_argv argv pp_buf_va buf_va pstatus status ul_flags flags ul_seg_id seg_id usize size Signed-off-by: Rene Sapiens Signed-off-by: Armando Uribe Signed-off-by: Omar Ramirez Luna diff --git a/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h b/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h index 6d1e33e..6ff8082 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h +++ b/drivers/staging/tidspbridge/include/dspbridge/dspapi-ioctl.h @@ -156,7 +156,7 @@ union trapped_args { void *processor; void *mpu_addr; u32 size; - u32 ul_flags; + u32 flags; } args_proc_flushmemory; struct { @@ -171,13 +171,13 @@ union trapped_args { struct dsp_uuid __user *node_id_ptr; struct dsp_cbdata __user *args; struct dsp_nodeattrin __user *attr_in; - void *__user *ph_node; + void *__user *node; } args_node_allocate; struct { void *node; - u32 usize; - struct dsp_bufferattr __user *pattr; + u32 size; + struct dsp_bufferattr __user *attr; u8 *__user *buffer; } args_node_allocmsgbuf; @@ -191,7 +191,7 @@ union trapped_args { u32 stream_id; void *other_node; u32 other_stream; - struct dsp_strmattr __user *pattrs; + struct dsp_strmattr __user *attrs; struct dsp_cbdata __user *conn_param; } args_node_connect; @@ -205,13 +205,13 @@ union trapped_args { struct { void *node; - struct dsp_bufferattr __user *pattr; + struct dsp_bufferattr __user *attr; u8 *buffer; } args_node_freemsgbuf; struct { void *node; - struct dsp_nodeattr __user *pattr; + struct dsp_nodeattr __user *attr; u32 attr_size; } args_node_getattr; @@ -244,7 +244,7 @@ union trapped_args { struct { void *node; - int __user *pstatus; + int __user *status; } args_node_terminate; struct { @@ -257,7 +257,7 @@ union trapped_args { struct { void *stream; - u32 usize; + u32 size; u8 *__user *ap_buffer; u32 num_bufs; } args_strm_allocatebuffer; @@ -274,7 +274,7 @@ union trapped_args { struct { void *stream; - void **ph_event; + void **event; } args_strm_geteventhandle; struct { @@ -291,8 +291,8 @@ union trapped_args { struct { void *stream; u8 *buffer; - u32 dw_bytes; - u32 dw_buf_size; + u32 bytes; + u32 buf_size; u32 arg; } args_strm_issue; @@ -301,7 +301,7 @@ union trapped_args { u32 direction; u32 index; struct strm_attr __user *attr_in; - void *__user *ph_stream; + void *__user *stream; } args_strm_open; struct { @@ -309,7 +309,7 @@ union trapped_args { u8 *__user *buf_ptr; u32 __user *bytes; u32 __user *buf_size_ptr; - u32 __user *pdw_arg; + u32 __user *arg; } args_strm_reclaim; struct { @@ -322,27 +322,27 @@ union trapped_args { struct { void *__user *stream_tab; u32 strm_num; - u32 __user *pmask; + u32 __user *mask; u32 timeout; } args_strm_select; /* CMM Module */ struct { struct cmm_object *cmm_mgr; - u32 usize; - struct cmm_attrs *pattrs; - void **pp_buf_va; + u32 size; + struct cmm_attrs *attrs; + void **buf_va; } args_cmm_allocbuf; struct { struct cmm_object *cmm_mgr; void *buf_pa; - u32 ul_seg_id; + u32 seg_id; } args_cmm_freebuf; struct { void *processor; - struct cmm_object *__user *ph_cmm_mgr; + struct cmm_object *__user *cmm_mgr; } args_cmm_gethandle; struct { @@ -353,7 +353,7 @@ union trapped_args { /* UTIL module */ struct { s32 util_argc; - char **pp_argv; + char **argv; } args_util_testdll; }; diff --git a/drivers/staging/tidspbridge/pmgr/dspapi.c b/drivers/staging/tidspbridge/pmgr/dspapi.c index 52717d9..767ffe2 100644 --- a/drivers/staging/tidspbridge/pmgr/dspapi.c +++ b/drivers/staging/tidspbridge/pmgr/dspapi.c @@ -721,14 +721,14 @@ u32 procwrap_flush_memory(union trapped_args *args, void *pr_ctxt) { int status; - if (args->args_proc_flushmemory.ul_flags > + if (args->args_proc_flushmemory.flags > PROC_WRITEBACK_INVALIDATE_MEM) return -EINVAL; status = proc_flush_memory(pr_ctxt, args->args_proc_flushmemory.mpu_addr, args->args_proc_flushmemory.size, - args->args_proc_flushmemory.ul_flags); + args->args_proc_flushmemory.flags); return status; } @@ -1129,7 +1129,7 @@ u32 nodewrap_allocate(union trapped_args *args, void *pr_ctxt) } if (!status) { nodeid = node_res->id + 1; - CP_TO_USR(args->args_node_allocate.ph_node, &nodeid, + CP_TO_USR(args->args_node_allocate.node, &nodeid, status, 1); if (status) { status = -EFAULT; @@ -1159,11 +1159,11 @@ u32 nodewrap_alloc_msg_buf(union trapped_args *args, void *pr_ctxt) if (!node_res) return -EFAULT; - if (!args->args_node_allocmsgbuf.usize) + if (!args->args_node_allocmsgbuf.size) return -EINVAL; - if (args->args_node_allocmsgbuf.pattr) { /* Optional argument */ - CP_FM_USR(&attr, args->args_node_allocmsgbuf.pattr, status, 1); + if (args->args_node_allocmsgbuf.attr) { /* Optional argument */ + CP_FM_USR(&attr, args->args_node_allocmsgbuf.attr, status, 1); if (!status) pattr = &attr; @@ -1172,7 +1172,7 @@ u32 nodewrap_alloc_msg_buf(union trapped_args *args, void *pr_ctxt) CP_FM_USR(&pbuffer, args->args_node_allocmsgbuf.buffer, status, 1); if (!status) { status = node_alloc_msg_buf(node_res->node, - args->args_node_allocmsgbuf.usize, + args->args_node_allocmsgbuf.size, pattr, &pbuffer); } CP_TO_USR(args->args_node_allocmsgbuf.buffer, &pbuffer, status, 1); @@ -1253,8 +1253,8 @@ u32 nodewrap_connect(union trapped_args *args, void *pr_ctxt) if (status) goto func_cont; } - if (args->args_node_connect.pattrs) { /* Optional argument */ - CP_FM_USR(&attrs, args->args_node_connect.pattrs, status, 1); + if (args->args_node_connect.attrs) { /* Optional argument */ + CP_FM_USR(&attrs, args->args_node_connect.attrs, status, 1); if (!status) pattrs = &attrs; @@ -1323,8 +1323,8 @@ u32 nodewrap_free_msg_buf(union trapped_args *args, void *pr_ctxt) if (!node_res) return -EFAULT; - if (args->args_node_freemsgbuf.pattr) { /* Optional argument */ - CP_FM_USR(&attr, args->args_node_freemsgbuf.pattr, status, 1); + if (args->args_node_freemsgbuf.attr) { /* Optional argument */ + CP_FM_USR(&attr, args->args_node_freemsgbuf.attr, status, 1); if (!status) pattr = &attr; @@ -1358,7 +1358,7 @@ u32 nodewrap_get_attr(union trapped_args *args, void *pr_ctxt) status = node_get_attr(node_res->node, &attr, args->args_node_getattr.attr_size); - CP_TO_USR(args->args_node_getattr.pattr, &attr, status, 1); + CP_TO_USR(args->args_node_getattr.attr, &attr, status, 1); return status; } @@ -1495,7 +1495,7 @@ u32 nodewrap_terminate(union trapped_args *args, void *pr_ctxt) status = node_terminate(node_res->node, &tempstatus); - CP_TO_USR(args->args_node_terminate.pstatus, &tempstatus, status, 1); + CP_TO_USR(args->args_node_terminate.status, &tempstatus, status, 1); return status; } @@ -1564,7 +1564,7 @@ u32 strmwrap_allocate_buffer(union trapped_args *args, void *pr_ctxt) return -ENOMEM; status = strm_allocate_buffer(strm_res, - args->args_strm_allocatebuffer.usize, + args->args_strm_allocatebuffer.size, ap_buffer, num_bufs, pr_ctxt); if (!status) { CP_TO_USR(args->args_strm_allocatebuffer.ap_buffer, ap_buffer, @@ -1715,8 +1715,8 @@ u32 strmwrap_issue(union trapped_args *args, void *pr_ctxt) in chnl_sm.c */ status = strm_issue(strm_res->stream, args->args_strm_issue.buffer, - args->args_strm_issue.dw_bytes, - args->args_strm_issue.dw_buf_size, + args->args_strm_issue.bytes, + args->args_strm_issue.buf_size, args->args_strm_issue.arg); return status; @@ -1756,7 +1756,7 @@ u32 strmwrap_open(union trapped_args *args, void *pr_ctxt) pr_ctxt); if (!status) { strmid = strm_res_obj->id + 1; - CP_TO_USR(args->args_strm_open.ph_stream, &strmid, status, 1); + CP_TO_USR(args->args_strm_open.stream, &strmid, status, 1); } return status; } @@ -1782,7 +1782,7 @@ u32 strmwrap_reclaim(union trapped_args *args, void *pr_ctxt) &ul_bytes, &ul_buf_size, &dw_arg); CP_TO_USR(args->args_strm_reclaim.buf_ptr, &buf_ptr, status, 1); CP_TO_USR(args->args_strm_reclaim.bytes, &ul_bytes, status, 1); - CP_TO_USR(args->args_strm_reclaim.pdw_arg, &dw_arg, status, 1); + CP_TO_USR(args->args_strm_reclaim.arg, &dw_arg, status, 1); if (args->args_strm_reclaim.buf_size_ptr != NULL) { CP_TO_USR(args->args_strm_reclaim.buf_size_ptr, &ul_buf_size, @@ -1855,7 +1855,7 @@ u32 strmwrap_select(union trapped_args *args, void *pr_ctxt) status = strm_select(strm_tab, args->args_strm_select.strm_num, &mask, args->args_strm_select.timeout); } - CP_TO_USR(args->args_strm_select.pmask, &mask, status, 1); + CP_TO_USR(args->args_strm_select.mask, &mask, status, 1); return status; } @@ -1892,7 +1892,7 @@ u32 cmmwrap_get_handle(union trapped_args *args, void *pr_ctxt) status = cmm_get_handle(hprocessor, &hcmm_mgr); - CP_TO_USR(args->args_cmm_gethandle.ph_cmm_mgr, &hcmm_mgr, status, 1); + CP_TO_USR(args->args_cmm_gethandle.cmm_mgr, &hcmm_mgr, status, 1); return status; } -- cgit v0.10.2