Permalink
Browse files

Update help messages for msglvl and mt commands.

Add early detection for write protect in write() and write_hetmark()
functions. Update 3590 sense responses.
  • Loading branch information...
1 parent 1bc2223 commit 8e511e8ed3d2c956f55063d1ac2c7a0dfe501e2e Paul Gorlinsky committed Mar 7, 2011
Showing with 301 additions and 173 deletions.
  1. +7 −2 cmdtab.h
  2. +13 −1 hettape.c
  3. +33 −4 hsccmd.c
  4. +2 −1 hstructs.h
  5. +6 −0 msgenu.h
  6. +108 −33 tapeccws.c
  7. +132 −132 tapedev.h
View
9 cmdtab.h
@@ -64,13 +64,17 @@ COMMAND("cmdsep", SYSALL, cmdsep_cmd,
COMMAND("msglevel", SYSALL, msglevel_cmd,
"Display/Set current Message Display output",
- "Format: msglevel [on|off|text|time|debug|nodebug|verbose|terse]\n"
+ "Format: msglevel [on|off|text|time|debug|nodebug|verbose|terse|{device}]\n"
" on Normal message display\n"
" off No messages are displayed\n"
" text Text portion only of message is display\n"
" time Timestamp is prefixed to message\n"
" debug Messages prefixed with source and linenumber\n"
" nodebug Turn off debug\n"
+ " tape Tape related messages\n"
+ " dasd DASD related messages\n"
+ " comm Communications related messages\n"
+ " ur Unit Record related messages\n"
" verbose Display messages during configuration file processing\n"
" terse Turn off verbose")
@@ -963,7 +967,8 @@ COMMAND("mt", SYSCMDALL, mt_cmd,
" bsf n backward space 'n' files (default = 1)\n"
" fsr n forward space 'n' records (default = 1)\n"
" bsr n backward space 'n' records (default = 1)\n"
- " wtm n write 'n' tapemarks (default = 1)\n")
+ " wtm n write 'n' tapemarks (default = 1)\n"
+ " dvol1 display VOL1 header\n" )
COMMAND("cd", SYSCMDALL|SYSNDIAG, cd_cmd,
"Change directory",
View
14 hettape.c
@@ -222,6 +222,12 @@ int write_het (DEVBLK *dev, BYTE *buf, U16 blklen,
int rc; /* Return code */
off_t cursize; /* Current size for size chk */
+ if ( dev->hetb->writeprotect )
+ {
+ build_senseX(TAPE_BSENSE_WRITEPROTECT,dev,unitstat,code);
+ return -1;
+ }
+
/* Check if we have already violated the size limit */
if(dev->tdparms.maxsize>0)
{
@@ -279,9 +285,15 @@ off_t cursize; /* Current size for size chk */
/* If successful, return value is zero. */
/* If error, return value is -1 and unitstat is set to CE+DE+UC */
/*-------------------------------------------------------------------*/
-int write_hetmark (DEVBLK *dev, BYTE *unitstat,BYTE code)
+int write_hetmark( DEVBLK *dev, BYTE *unitstat, BYTE code )
{
int rc; /* Return code */
+
+ if ( dev->hetb->writeprotect )
+ {
+ build_senseX(TAPE_BSENSE_WRITEPROTECT,dev,unitstat,code);
+ return -1;
+ }
/* Write the tape mark */
rc = het_tapemark (dev->hetb);
View
37 hsccmd.c
@@ -5823,7 +5823,8 @@ BYTE unitstat, code = 0;
( CMD(argv[2],fsr,3) ) ||
( CMD(argv[2],bsr,3) ) ||
( CMD(argv[2],asf,3) ) ||
- ( CMD(argv[2],wtm,3) )
+ ( CMD(argv[2],wtm,3) ) ||
+ ( CMD(argv[2],dvol1,4) )
)
)
{
@@ -5977,6 +5978,34 @@ BYTE unitstat, code = 0;
}
}
}
+ else if ( CMD(argv[2],dvol1,4) )
+ {
+ rc = dev->tmh->rewind( dev, &unitstat, code);
+ if ( rc == 0 )
+ {
+ char sLABEL[65535];
+
+ rc = dev->tmh->read( dev, sLABEL, &unitstat, code );
+
+ if ( rc == 80 )
+ {
+ for( count = 0; count < rc; count++ )
+ sLABEL[count] = guest_to_host(sLABEL[count]);
+ sLABEL[52] = '\0';
+ if ( strncmp( sLABEL, "VOL1", 4 ) )
+ {
+ WRMSG( HHC02805, "I", SSID_TO_LCSS(dev->ssid), dev->devnum, &sLABEL[4] );
+ }
+ else
+ WRMSG( HHC02805, "I", SSID_TO_LCSS(dev->ssid), dev->devnum, "missing" );
+ }
+ else
+ {
+ WRMSG( HHC02805, "I", SSID_TO_LCSS(dev->ssid), dev->devnum, "missing" );
+ }
+ }
+ rc = dev->tmh->rewind( dev, &unitstat, code);
+ }
else if ( CMD(argv[2],wtm,3) )
{
if ( dev->readonly || dev->tdparms.logical_readonly )
@@ -7230,7 +7259,7 @@ int msglevel_cmd(int argc, char *argv[], char *cmdline)
{
msglvl &= ~MLVL_TAPE;
}
- else if ( strabbrev("TAPE", check, 5) || strabbrev("+TAPE", check, 5) )
+ else if ( strabbrev("TAPE", check, 4) || strabbrev("+TAPE", check, 5) )
{
msglvl |= MLVL_TAPE;
}
@@ -7250,11 +7279,11 @@ int msglevel_cmd(int argc, char *argv[], char *cmdline)
{
msglvl |= MLVL_UR;
}
- else if ( strabbrev("NOCOMM", check, 7) || strabbrev("-COMM", check, 6) )
+ else if ( strabbrev("NOCOMM", check, 6) || strabbrev("-COMM", check, 5) )
{
msglvl &= ~MLVL_COMM;
}
- else if ( strabbrev("COMM", check, 5) || strabbrev("+COMM", check, 6) )
+ else if ( strabbrev("COMM", check, 4) || strabbrev("+COMM", check, 5) )
{
msglvl |= MLVL_COMM;
}
View
3 hstructs.h
@@ -1214,7 +1214,7 @@ struct DEVBLK { /* Device configuration block*/
for Read Subsystem Data */
HETB *hetb; /* HET control block */
- struct /* HET device parms */
+ struct /* TAPE device parms */
{
u_int compress:1; /* 1=Compression enabled */
u_int method:3; /* Compression method */
@@ -1225,6 +1225,7 @@ struct DEVBLK { /* Device configuration block*/
u_int deonirq:1; /* DE on IRQ on tape motion */
/* MVS 3.8j workaround */
u_int logical_readonly:1; /* Tape is forced READ ONLY */
+ u_int auto_create:1; /* Create Tape if needed */
U16 chksize; /* Chunk size */
off_t maxsize; /* Maximum allowed TAPE file
size */
View
6 msgenu.h
@@ -383,6 +383,9 @@ do { \
#define HHC00233 "%1d:%04X Tape file '%s', '%s' volume '%s': not loaded; rename failed"
#define HHC00234 "%1d:%04X Tape file '%s', '%s' volume '%s': not loaded; not enough space on volume"
#define HHC00235 "%1d:%04X Tape file '%s', type '%s': tape created"
+#define HHC00236 "%1d:%04X Tape SCRATCH LIST for %s tapes not found"
+#define HHC00237 "%1d:%04X Tape SCRATCH '%s', type '%s': tape volume '%s' being auto loaded"
+#define HHC00238 "%1d:%04X Tape file '%s', type '%s': tape not created"
// reserve 003xx for compressed dasd device related
#define HHC00300 "%1d:%04X CCKD file: error initializing shadow files"
@@ -1824,6 +1827,7 @@ do { \
#define HHC02802 "%1d:%04X Current file number %d"
#define HHC02803 "%1d:%04X Current block number %d"
#define HHC02804 "%1d:%04X File protect enabled"
+#define HHC02805 "%1d:%04X VOL1 = %s"
// reserve 04xxx for host os specific component messages
@@ -1981,6 +1985,8 @@ do { \
/* tapeccws tapedev */
#define HHC93480 "%1d:%04X TDSPSTAT[%02X] msg1[%-8s] msg2[%-8s] msg[%-8s] mnt[%s] unmnt[%s] TDSPFLAG[%02X]"
+/* tape general */
+#define HHC93590 "DBG: TAPE: %s"
/* ctc/lcs/ndis */
#define HHC90900 "DBG: CTC: %s device port %2.2X: %s"
View
141 tapeccws.c
@@ -3893,7 +3893,7 @@ int sns4mat = TAPE_SNS7_FMT_20_3480;
{
case TAPE_BSENSE_TAPEUNLOADED:
dev->sense[0] = TAPE_SNS0_INTVREQ;
- dev->sense[3] = TAPE_ERA_DRIVE_NOT_READY; /* ERA 43 = Int Req */
+ dev->sense[3] = TAPE_ERA_43_DRIVE_NOT_READY; /* ERA 43 = Int Req */
switch(ccwcode)
{
case 0x01: // write
@@ -3906,15 +3906,15 @@ int sns4mat = TAPE_SNS7_FMT_20_3480;
break;
case 0x04: // sense
*unitstat = CSW_CE | CSW_UC | CSW_DE;
- dev->sense[3] = TAPE_ERA_ENVIRONMENTAL_DATA_PRESENT;
+ dev->sense[3] = TAPE_ERA_2B_ENVIRONMENTAL_DATA_PRESENT;
break;
case 0x0f: // rewind unload
*unitstat = CSW_CE | CSW_UC | CSW_DE | CSW_CUE;
- dev->sense[3] = TAPE_ERA_ENVIRONMENTAL_DATA_PRESENT;
+ dev->sense[3] = TAPE_ERA_2B_ENVIRONMENTAL_DATA_PRESENT;
break;
default:
*unitstat = CSW_CE | CSW_UC | CSW_DE;
- dev->sense[3] = TAPE_ERA_ENVIRONMENTAL_DATA_PRESENT;
+ dev->sense[3] = TAPE_ERA_2B_ENVIRONMENTAL_DATA_PRESENT;
break;
} // end switch(ccwcode)
break;
@@ -3926,97 +3926,97 @@ int sns4mat = TAPE_SNS7_FMT_20_3480;
/* when they should be presented separatly */
*unitstat = CSW_CE|CSW_DE|CSW_UC;
dev->sense[0] = TAPE_SNS0_INTVREQ;
- dev->sense[3] = TAPE_ERA_ENVIRONMENTAL_DATA_PRESENT;
+ dev->sense[3] = TAPE_ERA_2B_ENVIRONMENTAL_DATA_PRESENT;
sns4mat = TAPE_SNS7_FMT_22_3480_EOV_STATS;
break;
case TAPE_BSENSE_TAPELOADFAIL:
*unitstat = CSW_CE|CSW_DE|CSW_UC;
dev->sense[0] = TAPE_SNS0_INTVREQ|TAPE_SNS0_DEFUNITCK;
- dev->sense[3] = TAPE_ERA_LOAD_FAILURE; /* ERA 33 = Load Failed */
+ dev->sense[3] = TAPE_ERA_33_LOAD_FAILURE; /* ERA 33 = Load Failed */
break;
case TAPE_BSENSE_READFAIL:
*unitstat = CSW_CE|CSW_DE|CSW_UC;
dev->sense[0] = TAPE_SNS0_DATACHK;
- dev->sense[3] = TAPE_ERA_READ_DATA_CHECK;
+ dev->sense[3] = TAPE_ERA_23_READ_DATA_CHECK;
break;
case TAPE_BSENSE_WRITEFAIL:
*unitstat = CSW_CE|CSW_DE|CSW_UC;
dev->sense[0] = TAPE_SNS0_DATACHK;
- dev->sense[3] = TAPE_ERA_WRITE_DATA_CHECK;
+ dev->sense[3] = TAPE_ERA_25_WRITE_DATA_CHECK;
break;
case TAPE_BSENSE_BADCOMMAND:
*unitstat = CSW_CE|CSW_DE|CSW_UC;
dev->sense[0] = TAPE_SNS0_CMDREJ;
- dev->sense[3] = TAPE_ERA_COMMAND_REJECT;
+ dev->sense[3] = TAPE_ERA_27_COMMAND_REJECT;
break;
case TAPE_BSENSE_INCOMPAT:
*unitstat = CSW_CE|CSW_DE|CSW_UC;
dev->sense[0] = TAPE_SNS0_CMDREJ;
- dev->sense[3] = TAPE_ERA_FUNCTION_INCOMPATIBLE;
+ dev->sense[3] = TAPE_ERA_29_FUNCTION_INCOMPATIBLE;
break;
case TAPE_BSENSE_WRITEPROTECT:
*unitstat = CSW_CE|CSW_DE|CSW_UC;
dev->sense[0] = TAPE_SNS0_CMDREJ;
- dev->sense[3] = TAPE_ERA_WRITE_PROTECTED;
+ dev->sense[3] = TAPE_ERA_30_WRITE_PROTECTED;
break;
case TAPE_BSENSE_EMPTYTAPE:
*unitstat = CSW_CE|CSW_DE|CSW_UC;
dev->sense[0] = TAPE_SNS0_DATACHK;
- dev->sense[3] = TAPE_ERA_TAPE_VOID;
+ dev->sense[3] = TAPE_ERA_31_TAPE_VOID;
break;
case TAPE_BSENSE_ENDOFTAPE:
*unitstat = CSW_CE|CSW_DE|CSW_UC;
dev->sense[0] = TAPE_SNS0_EQUIPCHK;
- dev->sense[3] = TAPE_ERA_PHYSICAL_END_OF_TAPE;
+ dev->sense[3] = TAPE_ERA_38_PHYSICAL_END_OF_TAPE;
break;
case TAPE_BSENSE_LOADPTERR:
*unitstat = CSW_CE|CSW_DE|CSW_UC;
dev->sense[0] = 0;
- dev->sense[3] = TAPE_ERA_BACKWARD_AT_BOT;
+ dev->sense[3] = TAPE_ERA_39_BACKWARD_AT_BOT;
break;
case TAPE_BSENSE_FENCED:
*unitstat = CSW_CE|CSW_DE|CSW_UC;
dev->sense[0] = TAPE_SNS0_EQUIPCHK|TAPE_SNS0_DEFUNITCK; /* Deffered UC */
- dev->sense[3] = TAPE_ERA_VOLUME_FENCED;
+ dev->sense[3] = TAPE_ERA_47_VOLUME_FENCED;
break;
case TAPE_BSENSE_BADALGORITHM:
*unitstat = CSW_CE|CSW_DE|CSW_UC;
dev->sense[0] = TAPE_SNS0_EQUIPCHK;
if (dev->devtype==0x3480)
{
- dev->sense[3] = TAPE_ERA_VOLUME_FENCED; // (volume fenced)
+ dev->sense[3] = TAPE_ERA_47_VOLUME_FENCED; // (volume fenced)
}
else // 3490, 3590, etc.
{
- dev->sense[3] = TAPE_ERA_COMPACT_ALGORITHM_INCOMPAT; // (bad compaction algorithm)
+ dev->sense[3] = TAPE_ERA_5E_COMPACT_ALGORITHM_INCOMPAT; // (bad compaction algorithm)
}
break;
case TAPE_BSENSE_LOCATEERR:
*unitstat = CSW_CE|CSW_DE|CSW_UC;
dev->sense[0] = TAPE_SNS0_EQUIPCHK;
- dev->sense[3] = TAPE_ERA_LOCATE_BLOCK_FAILED;
+ dev->sense[3] = TAPE_ERA_44_LOCATE_BLOCK_FAILED;
break;
case TAPE_BSENSE_BLOCKSHORT:
*unitstat = CSW_CE|CSW_DE|CSW_UC;
dev->sense[0] = TAPE_SNS0_EQUIPCHK;
- dev->sense[3] = TAPE_ERA_END_OF_DATA;
+ dev->sense[3] = TAPE_ERA_36_END_OF_DATA;
break;
case TAPE_BSENSE_ITFERROR:
*unitstat = CSW_CE|CSW_DE|CSW_UC;
dev->sense[0] = TAPE_SNS0_EQUIPCHK;
- dev->sense[3] = TAPE_ERA_PATH_EQUIPMENT_CHECK;
+ dev->sense[3] = TAPE_ERA_22_PATH_EQUIPMENT_CHECK;
break;
case TAPE_BSENSE_REWINDFAILED:
*unitstat = CSW_CE|CSW_DE|CSW_UC;
dev->sense[0] = TAPE_SNS0_EQUIPCHK;
- dev->sense[3] = TAPE_ERA_PERMANENT_EQUIPMENT_CHECK; /* Generic Equipment Malfunction ERP code */
+ dev->sense[3] = TAPE_ERA_2C_PERMANENT_EQUIPMENT_CHECK; /* Generic Equipment Malfunction ERP code */
break;
case TAPE_BSENSE_READTM:
*unitstat = CSW_CE|CSW_DE|CSW_UX;
break;
case TAPE_BSENSE_UNSOLICITED:
*unitstat = CSW_CE|CSW_DE;
- dev->sense[3] = TAPE_ERA_UNSOLICITED_SENSE;
+ dev->sense[3] = TAPE_ERA_00_UNSOLICITED_SENSE;
break;
case TAPE_BSENSE_STATUSONLY:
default:
@@ -4117,27 +4117,102 @@ void build_sense_3590 (int ERCode, DEVBLK *dev, BYTE *unitstat, BYTE ccwcode)
build_sense_3480_etal( ERCode, dev, unitstat, ccwcode );
+/* This information is from GA32-0127-03 sections 4.2 and 4.3
+ although it is a 3490E reference guide, the values are correct
+ for a 3590. For the 3480 and 3490 devices, these actions are
+ determined by the OS. For 3590, the device through sense byte
+ 2 (two) tells the OS what to do.
+*/
ERA = dev->sense[3];
- switch ( ERA )
+
+ switch ( ERA ) /* Set Software Recovery */
{
- case TAPE_ERA_LOAD_DISPLAY_CHECK:
- case TAPE_ERA_ENVIRONMENTAL_DATA_PRESENT:
- case TAPE_ERA_READ_BUFFERED_LOG:
- case TAPE_ERA_END_OF_VOLUME_PROCESSING:
- case TAPE_ERA_END_OF_VOLUME_COMPLETE:
+ case TAPE_ERA_00_UNSOLICITED_SENSE:
+ if ( unitstat[0] & CSW_UC )
+ {
+ dev->sense[2] |= TAPE_SNS2_NTP_BRAC_00_PERM_ERR;
+ dev->sense[2] |= TAPE_SNS2_NTP_LOG_CD2_PERM_OBR;
+ }
+ else
+ {
+ dev->sense[2] |= TAPE_SNS2_NTP_LOG_CD0_NO_LOG;
+ }
+ break;
+ /* Software Recovery - CONTINUE */
+ case TAPE_ERA_2B_ENVIRONMENTAL_DATA_PRESENT:
+ case TAPE_ERA_52_END_OF_VOLUME_COMPLETE:
dev->sense[2] |= TAPE_SNS2_NTP_BRAC_01_CONTINUE;
break;
- case TAPE_ERA_DATA_STREAMING_NOT_OPER:
- case TAPE_ERA_UNSOL_ENVIRONMENTAL_DATA:
- case TAPE_ERA_DEGRADED_MODE:
- case TAPE_ERA_RECOVERED_CHECKONE_FAILURE:
- case TAPE_ERA_CONTROLLING_COMP_RETRY_REQ:
+ /* Software Recovery - REISSUE */
+ case TAPE_ERA_21_DATA_STREAMING_NOT_OPER:
+ case TAPE_ERA_2A_UNSOL_ENVIRONMENTAL_DATA:
+ case TAPE_ERA_42_DEGRADED_MODE:
+ case TAPE_ERA_48_UNSOL_INFORMATIONAL_DATA:
+ case TAPE_ERA_4C_RECOVERED_CHECKONE_FAILURE:
+ case TAPE_ERA_50_BUFFERED_LOG_OVERFLOW:
+ case TAPE_ERA_51_BUFFERED_LOG_END_OF_VOLUME:
+ case TAPE_ERA_53_GLOBAL_COMMAND_INTERCEPT:
+ case TAPE_ERA_54_TEMP_CHNL_INTERFACE_ERROR:
+ case TAPE_ERA_57_GLOBAL_STATUS_INTERCEPT:
dev->sense[2] |= TAPE_SNS2_NTP_BRAC_10_REISSUE;
break;
+ /* Software Recovery - DEFER REISSUE */
+ case TAPE_ERA_33_LOAD_FAILURE:
+ case TAPE_ERA_34_UNLOAD_FAILURE:
+ case TAPE_ERA_3A_DRIVE_SWITCHED_NOT_READY:
+ case TAPE_ERA_43_DRIVE_NOT_READY:
+ dev->sense[2] |= TAPE_SNS2_NTP_BRAC_11_DEFER_REISS;
+ break;
default:
+ /* Software Recovery - NONE - PERMANENT */
dev->sense[2] |= TAPE_SNS2_NTP_BRAC_00_PERM_ERR;
break;
}
+
+ /* Check for OBR */
+ switch ( ERA )
+ {
+ case TAPE_ERA_00_UNSOLICITED_SENSE:
+ break;
+ case TAPE_ERA_24_LOAD_DISPLAY_CHECK:
+ case TAPE_ERA_26_READ_OPPOSITE:
+ case TAPE_ERA_27_COMMAND_REJECT:
+ case TAPE_ERA_29_FUNCTION_INCOMPATIBLE:
+ case TAPE_ERA_2A_UNSOL_ENVIRONMENTAL_DATA:
+ case TAPE_ERA_2B_ENVIRONMENTAL_DATA_PRESENT:
+ case TAPE_ERA_30_WRITE_PROTECTED:
+ case TAPE_ERA_38_PHYSICAL_END_OF_TAPE:
+ case TAPE_ERA_3A_DRIVE_SWITCHED_NOT_READY:
+ case TAPE_ERA_43_DRIVE_NOT_READY:
+ case TAPE_ERA_44_LOCATE_BLOCK_FAILED:
+ case TAPE_ERA_45_DRIVE_ASSIGNED_ELSEWHERE:
+ case TAPE_ERA_46_DRIVE_NOT_ONLINE:
+ case TAPE_ERA_4E_MAX_BLOCKSIZE_EXCEEDED:
+ case TAPE_ERA_50_BUFFERED_LOG_OVERFLOW:
+ case TAPE_ERA_51_BUFFERED_LOG_END_OF_VOLUME:
+ case TAPE_ERA_52_END_OF_VOLUME_COMPLETE:
+ case TAPE_ERA_53_GLOBAL_COMMAND_INTERCEPT:
+ case TAPE_ERA_57_GLOBAL_STATUS_INTERCEPT:
+ /* OBR - NO LOG */
+ dev->sense[2] |= TAPE_SNS2_NTP_LOG_CD0_NO_LOG;
+ break;
+ case TAPE_ERA_21_DATA_STREAMING_NOT_OPER:
+ case TAPE_ERA_33_LOAD_FAILURE:
+ case TAPE_ERA_34_UNLOAD_FAILURE:
+ case TAPE_ERA_48_UNSOL_INFORMATIONAL_DATA:
+ case TAPE_ERA_4D_RESETTING_EVENT:
+ case TAPE_ERA_54_TEMP_CHNL_INTERFACE_ERROR:
+ /* OBR - TEMP */
+ dev->sense[2] |= TAPE_SNS2_NTP_LOG_CD1_TEMP_OBR;
+ break;
+ default:
+ /* OBR - NONE - PERMANENT */
+ if ( ERA == TAPE_ERA_39_BACKWARD_AT_BOT && dev->blockid == 0 )
+ break;
+ dev->sense[2] |= TAPE_SNS2_NTP_LOG_CD2_PERM_OBR;
+ break;
+
+ }
}
/*-------------------------------------------------------------------*/
View
264 tapedev.h
@@ -608,133 +608,133 @@ extern int readhdr_omaheaders (DEVBLK *dev, OMATAPE_DESC *omadesc,
/* Error Recovery Action (ERA) SENSE BYTE 3 */
/*-------------------------------------------------------------------*/
-#define TAPE_ERA_UNSOLICITED_SENSE 0x00
-
-#define TAPE_ERA_DATA_STREAMING_NOT_OPER 0x21
-#define TAPE_ERA_PATH_EQUIPMENT_CHECK 0x22
-#define TAPE_ERA_READ_DATA_CHECK 0x23
-#define TAPE_ERA_LOAD_DISPLAY_CHECK 0x24
-#define TAPE_ERA_WRITE_DATA_CHECK 0x25
-#define TAPE_ERA_READ_OPPOSITE 0x26
-#define TAPE_ERA_COMMAND_REJECT 0x27
-#define TAPE_ERA_WRITE_ID_MARK_CHECK 0x28
-#define TAPE_ERA_FUNCTION_INCOMPATIBLE 0x29
-#define TAPE_ERA_UNSOL_ENVIRONMENTAL_DATA 0x2A
-#define TAPE_ERA_ENVIRONMENTAL_DATA_PRESENT 0x2B
-#define TAPE_ERA_PERMANENT_EQUIPMENT_CHECK 0x2C
-#define TAPE_ERA_DATA_SECURE_ERASE_FAILURE 0x2D
-#define TAPE_ERA_NOT_CAPABLE_BOT_ERROR 0x2E
-
-#define TAPE_ERA_WRITE_PROTECTED 0x30
-#define TAPE_ERA_TAPE_VOID 0x31
-#define TAPE_ERA_TENSION_LOST 0x32
-#define TAPE_ERA_LOAD_FAILURE 0x33
-#define TAPE_ERA_UNLOAD_FAILURE 0x34
-#define TAPE_ERA_MANUAL_UNLOAD 0x34
-#define TAPE_ERA_DRIVE_EQUIPMENT_CHECK 0x35
-#define TAPE_ERA_END_OF_DATA 0x36
-#define TAPE_ERA_TAPE_LENGTH_ERROR 0x37
-#define TAPE_ERA_PHYSICAL_END_OF_TAPE 0x38
-#define TAPE_ERA_BACKWARD_AT_BOT 0x39
-#define TAPE_ERA_DRIVE_SWITCHED_NOT_READY 0x3A
-#define TAPE_ERA_DRIVE_RESET_BY_OPERATOR 0x3A
-#define TAPE_ERA_MANUAL_REWIND_OR_UNLOAD 0x3B
-#define TAPE_ERA_VOLUME_REMOVE_BY_OPERATOR 0x3B
-#define TAPE_ERA_VOLUME_MANUALLY_UNLOADED 0x3C
-
-#define TAPE_ERA_OVERRUN 0x40
-#define TAPE_ERA_DEVICE_DEFERRED_ACCESS 0x40
-#define TAPE_ERA_RECORD_SEQUENCE_ERROR 0x41
-#define TAPE_ERA_BLOCK_ID_SEQUENCE_ERROR 0x41
-#define TAPE_ERA_DEGRADED_MODE 0x42
-#define TAPE_ERA_DRIVE_NOT_READY 0x43
-#define TAPE_ERA_INTERVENTION_REQ 0x43
-#define TAPE_ERA_LOCATE_BLOCK_FAILED 0x44
-#define TAPE_ERA_DRIVE_ASSIGNED_ELSEWHERE 0x45
-#define TAPE_ERA_DRIVE_NOT_ONLINE 0x46
-#define TAPE_ERA_VOLUME_FENCED 0x47
-#define TAPE_ERA_UNSOL_INFORMATIONAL_DATA 0x48
-#define TAPE_ERA_CONTROLLING_COMP_RETRY_REQ 0x48
-#define TAPE_ERA_BUS_OUT_CHECK 0x49
-#define TAPE_ERA_BUS_OUT_PARITY 0x49
-#define TAPE_ERA_CU_ERP_FAILURE 0x4A
-#define TAPE_ERA_CU_AND_DRIVE_INCOMPATIBLE 0x4B
-#define TAPE_ERA_RECOVERED_CHECKONE_FAILURE 0x4C
-#define TAPE_ERA_RESETTING_EVENT 0x4D
-#define TAPE_ERA_MAX_BLOCKSIZE_EXCEEDED 0x4E
-#define TAPE_ERA_DEVICE_CONTROLLER_INCOMP 0x4F
-
-#define TAPE_ERA_READ_BUFFERED_LOG 0x50
-#define TAPE_ERA_BUFFERED_LOG_OVERFLOW 0x50
-#define TAPE_ERA_BUFFERED_LOG_END_OF_VOLUME 0x51
-#define TAPE_ERA_END_OF_VOLUME_PROCESSING 0x51
-#define TAPE_ERA_END_OF_VOLUME_COMPLETE 0x52
-#define TAPE_ERA_GLOBAL_COMMAND_INTERCEPT 0x53
-#define TAPE_ERA_TEMP_CHNL_INTERFACE_ERROR 0x54
-#define TAPE_ERA_PERM_CHNL_INTERFACE_ERROR 0x55
-#define TAPE_ERA_CHNL_PROTOCOL_ERROR 0x56
-#define TAPE_ERA_GLOBAL_STATUS_INTERCEPT 0x57
-#define TAPE_ERA_ATTENTION_INTERCEPT 0x57
-#define TAPE_ERA_TAPE_LENGTH_INCOMPAT 0x5A
-#define TAPE_ERA_FORMAT_3480_XF_INCOMPAT 0x5B
-#define TAPE_ERA_FORMAT_3480_2_XF_INCOMPAT 0x5C
-#define TAPE_ERA_TAPE_LENGTH_VIOLATION 0x5D
-#define TAPE_ERA_COMPACT_ALGORITHM_INCOMPAT 0x5E
+#define TAPE_ERA_00_UNSOLICITED_SENSE 0x00
+
+#define TAPE_ERA_21_DATA_STREAMING_NOT_OPER 0x21
+#define TAPE_ERA_22_PATH_EQUIPMENT_CHECK 0x22
+#define TAPE_ERA_23_READ_DATA_CHECK 0x23
+#define TAPE_ERA_24_LOAD_DISPLAY_CHECK 0x24
+#define TAPE_ERA_25_WRITE_DATA_CHECK 0x25
+#define TAPE_ERA_26_READ_OPPOSITE 0x26
+#define TAPE_ERA_27_COMMAND_REJECT 0x27
+#define TAPE_ERA_28_WRITE_ID_MARK_CHECK 0x28
+#define TAPE_ERA_29_FUNCTION_INCOMPATIBLE 0x29
+#define TAPE_ERA_2A_UNSOL_ENVIRONMENTAL_DATA 0x2A
+#define TAPE_ERA_2B_ENVIRONMENTAL_DATA_PRESENT 0x2B
+#define TAPE_ERA_2C_PERMANENT_EQUIPMENT_CHECK 0x2C
+#define TAPE_ERA_2D_DATA_SECURE_ERASE_FAILURE 0x2D
+#define TAPE_ERA_2E_NOT_CAPABLE_BOT_ERROR 0x2E
+
+#define TAPE_ERA_30_WRITE_PROTECTED 0x30
+#define TAPE_ERA_31_TAPE_VOID 0x31
+#define TAPE_ERA_32_TENSION_LOST 0x32
+#define TAPE_ERA_33_LOAD_FAILURE 0x33
+#define TAPE_ERA_34_UNLOAD_FAILURE 0x34
+#define TAPE_ERA_34_MANUAL_UNLOAD 0x34
+#define TAPE_ERA_35_DRIVE_EQUIPMENT_CHECK 0x35
+#define TAPE_ERA_36_END_OF_DATA 0x36
+#define TAPE_ERA_37_TAPE_LENGTH_ERROR 0x37
+#define TAPE_ERA_38_PHYSICAL_END_OF_TAPE 0x38
+#define TAPE_ERA_39_BACKWARD_AT_BOT 0x39
+#define TAPE_ERA_3A_DRIVE_SWITCHED_NOT_READY 0x3A
+#define TAPE_ERA_3A_DRIVE_RESET_BY_OPERATOR 0x3A
+#define TAPE_ERA_3B_MANUAL_REWIND_OR_UNLOAD 0x3B
+#define TAPE_ERA_3B_VOLUME_REMOVE_BY_OPERATOR 0x3B
+#define TAPE_ERA_3C_VOLUME_MANUALLY_UNLOADED 0x3C
+
+#define TAPE_ERA_40_OVERRUN 0x40
+#define TAPE_ERA_40_DEVICE_DEFERRED_ACCESS 0x40
+#define TAPE_ERA_41_RECORD_SEQUENCE_ERROR 0x41
+#define TAPE_ERA_41_BLOCK_ID_SEQUENCE_ERROR 0x41
+#define TAPE_ERA_42_DEGRADED_MODE 0x42
+#define TAPE_ERA_43_DRIVE_NOT_READY 0x43
+#define TAPE_ERA_43_INTERVENTION_REQ 0x43
+#define TAPE_ERA_44_LOCATE_BLOCK_FAILED 0x44
+#define TAPE_ERA_45_DRIVE_ASSIGNED_ELSEWHERE 0x45
+#define TAPE_ERA_46_DRIVE_NOT_ONLINE 0x46
+#define TAPE_ERA_47_VOLUME_FENCED 0x47
+#define TAPE_ERA_48_UNSOL_INFORMATIONAL_DATA 0x48
+#define TAPE_ERA_48_CONTROLLING_COMP_RETRY_REQ 0x48
+#define TAPE_ERA_49_BUS_OUT_CHECK 0x49
+#define TAPE_ERA_49_BUS_OUT_PARITY 0x49
+#define TAPE_ERA_4A_CU_ERP_FAILURE 0x4A
+#define TAPE_ERA_4B_CU_AND_DRIVE_INCOMPATIBLE 0x4B
+#define TAPE_ERA_4C_RECOVERED_CHECKONE_FAILURE 0x4C
+#define TAPE_ERA_4D_RESETTING_EVENT 0x4D
+#define TAPE_ERA_4E_MAX_BLOCKSIZE_EXCEEDED 0x4E
+#define TAPE_ERA_4F_DEVICE_CONTROLLER_INCOMP 0x4F
+
+#define TAPE_ERA_50_READ_BUFFERED_LOG 0x50
+#define TAPE_ERA_50_BUFFERED_LOG_OVERFLOW 0x50
+#define TAPE_ERA_51_BUFFERED_LOG_END_OF_VOLUME 0x51
+#define TAPE_ERA_51_END_OF_VOLUME_PROCESSING 0x51
+#define TAPE_ERA_52_END_OF_VOLUME_COMPLETE 0x52
+#define TAPE_ERA_53_GLOBAL_COMMAND_INTERCEPT 0x53
+#define TAPE_ERA_54_TEMP_CHNL_INTERFACE_ERROR 0x54
+#define TAPE_ERA_55_PERM_CHNL_INTERFACE_ERROR 0x55
+#define TAPE_ERA_56_CHNL_PROTOCOL_ERROR 0x56
+#define TAPE_ERA_57_GLOBAL_STATUS_INTERCEPT 0x57
+#define TAPE_ERA_57_ATTENTION_INTERCEPT 0x57
+#define TAPE_ERA_5A_TAPE_LENGTH_INCOMPAT 0x5A
+#define TAPE_ERA_5B_FORMAT_3480_XF_INCOMPAT 0x5B
+#define TAPE_ERA_5C_FORMAT_3480_2_XF_INCOMPAT 0x5C
+#define TAPE_ERA_5D_TAPE_LENGTH_VIOLATION 0x5D
+#define TAPE_ERA_5E_COMPACT_ALGORITHM_INCOMPAT 0x5E
/*
|| 3490/3590/NTP IN AN AUTOMATED LIBRARY SYSTEM
*/
-#define TAPE_ERA_LIB_ATT_FAC_EQ_CHK 0x60
-#define TAPE_ERA_LIB_MGR_OFFLINE_TO_SUBSYS 0x62
-#define TAPE_ERA_LIB_MGR_CU_INCOMPAT 0x63
-#define TAPE_ERA_LIB_VOLSER_IN_USE 0x64
-#define TAPE_ERA_LIB_VOLUME_RESERVED 0x65
-#define TAPE_ERA_LIB_VOLSER_NOT_IN_LIB 0x66
-#define TAPE_ERA_LIB_CATEGORY_EMPTY 0x67
-#define TAPE_ERA_LIB_ORDER_SEQ_CHK 0x68
-#define TAPE_ERA_LIB_OUTPUT_STATIONS_FULL 0x69
-#define TAPE_ERA_LIB_VOLUME_MISPLACED 0x6B
-#define TAPE_ERA_LIB_MISPLACED_VOLUME_FOUND 0x6C
-#define TAPE_ERA_LIB_DRIVE_NOT_UNLOADED 0x6D
-#define TAPE_ERA_LIB_INACCESS_VOLUME_REST 0x6E
-#define TAPE_ERA_LIB_OPTICS_FAILURE 0x6F
-#define TAPE_ERA_LIB_MGR_EQ_CHK 0x70
-#define TAPE_ERA_LIB_EQ_CHK 0x71
-#define TAPE_ERA_LIB_NOT_CAP_MANUAL_MODE 0x72
-#define TAPE_ERA_LIB_INTERVENTION_REQ 0x73
-#define TAPE_ERA_LIB_INFORMATION_DATA 0x74
-#define TAPE_ERA_LIB_VOLSER_INACCESS 0x75
-#define TAPE_ERA_LIB_ALL_CELLS_FULL 0x76
-#define TAPE_ERA_LIB_DUP_VOLSER_EJECTED 0x77
-#define TAPE_ERA_LIB_DUP_VOLSER_LEFT_IN_STAT 0x78
-#define TAPE_ERA_LIB_UNREADABLE_INVLD_VOLSER 0x79
-#define TAPE_ERA_LIB_READ_STATISTICS 0x7A
-#define TAPE_ERA_LIB_VOLUME_MAN_EJECTED 0x7B
-#define TAPE_ERA_LIB_OUT_OF_CLEANER_VOLUMES 0x7C
-#define TAPE_ERA_LIB_VOLUME_EXPORTED 0x7D
-#define TAPE_ERA_LIB_CATEGORY_IN_USE 0x7F
-
-#define TAPE_ERA_LIB_UNEXPECTED_VOLUME_EJECT 0x80
-#define TAPE_ERA_LIB_IO_STATION_DOOR_OPEN 0x81
-#define TAPE_ERA_LIB_MGR_PROG_EXCEPTION 0x82
-#define TAPE_ERA_LIB_DRIVE_EXCEPTION 0x83
-#define TAPE_ERA_LIB_DRIVE_FAILURE 0x84
-#define TAPE_ERA_LIB_SMOKE_DETECTION_ALERT 0x85
-#define TAPE_ERA_LIB_ALL_CATEGORYS_RESERVED 0x86
-#define TAPE_ERA_LIB_DUP_VOLSER_ADDITION 0x87
-#define TAPE_ERA_LIB_DAMAGE_CART_EJECTED 0x88
-
-#define TAPE_ERA_LIB_VOLUME_INACCESSIBLE 0x91
+#define TAPE_ERA_60_LIB_ATT_FAC_EQ_CHK 0x60
+#define TAPE_ERA_62_LIB_MGR_OFFLINE_TO_SUBSYS 0x62
+#define TAPE_ERA_63_LIB_MGR_CU_INCOMPAT 0x63
+#define TAPE_ERA_64_LIB_VOLSER_IN_USE 0x64
+#define TAPE_ERA_65_LIB_VOLUME_RESERVED 0x65
+#define TAPE_ERA_66_LIB_VOLSER_NOT_IN_LIB 0x66
+#define TAPE_ERA_67_LIB_CATEGORY_EMPTY 0x67
+#define TAPE_ERA_68_LIB_ORDER_SEQ_CHK 0x68
+#define TAPE_ERA_69_LIB_OUTPUT_STATIONS_FULL 0x69
+#define TAPE_ERA_6B_LIB_VOLUME_MISPLACED 0x6B
+#define TAPE_ERA_6C_LIB_MISPLACED_VOLUME_FOUND 0x6C
+#define TAPE_ERA_6D_LIB_DRIVE_NOT_UNLOADED 0x6D
+#define TAPE_ERA_6E_LIB_INACCESS_VOLUME_REST 0x6E
+#define TAPE_ERA_6F_LIB_OPTICS_FAILURE 0x6F
+#define TAPE_ERA_70_LIB_MGR_EQ_CHK 0x70
+#define TAPE_ERA_71_LIB_EQ_CHK 0x71
+#define TAPE_ERA_72_LIB_NOT_CAP_MANUAL_MODE 0x72
+#define TAPE_ERA_73_LIB_INTERVENTION_REQ 0x73
+#define TAPE_ERA_74_LIB_INFORMATION_DATA 0x74
+#define TAPE_ERA_75_LIB_VOLSER_INACCESS 0x75
+#define TAPE_ERA_76_LIB_ALL_CELLS_FULL 0x76
+#define TAPE_ERA_77_LIB_DUP_VOLSER_EJECTED 0x77
+#define TAPE_ERA_78_LIB_DUP_VOLSER_LEFT_IN_STAT 0x78
+#define TAPE_ERA_79_LIB_UNREADABLE_INVLD_VOLSER 0x79
+#define TAPE_ERA_7A_LIB_READ_STATISTICS 0x7A
+#define TAPE_ERA_7B_LIB_VOLUME_MAN_EJECTED 0x7B
+#define TAPE_ERA_7C_LIB_OUT_OF_CLEANER_VOLUMES 0x7C
+#define TAPE_ERA_7D_LIB_VOLUME_EXPORTED 0x7D
+#define TAPE_ERA_7F_LIB_CATEGORY_IN_USE 0x7F
+
+#define TAPE_ERA_80_LIB_UNEXPECTED_VOLUME_EJECT 0x80
+#define TAPE_ERA_81_LIB_IO_STATION_DOOR_OPEN 0x81
+#define TAPE_ERA_82_LIB_MGR_PROG_EXCEPTION 0x82
+#define TAPE_ERA_83_LIB_DRIVE_EXCEPTION 0x83
+#define TAPE_ERA_84_LIB_DRIVE_FAILURE 0x84
+#define TAPE_ERA_85_LIB_SMOKE_DETECTION_ALERT 0x85
+#define TAPE_ERA_86_LIB_ALL_CATEGORYS_RESERVED 0x86
+#define TAPE_ERA_87_LIB_DUP_VOLSER_ADDITION 0x87
+#define TAPE_ERA_88_LIB_DAMAGE_CART_EJECTED 0x88
+
+#define TAPE_ERA_91_LIB_VOLUME_INACCESSIBLE 0x91
/*
|| SENSE BYTE 3 for NTP (3590) TAPES
*/
-#define TAPE_ERA_RAC_USE_BRAC 0xC0
-#define TAPE_ERA_RAC_FENCE_DEVICE 0xC1
-#define TAPE_ERA_RAC_FENCH_DEVICE_PATH 0xC2
-#define TAPE_ERA_RAC_LONG_BUSY 0xC6
-#define TAPE_ERA_RAC_READ_ALT 0xD2
+#define TAPE_ERA_C0_RAC_USE_BRAC 0xC0
+#define TAPE_ERA_C1_RAC_FENCE_DEVICE 0xC1
+#define TAPE_ERA_C2_RAC_FENCH_DEVICE_PATH 0xC2
+#define TAPE_ERA_C6_RAC_LONG_BUSY 0xC6
+#define TAPE_ERA_D2_RAC_READ_ALT 0xD2
// Sense byte 4
/*
@@ -765,26 +765,26 @@ extern int readhdr_omaheaders (DEVBLK *dev, OMATAPE_DESC *omadesc,
/*
|| SENSE BYTES 4-5 FOR NTP BYTE 4 is Reason Code(RC) and 5 is Reason Qualifer Code(RQC)
*/
-#define TAPE_SNS4_5_NTP_RC_UA_RQC_DEV_LOG 0x1110 // UNIT ATTENTION/Device Log
+#define TAPE_SNS4_5_NTP_RC_11_UA_RQC_11_DEV_LOG 0x1110 // UNIT ATTENTION/Device Log
-#define TAPE_SNS4_5_NTP_RC_LA_RQC_DEV_CLEANED 0x1211 // LIBRARY ATTENTION/Device CLEANED
-#define TAPE_SNS4_5_NTP_RC_LA_RQC_DEV_QUIESCED 0x1212 // LIBRARY ATTENTION/Device QUIESCE
-#define TAPE_SNS4_5_NTP_RC_LA_RQC_DEV_RESUMED 0x1213 // LIBRARY ATTENTION/Device RESUMED
+#define TAPE_SNS4_5_NTP_RC_12_LA_RQC_11_DEV_CLEANED 0x1211 // LIBRARY ATTENTION/Device CLEANED
+#define TAPE_SNS4_5_NTP_RC_12_LA_RQC_12_DEV_QUIESCED 0x1212 // LIBRARY ATTENTION/Device QUIESCE
+#define TAPE_SNS4_5_NTP_RC_12_LA_RQC_13_DEV_RESUMED 0x1213 // LIBRARY ATTENTION/Device RESUMED
-#define TAPE_SNS4_5_NTP_RC_CMD_REJ 0x2000 // COMMAND REJECT
+#define TAPE_SNS4_5_NTP_RC_20_CR_RQC_00 0x2000 // COMMAND REJECT
-#define TAPE_SNS4_5_NTP_RC_PE_RQC_GBL_CMD 0x2230 // PROTECTION EXCEPTION/Global Command
-#define TAPE_SNS4_5_NTP_RC_PE_RQC_GBL_STATUS 0x2231 // PROTECTION EXCEPTION/Global Status
+#define TAPE_SNS4_5_NTP_RC_22_PE_RQC_30_GBL_CMD 0x2230 // PROTECTION EXCEPTION/Global Command
+#define TAPE_SNS4_5_NTP_RC_22_PE_RQC_31_GBL_STATUS 0x2231 // PROTECTION EXCEPTION/Global Status
-#define TAPE_SNS4_5_NTP_RC_BE_RQC_EOV 0x3012 // BOUNDARY EXCEPTION/End of Volume
+#define TAPE_SNS4_5_NTP_RC_30_BE_RQC_12_EOV 0x3012 // BOUNDARY EXCEPTION/End of Volume
-#define TAPE_SNS4_5_NTP_RC_DC_RQC_NO_FMT_BOV 0x5050 // DATA CHECK/No Formatting at BOV
-#define TAPE_SNS4_5_NTP_RC_DC_RQC_NO_FMT 0x5051 // DATA CHECK/No Formatting Past BOV
+#define TAPE_SNS4_5_NTP_RC_50_DC_RQC_50_NO_FMT_BOV 0x5050 // DATA CHECK/No Formatting at BOV
+#define TAPE_SNS4_5_NTP_RC_50_DC_RQC_50_NO_FMT 0x5051 // DATA CHECK/No Formatting Past BOV
-#define TAPE_SNS4_5_NTP_RC_OE_RQC_MED_NOT_LD 0x4010 // OPERATIONAL EXCEPTION/Medium Not Loaded
-#define TAPE_SNS4_5_NTP_RC_OE_RQC_DRV_NOT_RDY 0x4011 // OPERATIONAL EXCEPTION/Drive Not Ready
-#define TAPE_SNS4_5_NTP_RC_OE_RQC_DEV_LONG_BSY 0x4012 // OPERATIONAL EXCEPTION/Device long busy
-#define TAPE_SNS4_5_NTP_RC_OE_RQC_LDR_IR 0x4020 // OPERATIONAL EXCEPTION/Loader Interv Req'd
+#define TAPE_SNS4_5_NTP_RC_40_OE_RQC_10_MED_NOT_LD 0x4010 // OPERATIONAL EXCEPTION/Medium Not Loaded
+#define TAPE_SNS4_5_NTP_RC_40_OE_RQC_11_DRV_NOT_RDY 0x4011 // OPERATIONAL EXCEPTION/Drive Not Ready
+#define TAPE_SNS4_5_NTP_RC_40_OE_RQC_12_DEV_LONG_BSY 0x4012 // OPERATIONAL EXCEPTION/Device long busy
+#define TAPE_SNS4_5_NTP_RC_40_OE_RQC_20_LDR_IR 0x4020 // OPERATIONAL EXCEPTION/Loader Interv Req'd
// Sense byte 7
/*

0 comments on commit 8e511e8

Please sign in to comment.