Reference

libnvme_read_regs-libnvme3(2)

Read the controller registers of a PCIe controller

NAME

libnvme_read_regs - Read the controller registers of a PCIe controller

SYNOPSIS

int libnvme_read_regs (struct libnvme_transport_handle *hdl , __u32 offset , void *buf , __u32 len );

ARGUMENTS

hdl

Transport handle

offset

Offset of the first register in bytes

buf

Buffer to store the register values

len

Number of bytes to read

DESCRIPTION

Copies the register range [offset, offset + len) of the controller into buf, using 32-bit MMIO reads. The register values are stored in little-endian byte order, as they appear in the register map. offset and len must be multiples of 4 and the range must be within the first 4 KiB of the register map.

This should only be sent to controller handles, not to namespaces.

RETURN

0 on success or a negative error code otherwise. -ENOTSUP indicates that the transport has no memory-mapped registers.