1 /* SPDX-License-Identifier: GPL-2.0+ */ 2 /* 3 * Copyright 2003 Digi International (www.digi.com) 4 * Scott H Kilau <Scott_Kilau at digi dot com> 5 */ 6 7 #ifndef _DIGI_H 8 #define _DIGI_H 9 10 #define DIGI_GETA (('e' << 8) | 94) /* Read params */ 11 #define DIGI_SETA (('e' << 8) | 95) /* Set params */ 12 #define DIGI_SETAW (('e' << 8) | 96) /* Drain & set params */ 13 #define DIGI_SETAF (('e' << 8) | 97) /* Drain, flush & set params */ 14 #define DIGI_LOOPBACK (('d' << 8) | 252) /* Enable/disable UART 15 * internal loopback 16 */ 17 #define DIGI_FAST 0x0002 /* Fast baud rates */ 18 #define RTSPACE 0x0004 /* RTS input flow control */ 19 #define CTSPACE 0x0008 /* CTS output flow control */ 20 #define DIGI_COOK 0x0080 /* Cooked processing done in FEP */ 21 #define DIGI_FORCEDCD 0x0100 /* Force carrier */ 22 #define DIGI_ALTPIN 0x0200 /* Alternate RJ-45 pin config */ 23 #define DIGI_PRINTER 0x0800 /* Hold port open for flow cntrl*/ 24 #define DIGI_DTR_TOGGLE 0x2000 /* Support DTR Toggle */ 25 #define DIGI_RTS_TOGGLE 0x8000 /* Support RTS Toggle */ 26 #define DIGI_PLEN 28 /* String length */ 27 #define DIGI_TSIZ 10 /* Terminal string len */ 28 29 /* 30 * Structure used with ioctl commands for DIGI parameters. 31 */ 32 /** 33 * struct digi_t - Ioctl commands for DIGI parameters. 34 * @digi_flags: Flags. 35 * @digi_maxcps: Maximum printer CPS. 36 * @digi_maxchar: Maximum characters in the print queue. 37 * @digi_bufsize: Buffer size. 38 * @digi_onlen: Length of ON string. 39 * @digi_offlen: Length of OFF string. 40 * @digi_onstr: Printer ON string. 41 * @digi_offstr: Printer OFF string. 42 * @digi_term: Terminal string. 43 */ 44 struct digi_t { 45 unsigned short digi_flags; 46 unsigned short digi_maxcps; 47 unsigned short digi_maxchar; 48 unsigned short digi_bufsize; 49 unsigned char digi_onlen; 50 unsigned char digi_offlen; 51 char digi_onstr[DIGI_PLEN]; 52 char digi_offstr[DIGI_PLEN]; 53 char digi_term[DIGI_TSIZ]; 54 }; 55 56 /** 57 * struct digi_getbuffer - Holds buffer use counts. 58 */ 59 struct digi_getbuffer { 60 unsigned long tx_in; 61 unsigned long tx_out; 62 unsigned long rxbuf; 63 unsigned long txbuf; 64 unsigned long txdone; 65 }; 66 67 /** 68 * struct digi_getcounter 69 * @norun: Number of UART overrun errors. 70 * @noflow: Number of buffer overflow errors. 71 * @nframe: Number of framing errors. 72 * @nparity: Number of parity errors. 73 * @nbreak: Number of breaks received. 74 * @rbytes: Number of received bytes. 75 * @tbytes: Number of transmitted bytes. 76 */ 77 struct digi_getcounter { 78 unsigned long norun; 79 unsigned long noflow; 80 unsigned long nframe; 81 unsigned long nparity; 82 unsigned long nbreak; 83 unsigned long rbytes; 84 unsigned long tbytes; 85 }; 86 87 #define DIGI_SETCUSTOMBAUD _IOW('e', 106, int) /* Set integer baud rate */ 88 #define DIGI_GETCUSTOMBAUD _IOR('e', 107, int) /* Get integer baud rate */ 89 90 #define DIGI_REALPORT_GETBUFFERS (('e' << 8) | 108) 91 #define DIGI_REALPORT_SENDIMMEDIATE (('e' << 8) | 109) 92 #define DIGI_REALPORT_GETCOUNTERS (('e' << 8) | 110) 93 #define DIGI_REALPORT_GETEVENTS (('e' << 8) | 111) 94 95 #define EV_OPU 0x0001 /* Output paused by client */ 96 #define EV_OPS 0x0002 /* Output paused by regular sw flowctrl */ 97 #define EV_IPU 0x0010 /* Input paused unconditionally by user */ 98 #define EV_IPS 0x0020 /* Input paused by high/low water marks */ 99 #define EV_TXB 0x0040 /* Transmit break pending */ 100 101 /** 102 * struct ni_info - intelligent <--> non-intelligent DPA translation. 103 */ 104 struct ni_info { 105 int board; 106 int channel; 107 int dtr; 108 int rts; 109 int cts; 110 int dsr; 111 int ri; 112 int dcd; 113 int curtx; 114 int currx; 115 unsigned short iflag; 116 unsigned short oflag; 117 unsigned short cflag; 118 unsigned short lflag; 119 unsigned int mstat; 120 unsigned char hflow; 121 unsigned char xmit_stopped; 122 unsigned char recv_stopped; 123 unsigned int baud; 124 }; 125 126 #define TTY_FLIPBUF_SIZE 512 127 128 #endif /* _DIGI_H */ 129