#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/rpmsg.h>
#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#define RPMSG_TTY_NAME …
#define MAX_TTY_RPMSG …
static DEFINE_IDR(tty_idr);
static DEFINE_MUTEX(idr_lock);
static struct tty_driver *rpmsg_tty_driver;
struct rpmsg_tty_port { … };
static int rpmsg_tty_cb(struct rpmsg_device *rpdev, void *data, int len, void *priv, u32 src)
{ … }
static int rpmsg_tty_install(struct tty_driver *driver, struct tty_struct *tty)
{ … }
static void rpmsg_tty_cleanup(struct tty_struct *tty)
{ … }
static int rpmsg_tty_open(struct tty_struct *tty, struct file *filp)
{ … }
static void rpmsg_tty_close(struct tty_struct *tty, struct file *filp)
{ … }
static ssize_t rpmsg_tty_write(struct tty_struct *tty, const u8 *buf,
size_t len)
{ … }
static unsigned int rpmsg_tty_write_room(struct tty_struct *tty)
{ … }
static void rpmsg_tty_hangup(struct tty_struct *tty)
{ … }
static const struct tty_operations rpmsg_tty_ops = …;
static struct rpmsg_tty_port *rpmsg_tty_alloc_cport(void)
{ … }
static void rpmsg_tty_destruct_port(struct tty_port *port)
{ … }
static const struct tty_port_operations rpmsg_tty_port_ops = …;
static int rpmsg_tty_probe(struct rpmsg_device *rpdev)
{ … }
static void rpmsg_tty_remove(struct rpmsg_device *rpdev)
{ … }
static struct rpmsg_device_id rpmsg_driver_tty_id_table[] = …;
MODULE_DEVICE_TABLE(rpmsg, rpmsg_driver_tty_id_table);
static struct rpmsg_driver rpmsg_tty_rpmsg_drv = …;
static int __init rpmsg_tty_init(void)
{ … }
static void __exit rpmsg_tty_exit(void)
{ … }
module_init(…) …;
module_exit(rpmsg_tty_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;