nVME
include/drivers/nvme.h View source View on GitHubStructs
Section titled “Structs”nvme_command
Section titled “nvme_command” struct nvme_command (14 fields) source
nvme_completion
Section titled “nvme_completion” struct nvme_completion (6 fields) source
nvme_cc
Section titled “nvme_cc” struct nvme_cc (1 field) source
nvme_regs
Section titled “nvme_regs” struct nvme_regs (15 fields) source
nvme_bio_data
Section titled “nvme_bio_data” struct nvme_bio_data (3 fields) source
nvme_request
Section titled “nvme_request” struct nvme_request (15 fields) source
nvme_waiting_requests
Section titled “nvme_waiting_requests”nvme_queue
Section titled “nvme_queue” struct nvme_queue (14 fields) source
struct nvme_command *sq Submission queue (virtual)
struct nvme_completion *cq Completion queue (virtual)
uint64_t sq_phys Submission queue physical address
uint64_t cq_phys Completion queue physical address
uint16_t sq_tail Tail index for submission
uint16_t cq_head Head index for completion
uint16_t sq_depth Queue depth (entries)
uint16_t cq_depth Queue depth (entries)
uint8_t cq_phase Phase bit for completion
struct nvme_request **sq_requests atomic_uint16_t outstanding nvme_device
Section titled “nvme_device” struct nvme_device (28 fields) source
uint64_t cap uint32_t version uint32_t doorbell_stride uint32_t page_size struct nvme_command *admin_sq struct nvme_completion *admin_cq uint64_t admin_sq_phys uint64_t admin_cq_phys uint16_t admin_sq_tail uint16_t admin_cq_head uint16_t admin_q_depth uint8_t admin_cq_phase struct nvme_queue **io_queues Array of pointers to queues
struct nvme_waiting_requests waiting_requests struct nvme_waiting_requests finished_requests atomic_bool on_sem uint8_t *isr_index uint32_t queue_count uint32_t sector_size uint64_t max_transfer_size struct block_device *generic_disk atomic_uint64_t total_outstanding nvme_identify
Section titled “nvme_identify”nvme_lbaf
Section titled “nvme_lbaf” struct nvme_lbaf (4 fields) source
nvme_identify_namespace
Section titled “nvme_identify_namespace” struct nvme_identify_namespace (39 fields) source
uint64_t nsze Namespace Size
uint64_t ncap Namespace Capacity
uint64_t nuse Namespace Utilization
uint8_t nsfeat Namespace Features
uint8_t nlbaf Number of LBA formats
uint8_t flbas Formatted LBA Size
uint8_t mc Metadata Capabilities
uint8_t dpc End-to-end Data Protection Capabilities
uint8_t dps End-to-end Data Protection Type Settings
uint8_t nmic Namespace Multipath I/O and Namespace Sharing Capabilities
uint8_t rescap Reservation Capabilities
uint8_t fpi Format Progress Indicator
uint8_t dlfeat Deallocate Logical Block Features
uint16_t nawun Namespace Atomic Write Unit Normal
uint16_t nawupf Namespace Atomic Write Unit Power Fail
uint16_t nacwu Namespace Atomic Compare & Write Unit
uint16_t nabsn Namespace Atomic Boundary Size Normal
uint16_t nabo Namespace Atomic Boundary Offset
uint16_t nabspf Namespace Atomic Boundary Size Power Fail
uint16_t noiob Namespace Optimal IO Boundary
uint64_t nvmcap[2] Namespace NVM Capacity
uint16_t npwg uint16_t npwa uint16_t npdg uint16_t npda uint16_t nows uint16_t mssrl uint32_t mcl uint8_t msrc uint8_t reserved0[11] uint32_t adagrpid uint8_t reserved1[3] uint8_t nsattr uint16_t nvmsetid uint16_t endgid uint64_t nguid[2] uint64_t eui64 uint8_t vendor_specific[3712] nvme_identify_controller
Section titled “nvme_identify_controller” struct nvme_identify_controller (44 fields) source
uint16_t vid PCI Vendor ID
uint16_t ssvid Subsystem Vendor ID
char sn[20] Serial Number (ASCII)
char mn[40] Model Number (ASCII)
char fr[8] Firmware Revision (ASCII)
uint8_t rab Recommended Arbitration Burst
uint8_t ieee[3] IEEE OUI Identifier
uint8_t mic Multi-interface Capabilities
uint8_t mdts Maximum Data Transfer Size
uint16_t cntlid Controller ID
uint32_t ver Version
uint32_t rtd3r RTD3 Resume Latency
uint32_t rtd3e RTD3 Entry Latency
uint32_t oaes Optional Admin Command Support
uint32_t ctratt Controller Attributes
uint8_t rsvd96[156] uint16_t oacs Optional Admin Command Support (bit flags)
uint8_t acl Abort Command Limit
uint8_t aerl Asynchronous Event Request Limit
uint8_t frmw Firmware Updates
uint8_t lpa Log Page Attributes
uint8_t elpe Error Log Page Entries
uint8_t npss Number of Power States Support
uint8_t avscc Admin Vendor Specific Command Configuration
uint8_t apsta Autonomous Power State Transition Attributes
uint16_t wctemp Warning Composite Temperature Threshold
uint16_t cctemp Critical Composite Temperature Threshold
uint16_t mtfa Maximum Time for Firmware Activation
uint32_t hmpre Host Memory Buffer Preferred Size
uint32_t hmmin Host Memory Buffer Minimum Size
uint64_t tnvmcap[2] Total NVM Capacity
uint64_t unvmcap[2] Unallocated NVM Capacity
uint32_t rpmbs Replay Protected Memory Block Support
uint16_t edstt Extended Device Self-test Time
uint8_t dsto Device Self-test Options
uint8_t fwug Firmware Update Granularity
uint16_t kas Keep Alive Support
uint16_t hctma Host Controlled Thermal Management Attributes
uint16_t mntmt Minimum Thermal Management Temperature
uint16_t mxtmt Maximum Thermal Management Temperature
uint32_t sanicap Sanitize Capabilities
uint8_t rsvd228[180] uint8_t sqes Submission Queue Entry Size
uint8_t cqes Completion Queue Entry Size
Functions
Section titled “Functions”nvme_submit_admin_cmd
Section titled “nvme_submit_admin_cmd”uint16_t nvme_submit_admin_cmd(
struct nvme_device *nvme,
struct nvme_command *cmd,
uint32_t * *
) source there is more but me lazy and dont need it
nvme_set_num_queues
Section titled “nvme_set_num_queues”uint32_t nvme_set_num_queues(
struct nvme_device *nvme,
uint16_t desired_sq,
uint16_t desired_cq
) source nvme_submit_io_cmd
Section titled “nvme_submit_io_cmd”bool nvme_submit_io_cmd(
struct nvme_device *nvme,
struct nvme_command *cmd,
uint32_t qid,
struct nvme_request *req
) source nvme_identify_controller
Section titled “nvme_identify_controller”uint8_t * nvme_identify_controller(struct nvme_device *nvme) source nvme_identify_namespace
Section titled “nvme_identify_namespace”uint8_t * nvme_identify_namespace(
struct nvme_device *nvme,
uint32_t nsid
) source nvme_enable_controller
Section titled “nvme_enable_controller”void nvme_enable_controller(struct nvme_device *nvme) source nvme_setup_admin_queues
Section titled “nvme_setup_admin_queues”void nvme_setup_admin_queues(struct nvme_device *nvme) source nvme_alloc_admin_queues
Section titled “nvme_alloc_admin_queues”void nvme_alloc_admin_queues(struct nvme_device *nvme) source nvme_alloc_io_queues
Section titled “nvme_alloc_io_queues”void nvme_alloc_io_queues(struct nvme_device *nvme, uint32_t qid) source nvme_discover_device
Section titled “nvme_discover_device”struct nvme_device * nvme_discover_device(
uint8_t bus,
uint8_t slot,
uint8_t func
) source nvme_create_generic
Section titled “nvme_create_generic”struct block_device * nvme_create_generic(struct nvme_device *nvme) source nvme_print_identify
Section titled “nvme_print_identify”void nvme_print_identify(const struct nvme_identify_controller *ctrl) source nvme_print_namespace
Section titled “nvme_print_namespace”void nvme_print_namespace(const struct nvme_identify_namespace *ns) source nvme_read_sector_wrapper
Section titled “nvme_read_sector_wrapper”bool nvme_read_sector_wrapper(
struct block_device *disk,
uint64_t lba,
uint8_t *buf,
uint64_t cnt
) source nvme_read_sector_async_wrapper
Section titled “nvme_read_sector_async_wrapper”bool nvme_read_sector_async_wrapper(
struct block_device *disk,
struct nvme_request *req
) source nvme_write_sector_async_wrapper
Section titled “nvme_write_sector_async_wrapper”bool nvme_write_sector_async_wrapper(
struct block_device *disk,
struct nvme_request *req
) source nvme_send_nvme_req
Section titled “nvme_send_nvme_req”bool nvme_send_nvme_req(
struct block_device *d,
struct nvme_request *r
) source nvme_write_sector_wrapper
Section titled “nvme_write_sector_wrapper”bool nvme_write_sector_wrapper(
struct block_device *disk,
uint64_t lba,
const uint8_t *buf,
uint64_t cnt
) source nvme_isr_handler
Section titled “nvme_isr_handler”enum irq_result nvme_isr_handler(struct irq_context *rsp, void *ctx) source nvme_submit_bio_request
Section titled “nvme_submit_bio_request”bool nvme_submit_bio_request(
struct block_device *disk,
struct bio_request *bio
) source nvme_should_coalesce
Section titled “nvme_should_coalesce”bool nvme_should_coalesce(
struct block_device *disk,
const struct bio_request *a,
const struct bio_request *b
) source nvme_do_coalesce
Section titled “nvme_do_coalesce”void nvme_do_coalesce(
struct block_device *disk,
struct bio_request *into,
struct bio_request *from
) source nvme_reorder
Section titled “nvme_reorder”void nvme_reorder(struct block_device *disk) source nvme_work
Section titled “nvme_work”void nvme_work(void *rvoid, void *dvoid) source nvme_print_wrapper
Section titled “nvme_print_wrapper”void nvme_print_wrapper(struct block_device *d) source