linux/drivers/input/serio/serport.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Input device TTY line discipline
 *
 * Copyright (c) 1999-2002 Vojtech Pavlik
 *
 * This is a module that converts a tty line into a much simpler
 * 'serial io port' abstraction that the input device drivers use.
 */


#include <linux/uaccess.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/serio.h>
#include <linux/tty.h>
#include <linux/compat.h>

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_ALIAS_LDISC();

#define SERPORT_BUSY
#define SERPORT_ACTIVE
#define SERPORT_DEAD

struct serport {};

/*
 * Callback functions from the serio code.
 */

static int serport_serio_write(struct serio *serio, unsigned char data)
{}

static int serport_serio_open(struct serio *serio)
{}


static void serport_serio_close(struct serio *serio)
{}

/*
 * serport_ldisc_open() is the routine that is called upon setting our line
 * discipline on a tty. It prepares the serio struct.
 */

static int serport_ldisc_open(struct tty_struct *tty)
{}

/*
 * serport_ldisc_close() is the opposite of serport_ldisc_open()
 */

static void serport_ldisc_close(struct tty_struct *tty)
{}

/*
 * serport_ldisc_receive() is called by the low level tty driver when characters
 * are ready for us. We forward the characters and flags, one by one to the
 * 'interrupt' routine.
 */

static void serport_ldisc_receive(struct tty_struct *tty, const u8 *cp,
				  const u8 *fp, size_t count)
{}

/*
 * serport_ldisc_read() just waits indefinitely if everything goes well.
 * However, when the serio driver closes the serio port, it finishes,
 * returning 0 characters.
 */

static ssize_t serport_ldisc_read(struct tty_struct * tty, struct file * file,
				  u8 *kbuf, size_t nr, void **cookie,
				  unsigned long offset)
{}

static void serport_set_type(struct tty_struct *tty, unsigned long type)
{}

/*
 * serport_ldisc_ioctl() allows to set the port protocol, and device ID
 */

static int serport_ldisc_ioctl(struct tty_struct *tty, unsigned int cmd,
			       unsigned long arg)
{}

#ifdef CONFIG_COMPAT
#define COMPAT_SPIOCSTYPE
static int serport_ldisc_compat_ioctl(struct tty_struct *tty,
				       unsigned int cmd, unsigned long arg)
{}
#endif

static void serport_ldisc_hangup(struct tty_struct *tty)
{}

static void serport_ldisc_write_wakeup(struct tty_struct * tty)
{}

/*
 * The line discipline structure.
 */

static struct tty_ldisc_ops serport_ldisc =;

/*
 * The functions for insering/removing us as a module.
 */

static int __init serport_init(void)
{}

static void __exit serport_exit(void)
{}

module_init();
module_exit(serport_exit);