static int adw_scsi_cmd __P((struct scsi_xfer *)); static int adw_build_req __P((struct scsi_xfer *, ADW_CCB *, int)); static void adw_build_sglist __P((ADW_CCB *, ADW_SCSI_REQ_Q *, ADW_SG_BLOCK *)); static void adwminphys __P((struct buf *)); static void adw_isr_callback __P((ADW_SOFTC *, ADW_SCSI_REQ_Q *)); static void adw_async_callback __P((ADW_SOFTC *, u_int8_t));
int adw_scsi_cmd __P((struct scsi_xfer *)); int adw_build_req __P((struct scsi_xfer *, ADW_CCB *, int)); void adw_build_sglist __P((ADW_CCB *, ADW_SCSI_REQ_Q *, ADW_SG_BLOCK *)); void adw_minphys __P((struct buf *)); void adw_isr_callback __P((ADW_SOFTC *, ADW_SCSI_REQ_Q *)); void adw_async_callback __P((ADW_SOFTC *, u_int8_t));
static struct scsi_xfer *adw_dequeue __P((ADW_SOFTC *));static int adw_alloc_controls __P((ADW_SOFTC *));static int adw_alloc_carriers __P((ADW_SOFTC *));static int adw_create_ccbs __P((ADW_SOFTC *, ADW_CCB *, int));static void adw_free_ccb __P((ADW_SOFTC *, ADW_CCB *));static void adw_reset_ccb __P((ADW_CCB *));static int adw_init_ccb __P((ADW_SOFTC *, ADW_CCB *));static ADW_CCB *adw_get_ccb __P((ADW_SOFTC *, int));static int adw_queue_ccb __P((ADW_SOFTC *, ADW_CCB *, int));static int adw_scsi_cmd __P((struct scsi_xfer *));static int adw_build_req __P((struct scsi_xfer *, ADW_CCB *, int));static void adw_build_sglist __P((ADW_CCB *, ADW_SCSI_REQ_Q *, ADW_SG_BLOCK *));static void adwminphys __P((struct buf *));static void adw_isr_callback __P((ADW_SOFTC *, ADW_SCSI_REQ_Q *));static void adw_async_callback __P((ADW_SOFTC *, u_int8_t));static void adw_print_info __P((ADW_SOFTC *, int));static int adw_poll __P((ADW_SOFTC *, struct scsi_xfer *, int));static void adw_timeout __P((void *));static void adw_reset_bus __P((ADW_SOFTC *));/******************************************************************************/struct cfdriver adw_cd = {	NULL, "adw", DV_DULL};/* the below structure is so we have a default dev struct for our link struct */struct scsi_device adw_dev ={	NULL,			/* Use default error handler */	NULL,			/* have a queue, served by this */	NULL,			/* have no async handler */	NULL,			/* Use default 'done' routine */};/******************************************************************************//* scsi_xfer queue routines                                                   *//******************************************************************************//* * Insert a scsi_xfer into the software queue.  We overload xs->free_list * to avoid having to allocate additional resources (since we're used * only during resource shortages anyhow. */static voidadw_enqueue(sc, xs, infront)	ADW_SOFTC      *sc;	struct scsi_xfer *xs;	int             infront;{	if (infront || sc->sc_queue.lh_first == NULL) {		if (sc->sc_queue.lh_first == NULL)			sc->sc_queuelast = xs;		LIST_INSERT_HEAD(&sc->sc_queue, xs, free_list);		return;	}	LIST_INSERT_AFTER(sc->sc_queuelast, xs, free_list);	sc->sc_queuelast = xs;}/* * Pull a scsi_xfer off the front of the software queue. */static struct scsi_xfer *adw_dequeue(sc)	ADW_SOFTC      *sc;{	struct scsi_xfer *xs;	xs = sc->sc_queue.lh_first;	LIST_REMOVE(xs, free_list);	if (sc->sc_queue.lh_first == NULL)		sc->sc_queuelast = NULL;	return (xs);}