linux/include/linux/nvme.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Definitions for the NVM Express interface
 * Copyright (c) 2011-2014, Intel Corporation.
 */

#ifndef _LINUX_NVME_H
#define _LINUX_NVME_H

#include <linux/bits.h>
#include <linux/types.h>
#include <linux/uuid.h>

/* NQN names in commands fields specified one size */
#define NVMF_NQN_FIELD_LEN

/* However the max length of a qualified name is another size */
#define NVMF_NQN_SIZE

#define NVMF_TRSVCID_SIZE
#define NVMF_TRADDR_SIZE
#define NVMF_TSAS_SIZE

#define NVME_DISC_SUBSYS_NAME

#define NVME_NSID_ALL

/* Special NSSR value, 'NVMe' */
#define NVME_SUBSYS_RESET

enum nvme_subsys_type {};

enum nvme_ctrl_type {};

enum nvme_dctype {};

/* Address Family codes for Discovery Log Page entry ADRFAM field */
enum {};

/* Transport Type codes for Discovery Log Page entry TRTYPE field */
enum {};

/* Transport Requirements codes for Discovery Log Page entry TREQ field */
enum {};

/* RDMA QP Service Type codes for Discovery Log Page entry TSAS
 * RDMA_QPTYPE field
 */
enum {};

/* RDMA Provider Type codes for Discovery Log Page entry TSAS
 * RDMA_PRTYPE field
 */
enum {};

/* RDMA Connection Management Service Type codes for Discovery Log Page
 * entry TSAS RDMA_CMS field
 */
enum {};

/* TSAS SECTYPE for TCP transport */
enum {};

#define NVME_AQ_DEPTH
#define NVME_NR_AEN_COMMANDS
#define NVME_AQ_BLK_MQ_DEPTH

/*
 * Subtract one to leave an empty queue entry for 'Full Queue' condition. See
 * NVM-Express 1.2 specification, section 4.1.2.
 */
#define NVME_AQ_MQ_TAG_DEPTH

enum {};

#define NVME_CAP_MQES(cap)
#define NVME_CAP_TIMEOUT(cap)
#define NVME_CAP_STRIDE(cap)
#define NVME_CAP_NSSRC(cap)
#define NVME_CAP_CSS(cap)
#define NVME_CAP_MPSMIN(cap)
#define NVME_CAP_MPSMAX(cap)
#define NVME_CAP_CMBS(cap)

#define NVME_CMB_BIR(cmbloc)
#define NVME_CMB_OFST(cmbloc)

#define NVME_CRTO_CRIMT(crto)
#define NVME_CRTO_CRWMT(crto)

enum {};

/*
 * Submission and Completion Queue Entry Sizes for the NVM command set.
 * (In bytes and specified as a power of two (2^n)).
 */
#define NVME_ADM_SQES
#define NVME_NVM_IOSQES
#define NVME_NVM_IOCQES

enum {};

enum {};

enum {};

enum {};

enum {};

struct nvme_id_power_state {};

enum {};

enum nvme_ctrl_attr {};

struct nvme_id_ctrl {};

enum {};

struct nvme_lbaf {};

struct nvme_id_ns {};

/* I/O Command Set Independent Identify Namespace Data Structure */
struct nvme_id_ns_cs_indep {};

struct nvme_zns_lbafe {};

struct nvme_id_ns_zns {};

struct nvme_id_ctrl_zns {};

struct nvme_id_ns_nvm {};

enum {};

static inline __u8 nvme_elbaf_sts(__u32 elbaf)
{}

static inline __u8 nvme_elbaf_guard_type(__u32 elbaf)
{}

static inline __u8 nvme_elbaf_qualified_guard_type(__u32 elbaf)
{}

struct nvme_id_ctrl_nvm {};

enum {};

enum {};

enum {};

enum {};

enum {};

enum {};

static inline __u8 nvme_lbaf_index(__u8 flbas)
{}

/* Identify Namespace Metadata Capabilities (MC): */
enum {};

struct nvme_ns_id_desc {};

#define NVME_NIDT_EUI64_LEN
#define NVME_NIDT_NGUID_LEN
#define NVME_NIDT_UUID_LEN
#define NVME_NIDT_CSI_LEN

enum {};

struct nvme_smart_log {};

struct nvme_fw_slot_info_log {};

enum {};

struct nvme_effects_log {};

enum nvme_ana_state {};

struct nvme_ana_group_desc {};

/* flag for the log specific field of the ANA log */
#define NVME_ANA_LOG_RGO

struct nvme_ana_rsp_hdr {};

struct nvme_zone_descriptor {};

enum {};

struct nvme_zone_report {};

enum {};

enum {};

enum {};

enum {};

enum {};

enum {};

struct nvme_lba_range_type {};

enum {};

enum nvme_pr_type {};

enum nvme_eds {};

struct nvme_registered_ctrl {};

struct nvme_reservation_status {};

struct nvme_registered_ctrl_ext {};

struct nvme_reservation_status_ext {};

/* I/O commands */

enum nvme_opcode {};

#define nvme_opcode_name(opcode)
#define show_nvm_opcode_name(val)



/*
 * Descriptor subtype - lower 4 bits of nvme_(keyed_)sgl_desc identifier
 *
 * @NVME_SGL_FMT_ADDRESS:     absolute address of the data block
 * @NVME_SGL_FMT_OFFSET:      relative offset of the in-capsule data block
 * @NVME_SGL_FMT_TRANSPORT_A: transport defined format, value 0xA
 * @NVME_SGL_FMT_INVALIDATE:  RDMA transport specific remote invalidation
 *                            request subtype
 */
enum {};

/*
 * Descriptor type - upper 4 bits of nvme_(keyed_)sgl_desc identifier
 *
 * For struct nvme_sgl_desc:
 *   @NVME_SGL_FMT_DATA_DESC:		data block descriptor
 *   @NVME_SGL_FMT_SEG_DESC:		sgl segment descriptor
 *   @NVME_SGL_FMT_LAST_SEG_DESC:	last sgl segment descriptor
 *
 * For struct nvme_keyed_sgl_desc:
 *   @NVME_KEY_SGL_FMT_DATA_DESC:	keyed data block descriptor
 *
 * Transport-specific SGL types:
 *   @NVME_TRANSPORT_SGL_DATA_DESC:	Transport SGL data dlock descriptor
 */
enum {};

struct nvme_sgl_desc {};

struct nvme_keyed_sgl_desc {};

nvme_data_ptr;

/*
 * Lowest two bits of our flags field (FUSE field in the spec):
 *
 * @NVME_CMD_FUSE_FIRST:   Fused Operation, first command
 * @NVME_CMD_FUSE_SECOND:  Fused Operation, second command
 *
 * Highest two bits in our flags field (PSDT field in the spec):
 *
 * @NVME_CMD_PSDT_SGL_METABUF:	Use SGLS for this transfer,
 *	If used, MPTR contains addr of single physical buffer (byte aligned).
 * @NVME_CMD_PSDT_SGL_METASEG:	Use SGLS for this transfer,
 *	If used, MPTR contains an address of an SGL segment containing
 *	exactly 1 SGL descriptor (qword aligned).
 */
enum {};

struct nvme_common_command {};

struct nvme_rw_command {};

enum {};

struct nvme_dsm_cmd {};

enum {};

#define NVME_DSM_MAX_RANGES

struct nvme_dsm_range {};

struct nvme_write_zeroes_cmd {};

enum nvme_zone_mgmt_action {};

struct nvme_zone_mgmt_send_cmd {};

struct nvme_zone_mgmt_recv_cmd {};

enum {};

/* Features */

enum {};

struct nvme_feat_auto_pst {};

enum {};

struct nvme_feat_host_behavior {};

enum {};

/* Admin commands */

enum nvme_admin_opcode {};

#define nvme_admin_opcode_name(opcode)
#define show_admin_opcode_name(val)

enum {};

/* NVMe Namespace Write Protect State */
enum {};

#define NVME_MAX_CHANGED_NAMESPACES

struct nvme_identify {};

#define NVME_IDENTIFY_DATA_SIZE

struct nvme_features {};

struct nvme_host_mem_buf_desc {};

struct nvme_create_cq {};

struct nvme_create_sq {};

struct nvme_delete_queue {};

struct nvme_abort_cmd {};

struct nvme_download_firmware {};

struct nvme_format_cmd {};

struct nvme_get_log_page_command {};

struct nvme_directive_cmd {};

/*
 * Fabrics subcommands.
 */
enum nvmf_fabrics_opcode {};

enum nvmf_capsule_command {};

#define nvme_fabrics_type_name(type)
#define show_fabrics_type_name(type)

/*
 * If not fabrics command, fctype will be ignored.
 */
#define show_opcode_name(qid, opcode, fctype)

struct nvmf_common_command {};

/*
 * The legal cntlid range a NVMe Target will provide.
 * Note that cntlid of value 0 is considered illegal in the fabrics world.
 * Devices based on earlier specs did not have the subsystem concept;
 * therefore, those devices had their cntlid value set to 0 as a result.
 */
#define NVME_CNTLID_MIN
#define NVME_CNTLID_MAX
#define NVME_CNTLID_DYNAMIC

#define MAX_DISC_LOGS

/* Discovery log page entry flags (EFLAGS): */
enum {};

/* Discovery log page entry */
struct nvmf_disc_rsp_page_entry {};

/* Discovery log page header */
struct nvmf_disc_rsp_page_hdr {};

enum {};

struct nvmf_connect_command {};

enum {};

struct nvmf_connect_data {};

struct nvmf_property_set_command {};

struct nvmf_property_get_command {};

struct nvmf_auth_common_command {};

struct nvmf_auth_send_command {};

struct nvmf_auth_receive_command {};

/* Value for secp */
enum {};

/* Defined value for auth_type */
enum {};

/* Defined messages for auth_id */
enum {};

struct nvmf_auth_dhchap_protocol_descriptor {};

enum {};

/* Defined hash functions for DH-HMAC-CHAP authentication */
enum {};

/* Defined Diffie-Hellman group identifiers for DH-HMAC-CHAP authentication */
enum {};

nvmf_auth_protocol;

struct nvmf_auth_dhchap_negotiate_data {};

struct nvmf_auth_dhchap_challenge_data {};

struct nvmf_auth_dhchap_reply_data {};

enum {};

struct nvmf_auth_dhchap_success1_data {};

struct nvmf_auth_dhchap_success2_data {};

struct nvmf_auth_dhchap_failure_data {};

enum {};

enum {};


struct nvme_dbbuf {};

struct streams_directive_params {};

struct nvme_command {};

static inline bool nvme_is_fabrics(const struct nvme_command *cmd)
{}

struct nvme_error_slot {};

static inline bool nvme_is_write(const struct nvme_command *cmd)
{}

enum {};

#define NVME_SCT(status)

struct nvme_completion {};

#define NVME_VS(major, minor, tertiary)

#define NVME_MAJOR(ver)
#define NVME_MINOR(ver)
#define NVME_TERTIARY(ver)

#endif /* _LINUX_NVME_H */