aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h')
-rw-r--r--drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h107
1 files changed, 35 insertions, 72 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
index 957fea1f574f..53a98949b294 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
@@ -14,7 +14,6 @@
#include "vchiq_cfg.h"
-
/* Do this so that we can test-build the code on non-rpi systems */
#if IS_ENABLED(CONFIG_RASPBERRYPI_FIRMWARE)
@@ -75,9 +74,7 @@
((fourcc) >> 8) & 0xff, \
(fourcc) & 0xff
-typedef uint32_t BITSET_T;
-
-static_assert((sizeof(BITSET_T) * 8) == 32);
+static_assert((sizeof(u32) * 8) == 32);
#define BITSET_SIZE(b) ((b + 31) >> 5)
#define BITSET_WORD(b) (b >> 5)
@@ -105,7 +102,7 @@ enum {
#if VCHIQ_ENABLE_DEBUG
-#define DEBUG_INITIALISE(local) int *debug_ptr = (local)->debug;
+#define DEBUG_INITIALISE(local) int *debug_ptr = (local)->debug
#define DEBUG_TRACE(d) \
do { debug_ptr[DEBUG_ ## d] = __LINE__; dsb(sy); } while (0)
#define DEBUG_VALUE(d, v) \
@@ -152,8 +149,6 @@ enum vchiq_bulk_dir {
VCHIQ_BULK_RECEIVE
};
-typedef void (*vchiq_userdata_term)(void *userdata);
-
struct vchiq_bulk {
short mode;
short dir;
@@ -198,7 +193,7 @@ struct vchiq_service {
struct kref ref_count;
struct rcu_head rcu;
int srvstate;
- vchiq_userdata_term userdata_term;
+ void (*userdata_term)(void *userdata);
unsigned int localport;
unsigned int remoteport;
int public_fourcc;
@@ -234,10 +229,10 @@ struct vchiq_service {
int bulk_tx_count;
int bulk_rx_count;
int bulk_aborted_count;
- uint64_t ctrl_tx_bytes;
- uint64_t ctrl_rx_bytes;
- uint64_t bulk_tx_bytes;
- uint64_t bulk_rx_bytes;
+ u64 ctrl_tx_bytes;
+ u64 ctrl_rx_bytes;
+ u64 bulk_tx_bytes;
+ u64 bulk_rx_bytes;
} stats;
int msg_queue_read;
@@ -262,7 +257,6 @@ struct vchiq_service_quota {
};
struct vchiq_shared_state {
-
/* A non-zero value here indicates that the content is valid. */
int initialised;
@@ -451,7 +445,6 @@ struct vchiq_config {
short version_min; /* The minimum compatible version of VCHIQ */
};
-
extern spinlock_t bulk_waiter_spinlock;
extern int vchiq_core_log_level;
@@ -476,7 +469,7 @@ struct vchiq_service *
vchiq_add_service_internal(struct vchiq_state *state,
const struct vchiq_service_params_kernel *params,
int srvstate, struct vchiq_instance *instance,
- vchiq_userdata_term userdata_term);
+ void (*userdata_term)(void *userdata));
extern enum vchiq_status
vchiq_open_service_internal(struct vchiq_service *service, int client_id);
@@ -536,12 +529,10 @@ extern struct vchiq_service *
find_service_by_port(struct vchiq_state *state, int localport);
extern struct vchiq_service *
-find_service_for_instance(struct vchiq_instance *instance,
- unsigned int handle);
+find_service_for_instance(struct vchiq_instance *instance, unsigned int handle);
extern struct vchiq_service *
-find_closed_service_for_instance(struct vchiq_instance *instance,
- unsigned int handle);
+find_closed_service_for_instance(struct vchiq_instance *instance, unsigned int handle);
extern struct vchiq_service *
__next_service_by_instance(struct vchiq_state *state,
@@ -566,81 +557,53 @@ vchiq_queue_message(unsigned int handle,
void *context,
size_t size);
-/*
- * The following functions are called from vchiq_core, and external
- * implementations must be provided.
- */
-
-extern int
-vchiq_prepare_bulk_data(struct vchiq_bulk *bulk, void *offset,
- void __user *uoffset, int size, int dir);
+int vchiq_prepare_bulk_data(struct vchiq_bulk *bulk, void *offset, void __user *uoffset,
+ int size, int dir);
-extern void
-vchiq_complete_bulk(struct vchiq_bulk *bulk);
+void vchiq_complete_bulk(struct vchiq_bulk *bulk);
-extern void
-remote_event_signal(struct remote_event *event);
+void remote_event_signal(struct remote_event *event);
-extern int
-vchiq_dump(void *dump_context, const char *str, int len);
+int vchiq_dump(void *dump_context, const char *str, int len);
-extern int
-vchiq_dump_platform_state(void *dump_context);
+int vchiq_dump_platform_state(void *dump_context);
-extern int
-vchiq_dump_platform_instances(void *dump_context);
+int vchiq_dump_platform_instances(void *dump_context);
-extern int
-vchiq_dump_platform_service_state(void *dump_context,
- struct vchiq_service *service);
+int vchiq_dump_platform_service_state(void *dump_context, struct vchiq_service *service);
-extern int
-vchiq_use_service_internal(struct vchiq_service *service);
+int vchiq_use_service_internal(struct vchiq_service *service);
-extern int
-vchiq_release_service_internal(struct vchiq_service *service);
+int vchiq_release_service_internal(struct vchiq_service *service);
-extern void
-vchiq_on_remote_use(struct vchiq_state *state);
+void vchiq_on_remote_use(struct vchiq_state *state);
-extern void
-vchiq_on_remote_release(struct vchiq_state *state);
+void vchiq_on_remote_release(struct vchiq_state *state);
-extern int
-vchiq_platform_init_state(struct vchiq_state *state);
+int vchiq_platform_init_state(struct vchiq_state *state);
-extern enum vchiq_status
-vchiq_check_service(struct vchiq_service *service);
+enum vchiq_status vchiq_check_service(struct vchiq_service *service);
-extern void
-vchiq_on_remote_use_active(struct vchiq_state *state);
+void vchiq_on_remote_use_active(struct vchiq_state *state);
-extern enum vchiq_status
-vchiq_send_remote_use(struct vchiq_state *state);
+enum vchiq_status vchiq_send_remote_use(struct vchiq_state *state);
-extern enum vchiq_status
-vchiq_send_remote_use_active(struct vchiq_state *state);
+enum vchiq_status vchiq_send_remote_use_active(struct vchiq_state *state);
-extern void
-vchiq_platform_conn_state_changed(struct vchiq_state *state,
- enum vchiq_connstate oldstate,
+void vchiq_platform_conn_state_changed(struct vchiq_state *state,
+ enum vchiq_connstate oldstate,
enum vchiq_connstate newstate);
-extern void
-vchiq_set_conn_state(struct vchiq_state *state, enum vchiq_connstate newstate);
+void vchiq_set_conn_state(struct vchiq_state *state, enum vchiq_connstate newstate);
-extern void
-vchiq_log_dump_mem(const char *label, uint32_t addr, const void *voidMem,
- size_t numBytes);
+void vchiq_log_dump_mem(const char *label, u32 addr, const void *void_mem, size_t num_bytes);
-extern enum vchiq_status vchiq_remove_service(unsigned int service);
+enum vchiq_status vchiq_remove_service(unsigned int service);
-extern int vchiq_get_client_id(unsigned int service);
+int vchiq_get_client_id(unsigned int service);
-extern void vchiq_get_config(struct vchiq_config *config);
+void vchiq_get_config(struct vchiq_config *config);
-extern int
-vchiq_set_service_option(unsigned int service, enum vchiq_service_option option,
- int value);
+int vchiq_set_service_option(unsigned int service, enum vchiq_service_option option, int value);
#endif