* Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000, 2001
*
- * $Revision: 1.30 $
*/
#include <linux/timer.h>
struct DCTL_data {
- unsigned char subcommand; /* e.g Inhibit Write, Enable Write,... */
- unsigned char modifier; /* Subcommand modifier */
- unsigned short res; /* reserved */
+ unsigned char subcommand; /* e.g Inhibit Write, Enable Write,... */
+ unsigned char modifier; /* Subcommand modifier */
+ unsigned short res; /* reserved */
} __attribute__ ((packed));
/*
opm = ccw_device_get_path_mask(device->cdev);
//FIXME: start with get_opm ?
if (erp->lpm == 0)
- erp->lpm = LPM_ANYPATH & ~(erp->dstat->esw.esw0.sublog.lpum);
+ erp->lpm = LPM_ANYPATH & ~(erp->irb.esw.esw0.sublog.lpum);
else
- erp->lpm &= ~(erp->dstat->esw.esw0.sublog.lpum);
+ erp->lpm &= ~(erp->irb.esw.esw0.sublog.lpum);
if ((erp->lpm & opm) != 0x00) {
DEV_MESSAGE(KERN_DEBUG, device,
"try alternate lpm=%x (lpum=%x / opm=%x)",
- erp->lpm, erp->dstat->esw.esw0.sublog.lpum, opm);
+ erp->lpm, erp->irb.esw.esw0.sublog.lpum, opm);
/* reset status to queued to handle the request again... */
if (erp->status > DASD_CQR_QUEUED)
DEV_MESSAGE(KERN_ERR, device,
"No alternate channel path left (lpum=%x / "
"opm=%x) -> permanent error",
- erp->dstat->esw.esw0.sublog.lpum, opm);
+ erp->irb.esw.esw0.sublog.lpum, opm);
/* post request with permanent error */
if (erp->status > DASD_CQR_QUEUED)
* Setup ERP to do the ERP action 4 (see Reference manual).
* Set the current request to PENDING to block the CQR queue for that device
* until the state change interrupt appears.
- * Use a timer (20 seconds) to retry the cqr if the interrupt is still missing.
+ * Use a timer (20 seconds) to retry the cqr if the interrupt is still
+ * missing.
*
* PARAMETER
* sense sense data of the actual error
/* interrupt (this enables easier enqueing of the cqr) */
if (erp->function != dasd_3990_erp_action_4) {
+ DEV_MESSAGE(KERN_INFO, device, "%s",
+ "dasd_3990_erp_action_4: first time retry");
+
erp->retries = 256;
erp->function = dasd_3990_erp_action_4;
dasd_3990_erp_block_queue(erp, 30*HZ);
+ } else if (sense[25] == 0x1E) { /* busy */
+ DEV_MESSAGE(KERN_INFO, device,
+ "busy - redriving request later, "
+ "%d retries left",
+ erp->retries);
+ dasd_3990_erp_block_queue(erp, HZ);
} else {
/* no state change pending - retry */
}
break;
- case 0x50: /* Format 5 - Data Check with displacement information */
+ case 0x50: /* Format 5 - Data Check with displacement information */
switch (msg_no) {
case 0x00:
DEV_MESSAGE(KERN_WARNING, device, "%s",
}
break;
- case 0x60: /* Format 6 - Usage Statistics/Overrun Errors */
+ case 0x60: /* Format 6 - Usage Statistics/Overrun Errors */
switch (msg_no) {
case 0x00:
DEV_MESSAGE(KERN_WARNING, device, "%s",
}
break;
- case 0x70: /* Format 7 - Device Connection Control Checks */
+ case 0x70: /* Format 7 - Device Connection Control Checks */
switch (msg_no) {
case 0x00:
DEV_MESSAGE(KERN_WARNING, device, "%s",
}
break;
- case 0x80: /* Format 8 - Additional Device Equipment Checks */
+ case 0x80: /* Format 8 - Additional Device Equipment Checks */
switch (msg_no) {
case 0x00: /* No Message */
case 0x01:
}
break;
- case 0x90: /* Format 9 - Device Read, Write, and Seek Checks */
+ case 0x90: /* Format 9 - Device Read, Write, and Seek Checks */
switch (msg_no) {
case 0x00:
break; /* No Message */
"fetch mode active");
/* not possible to handle this situation in Linux */
- panic("No way to inform appliction about the possibly "
- "incorret data");
+ panic("No way to inform application about the possibly "
+ "incorrect data");
} else if (sense[2] & SNS2_ENV_DATA_PRESENT) {
/* determine the address of the CCW to be restarted */
/* Imprecise ending is not set -> addr from IRB-SCSW */
- cpa = default_erp->refers->dstat->scsw.cpa;
+ cpa = default_erp->refers->irb.scsw.cpa;
if (cpa == 0) {
erp->magic = default_erp->magic;
erp->expires = 0;
erp->retries = 256;
- cqr->buildclk = get_clock();
+ erp->buildclk = get_clock();
erp->status = DASD_CQR_FILLED;
/* remove the default erp */
/* determine the address of the CCW to be restarted */
/* Imprecise ending is not set -> addr from IRB-SCSW */
- cpa = previous_erp->dstat->scsw.cpa;
+ cpa = previous_erp->irb.scsw.cpa;
if (cpa == 0) {
erp = dasd_3990_erp_int_req(erp);
break;
- case 0x0F: /* length mismatch during update write command */
+ case 0x0F: /* length mismatch during update write command */
DEV_MESSAGE(KERN_ERR, device, "%s",
"update write command error - should not "
"happen;\n"
erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
break;
- case 0x10: /* logging required for other channel program */
+ case 0x10: /* logging required for other channel program */
erp = dasd_3990_erp_action_10_32(erp, sense);
break;
/* not possible to handle this situation in Linux */
panic
- ("Invalid data - No way to inform appliction about "
- "the possibly incorret data");
+ ("Invalid data - No way to inform application "
+ "about the possibly incorrect data");
break;
case 0x1D: /* state-change pending */
erp = dasd_3990_erp_action_4(erp, sense);
break;
+ case 0x1E: /* busy */
+ DEV_MESSAGE(KERN_DEBUG, device, "%s",
+ "Busy condition exists "
+ "for the subsystem or device");
+ erp = dasd_3990_erp_action_4(erp, sense);
+ break;
+
default: /* all others errors - default erp */
break;
}
struct dasd_ccw_req *erp_new = NULL;
/* sense data are located in the refers record of the */
/* already set up new ERP ! */
- char *sense = erp->refers->dstat->ecw;
+ char *sense = erp->refers->irb.ecw;
/* distinguish between 24 and 32 byte sense data */
if (sense[27] & DASD_SENSE_BIT_0) {
/* inspect the 32 byte sense data */
erp_new = dasd_3990_erp_inspect_32(erp, sense);
- } /* end distinguish between 24 and 32 byte sense data */
+ } /* end distinguish between 24 and 32 byte sense data */
return erp_new;
-
-} /* END dasd_3990_erp_inspect */
+}
/*
* DASD_3990_ERP_ADD_ERP
erp->magic = cqr->magic;
erp->expires = 0;
erp->retries = 256;
+ erp->buildclk = get_clock();
erp->status = DASD_CQR_FILLED;
{
/* check failed CCW */
- if (cqr1->dstat->scsw.cpa != cqr2->dstat->scsw.cpa) {
+ if (cqr1->irb.scsw.cpa != cqr2->irb.scsw.cpa) {
// return 0; /* CCW doesn't match */
}
/* check sense data; byte 0-2,25,27 */
- if (!((memcmp (cqr1->dstat->ecw, cqr2->dstat->ecw, 3) == 0) &&
- (cqr1->dstat->ecw[27] == cqr2->dstat->ecw[27]) &&
- (cqr1->dstat->ecw[25] == cqr2->dstat->ecw[25]))) {
+ if (!((memcmp (cqr1->irb.ecw, cqr2->irb.ecw, 3) == 0) &&
+ (cqr1->irb.ecw[27] == cqr2->irb.ecw[27]) &&
+ (cqr1->irb.ecw[25] == cqr2->irb.ecw[25]))) {
return 0; /* sense doesn't match */
}
{
struct dasd_device *device = erp->device;
- char *sense = erp->dstat->ecw;
+ char *sense = erp->irb.ecw;
/* check for 24 byte sense ERP */
if ((erp->function == dasd_3990_erp_bus_out) ||
erp = dasd_3990_erp_compound(erp, sense);
} else {
- /* no retry left and no additional special handling necessary */
+ /* No retry left and no additional special handling */
+ /*necessary */
DEV_MESSAGE(KERN_ERR, device,
"no retries left for erp %p - "
"set status to FAILED", erp);
if (erp->retries > 0) {
- char *sense = erp->refers->dstat->ecw;
+ char *sense = erp->refers->irb.ecw;
/* check for special retries */
if (erp->function == dasd_3990_erp_action_4) {
struct dasd_ccw_req *erp = NULL;
struct dasd_device *device = cqr->device;
- __u32 cpa = cqr->dstat->scsw.cpa;
+ __u32 cpa = cqr->irb.scsw.cpa;
#ifdef ERP_DEBUG
/* print current erp_chain */
#endif /* ERP_DEBUG */
/* double-check if current erp/cqr was successfull */
- if ((cqr->dstat->scsw.cstat == 0x00) &&
- (cqr->dstat->scsw.dstat == (DEV_STAT_CHN_END|DEV_STAT_DEV_END))) {
+ if ((cqr->irb.scsw.cstat == 0x00) &&
+ (cqr->irb.scsw.dstat == (DEV_STAT_CHN_END|DEV_STAT_DEV_END))) {
DEV_MESSAGE(KERN_DEBUG, device,
"ERP called for successful request %p"
return cqr;
}
/* check if sense data are available */
- if (!cqr->dstat->ecw) {
+ if (!cqr->irb.ecw) {
DEV_MESSAGE(KERN_DEBUG, device,
"ERP called witout sense data avail ..."
"request %p - NO ERP possible", cqr);