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