smartmontools SVN Rev 5645
Utility to control and monitor storage systems with "S.M.A.R.T."
Classes | Macros | Enumerations | Functions | Variables
scsicmds.cpp File Reference
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include "config.h"
#include "scsicmds.h"
#include "dev_interface.h"
#include "utility.h"
#include "sg_unaligned.h"
Include dependency graph for scsicmds.cpp:

Go to the source code of this file.

Classes

struct  scsi_sa_var_map
 
struct  scsi_opcode_name
 

Macros

#define RSOC_RESP_SZ   4096
 
#define RSOC_ALL_CMDS_CTDP_0   8
 
#define RSOC_ALL_CMDS_CTDP_1   20
 
#define RSOC_1_CMD_CTDP_0   36
 
#define DEXCPT_ENABLE   0x08
 
#define EWASC_ENABLE   0x10
 
#define DEXCPT_DISABLE   0xf7
 
#define EWASC_DISABLE   0xef
 
#define TEST_DISABLE   0xfb
 
#define SCSI_IEC_MP_BYTE2_ENABLED   0x10
 
#define SCSI_IEC_MP_BYTE2_TEST_MASK   0x4
 
#define SCSI_IEC_MP_MRIE   6
 
#define SCSI_IEC_MP_INTERVAL_T   0
 
#define SCSI_IEC_MP_REPORT_COUNT   1
 

Enumerations

enum  scsi_sa_t { scsi_sa_none = 0 , scsi_sa_b1b4n5 , scsi_sa_b8b7n16 }
 

Functions

static scsi_cmd_support chk_lsense_spc (scsi_device *device)
 
static int my_isprint (uint8_t ch)
 
static int trimTrailingSpaces (char *b)
 
static void dStrHexHelper (const uint8_t *up, int len, int no_ascii, void(*out)(const char *s, void *ctx), void *ctx=nullptr)
 
void dStrHexFp (const uint8_t *up, int len, int no_ascii, FILE *fp)
 
void dStrHex (const uint8_t *up, int len, int no_ascii)
 
bool is_scsi_cdb (const uint8_t *cdbp, int clen)
 
const char * scsi_get_opcode_name (const uint8_t *cdbp)
 
void scsi_do_sense_disect (const struct scsi_cmnd_io *io_buf, struct scsi_sense_disect *out)
 
int scsiSimpleSenseFilter (const struct scsi_sense_disect *sinfo)
 
const char * scsiErrString (int scsiErr)
 
char * scsi_get_sense_key_str (int sense_key, int buff_len, char *buff)
 
int scsi_vpd_dev_id_iter (const unsigned char *initial_desig_desc, int page_len, int *off, int m_assoc, int m_desig_type, int m_code_set)
 
int scsi_decode_lu_dev_id (const unsigned char *b, int blen, char *s, int slen, int *transport)
 
int scsiLogSense (scsi_device *device, int pagenum, int subpagenum, uint8_t *pBuf, int bufLen, int known_resp_len)
 
int scsiLogSelect (scsi_device *device, int pcr, int sp, int pc, int pagenum, int subpagenum, uint8_t *pBuf, int bufLen)
 
int scsiModeSense (scsi_device *device, int pagenum, int subpagenum, int pc, uint8_t *pBuf, int bufLen)
 
int scsiModeSelect (scsi_device *device, int sp, uint8_t *pBuf, int bufLen)
 
int scsiModeSense10 (scsi_device *device, int pagenum, int subpagenum, int pc, uint8_t *pBuf, int bufLen)
 
int scsiModeSelect10 (scsi_device *device, int sp, uint8_t *pBuf, int bufLen)
 
int scsiStdInquiry (scsi_device *device, uint8_t *pBuf, int bufLen)
 
int scsiInquiryVpd (scsi_device *device, int vpd_page, uint8_t *pBuf, int bufLen)
 
int scsiRequestSense (scsi_device *device, struct scsi_sense_disect *sense_info)
 
int scsiSetPowerCondition (scsi_device *device, int power_cond, int pcond_modifier)
 
