dasd_3990_erp.c

来自「linux-2.4.29操作系统的源码」· C语言 代码 · 共 1,977 行 · 第 1/5 页

C
1,977
字号
dasd_3990_erp_action_5 (ccw_req_t *erp){        /* first of all retry */        erp->retries = 10;        erp->function = dasd_3990_erp_action_5;        return erp;} /* end dasd_3990_erp_action_5 *//* * DASD_3990_HANDLE_ENV_DATA * * DESCRIPTION *   Handles 24 byte 'Environmental data present'. *   Does a analysis of the sense data (message Format) *   and prints the error messages. * * PARAMETER *   sense              current sense data *    * RETURN VALUES *   void */voiddasd_3990_handle_env_data (ccw_req_t *erp,                           char      *sense){        dasd_device_t *device = erp->device;	char msg_format       = (sense[7] & 0xF0);	char msg_no           = (sense[7] & 0x0F);        	switch (msg_format) {	case 0x00:	/* Format 0 - Program or System Checks */		if (sense[1] & 0x10) {	/* check message to operator bit */			switch (msg_no) {			case 0x00:	/* No Message */				break;			case 0x01:                                DEV_MESSAGE (KERN_WARNING, device, "%s",                                             "FORMAT 0 - Invalid Command");				break;			case 0x02:                                DEV_MESSAGE (KERN_WARNING, device, "%s",                                             "FORMAT 0 - Invalid Command "                                             "Sequence");				break;			case 0x03:                                DEV_MESSAGE (KERN_WARNING, device, "%s",                                             "FORMAT 0 - CCW Count less than "                                             "required");				break;			case 0x04:                                DEV_MESSAGE (KERN_WARNING, device, "%s",                                             "FORMAT 0 - Invalid Parameter");				break;			case 0x05:                                DEV_MESSAGE (KERN_WARNING, device, "%s",                                             "FORMAT 0 - Diagnostic of Sepecial"                                             " Command Violates File Mask");				break;			case 0x07:                                DEV_MESSAGE (KERN_WARNING, device, "%s",                                             "FORMAT 0 - Channel Returned with "                                             "Incorrect retry CCW");				break;			case 0x08:                                DEV_MESSAGE (KERN_WARNING, device, "%s",                                             "FORMAT 0 - Reset Notification");				break;			case 0x09:                                DEV_MESSAGE (KERN_WARNING, device, "%s",                                             "FORMAT 0 - Storage Path Restart");				break;			case 0x0A:                                DEV_MESSAGE (KERN_WARNING, device,                                             "FORMAT 0 - Channel requested "                                             "... %02x",                                             sense[8]);				break;			case 0x0B:                                DEV_MESSAGE (KERN_WARNING, device, "%s",                                             "FORMAT 0 - Invalid Defective/"                                             "Alternate Track Pointer");				break;			case 0x0C:                                DEV_MESSAGE (KERN_WARNING, device, "%s",                                             "FORMAT 0 - DPS Installation "                                             "Check");				break;			case 0x0E:                                DEV_MESSAGE (KERN_WARNING, device, "%s",                                             "FORMAT 0 - Command Invalid on "                                             "Secondary Address");				break;			case 0x0F:                                DEV_MESSAGE (KERN_WARNING, device,                                             "FORMAT 0 - Status Not As "                                             "Required: reason %02x",                                             sense[8]);				break;			default:                                DEV_MESSAGE (KERN_WARNING, device, "%s",                                             "FORMAT 0 - Reseved");			}		} else {			switch (msg_no) {			case 0x00:	/* No Message */				break;			case 0x01:                                DEV_MESSAGE (KERN_WARNING, device, "%s",                                             "FORMAT 0 - Device Error Source");				break;			case 0x02:                                DEV_MESSAGE (KERN_WARNING, device, "%s",                                             "FORMAT 0 - Reserved");				break;			case 0x03:                                DEV_MESSAGE (KERN_WARNING, device,                                             "FORMAT 0 - Device Fenced - "                                             "device = %02x",                                             sense[4]);				break;			case 0x04:                                DEV_MESSAGE (KERN_WARNING, device, "%s",                                             "FORMAT 0 - Data Pinned for "                                             "Device");				break;			default:                                DEV_MESSAGE (KERN_WARNING, device, "%s",                                             "FORMAT 0 - Reserved");			}                }                break;			case 0x10:	/* Format 1 - Device Equipment Checks */		switch (msg_no) {		case 0x00:	/* No Message */			break;		case 0x01:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 1 - Device Status 1 not as "                                     "expected");			break;		case 0x03:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 1 - Index missing");			break;		case 0x04:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 1 - Interruption cannot be reset");			break;		case 0x05:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 1 - Device did not respond to "                                     "selection");			break;		case 0x06:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 1 - Device check-2 error or Set "                                     "Sector is not complete");			break;		case 0x07:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 1 - Head address does not "                                     "compare");			break;		case 0x08:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 1 - Device status 1 not valid");			break;		case 0x09:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 1 - Device not ready");			break;		case 0x0A:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 1 - Track physical address did "                                     "not compare");			break;		case 0x0B:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 1 - Missing device address bit");			break;		case 0x0C:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 1 - Drive motor switch is off");			break;		case 0x0D:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 1 - Seek incomplete");			break;		case 0x0E:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 1 - Cylinder address did not "                                     "compare");			break;		case 0x0F:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 1 - Offset active cannot be "                                     "reset");			break;		default:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 1 - Reserved");		}                break;		                        	case 0x20:	/* Format 2 - 3990 Equipment Checks */		switch (msg_no) {		case 0x08:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 2 - 3990 check-2 error");			break;		case 0x0E:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 2 - Support facility errors");			break;		case 0x0F:                        DEV_MESSAGE (KERN_WARNING, device,                                     "FORMAT 2 - Microcode detected error %02x",                                     sense[8]);			break;		default:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 2 - Reserved");		}                break;			case 0x30:	/* Format 3 - 3990 Control Checks */		switch (msg_no) {		case 0x0F:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 3 - Allegiance terminated");			break;		default:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 3 - Reserved");		}                break;			case 0x40:	/* Format 4 - Data Checks */		switch (msg_no) {		case 0x00:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 4 - Home address area error");			break;		case 0x01:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 4 - Count area error");			break;		case 0x02:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 4 - Key area error");			break;		case 0x03:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 4 - Data area error");			break;		case 0x04:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 4 - No sync byte in home address "                                      "area");			break;		case 0x05:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 4 - No sync byte in count address "                                     "area");			break;		case 0x06:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 4 - No sync byte in key area");			break;		case 0x07:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 4 - No sync byte in data area");			break;		case 0x08:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 4 - Home address area error; "                                     "offset active");			break;		case 0x09:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 4 - Count area error; offset "                                     "active");			break;		case 0x0A:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 4 - Key area error; offset "                                     "active");			break;		case 0x0B:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 4 - Data area error; "                                     "offset active");			break;		case 0x0C:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 4 - No sync byte in home "                                     "address area; offset active");			break;		case 0x0D:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 4 - No syn byte in count "                                     "address area; offset active");			break;		case 0x0E:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 4 - No sync byte in key area; "                                     "offset active");			break;		case 0x0F:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 4 - No syn byte in data area; "                                     "offset active");			break;		default:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 4 - Reserved");		}                break;			case 0x50:	/* Format 5 - Data Check with displacement information */		switch (msg_no) {		case 0x00:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 5 - Data Check in the "                                     "home address area");			break;		case 0x01:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 5 - Data Check in the count area");			break;		case 0x02:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 5 - Data Check in the key area");			break;		case 0x03:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 5 - Data Check in the data area");			break;		case 0x08:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 5 - Data Check in the "                                     "home address area; offset active");			break;		case 0x09:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 5 - Data Check in the count area; "                                     "offset active");			break;		case 0x0A:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 5 - Data Check in the key area; "                                     "offset active");			break;		case 0x0B:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 5 - Data Check in the data area; "                                     "offset active");			break;		default:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 5 - Reserved");		}                break;			case 0x60:	/* Format 6 - Usage Statistics/Overrun Errors */		switch (msg_no) {		case 0x00:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 6 - Overrun on channel A");			break;		case 0x01:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 6 - Overrun on channel B");			break;		case 0x02:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 6 - Overrun on channel C");			break;		case 0x03:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 6 - Overrun on channel D");			break;		case 0x04:                        DEV_MESSAGE (KERN_WARNING, device, "%s",                                     "FORMAT 6 - Overrun on channel E");			break;		case 0x05:

⌨️ 快捷键说明

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