sc->sc_link.openings = AAC_ADAP_NORM_CMD_ENTRIES;
sc->sc_link.openings = AAC_ADAP_NORM_CMD_ENTRIES / 4;
aac_attach(sc)	struct aac_softc *sc;{	int i, error;	bus_dma_segment_t seg;	int nsegs;	struct aac_ccb *ccb;	TAILQ_INIT(&sc->sc_free_ccb);	TAILQ_INIT(&sc->sc_ccbq);	TAILQ_INIT(&sc->sc_completed);	LIST_INIT(&sc->sc_queue);	/* disable interrupts before we enable anything */	AAC_MASK_INTERRUPTS(sc);	/* mark controller as suspended until we get ourselves organised */	sc->sc_state |= AAC_STATE_SUSPEND;	/*	 * Initialise the adapter.	 */	error = aac_init(sc);	if (error)		return (error);	/* 	 * Print a little information about the controller.	 */	aac_describe_controller(sc);	/* Initialize the ccbs */	for (i = 0; i < AAC_ADAP_NORM_CMD_ENTRIES; i++) {		ccb = &sc->sc_ccbs[i];		error = bus_dmamap_create(sc->sc_dmat,		    (AAC_MAXSGENTRIES - 1) << PGSHIFT, AAC_MAXSGENTRIES,		    (AAC_MAXSGENTRIES - 1) << PGSHIFT, 0,		    BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, &ccb->ac_dmamap_xfer);		if (error) {			printf("%s: cannot create ccb dmamap (%d)",			    sc->sc_dev.dv_xname, error);			/* XXX cleanup */			return (1);		}		/* allocate the FIB cluster in DMAable memory and load it */		if (bus_dmamem_alloc(sc->sc_dmat, sizeof *ccb->ac_fib, 1, 0,		    &seg, 1, &nsegs, BUS_DMA_NOWAIT)) {			printf("%s: can't allocate FIB structure\n",			    sc->sc_dev.dv_xname);			/* XXX cleanup */			return (1);		}		ccb->ac_fibphys = seg.ds_addr;		if (bus_dmamem_map(sc->sc_dmat, &seg, nsegs,		    sizeof *ccb->ac_fib, (caddr_t *)&ccb->ac_fib, 0)) {			printf("%s: can't map FIB structure\n",			    sc->sc_dev.dv_xname);			/* XXX cleanup */			return (1);		}		TAILQ_INSERT_TAIL(&sc->sc_free_ccb, &sc->sc_ccbs[i],		    ac_chain);	}	/* Fill in the prototype scsi_link. */	sc->sc_link.adapter_softc = sc;	sc->sc_link.adapter = &aac_switch;	sc->sc_link.device = &aac_dev;	sc->sc_link.openings = AAC_ADAP_NORM_CMD_ENTRIES; /* XXX optimal? */	sc->sc_link.adapter_buswidth = AAC_MAX_CONTAINERS;	sc->sc_link.adapter_target = AAC_MAX_CONTAINERS;	config_found(&sc->sc_dev, &sc->sc_link, scsiprint);	return (0);}