-/* $OpenBSD: dpt.c,v 1.27 2010/07/20 20:43:27 mk Exp $ */
+/* $OpenBSD: dpt.c,v 1.28 2010/07/20 20:46:18 mk Exp $ */
/* $NetBSD: dpt.c,v 1.12 1999/10/23 16:26:33 ad Exp $ */
/*-
sc->sc_statpack->sp_ccbid = -1;
/* Initialize the CCBs */
- TAILQ_INIT(&sc->sc_free_ccb);
+ SLIST_INIT(&sc->sc_free_ccb);
i = dpt_create_ccbs(sc, sc->sc_ccbs, sc->sc_nccbs);
if (i == 0) {
s = splbio();
ccb->ccb_flg = 0;
- TAILQ_INSERT_HEAD(&sc->sc_free_ccb, ccb, ccb_chain);
- /* Wake anybody waiting for a free ccb */
- if (TAILQ_NEXT(ccb, ccb_chain) == NULL)
+ if (SLIST_NEXT(ccb, ccb_chain) == NULL)
wakeup(&sc->sc_free_ccb);
splx(s);
}
break;
}
ccb->ccb_id = i;
- TAILQ_INSERT_TAIL(&sc->sc_free_ccb, ccb, ccb_chain);
+ SLIST_INSERT_HEAD(&sc->sc_free_ccb, ccb, ccb_chain);
}
return (i);
s = splbio();
for (;;) {
- ccb = TAILQ_FIRST(&sc->sc_free_ccb);
+ ccb = SLIST_FIRST(&sc->sc_free_ccb);
if (ccb) {
- TAILQ_REMOVE(&sc->sc_free_ccb, ccb, ccb_chain);
+ SLIST_REMOVE_HEAD(&sc->sc_free_ccb, ccb_chain);
break;
}
#ifdef __NetBSD__
-/* $OpenBSD: dptvar.h,v 1.5 2010/03/23 01:57:19 krw Exp $ */
+/* $OpenBSD: dptvar.h,v 1.6 2010/07/20 20:46:18 mk Exp $ */
/* $NetBSD: dptvar.h,v 1.5 1999/10/23 16:26:32 ad Exp $ */
/*
int ccb_hba_status; /* from status packet */
int ccb_scsi_status; /* from status packet */
int ccb_id; /* unique ID of this CCB */
- TAILQ_ENTRY(dpt_ccb) ccb_chain; /* link to next CCB */
+ SLIST_ENTRY(dpt_ccb) ccb_chain; /* link to next CCB */
#ifdef __NetBSD__
struct scsipi_sense_data ccb_sense; /* SCSI sense data on error */
struct scsipi_xfer *ccb_xs; /* initiating SCSI command */
int sc_hbaid[3]; /* ID of HBA on each channel */
int sc_nccbs; /* number of CCBs available */
int sc_open; /* device is open */
- TAILQ_HEAD(, dpt_ccb) sc_free_ccb;/* free ccb list */
+ SLIST_HEAD(, dpt_ccb) sc_free_ccb;/* free ccb list */
};
int dpt_intr(void *);