staging: vc04_services: Remove VCHIQ_STATE_T typedef
Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun <inf.braun@fau.de> Signed-off-by: Tobias Büttner <tobias.buettner@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f5a9826986
commit
2d0a029113
@ -105,7 +105,7 @@ static void
|
|||||||
free_pagelist(struct vchiq_pagelist_info *pagelistinfo,
|
free_pagelist(struct vchiq_pagelist_info *pagelistinfo,
|
||||||
int actual);
|
int actual);
|
||||||
|
|
||||||
int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state)
|
int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct vchiq_drvdata *drvdata = platform_get_drvdata(pdev);
|
struct vchiq_drvdata *drvdata = platform_get_drvdata(pdev);
|
||||||
@ -203,7 +203,7 @@ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VCHIQ_STATUS_T
|
VCHIQ_STATUS_T
|
||||||
vchiq_platform_init_state(VCHIQ_STATE_T *state)
|
vchiq_platform_init_state(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
VCHIQ_STATUS_T status = VCHIQ_SUCCESS;
|
VCHIQ_STATUS_T status = VCHIQ_SUCCESS;
|
||||||
struct vchiq_2835_state *platform_state;
|
struct vchiq_2835_state *platform_state;
|
||||||
@ -221,7 +221,7 @@ vchiq_platform_init_state(VCHIQ_STATE_T *state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct vchiq_arm_state*
|
struct vchiq_arm_state*
|
||||||
vchiq_platform_get_arm_state(VCHIQ_STATE_T *state)
|
vchiq_platform_get_arm_state(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
struct vchiq_2835_state *platform_state;
|
struct vchiq_2835_state *platform_state;
|
||||||
|
|
||||||
@ -290,29 +290,29 @@ vchiq_dump_platform_state(void *dump_context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VCHIQ_STATUS_T
|
VCHIQ_STATUS_T
|
||||||
vchiq_platform_suspend(VCHIQ_STATE_T *state)
|
vchiq_platform_suspend(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
return VCHIQ_ERROR;
|
return VCHIQ_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
VCHIQ_STATUS_T
|
VCHIQ_STATUS_T
|
||||||
vchiq_platform_resume(VCHIQ_STATE_T *state)
|
vchiq_platform_resume(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
return VCHIQ_SUCCESS;
|
return VCHIQ_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vchiq_platform_paused(VCHIQ_STATE_T *state)
|
vchiq_platform_paused(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vchiq_platform_resumed(VCHIQ_STATE_T *state)
|
vchiq_platform_resumed(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
vchiq_platform_videocore_wanted(VCHIQ_STATE_T *state)
|
vchiq_platform_videocore_wanted(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
return 1; // autosuspend not supported - videocore always wanted
|
return 1; // autosuspend not supported - videocore always wanted
|
||||||
}
|
}
|
||||||
@ -323,12 +323,12 @@ vchiq_platform_use_suspend_timer(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
vchiq_dump_platform_use_state(VCHIQ_STATE_T *state)
|
vchiq_dump_platform_use_state(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
vchiq_log_info(vchiq_arm_log_level, "Suspend timer not in use");
|
vchiq_log_info(vchiq_arm_log_level, "Suspend timer not in use");
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
vchiq_platform_handle_timeout(VCHIQ_STATE_T *state)
|
vchiq_platform_handle_timeout(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
(void)state;
|
(void)state;
|
||||||
}
|
}
|
||||||
@ -339,7 +339,7 @@ vchiq_platform_handle_timeout(VCHIQ_STATE_T *state)
|
|||||||
static irqreturn_t
|
static irqreturn_t
|
||||||
vchiq_doorbell_irq(int irq, void *dev_id)
|
vchiq_doorbell_irq(int irq, void *dev_id)
|
||||||
{
|
{
|
||||||
VCHIQ_STATE_T *state = dev_id;
|
struct vchiq_state *state = dev_id;
|
||||||
irqreturn_t ret = IRQ_NONE;
|
irqreturn_t ret = IRQ_NONE;
|
||||||
unsigned int status;
|
unsigned int status;
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ struct bulk_waiter_node {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct vchiq_instance_struct {
|
struct vchiq_instance_struct {
|
||||||
VCHIQ_STATE_T *state;
|
struct vchiq_state *state;
|
||||||
struct vchiq_completion_data completions[MAX_COMPLETIONS];
|
struct vchiq_completion_data completions[MAX_COMPLETIONS];
|
||||||
int completion_insert;
|
int completion_insert;
|
||||||
int completion_remove;
|
int completion_remove;
|
||||||
@ -162,7 +162,7 @@ struct dump_context {
|
|||||||
|
|
||||||
static struct cdev vchiq_cdev;
|
static struct cdev vchiq_cdev;
|
||||||
static dev_t vchiq_devid;
|
static dev_t vchiq_devid;
|
||||||
static VCHIQ_STATE_T g_state;
|
static struct vchiq_state g_state;
|
||||||
static struct class *vchiq_class;
|
static struct class *vchiq_class;
|
||||||
static DEFINE_SPINLOCK(msg_queue_spinlock);
|
static DEFINE_SPINLOCK(msg_queue_spinlock);
|
||||||
static struct platform_device *bcm2835_camera;
|
static struct platform_device *bcm2835_camera;
|
||||||
@ -208,7 +208,7 @@ vchiq_blocking_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *data,
|
|||||||
VCHIQ_STATUS_T vchiq_initialise(VCHIQ_INSTANCE_T *instance_out)
|
VCHIQ_STATUS_T vchiq_initialise(VCHIQ_INSTANCE_T *instance_out)
|
||||||
{
|
{
|
||||||
VCHIQ_STATUS_T status = VCHIQ_ERROR;
|
VCHIQ_STATUS_T status = VCHIQ_ERROR;
|
||||||
VCHIQ_STATE_T *state;
|
struct vchiq_state *state;
|
||||||
VCHIQ_INSTANCE_T instance = NULL;
|
VCHIQ_INSTANCE_T instance = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ EXPORT_SYMBOL(vchiq_initialise);
|
|||||||
VCHIQ_STATUS_T vchiq_shutdown(VCHIQ_INSTANCE_T instance)
|
VCHIQ_STATUS_T vchiq_shutdown(VCHIQ_INSTANCE_T instance)
|
||||||
{
|
{
|
||||||
VCHIQ_STATUS_T status;
|
VCHIQ_STATUS_T status;
|
||||||
VCHIQ_STATE_T *state = instance->state;
|
struct vchiq_state *state = instance->state;
|
||||||
|
|
||||||
vchiq_log_trace(vchiq_core_log_level,
|
vchiq_log_trace(vchiq_core_log_level,
|
||||||
"%s(%p) called", __func__, instance);
|
"%s(%p) called", __func__, instance);
|
||||||
@ -303,7 +303,7 @@ static int vchiq_is_connected(VCHIQ_INSTANCE_T instance)
|
|||||||
VCHIQ_STATUS_T vchiq_connect(VCHIQ_INSTANCE_T instance)
|
VCHIQ_STATUS_T vchiq_connect(VCHIQ_INSTANCE_T instance)
|
||||||
{
|
{
|
||||||
VCHIQ_STATUS_T status;
|
VCHIQ_STATUS_T status;
|
||||||
VCHIQ_STATE_T *state = instance->state;
|
struct vchiq_state *state = instance->state;
|
||||||
|
|
||||||
vchiq_log_trace(vchiq_core_log_level,
|
vchiq_log_trace(vchiq_core_log_level,
|
||||||
"%s(%p) called", __func__, instance);
|
"%s(%p) called", __func__, instance);
|
||||||
@ -335,7 +335,7 @@ VCHIQ_STATUS_T vchiq_add_service(
|
|||||||
VCHIQ_SERVICE_HANDLE_T *phandle)
|
VCHIQ_SERVICE_HANDLE_T *phandle)
|
||||||
{
|
{
|
||||||
VCHIQ_STATUS_T status;
|
VCHIQ_STATUS_T status;
|
||||||
VCHIQ_STATE_T *state = instance->state;
|
struct vchiq_state *state = instance->state;
|
||||||
struct vchiq_service *service = NULL;
|
struct vchiq_service *service = NULL;
|
||||||
int srvstate;
|
int srvstate;
|
||||||
|
|
||||||
@ -374,7 +374,7 @@ VCHIQ_STATUS_T vchiq_open_service(
|
|||||||
VCHIQ_SERVICE_HANDLE_T *phandle)
|
VCHIQ_SERVICE_HANDLE_T *phandle)
|
||||||
{
|
{
|
||||||
VCHIQ_STATUS_T status = VCHIQ_ERROR;
|
VCHIQ_STATUS_T status = VCHIQ_ERROR;
|
||||||
VCHIQ_STATE_T *state = instance->state;
|
struct vchiq_state *state = instance->state;
|
||||||
struct vchiq_service *service = NULL;
|
struct vchiq_service *service = NULL;
|
||||||
|
|
||||||
vchiq_log_trace(vchiq_core_log_level,
|
vchiq_log_trace(vchiq_core_log_level,
|
||||||
@ -1956,7 +1956,7 @@ vchiq_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|||||||
|
|
||||||
static int vchiq_open(struct inode *inode, struct file *file)
|
static int vchiq_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
VCHIQ_STATE_T *state = vchiq_get_state();
|
struct vchiq_state *state = vchiq_get_state();
|
||||||
VCHIQ_INSTANCE_T instance;
|
VCHIQ_INSTANCE_T instance;
|
||||||
|
|
||||||
vchiq_log_info(vchiq_arm_log_level, "vchiq_open");
|
vchiq_log_info(vchiq_arm_log_level, "vchiq_open");
|
||||||
@ -1990,7 +1990,7 @@ static int vchiq_open(struct inode *inode, struct file *file)
|
|||||||
static int vchiq_release(struct inode *inode, struct file *file)
|
static int vchiq_release(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
VCHIQ_INSTANCE_T instance = file->private_data;
|
VCHIQ_INSTANCE_T instance = file->private_data;
|
||||||
VCHIQ_STATE_T *state = vchiq_get_state();
|
struct vchiq_state *state = vchiq_get_state();
|
||||||
struct vchiq_service *service;
|
struct vchiq_service *service;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int i;
|
int i;
|
||||||
@ -2158,7 +2158,7 @@ vchiq_dump(void *dump_context, const char *str, int len)
|
|||||||
void
|
void
|
||||||
vchiq_dump_platform_instances(void *dump_context)
|
vchiq_dump_platform_instances(void *dump_context)
|
||||||
{
|
{
|
||||||
VCHIQ_STATE_T *state = vchiq_get_state();
|
struct vchiq_state *state = vchiq_get_state();
|
||||||
char buf[80];
|
char buf[80];
|
||||||
int len;
|
int len;
|
||||||
int i;
|
int i;
|
||||||
@ -2257,7 +2257,7 @@ vchiq_read(struct file *file, char __user *buf,
|
|||||||
return context.actual;
|
return context.actual;
|
||||||
}
|
}
|
||||||
|
|
||||||
VCHIQ_STATE_T *
|
struct vchiq_state *
|
||||||
vchiq_get_state(void)
|
vchiq_get_state(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -2288,7 +2288,7 @@ vchiq_fops = {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
vchiq_videocore_wanted(VCHIQ_STATE_T *state)
|
vchiq_videocore_wanted(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
||||||
|
|
||||||
@ -2322,7 +2322,7 @@ vchiq_keepalive_vchiq_callback(VCHIQ_REASON_T reason,
|
|||||||
static int
|
static int
|
||||||
vchiq_keepalive_thread_func(void *v)
|
vchiq_keepalive_thread_func(void *v)
|
||||||
{
|
{
|
||||||
VCHIQ_STATE_T *state = (VCHIQ_STATE_T *) v;
|
struct vchiq_state *state = (struct vchiq_state *)v;
|
||||||
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
||||||
|
|
||||||
VCHIQ_STATUS_T status;
|
VCHIQ_STATUS_T status;
|
||||||
@ -2401,7 +2401,8 @@ exit:
|
|||||||
}
|
}
|
||||||
|
|
||||||
VCHIQ_STATUS_T
|
VCHIQ_STATUS_T
|
||||||
vchiq_arm_init_state(VCHIQ_STATE_T *state, struct vchiq_arm_state *arm_state)
|
vchiq_arm_init_state(struct vchiq_state *state,
|
||||||
|
struct vchiq_arm_state *arm_state)
|
||||||
{
|
{
|
||||||
if (arm_state) {
|
if (arm_state) {
|
||||||
rwlock_init(&arm_state->susp_res_lock);
|
rwlock_init(&arm_state->susp_res_lock);
|
||||||
@ -2583,7 +2584,7 @@ stop_suspend_timer(struct vchiq_arm_state *arm_state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
need_resume(VCHIQ_STATE_T *state)
|
need_resume(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
||||||
|
|
||||||
@ -2668,7 +2669,7 @@ unblock_resume(struct vchiq_arm_state *arm_state)
|
|||||||
/* Initiate suspend via slot handler. Should be called with the write lock
|
/* Initiate suspend via slot handler. Should be called with the write lock
|
||||||
* held */
|
* held */
|
||||||
VCHIQ_STATUS_T
|
VCHIQ_STATUS_T
|
||||||
vchiq_arm_vcsuspend(VCHIQ_STATE_T *state)
|
vchiq_arm_vcsuspend(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
VCHIQ_STATUS_T status = VCHIQ_ERROR;
|
VCHIQ_STATUS_T status = VCHIQ_ERROR;
|
||||||
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
||||||
@ -2717,7 +2718,7 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vchiq_platform_check_suspend(VCHIQ_STATE_T *state)
|
vchiq_platform_check_suspend(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
||||||
int susp = 0;
|
int susp = 0;
|
||||||
@ -2744,7 +2745,7 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
output_timeout_error(VCHIQ_STATE_T *state)
|
output_timeout_error(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
||||||
char err[50] = "";
|
char err[50] = "";
|
||||||
@ -2789,7 +2790,7 @@ output_msg:
|
|||||||
** videocore failed to suspend in time or VCHIQ_ERROR if interrupted.
|
** videocore failed to suspend in time or VCHIQ_ERROR if interrupted.
|
||||||
*/
|
*/
|
||||||
VCHIQ_STATUS_T
|
VCHIQ_STATUS_T
|
||||||
vchiq_arm_force_suspend(VCHIQ_STATE_T *state)
|
vchiq_arm_force_suspend(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
||||||
VCHIQ_STATUS_T status = VCHIQ_ERROR;
|
VCHIQ_STATUS_T status = VCHIQ_ERROR;
|
||||||
@ -2900,7 +2901,7 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vchiq_check_suspend(VCHIQ_STATE_T *state)
|
vchiq_check_suspend(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
||||||
|
|
||||||
@ -2922,7 +2923,7 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
vchiq_arm_allow_resume(VCHIQ_STATE_T *state)
|
vchiq_arm_allow_resume(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
||||||
int resume = 0;
|
int resume = 0;
|
||||||
@ -2966,7 +2967,7 @@ out:
|
|||||||
|
|
||||||
/* This function should be called with the write lock held */
|
/* This function should be called with the write lock held */
|
||||||
int
|
int
|
||||||
vchiq_check_resume(VCHIQ_STATE_T *state)
|
vchiq_check_resume(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
||||||
int resume = 0;
|
int resume = 0;
|
||||||
@ -2988,7 +2989,7 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
VCHIQ_STATUS_T
|
VCHIQ_STATUS_T
|
||||||
vchiq_use_internal(VCHIQ_STATE_T *state, struct vchiq_service *service,
|
vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
|
||||||
enum USE_TYPE_E use_type)
|
enum USE_TYPE_E use_type)
|
||||||
{
|
{
|
||||||
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
||||||
@ -3121,7 +3122,7 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
VCHIQ_STATUS_T
|
VCHIQ_STATUS_T
|
||||||
vchiq_release_internal(VCHIQ_STATE_T *state, struct vchiq_service *service)
|
vchiq_release_internal(struct vchiq_state *state, struct vchiq_service *service)
|
||||||
{
|
{
|
||||||
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
||||||
VCHIQ_STATUS_T ret = VCHIQ_SUCCESS;
|
VCHIQ_STATUS_T ret = VCHIQ_SUCCESS;
|
||||||
@ -3183,7 +3184,7 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vchiq_on_remote_use(VCHIQ_STATE_T *state)
|
vchiq_on_remote_use(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
||||||
|
|
||||||
@ -3193,7 +3194,7 @@ vchiq_on_remote_use(VCHIQ_STATE_T *state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vchiq_on_remote_release(VCHIQ_STATE_T *state)
|
vchiq_on_remote_release(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
||||||
|
|
||||||
@ -3266,7 +3267,7 @@ static void suspend_timer_callback(struct timer_list *t)
|
|||||||
{
|
{
|
||||||
struct vchiq_arm_state *arm_state =
|
struct vchiq_arm_state *arm_state =
|
||||||
from_timer(arm_state, t, suspend_timer);
|
from_timer(arm_state, t, suspend_timer);
|
||||||
VCHIQ_STATE_T *state = arm_state->state;
|
struct vchiq_state *state = arm_state->state;
|
||||||
|
|
||||||
vchiq_log_info(vchiq_susp_log_level,
|
vchiq_log_info(vchiq_susp_log_level,
|
||||||
"%s - suspend timer expired - check suspend", __func__);
|
"%s - suspend timer expired - check suspend", __func__);
|
||||||
@ -3321,7 +3322,7 @@ struct service_data_struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
vchiq_dump_service_use_state(VCHIQ_STATE_T *state)
|
vchiq_dump_service_use_state(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
||||||
struct service_data_struct *service_data;
|
struct service_data_struct *service_data;
|
||||||
@ -3440,13 +3441,14 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* stub functions */
|
/* stub functions */
|
||||||
void vchiq_on_remote_use_active(VCHIQ_STATE_T *state)
|
void vchiq_on_remote_use_active(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
(void)state;
|
(void)state;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vchiq_platform_conn_state_changed(VCHIQ_STATE_T *state,
|
void vchiq_platform_conn_state_changed(struct vchiq_state *state,
|
||||||
VCHIQ_CONNSTATE_T oldstate, VCHIQ_CONNSTATE_T newstate)
|
VCHIQ_CONNSTATE_T oldstate,
|
||||||
|
VCHIQ_CONNSTATE_T newstate)
|
||||||
{
|
{
|
||||||
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state);
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ struct vchiq_arm_state {
|
|||||||
|
|
||||||
unsigned int wake_address;
|
unsigned int wake_address;
|
||||||
|
|
||||||
VCHIQ_STATE_T *state;
|
struct vchiq_state *state;
|
||||||
struct timer_list suspend_timer;
|
struct timer_list suspend_timer;
|
||||||
int suspend_timer_timeout;
|
int suspend_timer_timeout;
|
||||||
int suspend_timer_running;
|
int suspend_timer_running;
|
||||||
@ -131,31 +131,33 @@ struct vchiq_drvdata {
|
|||||||
extern int vchiq_arm_log_level;
|
extern int vchiq_arm_log_level;
|
||||||
extern int vchiq_susp_log_level;
|
extern int vchiq_susp_log_level;
|
||||||
|
|
||||||
int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state);
|
int vchiq_platform_init(struct platform_device *pdev,
|
||||||
|
struct vchiq_state *state);
|
||||||
|
|
||||||
extern VCHIQ_STATE_T *
|
extern struct vchiq_state *
|
||||||
vchiq_get_state(void);
|
vchiq_get_state(void);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_arm_vcsuspend(VCHIQ_STATE_T *state);
|
vchiq_arm_vcsuspend(struct vchiq_state *state);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_arm_force_suspend(VCHIQ_STATE_T *state);
|
vchiq_arm_force_suspend(struct vchiq_state *state);
|
||||||
|
|
||||||
extern int
|
extern int
|
||||||
vchiq_arm_allow_resume(VCHIQ_STATE_T *state);
|
vchiq_arm_allow_resume(struct vchiq_state *state);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_arm_vcresume(VCHIQ_STATE_T *state);
|
vchiq_arm_vcresume(struct vchiq_state *state);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_arm_init_state(VCHIQ_STATE_T *state, struct vchiq_arm_state *arm_state);
|
vchiq_arm_init_state(struct vchiq_state *state,
|
||||||
|
struct vchiq_arm_state *arm_state);
|
||||||
|
|
||||||
extern int
|
extern int
|
||||||
vchiq_check_resume(VCHIQ_STATE_T *state);
|
vchiq_check_resume(struct vchiq_state *state);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
vchiq_check_suspend(VCHIQ_STATE_T *state);
|
vchiq_check_suspend(struct vchiq_state *state);
|
||||||
VCHIQ_STATUS_T
|
VCHIQ_STATUS_T
|
||||||
vchiq_use_service(VCHIQ_SERVICE_HANDLE_T handle);
|
vchiq_use_service(VCHIQ_SERVICE_HANDLE_T handle);
|
||||||
|
|
||||||
@ -166,31 +168,32 @@ extern VCHIQ_STATUS_T
|
|||||||
vchiq_check_service(struct vchiq_service *service);
|
vchiq_check_service(struct vchiq_service *service);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_platform_suspend(VCHIQ_STATE_T *state);
|
vchiq_platform_suspend(struct vchiq_state *state);
|
||||||
|
|
||||||
extern int
|
extern int
|
||||||
vchiq_platform_videocore_wanted(VCHIQ_STATE_T *state);
|
vchiq_platform_videocore_wanted(struct vchiq_state *state);
|
||||||
|
|
||||||
extern int
|
extern int
|
||||||
vchiq_platform_use_suspend_timer(void);
|
vchiq_platform_use_suspend_timer(void);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
vchiq_dump_platform_use_state(VCHIQ_STATE_T *state);
|
vchiq_dump_platform_use_state(struct vchiq_state *state);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
vchiq_dump_service_use_state(VCHIQ_STATE_T *state);
|
vchiq_dump_service_use_state(struct vchiq_state *state);
|
||||||
|
|
||||||
extern struct vchiq_arm_state*
|
extern struct vchiq_arm_state*
|
||||||
vchiq_platform_get_arm_state(VCHIQ_STATE_T *state);
|
vchiq_platform_get_arm_state(struct vchiq_state *state);
|
||||||
|
|
||||||
extern int
|
extern int
|
||||||
vchiq_videocore_wanted(VCHIQ_STATE_T *state);
|
vchiq_videocore_wanted(struct vchiq_state *state);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_use_internal(VCHIQ_STATE_T *state, struct vchiq_service *service,
|
vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
|
||||||
enum USE_TYPE_E use_type);
|
enum USE_TYPE_E use_type);
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_release_internal(VCHIQ_STATE_T *state, struct vchiq_service *service);
|
vchiq_release_internal(struct vchiq_state *state,
|
||||||
|
struct vchiq_service *service);
|
||||||
|
|
||||||
extern struct vchiq_debugfs_node *
|
extern struct vchiq_debugfs_node *
|
||||||
vchiq_instance_get_debugfs_node(VCHIQ_INSTANCE_T instance);
|
vchiq_instance_get_debugfs_node(VCHIQ_INSTANCE_T instance);
|
||||||
|
@ -88,7 +88,7 @@ static DEFINE_SPINLOCK(service_spinlock);
|
|||||||
DEFINE_SPINLOCK(bulk_waiter_spinlock);
|
DEFINE_SPINLOCK(bulk_waiter_spinlock);
|
||||||
static DEFINE_SPINLOCK(quota_spinlock);
|
static DEFINE_SPINLOCK(quota_spinlock);
|
||||||
|
|
||||||
VCHIQ_STATE_T *vchiq_states[VCHIQ_MAX_STATES];
|
struct vchiq_state *vchiq_states[VCHIQ_MAX_STATES];
|
||||||
static unsigned int handle_seq;
|
static unsigned int handle_seq;
|
||||||
|
|
||||||
static const char *const srvstate_names[] = {
|
static const char *const srvstate_names[] = {
|
||||||
@ -127,7 +127,7 @@ static const char *const conn_state_names[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
release_message_sync(VCHIQ_STATE_T *state, struct vchiq_header *header);
|
release_message_sync(struct vchiq_state *state, struct vchiq_header *header);
|
||||||
|
|
||||||
static const char *msg_type_str(unsigned int msg_type)
|
static const char *msg_type_str(unsigned int msg_type)
|
||||||
{
|
{
|
||||||
@ -184,7 +184,7 @@ find_service_by_handle(VCHIQ_SERVICE_HANDLE_T handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct vchiq_service *
|
struct vchiq_service *
|
||||||
find_service_by_port(VCHIQ_STATE_T *state, int localport)
|
find_service_by_port(struct vchiq_state *state, int localport)
|
||||||
{
|
{
|
||||||
struct vchiq_service *service = NULL;
|
struct vchiq_service *service = NULL;
|
||||||
|
|
||||||
@ -257,8 +257,8 @@ find_closed_service_for_instance(VCHIQ_INSTANCE_T instance,
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct vchiq_service *
|
struct vchiq_service *
|
||||||
next_service_by_instance(VCHIQ_STATE_T *state, VCHIQ_INSTANCE_T instance,
|
next_service_by_instance(struct vchiq_state *state, VCHIQ_INSTANCE_T instance,
|
||||||
int *pidx)
|
int *pidx)
|
||||||
{
|
{
|
||||||
struct vchiq_service *service = NULL;
|
struct vchiq_service *service = NULL;
|
||||||
int idx = *pidx;
|
int idx = *pidx;
|
||||||
@ -308,7 +308,7 @@ unlock_service(struct vchiq_service *service)
|
|||||||
}
|
}
|
||||||
service->ref_count--;
|
service->ref_count--;
|
||||||
if (!service->ref_count) {
|
if (!service->ref_count) {
|
||||||
VCHIQ_STATE_T *state = service->state;
|
struct vchiq_state *state = service->state;
|
||||||
|
|
||||||
WARN_ON(service->srvstate != VCHIQ_SRVSTATE_FREE);
|
WARN_ON(service->srvstate != VCHIQ_SRVSTATE_FREE);
|
||||||
state->services[service->localport] = NULL;
|
state->services[service->localport] = NULL;
|
||||||
@ -356,7 +356,7 @@ vchiq_get_service_fourcc(VCHIQ_SERVICE_HANDLE_T handle)
|
|||||||
static void
|
static void
|
||||||
mark_service_closing_internal(struct vchiq_service *service, int sh_thread)
|
mark_service_closing_internal(struct vchiq_service *service, int sh_thread)
|
||||||
{
|
{
|
||||||
VCHIQ_STATE_T *state = service->state;
|
struct vchiq_state *state = service->state;
|
||||||
struct vchiq_service_quota *service_quota;
|
struct vchiq_service_quota *service_quota;
|
||||||
|
|
||||||
service->closing = 1;
|
service->closing = 1;
|
||||||
@ -405,7 +405,7 @@ make_service_callback(struct vchiq_service *service, VCHIQ_REASON_T reason,
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
vchiq_set_conn_state(VCHIQ_STATE_T *state, VCHIQ_CONNSTATE_T newstate)
|
vchiq_set_conn_state(struct vchiq_state *state, VCHIQ_CONNSTATE_T newstate)
|
||||||
{
|
{
|
||||||
VCHIQ_CONNSTATE_T oldstate = state->conn_state;
|
VCHIQ_CONNSTATE_T oldstate = state->conn_state;
|
||||||
|
|
||||||
@ -458,7 +458,7 @@ remote_event_poll(wait_queue_head_t *wq, struct remote_event *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
remote_event_pollall(VCHIQ_STATE_T *state)
|
remote_event_pollall(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
remote_event_poll(&state->sync_trigger_event, &state->local->sync_trigger);
|
remote_event_poll(&state->sync_trigger_event, &state->local->sync_trigger);
|
||||||
remote_event_poll(&state->sync_release_event, &state->local->sync_release);
|
remote_event_poll(&state->sync_release_event, &state->local->sync_release);
|
||||||
@ -483,7 +483,7 @@ calc_stride(size_t size)
|
|||||||
|
|
||||||
/* Called by the slot handler thread */
|
/* Called by the slot handler thread */
|
||||||
static struct vchiq_service *
|
static struct vchiq_service *
|
||||||
get_listening_service(VCHIQ_STATE_T *state, int fourcc)
|
get_listening_service(struct vchiq_state *state, int fourcc)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -507,7 +507,7 @@ get_listening_service(VCHIQ_STATE_T *state, int fourcc)
|
|||||||
|
|
||||||
/* Called by the slot handler thread */
|
/* Called by the slot handler thread */
|
||||||
static struct vchiq_service *
|
static struct vchiq_service *
|
||||||
get_connected_service(VCHIQ_STATE_T *state, unsigned int port)
|
get_connected_service(struct vchiq_state *state, unsigned int port)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -524,7 +524,8 @@ get_connected_service(VCHIQ_STATE_T *state, unsigned int port)
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
request_poll(VCHIQ_STATE_T *state, struct vchiq_service *service, int poll_type)
|
request_poll(struct vchiq_state *state, struct vchiq_service *service,
|
||||||
|
int poll_type)
|
||||||
{
|
{
|
||||||
u32 value;
|
u32 value;
|
||||||
|
|
||||||
@ -553,7 +554,7 @@ request_poll(VCHIQ_STATE_T *state, struct vchiq_service *service, int poll_type)
|
|||||||
/* Called from queue_message, by the slot handler and application threads,
|
/* Called from queue_message, by the slot handler and application threads,
|
||||||
** with slot_mutex held */
|
** with slot_mutex held */
|
||||||
static struct vchiq_header *
|
static struct vchiq_header *
|
||||||
reserve_space(VCHIQ_STATE_T *state, size_t space, int is_blocking)
|
reserve_space(struct vchiq_state *state, size_t space, int is_blocking)
|
||||||
{
|
{
|
||||||
struct vchiq_shared_state *local = state->local;
|
struct vchiq_shared_state *local = state->local;
|
||||||
int tx_pos = state->local_tx_pos;
|
int tx_pos = state->local_tx_pos;
|
||||||
@ -614,7 +615,8 @@ reserve_space(VCHIQ_STATE_T *state, size_t space, int is_blocking)
|
|||||||
|
|
||||||
/* Called by the recycle thread. */
|
/* Called by the recycle thread. */
|
||||||
static void
|
static void
|
||||||
process_free_queue(VCHIQ_STATE_T *state, BITSET_T *service_found, size_t length)
|
process_free_queue(struct vchiq_state *state, BITSET_T *service_found,
|
||||||
|
size_t length)
|
||||||
{
|
{
|
||||||
struct vchiq_shared_state *local = state->local;
|
struct vchiq_shared_state *local = state->local;
|
||||||
int slot_queue_available;
|
int slot_queue_available;
|
||||||
@ -799,7 +801,8 @@ copy_message_data(
|
|||||||
|
|
||||||
/* Called by the slot handler and application threads */
|
/* Called by the slot handler and application threads */
|
||||||
static VCHIQ_STATUS_T
|
static VCHIQ_STATUS_T
|
||||||
queue_message(VCHIQ_STATE_T *state, struct vchiq_service *service, int msgid,
|
queue_message(struct vchiq_state *state, struct vchiq_service *service,
|
||||||
|
int msgid,
|
||||||
ssize_t (*copy_callback)(void *context, void *dest,
|
ssize_t (*copy_callback)(void *context, void *dest,
|
||||||
size_t offset, size_t maxsize),
|
size_t offset, size_t maxsize),
|
||||||
void *context, size_t size, int flags)
|
void *context, size_t size, int flags)
|
||||||
@ -1046,7 +1049,7 @@ queue_message(VCHIQ_STATE_T *state, struct vchiq_service *service, int msgid,
|
|||||||
|
|
||||||
/* Called by the slot handler and application threads */
|
/* Called by the slot handler and application threads */
|
||||||
static VCHIQ_STATUS_T
|
static VCHIQ_STATUS_T
|
||||||
queue_message_sync(VCHIQ_STATE_T *state, struct vchiq_service *service,
|
queue_message_sync(struct vchiq_state *state, struct vchiq_service *service,
|
||||||
int msgid,
|
int msgid,
|
||||||
ssize_t (*copy_callback)(void *context, void *dest,
|
ssize_t (*copy_callback)(void *context, void *dest,
|
||||||
size_t offset, size_t maxsize),
|
size_t offset, size_t maxsize),
|
||||||
@ -1144,7 +1147,7 @@ claim_slot(struct vchiq_slot_info *slot)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
release_slot(VCHIQ_STATE_T *state, struct vchiq_slot_info *slot_info,
|
release_slot(struct vchiq_state *state, struct vchiq_slot_info *slot_info,
|
||||||
struct vchiq_header *header, struct vchiq_service *service)
|
struct vchiq_header *header, struct vchiq_service *service)
|
||||||
{
|
{
|
||||||
int release_count;
|
int release_count;
|
||||||
@ -1282,7 +1285,7 @@ notify_bulks(struct vchiq_service *service, struct vchiq_bulk_queue *queue,
|
|||||||
|
|
||||||
/* Called by the slot handler thread */
|
/* Called by the slot handler thread */
|
||||||
static void
|
static void
|
||||||
poll_services(VCHIQ_STATE_T *state)
|
poll_services(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
int group, i;
|
int group, i;
|
||||||
|
|
||||||
@ -1399,7 +1402,7 @@ abort_outstanding_bulks(struct vchiq_service *service,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
parse_open(VCHIQ_STATE_T *state, struct vchiq_header *header)
|
parse_open(struct vchiq_state *state, struct vchiq_header *header)
|
||||||
{
|
{
|
||||||
struct vchiq_service *service = NULL;
|
struct vchiq_service *service = NULL;
|
||||||
int msgid, size;
|
int msgid, size;
|
||||||
@ -1521,7 +1524,7 @@ bail_not_ready:
|
|||||||
|
|
||||||
/* Called by the slot handler thread */
|
/* Called by the slot handler thread */
|
||||||
static void
|
static void
|
||||||
parse_rx_slots(VCHIQ_STATE_T *state)
|
parse_rx_slots(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
struct vchiq_shared_state *remote = state->remote;
|
struct vchiq_shared_state *remote = state->remote;
|
||||||
struct vchiq_service *service = NULL;
|
struct vchiq_service *service = NULL;
|
||||||
@ -1873,7 +1876,7 @@ bail_not_ready:
|
|||||||
static int
|
static int
|
||||||
slot_handler_func(void *v)
|
slot_handler_func(void *v)
|
||||||
{
|
{
|
||||||
VCHIQ_STATE_T *state = (VCHIQ_STATE_T *) v;
|
struct vchiq_state *state = (struct vchiq_state *)v;
|
||||||
struct vchiq_shared_state *local = state->local;
|
struct vchiq_shared_state *local = state->local;
|
||||||
|
|
||||||
DEBUG_INITIALISE(local)
|
DEBUG_INITIALISE(local)
|
||||||
@ -1957,7 +1960,7 @@ slot_handler_func(void *v)
|
|||||||
static int
|
static int
|
||||||
recycle_func(void *v)
|
recycle_func(void *v)
|
||||||
{
|
{
|
||||||
VCHIQ_STATE_T *state = (VCHIQ_STATE_T *) v;
|
struct vchiq_state *state = (struct vchiq_state *)v;
|
||||||
struct vchiq_shared_state *local = state->local;
|
struct vchiq_shared_state *local = state->local;
|
||||||
BITSET_T *found;
|
BITSET_T *found;
|
||||||
size_t length;
|
size_t length;
|
||||||
@ -1981,7 +1984,7 @@ recycle_func(void *v)
|
|||||||
static int
|
static int
|
||||||
sync_func(void *v)
|
sync_func(void *v)
|
||||||
{
|
{
|
||||||
VCHIQ_STATE_T *state = (VCHIQ_STATE_T *) v;
|
struct vchiq_state *state = (struct vchiq_state *)v;
|
||||||
struct vchiq_shared_state *local = state->local;
|
struct vchiq_shared_state *local = state->local;
|
||||||
struct vchiq_header *header =
|
struct vchiq_header *header =
|
||||||
(struct vchiq_header *)SLOT_DATA_FROM_INDEX(state,
|
(struct vchiq_header *)SLOT_DATA_FROM_INDEX(state,
|
||||||
@ -2142,7 +2145,7 @@ vchiq_init_slots(void *mem_base, int mem_size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VCHIQ_STATUS_T
|
VCHIQ_STATUS_T
|
||||||
vchiq_init_state(VCHIQ_STATE_T *state, struct vchiq_slot_zero *slot_zero)
|
vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero)
|
||||||
{
|
{
|
||||||
struct vchiq_shared_state *local;
|
struct vchiq_shared_state *local;
|
||||||
struct vchiq_shared_state *remote;
|
struct vchiq_shared_state *remote;
|
||||||
@ -2172,7 +2175,7 @@ vchiq_init_state(VCHIQ_STATE_T *state, struct vchiq_slot_zero *slot_zero)
|
|||||||
return VCHIQ_ERROR;
|
return VCHIQ_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(state, 0, sizeof(VCHIQ_STATE_T));
|
memset(state, 0, sizeof(struct vchiq_state));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
initialize shared state pointers
|
initialize shared state pointers
|
||||||
@ -2297,9 +2300,10 @@ fail_free_handler_thread:
|
|||||||
|
|
||||||
/* Called from application thread when a client or server service is created. */
|
/* Called from application thread when a client or server service is created. */
|
||||||
struct vchiq_service *
|
struct vchiq_service *
|
||||||
vchiq_add_service_internal(VCHIQ_STATE_T *state,
|
vchiq_add_service_internal(struct vchiq_state *state,
|
||||||
const struct vchiq_service_params *params, int srvstate,
|
const struct vchiq_service_params *params,
|
||||||
VCHIQ_INSTANCE_T instance, VCHIQ_USERDATA_TERM_T userdata_term)
|
int srvstate, VCHIQ_INSTANCE_T instance,
|
||||||
|
VCHIQ_USERDATA_TERM_T userdata_term)
|
||||||
{
|
{
|
||||||
struct vchiq_service *service;
|
struct vchiq_service *service;
|
||||||
struct vchiq_service **pservice = NULL;
|
struct vchiq_service **pservice = NULL;
|
||||||
@ -2473,7 +2477,7 @@ vchiq_open_service_internal(struct vchiq_service *service, int client_id)
|
|||||||
static void
|
static void
|
||||||
release_service_messages(struct vchiq_service *service)
|
release_service_messages(struct vchiq_service *service)
|
||||||
{
|
{
|
||||||
VCHIQ_STATE_T *state = service->state;
|
struct vchiq_state *state = service->state;
|
||||||
int slot_last = state->remote->slot_last;
|
int slot_last = state->remote->slot_last;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -2615,7 +2619,7 @@ close_service_complete(struct vchiq_service *service, int failstate)
|
|||||||
VCHIQ_STATUS_T
|
VCHIQ_STATUS_T
|
||||||
vchiq_close_service_internal(struct vchiq_service *service, int close_recvd)
|
vchiq_close_service_internal(struct vchiq_service *service, int close_recvd)
|
||||||
{
|
{
|
||||||
VCHIQ_STATE_T *state = service->state;
|
struct vchiq_state *state = service->state;
|
||||||
VCHIQ_STATUS_T status = VCHIQ_SUCCESS;
|
VCHIQ_STATUS_T status = VCHIQ_SUCCESS;
|
||||||
int is_server = (service->public_fourcc != VCHIQ_FOURCC_INVALID);
|
int is_server = (service->public_fourcc != VCHIQ_FOURCC_INVALID);
|
||||||
|
|
||||||
@ -2749,7 +2753,7 @@ vchiq_close_service_internal(struct vchiq_service *service, int close_recvd)
|
|||||||
void
|
void
|
||||||
vchiq_terminate_service_internal(struct vchiq_service *service)
|
vchiq_terminate_service_internal(struct vchiq_service *service)
|
||||||
{
|
{
|
||||||
VCHIQ_STATE_T *state = service->state;
|
struct vchiq_state *state = service->state;
|
||||||
|
|
||||||
vchiq_log_info(vchiq_core_log_level, "%d: tsi - (%d<->%d)",
|
vchiq_log_info(vchiq_core_log_level, "%d: tsi - (%d<->%d)",
|
||||||
state->id, service->localport, service->remoteport);
|
state->id, service->localport, service->remoteport);
|
||||||
@ -2764,7 +2768,7 @@ vchiq_terminate_service_internal(struct vchiq_service *service)
|
|||||||
void
|
void
|
||||||
vchiq_free_service_internal(struct vchiq_service *service)
|
vchiq_free_service_internal(struct vchiq_service *service)
|
||||||
{
|
{
|
||||||
VCHIQ_STATE_T *state = service->state;
|
struct vchiq_state *state = service->state;
|
||||||
|
|
||||||
vchiq_log_info(vchiq_core_log_level, "%d: fsi - (%d)",
|
vchiq_log_info(vchiq_core_log_level, "%d: fsi - (%d)",
|
||||||
state->id, service->localport);
|
state->id, service->localport);
|
||||||
@ -2793,7 +2797,7 @@ vchiq_free_service_internal(struct vchiq_service *service)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VCHIQ_STATUS_T
|
VCHIQ_STATUS_T
|
||||||
vchiq_connect_internal(VCHIQ_STATE_T *state, VCHIQ_INSTANCE_T instance)
|
vchiq_connect_internal(struct vchiq_state *state, VCHIQ_INSTANCE_T instance)
|
||||||
{
|
{
|
||||||
struct vchiq_service *service;
|
struct vchiq_service *service;
|
||||||
int i;
|
int i;
|
||||||
@ -2829,7 +2833,7 @@ vchiq_connect_internal(VCHIQ_STATE_T *state, VCHIQ_INSTANCE_T instance)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VCHIQ_STATUS_T
|
VCHIQ_STATUS_T
|
||||||
vchiq_shutdown_internal(VCHIQ_STATE_T *state, VCHIQ_INSTANCE_T instance)
|
vchiq_shutdown_internal(struct vchiq_state *state, VCHIQ_INSTANCE_T instance)
|
||||||
{
|
{
|
||||||
struct vchiq_service *service;
|
struct vchiq_service *service;
|
||||||
int i;
|
int i;
|
||||||
@ -2846,7 +2850,7 @@ vchiq_shutdown_internal(VCHIQ_STATE_T *state, VCHIQ_INSTANCE_T instance)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VCHIQ_STATUS_T
|
VCHIQ_STATUS_T
|
||||||
vchiq_pause_internal(VCHIQ_STATE_T *state)
|
vchiq_pause_internal(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
VCHIQ_STATUS_T status = VCHIQ_SUCCESS;
|
VCHIQ_STATUS_T status = VCHIQ_SUCCESS;
|
||||||
|
|
||||||
@ -2869,7 +2873,7 @@ vchiq_pause_internal(VCHIQ_STATE_T *state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VCHIQ_STATUS_T
|
VCHIQ_STATUS_T
|
||||||
vchiq_resume_internal(VCHIQ_STATE_T *state)
|
vchiq_resume_internal(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
VCHIQ_STATUS_T status = VCHIQ_SUCCESS;
|
VCHIQ_STATUS_T status = VCHIQ_SUCCESS;
|
||||||
|
|
||||||
@ -3017,7 +3021,7 @@ VCHIQ_STATUS_T vchiq_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle,
|
|||||||
struct vchiq_service *service = find_service_by_handle(handle);
|
struct vchiq_service *service = find_service_by_handle(handle);
|
||||||
struct vchiq_bulk_queue *queue;
|
struct vchiq_bulk_queue *queue;
|
||||||
struct vchiq_bulk *bulk;
|
struct vchiq_bulk *bulk;
|
||||||
VCHIQ_STATE_T *state;
|
struct vchiq_state *state;
|
||||||
struct bulk_waiter *bulk_waiter = NULL;
|
struct bulk_waiter *bulk_waiter = NULL;
|
||||||
const char dir_char = (dir == VCHIQ_BULK_TRANSMIT) ? 't' : 'r';
|
const char dir_char = (dir == VCHIQ_BULK_TRANSMIT) ? 't' : 'r';
|
||||||
const int dir_msgtype = (dir == VCHIQ_BULK_TRANSMIT) ?
|
const int dir_msgtype = (dir == VCHIQ_BULK_TRANSMIT) ?
|
||||||
@ -3217,7 +3221,7 @@ vchiq_release_message(VCHIQ_SERVICE_HANDLE_T handle,
|
|||||||
{
|
{
|
||||||
struct vchiq_service *service = find_service_by_handle(handle);
|
struct vchiq_service *service = find_service_by_handle(handle);
|
||||||
struct vchiq_shared_state *remote;
|
struct vchiq_shared_state *remote;
|
||||||
VCHIQ_STATE_T *state;
|
struct vchiq_state *state;
|
||||||
int slot_index;
|
int slot_index;
|
||||||
|
|
||||||
if (!service)
|
if (!service)
|
||||||
@ -3245,7 +3249,7 @@ vchiq_release_message(VCHIQ_SERVICE_HANDLE_T handle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
release_message_sync(VCHIQ_STATE_T *state, struct vchiq_header *header)
|
release_message_sync(struct vchiq_state *state, struct vchiq_header *header)
|
||||||
{
|
{
|
||||||
header->msgid = VCHIQ_MSGID_PADDING;
|
header->msgid = VCHIQ_MSGID_PADDING;
|
||||||
remote_event_signal(&state->remote->sync_release);
|
remote_event_signal(&state->remote->sync_release);
|
||||||
@ -3358,8 +3362,8 @@ vchiq_set_service_option(VCHIQ_SERVICE_HANDLE_T handle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
vchiq_dump_shared_state(void *dump_context, VCHIQ_STATE_T *state,
|
vchiq_dump_shared_state(void *dump_context, struct vchiq_state *state,
|
||||||
struct vchiq_shared_state *shared, const char *label)
|
struct vchiq_shared_state *shared, const char *label)
|
||||||
{
|
{
|
||||||
static const char *const debug_names[] = {
|
static const char *const debug_names[] = {
|
||||||
"<entries>",
|
"<entries>",
|
||||||
@ -3407,7 +3411,7 @@ vchiq_dump_shared_state(void *dump_context, VCHIQ_STATE_T *state,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vchiq_dump_state(void *dump_context, VCHIQ_STATE_T *state)
|
vchiq_dump_state(void *dump_context, struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
char buf[80];
|
char buf[80];
|
||||||
int len;
|
int len;
|
||||||
@ -3583,7 +3587,7 @@ vchiq_loud_error_footer(void)
|
|||||||
"================");
|
"================");
|
||||||
}
|
}
|
||||||
|
|
||||||
VCHIQ_STATUS_T vchiq_send_remote_use(VCHIQ_STATE_T *state)
|
VCHIQ_STATUS_T vchiq_send_remote_use(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
VCHIQ_STATUS_T status = VCHIQ_RETRY;
|
VCHIQ_STATUS_T status = VCHIQ_RETRY;
|
||||||
|
|
||||||
@ -3594,7 +3598,7 @@ VCHIQ_STATUS_T vchiq_send_remote_use(VCHIQ_STATE_T *state)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
VCHIQ_STATUS_T vchiq_send_remote_release(VCHIQ_STATE_T *state)
|
VCHIQ_STATUS_T vchiq_send_remote_release(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
VCHIQ_STATUS_T status = VCHIQ_RETRY;
|
VCHIQ_STATUS_T status = VCHIQ_RETRY;
|
||||||
|
|
||||||
@ -3605,7 +3609,7 @@ VCHIQ_STATUS_T vchiq_send_remote_release(VCHIQ_STATE_T *state)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
VCHIQ_STATUS_T vchiq_send_remote_use_active(VCHIQ_STATE_T *state)
|
VCHIQ_STATUS_T vchiq_send_remote_use_active(struct vchiq_state *state)
|
||||||
{
|
{
|
||||||
VCHIQ_STATUS_T status = VCHIQ_RETRY;
|
VCHIQ_STATUS_T status = VCHIQ_RETRY;
|
||||||
|
|
||||||
|
@ -268,8 +268,6 @@ struct remote_event {
|
|||||||
|
|
||||||
typedef struct opaque_platform_state_t *VCHIQ_PLATFORM_STATE_T;
|
typedef struct opaque_platform_state_t *VCHIQ_PLATFORM_STATE_T;
|
||||||
|
|
||||||
typedef struct vchiq_state_struct VCHIQ_STATE_T;
|
|
||||||
|
|
||||||
struct vchiq_slot {
|
struct vchiq_slot {
|
||||||
char data[VCHIQ_SLOT_SIZE];
|
char data[VCHIQ_SLOT_SIZE];
|
||||||
};
|
};
|
||||||
@ -299,7 +297,7 @@ struct vchiq_service {
|
|||||||
short version_min;
|
short version_min;
|
||||||
short peer_version;
|
short peer_version;
|
||||||
|
|
||||||
VCHIQ_STATE_T *state;
|
struct vchiq_state *state;
|
||||||
VCHIQ_INSTANCE_T instance;
|
VCHIQ_INSTANCE_T instance;
|
||||||
|
|
||||||
int service_use_count;
|
int service_use_count;
|
||||||
@ -396,7 +394,7 @@ struct vchiq_slot_zero {
|
|||||||
struct vchiq_slot_info slots[VCHIQ_MAX_SLOTS];
|
struct vchiq_slot_info slots[VCHIQ_MAX_SLOTS];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct vchiq_state_struct {
|
struct vchiq_state {
|
||||||
int id;
|
int id;
|
||||||
int initialised;
|
int initialised;
|
||||||
VCHIQ_CONNSTATE_T conn_state;
|
VCHIQ_CONNSTATE_T conn_state;
|
||||||
@ -515,7 +513,7 @@ extern int vchiq_core_log_level;
|
|||||||
extern int vchiq_core_msg_log_level;
|
extern int vchiq_core_msg_log_level;
|
||||||
extern int vchiq_sync_log_level;
|
extern int vchiq_sync_log_level;
|
||||||
|
|
||||||
extern VCHIQ_STATE_T *vchiq_states[VCHIQ_MAX_STATES];
|
extern struct vchiq_state *vchiq_states[VCHIQ_MAX_STATES];
|
||||||
|
|
||||||
extern const char *
|
extern const char *
|
||||||
get_conn_state_name(VCHIQ_CONNSTATE_T conn_state);
|
get_conn_state_name(VCHIQ_CONNSTATE_T conn_state);
|
||||||
@ -524,15 +522,16 @@ extern struct vchiq_slot_zero *
|
|||||||
vchiq_init_slots(void *mem_base, int mem_size);
|
vchiq_init_slots(void *mem_base, int mem_size);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_init_state(VCHIQ_STATE_T *state, struct vchiq_slot_zero *slot_zero);
|
vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_connect_internal(VCHIQ_STATE_T *state, VCHIQ_INSTANCE_T instance);
|
vchiq_connect_internal(struct vchiq_state *state, VCHIQ_INSTANCE_T instance);
|
||||||
|
|
||||||
extern struct vchiq_service *
|
extern struct vchiq_service *
|
||||||
vchiq_add_service_internal(VCHIQ_STATE_T *state,
|
vchiq_add_service_internal(struct vchiq_state *state,
|
||||||
const struct vchiq_service_params *params, int srvstate,
|
const struct vchiq_service_params *params,
|
||||||
VCHIQ_INSTANCE_T instance, VCHIQ_USERDATA_TERM_T userdata_term);
|
int srvstate, VCHIQ_INSTANCE_T instance,
|
||||||
|
VCHIQ_USERDATA_TERM_T userdata_term);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_open_service_internal(struct vchiq_service *service, int client_id);
|
vchiq_open_service_internal(struct vchiq_service *service, int client_id);
|
||||||
@ -547,16 +546,16 @@ extern void
|
|||||||
vchiq_free_service_internal(struct vchiq_service *service);
|
vchiq_free_service_internal(struct vchiq_service *service);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_shutdown_internal(VCHIQ_STATE_T *state, VCHIQ_INSTANCE_T instance);
|
vchiq_shutdown_internal(struct vchiq_state *state, VCHIQ_INSTANCE_T instance);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_pause_internal(VCHIQ_STATE_T *state);
|
vchiq_pause_internal(struct vchiq_state *state);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_resume_internal(VCHIQ_STATE_T *state);
|
vchiq_resume_internal(struct vchiq_state *state);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
remote_event_pollall(VCHIQ_STATE_T *state);
|
remote_event_pollall(struct vchiq_state *state);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *offset, int size,
|
vchiq_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *offset, int size,
|
||||||
@ -564,7 +563,7 @@ vchiq_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *offset, int size,
|
|||||||
VCHIQ_BULK_DIR_T dir);
|
VCHIQ_BULK_DIR_T dir);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
vchiq_dump_state(void *dump_context, VCHIQ_STATE_T *state);
|
vchiq_dump_state(void *dump_context, struct vchiq_state *state);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
vchiq_dump_service_state(void *dump_context, struct vchiq_service *service);
|
vchiq_dump_service_state(void *dump_context, struct vchiq_service *service);
|
||||||
@ -576,13 +575,13 @@ extern void
|
|||||||
vchiq_loud_error_footer(void);
|
vchiq_loud_error_footer(void);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
request_poll(VCHIQ_STATE_T *state, struct vchiq_service *service,
|
request_poll(struct vchiq_state *state, struct vchiq_service *service,
|
||||||
int poll_type);
|
int poll_type);
|
||||||
|
|
||||||
static inline struct vchiq_service *
|
static inline struct vchiq_service *
|
||||||
handle_to_service(VCHIQ_SERVICE_HANDLE_T handle)
|
handle_to_service(VCHIQ_SERVICE_HANDLE_T handle)
|
||||||
{
|
{
|
||||||
VCHIQ_STATE_T *state = vchiq_states[(handle / VCHIQ_MAX_SERVICES) &
|
struct vchiq_state *state = vchiq_states[(handle / VCHIQ_MAX_SERVICES) &
|
||||||
(VCHIQ_MAX_STATES - 1)];
|
(VCHIQ_MAX_STATES - 1)];
|
||||||
if (!state)
|
if (!state)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -594,7 +593,7 @@ extern struct vchiq_service *
|
|||||||
find_service_by_handle(VCHIQ_SERVICE_HANDLE_T handle);
|
find_service_by_handle(VCHIQ_SERVICE_HANDLE_T handle);
|
||||||
|
|
||||||
extern struct vchiq_service *
|
extern struct vchiq_service *
|
||||||
find_service_by_port(VCHIQ_STATE_T *state, int localport);
|
find_service_by_port(struct vchiq_state *state, int localport);
|
||||||
|
|
||||||
extern struct vchiq_service *
|
extern struct vchiq_service *
|
||||||
find_service_for_instance(VCHIQ_INSTANCE_T instance,
|
find_service_for_instance(VCHIQ_INSTANCE_T instance,
|
||||||
@ -605,8 +604,8 @@ find_closed_service_for_instance(VCHIQ_INSTANCE_T instance,
|
|||||||
VCHIQ_SERVICE_HANDLE_T handle);
|
VCHIQ_SERVICE_HANDLE_T handle);
|
||||||
|
|
||||||
extern struct vchiq_service *
|
extern struct vchiq_service *
|
||||||
next_service_by_instance(VCHIQ_STATE_T *state, VCHIQ_INSTANCE_T instance,
|
next_service_by_instance(struct vchiq_state *state, VCHIQ_INSTANCE_T instance,
|
||||||
int *pidx);
|
int *pidx);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
lock_service(struct vchiq_service *service);
|
lock_service(struct vchiq_service *service);
|
||||||
@ -628,16 +627,16 @@ extern void
|
|||||||
remote_event_signal(struct remote_event *event);
|
remote_event_signal(struct remote_event *event);
|
||||||
|
|
||||||
void
|
void
|
||||||
vchiq_platform_check_suspend(VCHIQ_STATE_T *state);
|
vchiq_platform_check_suspend(struct vchiq_state *state);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
vchiq_platform_paused(VCHIQ_STATE_T *state);
|
vchiq_platform_paused(struct vchiq_state *state);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_platform_resume(VCHIQ_STATE_T *state);
|
vchiq_platform_resume(struct vchiq_state *state);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
vchiq_platform_resumed(VCHIQ_STATE_T *state);
|
vchiq_platform_resumed(struct vchiq_state *state);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
vchiq_dump(void *dump_context, const char *str, int len);
|
vchiq_dump(void *dump_context, const char *str, int len);
|
||||||
@ -659,38 +658,39 @@ extern VCHIQ_STATUS_T
|
|||||||
vchiq_release_service_internal(struct vchiq_service *service);
|
vchiq_release_service_internal(struct vchiq_service *service);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
vchiq_on_remote_use(VCHIQ_STATE_T *state);
|
vchiq_on_remote_use(struct vchiq_state *state);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
vchiq_on_remote_release(VCHIQ_STATE_T *state);
|
vchiq_on_remote_release(struct vchiq_state *state);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_platform_init_state(VCHIQ_STATE_T *state);
|
vchiq_platform_init_state(struct vchiq_state *state);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_check_service(struct vchiq_service *service);
|
vchiq_check_service(struct vchiq_service *service);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
vchiq_on_remote_use_active(VCHIQ_STATE_T *state);
|
vchiq_on_remote_use_active(struct vchiq_state *state);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_send_remote_use(VCHIQ_STATE_T *state);
|
vchiq_send_remote_use(struct vchiq_state *state);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_send_remote_release(VCHIQ_STATE_T *state);
|
vchiq_send_remote_release(struct vchiq_state *state);
|
||||||
|
|
||||||
extern VCHIQ_STATUS_T
|
extern VCHIQ_STATUS_T
|
||||||
vchiq_send_remote_use_active(VCHIQ_STATE_T *state);
|
vchiq_send_remote_use_active(struct vchiq_state *state);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
vchiq_platform_conn_state_changed(VCHIQ_STATE_T *state,
|
vchiq_platform_conn_state_changed(struct vchiq_state *state,
|
||||||
VCHIQ_CONNSTATE_T oldstate, VCHIQ_CONNSTATE_T newstate);
|
VCHIQ_CONNSTATE_T oldstate,
|
||||||
|
VCHIQ_CONNSTATE_T newstate);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
vchiq_platform_handle_timeout(VCHIQ_STATE_T *state);
|
vchiq_platform_handle_timeout(struct vchiq_state *state);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
vchiq_set_conn_state(VCHIQ_STATE_T *state, VCHIQ_CONNSTATE_T newstate);
|
vchiq_set_conn_state(struct vchiq_state *state, VCHIQ_CONNSTATE_T newstate);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
vchiq_log_dump_mem(const char *label, uint32_t addr, const void *voidMem,
|
vchiq_log_dump_mem(const char *label, uint32_t addr, const void *voidMem,
|
||||||
|
Loading…
Reference in New Issue
Block a user