Changeset 38694 in vbox for trunk/src/VBox
- Timestamp:
- Sep 8, 2011 9:44:08 PM (13 years ago)
- Location:
- trunk/src/VBox/Devices/Storage/VSCSI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/VSCSI/VSCSILunSbc.cpp
r38680 r38694 64 64 rc = vscsiVpdPagePoolInit(&pVScsiLunSbc->VpdPagePool); 65 65 66 /* Create device identification page - mandatory. */ 67 if (RT_SUCCESS(rc)) 68 { 69 PVSCSIVPDPAGEDEVID pDevIdPage; 70 71 rc = vscsiVpdPagePoolAllocNewPage(&pVScsiLunSbc->VpdPagePool, VSCSI_VPD_DEVID_NUMBER, 72 VSCSI_VPD_DEVID_SIZE, (uint8_t **)&pDevIdPage); 73 if (RT_SUCCESS(rc)) 74 { 75 /** @todo: Not conforming to the SPC spec but Solaris needs at least a stub to work. */ 76 pDevIdPage->u5PeripheralDeviceType = SCSI_INQUIRY_DATA_PERIPHERAL_DEVICE_TYPE_DIRECT_ACCESS; 77 pDevIdPage->u3PeripheralQualifier = SCSI_INQUIRY_DATA_PERIPHERAL_QUALIFIER_CONNECTED; 78 pDevIdPage->u16PageLength = RT_H2BE_U16(0x0); 79 cVpdPages++; 80 } 81 } 82 66 83 if ( RT_SUCCESS(rc) 67 84 && (pVScsiLun->fFeatures & VSCSI_LUN_FEATURE_UNMAP)) … … 138 155 pVpdPages->u16PageLength = RT_H2BE_U16(cVpdPages); 139 156 157 pVpdPages->abVpdPages[idxVpdPage++] = VSCSI_VPD_DEVID_NUMBER; 158 140 159 if (pVScsiLun->fFeatures & VSCSI_LUN_FEATURE_UNMAP) 141 160 { … … 479 498 { 480 499 rcReq = vscsiLunReqSenseErrorSet(pVScsiLun, pVScsiReq, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_LOGICAL_BLOCK_OOR, 0x00); 500 vscsiDeviceReqComplete(pVScsiLun->pVScsiDevice, pVScsiReq, rcReq, false, VINF_SUCCESS); 501 } 502 else if (!cSectorTransfer) 503 { 504 /* A 0 transfer length is not an error. */ 505 rcReq = vscsiLunReqSenseOkSet(pVScsiLun, pVScsiReq); 481 506 vscsiDeviceReqComplete(pVScsiLun->pVScsiDevice, pVScsiReq, rcReq, false, VINF_SUCCESS); 482 507 } -
trunk/src/VBox/Devices/Storage/VSCSI/VSCSIVpdPages.h
r38682 r38694 19 19 20 20 #include <iprt/stdint.h> 21 22 /** VPD device identification page number. */ 23 #define VSCSI_VPD_DEVID_NUMBER 0x83 24 /** VPD device identification size. */ 25 #define VSCSI_VPD_DEVID_SIZE 4 26 /** 27 * Device identification VPD page data. 28 */ 29 #pragma pack(1) 30 typedef struct VSCSIVPDPAGEDEVID 31 { 32 /** Device type. */ 33 unsigned u5PeripheralDeviceType : 5; /**< 0x00 / 00 */ 34 /** Qualifier. */ 35 unsigned u3PeripheralQualifier : 3; 36 /** Page number. */ 37 unsigned u8PageCode : 8; 38 /** Page size (Big endian) */ 39 unsigned u16PageLength : 16; 40 } VSCSIVPDPAGEDEVID; 41 #pragma pack() 42 AssertCompileSize(VSCSIVPDPAGEDEVID, VSCSI_VPD_DEVID_SIZE); 43 typedef VSCSIVPDPAGEDEVID *PVSCSIVPDPAGEDEVID; 44 typedef const VSCSIVPDPAGEDEVID *PCVSCSIVPDPAGEDEVID; 21 45 22 46 /** VPD supported VPD pages page number. */
Note:
See TracChangeset
for help on using the changeset viewer.