Changeset 56439 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 15, 2015 5:14:02 PM (10 years ago)
- Location:
- trunk/src/VBox/Devices/Storage
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvSCSI.cpp
r56292 r56439 648 648 } 649 649 650 /** @copydoc PDMISCSICONNECTOR::pfnQueryLUNType. */ 651 static DECLCALLBACK(int) drvscsiQueryLUNType(PPDMISCSICONNECTOR pInterface, uint32_t iLun, PPDMSCSILUNTYPE pLunType) 652 { 653 int rc; 654 PDRVSCSI pThis = PDMISCSICONNECTOR_2_DRVSCSI(pInterface); 655 VSCSILUNTYPE enmLunType; 656 657 rc = VSCSIDeviceLunQueryType(pThis->hVScsiDevice, iLun, &enmLunType); 658 if (RT_FAILURE(rc)) 659 return rc; 660 661 switch (enmLunType) 662 { 663 case VSCSILUNTYPE_SBC: *pLunType = PDMSCSILUNTYPE_SBC; break; 664 case VSCSILUNTYPE_MMC: *pLunType = PDMSCSILUNTYPE_MMC; break; 665 case VSCSILUNTYPE_SSC: *pLunType = PDMSCSILUNTYPE_SSC; break; 666 default: *pLunType = PDMSCSILUNTYPE_INVALID; 667 } 668 669 return rc; 670 } 671 650 672 /* -=-=-=-=- IBase -=-=-=-=- */ 651 673 … … 892 914 pThis->pDrvIns = pDrvIns; 893 915 pThis->ISCSIConnector.pfnSCSIRequestSend = drvscsiRequestSend; 916 pThis->ISCSIConnector.pfnQueryLUNType = drvscsiQueryLUNType; 894 917 895 918 pDrvIns->IBase.pfnQueryInterface = drvscsiQueryInterface; -
trunk/src/VBox/Devices/Storage/UsbMsd.cpp
r56393 r56439 2171 2171 pThis->Lun0.pIScsiConnector = NULL; 2172 2172 } 2173 2174 /* 2175 * Find out what kind of device we are. 2176 */ 2177 PDMSCSILUNTYPE enmLunType; 2178 pThis->fIsCdrom = false; 2179 rc = pThis->Lun0.pIScsiConnector->pfnQueryLUNType(pThis->Lun0.pIScsiConnector, 0 /*iLun*/, &enmLunType); 2180 if (RT_SUCCESS(rc)) 2181 { 2182 /* Anything else will be reported as a hard disk. */ 2183 if (enmLunType == PDMSCSILUNTYPE_MMC) 2184 pThis->fIsCdrom = true; 2185 } 2186 2173 2187 return rc; 2174 2188 } … … 2318 2332 * Find out what kind of device we are. 2319 2333 */ 2320 pThis->fIsCdrom = false; //@todo: Find out somehow 2334 PDMSCSILUNTYPE enmLunType; 2335 pThis->fIsCdrom = false; 2336 rc = pThis->Lun0.pIScsiConnector->pfnQueryLUNType(pThis->Lun0.pIScsiConnector, 0 /*iLun*/, &enmLunType); 2337 if (RT_SUCCESS(rc)) 2338 { 2339 /* Anything else will be reported as a hard disk. */ 2340 if (enmLunType == PDMSCSILUNTYPE_MMC) 2341 pThis->fIsCdrom = true; 2342 } 2321 2343 2322 2344 /* -
trunk/src/VBox/Devices/Storage/VSCSI/VSCSIDevice.cpp
r56292 r56439 257 257 258 258 259 VBOXDDU_DECL(int) VSCSIDeviceLun Get(VSCSIDEVICE hVScsiDevice, uint32_t iLun,260 PVSCSILUN phVScsiLun)261 { 262 PVSCSIDEVICEINT pVScsiDevice = (PVSCSIDEVICEINT)hVScsiDevice; 263 264 /* Parameter checks */ 265 AssertPtrReturn(pVScsiDevice, VERR_INVALID_HANDLE); 266 AssertPtrReturn(p hVScsiLun, VERR_INVALID_POINTER);259 VBOXDDU_DECL(int) VSCSIDeviceLunQueryType(VSCSIDEVICE hVScsiDevice, uint32_t iLun, 260 PVSCSILUNTYPE pEnmLunType) 261 { 262 PVSCSIDEVICEINT pVScsiDevice = (PVSCSIDEVICEINT)hVScsiDevice; 263 264 /* Parameter checks */ 265 AssertPtrReturn(pVScsiDevice, VERR_INVALID_HANDLE); 266 AssertPtrReturn(pEnmLunType, VERR_INVALID_POINTER); 267 267 AssertReturn(iLun < VSCSI_DEVICE_LUN_MAX, VERR_VSCSI_LUN_INVALID); 268 268 AssertReturn(iLun < pVScsiDevice->cLunsMax, VERR_VSCSI_LUN_NOT_ATTACHED); 269 269 AssertPtrReturn(pVScsiDevice->papVScsiLun[iLun], VERR_VSCSI_LUN_NOT_ATTACHED); 270 270 271 *phVScsiLun = pVScsiDevice->papVScsiLun[iLun]; 271 PVSCSILUNINT hVScsiLun = pVScsiDevice->papVScsiLun[iLun]; 272 *pEnmLunType = hVScsiLun->pVScsiLunDesc->enmLunType; 272 273 273 274 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.