Fixed Test Unit Ready being the culprit of the non-working Read 10.
Made Unknown transfers as invalid but with SCSI Status Good/Ok in the Adaptec 1540. SCSI Commands with no transfers are left with no transfer function.
This commit is contained in:
@@ -289,6 +289,7 @@ typedef struct Adaptec_t
|
||||
|
||||
Adaptec_t AdaptecLUN;
|
||||
|
||||
static void AdaptecSCSIRequestSetup(Adaptec_t *Adaptec, uint32_t CCBPointer);
|
||||
static void AdaptecStartMailbox(Adaptec_t *Adaptec);
|
||||
|
||||
typedef void (*AdaptecMemCopyCallback)(Adaptec_t *Adaptec, uint32_t Addr, SGBUF *SegmentBuffer,
|
||||
@@ -548,12 +549,6 @@ static int AdaptecScatterGatherBufferWalker(Adaptec_t *Adaptec, AdaptecRequests_
|
||||
DataPointer = ADDR_TO_U32(AdaptecRequests->CmdBlock.DataPointer);
|
||||
DataLength = ADDR_TO_U32(AdaptecRequests->CmdBlock.DataLength);
|
||||
|
||||
if (AdaptecRequests->CmdBlock.Cdb[0] == GPCMD_TEST_UNIT_READY)
|
||||
{
|
||||
AdaptecRequests->CmdBlock.ControlByte = 3;
|
||||
DataLength = 6;
|
||||
}
|
||||
|
||||
AdaptecLog("Adaptec: S/G Buffer Walker\n");
|
||||
AdaptecLog("Data Length=%u\n", DataLength);
|
||||
AdaptecLog("Data Buffer Copy=%u\n", Copy);
|
||||
@@ -972,7 +967,7 @@ static void AdaptecSCSIRequestSetup(Adaptec_t *Adaptec, uint32_t CCBPointer)
|
||||
{
|
||||
AdaptecRequests_t *AdaptecRequests = &Adaptec->AdaptecRequests;
|
||||
CCB CmdBlock;
|
||||
|
||||
|
||||
uint32_t CCBUSize = sizeof(CCB);
|
||||
void *Data = (void *)&CmdBlock;
|
||||
uint32_t l = PageLengthReadWrite(CCBPointer, CCBUSize);
|
||||
@@ -981,14 +976,11 @@ static void AdaptecSCSIRequestSetup(Adaptec_t *Adaptec, uint32_t CCBPointer)
|
||||
CCBPointer += l;
|
||||
Data -= l;
|
||||
CCBUSize += l;
|
||||
|
||||
pclog("Scanning SCSI Target ID %d\n", CmdBlock.Id);
|
||||
|
||||
pclog("Scanning SCSI Target ID %d\n", CmdBlock.Id);
|
||||
|
||||
if (CmdBlock.Id == scsi_cdrom_id && CmdBlock.Lun == 0)
|
||||
{
|
||||
if (CmdBlock.Cdb[0] == GPCMD_TEST_UNIT_READY)
|
||||
CmdBlock.ControlByte = 3;
|
||||
|
||||
pclog("SCSI Target ID %d detected and working\n", CmdBlock.Id);
|
||||
|
||||
SCSI *Scsi = &ScsiDrives[CmdBlock.Id];
|
||||
@@ -1006,12 +998,7 @@ static void AdaptecSCSIRequestSetup(Adaptec_t *Adaptec, uint32_t CCBPointer)
|
||||
|
||||
pclog("Control Byte Transfer Direction %02X\n", CmdBlock.ControlByte);
|
||||
|
||||
if (CmdBlock.ControlByte == 3)
|
||||
{
|
||||
pclog("Adaptec No Transfer\n");
|
||||
SCSINoTransfer(Scsi, CmdBlock.Id);
|
||||
}
|
||||
else if (CmdBlock.ControlByte == CCB_DATA_XFER_OUT)
|
||||
if (CmdBlock.ControlByte == CCB_DATA_XFER_OUT)
|
||||
{
|
||||
pclog("Adaptec Write Transfer\n");
|
||||
SCSIWriteTransfer(Scsi, CmdBlock.Id);
|
||||
@@ -1021,11 +1008,20 @@ static void AdaptecSCSIRequestSetup(Adaptec_t *Adaptec, uint32_t CCBPointer)
|
||||
pclog("Adaptec Read Transfer\n");
|
||||
SCSIReadTransfer(Scsi, CmdBlock.Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
AdaptecMailboxIn(Adaptec, AdaptecRequests->CCBPointer, &CmdBlock, CCB_INVALID_DIRECTION, SCSI_STATUS_OK,
|
||||
MBI_ERROR);
|
||||
}
|
||||
|
||||
SCSISendCommand(Scsi, CmdBlock.Id, CmdBlock.Cdb, CmdBlock.CdbLength, BufferSize, AdaptecRequests->RequestSenseBuffer, SenseLength);
|
||||
|
||||
AdaptecRequestComplete(Scsi, Adaptec, AdaptecRequests);
|
||||
}
|
||||
else
|
||||
{
|
||||
CmdBlock.Id++;
|
||||
}
|
||||
}
|
||||
|
||||
static uint32_t AdaptecMailboxOut(Adaptec_t *Adaptec, Mailbox32_t *Mailbox32)
|
||||
|
@@ -19,14 +19,6 @@ uint8_t SCSIDeviceIsPresent(SCSI *Scsi)
|
||||
return (scsi_cdrom_id < 7 && Scsi->LunType != SCSI_NONE);
|
||||
}
|
||||
|
||||
void SCSINoTransfer(SCSI *Scsi, uint8_t Id)
|
||||
{
|
||||
pclog("SCSI: No Transfer\n");
|
||||
SGBUF SegmentBuffer;
|
||||
SegmentBufferInit(&SegmentBuffer, &Scsi->SegmentData, 1);
|
||||
pfnIoRequestCopyFromBuffer(0, &SegmentBuffer, Scsi->SegmentData.Length);
|
||||
}
|
||||
|
||||
void SCSIReadTransfer(SCSI *Scsi, uint8_t Id)
|
||||
{
|
||||
if (Scsi->LunType == SCSI_CDROM)
|
||||
|
@@ -204,7 +204,6 @@ uint32_t (*pfnIoRequestCopyFromBuffer)(uint32_t OffDst, SGBUF *SegmentBuffer,
|
||||
uint32_t (*pfnIoRequestCopyToBuffer)(uint32_t OffSrc, SGBUF *SegmentBuffer,
|
||||
uint32_t Copy);
|
||||
|
||||
void SCSINoTransfer(SCSI *Scsi, uint8_t Id);
|
||||
void SCSIReadTransfer(SCSI *Scsi, uint8_t Id);
|
||||
void SCSIWriteTransfer(SCSI *Scsi, uint8_t Id);
|
||||
|
||||
|
@@ -436,8 +436,6 @@ void SCSICDROM_RunCommand(SCSI *Scsi, uint8_t Id, uint8_t *Cdb)
|
||||
switch (Scsi->Cdb[0])
|
||||
{
|
||||
case GPCMD_TEST_UNIT_READY:
|
||||
SCSINoTransfer(Scsi, Id);
|
||||
|
||||
ScsiStatus = SCSI_STATUS_OK;
|
||||
SCSISenseCodeOk();
|
||||
ScsiCallback[Id]=50*SCSI_TIME;
|
||||
@@ -481,8 +479,6 @@ void SCSICDROM_RunCommand(SCSI *Scsi, uint8_t Id, uint8_t *Cdb)
|
||||
break;
|
||||
|
||||
case GPCMD_SET_SPEED:
|
||||
SCSINoTransfer(Scsi, Id);
|
||||
|
||||
ScsiStatus = SCSI_STATUS_OK;
|
||||
SCSISenseCodeOk();
|
||||
ScsiCallback[Id]=50*SCSI_TIME;
|
||||
@@ -900,9 +896,6 @@ void SCSICDROM_RunCommand(SCSI *Scsi, uint8_t Id, uint8_t *Cdb)
|
||||
}
|
||||
|
||||
cdrom->playaudio(Scsi->BufferPosition, Scsi->SegmentData.Length, (Scsi->Cdb[0] == GPCMD_PLAY_AUDIO_MSF) ? 1 : 0);
|
||||
|
||||
SCSINoTransfer(Scsi, Id);
|
||||
|
||||
ScsiStatus = SCSI_STATUS_OK;
|
||||
SCSISenseCodeOk();
|
||||
ScsiCallback[Id]=50*SCSI_TIME;
|
||||
@@ -1014,8 +1007,6 @@ void SCSICDROM_RunCommand(SCSI *Scsi, uint8_t Id, uint8_t *Cdb)
|
||||
if (!Scsi->Cdb[4]) cdrom->stop();
|
||||
else if (Scsi->Cdb[4]==2) cdrom->eject();
|
||||
else cdrom->load();
|
||||
SCSINoTransfer(Scsi, Id);
|
||||
|
||||
ScsiStatus = SCSI_STATUS_OK;
|
||||
SCSISenseCodeOk();
|
||||
ScsiCallback[Id]=50*SCSI_TIME;
|
||||
@@ -1120,8 +1111,6 @@ SCSIOut:
|
||||
break;
|
||||
|
||||
case GPCMD_PREVENT_REMOVAL:
|
||||
SCSINoTransfer(Scsi, Id);
|
||||
|
||||
ScsiStatus = SCSI_STATUS_OK;
|
||||
SCSISenseCodeOk();
|
||||
ScsiCallback[Id]=50*SCSI_TIME;
|
||||
@@ -1130,8 +1119,6 @@ SCSIOut:
|
||||
case GPCMD_PAUSE_RESUME:
|
||||
if (Scsi->Cdb[8]&1) cdrom->resume();
|
||||
else cdrom->pause();
|
||||
SCSINoTransfer(Scsi, Id);
|
||||
|
||||
ScsiStatus = SCSI_STATUS_OK;
|
||||
SCSISenseCodeOk();
|
||||
ScsiCallback[Id]=50*SCSI_TIME;
|
||||
@@ -1140,9 +1127,6 @@ SCSIOut:
|
||||
case GPCMD_SEEK:
|
||||
Scsi->BufferPosition = (Scsi->Cdb[3]<<16)|(Scsi->Cdb[4]<<8)|Scsi->Cdb[5];
|
||||
cdrom->seek(Scsi->BufferPosition);
|
||||
|
||||
SCSINoTransfer(Scsi, Id);
|
||||
|
||||
ScsiStatus = SCSI_STATUS_OK;
|
||||
SCSISenseCodeOk();
|
||||
ScsiCallback[Id]=50*SCSI_TIME;
|
||||
@@ -1171,9 +1155,6 @@ SCSIOut:
|
||||
|
||||
case GPCMD_STOP_PLAY_SCAN:
|
||||
cdrom->stop();
|
||||
|
||||
SCSINoTransfer(Scsi, Id);
|
||||
|
||||
ScsiStatus = SCSI_STATUS_OK;
|
||||
SCSISenseCodeOk();
|
||||
ScsiCallback[Id]=50*SCSI_TIME;
|
||||
|
Reference in New Issue
Block a user