Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/nvme/nvme.h
Show First 20 Lines • Show All 606 Lines • ▼ Show 20 Lines | struct nvme_command { | ||||
/* dword 10-15 */ | /* dword 10-15 */ | ||||
uint32_t cdw10; /* command-specific */ | uint32_t cdw10; /* command-specific */ | ||||
uint32_t cdw11; /* command-specific */ | uint32_t cdw11; /* command-specific */ | ||||
uint32_t cdw12; /* command-specific */ | uint32_t cdw12; /* command-specific */ | ||||
uint32_t cdw13; /* command-specific */ | uint32_t cdw13; /* command-specific */ | ||||
uint32_t cdw14; /* command-specific */ | uint32_t cdw14; /* command-specific */ | ||||
uint32_t cdw15; /* command-specific */ | uint32_t cdw15; /* command-specific */ | ||||
} __packed; | }; | ||||
_Static_assert(sizeof(struct nvme_command) == 16 * 4, "bad size for nvme_command"); | _Static_assert(sizeof(struct nvme_command) == 16 * 4, "bad size for nvme_command"); | ||||
struct nvme_completion { | struct nvme_completion { | ||||
/* dword 0 */ | /* dword 0 */ | ||||
uint32_t cdw0; /* command-specific */ | uint32_t cdw0; /* command-specific */ | ||||
/* dword 1 */ | /* dword 1 */ | ||||
uint32_t rsvd1; | uint32_t rsvd1; | ||||
/* dword 2 */ | /* dword 2 */ | ||||
uint16_t sqhd; /* submission queue head pointer */ | uint16_t sqhd; /* submission queue head pointer */ | ||||
uint16_t sqid; /* submission queue identifier */ | uint16_t sqid; /* submission queue identifier */ | ||||
/* dword 3 */ | /* dword 3 */ | ||||
uint16_t cid; /* command identifier */ | uint16_t cid; /* command identifier */ | ||||
uint16_t status; | uint16_t status; | ||||
} __packed; | } __aligned(8); /* riscv: nvme_qpair_process_completions has better code gen */ | ||||
_Static_assert(sizeof(struct nvme_completion) == 4 * 4, "bad size for nvme_completion"); | _Static_assert(sizeof(struct nvme_completion) == 4 * 4, "bad size for nvme_completion"); | ||||
struct nvme_dsm_range { | struct nvme_dsm_range { | ||||
uint32_t attributes; | uint32_t attributes; | ||||
uint32_t length; | uint32_t length; | ||||
uint64_t starting_lba; | uint64_t starting_lba; | ||||
} __packed; | }; | ||||
/* Largest DSM Trim that can be done */ | /* Largest DSM Trim that can be done */ | ||||
#define NVME_MAX_DSM_TRIM 4096 | #define NVME_MAX_DSM_TRIM 4096 | ||||
_Static_assert(sizeof(struct nvme_dsm_range) == 16, "bad size for nvme_dsm_ranage"); | _Static_assert(sizeof(struct nvme_dsm_range) == 16, "bad size for nvme_dsm_ranage"); | ||||
/* status code types */ | /* status code types */ | ||||
enum nvme_status_code_type { | enum nvme_status_code_type { | ||||
▲ Show 20 Lines • Show All 1,406 Lines • Show Last 20 Lines |