smartmontools SVN Rev 3317
Utility to control and monitor storage systems with "S.M.A.R.T."
Classes | Defines | Typedefs | Functions | Variables
scsicmds.h File Reference
#include <stdio.h>
#include <stdlib.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
class  supported_vpd_pages

Defines

#define SCSICMDS_H_CVSID   "$Id: scsicmds.h 3783 2013-03-02 01:51:12Z dpgilbert $\n"
#define TEST_UNIT_READY   0x0
#define LOG_SELECT   0x4c
#define LOG_SENSE   0x4d
#define MODE_SENSE   0x1a
#define MODE_SENSE_10   0x5a
#define MODE_SELECT   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 READ_CAPACITY_16   0x9e
#define SAI_READ_CAPACITY_16   0x10
#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_CDROM   0x5
#define SCSI_PT_MEDIUM_CHANGER   0x8
#define SCSI_PT_ENCLOSURE   0xd
#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_LPAGE   0x07
#define FORMAT_STATUS_LPAGE   0x08
#define LB_PROV_LPAGE   0x0c
#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
#define BACKGROUND_RESULTS_LPAGE   0x15
#define NONVOL_CACHE_LPAGE   0x17
#define PROTOCOL_SPECIFIC_LPAGE   0x18
#define IE_LPAGE   0x2f
#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
#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_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_ABORTED_COMMAND   0xb
#define SCSI_ASC_NOT_READY   0x4
#define SCSI_ASC_NO_MEDIUM   0x3a
#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
#define SIMPLE_ERR_BAD_PARAM   4
#define SIMPLE_ERR_BAD_RESP   5
#define SIMPLE_ERR_NO_MEDIUM   6
#define SIMPLE_ERR_BECOMING_READY   7
#define SIMPLE_ERR_TRY_AGAIN   8
#define SIMPLE_ERR_MEDIUM_HARDWARE   9
#define SIMPLE_ERR_UNKNOWN   10
#define SIMPLE_ERR_ABORTED_COMMAND   11
#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_TIMEOUT_DEFAULT   20
#define SCSI_TIMEOUT_SELF_TEST   (5 * 60 * 60)
#define LOGPAGEHDRSIZE   4

Typedefs

typedef unsigned char UINT8
typedef signed char INT8
typedef unsigned int UINT32
typedef int INT32

