termbits-common.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef __ASM_GENERIC_TERMBITS_COMMON_H
  3. #define __ASM_GENERIC_TERMBITS_COMMON_H
  4. typedef unsigned char cc_t;
  5. typedef unsigned int speed_t;
  6. /* c_iflag bits */
  7. #define IGNBRK 0x001 /* Ignore break condition */
  8. #define BRKINT 0x002 /* Signal interrupt on break */
  9. #define IGNPAR 0x004 /* Ignore characters with parity errors */
  10. #define PARMRK 0x008 /* Mark parity and framing errors */
  11. #define INPCK 0x010 /* Enable input parity check */
  12. #define ISTRIP 0x020 /* Strip 8th bit off characters */
  13. #define INLCR 0x040 /* Map NL to CR on input */
  14. #define IGNCR 0x080 /* Ignore CR */
  15. #define ICRNL 0x100 /* Map CR to NL on input */
  16. #define IXANY 0x800 /* Any character will restart after stop */
  17. /* c_oflag bits */
  18. #define OPOST 0x01 /* Perform output processing */
  19. #define OCRNL 0x08
  20. #define ONOCR 0x10
  21. #define ONLRET 0x20
  22. #define OFILL 0x40
  23. #define OFDEL 0x80
  24. /* c_cflag bit meaning */
  25. /* Common CBAUD rates */
  26. #define B0 0x00000000 /* hang up */
  27. #define B50 0x00000001
  28. #define B75 0x00000002
  29. #define B110 0x00000003
  30. #define B134 0x00000004
  31. #define B150 0x00000005
  32. #define B200 0x00000006
  33. #define B300 0x00000007
  34. #define B600 0x00000008
  35. #define B1200 0x00000009
  36. #define B1800 0x0000000a
  37. #define B2400 0x0000000b
  38. #define B4800 0x0000000c
  39. #define B9600 0x0000000d
  40. #define B19200 0x0000000e
  41. #define B38400 0x0000000f
  42. #define EXTA B19200
  43. #define EXTB B38400
  44. #define ADDRB 0x20000000 /* address bit */
  45. #define CMSPAR 0x40000000 /* mark or space (stick) parity */
  46. #define CRTSCTS 0x80000000 /* flow control */
  47. #define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
  48. /* tcflow() ACTION argument and TCXONC use these */
  49. #define TCOOFF 0 /* Suspend output */
  50. #define TCOON 1 /* Restart suspended output */
  51. #define TCIOFF 2 /* Send a STOP character */
  52. #define TCION 3 /* Send a START character */
  53. /* tcflush() QUEUE_SELECTOR argument and TCFLSH use these */
  54. #define TCIFLUSH 0 /* Discard data received but not yet read */
  55. #define TCOFLUSH 1 /* Discard data written but not yet sent */
  56. #define TCIOFLUSH 2 /* Discard all pending data */
  57. #endif /* __ASM_GENERIC_TERMBITS_COMMON_H */