diff options
author | gibbs <gibbs@FreeBSD.org> | 2004-05-11 20:33:42 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 2004-05-11 20:33:42 +0000 |
commit | 82f4a65caf9e61c4e527c1a12289aa5d1baef4b9 (patch) | |
tree | 91cdd878f27f972849f6bb03761fdcfaf1a54e19 /sys/dev/aic7xxx | |
parent | 052c3f46af8417c8d636dc411d8c3b623150e3e3 (diff) | |
download | FreeBSD-src-82f4a65caf9e61c4e527c1a12289aa5d1baef4b9.zip FreeBSD-src-82f4a65caf9e61c4e527c1a12289aa5d1baef4b9.tar.gz |
Add aic_scb_timer_start() which will be used in the aic7xxx driver to
start the timer on SCBs queued in the untagged SCB queue.
The core treats timeouts in usecs to satisfy Linux requirements. Multiply
accordingly.
Diffstat (limited to 'sys/dev/aic7xxx')
-rw-r--r-- | sys/dev/aic7xxx/aic_osm_lib.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/aic7xxx/aic_osm_lib.h b/sys/dev/aic7xxx/aic_osm_lib.h index b12ac35..ca7a088 100644 --- a/sys/dev/aic7xxx/aic_osm_lib.h +++ b/sys/dev/aic7xxx/aic_osm_lib.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic_osm_lib.h#4 $ + * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic_osm_lib.h#5 $ * * $FreeBSD$ */ @@ -207,7 +207,7 @@ aic_timer_reset(aic_timer_t *timer, u_int usec, aic_callback_t *func, void *arg) static __inline u_int aic_get_timeout(struct scb *scb) { - return (scb->io_ctx->ccb_h.timeout); + return (scb->io_ctx->ccb_h.timeout * 1000); } static __inline void @@ -219,6 +219,21 @@ aic_scb_timer_reset(struct scb *scb, u_int usec) timeout(aic_platform_timeout, scb, (usec * hz)/1000000); } +static __inline void +aic_scb_timer_start(struct scb *scb) +{ + + if (scb->io_ctx->ccb_h.timeout != CAM_TIME_INFINITY) { + uint64_t time; + + time = scb->io_ctx->ccb_h.timeout; + time *= hz; + time /= 1000; + scb->io_ctx->ccb_h.timeout_ch = + timeout(aic_platform_timeout, scb, time); + } +} + /************************** Transaction Operations ****************************/ static __inline void aic_set_transaction_status(struct scb *, uint32_t); static __inline void aic_set_scsi_status(struct scb *, uint32_t); |