//\r
// Ring the submission queue doorbell.\r
//\r
- if (Event != NULL) {\r
+ if ((Event != NULL) && (QueueId != 0)) {\r
Private->SqTdbl[QueueId].Sqt =\r
(Private->SqTdbl[QueueId].Sqt + 1) % (NVME_ASYNC_CSQ_SIZE + 1);\r
} else {\r
// For non-blocking requests, return directly if the command is placed\r
// in the submission queue.\r
//\r
- if (Event != NULL) {\r
+ if ((Event != NULL) && (QueueId != 0)) {\r
AsyncRequest = AllocateZeroPool (sizeof (NVME_PASS_THRU_ASYNC_REQ));\r
if (AsyncRequest == NULL) {\r
Status = EFI_DEVICE_ERROR;\r
&Data\r
);\r
\r
+ //\r
+ // For now, the code does not support the non-blocking feature for admin queue.\r
+ // If Event is not NULL for admin queue, signal the caller's event here.\r
+ //\r
+ if (Event != NULL) {\r
+ ASSERT (QueueId == 0);\r
+ gBS->SignalEvent (Event);\r
+ }\r
+\r
EXIT:\r
if (MapData != NULL) {\r
PciIo->Unmap (\r