smartmontools SVN Rev 5611
Utility to control and monitor storage systems with "S.M.A.R.T."
Functions | Variables
nvmecmds.cpp File Reference
#include "config.h"
#include "nvmecmds.h"
#include "dev_interface.h"
#include "atacmds.h"
#include "scsicmds.h"
#include "utility.h"
#include <errno.h>
Include dependency graph for nvmecmds.cpp:

Go to the source code of this file.

Functions

static void debug_hex_dump (const void *data, unsigned size)
 
static bool nvme_pass_through (nvme_device *device, const nvme_cmd_in &in, nvme_cmd_out &out)
 
static bool nvme_pass_through (nvme_device *device, const nvme_cmd_in &in)
 
static bool nvme_read_identify (nvme_device *device, unsigned nsid, unsigned char cns, void *data, unsigned size)
 
bool nvme_read_id_ctrl (nvme_device *device, nvme_id_ctrl &id_ctrl)
 
bool nvme_read_id_ns (nvme_device *device, unsigned nsid, nvme_id_ns &id_ns)
 
static bool nvme_read_log_page_1 (nvme_device *device, unsigned nsid, unsigned char lid, void *data, unsigned size, unsigned offset=0)
 
unsigned nvme_read_log_page (nvme_device *device, unsigned nsid, unsigned char lid, void *data, unsigned size, bool lpo_sup, unsigned offset)
 
unsigned nvme_read_error_log (nvme_device *device, nvme_error_log_page *error_log, unsigned num_entries, bool lpo_sup)
 
bool nvme_read_smart_log (nvme_device *device, nvme_smart_log &smart_log)
 
bool nvme_read_self_test_log (nvme_device *device, uint32_t nsid, smartmontools::nvme_self_test_log &self_test_log)
 
bool nvme_self_test (nvme_device *device, uint8_t stc, uint32_t nsid)
 
static const char * nvme_status_to_flagged_str (uint16_t status)
 
int nvme_status_to_errno (uint16_t status)
 
const char * nvme_status_to_str (uint16_t status)
 
const char * nvme_status_to_info_str (char *buf, size_t bufsize, uint16_t status)
 

Variables

const char * nvmecmds_cvsid
 
unsigned char nvme_debugmode = 0
 

Function Documentation

◆ debug_hex_dump()

static void debug_hex_dump ( const void *  data,
unsigned  size 
)
static

Definition at line 31 of file nvmecmds.cpp.

◆ nvme_pass_through() [1/2]

static bool nvme_pass_through ( nvme_device device,
const nvme_cmd_in in 
)
static

Definition at line 112 of file nvmecmds.cpp.

◆ nvme_pass_through() [2/2]

static bool nvme_pass_through ( nvme_device device,
const nvme_cmd_in in,
nvme_cmd_out out 
)
static

Definition at line 53 of file nvmecmds.cpp.

◆ nvme_read_error_log()

unsigned nvme_read_error_log ( nvme_device device,
nvme_error_log_page error_log,
unsigned  num_entries,
bool  lpo_sup 
)

Definition at line 231 of file nvmecmds.cpp.

◆ nvme_read_id_ctrl()

bool nvme_read_id_ctrl ( nvme_device device,
nvme_id_ctrl id_ctrl 
)

Definition at line 132 of file nvmecmds.cpp.

◆ nvme_read_id_ns()

bool nvme_read_id_ns ( nvme_device device,
unsigned  nsid,
nvme_id_ns id_ns 
)

Definition at line 169 of file nvmecmds.cpp.

◆ nvme_read_identify()

static bool nvme_read_identify ( nvme_device device,
unsigned  nsid,
unsigned char  cns,
void *  data,
unsigned  size 
)
static

Definition at line 119 of file nvmecmds.cpp.

◆ nvme_read_log_page()

unsigned nvme_read_log_page ( nvme_device device,
unsigned  nsid,
unsigned char  lid,
void *  data,
unsigned  size,
bool  lpo_sup,
unsigned  offset 
)

Definition at line 208 of file nvmecmds.cpp.

◆ nvme_read_log_page_1()

static bool nvme_read_log_page_1 ( nvme_device device,
unsigned  nsid,
unsigned char  lid,
void *  data,
unsigned  size,
unsigned  offset = 0 
)
static

Definition at line 191 of file nvmecmds.cpp.

◆ nvme_read_self_test_log()

bool nvme_read_self_test_log ( nvme_device device,
uint32_t  nsid,
smartmontools::nvme_self_test_log self_test_log 
)

Definition at line 270 of file nvmecmds.cpp.

◆ nvme_read_smart_log()

bool nvme_read_smart_log ( nvme_device device,
nvme_smart_log smart_log 
)

Definition at line 254 of file nvmecmds.cpp.

◆ nvme_self_test()

bool nvme_self_test ( nvme_device device,
uint8_t  stc,
uint32_t  nsid 
)

Definition at line 285 of file nvmecmds.cpp.

◆ nvme_status_to_errno()

int nvme_status_to_errno ( uint16_t  status)

Definition at line 472 of file nvmecmds.cpp.

◆ nvme_status_to_flagged_str()

static const char * nvme_status_to_flagged_str ( uint16_t  status)
static

Definition at line 296 of file nvmecmds.cpp.

◆ nvme_status_to_info_str()

const char * nvme_status_to_info_str ( char *  buf,
size_t  bufsize,
uint16_t  status 
)

Definition at line 490 of file nvmecmds.cpp.

◆ nvme_status_to_str()

const char * nvme_status_to_str ( uint16_t  status)

Definition at line 483 of file nvmecmds.cpp.

Variable Documentation

◆ nvme_debugmode

unsigned char nvme_debugmode = 0

Definition at line 27 of file nvmecmds.cpp.

◆ nvmecmds_cvsid

const char* nvmecmds_cvsid
Initial value:
= "$Id: nvmecmds.cpp 5473 2023-05-30 12:36:57Z chrfranke $"
#define NVMECMDS_H_CVSID
Definition: nvmecmds.h:17

Definition at line 14 of file nvmecmds.cpp.