diff --git a/drivers/nvme/command.inc b/drivers/nvme/command.inc index d13e7aa..e40c264 100644 --- a/drivers/nvme/command.inc +++ b/drivers/nvme/command.inc @@ -78,7 +78,7 @@ proc create_io_submission_queue stdcall, pci:dword, prp1:dword, qid:dword, cqid: mov dword [esi + pcidev.spinlock], 1 sub esp, sizeof.SQ_ENTRY stdcall memsetdz, esp, sizeof.SQ_ENTRY / 4 - stdcall set_cdw0, [pci], ADMIN_QUEUE, ADM_CMD_CRE_IO_SUBMISSION_QUEUE + stdcall set_cdw0, esi, ADMIN_QUEUE, ADM_CMD_CRE_IO_SUBMISSION_QUEUE mov dword [esp + SQ_ENTRY.cdw0], eax mov eax, [prp1] mov dword [esp + SQ_ENTRY.prp1], eax @@ -106,13 +106,13 @@ proc abort stdcall, pci:dword, cid:word, sqid:word mov dword [esi + pcidev.spinlock], 1 sub esp, sizeof.SQ_ENTRY stdcall memsetdz, esp, sizeof.SQ_ENTRY / 4 - stdcall set_cdw0, [pci], ADMIN_QUEUE, ADM_CMD_ABORT + stdcall set_cdw0, esi, ADMIN_QUEUE, ADM_CMD_ABORT mov dword [esp + SQ_ENTRY.cdw0], eax movzx eax, [cid] shl eax, 16 or eax, word [sqid] mov dword [esp + SQ_ENTRY.cdw10], eax - stdcall sqytdbl_write, [pci], ADMIN_QUEUE, esp + stdcall sqytdbl_write, esi, ADMIN_QUEUE, esp add esp, sizeof.SQ_ENTRY stdcall nvme_poll, esi pop esi @@ -149,11 +149,11 @@ proc delete_io_completion_queue stdcall, pci:dword, qid:word mov dword [esi + pcidev.spinlock], 1 sub esp, sizeof.SQ_ENTRY stdcall memsetdz, esp, sizeof.SQ_ENTRY / 4 - stdcall set_cdw0, [pci], ADMIN_QUEUE, ADM_CMD_DEL_IO_COMPLETION_QUEUE + stdcall set_cdw0, esi, ADMIN_QUEUE, ADM_CMD_DEL_IO_COMPLETION_QUEUE mov dword [esp + SQ_ENTRY.cdw0], eax mov ax, [qid] mov word [esp + SQ_ENTRY.cdw10], ax - stdcall sqytdbl_write, [pci], ADMIN_QUEUE, esp + stdcall sqytdbl_write, esi, ADMIN_QUEUE, esp add esp, sizeof.SQ_ENTRY stdcall nvme_poll, esi pop esi @@ -190,11 +190,11 @@ proc delete_io_submission_queue stdcall, pci:dword, qid:word mov dword [esi + pcidev.spinlock], 1 sub esp, sizeof.SQ_ENTRY stdcall memsetdz, esp, sizeof.SQ_ENTRY / 4 - stdcall set_cdw0, [pci], ADMIN_QUEUE, ADM_CMD_DEL_IO_SUBMISSION_QUEUE + stdcall set_cdw0, esi, ADMIN_QUEUE, ADM_CMD_DEL_IO_SUBMISSION_QUEUE mov dword [esp + SQ_ENTRY.cdw0], eax mov ax, [qid] mov word [esp + SQ_ENTRY.cdw10], ax - stdcall sqytdbl_write, [pci], ADMIN_QUEUE, esp + stdcall sqytdbl_write, esi, ADMIN_QUEUE, esp add esp, sizeof.SQ_ENTRY stdcall nvme_poll, esi pop esi diff --git a/drivers/nvme/nvme.asm b/drivers/nvme/nvme.asm index 2e741d7..c0c52a2 100644 --- a/drivers/nvme/nvme.asm +++ b/drivers/nvme/nvme.asm @@ -1254,6 +1254,7 @@ endp proc nvme_cleanup + DEBUGF DBG_INFO, "nvme: Cleaning up...\n" push ebx esi edi mov esi, dword [p_nvme_devices] test esi, esi @@ -1291,6 +1292,7 @@ proc nvme_cleanup cmp ebx, LAST_QUEUE_ID jbe .get_queue pop ebx + inc ebx cmp ebx, dword [pcidevs_len] jne .get_pcidev @@ -1300,6 +1302,7 @@ proc nvme_cleanup and eax, not CC_SHN or eax, CC_SHN_NORMAL_SHUTDOWN mov dword [edi + NVME_MMIO.CC], eax + stdcall nvme_disable_ctrl, esi ; Wait for shutdown processing to complete @@: