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_SYNCLINK_H_ |
| 8 | #define _UAPI_SYNCLINK_H_ |
| 9 | #define SYNCLINK_H_VERSION 3.6 |
| 10 | #include <linux/types.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 11 | #define BIT0 0x0001 |
| 12 | #define BIT1 0x0002 |
| 13 | #define BIT2 0x0004 |
| 14 | #define BIT3 0x0008 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 15 | #define BIT4 0x0010 |
| 16 | #define BIT5 0x0020 |
| 17 | #define BIT6 0x0040 |
| 18 | #define BIT7 0x0080 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 19 | #define BIT8 0x0100 |
| 20 | #define BIT9 0x0200 |
| 21 | #define BIT10 0x0400 |
| 22 | #define BIT11 0x0800 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | #define BIT12 0x1000 |
| 24 | #define BIT13 0x2000 |
| 25 | #define BIT14 0x4000 |
| 26 | #define BIT15 0x8000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 27 | #define BIT16 0x00010000 |
| 28 | #define BIT17 0x00020000 |
| 29 | #define BIT18 0x00040000 |
| 30 | #define BIT19 0x00080000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 31 | #define BIT20 0x00100000 |
| 32 | #define BIT21 0x00200000 |
| 33 | #define BIT22 0x00400000 |
| 34 | #define BIT23 0x00800000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 35 | #define BIT24 0x01000000 |
| 36 | #define BIT25 0x02000000 |
| 37 | #define BIT26 0x04000000 |
| 38 | #define BIT27 0x08000000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 39 | #define BIT28 0x10000000 |
| 40 | #define BIT29 0x20000000 |
| 41 | #define BIT30 0x40000000 |
| 42 | #define BIT31 0x80000000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 43 | #define HDLC_MAX_FRAME_SIZE 65535 |
| 44 | #define MAX_ASYNC_TRANSMIT 4096 |
| 45 | #define MAX_ASYNC_BUFFER_SIZE 4096 |
| 46 | #define ASYNC_PARITY_NONE 0 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 47 | #define ASYNC_PARITY_EVEN 1 |
| 48 | #define ASYNC_PARITY_ODD 2 |
| 49 | #define ASYNC_PARITY_SPACE 3 |
| 50 | #define HDLC_FLAG_UNDERRUN_ABORT7 0x0000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 51 | #define HDLC_FLAG_UNDERRUN_ABORT15 0x0001 |
| 52 | #define HDLC_FLAG_UNDERRUN_FLAG 0x0002 |
| 53 | #define HDLC_FLAG_UNDERRUN_CRC 0x0004 |
| 54 | #define HDLC_FLAG_SHARE_ZERO 0x0010 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 55 | #define HDLC_FLAG_AUTO_CTS 0x0020 |
| 56 | #define HDLC_FLAG_AUTO_DCD 0x0040 |
| 57 | #define HDLC_FLAG_AUTO_RTS 0x0080 |
| 58 | #define HDLC_FLAG_RXC_DPLL 0x0100 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 59 | #define HDLC_FLAG_RXC_BRG 0x0200 |
| 60 | #define HDLC_FLAG_RXC_TXCPIN 0x8000 |
| 61 | #define HDLC_FLAG_RXC_RXCPIN 0x0000 |
| 62 | #define HDLC_FLAG_TXC_DPLL 0x0400 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 63 | #define HDLC_FLAG_TXC_BRG 0x0800 |
| 64 | #define HDLC_FLAG_TXC_TXCPIN 0x0000 |
| 65 | #define HDLC_FLAG_TXC_RXCPIN 0x0008 |
| 66 | #define HDLC_FLAG_DPLL_DIV8 0x1000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 67 | #define HDLC_FLAG_DPLL_DIV16 0x2000 |
| 68 | #define HDLC_FLAG_DPLL_DIV32 0x0000 |
| 69 | #define HDLC_FLAG_HDLC_LOOPMODE 0x4000 |
| 70 | #define HDLC_CRC_NONE 0 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 71 | #define HDLC_CRC_16_CCITT 1 |
| 72 | #define HDLC_CRC_32_CCITT 2 |
| 73 | #define HDLC_CRC_MASK 0x00ff |
| 74 | #define HDLC_CRC_RETURN_EX 0x8000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 75 | #define RX_OK 0 |
| 76 | #define RX_CRC_ERROR 1 |
| 77 | #define HDLC_TXIDLE_FLAGS 0 |
| 78 | #define HDLC_TXIDLE_ALT_ZEROS_ONES 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 79 | #define HDLC_TXIDLE_ZEROS 2 |
| 80 | #define HDLC_TXIDLE_ONES 3 |
| 81 | #define HDLC_TXIDLE_ALT_MARK_SPACE 4 |
| 82 | #define HDLC_TXIDLE_SPACE 5 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 83 | #define HDLC_TXIDLE_MARK 6 |
| 84 | #define HDLC_TXIDLE_CUSTOM_8 0x10000000 |
| 85 | #define HDLC_TXIDLE_CUSTOM_16 0x20000000 |
| 86 | #define HDLC_ENCODING_NRZ 0 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 87 | #define HDLC_ENCODING_NRZB 1 |
| 88 | #define HDLC_ENCODING_NRZI_MARK 2 |
| 89 | #define HDLC_ENCODING_NRZI_SPACE 3 |
| 90 | #define HDLC_ENCODING_NRZI HDLC_ENCODING_NRZI_SPACE |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 91 | #define HDLC_ENCODING_BIPHASE_MARK 4 |
| 92 | #define HDLC_ENCODING_BIPHASE_SPACE 5 |
| 93 | #define HDLC_ENCODING_BIPHASE_LEVEL 6 |
| 94 | #define HDLC_ENCODING_DIFF_BIPHASE_LEVEL 7 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 95 | #define HDLC_PREAMBLE_LENGTH_8BITS 0 |
| 96 | #define HDLC_PREAMBLE_LENGTH_16BITS 1 |
| 97 | #define HDLC_PREAMBLE_LENGTH_32BITS 2 |
| 98 | #define HDLC_PREAMBLE_LENGTH_64BITS 3 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 99 | #define HDLC_PREAMBLE_PATTERN_NONE 0 |
| 100 | #define HDLC_PREAMBLE_PATTERN_ZEROS 1 |
| 101 | #define HDLC_PREAMBLE_PATTERN_FLAGS 2 |
| 102 | #define HDLC_PREAMBLE_PATTERN_10 3 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 103 | #define HDLC_PREAMBLE_PATTERN_01 4 |
| 104 | #define HDLC_PREAMBLE_PATTERN_ONES 5 |
| 105 | #define MGSL_MODE_ASYNC 1 |
| 106 | #define MGSL_MODE_HDLC 2 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 107 | #define MGSL_MODE_MONOSYNC 3 |
| 108 | #define MGSL_MODE_BISYNC 4 |
| 109 | #define MGSL_MODE_RAW 6 |
| 110 | #define MGSL_MODE_BASE_CLOCK 7 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 111 | #define MGSL_MODE_XSYNC 8 |
| 112 | #define MGSL_BUS_TYPE_ISA 1 |
| 113 | #define MGSL_BUS_TYPE_EISA 2 |
| 114 | #define MGSL_BUS_TYPE_PCI 5 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 115 | #define MGSL_INTERFACE_MASK 0xf |
| 116 | #define MGSL_INTERFACE_DISABLE 0 |
| 117 | #define MGSL_INTERFACE_RS232 1 |
| 118 | #define MGSL_INTERFACE_V35 2 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 119 | #define MGSL_INTERFACE_RS422 3 |
| 120 | #define MGSL_INTERFACE_RTS_EN 0x10 |
| 121 | #define MGSL_INTERFACE_LL 0x20 |
| 122 | #define MGSL_INTERFACE_RL 0x40 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 123 | #define MGSL_INTERFACE_MSB_FIRST 0x80 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 124 | typedef struct _MGSL_PARAMS { |
| 125 | unsigned long mode; |
| 126 | unsigned char loopback; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 127 | unsigned short flags; |
| 128 | unsigned char encoding; |
| 129 | unsigned long clock_speed; |
| 130 | unsigned char addr_filter; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 131 | unsigned short crc_type; |
| 132 | unsigned char preamble_length; |
| 133 | unsigned char preamble; |
| 134 | unsigned long data_rate; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 135 | unsigned char data_bits; |
| 136 | unsigned char stop_bits; |
| 137 | unsigned char parity; |
| 138 | } MGSL_PARAMS, * PMGSL_PARAMS; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 139 | #define MICROGATE_VENDOR_ID 0x13c0 |
| 140 | #define SYNCLINK_DEVICE_ID 0x0010 |
| 141 | #define MGSCC_DEVICE_ID 0x0020 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 142 | #define SYNCLINK_SCA_DEVICE_ID 0x0030 |
| 143 | #define SYNCLINK_GT_DEVICE_ID 0x0070 |
| 144 | #define SYNCLINK_GT4_DEVICE_ID 0x0080 |
| 145 | #define SYNCLINK_AC_DEVICE_ID 0x0090 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 146 | #define SYNCLINK_GT2_DEVICE_ID 0x00A0 |
| 147 | #define MGSL_MAX_SERIAL_NUMBER 30 |
| 148 | #define DiagStatus_OK 0 |
| 149 | #define DiagStatus_AddressFailure 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 150 | #define DiagStatus_AddressConflict 2 |
| 151 | #define DiagStatus_IrqFailure 3 |
| 152 | #define DiagStatus_IrqConflict 4 |
| 153 | #define DiagStatus_DmaFailure 5 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 154 | #define DiagStatus_DmaConflict 6 |
| 155 | #define DiagStatus_PciAdapterNotFound 7 |
| 156 | #define DiagStatus_CantAssignPciResources 8 |
| 157 | #define DiagStatus_CantAssignPciMemAddr 9 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 158 | #define DiagStatus_CantAssignPciIoAddr 10 |
| 159 | #define DiagStatus_CantAssignPciIrq 11 |
| 160 | #define DiagStatus_MemoryError 12 |
| 161 | #define SerialSignal_DCD 0x01 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 162 | #define SerialSignal_TXD 0x02 |
| 163 | #define SerialSignal_RI 0x04 |
| 164 | #define SerialSignal_RXD 0x08 |
| 165 | #define SerialSignal_CTS 0x10 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 166 | #define SerialSignal_RTS 0x20 |
| 167 | #define SerialSignal_DSR 0x40 |
| 168 | #define SerialSignal_DTR 0x80 |
| 169 | struct mgsl_icount { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 170 | __u32 cts, dsr, rng, dcd, tx, rx; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 171 | __u32 frame, parity, overrun, brk; |
| 172 | __u32 buf_overrun; |
| 173 | __u32 txok; |
| 174 | __u32 txunder; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 175 | __u32 txabort; |
| 176 | __u32 txtimeout; |
| 177 | __u32 rxshort; |
| 178 | __u32 rxlong; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 179 | __u32 rxabort; |
| 180 | __u32 rxover; |
| 181 | __u32 rxcrc; |
| 182 | __u32 rxok; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 183 | __u32 exithunt; |
| 184 | __u32 rxidle; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 185 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 186 | struct gpio_desc { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 187 | __u32 state; |
| 188 | __u32 smask; |
| 189 | __u32 dir; |
| 190 | __u32 dmask; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 191 | }; |
| 192 | #define DEBUG_LEVEL_DATA 1 |
| 193 | #define DEBUG_LEVEL_ERROR 2 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 194 | #define DEBUG_LEVEL_INFO 3 |
| 195 | #define DEBUG_LEVEL_BH 4 |
| 196 | #define DEBUG_LEVEL_ISR 5 |
| 197 | #define MgslEvent_DsrActive 0x0001 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 198 | #define MgslEvent_DsrInactive 0x0002 |
| 199 | #define MgslEvent_Dsr 0x0003 |
| 200 | #define MgslEvent_CtsActive 0x0004 |
| 201 | #define MgslEvent_CtsInactive 0x0008 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 202 | #define MgslEvent_Cts 0x000c |
| 203 | #define MgslEvent_DcdActive 0x0010 |
| 204 | #define MgslEvent_DcdInactive 0x0020 |
| 205 | #define MgslEvent_Dcd 0x0030 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 206 | #define MgslEvent_RiActive 0x0040 |
| 207 | #define MgslEvent_RiInactive 0x0080 |
| 208 | #define MgslEvent_Ri 0x00c0 |
| 209 | #define MgslEvent_ExitHuntMode 0x0100 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 210 | #define MgslEvent_IdleReceived 0x0200 |
| 211 | #define MGSL_MAGIC_IOC 'm' |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 212 | #define MGSL_IOCSPARAMS _IOW(MGSL_MAGIC_IOC, 0, struct _MGSL_PARAMS) |
| 213 | #define MGSL_IOCGPARAMS _IOR(MGSL_MAGIC_IOC, 1, struct _MGSL_PARAMS) |
| 214 | #define MGSL_IOCSTXIDLE _IO(MGSL_MAGIC_IOC, 2) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 215 | #define MGSL_IOCGTXIDLE _IO(MGSL_MAGIC_IOC, 3) |
| 216 | #define MGSL_IOCTXENABLE _IO(MGSL_MAGIC_IOC, 4) |
| 217 | #define MGSL_IOCRXENABLE _IO(MGSL_MAGIC_IOC, 5) |
| 218 | #define MGSL_IOCTXABORT _IO(MGSL_MAGIC_IOC, 6) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 219 | #define MGSL_IOCGSTATS _IO(MGSL_MAGIC_IOC, 7) |
| 220 | #define MGSL_IOCWAITEVENT _IOWR(MGSL_MAGIC_IOC, 8, int) |
| 221 | #define MGSL_IOCCLRMODCOUNT _IO(MGSL_MAGIC_IOC, 15) |
| 222 | #define MGSL_IOCLOOPTXDONE _IO(MGSL_MAGIC_IOC, 9) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 223 | #define MGSL_IOCSIF _IO(MGSL_MAGIC_IOC, 10) |
| 224 | #define MGSL_IOCGIF _IO(MGSL_MAGIC_IOC, 11) |
| 225 | #define MGSL_IOCSGPIO _IOW(MGSL_MAGIC_IOC, 16, struct gpio_desc) |
| 226 | #define MGSL_IOCGGPIO _IOR(MGSL_MAGIC_IOC, 17, struct gpio_desc) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 227 | #define MGSL_IOCWAITGPIO _IOWR(MGSL_MAGIC_IOC, 18, struct gpio_desc) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 228 | #define MGSL_IOCSXSYNC _IO(MGSL_MAGIC_IOC, 19) |
| 229 | #define MGSL_IOCGXSYNC _IO(MGSL_MAGIC_IOC, 20) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 230 | #define MGSL_IOCSXCTRL _IO(MGSL_MAGIC_IOC, 21) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 231 | #define MGSL_IOCGXCTRL _IO(MGSL_MAGIC_IOC, 22) |
| 232 | #endif |