int scsiSendDiagnostic (scsi_device *device, int functioncode, uint8_t *pBuf, int bufLen)
 
static int _testunitready (scsi_device *device, struct scsi_sense_disect *sinfop)
 
int scsiTestUnitReady (scsi_device *device)
 
int scsiReadDefect10 (scsi_device *device, int req_plist, int req_glist, int dl_format, uint8_t *pBuf, int bufLen)
 
int scsiReadDefect12 (scsi_device *device, int req_plist, int req_glist, int dl_format, int addrDescIndex, uint8_t *pBuf, int bufLen)
 
bool scsi_pass_through_yield_sense (scsi_device *device, scsi_cmnd_io *iop, scsi_sense_disect &sinfo)
 
int scsiReadCapacity10 (scsi_device *device, unsigned int *last_lbap, unsigned int *lb_sizep)
 
int scsiReadCapacity16 (scsi_device *device, uint8_t *pBuf, int bufLen)
 
int scsiRSOCcmd (scsi_device *device, bool rctd, uint8_t rep_opt, uint8_t opcode, uint16_t serv_act, uint8_t *pBuf, int bufLen, int &rspLen)
 
uint64_t scsiGetSize (scsi_device *device, bool avoid_rcap16, struct scsi_readcap_resp *srrp)
 
int scsiModePageOffset (const uint8_t *resp, int len, int modese_len)
 
int scsiFetchIECmpage (scsi_device *device, struct scsi_iec_mode_page *iecp, int modese_len)
 
int scsi_IsExceptionControlEnabled (const struct scsi_iec_mode_page *iecp)
 
int scsi_IsWarningEnabled (const struct scsi_iec_mode_page *iecp)
 
int scsiSetExceptionControlAndWarning (scsi_device *device, int enabled, const struct scsi_iec_mode_page *iecp)
 
int scsiGetTemp (scsi_device *device, uint8_t *currenttemp, uint8_t *triptemp)
 
int scsiCheckIE (scsi_device *device, int hasIELogPage, int hasTempLogPage, uint8_t *asc, uint8_t *ascq, uint8_t *currenttemp, uint8_t *triptemp)
 
const char * scsiTapeAlertsTapeDevice (unsigned short code)
 
const char * scsiTapeAlertsChangerDevice (unsigned short code)
 
int scsiSmartDefaultSelfTest (scsi_device *device)
 
int scsiSmartShortSelfTest (scsi_device *device)
 
int scsiSmartExtendSelfTest (scsi_device *device)
 
int scsiSmartShortCapSelfTest (scsi_device *device)
 
int scsiSmartExtendCapSelfTest (scsi_device *device)
 
int scsiSmartSelfTestAbort (scsi_device *device)
 
int scsiFetchExtendedSelfTestTime (scsi_device *device, int *durationSec, int modese_len)
 
void scsiDecodeErrCounterPage (unsigned char *resp, struct scsiErrorCounter *ecp, int allocLen)
 
void scsiDecodeNonMediumErrPage (unsigned char *resp, struct scsiNonMediumError *nmep, int allocLen)
 
int scsiCountFailedSelfTests (scsi_device *fd, int noisy)
 
int scsiSelfTestInProgress (scsi_device *fd, int *inProgress)
 
int scsiFetchControlGLTSD (scsi_device *device, int modese_len, int current)
 
int scsiGetRPM (scsi_device *device, int modese_len, int *form_factorp, int *haw_zbcp)
 
int scsiGetSetCache (scsi_device *device, int modese_len, short int *wcep, short int *rcdp)
 
int scsiSetControlGLTSD (scsi_device *device, int enabled, int modese_len)
 
int scsiFetchTransportProtocol (scsi_device *device, int modese_len)
 
const unsigned char * sg_scsi_sense_desc_find (const unsigned char *sensep, int sense_len, int desc_type)
 
void scsi_format_id_string (char *out, const uint8_t *in, int n)
 
