Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tty: tty_driver: move TTY macros to the top

So that they can be referenced in structs once converted to enums (in
the next patches).

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20250317070046.24386-13-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
67acbcc3 f812af36

+78 -78
+78 -78
include/linux/tty_driver.h
··· 17 17 struct serial_struct; 18 18 19 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 + 97 + /** 20 98 * struct tty_operations -- interface between driver and tty 21 99 * 22 100 * @lookup: ``struct tty_struct *()(struct tty_driver *self, struct file *, ··· 571 493 { 572 494 driver->ops = op; 573 495 } 574 - 575 - /** 576 - * DOC: TTY Driver Flags 577 - * 578 - * TTY_DRIVER_RESET_TERMIOS 579 - * Requests the tty layer to reset the termios setting when the last 580 - * process has closed the device. Used for PTYs, in particular. 581 - * 582 - * TTY_DRIVER_REAL_RAW 583 - * Indicates that the driver will guarantee not to set any special 584 - * character handling flags if this is set for the tty: 585 - * 586 - * ``(IGNBRK || (!BRKINT && !PARMRK)) && (IGNPAR || !INPCK)`` 587 - * 588 - * That is, if there is no reason for the driver to 589 - * send notifications of parity and break characters up to the line 590 - * driver, it won't do so. This allows the line driver to optimize for 591 - * this case if this flag is set. (Note that there is also a promise, if 592 - * the above case is true, not to signal overruns, either.) 593 - * 594 - * TTY_DRIVER_DYNAMIC_DEV 595 - * The individual tty devices need to be registered with a call to 596 - * tty_register_device() when the device is found in the system and 597 - * unregistered with a call to tty_unregister_device() so the devices will 598 - * be show up properly in sysfs. If not set, all &tty_driver.num entries 599 - * will be created by the tty core in sysfs when tty_register_driver() is 600 - * called. This is to be used by drivers that have tty devices that can 601 - * appear and disappear while the main tty driver is registered with the 602 - * tty core. 603 - * 604 - * TTY_DRIVER_DEVPTS_MEM 605 - * Don't use the standard arrays (&tty_driver.ttys and 606 - * &tty_driver.termios), instead use dynamic memory keyed through the 607 - * devpts filesystem. This is only applicable to the PTY driver. 608 - * 609 - * TTY_DRIVER_HARDWARE_BREAK 610 - * Hardware handles break signals. Pass the requested timeout to the 611 - * &tty_operations.break_ctl instead of using a simple on/off interface. 612 - * 613 - * TTY_DRIVER_DYNAMIC_ALLOC 614 - * Do not allocate structures which are needed per line for this driver 615 - * (&tty_driver.ports) as it would waste memory. The driver will take 616 - * care. This is only applicable to the PTY driver. 617 - * 618 - * TTY_DRIVER_UNNUMBERED_NODE 619 - * Do not create numbered ``/dev`` nodes. For example, create 620 - * ``/dev/ttyprintk`` and not ``/dev/ttyprintk0``. Applicable only when a 621 - * driver for a single tty device is being allocated. 622 - */ 623 - #define TTY_DRIVER_INSTALLED 0x0001 624 - #define TTY_DRIVER_RESET_TERMIOS 0x0002 625 - #define TTY_DRIVER_REAL_RAW 0x0004 626 - #define TTY_DRIVER_DYNAMIC_DEV 0x0008 627 - #define TTY_DRIVER_DEVPTS_MEM 0x0010 628 - #define TTY_DRIVER_HARDWARE_BREAK 0x0020 629 - #define TTY_DRIVER_DYNAMIC_ALLOC 0x0040 630 - #define TTY_DRIVER_UNNUMBERED_NODE 0x0080 631 - 632 - /* tty driver types */ 633 - #define TTY_DRIVER_TYPE_SYSTEM 0x0001 634 - #define TTY_DRIVER_TYPE_CONSOLE 0x0002 635 - #define TTY_DRIVER_TYPE_SERIAL 0x0003 636 - #define TTY_DRIVER_TYPE_PTY 0x0004 637 - #define TTY_DRIVER_TYPE_SCC 0x0005 /* scc driver */ 638 - #define TTY_DRIVER_TYPE_SYSCONS 0x0006 639 - 640 - /* system subtypes (magic, used by tty_io.c) */ 641 - #define SYSTEM_TYPE_TTY 0x0001 642 - #define SYSTEM_TYPE_CONSOLE 0x0002 643 - #define SYSTEM_TYPE_SYSCONS 0x0003 644 - #define SYSTEM_TYPE_SYSPTMX 0x0004 645 - 646 - /* pty subtypes (magic, used by tty_io.c) */ 647 - #define PTY_TYPE_MASTER 0x0001 648 - #define PTY_TYPE_SLAVE 0x0002 649 - 650 - /* serial subtype definitions */ 651 - #define SERIAL_TYPE_NORMAL 1 652 496 653 497 int tty_register_driver(struct tty_driver *driver); 654 498 void tty_unregister_driver(struct tty_driver *driver);