Changeset 56439 in vbox
- Timestamp:
- Jun 15, 2015 5:14:02 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 101056
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmifs.h
r56085 r56439 3149 3149 #define PDMISCSIPORT_IID "05d9fc3b-e38c-4b30-8344-a323feebcfe5" 3150 3150 3151 /** 3152 * LUN type. 3153 */ 3154 typedef enum PDMSCSILUNTYPE 3155 { 3156 PDMSCSILUNTYPE_INVALID = 0, 3157 PDMSCSILUNTYPE_SBC, /** Hard disk (SBC) */ 3158 PDMSCSILUNTYPE_MMC, /** CD/DVD drive (MMC) */ 3159 PDMSCSILUNTYPE_SSC, /** Tape drive (SSC) */ 3160 PDMSCSILUNTYPE_32BIT_HACK = 0x7fffffff 3161 } PDMSCSILUNTYPE, *PPDMSCSILUNTYPE; 3162 3151 3163 3152 3164 /** Pointer to a SCSI connector interface. */ … … 3167 3179 */ 3168 3180 DECLR3CALLBACKMEMBER(int, pfnSCSIRequestSend, (PPDMISCSICONNECTOR pInterface, PPDMSCSIREQUEST pSCSIRequest)); 3181 3182 /** 3183 * Queries the type of the attached LUN. 3184 * 3185 * @returns VBox status code. 3186 * @param pInterface Pointer to this interface. 3187 * @param iLUN The logical unit number. 3188 * @param pSCSIRequest Pointer to the LUN to be returned. 3189 */ 3190 DECLR3CALLBACKMEMBER(int, pfnQueryLUNType, (PPDMISCSICONNECTOR pInterface, uint32_t iLun, PPDMSCSILUNTYPE pLUNType)); 3169 3191 3170 3192 } PDMISCSICONNECTOR; -
trunk/include/VBox/vscsi.h
r53096 r56439 234 234 235 235 /** 236 * Return the SCSI LUN handle.236 * Query the SCSI LUN type. 237 237 * 238 238 * @returns VBox status code. 239 239 * @param hVScsiDevice The SCSI device handle. 240 240 * @param iLun The LUN number to get. 241 * @param p hVScsiLun Where to store the LUN handle.242 */ 243 VBOXDDU_DECL(int) VSCSIDeviceLun Get(VSCSIDEVICE hVScsiDevice, uint32_t iLun,244 PVSCSILUN phVScsiLun);241 * @param pEnmLunType Where to store the LUN type. 242 */ 243 VBOXDDU_DECL(int) VSCSIDeviceLunQueryType(VSCSIDEVICE hVScsiDevice, uint32_t iLun, 244 PVSCSILUNTYPE pEnmLunType); 245 245 246 246 /** -
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.