char * scsiGetIEString (uint8_t asc, uint8_t ascq, char *b, int blen)
 

Variables

const char * scsicmds_c_cvsid
 
static const char * logSenStr = "Log Sense"
 
unsigned char scsi_debugmode = 0
 
supported_vpd_pagessupported_vpd_pages_p = nullptr
 
static struct scsi_sa_var_map sa_var_a []
 
static struct scsi_opcode_name opcode_name_arr []
 
static const char * vendor_specific = "<vendor specific>"
 
static const char * sense_key_desc []
 
static const char * TapeAlertsMessageTable []
 
static const char * ChangerTapeAlertsMessageTable []
 
static const char * wn = "Warning"
 
static const char * wn1_9 []
 
static const char * five_d_t []
 
static const char * impfail = "impending failure"
 
static const char * impending0_c []
 
static const char * pred = "prediction threshold exceeded"
 

Macro Definition Documentation

◆ DEXCPT_DISABLE

#define DEXCPT_DISABLE   0xf7

Definition at line 1828 of file scsicmds.cpp.

◆ DEXCPT_ENABLE

#define DEXCPT_ENABLE   0x08

Definition at line 1826 of file scsicmds.cpp.

◆ EWASC_DISABLE

#define EWASC_DISABLE   0xef

Definition at line 1829 of file scsicmds.cpp.

◆ EWASC_ENABLE

#define EWASC_ENABLE   0x10

Definition at line 1827 of file scsicmds.cpp.

◆ RSOC_1_CMD_CTDP_0

#define RSOC_1_CMD_CTDP_0   36

Definition at line 52 of file scsicmds.cpp.

◆ RSOC_ALL_CMDS_CTDP_0

#define RSOC_ALL_CMDS_CTDP_0   8

Definition at line 50 of file scsicmds.cpp.

◆ RSOC_ALL_CMDS_CTDP_1

#define RSOC_ALL_CMDS_CTDP_1   20

Definition at line 51 of file scsicmds.cpp.

◆ RSOC_RESP_SZ

#define RSOC_RESP_SZ   4096

Definition at line 49 of file scsicmds.cpp.

◆ SCSI_IEC_MP_BYTE2_ENABLED

#define SCSI_IEC_MP_BYTE2_ENABLED   0x10

Definition at line 1913 of file scsicmds.cpp.

◆ SCSI_IEC_MP_BYTE2_TEST_MASK

#define SCSI_IEC_MP_BYTE2_TEST_MASK   0x4

Definition at line 1914 of file scsicmds.cpp.

◆ SCSI_IEC_MP_INTERVAL_T

#define SCSI_IEC_MP_INTERVAL_T   0

Definition at line 1917 of file scsicmds.cpp.

◆ SCSI_IEC_MP_MRIE

#define SCSI_IEC_MP_MRIE   6

Definition at line 1916 of file scsicmds.cpp.

◆ SCSI_IEC_MP_REPORT_COUNT

#define SCSI_IEC_MP_REPORT_COUNT   1

Definition at line 1918 of file scsicmds.cpp.

◆ TEST_DISABLE

#define TEST_DISABLE   0xfb

Definition at line 1830 of file scsicmds.cpp.

Enumeration Type Documentation

◆ scsi_sa_t

enum scsi_sa_t
Enumerator
scsi_sa_none 
scsi_sa_b1b4n5 
scsi_sa_b8b7n16 

Definition at line 440 of file scsicmds.cpp.

Function Documentation

◆ _testunitready()

static int _testunitready ( scsi_device device,
struct scsi_sense_disect sinfop 
)
static

Definition at line 1425 of file scsicmds.cpp.

◆ chk_lsense_spc()

static scsi_cmd_support chk_lsense_spc ( scsi_device device)
static

Definition at line 56 of file scsicmds.cpp.

◆ dStrHex()

void dStrHex ( const uint8_t *  up,
int  len,
int  no_ascii 
)

Definition at line 368 of file scsicmds.cpp.

◆ dStrHexFp()

