first attempt to report sense data
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25652 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -466,6 +466,7 @@ AHCIPort::WaitForTransfer(int *tfd, bigtime_t timeout)
|
|||||||
fCommandsActive &= ~1;
|
fCommandsActive &= ~1;
|
||||||
result = B_TIMED_OUT;
|
result = B_TIMED_OUT;
|
||||||
} else if (fError) {
|
} else if (fError) {
|
||||||
|
*tfd = fRegs->tfd;
|
||||||
result = B_ERROR;
|
result = B_ERROR;
|
||||||
fError = false;
|
fError = false;
|
||||||
} else {
|
} else {
|
||||||
@@ -748,16 +749,14 @@ AHCIPort::ExecuteSataRequest(sata_request *request, bool isWrite)
|
|||||||
|
|
||||||
FinishTransfer();
|
FinishTransfer();
|
||||||
|
|
||||||
if (status < B_OK) {
|
|
||||||
if (status == B_TIMED_OUT) {
|
if (status == B_TIMED_OUT) {
|
||||||
TRACE("ExecuteAtaRequest port %d: device timeout\n", fIndex);
|
TRACE("ExecuteAtaRequest port %d: device timeout\n", fIndex);
|
||||||
fResetPort = true;
|
fResetPort = true;
|
||||||
} else
|
|
||||||
TRACE("ExecuteAtaRequest port %d: device error\n", fIndex);
|
|
||||||
request->abort();
|
request->abort();
|
||||||
} else
|
} else {
|
||||||
request->finish(tfd, bytesTransfered);
|
request->finish(tfd, bytesTransfered);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "sata_request.h"
|
#include "sata_request.h"
|
||||||
|
#include "scsi_cmds.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
sata_request::sata_request()
|
sata_request::sata_request()
|
||||||
@@ -100,6 +101,22 @@ sata_request::finish(int tfd, size_t bytesTransfered)
|
|||||||
if (fCcb) {
|
if (fCcb) {
|
||||||
fCcb->data_resid = fCcb->data_length - bytesTransfered;
|
fCcb->data_resid = fCcb->data_length - bytesTransfered;
|
||||||
fCcb->subsys_status = (tfd & ATA_ERR) ? SCSI_REQ_CMP_ERR : SCSI_REQ_CMP;
|
fCcb->subsys_status = (tfd & ATA_ERR) ? SCSI_REQ_CMP_ERR : SCSI_REQ_CMP;
|
||||||
|
if (fIsATAPI && (tfd & ATA_ERR)) {
|
||||||
|
uint8 error = (tfd >> 8) & 0xff;
|
||||||
|
dprintf("ahci: sata_request::finish status 0x%02x, error 0x%02x\n", tfd & 0xff, error);
|
||||||
|
if (error & 0x04) { // ABRT
|
||||||
|
fCcb->subsys_status = SCSI_REQ_ABORTED;
|
||||||
|
} else {
|
||||||
|
fCcb->device_status = SCSI_STATUS_CHECK_CONDITION;
|
||||||
|
fCcb->subsys_status |= SCSI_AUTOSNS_VALID;
|
||||||
|
fCcb->sense_resid = 0; //FIXME
|
||||||
|
scsi_sense *sense = (scsi_sense *)fCcb->sense;
|
||||||
|
sense->error_code = SCSIS_CURR_ERROR;
|
||||||
|
sense->sense_key = error >> 4;
|
||||||
|
sense->asc = 0;
|
||||||
|
sense->ascq = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
gSCSI->finished(fCcb, 1);
|
gSCSI->finished(fCcb, 1);
|
||||||
delete this;
|
delete this;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user