From cdc20e6ce867e734bc366096859ad1a186954ca4 Mon Sep 17 00:00:00 2001 From: mycroft Date: Fri, 17 Sep 2004 23:35:13 +0000 Subject: [PATCH] In places where we've already called scsipi_make_xs(), call scsipi_execute_xs() directly rather than going through scsipi_command(). --- sys/dev/scsipi/cd.c | 8 +++----- sys/dev/scsipi/sd.c | 8 +++----- sys/dev/scsipi/ss_mustek.c | 9 +++------ sys/dev/scsipi/ss_scanjet.c | 9 +++------ sys/dev/scsipi/st.c | 9 +++------ 5 files changed, 15 insertions(+), 28 deletions(-) diff --git a/sys/dev/scsipi/cd.c b/sys/dev/scsipi/cd.c index b90331a282f2..45b9ef2ca17a 100644 --- a/sys/dev/scsipi/cd.c +++ b/sys/dev/scsipi/cd.c @@ -1,4 +1,4 @@ -/* $NetBSD: cd.c,v 1.206 2004/09/17 23:10:50 mycroft Exp $ */ +/* $NetBSD: cd.c,v 1.207 2004/09/17 23:35:13 mycroft Exp $ */ /*- * Copyright (c) 1998, 2001, 2003, 2004 The NetBSD Foundation, Inc. @@ -54,7 +54,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.206 2004/09/17 23:10:50 mycroft Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.207 2004/09/17 23:35:13 mycroft Exp $"); #include "rnd.h" @@ -859,9 +859,7 @@ cdstart(struct scsipi_periph *periph) #else BUFQ_GET(&cd->buf_queue); #endif - error = scsipi_command(periph, xs, cmdp, cmdlen, - (u_char *)bp->b_data, bp->b_bcount, - CDRETRIES, 30000, bp, flags); + error = scsipi_execute_xs(xs); /* with a scsipi_xfer preallocated, scsipi_command can't fail */ KASSERT(error == 0); } diff --git a/sys/dev/scsipi/sd.c b/sys/dev/scsipi/sd.c index 039fbdbdb2c7..9cf0af0570d7 100644 --- a/sys/dev/scsipi/sd.c +++ b/sys/dev/scsipi/sd.c @@ -1,4 +1,4 @@ -/* $NetBSD: sd.c,v 1.224 2004/09/17 23:10:51 mycroft Exp $ */ +/* $NetBSD: sd.c,v 1.225 2004/09/17 23:35:13 mycroft Exp $ */ /*- * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc. @@ -54,7 +54,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.224 2004/09/17 23:10:51 mycroft Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.225 2004/09/17 23:35:13 mycroft Exp $"); #include "opt_scsi.h" #include "rnd.h" @@ -892,9 +892,7 @@ sdstart(struct scsipi_periph *periph) #else BUFQ_GET(&sd->buf_queue); #endif - error = scsipi_command(periph, xs, cmdp, cmdlen, - (u_char *)bp->b_data, bp->b_bcount, - SDRETRIES, SD_IO_TIMEOUT, bp, flags); + error = scsipi_execute_xs(xs); /* with a scsipi_xfer preallocated, scsipi_command can't fail */ KASSERT(error == 0); } diff --git a/sys/dev/scsipi/ss_mustek.c b/sys/dev/scsipi/ss_mustek.c index e983f88f4b8b..60940efa71d0 100644 --- a/sys/dev/scsipi/ss_mustek.c +++ b/sys/dev/scsipi/ss_mustek.c @@ -1,4 +1,4 @@ -/* $NetBSD: ss_mustek.c,v 1.21 2004/09/09 19:35:33 bouyer Exp $ */ +/* $NetBSD: ss_mustek.c,v 1.22 2004/09/17 23:35:13 mycroft Exp $ */ /* * Copyright (c) 1995 Joachim Koenig-Baltes. All rights reserved. @@ -46,7 +46,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ss_mustek.c,v 1.21 2004/09/09 19:35:33 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ss_mustek.c,v 1.22 2004/09/17 23:35:13 mycroft Exp $"); #include #include @@ -501,10 +501,7 @@ mustek_read(struct ss_softc *ss, struct buf *bp) #else BUFQ_GET(&ss->buf_queue); #endif - error = scsipi_command(periph, xs, - (struct scsipi_generic *) &cmd, sizeof(cmd), - (u_char *) bp->b_data, bp->b_bcount, MUSTEK_RETRIES, 10000, bp, - XS_CTL_NOSLEEP | XS_CTL_ASYNC | XS_CTL_DATA_IN); + error = scsipi_execute_xs(xs); /* with a scsipi_xfer preallocated, scsipi_command can't fail */ KASSERT(error == 0); ss->sio.scan_lines -= lines_to_read; diff --git a/sys/dev/scsipi/ss_scanjet.c b/sys/dev/scsipi/ss_scanjet.c index 9ab2f066571b..957a35d75741 100644 --- a/sys/dev/scsipi/ss_scanjet.c +++ b/sys/dev/scsipi/ss_scanjet.c @@ -1,4 +1,4 @@ -/* $NetBSD: ss_scanjet.c,v 1.32 2004/09/09 19:35:33 bouyer Exp $ */ +/* $NetBSD: ss_scanjet.c,v 1.33 2004/09/17 23:35:13 mycroft Exp $ */ /* * Copyright (c) 1995 Kenneth Stailey. All rights reserved. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ss_scanjet.c,v 1.32 2004/09/09 19:35:33 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ss_scanjet.c,v 1.33 2004/09/17 23:35:13 mycroft Exp $"); #include #include @@ -300,10 +300,7 @@ scanjet_read(struct ss_softc *ss, struct buf *bp) #else BUFQ_GET(&ss->buf_queue); #endif - error = scsipi_command(periph, xs, - (struct scsipi_generic *) &cmd, sizeof(cmd), - (u_char *) bp->b_data, bp->b_bcount, SCANJET_RETRIES, 100000, bp, - XS_CTL_NOSLEEP | XS_CTL_ASYNC | XS_CTL_DATA_IN); + error = scsipi_execute_xs(xs); /* with a scsipi_xfer preallocated, scsipi_command can't fail */ KASSERT(error == 0); ss->sio.scan_window_size -= bp->b_bcount; diff --git a/sys/dev/scsipi/st.c b/sys/dev/scsipi/st.c index 4b9b571604b3..5a88cfead998 100644 --- a/sys/dev/scsipi/st.c +++ b/sys/dev/scsipi/st.c @@ -1,4 +1,4 @@ -/* $NetBSD: st.c,v 1.167 2004/09/17 23:10:53 mycroft Exp $ */ +/* $NetBSD: st.c,v 1.168 2004/09/17 23:35:13 mycroft Exp $ */ /*- * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: st.c,v 1.167 2004/09/17 23:10:53 mycroft Exp $"); +__KERNEL_RCSID(0, "$NetBSD: st.c,v 1.168 2004/09/17 23:35:13 mycroft Exp $"); #include "opt_scsi.h" @@ -1307,10 +1307,7 @@ ststart(struct scsipi_periph *periph) #else BUFQ_GET(&st->buf_queue); #endif - error = scsipi_command(periph, xs, - (struct scsipi_generic *)&cmd, sizeof(cmd), - (u_char *)bp->b_data, bp->b_bcount, - 0, ST_IO_TIME, bp, flags); + error = scsipi_execute_xs(xs); /* with a scsipi_xfer preallocated, scsipi_command can't fail */ KASSERT(error == 0); } /* go back and see if we can cram more work in.. */