smartmontools SVN Rev 5396
Utility to control and monitor storage systems with "S.M.A.R.T."
Classes | Macros | Functions | Variables
scsicmds.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for scsicmds.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  scsi_cmnd_io
 
struct  scsi_sense_disect
 
struct  scsi_iec_mode_page
 
struct  scsiErrorCounter
 
struct  scsiNonMediumError
 
struct  scsi_readcap_resp
 
struct  scsi_supp_log_pages
 
class  supported_vpd_pages
 

Macros

#define SCSICMDS_H_CVSID   "$Id: scsicmds.h 5394 2022-05-31 04:00:25Z dpgilbert $\n"
 
#define TEST_UNIT_READY   0x0
 
#define LOG_SELECT   0x4c
 
#define LOG_SENSE   0x4d
 
#define MODE_SENSE_6   0x1a
 
#define MODE_SENSE_10   0x5a
 
#define MODE_SELECT_6   0x15
 
#define MODE_SELECT_10   0x55
 
#define INQUIRY   0x12
 
#define REQUEST_SENSE   0x03
 
#define RECEIVE_DIAGNOSTIC   0x1c
 
#define SEND_DIAGNOSTIC   0x1d
 
#define READ_DEFECT_10   0x37
 
#define READ_DEFECT_12   0xb7
 
#define START_STOP_UNIT   0x1b
 
#define REPORT_LUNS   0xa0
 
#define READ_CAPACITY_10   0x25
 
#define SERVICE_ACTION_IN_16   0x9e
 
#define SAI_READ_CAPACITY_16   0x10
 
#define SAI_GET_PHY_ELEM_STATUS   0x17
 
#define MAINTENANCE_IN_12   0xa3
 
#define MI_REP_SUP_OPCODES   0xc /* maintenance in (12) */
 
#define SAT_ATA_PASSTHROUGH_12   0xa1
 
#define SAT_ATA_PASSTHROUGH_16   0x85
 
#define DXFER_NONE   0
 
#define DXFER_FROM_DEVICE   1
 
#define DXFER_TO_DEVICE   2
 
#define SCSI_IECMP_RAW_LEN   64
 
#define SCSI_PT_DIRECT_ACCESS   0x0
 
#define SCSI_PT_SEQUENTIAL_ACCESS   0x1
 
#define SCSI_PT_WO   0x4 /* write once device */
 
#define SCSI_PT_CDROM   0x5
 
#define SCSI_PT_OPTICAL   0x7
 
#define SCSI_PT_MEDIUM_CHANGER   0x8
 
#define SCSI_PT_ENCLOSURE   0xd
 
#define SCSI_PT_RBC   0xe
 
#define SCSI_PT_HOST_MANAGED   0x14 /* Zoned disk */
 
#define SCSI_TPROTO_FCP   0
 
#define SCSI_TPROTO_SPI   1
 
#define SCSI_TPROTO_SSA   2
 
#define SCSI_TPROTO_1394   3
 
#define SCSI_TPROTO_SRP   4 /* SCSI over RDMA */
 
#define SCSI_TPROTO_ISCSI   5
 
#define SCSI_TPROTO_SAS   6
 
#define SCSI_TPROTO_ADT   7
 
#define SCSI_TPROTO_ATA   8
 
#define SCSI_TPROTO_UAS   9 /* USB attached SCSI */
 
#define SCSI_TPROTO_SOP   0xa /* SCSI over PCIe */
 
#define SCSI_TPROTO_PCIE   0xb /* includes NVMe */
 
#define SCSI_TPROTO_NONE   0xf
 
#define SUPPORTED_LPAGES   0x00
 
#define BUFFER_OVERRUN_LPAGE   0x01
 
#define WRITE_ERROR_COUNTER_LPAGE   0x02
 
#define READ_ERROR_COUNTER_LPAGE   0x03
 
#define READ_REVERSE_ERROR_COUNTER_LPAGE   0x04
 
#define VERIFY_ERROR_COUNTER_LPAGE   0x05
 
#define NON_MEDIUM_ERROR_LPAGE   0x06
 
#define LAST_N_ERROR_EVENTS_LPAGE   0x07
 
#define FORMAT_STATUS_LPAGE   0x08
 
#define LAST_N_DEFERRED_LPAGE   0x0b /* or async events */
 
#define LB_PROV_LPAGE   0x0c /* SBC-3 */
 
#define TEMPERATURE_LPAGE   0x0d
 
#define STARTSTOP_CYCLE_COUNTER_LPAGE   0x0e
 
#define APPLICATION_CLIENT_LPAGE   0x0f
 
#define SELFTEST_RESULTS_LPAGE   0x10
 
#define SS_MEDIA_LPAGE   0x11 /* SBC-3 */
 
#define DEVICE_STATS_LPAGE   0x14 /* SSC-5 */
 
#define BACKGROUND_RESULTS_LPAGE   0x15 /* SBC-3 */
 
#define ATA_PT_RESULTS_LPAGE   0x16 /* SAT */
 
#define NONVOL_CACHE_LPAGE   0x17 /* SBC-3 */
 
#define PROTOCOL_SPECIFIC_LPAGE   0x18
 
#define GEN_STATS_PERF_LPAGE   0x19
 
#define POWER_COND_TRANS_LPAGE   0x1a
 
#define IE_LPAGE   0x2f
 
#define NO_SUBPAGE_L_SPAGE   0x0 /* 0x0-0x3f,0x0 */
 
#define LAST_N_INQ_DAT_L_SPAGE   0x1 /* 0xb,0x1 */
 
#define LAST_N_MODE_PG_L_SPAGE   0x2 /* 0xb,0x2 */
 
#define ENVIRO_REP_L_SPAGE   0x1 /* 0xd,0x1 */
 
#define ENVIRO_LIMITS_L_SPAGE   0x2 /* 0xd,0x2 */
 
#define UTILIZATION_L_SPAGE   0x1 /* 0xe,0x1 */
 
#define ZB_DEV_STATS_L_SPAGE   0x1 /* 0x14,0x1 */
 
#define PEND_DEFECTS_L_SPAGE   0x1 /* 0x15,0x1 */
 
#define BACKGROUND_OP_L_SPAGE   0x2 /* 0x15,0x2 */
 
#define LPS_MISALIGN_L_SPAGE   0x3 /* 0x15,0x3 */
 
#define SUPP_SPAGE_L_SPAGE   0xff /* 0x0,0xff pages+subpages */
 
#define SEAGATE_CACHE_LPAGE   0x37
 
#define SEAGATE_FACTORY_LPAGE   0x3e
 
#define LOG_RESP_SELF_TEST_LEN   0x194
 
