Home
last modified time | relevance | path

Searched full:tty (Results 1 – 25 of 406) sorted by relevance

12345678910>>...17

/linux/drivers/tty/
H A Dtty_jobctrl.c11 #include <linux/tty.h>
14 #include "tty.h"
24 * @tty: tty to check
33 int __tty_check_change(struct tty_struct *tty, int sig) in __tty_check_change() argument
39 if (current->signal->tty != tty) in __tty_check_change()
45 spin_lock_irqsave(&tty->ctrl.lock, flags); in __tty_check_change()
46 tty_pgrp = tty->ctrl.pgrp; in __tty_check_change()
47 spin_unlock_irqrestore(&tty->ctrl.lock, flags); in __tty_check_change()
64 tty_warn(tty, "sig=%d, tty->pgrp == NULL!\n", sig); in __tty_check_change()
69 int tty_check_change(struct tty_struct *tty) in tty_check_change() argument
[all …]
H A Dn_tty.c46 #include <linux/tty.h>
51 #include "tty.h"
63 * unthrottling the TTY driver. These watermarks are used for
155 static void zero_buffer(const struct tty_struct *tty, u8 *buffer, size_t size) in zero_buffer() argument
157 if (L_ICANON(tty) && !L_ECHO(tty)) in zero_buffer()
161 static void tty_copy(const struct tty_struct *tty, void *to, size_t tail, in tty_copy() argument
164 struct n_tty_data *ldata = tty->disc_data; in tty_copy()
169 tty_audit_add_data(tty, from, size); in tty_copy()
171 zero_buffer(tty, from, size); in tty_copy()
177 tty_audit_add_data(tty, from, n); in tty_copy()
[all …]
H A Dtty_ioctl.c17 #include <linux/tty.h>
26 #include "tty.h"
43 * @tty: terminal
48 unsigned int tty_chars_in_buffer(struct tty_struct *tty) in tty_chars_in_buffer() argument
50 if (tty->ops->chars_in_buffer) in tty_chars_in_buffer()
51 return tty->ops->chars_in_buffer(tty); in tty_chars_in_buffer()
58 * @tty: terminal
66 unsigned int tty_write_room(struct tty_struct *tty) in tty_write_room() argument
68 if (tty->ops->write_room) in tty_write_room()
69 return tty->ops->write_room(tty); in tty_write_room()
[all …]
H A Dtty.h3 * TTY core internal functions
9 #define tty_msg(fn, tty, f, ...) \ argument
10 fn("%s %s: " f, tty_driver_name(tty), tty_name(tty), ##__VA_ARGS__)
12 #define tty_debug(tty, f, ...) tty_msg(pr_debug, tty, f, ##__VA_ARGS__) argument
13 #define tty_notice(tty, f, ...) tty_msg(pr_notice, tty, f, ##__VA_ARGS__) argument
14 #define tty_warn(tty, f, ...) tty_msg(pr_warn, tty, f, ##__VA_ARGS__) argument
15 #define tty_err(tty, f, ...) tty_msg(pr_err, tty, f, ##__VA_ARGS__) argument
17 #define tty_info_ratelimited(tty, f, ...) \ argument
18 tty_msg(pr_info_ratelimited, tty, f, ##__VA_ARGS__)
21 * Lock subclasses for tty locks
[all …]
H A Dtty_mutex.c2 #include <linux/tty.h>
7 #include "tty.h"
9 /* Legacy tty mutex glue */
12 * Getting the big tty mutex.
15 void tty_lock(struct tty_struct *tty) in tty_lock() argument
17 tty_kref_get(tty); in tty_lock()
18 mutex_lock(&tty->legacy_mutex); in tty_lock()
22 int tty_lock_interruptible(struct tty_struct *tty) in tty_lock_interruptible() argument
26 tty_kref_get(tty); in tty_lock_interruptible()
27 ret = mutex_lock_interruptible(&tty->legacy_mutex); in tty_lock_interruptible()
[all …]
H A Dn_hdlc.c15 * This module implements the tty line discipline N_HDLC for use with
16 * tty device drivers that support bit-synchronous HDLC communications.
20 * 1. tty write calls represent one complete transmit frame of data
33 * the tty flip buffer and call the line discipline receive
39 * tty read calls.
41 * 3. tty read calls returns an entire frame of data or nothing.
45 * of the tty flags
52 * These conventions allow the standard tty programming interface
92 #include <linux/tty.h>
94 #include <linux/string.h> /* used in new tty drivers */
[all …]
H A Drpmsg_tty.c5 * The rpmsg tty driver implements serial communication on the RPMsg bus to makes
7 * tty protocol.
9 * The remote processor can instantiate a new tty by requesting a "rpmsg-tty" RPMsg service.
10 * The "rpmsg-tty" service is directly used for data exchange. No flow control is implemented yet.
18 #include <linux/tty.h>
24 static DEFINE_IDR(tty_idr); /* tty instance id */
30 struct tty_port port; /* TTY port data */
31 int id; /* TTY rpmsg index */
50 static int rpmsg_tty_install(struct tty_driver *driver, struct tty_struct *tty) in rpmsg_tty_install() argument
52 struct rpmsg_tty_port *cport = idr_find(&tty_idr, tty->index); in rpmsg_tty_install()
[all …]
H A Dvcc.c12 #include <linux/tty.h>
27 struct tty_struct *tty; /* only populated while dev is open */ member
35 /* This buffer is required to support the tty write_room interface
277 static int vcc_rx_check(struct tty_struct *tty, int size) in vcc_rx_check() argument
279 if (WARN_ON(!tty || !tty->port)) in vcc_rx_check()
285 if (test_bit(TTY_THROTTLED, &tty->flags) || in vcc_rx_check()
286 (tty_buffer_request_room(tty->port, VCC_BUFF_LEN) < VCC_BUFF_LEN)) in vcc_rx_check()
292 static int vcc_rx(struct tty_struct *tty, char *buf, int size) in vcc_rx() argument
296 if (WARN_ON(!tty || !tty->port)) in vcc_rx()
299 len = tty_insert_flip_string(tty->port, buf, size); in vcc_rx()
[all …]
H A Dgoldfish.c11 #include <linux/tty.h>
22 /* Goldfish tty register's offsets */
30 /* Goldfish tty commands */
83 * Goldfish TTY for Ranchu platform uses in goldfish_tty_rw()
102 dev_err(qtty->dev, "tty: DMA mapping error.\n"); in goldfish_tty_rw()
117 * Old style Goldfish TTY used on the Goldfish platform in goldfish_tty_rw()
150 static int goldfish_tty_activate(struct tty_port *port, struct tty_struct *tty) in goldfish_tty_activate() argument
165 static int goldfish_tty_open(struct tty_struct *tty, struct file *filp) in goldfish_tty_open() argument
167 struct goldfish_tty *qtty = &goldfish_ttys[tty->index]; in goldfish_tty_open()
168 return tty_port_open(&qtty->port, tty, filp); in goldfish_tty_open()
[all …]
H A Dtty_audit.c3 * Creating audit events from TTY input.
12 #include <linux/tty.h>
13 #include "tty.h"
19 dev_t dev; /* The TTY which the data is from */
101 tty_audit_log("tty", buf->dev, buf->data, buf->valid); in tty_audit_buf_push()
127 * tty_audit_fork - Copy TTY audit state for a new task
129 * Set up TTY audit state in @sig from current. @sig needs no locking.
139 void tty_audit_tiocsti(const struct tty_struct *tty, u8 ch) in tty_audit_tiocsti() argument
143 dev = MKDEV(tty->driver->major, tty->driver->minor_start) + tty->index; in tty_audit_tiocsti()
154 * Returns 0 if success, -EPERM if tty audit is disabled
[all …]
/linux/drivers/tty/ipwireless/
H A Dtty.c28 #include <linux/tty.h>
33 #include "tty.h"
90 struct ipw_tty *tty = get_tty(linux_tty->index); in ipw_open() local
92 if (!tty) in ipw_open()
95 mutex_lock(&tty->ipw_tty_mutex); in ipw_open()
96 if (tty->port.count == 0) in ipw_open()
97 tty->tx_bytes_queued = 0; in ipw_open()
99 tty->port.count++; in ipw_open()
101 tty->port.tty = linux_tty; in ipw_open()
102 linux_tty->driver_data = tty; in ipw_open()
[all …]
/linux/drivers/accessibility/speakup/
H A Dspk_ttyio.c3 #include <linux/tty.h>
47 static int spk_ttyio_ldisc_open(struct tty_struct *tty) in spk_ttyio_ldisc_open() argument
51 if (tty != speakup_tty) in spk_ttyio_ldisc_open()
55 if (!tty->ops->write) in spk_ttyio_ldisc_open()
64 tty->disc_data = ldisc_data; in spk_ttyio_ldisc_open()
69 static void spk_ttyio_ldisc_close(struct tty_struct *tty) in spk_ttyio_ldisc_close() argument
71 kfree(tty->disc_data); in spk_ttyio_ldisc_close()
74 static size_t spk_ttyio_receive_buf2(struct tty_struct *tty, const u8 *cp, in spk_ttyio_receive_buf2() argument
77 struct spk_ldisc_data *ldisc_data = tty->disc_data; in spk_ttyio_receive_buf2()
135 static inline void get_termios(struct tty_struct *tty, in get_termios() argument
[all …]
H A Dselection.c9 #include <linux/tty.h>
22 struct tty_struct *tty; member
30 struct tty_struct *tty; in __speakup_set_selection() local
38 /* release the lock by setting tty of the struct to NULL */ in __speakup_set_selection()
39 tty = xchg(&ssw->tty, NULL); in __speakup_set_selection()
51 set_selection_kernel(&sel, tty); in __speakup_set_selection()
54 tty_kref_put(tty); in __speakup_set_selection()
62 int speakup_set_selection(struct tty_struct *tty) in speakup_set_selection() argument
66 * invariant that if speakup_sel_work.tty is not NULL when in speakup_set_selection()
70 tty_kref_get(tty); in speakup_set_selection()
[all …]
/linux/net/nfc/nci/
H A Duart.c23 #include <linux/tty.h>
74 struct tty_struct *tty = nu->tty; in nci_uart_write_work() local
86 set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); in nci_uart_write_work()
87 len = tty->ops->write(tty, skb->data, skb->len); in nci_uart_write_work()
105 static int nci_uart_set_driver(struct tty_struct *tty, unsigned int driver) in nci_uart_set_driver() argument
121 nu->tty = tty; in nci_uart_set_driver()
135 tty->disc_data = nu; in nci_uart_set_driver()
147 * tty pointer to tty info structure
151 static int nci_uart_tty_open(struct tty_struct *tty) in nci_uart_tty_open() argument
153 /* Error if the tty has no write op instead of leaving an exploitable in nci_uart_tty_open()
[all …]
/linux/drivers/input/serio/
H A Dserport.c3 * Input device TTY line discipline
7 * This is a module that converts a tty line into a much simpler
19 #include <linux/tty.h>
23 MODULE_DESCRIPTION("Input device TTY line discipline");
32 struct tty_struct *tty; member
47 return -(serport->tty->ops->write(serport->tty, &data, 1) != 1); in serport_serio_write()
71 * discipline on a tty. It prepares the serio struct.
74 static int serport_ldisc_open(struct tty_struct *tty) in serport_ldisc_open() argument
85 serport->tty = tty; in serport_ldisc_open()
89 tty->disc_data = serport; in serport_ldisc_open()
[all …]
/linux/tools/testing/selftests/tty/
H A Dtty_tstamp_update.c16 static bool tty_valid(char *tty) in tty_valid() argument
18 if (strlen(tty) < MIN_TTY_PATH_LEN) in tty_valid()
21 if (strncmp(tty, "/dev/tty", MIN_TTY_PATH_LEN) == 0 || in tty_valid()
22 strncmp(tty, "/dev/pts", MIN_TTY_PATH_LEN) == 0) in tty_valid()
33 f = fopen("/dev/tty", "r+"); in write_dev_tty()
48 char tty[PATH_MAX] = {}; in main() local
55 r = readlink("/proc/self/fd/0", tty, PATH_MAX); in main()
61 if (!tty_valid(tty)) { in main()
62 ksft_print_msg("invalid tty path '%s'\n", tty); in main()
68 r = stat(tty, &st1); in main()
[all …]
/linux/drivers/misc/bcm-vk/
H A Dbcm_vk_tty.c6 #include <linux/tty.h>
77 /* Check the card status that the tty channel is ready */ in bcm_vk_tty_wq_handler()
81 vktty = &vk->tty[i]; in bcm_vk_tty_wq_handler()
83 /* Don't increment read index if tty app is closed */ in bcm_vk_tty_wq_handler()
104 * insert into tty flip buffer in bcm_vk_tty_wq_handler()
106 while (vk->tty[i].rd != wr) { in bcm_vk_tty_wq_handler()
126 static int bcm_vk_tty_open(struct tty_struct *tty, struct file *file) in bcm_vk_tty_open() argument
134 tty->driver_data = NULL; in bcm_vk_tty_open()
136 vk = (struct bcm_vk *)dev_get_drvdata(tty->dev); in bcm_vk_tty_open()
137 index = tty->index; in bcm_vk_tty_open()
[all …]
/linux/drivers/mmc/core/
H A Dsdio_uart.c34 #include <linux/tty.h>
141 * the tty layer. Be careful to prevent any further access in sdio_uart_port_remove()
142 * to the SDIO function and arrange for the tty layer to in sdio_uart_port_remove()
411 struct tty_struct *tty; in sdio_uart_transmit_chars() local
422 tty = tty_port_tty_get(&port->port); in sdio_uart_transmit_chars()
424 if (tty == NULL || !kfifo_len(xmit) || in sdio_uart_transmit_chars()
425 tty->flow.stopped || tty->hw_stopped) { in sdio_uart_transmit_chars()
427 tty_kref_put(tty); in sdio_uart_transmit_chars()
439 tty_wakeup(tty); in sdio_uart_transmit_chars()
443 tty_kref_put(tty); in sdio_uart_transmit_chars()
[all …]
/linux/net/bluetooth/rfcomm/
H A Dtty.c25 * RFCOMM TTY.
30 #include <linux/tty.h>
110 static int rfcomm_dev_activate(struct tty_port *port, struct tty_struct *tty) in rfcomm_dev_activate() argument
117 set_bit(TTY_IO_ERROR, &tty->flags); in rfcomm_dev_activate()
321 struct device *tty; in rfcomm_dev_add() local
331 tty = tty_port_register_device(&dev->port, rfcomm_tty_driver, in rfcomm_dev_add()
333 if (IS_ERR(tty)) { in rfcomm_dev_add()
335 return PTR_ERR(tty); in rfcomm_dev_add()
338 dev->tty_dev = tty; in rfcomm_dev_add()
465 /* Shut down TTY synchronously before freeing rfcomm_dev */ in __rfcomm_release_dev()
[all …]
/linux/drivers/usb/host/
H A Dxhci-dbgtty.c3 * xhci-dbgtty.c - tty glue for xHCI debug capability
11 #include <linux/tty.h>
84 if (do_tty_wake && port->port.tty) in dbc_do_start_tx()
85 tty_wakeup(port->port.tty); in dbc_do_start_tx()
110 if (!port->port.tty) in dbc_start_rx()
129 * Queue received data to tty buffer and push it.
131 * Returns nr of remaining bytes that didn't fit tty buffer, i.e. 0 if all
144 /* if n_read is set then request was partially moved to tty buffer */ in dbc_rx_push_buffer()
168 struct tty_struct *tty; in dbc_read_complete() local
171 tty = port->port.tty; in dbc_read_complete()
[all …]
/linux/Documentation/ABI/testing/
H A Dsysfs-tty1 What: /sys/class/tty/console/active
12 What: /sys/class/tty/tty<x>/active
21 What: /sys/class/tty/ttyS<x>/uartclk
26 UART port in serial_core, that is bound to TTY like ttyS0.
32 What: /sys/class/tty/ttyS<x>/type
36 Shows the current tty type for this port.
41 What: /sys/class/tty/ttyS<x>/line
45 Shows the current tty line number for this port.
50 What: /sys/class/tty/ttyS<x>/port
54 Shows the current tty port I/O address for this port.
[all …]
/linux/Documentation/driver-api/tty/
H A Dindex.rst4 TTY title
7 Teletypewriter (TTY) layer takes care of all those serial devices. Including
10 TTY structures
13 There are several major TTY structures. Every TTY device in a system has a
14 corresponding struct tty_port. These devices are maintained by a TTY driver
19 tty_operations are invoked by the TTY layer.
29 In-detail description of the named TTY structures is in separate documents:
43 Writing TTY Driver
46 Before one starts writing a TTY driver, they must consider
50 directly by the TTY Layer. If you are about to write such a driver, read on.
[all …]
/linux/drivers/usb/serial/
H A Dupd78f0730.c23 #include <linux/tty.h>
183 static int upd78f0730_tiocmget(struct tty_struct *tty) in upd78f0730_tiocmget() argument
186 struct usb_serial_port *port = tty->driver_data; in upd78f0730_tiocmget()
204 static int upd78f0730_tiocmset(struct tty_struct *tty, in upd78f0730_tiocmset() argument
207 struct usb_serial_port *port = tty->driver_data; in upd78f0730_tiocmset()
241 static int upd78f0730_break_ctl(struct tty_struct *tty, int break_state) in upd78f0730_break_ctl() argument
244 struct usb_serial_port *port = tty->driver_data; in upd78f0730_break_ctl()
270 struct tty_struct *tty = port->port.tty; in upd78f0730_dtr_rts() local
279 upd78f0730_tiocmset(tty, set, clear); in upd78f0730_dtr_rts()
282 static speed_t upd78f0730_get_baud_rate(struct tty_struct *tty) in upd78f0730_get_baud_rate() argument
[all …]
H A Dxr_serial.c18 #include <linux/tty.h>
107 static void xr21v141x_set_line_settings(struct tty_struct *tty,
137 void (*set_line_settings)(struct tty_struct *tty,
438 static int xr_tiocmget(struct tty_struct *tty) in xr_tiocmget() argument
440 struct usb_serial_port *port = tty->driver_data; in xr_tiocmget()
492 static int xr_tiocmset(struct tty_struct *tty, in xr_tiocmset() argument
495 struct usb_serial_port *port = tty->driver_data; in xr_tiocmset()
508 static int xr_break_ctl(struct tty_struct *tty, int break_state) in xr_break_ctl() argument
510 struct usb_serial_port *port = tty->driver_data; in xr_break_ctl()
561 static int xr21v141x_set_baudrate(struct tty_struct *tty, struct usb_serial_port *port) in xr21v141x_set_baudrate() argument
[all …]
/linux/drivers/staging/greybus/
H A Duart.c21 #include <linux/tty.h>
189 * the port the tty layer may be waiting for credits in gb_uart_receive_credits_handler()
281 static int send_line_coding(struct gb_tty *tty) in send_line_coding() argument
283 return gb_operation_sync(tty->connection, GB_UART_TYPE_SET_LINE_CODING, in send_line_coding()
284 &tty->line_coding, sizeof(tty->line_coding), in send_line_coding()
382 static int gb_tty_install(struct tty_driver *driver, struct tty_struct *tty) in gb_tty_install() argument
387 gb_tty = get_gb_by_minor(tty->index); in gb_tty_install()
391 retval = tty_standard_install(driver, tty); in gb_tty_install()
395 tty->driver_data = gb_tty; in gb_tty_install()
402 static int gb_tty_open(struct tty_struct *tty, struct file *file) in gb_tty_open() argument
[all …]

12345678910>>...17