40 Private = Device->Controller;
41 BlockSize = Device->Media.BlockSize;
42 Bytes = Blocks * BlockSize;
48 CommandPacket.NvmeCmd = &Command;
49 CommandPacket.NvmeCompletion = &Completion;
51 CommandPacket.NvmeCmd->Cdw0.Opcode = NVME_IO_READ_OPC;
52 CommandPacket.NvmeCmd->Nsid = Device->NamespaceId;
53 CommandPacket.TransferBuffer = (VOID *)(
UINTN)Buffer;
55 CommandPacket.TransferLength = Bytes;
56 CommandPacket.CommandTimeout = NVME_GENERIC_TIMEOUT;
57 CommandPacket.QueueType = NVME_IO_QUEUE;
59 CommandPacket.NvmeCmd->Cdw10 = (UINT32)Lba;
60 CommandPacket.NvmeCmd->Cdw11 = (UINT32)
RShiftU64 (Lba, 32);
61 CommandPacket.NvmeCmd->Cdw12 = (Blocks - 1) & 0xFFFF;
63 CommandPacket.NvmeCmd->Flags = CDW10_VALID | CDW11_VALID | CDW12_VALID;
65 Status = Private->Passthru.PassThru (
103 Private = Device->Controller;
104 BlockSize = Device->Media.BlockSize;
105 Bytes = Blocks * BlockSize;
111 CommandPacket.NvmeCmd = &Command;
112 CommandPacket.NvmeCompletion = &Completion;
114 CommandPacket.NvmeCmd->Cdw0.Opcode = NVME_IO_WRITE_OPC;
115 CommandPacket.NvmeCmd->Nsid = Device->NamespaceId;
116 CommandPacket.TransferBuffer = (VOID *)(
UINTN)Buffer;
118 CommandPacket.TransferLength = Bytes;
119 CommandPacket.CommandTimeout = NVME_GENERIC_TIMEOUT;
120 CommandPacket.QueueType = NVME_IO_QUEUE;
122 CommandPacket.NvmeCmd->Cdw10 = (UINT32)Lba;
123 CommandPacket.NvmeCmd->Cdw11 = (UINT32)
RShiftU64 (Lba, 32);
127 CommandPacket.NvmeCmd->Cdw12 = ((Blocks - 1) & 0xFFFF) | BIT30;
129 CommandPacket.MetadataBuffer =
NULL;
130 CommandPacket.MetadataLength = 0;
132 CommandPacket.NvmeCmd->Flags = CDW10_VALID | CDW11_VALID | CDW12_VALID;
134 Status = Private->Passthru.PassThru (
167 UINT32 MaxTransferBlocks;
176 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
178 gBS->RestoreTPL (OldTpl);
188 Private = Device->Controller;
189 BlockSize = Device->Media.BlockSize;
190 OrginalBlocks = Blocks;
192 if (Private->ControllerData->Mdts != 0) {
193 MaxTransferBlocks = (1 << (Private->ControllerData->Mdts)) * (1 << (Private->Cap.Mpsmin + 12)) / BlockSize;
195 MaxTransferBlocks = 1024;
199 if (Blocks > MaxTransferBlocks) {
200 Status =
ReadSectors (Device, (UINT64)(
UINTN)Buffer, Lba, MaxTransferBlocks);
202 Blocks -= MaxTransferBlocks;
203 Buffer = (VOID *)(
UINTN)((UINT64)(
UINTN)Buffer + MaxTransferBlocks * BlockSize);
204 Lba += MaxTransferBlocks;
210 if (EFI_ERROR (Status)) {
217 "%a: Lba = 0x%08Lx, Original = 0x%08Lx, "
218 "Remaining = 0x%08Lx, BlockSize = 0x%x, Status = %r\n",
221 (UINT64)OrginalBlocks,
253 UINT32 MaxTransferBlocks;
262 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
264 gBS->RestoreTPL (OldTpl);
274 Private = Device->Controller;
275 BlockSize = Device->Media.BlockSize;
276 OrginalBlocks = Blocks;
278 if (Private->ControllerData->Mdts != 0) {
279 MaxTransferBlocks = (1 << (Private->ControllerData->Mdts)) * (1 << (Private->Cap.Mpsmin + 12)) / BlockSize;
281 MaxTransferBlocks = 1024;
285 if (Blocks > MaxTransferBlocks) {
288 Blocks -= MaxTransferBlocks;
289 Buffer = (VOID *)(
UINTN)((UINT64)(
UINTN)Buffer + MaxTransferBlocks * BlockSize);
290 Lba += MaxTransferBlocks;
296 if (EFI_ERROR (Status)) {
303 "%a: Lba = 0x%08Lx, Original = 0x%08Lx, "
304 "Remaining = 0x%08Lx, BlockSize = 0x%x, Status = %r\n",
307 (UINT64)OrginalBlocks,
336 Private = Device->Controller;
342 CommandPacket.NvmeCmd = &Command;
343 CommandPacket.NvmeCompletion = &Completion;
345 CommandPacket.NvmeCmd->Cdw0.Opcode = NVME_IO_FLUSH_OPC;
346 CommandPacket.NvmeCmd->Nsid = Device->NamespaceId;
347 CommandPacket.CommandTimeout = NVME_GENERIC_TIMEOUT;
348 CommandPacket.QueueType = NVME_IO_QUEUE;
350 Status = Private->Passthru.PassThru (
380 gBS->CloseEvent (Event);
383 Completion = (
NVME_CQ *)Subtask->CommandPacket->NvmeCompletion;
384 Request = Subtask->BlockIo2Request;
385 Token = Request->Token;
392 if ((Completion->Sct != 0) || (Completion->Sc != 0)) {
409 if (
IsListEmpty (&Request->SubtasksQueue) && Request->LastSubtaskSubmitted) {
418 FreePool (Subtask->CommandPacket->NvmeCmd);
419 FreePool (Subtask->CommandPacket->NvmeCompletion);
459 Private = Device->Controller;
460 BlockSize = Device->Media.BlockSize;
461 Bytes = Blocks * BlockSize;
462 CommandPacket =
NULL;
467 if (Subtask ==
NULL) {
468 Status = EFI_OUT_OF_RESOURCES;
472 Subtask->Signature = NVME_BLKIO2_SUBTASK_SIGNATURE;
473 Subtask->IsLast = IsLast;
474 Subtask->NamespaceId = Device->NamespaceId;
475 Subtask->BlockIo2Request = Request;
478 if (CommandPacket ==
NULL) {
479 Status = EFI_OUT_OF_RESOURCES;
482 Subtask->CommandPacket = CommandPacket;
486 if (Command ==
NULL) {
487 Status = EFI_OUT_OF_RESOURCES;
492 if (Completion ==
NULL) {
493 Status = EFI_OUT_OF_RESOURCES;
500 Status =
gBS->CreateEvent (
507 if (EFI_ERROR (Status)) {
511 CommandPacket->NvmeCmd = Command;
512 CommandPacket->NvmeCompletion = Completion;
514 CommandPacket->NvmeCmd->Cdw0.Opcode = NVME_IO_READ_OPC;
515 CommandPacket->NvmeCmd->Nsid = Device->NamespaceId;
516 CommandPacket->TransferBuffer = (VOID *)(
UINTN)Buffer;
518 CommandPacket->TransferLength = Bytes;
519 CommandPacket->CommandTimeout = NVME_GENERIC_TIMEOUT;
520 CommandPacket->QueueType = NVME_IO_QUEUE;
522 CommandPacket->NvmeCmd->Cdw10 = (UINT32)Lba;
523 CommandPacket->NvmeCmd->Cdw11 = (UINT32)
RShiftU64 (Lba, 32);
524 CommandPacket->NvmeCmd->Cdw12 = (Blocks - 1) & 0xFFFF;
526 CommandPacket->NvmeCmd->Flags = CDW10_VALID | CDW11_VALID | CDW12_VALID;
528 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
530 Request->UnsubmittedSubtaskNum++;
531 gBS->RestoreTPL (OldTpl);
539 if (Completion !=
NULL) {
543 if (Command !=
NULL) {
547 if (CommandPacket !=
NULL) {
551 if (Subtask !=
NULL) {
552 if (Subtask->Event !=
NULL) {
553 gBS->CloseEvent (Subtask->Event);
598 Private = Device->Controller;
599 BlockSize = Device->Media.BlockSize;
600 Bytes = Blocks * BlockSize;
601 CommandPacket =
NULL;
606 if (Subtask ==
NULL) {
607 Status = EFI_OUT_OF_RESOURCES;
611 Subtask->Signature = NVME_BLKIO2_SUBTASK_SIGNATURE;
612 Subtask->IsLast = IsLast;
613 Subtask->NamespaceId = Device->NamespaceId;
614 Subtask->BlockIo2Request = Request;
617 if (CommandPacket ==
NULL) {
618 Status = EFI_OUT_OF_RESOURCES;
621 Subtask->CommandPacket = CommandPacket;
625 if (Command ==
NULL) {
626 Status = EFI_OUT_OF_RESOURCES;
631 if (Completion ==
NULL) {
632 Status = EFI_OUT_OF_RESOURCES;
639 Status =
gBS->CreateEvent (
646 if (EFI_ERROR (Status)) {
650 CommandPacket->NvmeCmd = Command;
651 CommandPacket->NvmeCompletion = Completion;
653 CommandPacket->NvmeCmd->Cdw0.Opcode = NVME_IO_WRITE_OPC;
654 CommandPacket->NvmeCmd->Nsid = Device->NamespaceId;
655 CommandPacket->TransferBuffer = (VOID *)(
UINTN)Buffer;
657 CommandPacket->TransferLength = Bytes;
658 CommandPacket->CommandTimeout = NVME_GENERIC_TIMEOUT;
659 CommandPacket->QueueType = NVME_IO_QUEUE;
661 CommandPacket->NvmeCmd->Cdw10 = (UINT32)Lba;
662 CommandPacket->NvmeCmd->Cdw11 = (UINT32)
RShiftU64 (Lba, 32);
666 CommandPacket->NvmeCmd->Cdw12 = ((Blocks - 1) & 0xFFFF) | BIT30;
668 CommandPacket->NvmeCmd->Flags = CDW10_VALID | CDW11_VALID | CDW12_VALID;
670 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
672 Request->UnsubmittedSubtaskNum++;
673 gBS->RestoreTPL (OldTpl);
681 if (Completion !=
NULL) {
685 if (Command !=
NULL) {
689 if (CommandPacket !=
NULL) {
693 if (Subtask !=
NULL) {
694 if (Subtask->Event !=
NULL) {
695 gBS->CloseEvent (Subtask->Event);
731 UINT32 MaxTransferBlocks;
737 Private = Device->Controller;
738 BlockSize = Device->Media.BlockSize;
739 OrginalBlocks = Blocks;
741 if (BlkIo2Req ==
NULL) {
742 return EFI_OUT_OF_RESOURCES;
745 BlkIo2Req->Signature = NVME_BLKIO2_REQUEST_SIGNATURE;
746 BlkIo2Req->Token = Token;
748 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
750 gBS->RestoreTPL (OldTpl);
754 if (Private->ControllerData->Mdts != 0) {
755 MaxTransferBlocks = (1 << (Private->ControllerData->Mdts)) * (1 << (Private->Cap.Mpsmin + 12)) / BlockSize;
757 MaxTransferBlocks = 1024;
761 if (Blocks > MaxTransferBlocks) {
765 (UINT64)(
UINTN)Buffer,
771 Blocks -= MaxTransferBlocks;
772 Buffer = (VOID *)(
UINTN)((UINT64)(
UINTN)Buffer + MaxTransferBlocks * BlockSize);
773 Lba += MaxTransferBlocks;
778 (UINT64)(
UINTN)Buffer,
787 if (EFI_ERROR (Status)) {
788 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
789 IsEmpty =
IsListEmpty (&BlkIo2Req->SubtasksQueue) &&
790 (BlkIo2Req->UnsubmittedSubtaskNum == 0);
798 Status = EFI_DEVICE_ERROR;
806 Token->TransactionStatus = EFI_DEVICE_ERROR;
807 BlkIo2Req->LastSubtaskSubmitted =
TRUE;
810 gBS->RestoreTPL (OldTpl);
818 "%a: Lba = 0x%08Lx, Original = 0x%08Lx, "
819 "Remaining = 0x%08Lx, BlockSize = 0x%x, Status = %r\n",
822 (UINT64)OrginalBlocks,
859 UINT32 MaxTransferBlocks;
865 Private = Device->Controller;
866 BlockSize = Device->Media.BlockSize;
867 OrginalBlocks = Blocks;
869 if (BlkIo2Req ==
NULL) {
870 return EFI_OUT_OF_RESOURCES;
873 BlkIo2Req->Signature = NVME_BLKIO2_REQUEST_SIGNATURE;
874 BlkIo2Req->Token = Token;
876 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
878 gBS->RestoreTPL (OldTpl);
882 if (Private->ControllerData->Mdts != 0) {
883 MaxTransferBlocks = (1 << (Private->ControllerData->Mdts)) * (1 << (Private->Cap.Mpsmin + 12)) / BlockSize;
885 MaxTransferBlocks = 1024;
889 if (Blocks > MaxTransferBlocks) {
893 (UINT64)(
UINTN)Buffer,
899 Blocks -= MaxTransferBlocks;
900 Buffer = (VOID *)(
UINTN)((UINT64)(
UINTN)Buffer + MaxTransferBlocks * BlockSize);
901 Lba += MaxTransferBlocks;
906 (UINT64)(
UINTN)Buffer,
915 if (EFI_ERROR (Status)) {
916 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
917 IsEmpty =
IsListEmpty (&BlkIo2Req->SubtasksQueue) &&
918 (BlkIo2Req->UnsubmittedSubtaskNum == 0);
926 Status = EFI_DEVICE_ERROR;
934 Token->TransactionStatus = EFI_DEVICE_ERROR;
935 BlkIo2Req->LastSubtaskSubmitted =
TRUE;
938 gBS->RestoreTPL (OldTpl);
946 "%a: Lba = 0x%08Lx, Original = 0x%08Lx, "
947 "Remaining = 0x%08Lx, BlockSize = 0x%x, Status = %r\n",
950 (UINT64)OrginalBlocks,
974 IN BOOLEAN ExtendedVerification
983 return EFI_INVALID_PARAMETER;
989 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
991 Device = NVME_DEVICE_PRIVATE_DATA_FROM_BLOCK_IO (This);
993 Private = Device->Controller;
997 if (EFI_ERROR (Status)) {
998 Status = EFI_DEVICE_ERROR;
1001 gBS->RestoreTPL (OldTpl);
1039 UINTN NumberOfBlocks;
1047 return EFI_INVALID_PARAMETER;
1050 Media = This->Media;
1052 if (MediaId != Media->
MediaId) {
1053 return EFI_MEDIA_CHANGED;
1056 if (Buffer ==
NULL) {
1057 return EFI_INVALID_PARAMETER;
1060 if (BufferSize == 0) {
1065 if ((BufferSize % BlockSize) != 0) {
1066 return EFI_BAD_BUFFER_SIZE;
1069 NumberOfBlocks = BufferSize / BlockSize;
1070 if ((Lba + NumberOfBlocks - 1) > Media->
LastBlock) {
1071 return EFI_INVALID_PARAMETER;
1075 if ((IoAlign > 0) && (((
UINTN)Buffer & (IoAlign - 1)) != 0)) {
1076 return EFI_INVALID_PARAMETER;
1079 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
1081 Device = NVME_DEVICE_PRIVATE_DATA_FROM_BLOCK_IO (This);
1083 Status =
NvmeRead (Device, Buffer, Lba, NumberOfBlocks);
1085 gBS->RestoreTPL (OldTpl);
1123 UINTN NumberOfBlocks;
1131 return EFI_INVALID_PARAMETER;
1134 Media = This->Media;
1136 if (MediaId != Media->
MediaId) {
1137 return EFI_MEDIA_CHANGED;
1140 if (Buffer ==
NULL) {
1141 return EFI_INVALID_PARAMETER;
1144 if (BufferSize == 0) {
1149 if ((BufferSize % BlockSize) != 0) {
1150 return EFI_BAD_BUFFER_SIZE;
1153 NumberOfBlocks = BufferSize / BlockSize;
1154 if ((Lba + NumberOfBlocks - 1) > Media->
LastBlock) {
1155 return EFI_INVALID_PARAMETER;
1159 if ((IoAlign > 0) && (((
UINTN)Buffer & (IoAlign - 1)) != 0)) {
1160 return EFI_INVALID_PARAMETER;
1163 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
1165 Device = NVME_DEVICE_PRIVATE_DATA_FROM_BLOCK_IO (This);
1167 Status =
NvmeWrite (Device, Buffer, Lba, NumberOfBlocks);
1169 gBS->RestoreTPL (OldTpl);
1198 return EFI_INVALID_PARAMETER;
1201 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
1203 Device = NVME_DEVICE_PRIVATE_DATA_FROM_BLOCK_IO (This);
1207 gBS->RestoreTPL (OldTpl);
1229 IN BOOLEAN ExtendedVerification
1239 return EFI_INVALID_PARAMETER;
1242 Device = NVME_DEVICE_PRIVATE_DATA_FROM_BLOCK_IO2 (This);
1243 Private = Device->Controller;
1249 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
1250 IsEmpty =
IsListEmpty (&Private->AsyncPassThruQueue) &&
1252 gBS->RestoreTPL (OldTpl);
1261 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
1265 if (EFI_ERROR (Status)) {
1266 Status = EFI_DEVICE_ERROR;
1269 gBS->RestoreTPL (OldTpl);
1326 UINTN NumberOfBlocks;
1334 return EFI_INVALID_PARAMETER;
1337 Media = This->Media;
1339 if (MediaId != Media->
MediaId) {
1340 return EFI_MEDIA_CHANGED;
1343 if (Buffer ==
NULL) {
1344 return EFI_INVALID_PARAMETER;
1347 if (BufferSize == 0) {
1348 if ((Token !=
NULL) && (Token->Event !=
NULL)) {
1350 gBS->SignalEvent (Token->Event);
1357 if ((BufferSize % BlockSize) != 0) {
1358 return EFI_BAD_BUFFER_SIZE;
1361 NumberOfBlocks = BufferSize / BlockSize;
1362 if ((Lba + NumberOfBlocks - 1) > Media->
LastBlock) {
1363 return EFI_INVALID_PARAMETER;
1367 if ((IoAlign > 0) && (((
UINTN)Buffer & (IoAlign - 1)) != 0)) {
1368 return EFI_INVALID_PARAMETER;
1371 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
1373 Device = NVME_DEVICE_PRIVATE_DATA_FROM_BLOCK_IO2 (This);
1375 if ((Token !=
NULL) && (Token->Event !=
NULL)) {
1377 Status =
NvmeAsyncRead (Device, Buffer, Lba, NumberOfBlocks, Token);
1379 Status =
NvmeRead (Device, Buffer, Lba, NumberOfBlocks);
1382 gBS->RestoreTPL (OldTpl);
1439 UINTN NumberOfBlocks;
1447 return EFI_INVALID_PARAMETER;
1450 Media = This->Media;
1452 if (MediaId != Media->
MediaId) {
1453 return EFI_MEDIA_CHANGED;
1456 if (Buffer ==
NULL) {
1457 return EFI_INVALID_PARAMETER;
1460 if (BufferSize == 0) {
1461 if ((Token !=
NULL) && (Token->Event !=
NULL)) {
1463 gBS->SignalEvent (Token->Event);
1470 if ((BufferSize % BlockSize) != 0) {
1471 return EFI_BAD_BUFFER_SIZE;
1474 NumberOfBlocks = BufferSize / BlockSize;
1475 if ((Lba + NumberOfBlocks - 1) > Media->
LastBlock) {
1476 return EFI_INVALID_PARAMETER;
1480 if ((IoAlign > 0) && (((
UINTN)Buffer & (IoAlign - 1)) != 0)) {
1481 return EFI_INVALID_PARAMETER;
1484 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
1486 Device = NVME_DEVICE_PRIVATE_DATA_FROM_BLOCK_IO2 (This);
1488 if ((Token !=
NULL) && (Token->Event !=
NULL)) {
1490 Status =
NvmeAsyncWrite (Device, Buffer, Lba, NumberOfBlocks, Token);
1492 Status =
NvmeWrite (Device, Buffer, Lba, NumberOfBlocks);
1495 gBS->RestoreTPL (OldTpl);
1538 return EFI_INVALID_PARAMETER;
1541 Device = NVME_DEVICE_PRIVATE_DATA_FROM_BLOCK_IO2 (This);
1547 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
1549 gBS->RestoreTPL (OldTpl);
1561 if ((Token !=
NULL) && (Token->Event !=
NULL)) {
1563 gBS->SignalEvent (Token->Event);
1599 IN OUT VOID *Buffer,
1600 IN UINT8 SecurityProtocolId,
1601 IN UINT16 SecurityProtocolSpecificData,
1603 IN BOOLEAN IsTrustSend,
1612 UINT16 SpecificData;
1618 CommandPacket.NvmeCmd = &Command;
1619 CommandPacket.NvmeCompletion = &Completion;
1624 SpecificData = (((SecurityProtocolSpecificData << 8) & 0xFF00) | (SecurityProtocolSpecificData >> 8));
1627 Command.Cdw0.Opcode = NVME_ADMIN_SECURITY_SEND_CMD;
1628 CommandPacket.TransferBuffer = Buffer;
1629 CommandPacket.TransferLength = (UINT32)TransferLength;
1630 CommandPacket.NvmeCmd->Cdw10 = (UINT32)((SecurityProtocolId << 24) | (SpecificData << 8));
1631 CommandPacket.NvmeCmd->Cdw11 = (UINT32)TransferLength;
1633 Command.Cdw0.Opcode = NVME_ADMIN_SECURITY_RECEIVE_CMD;
1634 CommandPacket.TransferBuffer = Buffer;
1635 CommandPacket.TransferLength = (UINT32)TransferLength;
1636 CommandPacket.NvmeCmd->Cdw10 = (UINT32)((SecurityProtocolId << 24) | (SpecificData << 8));
1637 CommandPacket.NvmeCmd->Cdw11 = (UINT32)TransferLength;
1640 CommandPacket.NvmeCmd->Flags = CDW10_VALID | CDW11_VALID;
1641 CommandPacket.NvmeCmd->Nsid = NVME_CONTROLLER_ID;
1642 CommandPacket.CommandTimeout = Timeout;
1643 CommandPacket.QueueType = NVME_ADMIN_QUEUE;
1645 Status = Private->Passthru.PassThru (
1653 if (EFI_ERROR (Status)) {
1654 *TransferLengthOut = 0;
1656 *TransferLengthOut = (
UINTN)TransferLength;
1743 IN UINT8 SecurityProtocolId,
1744 IN UINT16 SecurityProtocolSpecificData,
1746 OUT VOID *PayloadBuffer,
1755 if ((PayloadBuffer ==
NULL) || (PayloadTransferSize ==
NULL) || (PayloadBufferSize == 0)) {
1756 return EFI_INVALID_PARAMETER;
1759 Device = NVME_DEVICE_PRIVATE_DATA_FROM_STORAGE_SECURITY (This);
1762 return EFI_MEDIA_CHANGED;
1766 return EFI_NO_MEDIA;
1773 SecurityProtocolSpecificData,
1852 IN UINT8 SecurityProtocolId,
1853 IN UINT16 SecurityProtocolSpecificData,
1855 IN VOID *PayloadBuffer
1863 if ((PayloadBuffer ==
NULL) && (PayloadBufferSize != 0)) {
1864 return EFI_INVALID_PARAMETER;
1867 Device = NVME_DEVICE_PRIVATE_DATA_FROM_STORAGE_SECURITY (This);
1870 return EFI_MEDIA_CHANGED;
1874 return EFI_NO_MEDIA;
1881 SecurityProtocolSpecificData,
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
UINT64 EFIAPI RShiftU64(IN UINT64 Operand, IN UINTN Count)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define DEBUG_CODE_BEGIN()
#define DEBUG(Expression)
VOID NvmeDumpStatus(IN NVME_CQ *Cq)
EFI_STATUS TrustTransferNvmeDevice(IN OUT NVME_CONTROLLER_PRIVATE_DATA *Private, IN OUT VOID *Buffer, IN UINT8 SecurityProtocolId, IN UINT16 SecurityProtocolSpecificData, IN UINTN TransferLength, IN BOOLEAN IsTrustSend, IN UINT64 Timeout, OUT UINTN *TransferLengthOut)
EFI_STATUS EFIAPI NvmeBlockIoWriteBlocks(IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, IN VOID *Buffer)
EFI_STATUS ReadSectors(IN NVME_DEVICE_PRIVATE_DATA *Device, IN UINT64 Buffer, IN UINT64 Lba, IN UINT32 Blocks)
EFI_STATUS NvmeWrite(IN NVME_DEVICE_PRIVATE_DATA *Device, IN VOID *Buffer, IN UINT64 Lba, IN UINTN Blocks)
EFI_STATUS AsyncReadSectors(IN NVME_DEVICE_PRIVATE_DATA *Device, IN NVME_BLKIO2_REQUEST *Request, IN UINT64 Buffer, IN UINT64 Lba, IN UINT32 Blocks, IN BOOLEAN IsLast)
EFI_STATUS WriteSectors(IN NVME_DEVICE_PRIVATE_DATA *Device, IN UINT64 Buffer, IN UINT64 Lba, IN UINT32 Blocks)
EFI_STATUS EFIAPI NvmeBlockIoResetEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
EFI_STATUS NvmeFlush(IN NVME_DEVICE_PRIVATE_DATA *Device)
EFI_STATUS EFIAPI NvmeBlockIoReset(IN EFI_BLOCK_IO_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
EFI_STATUS EFIAPI NvmeBlockIoReadBlocksEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN OUT EFI_BLOCK_IO2_TOKEN *Token, IN UINTN BufferSize, OUT VOID *Buffer)
EFI_STATUS NvmeRead(IN NVME_DEVICE_PRIVATE_DATA *Device, OUT VOID *Buffer, IN UINT64 Lba, IN UINTN Blocks)
EFI_STATUS EFIAPI NvmeStorageSecuritySendData(IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This, IN UINT32 MediaId, IN UINT64 Timeout, IN UINT8 SecurityProtocolId, IN UINT16 SecurityProtocolSpecificData, IN UINTN PayloadBufferSize, IN VOID *PayloadBuffer)
EFI_STATUS NvmeAsyncWrite(IN NVME_DEVICE_PRIVATE_DATA *Device, IN VOID *Buffer, IN UINT64 Lba, IN UINTN Blocks, IN EFI_BLOCK_IO2_TOKEN *Token)
EFI_STATUS EFIAPI NvmeBlockIoReadBlocks(IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, OUT VOID *Buffer)
EFI_STATUS EFIAPI NvmeStorageSecurityReceiveData(IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This, IN UINT32 MediaId, IN UINT64 Timeout, IN UINT8 SecurityProtocolId, IN UINT16 SecurityProtocolSpecificData, IN UINTN PayloadBufferSize, OUT VOID *PayloadBuffer, OUT UINTN *PayloadTransferSize)
EFI_STATUS EFIAPI NvmeBlockIoWriteBlocksEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN OUT EFI_BLOCK_IO2_TOKEN *Token, IN UINTN BufferSize, IN VOID *Buffer)
EFI_STATUS NvmeAsyncRead(IN NVME_DEVICE_PRIVATE_DATA *Device, OUT VOID *Buffer, IN UINT64 Lba, IN UINTN Blocks, IN EFI_BLOCK_IO2_TOKEN *Token)
EFI_STATUS EFIAPI NvmeBlockIoFlushBlocksEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN OUT EFI_BLOCK_IO2_TOKEN *Token)
EFI_STATUS EFIAPI NvmeBlockIoFlushBlocks(IN EFI_BLOCK_IO_PROTOCOL *This)
EFI_STATUS AsyncWriteSectors(IN NVME_DEVICE_PRIVATE_DATA *Device, IN NVME_BLKIO2_REQUEST *Request, IN UINT64 Buffer, IN UINT64 Lba, IN UINT32 Blocks, IN BOOLEAN IsLast)
VOID EFIAPI AsyncIoCallback(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS NvmeControllerInit(IN NVME_CONTROLLER_PRIVATE_DATA *Private)
EFI_BLOCK_IO_MEDIA * Media
EFI_STATUS TransactionStatus