#define TAPE_ALERTS_LPAGE   0x2e
 
#define VENDOR_UNIQUE_PAGE   0x00
 
#define READ_WRITE_ERROR_RECOVERY_PAGE   0x01
 
#define DISCONNECT_RECONNECT_PAGE   0x02
 
#define FORMAT_DEVICE_PAGE   0x03
 
#define RIGID_DISK_DRIVE_GEOMETRY_PAGE   0x04
 
#define FLEXIBLE_DISK_PAGE   0x05
 
#define VERIFY_ERROR_RECOVERY_PAGE   0x07
 
#define CACHING_PAGE   0x08
 
#define PERIPHERAL_DEVICE_PAGE   0x09
 
#define XOR_CONTROL_MODE_PAGE   0x10
 
#define CONTROL_MODE_PAGE   0x0a
 
#define MEDIUM_TYPES_SUPPORTED_PAGE   0x0b
 
#define NOTCH_PAGE   0x0c
 
#define CD_DEVICE_PAGE   0x0d
 
#define CD_AUDIO_CONTROL_PAGE   0x0e
 
#define DATA_COMPRESSION_PAGE   0x0f
 
#define ENCLOSURE_SERVICES_MANAGEMENT_PAGE   0x14
 
#define PROTOCOL_SPECIFIC_LUN_PAGE   0x18
 
#define PROTOCOL_SPECIFIC_PORT_PAGE   0x19
 
#define POWER_CONDITION_PAGE   0x1a
 
#define INFORMATIONAL_EXCEPTIONS_CONTROL_PAGE   0x1c
 
#define FAULT_FAILURE_REPORTING_PAGE   0x1c
 
#define BACKGROUND_CONTROL_M_SUBPAGE   0x1 /* SBC-2 */
 
#define ALL_MODE_PAGES   0x3f
 
#define MPAGE_CONTROL_CURRENT   0
 
#define MPAGE_CONTROL_CHANGEABLE   1
 
#define MPAGE_CONTROL_DEFAULT   2
 
#define MPAGE_CONTROL_SAVED   3
 
#define SCSI_VPD_SUPPORTED_VPD_PAGES   0x0
 
#define SCSI_VPD_UNIT_SERIAL_NUMBER   0x80
 
#define SCSI_VPD_DEVICE_IDENTIFICATION   0x83
 
#define SCSI_VPD_EXTENDED_INQUIRY_DATA   0x86
 
#define SCSI_VPD_ATA_INFORMATION   0x89
 
#define SCSI_VPD_POWER_CONDITION   0x8a
 
#define SCSI_VPD_POWER_CONSUMPTION   0x8d
 
#define SCSI_VPD_BLOCK_LIMITS   0xb0
 
#define SCSI_VPD_BLOCK_DEVICE_CHARACTERISTICS   0xb1
 
#define SCSI_VPD_LOGICAL_BLOCK_PROVISIONING   0xb2
 
#define SCSI_VPD_ZONED_BLOCK_DEV_CHAR   0xb6
 
#define SCSI_STATUS_CHECK_CONDITION   0x2
 
#define SCSI_SK_NO_SENSE   0x0
 
#define SCSI_SK_RECOVERED_ERR   0x1
 
#define SCSI_SK_NOT_READY   0x2
 
#define SCSI_SK_MEDIUM_ERROR   0x3
 
#define SCSI_SK_HARDWARE_ERROR   0x4
 
#define SCSI_SK_ILLEGAL_REQUEST   0x5
 
#define SCSI_SK_UNIT_ATTENTION   0x6
 
#define SCSI_SK_DATA_PROTECT   0x7
 
#define SCSI_SK_ABORTED_COMMAND   0xb
 
#define SCSI_SK_MISCOMPARE   0xe
 
#define SCSI_SK_COMPLETED   0xf
 
#define SCSI_ASC_NOT_READY   0x4 /* more info in ASCQ code */
 
#define SCSI_ASC_NO_MEDIUM   0x3a /* more info in ASCQ code */
 
#define SCSI_ASC_UNKNOWN_OPCODE   0x20
 
#define SCSI_ASC_INVALID_FIELD   0x24
 
#define SCSI_ASC_UNKNOWN_PARAM   0x26
 
#define SCSI_ASC_WARNING   0xb
 
#define SCSI_ASC_IMPENDING_FAILURE   0x5d
 
#define SCSI_ASCQ_ATA_PASS_THROUGH   0x1d
 
#define SIMPLE_NO_ERROR   0
 
#define SIMPLE_ERR_NOT_READY   1
 
#define SIMPLE_ERR_BAD_OPCODE   2
 
#define SIMPLE_ERR_BAD_FIELD   3 /* in cbd */
 
#define SIMPLE_ERR_BAD_PARAM   4 /* in data */
 
#define SIMPLE_ERR_BAD_RESP   5 /* response fails sanity */
 
#define SIMPLE_ERR_NO_MEDIUM   6 /* no medium present */
 
#define SIMPLE_ERR_BECOMING_READY   7 /* device will be ready soon */
 
#define SIMPLE_ERR_TRY_AGAIN   8 /* some warning, try again */
 
#define SIMPLE_ERR_MEDIUM_HARDWARE   9 /* medium or hardware error */
 
#define SIMPLE_ERR_UNKNOWN   10 /* unknown sense value */
 
#define SIMPLE_ERR_ABORTED_COMMAND   11 /* probably transport error */
 
#define SIMPLE_ERR_PROTECTION   12 /* data protect sense key */
 
#define SIMPLE_ERR_MISCOMPARE   13 /* from VERIFY commands */
 
#define SCSI_DIAG_NO_SELF_TEST   0x00
 
#define SCSI_DIAG_DEF_SELF_TEST   0xff
 
#define SCSI_DIAG_BG_SHORT_SELF_TEST   0x01
 
#define SCSI_DIAG_BG_EXTENDED_SELF_TEST   0x02
 
#define SCSI_DIAG_FG_SHORT_SELF_TEST   0x05
 
#define SCSI_DIAG_FG_EXTENDED_SELF_TEST   0x06
 
#define SCSI_DIAG_ABORT_SELF_TEST   0x04
 
#define SCSI_POW_COND_ACTIVE   0x1
 
#define SCSI_POW_COND_IDLE   0x2
 
#define SCSI_POW_COND_STANDBY   0x3
 
#define SCSI_TIMEOUT_DEFAULT   60
 
#define SCSI_TIMEOUT_SELF_TEST   (5 * 60 * 60) /* allow max 5 hours for */
 
#define LOGPAGEHDRSIZE   4
 

Functions

