constants.c

来自「linux 内核源代码」· C语言 代码 · 共 1,417 行 · 第 1/4 页

C
1,417
字号
	/* print out all bytes in cdb */	printk(":");	for (k = 0; k < cmd->cmd_len; ++k)		printk(" %02x", cmd->cmnd[k]);	printk("\n");}EXPORT_SYMBOL(scsi_print_command);/** * *	scsi_print_status - print scsi status description *	@scsi_status: scsi status value * *	If the status is recognized, the description is printed. *	Otherwise "Unknown status" is output. No trailing space. *	If CONFIG_SCSI_CONSTANTS is not set, then print status in hex *	(e.g. "0x2" for Check Condition). **/voidscsi_print_status(unsigned char scsi_status) {#ifdef CONFIG_SCSI_CONSTANTS	const char * ccp;	switch (scsi_status) {	case 0:    ccp = "Good"; break;	case 0x2:  ccp = "Check Condition"; break;	case 0x4:  ccp = "Condition Met"; break;	case 0x8:  ccp = "Busy"; break;	case 0x10: ccp = "Intermediate"; break;	case 0x14: ccp = "Intermediate-Condition Met"; break;	case 0x18: ccp = "Reservation Conflict"; break;	case 0x22: ccp = "Command Terminated"; break;	/* obsolete */	case 0x28: ccp = "Task set Full"; break;	/* was: Queue Full */	case 0x30: ccp = "ACA Active"; break;	case 0x40: ccp = "Task Aborted"; break;	default:   ccp = "Unknown status";	}	printk(KERN_INFO "%s", ccp);#else	printk(KERN_INFO "0x%0x", scsi_status);#endif}EXPORT_SYMBOL(scsi_print_status);#ifdef CONFIG_SCSI_CONSTANTSstruct error_info {	unsigned short code12;	/* 0x0302 looks better than 0x03,0x02 */	const char * text;};/* * The canonical list of T10 Additional Sense Codes is available at: * http://www.t10.org/lists/asc-num.txt */static const struct error_info additional[] ={	{0x0000, "No additional sense information"},	{0x0001, "Filemark detected"},	{0x0002, "End-of-partition/medium detected"},	{0x0003, "Setmark detected"},	{0x0004, "Beginning-of-partition/medium detected"},	{0x0005, "End-of-data detected"},	{0x0006, "I/O process terminated"},	{0x0011, "Audio play operation in progress"},	{0x0012, "Audio play operation paused"},	{0x0013, "Audio play operation successfully completed"},	{0x0014, "Audio play operation stopped due to error"},	{0x0015, "No current audio status to return"},	{0x0016, "Operation in progress"},	{0x0017, "Cleaning requested"},	{0x0018, "Erase operation in progress"},	{0x0019, "Locate operation in progress"},	{0x001A, "Rewind operation in progress"},	{0x001B, "Set capacity operation in progress"},	{0x001C, "Verify operation in progress"},	{0x001D, "ATA pass through information available"},	{0x0100, "No index/sector signal"},	{0x0200, "No seek complete"},	{0x0300, "Peripheral device write fault"},	{0x0301, "No write current"},	{0x0302, "Excessive write errors"},	{0x0400, "Logical unit not ready, cause not reportable"},	{0x0401, "Logical unit is in process of becoming ready"},	{0x0402, "Logical unit not ready, initializing command required"},	{0x0403, "Logical unit not ready, manual intervention required"},	{0x0404, "Logical unit not ready, format in progress"},	{0x0405, "Logical unit not ready, rebuild in progress"},	{0x0406, "Logical unit not ready, recalculation in progress"},	{0x0407, "Logical unit not ready, operation in progress"},	{0x0408, "Logical unit not ready, long write in progress"},	{0x0409, "Logical unit not ready, self-test in progress"},	{0x040A, "Logical unit not accessible, asymmetric access state "	 "transition"},	{0x040B, "Logical unit not accessible, target port in standby state"},	{0x040C, "Logical unit not accessible, target port in unavailable "	 "state"},	{0x0410, "Logical unit not ready, auxiliary memory not accessible"},	{0x0411, "Logical unit not ready, notify (enable spinup) required"},	{0x0412, "Logical unit not ready, offline"},	{0x0500, "Logical unit does not respond to selection"},	{0x0600, "No reference position found"},	{0x0700, "Multiple peripheral devices selected"},	{0x0800, "Logical unit communication failure"},	{0x0801, "Logical unit communication time-out"},	{0x0802, "Logical unit communication parity error"},	{0x0803, "Logical unit communication CRC error (Ultra-DMA/32)"},	{0x0804, "Unreachable copy target"},	{0x0900, "Track following error"},	{0x0901, "Tracking servo failure"},	{0x0902, "Focus servo failure"},	{0x0903, "Spindle servo failure"},	{0x0904, "Head select fault"},	{0x0A00, "Error log overflow"},	{0x0B00, "Warning"},	{0x0B01, "Warning - specified temperature exceeded"},	{0x0B02, "Warning - enclosure degraded"},	{0x0B03, "Warning - background self-test failed"},	{0x0B04, "Warning - background pre-scan detected medium error"},	{0x0B05, "Warning - background medium scan detected medium error"},	{0x0C00, "Write error"},	{0x0C01, "Write error - recovered with auto reallocation"},	{0x0C02, "Write error - auto reallocation failed"},	{0x0C03, "Write error - recommend reassignment"},	{0x0C04, "Compression check miscompare error"},	{0x0C05, "Data expansion occurred during compression"},	{0x0C06, "Block not compressible"},	{0x0C07, "Write error - recovery needed"},	{0x0C08, "Write error - recovery failed"},	{0x0C09, "Write error - loss of streaming"},	{0x0C0A, "Write error - padding blocks added"},	{0x0C0B, "Auxiliary memory write error"},	{0x0C0C, "Write error - unexpected unsolicited data"},	{0x0C0D, "Write error - not enough unsolicited data"},	{0x0C0F, "Defects in error window"},	{0x0D00, "Error detected by third party temporary initiator"},	{0x0D01, "Third party device failure"},	{0x0D02, "Copy target device not reachable"},	{0x0D03, "Incorrect copy target device type"},	{0x0D04, "Copy target device data underrun"},	{0x0D05, "Copy target device data overrun"},	{0x0E00, "Invalid information unit"},	{0x0E01, "Information unit too short"},	{0x0E02, "Information unit too long"},	{0x0E03, "Invalid field in command information unit"},	{0x1000, "Id CRC or ECC error"},	{0x1001, "Logical block guard check failed"},	{0x1002, "Logical block application tag check failed"},	{0x1003, "Logical block reference tag check failed"},	{0x1100, "Unrecovered read error"},	{0x1101, "Read retries exhausted"},	{0x1102, "Error too long to correct"},	{0x1103, "Multiple read errors"},	{0x1104, "Unrecovered read error - auto reallocate failed"},	{0x1105, "L-EC uncorrectable error"},	{0x1106, "CIRC unrecovered error"},	{0x1107, "Data re-synchronization error"},	{0x1108, "Incomplete block read"},	{0x1109, "No gap found"},	{0x110A, "Miscorrected error"},	{0x110B, "Unrecovered read error - recommend reassignment"},	{0x110C, "Unrecovered read error - recommend rewrite the data"},	{0x110D, "De-compression CRC error"},	{0x110E, "Cannot decompress using declared algorithm"},	{0x110F, "Error reading UPC/EAN number"},	{0x1110, "Error reading ISRC number"},	{0x1111, "Read error - loss of streaming"},	{0x1112, "Auxiliary memory read error"},	{0x1113, "Read error - failed retransmission request"},	{0x1114, "Read error - lba marked bad by application client"},	{0x1200, "Address mark not found for id field"},	{0x1300, "Address mark not found for data field"},	{0x1400, "Recorded entity not found"},	{0x1401, "Record not found"},	{0x1402, "Filemark or setmark not found"},	{0x1403, "End-of-data not found"},	{0x1404, "Block sequence error"},	{0x1405, "Record not found - recommend reassignment"},	{0x1406, "Record not found - data auto-reallocated"},	{0x1407, "Locate operation failure"},	{0x1500, "Random positioning error"},	{0x1501, "Mechanical positioning error"},	{0x1502, "Positioning error detected by read of medium"},	{0x1600, "Data synchronization mark error"},	{0x1601, "Data sync error - data rewritten"},	{0x1602, "Data sync error - recommend rewrite"},	{0x1603, "Data sync error - data auto-reallocated"},	{0x1604, "Data sync error - recommend reassignment"},	{0x1700, "Recovered data with no error correction applied"},	{0x1701, "Recovered data with retries"},	{0x1702, "Recovered data with positive head offset"},	{0x1703, "Recovered data with negative head offset"},	{0x1704, "Recovered data with retries and/or circ applied"},	{0x1705, "Recovered data using previous sector id"},	{0x1706, "Recovered data without ECC - data auto-reallocated"},	{0x1707, "Recovered data without ECC - recommend reassignment"},	{0x1708, "Recovered data without ECC - recommend rewrite"},	{0x1709, "Recovered data without ECC - data rewritten"},	{0x1800, "Recovered data with error correction applied"},	{0x1801, "Recovered data with error corr. & retries applied"},	{0x1802, "Recovered data - data auto-reallocated"},	{0x1803, "Recovered data with CIRC"},	{0x1804, "Recovered data with L-EC"},	{0x1805, "Recovered data - recommend reassignment"},	{0x1806, "Recovered data - recommend rewrite"},	{0x1807, "Recovered data with ECC - data rewritten"},	{0x1808, "Recovered data with linking"},	{0x1900, "Defect list error"},	{0x1901, "Defect list not available"},	{0x1902, "Defect list error in primary list"},	{0x1903, "Defect list error in grown list"},	{0x1A00, "Parameter list length error"},	{0x1B00, "Synchronous data transfer error"},	{0x1C00, "Defect list not found"},	{0x1C01, "Primary defect list not found"},	{0x1C02, "Grown defect list not found"},	{0x1D00, "Miscompare during verify operation"},	{0x1E00, "Recovered id with ECC correction"},	{0x1F00, "Partial defect list transfer"},	{0x2000, "Invalid command operation code"},	{0x2001, "Access denied - initiator pending-enrolled"},	{0x2002, "Access denied - no access rights"},	{0x2003, "Access denied - invalid mgmt id key"},	{0x2004, "Illegal command while in write capable state"},	{0x2005, "Obsolete"},	{0x2006, "Illegal command while in explicit address mode"},	{0x2007, "Illegal command while in implicit address mode"},	{0x2008, "Access denied - enrollment conflict"},	{0x2009, "Access denied - invalid LU identifier"},	{0x200A, "Access denied - invalid proxy token"},	{0x200B, "Access denied - ACL LUN conflict"},	{0x2100, "Logical block address out of range"},	{0x2101, "Invalid element address"},	{0x2102, "Invalid address for write"},	{0x2103, "Invalid write crossing layer jump"},	{0x2200, "Illegal function (use 20 00, 24 00, or 26 00)"},	{0x2400, "Invalid field in cdb"},	{0x2401, "CDB decryption error"},	{0x2402, "Obsolete"},	{0x2403, "Obsolete"},	{0x2404, "Security audit value frozen"},	{0x2405, "Security working key frozen"},	{0x2406, "Nonce not unique"},	{0x2407, "Nonce timestamp out of range"},	{0x2500, "Logical unit not supported"},	{0x2600, "Invalid field in parameter list"},	{0x2601, "Parameter not supported"},	{0x2602, "Parameter value invalid"},	{0x2603, "Threshold parameters not supported"},	{0x2604, "Invalid release of persistent reservation"},	{0x2605, "Data decryption error"},	{0x2606, "Too many target descriptors"},	{0x2607, "Unsupported target descriptor type code"},	{0x2608, "Too many segment descriptors"},	{0x2609, "Unsupported segment descriptor type code"},	{0x260A, "Unexpected inexact segment"},	{0x260B, "Inline data length exceeded"},	{0x260C, "Invalid operation for copy source or destination"},	{0x260D, "Copy segment granularity violation"},	{0x260E, "Invalid parameter while port is enabled"},	{0x260F, "Invalid data-out buffer integrity check value"},	{0x2610, "Data decryption key fail limit reached"},	{0x2611, "Incomplete key-associated data set"},	{0x2612, "Vendor specific key reference not found"},	{0x2700, "Write protected"},	{0x2701, "Hardware write protected"},	{0x2702, "Logical unit software write protected"},	{0x2703, "Associated write protect"},	{0x2704, "Persistent write protect"},	{0x2705, "Permanent write protect"},	{0x2706, "Conditional write protect"},	{0x2800, "Not ready to ready change, medium may have changed"},	{0x2801, "Import or export element accessed"},	{0x2802, "Format-layer may have changed"},	{0x2900, "Power on, reset, or bus device reset occurred"},	{0x2901, "Power on occurred"},	{0x2902, "Scsi bus reset occurred"},	{0x2903, "Bus device reset function occurred"},	{0x2904, "Device internal reset"},	{0x2905, "Transceiver mode changed to single-ended"},	{0x2906, "Transceiver mode changed to lvd"},	{0x2907, "I_T nexus loss occurred"},	{0x2A00, "Parameters changed"},	{0x2A01, "Mode parameters changed"},	{0x2A02, "Log parameters changed"},	{0x2A03, "Reservations preempted"},	{0x2A04, "Reservations released"},	{0x2A05, "Registrations preempted"},	{0x2A06, "Asymmetric access state changed"},	{0x2A07, "Implicit asymmetric access state transition failed"},	{0x2A08, "Priority changed"},	{0x2A09, "Capacity data has changed"},	{0x2A10, "Timestamp changed"},	{0x2A11, "Data encryption parameters changed by another i_t nexus"},	{0x2A12, "Data encryption parameters changed by vendor specific "		 "event"},	{0x2A13, "Data encryption key instance counter has changed"},	{0x2B00, "Copy cannot execute since host cannot disconnect"},	{0x2C00, "Command sequence error"},	{0x2C01, "Too many windows specified"},	{0x2C02, "Invalid combination of windows specified"},	{0x2C03, "Current program area is not empty"},	{0x2C04, "Current program area is empty"},	{0x2C05, "Illegal power condition request"},	{0x2C06, "Persistent prevent conflict"},	{0x2C07, "Previous busy status"},	{0x2C08, "Previous task set full status"},	{0x2C09, "Previous reservation conflict status"},	{0x2C0A, "Partition or collection contains user objects"},	{0x2C0B, "Not reserved"},	{0x2D00, "Overwrite error on update in place"},

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?