Turnstone Operating System
|
nvme interface More...
#include <types.h>
#include <memory.h>
#include <list.h>
#include <pci.h>
#include <utils.h>
#include <future.h>
#include <hashmap.h>
#include <disk.h>
Macros | |
#define | ___DRIVER_NVME_H 0 |
Typedefs | |
typedef union nvme_controller_cap_t | nvme_controller_cap_t |
union shorthand | |
typedef struct nvme_controller_version_t | nvme_controller_version_t |
shorthand for struct | |
typedef struct nvme_controller_cfg_t | nvme_controller_cfg_t |
shorthand for struct | |
typedef struct nvme_controller_sts_t | nvme_controller_sts_t |
shorthand for struct | |
typedef union nvme_controller_aqa_t | nvme_controller_aqa_t |
shorthand for struct | |
typedef struct nvme_controller_cmbloc_t | nvme_controller_cmbloc_t |
shorthand for struct | |
typedef struct nvme_controller_cmbsz_t | nvme_controller_cmbsz_t |
shorthand for struct | |
typedef struct nvme_controller_bpinfo_t | nvme_controller_bpinfo_t |
shorthand for struct | |
typedef struct nvme_controller_bprsel_t | nvme_controller_bprsel_t |
shorthand for struct | |
typedef struct nvme_controller_cmbmsc_t | nvme_controller_cmbmsc_t |
shorthand for struct | |
typedef struct nvme_controller_cmbsts_t | nvme_controller_cmbsts_t |
typedef struct nvme_controller_registers_t | nvme_controller_registers_t |
shorthand for struct | |
typedef struct nvme_submission_queue_entry_t | nvme_submission_queue_entry_t |
typedef struct nvme_completion_queue_entry_t | nvme_completion_queue_entry_t |
shorthand for struct | |
typedef struct nvme_identify_t | nvme_identify_t |
shorthand for struct | |
typedef struct nvme_lba_format_t | nvme_lba_format_t |
typedef struct nvme_ns_identify_t | nvme_ns_identify_t |
shorthand for struct | |
typedef enum nvme_admin_cmd_opcode_t | nvme_admin_cmd_opcode_t |
shorthand for enum | |
typedef enum nvme_cmd_opcode_t | nvme_cmd_opcode_t |
shorthand for enum | |
typedef enum nvme_feat_id_t | nvme_feat_id_t |
shorthand for enum | |
typedef enum nvme_cmd_status_t | nvme_cmd_status_t |
shorthand for enum | |
typedef struct nvme_disk_t | nvme_disk_t |
shorthand for struct | |
Enumerations | |
enum | nvme_admin_cmd_opcode_t { NVME_ADMIN_CMD_DELETE_SQ = 0X00 , NVME_ADMIN_CMD_CREATE_SQ = 0X01 , NVME_ADMIN_CMD_GET_LOG_PAGE = 0X02 , NVME_ADMIN_CMD_DELETE_CQ = 0X04 , NVME_ADMIN_CMD_CREATE_CQ = 0X05 , NVME_ADMIN_CMD_IDENTIFY = 0X06 , NVME_ADMIN_CMD_ABORT = 0X08 , NVME_ADMIN_CMD_SET_FEATURES = 0X09 , NVME_ADMIN_CMD_GET_FEATURES = 0X0A , NVME_ADMIN_CMD_ASYNC_EVNT_REQ = 0X0C , NVME_ADMIN_CMD_FIRMWARE_COMMIT = 0X10 , NVME_ADMIN_CMD_FIRMWARE_DOWNLOAD = 0X11 , NVME_ADMIN_CMD_NS_ATTACH = 0X15 , NVME_ADMIN_CMD_KEEP_ALIVE = 0X18 , NVME_ADMIN_CMD_FORMAT_NVM = 0X80 } |
nvme admin commands More... | |
enum | nvme_cmd_opcode_t { NVME_CMD_FLUSH = 0X00 , NVME_CMD_WRITE = 0X01 , NVME_CMD_READ = 0X02 , NVME_CMD_WRITE_UNCORRECTABLE = 0X4 , NVME_CMD_COMPARE = 0X05 , NVME_CMD_WRITE_ZEROS = 0X08 , NVME_CMD_DATASET_MGMT = 0X09 , NVME_CMD_RESERVATION_REG = 0X0D , NVME_CMD_RESERVATION_REP = 0X0E , NVME_CMD_RESERVATION_ACQ = 0X11 , NVME_CMD_RESERVATION_REL = 0X15 } |
nvme io commands More... | |
enum | nvme_feat_id_t { NVME_FEAT_HOST_MEM_BUF = 0XD , NVME_FEAT_NUM_QUEUES = 0X07 } |
nvme feature id's | |
enum | nvme_cmd_status_t { NVME_CMD_STATUS_SUCCESS = 0X0 , NVME_CMD_STATUS_INVALID_CMD = 0X1 , NVME_CMD_STATUS_INVALID_FIELD = 0X2 , NVME_CMD_STATUS_CMD_ID_CONFLICT = 0X3 , NVME_CMD_STATUS_DATA_XFER_ERROR = 0X4 , NVME_CMD_STATUS_ABORTED_PWR_LOSS = 0X5 , NVME_CMD_STATUS_INTERNAL_ERROR = 0X6 , NVME_CMD_STATUS_CMD_ABORT_REQUESTED = 0X7 , NVME_CMD_STATUS_CMD_ABORT_SQ_DELETED = 0X8 , NVME_CMD_STATUS_CMD_ABORT_FUSED_CMD = 0X9 , NVME_CMD_STATUS_CMD_ABORT_MISSING_FUSED_CMD = 0XA , NVME_CMD_STATUS_INVALID_NS_OR_FMT = 0XB , NVME_CMD_STATUS_CMD_SEQ_ERROR = 0XC , NVME_CMD_STATUS_INVALID_SGL_SEG_DESC = 0XD , NVME_CMD_STATUS_INVALID_SGL_COUNT = 0XE , NVME_CMD_STATUS_INVALID_DATA_SGL_LEN = 0XF , NVME_CMD_STATUS_INVALID_MD_GL_LEN = 0X10 , NVME_CMD_STATUS_INVALID_SGL_DESC_TYPE = 0X11 , NVME_CMD_STATUS_INVALID_USE_CTRL_MEM = 0X12 , NVME_CMD_STATUS_INVALID_PRP_OFS = 0X13 , NVME_CMD_STATUS_ATOMIC_WRITE_UNIT_EXCEEDED = 0X14 , NVME_CMD_STATUS_INVALID_SGL_OFS = 0X16 , NVME_CMD_STATUS_INVALID_SGL_SUBTYPE = 0X17 , NVME_CMD_STATUS_INCONSISTENT_HOST_ID = 0X18 , NVME_CMD_STATUS_KEEPALIVE_EXPIRED = 0X19 , NVME_CMD_STATUS_KEEPALIVE_INVALID = 0X1A , NVME_CMD_STATUS_LBA_OUT_OF_RANGE = 0X80 , NVME_CMD_STATUS_CAPACITY_EXCEEDED = 0X81 , NVME_CMD_STATUS_NS_NOT_READY = 0X82 , NVME_CMD_STATUS_RESERVATION_CONFLICT = 0X83 , NVME_CMD_STATUS_FORMAT_IN_PROGRESS = 0X84 } |
nvme command's status codes More... | |
Functions | |
int8_t | nvme_init (memory_heap_t *heap, list_t *nvme_pci_devices) |
initialize nvme devices More... | |
_Static_assert (offsetof_field(nvme_ns_identify_t, lbaf)==128, "nvme_ns_identify_t size mismatch") | |
future_t * | nvme_read (uint64_t disk_id, uint64_t lba, uint32_t size, uint8_t *buffer) |
future_t * | nvme_write (uint64_t disk_id, uint64_t lba, uint32_t size, uint8_t *buffer) |
future_t * | nvme_flush (uint64_t disk_id) |
disk_t * | nvme_disk_impl_open (nvme_disk_t *nvme_disk) |
const nvme_disk_t * | nvme_get_disk_by_id (uint64_t disk_id) |
nvme interface
This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.
#define ___DRIVER_NVME_H 0 |
prevent duplicate header error macro
nvme admin commands
enum nvme_cmd_opcode_t |
enum nvme_cmd_status_t |
int8_t nvme_init | ( | memory_heap_t * | heap, |
list_t * | nvme_pci_devices | ||
) |
initialize nvme devices
[in] | heap | the heap for storing data |
[in] | nvme_pci_devices | pci device list contains nvmes |