1*9180Ssam /* if_ilreg.h 4.3 82/11/13 */ 26895Sfeldman 36895Sfeldman /* 46895Sfeldman * Interlan Ethernet Communications Controller interface 56895Sfeldman */ 66895Sfeldman struct ildevice { 76895Sfeldman short il_csr; /* Command and Status Register */ 86895Sfeldman short il_bar; /* Buffer Address Register */ 96895Sfeldman short il_bcr; /* Byte Count Register */ 106895Sfeldman }; 116895Sfeldman 126895Sfeldman /* 136895Sfeldman * Command and status bits 146895Sfeldman */ 157265Ssam #define IL_EUA 0xc000 /* Extended Unibus Address */ 166895Sfeldman #define IL_CMD 0x3f00 /* Command Function Code */ 176895Sfeldman #define IL_CDONE 0x0080 /* Command Done */ 186895Sfeldman #define IL_CIE 0x0040 /* Command Interrupt Enable */ 196895Sfeldman #define IL_RDONE 0x0020 /* Receive DMA Done */ 206895Sfeldman #define IL_RIE 0x0010 /* Receive Interrupt Enable */ 216895Sfeldman #define IL_STATUS 0x000f /* Command Status Code */ 226895Sfeldman 237265Ssam #define IL_BITS "\20\10CDONE\7CIE\6RDONE\5RIE" 246895Sfeldman 257265Ssam /* command definitions */ 266895Sfeldman #define ILC_MLPBAK 0x0100 /* Set Module Interface Loopback Mode */ 276895Sfeldman #define ILC_ILPBAK 0x0200 /* Set Internal Loopback Mode */ 286895Sfeldman #define ILC_CLPBAK 0x0300 /* Clear Loopback Mode */ 296895Sfeldman #define ILC_PRMSC 0x0400 /* Set Promiscuous Receive Mode */ 306895Sfeldman #define ILC_CLPRMSC 0x0500 /* Clear Promiscuous Receive Mode */ 316895Sfeldman #define ILC_RCVERR 0x0600 /* Set Receive-On-Error Bit */ 326895Sfeldman #define ILC_CRCVERR 0x0700 /* Clear Receive-On-Error Bit */ 336895Sfeldman #define ILC_OFFLINE 0x0800 /* Go Offline */ 346895Sfeldman #define ILC_ONLINE 0x0900 /* Go Online */ 356895Sfeldman #define ILC_DIAG 0x0a00 /* Run On-board Diagnostics */ 36*9180Ssam #define ILC_ISA 0x0d00 /* Set Insert Source Address Mode */ 37*9180Ssam #define ILC_CISA 0x0e00 /* Clear Insert Source Address Mode */ 38*9180Ssam #define ILC_DEFPA 0x0f00 /* Set Physical Address to Default */ 39*9180Ssam #define ILC_ALLMC 0x1000 /* Set Receive All Multicast Packets */ 40*9180Ssam #define ILC_CALLMC 0x1100 /* Clear Receive All Multicast */ 416895Sfeldman #define ILC_STAT 0x1800 /* Report and Reset Statistics */ 426895Sfeldman #define ILC_DELAYS 0x1900 /* Report Collision Delay Times */ 436895Sfeldman #define ILC_RCV 0x2000 /* Supply Receive Buffer */ 446895Sfeldman #define ILC_LDXMIT 0x2800 /* Load Transmit Data */ 456895Sfeldman #define ILC_XMIT 0x2900 /* Load Transmit Data and Send */ 466895Sfeldman #define ILC_LDGRPS 0x2a00 /* Load Group Addresses */ 476895Sfeldman #define ILC_RMGRPS 0x2b00 /* Delete Group Addresses */ 48*9180Ssam #define ILC_LDPA 0x2c00 /* Load Physical Address */ 496895Sfeldman #define ILC_FLUSH 0x3000 /* Flush Receive BAR/BCR Queue */ 506895Sfeldman #define ILC_RESET 0x3f00 /* Reset */ 516895Sfeldman 526895Sfeldman /* 537265Ssam * Error codes found in the status bits of the csr. 546895Sfeldman */ 557265Ssam #define ILERR_SUCCESS 0 /* command successful */ 567265Ssam #define ILERR_RETRIES 1 /* " " with retries */ 577265Ssam #define ILERR_BADCMD 2 /* illegal command */ 587265Ssam #define ILERR_INVCMD 3 /* invalid command */ 597265Ssam #define ILERR_RECVERR 4 /* receiver error */ 607265Ssam #define ILERR_BUFSIZ 5 /* buffer size too big */ 617265Ssam #define ILERR_FRAMESIZ 6 /* frame size too small */ 627265Ssam #define ILERR_COLLISIONS 8 /* excessive collisions */ 637265Ssam #define ILERR_BUFALIGNMENT 10 /* buffer not word aligned */ 647265Ssam #define ILERR_NXM 15 /* non-existent memory */ 657265Ssam 667265Ssam #define NILERRS 16 677265Ssam #ifdef ILERRS 687265Ssam char *ilerrs[NILERRS] = { 697265Ssam "success", /* 0 */ 707265Ssam "success with retries", /* 1 */ 717265Ssam "illegal command", /* 2 */ 727265Ssam "inappropriate command", /* 3 */ 737265Ssam "failure", /* 4 */ 747265Ssam "buffer size exceeded", /* 5 */ 757265Ssam "frame too small", /* 6 */ 767265Ssam 0, /* 7 */ 777265Ssam "excessive collisions", /* 8 */ 787265Ssam 0, /* 9 */ 797265Ssam "buffer alignment error", /* 10 */ 807265Ssam 0, /* 11 */ 817265Ssam 0, /* 12 */ 827265Ssam 0, /* 13 */ 837265Ssam 0, /* 14 */ 847265Ssam "non-existent memory" /* 15 */ 856895Sfeldman }; 867265Ssam #endif 876895Sfeldman 887265Ssam /* 897265Ssam * Diagnostics codes. 907265Ssam */ 917265Ssam #define ILDIAG_SUCCESS 0 /* no problems */ 927265Ssam #define ILDIAG_CHKSUMERR 1 /* ROM/RAM checksum error */ 937265Ssam #define ILDIAG_DMAERR 2 /* DMA not working */ 947265Ssam #define ILDIAG_XMITERR 3 /* xmit circuitry failure */ 957265Ssam #define ILDIAG_RECVERR 4 /* rcvr circuitry failure */ 967265Ssam #define ILDIAG_LOOPBACK 5 /* loopback test failed */ 977265Ssam 987265Ssam #define NILDIAGS 6 997265Ssam #ifdef ILDIAGS 1007265Ssam char *ildiag[NILDIAGS] = { 1017265Ssam "success", /* 0 */ 1027265Ssam "checksum error", /* 1 */ 1037265Ssam "NM10 dma error", /* 2 */ 1047265Ssam "transmitter error", /* 3 */ 1057265Ssam "receiver error", /* 4 */ 1067265Ssam "loopback failure", /* 5 */ 1076895Sfeldman }; 1087265Ssam #endif 1097265Ssam 1107265Ssam /* 1117265Ssam * Frame status bits, returned in frame status byte 1127265Ssam * at the top of each received packet. 1137265Ssam */ 1147265Ssam #define ILFSTAT_C 0x1 /* CRC error */ 1157265Ssam #define ILFSTAT_A 0x2 /* alignment error */ 1167265Ssam #define ILFSTAT_L 0x4 /* 1+ frames lost just before */ 117