drivers/nvme/host/constants.c

Source file repositories/reference/linux-study-clean/drivers/nvme/host/constants.c

File Facts

System
Linux kernel
Corpus path
drivers/nvme/host/constants.c
Extension
.c
Size
9580 bytes
Lines
204
Domain
Representative Device Path
Bucket
PCIe NVMe Storage Path
Inferred role
Representative Device Path: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0
/*
 * NVM Express device driver verbose errors
 * Copyright (c) 2022, Oracle and/or its affiliates
 */

#include "nvme.h"

static const char * const nvme_ops[] = {
	[nvme_cmd_flush] = "Flush",
	[nvme_cmd_write] = "Write",
	[nvme_cmd_read] = "Read",
	[nvme_cmd_write_uncor] = "Write Uncorrectable",
	[nvme_cmd_compare] = "Compare",
	[nvme_cmd_write_zeroes] = "Write Zeroes",
	[nvme_cmd_dsm] = "Dataset Management",
	[nvme_cmd_verify] = "Verify",
	[nvme_cmd_resv_register] = "Reservation Register",
	[nvme_cmd_resv_report] = "Reservation Report",
	[nvme_cmd_resv_acquire] = "Reservation Acquire",
	[nvme_cmd_resv_release] = "Reservation Release",
	[nvme_cmd_zone_mgmt_send] = "Zone Management Send",
	[nvme_cmd_zone_mgmt_recv] = "Zone Management Receive",
	[nvme_cmd_zone_append] = "Zone Append",
};

static const char * const nvme_admin_ops[] = {
	[nvme_admin_delete_sq] = "Delete SQ",
	[nvme_admin_create_sq] = "Create SQ",
	[nvme_admin_get_log_page] = "Get Log Page",
	[nvme_admin_delete_cq] = "Delete CQ",
	[nvme_admin_create_cq] = "Create CQ",
	[nvme_admin_identify] = "Identify",
	[nvme_admin_abort_cmd] = "Abort Command",
	[nvme_admin_set_features] = "Set Features",
	[nvme_admin_get_features] = "Get Features",
	[nvme_admin_async_event] = "Async Event",
	[nvme_admin_ns_mgmt] = "Namespace Management",
	[nvme_admin_activate_fw] = "Activate Firmware",
	[nvme_admin_download_fw] = "Download Firmware",
	[nvme_admin_dev_self_test] = "Device Self Test",
	[nvme_admin_ns_attach] = "Namespace Attach",
	[nvme_admin_keep_alive] = "Keep Alive",
	[nvme_admin_directive_send] = "Directive Send",
	[nvme_admin_directive_recv] = "Directive Receive",
	[nvme_admin_virtual_mgmt] = "Virtual Management",
	[nvme_admin_nvme_mi_send] = "NVMe Send MI",
	[nvme_admin_nvme_mi_recv] = "NVMe Receive MI",
	[nvme_admin_dbbuf] = "Doorbell Buffer Config",
	[nvme_admin_format_nvm] = "Format NVM",
	[nvme_admin_security_send] = "Security Send",
	[nvme_admin_security_recv] = "Security Receive",
	[nvme_admin_sanitize_nvm] = "Sanitize NVM",
	[nvme_admin_get_lba_status] = "Get LBA Status",
};

static const char * const nvme_fabrics_ops[] = {
	[nvme_fabrics_type_property_set] = "Property Set",
	[nvme_fabrics_type_property_get] = "Property Get",
	[nvme_fabrics_type_connect] = "Connect",
	[nvme_fabrics_type_auth_send] = "Authentication Send",
	[nvme_fabrics_type_auth_receive] = "Authentication Receive",
};

static const char * const nvme_statuses[] = {
	[NVME_SC_SUCCESS] = "Success",
	[NVME_SC_INVALID_OPCODE] = "Invalid Command Opcode",
	[NVME_SC_INVALID_FIELD] = "Invalid Field in Command",
	[NVME_SC_CMDID_CONFLICT] = "Command ID Conflict",
	[NVME_SC_DATA_XFER_ERROR] = "Data Transfer Error",
	[NVME_SC_POWER_LOSS] = "Commands Aborted due to Power Loss Notification",
	[NVME_SC_INTERNAL] = "Internal Error",
	[NVME_SC_ABORT_REQ] = "Command Abort Requested",
	[NVME_SC_ABORT_QUEUE] = "Command Aborted due to SQ Deletion",
	[NVME_SC_FUSED_FAIL] = "Command Aborted due to Failed Fused Command",
	[NVME_SC_FUSED_MISSING] = "Command Aborted due to Missing Fused Command",
	[NVME_SC_INVALID_NS] = "Invalid Namespace or Format",
	[NVME_SC_CMD_SEQ_ERROR] = "Command Sequence Error",
	[NVME_SC_SGL_INVALID_LAST] = "Invalid SGL Segment Descriptor",
	[NVME_SC_SGL_INVALID_COUNT] = "Invalid Number of SGL Descriptors",
	[NVME_SC_SGL_INVALID_DATA] = "Data SGL Length Invalid",
	[NVME_SC_SGL_INVALID_METADATA] = "Metadata SGL Length Invalid",
	[NVME_SC_SGL_INVALID_TYPE] = "SGL Descriptor Type Invalid",
	[NVME_SC_CMB_INVALID_USE] = "Invalid Use of Controller Memory Buffer",
	[NVME_SC_PRP_INVALID_OFFSET] = "PRP Offset Invalid",
	[NVME_SC_ATOMIC_WU_EXCEEDED] = "Atomic Write Unit Exceeded",
	[NVME_SC_OP_DENIED] = "Operation Denied",
	[NVME_SC_SGL_INVALID_OFFSET] = "SGL Offset Invalid",
	[NVME_SC_RESERVED] = "Reserved",
	[NVME_SC_HOST_ID_INCONSIST] = "Host Identifier Inconsistent Format",

Annotation

Implementation Notes