27 #include <linux/kernel.h>
28 #include <linux/module.h>
29 #include <linux/types.h>
31 #include <linux/tty.h>
33 #include <linux/errno.h>
34 #include <linux/string.h>
36 #include <linux/slab.h>
45 #define RECEIVE_ROOM 65536
46 #define DRIVERNAME "n_tracerouter"
71 static int n_tracerouter_open(
struct tty_struct *tty)
78 tr_data->
kref_tty = tty_kref_get(tty);
99 static void n_tracerouter_close(
struct tty_struct *tty)
131 unsigned char __user *
buf,
size_t nr) {
155 const unsigned char *
buf,
size_t nr) {
171 static void n_tracerouter_receivebuf(
struct tty_struct *tty,
172 const unsigned char *
cp,
189 .open = n_tracerouter_open,
190 .close = n_tracerouter_close,
191 .read = n_tracerouter_read,
192 .write = n_tracerouter_write,
193 .receive_buf = n_tracerouter_receivebuf
204 static int __init n_tracerouter_init(
void)
216 pr_err(
"%s: Registration failed: %d\n", __func__, retval);
227 static void __exit n_tracerouter_exit(
void)
232 pr_err(
"%s: Unregistration failed: %d\n", __func__, retval);