4 * Original authors: Arpad Bakay <bakay.arpad@synergon.hu>,
5 * Peter Bajan <bajan.peter@synergon.hu>,
6 * Previous maintainer: Tivadar Szemethy <tiv@itc.hu>
7 * Current maintainer: Gergely Madarasz <gorgo@itc.hu>
9 * Copyright (C) 1995-1999 ITConsult-Pro Co. <info@itc.hu>
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
18 #define LOCOMX_IO_EXTENT 8
19 #define COMX_IO_EXTENT 4
20 #define HICOMX_IO_EXTENT 16
22 #define COMX_MAX_TX_SIZE 1600
23 #define COMX_MAX_RX_SIZE 2048
25 #define COMX_JAIL_OFFSET 0xffff
26 #define COMX_JAIL_VALUE 0xfe
27 #define COMX_MEMORY_SIZE 65536
28 #define HICOMX_MEMORY_SIZE 16384
29 #define COMX_MEM_MIN 0xa0000
30 #define COMX_MEM_MAX 0xf0000
32 #define COMX_DEFAULT_IO 0x360
33 #define COMX_DEFAULT_IRQ 10
34 #define COMX_DEFAULT_MEMADDR 0xd0000
35 #define HICOMX_DEFAULT_IO 0x320
36 #define HICOMX_DEFAULT_IRQ 10
37 #define HICOMX_DEFAULT_MEMADDR 0xd0000
38 #define LOCOMX_DEFAULT_IO 0x368
39 #define LOCOMX_DEFAULT_IRQ 7
41 #define MAX_CHANNELNO 2
43 #define COMX_CHANNEL_OFFSET 0x2000
45 #define COMX_ENABLE_BOARD_IT 0x40
46 #define COMX_BOARD_RESET 0x20
47 #define COMX_ENABLE_BOARD_MEM 0x10
48 #define COMX_DISABLE_BOARD_MEM 0
49 #define COMX_DISABLE_ALL 0x00
51 #define HICOMX_DISABLE_ALL 0x00
52 #define HICOMX_ENABLE_BOARD_MEM 0x02
53 #define HICOMX_DISABLE_BOARD_MEM 0x0
54 #define HICOMX_BOARD_RESET 0x01
55 #define HICOMX_PRG_MEM 4
56 #define HICOMX_DATA_MEM 0
57 #define HICOMX_ID_BYTE 0x55
59 #define CMX_ID_BYTE 0x31
60 #define COMX_CLOCK_CONST 8000
62 #define LINKUP_READY 3
64 #define OFF_FW_L1_ID 0x01e /* ID bytes */
65 #define OFF_FW_L2_ID 0x1006
66 #define FW_L1_ID_1 0xab
67 #define FW_L1_ID_2_COMX 0xc0
68 #define FW_L1_ID_2_HICOMX 0xc1
69 #define FW_L2_ID_1 0xab
71 #define OFF_A_L2_CMD 0x130 /* command register for L2 */
72 #define OFF_A_L2_CMDPAR 0x131 /* command parameter byte */
73 #define OFF_A_L1_STATB 0x122 /* stat. block for L1 */
74 #define OFF_A_L1_ABOREC 0x122 /* receive ABORT counter */
75 #define OFF_A_L1_OVERRUN 0x123 /* receive overrun counter */
76 #define OFF_A_L1_CRCREC 0x124 /* CRC error counter */
77 #define OFF_A_L1_BUFFOVR 0x125 /* buffer overrun counter */
78 #define OFF_A_L1_PBUFOVR 0x126 /* priority buffer overrun counter */
79 #define OFF_A_L1_MODSTAT 0x127 /* current state of modem ctrl lines */
80 #define OFF_A_L1_STATE 0x127 /* end of stat. block for L1 */
81 #define OFF_A_L1_TXPC 0x128 /* Tx counter for the PC */
82 #define OFF_A_L1_TXZ80 0x129 /* Tx counter for the Z80 */
83 #define OFF_A_L1_RXPC 0x12a /* Rx counter for the PC */
84 #define OFF_A_L1_RXZ80 0x12b /* Rx counter for the Z80 */
85 #define OFF_A_L1_REPENA 0x12c /* IT rep disable */
86 #define OFF_A_L1_CHNR 0x12d /* L1 channel logical number */
87 #define OFF_A_L1_CLKINI 0x12e /* Timer Const */
88 #define OFF_A_L2_LINKUP 0x132 /* Linkup byte */
89 #define OFF_A_L2_DAV 0x134 /* Rx DAV */
90 #define OFF_A_L2_RxBUFP 0x136 /* Rx buff relative to membase */
91 #define OFF_A_L2_TxEMPTY 0x138 /* Tx Empty */
92 #define OFF_A_L2_TxBUFP 0x13a /* Tx Buf */
93 #define OFF_A_L2_NBUFFS 0x144 /* Number of buffers to fetch */
95 #define OFF_A_L2_SABMREC 0x164 /* LAPB no. of SABMs received */
96 #define OFF_A_L2_SABMSENT 0x165 /* LAPB no. of SABMs sent */
97 #define OFF_A_L2_REJREC 0x166 /* LAPB no. of REJs received */
98 #define OFF_A_L2_REJSENT 0x167 /* LAPB no. of REJs sent */
99 #define OFF_A_L2_FRMRREC 0x168 /* LAPB no. of FRMRs received */
100 #define OFF_A_L2_FRMRSENT 0x169 /* LAPB no. of FRMRs sent */
101 #define OFF_A_L2_PROTERR 0x16A /* LAPB no. of protocol errors rec'd */
102 #define OFF_A_L2_LONGREC 0x16B /* LAPB no. of long frames */
103 #define OFF_A_L2_INVNR 0x16C /* LAPB no. of invalid N(R)s rec'd */
104 #define OFF_A_L2_UNDEFFR 0x16D /* LAPB no. of invalid frames */
106 #define OFF_A_L2_T1 0x174 /* T1 timer */
107 #define OFF_A_L2_ADDR 0x176 /* DCE = 1, DTE = 3 */
109 #define COMX_CMD_INIT 1
110 #define COMX_CMD_EXIT 2
111 #define COMX_CMD_OPEN 16
112 #define COMX_CMD_CLOSE 17