void dStrHexFp ( const uint8_t *  up,
int  len,
int  no_ascii,
FILE *  fp 
)

Definition at line 344 of file scsicmds.cpp.

◆ dStrHexHelper()

static void dStrHexHelper ( const uint8_t *  up,
int  len,
int  no_ascii,
void(*)(const char *s, void *ctx)  out,
void *  ctx = nullptr 
)
static

Definition at line 248 of file scsicmds.cpp.

◆ is_scsi_cdb()

bool is_scsi_cdb ( const uint8_t *  cdbp,
int  clen 
)

Definition at line 391 of file scsicmds.cpp.

◆ my_isprint()

static int my_isprint ( uint8_t  ch)
inlinestatic

Definition at line 230 of file scsicmds.cpp.

◆ scsi_decode_lu_dev_id()

int scsi_decode_lu_dev_id ( const unsigned char *  b,
int  blen,
char *  s,
int  slen,
int *  transport 
)

Definition at line 747 of file scsicmds.cpp.

◆ scsi_do_sense_disect()

void scsi_do_sense_disect ( const struct scsi_cmnd_io io_buf,
struct scsi_sense_disect out 
)

Definition at line 565 of file scsicmds.cpp.

◆ scsi_format_id_string()

void scsi_format_id_string ( char *  out,
const uint8_t *  in,
int  n 
)

Definition at line 3117 of file scsicmds.cpp.

◆ scsi_get_opcode_name()

const char * scsi_get_opcode_name ( const uint8_t *  cdbp)

Definition at line 511 of file scsicmds.cpp.

◆ scsi_get_sense_key_str()

char * scsi_get_sense_key_str ( int  sense_key,
int  buff_len,
char *  buff 
)

Definition at line 695 of file scsicmds.cpp.

◆ scsi_IsExceptionControlEnabled()

int scsi_IsExceptionControlEnabled ( const struct scsi_iec_mode_page iecp)

Definition at line 1885 of file scsicmds.cpp.

◆ scsi_IsWarningEnabled()

int scsi_IsWarningEnabled ( const struct scsi_iec_mode_page iecp)

Definition at line 1899 of file scsicmds.cpp.

◆ scsi_pass_through_yield_sense()

bool scsi_pass_through_yield_sense ( scsi_device device,
scsi_cmnd_io iop,
scsi_sense_disect sinfo 
)

Definition at line 1543 of file scsicmds.cpp.

◆ scsi_vpd_dev_id_iter()

int scsi_vpd_dev_id_iter ( const unsigned char *  initial_desig_desc,
int  page_len,
int *  off,
int  m_assoc,
int  m_desig_type,
int  m_code_set 
)

Definition at line 718 of file scsicmds.cpp.

◆ scsiCheckIE()

int scsiCheckIE ( scsi_device device,
int  hasIELogPage,
int  hasTempLogPage,
uint8_t *  asc,
uint8_t *  ascq,
uint8_t *  currenttemp,
uint8_t *  triptemp 
)

Definition at line 2028 of file scsicmds.cpp.

◆ scsiCountFailedSelfTests()

int scsiCountFailedSelfTests ( scsi_device fd,
int  noisy 
)

Definition at line 2722 of file scsicmds.cpp.

◆ scsiDecodeErrCounterPage()

void scsiDecodeErrCounterPage ( unsigned char *  resp,
struct scsiErrorCounter ecp,
int  allocLen 
)

Definition at line 2609 of file scsicmds.cpp.

◆ scsiDecodeNonMediumErrPage()

void scsiDecodeNonMediumErrPage ( unsigned char *  resp,
struct scsiNonMediumError nmep,
int  allocLen 
)

Definition at line 2654 of file scsicmds.cpp.

◆ scsiErrString()

const char * scsiErrString ( int  scsiErr)

Definition at line 630 of file scsicmds.cpp.

◆ scsiFetchControlGLTSD()

int scsiFetchControlGLTSD ( scsi_device device,
int  modese_len,
int  current 
)

Definition at line 2801 of file scsicmds.cpp.

