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

Go to the source code of this file.

Macros

#define GBUF_SIZE   65535
 
#define LOG_RESP_LEN   252
 
#define LOG_RESP_LONG_LEN   ((62 * 256) + 252)
 
#define LOG_RESP_TAPE_ALERT_LEN   0x144
 

Functions

static void scsiGetSupportedLogPages (scsi_device *device)
 
static int scsiGetSmartData (scsi_device *device, bool attribs)
 
static int scsiGetTapeAlertsData (scsi_device *device, int peripheral_type)
 
static void scsiGetStartStopData (scsi_device *device)
 
static void scsiPrintGrownDefectListLen (scsi_device *device)
 
static void scsiPrintSeagateCacheLPage (scsi_device *device)
 
static void scsiPrintSeagateFactoryLPage (scsi_device *device)
 
static void scsiPrintErrorCounterLog (scsi_device *device)
 
static int scsiPrintSelfTest (scsi_device *device)
 
static int scsiPrintBackgroundResults (scsi_device *device)
 
static int scsiPrintSSMedia (scsi_device *device)
 
static void show_sas_phy_event_info (int peis, unsigned int val, unsigned thresh_val)
 
static void show_sas_port_param (unsigned char *ucp, int param_len)
 
static int show_protocol_specific_page (unsigned char *resp, int len)
 
static int scsiPrintSasPhy (scsi_device *device, int reset)
 
static int scsiGetDriveInfo (scsi_device *device, UINT8 *peripheral_type, bool all)
 
static int scsiSmartEnable (scsi_device *device)
 
static int scsiSmartDisable (scsi_device *device)
 
static void scsiPrintTemp (scsi_device *device)
 
int scsiPrintMain (scsi_device *device, const scsi_print_options &options)
 

Variables

const char * scsiprint_c_cvsid
 
UINT8 gBuf [GBUF_SIZE]
 
static int gSmartLPage = 0
 
static int gTempLPage = 0
 
static int gSelfTestLPage = 0
 
static int gStartStopLPage = 0
 
static int gReadECounterLPage = 0
 
static int gWriteECounterLPage = 0
 
static int gVerifyECounterLPage = 0
 
static int gNonMediumELPage = 0
 
static int gLastNErrorLPage = 0
 
static int gBackgroundResultsLPage = 0
 
static int gProtocolSpecificLPage = 0
 
static int gTapeAlertsLPage = 0
 
static int gSSMediaLPage = 0
 
static int gSeagateCacheLPage = 0
 
static int gSeagateFactoryLPage = 0
 
static int gIecMPage = 1
 
static int modese_len = 0
 
static const char *const severities = "CWI"
 
static const char * self_test_code []
 
static const char * self_test_result []
 
static const char * bms_status []
 
static const char * reassign_status []
 
static const char * peripheral_dt_arr []
 
static const char * transport_proto_arr []
 

Macro Definition Documentation

#define GBUF_SIZE   65535

Definition at line 43 of file scsiprint.cpp.

#define LOG_RESP_LEN   252

Definition at line 50 of file scsiprint.cpp.

#define LOG_RESP_LONG_LEN   ((62 * 256) + 252)

Definition at line 51 of file scsiprint.cpp.

#define LOG_RESP_TAPE_ALERT_LEN   0x144

Definition at line 52 of file scsiprint.cpp.

Function Documentation

static int scsiGetDriveInfo ( scsi_device device,
UINT8 peripheral_type,
bool  all 
)
static

Definition at line 1452 of file scsiprint.cpp.

static int scsiGetSmartData ( scsi_device device,
bool  attribs 
)
static

Definition at line 150 of file scsiprint.cpp.

static void scsiGetStartStopData ( scsi_device device)
static

Definition at line 245 of file scsiprint.cpp.

static void scsiGetSupportedLogPages ( scsi_device device)
static

Definition at line 81 of file scsiprint.cpp.

static int scsiGetTapeAlertsData ( scsi_device device,
int  peripheral_type 
)
static

Definition at line 195 of file scsiprint.cpp.

static int scsiPrintBackgroundResults ( scsi_device device)
static

Definition at line 904 of file scsiprint.cpp.

static void scsiPrintErrorCounterLog ( scsi_device device)
static

Definition at line 579 of file scsiprint.cpp.

static void scsiPrintGrownDefectListLen ( scsi_device device)
static

Definition at line 322 of file scsiprint.cpp.

int scsiPrintMain ( scsi_device device,
const scsi_print_options options 
)

Definition at line 1861 of file scsiprint.cpp.

static int scsiPrintSasPhy ( scsi_device device,
int  reset 
)
static

Definition at line 1357 of file scsiprint.cpp.

static void scsiPrintSeagateCacheLPage ( scsi_device device)
static

Definition at line 406 of file scsiprint.cpp.

static void scsiPrintSeagateFactoryLPage ( scsi_device device)
static

Definition at line 483 of file scsiprint.cpp.

static int scsiPrintSelfTest ( scsi_device device)
static

Definition at line 721 of file scsiprint.cpp.

static int scsiPrintSSMedia ( scsi_device device)
static

Definition at line 1013 of file scsiprint.cpp.

