> As foreshadowed in a previous posting to this group, some
> changes have been made to the SCSI mid level command structure
> [struct scsi_cmnd] in 2.3.19
> - the sense_buffer array has been increased from 16 to 64 bytes
> - a new int member called "resid" has been added.
>
> The "resid" member is for the residual DMA count from data
> transfers. It is initialized to 0 and is set currently by no
> adapter drivers [hint]. It is defined (as per CAM) as the
> requested data transfer length less the number of bytes
> actually transferred. In practice, it should be used to indicate
> underrun (which will yield a positive number). [Hopefully
Right on. From my qlogic FC/SCSI driver:
isplinux_cdone(Scsi_Cmnd *Cmnd)
{
struct ispsoftc *isp = (struct ispsoftc *) (Cmnd->host->hostdata);
/*
* Internal bookkeeping
*/
Cmnd->SCp.phase = 1;
/*
*
*/
Cmnd->result &= ~0xff;
Cmnd->result |= Cmnd->SCp.Status;
if (host_byte(Cmnd->result) == DID_OK) {
/* Never have can_queue go to zero. */
int cq = ISP_QAVAIL(isp->isp_reqidx, isp->isp_reqodx,
min(MAXISPREQUEST, isp->isp_maxcmds));
Cmnd->host->can_queue = (cq != 0)? cq : 1;
if (IS_FC(isp))
Cmnd->host->sg_tablesize = SGSZ_2X00(Cmnd->host->can_queue);
else
Cmnd->host->sg_tablesize = SGSZ_1XX0(Cmnd->host->can_queue);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,75)
/* host_busy is an unsigned char for 2.0.X */
cq = min(cq, 255);
#endif
}
/*
* If we had a way handling residuals, this is where we'd do it
*/
/*
* Queue command on completion queue.
*/
if (isp->isp_osinfo.dqnext == NULL) {
isp->isp_osinfo.dqnext = isp->isp_osinfo.dqtail = Cmnd;
} else {
isp->isp_osinfo.dqtail->host_scribble = (unsigned char *) Cmnd;
}
Cmnd->host_scribble = NULL;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]