Linux 4.19.133
[linux/fpc-iii.git] / drivers / staging / dgnc / digi.h
blobb414ee80db88604b0ea2022f5594a9dcca136064
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 */
7 #ifndef _DIGI_H
8 #define _DIGI_H
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
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 */
30 * Structure used with ioctl commands for DIGI parameters.
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.
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];
56 /**
57 * struct digi_getbuffer - Holds buffer use counts.
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;
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.
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;
87 #define DIGI_SETCUSTOMBAUD _IOW('e', 106, int) /* Set integer baud rate */
88 #define DIGI_GETCUSTOMBAUD _IOR('e', 107, int) /* Get integer baud rate */
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)
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 */
102 * struct ni_info - intelligent <--> non-intelligent DPA translation.
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;
126 #define TTY_FLIPBUF_SIZE 512
128 #endif /* _DIGI_H */