static void scsiPrintTemp ( scsi_device device)
static

Definition at line 1839 of file scsiprint.cpp.

static int scsiSmartDisable ( scsi_device device)
static

Definition at line 1802 of file scsiprint.cpp.

static int scsiSmartEnable ( scsi_device device)
static

Definition at line 1765 of file scsiprint.cpp.

static int show_protocol_specific_page ( unsigned char *  resp,
int  len 
)
static

Definition at line 1333 of file scsiprint.cpp.

static void show_sas_phy_event_info ( int  peis,
unsigned int  val,
unsigned  thresh_val 
)
static

Definition at line 1069 of file scsiprint.cpp.

static void show_sas_port_param ( unsigned char *  ucp,
int  param_len 
)
static

Definition at line 1200 of file scsiprint.cpp.

Variable Documentation

const char* bms_status[]
static
Initial value:
= {
"no scans active",
"scan is active",
"pre-scan is active",
"halted due to fatal error",
"halted due to a vendor specific pattern of error",
"halted due to medium formatted without P-List",
"halted - vendor specific cause",
"halted due to temperature out of range",
"waiting until BMS interval timer expires",
}

Definition at line 875 of file scsiprint.cpp.

int gBackgroundResultsLPage = 0
static

Definition at line 64 of file scsiprint.cpp.

Definition at line 49 of file scsiprint.cpp.

int gIecMPage = 1
static

Definition at line 74 of file scsiprint.cpp.

int gLastNErrorLPage = 0
static

Definition at line 63 of file scsiprint.cpp.

int gNonMediumELPage = 0
static

Definition at line 62 of file scsiprint.cpp.

int gProtocolSpecificLPage = 0
static

Definition at line 65 of file scsiprint.cpp.

int gReadECounterLPage = 0
static

Definition at line 59 of file scsiprint.cpp.

int gSeagateCacheLPage = 0
static

Definition at line 70 of file scsiprint.cpp.

int gSeagateFactoryLPage = 0
static

Definition at line 71 of file scsiprint.cpp.

int gSelfTestLPage = 0
static

Definition at line 57 of file scsiprint.cpp.

int gSmartLPage = 0
static

Definition at line 55 of file scsiprint.cpp.

int gSSMediaLPage = 0
static

Definition at line 67 of file scsiprint.cpp.

int gStartStopLPage = 0
static

Definition at line 58 of file scsiprint.cpp.

int gTapeAlertsLPage = 0
static

Definition at line 66 of file scsiprint.cpp.

int gTempLPage = 0
static

Definition at line 56 of file scsiprint.cpp.

int gVerifyECounterLPage = 0
static

Definition at line 61 of file scsiprint.cpp.

int gWriteECounterLPage = 0
static

Definition at line 60 of file scsiprint.cpp.

int modese_len = 0
static

Definition at line 77 of file scsiprint.cpp.

const char* peripheral_dt_arr[]
static

Definition at line 1396 of file scsiprint.cpp.

const char* reassign_status[]
static
Initial value:
= {
"Reserved [0x0]",
"Require Write or Reassign Blocks command",
"Successfully reassigned",
"Reserved [0x3]",
"Reassignment by disk failed",
"Recovered via rewrite in-place",
"Reassigned by app, has valid data",
"Reassigned by app, has no valid data",
"Unsuccessfully reassigned by app",
}

Definition at line 887 of file scsiprint.cpp.

const char* scsiprint_c_cvsid
Initial value:
= "$Id: scsiprint.cpp 4040 2015-03-10 22:30:44Z dpgilbert $"
#define SCSIPRINT_H_CVSID
Definition: scsiprint.h:32

Definition at line 45 of file scsiprint.cpp.

const char* self_test_code[]
static
Initial value:
= {
"Default ",
"Background short",
"Background long ",
"Reserved(3) ",
"Abort background",
"Foreground short",
"Foreground long ",
"Reserved(7) "
}

Definition at line 686 of file scsiprint.cpp.

const char* self_test_result[]
static
Initial value:
= {
"Completed ",
"Aborted (by user command)",
"Aborted (device reset ?) ",
"Unknown error, incomplete",
"Completed, segment failed",
"Failed in first segment ",
"Failed in second segment ",
"Failed in segment --> ",
"Reserved(8) ",
"Reserved(9) ",
"Reserved(10) ",
"Reserved(11) ",
"Reserved(12) ",
"Reserved(13) ",
"Reserved(14) ",
"Self test in progress ..."
}

Definition at line 697 of file scsiprint.cpp.

const char* const severities = "CWI"
static

Definition at line 192 of file scsiprint.cpp.

const char* transport_proto_arr[]
static
Initial value:
= {
"Fibre channel (FCP-2)",
"Parallel SCSI (SPI-4)",
"SSA",
"IEEE 1394 (SBP-2)",
"RDMA (SRP)",
"iSCSI",
"SAS (SPL-3)",
"ADT",
"ATA (ACS-2)",
"UAS",
"SOP",
"0xb",
"0xc",
"0xd",
"0xe",
"0xf"
}

Definition at line 1431 of file scsiprint.cpp.