atapicam(4) is currently off by three orders of magnitude regarding the

timeout values in the CAM CCBs.  Divide by 1000 to get values in seconds
which are what ata(4) timeouts internally use.

This does lose granularity, though, and small values can now round down
to zero.  It's probably worth making all ata(4) timeouts in terms of
hz/ticks/milliseconds/something.
This commit is contained in:
green 2004-06-17 07:29:56 +00:00
parent 721db61fd9
commit 29963c7c24

View File

@ -496,7 +496,7 @@ atapi_action(struct cam_sim *sim, union ccb *ccb)
request->data = buf;
request->bytecount = len;
request->transfersize = min(request->bytecount, 65534);
request->timeout = ccb_h->timeout;
request->timeout = ccb_h->timeout / 1000; /* XXX lost granularity */
request->retries = 2;
request->callback = &atapi_cb;
request->flags = request_flags;
@ -588,7 +588,7 @@ atapi_cb(struct ata_request *request)
request->data = (caddr_t)&csio->sense_data;
request->bytecount = sizeof(struct atapi_sense);
request->transfersize = min(request->bytecount, 65534);
request->timeout = csio->ccb_h.timeout;
request->timeout = csio->ccb_h.timeout / 1000;
request->retries = 2;
request->flags = ATA_R_QUIET|ATA_R_ATAPI|ATA_R_IMMEDIATE;
hcb->flags |= AUTOSENSE;