| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** | 
|  | 2 | **************************************************************************** | 
|  | 3 | *** | 
|  | 4 | ***   This header was automatically generated from a Linux kernel header | 
|  | 5 | ***   of the same name, to make information necessary for userspace to | 
|  | 6 | ***   call into the kernel available to libc.  It contains only constants, | 
|  | 7 | ***   structures, and macros generated from the original header, and thus, | 
|  | 8 | ***   contains no copyrightable information. | 
|  | 9 | *** | 
|  | 10 | ***   To edit the content of this header, modify the corresponding | 
|  | 11 | ***   source file (e.g. under external/kernel-headers/original/) then | 
|  | 12 | ***   run bionic/libc/kernel/tools/update_all.py | 
|  | 13 | *** | 
|  | 14 | ***   Any manual change here will be lost the next time this script will | 
|  | 15 | ***   be run. You've been warned! | 
|  | 16 | *** | 
|  | 17 | **************************************************************************** | 
|  | 18 | ****************************************************************************/ | 
|  | 19 | #ifndef _UAPI_LINUX_SERIAL_H | 
|  | 20 | #define _UAPI_LINUX_SERIAL_H | 
|  | 21 | #include <linux/types.h> | 
|  | 22 | #include <linux/tty_flags.h> | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | struct serial_struct { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 24 | int type; | 
|  | 25 | int line; | 
|  | 26 | unsigned int port; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 27 | int irq; | 
|  | 28 | int flags; | 
|  | 29 | int xmit_fifo_size; | 
|  | 30 | int custom_divisor; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 31 | int baud_base; | 
|  | 32 | unsigned short close_delay; | 
|  | 33 | char io_type; | 
|  | 34 | char reserved_char[1]; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 35 | int hub6; | 
|  | 36 | unsigned short closing_wait; | 
|  | 37 | unsigned short closing_wait2; | 
|  | 38 | unsigned char * iomem_base; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 39 | unsigned short iomem_reg_shift; | 
|  | 40 | unsigned int port_high; | 
|  | 41 | unsigned long iomap_base; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 42 | }; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 43 | #define ASYNC_CLOSING_WAIT_INF 0 | 
|  | 44 | #define ASYNC_CLOSING_WAIT_NONE 65535 | 
|  | 45 | #define PORT_UNKNOWN 0 | 
|  | 46 | #define PORT_8250 1 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 47 | #define PORT_16450 2 | 
|  | 48 | #define PORT_16550 3 | 
|  | 49 | #define PORT_16550A 4 | 
|  | 50 | #define PORT_CIRRUS 5 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 51 | #define PORT_16650 6 | 
|  | 52 | #define PORT_16650V2 7 | 
|  | 53 | #define PORT_16750 8 | 
|  | 54 | #define PORT_STARTECH 9 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 55 | #define PORT_16C950 10 | 
|  | 56 | #define PORT_16654 11 | 
|  | 57 | #define PORT_16850 12 | 
|  | 58 | #define PORT_RSA 13 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 59 | #define PORT_MAX 13 | 
|  | 60 | #define SERIAL_IO_PORT 0 | 
|  | 61 | #define SERIAL_IO_HUB6 1 | 
|  | 62 | #define SERIAL_IO_MEM 2 | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 63 | #define SERIAL_IO_MEM32 3 | 
|  | 64 | #define SERIAL_IO_AU 4 | 
|  | 65 | #define SERIAL_IO_TSI 5 | 
|  | 66 | #define SERIAL_IO_MEM32BE 6 | 
| Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 67 | #define SERIAL_IO_MEM16 7 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 68 | #define UART_CLEAR_FIFO 0x01 | 
|  | 69 | #define UART_USE_FIFO 0x02 | 
|  | 70 | #define UART_STARTECH 0x04 | 
| Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 71 | #define UART_NATSEMI 0x08 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 72 | struct serial_multiport_struct { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 73 | int irq; | 
|  | 74 | int port1; | 
| Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 75 | unsigned char mask1, match1; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 76 | int port2; | 
|  | 77 | unsigned char mask2, match2; | 
|  | 78 | int port3; | 
| Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 79 | unsigned char mask3, match3; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 80 | int port4; | 
|  | 81 | unsigned char mask4, match4; | 
|  | 82 | int port_monitor; | 
| Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 83 | int reserved[32]; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 84 | }; | 
|  | 85 | struct serial_icounter_struct { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 86 | int cts, dsr, rng, dcd; | 
| Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 87 | int rx, tx; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 88 | int frame, overrun, parity, brk; | 
|  | 89 | int buf_overrun; | 
|  | 90 | int reserved[9]; | 
| Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 91 | }; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 92 | struct serial_rs485 { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 93 | __u32 flags; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 94 | #define SER_RS485_ENABLED (1 << 0) | 
| Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 95 | #define SER_RS485_RTS_ON_SEND (1 << 1) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 96 | #define SER_RS485_RTS_AFTER_SEND (1 << 2) | 
|  | 97 | #define SER_RS485_RX_DURING_TX (1 << 4) | 
| Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 98 | #define SER_RS485_TERMINATE_BUS (1 << 5) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 99 | __u32 delay_rts_before_send; | 
| Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 100 | __u32 delay_rts_after_send; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 101 | __u32 padding[5]; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 102 | }; | 
|  | 103 | #endif |