aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/epca.h
blob: 3c77c02b5d659e6362017cd8bdc6f4ee115943f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#define XEMPORTS    0xC02
#define XEPORTS     0xC22

#define MAX_ALLOC   0x100

#define MAXBOARDS   12
#define FEPCODESEG  0x0200L
#define FEPCODE     0x2000L
#define BIOSCODE    0xf800L

#define MISCGLOBAL  0x0C00L
#define NPORT       0x0C22L
#define MBOX        0x0C40L
#define PORTBASE    0x0C90L

/* Begin code defines used for epca_setup */

#define INVALID_BOARD_TYPE   0x1
#define INVALID_NUM_PORTS    0x2
#define INVALID_MEM_BASE     0x4
#define INVALID_PORT_BASE    0x8
#define INVALID_BOARD_STATUS 0x10
#define INVALID_ALTPIN       0x20

/* End code defines used for epca_setup */


#define FEPCLR      0x00
#define FEPMEM      0x02
#define FEPRST      0x04
#define FEPINT      0x08
#define	FEPMASK     0x0e
#define	FEPWIN      0x80

#define PCXE    0
#define PCXEVE  1
#define PCXEM   2   
#define EISAXEM 3
#define PC64XE  4
#define PCXI    5
#define PCIXEM  7
#define PCICX   8
#define PCIXR   9
#define PCIXRJ  10
#define EPCA_NUM_TYPES 6


static char *board_desc[] = 
{
	"PC/Xe",
	"PC/Xeve",
	"PC/Xem",
	"EISA/Xem",
	"PC/64Xe",
	"PC/Xi",
	"unknown",
	"PCI/Xem",
	"PCI/CX",
	"PCI/Xr",
	"PCI/Xrj",
};

#define STARTC      021
#define STOPC       023
#define IAIXON      0x2000


#define TXSTOPPED  0x1
#define LOWWAIT    0x2
#define EMPTYWAIT  0x4
#define RXSTOPPED  0x8
#define TXBUSY     0x10

#define DISABLED   0
#define ENABLED    1
#define OFF        0
#define ON         1

#define FEPTIMEOUT 200000  
#define SERIAL_TYPE_INFO    3
#define EPCA_EVENT_HANGUP   1
#define EPCA_MAGIC          0x5c6df104L

struct channel 
{
	long   magic;
	unsigned char boardnum;
	unsigned char channelnum;
	unsigned char omodem;         /* FEP output modem status     */
	unsigned char imodem;         /* FEP input modem status      */
	unsigned char modemfake;      /* Modem values to be forced   */
	unsigned char modem;          /* Force values                */
	unsigned char hflow;
	unsigned char dsr;
	unsigned char dcd;
	unsigned char m_rts ; 		/* The bits used in whatever FEP */
	unsigned char m_dcd ;		/* is indiginous to this board to */
	unsigned char m_dsr ;		/* represent each of the physical */
	unsigned char m_cts ;		/* handshake lines */
	unsigned char m_ri ;
	unsigned char m_dtr ;
	unsigned char stopc;
	unsigned char startc;
	unsigned char stopca;
	unsigned char startca;
	unsigned char fepstopc;
	unsigned char fepstartc;
	unsigned char fepstopca;
	unsigned char fepstartca;
	unsigned char txwin;
	unsigned char rxwin;
	unsigned short fepiflag;
	unsigned short fepcflag;
	unsigned short fepoflag;
	unsigned short txbufhead;
	unsigned short txbufsize;
	unsigned short rxbufhead;
	unsigned short rxbufsize;
	int    close_delay;
	int    count;
	int    blocked_open;
	unsigned long  event;
	int    asyncflags;
	uint   dev;
	unsigned long  statusflags;
	unsigned long  c_iflag;
	unsigned long  c_cflag;
	unsigned long  c_lflag;
	unsigned long  c_oflag;
	unsigned char __iomem *txptr;
	unsigned char __iomem *rxptr;
	struct board_info           *board;
	struct board_chan	    __iomem *brdchan;
	struct digi_struct          digiext;
	struct tty_struct           *tty;
	wait_queue_head_t           open_wait;
	wait_queue_head_t           close_wait;
	struct work_struct          tqueue;
	struct global_data 	    __iomem *mailbox;
};

struct board_info	
{
	unsigned char status;
	unsigned char type;
	unsigned char altpin;
	unsigned short numports;
	unsigned long port;
	unsigned long membase;
	void __iomem *re_map_port;
	void __iomem *re_map_membase;
	unsigned long  memory_seg;
	void ( * memwinon )	(struct board_info *, unsigned int) ;
	void ( * memwinoff ) 	(struct board_info *, unsigned int) ;
	void ( * globalwinon )	(struct channel *) ;
	void ( * txwinon ) 	(struct channel *) ;
	void ( * rxwinon )	(struct channel *) ;
	void ( * memoff )	(struct channel *) ;
	void ( * assertgwinon )	(struct channel *) ;
	void ( * assertmemoff )	(struct channel *) ;
	unsigned char poller_inhibited ;
};