◆ scsiFetchExtendedSelfTestTime()

int scsiFetchExtendedSelfTestTime ( scsi_device device,
int *  durationSec,
int  modese_len 
)

Definition at line 2557 of file scsicmds.cpp.

◆ scsiFetchIECmpage()

int scsiFetchIECmpage ( scsi_device device,
struct scsi_iec_mode_page iecp,
int  modese_len 
)

Definition at line 1838 of file scsicmds.cpp.

◆ scsiFetchTransportProtocol()

int scsiFetchTransportProtocol ( scsi_device device,
int  modese_len 
)

Definition at line 3057 of file scsicmds.cpp.

◆ scsiGetIEString()

char * scsiGetIEString ( uint8_t  asc,
uint8_t  ascq,
char *  b,
int  blen 
)

Definition at line 3198 of file scsicmds.cpp.

◆ scsiGetRPM()

int scsiGetRPM ( scsi_device device,
int  modese_len,
int *  form_factorp,
int *  haw_zbcp 
)

Definition at line 2838 of file scsicmds.cpp.

◆ scsiGetSetCache()

int scsiGetSetCache ( scsi_device device,
int  modese_len,
short int *  wcep,
short int *  rcdp 
)

Definition at line 2883 of file scsicmds.cpp.

◆ scsiGetSize()

uint64_t scsiGetSize ( scsi_device device,
bool  avoid_rcap16,
struct scsi_readcap_resp srrp 
)

Definition at line 1713 of file scsicmds.cpp.

◆ scsiGetTemp()

int scsiGetTemp ( scsi_device device,
uint8_t *  currenttemp,
uint8_t *  triptemp 
)

Definition at line 2000 of file scsicmds.cpp.

◆ scsiInquiryVpd()

int scsiInquiryVpd ( scsi_device device,
int  vpd_page,
uint8_t *  pBuf,
int  bufLen 
)

Definition at line 1210 of file scsicmds.cpp.

◆ scsiLogSelect()

int scsiLogSelect ( scsi_device device,
int  pcr,
int  sp,
int  pc,
int  pagenum,
int  subpagenum,
uint8_t *  pBuf,
int  bufLen 
)

Definition at line 962 of file scsicmds.cpp.

◆ scsiLogSense()

int scsiLogSense ( scsi_device device,
int  pagenum,
int  subpagenum,
uint8_t *  pBuf,
int  bufLen,
int  known_resp_len 
)

Definition at line 873 of file scsicmds.cpp.

◆ scsiModePageOffset()

int scsiModePageOffset ( const uint8_t *  resp,
int  len,
int  modese_len 
)

Definition at line 1795 of file scsicmds.cpp.

◆ scsiModeSelect()

int scsiModeSelect ( scsi_device device,
int  sp,
uint8_t *  pBuf,
int  bufLen 
)

Definition at line 1040 of file scsicmds.cpp.

◆ scsiModeSelect10()

int scsiModeSelect10 ( scsi_device device,
int  sp,
uint8_t *  pBuf,
int  bufLen 
)

Definition at line 1123 of file scsicmds.cpp.

◆ scsiModeSense()

int scsiModeSense ( scsi_device device,
int  pagenum,
int  subpagenum,
int  pc,
uint8_t *  pBuf,
int  bufLen 
)

Definition at line 994 of file scsicmds.cpp.

◆ scsiModeSense10()

int scsiModeSense10 ( scsi_device device,
int  pagenum,
int  subpagenum,
int  pc,
uint8_t *  pBuf,
int  bufLen 
)

Definition at line 1079 of file scsicmds.cpp.

◆ scsiReadCapacity10()

int scsiReadCapacity10 ( scsi_device device,
unsigned int *  last_lbap,
unsigned int *  lb_sizep 
)

Definition at line 1609 of file scsicmds.cpp.

◆ scsiReadCapacity16()

int scsiReadCapacity16 ( scsi_device device,
uint8_t *  pBuf,
int  bufLen 
)

Definition at line 1645 of file scsicmds.cpp.

