Changeset 64413 in vbox for trunk/src/VBox
- Timestamp:
- Oct 25, 2016 1:07:55 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvHostDVD.cpp
r64407 r64413 116 116 } 117 117 118 static voiddrvHostDvdCmdOK(PDRVHOSTDVD pThis)118 static uint8_t drvHostDvdCmdOK(PDRVHOSTDVD pThis) 119 119 { 120 120 memset(pThis->abATAPISense, '\0', sizeof(pThis->abATAPISense)); 121 121 pThis->abATAPISense[0] = 0x70; 122 122 pThis->abATAPISense[7] = 10; 123 } 124 125 static void drvHostDvdCmdError(PDRVHOSTDVD pThis, const uint8_t *pabATAPISense, size_t cbATAPISense) 123 return SCSI_STATUS_OK; 124 } 125 126 static uint8_t drvHostDvdCmdError(PDRVHOSTDVD pThis, const uint8_t *pabATAPISense, size_t cbATAPISense) 126 127 { 127 128 Log(("%s: sense=%#x (%s) asc=%#x ascq=%#x (%s)\n", __FUNCTION__, pabATAPISense[2] & 0x0f, SCSISenseText(pabATAPISense[2] & 0x0f), … … 129 130 memset(pThis->abATAPISense, '\0', sizeof(pThis->abATAPISense)); 130 131 memcpy(pThis->abATAPISense, pabATAPISense, RT_MIN(cbATAPISense, sizeof(pThis->abATAPISense))); 132 return SCSI_STATUS_CHECK_CONDITION; 131 133 } 132 134 133 135 /** @todo deprecated function - doesn't provide enough info. Replace by direct 134 136 * calls to drvHostDvdCmdError() with full data. */ 135 static voiddrvHostDvdCmdErrorSimple(PDRVHOSTDVD pThis, uint8_t uATAPISenseKey, uint8_t uATAPIASC)137 static uint8_t drvHostDvdCmdErrorSimple(PDRVHOSTDVD pThis, uint8_t uATAPISenseKey, uint8_t uATAPIASC) 136 138 { 137 139 uint8_t abATAPISense[ATAPI_SENSE_SIZE]; … … 141 143 abATAPISense[7] = 10; 142 144 abATAPISense[12] = uATAPIASC; 143 drvHostDvdCmdError(pThis, abATAPISense, sizeof(abATAPISense));145 return drvHostDvdCmdError(pThis, abATAPISense, sizeof(abATAPISense)); 144 146 } 145 147 … … 443 445 case 0x0f: /* activate deferred microcode */ 444 446 LogRel(("HostDVD#%u: CD-ROM passthrough command attempted to update firmware, blocked\n", pThis->Core.pDrvIns->iInstance)); 445 drvHostDvdCmdErrorSimple(pThis, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_INV_FIELD_IN_CMD_PACKET); 446 *pu8ScsiSts = SCSI_STATUS_CHECK_CONDITION; 447 *pu8ScsiSts = drvHostDvdCmdErrorSimple(pThis, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_INV_FIELD_IN_CMD_PACKET); 447 448 break; 448 449 default: … … 464 465 * opcode 0x01" in syslog) and replies with a sense code of 0, 465 466 * which sends cdrecord to an endless loop. */ 466 drvHostDvdCmdErrorSimple(pThis, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_ILLEGAL_OPCODE); 467 *pu8ScsiSts = SCSI_STATUS_CHECK_CONDITION; 467 *pu8ScsiSts = drvHostDvdCmdErrorSimple(pThis, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_ILLEGAL_OPCODE); 468 468 break; 469 469 default: 470 470 LogRel(("HostDVD#%u: Passthrough unimplemented for command %#x\n", pThis->Core.pDrvIns->iInstance, pbCdb[0])); 471 drvHostDvdCmdErrorSimple(pThis, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_ILLEGAL_OPCODE); 472 *pu8ScsiSts = SCSI_STATUS_CHECK_CONDITION; 471 *pu8ScsiSts = drvHostDvdCmdErrorSimple(pThis, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_ILLEGAL_OPCODE); 473 472 break; 474 473 } … … 605 604 AssertMsgFailed(("Don't know how to split command %#04x\n", pbCdb[0])); 606 605 LogRelMax(10, ("HostDVD#%u: CD-ROM passthrough split error\n", pThis->Core.pDrvIns->iInstance)); 607 drvHostDvdCmdErrorSimple(pThis, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_ILLEGAL_OPCODE); 608 *pu8ScsiSts = SCSI_STATUS_CHECK_CONDITION; 606 *pu8ScsiSts = drvHostDvdCmdErrorSimple(pThis, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_ILLEGAL_OPCODE); 609 607 rc = drvHostBaseBufferRelease(&pThis->Core, pReq, cbBuf, enmXferDir == PDMMEDIATXDIR_TO_DEVICE, pvBuf); 610 608 RTCritSectLeave(&pThis->Core.CritSect); … … 712 710 } 713 711 714 drvHostDvdCmdOK(pThis); 715 *pu8ScsiSts = SCSI_STATUS_OK; 712 *pu8ScsiSts = drvHostDvdCmdOK(pThis); 716 713 } 717 714 else … … 730 727 pThis->abATAPISense[12], pThis->abATAPISense[13], rc)); 731 728 } while (0); 732 drvHostDvdCmdError(pThis, &pThis->abATAPISense[0], sizeof(pThis->abATAPISense));733 729 *pu8ScsiSts = SCSI_STATUS_CHECK_CONDITION; 734 730 rc = VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.