bool is_scsi_cdb (const uint8_t *cdbp, int clen)
 
void scsi_do_sense_disect (const struct scsi_cmnd_io *in, 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 scsiTestUnitReady (scsi_device *device)
 
int scsiStdInquiry (scsi_device *device, uint8_t *pBuf, int bufLen)
 
int scsiInquiryVpd (scsi_device *device, int vpd_page, uint8_t *pBuf, int bufLen)
 
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 scsiModePageOffset (const uint8_t *resp, int len, int modese_len)
 
int scsiRequestSense (scsi_device *device, struct scsi_sense_disect *sense_info)
 
int scsiSetPowerCondition (scsi_device *device, int power_cond, int pcond_modifier=0)
 
int scsiSendDiagnostic (scsi_device *device, int functioncode, uint8_t *pBuf, int bufLen)
 
bool scsi_pass_through_yield_sense (scsi_device *device, scsi_cmnd_io *iop, struct scsi_sense_disect &sinfo)
 
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)
 
int scsiReadCapacity10 (scsi_device *device, unsigned int *last_lbp, unsigned int *lb_sizep)
 
int scsiReadCapacity16 (scsi_device *device, uint8_t *pBuf, int bufLen)
 
int scsiRSOCcmd (scsi_device *device, uint8_t *pBuf, int bufLen, int &rspLen)
 
int scsiCheckIE (scsi_device *device, int hasIELogPage, int hasTempLogPage, uint8_t *asc, uint8_t *ascq, uint8_t *currenttemp, uint8_t *triptemp)
 
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)
 
void scsiDecodeErrCounterPage (unsigned char *resp, struct scsiErrorCounter *ecp)
 
void scsiDecodeNonMediumErrPage (unsigned char *resp, struct scsiNonMediumError *nmep)
 
int scsiFetchExtendedSelfTestTime (scsi_device *device, int *durationSec, int modese_len)
 
int scsiCountFailedSelfTests (scsi_device *device, int noisy)
 
int scsiSelfTestInProgress (scsi_device *device, int *inProgress)
 
int scsiFetchControlGLTSD (scsi_device *device, int modese_len, int current)
 
int scsiSetControlGLTSD (scsi_device *device, int enabled, int modese_len)
 
int scsiFetchTransportProtocol (scsi_device *device, int modese_len)
 
int scsiGetRPM (scsi_device *device, int modese_len, int *form_factorp, int *haw_zbcp)
 
int scsiGetSetCache (scsi_device *device, int modese_len, short int *wce, short int *rcd)
 
uint64_t scsiGetSize (scsi_device *device, bool avoid_rcap16, struct scsi_readcap_resp *srrp)
 
char * scsiGetIEString (uint8_t asc, uint8_t ascq, char *b, int blen)
 
int scsiGetTemp (scsi_device *device, uint8_t *currenttemp, uint8_t *triptemp)
 
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)
 
const char * scsiTapeAlertsTapeDevice (unsigned short code)
 
const char * scsiTapeAlertsChangerDevice (unsigned short code)
 
const char * scsi_get_opcode_name (const uint8_t *cdbp)
 
void scsi_format_id_string (char *out, const uint8_t *in, int n)
 
void dStrHex (const uint8_t *up, int len, int no_ascii)
 
const unsigned char * sg_scsi_sense_desc_find (const unsigned char *sensep, int sense_len, int desc_type)
 

Variables

supported_vpd_pagessupported_vpd_pages_p
 
unsigned char scsi_debugmode
 

Macro Definition Documentation

◆ ALL_MODE_PAGES

#define ALL_MODE_PAGES   0x3f

Definition at line 291 of file scsicmds.h.

◆ APPLICATION_CLIENT_LPAGE

#define APPLICATION_CLIENT_LPAGE   0x0f

Definition at line 228 of file scsicmds.h.

◆ ATA_PT_RESULTS_LPAGE

#define ATA_PT_RESULTS_LPAGE   0x16 /* SAT */

Definition at line 233 of file scsicmds.h.

◆ BACKGROUND_CONTROL_M_SUBPAGE

#define BACKGROUND_CONTROL_M_SUBPAGE   0x1 /* SBC-2 */

Definition at line 289 of file scsicmds.h.

◆ BACKGROUND_OP_L_SPAGE

#define BACKGROUND_OP_L_SPAGE   0x2 /* 0x15,0x2 */

Definition at line 249 of file scsicmds.h.

◆ BACKGROUND_RESULTS_LPAGE

#define BACKGROUND_RESULTS_LPAGE   0x15 /* SBC-3 */

Definition at line 232 of file scsicmds.h.

◆ BUFFER_OVERRUN_LPAGE

#define BUFFER_OVERRUN_LPAGE   0x01

Definition at line 216 of file scsicmds.h.

◆ CACHING_PAGE

#define CACHING_PAGE   0x08

Definition at line 272 of file scsicmds.h.

◆ CD_AUDIO_CONTROL_PAGE

#define CD_AUDIO_CONTROL_PAGE   0x0e

Definition at line 279 of file scsicmds.h.

◆ CD_DEVICE_PAGE

#define CD_DEVICE_PAGE   0x0d

Definition at line 278 of file scsicmds.h.

◆ CONTROL_MODE_PAGE

#define CONTROL_MODE_PAGE   0x0a

Definition at line 275 of file scsicmds.h.

◆ DATA_COMPRESSION_PAGE

#define DATA_COMPRESSION_PAGE   0x0f

Definition at line 280 of file scsicmds.h.

◆ DEVICE_STATS_LPAGE

#define DEVICE_STATS_LPAGE   0x14 /* SSC-5 */

Definition at line 231 of file scsicmds.h.

◆ DISCONNECT_RECONNECT_PAGE

#define DISCONNECT_RECONNECT_PAGE   0x02

Definition at line 267 of file scsicmds.h.

◆ DXFER_FROM_DEVICE

#define DXFER_FROM_DEVICE   1

Definition at line 106 of file scsicmds.h.

◆ DXFER_NONE

#define DXFER_NONE   0

Definition at line 105 of file scsicmds.h.

◆ DXFER_TO_DEVICE

#define DXFER_TO_DEVICE   2

Definition at line 107 of file scsicmds.h.

◆ ENCLOSURE_SERVICES_MANAGEMENT_PAGE

#define ENCLOSURE_SERVICES_MANAGEMENT_PAGE   0x14

Definition at line 281 of file scsicmds.h.

◆ ENVIRO_LIMITS_L_SPAGE

#define ENVIRO_LIMITS_L_SPAGE   0x2 /* 0xd,0x2 */

Definition at line 245 of file scsicmds.h.