◆ scsiReadDefect10()

int scsiReadDefect10 ( scsi_device device,
int  req_plist,
int  req_glist,
int  dl_format,
uint8_t *  pBuf,
int  bufLen 
)

Definition at line 1472 of file scsicmds.cpp.

◆ scsiReadDefect12()

int scsiReadDefect12 ( scsi_device device,
int  req_plist,
int  req_glist,
int  dl_format,
int  addrDescIndex,
uint8_t *  pBuf,
int  bufLen 
)

Definition at line 1506 of file scsicmds.cpp.

◆ scsiRequestSense()

int scsiRequestSense ( scsi_device device,
struct scsi_sense_disect sense_info 
)

Definition at line 1268 of file scsicmds.cpp.

◆ scsiRSOCcmd()

int scsiRSOCcmd ( scsi_device device,
bool  rctd,
uint8_t  rep_opt,
uint8_t  opcode,
uint16_t  serv_act,
uint8_t *  pBuf,
int  bufLen,
int &  rspLen 
)

Definition at line 1672 of file scsicmds.cpp.

◆ scsiSelfTestInProgress()

int scsiSelfTestInProgress ( scsi_device fd,
int *  inProgress 
)

Definition at line 2773 of file scsicmds.cpp.

◆ scsiSendDiagnostic()

int scsiSendDiagnostic ( scsi_device device,
int  functioncode,
uint8_t *  pBuf,
int  bufLen 
)

Definition at line 1392 of file scsicmds.cpp.

◆ scsiSetControlGLTSD()

int scsiSetControlGLTSD ( scsi_device device,
int  enabled,
int  modese_len 
)

Definition at line 2987 of file scsicmds.cpp.

◆ scsiSetExceptionControlAndWarning()

int scsiSetExceptionControlAndWarning ( scsi_device device,
int  enabled,
const struct scsi_iec_mode_page iecp 
)

Definition at line 1928 of file scsicmds.cpp.

◆ scsiSetPowerCondition()

int scsiSetPowerCondition ( scsi_device device,
int  power_cond,
int  pcond_modifier 
)

Definition at line 1361 of file scsicmds.cpp.

◆ scsiSimpleSenseFilter()

int scsiSimpleSenseFilter ( const struct scsi_sense_disect sinfo)

Definition at line 587 of file scsicmds.cpp.

◆ scsiSmartDefaultSelfTest()

int scsiSmartDefaultSelfTest ( scsi_device device)

Definition at line 2487 of file scsicmds.cpp.

◆ scsiSmartExtendCapSelfTest()

int scsiSmartExtendCapSelfTest ( scsi_device device)

Definition at line 2532 of file scsicmds.cpp.

◆ scsiSmartExtendSelfTest()

int scsiSmartExtendSelfTest ( scsi_device device)

Definition at line 2509 of file scsicmds.cpp.

◆ scsiSmartSelfTestAbort()

int scsiSmartSelfTestAbort ( scsi_device device)

Definition at line 2544 of file scsicmds.cpp.

◆ scsiSmartShortCapSelfTest()

int scsiSmartShortCapSelfTest ( scsi_device device)

Definition at line 2521 of file scsicmds.cpp.

◆ scsiSmartShortSelfTest()

int scsiSmartShortSelfTest ( scsi_device device)

Definition at line 2498 of file scsicmds.cpp.

◆ scsiStdInquiry()

int scsiStdInquiry ( scsi_device device,
uint8_t *  pBuf,
int  bufLen 
)

Definition at line 1163 of file scsicmds.cpp.

◆ scsiTapeAlertsChangerDevice()

const char * scsiTapeAlertsChangerDevice ( unsigned short  code)

Definition at line 2477 of file scsicmds.cpp.

◆ scsiTapeAlertsTapeDevice()

const char * scsiTapeAlertsTapeDevice ( unsigned short  code)

Definition at line 2329 of file scsicmds.cpp.

◆ scsiTestUnitReady()

int scsiTestUnitReady ( scsi_device device)

