@@ -16,6 +16,84 @@ struct tty_driver;
1616struct serial_icounter_struct ;
1717struct serial_struct ;
1818
19+ /**
20+ * DOC: TTY Driver Flags
21+ *
22+ * TTY_DRIVER_RESET_TERMIOS
23+ * Requests the tty layer to reset the termios setting when the last
24+ * process has closed the device. Used for PTYs, in particular.
25+ *
26+ * TTY_DRIVER_REAL_RAW
27+ * Indicates that the driver will guarantee not to set any special
28+ * character handling flags if this is set for the tty:
29+ *
30+ * ``(IGNBRK || (!BRKINT && !PARMRK)) && (IGNPAR || !INPCK)``
31+ *
32+ * That is, if there is no reason for the driver to
33+ * send notifications of parity and break characters up to the line
34+ * driver, it won't do so. This allows the line driver to optimize for
35+ * this case if this flag is set. (Note that there is also a promise, if
36+ * the above case is true, not to signal overruns, either.)
37+ *
38+ * TTY_DRIVER_DYNAMIC_DEV
39+ * The individual tty devices need to be registered with a call to
40+ * tty_register_device() when the device is found in the system and
41+ * unregistered with a call to tty_unregister_device() so the devices will
42+ * be show up properly in sysfs. If not set, all &tty_driver.num entries
43+ * will be created by the tty core in sysfs when tty_register_driver() is
44+ * called. This is to be used by drivers that have tty devices that can
45+ * appear and disappear while the main tty driver is registered with the
46+ * tty core.
47+ *
48+ * TTY_DRIVER_DEVPTS_MEM
49+ * Don't use the standard arrays (&tty_driver.ttys and
50+ * &tty_driver.termios), instead use dynamic memory keyed through the
51+ * devpts filesystem. This is only applicable to the PTY driver.
52+ *
53+ * TTY_DRIVER_HARDWARE_BREAK
54+ * Hardware handles break signals. Pass the requested timeout to the
55+ * &tty_operations.break_ctl instead of using a simple on/off interface.
56+ *
57+ * TTY_DRIVER_DYNAMIC_ALLOC
58+ * Do not allocate structures which are needed per line for this driver
59+ * (&tty_driver.ports) as it would waste memory. The driver will take
60+ * care. This is only applicable to the PTY driver.
61+ *
62+ * TTY_DRIVER_UNNUMBERED_NODE
63+ * Do not create numbered ``/dev`` nodes. For example, create
64+ * ``/dev/ttyprintk`` and not ``/dev/ttyprintk0``. Applicable only when a
65+ * driver for a single tty device is being allocated.
66+ */
67+ #define TTY_DRIVER_INSTALLED 0x0001
68+ #define TTY_DRIVER_RESET_TERMIOS 0x0002
69+ #define TTY_DRIVER_REAL_RAW 0x0004
70+ #define TTY_DRIVER_DYNAMIC_DEV 0x0008
71+ #define TTY_DRIVER_DEVPTS_MEM 0x0010
72+ #define TTY_DRIVER_HARDWARE_BREAK 0x0020
73+ #define TTY_DRIVER_DYNAMIC_ALLOC 0x0040
74+ #define TTY_DRIVER_UNNUMBERED_NODE 0x0080
75+
76+ /* tty driver types */
77+ #define TTY_DRIVER_TYPE_SYSTEM 0x0001
78+ #define TTY_DRIVER_TYPE_CONSOLE 0x0002
79+ #define TTY_DRIVER_TYPE_SERIAL 0x0003
80+ #define TTY_DRIVER_TYPE_PTY 0x0004
81+ #define TTY_DRIVER_TYPE_SCC 0x0005 /* scc driver */
82+ #define TTY_DRIVER_TYPE_SYSCONS 0x0006
83+
84+ /* system subtypes (magic, used by tty_io.c) */
85+ #define SYSTEM_TYPE_TTY 0x0001
86+ #define SYSTEM_TYPE_CONSOLE 0x0002
87+ #define SYSTEM_TYPE_SYSCONS 0x0003
88+ #define SYSTEM_TYPE_SYSPTMX 0x0004
89+
90+ /* pty subtypes (magic, used by tty_io.c) */
91+ #define PTY_TYPE_MASTER 0x0001
92+ #define PTY_TYPE_SLAVE 0x0002
93+
94+ /* serial subtype definitions */
95+ #define SERIAL_TYPE_NORMAL 1
96+
1997/**
2098 * struct tty_operations -- interface between driver and tty
2199 *
@@ -494,84 +572,6 @@ static inline void tty_set_operations(struct tty_driver *driver,
494572 driver -> ops = op ;
495573}
496574
497- /**
498- * DOC: TTY Driver Flags
499- *
500- * TTY_DRIVER_RESET_TERMIOS
501- * Requests the tty layer to reset the termios setting when the last
502- * process has closed the device. Used for PTYs, in particular.
503- *
504- * TTY_DRIVER_REAL_RAW
505- * Indicates that the driver will guarantee not to set any special
506- * character handling flags if this is set for the tty:
507- *
508- * ``(IGNBRK || (!BRKINT && !PARMRK)) && (IGNPAR || !INPCK)``
509- *
510- * That is, if there is no reason for the driver to
511- * send notifications of parity and break characters up to the line
512- * driver, it won't do so. This allows the line driver to optimize for
513- * this case if this flag is set. (Note that there is also a promise, if
514- * the above case is true, not to signal overruns, either.)
515- *
516- * TTY_DRIVER_DYNAMIC_DEV
517- * The individual tty devices need to be registered with a call to
518- * tty_register_device() when the device is found in the system and
519- * unregistered with a call to tty_unregister_device() so the devices will
520- * be show up properly in sysfs. If not set, all &tty_driver.num entries
521- * will be created by the tty core in sysfs when tty_register_driver() is
522- * called. This is to be used by drivers that have tty devices that can
523- * appear and disappear while the main tty driver is registered with the
524- * tty core.
525- *
526- * TTY_DRIVER_DEVPTS_MEM
527- * Don't use the standard arrays (&tty_driver.ttys and
528- * &tty_driver.termios), instead use dynamic memory keyed through the
529- * devpts filesystem. This is only applicable to the PTY driver.
530- *
531- * TTY_DRIVER_HARDWARE_BREAK
532- * Hardware handles break signals. Pass the requested timeout to the
533- * &tty_operations.break_ctl instead of using a simple on/off interface.
534- *
535- * TTY_DRIVER_DYNAMIC_ALLOC
536- * Do not allocate structures which are needed per line for this driver
537- * (&tty_driver.ports) as it would waste memory. The driver will take
538- * care. This is only applicable to the PTY driver.
539- *
540- * TTY_DRIVER_UNNUMBERED_NODE
541- * Do not create numbered ``/dev`` nodes. For example, create
542- * ``/dev/ttyprintk`` and not ``/dev/ttyprintk0``. Applicable only when a
543- * driver for a single tty device is being allocated.
544- */
545- #define TTY_DRIVER_INSTALLED 0x0001
546- #define TTY_DRIVER_RESET_TERMIOS 0x0002
547- #define TTY_DRIVER_REAL_RAW 0x0004
548- #define TTY_DRIVER_DYNAMIC_DEV 0x0008
549- #define TTY_DRIVER_DEVPTS_MEM 0x0010
550- #define TTY_DRIVER_HARDWARE_BREAK 0x0020
551- #define TTY_DRIVER_DYNAMIC_ALLOC 0x0040
552- #define TTY_DRIVER_UNNUMBERED_NODE 0x0080
553-
554- /* tty driver types */
555- #define TTY_DRIVER_TYPE_SYSTEM 0x0001
556- #define TTY_DRIVER_TYPE_CONSOLE 0x0002
557- #define TTY_DRIVER_TYPE_SERIAL 0x0003
558- #define TTY_DRIVER_TYPE_PTY 0x0004
559- #define TTY_DRIVER_TYPE_SCC 0x0005 /* scc driver */
560- #define TTY_DRIVER_TYPE_SYSCONS 0x0006
561-
562- /* system subtypes (magic, used by tty_io.c) */
563- #define SYSTEM_TYPE_TTY 0x0001
564- #define SYSTEM_TYPE_CONSOLE 0x0002
565- #define SYSTEM_TYPE_SYSCONS 0x0003
566- #define SYSTEM_TYPE_SYSPTMX 0x0004
567-
568- /* pty subtypes (magic, used by tty_io.c) */
569- #define PTY_TYPE_MASTER 0x0001
570- #define PTY_TYPE_SLAVE 0x0002
571-
572- /* serial subtype definitions */
573- #define SERIAL_TYPE_NORMAL 1
574-
575575int tty_register_driver (struct tty_driver * driver );
576576void tty_unregister_driver (struct tty_driver * driver );
577577struct device * tty_register_device (struct tty_driver * driver , unsigned index ,
0 commit comments