4 #include "block/nvme.h"
6 typedef struct NvmeParams
{
8 uint32_t num_queues
; /* deprecated since 5.1 */
13 typedef struct NvmeAsyncEvent
{
14 QSIMPLEQ_ENTRY(NvmeAsyncEvent
) entry
;
18 typedef struct NvmeRequest
{
19 struct NvmeSQueue
*sq
;
27 QTAILQ_ENTRY(NvmeRequest
)entry
;
30 typedef struct NvmeSQueue
{
31 struct NvmeCtrl
*ctrl
;
40 QTAILQ_HEAD(, NvmeRequest
) req_list
;
41 QTAILQ_HEAD(, NvmeRequest
) out_req_list
;
42 QTAILQ_ENTRY(NvmeSQueue
) entry
;
45 typedef struct NvmeCQueue
{
46 struct NvmeCtrl
*ctrl
;
56 QTAILQ_HEAD(, NvmeSQueue
) sq_list
;
57 QTAILQ_HEAD(, NvmeRequest
) req_list
;
60 typedef struct NvmeNamespace
{
64 #define TYPE_NVME "nvme"
66 OBJECT_CHECK(NvmeCtrl, (obj), TYPE_NVME)
68 typedef struct NvmeCtrl
{
71 MemoryRegion ctrl_mem
;
78 uint16_t max_prp_ents
;
82 uint32_t num_namespaces
;
89 uint64_t host_timestamp
; /* Timestamp sent by the host */
90 uint64_t timestamp_set_qemu_clock_ms
; /* QEMU clock time */
92 HostMemoryBackend
*pmrdev
;
94 NvmeNamespace
*namespaces
;
102 #endif /* HW_NVME_H */