◆ ENVIRO_REP_L_SPAGE

#define ENVIRO_REP_L_SPAGE   0x1 /* 0xd,0x1 */

Definition at line 244 of file scsicmds.h.

◆ FAULT_FAILURE_REPORTING_PAGE

#define FAULT_FAILURE_REPORTING_PAGE   0x1c

Definition at line 286 of file scsicmds.h.

◆ FLEXIBLE_DISK_PAGE

#define FLEXIBLE_DISK_PAGE   0x05

Definition at line 270 of file scsicmds.h.

◆ FORMAT_DEVICE_PAGE

#define FORMAT_DEVICE_PAGE   0x03

Definition at line 268 of file scsicmds.h.

◆ FORMAT_STATUS_LPAGE

#define FORMAT_STATUS_LPAGE   0x08

Definition at line 223 of file scsicmds.h.

◆ GEN_STATS_PERF_LPAGE

#define GEN_STATS_PERF_LPAGE   0x19

Definition at line 236 of file scsicmds.h.

◆ IE_LPAGE

#define IE_LPAGE   0x2f

Definition at line 238 of file scsicmds.h.

◆ INFORMATIONAL_EXCEPTIONS_CONTROL_PAGE

#define INFORMATIONAL_EXCEPTIONS_CONTROL_PAGE   0x1c

Definition at line 285 of file scsicmds.h.

◆ INQUIRY

#define INQUIRY   0x12

Definition at line 55 of file scsicmds.h.

◆ LAST_N_DEFERRED_LPAGE

#define LAST_N_DEFERRED_LPAGE   0x0b /* or async events */

Definition at line 224 of file scsicmds.h.

◆ LAST_N_ERROR_EVENTS_LPAGE

#define LAST_N_ERROR_EVENTS_LPAGE   0x07

Definition at line 222 of file scsicmds.h.

◆ LAST_N_INQ_DAT_L_SPAGE

#define LAST_N_INQ_DAT_L_SPAGE   0x1 /* 0xb,0x1 */

Definition at line 242 of file scsicmds.h.

◆ LAST_N_MODE_PG_L_SPAGE

#define LAST_N_MODE_PG_L_SPAGE   0x2 /* 0xb,0x2 */

Definition at line 243 of file scsicmds.h.

◆ LB_PROV_LPAGE

#define LB_PROV_LPAGE   0x0c /* SBC-3 */

Definition at line 225 of file scsicmds.h.

◆ LOG_RESP_SELF_TEST_LEN

#define LOG_RESP_SELF_TEST_LEN   0x194

Definition at line 258 of file scsicmds.h.

◆ LOG_SELECT

#define LOG_SELECT   0x4c

Definition at line 37 of file scsicmds.h.

◆ LOG_SENSE

#define LOG_SENSE   0x4d

Definition at line 40 of file scsicmds.h.

◆ LOGPAGEHDRSIZE

#define LOGPAGEHDRSIZE   4

Definition at line 378 of file scsicmds.h.

◆ LPS_MISALIGN_L_SPAGE

#define LPS_MISALIGN_L_SPAGE   0x3 /* 0x15,0x3 */

Definition at line 250 of file scsicmds.h.

◆ MAINTENANCE_IN_12

#define MAINTENANCE_IN_12   0xa3

Definition at line 91 of file scsicmds.h.

◆ MEDIUM_TYPES_SUPPORTED_PAGE

#define MEDIUM_TYPES_SUPPORTED_PAGE   0x0b

Definition at line 276 of file scsicmds.h.

◆ MI_REP_SUP_OPCODES

#define MI_REP_SUP_OPCODES   0xc /* maintenance in (12) */

Definition at line 94 of file scsicmds.h.

◆ MODE_SELECT_10

#define MODE_SELECT_10   0x55

Definition at line 52 of file scsicmds.h.

◆ MODE_SELECT_6

#define MODE_SELECT_6   0x15

Definition at line 49 of file scsicmds.h.

◆ MODE_SENSE_10

#define MODE_SENSE_10   0x5a

Definition at line 46 of file scsicmds.h.

◆ MODE_SENSE_6

#define MODE_SENSE_6   0x1a

Definition at line 43 of file scsicmds.h.

◆ MPAGE_CONTROL_CHANGEABLE

#define MPAGE_CONTROL_CHANGEABLE   1

Definition at line 295 of file scsicmds.h.

◆ MPAGE_CONTROL_CURRENT

#define MPAGE_CONTROL_CURRENT   0

Definition at line 294 of file scsicmds.h.

◆ MPAGE_CONTROL_DEFAULT

#define MPAGE_CONTROL_DEFAULT   2

Definition at line 296 of file scsicmds.h.

◆ MPAGE_CONTROL_SAVED

#define MPAGE_CONTROL_SAVED   3

Definition at line 297 of file scsicmds.h.

◆ NO_SUBPAGE_L_SPAGE

#define NO_SUBPAGE_L_SPAGE   0x0 /* 0x0-0x3f,0x0 */

Definition at line 241 of file scsicmds.h.

◆ NON_MEDIUM_ERROR_LPAGE

#define NON_MEDIUM_ERROR_LPAGE   0x06

Definition at line 221 of file scsicmds.h.

◆ NONVOL_CACHE_LPAGE

#define NONVOL_CACHE_LPAGE   0x17 /* SBC-3 */

Definition at line 234 of file scsicmds.h.

◆ NOTCH_PAGE

#define NOTCH_PAGE   0x0c

Definition at line 277 of file scsicmds.h.

◆ PEND_DEFECTS_L_SPAGE

#define PEND_DEFECTS_L_SPAGE   0x1 /* 0x15,0x1 */

Definition at line 248 of file scsicmds.h.

◆ PERIPHERAL_DEVICE_PAGE

#define PERIPHERAL_DEVICE_PAGE   0x09

Definition at line 273 of file scsicmds.h.

◆ POWER_COND_TRANS_LPAGE

#define POWER_COND_TRANS_LPAGE   0x1a

Definition at line 237 of file scsicmds.h.

◆ POWER_CONDITION_PAGE

#define POWER_CONDITION_PAGE   0x1a

Definition at line 284 of file scsicmds.h.

◆ PROTOCOL_SPECIFIC_LPAGE

#define PROTOCOL_SPECIFIC_LPAGE   0x18

Definition at line 235 of file scsicmds.h.

◆ PROTOCOL_SPECIFIC_LUN_PAGE

#define PROTOCOL_SPECIFIC_LUN_PAGE   0x18

Definition at line 282 of file scsicmds.h.

◆ PROTOCOL_SPECIFIC_PORT_PAGE

