Fix up unit attention and selection timeout handling in various peripheral
drivers. - change daprevent() to set CAM_RETRY_SELTO and SF_RETRY_UA when it calls cam_periph_runccb(). - change the pt(4) driver to ignore unit attentions - change the targ(4) driver to retry selection timeouts - clean up a few formatting glitches in the targ(4) driver Reviewed by: gibbs
This commit is contained in:
parent
f22b7c560b
commit
b303ef38f5
@ -1479,8 +1479,8 @@ daprevent(struct cam_periph *periph, int action)
|
||||
SSD_FULL_SIZE,
|
||||
5000);
|
||||
|
||||
error = cam_periph_runccb(ccb, /*error_routine*/NULL, /*cam_flags*/0,
|
||||
/*sense_flags*/0, &softc->device_stats);
|
||||
error = cam_periph_runccb(ccb, /*error_routine*/NULL, CAM_RETRY_SELTO,
|
||||
SF_RETRY_UA, &softc->device_stats);
|
||||
|
||||
if (error == 0) {
|
||||
if (action == PR_ALLOW)
|
||||
|
@ -544,7 +544,7 @@ ptstart(struct cam_periph *periph, union ccb *start_ccb)
|
||||
/*sense_len*/SSD_FULL_SIZE,
|
||||
/*timeout*/softc->io_timeout);
|
||||
|
||||
start_ccb->ccb_h.ccb_state = PT_CCB_BUFFER_IO;
|
||||
start_ccb->ccb_h.ccb_state = PT_CCB_BUFFER_IO_UA;
|
||||
|
||||
/*
|
||||
* Block out any asyncronous callbacks
|
||||
|
@ -1011,10 +1011,8 @@ targsendccb(struct cam_periph *periph, union ccb *ccb, union ccb *inccb)
|
||||
* then honor that request. Otherwise, it's up to the
|
||||
* user to perform any error recovery.
|
||||
*/
|
||||
error = cam_periph_runccb(ccb,
|
||||
/* error handler */NULL,
|
||||
/* cam_flags */ 0,
|
||||
/* sense_flags */SF_RETRY_UA,
|
||||
error = cam_periph_runccb(ccb, /* error handler */NULL,
|
||||
CAM_RETRY_SELTO, SF_RETRY_UA,
|
||||
&softc->device_stats);
|
||||
|
||||
if (ccb->ccb_h.func_code == XPT_CONT_TARGET_IO)
|
||||
@ -2041,8 +2039,7 @@ targerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
|
||||
/* "SCSI parity error" */
|
||||
fill_sense(softc, csio->init_id, SSD_CURRENT_ERROR,
|
||||
SSD_KEY_HARDWARE_ERROR, 0x47, 0x00);
|
||||
set_ca_condition(periph, csio->init_id,
|
||||
CA_CMD_SENSE);
|
||||
set_ca_condition(periph, csio->init_id, CA_CMD_SENSE);
|
||||
csio->resid = csio->dxfer_len;
|
||||
error = EIO;
|
||||
break;
|
||||
@ -2054,9 +2051,7 @@ targerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
|
||||
if (sense != 0) {
|
||||
copy_sense(softc, istate, (u_int8_t *)&csio->sense_data,
|
||||
csio->sense_len);
|
||||
set_ca_condition(periph,
|
||||
csio->init_id,
|
||||
CA_CMD_SENSE);
|
||||
set_ca_condition(periph, csio->init_id, CA_CMD_SENSE);
|
||||
}
|
||||
csio->resid = csio->dxfer_len;
|
||||
error = EIO;
|
||||
@ -2065,8 +2060,7 @@ targerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
|
||||
/* "Initiator detected error message received" */
|
||||
fill_sense(softc, csio->init_id, SSD_CURRENT_ERROR,
|
||||
SSD_KEY_HARDWARE_ERROR, 0x48, 0x00);
|
||||
set_ca_condition(periph, csio->init_id,
|
||||
CA_CMD_SENSE);
|
||||
set_ca_condition(periph, csio->init_id, CA_CMD_SENSE);
|
||||
csio->resid = csio->dxfer_len;
|
||||
error = EIO;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user