mirror of
https://git.missingno.dev/kolibrios-nvme-driver/
synced 2025-01-03 11:25:55 +01:00
implement reporting on namespace info
This commit is contained in:
parent
3db664b53e
commit
f612befee6
@ -710,10 +710,35 @@ proc nvme_init stdcall, pci:dword
|
|||||||
invoke GetPhysAddr
|
invoke GetPhysAddr
|
||||||
stdcall create_io_submission_queue, [pci], eax, 1, 1
|
stdcall create_io_submission_queue, [pci], eax, 1, 1
|
||||||
|
|
||||||
|
if 1
|
||||||
stdcall determine_active_nsids, [pci]
|
stdcall determine_active_nsids, [pci]
|
||||||
test eax, eax
|
test eax, eax
|
||||||
jz .exit_fail ; No active NSIDS
|
jz .exit_fail ; No active NSIDS
|
||||||
|
mov esi, [pci]
|
||||||
|
mov dword [esi + pcidev.nsid], eax
|
||||||
DEBUGF DBG_INFO, "(NVMe) Found active NSID: %u\n", eax
|
DEBUGF DBG_INFO, "(NVMe) Found active NSID: %u\n", eax
|
||||||
|
else
|
||||||
|
mov esi, [pci]
|
||||||
|
xor eax, eax
|
||||||
|
inc eax
|
||||||
|
mov dword [esi + pcidev.nsid], eax
|
||||||
|
end if
|
||||||
|
invoke KernelAlloc, 0x1000
|
||||||
|
test eax, eax
|
||||||
|
jz .exit_fail
|
||||||
|
mov edi, eax
|
||||||
|
invoke GetPhysAddr
|
||||||
|
stdcall nvme_identify, [pci], [esi + pcidev.nsid], eax, CNS_IDNS
|
||||||
|
mov al, byte [edi + IDENTN.nsfeat]
|
||||||
|
DEBUGF DBG_INFO, "(nvme%un%u): Namespace Features: 0x%x\n", 0, [esi + pcidev.nsid], al
|
||||||
|
DEBUGF DBG_INFO, "(nvme%un%u): Namespace Size: %u + %u logical blocks\n", 0, [esi + pcidev.nsid], [edi + IDENTN.nsze], [edi + IDENTN.nsze + 4]
|
||||||
|
DEBUGF DBG_INFO, "(nvme%un%u): Namespace Capacity: %u + %u logical blocks\n", 0, [esi + pcidev.nsid], [edi + IDENTN.ncap], [edi + IDENTN.ncap + 4]
|
||||||
|
mov eax, dword [edi + IDENTN.lbaf0]
|
||||||
|
shr eax, 16 ; Get LBADS
|
||||||
|
and eax, 0xff
|
||||||
|
stdcall pow2, eax
|
||||||
|
DEBUGF DBG_INFO, "(nvme%un%u): Namespace LBA Data Size: %u\n", 0, [esi + pcidev.nsid], eax
|
||||||
|
invoke KernelFree, edi
|
||||||
|
|
||||||
DEBUGF DBG_INFO, "(NVMe) Successfully initialized driver!\n"
|
DEBUGF DBG_INFO, "(NVMe) Successfully initialized driver!\n"
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
|
@ -311,7 +311,7 @@ struct pcidev
|
|||||||
io_addr dd ?
|
io_addr dd ?
|
||||||
queue_entries dd ?
|
queue_entries dd ?
|
||||||
version dd ?
|
version dd ?
|
||||||
nsids dd ?
|
nsid dd ?
|
||||||
nn dd ?
|
nn dd ?
|
||||||
dstrd db ?
|
dstrd db ?
|
||||||
rb 3 ; align
|
rb 3 ; align
|
||||||
|
Loading…
Reference in New Issue
Block a user