#define PROTOCOL_SPECIFIC_PORT_PAGE   0x19

Definition at line 283 of file scsicmds.h.

◆ READ_CAPACITY_10

#define READ_CAPACITY_10   0x25

Definition at line 79 of file scsicmds.h.

◆ READ_DEFECT_10

#define READ_DEFECT_10   0x37

Definition at line 67 of file scsicmds.h.

◆ READ_DEFECT_12

#define READ_DEFECT_12   0xb7

Definition at line 70 of file scsicmds.h.

◆ READ_ERROR_COUNTER_LPAGE

#define READ_ERROR_COUNTER_LPAGE   0x03

Definition at line 218 of file scsicmds.h.

◆ READ_REVERSE_ERROR_COUNTER_LPAGE

#define READ_REVERSE_ERROR_COUNTER_LPAGE   0x04

Definition at line 219 of file scsicmds.h.

◆ READ_WRITE_ERROR_RECOVERY_PAGE

#define READ_WRITE_ERROR_RECOVERY_PAGE   0x01

Definition at line 266 of file scsicmds.h.

◆ RECEIVE_DIAGNOSTIC

#define RECEIVE_DIAGNOSTIC   0x1c

Definition at line 61 of file scsicmds.h.

◆ REPORT_LUNS

#define REPORT_LUNS   0xa0

Definition at line 76 of file scsicmds.h.

◆ REQUEST_SENSE

#define REQUEST_SENSE   0x03

Definition at line 58 of file scsicmds.h.

◆ RIGID_DISK_DRIVE_GEOMETRY_PAGE

#define RIGID_DISK_DRIVE_GEOMETRY_PAGE   0x04

Definition at line 269 of file scsicmds.h.

◆ SAI_GET_PHY_ELEM_STATUS

#define SAI_GET_PHY_ELEM_STATUS   0x17

Definition at line 88 of file scsicmds.h.

◆ SAI_READ_CAPACITY_16

#define SAI_READ_CAPACITY_16   0x10

Definition at line 85 of file scsicmds.h.

◆ SAT_ATA_PASSTHROUGH_12

#define SAT_ATA_PASSTHROUGH_12   0xa1

Definition at line 98 of file scsicmds.h.

◆ SAT_ATA_PASSTHROUGH_16

#define SAT_ATA_PASSTHROUGH_16   0x85

Definition at line 101 of file scsicmds.h.

◆ SCSI_ASC_IMPENDING_FAILURE

#define SCSI_ASC_IMPENDING_FAILURE   0x5d

Definition at line 335 of file scsicmds.h.

◆ SCSI_ASC_INVALID_FIELD

#define SCSI_ASC_INVALID_FIELD   0x24

Definition at line 332 of file scsicmds.h.

◆ SCSI_ASC_NO_MEDIUM

#define SCSI_ASC_NO_MEDIUM   0x3a /* more info in ASCQ code */

Definition at line 330 of file scsicmds.h.

◆ SCSI_ASC_NOT_READY

#define SCSI_ASC_NOT_READY   0x4 /* more info in ASCQ code */

Definition at line 329 of file scsicmds.h.

◆ SCSI_ASC_UNKNOWN_OPCODE

#define SCSI_ASC_UNKNOWN_OPCODE   0x20

Definition at line 331 of file scsicmds.h.

◆ SCSI_ASC_UNKNOWN_PARAM

#define SCSI_ASC_UNKNOWN_PARAM   0x26

Definition at line 333 of file scsicmds.h.

◆ SCSI_ASC_WARNING

#define SCSI_ASC_WARNING   0xb

Definition at line 334 of file scsicmds.h.

◆ SCSI_ASCQ_ATA_PASS_THROUGH

#define SCSI_ASCQ_ATA_PASS_THROUGH   0x1d

Definition at line 337 of file scsicmds.h.

◆ SCSI_DIAG_ABORT_SELF_TEST

#define SCSI_DIAG_ABORT_SELF_TEST   0x04

Definition at line 363 of file scsicmds.h.

◆ SCSI_DIAG_BG_EXTENDED_SELF_TEST

#define SCSI_DIAG_BG_EXTENDED_SELF_TEST   0x02

Definition at line 360 of file scsicmds.h.

◆ SCSI_DIAG_BG_SHORT_SELF_TEST

#define SCSI_DIAG_BG_SHORT_SELF_TEST   0x01

Definition at line 359 of file scsicmds.h.

◆ SCSI_DIAG_DEF_SELF_TEST

#define SCSI_DIAG_DEF_SELF_TEST   0xff

Definition at line 358 of file scsicmds.h.

◆ SCSI_DIAG_FG_EXTENDED_SELF_TEST

#define SCSI_DIAG_FG_EXTENDED_SELF_TEST   0x06

Definition at line 362 of file scsicmds.h.

◆ SCSI_DIAG_FG_SHORT_SELF_TEST

#define SCSI_DIAG_FG_SHORT_SELF_TEST   0x05

Definition at line 361 of file scsicmds.h.

◆ SCSI_DIAG_NO_SELF_TEST

#define SCSI_DIAG_NO_SELF_TEST   0x00

Definition at line 357 of file scsicmds.h.

◆ SCSI_IECMP_RAW_LEN

#define SCSI_IECMP_RAW_LEN   64

Definition at line 140 of file scsicmds.h.

◆ SCSI_POW_COND_ACTIVE

#define SCSI_POW_COND_ACTIVE   0x1

Definition at line 366 of file scsicmds.h.

◆ SCSI_POW_COND_IDLE

#define SCSI_POW_COND_IDLE   0x2

Definition at line 367 of file scsicmds.h.

◆ SCSI_POW_COND_STANDBY

#define SCSI_POW_COND_STANDBY   0x3

Definition at line 368 of file scsicmds.h.

◆ SCSI_PT_CDROM

#define SCSI_PT_CDROM   0x5

Definition at line 191 of file scsicmds.h.

◆ SCSI_PT_DIRECT_ACCESS

#define SCSI_PT_DIRECT_ACCESS   0x0

Definition at line 188 of file scsicmds.h.

◆ SCSI_PT_ENCLOSURE

#define SCSI_PT_ENCLOSURE   0xd

Definition at line 194 of file scsicmds.h.

◆ SCSI_PT_HOST_MANAGED

#define SCSI_PT_HOST_MANAGED   0x14 /* Zoned disk */

Definition at line 196 of file scsicmds.h.

◆ SCSI_PT_MEDIUM_CHANGER

#define SCSI_PT_MEDIUM_CHANGER   0x8

Definition at line 193 of file scsicmds.h.

◆ SCSI_PT_OPTICAL

