00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #define I82586_MEMZ (64 * 1024)
00027
00028 #define I82586_SCP_ADDR (I82586_MEMZ - sizeof(scp_t))
00029
00030 #define ADDR_LEN 6
00031 #define I82586NULL 0xFFFF
00032
00033 #define toff(t,p,f) (unsigned short)((void *)(&((t *)((void *)0 + (p)))->f) - (void *)0)
00034
00035
00036
00037
00038 typedef struct scp_t scp_t;
00039 struct scp_t
00040 {
00041 unsigned short scp_sysbus;
00042 #define SCP_SY_16BBUS (0x0 << 0)
00043 #define SCP_SY_8BBUS (0x1 << 0)
00044 unsigned short scp_junk[2];
00045 unsigned short scp_iscpl;
00046 unsigned short scp_iscph;
00047 };
00048
00049
00050
00051
00052 typedef struct iscp_t iscp_t;
00053 struct iscp_t
00054 {
00055 unsigned short iscp_busy;
00056
00057 unsigned short iscp_offset;
00058 unsigned short iscp_basel;
00059 unsigned short iscp_baseh;
00060 };
00061
00062
00063
00064
00065
00066
00067
00068
00069 typedef struct scb_t scb_t;
00070 struct scb_t
00071 {
00072 unsigned short scb_status;
00073 #define SCB_ST_INT (0xF << 12)
00074 #define SCB_ST_CX (0x1 << 15)
00075 #define SCB_ST_FR (0x1 << 14)
00076 #define SCB_ST_CNA (0x1 << 13)
00077 #define SCB_ST_RNR (0x1 << 12)
00078 #define SCB_ST_JUNK0 (0x1 << 11)
00079 #define SCB_ST_CUS (0x7 << 8)
00080 #define SCB_ST_CUS_IDLE (0 << 8)
00081 #define SCB_ST_CUS_SUSP (1 << 8)
00082 #define SCB_ST_CUS_ACTV (2 << 8)
00083 #define SCB_ST_JUNK1 (0x1 << 7)
00084 #define SCB_ST_RUS (0x7 << 4)
00085 #define SCB_ST_RUS_IDLE (0 << 4)
00086 #define SCB_ST_RUS_SUSP (1 << 4)
00087 #define SCB_ST_RUS_NRES (2 << 4)
00088 #define SCB_ST_RUS_RDY (4 << 4)
00089 unsigned short scb_command;
00090 #define SCB_CMD_ACK_CX (0x1 << 15)
00091 #define SCB_CMD_ACK_FR (0x1 << 14)
00092 #define SCB_CMD_ACK_CNA (0x1 << 13)
00093 #define SCB_CMD_ACK_RNR (0x1 << 12)
00094 #define SCB_CMD_JUNKX (0x1 << 11)
00095 #define SCB_CMD_CUC (0x7 << 8)
00096 #define SCB_CMD_CUC_NOP (0 << 8)
00097 #define SCB_CMD_CUC_GO (1 << 8)
00098 #define SCB_CMD_CUC_RES (2 << 8)
00099 #define SCB_CMD_CUC_SUS (3 << 8)
00100 #define SCB_CMD_CUC_ABT (4 << 8)
00101 #define SCB_CMD_RESET (0x1 << 7)
00102 #define SCB_CMD_RUC (0x7 << 4)
00103 #define SCB_CMD_RUC_NOP (0 << 4)
00104 #define SCB_CMD_RUC_GO (1 << 4)
00105 #define SCB_CMD_RUC_RES (2 << 4)
00106 #define SCB_CMD_RUC_SUS (3 << 4)
00107 #define SCB_CMD_RUC_ABT (4 << 4)
00108 unsigned short scb_cbl_offset;
00109
00110 unsigned short scb_rfa_offset;
00111
00112
00113 unsigned short scb_crcerrs;
00114
00115 unsigned short scb_alnerrs;
00116
00117 unsigned short scb_rscerrs;
00118 unsigned short scb_ovrnerrs;
00119 };
00120
00121 #define scboff(p,f) toff(scb_t, p, f)
00122
00123
00124
00125
00126 typedef enum acmd_e acmd_e;
00127 enum acmd_e
00128 {
00129 acmd_nop = 0,
00130 acmd_ia_setup = 1,
00131
00132 acmd_configure = 2,
00133 acmd_mc_setup = 3,
00134
00135 acmd_transmit = 4,
00136 acmd_tdr = 5,
00137
00138 acmd_dump = 6,
00139 acmd_diagnose = 7,
00140 };
00141
00142
00143
00144
00145 typedef struct ach_t ach_t;
00146 struct ach_t
00147 {
00148 unsigned short ac_status;
00149 #define AC_SFLD_C (0x1 << 15)
00150 #define AC_SFLD_B (0x1 << 14)
00151 #define AC_SFLD_OK (0x1 << 13)
00152 #define AC_SFLD_A (0x1 << 12)
00153 #define AC_SFLD_FAIL (0x1 << 11)
00154 #define AC_SFLD_S10 (0x1 << 10)
00155
00156 #define AC_SFLD_S9 (0x1 << 9)
00157
00158 #define AC_SFLD_S8 (0x1 << 8)
00159
00160 #define AC_SFLD_S7 (0x1 << 7)
00161
00162 #define AC_SFLD_S6 (0x1 << 6)
00163
00164 #define AC_SFLD_S5 (0x1 << 5)
00165
00166 #define AC_SFLD_MAXCOL (0xF << 0)
00167 unsigned short ac_command;
00168 #define AC_CFLD_EL (0x1 << 15)
00169 #define AC_CFLD_S (0x1 << 14)
00170 #define AC_CFLD_I (0x1 << 13)
00171 #define AC_CFLD_CMD (0x7 << 0)
00172 unsigned short ac_link;
00173 };
00174
00175 #define acoff(p,f) toff(ach_t, p, f)
00176
00177
00178
00179
00180 typedef struct ac_nop_t ac_nop_t;
00181 struct ac_nop_t
00182 {
00183 ach_t nop_h;
00184 };
00185
00186
00187
00188
00189 typedef struct ac_ias_t ac_ias_t;
00190 struct ac_ias_t
00191 {
00192 ach_t ias_h;
00193 unsigned char ias_addr[ADDR_LEN];
00194 };
00195
00196
00197
00198
00199 typedef struct ac_cfg_t ac_cfg_t;
00200 struct ac_cfg_t
00201 {
00202 ach_t cfg_h;
00203 unsigned char cfg_byte_cnt;
00204 #define AC_CFG_BYTE_CNT(v) (((v) & 0xF) << 0)
00205 unsigned char cfg_fifolim;
00206 #define AC_CFG_FIFOLIM(v) (((v) & 0xF) << 0)
00207 unsigned char cfg_byte8;
00208 #define AC_CFG_SAV_BF(v) (((v) & 0x1) << 7)
00209 #define AC_CFG_SRDY(v) (((v) & 0x1) << 6)
00210
00211 unsigned char cfg_byte9;
00212 #define AC_CFG_ELPBCK(v) (((v) & 0x1) << 7)
00213 #define AC_CFG_ILPBCK(v) (((v) & 0x1) << 6)
00214 #define AC_CFG_PRELEN(v) (((v) & 0x3) << 4)
00215 #define AC_CFG_PLEN_2 0
00216 #define AC_CFG_PLEN_4 1
00217 #define AC_CFG_PLEN_8 2
00218 #define AC_CFG_PLEN_16 3
00219 #define AC_CFG_ALOC(v) (((v) & 0x1) << 3)
00220
00221 #define AC_CFG_ADDRLEN(v) (((v) & 0x7) << 0)
00222 unsigned char cfg_byte10;
00223 #define AC_CFG_BOFMET(v) (((v) & 0x1) << 7)
00224
00225 #define AC_CFG_ACR(v) (((v) & 0x7) << 4)
00226 #define AC_CFG_LINPRIO(v) (((v) & 0x7) << 0)
00227 unsigned char cfg_ifs;
00228 unsigned char cfg_slotl;
00229 unsigned char cfg_byte13;
00230 #define AC_CFG_RETRYNUM(v) (((v) & 0xF) << 4)
00231 #define AC_CFG_SLTTMHI(v) (((v) & 0x7) << 0)
00232 unsigned char cfg_byte14;
00233 #define AC_CFG_FLGPAD(v) (((v) & 0x1) << 7)
00234 #define AC_CFG_BTSTF(v) (((v) & 0x1) << 6)
00235 #define AC_CFG_CRC16(v) (((v) & 0x1) << 5)
00236 #define AC_CFG_NCRC(v) (((v) & 0x1) << 4)
00237 #define AC_CFG_TNCRS(v) (((v) & 0x1) << 3)
00238 #define AC_CFG_MANCH(v) (((v) & 0x1) << 2)
00239 #define AC_CFG_BCDIS(v) (((v) & 0x1) << 1)
00240 #define AC_CFG_PRM(v) (((v) & 0x1) << 0)
00241 unsigned char cfg_byte15;
00242 #define AC_CFG_ICDS(v) (((v) & 0x1) << 7)
00243
00244 #define AC_CFG_CDTF(v) (((v) & 0x7) << 4)
00245
00246 #define AC_CFG_ICSS(v) (((v) & 0x1) << 3)
00247
00248 #define AC_CFG_CSTF(v) (((v) & 0x7) << 0)
00249
00250 unsigned short cfg_min_frm_len;
00251 #define AC_CFG_MNFRM(v) (((v) & 0xFF) << 0)
00252 };
00253
00254
00255
00256
00257 typedef struct ac_mcs_t ac_mcs_t;
00258 struct ac_mcs_t
00259 {
00260 ach_t mcs_h;
00261 unsigned short mcs_cnt;
00262 #if 0
00263 unsigned char mcs_data[ADDR_LEN];
00264 ...
00265 #endif
00266 };
00267
00268 #define I82586_MAX_MULTICAST_ADDRESSES 128
00269
00270
00271
00272
00273 typedef struct ac_tx_t ac_tx_t;
00274 struct ac_tx_t
00275 {
00276 ach_t tx_h;
00277 unsigned short tx_tbd_offset;
00278 #if 0
00279 Linux packets are passed down with the destination MAC address
00280 and length/type field already prepended to the data,
00281 so we do not need to insert it. Consistent with this
00282 we must also set the AC_CFG_ALOC(..) flag during the
00283 ac_cfg_t action command.
00284 unsigned char tx_addr[ADDR_LEN];
00285 unsigned short tx_length;
00286 #endif
00287 };
00288
00289
00290
00291
00292 typedef struct ac_tdr_t ac_tdr_t;
00293 struct ac_tdr_t
00294 {
00295 ach_t tdr_h;
00296 unsigned short tdr_result;
00297 #define AC_TDR_LNK_OK (0x1 << 15)
00298 #define AC_TDR_XCVR_PRB (0x1 << 14)
00299 #define AC_TDR_ET_OPN (0x1 << 13)
00300 #define AC_TDR_ET_SRT (0x1 << 12)
00301 #define AC_TDR_TIME (0x7FF << 0)
00302
00303
00304 };
00305
00306
00307
00308
00309 typedef struct ac_dmp_t ac_dmp_t;
00310 struct ac_dmp_t
00311 {
00312 ach_t dmp_h;
00313 unsigned short dmp_offset;
00314 };
00315
00316
00317
00318
00319 #define DUMPBYTES 170
00320
00321
00322
00323
00324 typedef struct ac_dgn_t ac_dgn_t;
00325 struct ac_dgn_t
00326 {
00327 ach_t dgn_h;
00328 };
00329
00330
00331
00332
00333 typedef struct tbd_t tbd_t;
00334 struct tbd_t
00335 {
00336 unsigned short tbd_status;
00337 #define TBD_STATUS_EOF (0x1 << 15)
00338
00339 #define TBD_STATUS_ACNT (0x3FFF << 0)
00340
00341 unsigned short tbd_next_bd_offset;
00342 unsigned short tbd_bufl;
00343 unsigned short tbd_bufh;
00344 };
00345
00346
00347
00348
00349 typedef struct rbd_t rbd_t;
00350 struct rbd_t
00351 {
00352 unsigned short rbd_status;
00353 #define RBD_STATUS_EOF (0x1 << 15)
00354
00355 #define RBD_STATUS_F (0x1 << 14)
00356 #define RBD_STATUS_ACNT (0x3FFF << 0)
00357
00358 unsigned short rbd_next_rbd_offset;
00359 unsigned short rbd_bufl;
00360 unsigned short rbd_bufh;
00361 unsigned short rbd_el_size;
00362 #define RBD_EL (0x1 << 15)
00363
00364 #define RBD_SIZE (0x3FFF << 0)
00365
00366 };
00367
00368 #define rbdoff(p,f) toff(rbd_t, p, f)
00369
00370
00371
00372
00373 typedef struct fd_t fd_t;
00374 struct fd_t
00375 {
00376 unsigned short fd_status;
00377 #define FD_STATUS_C (0x1 << 15)
00378 #define FD_STATUS_B (0x1 << 14)
00379 #define FD_STATUS_OK (0x1 << 13)
00380 #define FD_STATUS_S11 (0x1 << 11)
00381 #define FD_STATUS_S10 (0x1 << 10)
00382 #define FD_STATUS_S9 (0x1 << 9)
00383 #define FD_STATUS_S8 (0x1 << 8)
00384 #define FD_STATUS_S7 (0x1 << 7)
00385 #define FD_STATUS_S6 (0x1 << 6)
00386 unsigned short fd_command;
00387 #define FD_COMMAND_EL (0x1 << 15)
00388 #define FD_COMMAND_S (0x1 << 14)
00389 unsigned short fd_link_offset;
00390 unsigned short fd_rbd_offset;
00391
00392
00393 #if 0
00394 I think the rest is unused since we
00395 have set AC_CFG_ALOC(..). However, just
00396 in case, we leave the space.
00397 #endif
00398 unsigned char fd_dest[ADDR_LEN];
00399
00400 unsigned char fd_src[ADDR_LEN];
00401
00402 unsigned short fd_length;
00403
00404 };
00405
00406 #define fdoff(p,f) toff(fd_t, p, f)
00407
00408
00409
00410
00411
00412
00413