📄 dteei.c
字号:
Fprint("%02x\n", *bptr++); if (count < length) PrintAscii("", "", DNL); } else { Fprint ("%02x ", *bptr++); } } if (count % field_entrys) Fprint("\n");}/* * CAM Status Code Table. */struct CAM_StatusTable { u_char cam_status; caddr_t status_msg_brief; caddr_t status_msg_full;} cam_StatusTable[] = { { CAM_REQ_INPROG, "CAM_REQ_INPROG", "CCB request is in progress" }, { CAM_REQ_CMP , "CAM_REQ_CMP", "CCB request completed w/out error" }, { CAM_REQ_ABORTED, "CAM_REQ_ABORTED", "CCB request aborted by the host" }, { CAM_UA_ABORT, "CAM_UA_ABORT", "Unable to Abort CCB request" }, { CAM_REQ_CMP_ERR, "CAM_REQ_CMP_ERR", "CCB request completed with an error" }, { CAM_BUSY, "CAM_BUSY", "CAM subsystem is busy" }, { CAM_REQ_INVALID, "CAM_REQ_INVALID", "CCB request is invalid" }, { CAM_PATH_INVALID, "CAM_PATH_INVALID", "ID supplied is invalid" }, { CAM_DEV_NOT_THERE, "CAM_DEV_NOT_THERE", "device not installed/there" }, { CAM_UA_TERMIO, "CAM_UA_TERMIO", "Unable to Terminate I/O CCB request" }, { CAM_SEL_TIMEOUT, "CAM_SEL_TIMEOUT", "Target selection timeout" }, { CAM_CMD_TIMEOUT, "CAM_CMD_TIMEOUT", "Command timed out", }, { CAM_MSG_REJECT_REC, "CAM_MSG_REJECT_REC", "reject received" }, { CAM_SCSI_BUS_RESET, "CAM_SCSI_BUS_RESET", "bus reset sent/received" }, { CAM_UNCOR_PARITY, "CAM_UNCOR_PARITY", "parity error occurred" }, { CAM_AUTOSENSE_FAIL, "CAM_AUTOSENSE_FAIL", "Request sense cmd fail" }, { CAM_NO_HBA, "CAM_NO_HBA", "No HBA detected Error" }, { CAM_DATA_RUN_ERR, "CAM_DATA_RUN_ERR", "overrun/underrun error" }, { CAM_UNEXP_BUSFREE, "CAM_UNEXP_BUSFREE", "Unexpected bus free" }, { CAM_SEQUENCE_FAIL, "CAM_SEQUENCE_FAIL", "bus phase sequence failure" }, { CAM_CCB_LEN_ERR, "CAM_CCB_LEN_ERR", "CCB length supplied is inadequate" }, { CAM_PROVIDE_FAIL, "CAM_PROVIDE_FAIL", "to provide requ. capability" }, { CAM_BDR_SENT, "CAM_BDR_SENT", "A SCSI BDR msg was sent to target" }, { CAM_REQ_TERMIO, "CAM_REQ_TERMIO", "CCB request terminated by the host" }, { CAM_HBA_ERR, "CAM_HBA_ERR", "Unrecoverable host bus adaptor error" }, { CAM_BUS_RESET_DENIED, "CAM_BUS_RESET_DENIED", "bus reset denied" }, { CAM_MUNSA_REJECT, "CAM_MUNSA_REJECT", "rejecting device" }, { CAM_IDE, "CAM_IDE", "Initiator Detected Error Received" }, { CAM_RESRC_UNAVAIL, "CAM_RESRC_UNAVAIL", "Resource unavailable" }, { CAM_UNACKED_EVENT, "CAM_UNACKED_EVENT", "Unacknowledged event by host" }, { CAM_MESSAGE_RECV, "CAM_MESSAGE_RECV", "Msg received in Host Target Mode" }, { CAM_INVALID_CDB, "CAM_INVALID_CDB", "Invalid CDB recvd in HT Mode" }, { CAM_LUN_INVALID, "CAM_LUN_INVALID", "LUN supplied is invalid" }, { CAM_TID_INVALID, "CAM_TID_INVALID", "Target ID supplied is invalid" }, { CAM_FUNC_NOTAVAIL, "CAM_FUNC_NOTAVAIL", "Requested function is not available" }, { CAM_NO_NEXUS, "CAM_NO_NEXUS", "Nexus is not established" }, { CAM_IID_INVALID, "CAM_IID_INVALID", "The initiator ID is invalid" }, { CAM_CDB_RECVD, "CAM_CDB_RECVD", "The SCSI CDB has been received" }, { CAM_LUN_ALLREADY_ENAB, "CAM_LUN_ALLREADY_ENAB", "LUN is already enabled" }, { CAM_SCSI_BUSY, "CAM_SCSI_BUSY", "SCSI bus busy" }};static int cam_StatusEntrys = sizeof(cam_StatusTable) / sizeof(cam_StatusTable[0]);char *cdbg_CamStatus (u_char cam_status, int report_format){ struct CAM_StatusTable *cst = cam_StatusTable; I32 entrys; for (entrys = 0; entrys < cam_StatusEntrys; cst++, entrys++) { if (cst->cam_status == (cam_status&CAM_STATUS_MASK)) { if (report_format == CDBG_BRIEF) { return (cst->status_msg_brief); } else { return (cst->status_msg_full); } } } return ((report_format) ? "Unknown CAM Status" : "Unknown");}/* * CAM Status Code Table. */struct SCSI_StatusTable { u_char scsi_status; caddr_t status_msg_brief; caddr_t status_msg_full;} scsi_StatusTable[] = { { SCSI_STAT_GOOD, "SCSI_STAT_GOOD", /* 0x00 */ "Command successfully completed" }, { SCSI_STAT_CHECK_CONDITION, "SCSI_STAT_CHECK_CONDITION", /* 0x02 */ "Error, exception, or abnormal condition" }, { SCSI_STAT_CONDITION_MET, "SCSI_STAT_CONDITION_MET", /* 0x04 */ "Requested operation satisifed" }, { SCSI_STAT_BUSY, "SCSI_STAT_BUSY", /* 0x08 */ "Target is BUSY" }, { SCSI_STAT_INTERMEDIATE, "SCSI_STAT_INTERMEDIATE", /* 0x10 */ "Linked commands successfully completed" }, { SCSI_STAT_INTER_COND_MET, "SCSI_STAT_INTER_COND_MET", /* 0x14 */ "Intermediate-Condition met" }, { SCSI_STAT_RESERVATION_CONFLICT, "SCSI_STAT_RESERVATION_CONFLICT", /* 0x18 */ "Target reservation conflict" }, { SCSI_STAT_COMMAND_TERMINATED, "SCSI_STAT_COMMAND_TERMINATED", /* 0x22 */ "Command terminated by Terminate I/O Message"}, { SCSI_STAT_QUEUE_FULL, "SCSI_STAT_QUEUE_FULL", /* 0x28 */ "Command tag queue is full" }};static int scsi_StatusEntrys = sizeof(scsi_StatusTable) / sizeof(scsi_StatusTable[0]);char *cdbg_ScsiStatus (u_char scsi_status, int report_format){ struct SCSI_StatusTable *cst = scsi_StatusTable; I32 entrys; for (entrys = 0; entrys < scsi_StatusEntrys; cst++, entrys++) { if (cst->scsi_status == scsi_status) { if (report_format == CDBG_BRIEF) { return (cst->status_msg_brief); } else { return (cst->status_msg_full); } } } return ((report_format) ? "Unknown SCSI Status" : "Unknown");}/* * Sense Key Error Table. */char *cdbg_SenseKeyTable[] = { "NO SENSE - No error or no sense information", /* 0x00 */ "RECOVERED ERROR - Recovery action performed", /* 0x01 */ "NOT READY - Logical unit is NOT ready", /* 0x02 */ "MEDIUM ERROR - Nonrecoverable medium error", /* 0x03 */ "HARDWARE ERROR - Nonrecoverable hardware error", /* 0x04 */ "ILLEGAL REQUEST - Illegal request or CDB parameter", /* 0x05 */ "UNIT ATTENTION - Medium changed or target reset", /* 0x06 */ "DATA PROTECT - Data protected from this operation", /* 0x07 */ "BLANK CHECK - No-data condition occured", /* 0x08 */ "Vendor Specific", /* 0x09 */ "COPY ABORTED - Copy command was aborted", /* 0x0a */ "ABORTED COMMAND - Target aborted command", /* 0x0b */ "EQUAL - Search satisfied with equal comparison", /* 0x0c */ "VOLUME OVERFLOW - Physical end of media detected", /* 0x0d */ "MISCOMPARE - Source and medium data differ", /* 0x0e */ "RESERVED", /* 0x0f */};/* * Sense Code/Qualifier Table: */struct sense_entry SenseCodeTable[] = {/* Table 7-41: ASC and ASCQ Assignments-------------------------------------------------------------------------- ASC AND ASCQ ASSIGNMENTS D = Direct Access Device T = Sequential Access Device L = Printer Device P = Processor Device W = Write Once Read Multiple Device R = Read Only (CD-ROM) Device S = Scanner Device O = Optical Memory Device M = Media Changer Device C = Communication Device BYTE 12 13 DTLPWRSOMC DESCRIPTION -- -- -------------------------------------------- */{ 0x13, 0x00, /*D W O */ "Address mark not found for data field" },{ 0x12, 0x00, /*D W O */ "Address mark not found for ID field" },{ 0x00, 0x11, /* R */ "Audio play operation in progress" },{ 0x00, 0x12, /* R */ "Audio play operation paused" },{ 0x00, 0x14, /* R */ "Audio play operation stopped due to error" },{ 0x00, 0x13, /* R */ "Audio play operation successfully completed" },{ 0x00, 0x04, /* T S */ "Beginning-of-partition/medium detected" },{ 0x14, 0x04, /* T */ "Block sequence error" },{ 0x30, 0x02, /*DT WR O */ "Cannot read medium - incompatible format" },{ 0x30, 0x01, /*DT WR O */ "Cannot read medium - unknown format" },{ 0x52, 0x00, /* T */ "Cartridge fault" },{ 0x3F, 0x02, /*DTLPWRSOMC*/ "Changed operating definition" },{ 0x11, 0x06, /* WR O */ "Circ unrecovered error" },{ 0x30, 0x03, /*DT */ "Cleaning cartridge installed" },{ 0x4A, 0x00, /*DTLPWRSOMC*/ "Command phase error" },{ 0x2C, 0x00, /*DTLPWRSOMC*/ "Command sequence error" },{ 0x2F, 0x00, /*DTLPWRSOMC*/ "Commands cleared by another initiator" },{ 0x2B, 0x00, /*DTLPWRSO C*/ "Copy cannot execute since host cannot disconnect" },{ 0x41, 0x00, /*D */ "Data path failure (should use 40 nn)" },{ 0x4B, 0x00, /*DTLPWRSOMC*/ "Data phase error" },{ 0x11, 0x07, /* W O */ "Data resychronization error" },{ 0x16, 0x00, /*D W O */ "Data synchronization mark error" },{ 0x19, 0x00, /*D O */ "Defect list error" },{ 0x19, 0x03, /*D O */ "Defect list error in grown list" },{ 0x19, 0x02, /*D O */ "Defect list error in primary list" },{ 0x19, 0x01, /*D O */ "Defect list not available" },{ 0x1C, 0x00, /*D O */ "Defect list not found" },{ 0x32, 0x01, /*D W O */ "Defect list update failure" },#if 0{ 0x40, 0xNN, /*DTLPWRSOMC*/ "Diagnostic failure on component nn (80h-ffh)" },#endif{ 0x40, 0x00, /*DTLPWRSOMC*/ "Diagnostic failure on component 0 (80h-ffh)" },{ 0x63, 0x00, /* R */ "End of user area encountered on this track" },{ 0x00, 0x05, /* T S */ "End-of-data detected" },{ 0x14, 0x03, /* T */ "End-of-data not found" },{ 0x00, 0x02, /* T S */ "End-of-partition/medium detected" },{ 0x51, 0x00, /* T O */ "Erase failure" },{ 0x0A, 0x00, /*DTLPWRSOMC*/ "Error log overflow" },{ 0x11, 0x02, /*DT W SO */ "Error too long to correct" },{ 0x03, 0x02, /* T */ "Excessive write errors" },{ 0x3B, 0x07, /* L */ "Failed to sense bottom-of-form" },{ 0x3B, 0x06, /* L */ "Failed to sense top-of-form" },{ 0x00, 0x01, /* T */ "Filemark detected" },{ 0x14, 0x02, /* T */ "Filemark or setmark not found" },{ 0x09, 0x02, /* WR O */ "Focus servo failure" },{ 0x31, 0x01, /*D L O */ "Format command failed" },{ 0x58, 0x00, /* O */ "Generation does not exist" },{ 0x1C, 0x02, /*D O */ "Grown defect list not found" },{ 0x00, 0x06, /*DTLPWRSOMC*/ "I/O process terminated" },{ 0x10, 0x00, /*D W O */ "Id CRC or ECC error" },{ 0x22, 0x00, /*D */ "Illegal function (should use 20 00, 24 00, or 26 00)" },{ 0x64, 0x00, /* R */ "Illegal mode for this track" },{ 0x28, 0x01, /* M */ "Import or export element accessed" },{ 0x30, 0x00, /*DT WR OM */ "Incompatible medium installed" },{ 0x11, 0x08, /* T */ "Incomplete block read" },{ 0x48, 0x00, /*DTLPWRSOMC*/ "Initiator detected error message received" },{ 0x3F, 0x03, /*DTLPWRSOMC*/ "Inquiry data has changed" },{ 0x44, 0x00, /*DTLPWRSOMC*/ "Internal target failure" },{ 0x3D, 0x00, /*DTLPWRSOMC*/ "Invalid bits in identify message" },{ 0x2C, 0x02, /* S */ "Invalid combination of windows specified" },{ 0x20, 0x00, /*DTLPWRSOMC*/ "Invalid command operation code" },{ 0x21, 0x01, /* M */ "Invalid element address" },{ 0x24, 0x00, /*DTLPWRSOMC*/ "Invalid field in CDB" },{ 0x26, 0x00, /*DTLPWRSOMC*/ "Invalid field in parameter list" },{ 0x49, 0x00, /*DTLPWRSOMC*/ "Invalid message error" },{ 0x11, 0x05, /* WR O */ "L-ec uncorrectable error" },{ 0x60, 0x00, /* S */ "Lamp failure" },{ 0x5B, 0x02, /*DTLPWRSOM */ "Log counter at maximum" },{ 0x5B, 0x00, /*DTLPWRSOM */ "Log exception" },{ 0x5B, 0x03, /*DTLPWRSOM */ "Log list codes exhausted" },{ 0x2A, 0x02, /*DTL WRSOMC*/ "Log parameters changed" },{ 0x21, 0x00, /*DT WR OM */ "Logical block address out of range" },{ 0x08, 0x00, /*DTL WRSOMC*/ "Logical unit communication failure" },{ 0x08, 0x02, /*DTL WRSOMC*/ "Logical unit communication parity error" },{ 0x08, 0x01, /*DTL WRSOMC*/ "Logical unit communication time-out" },{ 0x05, 0x00, /*DTL WRSOMC*/ "Logical unit does not respond to selection" },{ 0x4C, 0x00, /*DTLPWRSOMC*/ "Logical unit failed self-configuration" },{ 0x3E, 0x00, /*DTLPWRSOMC*/ "Logical unit has not self-configured yet" },{ 0x04, 0x01, /*DTLPWRSOMC*/ "Logical unit is in process of becoming ready" },{ 0x04, 0x00, /*DTLPWRSOMC*/ "Logical unit not ready, cause not reportable" },{ 0x04, 0x04, /*DTL O */ "Logical unit not ready, format in progress" },{ 0x04, 0x02, /*DTLPWRSOMC*/ "Logical unit not ready, initializing command required" },{ 0x04, 0x03, /*DTLPWRSOMC*/ "Logical unit not ready, manual intervention required" },{ 0x25, 0x00, /*DTLPWRSOMC*/ "Logical unit not supported" },{ 0x15, 0x01, /*DTL WRSOM */ "Mechanical positioning error" },{ 0x53, 0x00, /*DTL WRSOM */ "Media load or eject failed" },{ 0x3B, 0x0D, /* M */ "Medium destination element full" },{ 0x31, 0x00, /*DT W O */ "Medium format corrupted" },{ 0x3A, 0x00, /*DTL WRSOM */ "Medium not present" },{ 0x53, 0x02, /*DT WR OM */ "Medium removal prevented" },{ 0x3B, 0x0E, /* M */ "Medium source element empty" },{ 0x43, 0x00, /*DTLPWRSOMC*/ "Message error" },{ 0x3F, 0x01, /*DTLPWRSOMC*/ "Microcode has been changed" },{ 0x1D, 0x00, /*D W O */ "Miscompare during verify operation" },{ 0x11, 0x0A, /*DT O */ "Miscorrected error" },{ 0x2A, 0x01, /*DTL WRSOMC*/ "Mode parameters changed" },{ 0x07, 0x00, /*DTL WRSOM */ "Multiple peripheral devices selected" },{ 0x11, 0x03, /*DT W SO */ "Multiple read errors" },{ 0x00, 0x00, /*DTLPWRSOMC*/ "No additional sense information" },{ 0x00, 0x15, /* R */ "No current audio status to return" },{ 0x32, 0x00, /*D W O */ "No defect spare location available" },{ 0x11, 0x09, /* T */ "No gap found" },{ 0x01, 0x00, /*D W O */ "No index/sector signal" },{ 0x06, 0x00, /*D WR OM */ "No reference position found" },{ 0x02, 0x00, /*D WR OM */ "No seek complete" },{ 0x03, 0x01, /* T */ "No write current" },{ 0x28, 0x00, /*DTLPWRSOMC*/ "Not ready to ready transition (medium may have changed)" },{ 0x5A, 0x01, /*DT WR OM */ "Operator medium removal request" },{ 0x5A, 0x00, /*DTLPWRSOM */ "Operator request or state change input (unspecified)" },{ 0x5A, 0x03, /*DT W O */ "Operator selected write permit" },{ 0x5A, 0x02, /*DT W O */ "Operator selected write protect" },{ 0x61, 0x02, /* S */ "Out of focus" },{ 0x4E, 0x00, /*DTLPWRSOMC*/ "Overlapped commands attempted" },{ 0x2D, 0x00, /* T */ "Overwrite error on update in place" },{ 0x3B, 0x05, /* L */ "Paper jam" },{ 0x1A, 0x00, /*DTLPWRSOMC*/ "Parameter list length error" },{ 0x26, 0x01, /*DTLPWRSOMC*/ "Parameter not supported" },{ 0x26, 0x02, /*DTLPWRSOMC*/ "Parameter value invalid" },{ 0x2A, 0x00, /*DTL WRSOMC*/ "Parameters changed" },{ 0x03, 0x00, /*DTL W SO */ "Peripheral device write fault" },{ 0x50, 0x02, /* T */ "Position error related to timing" },{ 0x3B, 0x0C, /* S */ "Position past beginning of medium" },{ 0x3B, 0x0B, /* S */ "Position past end of medium" },{ 0x15, 0x02, /*DT WR O */ "Positioning error detected by read of medium" },{ 0x29, 0x00, /*DTLPWRSOMC*/ "Power on, reset, or bus device reset occurred" },{ 0x42, 0x00, /*D */ "Power-on or self-test failure (should use 40 nn)" },{ 0x1C, 0x01, /*D O */ "Primary defect list not found" },{ 0x40, 0x00, /*D */ "Ram failure (should use 40 nn)" },{ 0x15, 0x00, /*DTL WRSOM */ "Random positioning error" },{ 0x3B, 0x0A, /* S */ "Read past beginning of medium" },{ 0x3B, 0x09, /* S */ "Read past end of medium" },{ 0x11, 0x01, /*DT W SO */ "Read retries exhausted" },{ 0x14, 0x01, /*DT WR O */ "Record not found" },{ 0x14, 0x00, /*DTL WRSO */ "Recorded entity not found" },{ 0x18, 0x02, /*D WR O */ "Recovered data - data auto-reallocated" },{ 0x18, 0x05, /*D WR O */ "Recovered data - recommend reassignment" },{ 0x17, 0x05, /*D WR O */ "Recovered data using previous sector ID" },{ 0x18, 0x03, /* R */ "Recovered data with CIRC" },{ 0x18, 0x01, /*D WR O */ "Recovered data with error correction and retries applied" },{ 0x18, 0x00, /*DT WR O */ "Recovered data with error correction applied" },{ 0x18, 0x04, /* R */ "Recovered data with LEC" },{ 0x17, 0x03, /*DT WR O */ "Recovered data with negative head offset" },{ 0x17, 0x00, /*DT WRSO */ "Recovered data with no error correction applied" },{ 0x17, 0x02, /*DT WR O */ "Recovered data with positive head offset" },{ 0x17, 0x01, /*DT WRSO */ "Recovered data with retries" },{ 0x17, 0x04, /* WR O */ "Recovered data with retries and/or CIRC applied" },{ 0x17, 0x06, /*D W O */ "Recovered data without ECC - data auto-reallocated" },{ 0x17, 0x07, /*D W O */ "Recovered data without ECC - recommend reassignment" },{ 0x1E, 0x00, /*D W O */ "Recovered ID with ECC correction" },{ 0x3B, 0x08, /* T */ "Reposition error" },{ 0x36, 0x00, /* L */ "Ribbon, ink, or toner failure" },{ 0x37, 0x00, /*DTL WRSOMC*/ "Rounded parameter" },{ 0x5C, 0x00, /*D O */ "Rpl status change" },{ 0x39, 0x00, /*DTL WRSOMC*/ "Saving parameters not supported" },{ 0x62, 0x00, /* S */ "Scan head positioning error" },{ 0x47, 0x00, /*DTLPWRSOMC*/ "Scsi parity error" },{ 0x54, 0x00, /* P */ "Scsi to host system interface failure" },{ 0x45, 0x00, /*DTLPWRSOMC*/ "Select or reselect failure" },{ 0x3B, 0x00, /* TL */ "Sequential positioning error" },{ 0x00, 0x03, /* T */ "Setmark detected" },{ 0x3B, 0x04, /* L */ "Slew failure" },{ 0x09, 0x03, /* WR O */ "Spindle servo failure" },{ 0x5C, 0x02, /*D O */ "Spindles not synchronized" },{ 0x5C, 0x01, /*D O */ "Spindles synchronized" },{ 0x1B, 0x00, /*DTLPWRSOMC*/ "Synchronous data transfer error" },{ 0x55, 0x00, /* P */ "System resource failure" },{ 0x33, 0x00, /* T */ "Tape length error" },{ 0x3B, 0x03, /* L */ "Tape or electronic vertical forms unit not ready" },{ 0x3B, 0x01, /* T */ "Tape position error at beginning-of-medium" },{ 0x3B, 0x02, /* T */ "Tape position error at end-of-medium" },{ 0x3F, 0x00, /*DTLPWRSOMC*/ "Target operating conditions have changed" },{ 0x5B, 0x01, /*DTLPWRSOM */ "Threshold condition met" },{ 0x26, 0x03, /*DTLPWRSOMC*/ "Threshold parameters not supported" },{ 0x2C, 0x01, /* S */ "Too many windows specified" },{ 0x09, 0x00, /*DT WR O */ "Track following error" },{ 0x09, 0x01, /* WR O */ "Tracking servo failure" },{ 0x61, 0x01, /* S */ "Unable to acquire video" },{ 0x57, 0x00, /* R */ "Unable to recover table-of-contents" },{ 0x53, 0x01, /* T */ "Unload tape failure" },{ 0x11, 0x00, /*DT WRSO */ "Unrecovered read error" },{ 0x11, 0x04, /*D W O */ "Unrecovered read error - auto reallocate failed" },{ 0x11, 0x0B, /*D W O */ "Unrecovered read error - recommend reassignment" },{ 0x11, 0x0C, /*D W O */ "Unrecovered read error - recommend rewrite the data" },{ 0x46, 0x00, /*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -