1#ifndef _LINUX_TTY_PORT_H
2#define _LINUX_TTY_PORT_H
58 const u8* fp,
size_t count);
60 const u8* fp,
size_t count);
76#pragma clang diagnostic push
77#pragma clang diagnostic ignored "-Wgnu-variable-sized-type-not-at-end"
103#if defined(__clang__)
104#pragma clang diagnostic pop
108#define TTY_PORT_INITIALIZED 0
109#define TTY_PORT_SUSPENDED 1
110#define TTY_PORT_ACTIVE 2
116#define TTY_PORT_CTS_FLOW 3
117#define TTY_PORT_CHECK_CD 4
118#define TTY_PORT_KOPENED 5
144 if (port && kref_get_unless_zero(&port->
kref))
154static inline void tty_port_link_driver_wq(
struct tty_port* port,
162static inline bool tty_port_cts_enabled(
const struct tty_port* port)
167static inline void tty_port_set_cts_flow(
struct tty_port* port,
bool val)
172static inline bool tty_port_active(
const struct tty_port* port)
177static inline void tty_port_set_active(
struct tty_port* port,
bool val)
182static inline bool tty_port_check_carrier(
const struct tty_port* port)
187static inline void tty_port_set_check_carrier(
struct tty_port* port,
bool val)
192static inline bool tty_port_suspended(
const struct tty_port* port)
197static inline void tty_port_set_suspended(
struct tty_port* port,
bool val)
202static inline bool tty_port_initialized(
const struct tty_port* port)
207static inline void tty_port_set_initialized(
struct tty_port* port,
bool val)
212static inline bool tty_port_kopened(
const struct tty_port* port)
217static inline void tty_port_set_kopened(
struct tty_port* port,
bool val)
252static inline void tty_port_tty_hangup(
struct tty_port*
port,
bool check_clocal)
260static inline void tty_port_tty_vhangup(
struct tty_port*
port)
324#define scoped_tty() ((struct tty_struct*)(_dclg.lock))
#define bool
Definition stdbool.h:35
uint64_t size_t
Definition stdint.h:104
#define index(str, chr)
Definition string.h:66
#define NULL
Definition actypes.h:561
#define assign_bit(nr, addr, val)
Definition bitops.h:237
#define test_bit(nr, addr)
Definition bitops.h:124
struct kobject * parent
Definition kobject.h:91
uint8_t u8
Definition kernel.h:14
int spinlock_t
Definition kernel.h:44
Definition tty_port.h:298
struct tty_struct * lock
Definition tty_port.h:299
Definition tty_buffer.h:80
struct workqueue_struct * flip_wq
Definition tty_buffer.h:82
Definition tty_driver.h:122
struct workqueue_struct * flip_wq
Definition tty_driver.h:138
void(* lookahead_buf)(struct tty_port *port, const u8 *cp, const u8 *fp, size_t count)
Definition tty_port.h:59
size_t(* receive_buf)(struct tty_port *port, const u8 *cp, const u8 *fp, size_t count)
Definition tty_port.h:57
void(* write_wakeup)(struct tty_port *port)
Definition tty_port.h:61
void(* shutdown)(struct tty_port *port)
Definition tty_port.h:51
void(* dtr_rts)(struct tty_port *port, bool active)
Definition tty_port.h:50
int(* activate)(struct tty_port *port, struct tty_struct *tty)
Definition tty_port.h:52
bool(* carrier_raised)(struct tty_port *port)
Definition tty_port.h:49
void(* destruct)(struct tty_port *port)
Definition tty_port.h:53
struct tty_struct * itty
Definition tty_port.h:82
unsigned long flags
Definition tty_port.h:90
struct tty_struct * tty
Definition tty_port.h:81
struct tty_bufhead buf
Definition tty_port.h:80
unsigned int close_delay
Definition tty_port.h:97
struct kref kref
Definition tty_port.h:100
spinlock_t lock
Definition tty_port.h:85
int drain_delay
Definition tty_port.h:99
unsigned int closing_wait
Definition tty_port.h:98
const struct tty_port_client_operations * client_ops
Definition tty_port.h:84
int blocked_open
Definition tty_port.h:86
struct mutex buf_mutex
Definition tty_port.h:94
wait_queue_head_t open_wait
Definition tty_port.h:88
u8 * xmit_buf
Definition tty_port.h:95
unsigned long iflags
Definition tty_port.h:91
void * client_data
Definition tty_port.h:101
wait_queue_head_t delta_msr_wait
Definition tty_port.h:89
const struct tty_port_operations * ops
Definition tty_port.h:83
unsigned char console
Definition tty_port.h:92
DECLARE_KFIFO_PTR(xmit_fifo, u8)
int count
Definition tty_port.h:87
struct tty_driver * driver
Definition tty.h:207
struct tty_port * port
Definition tty.h:208
Definition workqueue.h:50
void tty_kref_put(struct tty_struct *tty)
int tty_port_block_til_ready(struct tty_port *port, struct tty_struct *tty, struct file *filp)
void tty_port_tty_wakeup(struct tty_port *port)
struct device * tty_port_register_device_attr(struct tty_port *port, struct tty_driver *driver, unsigned index, struct device *device, void *drvdata, const struct attribute_group **attr_grp)
void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty)
void tty_port_raise_dtr_rts(struct tty_port *port)
#define TTY_PORT_INITIALIZED
Definition tty_port.h:108
#define TTY_PORT_SUSPENDED
Definition tty_port.h:109
void tty_port_hangup(struct tty_port *port)
void tty_port_link_wq(struct tty_port *port, struct workqueue_struct *flip_wq)
#define TTY_PORT_CTS_FLOW
Definition tty_port.h:116
void tty_port_unregister_device(struct tty_port *port, struct tty_driver *driver, unsigned index)
void tty_port_destroy(struct tty_port *port)
void tty_port_close(struct tty_port *port, struct tty_struct *tty, struct file *filp)
void tty_port_free_xmit_buf(struct tty_port *port)
#define TTY_PORT_KOPENED
Definition tty_port.h:118
void tty_port_close_end(struct tty_port *port, struct tty_struct *tty)
const struct tty_port_client_operations tty_port_default_client_ops
int tty_port_close_start(struct tty_port *port, struct tty_struct *tty, struct file *filp)
struct tty_struct * tty_port_tty_get(struct tty_port *port)
#define TTY_PORT_CHECK_CD
Definition tty_port.h:117
void tty_port_link_device(struct tty_port *port, struct tty_driver *driver, unsigned index)
void tty_port_lower_dtr_rts(struct tty_port *port)
void tty_port_init(struct tty_port *port)
void tty_port_put(struct tty_port *port)
int tty_port_install(struct tty_port *port, struct tty_driver *driver, struct tty_struct *tty)
#define TTY_PORT_ACTIVE
Definition tty_port.h:110
struct device * tty_port_register_device(struct tty_port *port, struct tty_driver *driver, unsigned index, struct device *device)
int tty_port_alloc_xmit_buf(struct tty_port *port)
bool tty_port_carrier_raised(struct tty_port *port)
void __tty_port_tty_hangup(struct tty_port *port, bool check_clocal, bool async)
int tty_port_open(struct tty_port *port, struct tty_struct *tty, struct file *filp)
struct device * tty_port_register_device_attr_serdev(struct tty_port *port, struct tty_driver *driver, unsigned index, struct device *host, struct device *parent, void *drvdata, const struct attribute_group **attr_grp)