nvme_var.h revision d148d46e69709052e6d92205c98874f3e7cfd4c0
/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* Copyright 2016 Nexenta Systems, Inc. All rights reserved.
* Copyright 2016 The MathWorks, Inc. All rights reserved.
*/
#ifndef _NVME_VAR_H
#define _NVME_VAR_H
#include <sys/taskq_impl.h>
/*
* NVMe driver state
*/
#ifdef __cplusplus
/* extern "C" { */
#endif
#define NVME_FMA_INIT 0x1
#define NVME_REGS_MAPPED 0x2
#define NVME_ADMIN_QUEUE 0x4
#define NVME_CTRL_LIMITS 0x8
#define NVME_INTERRUPTS 0x10
#define NVME_MIN_ADMIN_QUEUE_LEN 16
#define NVME_MIN_IO_QUEUE_LEN 16
#define NVME_DEFAULT_ADMIN_QUEUE_LEN 256
#define NVME_DEFAULT_IO_QUEUE_LEN 1024
#define NVME_DEFAULT_ASYNC_EVENT_LIMIT 10
#define NVME_MIN_ASYNC_EVENT_LIMIT 1
typedef struct nvme_namespace nvme_namespace_t;
typedef struct nvme_dma nvme_dma_t;
typedef struct nvme_cmd nvme_cmd_t;
typedef struct nvme_qpair nvme_qpair_t;
typedef struct nvme_task_arg nvme_task_arg_t;
struct nvme_dma {
};
struct nvme_cmd {
void (*nc_callback)(void *);
};
struct nvme_qpair {
nvme_cmd_t **nq_cmd;
int nq_phase;
};
struct nvme {
int n_progress;
int n_intr_cnt;
int n_intr_cap;
int n_intr_type;
int n_intr_types;
char *n_product;
char *n_vendor;
int n_error_log_len;
int n_nssr_supported;
int n_doorbell_stride;
int n_timeout;
int n_cont_queues_reqd;
int n_max_queue_entries;
int n_pageshift;
int n_pagesize;
int n_namespace_count;
int n_ioq_count;
int n_fm_cap;
/* errors detected by driver */
/* errors detected by hardware */
/* errors reported by asynchronous events */
};
struct nvme_namespace {
/*
* Section 7.7 of the spec describes how to get a unique ID for
* the controller: the vendor ID, the model name and the serial
* number shall be unique when combined.
*
* We add the hex namespace ID to get a unique ID for the namespace.
*/
};
struct nvme_task_arg {
};
#ifdef __cplusplus
/* } */
#endif
#endif /* _NVME_VAR_H */