ioctl/open return errors, not u.u_error; remove ubarelses (it is
[unix-history] / usr / src / sys / vax / uba / tmreg.h
index 828eb1c..bf42c57 100644 (file)
@@ -1,9 +1,9 @@
-/*     tmreg.h 4.3     81/02/21        */
+/*     tmreg.h 4.6     82/02/03        */
 
 /*
  * TM11 controller registers
  */
 
 /*
  * TM11 controller registers
  */
-struct device {
+struct tmdevice {
        u_short tmer;           /* error register, per drive */
        u_short tmcs;           /* control-status register */
        short   tmbc;           /* byte/frame count */
        u_short tmer;           /* error register, per drive */
        u_short tmcs;           /* control-status register */
        short   tmbc;           /* byte/frame count */
@@ -27,6 +27,9 @@ struct device {
 #define        TM_WIRG         0000014         /* write with xtra interrecord gap */
 #define        TM_REW          0000016         /* rewind */
 #define        TM_SENSE        TM_IE           /* sense (internal to driver) */
 #define        TM_WIRG         0000014         /* write with xtra interrecord gap */
 #define        TM_REW          0000016         /* rewind */
 #define        TM_SENSE        TM_IE           /* sense (internal to driver) */
+
+#define        tmreverseop(cmd)                ((cmd)==TM_SREV || (cmd)==TM_REW)
+
 /* TM_SNS is a pseudo-op used to get tape status */
 #define        TM_IE           0000100         /* interrupt enable */
 #define        TM_CUR          0000200         /* control unit is ready */
 /* TM_SNS is a pseudo-op used to get tape status */
 #define        TM_IE           0000100         /* interrupt enable */
 #define        TM_CUR          0000200         /* control unit is ready */
@@ -35,21 +38,26 @@ struct device {
 #define        TM_ERR          0100000         /* drive error summary */
 
 /* bits in tmer */
 #define        TM_ERR          0100000         /* drive error summary */
 
 /* bits in tmer */
-#define        TM_TUR          0000001         /* tape unit ready */
-#define        TM_RWS          0000002         /* tape unit rewinding */
-#define        TM_WRL          0000004         /* tape unit write protected */
-#define        TM_SDWN         0000010         /* gap settling down */
-#define        TM_BOT          0000040         /* at beginning of tape */
-#define        TM_SELR         0000100         /* tape unit properly selected */
-#define        TM_NXM          0000200         /* non-existant memory */
-#define        TM_BTE          0000400         /* bad tape error */
-#define        TM_RLE          0001000         /* record length error */
-#define        TM_EOT          0002000         /* at end of tape */
-#define        TM_BGL          0004000         /* bus grant late */
-#define        TM_PAE          0010000         /* parity error */
-#define        TM_CRE          0020000         /* cyclic redundancy error */
-#define        TM_EOF          0040000         /* end of file */
-#define        TM_ILC          0100000         /* illegal command */
-
-#define        TM_HARD         (TM_ILC|TM_EOT)
-#define        TM_SOFT         (TM_CRE|TM_PAE|TM_BGL|TM_RLE|TM_BTE|TM_NXM)
+#define        TMER_ILC        0100000         /* illegal command */
+#define        TMER_EOF        0040000         /* end of file */
+#define        TMER_CRE        0020000         /* cyclic redundancy error */
+#define        TMER_PAE        0010000         /* parity error */
+#define        TMER_BGL        0004000         /* bus grant late */
+#define        TMER_EOT        0002000         /* at end of tape */
+#define        TMER_RLE        0001000         /* record length error */
+#define        TMER_BTE        0000400         /* bad tape error */
+#define        TMER_NXM        0000200         /* non-existant memory */
+#define        TMER_SELR       0000100         /* tape unit properly selected */
+#define        TMER_BOT        0000040         /* at beginning of tape */
+#define        TMER_CH7        0000020         /* 7 channel tape */
+#define        TMER_SDWN       0000010         /* gap settling down */
+#define        TMER_WRL        0000004         /* tape unit write protected */
+#define        TMER_RWS        0000002         /* tape unit rewinding */
+#define        TMER_TUR        0000001         /* tape unit ready */
+
+#define        TMER_BITS       \
+"\10\20ILC\17EOF\16CRE\15PAE\14BGL\13EOT\12RLE\11BTE\10NXM\
+\7SELR\6BOT\5CH7\4SDWN\3WRL\2RWS\1TUR"
+
+#define        TMER_HARD       (TMER_ILC|TMER_EOT)
+#define        TMER_SOFT       (TMER_CRE|TMER_PAE|TMER_BGL|TMER_RLE|TMER_BTE|TMER_NXM)