29#define PVSCSI_BINDING_VERSION 0x10
46 return Dev->PciIo->Mem.Read (
67 return Dev->PciIo->Mem.Write (
89 return Dev->PciIo->Mem.Write (
91 EfiPciIoWidthFifoUint32,
121 IN UINT32 *DescWords OPTIONAL,
127 if (DescWordsCount > PVSCSI_MAX_CMD_DATA_WORDS) {
128 return EFI_INVALID_PARAMETER;
132 if (EFI_ERROR (Status)) {
136 if (DescWordsCount > 0) {
139 PvScsiRegOffsetCommandData,
167 UINT32 ReqNumEntries;
169 RingsState = Dev->RingDesc.RingState;
170 ReqNumEntries = 1U << RingsState->ReqNumEntriesLog2;
171 return (RingsState->ReqProdIdx - RingsState->CmpConsIdx) >= ReqNumEntries;
184 UINT32 ReqNumEntries;
186 RingState = Dev->RingDesc.RingState;
187 ReqNumEntries = 1U << RingState->ReqNumEntriesLog2;
188 return Dev->RingDesc.RingReqs +
189 (RingState->ReqProdIdx & (ReqNumEntries - 1));
202 UINT32 CmpNumEntries;
204 RingState = Dev->RingDesc.RingState;
205 CmpNumEntries = 1U << RingState->CmpNumEntriesLog2;
206 return Dev->RingDesc.RingCmps +
207 (RingState->CmpConsIdx & (CmpNumEntries - 1));
231 if (EFI_ERROR (Status)) {
238 if ((IntrStatus & PVSCSI_INTR_CMPL_MASK) != 0) {
242 gBS->Stall (Dev->WaitForCmpStallInUsecs);
250 PvScsiRegOffsetIntrStatus,
251 PVSCSI_INTR_CMPL_MASK
264 Packet->InTransferLength = 0;
265 Packet->OutTransferLength = 0;
266 Packet->SenseDataLength = 0;
267 Packet->HostAdapterStatus = EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OTHER;
268 Packet->TargetStatus = EFI_EXT_SCSI_STATUS_TARGET_GOOD;
269 return EFI_DEVICE_ERROR;
281 Packet->SenseDataLength = 0;
282 Packet->HostAdapterStatus =
283 EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN;
284 Packet->TargetStatus = EFI_EXT_SCSI_STATUS_TARGET_GOOD;
285 return EFI_BAD_BUFFER_SIZE;
307 TargetValue = *Target;
316 ((Packet->InTransferLength > 0) && (Packet->OutTransferLength > 0)) ||
317 (Packet->DataDirection == EFI_EXT_SCSI_DATA_DIRECTION_BIDIRECTIONAL) ||
322 (Packet->CdbLength > PVSCSI_CDB_MAX_SIZE)
328 return EFI_UNSUPPORTED;
338 (TargetValue > Dev->MaxTarget) || (Lun > Dev->MaxLun) ||
343 (Packet->DataDirection > EFI_EXT_SCSI_DATA_DIRECTION_BIDIRECTIONAL) ||
348 ((Packet->InTransferLength > 0) &&
349 ((Packet->InDataBuffer ==
NULL) ||
350 (Packet->DataDirection == EFI_EXT_SCSI_DATA_DIRECTION_WRITE)
357 ((Packet->OutTransferLength > 0) &&
358 ((Packet->OutDataBuffer ==
NULL) ||
359 (Packet->DataDirection == EFI_EXT_SCSI_DATA_DIRECTION_READ)
367 return EFI_INVALID_PARAMETER;
373 if (Packet->InTransferLength > sizeof (Dev->DmaBuf->Data)) {
374 Packet->InTransferLength =
sizeof (Dev->DmaBuf->Data);
378 if (Packet->OutTransferLength > sizeof (Dev->DmaBuf->Data)) {
379 Packet->OutTransferLength =
sizeof (Dev->DmaBuf->Data);
386 ZeroMem (Request,
sizeof (*Request));
389 Request->Target = TargetValue;
393 Request->Lun[1] = (UINT8)Lun;
394 Request->SenseLen = Packet->SenseDataLength;
399 Request->SenseAddr = PVSCSI_DMA_BUF_DEV_ADDR (Dev, SenseData);
400 Request->CdbLen = Packet->CdbLength;
401 CopyMem (Request->Cdb, Packet->Cdb, Packet->CdbLength);
402 Request->VcpuHint = 0;
403 Request->Tag = PVSCSI_SIMPLE_QUEUE_TAG;
404 if (Packet->DataDirection == EFI_EXT_SCSI_DATA_DIRECTION_READ) {
405 Request->Flags = PVSCSI_FLAG_CMD_DIR_TOHOST;
406 Request->DataLen = Packet->InTransferLength;
408 Request->Flags = PVSCSI_FLAG_CMD_DIR_TODEVICE;
409 Request->DataLen = Packet->OutTransferLength;
412 Packet->OutDataBuffer,
413 Packet->OutTransferLength
417 Request->DataAddr = PVSCSI_DMA_BUF_DEV_ADDR (Dev, Data);
439 if (Packet->SenseDataLength > Response->SenseLen) {
440 Packet->SenseDataLength = (UINT8)Response->SenseLen;
448 Dev->DmaBuf->SenseData,
449 Packet->SenseDataLength
455 if (Packet->DataDirection == EFI_EXT_SCSI_DATA_DIRECTION_READ) {
456 CopyMem (Packet->InDataBuffer, Dev->DmaBuf->Data, Packet->InTransferLength);
465 ASSERT (Response->ScsiStatus <= MAX_UINT8);
466 Packet->TargetStatus = (UINT8)Response->ScsiStatus;
472 switch (Response->HostStatus) {
473 case PvScsiBtStatSuccess:
474 case PvScsiBtStatLinkedCommandCompleted:
475 case PvScsiBtStatLinkedCommandCompletedWithFlag:
476 Packet->HostAdapterStatus = EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OK;
479 case PvScsiBtStatDataUnderrun:
483 if (Packet->DataDirection == EFI_EXT_SCSI_DATA_DIRECTION_READ) {
484 Packet->InTransferLength = (UINT32)Response->DataLen;
486 Packet->OutTransferLength = (UINT32)Response->DataLen;
489 Packet->HostAdapterStatus =
490 EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN;
493 case PvScsiBtStatDatarun:
494 Packet->HostAdapterStatus =
495 EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN;
498 case PvScsiBtStatSelTimeout:
499 Packet->HostAdapterStatus =
500 EFI_EXT_SCSI_STATUS_HOST_ADAPTER_SELECTION_TIMEOUT;
503 case PvScsiBtStatBusFree:
504 Packet->HostAdapterStatus = EFI_EXT_SCSI_STATUS_HOST_ADAPTER_BUS_FREE;
507 case PvScsiBtStatInvPhase:
508 Packet->HostAdapterStatus = EFI_EXT_SCSI_STATUS_HOST_ADAPTER_PHASE_ERROR;
511 case PvScsiBtStatSensFailed:
512 Packet->HostAdapterStatus =
513 EFI_EXT_SCSI_STATUS_HOST_ADAPTER_REQUEST_SENSE_FAILED;
516 case PvScsiBtStatTagReject:
517 case PvScsiBtStatBadMsg:
518 Packet->HostAdapterStatus =
519 EFI_EXT_SCSI_STATUS_HOST_ADAPTER_MESSAGE_REJECT;
522 case PvScsiBtStatBusReset:
523 Packet->HostAdapterStatus = EFI_EXT_SCSI_STATUS_HOST_ADAPTER_BUS_RESET;
526 case PvScsiBtStatHaTimeout:
527 Packet->HostAdapterStatus = EFI_EXT_SCSI_STATUS_HOST_ADAPTER_TIMEOUT;
530 case PvScsiBtStatScsiParity:
531 Packet->HostAdapterStatus = EFI_EXT_SCSI_STATUS_HOST_ADAPTER_PARITY_ERROR;
535 Packet->HostAdapterStatus = EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OTHER;
539 return EFI_DEVICE_ERROR;
554 for (Idx = 0; Idx < TARGET_MAX_BYTES; ++Idx) {
555 if (Target[Idx] != 0xFF) {
583 Dev = PVSCSI_FROM_PASS_THRU (This);
586 return EFI_NOT_READY;
592 if (EFI_ERROR (Status)) {
601 Dev->RingDesc.RingState->ReqProdIdx++;
604 if (EFI_ERROR (Status)) {
614 if (EFI_ERROR (Status)) {
631 Dev->RingDesc.RingState->CmpConsIdx++;
639PvScsiGetNextTargetLun (
641 IN OUT UINT8 **Target,
649 if (Target ==
NULL) {
650 return EFI_INVALID_PARAMETER;
662 ZeroMem (TargetPtr, TARGET_MAX_BYTES);
670 LastTarget = *TargetPtr;
675 Dev = PVSCSI_FROM_PASS_THRU (This);
676 if ((LastTarget > Dev->MaxTarget) || (*Lun > Dev->MaxLun)) {
677 return EFI_INVALID_PARAMETER;
680 if (*Lun < Dev->MaxLun) {
685 if (LastTarget < Dev->MaxTarget) {
688 *TargetPtr = LastTarget;
692 return EFI_NOT_FOUND;
698PvScsiBuildDevicePath (
709 if (DevicePath ==
NULL) {
710 return EFI_INVALID_PARAMETER;
716 TargetValue = *Target;
718 Dev = PVSCSI_FROM_PASS_THRU (This);
719 if ((TargetValue > Dev->MaxTarget) || (Lun > Dev->MaxLun)) {
720 return EFI_NOT_FOUND;
723 ScsiDevicePath =
AllocatePool (
sizeof (*ScsiDevicePath));
724 if (ScsiDevicePath ==
NULL) {
725 return EFI_OUT_OF_RESOURCES;
730 ScsiDevicePath->Header.
Length[0] = (UINT8)
sizeof (*ScsiDevicePath);
731 ScsiDevicePath->Header.
Length[1] = (UINT8)(
sizeof (*ScsiDevicePath) >> 8);
732 ScsiDevicePath->
Pun = TargetValue;
733 ScsiDevicePath->
Lun = (UINT16)Lun;
735 *DevicePath = &ScsiDevicePath->Header;
752 if ((DevicePath ==
NULL) || (Target ==
NULL) || (*Target ==
NULL) || (Lun ==
NULL)) {
753 return EFI_INVALID_PARAMETER;
759 return EFI_UNSUPPORTED;
763 Dev = PVSCSI_FROM_PASS_THRU (This);
764 if ((ScsiDevicePath->
Pun > Dev->MaxTarget) ||
765 (ScsiDevicePath->
Lun > Dev->MaxLun))
767 return EFI_NOT_FOUND;
773 **Target = (UINT8)ScsiDevicePath->
Pun;
774 ZeroMem (*Target + 1, TARGET_MAX_BYTES - 1);
775 *Lun = ScsiDevicePath->
Lun;
787 return EFI_UNSUPPORTED;
793PvScsiResetTargetLun (
799 return EFI_UNSUPPORTED;
807 IN OUT UINT8 **Target
814 if (Target ==
NULL) {
815 return EFI_INVALID_PARAMETER;
827 ZeroMem (TargetPtr, TARGET_MAX_BYTES);
834 LastTarget = *TargetPtr;
839 Dev = PVSCSI_FROM_PASS_THRU (This);
840 if (LastTarget > Dev->MaxTarget) {
841 return EFI_INVALID_PARAMETER;
844 if (LastTarget < Dev->MaxTarget) {
846 *TargetPtr = LastTarget;
850 return EFI_NOT_FOUND;
855PvScsiSetPciAttributes (
864 Status = Dev->PciIo->Attributes (
868 &Dev->OriginalPciAttributes
870 if (EFI_ERROR (Status)) {
877 Status = Dev->PciIo->Attributes (
884 if (EFI_ERROR (Status)) {
891 Status = Dev->PciIo->Attributes (
897 if (EFI_ERROR (Status)) {
906 "%a: failed to enable 64-bit DMA addresses\n",
916PvScsiRestorePciAttributes (
920 Dev->PciIo->Attributes (
923 Dev->OriginalPciAttributes,
930PvScsiAllocateSharedPages (
933 OUT VOID **HostAddress,
940 Status = Dev->PciIo->AllocateBuffer (
946 EFI_PCI_ATTRIBUTE_MEMORY_CACHED
948 if (EFI_ERROR (Status)) {
953 Status = Dev->PciIo->Map (
958 &DmaDesc->DeviceAddress,
961 if (EFI_ERROR (Status)) {
966 Status = EFI_OUT_OF_RESOURCES;
973 Dev->PciIo->Unmap (Dev->PciIo, DmaDesc->Mapping);
976 Dev->PciIo->FreeBuffer (Dev->PciIo, Pages, *HostAddress);
983PvScsiFreeSharedPages (
986 IN VOID *HostAddress,
990 Dev->PciIo->Unmap (Dev->PciIo, DmaDesc->Mapping);
991 Dev->PciIo->FreeBuffer (Dev->PciIo, Pages, HostAddress);
1002 Status = PvScsiAllocateSharedPages (
1005 (VOID **)&Dev->RingDesc.RingState,
1006 &Dev->RingDesc.RingStateDmaDesc
1008 if (EFI_ERROR (Status)) {
1012 ZeroMem (Dev->RingDesc.RingState, EFI_PAGE_SIZE);
1014 Status = PvScsiAllocateSharedPages (
1017 (VOID **)&Dev->RingDesc.RingReqs,
1018 &Dev->RingDesc.RingReqsDmaDesc
1020 if (EFI_ERROR (Status)) {
1024 ZeroMem (Dev->RingDesc.RingReqs, EFI_PAGE_SIZE);
1026 Status = PvScsiAllocateSharedPages (
1029 (VOID **)&Dev->RingDesc.RingCmps,
1030 &Dev->RingDesc.RingCmpsDmaDesc
1032 if (EFI_ERROR (Status)) {
1036 ZeroMem (Dev->RingDesc.RingCmps, EFI_PAGE_SIZE);
1041 PvScsiFreeSharedPages (
1044 Dev->RingDesc.RingReqs,
1045 &Dev->RingDesc.RingReqsDmaDesc
1049 PvScsiFreeSharedPages (
1052 Dev->RingDesc.RingState,
1053 &Dev->RingDesc.RingStateDmaDesc
1065 PvScsiFreeSharedPages (
1068 Dev->RingDesc.RingCmps,
1069 &Dev->RingDesc.RingCmpsDmaDesc
1072 PvScsiFreeSharedPages (
1075 Dev->RingDesc.RingReqs,
1076 &Dev->RingDesc.RingReqsDmaDesc
1079 PvScsiFreeSharedPages (
1082 Dev->RingDesc.RingState,
1083 &Dev->RingDesc.RingStateDmaDesc
1099 Cmd = &AlignedCmd.Cmd;
1102 Cmd->ReqRingNumPages = 1;
1103 Cmd->CmpRingNumPages = 1;
1105 Dev->RingDesc.RingStateDmaDesc.DeviceAddress,
1109 Dev->RingDesc.RingReqsDmaDesc.DeviceAddress,
1113 Dev->RingDesc.RingCmpsDmaDesc.DeviceAddress,
1118 sizeof (*Cmd) %
sizeof (UINT32) == 0,
1119 "Cmd must be multiple of 32-bit words"
1123 PvScsiCmdSetupRings,
1125 sizeof (*Cmd) /
sizeof (UINT32)
1140 Dev->MaxTarget =
PcdGet8 (PcdPvScsiMaxTargetLimit);
1141 Dev->MaxLun =
PcdGet8 (PcdPvScsiMaxLunLimit);
1142 Dev->WaitForCmpStallInUsecs =
PcdGet32 (PcdPvScsiWaitForCmpStallInUsecs);
1147 Status = PvScsiSetPciAttributes (Dev);
1148 if (EFI_ERROR (Status)) {
1155 Status = PvScsiResetAdapter (Dev);
1156 if (EFI_ERROR (Status)) {
1157 goto RestorePciAttributes;
1163 Status = PvScsiInitRings (Dev);
1164 if (EFI_ERROR (Status)) {
1165 goto RestorePciAttributes;
1171 Status = PvScsiAllocateSharedPages (
1174 (VOID **)&Dev->DmaBuf,
1177 if (EFI_ERROR (Status)) {
1184 Status = PvScsiSetupRings (Dev);
1185 if (EFI_ERROR (Status)) {
1186 goto FreeDmaCommBuffer;
1192 Dev->PassThru.Mode = &Dev->PassThruMode;
1193 Dev->PassThru.PassThru = &PvScsiPassThru;
1194 Dev->PassThru.GetNextTargetLun = &PvScsiGetNextTargetLun;
1195 Dev->PassThru.BuildDevicePath = &PvScsiBuildDevicePath;
1196 Dev->PassThru.GetTargetLun = &PvScsiGetTargetLun;
1197 Dev->PassThru.ResetChannel = &PvScsiResetChannel;
1198 Dev->PassThru.ResetTargetLun = &PvScsiResetTargetLun;
1199 Dev->PassThru.GetNextTarget = &PvScsiGetNextTarget;
1205 Dev->PassThruMode.AdapterId = MAX_UINT32;
1210 Dev->PassThruMode.Attributes = EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_PHYSICAL |
1211 EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_LOGICAL;
1216 Dev->PassThruMode.IoAlign = 0;
1221 PvScsiFreeSharedPages (
1229 PvScsiFreeRings (Dev);
1231RestorePciAttributes:
1232 PvScsiRestorePciAttributes (Dev);
1251 PvScsiResetAdapter (Dev);
1256 PvScsiFreeSharedPages (
1263 PvScsiFreeRings (Dev);
1265 PvScsiRestorePciAttributes (Dev);
1282 DEBUG ((DEBUG_VERBOSE,
"%a: Context=0x%p\n", __func__, Context));
1290 PvScsiResetAdapter (Dev);
1300PvScsiDriverBindingSupported (
1310 Status =
gBS->OpenProtocol (
1312 &gEfiPciIoProtocolGuid,
1314 This->DriverBindingHandle,
1316 EFI_OPEN_PROTOCOL_BY_DRIVER
1318 if (EFI_ERROR (Status)) {
1322 Status = PciIo->Pci.Read (
1324 EfiPciIoWidthUint32,
1326 sizeof (Pci) /
sizeof (UINT32),
1329 if (EFI_ERROR (Status)) {
1333 if ((Pci.Hdr.VendorId != PCI_VENDOR_ID_VMWARE) ||
1334 (Pci.Hdr.DeviceId != PCI_DEVICE_ID_VMWARE_PVSCSI))
1336 Status = EFI_UNSUPPORTED;
1343 gBS->CloseProtocol (
1345 &gEfiPciIoProtocolGuid,
1346 This->DriverBindingHandle,
1356PvScsiDriverBindingStart (
1367 return EFI_OUT_OF_RESOURCES;
1370 Status =
gBS->OpenProtocol (
1372 &gEfiPciIoProtocolGuid,
1373 (VOID **)&Dev->PciIo,
1374 This->DriverBindingHandle,
1376 EFI_OPEN_PROTOCOL_BY_DRIVER
1378 if (EFI_ERROR (Status)) {
1382 Status = PvScsiInit (Dev);
1383 if (EFI_ERROR (Status)) {
1387 Status =
gBS->CreateEvent (
1388 EVT_SIGNAL_EXIT_BOOT_SERVICES,
1394 if (EFI_ERROR (Status)) {
1401 Dev->Signature = PVSCSI_SIG;
1402 Status =
gBS->InstallProtocolInterface (
1404 &gEfiExtScsiPassThruProtocolGuid,
1408 if (EFI_ERROR (Status)) {
1415 gBS->CloseEvent (Dev->ExitBoot);
1421 gBS->CloseProtocol (
1423 &gEfiPciIoProtocolGuid,
1424 This->DriverBindingHandle,
1437PvScsiDriverBindingStop (
1448 Status =
gBS->OpenProtocol (
1450 &gEfiExtScsiPassThruProtocolGuid,
1452 This->DriverBindingHandle,
1454 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1456 if (EFI_ERROR (Status)) {
1460 Dev = PVSCSI_FROM_PASS_THRU (PassThru);
1462 Status =
gBS->UninstallProtocolInterface (
1464 &gEfiExtScsiPassThruProtocolGuid,
1467 if (EFI_ERROR (Status)) {
1471 gBS->CloseEvent (Dev->ExitBoot);
1475 gBS->CloseProtocol (
1477 &gEfiPciIoProtocolGuid,
1478 This->DriverBindingHandle,
1488 &PvScsiDriverBindingSupported,
1489 &PvScsiDriverBindingStart,
1490 &PvScsiDriverBindingStop,
1491 PVSCSI_BINDING_VERSION,
1501 {
"eng;en", L
"PVSCSI Host Driver" },
1510PvScsiGetDriverName (
1513 OUT CHAR16 **DriverName
1518 This->SupportedLanguages,
1521 (BOOLEAN)(This == &mComponentName)
1528PvScsiGetDeviceName (
1533 OUT CHAR16 **ControllerName
1536 return EFI_UNSUPPORTED;
1540 &PvScsiGetDriverName,
1541 &PvScsiGetDeviceName,
1565 &mPvScsiDriverBinding,
VOID EFIAPI MemoryFence(VOID)
UINT64 EFIAPI RShiftU64(IN UINT64 Operand, IN UINTN Count)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_STATUS(EFIAPI * EFI_COMPONENT_NAME2_GET_DRIVER_NAME)(IN EFI_COMPONENT_NAME2_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
EFI_STATUS(EFIAPI * EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)(IN EFI_COMPONENT_NAME2_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle OPTIONAL, IN CHAR8 *Language, OUT CHAR16 **ControllerName)
#define MESSAGING_DEVICE_PATH
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define DEBUG(Expression)
#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE
Clear for PCI controllers that can not genrate a DAC.
@ EfiPciIoAttributeOperationGet
@ EfiPciIoAttributeOperationEnable
@ EfiPciIoAttributeOperationSet
#define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER
Enable the DMA bit in the PCI Config Header.
@ EfiPciIoOperationBusMasterCommonBuffer
#define EFI_PCI_IO_ATTRIBUTE_MEMORY
Enable the Memory decode bit in the PCI Config Header.
#define PcdGet8(TokenName)
#define PcdGet32(TokenName)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
STATIC VOID EFIAPI PvScsiExitBoot(IN EFI_EVENT Event, IN VOID *Context)
STATIC PVSCSI_RING_CMP_DESC * PvScsiGetCurrentResponse(IN CONST PVSCSI_DEV *Dev)
STATIC PVSCSI_RING_REQ_DESC * PvScsiGetCurrentRequest(IN CONST PVSCSI_DEV *Dev)
STATIC EFI_STATUS PvScsiMmioRead32(IN CONST PVSCSI_DEV *Dev, IN UINT64 Offset, OUT UINT32 *Value)
STATIC EFI_STATUS PopulateRequest(IN CONST PVSCSI_DEV *Dev, IN UINT8 *Target, IN UINT64 Lun, IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet, OUT PVSCSI_RING_REQ_DESC *Request)
STATIC BOOLEAN PvScsiIsReqRingFull(IN CONST PVSCSI_DEV *Dev)
STATIC EFI_STATUS HandleResponse(IN PVSCSI_DEV *Dev, IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet, IN CONST PVSCSI_RING_CMP_DESC *Response)
STATIC EFI_STATUS ReportHostAdapterError(OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet)
STATIC EFI_STATUS PvScsiWaitForRequestCompletion(IN CONST PVSCSI_DEV *Dev)
STATIC EFI_STATUS PvScsiWriteCmdDesc(IN CONST PVSCSI_DEV *Dev, IN UINT32 Cmd, IN UINT32 *DescWords OPTIONAL, IN UINTN DescWordsCount)
STATIC EFI_STATUS PvScsiMmioWrite32(IN CONST PVSCSI_DEV *Dev, IN UINT64 Offset, IN UINT32 Value)
STATIC EFI_STATUS PvScsiMmioWrite32Multiple(IN CONST PVSCSI_DEV *Dev, IN UINT64 Offset, IN UINTN Count, IN UINT32 *Words)
STATIC BOOLEAN IsTargetInitialized(IN UINT8 *Target)
STATIC EFI_STATUS ReportHostAdapterOverrunError(OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet)
#define EFI_PAGES_TO_SIZE(Pages)
#define EFI_SIZE_TO_PAGES(Size)
EFI_STATUS EFIAPI LookupUnicodeString2(IN CONST CHAR8 *Language, IN CONST CHAR8 *SupportedLanguages, IN CONST EFI_UNICODE_STRING_TABLE *UnicodeStringTable, OUT CHAR16 **UnicodeString, IN BOOLEAN Iso639Language)
EFI_STATUS EFIAPI EfiLibInstallDriverBindingComponentName2(IN CONST EFI_HANDLE ImageHandle, IN CONST EFI_SYSTEM_TABLE *SystemTable, IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE DriverBindingHandle, IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL)