#define pr_fmt(fmt) …
#include <linux/cdev.h>
#include <linux/device.h>
#include <linux/fs.h>
#include <linux/idr.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/poll.h>
#include <linux/rpmsg.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <uapi/linux/rpmsg.h>
#include "rpmsg_char.h"
#include "rpmsg_internal.h"
#define RPMSG_DEV_MAX …
static dev_t rpmsg_major;
static DEFINE_IDA(rpmsg_ept_ida);
static DEFINE_IDA(rpmsg_minor_ida);
#define dev_to_eptdev(dev) …
#define cdev_to_eptdev(i_cdev) …
struct rpmsg_eptdev { … };
int rpmsg_chrdev_eptdev_destroy(struct device *dev, void *data)
{ … }
EXPORT_SYMBOL(…);
static int rpmsg_ept_cb(struct rpmsg_device *rpdev, void *buf, int len,
void *priv, u32 addr)
{ … }
static int rpmsg_ept_flow_cb(struct rpmsg_device *rpdev, void *priv, bool enable)
{ … }
static int rpmsg_eptdev_open(struct inode *inode, struct file *filp)
{ … }
static int rpmsg_eptdev_release(struct inode *inode, struct file *filp)
{ … }
static ssize_t rpmsg_eptdev_read_iter(struct kiocb *iocb, struct iov_iter *to)
{ … }
static ssize_t rpmsg_eptdev_write_iter(struct kiocb *iocb,
struct iov_iter *from)
{ … }
static __poll_t rpmsg_eptdev_poll(struct file *filp, poll_table *wait)
{ … }
static long rpmsg_eptdev_ioctl(struct file *fp, unsigned int cmd,
unsigned long arg)
{ … }
static const struct file_operations rpmsg_eptdev_fops = …;
static ssize_t name_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(name);
static ssize_t src_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(src);
static ssize_t dst_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(dst);
static struct attribute *rpmsg_eptdev_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static void rpmsg_eptdev_release_device(struct device *dev)
{ … }
static struct rpmsg_eptdev *rpmsg_chrdev_eptdev_alloc(struct rpmsg_device *rpdev,
struct device *parent)
{ … }
static int rpmsg_chrdev_eptdev_add(struct rpmsg_eptdev *eptdev, struct rpmsg_channel_info chinfo)
{ … }
int rpmsg_chrdev_eptdev_create(struct rpmsg_device *rpdev, struct device *parent,
struct rpmsg_channel_info chinfo)
{ … }
EXPORT_SYMBOL(…);
static int rpmsg_chrdev_probe(struct rpmsg_device *rpdev)
{ … }
static void rpmsg_chrdev_remove(struct rpmsg_device *rpdev)
{ … }
static struct rpmsg_device_id rpmsg_chrdev_id_table[] = …;
static struct rpmsg_driver rpmsg_chrdev_driver = …;
static int rpmsg_chrdev_init(void)
{ … }
postcore_initcall(rpmsg_chrdev_init);
static void rpmsg_chrdev_exit(void)
{ … }
module_exit(rpmsg_chrdev_exit);
MODULE_ALIAS(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;