Commit a24bc667 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

tty: move ldisc prototypes to tty_ldisc.h

We already have tty_ldisc.h, so cleanup tty.h a bit by moving out
tty_ldisc-related function prototypes and a variable into tty_ldisc.h.
They are implemented in tty_ldisc.c anyway.
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210723103147.18250-4-jslaby@suse.czSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 890ebae6
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <linux/tty_ldisc.h> #include <linux/tty_ldisc.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/tty_flags.h> #include <linux/tty_flags.h>
#include <linux/seq_file.h>
#include <uapi/linux/tty.h> #include <uapi/linux/tty.h>
#include <linux/rwsem.h> #include <linux/rwsem.h>
#include <linux/llist.h> #include <linux/llist.h>
...@@ -493,13 +492,7 @@ extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old); ...@@ -493,13 +492,7 @@ extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old);
extern int tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b); extern int tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b);
extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt); extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt);
extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *);
extern void tty_ldisc_deref(struct tty_ldisc *);
extern struct tty_ldisc *tty_ldisc_ref_wait(struct tty_struct *);
extern const struct seq_operations tty_ldiscs_seq_ops;
extern void tty_wakeup(struct tty_struct *tty); extern void tty_wakeup(struct tty_struct *tty);
extern void tty_ldisc_flush(struct tty_struct *tty);
extern int tty_mode_ioctl(struct tty_struct *tty, struct file *file, extern int tty_mode_ioctl(struct tty_struct *tty, struct file *file,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
...@@ -629,9 +622,6 @@ static inline int tty_port_users(struct tty_port *port) ...@@ -629,9 +622,6 @@ static inline int tty_port_users(struct tty_port *port)
return port->count + port->blocked_open; return port->count + port->blocked_open;
} }
extern int tty_register_ldisc(struct tty_ldisc_ops *new_ldisc);
extern void tty_unregister_ldisc(struct tty_ldisc_ops *ldisc);
extern int tty_set_ldisc(struct tty_struct *tty, int disc);
extern int tty_ldisc_receive_buf(struct tty_ldisc *ld, const unsigned char *p, extern int tty_ldisc_receive_buf(struct tty_ldisc *ld, const unsigned char *p,
const char *f, int count); const char *f, int count);
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
#ifndef _LINUX_TTY_LDISC_H #ifndef _LINUX_TTY_LDISC_H
#define _LINUX_TTY_LDISC_H #define _LINUX_TTY_LDISC_H
struct tty_struct;
/* /*
* This structure defines the interface between the tty line discipline * This structure defines the interface between the tty line discipline
* implementation and the tty routines. The following routines can be * implementation and the tty routines. The following routines can be
...@@ -126,6 +128,7 @@ ...@@ -126,6 +128,7 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/atomic.h> #include <linux/atomic.h>
#include <linux/seq_file.h>
/* /*
* the semaphore definition * the semaphore definition
...@@ -220,4 +223,16 @@ struct tty_ldisc { ...@@ -220,4 +223,16 @@ struct tty_ldisc {
#define MODULE_ALIAS_LDISC(ldisc) \ #define MODULE_ALIAS_LDISC(ldisc) \
MODULE_ALIAS("tty-ldisc-" __stringify(ldisc)) MODULE_ALIAS("tty-ldisc-" __stringify(ldisc))
extern const struct seq_operations tty_ldiscs_seq_ops;
struct tty_ldisc *tty_ldisc_ref(struct tty_struct *);
void tty_ldisc_deref(struct tty_ldisc *);
struct tty_ldisc *tty_ldisc_ref_wait(struct tty_struct *);
void tty_ldisc_flush(struct tty_struct *tty);
int tty_register_ldisc(struct tty_ldisc_ops *new_ldisc);
void tty_unregister_ldisc(struct tty_ldisc_ops *ldisc);
int tty_set_ldisc(struct tty_struct *tty, int disc);
#endif /* _LINUX_TTY_LDISC_H */ #endif /* _LINUX_TTY_LDISC_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment