Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations
nvme.h File Reference
#include <linux/types.h>

Go to the source code of this file.

Data Structures

struct  nvme_bar
 
struct  nvme_id_power_state
 
struct  nvme_id_ctrl
 
struct  nvme_lbaf
 
struct  nvme_id_ns
 
struct  nvme_lba_range_type
 
struct  nvme_common_command
 
struct  nvme_rw_command
 
struct  nvme_identify
 
struct  nvme_features
 
struct  nvme_create_cq
 
struct  nvme_create_sq
 
struct  nvme_delete_queue
 
struct  nvme_download_firmware
 
struct  nvme_command
 
struct  nvme_completion
 
struct  nvme_user_io
 
struct  nvme_admin_cmd
 

Macros

#define NVME_CAP_MQES(cap)   ((cap) & 0xffff)
 
#define NVME_CAP_TIMEOUT(cap)   (((cap) >> 24) & 0xff)
 
#define NVME_CAP_STRIDE(cap)   (((cap) >> 32) & 0xf)
 
#define NVME_CAP_MPSMIN(cap)   (((cap) >> 48) & 0xf)
 
#define NVME_VS(major, minor)   (major << 16 | minor)
 
#define NVME_IOCTL_ID   _IO('N', 0x40)
 
#define NVME_IOCTL_ADMIN_CMD   _IOWR('N', 0x41, struct nvme_admin_cmd)
 
#define NVME_IOCTL_SUBMIT_IO   _IOW('N', 0x42, struct nvme_user_io)
 

Enumerations

enum  {
  NVME_CC_ENABLE = 1 << 0, NVME_CC_CSS_NVM = 0 << 4, NVME_CC_MPS_SHIFT = 7, NVME_CC_ARB_RR = 0 << 11,
  NVME_CC_ARB_WRRU = 1 << 11, NVME_CC_ARB_VS = 7 << 11, NVME_CC_SHN_NONE = 0 << 14, NVME_CC_SHN_NORMAL = 1 << 14,
  NVME_CC_SHN_ABRUPT = 2 << 14, NVME_CC_IOSQES = 6 << 16, NVME_CC_IOCQES = 4 << 20, NVME_CSTS_RDY = 1 << 0,
  NVME_CSTS_CFS = 1 << 1, NVME_CSTS_SHST_NORMAL = 0 << 2, NVME_CSTS_SHST_OCCUR = 1 << 2, NVME_CSTS_SHST_CMPLT = 2 << 2
}
 
enum  {
  NVME_NS_FEAT_THIN = 1 << 0, NVME_LBAF_RP_BEST = 0, NVME_LBAF_RP_BETTER = 1, NVME_LBAF_RP_GOOD = 2,
  NVME_LBAF_RP_DEGRADED = 3
}
 
enum  {
  NVME_LBART_TYPE_FS = 0x01, NVME_LBART_TYPE_RAID = 0x02, NVME_LBART_TYPE_CACHE = 0x03, NVME_LBART_TYPE_SWAP = 0x04,
  NVME_LBART_ATTRIB_TEMP = 1 << 0, NVME_LBART_ATTRIB_HIDE = 1 << 1
}
 
enum  nvme_opcode {
  nvme_cmd_flush = 0x00, nvme_cmd_write = 0x01, nvme_cmd_read = 0x02, nvme_cmd_write_uncor = 0x04,
  nvme_cmd_compare = 0x05, nvme_cmd_dsm = 0x09
}
 
enum  {
  NVME_RW_LR = 1 << 15, NVME_RW_FUA = 1 << 14, NVME_RW_DSM_FREQ_UNSPEC = 0, NVME_RW_DSM_FREQ_TYPICAL = 1,
  NVME_RW_DSM_FREQ_RARE = 2, NVME_RW_DSM_FREQ_READS = 3, NVME_RW_DSM_FREQ_WRITES = 4, NVME_RW_DSM_FREQ_RW = 5,
  NVME_RW_DSM_FREQ_ONCE = 6, NVME_RW_DSM_FREQ_PREFETCH = 7, NVME_RW_DSM_FREQ_TEMP = 8, NVME_RW_DSM_LATENCY_NONE = 0 << 4,
  NVME_RW_DSM_LATENCY_IDLE = 1 << 4, NVME_RW_DSM_LATENCY_NORM = 2 << 4, NVME_RW_DSM_LATENCY_LOW = 3 << 4, NVME_RW_DSM_SEQ_REQ = 1 << 6,
  NVME_RW_DSM_COMPRESSED = 1 << 7
}
 
enum  nvme_admin_opcode {
  nvme_admin_delete_sq = 0x00, nvme_admin_create_sq = 0x01, nvme_admin_get_log_page = 0x02, nvme_admin_delete_cq = 0x04,
  nvme_admin_create_cq = 0x05, nvme_admin_identify = 0x06, nvme_admin_abort_cmd = 0x08, nvme_admin_set_features = 0x09,
  nvme_admin_get_features = 0x0a, nvme_admin_async_event = 0x0c, nvme_admin_activate_fw = 0x10, nvme_admin_download_fw = 0x11,
  nvme_admin_format_nvm = 0x80, nvme_admin_security_send = 0x81, nvme_admin_security_recv = 0x82
}
 
enum  {
  NVME_QUEUE_PHYS_CONTIG = (1 << 0), NVME_CQ_IRQ_ENABLED = (1 << 1), NVME_SQ_PRIO_URGENT = (0 << 1), NVME_SQ_PRIO_HIGH = (1 << 1),
  NVME_SQ_PRIO_MEDIUM = (2 << 1), NVME_SQ_PRIO_LOW = (3 << 1), NVME_FEAT_ARBITRATION = 0x01, NVME_FEAT_POWER_MGMT = 0x02,
  NVME_FEAT_LBA_RANGE = 0x03, NVME_FEAT_TEMP_THRESH = 0x04, NVME_FEAT_ERR_RECOVERY = 0x05, NVME_FEAT_VOLATILE_WC = 0x06,
  NVME_FEAT_NUM_QUEUES = 0x07, NVME_FEAT_IRQ_COALESCE = 0x08, NVME_FEAT_IRQ_CONFIG = 0x09, NVME_FEAT_WRITE_ATOMIC = 0x0a,
  NVME_FEAT_ASYNC_EVENT = 0x0b, NVME_FEAT_SW_PROGRESS = 0x0c
}
 
enum  {
  NVME_SC_SUCCESS = 0x0, NVME_SC_INVALID_OPCODE = 0x1, NVME_SC_INVALID_FIELD = 0x2, NVME_SC_CMDID_CONFLICT = 0x3,
  NVME_SC_DATA_XFER_ERROR = 0x4, NVME_SC_POWER_LOSS = 0x5, NVME_SC_INTERNAL = 0x6, NVME_SC_ABORT_REQ = 0x7,
  NVME_SC_ABORT_QUEUE = 0x8, NVME_SC_FUSED_FAIL = 0x9, NVME_SC_FUSED_MISSING = 0xa, NVME_SC_INVALID_NS = 0xb,
  NVME_SC_LBA_RANGE = 0x80, NVME_SC_CAP_EXCEEDED = 0x81, NVME_SC_NS_NOT_READY = 0x82, NVME_SC_CQ_INVALID = 0x100,
  NVME_SC_QID_INVALID = 0x101, NVME_SC_QUEUE_SIZE = 0x102, NVME_SC_ABORT_LIMIT = 0x103, NVME_SC_ABORT_MISSING = 0x104,
  NVME_SC_ASYNC_LIMIT = 0x105, NVME_SC_FIRMWARE_SLOT = 0x106, NVME_SC_FIRMWARE_IMAGE = 0x107, NVME_SC_INVALID_VECTOR = 0x108,
  NVME_SC_INVALID_LOG_PAGE = 0x109, NVME_SC_INVALID_FORMAT = 0x10a, NVME_SC_BAD_ATTRIBUTES = 0x180, NVME_SC_WRITE_FAULT = 0x280,
  NVME_SC_READ_ERROR = 0x281, NVME_SC_GUARD_CHECK = 0x282, NVME_SC_APPTAG_CHECK = 0x283, NVME_SC_REFTAG_CHECK = 0x284,
  NVME_SC_COMPARE_FAILED = 0x285, NVME_SC_ACCESS_DENIED = 0x286
}
 

Macro Definition Documentation

#define NVME_CAP_MPSMIN (   cap)    (((cap) >> 48) & 0xf)

Definition at line 41 of file nvme.h.

#define NVME_CAP_MQES (   cap)    ((cap) & 0xffff)

Definition at line 38 of file nvme.h.

#define NVME_CAP_STRIDE (   cap)    (((cap) >> 32) & 0xf)

Definition at line 40 of file nvme.h.

#define NVME_CAP_TIMEOUT (   cap)    (((cap) >> 24) & 0xff)

Definition at line 39 of file nvme.h.

#define NVME_IOCTL_ADMIN_CMD   _IOWR('N', 0x41, struct nvme_admin_cmd)

Definition at line 433 of file nvme.h.

#define NVME_IOCTL_ID   _IO('N', 0x40)

Definition at line 432 of file nvme.h.

#define NVME_IOCTL_SUBMIT_IO   _IOW('N', 0x42, struct nvme_user_io)

Definition at line 434 of file nvme.h.

#define NVME_VS (   major,
  minor 
)    (major << 16 | minor)

Definition at line 74 of file nvme.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
NVME_CC_ENABLE 
NVME_CC_CSS_NVM 
NVME_CC_MPS_SHIFT 
NVME_CC_ARB_RR 
NVME_CC_ARB_WRRU 
NVME_CC_ARB_VS 
NVME_CC_SHN_NONE 
NVME_CC_SHN_NORMAL 
NVME_CC_SHN_ABRUPT 
NVME_CC_IOSQES 
NVME_CC_IOCQES 
NVME_CSTS_RDY 
NVME_CSTS_CFS 
NVME_CSTS_SHST_NORMAL 
NVME_CSTS_SHST_OCCUR 
NVME_CSTS_SHST_CMPLT 

Definition at line 43 of file nvme.h.

anonymous enum
Enumerator:
NVME_NS_FEAT_THIN 
NVME_LBAF_RP_BEST 
NVME_LBAF_RP_BETTER 
NVME_LBAF_RP_GOOD 
NVME_LBAF_RP_DEGRADED 

Definition at line 132 of file nvme.h.

anonymous enum
Enumerator:
NVME_LBART_TYPE_FS 
NVME_LBART_TYPE_RAID 
NVME_LBART_TYPE_CACHE 
NVME_LBART_TYPE_SWAP 
NVME_LBART_ATTRIB_TEMP 
NVME_LBART_ATTRIB_HIDE 

Definition at line 150 of file nvme.h.

anonymous enum
Enumerator:
NVME_RW_LR 
NVME_RW_FUA 
NVME_RW_DSM_FREQ_UNSPEC 
NVME_RW_DSM_FREQ_TYPICAL 
NVME_RW_DSM_FREQ_RARE 
NVME_RW_DSM_FREQ_READS 
NVME_RW_DSM_FREQ_WRITES 
NVME_RW_DSM_FREQ_RW 
NVME_RW_DSM_FREQ_ONCE 
NVME_RW_DSM_FREQ_PREFETCH 
NVME_RW_DSM_FREQ_TEMP 
NVME_RW_DSM_LATENCY_NONE 
NVME_RW_DSM_LATENCY_IDLE 
NVME_RW_DSM_LATENCY_NORM 
NVME_RW_DSM_LATENCY_LOW 
NVME_RW_DSM_SEQ_REQ 
NVME_RW_DSM_COMPRESSED 

Definition at line 201 of file nvme.h.

anonymous enum
Enumerator:
NVME_QUEUE_PHYS_CONTIG 
NVME_CQ_IRQ_ENABLED 
NVME_SQ_PRIO_URGENT 
NVME_SQ_PRIO_HIGH 
NVME_SQ_PRIO_MEDIUM 
NVME_SQ_PRIO_LOW 
NVME_FEAT_ARBITRATION 
NVME_FEAT_POWER_MGMT 
NVME_FEAT_LBA_RANGE 
NVME_FEAT_TEMP_THRESH 
NVME_FEAT_ERR_RECOVERY 
NVME_FEAT_VOLATILE_WC 
NVME_FEAT_NUM_QUEUES 
NVME_FEAT_IRQ_COALESCE 
NVME_FEAT_IRQ_CONFIG 
NVME_FEAT_WRITE_ATOMIC 
NVME_FEAT_ASYNC_EVENT 
NVME_FEAT_SW_PROGRESS 

Definition at line 241 of file nvme.h.

anonymous enum
Enumerator:
NVME_SC_SUCCESS 
NVME_SC_INVALID_OPCODE 
NVME_SC_INVALID_FIELD 
NVME_SC_CMDID_CONFLICT 
NVME_SC_DATA_XFER_ERROR 
NVME_SC_POWER_LOSS 
NVME_SC_INTERNAL 
NVME_SC_ABORT_REQ 
NVME_SC_ABORT_QUEUE 
NVME_SC_FUSED_FAIL 
NVME_SC_FUSED_MISSING 
NVME_SC_INVALID_NS 
NVME_SC_LBA_RANGE 
NVME_SC_CAP_EXCEEDED 
NVME_SC_NS_NOT_READY 
NVME_SC_CQ_INVALID 
NVME_SC_QID_INVALID 
NVME_SC_QUEUE_SIZE 
NVME_SC_ABORT_LIMIT 
NVME_SC_ABORT_MISSING 
NVME_SC_ASYNC_LIMIT 
NVME_SC_FIRMWARE_SLOT 
NVME_SC_FIRMWARE_IMAGE 
NVME_SC_INVALID_VECTOR 
NVME_SC_INVALID_LOG_PAGE 
NVME_SC_INVALID_FORMAT 
NVME_SC_BAD_ATTRIBUTES 
NVME_SC_WRITE_FAULT 
NVME_SC_READ_ERROR 
NVME_SC_GUARD_CHECK 
NVME_SC_APPTAG_CHECK 
NVME_SC_REFTAG_CHECK 
NVME_SC_COMPARE_FAILED 
NVME_SC_ACCESS_DENIED 

Definition at line 350 of file nvme.h.

Enumerator:
nvme_admin_delete_sq 
nvme_admin_create_sq 
nvme_admin_get_log_page 
nvme_admin_delete_cq 
nvme_admin_create_cq 
nvme_admin_identify 
nvme_admin_abort_cmd 
nvme_admin_set_features 
nvme_admin_get_features 
nvme_admin_async_event 
nvme_admin_activate_fw 
nvme_admin_download_fw 
nvme_admin_format_nvm 
nvme_admin_security_send 
nvme_admin_security_recv 

Definition at line 223 of file nvme.h.

Enumerator:
nvme_cmd_flush 
nvme_cmd_write 
nvme_cmd_read 
nvme_cmd_write_uncor 
nvme_cmd_compare 
nvme_cmd_dsm 

Definition at line 162 of file nvme.h.