0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #ifndef _SMC9194_H_
0026 #define _SMC9194_H_
0027
0028
0029
0030 typedef unsigned char byte;
0031 typedef unsigned short word;
0032 typedef unsigned long int dword;
0033
0034
0035
0036
0037 #define SMC_IO_EXTENT 16
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060 #define BANK_SELECT 14
0061
0062
0063
0064 #define TCR 0
0065 #define TCR_ENABLE 0x0001
0066 #define TCR_FDUPLX 0x0800
0067 #define TCR_STP_SQET 0x1000
0068 #define TCR_MON_CNS 0x0400
0069 #define TCR_PAD_ENABLE 0x0080
0070
0071 #define TCR_CLEAR 0
0072
0073
0074 #define TCR_NORMAL TCR_ENABLE
0075
0076
0077 #define EPH_STATUS 2
0078 #define ES_LINK_OK 0x4000
0079
0080 #define RCR 4
0081 #define RCR_SOFTRESET 0x8000
0082 #define RCR_STRIP_CRC 0x200
0083 #define RCR_ENABLE 0x100
0084 #define RCR_ALMUL 0x4
0085 #define RCR_PROMISC 0x2
0086
0087
0088 #define RCR_NORMAL (RCR_STRIP_CRC | RCR_ENABLE)
0089 #define RCR_CLEAR 0x0
0090
0091 #define COUNTER 6
0092 #define MIR 8
0093 #define MCR 10
0094
0095
0096
0097 #define CONFIG 0
0098 #define CFG_AUI_SELECT 0x100
0099 #define BASE 2
0100 #define ADDR0 4
0101 #define ADDR1 6
0102 #define ADDR2 8
0103 #define GENERAL 10
0104 #define CONTROL 12
0105 #define CTL_POWERDOWN 0x2000
0106 #define CTL_LE_ENABLE 0x80
0107 #define CTL_CR_ENABLE 0x40
0108 #define CTL_TE_ENABLE 0x0020
0109 #define CTL_AUTO_RELEASE 0x0800
0110 #define CTL_EPROM_ACCESS 0x0003
0111
0112
0113 #define MMU_CMD 0
0114 #define MC_BUSY 1
0115 #define MC_NOP 0
0116 #define MC_ALLOC 0x20
0117 #define MC_RESET 0x40
0118 #define MC_REMOVE 0x60
0119 #define MC_RELEASE 0x80
0120 #define MC_FREEPKT 0xA0
0121 #define MC_ENQUEUE 0xC0
0122
0123 #define PNR_ARR 2
0124 #define FIFO_PORTS 4
0125
0126 #define FP_RXEMPTY 0x8000
0127 #define FP_TXEMPTY 0x80
0128
0129 #define POINTER 6
0130 #define PTR_READ 0x2000
0131 #define PTR_RCV 0x8000
0132 #define PTR_AUTOINC 0x4000
0133 #define PTR_AUTO_INC 0x0040
0134
0135 #define DATA_1 8
0136 #define DATA_2 10
0137 #define INTERRUPT 12
0138
0139 #define INT_MASK 13
0140 #define IM_RCV_INT 0x1
0141 #define IM_TX_INT 0x2
0142 #define IM_TX_EMPTY_INT 0x4
0143 #define IM_ALLOC_INT 0x8
0144 #define IM_RX_OVRN_INT 0x10
0145 #define IM_EPH_INT 0x20
0146 #define IM_ERCV_INT 0x40
0147
0148
0149 #define MULTICAST1 0
0150 #define MULTICAST2 2
0151 #define MULTICAST3 4
0152 #define MULTICAST4 6
0153 #define MGMT 8
0154 #define REVISION 10
0155
0156
0157
0158 #define ERCV 12
0159
0160 #define CHIP_9190 3
0161 #define CHIP_9194 4
0162 #define CHIP_9195 5
0163 #define CHIP_91100 7
0164
0165 static const char * chip_ids[ 15 ] = {
0166 NULL, NULL, NULL,
0167 "SMC91C90/91C92",
0168 "SMC91C94",
0169 "SMC91C95",
0170 NULL,
0171 "SMC91C100",
0172 "SMC91C100FD",
0173 NULL, NULL, NULL,
0174 NULL, NULL, NULL};
0175
0176
0177
0178
0179 #define TS_SUCCESS 0x0001
0180 #define TS_LOSTCAR 0x0400
0181 #define TS_LATCOL 0x0200
0182 #define TS_16COL 0x0010
0183
0184
0185
0186
0187 #define RS_ALGNERR 0x8000
0188 #define RS_BADCRC 0x2000
0189 #define RS_ODDFRAME 0x1000
0190 #define RS_TOOLONG 0x0800
0191 #define RS_TOOSHORT 0x0400
0192 #define RS_MULTICAST 0x0001
0193 #define RS_ERRORS (RS_ALGNERR | RS_BADCRC | RS_TOOLONG | RS_TOOSHORT)
0194
0195 static const char * interfaces[ 2 ] = { "TP", "AUI" };
0196
0197
0198
0199
0200
0201
0202
0203
0204 #define SMC_SELECT_BANK(x) { outw( x, ioaddr + BANK_SELECT ); }
0205
0206
0207 #define SMC_DELAY() { inw( ioaddr + RCR );\
0208 inw( ioaddr + RCR );\
0209 inw( ioaddr + RCR ); }
0210
0211
0212 #define SMC_ENABLE_INT(x) {\
0213 unsigned char mask;\
0214 SMC_SELECT_BANK(2);\
0215 mask = inb( ioaddr + INT_MASK );\
0216 mask |= (x);\
0217 outb( mask, ioaddr + INT_MASK ); \
0218 }
0219
0220
0221
0222 #define SMC_DISABLE_INT(x) {\
0223 unsigned char mask;\
0224 SMC_SELECT_BANK(2);\
0225 mask = inb( ioaddr + INT_MASK );\
0226 mask &= ~(x);\
0227 outb( mask, ioaddr + INT_MASK ); \
0228 }
0229
0230
0231
0232
0233
0234
0235
0236
0237
0238 #define SMC_INTERRUPT_MASK (IM_EPH_INT | IM_RX_OVRN_INT | IM_RCV_INT)
0239
0240 #endif
0241