~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/um/drivers/line.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /* 
  3  * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
  4  */
  5 
  6 #ifndef __LINE_H__
  7 #define __LINE_H__
  8 
  9 #include <linux/list.h>
 10 #include <linux/workqueue.h>
 11 #include <linux/tty.h>
 12 #include <linux/interrupt.h>
 13 #include <linux/spinlock.h>
 14 #include <linux/mutex.h>
 15 #include "chan_user.h"
 16 #include "mconsole_kern.h"
 17 
 18 /* There's only two modifiable fields in this - .mc.list and .driver */
 19 struct line_driver {
 20         const char *name;
 21         const char *device_name;
 22         const short major;
 23         const short minor_start;
 24         const short type;
 25         const short subtype;
 26         const char *read_irq_name;
 27         const char *write_irq_name;
 28         struct mc_device mc;
 29         struct tty_driver *driver;
 30 };
 31 
 32 struct line {
 33         struct tty_port port;
 34         int valid;
 35 
 36         int read_irq, write_irq;
 37 
 38         char *init_str;
 39         struct list_head chan_list;
 40         struct chan *chan_in, *chan_out;
 41 
 42         /*This lock is actually, mostly, local to*/
 43         spinlock_t lock;
 44         int throttled;
 45         /* Yes, this is a real circular buffer.
 46          * XXX: And this should become a struct kfifo!
 47          *
 48          * buffer points to a buffer allocated on demand, of length
 49          * LINE_BUFSIZE, head to the start of the ring, tail to the end.*/
 50         u8 *buffer;
 51         u8 *head;
 52         u8 *tail;
 53 
 54         int sigio;
 55         struct delayed_work task;
 56         const struct line_driver *driver;
 57 };
 58 
 59 extern void line_close(struct tty_struct *tty, struct file * filp);
 60 extern int line_open(struct tty_struct *tty, struct file *filp);
 61 extern int line_install(struct tty_driver *driver, struct tty_struct *tty,
 62         struct line *line);
 63 extern void line_cleanup(struct tty_struct *tty);
 64 extern void line_hangup(struct tty_struct *tty);
 65 extern int line_setup(char **conf, unsigned nlines, char **def,
 66                       char *init, char *name);
 67 extern ssize_t line_write(struct tty_struct *tty, const u8 *buf, size_t len);
 68 extern unsigned int line_chars_in_buffer(struct tty_struct *tty);
 69 extern void line_flush_buffer(struct tty_struct *tty);
 70 extern void line_flush_chars(struct tty_struct *tty);
 71 extern unsigned int line_write_room(struct tty_struct *tty);
 72 extern void line_throttle(struct tty_struct *tty);
 73 extern void line_unthrottle(struct tty_struct *tty);
 74 
 75 extern char *add_xterm_umid(char *base);
 76 extern int line_setup_irq(int fd, int input, int output, struct line *line,
 77                           void *data);
 78 extern void line_close_chan(struct line *line);
 79 extern int register_lines(struct line_driver *line_driver,
 80                           const struct tty_operations *driver,
 81                           struct line *lines, int nlines);
 82 extern int setup_one_line(struct line *lines, int n, char *init,
 83                           const struct chan_opts *opts, char **error_out);
 84 extern void close_lines(struct line *lines, int nlines);
 85 
 86 extern int line_config(struct line *lines, unsigned int sizeof_lines,
 87                        char *str, const struct chan_opts *opts,
 88                        char **error_out);
 89 extern int line_id(char **str, int *start_out, int *end_out);
 90 extern int line_remove(struct line *lines, unsigned int sizeof_lines, int n,
 91                        char **error_out);
 92 extern int line_get_config(char *dev, struct line *lines,
 93                            unsigned int sizeof_lines, char *str,
 94                            int size, char **error_out);
 95 
 96 #endif
 97 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php