2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 2N/A * Debug output function. Prints messages to stdout only if debug flag 2N/A * debug_mode is set to true. 2N/A * Define the command string. For INQUIRY command, use page_code 2N/A * to specify if evpd is set, if yes, the subpage_code stands for 2N/A * the vpd page number. For vendor specific commands, both the 2N/A * page_code and the subpage_code are zero, which means the command 2N/A * doesn't need them. 2N/A "Software Interface Identification" },
2N/A "Management Network Addresses" },
2N/A "Protocol Specific Logical Unit Information" },
2N/A "Protocol Specific Port Information" },
2N/A "Block Device Characteristics VPD page" },
2N/A "Read Reverse Error Counter Log Page" },
2N/A "Verify Error Counter Log Page" },
2N/A "Last N Deferred Errors or Asynchronous Events Log Page" },
2N/A "Start-Stop Cycle Counter Log Page" },
2N/A "Background Scan Results Log Page" },
2N/A "Protocol-Specific Port Log Page" },
2N/A "General Statistics and Performance Log Page" },
2N/A "Power Condition Transitions Log Page" },
2N/A "Informational Exceptions Log Page" },
2N/A "Read-Write Error Recovery Mode Page" },
2N/A "Disconnect-Reconnect Mode Page" },
2N/A "Verify Error Recovery Mode Page" },
2N/A "Control Extension Mode Page" },
2N/A "Enclosure Services Management Mode Page" },
2N/A "Extended Device-Type Specific Mode Page" },
2N/A "Protocol Specific Logical Unit Mode Page" },
2N/A "Protocol Specific Port Mode Page" },
2N/A "Informational Exceptions Control Mode Page" },
2N/A "Background Control Mode Page" },
2N/A "Thin Provisioning Mode Page" },
2N/A "Supported Mode Pages and Subpages" },
2N/A "HITACHI VIPER-A Log Dump Command" },
2N/A "SEAGATE Drive Read Command" },
2N/A "---- %s(evpd-%02xh,pc-%02xh) ----\n",
2N/A "---- %s(pc-%02xh) ----\n",
2N/A "---- %s(pc-%02xh,spc-%02xh) ----\n",
2N/A "---- Vendor Specific INQUIRY Data(evpd-%02xh,pc-%02xh) " 2N/A "---- Vendor Specific Log Page(pc-%02xh) ----\n",
2N/A "---- Vendor Specific Mode Page(pc-%02xh,spc-%02xh) ----\n",
2N/A "---- Unknown command(pc-%02xh,spc-%02xh) ----\n",
2N/A for (i = 0; i <
len; i +=
16) {
2N/A for (j = i; j < i +
16 && j <
len; j++)
2N/A "PERIPHERAL DEVICE TYPE: %d PERIPHERAL QUALIFIER : %d\n" 2N/A "RMB : %d VERSION : %d RESPONSE DATA FORMAT : %d\n" 2N/A "HISUP : %d NORMACA : %d ADDITIONAL LENGTH : %d\n" 2N/A "PROTECT: %d 3PC : %d TPGS : %d ACC: %d\n" 2N/A "SCCS : %d ADDR16 : %d MCHANGER: %d MULTIP: %d\n" 2N/A "VS_6_5 : %d ENCSERV : %d BQUE : %d VS_7_0: %d\n" 2N/A "CMDQUE : %d LINKED : %d SYNC : %d WBUS16: %d\n" 2N/A "VENDOR_ID : %.8s\n" 2N/A "PRODUCT_ID : %.16s\n" 2N/A "PRODUCT_REVISION : %.4s\n" 2N/A "IUS : %d QAS : %d CLOCKING: %d\n" 2N/A "VERSION_DESCRIPTORS : %d\n\n",
2N/A "ASSOCIATED WITH THE ADDRESSED LU",
2N/A "ASSOCIATED WITH THE TARGET PORT THAT RECEIVED THE REQUEST",
2N/A "ASSOCIATED WITH THE SCSI TARGET DEVICE CONTAINING THE LU",
2N/A "CODE SET : %s\nPROTOCOL ID: %s\n" 2N/A "ID TYPE : %s\nASSOCIATION: %s\n" 2N/A "PIV : %d ID LEN : %d\n",
2N/A "REF_CHK : %d APP_CHK: %d GRD_CHK: %d RTO : %d\n" 2N/A "SIMPSUP : %d ORDSUP : %d HEADSUP: %d PRIOR_SUP: %d\n" 2N/A "GROUP_SUP: %d V_SUP : %d NV_SUP : %d\n\n",
2N/A "INQUIRY mode page policy data invalid\n");
2N/A "POLICY PAGE CODE: 0x%02x POLICY SUBPAGE CODE: 0x%02x\n" 2N/A "MLUS : %d MODE POLICY CODE : %s\n\n",
2N/A "LP : %d LBIN: %d TMC: %d ETC : %d\n" \
2N/A "TSD: %d DS : %d DU : %d PARAM LEN: %d\n", \
2N/A "ERRORS CORRECTED WITHOUT SUBSTANTIAL DELAY" },
2N/A "TOTAL TIMES CORRECTION ALGORITHM PROCESSED" },
2N/A "TOTAL UNCORRECTED ERRORS" },
2N/A "CURRENT TEMPERATURE : %d C\n\n",
2N/A "REFERENCE TEMPERATURE : %d C\n\n",
2N/A "YEAR OF MANUFACTURE : %.4s\n" 2N/A "WEEK OF MANUFACTURE : %.2s\n\n",
2N/A "ACCOUNTING DATE YEAR : %.4s\n" 2N/A "ACCOUNTING DATE WEEK : %.2s\n\n",
2N/A "SPECIFIED CYCLE COUNT OVER DEVICE LIFETIME : " 2N/A "SPECIFIED CYCLE COUNT OVER DEVICE LIFETIME : " 2N/A "SELF-TEST RESULT: %d SELF-TEST CODE : %d\n" 2N/A "SELF-TEST NUMBER: %d TIMESTAMP : %d\n" 2N/A "SENSE KEY: %d ASC: %d ASCQ: %d VS: %d\n\n",
2N/A "BACK SCAN HALTED DUE TO FATAL ERR" },
2N/A "BACK SCAN HALTED DUE TO VENDOR SPECIFIC PATTERN OF ERRS" },
2N/A "BACK SCAN HALTED DUE TO MEDIUM FORMATTED WITHOUT P-LIST" },
2N/A "BACK SCAN HALTED DUE TOH VENDOR CAUSE" },
2N/A "BACK SCAN HALTED DUE TO TOO HIGH TEMPERATURE" },
2N/A "BACK MEDIUM SCAN ENABLED, BUT NO ONE INACTIVE" },
2N/A "PARAM CODE : %04xh (%s)\n",
2N/A "STATUS PARAMETER" :
"MEDIUM SCAN PARAMETER"));
2N/A "ACCUMULATED POWER ON MINUTES: %d\n" 2N/A "BACKGROUND SCAN STATUS : %s\n" 2N/A "NUMBER OF BACKGROUND SCANS PERFORMED : " 2N/A "BACKGROUND SCAN PROGRESS : " 2N/A "NUMBER OF BACKGROUND MEDIUM SCANS PERFORMED : " 2N/A "ACCUMULATED POWER ON MINUTES: %d\n" 2N/A "REASSIGN STATUS : %d\n" 2N/A "ASC: 0x%02x ASCQ: 0x%02x",
2N/A "LOSS OF DWORD SYNCHRONIZATION" },
2N/A "EXPANDER DEVICE COMPLIANT WITH A PREVIOUS VERSION"},
2N/A "PHY ENABLED, UNKNOWN PHYISCAL LINK RATE" },
2N/A "PHY ENABLED, A PHY RESET PROBLEM OCCURRED" },
2N/A "PHY ENABLED, UNSUPPORTED PHY ATTACHED" },
2N/A "RUNNING DISPARITY ERROR COUNT" },
2N/A "LOSS OF DWORD SYNCHRONIZATION COUNT" },
2N/A "ELASTICITY BUFFER OVERFLOW COUNT" },
2N/A "RECEIVED ADDRESS FRAME ERROR COUNT" },
2N/A "TRANSMITTED ABANDON-CLASS OPEN_REJECT COUNT" },
2N/A "RECEIVED ABANDON-CLASS OPEN_REJECT COUNT" },
2N/A "TRANSMITTED RETRY-CLASS OPEN_REJECT COUNT" },
2N/A "RECEIVED RETRY-CLASS OPEN_REJECT COUNT" },
2N/A "RECEIVED AIP(WAITING ON PARTIAL) COUNT" },
2N/A "RECEIVED AIP(WAITING ON CONNECTION) COUNT" },
2N/A "PEAK TRANSMITTED PATHWAY BLOCKED COUNT" },
2N/A "PEAK TRANSMITTED ARBITRATION WAIT TIME" },
2N/A "TRANSMITTED SSP FRAME COUNT" },
2N/A "TRANSMITTED SSP FRAME ERROR COUNT" },
2N/A "RECEIVED SSP FRAME ERROR COUNT" },
2N/A "TRANSMITTED CREDIT_BLOCKED COUNT" },
2N/A "TRANSMITTED SATA FRAME COUNT" },
2N/A "SATA FLOW CONTROL BUFFER OVERFLOW COUNT" },
2N/A "TRANSMITTED SMP FRAME COUNT" },
2N/A "RECEIVED SMP FRAME ERROR COUNT" },
2N/A "PROTOCOL IDENTIFIER : SAS SERIAL SCSI PROTOCOL\n" 2N/A "GENERATION CODE : %d NUMBER OF PHYS : %d\n",
2N/A "SAS phy log descriptor invalid\n");
2N/A "PHY IDENTIFIER : %d\n" 2N/A "SAS_PHY_LOG_DESCRIPTOR_LENGTH : " 2N/A "ATTACHED REASON : %s\n" 2N/A "ATTACHED DEVICE : %s\n" 2N/A "NEGOTIATED LOGICAL LINK RATE: %s\n" 2N/A "ATTACHED INITIATOR PORT\n" 2N/A "SMP: %d STP: %d SSP: %d\n" 2N/A "ATTACHED TARGET PORT\n" 2N/A "SMP: %d STP: %d SSP: %d\n",
2N/A "ATTACHED SAS ADDR : 0x");
2N/A "ATTACHED PHY ID : %d\n" 2N/A "INVALID DWORD COUNT : %d\n" 2N/A "RUNNING DISPARITY ERR COUNT : %d\n" 2N/A "LOSS OF DWORD SYNC : %d\n" 2N/A "PHY RESET PROBLEM : %d\n",
2N/A "PHY EVENT DESCRIPTOR LEN : %d\n" 2N/A "# OF PHY EVENT DESCRIPTORS : %d\n",
2N/A ", phy event descriptor invalid\n");
2N/A "PHY EVENT SOURCE: %s\n" 2N/A "PHY EVEMT VALUE : %d\n",
2N/A "PEAK VAL DETECTOR THRESHOLD: %d" 2N/A "INFORMATIONAl EXCEPTION ASC : %d\n" 2N/A "INFORMATIONAL EXCEPTION ASCQ: %d\n",
2N/A "MOST RECENT TEMPERATURE : %d C\n",
2N/A "BLOCKS SENT TO INITIATOR " },
2N/A "BLOCKS RECEIVED FROM INITIATOR " },
2N/A "BLOCKS READ FROM CACHE AND SENT TO INITIATOR " },
2N/A "COMMAND # OF R/W WHOSE SIZE <= SEGMENT SIZE " },
2N/A "COMMAND # OF R/W WHOSE SIZE >= SEGMENT SIZE " },
2N/A "UNKNOWN SEAGATE PARAMETER CODE: %04xh\n",
code);
2N/A "SMART TEST : %d\n\n",
2N/A for (i = 0; i <
len; i +=
2) {
2N/A for (i = 0; i <
len; i +=
2) {
2N/A "RLEC: %d GLTSD: %d D_SENSE : %d TMF_ONLY: %d TST: %d\n" 2N/A "QERR: %d QUEUE ALGORITHM MODIFIER: %d SWP : %d\n" 2N/A "UA_INTLCK_CTRL: %d RAC: %d VS: %d AUTOLOAD MODE : %d\n" 2N/A "TAS : %d ATO: %d BUSY TIMEOUT PERIOD: %d\n" 2N/A "EXTENDED SELF-TEST COMPLETION TIME : %d\n\n",
2N/A "Control Extension Mode Page data incomplete\n\n");
2N/A "IALUAE: %d SCSIP: %d TCMOS: %d " 2N/A "Initial command priority: %d\n\n",
2N/A "Disconnect-Reconnect Mode Page data incomplete\n");
2N/A "BUFFER FULL RATIO : %d\n" 2N/A "BUFFER EMPTY RATIO : %d\n" 2N/A "BUS INACTIVITY LIMIT : %d\n" 2N/A "DISCONNECT TIME LIMIT: %d\n" 2N/A "CONNECT TIME LIMIT : %d\n" 2N/A "MAX BURST SIZE : %d\n" 2N/A "DTDC: %d DIMM: %d FAIR ARBITRATION : %d\n" 2N/A "EMDP: %d FIRST BURST SIZE : %d\n\n",
2N/A "Information Exception Control Mode Page " 2N/A "data incomplete\n\n");
2N/A "LOGERR: %d TEST: %d DEXCPT: %d EWASC: %d EBF : %d\n" 2N/A "PERF : %d MRIE: %d INTERVAL TIMER : %u\n" 2N/A "EPORT COUNT : %u\n\n",
2N/A "Power Condition Mode Page data incomplete\n\n");
2N/A "STANDBY: %d IDLE : %d\nIDLE CONDITION TIMER : %u\n" 2N/A "STANDBY CONDITION TIMER: %u\n\n",
2N/A "(no sense data available)",
2N/A "SCSI status = 0x%x\nsense key = 0x%llx (%s)\n" 2N/A "sense code = 0x%llx/0x%llx (%s)\n\n",
2N/A * Send an inquiry page request. Provides the ability to request a particular 2N/A * inquiry page for the scsi target specified by the libscsi_target_t parameter. 2N/A * This includes the ability to request all inquiry pages supported by the 2N/A * target. Once retrieved call the appropriate parse function and print the 2N/A * data to the stream. 2N/A * Format and send a request to obtain the log pages from the the scsi target 2N/A * specified by the libscsi_target_t structure. These pages contain read/write 2N/A * error counters, verify error counters and etc. Once the data is retrieved 2N/A * call parse and print functions to write this data to the stream. 2N/A * Format and send a request to obtain the mode pages from the the scsi target 2N/A * specified by the libscsi_target_t structure. These pages will contain data 2N/A * like the informational Exception settings and data. Once the data is 2N/A * retrieved call parse and print functions to write this data to the stream. 2N/A /* Send mode sense command to get supported pages and subpages */ 2N/A * Create a directory if it doesn't exist. 2N/A * path: The directory path to create. 2N/A * mode: The mode used when creating the directory. 2N/A * If the indicated path does not exist, attempt to create it, if is does exist 2N/A * verify whether it is a directory or not. 2N/A /* Directory does not exist */ 2N/A * Walk the indcated path, checking whether each directory exists by calling 2N/A * the do_mkdir function. 2N/A /* Neither root nor double slash in path */ 2N/A dprintf(
"disklog_print_diskinfo was passed a NULL parameter\n");
2N/A /* Retrieve the devid from the args. */ 2N/A dprintf(
"Directory %s does not exist and could not be "