bus_dmamap_sync(sc->sc_dmat, pScb->SCB_DataDma, 0, pScb->SCB_BufChars, (pScb->SCB_Flags & SCSI_DATA_IN) ? BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);
iha_scsi_cmd(xs)	struct scsi_xfer *xs;{	struct iha_scsi_req_q *pScb;	struct scsi_link *sc_link = xs->sc_link;	struct iha_softc *sc = sc_link->adapter_softc;	int error;	if ((xs->cmdlen > 12) || (sc_link->target >= IHA_MAX_TARGETS)) {		xs->error = XS_DRIVER_STUFFUP;		return (COMPLETE);	}	pScb = iha_pop_free_scb(sc);	if (pScb == NULL) {		/* XXX - different xs->error/return if		 * SCSI_POLL/_NOSLEEP? */		xs->error = XS_BUSY;		return (TRY_AGAIN_LATER);	}	pScb->SCB_Target = sc_link->target;	pScb->SCB_Lun	 = sc_link->lun;	pScb->SCB_Tcs	 = &sc->HCS_Tcs[pScb->SCB_Target];	pScb->SCB_Flags	 = xs->flags;	pScb->SCB_Ident  = MSG_IDENTIFYFLAG |		(pScb->SCB_Lun & MSG_IDENTIFY_LUNMASK);	if ((xs->cmd->opcode != REQUEST_SENSE)	    && ((pScb->SCB_Flags & SCSI_POLL) == 0))		pScb->SCB_Ident |= MSG_IDENTIFY_DISCFLAG;	pScb->SCB_Xs	 = xs;	pScb->SCB_CDBLen = xs->cmdlen;	bcopy(xs->cmd, &pScb->SCB_CDB, xs->cmdlen);	pScb->SCB_BufCharsLeft = pScb->SCB_BufChars = xs->datalen;	if ((pScb->SCB_Flags & (SCSI_DATA_IN | SCSI_DATA_OUT)) != 0) {#ifdef TFS		if (pScb->SCB_Flags & SCSI_DATA_UIO)			error = bus_dmamap_load_uio(sc->sc_dmat,			    pScb->SCB_DataDma, (struct uio *)xs->data,			    (pScb->SCB_Flags & SCSI_NOSLEEP) ?			    BUS_DMA_NOWAIT : BUS_DMA_WAITOK);		else#endif /* TFS */			error = bus_dmamap_load(sc->sc_dmat, pScb->SCB_DataDma,			    xs->data, pScb->SCB_BufChars, NULL,			    (pScb->SCB_Flags & SCSI_NOSLEEP) ?			    BUS_DMA_NOWAIT : BUS_DMA_WAITOK);		if (error) {			sc_print_addr(xs->sc_link);			if (error == EFBIG)				printf("buffer needs >%d dma segments\n",				    IHA_MAX_SG_ENTRIES);			else				printf("error %d loading buffer dma map\n",				    error);			iha_append_free_scb(sc, pScb); 			xs->error = XS_DRIVER_STUFFUP;			return (COMPLETE);		}		error = iha_setup_sg_list(sc, pScb);		if (error) {			bus_dmamap_unload(sc->sc_dmat, pScb->SCB_DataDma);			xs->error = XS_DRIVER_STUFFUP;			return (COMPLETE);		}		bus_dmamap_sync(sc->sc_dmat, pScb->SCB_DataDma, 			0, pScb->SCB_BufChars,			(pScb->SCB_Flags & SCSI_DATA_IN) ?				BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);	}	/*	 * Always initialize the stimeout structure as it may 	 * contain garbage that confuses timeout_del() later on.	 * But, timeout_add() ONLY if we are not polling.	 */	timeout_set(&xs->stimeout, iha_timeout, pScb);	if ((pScb->SCB_Flags & SCSI_POLL) == 0)		timeout_add(&xs->stimeout, (xs->timeout/1000) * hz);	iha_exec_scb(sc, pScb);	if ((xs->flags & ITSDONE) == 0)		return (SUCCESSFULLY_QUEUED);	else		return (COMPLETE);}