mirror of
https://github.com/moibenko/mtx.git
synced 2026-01-03 19:03:58 +00:00
Add files via upload
This commit is contained in:
committed by
GitHub
parent
9b1e508466
commit
2ce5e5dfb1
@@ -622,7 +622,22 @@ void Move(int src, int dest) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Test_UnitReady(void)
|
||||||
|
{
|
||||||
|
int result;
|
||||||
|
|
||||||
|
result = testUnitReady(MediumChangerFD);
|
||||||
|
if (result == 0)
|
||||||
|
{
|
||||||
|
printf("Ready:yes\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("Ready:no\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* okay, now for the Load, Unload, etc. logic: */
|
/* okay, now for the Load, Unload, etc. logic: */
|
||||||
|
|
||||||
static void Load(void)
|
static void Load(void)
|
||||||
|
|||||||
@@ -1870,7 +1870,7 @@ int ClearUnitAttention(DEVICE_TYPE fd, RequestSense_T *RequestSense)
|
|||||||
&unit_attention_sense, sizeof(unit_attention_sense),
|
&unit_attention_sense, sizeof(unit_attention_sense),
|
||||||
RequestSense) != 0)
|
RequestSense) != 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "RequestSense (0x03) failed\n");
|
fprintf(stderr, "RequestSense (0x03) failed\n");
|
||||||
return -1; /* could not do! */
|
return -1; /* could not do! */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1884,6 +1884,27 @@ int ClearUnitAttention(DEVICE_TYPE fd, RequestSense_T *RequestSense)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Test unit ready: This will tell us whether the tape drive
|
||||||
|
* is currently ready to read or write.
|
||||||
|
*/
|
||||||
|
|
||||||
|
int testUnitReady(DEVICE_TYPE fd)
|
||||||
|
{
|
||||||
|
RequestSense_T sense;
|
||||||
|
CDB_T CDB;
|
||||||
|
unsigned char buffer[6];
|
||||||
|
|
||||||
|
CDB[0] = 0x00; /* TEST_UNIT_READY */
|
||||||
|
CDB[1] = 0;
|
||||||
|
CDB[2] = 0;
|
||||||
|
CDB[3] = 0; /* 1-5 all unused. */
|
||||||
|
CDB[4] = 0;
|
||||||
|
CDB[5] = 0;
|
||||||
|
|
||||||
|
slow_bzero((char *)&sense,sizeof(RequestSense_T));
|
||||||
|
return SCSI_ExecuteCommand(fd,Input,&CDB,6,buffer,0,&sense);
|
||||||
|
}
|
||||||
|
|
||||||
static char Spaces[] = " ";
|
static char Spaces[] = " ";
|
||||||
|
|
||||||
void PrintHex(int Indent, unsigned char *Buffer, int Length)
|
void PrintHex(int Indent, unsigned char *Buffer, int Length)
|
||||||
|
|||||||
Reference in New Issue
Block a user