⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 constants.c

📁 完整的1.0代码
💻 C
📖 第 1 页 / 共 2 页
字号:
  {0x2C,0x01,S,"Too many windows specified"},  {0x2C,0x02,S,"Invalid combination of windows specified"},  {0x2D,0x00,T,"Overwrite error on update in place"},  {0x2F,0x00,D|T|L|P|W|R|S|O|M|C,"Commands cleared by another initiator"},  {0x30,0x00,D|T|W|R|O|M,"Incompatible medium installed"},  {0x30,0x01,D|T|W|R|O,"Cannot read medium - unknown format"},  {0x30,0x02,D|T|W|R|O,"Cannot read medium - incompatible format"},  {0x30,0x03,D|T,"Cleaning cartridge installed"},  {0x31,0x00,D|T|W|O,"Medium format corrupted"},  {0x31,0x01,D|L|O,"Format command failed"},  {0x32,0x00,D|W|O,"No defect spare location available"},  {0x32,0x01,D|W|O,"Defect list update failure"},  {0x33,0x00,T,"Tape length error"},  {0x36,0x00,L,"Ribbon, ink, or toner failure"},  {0x37,0x00,D|T|L|W|R|S|O|M|C,"Rounded parameter"},  {0x39,0x00,D|T|L|W|R|S|O|M|C,"Saving parameters not supported"},  {0x3A,0x00,D|T|L|W|R|S|O|M,"Medium not present"},  {0x3B,0x00,T|L,"Sequential positioning error"},  {0x3B,0x01,T,"Tape position error at beginning-of-medium"},  {0x3B,0x02,T,"Tape position error at end-of-medium"},  {0x3B,0x03,L,"Tape or electronic vertical forms unit not ready"},  {0x3B,0x04,L,"Slew failure"},  {0x3B,0x05,L,"Paper jam"},  {0x3B,0x06,L,"Failed to sense top-of-form"},  {0x3B,0x07,L,"Failed to sense bottom-of-form"},  {0x3B,0x08,T,"Reposition error"},  {0x3B,0x09,S,"Read past end of medium"},  {0x3B,0x0A,S,"Read past beginning of medium"},  {0x3B,0x0B,S,"Position past end of medium"},  {0x3B,0x0C,S,"Position past beginning of medium"},  {0x3B,0x0D,M,"Medium destination element full"},  {0x3B,0x0E,M,"Medium source element empty"},  {0x3D,0x00,D|T|L|P|W|R|S|O|M|C,"Invalid bits in identify message"},  {0x3E,0x00,D|T|L|P|W|R|S|O|M|C,"Logical unit has not self-configured yet"},  {0x3F,0x00,D|T|L|P|W|R|S|O|M|C,"Target operating conditions have changed"},  {0x3F,0x01,D|T|L|P|W|R|S|O|M|C,"Microcode has been changed"},  {0x3F,0x02,D|T|L|P|W|R|S|O|M|C,"Changed operating definition"},  {0x3F,0x03,D|T|L|P|W|R|S|O|M|C,"Inquiry data has changed"},  {0x43,0x00,D|T|L|P|W|R|S|O|M|C,"Message error"},  {0x44,0x00,D|T|L|P|W|R|S|O|M|C,"Internal target failure"},  {0x45,0x00,D|T|L|P|W|R|S|O|M|C,"Select or reselect failure"},  {0x46,0x00,D|T|L|P|W|R|S|O|M|C,"Unsuccessful soft reset"},  {0x47,0x00,D|T|L|P|W|R|S|O|M|C,"Scsi parity error"},  {0x48,0x00,D|T|L|P|W|R|S|O|M|C,"Initiator detected error message received"},  {0x49,0x00,D|T|L|P|W|R|S|O|M|C,"Invalid message error"},  {0x4A,0x00,D|T|L|P|W|R|S|O|M|C,"Command phase error"},  {0x4B,0x00,D|T|L|P|W|R|S|O|M|C,"Data phase error"},  {0x4C,0x00,D|T|L|P|W|R|S|O|M|C,"Logical unit failed self-configuration"},  {0x4E,0x00,D|T|L|P|W|R|S|O|M|C,"Overlapped commands attempted"},  {0x50,0x00,T,"Write append error"},  {0x50,0x01,T,"Write append position error"},  {0x50,0x02,T,"Position error related to timing"},  {0x51,0x00,T|O,"Erase failure"},  {0x52,0x00,T,"Cartridge fault"},  {0x53,0x00,D|T|L|W|R|S|O|M,"Media load or eject failed"},  {0x53,0x01,T,"Unload tape failure"},  {0x53,0x02,D|T|W|R|O|M,"Medium removal prevented"},  {0x54,0x00,P,"Scsi to host system interface failure"},  {0x55,0x00,P,"System resource failure"},  {0x57,0x00,R,"Unable to recover table-of-contents"},  {0x58,0x00,O,"Generation does not exist"},  {0x59,0x00,O,"Updated block read"},  {0x5A,0x00,D|T|L|P|W|R|S|O|M,"Operator request or state change input (unspecified)"},  {0x5A,0x01,D|T|W|R|O|M,"Operator medium removal request"},  {0x5A,0x02,D|T|W|O,"Operator selected write protect"},  {0x5A,0x03,D|T|W|O,"Operator selected write permit"},  {0x5B,0x00,D|T|L|P|W|R|S|O|M,"Log exception"},  {0x5B,0x01,D|T|L|P|W|R|S|O|M,"Threshold condition met"},  {0x5B,0x02,D|T|L|P|W|R|S|O|M,"Log counter at maximum"},  {0x5B,0x03,D|T|L|P|W|R|S|O|M,"Log list codes exhausted"},  {0x5C,0x00,D|O,"Rpl status change"},  {0x5C,0x01,D|O,"Spindles synchronized"},  {0x5C,0x02,D|O,"Spindles not synchronized"},  {0x60,0x00,S,"Lamp failure"},  {0x61,0x00,S,"Video acquisition error"},  {0x61,0x01,S,"Unable to acquire video"},  {0x61,0x02,S,"Out of focus"},  {0x62,0x00,S,"Scan head positioning error"},  {0x63,0x00,R,"End of user area encountered on this track"},  {0x64,0x00,R,"Illegal mode for this track"},  {0, 0, 0, NULL}};#endif#if (CONSTANTS & CONST_SENSE)static char *snstext[] = {	"None","Recovered Error","Not Ready","Medium Error","Hardware Error",	"Illegal Request","Unit Attention","Data Protect","Blank Check",	"Key=E","Key=F","Filemark","End-Of-Medium","Incorrect Block Length",	"14","15"};#endif/* Print sense information */void print_sense(char * devclass, Scsi_Cmnd * SCpnt){	int i, s;	int sense_class, valid, code;	unsigned char * sense_buffer = SCpnt->sense_buffer;	char * error = NULL;	int dev = SCpnt->request.dev;	sense_class = (sense_buffer[0] >> 4) & 0x07;	code = sense_buffer[0] & 0xf;	valid = sense_buffer[0] & 0x80;	if (sense_class == 7) { 	  s = sense_buffer[7] + 8;	  if(s > sizeof(SCpnt->sense_buffer)) s = sizeof(SCpnt->sense_buffer);	  if (!valid)	    printk("extra data not valid ");	  	  if (sense_buffer[2] & 0x80) printk( "FMK ");	  if (sense_buffer[2] & 0x40) printk( "EOM ");	  if (sense_buffer[2] & 0x20) printk( "ILI ");	  switch (code) {	  case 0x0:	    error = "Current";	    break;	  case 0x1:	    error = "Deferred";	    break;	  default:	    error = "Invalid";	  }	  	  printk("%s error ", error);	  #if (CONSTANTS & CONST_SENSE)	  if (sense_buffer[2] & 0x80) printk( "FMK ");	  if (sense_buffer[2] & 0x40) printk( "EOM ");	  if (sense_buffer[2] & 0x20) printk( "ILI ");	  printk( "%s%x: sense key %s\n", devclass, dev, snstext[sense_buffer[2] & 0x0f]);#else	  printk("%s%x: sns = %2x %2x\n", devclass, dev, sense_buffer[0], sense_buffer[2]);#endif		/* Check to see if additional sense information is available */	if(sense_buffer[7] + 7 < 13 ||	   (sense_buffer[12] == 0  && sense_buffer[13] ==  0)) goto done;	#if (CONSTANTS & CONST_XSENSE)	for(i=0; additional[i].text; i++)		if(additional[i].code1 == sense_buffer[12] &&		   additional[i].code2 == sense_buffer[13])			printk("Additional sense indicates %s\n", additional[i].text);		for(i=0; additional2[i].text; i++)		if(additional2[i].code1 == sense_buffer[12] &&		   additional2[i].code2_min >= sense_buffer[13]  &&		   additional2[i].code2_max <= sense_buffer[13]) {			printk("Additional sense indicates ");			printk(additional2[i].text, sense_buffer[13]);			printk("\n");		};#else	printk("ASC=%2x ASCQ=%2x\n", sense_buffer[12], sense_buffer[13]);#endif	} else { #if (CONSTANTS & CONST_SENSE)	  if (sense_buffer[0] < 15)	    printk("%s%x: old sense key %s\n", devclass, dev, snstext[sense_buffer[0] & 0x0f]);	  else#endif	    printk("%s%x: sns = %2x %2x\n", devclass, dev, sense_buffer[0], sense_buffer[2]);	  printk("Non-extended sense class %d code 0x%0x ", sense_class, code);	  s = 4;	}	      done:	for (i = 0; i < s; ++i) 	  printk("0x%02x ", sense_buffer[i]);	return;}#if (CONSTANTS & CONST_MSG) static const char *one_byte_msgs[] = {/* 0x00 */ "Command Complete", NULL, "Save Pointers",/* 0x03 */ "Restore Pointers", "Disconnect", "Initiator Error", /* 0x06 */ "Abort", "Message Reject", "Nop", "Message Parity Error",/* 0x0a */ "Linked Command Complete", "Linked Command Complete w/flag",/* 0x0c */ "Bus device reset", "Abort Tag", "Clear Queue", /* 0x0f */ "Initiate Recovery", "Release Recovery"}#define NO_ONE_BYTE_MSGS (sizeof(one_byte_msgs)  / sizeof (const char *))static const char *queue_tag_msgs[] = {/* 0x20 */ "Simple Queue Tag", "Head of Queue Tag", "Ordered Queue Tag"/* 0x23 */ "Ignore Wide Residue"}#define NO_TWO_BYTE_MSGS (sizeof(two_byte_msgs)  / sizeof (const char *))static const char *extended_msgs[] = {/* 0x00 */ "Modify Data Pointer", "Synchronous Data Transfer Request",/* 0x02 */ "SCSI-I Extended Identify", "Wide Data Transfer Reqeust"};#define NO_EXTENDED_MSGS (sizeof(two_byte_msgs)  / sizeof (const char *))#endif /* (CONSTANTS & CONST_MSG) */int print_msg (const unsigned char *msg) {    int len = 0, i;    if (msg[0] == EXTENDED_MESSAGE) {	len = 3 + msg[1];#if (CONSTANTS & CONST_MSG)	printk("Extended Message code %s arguments ", 	    (msg[2] < NO_EXTENDED_MESSAGES) ?	    printk("%s " extended_msgs[msg[2]]),	    reserved);	for (i = 3; i < msg[1]; ++i) #else	for (i = 0; i < msg[1]; ++i)#endif	    printk("%02x ", msg[i]);    /* Identify */    } else if (msg[0] & 0x80) {#if (CONSTANTS & CONST_MSG)	printk("Identify disconnect %sallowed %s %d ",	    (msg[0] & 0x40) ? "" : "not ",	    (msg[0] & 0x20) ? "target routine" : "lun",	    msg[0] & 0x7);#else    printk("%02x ", msg[0]);#endif    len = 1;    /* Normal One byte */    } else if (msg[0] < 0x1f) {#if (CONSTANTS & CONST_MSG)	if (msg[0] < NO_ONE_BYTE_MSGS)	    printk(one_byte_msgs[msg[0]]);	else	    printk("reserved (%02x) ", msg[0]);#else	printk("%02x ", msg[0]);#endif	len = 1;    /* Two byte */    } else if (msg[0] <= 0x2f) {#if (CONSTANTS & CONST_MSG)	if ((msg[0] - 0x20) < NO_TWO_BYTE_MESSAGES) 	    printk("%s %02x ", two_byte_msgs[msg[0] - 0x20], 		msg[1]);	else 	    printk("reserved two byte (%02x %02x) ", 		msg[0], msg[1]);#else	printk("%02x %02x", msg[0], msg[1]);#endif	len = 2;    } else #if (CONSTANTS & CONST_MSG)	printk(reserved);#else	printk("%02x ", msg[0]);#endif    return len;}

⌨️ 快捷键说明

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