summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Knudsen <mk@cvs.openbsd.org>2010-06-30 19:09:00 +0000
committerMichael Knudsen <mk@cvs.openbsd.org>2010-06-30 19:09:00 +0000
commite8ea1c2f0d10ecba1caf3e09529e316458eaf798 (patch)
tree2c2c7e06b4b17adbd42f78067aba5695c7e1068f
parent3bfd24c054b5586f7f89310f5ccdd65a63ac9822 (diff)
Use a SLIST for the ccb free list.
ok krw
-rw-r--r--sys/dev/pci/ips.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/dev/pci/ips.c b/sys/dev/pci/ips.c
index efd515c4f23..07a39e0d20f 100644
--- a/sys/dev/pci/ips.c
+++ b/sys/dev/pci/ips.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ips.c,v 1.99 2010/06/28 18:31:02 krw Exp $ */
+/* $OpenBSD: ips.c,v 1.100 2010/06/30 19:08:59 mk Exp $ */
/*
* Copyright (c) 2006, 2007, 2009 Alexander Yurchenko <grange@openbsd.org>
@@ -366,11 +366,11 @@ struct ips_ccb {
void (*c_done)(struct ips_softc *, /* cmd done */
struct ips_ccb *); /* callback */
- TAILQ_ENTRY(ips_ccb) c_link; /* queue link */
+ SLIST_ENTRY(ips_ccb) c_link; /* queue link */
};
/* CCB queue */
-TAILQ_HEAD(ips_ccbq, ips_ccb);
+SLIST_HEAD(ips_ccbq, ips_ccb);
/* DMA-able chunk of memory */
struct dmamem {
@@ -658,8 +658,8 @@ ips_attach(struct device *parent, struct device *self, void *aux)
bzero(&ccb0, sizeof(ccb0));
ccb0.c_cmdbva = sc->sc_cmdbm.dm_vaddr;
ccb0.c_cmdbpa = sc->sc_cmdbm.dm_paddr;
- TAILQ_INIT(&sc->sc_ccbq_free);
- TAILQ_INSERT_TAIL(&sc->sc_ccbq_free, &ccb0, c_link);
+ SLIST_INIT(&sc->sc_ccbq_free);
+ SLIST_INSERT_HEAD(&sc->sc_ccbq_free, &ccb0, c_link);
/* Get adapter info */
if (ips_getadapterinfo(sc, SCSI_NOSLEEP)) {
@@ -689,9 +689,9 @@ ips_attach(struct device *parent, struct device *self, void *aux)
printf(": can't alloc ccb queue\n");
goto fail4;
}
- TAILQ_INIT(&sc->sc_ccbq_free);
+ SLIST_INIT(&sc->sc_ccbq_free);
for (i = 0; i < sc->sc_nccbs; i++)
- TAILQ_INSERT_TAIL(&sc->sc_ccbq_free,
+ SLIST_INSERT_HEAD(&sc->sc_ccbq_free,
&sc->sc_ccb[i], c_link);
/* Install interrupt handler */
@@ -2076,8 +2076,8 @@ ips_ccb_get(struct ips_softc *sc)
splassert(IPL_BIO);
- if ((ccb = TAILQ_FIRST(&sc->sc_ccbq_free)) != NULL) {
- TAILQ_REMOVE(&sc->sc_ccbq_free, ccb, c_link);
+ if ((ccb = SLIST_FIRST(&sc->sc_ccbq_free)) != NULL) {
+ SLIST_REMOVE_HEAD(&sc->sc_ccbq_free, c_link);
ccb->c_flags = 0;
ccb->c_xfer = NULL;
bzero(ccb->c_cmdbva, sizeof(struct ips_cmdb));
@@ -2092,7 +2092,7 @@ ips_ccb_put(struct ips_softc *sc, struct ips_ccb *ccb)
splassert(IPL_BIO);
ccb->c_state = IPS_CCB_FREE;
- TAILQ_INSERT_TAIL(&sc->sc_ccbq_free, ccb, c_link);
+ SLIST_INSERT_HEAD(&sc->sc_ccbq_free, ccb, c_link);
}
int