| /linux/drivers/tty/ |
| H A D | n_tty.c | 46 #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 D | tty_ioctl.c | 17 #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 D | tty.h | 3 * 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 D | tty_mutex.c | 2 #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 D | rpmsg_tty.c | 5 * 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 D | vcc.c | 12 #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 D | goldfish.c | 11 #include <linux/tty.h> 22 /* Goldfish tty register's offsets */ 30 /* Goldfish tty commands */ 88 * Goldfish TTY for Ranchu platform uses in goldfish_tty_rw() 107 dev_err(qtty->dev, "tty: DMA mapping error.\n"); in goldfish_tty_rw() 122 * Old style Goldfish TTY used on the Goldfish platform in goldfish_tty_rw() 155 static int goldfish_tty_activate(struct tty_port *port, struct tty_struct *tty) in goldfish_tty_activate() argument 170 static int goldfish_tty_open(struct tty_struct *tty, struct file *filp) in goldfish_tty_open() argument 172 struct goldfish_tty *qtty = &goldfish_ttys[tty->index]; in goldfish_tty_open() 173 return tty_port_open(&qtty->port, tty, filp); in goldfish_tty_open() [all …]
|
| H A D | tty_audit.c | 3 * 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/accessibility/speakup/ |
| H A D | spk_ttyio.c | 3 #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 …]
|
| /linux/net/nfc/nci/ |
| H A D | uart.c | 23 #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 in nci_uart_set_driver() 151 nci_uart_tty_open(struct tty_struct * tty) nci_uart_tty_open() argument 173 nci_uart_tty_close(struct tty_struct * tty) nci_uart_tty_close() argument 205 nci_uart_tty_wakeup(struct tty_struct * tty) nci_uart_tty_wakeup() argument 298 nci_uart_tty_receive(struct tty_struct * tty,const u8 * data,const u8 * flags,size_t count) nci_uart_tty_receive() argument 325 nci_uart_tty_ioctl(struct tty_struct * tty,unsigned int cmd,unsigned long arg) nci_uart_tty_ioctl() argument 347 nci_uart_tty_read(struct tty_struct * tty,struct file * file,u8 * buf,size_t nr,void ** cookie,unsigned long offset) nci_uart_tty_read() argument 354 nci_uart_tty_write(struct tty_struct * tty,struct file * file,const u8 * data,size_t count) nci_uart_tty_write() argument [all...] |
| /linux/drivers/input/serio/ |
| H A D | serport.c | 3 * 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 D | tty_tstamp_update.c | 16 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 D | bcm_vk_tty.c | 6 #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 D | sdio_uart.c | 34 #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 D | tty.c | 22 * RFCOMM TTY. 27 #include <linux/tty.h> 107 static int rfcomm_dev_activate(struct tty_port *port, struct tty_struct *tty) in rfcomm_dev_activate() argument 114 set_bit(TTY_IO_ERROR, &tty->flags); in rfcomm_dev_activate() 318 struct device *tty; in rfcomm_dev_add() local 328 tty = tty_port_register_device(&dev->port, rfcomm_tty_driver, in rfcomm_dev_add() 330 if (IS_ERR(tty)) { in rfcomm_dev_add() 332 return PTR_ERR(tty); in rfcomm_dev_add() 335 dev->tty_dev = tty; in rfcomm_dev_add() 462 /* Shut down TTY synchronously before freeing rfcomm_dev */ in __rfcomm_release_dev() [all …]
|
| /linux/Documentation/ABI/testing/ |
| H A D | sysfs-tty | 1 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 D | index.rst | 4 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 …]
|
| H A D | tty_port.rst | 4 TTY Port 9 The TTY drivers are advised to use struct tty_port helpers as much as possible. 15 The reference and details are contained in the `TTY Port Reference`_ and `TTY 18 TTY Port Functions 24 .. kernel-doc:: drivers/tty/tty_port.c 31 .. kernel-doc:: drivers/tty/tty_port.c 36 TTY Refcounting 39 .. kernel-doc:: drivers/tty/tty_port.c 42 TTY Helpers 47 .. kernel-doc:: drivers/tty/tty_port.c [all …]
|
| /linux/drivers/usb/serial/ |
| H A D | upd78f0730.c | 23 #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 D | console.c | 16 #include <linux/tty.h> 67 struct tty_struct *tty = NULL; in usb_console_setup() local 132 * allocate a fake tty so the driver can initialize in usb_console_setup() 136 tty = kzalloc_obj(*tty); in usb_console_setup() 137 if (!tty) { in usb_console_setup() 141 kref_init(&tty->kref); in usb_console_setup() 142 tty->driver = usb_serial_tty_driver; in usb_console_setup() 143 tty->index = co->index; in usb_console_setup() 144 init_ldsem(&tty->ldisc_sem); in usb_console_setup() 145 spin_lock_init(&tty->files_lock); in usb_console_setup() [all …]
|
| /linux/drivers/char/ |
| H A D | ttyprintk.c | 17 #include <linux/tty.h> 84 * TTY operations open function. 86 static int tpk_open(struct tty_struct *tty, struct file *filp) in tpk_open() argument 88 tty->driver_data = &tpk_port; in tpk_open() 90 return tty_port_open(&tpk_port.port, tty, filp); in tpk_open() 94 * TTY operations close function. 96 static void tpk_close(struct tty_struct *tty, struct file *filp) in tpk_close() argument 98 struct ttyprintk_port *tpkp = tty->driver_data; in tpk_close() 100 tty_port_close(&tpkp->port, tty, filp); in tpk_close() 104 * TTY operations write function. [all …]
|
| /linux/drivers/tty/hvc/ |
| H A D | hvc_console.c | 22 #include <linux/tty.h> 40 * hypervisor before allowing the tty to complete a close operation. 79 * This value is used to assign a tty->index value to a hvc_struct based 139 * console interfaces but can still be used as a tty device. This has to be 147 * Console APIs, NOT TTY. These APIs are available immediately when 295 /* make sure no tty has been registered in this index */ in hvc_instantiate() 320 static void hvc_unthrottle(struct tty_struct *tty) in hvc_unthrottle() argument 325 static int hvc_install(struct tty_driver *driver, struct tty_struct *tty) in hvc_install() argument 331 hp = hvc_get_by_index(tty->index); in hvc_install() 335 tty->driver_data = hp; in hvc_install() [all …]
|
| /linux/include/linux/ |
| H A D | tty_port.h | 27 * FIXME: long term getting the tty argument *out* of this would be good 37 int (*activate)(struct tty_port *port, struct tty_struct *tty); 55 * @tty: back pointer to &struct tty_struct, valid only if the tty is open. Use 59 * @ops: tty port operations (like activate, shutdown), see &struct 61 * @client_ops: tty port client operations (like receive_buf, write_wakeup). 63 * @lock: lock protecting @tty 68 * @flags: user TTY flags (%ASYNC_) 84 * introduced as a common structure for such information. As every TTY device 87 * The tty port has a different lifetime to the tty so must be kept apart. 88 * In addition be careful as tty -> port mappings are valid for the life [all …]
|
| /linux/sound/soc/codecs/ |
| H A D | cx20442.c | 12 #include <linux/tty.h> 25 struct tty_struct *tty; member 162 /* tty and write pointers required for talking to the modem in cx20442_write() 164 if (!cx20442->tty || !cx20442->tty->ops->write) in cx20442_write() 193 if (cx20442->tty->ops->write(cx20442->tty, buf, len) != len) in cx20442_write() 212 static int v253_open(struct tty_struct *tty) in v253_open() argument 217 if (!tty->ops->write) in v253_open() 221 if (!tty in v253_open() 237 v253_close(struct tty_struct * tty) v253_close() argument 255 v253_hangup(struct tty_struct * tty) v253_hangup() argument 261 v253_receive(struct tty_struct * tty,const u8 * cp,const u8 * fp,size_t count) v253_receive() argument 389 struct tty_struct *tty = cx20442->tty; cx20442_component_remove() local [all...] |
| /linux/arch/um/drivers/ |
| H A D | line.c | 50 unsigned int line_write_room(struct tty_struct *tty) in line_write_room() argument 52 struct line *line = tty->driver_data; in line_write_room() 63 unsigned int line_chars_in_buffer(struct tty_struct *tty) in line_chars_in_buffer() argument 65 struct line *line = tty->driver_data; in line_chars_in_buffer() 168 void line_flush_buffer(struct tty_struct *tty) in line_flush_buffer() argument 170 struct line *line = tty->driver_data; in line_flush_buffer() 182 void line_flush_chars(struct tty_struct *tty) in line_flush_chars() argument 184 line_flush_buffer(tty); in line_flush_chars() 187 ssize_t line_write(struct tty_struct *tty, const u8 *buf, size_t len) in line_write() argument 189 struct line *line = tty->driver_data; in line_write() [all …]
|