Definition at line 1456 of file scsicmds.cpp.

◆ sg_scsi_sense_desc_find()

const unsigned char * sg_scsi_sense_desc_find ( const unsigned char *  sensep,
int  sense_len,
int  desc_type 
)

Definition at line 3090 of file scsicmds.cpp.

◆ trimTrailingSpaces()

static int trimTrailingSpaces ( char *  b)
static

Definition at line 236 of file scsicmds.cpp.

Variable Documentation

◆ ChangerTapeAlertsMessageTable

const char* ChangerTapeAlertsMessageTable[]
static

Definition at line 2338 of file scsicmds.cpp.

◆ five_d_t

const char* five_d_t[]
static
Initial value:
= {
"Hardware",
"Controller",
"Data channel",
"Servo",
"Spindle",
"Firmware",
}

Definition at line 3161 of file scsicmds.cpp.

◆ impending0_c

const char* impending0_c[]
static
Initial value:
= {
"general hard drive failure",
"drive error rate too high",
"data error rate too high",
"seek error rate too high",
"too many block reassigns",
"access times too high",
"start unit times too high",
"channel parametrics",
"controller detected",
"throughput performance",
"seek time performance",
"spin-up retry count",
"drive calibration retry count",
}

Definition at line 3172 of file scsicmds.cpp.

◆ impfail

const char* impfail = "impending failure"
static

Definition at line 3170 of file scsicmds.cpp.

◆ logSenStr

const char* logSenStr = "Log Sense"
static

Definition at line 42 of file scsicmds.cpp.

◆ opcode_name_arr

struct scsi_opcode_name opcode_name_arr[]
static
Initial value:
= {
{TEST_UNIT_READY, false, 0, "test unit ready"},
{REQUEST_SENSE, false, 0, "request sense"},
{INQUIRY, false, 0, "inquiry"},
{MODE_SELECT_6, false, 0, "mode select(6)"},
{MODE_SENSE_6, false, 0, "mode sense(6)"},
{START_STOP_UNIT, false, 0, "start stop unit"},
{RECEIVE_DIAGNOSTIC, false, 0, "receive diagnostic"},
{SEND_DIAGNOSTIC, false, 0, "send diagnostic"},
{READ_CAPACITY_10, false, 0, "read capacity(10)"},
{READ_DEFECT_10, false, 0, "read defect list(10)"},
{LOG_SELECT, false, 0, "log select"},
{LOG_SENSE, false, 0, "log sense"},
{MODE_SELECT_10, false, 0, "mode select(10)"},
{MODE_SENSE_10, false, 0, "mode sense(10)"},
{SAT_ATA_PASSTHROUGH_16, false, 0, "ata pass-through(16)"},
{SERVICE_ACTION_IN_16, true, SAI_READ_CAPACITY_16, "read capacity(16)"},
"get physical element status"},
{REPORT_LUNS, false, 0, "report luns"},
{SAT_ATA_PASSTHROUGH_12, false, 0, "ata pass-through(12)"},
"report supported operation codes"},
{READ_DEFECT_12, false, 0, "read defect list(12)"},
}
#define REPORT_LUNS
Definition: scsicmds.h:76
#define START_STOP_UNIT
Definition: scsicmds.h:73
#define SAI_READ_CAPACITY_16
Definition: scsicmds.h:85
#define MODE_SENSE_6
Definition: scsicmds.h:43
#define SAI_GET_PHY_ELEM_STATUS
Definition: scsicmds.h:88
#define READ_CAPACITY_10
Definition: scsicmds.h:79
#define MAINTENANCE_IN_12
Definition: scsicmds.h:94
#define MI_REP_SUP_OPCODES
Definition: scsicmds.h:97
#define SAT_ATA_PASSTHROUGH_12
Definition: scsicmds.h:101
#define SEND_DIAGNOSTIC
Definition: scsicmds.h:64
#define READ_DEFECT_12
Definition: scsicmds.h:70
#define READ_DEFECT_10
Definition: scsicmds.h:67
#define RECEIVE_DIAGNOSTIC
Definition: scsicmds.h:61
#define MODE_SELECT_10
Definition: scsicmds.h:52
#define LOG_SENSE
Definition: scsicmds.h:40
#define MODE_SELECT_6
Definition: scsicmds.h:49
#define SAT_ATA_PASSTHROUGH_16
Definition: scsicmds.h:104
#define MODE_SENSE_10
Definition: scsicmds.h:46
#define LOG_SELECT
Definition: scsicmds.h:37
#define TEST_UNIT_READY
Definition: scsicmds.h:34
#define SERVICE_ACTION_IN_16
Definition: scsicmds.h:82
#define INQUIRY
Definition: scsicmds.h:55
#define REQUEST_SENSE
Definition: scsicmds.h:58

Definition at line 478 of file scsicmds.cpp.

◆ pred

const char* pred = "prediction threshold exceeded"
static

Definition at line 3188 of file scsicmds.cpp.

◆ sa_var_a

struct scsi_sa_var_map sa_var_a[]
static
Initial value:
= {
{0x3b, scsi_sa_b1b4n5},
{0x3c, scsi_sa_b1b4n5},
{0x48, scsi_sa_b1b4n5},
{0x5e, scsi_sa_b1b4n5},
{0x5f, scsi_sa_b1b4n5},
{0x7f, scsi_sa_b8b7n16},
{0x83, scsi_sa_b1b4n5},
{0x84, scsi_sa_b1b4n5},
{0x8c, scsi_sa_b1b4n5},
{0x9b, scsi_sa_b1b4n5},
{0x9e, scsi_sa_b1b4n5},
{0x9f, scsi_sa_b1b4n5},
{0xa3, scsi_sa_b1b4n5},
{0xa4, scsi_sa_b1b4n5},
{0xa9, scsi_sa_b1b4n5},
{0xab, scsi_sa_b1b4n5},
}
@ scsi_sa_b8b7n16
Definition: scsicmds.cpp:443
@ scsi_sa_b1b4n5
Definition: scsicmds.cpp:442

Definition at line 451 of file scsicmds.cpp.

◆ scsi_debugmode

unsigned char scsi_debugmode = 0

Definition at line 45 of file scsicmds.cpp.

◆ scsicmds_c_cvsid

const char* scsicmds_c_cvsid
Initial value:
="$Id: scsicmds.cpp 5618 2024-10-05 10:58:14Z chrfranke $"
#define SCSICMDS_H_CVSID
Definition: scsicmds.h:22

Definition at line 39 of file scsicmds.cpp.

◆ sense_key_desc

const char* sense_key_desc[]
static
Initial value:
= {
"No Sense",
"Recovered Error",
"Not Ready",
"Medium Error",
"Hardware Error",
"Illegal Request",
"Unit Attention",
"Data Protect",
"Blank Check",
"Vendor specific(9)",
"Copy Aborted",
"Aborted Command",
"Equal",
"Volume Overflow",
"Miscompare",
"Completed"
}

Definition at line 668 of file scsicmds.cpp.

◆ supported_vpd_pages_p

supported_vpd_pages* supported_vpd_pages_p = nullptr

Definition at line 47 of file scsicmds.cpp.

◆ TapeAlertsMessageTable

const char* TapeAlertsMessageTable[]
static

Definition at line 2085 of file scsicmds.cpp.

◆ vendor_specific

const char* vendor_specific = "<vendor specific>"
static

Definition at line 506 of file scsicmds.cpp.

◆ wn

const char* wn = "Warning"
static

Definition at line 3147 of file scsicmds.cpp.

◆ wn1_9

const char* wn1_9[]
static
Initial value:
= {
"specified temperature exceeded",
"enclosure degraded",
"background self-test failed",
"background pre-scan detected medium error",
"background medium scan detected medium error",
"non-volatile cache now volatile",
"degraded power to non-volatile cache",
"power loss expected",
"device statistics notification active",
}

Definition at line 3149 of file scsicmds.cpp.