Changeset 58466 in vbox for trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Scsi
- Timestamp:
- Oct 29, 2015 4:30:44 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 103777
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
- Property svn:mergeinfo changed
/vendor/edk2/current merged: 103769-103776
- Property svn:mergeinfo changed
-
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
r58459 r58466 189 189 190 190 // 191 // To keep backward compatibility, UEFI ExtPassThru Protocol is supported as well as 191 // To keep backward compatibility, UEFI ExtPassThru Protocol is supported as well as 192 192 // EFI PassThru Protocol. From priority perspective, ExtPassThru Protocol is firstly 193 193 // tried to open on host controller handle. If fails, then PassThru Protocol is tried instead. … … 218 218 This->DriverBindingHandle, 219 219 Controller 220 ); 220 ); 221 221 return EFI_SUCCESS; 222 222 } else { … … 233 233 This->DriverBindingHandle, 234 234 Controller 235 ); 235 ); 236 236 if (!EFI_ERROR(Status)) { 237 237 return EFI_SUCCESS; … … 241 241 242 242 // 243 // Come here in 2 condition: 243 // Come here in 2 condition: 244 244 // 1. ExtPassThru doesn't exist. 245 245 // 2. ExtPassThru exists but RemainingDevicePath is invalid. … … 253 253 EFI_OPEN_PROTOCOL_BY_DRIVER 254 254 ); 255 255 256 256 if (Status == EFI_ALREADY_STARTED) { 257 257 return EFI_SUCCESS; 258 258 } 259 259 260 260 if (EFI_ERROR (Status)) { 261 261 return Status; 262 262 } 263 263 264 264 // 265 265 // Test RemainingDevicePath is valid or not. … … 268 268 Status = PassThru->GetTargetLun (PassThru, RemainingDevicePath, &ScsiTargetId.ScsiId.Scsi, &Lun); 269 269 } 270 270 271 271 gBS->CloseProtocol ( 272 272 Controller, … … 326 326 ExtScsiSupport = FALSE; 327 327 PassThruStatus = EFI_SUCCESS; 328 328 329 329 TargetId = &ScsiTargetId.ScsiId.ExtScsi[0]; 330 330 SetMem (TargetId, TARGET_MAX_BYTES, 0xFF); 331 331 332 332 DevicePathStatus = gBS->OpenProtocol ( 333 333 Controller, … … 349 349 (EFI_IO_BUS_SCSI | EFI_IOB_PC_INIT), 350 350 ParentDevicePath 351 ); 352 353 // 354 // To keep backward compatibility, UEFI ExtPassThru Protocol is supported as well as 351 ); 352 353 // 354 // To keep backward compatibility, UEFI ExtPassThru Protocol is supported as well as 355 355 // EFI PassThru Protocol. From priority perspective, ExtPassThru Protocol is firstly 356 356 // tried to open on host controller handle. If fails, then PassThru Protocol is tried instead. … … 387 387 Controller 388 388 ); 389 } 389 } 390 390 return Status; 391 } 391 } 392 392 } else { 393 393 // 394 // Succeed to open ExtPassThru Protocol, and meanwhile open PassThru Protocol 395 // with BY_DRIVER if it is also present on the handle. The intent is to prevent 394 // Succeed to open ExtPassThru Protocol, and meanwhile open PassThru Protocol 395 // with BY_DRIVER if it is also present on the handle. The intent is to prevent 396 396 // another SCSI Bus Driver to work on the same host handle. 397 397 // … … 406 406 ); 407 407 } 408 408 409 409 if (Status != EFI_ALREADY_STARTED) { 410 410 // … … 424 424 ScsiBusDev->ExtScsiInterface = ExtScsiInterface; 425 425 } else { 426 ScsiBusDev->ScsiInterface = ScsiInterface; 426 ScsiBusDev->ScsiInterface = ScsiInterface; 427 427 } 428 428 … … 431 431 // retrieved on this controller handle. With ScsiBusDev, we can know which PassThru 432 432 // Protocol is present on the handle, UEFI ExtPassThru Protocol or EFI PassThru Protocol. 433 // 433 // 434 434 Status = gBS->InstallProtocolInterface ( 435 435 &Controller, … … 473 473 if (RemainingDevicePath == NULL) { 474 474 // 475 // If RemainingDevicePath is NULL, 475 // If RemainingDevicePath is NULL, 476 476 // must enumerate all SCSI devices anyway 477 477 // … … 479 479 } else if (!IsDevicePathEnd (RemainingDevicePath)) { 480 480 // 481 // If RemainingDevicePath isn't the End of Device Path Node, 481 // If RemainingDevicePath isn't the End of Device Path Node, 482 482 // only scan the specified device by RemainingDevicePath 483 483 // 484 484 if (ScsiBusDev->ExtScsiSupport) { 485 Status = ScsiBusDev->ExtScsiInterface->GetTargetLun (ScsiBusDev->ExtScsiInterface, RemainingDevicePath, &TargetId, &Lun); 485 Status = ScsiBusDev->ExtScsiInterface->GetTargetLun (ScsiBusDev->ExtScsiInterface, RemainingDevicePath, &TargetId, &Lun); 486 486 } else { 487 487 Status = ScsiBusDev->ScsiInterface->GetTargetLun (ScsiBusDev->ScsiInterface, RemainingDevicePath, &ScsiTargetId.ScsiId.Scsi, &Lun); … … 495 495 // If RemainingDevicePath is the End of Device Path Node, 496 496 // skip enumerate any device and return EFI_SUCESSS 497 // 497 // 498 498 ScanOtherPuns = FALSE; 499 499 } … … 540 540 541 541 ErrorExit: 542 542 543 543 if (ScsiBusDev != NULL) { 544 544 FreePool (ScsiBusDev); 545 545 } 546 546 547 547 if (ExtScsiSupport) { 548 548 gBS->CloseProtocol ( … … 579 579 calling restrictions. If any other agent wishes to call Stop() it must also 580 580 follow these calling restrictions. 581 581 582 582 @param This Protocol instance pointer. 583 583 @param ControllerHandle Handle of device to stop driver on … … 651 651 // 652 652 // When Start() succeeds to open ExtPassThru, it always tries to open PassThru BY_DRIVER. 653 // Its intent is to prevent another SCSI Bus Driver from woking on the same host handle. 653 // Its intent is to prevent another SCSI Bus Driver from woking on the same host handle. 654 654 // So Stop() needs to try to close PassThru if present here. 655 655 // … … 764 764 @param This Protocol instance pointer. 765 765 @param DeviceType A pointer to the device type information retrieved from 766 the SCSI Controller. 766 the SCSI Controller. 767 767 768 768 @retval EFI_SUCCESS Retrieves the device type information successfully. 769 769 @retval EFI_INVALID_PARAMETER The DeviceType is NULL. 770 770 771 771 **/ 772 772 EFI_STATUS … … 834 834 @retval EFI_UNSUPPORTED The bus reset operation is not supported by the 835 835 SCSI Host Controller. 836 @retval EFI_TIMEOUT A timeout occurred while attempting to reset 836 @retval EFI_TIMEOUT A timeout occurred while attempting to reset 837 837 the SCSI bus. 838 838 **/ … … 894 894 ScsiIoDevice->ScsiBusDeviceData->DevicePath 895 895 ); 896 896 897 897 CopyMem (Target,&ScsiIoDevice->Pun, TARGET_MAX_BYTES); 898 898 … … 918 918 919 919 @param This Protocol instance pointer. 920 @param CommandPacket The SCSI request packet to send to the SCSI 920 @param CommandPacket The SCSI request packet to send to the SCSI 921 921 Controller specified by the device handle. 922 922 @param Event If the SCSI bus where the SCSI device is attached 923 does not support non-blocking I/O, then Event is 924 ignored, and blocking I/O is performed. 923 does not support non-blocking I/O, then Event is 924 ignored, and blocking I/O is performed. 925 925 If Event is NULL, then blocking I/O is performed. 926 If Event is not NULL and non-blocking I/O is 926 If Event is not NULL and non-blocking I/O is 927 927 supported, then non-blocking I/O is performed, 928 928 and Event will be signaled when the SCSI Request 929 929 Packet completes. 930 930 931 @retval EFI_SUCCESS The SCSI Request Packet was sent by the host 932 successfully, and TransferLength bytes were 933 transferred to/from DataBuffer.See 934 HostAdapterStatus, TargetStatus, 931 @retval EFI_SUCCESS The SCSI Request Packet was sent by the host 932 successfully, and TransferLength bytes were 933 transferred to/from DataBuffer.See 934 HostAdapterStatus, TargetStatus, 935 935 SenseDataLength, and SenseData in that order 936 936 for additional status information. 937 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, 937 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, 938 938 but the entire DataBuffer could not be transferred. 939 939 The actual number of bytes transferred is returned 940 in TransferLength. See HostAdapterStatus, 941 TargetStatus, SenseDataLength, and SenseData in 940 in TransferLength. See HostAdapterStatus, 941 TargetStatus, SenseDataLength, and SenseData in 942 942 that order for additional status information. 943 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because 944 there are too many SCSI Command Packets already 943 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because 944 there are too many SCSI Command Packets already 945 945 queued.The caller may retry again later. 946 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send 947 the SCSI Request Packet. See HostAdapterStatus, 948 TargetStatus, SenseDataLength, and SenseData in 946 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send 947 the SCSI Request Packet. See HostAdapterStatus, 948 TargetStatus, SenseDataLength, and SenseData in 949 949 that order for additional status information. 950 @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid. 951 The SCSI Request Packet was not sent, so no 950 @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid. 951 The SCSI Request Packet was not sent, so no 952 952 additional status information is available. 953 953 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet 954 is not supported by the SCSI initiator(i.e., SCSI 954 is not supported by the SCSI initiator(i.e., SCSI 955 955 Host Controller). The SCSI Request Packet was not 956 sent, so no additional status information is 956 sent, so no additional status information is 957 957 available. 958 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI 958 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI 959 959 Request Packet to execute. See HostAdapterStatus, 960 TargetStatus, SenseDataLength, and SenseData in 960 TargetStatus, SenseDataLength, and SenseData in 961 961 that order for additional status information. 962 962 **/ … … 974 974 EFI_EVENT PacketEvent; 975 975 EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *ExtRequestPacket; 976 SCSI_EVENT_DATA EventData; 976 SCSI_EVENT_DATA EventData; 977 977 978 978 PacketEvent = NULL; 979 979 980 980 if (Packet == NULL) { 981 981 return EFI_INVALID_PARAMETER; … … 1230 1230 1231 1231 ErrorExit: 1232 1232 1233 1233 // 1234 1234 // The memory space for ScsiDevicePath is allocated in … … 1305 1305 if (!EFI_ERROR (Status)) { 1306 1306 break; 1307 } else if ((Status == EFI_BAD_BUFFER_SIZE) || 1307 } else if ((Status == EFI_BAD_BUFFER_SIZE) || 1308 1308 (Status == EFI_INVALID_PARAMETER) || 1309 1309 (Status == EFI_UNSUPPORTED)) { … … 1317 1317 goto Done; 1318 1318 } 1319 1319 1320 1320 // 1321 1321 // Retrieved inquiry data successfully -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h
r58459 r58466 42 42 typedef union { 43 43 UINT32 Scsi; 44 UINT8 ExtScsi[4]; 44 UINT8 ExtScsi[4]; 45 45 } SCSI_ID; 46 46 … … 80 80 UINTN Signature; 81 81 EFI_SCSI_BUS_PROTOCOL BusIdentify; 82 BOOLEAN ExtScsiSupport; 82 BOOLEAN ExtScsiSupport; 83 83 EFI_SCSI_PASS_THRU_PROTOCOL *ScsiInterface; 84 84 EFI_EXT_SCSI_PASS_THRU_PROTOCOL *ExtScsiInterface; … … 93 93 EFI_SCSI_IO_PROTOCOL ScsiIo; 94 94 EFI_DEVICE_PATH_PROTOCOL *DevicePath; 95 BOOLEAN ExtScsiSupport; 95 BOOLEAN ExtScsiSupport; 96 96 EFI_SCSI_PASS_THRU_PROTOCOL *ScsiPassThru; 97 97 EFI_EXT_SCSI_PASS_THRU_PROTOCOL *ExtScsiPassThru; … … 175 175 calling restrictions. If any other agent wishes to call Stop() it must also 176 176 follow these calling restrictions. 177 177 178 178 @param This Protocol instance pointer. 179 179 @param ControllerHandle Handle of device to stop driver on … … 328 328 @param This Protocol instance pointer. 329 329 @param DeviceType A pointer to the device type information retrieved from 330 the SCSI Controller. 330 the SCSI Controller. 331 331 332 332 @retval EFI_SUCCESS Retrieves the device type information successfully. 333 333 @retval EFI_INVALID_PARAMETER The DeviceType is NULL. 334 334 335 335 **/ 336 336 EFI_STATUS … … 371 371 @retval EFI_UNSUPPORTED The bus reset operation is not supported by the 372 372 SCSI Host Controller. 373 @retval EFI_TIMEOUT A timeout occurred while attempting to reset 373 @retval EFI_TIMEOUT A timeout occurred while attempting to reset 374 374 the SCSI bus. 375 375 **/ … … 401 401 402 402 @param This Protocol instance pointer. 403 @param CommandPacket The SCSI request packet to send to the SCSI 403 @param CommandPacket The SCSI request packet to send to the SCSI 404 404 Controller specified by the device handle. 405 405 @param Event If the SCSI bus where the SCSI device is attached 406 does not support non-blocking I/O, then Event is 407 ignored, and blocking I/O is performed. 406 does not support non-blocking I/O, then Event is 407 ignored, and blocking I/O is performed. 408 408 If Event is NULL, then blocking I/O is performed. 409 If Event is not NULL and non-blocking I/O is 409 If Event is not NULL and non-blocking I/O is 410 410 supported, then non-blocking I/O is performed, 411 411 and Event will be signaled when the SCSI Request 412 412 Packet completes. 413 413 414 @retval EFI_SUCCESS The SCSI Request Packet was sent by the host 415 successfully, and TransferLength bytes were 416 transferred to/from DataBuffer.See 417 HostAdapterStatus, TargetStatus, 414 @retval EFI_SUCCESS The SCSI Request Packet was sent by the host 415 successfully, and TransferLength bytes were 416 transferred to/from DataBuffer.See 417 HostAdapterStatus, TargetStatus, 418 418 SenseDataLength, and SenseData in that order 419 419 for additional status information. 420 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, 420 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, 421 421 but the entire DataBuffer could not be transferred. 422 422 The actual number of bytes transferred is returned 423 in TransferLength. See HostAdapterStatus, 424 TargetStatus, SenseDataLength, and SenseData in 423 in TransferLength. See HostAdapterStatus, 424 TargetStatus, SenseDataLength, and SenseData in 425 425 that order for additional status information. 426 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because 427 there are too many SCSI Command Packets already 426 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because 427 there are too many SCSI Command Packets already 428 428 queued.The caller may retry again later. 429 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send 430 the SCSI Request Packet. See HostAdapterStatus, 431 TargetStatus, SenseDataLength, and SenseData in 429 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send 430 the SCSI Request Packet. See HostAdapterStatus, 431 TargetStatus, SenseDataLength, and SenseData in 432 432 that order for additional status information. 433 @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid. 434 The SCSI Request Packet was not sent, so no 433 @retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid. 434 The SCSI Request Packet was not sent, so no 435 435 additional status information is available. 436 436 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet 437 is not supported by the SCSI initiator(i.e., SCSI 437 is not supported by the SCSI initiator(i.e., SCSI 438 438 Host Controller). The SCSI Request Packet was not 439 sent, so no additional status information is 439 sent, so no additional status information is 440 440 available. 441 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI 441 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI 442 442 Request Packet to execute. See HostAdapterStatus, 443 TargetStatus, SenseDataLength, and SenseData in 443 TargetStatus, SenseDataLength, and SenseData in 444 444 that order for additional status information. 445 445 **/ -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
r58459 r58466 3 3 # Note that the driver will install the Device Path Protocol and SCSI I/O Protocol on 4 4 # these handles. 5 # 5 # 6 6 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 7 7 # This program and the accompanying materials … … 9 9 # which accompanies this distribution. The full text of the license may be found at 10 10 # http://opensource.org/licenses/bsd-license.php 11 # 11 # 12 12 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 13 13 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 14 # 14 # 15 15 ## 16 16 … … 30 30 # VALID_ARCHITECTURES = IA32 X64 IPF EBC 31 31 # 32 # DRIVER_BINDING = gSCSIBusDriverBinding 32 # DRIVER_BINDING = gSCSIBusDriverBinding 33 33 # COMPONENT_NAME = gScsiBusComponentName 34 34 # COMPONENT_NAME2 = gScsiBusComponentName2 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ComponentName.c
r48674 r58466 184 184 return EFI_UNSUPPORTED; 185 185 } 186 186 187 187 // 188 188 // Make sure this driver is currently managing ControllerHandle -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
r58459 r58466 80 80 The user code starts with this function. 81 81 82 @param ImageHandle The firmware allocated handle for the EFI image. 82 @param ImageHandle The firmware allocated handle for the EFI image. 83 83 @param SystemTable A pointer to the EFI System Table. 84 84 85 85 @retval EFI_SUCCESS The entry point is executed successfully. 86 86 @retval other Some error occurs when executing this entry point. … … 331 331 return EFI_SUCCESS; 332 332 } 333 } 333 } 334 334 } 335 335 … … 343 343 ); 344 344 return Status; 345 345 346 346 } 347 347 … … 355 355 calling restrictions. If any other agent wishes to call Stop() it must 356 356 also follow these calling restrictions. 357 357 358 358 @param This Protocol instance pointer. 359 359 @param ControllerHandle Handle of device to stop driver on … … 731 731 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV 732 732 @param MustReadCapacity The flag about reading device capacity 733 @param MediaChange The pointer of flag indicates if media has changed 733 @param MediaChange The pointer of flag indicates if media has changed 734 734 735 735 @retval EFI_DEVICE_ERROR Indicates that error occurs … … 866 866 break; 867 867 } 868 } else { 868 } else { 869 869 Retry++; 870 870 if (!NeedRetry || (Retry >= MaxRetry)) { … … 1033 1033 ); 1034 1034 if (!EFI_ERROR (Status)) { 1035 ScsiDiskDevice->BlkIo.Media->OptimalTransferLengthGranularity = 1035 ScsiDiskDevice->BlkIo.Media->OptimalTransferLengthGranularity = 1036 1036 (BlockLimits->OptimalTransferLengthGranularity2 << 8) | 1037 1037 BlockLimits->OptimalTransferLengthGranularity1; … … 1052 1052 *NeedRetry = TRUE; 1053 1053 return EFI_DEVICE_ERROR; 1054 1054 1055 1055 } else if ((Status == EFI_INVALID_PARAMETER) || (Status == EFI_UNSUPPORTED)) { 1056 1056 *NeedRetry = FALSE; … … 1088 1088 return EFI_DEVICE_ERROR; 1089 1089 } 1090 1090 1091 1091 // 1092 1092 // if goes here, meant ScsiInquiryCommand() failed. … … 1244 1244 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV 1245 1245 @param SenseData The pointer of EFI_SCSI_SENSE_DATA 1246 @param NumberOfSenseKeys The number of sense key 1246 @param NumberOfSenseKeys The number of sense key 1247 1247 @param Action The pointer of action which indicates what is need to do next 1248 1248 … … 1385 1385 1386 1386 // 1387 // submit Read Capacity(10) Command. If it returns capacity of FFFFFFFFh, 1387 // submit Read Capacity(10) Command. If it returns capacity of FFFFFFFFh, 1388 1388 // 16 byte command should be used to access large hard disk >2TB 1389 1389 // … … 1449 1449 // (EFI_TIMEOUT, EFI_DEVICE_ERROR, EFI_WARN_BUFFER_TOO_SMALL) 1450 1450 // 1451 1451 1452 1452 Status = CheckHostAdapterStatus (HostAdapterStatus); 1453 1453 if ((Status == EFI_TIMEOUT) || (Status == EFI_NOT_READY)) { 1454 1454 *NeedRetry = TRUE; 1455 1455 return EFI_DEVICE_ERROR; 1456 1456 1457 1457 } else if (Status == EFI_DEVICE_ERROR) { 1458 1458 // … … 1477 1477 return EFI_DEVICE_ERROR; 1478 1478 } 1479 1479 1480 1480 // 1481 1481 // if goes here, meant ScsiReadCapacityCommand() failed. … … 1557 1557 1558 1558 @retval EFI_NOT_READY Device is NOT ready. 1559 @retval EFI_DEVICE_ERROR 1559 @retval EFI_DEVICE_ERROR 1560 1560 @retval EFI_SUCCESS 1561 1561 … … 1650 1650 if ((Status == EFI_SUCCESS) || (Status == EFI_WARN_BUFFER_TOO_SMALL)) { 1651 1651 FallStatus = EFI_SUCCESS; 1652 1652 1653 1653 } else if ((Status == EFI_TIMEOUT) || (Status == EFI_NOT_READY)) { 1654 1654 *NeedRetry = TRUE; 1655 1655 FallStatus = EFI_DEVICE_ERROR; 1656 1656 1657 1657 } else if ((Status == EFI_INVALID_PARAMETER) || (Status == EFI_UNSUPPORTED)) { 1658 1658 *NeedRetry = FALSE; 1659 1659 FallStatus = EFI_DEVICE_ERROR; 1660 1660 1661 1661 } else if (Status == EFI_DEVICE_ERROR) { 1662 1662 if (AskResetIfError) { 1663 1663 ScsiDiskDevice->ScsiIo->ResetDevice (ScsiDiskDevice->ScsiIo); 1664 1664 } 1665 1665 1666 1666 FallStatus = EFI_DEVICE_ERROR; 1667 1667 } … … 1685 1685 // skip the loop. 1686 1686 // 1687 if ((PtrSenseData->Sense_Key == EFI_SCSI_SK_NO_SENSE) || 1687 if ((PtrSenseData->Sense_Key == EFI_SCSI_SK_NO_SENSE) || 1688 1688 (*NumberOfSenseKeys == ScsiDiskDevice->SenseDataNumber)) { 1689 1689 SenseReq = FALSE; … … 1719 1719 (Capacity10->LastLba1 << 8) | 1720 1720 Capacity10->LastLba0; 1721 1721 1722 1722 ScsiDiskDevice->BlkIo.Media->BlockSize = (Capacity10->BlockSize3 << 24) | 1723 (Capacity10->BlockSize2 << 16) | 1723 (Capacity10->BlockSize2 << 16) | 1724 1724 (Capacity10->BlockSize1 << 8) | 1725 1725 Capacity10->BlockSize0; … … 1738 1738 1739 1739 ScsiDiskDevice->BlkIo.Media->BlockSize = (Capacity16->BlockSize3 << 24) | 1740 (Capacity16->BlockSize2 << 16) | 1740 (Capacity16->BlockSize2 << 16) | 1741 1741 (Capacity16->BlockSize1 << 8) | 1742 1742 Capacity16->BlockSize0; … … 1801 1801 BlocksRemaining = NumberOfBlocks; 1802 1802 BlockSize = ScsiDiskDevice->BlkIo.Media->BlockSize; 1803 1803 1804 1804 // 1805 1805 // limit the data bytes that can be transferred by one Read(10) or Read(16) Command … … 2025 2025 Lba, 2026 2026 SectorCount 2027 ); 2027 ); 2028 2028 } 2029 2029 if (!EFI_ERROR (Status)) { … … 2695 2695 2696 2696 for (Index = 0; Index < SenseCounts; Index++) { 2697 2697 2698 2698 // 2699 2699 // Sense Key is EFI_SCSI_SK_HARDWARE_ERROR (0x4) … … 2772 2772 2773 2773 for (Index = 0; Index < SenseCounts; Index++) { 2774 2774 2775 2775 // 2776 2776 // Sense Key is EFI_SCSI_SK_UNIT_ATTENTION (0x6) … … 2793 2793 @param SenseData The pointer of EFI_SCSI_SENSE_DATA 2794 2794 @param SenseCounts The number of sense key 2795 @param RetryLater The flag means if need a retry 2795 @param RetryLater The flag means if need a retry 2796 2796 2797 2797 @retval TRUE Drive is ready. … … 2888 2888 2889 2889 for (Index = 0; Index < SenseCounts; Index++) { 2890 2890 2891 2891 // 2892 2892 // Sense Key is SK_NO_SENSE (0x0) … … 2935 2935 /** 2936 2936 Determine if Block Io should be produced. 2937 2937 2938 2938 2939 2939 @param ChildHandle Child Handle to retrieve Parent information. 2940 2940 2941 2941 @retval TRUE Should produce Block Io. 2942 2942 @retval FALSE Should not produce Block Io. 2943 2943 2944 **/ 2944 **/ 2945 2945 BOOLEAN 2946 2946 DetermineInstallBlockIo ( 2947 2947 IN EFI_HANDLE ChildHandle 2948 ) 2948 ) 2949 2949 { 2950 2950 EFI_SCSI_PASS_THRU_PROTOCOL *ScsiPassThru; … … 2972 2972 } 2973 2973 } 2974 2974 2975 2975 return FALSE; 2976 2976 } … … 2981 2981 ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER. 2982 2982 If the ControllerHandle is found, then the protocol specified by ProtocolGuid 2983 will be opened on it. 2984 2983 will be opened on it. 2984 2985 2985 2986 2986 @param ProtocolGuid ProtocolGuid pointer. 2987 2987 @param ChildHandle Child Handle to retrieve Parent information. 2988 2989 **/ 2988 2989 **/ 2990 2990 VOID * 2991 2991 EFIAPI … … 2993 2993 IN EFI_GUID *ProtocolGuid, 2994 2994 IN EFI_HANDLE ChildHandle 2995 ) 2995 ) 2996 2996 { 2997 2997 UINTN Index; 2998 2998 UINTN HandleCount; 2999 VOID *Interface; 2999 VOID *Interface; 3000 3000 EFI_STATUS Status; 3001 3001 EFI_HANDLE *HandleBuffer; … … 3017 3017 3018 3018 // 3019 // Iterate to find who is parent handle that is opened with ProtocolGuid by ChildHandle 3019 // Iterate to find who is parent handle that is opened with ProtocolGuid by ChildHandle 3020 3020 // 3021 3021 for (Index = 0; Index < HandleCount; Index++) { … … 3032 3032 gBS->FreePool (HandleBuffer); 3033 3033 return NULL; 3034 } 3034 } 3035 3035 3036 3036 /** 3037 3037 Provides inquiry information for the controller type. 3038 3038 3039 3039 This function is used by the IDE bus driver to get inquiry data. Data format 3040 3040 of Identify data is defined by the Interface GUID. … … 3045 3045 3046 3046 @retval EFI_SUCCESS The command was accepted without any errors. 3047 @retval EFI_NOT_FOUND Device does not support this data class 3048 @retval EFI_DEVICE_ERROR Error reading InquiryData from device 3049 @retval EFI_BUFFER_TOO_SMALL InquiryDataSize not big enough 3047 @retval EFI_NOT_FOUND Device does not support this data class 3048 @retval EFI_DEVICE_ERROR Error reading InquiryData from device 3049 @retval EFI_BUFFER_TOO_SMALL InquiryDataSize not big enough 3050 3050 3051 3051 **/ … … 3079 3079 of Identify data is defined by the Interface GUID. 3080 3080 3081 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL 3081 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL 3082 3082 instance. 3083 3083 @param[in, out] IdentifyData Pointer to a buffer for the identify data. … … 3086 3086 3087 3087 @retval EFI_SUCCESS The command was accepted without any errors. 3088 @retval EFI_NOT_FOUND Device does not support this data class 3089 @retval EFI_DEVICE_ERROR Error reading IdentifyData from device 3090 @retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough 3088 @retval EFI_NOT_FOUND Device does not support this data class 3089 @retval EFI_DEVICE_ERROR Error reading IdentifyData from device 3090 @retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough 3091 3091 3092 3092 **/ … … 3104 3104 if (CompareGuid (&This->Interface, &gEfiDiskInfoScsiInterfaceGuid) || CompareGuid (&This->Interface, &gEfiDiskInfoUfsInterfaceGuid)) { 3105 3105 // 3106 // Physical SCSI bus does not support this data class. 3106 // Physical SCSI bus does not support this data class. 3107 3107 // 3108 3108 return EFI_NOT_FOUND; … … 3122 3122 /** 3123 3123 Provides sense data information for the controller type. 3124 3125 This function is used by the IDE bus driver to get sense data. 3124 3125 This function is used by the IDE bus driver to get sense data. 3126 3126 Data format of Sense data is defined by the Interface GUID. 3127 3127 … … 3153 3153 This function is used by the IDE bus driver to get controller information. 3154 3154 3155 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance. 3155 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance. 3156 3156 @param[out] IdeChannel Pointer to the Ide Channel number. Primary or secondary. 3157 3157 @param[out] IdeDevice Pointer to the Ide Device number. Master or slave. … … 3194 3194 3195 3195 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV 3196 3196 3197 3197 @retval EFI_SUCCESS The ATAPI device identify data were retrieved successfully. 3198 3198 @retval others Some error occurred during the identification that ATAPI device. 3199 3199 3200 **/ 3200 **/ 3201 3201 EFI_STATUS 3202 3202 AtapiIdentifyDevice ( … … 3234 3234 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV. 3235 3235 @param ChildHandle Child handle to install DiskInfo protocol. 3236 3237 **/ 3236 3237 **/ 3238 3238 VOID 3239 3239 InitializeInstallDiskInfo ( … … 3251 3251 Status = gBS->HandleProtocol (ChildHandle, &gEfiDevicePathProtocolGuid, (VOID **) &DevicePathNode); 3252 3252 // 3253 // Device Path protocol must be installed on the device handle. 3253 // Device Path protocol must be installed on the device handle. 3254 3254 // 3255 3255 ASSERT_EFI_ERROR (Status); … … 3283 3283 ScsiDiskDevice->Device = AtapiDevicePath->SlaveMaster; 3284 3284 // 3285 // Update the DiskInfo.Interface to IDE interface GUID for the physical ATAPI device. 3285 // Update the DiskInfo.Interface to IDE interface GUID for the physical ATAPI device. 3286 3286 // 3287 3287 CopyGuid (&ScsiDiskDevice->DiskInfo.Interface, &gEfiDiskInfoIdeInterfaceGuid); … … 3294 3294 ScsiDiskDevice->Device = SataDevicePath->PortMultiplierPortNumber; 3295 3295 // 3296 // Update the DiskInfo.Interface to AHCI interface GUID for the physical AHCI device. 3296 // Update the DiskInfo.Interface to AHCI interface GUID for the physical AHCI device. 3297 3297 // 3298 3298 CopyGuid (&ScsiDiskDevice->DiskInfo.Interface, &gEfiDiskInfoAhciInterfaceGuid); -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
r58459 r58466 71 71 UINT32 Device; 72 72 ATAPI_IDENTIFY_DATA IdentifyData; 73 73 74 74 // 75 75 // The flag indicates if 16-byte command can be used … … 167 167 calling restrictions. If any other agent wishes to call Stop() it must 168 168 also follow these calling restrictions. 169 169 170 170 @param This Protocol instance pointer. 171 171 @param ControllerHandle Handle of device to stop driver on … … 413 413 /** 414 414 Provides inquiry information for the controller type. 415 415 416 416 This function is used by the IDE bus driver to get inquiry data. Data format 417 417 of Identify data is defined by the Interface GUID. … … 422 422 423 423 @retval EFI_SUCCESS The command was accepted without any errors. 424 @retval EFI_NOT_FOUND Device does not support this data class 425 @retval EFI_DEVICE_ERROR Error reading InquiryData from device 426 @retval EFI_BUFFER_TOO_SMALL InquiryDataSize not big enough 424 @retval EFI_NOT_FOUND Device does not support this data class 425 @retval EFI_DEVICE_ERROR Error reading InquiryData from device 426 @retval EFI_BUFFER_TOO_SMALL InquiryDataSize not big enough 427 427 428 428 **/ … … 442 442 of Identify data is defined by the Interface GUID. 443 443 444 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL 444 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL 445 445 instance. 446 446 @param[in, out] IdentifyData Pointer to a buffer for the identify data. … … 449 449 450 450 @retval EFI_SUCCESS The command was accepted without any errors. 451 @retval EFI_NOT_FOUND Device does not support this data class 452 @retval EFI_DEVICE_ERROR Error reading IdentifyData from device 453 @retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough 451 @retval EFI_NOT_FOUND Device does not support this data class 452 @retval EFI_DEVICE_ERROR Error reading IdentifyData from device 453 @retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough 454 454 455 455 **/ … … 465 465 /** 466 466 Provides sense data information for the controller type. 467 468 This function is used by the IDE bus driver to get sense data. 467 468 This function is used by the IDE bus driver to get sense data. 469 469 Data format of Sense data is defined by the Interface GUID. 470 470 … … 492 492 This function is used by the IDE bus driver to get controller information. 493 493 494 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance. 494 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance. 495 495 @param[out] IdeChannel Pointer to the Ide Channel number. Primary or secondary. 496 496 @param[out] IdeDevice Pointer to the Ide Device number. Master or slave. … … 514 514 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV 515 515 @param MustReadCapacity The flag about reading device capacity 516 @param MediaChange The pointer of flag indicates if media has changed 516 @param MediaChange The pointer of flag indicates if media has changed 517 517 518 518 @retval EFI_DEVICE_ERROR Indicates that error occurs … … 557 557 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV 558 558 @param SenseData The pointer of EFI_SCSI_SENSE_DATA 559 @param NumberOfSenseKeys The number of sense key 559 @param NumberOfSenseKeys The number of sense key 560 560 @param Action The pointer of action which indicates what is need to do next 561 561 … … 616 616 617 617 @retval EFI_NOT_READY Device is NOT ready. 618 @retval EFI_DEVICE_ERROR 618 @retval EFI_DEVICE_ERROR 619 619 @retval EFI_SUCCESS 620 620 … … 790 790 IN UINT32 SectorCount 791 791 ); 792 792 793 793 /** 794 794 Submit Write(16) Command. … … 814 814 IN UINT64 StartLba, 815 815 IN UINT32 SectorCount 816 ); 816 ); 817 817 818 818 /** … … 913 913 @param SenseData The pointer of EFI_SCSI_SENSE_DATA 914 914 @param SenseCounts The number of sense key 915 @param RetryLater The flag means if need a retry 915 @param RetryLater The flag means if need a retry 916 916 917 917 @retval TRUE Drive is ready. … … 955 955 /** 956 956 Determine if Block Io should be produced. 957 957 958 958 959 959 @param ChildHandle Child Handle to retrieve Parent information. 960 960 961 961 @retval TRUE Should produce Block Io. 962 962 @retval FALSE Should not produce Block Io. 963 963 964 **/ 964 **/ 965 965 BOOLEAN 966 966 DetermineInstallBlockIo ( … … 978 978 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV. 979 979 @param ChildHandle Child handle to install DiskInfo protocol. 980 981 **/ 980 981 **/ 982 982 VOID 983 983 InitializeInstallDiskInfo ( 984 984 IN SCSI_DISK_DEV *ScsiDiskDevice, 985 985 IN EFI_HANDLE ChildHandle 986 ); 986 ); 987 987 988 988 /** … … 991 991 ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER. 992 992 If the ControllerHandle is found, then the protocol specified by ProtocolGuid 993 will be opened on it. 994 993 will be opened on it. 994 995 995 996 996 @param ProtocolGuid ProtocolGuid pointer. 997 997 @param ChildHandle Child Handle to retrieve Parent information. 998 999 **/ 998 999 **/ 1000 1000 VOID * 1001 1001 EFIAPI -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
r58459 r58466 2 2 # The Scsi Disk driver is used to retrieve the media info in the attached SCSI disk. 3 3 # It detects the SCSI disk media and installs Block I/O Protocol on the device handle. 4 # 4 # 5 5 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 6 6 # This program and the accompanying materials … … 8 8 # which accompanies this distribution. The full text of the license may be found at 9 9 # http://opensource.org/licenses/bsd-license.php 10 # 10 # 11 11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 13 # 13 # 14 14 ## 15 15
Note:
See TracChangeset
for help on using the changeset viewer.