#define SCSI_PT_OPTICAL   0x7

Definition at line 192 of file scsicmds.h.

◆ SCSI_PT_RBC

#define SCSI_PT_RBC   0xe

Definition at line 195 of file scsicmds.h.

◆ SCSI_PT_SEQUENTIAL_ACCESS

#define SCSI_PT_SEQUENTIAL_ACCESS   0x1

Definition at line 189 of file scsicmds.h.

◆ SCSI_PT_WO

#define SCSI_PT_WO   0x4 /* write once device */

Definition at line 190 of file scsicmds.h.

◆ SCSI_SK_ABORTED_COMMAND

#define SCSI_SK_ABORTED_COMMAND   0xb

Definition at line 324 of file scsicmds.h.

◆ SCSI_SK_COMPLETED

#define SCSI_SK_COMPLETED   0xf

Definition at line 326 of file scsicmds.h.

◆ SCSI_SK_DATA_PROTECT

#define SCSI_SK_DATA_PROTECT   0x7

Definition at line 323 of file scsicmds.h.

◆ SCSI_SK_HARDWARE_ERROR

#define SCSI_SK_HARDWARE_ERROR   0x4

Definition at line 320 of file scsicmds.h.

◆ SCSI_SK_ILLEGAL_REQUEST

#define SCSI_SK_ILLEGAL_REQUEST   0x5

Definition at line 321 of file scsicmds.h.

◆ SCSI_SK_MEDIUM_ERROR

#define SCSI_SK_MEDIUM_ERROR   0x3

Definition at line 319 of file scsicmds.h.

◆ SCSI_SK_MISCOMPARE

#define SCSI_SK_MISCOMPARE   0xe

Definition at line 325 of file scsicmds.h.

◆ SCSI_SK_NO_SENSE

#define SCSI_SK_NO_SENSE   0x0

Definition at line 316 of file scsicmds.h.

◆ SCSI_SK_NOT_READY

#define SCSI_SK_NOT_READY   0x2

Definition at line 318 of file scsicmds.h.

◆ SCSI_SK_RECOVERED_ERR

#define SCSI_SK_RECOVERED_ERR   0x1

Definition at line 317 of file scsicmds.h.

◆ SCSI_SK_UNIT_ATTENTION

#define SCSI_SK_UNIT_ATTENTION   0x6

Definition at line 322 of file scsicmds.h.

◆ SCSI_STATUS_CHECK_CONDITION

#define SCSI_STATUS_CHECK_CONDITION   0x2

Definition at line 313 of file scsicmds.h.

◆ SCSI_TIMEOUT_DEFAULT

#define SCSI_TIMEOUT_DEFAULT   60

Definition at line 372 of file scsicmds.h.

◆ SCSI_TIMEOUT_SELF_TEST

#define SCSI_TIMEOUT_SELF_TEST   (5 * 60 * 60) /* allow max 5 hours for */

Definition at line 375 of file scsicmds.h.

◆ SCSI_TPROTO_1394

#define SCSI_TPROTO_1394   3

Definition at line 202 of file scsicmds.h.

◆ SCSI_TPROTO_ADT

#define SCSI_TPROTO_ADT   7

Definition at line 206 of file scsicmds.h.

◆ SCSI_TPROTO_ATA

#define SCSI_TPROTO_ATA   8

Definition at line 207 of file scsicmds.h.

◆ SCSI_TPROTO_FCP

#define SCSI_TPROTO_FCP   0

Definition at line 199 of file scsicmds.h.

◆ SCSI_TPROTO_ISCSI

#define SCSI_TPROTO_ISCSI   5

Definition at line 204 of file scsicmds.h.

◆ SCSI_TPROTO_NONE

#define SCSI_TPROTO_NONE   0xf

Definition at line 211 of file scsicmds.h.

◆ SCSI_TPROTO_PCIE

#define SCSI_TPROTO_PCIE   0xb /* includes NVMe */

Definition at line 210 of file scsicmds.h.

◆ SCSI_TPROTO_SAS

#define SCSI_TPROTO_SAS   6

Definition at line 205 of file scsicmds.h.

◆ SCSI_TPROTO_SOP

#define SCSI_TPROTO_SOP   0xa /* SCSI over PCIe */

Definition at line 209 of file scsicmds.h.

◆ SCSI_TPROTO_SPI

#define SCSI_TPROTO_SPI   1

Definition at line 200 of file scsicmds.h.

◆ SCSI_TPROTO_SRP

#define SCSI_TPROTO_SRP   4 /* SCSI over RDMA */

Definition at line 203 of file scsicmds.h.

◆ SCSI_TPROTO_SSA

#define SCSI_TPROTO_SSA   2

Definition at line 201 of file scsicmds.h.

◆ SCSI_TPROTO_UAS

#define SCSI_TPROTO_UAS   9 /* USB attached SCSI */

Definition at line 208 of file scsicmds.h.

◆ SCSI_VPD_ATA_INFORMATION

#define SCSI_VPD_ATA_INFORMATION   0x89

Definition at line 304 of file scsicmds.h.

◆ SCSI_VPD_BLOCK_DEVICE_CHARACTERISTICS

#define SCSI_VPD_BLOCK_DEVICE_CHARACTERISTICS   0xb1

Definition at line 308 of file scsicmds.h.

◆ SCSI_VPD_BLOCK_LIMITS

#define SCSI_VPD_BLOCK_LIMITS   0xb0

Definition at line 307 of file scsicmds.h.

◆ SCSI_VPD_DEVICE_IDENTIFICATION

#define SCSI_VPD_DEVICE_IDENTIFICATION   0x83

Definition at line 302 of file scsicmds.h.

◆ SCSI_VPD_EXTENDED_INQUIRY_DATA

#define SCSI_VPD_EXTENDED_INQUIRY_DATA   0x86

Definition at line 303 of file scsicmds.h.

◆ SCSI_VPD_LOGICAL_BLOCK_PROVISIONING

#define SCSI_VPD_LOGICAL_BLOCK_PROVISIONING   0xb2

Definition at line 309 of file scsicmds.h.

◆ SCSI_VPD_POWER_CONDITION

#define SCSI_VPD_POWER_CONDITION   0x8a

Definition at line 305 of file scsicmds.h.

◆ SCSI_VPD_POWER_CONSUMPTION

#define SCSI_VPD_POWER_CONSUMPTION   0x8d

Definition at line 306 of file scsicmds.h.

◆ SCSI_VPD_SUPPORTED_VPD_PAGES

#define SCSI_VPD_SUPPORTED_VPD_PAGES   0x0

Definition at line 300 of file scsicmds.h.

