dasd_3990_erp.c
来自「linux-2.4.29操作系统的源码」· C语言 代码 · 共 1,977 行 · 第 1/5 页
C
1,977 行
/* * 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 */ccw_req_t *dasd_3990_erp_data_check (ccw_req_t *erp, char *sense){ dasd_device_t *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 appliction about the possibly " "incorret 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 */ccw_req_t *dasd_3990_erp_overrun (ccw_req_t *erp, char *sense){ dasd_device_t *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 */ccw_req_t *dasd_3990_erp_inv_format (ccw_req_t *erp, char *sense){ dasd_device_t *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, CQR_STATUS_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. */ccw_req_t *dasd_3990_erp_EOC (ccw_req_t *default_erp, char *sense){ dasd_device_t *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, CQR_STATUS_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 */ccw_req_t *dasd_3990_erp_env_data (ccw_req_t *erp, char *sense){ dasd_device_t *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, CQR_STATUS_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 */ccw_req_t *dasd_3990_erp_no_rec (ccw_req_t *default_erp, char *sense){ dasd_device_t *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, CQR_STATUS_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 */ccw_req_t *dasd_3990_erp_file_prot (ccw_req_t *erp){ dasd_device_t *device = erp->device; DEV_MESSAGE (KERN_ERR, device, "%s", "File Protected"); return dasd_3990_erp_cleanup (erp, CQR_STATUS_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 */ccw_req_t *dasd_3990_erp_inspect_24 (ccw_req_t *erp, char *sense){ ccw_req_t *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); } /* 'Data Check' */ if ((erp_filled == NULL) && (sense[0] & SNS0_DATA_CHECK)) { erp_filled = dasd_3990_erp_data_check (erp, sense); } /* 'Overrun' */ if ((erp_filled == NULL) && (sense[0] & SNS0_OVERRUN)) { erp_filled = dasd_3990_erp_overrun (erp, sense); } /* 'Invalid Track Format' */ if ((erp_filled == NULL) && (sense[1] & SNS1_INV_TRACK_FORMAT)) { erp_filled = dasd_3990_erp_inv_format (erp, sense); } /* 'End-of-Cylinder' */ if ((erp_filled == NULL) && (sense[1] & SNS1_EOC)) { erp_filled = dasd_3990_erp_EOC (erp, sense); } /* 'Environmental Data' */ if ((erp_filled == NULL) && (sense[2] & SNS2_ENV_DATA_PRESENT)) { erp_filled = dasd_3990_erp_env_data (erp, sense); } /* 'No Record Found' */ if ((erp_filled == NULL) && (sense[1] & SNS1_NO_REC_FOUND)) { erp_filled = dasd_3990_erp_no_rec (erp, sense); } /* 'File Protected' */ if ((erp_filled == NULL) && (sense[1] & SNS1_FILE_PROTECTED)) { erp_filled = dasd_3990_erp_file_prot (erp); } /* other (unknown) error - do default ERP */ if (erp_filled == NULL) { erp_filled = erp; } return erp_filled;} /* END dasd_3990_erp_inspect_24 *//* ***************************************************************************** * 32 byte sense ERP functions (only) ***************************************************************************** *//* * DASD_3990_ERPACTION_10_32 * * DESCRIPTION * Handles 32 byte 'Action 10' of Single Program Action Codes. * Just retry and if retry doesn't work, return with error. * * PARAMETER * erp current erp_head * sense current sense data * RETURN VALUES * erp modified erp_head */ccw_req_t *dasd_3990_erp_action_10_32 (ccw_req_t *erp, char *sense){ dasd_device_t *device = erp->device; erp->retries = 256; erp->function = dasd_3990_erp_action_10_32; DEV_MESSAGE (KERN_DEBUG, device, "%s", "Perform logging requested"); return erp;} /* end dasd_3990_erp_action_10_32 *//* * DASD_3990
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?