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

📄 dasd_3990_erp.c

📁 linux-2.6.15.6
💻 C
📖 第 1 页 / 共 5 页
字号:
	case 0x90:  /* Format 9 - Device Read, Write, and Seek Checks */		switch (msg_no) {		case 0x00:			break;	/* No Message */		case 0x06:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT 9 - Device check-2 error");			break;		case 0x07:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT 9 - Head address did not compare");			break;		case 0x0A:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT 9 - Track physical address did "				    "not compare while oriented");			break;		case 0x0E:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT 9 - Cylinder address did not "				    "compare");			break;		default:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT 9 - Reserved");		}		break;	case 0xF0:		/* Format F - Cache Storage Checks */		switch (msg_no) {		case 0x00:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT F - Operation Terminated");			break;		case 0x01:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT F - Subsystem Processing Error");			break;		case 0x02:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT F - Cache or nonvolatile storage "				    "equipment failure");			break;		case 0x04:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT F - Caching terminated");			break;		case 0x06:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT F - Cache fast write access not "				    "authorized");			break;		case 0x07:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT F - Track format incorrect");			break;		case 0x09:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT F - Caching reinitiated");			break;		case 0x0A:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT F - Nonvolatile storage "				    "terminated");			break;		case 0x0B:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT F - Volume is suspended duplex");			break;		case 0x0C:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT F - Subsystem status connot be "				    "determined");			break;		case 0x0D:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT F - Caching status reset to "				    "default");			break;		case 0x0E:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT F - DASD Fast Write inhibited");			break;		default:			DEV_MESSAGE(KERN_WARNING, device, "%s",				    "FORMAT D - Reserved");		}		break;	default:	/* unknown message format - should not happen */	        DEV_MESSAGE (KERN_WARNING, device,                             "unknown message format %02x",                             msg_format);		break;	}			/* end switch message format */}				/* end dasd_3990_handle_env_data *//* * DASD_3990_ERP_COM_REJ * * DESCRIPTION *   Handles 24 byte 'Command Reject' error. * * PARAMETER *   erp		current erp_head *   sense		current sense data *  * RETURN VALUES *   erp		'new' erp_head - pointer to new ERP  */static struct dasd_ccw_req *dasd_3990_erp_com_rej(struct dasd_ccw_req * erp, char *sense){	struct dasd_device *device = erp->device;	erp->function = dasd_3990_erp_com_rej;	/* env data present (ACTION 10 - retry should work) */	if (sense[2] & SNS2_ENV_DATA_PRESENT) {		DEV_MESSAGE(KERN_DEBUG, device, "%s",			    "Command Reject - environmental data present");		dasd_3990_handle_env_data(erp, sense);		erp->retries = 5;	} else {		/* fatal error -  set status to FAILED */		DEV_MESSAGE(KERN_ERR, device, "%s",			    "Command Reject - Fatal error");		erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);	}	return erp;}				/* end dasd_3990_erp_com_rej *//* * DASD_3990_ERP_BUS_OUT  * * DESCRIPTION *   Handles 24 byte 'Bus Out Parity Check' error. * * PARAMETER *   erp		current erp_head * RETURN VALUES *   erp		new erp_head - pointer to new ERP */static struct dasd_ccw_req *dasd_3990_erp_bus_out(struct dasd_ccw_req * erp){	struct dasd_device *device = erp->device;	/* first time set initial retry counter and erp_function */	/* and retry once without blocking queue		 */	/* (this enables easier enqueing of the cqr)		 */	if (erp->function != dasd_3990_erp_bus_out) {		erp->retries = 256;		erp->function = dasd_3990_erp_bus_out;	} else {		/* issue a message and wait for 'device ready' interrupt */		DEV_MESSAGE(KERN_DEBUG, device, "%s",			    "bus out parity error or BOPC requested by "			    "channel");		dasd_3990_erp_block_queue(erp, 60*HZ);	}	return erp;}				/* end dasd_3990_erp_bus_out *//* * DASD_3990_ERP_EQUIP_CHECK * * DESCRIPTION *   Handles 24 byte 'Equipment Check' error. * * PARAMETER *   erp		current erp_head * RETURN VALUES *   erp		new erp_head - pointer to new ERP */static struct dasd_ccw_req *dasd_3990_erp_equip_check(struct dasd_ccw_req * erp, char *sense){	struct dasd_device *device = erp->device;	erp->function = dasd_3990_erp_equip_check;	if (sense[1] & SNS1_WRITE_INHIBITED) {		DEV_MESSAGE(KERN_DEBUG, device, "%s",			    "Write inhibited path encountered");		/* vary path offline */		DEV_MESSAGE(KERN_ERR, device, "%s",			    "Path should be varied off-line. "			    "This is not implemented yet \n - please report "			    "to linux390@de.ibm.com");		erp = dasd_3990_erp_action_1(erp);	} else if (sense[2] & SNS2_ENV_DATA_PRESENT) {		DEV_MESSAGE(KERN_DEBUG, device, "%s",			    "Equipment Check - " "environmental data present");		dasd_3990_handle_env_data(erp, sense);		erp = dasd_3990_erp_action_4(erp, sense);	} else if (sense[1] & SNS1_PERM_ERR) {		DEV_MESSAGE(KERN_DEBUG, device, "%s",			    "Equipment Check - retry exhausted or "			    "undesirable");		erp = dasd_3990_erp_action_1(erp);	} else {		/* all other equipment checks - Action 5 */		/* rest is done when retries == 0 */		DEV_MESSAGE(KERN_DEBUG, device, "%s",			    "Equipment check or processing error");		erp = dasd_3990_erp_action_5(erp);	}	return erp;}				/* end dasd_3990_erp_equip_check *//* * DASD_3990_ERP_DATA_CHECK * * DESCRIPTION *   Handles 24 byte 'Data Check' error. * * PARAMETER *   erp		current erp_head * RETURN VALUES *   erp		new erp_head - pointer to new ERP */static struct dasd_ccw_req *dasd_3990_erp_data_check(struct dasd_ccw_req * erp, char *sense){	struct dasd_device *device = erp->device;	erp->function = dasd_3990_erp_data_check;	if (sense[2] & SNS2_CORRECTABLE) {	/* correctable data check */		/* issue message that the data has been corrected */		DEV_MESSAGE(KERN_EMERG, device, "%s",			    "Data recovered during retry with PCI "			    "fetch mode active");		/* not possible to handle this situation in Linux */		panic("No way to inform application about the possibly "		      "incorrect data");	} else if (sense[2] & SNS2_ENV_DATA_PRESENT) {		DEV_MESSAGE(KERN_DEBUG, device, "%s",			    "Uncorrectable data check recovered secondary "			    "addr of duplex pair");		erp = dasd_3990_erp_action_4(erp, sense);	} else if (sense[1] & SNS1_PERM_ERR) {		DEV_MESSAGE(KERN_DEBUG, device, "%s",			    "Uncorrectable data check with internal "			    "retry exhausted");		erp = dasd_3990_erp_action_1(erp);	} else {		/* all other data checks */		DEV_MESSAGE(KERN_DEBUG, device, "%s",			    "Uncorrectable data check with retry count "			    "exhausted...");		erp = dasd_3990_erp_action_5(erp);	}	return erp;}				/* end dasd_3990_erp_data_check *//* * DASD_3990_ERP_OVERRUN * * DESCRIPTION *   Handles 24 byte 'Overrun' error. * * PARAMETER *   erp		current erp_head * RETURN VALUES *   erp		new erp_head - pointer to new ERP */static struct dasd_ccw_req *dasd_3990_erp_overrun(struct dasd_ccw_req * erp, char *sense){	struct dasd_device *device = erp->device;	erp->function = dasd_3990_erp_overrun;	DEV_MESSAGE(KERN_DEBUG, device, "%s",		    "Overrun - service overrun or overrun"		    " error requested by channel");	erp = dasd_3990_erp_action_5(erp);	return erp;}				/* end dasd_3990_erp_overrun *//* * DASD_3990_ERP_INV_FORMAT * * DESCRIPTION *   Handles 24 byte 'Invalid Track Format' error. * * PARAMETER *   erp		current erp_head * RETURN VALUES *   erp		new erp_head - pointer to new ERP */static struct dasd_ccw_req *dasd_3990_erp_inv_format(struct dasd_ccw_req * erp, char *sense){	struct dasd_device *device = erp->device;	erp->function = dasd_3990_erp_inv_format;	if (sense[2] & SNS2_ENV_DATA_PRESENT) {		DEV_MESSAGE(KERN_DEBUG, device, "%s",			    "Track format error when destaging or "			    "staging data");		dasd_3990_handle_env_data(erp, sense);		erp = dasd_3990_erp_action_4(erp, sense);	} else {		DEV_MESSAGE(KERN_ERR, device, "%s",			    "Invalid Track Format - Fatal error should have "			    "been handled within the interrupt handler");		erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);	}	return erp;}				/* end dasd_3990_erp_inv_format *//* * DASD_3990_ERP_EOC * * DESCRIPTION *   Handles 24 byte 'End-of-Cylinder' error. * * PARAMETER *   erp		already added default erp * RETURN VALUES *   erp		pointer to original (failed) cqr. */static struct dasd_ccw_req *dasd_3990_erp_EOC(struct dasd_ccw_req * default_erp, char *sense){	struct dasd_device *device = default_erp->device;	DEV_MESSAGE(KERN_ERR, device, "%s",		    "End-of-Cylinder - must never happen");	/* implement action 7 - BUG */	return dasd_3990_erp_cleanup(default_erp, DASD_CQR_FAILED);}				/* end dasd_3990_erp_EOC *//* * DASD_3990_ERP_ENV_DATA * * DESCRIPTION *   Handles 24 byte 'Environmental-Data Present' error. * * PARAMETER *   erp		current erp_head * RETURN VALUES *   erp		new erp_head - pointer to new ERP */static struct dasd_ccw_req *dasd_3990_erp_env_data(struct dasd_ccw_req * erp, char *sense){	struct dasd_device *device = erp->device;	erp->function = dasd_3990_erp_env_data;	DEV_MESSAGE(KERN_DEBUG, device, "%s", "Environmental data present");	dasd_3990_handle_env_data(erp, sense);	/* don't retry on disabled interface */	if (sense[7] != 0x0F) {		erp = dasd_3990_erp_action_4(erp, sense);	} else {		erp = dasd_3990_erp_cleanup(erp, DASD_CQR_IN_IO);	}	return erp;}				/* end dasd_3990_erp_env_data *//* * DASD_3990_ERP_NO_REC * * DESCRIPTION *   Handles 24 byte 'No Record Found' error. * * PARAMETER *   erp		already added default ERP *		 * RETURN VALUES *   erp		new erp_head - pointer to new ERP */static struct dasd_ccw_req *dasd_3990_erp_no_rec(struct dasd_ccw_req * default_erp, char *sense){	struct dasd_device *device = default_erp->device;	DEV_MESSAGE(KERN_ERR, device, "%s",		    "No Record Found - Fatal error should "		    "have been handled within the interrupt handler");	return dasd_3990_erp_cleanup(default_erp, DASD_CQR_FAILED);}				/* end dasd_3990_erp_no_rec *//* * DASD_3990_ERP_FILE_PROT * * DESCRIPTION *   Handles 24 byte 'File Protected' error. *   Note: Seek related recovery is not implemented because *	   wee don't use the seek command yet. * * PARAMETER *   erp		current erp_head * RETURN VALUES *   erp		new erp_head - pointer to new ERP */static struct dasd_ccw_req *dasd_3990_erp_file_prot(struct dasd_ccw_req * erp){	struct dasd_device *device = erp->device;	DEV_MESSAGE(KERN_ERR, device, "%s", "File Protected");	return dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);}				/* end dasd_3990_erp_file_prot *//* * DASD_3990_ERP_INSPECT_24  * * DESCRIPTION *   Does a detailed inspection of the 24 byte sense data *   and sets up a related error recovery action.   * * PARAMETER *   sense		sense data of the actual error *   erp		pointer to the currently created default ERP * * RETURN VALUES *   erp		pointer to the (addtitional) ERP */static struct dasd_ccw_req *dasd_3990_erp_inspect_24(struct dasd_ccw_req * erp, char *sense){	struct dasd_ccw_req *erp_filled = NULL;	/* Check sense for ....	   */	/* 'Command Reject'	   */	if ((erp_filled == NULL) && (sense[0] & SNS0_CMD_REJECT)) {		erp_filled = dasd_3990_erp_com_rej(erp, sense);	}	/* 'Intervention Required' */	if ((erp_filled == NULL) && (sense[0] & SNS0_INTERVENTION_REQ)) {		erp_filled = dasd_3990_erp_int_req(erp);	}	/* 'Bus Out Parity Check'  */	if ((erp_filled == NULL) && (sense[0] & SNS0_BUS_OUT_CHECK)) {		erp_filled = dasd_3990_erp_bus_out(erp);	}	/* 'Equipment Check'	   */	if ((erp_filled == NULL) && (sense[0] & SNS0_EQUIPMENT_CHECK)) {		erp_filled = dasd_3990_erp_equip_check(erp, sense);	}

⌨️ 快捷键说明

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