From e80bb6f42a12b78f93e88b23d3b6d6ee702e2cdd Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Thu, 24 Jun 1982 04:11:17 -0800 Subject: [PATCH] add error codes, don't use strings anymore SCCS-vsn: sys/vax/if/if_ilreg.h 4.2 --- usr/src/sys/vax/if/if_ilreg.h | 94 ++++++++++++++++++++++++----------- 1 file changed, 64 insertions(+), 30 deletions(-) diff --git a/usr/src/sys/vax/if/if_ilreg.h b/usr/src/sys/vax/if/if_ilreg.h index d6c3f6d454..0037280bb4 100644 --- a/usr/src/sys/vax/if/if_ilreg.h +++ b/usr/src/sys/vax/if/if_ilreg.h @@ -1,4 +1,4 @@ -/* if_ilreg.h 4.1 82/05/21 */ +/* if_ilreg.h 4.2 82/06/23 */ /* * Interlan Ethernet Communications Controller interface @@ -12,7 +12,7 @@ struct ildevice { /* * Command and status bits */ -#define IL_EUA 0xC000 /* Extended Unibus Address */ +#define IL_EUA 0xc000 /* Extended Unibus Address */ #define IL_CMD 0x3f00 /* Command Function Code */ #define IL_CDONE 0x0080 /* Command Done */ #define IL_CIE 0x0040 /* Command Interrupt Enable */ @@ -20,10 +20,9 @@ struct ildevice { #define IL_RIE 0x0010 /* Receive Interrupt Enable */ #define IL_STATUS 0x000f /* Command Status Code */ -#define IL_BITS "\10\10CDONE\7CIE\6RDONE\5RIE" - -/* Command definitions */ +#define IL_BITS "\20\10CDONE\7CIE\6RDONE\5RIE" +/* command definitions */ #define ILC_MLPBAK 0x0100 /* Set Module Interface Loopback Mode */ #define ILC_ILPBAK 0x0200 /* Set Internal Loopback Mode */ #define ILC_CLPBAK 0x0300 /* Clear Loopback Mode */ @@ -45,32 +44,67 @@ struct ildevice { #define ILC_RESET 0x3f00 /* Reset */ /* - * Error codes + * Error codes found in the status bits of the csr. */ -char *ilerrs[] = { - "success", /* 0 */ - "success with retries", /* 01 */ - "illegal command", /* 02 */ - "inappropriate command", /* 03 */ - "failure", /* 04 */ - "buffer size exceeded", /* 05 */ - "frame too small", /* 06 */ - 0, /* 07 */ - "excessive collisions", /* 010 */ - 0, /* 011 */ - "buffer alignment error", /* 012 */ - 0, /* 013 */ - 0, /* 014 */ - 0, /* 015 */ - 0, /* 016 */ - "non-existent memory" /* 017 */ +#define ILERR_SUCCESS 0 /* command successful */ +#define ILERR_RETRIES 1 /* " " with retries */ +#define ILERR_BADCMD 2 /* illegal command */ +#define ILERR_INVCMD 3 /* invalid command */ +#define ILERR_RECVERR 4 /* receiver error */ +#define ILERR_BUFSIZ 5 /* buffer size too big */ +#define ILERR_FRAMESIZ 6 /* frame size too small */ +#define ILERR_COLLISIONS 8 /* excessive collisions */ +#define ILERR_BUFALIGNMENT 10 /* buffer not word aligned */ +#define ILERR_NXM 15 /* non-existent memory */ + +#define NILERRS 16 +#ifdef ILERRS +char *ilerrs[NILERRS] = { + "success", /* 0 */ + "success with retries", /* 1 */ + "illegal command", /* 2 */ + "inappropriate command", /* 3 */ + "failure", /* 4 */ + "buffer size exceeded", /* 5 */ + "frame too small", /* 6 */ + 0, /* 7 */ + "excessive collisions", /* 8 */ + 0, /* 9 */ + "buffer alignment error", /* 10 */ + 0, /* 11 */ + 0, /* 12 */ + 0, /* 13 */ + 0, /* 14 */ + "non-existent memory" /* 15 */ }; +#endif + +/* + * Diagnostics codes. + */ +#define ILDIAG_SUCCESS 0 /* no problems */ +#define ILDIAG_CHKSUMERR 1 /* ROM/RAM checksum error */ +#define ILDIAG_DMAERR 2 /* DMA not working */ +#define ILDIAG_XMITERR 3 /* xmit circuitry failure */ +#define ILDIAG_RECVERR 4 /* rcvr circuitry failure */ +#define ILDIAG_LOOPBACK 5 /* loopback test failed */ -char *ildiag[] = { - "success", /* 0 */ - "checksum error", /* 1 */ - "NM10 dma error", /* 2 */ - "transmitter error", /* 3 */ - "receiver error", /* 4 */ - "loopback failure", /* 5 */ +#define NILDIAGS 6 +#ifdef ILDIAGS +char *ildiag[NILDIAGS] = { + "success", /* 0 */ + "checksum error", /* 1 */ + "NM10 dma error", /* 2 */ + "transmitter error", /* 3 */ + "receiver error", /* 4 */ + "loopback failure", /* 5 */ }; +#endif + +/* + * Frame status bits, returned in frame status byte + * at the top of each received packet. + */ +#define ILFSTAT_C 0x1 /* CRC error */ +#define ILFSTAT_A 0x2 /* alignment error */ +#define ILFSTAT_L 0x4 /* 1+ frames lost just before */ -- 2.20.1