Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #define XEMPORTS 0xC02 |
| 2 | #define XEPORTS 0xC22 |
| 3 | |
| 4 | #define MAX_ALLOC 0x100 |
| 5 | |
| 6 | #define MAXBOARDS 12 |
| 7 | #define FEPCODESEG 0x0200L |
| 8 | #define FEPCODE 0x2000L |
| 9 | #define BIOSCODE 0xf800L |
| 10 | |
| 11 | #define MISCGLOBAL 0x0C00L |
| 12 | #define NPORT 0x0C22L |
| 13 | #define MBOX 0x0C40L |
| 14 | #define PORTBASE 0x0C90L |
| 15 | |
| 16 | /* Begin code defines used for epca_setup */ |
| 17 | |
| 18 | #define INVALID_BOARD_TYPE 0x1 |
| 19 | #define INVALID_NUM_PORTS 0x2 |
| 20 | #define INVALID_MEM_BASE 0x4 |
| 21 | #define INVALID_PORT_BASE 0x8 |
| 22 | #define INVALID_BOARD_STATUS 0x10 |
| 23 | #define INVALID_ALTPIN 0x20 |
| 24 | |
| 25 | /* End code defines used for epca_setup */ |
| 26 | |
| 27 | |
| 28 | #define FEPCLR 0x00 |
| 29 | #define FEPMEM 0x02 |
| 30 | #define FEPRST 0x04 |
| 31 | #define FEPINT 0x08 |
| 32 | #define FEPMASK 0x0e |
| 33 | #define FEPWIN 0x80 |
| 34 | |
| 35 | #define PCXE 0 |
| 36 | #define PCXEVE 1 |
| 37 | #define PCXEM 2 |
| 38 | #define EISAXEM 3 |
| 39 | #define PC64XE 4 |
| 40 | #define PCXI 5 |
| 41 | #define PCIXEM 7 |
| 42 | #define PCICX 8 |
| 43 | #define PCIXR 9 |
| 44 | #define PCIXRJ 10 |
| 45 | #define EPCA_NUM_TYPES 6 |
| 46 | |
| 47 | |
| 48 | static char *board_desc[] = |
| 49 | { |
| 50 | "PC/Xe", |
| 51 | "PC/Xeve", |
| 52 | "PC/Xem", |
| 53 | "EISA/Xem", |
| 54 | "PC/64Xe", |
| 55 | "PC/Xi", |
| 56 | "unknown", |
| 57 | "PCI/Xem", |
| 58 | "PCI/CX", |
| 59 | "PCI/Xr", |
| 60 | "PCI/Xrj", |
| 61 | }; |
| 62 | |
| 63 | #define STARTC 021 |
| 64 | #define STOPC 023 |
| 65 | #define IAIXON 0x2000 |
| 66 | |
| 67 | |
| 68 | #define TXSTOPPED 0x1 |
| 69 | #define LOWWAIT 0x2 |
| 70 | #define EMPTYWAIT 0x4 |
| 71 | #define RXSTOPPED 0x8 |
| 72 | #define TXBUSY 0x10 |
| 73 | |
| 74 | #define DISABLED 0 |
| 75 | #define ENABLED 1 |
| 76 | #define OFF 0 |
| 77 | #define ON 1 |
| 78 | |
| 79 | #define FEPTIMEOUT 200000 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 | #define SERIAL_TYPE_INFO 3 |
| 81 | #define EPCA_EVENT_HANGUP 1 |
| 82 | #define EPCA_MAGIC 0x5c6df104L |
| 83 | |
| 84 | struct channel |
| 85 | { |
| 86 | long magic; |
Alan Cox | f2cf8e2 | 2005-09-06 15:16:44 -0700 | [diff] [blame] | 87 | unsigned char boardnum; |
| 88 | unsigned char channelnum; |
| 89 | unsigned char omodem; /* FEP output modem status */ |
| 90 | unsigned char imodem; /* FEP input modem status */ |
| 91 | unsigned char modemfake; /* Modem values to be forced */ |
| 92 | unsigned char modem; /* Force values */ |
| 93 | unsigned char hflow; |
| 94 | unsigned char dsr; |
| 95 | unsigned char dcd; |
| 96 | unsigned char m_rts ; /* The bits used in whatever FEP */ |
| 97 | unsigned char m_dcd ; /* is indiginous to this board to */ |
| 98 | unsigned char m_dsr ; /* represent each of the physical */ |
| 99 | unsigned char m_cts ; /* handshake lines */ |
| 100 | unsigned char m_ri ; |
| 101 | unsigned char m_dtr ; |
| 102 | unsigned char stopc; |
| 103 | unsigned char startc; |
| 104 | unsigned char stopca; |
| 105 | unsigned char startca; |
| 106 | unsigned char fepstopc; |
| 107 | unsigned char fepstartc; |
| 108 | unsigned char fepstopca; |
| 109 | unsigned char fepstartca; |
| 110 | unsigned char txwin; |
| 111 | unsigned char rxwin; |
| 112 | unsigned short fepiflag; |
| 113 | unsigned short fepcflag; |
| 114 | unsigned short fepoflag; |
| 115 | unsigned short txbufhead; |
| 116 | unsigned short txbufsize; |
| 117 | unsigned short rxbufhead; |
| 118 | unsigned short rxbufsize; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 119 | int close_delay; |
| 120 | int count; |
| 121 | int blocked_open; |
Alan Cox | f2cf8e2 | 2005-09-06 15:16:44 -0700 | [diff] [blame] | 122 | unsigned long event; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 123 | int asyncflags; |
| 124 | uint dev; |
Alan Cox | f2cf8e2 | 2005-09-06 15:16:44 -0700 | [diff] [blame] | 125 | unsigned long statusflags; |
| 126 | unsigned long c_iflag; |
| 127 | unsigned long c_cflag; |
| 128 | unsigned long c_lflag; |
| 129 | unsigned long c_oflag; |
Al Viro | bc9a515 | 2005-09-15 22:53:28 +0100 | [diff] [blame] | 130 | unsigned char __iomem *txptr; |
| 131 | unsigned char __iomem *rxptr; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | struct board_info *board; |
Al Viro | bc9a515 | 2005-09-15 22:53:28 +0100 | [diff] [blame] | 133 | struct board_chan __iomem *brdchan; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 134 | struct digi_struct digiext; |
| 135 | struct tty_struct *tty; |
| 136 | wait_queue_head_t open_wait; |
| 137 | wait_queue_head_t close_wait; |
Alan Cox | f2cf8e2 | 2005-09-06 15:16:44 -0700 | [diff] [blame] | 138 | struct work_struct tqueue; |
Al Viro | bc9a515 | 2005-09-15 22:53:28 +0100 | [diff] [blame] | 139 | struct global_data __iomem *mailbox; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 140 | }; |
| 141 | |
| 142 | struct board_info |
| 143 | { |
Alan Cox | f2cf8e2 | 2005-09-06 15:16:44 -0700 | [diff] [blame] | 144 | unsigned char status; |
| 145 | unsigned char type; |
| 146 | unsigned char altpin; |
| 147 | unsigned short numports; |
| 148 | unsigned long port; |
| 149 | unsigned long membase; |
Al Viro | bc9a515 | 2005-09-15 22:53:28 +0100 | [diff] [blame] | 150 | void __iomem *re_map_port; |
| 151 | void __iomem *re_map_membase; |
Alan Cox | f2cf8e2 | 2005-09-06 15:16:44 -0700 | [diff] [blame] | 152 | unsigned long memory_seg; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 153 | void ( * memwinon ) (struct board_info *, unsigned int) ; |
| 154 | void ( * memwinoff ) (struct board_info *, unsigned int) ; |
| 155 | void ( * globalwinon ) (struct channel *) ; |
| 156 | void ( * txwinon ) (struct channel *) ; |
| 157 | void ( * rxwinon ) (struct channel *) ; |
| 158 | void ( * memoff ) (struct channel *) ; |
| 159 | void ( * assertgwinon ) (struct channel *) ; |
| 160 | void ( * assertmemoff ) (struct channel *) ; |
Alan Cox | f2cf8e2 | 2005-09-06 15:16:44 -0700 | [diff] [blame] | 161 | unsigned char poller_inhibited ; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 162 | }; |
| 163 | |