◆ SCSI_VPD_UNIT_SERIAL_NUMBER

#define SCSI_VPD_UNIT_SERIAL_NUMBER   0x80

Definition at line 301 of file scsicmds.h.

◆ SCSI_VPD_ZONED_BLOCK_DEV_CHAR

#define SCSI_VPD_ZONED_BLOCK_DEV_CHAR   0xb6

Definition at line 310 of file scsicmds.h.

◆ SCSICMDS_H_CVSID

#define SCSICMDS_H_CVSID   "$Id: scsicmds.h 5394 2022-05-31 04:00:25Z dpgilbert $\n"

Definition at line 22 of file scsicmds.h.

◆ SEAGATE_CACHE_LPAGE

#define SEAGATE_CACHE_LPAGE   0x37

Definition at line 254 of file scsicmds.h.

◆ SEAGATE_FACTORY_LPAGE

#define SEAGATE_FACTORY_LPAGE   0x3e

Definition at line 255 of file scsicmds.h.

◆ SELFTEST_RESULTS_LPAGE

#define SELFTEST_RESULTS_LPAGE   0x10

Definition at line 229 of file scsicmds.h.

◆ SEND_DIAGNOSTIC

#define SEND_DIAGNOSTIC   0x1d

Definition at line 64 of file scsicmds.h.

◆ SERVICE_ACTION_IN_16

#define SERVICE_ACTION_IN_16   0x9e

Definition at line 82 of file scsicmds.h.

◆ SIMPLE_ERR_ABORTED_COMMAND

#define SIMPLE_ERR_ABORTED_COMMAND   11 /* probably transport error */

Definition at line 351 of file scsicmds.h.

◆ SIMPLE_ERR_BAD_FIELD

#define SIMPLE_ERR_BAD_FIELD   3 /* in cbd */

Definition at line 343 of file scsicmds.h.

◆ SIMPLE_ERR_BAD_OPCODE

#define SIMPLE_ERR_BAD_OPCODE   2

Definition at line 342 of file scsicmds.h.

◆ SIMPLE_ERR_BAD_PARAM

#define SIMPLE_ERR_BAD_PARAM   4 /* in data */

Definition at line 344 of file scsicmds.h.

◆ SIMPLE_ERR_BAD_RESP

#define SIMPLE_ERR_BAD_RESP   5 /* response fails sanity */

Definition at line 345 of file scsicmds.h.

◆ SIMPLE_ERR_BECOMING_READY

#define SIMPLE_ERR_BECOMING_READY   7 /* device will be ready soon */

Definition at line 347 of file scsicmds.h.

◆ SIMPLE_ERR_MEDIUM_HARDWARE

#define SIMPLE_ERR_MEDIUM_HARDWARE   9 /* medium or hardware error */

Definition at line 349 of file scsicmds.h.

◆ SIMPLE_ERR_MISCOMPARE

#define SIMPLE_ERR_MISCOMPARE   13 /* from VERIFY commands */

Definition at line 353 of file scsicmds.h.

◆ SIMPLE_ERR_NO_MEDIUM

#define SIMPLE_ERR_NO_MEDIUM   6 /* no medium present */

Definition at line 346 of file scsicmds.h.

◆ SIMPLE_ERR_NOT_READY

#define SIMPLE_ERR_NOT_READY   1

Definition at line 341 of file scsicmds.h.

◆ SIMPLE_ERR_PROTECTION

#define SIMPLE_ERR_PROTECTION   12 /* data protect sense key */

Definition at line 352 of file scsicmds.h.

◆ SIMPLE_ERR_TRY_AGAIN

#define SIMPLE_ERR_TRY_AGAIN   8 /* some warning, try again */

Definition at line 348 of file scsicmds.h.

◆ SIMPLE_ERR_UNKNOWN

#define SIMPLE_ERR_UNKNOWN   10 /* unknown sense value */

Definition at line 350 of file scsicmds.h.

◆ SIMPLE_NO_ERROR

#define SIMPLE_NO_ERROR   0

Definition at line 340 of file scsicmds.h.

◆ SS_MEDIA_LPAGE

#define SS_MEDIA_LPAGE   0x11 /* SBC-3 */

Definition at line 230 of file scsicmds.h.

◆ START_STOP_UNIT

#define START_STOP_UNIT   0x1b

Definition at line 73 of file scsicmds.h.

◆ STARTSTOP_CYCLE_COUNTER_LPAGE

#define STARTSTOP_CYCLE_COUNTER_LPAGE   0x0e

Definition at line 227 of file scsicmds.h.

◆ SUPP_SPAGE_L_SPAGE

#define SUPP_SPAGE_L_SPAGE   0xff /* 0x0,0xff pages+subpages */

Definition at line 251 of file scsicmds.h.

◆ SUPPORTED_LPAGES

#define SUPPORTED_LPAGES   0x00

Definition at line 215 of file scsicmds.h.

◆ TAPE_ALERTS_LPAGE

#define TAPE_ALERTS_LPAGE   0x2e

Definition at line 262 of file scsicmds.h.

◆ TEMPERATURE_LPAGE

#define TEMPERATURE_LPAGE   0x0d

Definition at line 226 of file scsicmds.h.

◆ TEST_UNIT_READY

#define TEST_UNIT_READY   0x0

Definition at line 34 of file scsicmds.h.

◆ UTILIZATION_L_SPAGE

#define UTILIZATION_L_SPAGE   0x1 /* 0xe,0x1 */

Definition at line 246 of file scsicmds.h.

◆ VENDOR_UNIQUE_PAGE

#define VENDOR_UNIQUE_PAGE   0x00

Definition at line 265 of file scsicmds.h.

◆ VERIFY_ERROR_COUNTER_LPAGE

#define VERIFY_ERROR_COUNTER_LPAGE   0x05

Definition at line 220 of file scsicmds.h.

◆ VERIFY_ERROR_RECOVERY_PAGE

#define VERIFY_ERROR_RECOVERY_PAGE   0x07

Definition at line 271 of file scsicmds.h.

◆ WRITE_ERROR_COUNTER_LPAGE

#define WRITE_ERROR_COUNTER_LPAGE   0x02

Definition at line 217 of file scsicmds.h.

◆ XOR_CONTROL_MODE_PAGE

#define XOR_CONTROL_MODE_PAGE   0x10

Definition at line 274 of file scsicmds.h.

◆ ZB_DEV_STATS_L_SPAGE

#define ZB_DEV_STATS_L_SPAGE   0x1 /* 0x14,0x1 */

Definition at line 247 of file scsicmds.h.

Function Documentation

◆ dStrHex()

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

