summaryrefslogtreecommitdiffstats
path: root/sys/dev/advansys/advlib.c
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1998-10-07 03:32:57 +0000
committergibbs <gibbs@FreeBSD.org>1998-10-07 03:32:57 +0000
commitd925bde25d267b98712f34599b3a506e67ea366d (patch)
tree303eb20c48799e67a76d8cb037a1885b9091b296 /sys/dev/advansys/advlib.c
parent848e5bffcd8e6d2e46b6562db0350f0c4cf04d93 (diff)
downloadFreeBSD-src-d925bde25d267b98712f34599b3a506e67ea366d.zip
FreeBSD-src-d925bde25d267b98712f34599b3a506e67ea366d.tar.gz
Don't set the active flag on a transaction resource until it has been
queued. Perform dma segment setup outside of splcam protection as this can take some time and the protection is not necessary. Inline a function. Clean up some whitespace.
Diffstat (limited to 'sys/dev/advansys/advlib.c')
-rw-r--r--sys/dev/advansys/advlib.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/sys/dev/advansys/advlib.c b/sys/dev/advansys/advlib.c
index d20eddf..3a7f611 100644
--- a/sys/dev/advansys/advlib.c
+++ b/sys/dev/advansys/advlib.c
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: advlib.c,v 1.5 1998/09/15 07:03:33 gibbs Exp $
+ * $Id: advlib.c,v 1.6 1998/09/20 05:04:05 gibbs Exp $
*/
/*
* Ported from:
@@ -241,7 +241,20 @@ static u_int8_t adv_get_chip_scsi_ctrl(struct adv_softc *adv);
#endif
/* Queue handling and execution */
-static int adv_sgcount_to_qcount(int sgcount);
+static __inline int
+ adv_sgcount_to_qcount(int sgcount);
+
+static __inline int
+adv_sgcount_to_qcount(int sgcount)
+{
+ int n_sg_list_qs;
+
+ n_sg_list_qs = ((sgcount - 1) / ADV_SG_LIST_PER_Q);
+ if (((sgcount - 1) % ADV_SG_LIST_PER_Q) != 0)
+ n_sg_list_qs++;
+ return (n_sg_list_qs + 1);
+}
+
static void adv_get_q_info(struct adv_softc *adv, u_int16_t s_addr,
u_int16_t *inbuf, int words);
static u_int adv_get_num_free_queues(struct adv_softc *adv, u_int8_t n_qs);
@@ -1584,17 +1597,6 @@ adv_get_chip_scsi_ctrl(struct adv_softc *adv)
}
#endif
-static int
-adv_sgcount_to_qcount(int sgcount)
-{
- int n_sg_list_qs;
-
- n_sg_list_qs = ((sgcount - 1) / ADV_SG_LIST_PER_Q);
- if (((sgcount - 1) % ADV_SG_LIST_PER_Q) != 0)
- n_sg_list_qs++;
- return (n_sg_list_qs + 1);
-}
-
/*
* XXX Looks like more padding issues in this routine as well.
* There has to be a way to turn this into an insw.
OpenPOWER on IntegriCloud