Changeset 43659 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Oct 16, 2012 4:25:26 PM (12 years ago)
- Location:
- trunk/src/VBox/Devices/Storage
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevBusLogic.cpp
r43646 r43659 2063 2063 memcpy(pBusLogic->VBoxSCSI.pBuf, &ScsiInquiryData, 5); 2064 2064 2065 rc = vboxscsiRequestFinished(&pBusLogic->VBoxSCSI, &pTaskState->PDMScsiRequest );2065 rc = vboxscsiRequestFinished(&pBusLogic->VBoxSCSI, &pTaskState->PDMScsiRequest, SCSI_STATUS_OK); 2066 2066 AssertMsgRCReturn(rc, ("Finishing BIOS SCSI request failed rc=%Rrc\n", rc), rc); 2067 2067 … … 2402 2402 if (pTaskState->fBIOS) 2403 2403 { 2404 rc = vboxscsiRequestFinished(&pBusLogic->VBoxSCSI, pSCSIRequest );2404 rc = vboxscsiRequestFinished(&pBusLogic->VBoxSCSI, pSCSIRequest, rcCompletion); 2405 2405 AssertMsgRC(rc, ("Finishing BIOS SCSI request failed rc=%Rrc\n", rc)); 2406 2406 } … … 3367 3367 { 3368 3368 /* Register I/O port space for BIOS access. */ 3369 rc = PDMDevHlpIOPortRegister(pDevIns, BUSLOGIC_BIOS_IO_PORT, 3, NULL,3369 rc = PDMDevHlpIOPortRegister(pDevIns, BUSLOGIC_BIOS_IO_PORT, 4, NULL, 3370 3370 buslogicBIOSIOPortWrite, buslogicBIOSIOPortRead, 3371 3371 buslogicBIOSIOPortWriteStr, buslogicBIOSIOPortReadStr, -
trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
r43472 r43659 2110 2110 if (RT_UNLIKELY(pTaskState->fBIOS)) 2111 2111 { 2112 int rc = vboxscsiRequestFinished(&pLsiLogic->VBoxSCSI, pSCSIRequest );2112 int rc = vboxscsiRequestFinished(&pLsiLogic->VBoxSCSI, pSCSIRequest, rcCompletion); 2113 2113 AssertMsgRC(rc, ("Finishing BIOS SCSI request failed rc=%Rrc\n", rc)); 2114 2114 } … … 3728 3728 memcpy(pLsiLogic->VBoxSCSI.pBuf, &ScsiInquiryData, 5); 3729 3729 3730 rc = vboxscsiRequestFinished(&pLsiLogic->VBoxSCSI, &pTaskState->PDMScsiRequest );3730 rc = vboxscsiRequestFinished(&pLsiLogic->VBoxSCSI, &pTaskState->PDMScsiRequest, SCSI_STATUS_OK); 3731 3731 AssertMsgRCReturn(rc, ("Finishing BIOS SCSI request failed rc=%Rrc\n", rc), rc); 3732 3732 … … 5230 5230 { 5231 5231 if (pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI) 5232 rc = PDMDevHlpIOPortRegister(pDevIns, LSILOGIC_BIOS_IO_PORT, 3, NULL,5232 rc = PDMDevHlpIOPortRegister(pDevIns, LSILOGIC_BIOS_IO_PORT, 4, NULL, 5233 5233 lsilogicIsaIOPortWrite, lsilogicIsaIOPortRead, 5234 5234 lsilogicIsaIOPortWriteStr, lsilogicIsaIOPortReadStr, -
trunk/src/VBox/Devices/Storage/VBoxSCSI.cpp
r43474 r43659 39 39 static void vboxscsiReset(PVBOXSCSI pVBoxSCSI) 40 40 { 41 pVBoxSCSI->regIdentify = 0;42 pVBoxSCSI->cbCDB = 0;41 pVBoxSCSI->regIdentify = 0; 42 pVBoxSCSI->cbCDB = 0; 43 43 memset(pVBoxSCSI->aCDB, 0, sizeof(pVBoxSCSI->aCDB)); 44 pVBoxSCSI->iCDB = 0; 45 pVBoxSCSI->fBusy = false; 46 pVBoxSCSI->cbBuf = 0; 47 pVBoxSCSI->iBuf = 0; 44 pVBoxSCSI->iCDB = 0; 45 pVBoxSCSI->fBusy = false; 46 pVBoxSCSI->rcCompletion = 0; 47 pVBoxSCSI->uTargetDevice = 0; 48 pVBoxSCSI->cbBuf = 0; 49 pVBoxSCSI->iBuf = 0; 48 50 if (pVBoxSCSI->pBuf) 49 51 RTMemFree(pVBoxSCSI->pBuf); 50 52 51 pVBoxSCSI->pBuf = NULL; 52 pVBoxSCSI->enmState = VBOXSCSISTATE_NO_COMMAND; 53 53 pVBoxSCSI->pBuf = NULL; 54 pVBoxSCSI->enmState = VBOXSCSISTATE_NO_COMMAND; 54 55 } 55 56 … … 92 93 RTThreadYield(); 93 94 } 94 else95 uVal &= ~VBOX_SCSI_BUSY;95 if (pVBoxSCSI->rcCompletion) 96 uVal |= VBOX_SCSI_ERROR; 96 97 break; 97 98 } … … 117 118 pVBoxSCSI->iCDB = 0; 118 119 pVBoxSCSI->iBuf = 0; 120 pVBoxSCSI->rcCompletion = 0; 119 121 pVBoxSCSI->uTargetDevice = 0; 120 122 pVBoxSCSI->enmState = VBOXSCSISTATE_NO_COMMAND; … … 127 129 { 128 130 uVal = pVBoxSCSI->regIdentify; 131 break; 132 } 133 case 3: 134 { 135 uVal = pVBoxSCSI->rcCompletion; 129 136 break; 130 137 } … … 275 282 AssertMsg(pVBoxSCSI->enmState == VBOXSCSISTATE_COMMAND_READY, ("Invalid state %u\n", pVBoxSCSI->enmState)); 276 283 284 /* Clear any errors from a previous request. */ 285 pVBoxSCSI->rcCompletion = 0; 286 277 287 if (pVBoxSCSI->uTxDir == VBOXSCSI_TXDIR_FROM_DEVICE) 278 288 { … … 316 326 * is ready at the incoming data port. 317 327 */ 318 int vboxscsiRequestFinished(PVBOXSCSI pVBoxSCSI, PPDMSCSIREQUEST pScsiRequest )328 int vboxscsiRequestFinished(PVBOXSCSI pVBoxSCSI, PPDMSCSIREQUEST pScsiRequest, int rcCompletion) 319 329 { 320 330 LogFlowFunc(("pVBoxSCSI=%#p pScsiRequest=%#p\n", pVBoxSCSI, pScsiRequest)); … … 335 345 memset(pVBoxSCSI->aCDB, 0, sizeof(pVBoxSCSI->aCDB)); 336 346 } 347 348 pVBoxSCSI->rcCompletion = rcCompletion; 337 349 338 350 ASMAtomicXchgBool(&pVBoxSCSI->fBusy, false); -
trunk/src/VBox/Devices/Storage/VBoxSCSI.h
r43474 r43659 24 24 * 25 25 * The BusLogic interface if available will be starting at port 0x330 26 * and the LsiLogic starts at 0x340 and each will have a size of 3ports.26 * and the LsiLogic starts at 0x340 and each will have a size of 4 ports. 27 27 * The ports are used as described below: 28 28 * … … 39 39 * +--------+--------+----------+ 40 40 * | 2 | R/W | Detect | 41 * +--------+--------+----------+ 42 * | 3 | Read | SCSI rc | 41 43 * +--------+--------+----------+ 42 44 * | 3 | Write | Reset | … … 55 57 * again the adapter is available. 56 58 * 59 * Any write to the register at offset 3 causes the interface to be reset. A read returns 60 * the SCSI status code of the last operation. 61 * 57 62 * This part has no R0 or GC components. 58 63 */ … … 66 71 //#define DEBUG 67 72 #include <VBox/vmm/pdmdev.h> 73 #include <VBox/scsi.h> 68 74 69 75 typedef enum VBOXSCSISTATE … … 109 115 /** Current position in the buffer. */ 110 116 uint32_t iBuf; 117 /** The result code of last operation. */ 118 int rcCompletion; 111 119 /** Flag whether a request is pending. */ 112 120 volatile bool fBusy; … … 115 123 } VBOXSCSI, *PVBOXSCSI; 116 124 117 #define VBOX_SCSI_BUSY RT_BIT(0) 125 #define VBOX_SCSI_BUSY RT_BIT(0) 126 #define VBOX_SCSI_ERROR RT_BIT(1) 118 127 119 128 #ifdef IN_RING3 … … 123 132 int vboxscsiWriteRegister(PVBOXSCSI pVBoxSCSI, uint8_t iRegister, uint8_t uVal); 124 133 int vboxscsiSetupRequest(PVBOXSCSI pVBoxSCSI, PPDMSCSIREQUEST pScsiRequest, uint32_t *puTargetDevice); 125 int vboxscsiRequestFinished(PVBOXSCSI pVBoxSCSI, PPDMSCSIREQUEST pScsiRequest );134 int vboxscsiRequestFinished(PVBOXSCSI pVBoxSCSI, PPDMSCSIREQUEST pScsiRequest, int rcCompletion); 126 135 void vboxscsiSetRequestRedo(PVBOXSCSI pVBoxSCSI, PPDMSCSIREQUEST pScsiRequest); 127 136 int vboxscsiWriteString(PPDMDEVINS pDevIns, PVBOXSCSI pVBoxSCSI, uint8_t iRegister,
Note:
See TracChangeset
for help on using the changeset viewer.