Definition at line 78 of file scsicmds.cpp.

◆ is_scsi_cdb()

bool is_scsi_cdb ( const uint8_t *  cdbp,
int  clen 
)

Definition at line 151 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 507 of file scsicmds.cpp.

◆ scsi_do_sense_disect()

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

Definition at line 325 of file scsicmds.cpp.

◆ scsi_format_id_string()

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

Definition at line 2825 of file scsicmds.cpp.

◆ scsi_get_opcode_name()

const char * scsi_get_opcode_name ( const uint8_t *  cdbp)

Definition at line 271 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 455 of file scsicmds.cpp.

◆ scsi_IsExceptionControlEnabled()

int scsi_IsExceptionControlEnabled ( const struct scsi_iec_mode_page iecp)

Definition at line 1609 of file scsicmds.cpp.

◆ scsi_IsWarningEnabled()

int scsi_IsWarningEnabled ( const struct scsi_iec_mode_page iecp)

Definition at line 1623 of file scsicmds.cpp.

◆ scsi_pass_through_yield_sense()

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

Definition at line 1303 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 478 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 1750 of file scsicmds.cpp.

◆ scsiCountFailedSelfTests()

int scsiCountFailedSelfTests ( scsi_device device,
int  noisy 
)

Definition at line 2430 of file scsicmds.cpp.

◆ scsiDecodeErrCounterPage()

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

Definition at line 2331 of file scsicmds.cpp.

◆ scsiDecodeNonMediumErrPage()

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

Definition at line 2369 of file scsicmds.cpp.

◆ scsiErrString()

const char * scsiErrString ( int  scsiErr)

Definition at line 390 of file scsicmds.cpp.

◆ scsiFetchControlGLTSD()

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

Definition at line 2509 of file scsicmds.cpp.

◆ scsiFetchExtendedSelfTestTime()

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

Definition at line 2279 of file scsicmds.cpp.

◆ scsiFetchIECmpage()

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

Definition at line 1562 of file scsicmds.cpp.

◆ scsiFetchTransportProtocol()

int scsiFetchTransportProtocol ( scsi_device device,
int  modese_len 
)

Definition at line 2765 of file scsicmds.cpp.

◆ scsiGetIEString()

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

Definition at line 2906 of file scsicmds.cpp.

◆ scsiGetRPM()

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

Definition at line 2546 of file scsicmds.cpp.

◆ scsiGetSetCache()

int scsiGetSetCache ( scsi_device device,
int  modese_len,
short int *  wce,
short int *  rcd 
)

Definition at line 2591 of file scsicmds.cpp.

◆ scsiGetSize()

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

Definition at line 1441 of file scsicmds.cpp.

◆ scsiGetTemp()

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

Definition at line 1722 of file scsicmds.cpp.

◆ scsiInquiryVpd()

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

Definition at line 970 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 722 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 633 of file scsicmds.cpp.

◆ scsiModePageOffset()

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

Definition at line 1519 of file scsicmds.cpp.

◆ scsiModeSelect()

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

Definition at line 800 of file scsicmds.cpp.

◆ scsiModeSelect10()

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

Definition at line 883 of file scsicmds.cpp.

◆ scsiModeSense()

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

Definition at line 754 of file scsicmds.cpp.

◆ scsiModeSense10()

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

Definition at line 839 of file scsicmds.cpp.

◆ scsiReadCapacity10()

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

Definition at line 1342 of file scsicmds.cpp.

◆ scsiReadCapacity16()

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

Definition at line 1378 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 1232 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 1266 of file scsicmds.cpp.

◆ scsiRequestSense()

int scsiRequestSense ( scsi_device device,
struct scsi_sense_disect sense_info 
)

Definition at line 1028 of file scsicmds.cpp.

◆ scsiRSOCcmd()

int scsiRSOCcmd ( scsi_device device,
uint8_t *  pBuf,
int  bufLen,
int &  rspLen 
)

Definition at line 1405 of file scsicmds.cpp.

◆ scsiSelfTestInProgress()

int scsiSelfTestInProgress ( scsi_device device,
int *  inProgress 
)

Definition at line 2481 of file scsicmds.cpp.

◆ scsiSendDiagnostic()

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

Definition at line 1152 of file scsicmds.cpp.

◆ scsiSetControlGLTSD()

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

Definition at line 2695 of file scsicmds.cpp.

◆ scsiSetExceptionControlAndWarning()

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

Definition at line 1652 of file scsicmds.cpp.

◆ scsiSetPowerCondition()

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

Definition at line 1121 of file scsicmds.cpp.

◆ scsiSimpleSenseFilter()

int scsiSimpleSenseFilter ( const struct scsi_sense_disect sinfo)

Definition at line 347 of file scsicmds.cpp.

◆ scsiSmartDefaultSelfTest()

int scsiSmartDefaultSelfTest ( scsi_device device)

Definition at line 2209 of file scsicmds.cpp.

◆ scsiSmartExtendCapSelfTest()

int scsiSmartExtendCapSelfTest ( scsi_device device)

Definition at line 2254 of file scsicmds.cpp.

◆ scsiSmartExtendSelfTest()

int scsiSmartExtendSelfTest ( scsi_device device)

Definition at line 2231 of file scsicmds.cpp.

◆ scsiSmartSelfTestAbort()

int scsiSmartSelfTestAbort ( scsi_device device)

Definition at line 2266 of file scsicmds.cpp.

◆ scsiSmartShortCapSelfTest()

int scsiSmartShortCapSelfTest ( scsi_device device)

Definition at line 2243 of file scsicmds.cpp.

◆ scsiSmartShortSelfTest()

int scsiSmartShortSelfTest ( scsi_device device)

Definition at line 2220 of file scsicmds.cpp.

◆ scsiStdInquiry()

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

Definition at line 923 of file scsicmds.cpp.

◆ scsiTapeAlertsChangerDevice()

const char * scsiTapeAlertsChangerDevice ( unsigned short  code)

Definition at line 2199 of file scsicmds.cpp.

◆ scsiTapeAlertsTapeDevice()

const char * scsiTapeAlertsTapeDevice ( unsigned short  code)

Definition at line 2051 of file scsicmds.cpp.

◆ scsiTestUnitReady()

int scsiTestUnitReady ( scsi_device device)

Definition at line 1216 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 2798 of file scsicmds.cpp.

Variable Documentation

◆ scsi_debugmode

unsigned char scsi_debugmode
extern

Definition at line 45 of file scsicmds.cpp.

◆ supported_vpd_pages_p

supported_vpd_pages* supported_vpd_pages_p
extern

Definition at line 47 of file scsicmds.cpp.