- Timestamp:
- Apr 27, 2010 12:12:36 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r28784 r28786 4855 4855 * @param pAhciPort Pointer to the port where to request completed. 4856 4856 * @param pAhciPortTaskState Pointer to the task which finished. 4857 */ 4858 static int ahciTransferComplete(PAHCIPort pAhciPort, PAHCIPORTTASKSTATE pAhciPortTaskState) 4857 * @param rcReq IPRT status code of the completed request. 4858 */ 4859 static int ahciTransferComplete(PAHCIPort pAhciPort, PAHCIPORTTASKSTATE pAhciPortTaskState, int rcReq) 4859 4860 { 4860 4861 /* Free system resources occupied by the scatter gather list. */ … … 4862 4863 ahciScatterGatherListDestroy(pAhciPort, pAhciPortTaskState); 4863 4864 4864 pAhciPortTaskState->cmdHdr.u32PRDBC = pAhciPortTaskState->cbTransfer; 4865 4866 pAhciPortTaskState->uATARegError = 0; 4867 pAhciPortTaskState->uATARegStatus = ATA_STAT_READY | ATA_STAT_SEEK; 4865 if (RT_FAILURE(rcReq)) 4866 { 4867 pAhciPortTaskState->cmdHdr.u32PRDBC = 0; 4868 pAhciPortTaskState->uATARegError = ID_ERR; 4869 pAhciPortTaskState->uATARegStatus = ATA_STAT_READY | ATA_STAT_ERR; 4870 4871 /* Log the error. */ 4872 if (pAhciPort->cErrors++ < MAX_LOG_REL_ERRORS) 4873 { 4874 if (pAhciPortTaskState->enmTxDir == AHCITXDIR_FLUSH) 4875 LogRel(("AHCI#%u: Flush returned rc=%Rrc\n", 4876 pAhciPort->iLUN, rcReq)); 4877 else 4878 LogRel(("AHCI#%u: %s at offset %llu (%u bytes left) returned rc=%Rrc\n", 4879 pAhciPort->iLUN, 4880 pAhciPortTaskState->enmTxDir == AHCITXDIR_READ 4881 ? "Read" 4882 : "Write", 4883 pAhciPortTaskState->uOffset, 4884 pAhciPortTaskState->cbTransfer, rcReq)); 4885 } 4886 } 4887 else 4888 { 4889 pAhciPortTaskState->cmdHdr.u32PRDBC = pAhciPortTaskState->cbTransfer; 4890 4891 pAhciPortTaskState->uATARegError = 0; 4892 pAhciPortTaskState->uATARegStatus = ATA_STAT_READY | ATA_STAT_SEEK; 4893 } 4894 4868 4895 /* Write updated command header into memory of the guest. */ 4869 4896 PDMDevHlpPhysWrite(pAhciPort->CTX_SUFF(pDevIns), pAhciPortTaskState->GCPhysCmdHdrAddr, … … 4930 4957 __FUNCTION__, pInterface, pvUser, pAhciPortTaskState->uTag)); 4931 4958 4932 int rc = ahciTransferComplete(pAhciPort, pAhciPortTaskState );4959 int rc = ahciTransferComplete(pAhciPort, pAhciPortTaskState, rcReq); 4933 4960 4934 4961 if (pAhciPort->uActTasksActive == 0 && pAhciPort->pAhciR3->fSignalIdle) … … 5354 5381 } 5355 5382 if (rc == VINF_VD_ASYNC_IO_FINISHED) 5356 rc = ahciTransferComplete(pAhciPort, pAhciPortTaskState );5383 rc = ahciTransferComplete(pAhciPort, pAhciPortTaskState, VINF_SUCCESS); 5357 5384 5358 5385 if (RT_FAILURE(rc) && rc != VERR_VD_ASYNC_IO_IN_PROGRESS) 5359 AssertMsgFailed(("%s: Failed to enqueue command %Rrc\n", __FUNCTION__, rc));5386 rc = ahciTransferComplete(pAhciPort, pAhciPortTaskState, rc); 5360 5387 } 5361 5388 else
Note:
See TracChangeset
for help on using the changeset viewer.