Functions

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)
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 *pBuf, int bufLen)
int scsiInquiryVpd (scsi_device *device, int vpd_page, UINT8 *pBuf, int bufLen)
int scsiLogSense (scsi_device *device, int pagenum, int subpagenum, UINT8 *pBuf, int bufLen, int known_resp_len)
int scsiLogSelect (scsi_device *device, int pcr, int sp, int pc, int pagenum, int subpagenum, UINT8 *pBuf, int bufLen)
int scsiModeSense (scsi_device *device, int pagenum, int subpagenum, int pc, UINT8 *pBuf, int bufLen)
int scsiModeSelect (scsi_device *device, int sp, UINT8 *pBuf, int bufLen)
int scsiModeSense10 (scsi_device *device, int pagenum, int subpagenum, int pc, UINT8 *pBuf, int bufLen)
int scsiModeSelect10 (scsi_device *device, int sp, UINT8 *pBuf, int bufLen)
int scsiModePageOffset (const UINT8 *resp, int len, int modese_len)
int scsiRequestSense (scsi_device *device, struct scsi_sense_disect *sense_info)
int scsiSendDiagnostic (scsi_device *device, int functioncode, UINT8 *pBuf, int bufLen)
int scsiReceiveDiagnostic (scsi_device *device, int pcv, int pagenum, UINT8 *pBuf, int bufLen)
int scsiReadDefect10 (scsi_device *device, int req_plist, int req_glist, int dl_format, UINT8 *pBuf, int bufLen)
int scsiReadDefect12 (scsi_device *device, int req_plist, int req_glist, int dl_format, int addrDescIndex, UINT8 *pBuf, int bufLen)
int scsiReadCapacity10 (scsi_device *device, unsigned int *last_lbp, unsigned int *lb_sizep)
int scsiReadCapacity16 (scsi_device *device, UINT8 *pBuf, int bufLen)
int scsiCheckIE (scsi_device *device, int hasIELogPage, int hasTempLogPage, UINT8 *asc, UINT8 *ascq, UINT8 *currenttemp, UINT8 *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 scsiGetSetCache (scsi_device *device, int modese_len, short int *wce, short int *rcd)
uint64_t scsiGetSize (scsi_device *device, unsigned int *lb_sizep, int *lb_per_pb_expp)
int scsiGetProtPBInfo (scsi_device *device, unsigned char *rc16_12_31p)
const char * scsiGetIEString (UINT8 asc, UINT8 ascq)
int scsiGetTemp (scsi_device *device, UINT8 *currenttemp, UINT8 *triptemp)
int scsiSmartIBMOfflineTest (scsi_device *device)
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 (UINT8 opcode)
void scsi_format_id_string (char *out, const unsigned char *in, int n)
void dStrHex (const char *str, int len, int no_ascii)
void dStrHex (const unsigned char *str, 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

Define Documentation

#define ALL_MODE_PAGES   0x3f

Definition at line 239 of file scsicmds.h.

#define APPLICATION_CLIENT_LPAGE   0x0f

Definition at line 193 of file scsicmds.h.

#define BACKGROUND_CONTROL_M_SUBPAGE   0x1

Definition at line 237 of file scsicmds.h.

#define BACKGROUND_RESULTS_LPAGE   0x15

Definition at line 196 of file scsicmds.h.

#define BUFFER_OVERRUN_LPAGE   0x01

Definition at line 182 of file scsicmds.h.

#define CACHING_PAGE   0x08

Definition at line 220 of file scsicmds.h.

#define CD_AUDIO_CONTROL_PAGE   0x0e

Definition at line 227 of file scsicmds.h.

#define CD_DEVICE_PAGE   0x0d

Definition at line 226 of file scsicmds.h.

#define CONTROL_MODE_PAGE   0x0a

Definition at line 223 of file scsicmds.h.

#define DATA_COMPRESSION_PAGE   0x0f

Definition at line 228 of file scsicmds.h.

#define DISCONNECT_RECONNECT_PAGE   0x02

Definition at line 215 of file scsicmds.h.

#define DXFER_FROM_DEVICE   1

Definition at line 113 of file scsicmds.h.

#define DXFER_NONE   0

Definition at line 112 of file scsicmds.h.

#define DXFER_TO_DEVICE   2

Definition at line 114 of file scsicmds.h.

#define ENCLOSURE_SERVICES_MANAGEMENT_PAGE   0x14

Definition at line 229 of file scsicmds.h.

#define FAULT_FAILURE_REPORTING_PAGE   0x1c

Definition at line 234 of file scsicmds.h.

#define FLEXIBLE_DISK_PAGE   0x05

Definition at line 218 of file scsicmds.h.

#define FORMAT_DEVICE_PAGE   0x03

Definition at line 216 of file scsicmds.h.

#define FORMAT_STATUS_LPAGE   0x08

Definition at line 189 of file scsicmds.h.

#define IE_LPAGE   0x2f

Definition at line 199 of file scsicmds.h.

#define INFORMATIONAL_EXCEPTIONS_CONTROL_PAGE   0x1c

Definition at line 233 of file scsicmds.h.

#define INQUIRY   0x12

Definition at line 67 of file scsicmds.h.

#define LAST_N_ERROR_LPAGE   0x07

Definition at line 188 of file scsicmds.h.

#define LB_PROV_LPAGE   0x0c

Definition at line 190 of file scsicmds.h.

#define LOG_RESP_SELF_TEST_LEN   0x194

Definition at line 206 of file scsicmds.h.

#define LOG_SELECT   0x4c

Definition at line 49 of file scsicmds.h.

#define LOG_SENSE   0x4d

Definition at line 52 of file scsicmds.h.

#define LOGPAGEHDRSIZE   4

Definition at line 316 of file scsicmds.h.

#define MEDIUM_TYPES_SUPPORTED_PAGE   0x0b

Definition at line 224 of file scsicmds.h.

#define MODE_SELECT   0x15

Definition at line 61 of file scsicmds.h.

#define MODE_SELECT_10   0x55

Definition at line 64 of file scsicmds.h.

#define MODE_SENSE   0x1a

Definition at line 55 of file scsicmds.h.

#define MODE_SENSE_10   0x5a

Definition at line 58 of file scsicmds.h.

#define MPAGE_CONTROL_CHANGEABLE   1

Definition at line 243 of file scsicmds.h.

#define MPAGE_CONTROL_CURRENT   0

Definition at line 242 of file scsicmds.h.

#define MPAGE_CONTROL_DEFAULT   2

Definition at line 244 of file scsicmds.h.

#define MPAGE_CONTROL_SAVED   3

Definition at line 245 of file scsicmds.h.

#define NON_MEDIUM_ERROR_LPAGE   0x06

Definition at line 187 of file scsicmds.h.

#define NONVOL_CACHE_LPAGE   0x17

Definition at line 197 of file scsicmds.h.

#define NOTCH_PAGE   0x0c

Definition at line 225 of file scsicmds.h.

#define PERIPHERAL_DEVICE_PAGE   0x09

Definition at line 221 of file scsicmds.h.

#define POWER_CONDITION_PAGE   0x1a

Definition at line 232 of file scsicmds.h.

#define PROTOCOL_SPECIFIC_LPAGE   0x18

Definition at line 198 of file scsicmds.h.

#define PROTOCOL_SPECIFIC_LUN_PAGE   0x18

Definition at line 230 of file scsicmds.h.

#define PROTOCOL_SPECIFIC_PORT_PAGE   0x19

Definition at line 231 of file scsicmds.h.

#define READ_CAPACITY_10   0x25

Definition at line 91 of file scsicmds.h.

#define READ_CAPACITY_16   0x9e

Definition at line 94 of file scsicmds.h.

#define READ_DEFECT_10   0x37

Definition at line 79 of file scsicmds.h.

#define READ_DEFECT_12   0xb7

Definition at line 82 of file scsicmds.h.

#define READ_ERROR_COUNTER_LPAGE   0x03

Definition at line 184 of file scsicmds.h.

#define READ_REVERSE_ERROR_COUNTER_LPAGE   0x04

Definition at line 185 of file scsicmds.h.

#define READ_WRITE_ERROR_RECOVERY_PAGE   0x01

Definition at line 214 of file scsicmds.h.

#define RECEIVE_DIAGNOSTIC   0x1c

Definition at line 73 of file scsicmds.h.

#define REPORT_LUNS   0xa0

Definition at line 88 of file scsicmds.h.

#define REQUEST_SENSE   0x03

Definition at line 70 of file scsicmds.h.

#define RIGID_DISK_DRIVE_GEOMETRY_PAGE   0x04

Definition at line 217 of file scsicmds.h.

#define SAI_READ_CAPACITY_16   0x10

Definition at line 97 of file scsicmds.h.

#define SAT_ATA_PASSTHROUGH_12   0xa1

Definition at line 101 of file scsicmds.h.

#define SAT_ATA_PASSTHROUGH_16   0x85

Definition at line 104 of file scsicmds.h.

#define SCSI_ASC_IMPENDING_FAILURE   0x5d

Definition at line 279 of file scsicmds.h.

#define SCSI_ASC_INVALID_FIELD   0x24

Definition at line 276 of file scsicmds.h.

#define SCSI_ASC_NO_MEDIUM   0x3a

Definition at line 274 of file scsicmds.h.

#define SCSI_ASC_NOT_READY   0x4

Definition at line 273 of file scsicmds.h.

#define SCSI_ASC_UNKNOWN_OPCODE   0x20

Definition at line 275 of file scsicmds.h.

#define SCSI_ASC_UNKNOWN_PARAM   0x26

Definition at line 277 of file scsicmds.h.

#define SCSI_ASC_WARNING   0xb

Definition at line 278 of file scsicmds.h.

#define SCSI_ASCQ_ATA_PASS_THROUGH   0x1d

Definition at line 281 of file scsicmds.h.

#define SCSI_DIAG_ABORT_SELF_TEST   0x04

Definition at line 305 of file scsicmds.h.

#define SCSI_DIAG_BG_EXTENDED_SELF_TEST   0x02

Definition at line 302 of file scsicmds.h.

#define SCSI_DIAG_BG_SHORT_SELF_TEST   0x01

Definition at line 301 of file scsicmds.h.

#define SCSI_DIAG_DEF_SELF_TEST   0xff

Definition at line 300 of file scsicmds.h.

#define SCSI_DIAG_FG_EXTENDED_SELF_TEST   0x06

Definition at line 304 of file scsicmds.h.

#define SCSI_DIAG_FG_SHORT_SELF_TEST   0x05

Definition at line 303 of file scsicmds.h.

#define SCSI_DIAG_NO_SELF_TEST   0x00

Definition at line 299 of file scsicmds.h.

#define SCSI_IECMP_RAW_LEN   64

Definition at line 144 of file scsicmds.h.

#define SCSI_PT_CDROM   0x5

Definition at line 176 of file scsicmds.h.

#define SCSI_PT_DIRECT_ACCESS   0x0

Definition at line 174 of file scsicmds.h.

#define SCSI_PT_ENCLOSURE   0xd

Definition at line 178 of file scsicmds.h.

#define SCSI_PT_MEDIUM_CHANGER   0x8

Definition at line 177 of file scsicmds.h.

#define SCSI_PT_SEQUENTIAL_ACCESS   0x1

Definition at line 175 of file scsicmds.h.

#define SCSI_SK_ABORTED_COMMAND   0xb

Definition at line 270 of file scsicmds.h.

#define SCSI_SK_HARDWARE_ERROR   0x4

Definition at line 267 of file scsicmds.h.

#define SCSI_SK_ILLEGAL_REQUEST   0x5

Definition at line 268 of file scsicmds.h.

#define SCSI_SK_MEDIUM_ERROR   0x3

Definition at line 266 of file scsicmds.h.

#define SCSI_SK_NO_SENSE   0x0

Definition at line 263 of file scsicmds.h.

#define SCSI_SK_NOT_READY   0x2

Definition at line 265 of file scsicmds.h.

#define SCSI_SK_RECOVERED_ERR   0x1

Definition at line 264 of file scsicmds.h.

#define SCSI_SK_UNIT_ATTENTION   0x6

Definition at line 269 of file scsicmds.h.

#define SCSI_STATUS_CHECK_CONDITION   0x2

Definition at line 260 of file scsicmds.h.

#define SCSI_TIMEOUT_DEFAULT   20

Definition at line 309 of file scsicmds.h.

#define SCSI_TIMEOUT_SELF_TEST   (5 * 60 * 60)

Definition at line 311 of file scsicmds.h.

#define SCSI_VPD_ATA_INFORMATION   0x89

Definition at line 252 of file scsicmds.h.

#define SCSI_VPD_BLOCK_DEVICE_CHARACTERISTICS   0xb1

Definition at line 256 of file scsicmds.h.

#define SCSI_VPD_BLOCK_LIMITS   0xb0

Definition at line 255 of file scsicmds.h.

#define SCSI_VPD_DEVICE_IDENTIFICATION   0x83

Definition at line 250 of file scsicmds.h.

#define SCSI_VPD_EXTENDED_INQUIRY_DATA   0x86

Definition at line 251 of file scsicmds.h.

#define SCSI_VPD_LOGICAL_BLOCK_PROVISIONING   0xb2

Definition at line 257 of file scsicmds.h.

#define SCSI_VPD_POWER_CONDITION   0x8a

Definition at line 253 of file scsicmds.h.

#define SCSI_VPD_POWER_CONSUMPTION   0x8d

Definition at line 254 of file scsicmds.h.

#define SCSI_VPD_SUPPORTED_VPD_PAGES   0x0

Definition at line 248 of file scsicmds.h.

#define SCSI_VPD_UNIT_SERIAL_NUMBER   0x80

Definition at line 249 of file scsicmds.h.

#define SCSICMDS_H_CVSID   "$Id: scsicmds.h 3783 2013-03-02 01:51:12Z dpgilbert $\n"

Definition at line 35 of file scsicmds.h.

#define SEAGATE_CACHE_LPAGE   0x37

Definition at line 202 of file scsicmds.h.

#define SEAGATE_FACTORY_LPAGE   0x3e

Definition at line 203 of file scsicmds.h.

#define SELFTEST_RESULTS_LPAGE   0x10

Definition at line 194 of file scsicmds.h.

#define SEND_DIAGNOSTIC   0x1d

Definition at line 76 of file scsicmds.h.

#define SIMPLE_ERR_ABORTED_COMMAND   11

Definition at line 295 of file scsicmds.h.

#define SIMPLE_ERR_BAD_FIELD   3

Definition at line 287 of file scsicmds.h.

#define SIMPLE_ERR_BAD_OPCODE   2

Definition at line 286 of file scsicmds.h.

#define SIMPLE_ERR_BAD_PARAM   4

Definition at line 288 of file scsicmds.h.

#define SIMPLE_ERR_BAD_RESP   5

Definition at line 289 of file scsicmds.h.

#define SIMPLE_ERR_BECOMING_READY   7

Definition at line 291 of file scsicmds.h.

#define SIMPLE_ERR_MEDIUM_HARDWARE   9

Definition at line 293 of file scsicmds.h.

#define SIMPLE_ERR_NO_MEDIUM   6

Definition at line 290 of file scsicmds.h.

#define SIMPLE_ERR_NOT_READY   1

Definition at line 285 of file scsicmds.h.

#define SIMPLE_ERR_TRY_AGAIN   8

Definition at line 292 of file scsicmds.h.

#define SIMPLE_ERR_UNKNOWN   10

Definition at line 294 of file scsicmds.h.

#define SIMPLE_NO_ERROR   0

Definition at line 284 of file scsicmds.h.

#define SS_MEDIA_LPAGE   0x11

Definition at line 195 of file scsicmds.h.

#define START_STOP_UNIT   0x1b

Definition at line 85 of file scsicmds.h.

#define STARTSTOP_CYCLE_COUNTER_LPAGE   0x0e

Definition at line 192 of file scsicmds.h.

#define SUPPORTED_LPAGES   0x00

Definition at line 181 of file scsicmds.h.

#define TAPE_ALERTS_LPAGE   0x2e

Definition at line 210 of file scsicmds.h.

#define TEMPERATURE_LPAGE   0x0d

Definition at line 191 of file scsicmds.h.

#define TEST_UNIT_READY   0x0

Definition at line 46 of file scsicmds.h.

#define VENDOR_UNIQUE_PAGE   0x00

Definition at line 213 of file scsicmds.h.

#define VERIFY_ERROR_COUNTER_LPAGE   0x05

Definition at line 186 of file scsicmds.h.

#define VERIFY_ERROR_RECOVERY_PAGE   0x07

Definition at line 219 of file scsicmds.h.

#define WRITE_ERROR_COUNTER_LPAGE   0x02

Definition at line 183 of file scsicmds.h.

#define XOR_CONTROL_MODE_PAGE   0x10

Definition at line 222 of file scsicmds.h.


Typedef Documentation

typedef int INT32

Definition at line 110 of file scsicmds.h.

typedef signed char INT8

Definition at line 108 of file scsicmds.h.

typedef unsigned int UINT32

Definition at line 109 of file scsicmds.h.

typedef unsigned char UINT8

Definition at line 107 of file scsicmds.h.


Function Documentation

void dStrHex ( const char *  str,
int  len,
int  no_ascii 
)

Definition at line 91 of file scsicmds.cpp.

void dStrHex ( const unsigned char *  str,
int  len,
int  no_ascii 
) [inline]

Definition at line 451 of file scsicmds.h.

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

Definition at line 330 of file scsicmds.cpp.

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

Definition at line 195 of file scsicmds.cpp.

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

Definition at line 2756 of file scsicmds.cpp.

const char* scsi_get_opcode_name ( UINT8  opcode)

Definition at line 176 of file scsicmds.cpp.

int scsi_IsExceptionControlEnabled ( const struct scsi_iec_mode_page iecp)

Definition at line 1382 of file scsicmds.cpp.

int scsi_IsWarningEnabled ( const struct scsi_iec_mode_page iecp)

Definition at line 1398 of file scsicmds.cpp.

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 301 of file scsicmds.cpp.

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

Definition at line 1528 of file scsicmds.cpp.

int scsiCountFailedSelfTests ( scsi_device device,
int  noisy 
)

Definition at line 2369 of file scsicmds.cpp.

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

Definition at line 2244 of file scsicmds.cpp.

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

Definition at line 2291 of file scsicmds.cpp.

const char* scsiErrString ( int  scsiErr)

Definition at line 257 of file scsicmds.cpp.

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

Definition at line 2447 of file scsicmds.cpp.

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

Definition at line 2206 of file scsicmds.cpp.

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

Definition at line 1335 of file scsicmds.cpp.

int scsiFetchTransportProtocol ( scsi_device device,
int  modese_len 
)

Definition at line 2695 of file scsicmds.cpp.

const char* scsiGetIEString ( UINT8  asc,
UINT8  ascq 
)

Definition at line 2082 of file scsicmds.cpp.

int scsiGetProtPBInfo ( scsi_device device,
unsigned char *  rc16_12_31p 
)

Definition at line 1273 of file scsicmds.cpp.

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

Definition at line 2482 of file scsicmds.cpp.

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

Definition at line 2523 of file scsicmds.cpp.

uint64_t scsiGetSize ( scsi_device device,
unsigned int *  lb_sizep,
int *  lb_per_pb_expp 
)

Definition at line 1228 of file scsicmds.cpp.

int scsiGetTemp ( scsi_device device,
UINT8 currenttemp,
UINT8 triptemp 
)

Definition at line 1505 of file scsicmds.cpp.

int scsiInquiryVpd ( scsi_device device,
int  vpd_page,
UINT8 pBuf,
int  bufLen 
)

Definition at line 814 of file scsicmds.cpp.

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

Definition at line 549 of file scsicmds.cpp.

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

Definition at line 456 of file scsicmds.cpp.

int scsiModePageOffset ( const UINT8 resp,
int  len,
int  modese_len 
)

Definition at line 1292 of file scsicmds.cpp.

int scsiModeSelect ( scsi_device device,
int  sp,
UINT8 pBuf,
int  bufLen 
)

Definition at line 641 of file scsicmds.cpp.

int scsiModeSelect10 ( scsi_device device,
int  sp,
UINT8 pBuf,
int  bufLen 
)

Definition at line 738 of file scsicmds.cpp.

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

Definition at line 585 of file scsicmds.cpp.

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

Definition at line 683 of file scsicmds.cpp.

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

Definition at line 1152 of file scsicmds.cpp.

int scsiReadCapacity16 ( scsi_device device,
UINT8 pBuf,
int  bufLen 
)

Definition at line 1194 of file scsicmds.cpp.

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

Definition at line 1078 of file scsicmds.cpp.

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

Definition at line 1112 of file scsicmds.cpp.

int scsiReceiveDiagnostic ( scsi_device device,
int  pcv,
int  pagenum,
UINT8 pBuf,
int  bufLen 
)

Definition at line 996 of file scsicmds.cpp.

int scsiRequestSense ( scsi_device device,
struct scsi_sense_disect sense_info 
)

Definition at line 876 of file scsicmds.cpp.

int scsiSelfTestInProgress ( scsi_device device,
int *  inProgress 
)

Definition at line 2419 of file scsicmds.cpp.

int scsiSendDiagnostic ( scsi_device device,
int  functioncode,
UINT8 pBuf,
int  bufLen 
)

Definition at line 957 of file scsicmds.cpp.

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

Definition at line 2625 of file scsicmds.cpp.

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

Definition at line 1429 of file scsicmds.cpp.

int scsiSimpleSenseFilter ( const struct scsi_sense_disect sinfo)

Definition at line 219 of file scsicmds.cpp.

int scsiSmartDefaultSelfTest ( scsi_device device)

Definition at line 2136 of file scsicmds.cpp.

int scsiSmartExtendCapSelfTest ( scsi_device device)

Definition at line 2181 of file scsicmds.cpp.

int scsiSmartExtendSelfTest ( scsi_device device)

Definition at line 2158 of file scsicmds.cpp.

int scsiSmartIBMOfflineTest ( scsi_device device)

Definition at line 2114 of file scsicmds.cpp.

int scsiSmartSelfTestAbort ( scsi_device device)

Definition at line 2193 of file scsicmds.cpp.

int scsiSmartShortCapSelfTest ( scsi_device device)

Definition at line 2170 of file scsicmds.cpp.

int scsiSmartShortSelfTest ( scsi_device device)

Definition at line 2147 of file scsicmds.cpp.

int scsiStdInquiry ( scsi_device device,
UINT8 pBuf,
int  bufLen 
)

Definition at line 780 of file scsicmds.cpp.

const char* scsiTapeAlertsChangerDevice ( unsigned short  code)

Definition at line 1947 of file scsicmds.cpp.

const char* scsiTapeAlertsTapeDevice ( unsigned short  code)

Definition at line 1811 of file scsicmds.cpp.

int scsiTestUnitReady ( scsi_device device)

Definition at line 1055 of file scsicmds.cpp.

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

Definition at line 2729 of file scsicmds.cpp.


Variable Documentation

unsigned char scsi_debugmode

Definition at line 56 of file scsicmds.cpp.

Definition at line 58 of file scsicmds.cpp.