| 1 | /* rxreg.h 4.7 83/05/07 */ |
| 2 | |
| 3 | #include <sys/ioctl.h> |
| 4 | /* |
| 5 | * RX02 registers |
| 6 | */ |
| 7 | struct rxdevice { |
| 8 | short rxcs; /* control/status register */ |
| 9 | short rxdb; /* data buffer register */ |
| 10 | }; |
| 11 | |
| 12 | /* |
| 13 | * RX211 Command and Status Register (RX2CS) |
| 14 | */ |
| 15 | #define RX_DRV0 0x0000 /* select drive 0 */ |
| 16 | #define RX_DRV1 0x0010 /* select drive 1 */ |
| 17 | #define RX_DONE 0x0020 /* function complete */ |
| 18 | #define RX_INTR 0x0040 /* interrupt enable */ |
| 19 | #define RX_TREQ 0x0080 /* transfer request (data only) */ |
| 20 | #define RX_SDEN 0x0000 /* single density */ |
| 21 | #define RX_DDEN 0x0100 /* double density */ |
| 22 | #define RX_EXT 0x3000 /* extended address bits */ |
| 23 | #define RX_INIT 0x4000 /* initialize RX211 interface */ |
| 24 | #define RX_ERR 0x8000 /* general error bit */ |
| 25 | |
| 26 | /* |
| 27 | * RX211 control function bits (0-3 of RX2CS) |
| 28 | */ |
| 29 | #define RX_FILL 0x0001 /* fill the buffer */ |
| 30 | #define RX_EMPTY 0x0003 /* empty the buffer */ |
| 31 | #define RX_WRITE 0x0005 /* write the buffer to disk */ |
| 32 | #define RX_READ 0x0007 /* read a disk sector to the buffer */ |
| 33 | #define RX_FORMAT 0x0009 /* set the media density (format) */ |
| 34 | #define RX_RDSTAT 0x000b /* read the disk status */ |
| 35 | #define RX_WDDS 0x000d /* write a deleted-data sector */ |
| 36 | #define RX_RDERR 0x000f /* read the error registers */ |
| 37 | |
| 38 | #define RXCS_BITS \ |
| 39 | "\20\20RX_ERR\17RX_INIT\11RX_DDEN\10RX_TREQ\7RX_IE\6RX_DONE\5RX_DRV1" |
| 40 | |
| 41 | /* |
| 42 | * RX211 Error and Status Register (RX2ES) -- |
| 43 | * information is located in RX2DB after completion of function. |
| 44 | * The READY bit's value is available only after a "read status". |
| 45 | */ |
| 46 | #define RXES_CRCERR 0x0001 /* CRC error (data read error) */ |
| 47 | #define RXES_IDONE 0x0004 /* reinitialization complete */ |
| 48 | #define RXES_DENERR 0x0010 /* density error */ |
| 49 | #define RXES_DBLDEN 0x0020 /* set if double density */ |
| 50 | #define RXES_DDMARK 0x0040 /* deleted-data mark */ |
| 51 | #define RXES_READY 0x0080 /* drive is ready */ |
| 52 | |
| 53 | #define RXES_BITS \ |
| 54 | "\20\14RXES_NXM\13RXES_WCOF\11RXES_DRV1\10RXES_RDY\7RXES_DDMK\6RXES_DDEN\5\ |
| 55 | RXES_DNER\4RXES_ACLO\3RXES_ID\1RXES_CRC" |
| 56 | |
| 57 | /* |
| 58 | * Ioctl commands, move to dkio.h later |
| 59 | */ |
| 60 | #define RXIOC_FORMAT _IOW(d, 1, int) /* format the disk */ |
| 61 | #define RXIOC_WDDS _IOW(d, 2, int) /* write `deleted data' mark */ |
| 62 | /* on next sector */ |
| 63 | #define RXIOC_RDDSMK _IOR(d, 3, int) /* did last read sector contain */ |
| 64 | /* `deleted data'?*/ |
| 65 | #define RXIOC_GDENS _IOR(d, 4, int) /* return density of current disk */ |
| 66 | |
| 67 | #ifdef RXDEFERR |
| 68 | /* |
| 69 | * Table of values for definitive error code (rxxt[0] & 0xff) |
| 70 | */ |
| 71 | struct rxdeferr { |
| 72 | short errval; |
| 73 | char *errmsg; |
| 74 | } rxdeferr[] = { |
| 75 | { 0010, "Can't find home on drive 0" }, |
| 76 | { 0020, "Can't find home on drive 1" }, |
| 77 | { 0040, "Bad track number requested" }, |
| 78 | { 0050, "Home found too soon" }, |
| 79 | { 0070, "Can't find desired sector" }, |
| 80 | { 0110, "No SEP clock seen" }, |
| 81 | { 0120, "No preamble found" }, |
| 82 | { 0130, "Preamble, but no ID mark" }, |
| 83 | { 0140, "Header CRC error"}, |
| 84 | { 0150, "Track addr wrong in header" }, |
| 85 | { 0160, "Too many tries for ID AM" }, |
| 86 | { 0170, "No data AM found" }, |
| 87 | { 0200, "Data CRC error" }, |
| 88 | { 0220, "Maintenance test failure" }, |
| 89 | { 0230, "Word count overflow" }, |
| 90 | { 0240, "Density error" }, |
| 91 | { 0250, "Set-density protocol bad" }, |
| 92 | { 0, "Undefined error code" } |
| 93 | }; |
| 94 | #endif |