#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sched/signal.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/cdev.h>
#include <linux/fs.h>
#include <linux/device.h>
#include <linux/device/bus.h>
#include <linux/mm.h>
#include <linux/highmem.h>
#include <linux/pagemap.h>
#include <linux/bug.h>
#include <linux/completion.h>
#include <linux/list.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/compat.h>
#include <linux/dma-mapping.h>
#include <linux/rcupdate.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/uaccess.h>
#include <soc/bcm2835/raspberrypi-firmware.h>
#include "vchiq_core.h"
#include "vchiq_ioctl.h"
#include "vchiq_arm.h"
#include "vchiq_bus.h"
#include "vchiq_debugfs.h"
#include "vchiq_pagelist.h"
#define DEVICE_NAME …
#define TOTAL_SLOTS …
#define MAX_FRAGMENTS …
#define VCHIQ_PLATFORM_FRAGMENTS_OFFSET_IDX …
#define VCHIQ_PLATFORM_FRAGMENTS_COUNT_IDX …
#define BELL0 …
#define BELL2 …
#define ARM_DS_ACTIVE …
#undef MODULE_PARAM_PREFIX
#define MODULE_PARAM_PREFIX …
#define KEEPALIVE_VER …
#define KEEPALIVE_VER_MIN …
static struct vchiq_device *bcm2835_audio;
static struct vchiq_device *bcm2835_camera;
static const struct vchiq_platform_info bcm2835_info = …;
static const struct vchiq_platform_info bcm2836_info = …;
struct vchiq_arm_state { … };
struct vchiq_pagelist_info { … };
static int
vchiq_blocking_bulk_transfer(struct vchiq_instance *instance, unsigned int handle, void *data,
unsigned int size, enum vchiq_bulk_dir dir);
static irqreturn_t
vchiq_doorbell_irq(int irq, void *dev_id)
{ … }
static void
cleanup_pagelistinfo(struct vchiq_instance *instance, struct vchiq_pagelist_info *pagelistinfo)
{ … }
static inline bool
is_adjacent_block(u32 *addrs, dma_addr_t addr, unsigned int k)
{ … }
static void vchiq_call_connected_callbacks(struct vchiq_drv_mgmt *drv_mgmt)
{ … }
void vchiq_add_connected_callback(struct vchiq_device *device, void (*callback)(void))
{ … }
EXPORT_SYMBOL(…);
static struct vchiq_pagelist_info *
create_pagelist(struct vchiq_instance *instance, char *buf, char __user *ubuf,
size_t count, unsigned short type)
{ … }
static void
free_pagelist(struct vchiq_instance *instance, struct vchiq_pagelist_info *pagelistinfo,
int actual)
{ … }
static int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state)
{ … }
int
vchiq_platform_init_state(struct vchiq_state *state)
{ … }
static struct vchiq_arm_state *vchiq_platform_get_arm_state(struct vchiq_state *state)
{ … }
void
remote_event_signal(struct vchiq_state *state, struct remote_event *event)
{ … }
int
vchiq_prepare_bulk_data(struct vchiq_instance *instance, struct vchiq_bulk *bulk, void *offset,
void __user *uoffset, int size, int dir)
{ … }
void
vchiq_complete_bulk(struct vchiq_instance *instance, struct vchiq_bulk *bulk)
{ … }
void vchiq_dump_platform_state(struct seq_file *f)
{ … }
#define VCHIQ_INIT_RETRIES …
int vchiq_initialise(struct vchiq_state *state, struct vchiq_instance **instance_out)
{ … }
EXPORT_SYMBOL(…);
void free_bulk_waiter(struct vchiq_instance *instance)
{ … }
int vchiq_shutdown(struct vchiq_instance *instance)
{ … }
EXPORT_SYMBOL(…);
static int vchiq_is_connected(struct vchiq_instance *instance)
{ … }
int vchiq_connect(struct vchiq_instance *instance)
{ … }
EXPORT_SYMBOL(…);
static int
vchiq_add_service(struct vchiq_instance *instance,
const struct vchiq_service_params_kernel *params,
unsigned int *phandle)
{ … }
int
vchiq_open_service(struct vchiq_instance *instance,
const struct vchiq_service_params_kernel *params,
unsigned int *phandle)
{ … }
EXPORT_SYMBOL(…);
int
vchiq_bulk_transmit(struct vchiq_instance *instance, unsigned int handle, const void *data,
unsigned int size, void *userdata, enum vchiq_bulk_mode mode)
{ … }
EXPORT_SYMBOL(…);
int vchiq_bulk_receive(struct vchiq_instance *instance, unsigned int handle,
void *data, unsigned int size, void *userdata,
enum vchiq_bulk_mode mode)
{ … }
EXPORT_SYMBOL(…);
static int
vchiq_blocking_bulk_transfer(struct vchiq_instance *instance, unsigned int handle, void *data,
unsigned int size, enum vchiq_bulk_dir dir)
{ … }
static int
add_completion(struct vchiq_instance *instance, enum vchiq_reason reason,
struct vchiq_header *header, struct user_service *user_service,
void *bulk_userdata)
{ … }
static int
service_single_message(struct vchiq_instance *instance,
enum vchiq_reason reason,
struct vchiq_service *service, void *bulk_userdata)
{ … }
int
service_callback(struct vchiq_instance *instance, enum vchiq_reason reason,
struct vchiq_header *header, unsigned int handle, void *bulk_userdata)
{ … }
void vchiq_dump_platform_instances(struct vchiq_state *state, struct seq_file *f)
{ … }
void vchiq_dump_platform_service_state(struct seq_file *f,
struct vchiq_service *service)
{ … }
static int
vchiq_keepalive_vchiq_callback(struct vchiq_instance *instance,
enum vchiq_reason reason,
struct vchiq_header *header,
unsigned int service_user, void *bulk_user)
{ … }
static int
vchiq_keepalive_thread_func(void *v)
{ … }
int
vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
enum USE_TYPE_E use_type)
{ … }
int
vchiq_release_internal(struct vchiq_state *state, struct vchiq_service *service)
{ … }
void
vchiq_on_remote_use(struct vchiq_state *state)
{ … }
void
vchiq_on_remote_release(struct vchiq_state *state)
{ … }
int
vchiq_use_service_internal(struct vchiq_service *service)
{ … }
int
vchiq_release_service_internal(struct vchiq_service *service)
{ … }
struct vchiq_debugfs_node *
vchiq_instance_get_debugfs_node(struct vchiq_instance *instance)
{ … }
int
vchiq_instance_get_use_count(struct vchiq_instance *instance)
{ … }
int
vchiq_instance_get_pid(struct vchiq_instance *instance)
{ … }
int
vchiq_instance_get_trace(struct vchiq_instance *instance)
{ … }
void
vchiq_instance_set_trace(struct vchiq_instance *instance, int trace)
{ … }
int
vchiq_use_service(struct vchiq_instance *instance, unsigned int handle)
{ … }
EXPORT_SYMBOL(…);
int
vchiq_release_service(struct vchiq_instance *instance, unsigned int handle)
{ … }
EXPORT_SYMBOL(…);
struct service_data_struct { … };
void
vchiq_dump_service_use_state(struct vchiq_state *state)
{ … }
int
vchiq_check_service(struct vchiq_service *service)
{ … }
void vchiq_platform_conn_state_changed(struct vchiq_state *state,
enum vchiq_connstate oldstate,
enum vchiq_connstate newstate)
{ … }
static const struct of_device_id vchiq_of_match[] = …;
MODULE_DEVICE_TABLE(of, vchiq_of_match);
static int vchiq_probe(struct platform_device *pdev)
{ … }
static void vchiq_remove(struct platform_device *pdev)
{ … }
static struct platform_driver vchiq_driver = …;
static int __init vchiq_driver_init(void)
{ … }
module_init(…) …;
static void __exit vchiq_driver_exit(void)
{ … }
module_exit(vchiq_driver_exit);
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;