1
2
3
4
5
6
7
8
9
10
11
12
13
14 #define DATAPORT 0x0000
15 #define WRITE_PTR 0x0002
16 #define READ_PTR 0x0004
17 #define SIGNAL_CA 0x0006
18 #define SET_IRQ 0x0007
19 #define SM_PTR 0x0008
20 #define MEM_Ctrl 0x000b
21 #define MEM_Page_Ctrl 0x000c
22 #define Config 0x000d
23 #define EEPROM_Ctrl 0x000e
24 #define ID_PORT 0x000f
25
26
27
28
29
30
31 #define SM_ADDR(x) (0x4000+((x&0x10)<<10)+(x&0xf))
32
33
34 #define SCB_STATUS 0xc008
35 #define SCB_CMD 0xc00a
36 #define SCB_CBL 0xc00c
37 #define SCB_RFA 0xc00e
38
39
40
41
42
43
44
45
46 #define SIRQ_en 0x08
47 #define SIRQ_dis 0x00
48
49
50 #define set_loopback outb(inb(ioaddr+Config)|0x02,ioaddr+Config)
51 #define clear_loopback outb(inb(ioaddr+Config)&0xfd,ioaddr+Config)
52
53
54 #define EC_Clk 0x01
55 #define EC_CS 0x02
56 #define EC_Wr 0x04
57 #define EC_Rd 0x08
58 #define ASIC_RST 0x40
59 #define i586_RST 0x80
60
61 #define eeprom_delay() { int _i = 40; while (--_i>0) { __SLOW_DOWN_IO; }}
62
63
64
65
66
67
68 #define SCP_START 0xfff6
69
70
71
72 #define ISCP_START 0x0000
73
74 #define SCB_START 0x0008
75
76
77
78
79
80
81
82 #define TX_BUF_START 0x0100
83 #define TX_BUF_SIZE ((24+ETH_FRAME_LEN+31)&~0x1f)
84 #define RX_BUF_SIZE ((32+ETH_FRAME_LEN+31)&~0x1f)
85
86
87
88
89
90
91
92
93 #define SCB_complete(s) ((s&0x8000)!=0)
94 #define SCB_rxdframe(s) ((s&0x4000)!=0)
95 #define SCB_CUdead(s) ((s&0x2000)!=0)
96 #define SCB_RUdead(s) ((s&0x1000)!=0)
97 #define SCB_ack(s) (s & 0xf000)
98
99
100 #define SCB_CUstat(s) ((s&0x0300)>>8)
101
102
103 #define SCB_RUstat(s) ((s&0x0070)>>4)
104
105
106 #define SCB_CUnop 0x0000
107 #define SCB_CUstart 0x0100
108 #define SCB_CUresume 0x0200
109 #define SCB_CUsuspend 0x0300
110 #define SCB_CUabort 0x0400
111
112
113 #define SCB_resetchip 0x0080
114
115 #define SCB_RUnop 0x0000
116 #define SCB_RUstart 0x0010
117 #define SCB_RUresume 0x0020
118 #define SCB_RUsuspend 0x0030
119 #define SCB_RUabort 0x0040
120
121
122
123
124
125
126 #define Stat_Done(s) ((s&0x8000)!=0)
127 #define Stat_Busy(s) ((s&0x4000)!=0)
128 #define Stat_OK(s) ((s&0x2000)!=0)
129 #define Stat_Abort(s) ((s&0x1000)!=0)
130 #define Stat_STFail ((s&0x0800)!=0)
131 #define Stat_TNoCar(s) ((s&0x0400)!=0)
132 #define Stat_TNoCTS(s) ((s&0x0200)!=0)
133 #define Stat_TNoDMA(s) ((s&0x0100)!=0)
134 #define Stat_TDefer(s) ((s&0x0080)!=0)
135 #define Stat_TColl(s) ((s&0x0040)!=0)
136 #define Stat_TXColl(s) ((s&0x0020)!=0)
137 #define Stat_NoColl(s) (s&0x000f)
138
139
140
141
142
143
144
145 #define Cmd_END 0x8000
146 #define Cmd_SUS 0x4000
147 #define Cmd_INT 0x2000
148
149 #define Cmd_Nop 0x0000
150 #define Cmd_SetAddr 0x0001
151 #define Cmd_Config 0x0002
152 #define Cmd_MCast 0x0003
153 #define Cmd_Xmit 0x0004
154 #define Cmd_TDR 0x0005
155 #define Cmd_Dump 0x0006
156 #define Cmd_Diag 0x0007
157
158
159
160
161
162
163 #define FD_Done(s) ((s&0x8000)!=0)
164 #define FD_Busy(s) ((s&0x4000)!=0)
165 #define FD_OK(s) ((s&0x2000)!=0)
166
167 #define FD_CRC(s) ((s&0x0800)!=0)
168 #define FD_Align(s) ((s&0x0400)!=0)
169 #define FD_Resrc(s) ((s&0x0200)!=0)
170 #define FD_DMA(s) ((s&0x0100)!=0)
171 #define FD_Short(s) ((s&0x0080)!=0)
172 #define FD_NoEOF(s) ((s&0x0040)!=0)