Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is auto-generated. Modifications will be lost. |
| 3 | * |
| 4 | * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ |
| 5 | * for more information. |
| 6 | */ |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 7 | #ifndef _UAPI_LINUX_SERIAL_H |
| 8 | #define _UAPI_LINUX_SERIAL_H |
| 9 | #include <linux/types.h> |
| 10 | #include <linux/tty_flags.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 11 | struct serial_struct { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 12 | int type; |
| 13 | int line; |
| 14 | unsigned int port; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 15 | int irq; |
| 16 | int flags; |
| 17 | int xmit_fifo_size; |
| 18 | int custom_divisor; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 19 | int baud_base; |
| 20 | unsigned short close_delay; |
| 21 | char io_type; |
| 22 | char reserved_char[1]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 23 | int hub6; |
| 24 | unsigned short closing_wait; |
| 25 | unsigned short closing_wait2; |
| 26 | unsigned char * iomem_base; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 27 | unsigned short iomem_reg_shift; |
| 28 | unsigned int port_high; |
| 29 | unsigned long iomap_base; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 30 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 31 | #define ASYNC_CLOSING_WAIT_INF 0 |
| 32 | #define ASYNC_CLOSING_WAIT_NONE 65535 |
| 33 | #define PORT_UNKNOWN 0 |
| 34 | #define PORT_8250 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 35 | #define PORT_16450 2 |
| 36 | #define PORT_16550 3 |
| 37 | #define PORT_16550A 4 |
| 38 | #define PORT_CIRRUS 5 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 39 | #define PORT_16650 6 |
| 40 | #define PORT_16650V2 7 |
| 41 | #define PORT_16750 8 |
| 42 | #define PORT_STARTECH 9 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 43 | #define PORT_16C950 10 |
| 44 | #define PORT_16654 11 |
| 45 | #define PORT_16850 12 |
| 46 | #define PORT_RSA 13 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 47 | #define PORT_MAX 13 |
| 48 | #define SERIAL_IO_PORT 0 |
| 49 | #define SERIAL_IO_HUB6 1 |
| 50 | #define SERIAL_IO_MEM 2 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 51 | #define SERIAL_IO_MEM32 3 |
| 52 | #define SERIAL_IO_AU 4 |
| 53 | #define SERIAL_IO_TSI 5 |
| 54 | #define SERIAL_IO_MEM32BE 6 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 55 | #define SERIAL_IO_MEM16 7 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 56 | #define UART_CLEAR_FIFO 0x01 |
| 57 | #define UART_USE_FIFO 0x02 |
| 58 | #define UART_STARTECH 0x04 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 59 | #define UART_NATSEMI 0x08 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 60 | struct serial_multiport_struct { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 61 | int irq; |
| 62 | int port1; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 63 | unsigned char mask1, match1; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 64 | int port2; |
| 65 | unsigned char mask2, match2; |
| 66 | int port3; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 67 | unsigned char mask3, match3; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 68 | int port4; |
| 69 | unsigned char mask4, match4; |
| 70 | int port_monitor; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 71 | int reserved[32]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 72 | }; |
| 73 | struct serial_icounter_struct { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 74 | int cts, dsr, rng, dcd; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 75 | int rx, tx; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 76 | int frame, overrun, parity, brk; |
| 77 | int buf_overrun; |
| 78 | int reserved[9]; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 79 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 80 | struct serial_rs485 { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 81 | __u32 flags; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 82 | #define SER_RS485_ENABLED (1 << 0) |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 83 | #define SER_RS485_RTS_ON_SEND (1 << 1) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 84 | #define SER_RS485_RTS_AFTER_SEND (1 << 2) |
| 85 | #define SER_RS485_RX_DURING_TX (1 << 4) |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 86 | #define SER_RS485_TERMINATE_BUS (1 << 5) |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 87 | #define SER_RS485_ADDRB (1 << 6) |
| 88 | #define SER_RS485_ADDR_RECV (1 << 7) |
| 89 | #define SER_RS485_ADDR_DEST (1 << 8) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 90 | __u32 delay_rts_before_send; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 91 | __u32 delay_rts_after_send; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 92 | union { |
| 93 | __u32 padding[5]; |
| 94 | struct { |
| 95 | __u8 addr_recv; |
| 96 | __u8 addr_dest; |
| 97 | __u8 padding0[2]; |
| 98 | __u32 padding1[4]; |
| 99 | }; |
| 100 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 101 | }; |
Christopher Ferris | 86a4837 | 2019-01-10 14:14:59 -0800 | [diff] [blame] | 102 | struct serial_iso7816 { |
| 103 | __u32 flags; |
| 104 | #define SER_ISO7816_ENABLED (1 << 0) |
| 105 | #define SER_ISO7816_T_PARAM (0x0f << 4) |
| 106 | #define SER_ISO7816_T(t) (((t) & 0x0f) << 4) |
| 107 | __u32 tg; |
| 108 | __u32 sc_fi; |
| 109 | __u32 sc_di; |
| 110 | __u32 clk; |
| 111 | __u32 reserved[5]; |
| 112 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 113 | #endif |