ahd               139 dev/ic/aic79xx.c void		ahd_handle_transmission_error(struct ahd_softc *ahd);
ahd               140 dev/ic/aic79xx.c void		ahd_handle_lqiphase_error(struct ahd_softc *ahd,
ahd               142 dev/ic/aic79xx.c int		ahd_handle_pkt_busfree(struct ahd_softc *ahd,
ahd               144 dev/ic/aic79xx.c int		ahd_handle_nonpkt_busfree(struct ahd_softc *ahd);
ahd               145 dev/ic/aic79xx.c void		ahd_handle_proto_violation(struct ahd_softc *ahd);
ahd               146 dev/ic/aic79xx.c void		ahd_force_renegotiation(struct ahd_softc *ahd,
ahd               150 dev/ic/aic79xx.c 			ahd_alloc_tstate(struct ahd_softc *ahd,
ahd               153 dev/ic/aic79xx.c void		ahd_free_tstate(struct ahd_softc *ahd,
ahd               156 dev/ic/aic79xx.c void		ahd_devlimited_syncrate(struct ahd_softc *ahd,
ahd               161 dev/ic/aic79xx.c void		ahd_update_neg_table(struct ahd_softc *ahd,
ahd               164 dev/ic/aic79xx.c void		ahd_update_pending_scbs(struct ahd_softc *ahd);
ahd               165 dev/ic/aic79xx.c void		ahd_fetch_devinfo(struct ahd_softc *ahd,
ahd               167 dev/ic/aic79xx.c void		ahd_scb_devinfo(struct ahd_softc *ahd,
ahd               170 dev/ic/aic79xx.c void		ahd_setup_initiator_msgout(struct ahd_softc *ahd,
ahd               173 dev/ic/aic79xx.c void		ahd_build_transfer_msg(struct ahd_softc *ahd,
ahd               175 dev/ic/aic79xx.c void		ahd_construct_sdtr(struct ahd_softc *ahd,
ahd               178 dev/ic/aic79xx.c void		ahd_construct_wdtr(struct ahd_softc *ahd,
ahd               181 dev/ic/aic79xx.c void		ahd_construct_ppr(struct ahd_softc *ahd,
ahd               185 dev/ic/aic79xx.c void		ahd_clear_msg_state(struct ahd_softc *ahd);
ahd               186 dev/ic/aic79xx.c void		ahd_handle_message_phase(struct ahd_softc *ahd);
ahd               192 dev/ic/aic79xx.c int		ahd_sent_msg(struct ahd_softc *ahd, ahd_msgtype type,
ahd               194 dev/ic/aic79xx.c int		ahd_parse_msg(struct ahd_softc *ahd,
ahd               196 dev/ic/aic79xx.c int		ahd_handle_msg_reject(struct ahd_softc *ahd,
ahd               198 dev/ic/aic79xx.c void		ahd_handle_ign_wide_residue(struct ahd_softc *ahd,
ahd               200 dev/ic/aic79xx.c void		ahd_reinitialize_dataptrs(struct ahd_softc *ahd);
ahd               201 dev/ic/aic79xx.c void		ahd_handle_devreset(struct ahd_softc *ahd,
ahd               206 dev/ic/aic79xx.c void		ahd_setup_target_msgin(struct ahd_softc *ahd,
ahd               211 dev/ic/aic79xx.c u_int		ahd_sglist_size(struct ahd_softc *ahd);
ahd               212 dev/ic/aic79xx.c u_int		ahd_sglist_allocsize(struct ahd_softc *ahd);
ahd               213 dev/ic/aic79xx.c void		ahd_initialize_hscbs(struct ahd_softc *ahd);
ahd               214 dev/ic/aic79xx.c int		ahd_init_scbdata(struct ahd_softc *ahd);
ahd               216 dev/ic/aic79xx.c void		ahd_fini_scbdata(struct ahd_softc *ahd);
ahd               217 dev/ic/aic79xx.c void		ahd_setup_iocell_workaround(struct ahd_softc *ahd);
ahd               218 dev/ic/aic79xx.c void		ahd_iocell_first_selection(struct ahd_softc *ahd);
ahd               219 dev/ic/aic79xx.c void		ahd_add_col_list(struct ahd_softc *ahd,
ahd               221 dev/ic/aic79xx.c void		ahd_rem_col_list(struct ahd_softc *ahd,
ahd               223 dev/ic/aic79xx.c void		ahd_chip_init(struct ahd_softc *ahd);
ahd               224 dev/ic/aic79xx.c void		ahd_qinfifo_requeue(struct ahd_softc *ahd,
ahd               227 dev/ic/aic79xx.c int		ahd_qinfifo_count(struct ahd_softc *ahd);
ahd               228 dev/ic/aic79xx.c int		ahd_search_scb_list(struct ahd_softc *ahd, int target,
ahd               234 dev/ic/aic79xx.c void		ahd_stitch_tid_list(struct ahd_softc *ahd,
ahd               237 dev/ic/aic79xx.c void		ahd_add_scb_to_free_list(struct ahd_softc *ahd,
ahd               239 dev/ic/aic79xx.c u_int		ahd_rem_wscb(struct ahd_softc *ahd, u_int scbid,
ahd               241 dev/ic/aic79xx.c void		ahd_reset_current_bus(struct ahd_softc *ahd);
ahd               245 dev/ic/aic79xx.c void		ahd_dumpseq(struct ahd_softc *ahd);
ahd               247 dev/ic/aic79xx.c void		ahd_loadseq(struct ahd_softc *ahd);
ahd               248 dev/ic/aic79xx.c int		ahd_check_patch(struct ahd_softc *ahd,
ahd               251 dev/ic/aic79xx.c u_int		ahd_resolve_seqaddr(struct ahd_softc *ahd,
ahd               253 dev/ic/aic79xx.c void		ahd_download_instr(struct ahd_softc *ahd,
ahd               255 dev/ic/aic79xx.c int		ahd_probe_stack_size(struct ahd_softc *ahd);
ahd               256 dev/ic/aic79xx.c int		ahd_scb_active_in_fifo(struct ahd_softc *ahd,
ahd               258 dev/ic/aic79xx.c void		ahd_run_data_fifo(struct ahd_softc *ahd,
ahd               262 dev/ic/aic79xx.c void		ahd_queue_lstate_event(struct ahd_softc *ahd,
ahd               267 dev/ic/aic79xx.c void		ahd_update_scsiid(struct ahd_softc *ahd,
ahd               269 dev/ic/aic79xx.c int		ahd_handle_target_cmd(struct ahd_softc *ahd,
ahd               280 dev/ic/aic79xx.c __inline void	ahd_assert_atn(struct ahd_softc *ahd);
ahd               281 dev/ic/aic79xx.c int	ahd_currently_packetized(struct ahd_softc *ahd);
ahd               282 dev/ic/aic79xx.c int	ahd_set_active_fifo(struct ahd_softc *ahd);
ahd               285 dev/ic/aic79xx.c ahd_assert_atn(struct ahd_softc *ahd)
ahd               287 dev/ic/aic79xx.c 	ahd_outb(ahd, SCSISIGO, ATNO);
ahd               297 dev/ic/aic79xx.c ahd_currently_packetized(struct ahd_softc *ahd)
ahd               302 dev/ic/aic79xx.c 	saved_modes = ahd_save_modes(ahd);
ahd               303 dev/ic/aic79xx.c 	if ((ahd->bugs & AHD_PKTIZED_STATUS_BUG) != 0) {
ahd               309 dev/ic/aic79xx.c 		ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
ahd               310 dev/ic/aic79xx.c 		packetized = ahd_inb(ahd, LQISTATE) != 0;
ahd               312 dev/ic/aic79xx.c 		ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd               313 dev/ic/aic79xx.c 		packetized = ahd_inb(ahd, LQISTAT2) & PACKETIZED;
ahd               315 dev/ic/aic79xx.c 	ahd_restore_modes(ahd, saved_modes);
ahd               320 dev/ic/aic79xx.c ahd_set_active_fifo(struct ahd_softc *ahd)
ahd               324 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
ahd               325 dev/ic/aic79xx.c 	active_fifo = ahd_inb(ahd, DFFSTAT) & CURRFIFO;
ahd               329 dev/ic/aic79xx.c 		ahd_set_modes(ahd, active_fifo, active_fifo);
ahd               341 dev/ic/aic79xx.c ahd_restart(struct ahd_softc *ahd)
ahd               344 dev/ic/aic79xx.c 	ahd_pause(ahd);
ahd               346 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd               349 dev/ic/aic79xx.c 	ahd_clear_msg_state(ahd);
ahd               350 dev/ic/aic79xx.c 	ahd_outb(ahd, SCSISIGO, 0);		/* De-assert BSY */
ahd               351 dev/ic/aic79xx.c 	ahd_outb(ahd, MSG_OUT, MSG_NOOP);	/* No message to send */
ahd               352 dev/ic/aic79xx.c 	ahd_outb(ahd, SXFRCTL1, ahd_inb(ahd, SXFRCTL1) & ~BITBUCKET);
ahd               353 dev/ic/aic79xx.c 	ahd_outb(ahd, SEQINTCTL, 0);
ahd               354 dev/ic/aic79xx.c 	ahd_outb(ahd, LASTPHASE, P_BUSFREE);
ahd               355 dev/ic/aic79xx.c 	ahd_outb(ahd, SEQ_FLAGS, 0);
ahd               356 dev/ic/aic79xx.c 	ahd_outb(ahd, SAVED_SCSIID, 0xFF);
ahd               357 dev/ic/aic79xx.c 	ahd_outb(ahd, SAVED_LUN, 0xFF);
ahd               366 dev/ic/aic79xx.c 	ahd_outb(ahd, TQINPOS, ahd->tqinfifonext);
ahd               369 dev/ic/aic79xx.c 	ahd_outb(ahd, SCSISEQ1,
ahd               370 dev/ic/aic79xx.c 		 ahd_inb(ahd, SCSISEQ_TEMPLATE) & (ENSELI|ENRSELI|ENAUTOATNP));
ahd               371 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_CCHAN, AHD_MODE_CCHAN);
ahd               378 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRINT, CLRSEQINT);
ahd               380 dev/ic/aic79xx.c 	ahd_outb(ahd, SEQCTL0, FASTMODE|SEQRESET);
ahd               381 dev/ic/aic79xx.c 	ahd_unpause(ahd);
ahd               385 dev/ic/aic79xx.c ahd_clear_fifo(struct ahd_softc *ahd, u_int fifo)
ahd               391 dev/ic/aic79xx.c 		printf("%s: Clearing FIFO %d\n", ahd_name(ahd), fifo);
ahd               393 dev/ic/aic79xx.c 	saved_modes = ahd_save_modes(ahd);
ahd               394 dev/ic/aic79xx.c 	ahd_set_modes(ahd, fifo, fifo);
ahd               395 dev/ic/aic79xx.c 	ahd_outb(ahd, DFFSXFRCTL, RSTCHN|CLRSHCNT);
ahd               396 dev/ic/aic79xx.c 	if ((ahd_inb(ahd, SG_STATE) & FETCH_INPROG) != 0)
ahd               397 dev/ic/aic79xx.c 		ahd_outb(ahd, CCSGCTL, CCSGRESET);
ahd               398 dev/ic/aic79xx.c 	ahd_outb(ahd, LONGJMP_ADDR + 1, INVALID_ADDR);
ahd               399 dev/ic/aic79xx.c 	ahd_outb(ahd, SG_STATE, 0);
ahd               400 dev/ic/aic79xx.c 	ahd_restore_modes(ahd, saved_modes);
ahd               409 dev/ic/aic79xx.c ahd_flush_qoutfifo(struct ahd_softc *ahd)
ahd               418 dev/ic/aic79xx.c 	saved_modes = ahd_save_modes(ahd);
ahd               423 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd               424 dev/ic/aic79xx.c 	saved_scbptr = ahd_get_scbptr(ahd);
ahd               425 dev/ic/aic79xx.c 	while ((ahd_inb(ahd, LQISTAT2) & LQIGSAVAIL) != 0) {
ahd               429 dev/ic/aic79xx.c 		scbid = ahd_inw(ahd, GSFIFO);
ahd               430 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scbid);
ahd               433 dev/ic/aic79xx.c 			       ahd_name(ahd), scbid);
ahd               446 dev/ic/aic79xx.c 			ahd_set_modes(ahd, fifo_mode, fifo_mode);
ahd               448 dev/ic/aic79xx.c 			if (ahd_scb_active_in_fifo(ahd, scb) == 0)
ahd               451 dev/ic/aic79xx.c 			ahd_run_data_fifo(ahd, scb);
ahd               470 dev/ic/aic79xx.c 		ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd               471 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, scbid);
ahd               472 dev/ic/aic79xx.c 		if ((ahd_inb_scbram(ahd, SCB_SGPTR) & SG_LIST_NULL) == 0
ahd               473 dev/ic/aic79xx.c 		 && ((ahd_inb_scbram(ahd, SCB_SGPTR) & SG_FULL_RESID) != 0
ahd               474 dev/ic/aic79xx.c 		  || (ahd_inb_scbram(ahd, SCB_RESIDUAL_SGPTR)
ahd               484 dev/ic/aic79xx.c 			ahd_outb(ahd, SCB_SCSI_STATUS, 0);
ahd               485 dev/ic/aic79xx.c 			ahd_outb(ahd, SCB_SGPTR,
ahd               486 dev/ic/aic79xx.c 				 ahd_inb_scbram(ahd, SCB_SGPTR)
ahd               488 dev/ic/aic79xx.c 			ahd_outw(ahd, SCB_TAG, scbid);
ahd               489 dev/ic/aic79xx.c 			ahd_outw(ahd, SCB_NEXT_COMPLETE, SCB_LIST_NULL);
ahd               490 dev/ic/aic79xx.c 			comp_head = ahd_inw(ahd, COMPLETE_DMA_SCB_HEAD);
ahd               492 dev/ic/aic79xx.c 				ahd_outw(ahd, COMPLETE_DMA_SCB_HEAD, scbid);
ahd               493 dev/ic/aic79xx.c 				ahd_outw(ahd, COMPLETE_DMA_SCB_TAIL, scbid);
ahd               497 dev/ic/aic79xx.c 				tail = ahd_inw(ahd, COMPLETE_DMA_SCB_TAIL);
ahd               498 dev/ic/aic79xx.c 				ahd_set_scbptr(ahd, tail);
ahd               499 dev/ic/aic79xx.c 				ahd_outw(ahd, SCB_NEXT_COMPLETE, scbid);
ahd               500 dev/ic/aic79xx.c 				ahd_outw(ahd, COMPLETE_DMA_SCB_TAIL, scbid);
ahd               501 dev/ic/aic79xx.c 				ahd_set_scbptr(ahd, scbid);
ahd               504 dev/ic/aic79xx.c 			ahd_complete_scb(ahd, scb);
ahd               506 dev/ic/aic79xx.c 	ahd_set_scbptr(ahd, saved_scbptr);
ahd               511 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_CCHAN, AHD_MODE_CCHAN);
ahd               517 dev/ic/aic79xx.c 	while (((ccscbctl = ahd_inb(ahd, CCSCBCTL)) & (CCARREN|CCSCBEN)) != 0) {
ahd               534 dev/ic/aic79xx.c 		ahd_outb(ahd, CCSCBCTL, ccscbctl & ~(CCARREN|CCSCBEN));
ahd               540 dev/ic/aic79xx.c 	ahd_run_qoutfifo(ahd);
ahd               542 dev/ic/aic79xx.c 	saved_scbptr = ahd_get_scbptr(ahd);
ahd               547 dev/ic/aic79xx.c 	scbid = ahd_inw(ahd, COMPLETE_DMA_SCB_HEAD);
ahd               552 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, scbid);
ahd               553 dev/ic/aic79xx.c 		next_scbid = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE);
ahd               554 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scbid);
ahd               557 dev/ic/aic79xx.c 			       "SCB %d invalid\n", ahd_name(ahd), scbid);
ahd               562 dev/ic/aic79xx.c 			*hscb_ptr++ = ahd_inb_scbram(ahd, SCB_BASE + i);
ahd               564 dev/ic/aic79xx.c 		ahd_complete_scb(ahd, scb);
ahd               567 dev/ic/aic79xx.c 	ahd_outw(ahd, COMPLETE_DMA_SCB_HEAD, SCB_LIST_NULL);
ahd               568 dev/ic/aic79xx.c 	ahd_outw(ahd, COMPLETE_DMA_SCB_TAIL, SCB_LIST_NULL);
ahd               570 dev/ic/aic79xx.c 	scbid = ahd_inw(ahd, COMPLETE_ON_QFREEZE_HEAD);
ahd               573 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, scbid);
ahd               574 dev/ic/aic79xx.c 		next_scbid = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE);
ahd               575 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scbid);
ahd               578 dev/ic/aic79xx.c 			       ahd_name(ahd), scbid);
ahd               582 dev/ic/aic79xx.c 		ahd_complete_scb(ahd, scb);
ahd               585 dev/ic/aic79xx.c 	ahd_outw(ahd, COMPLETE_ON_QFREEZE_HEAD, SCB_LIST_NULL);
ahd               587 dev/ic/aic79xx.c 	scbid = ahd_inw(ahd, COMPLETE_SCB_HEAD);
ahd               590 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, scbid);
ahd               591 dev/ic/aic79xx.c 		next_scbid = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE);
ahd               592 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scbid);
ahd               595 dev/ic/aic79xx.c 			       ahd_name(ahd), scbid);
ahd               599 dev/ic/aic79xx.c 		ahd_complete_scb(ahd, scb);
ahd               602 dev/ic/aic79xx.c 	ahd_outw(ahd, COMPLETE_SCB_HEAD, SCB_LIST_NULL);
ahd               607 dev/ic/aic79xx.c 	ahd_set_scbptr(ahd, saved_scbptr);
ahd               608 dev/ic/aic79xx.c 	ahd_restore_modes(ahd, saved_modes);
ahd               609 dev/ic/aic79xx.c 	ahd->flags |= AHD_UPDATE_PEND_CMDS;
ahd               617 dev/ic/aic79xx.c ahd_scb_active_in_fifo(struct ahd_softc *ahd, struct scb *scb)
ahd               626 dev/ic/aic79xx.c 	if (ahd_get_scbptr(ahd) != SCB_GET_TAG(scb)
ahd               627 dev/ic/aic79xx.c 	 || ((ahd_inb(ahd, LONGJMP_ADDR+1) & INVALID_ADDR) != 0
ahd               628 dev/ic/aic79xx.c 	  && (ahd_inb(ahd, SEQINTSRC) & (CFG4DATA|SAVEPTRS)) == 0))
ahd               646 dev/ic/aic79xx.c ahd_run_data_fifo(struct ahd_softc *ahd, struct scb *scb)
ahd               650 dev/ic/aic79xx.c 	seqintsrc = ahd_inb(ahd, SEQINTSRC);
ahd               658 dev/ic/aic79xx.c 		sgptr = ahd_inl_scbram(ahd, SCB_SGPTR) & ~SG_FULL_RESID;
ahd               659 dev/ic/aic79xx.c 		ahd_outb(ahd, SCB_SGPTR, sgptr);
ahd               664 dev/ic/aic79xx.c 		datacnt = ahd_inl_scbram(ahd, SCB_DATACNT);
ahd               667 dev/ic/aic79xx.c 			ahd_outb(ahd, SG_STATE, 0);
ahd               669 dev/ic/aic79xx.c 			ahd_outb(ahd, SG_STATE, LOADING_NEEDED);
ahd               670 dev/ic/aic79xx.c 		ahd_outq(ahd, HADDR, ahd_inq_scbram(ahd, SCB_DATAPTR));
ahd               671 dev/ic/aic79xx.c 		ahd_outl(ahd, HCNT, datacnt & AHD_SG_LEN_MASK);
ahd               672 dev/ic/aic79xx.c 		ahd_outb(ahd, SG_CACHE_PRE, sgptr);
ahd               673 dev/ic/aic79xx.c 		ahd_outb(ahd, DFCNTRL, PRELOADEN|SCSIEN|HDMAEN);
ahd               678 dev/ic/aic79xx.c 		ahd_outb(ahd, SCB_RESIDUAL_DATACNT+3, datacnt >> 24);
ahd               679 dev/ic/aic79xx.c 		ahd_outl(ahd, SCB_RESIDUAL_SGPTR, sgptr & SG_PTR_MASK);
ahd               684 dev/ic/aic79xx.c 		ahd_outb(ahd, SCB_FIFO_USE_COUNT,
ahd               685 dev/ic/aic79xx.c 			 ahd_inb_scbram(ahd, SCB_FIFO_USE_COUNT) + 1);
ahd               690 dev/ic/aic79xx.c 		ahd_outw(ahd, LONGJMP_ADDR, 0);
ahd               696 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRSEQINTSRC, CLRCFG4DATA);
ahd               701 dev/ic/aic79xx.c 		if ((ahd_inb(ahd, LONGJMP_ADDR+1)&INVALID_ADDR) != 0) {
ahd               714 dev/ic/aic79xx.c 		if ((ahd_inb(ahd, SG_STATE) & FETCH_INPROG) != 0)
ahd               715 dev/ic/aic79xx.c 			ahd_outb(ahd, CCSGCTL, 0);
ahd               716 dev/ic/aic79xx.c 		ahd_outb(ahd, SG_STATE, 0);
ahd               722 dev/ic/aic79xx.c 		ahd_outb(ahd, DFCNTRL, ahd_inb(ahd, DFCNTRL) | FIFOFLUSH);
ahd               727 dev/ic/aic79xx.c 		sgptr = ahd_inl_scbram(ahd, SCB_RESIDUAL_SGPTR);
ahd               728 dev/ic/aic79xx.c 		resid = ahd_inl(ahd, SHCNT);
ahd               729 dev/ic/aic79xx.c 		resid |= ahd_inb_scbram(ahd, SCB_RESIDUAL_DATACNT+3) << 24;
ahd               730 dev/ic/aic79xx.c 		ahd_outl(ahd, SCB_RESIDUAL_DATACNT, resid);
ahd               731 dev/ic/aic79xx.c 		if ((ahd_inb(ahd, SG_CACHE_SHADOW) & LAST_SEG) == 0) {
ahd               739 dev/ic/aic79xx.c 			if ((ahd_inb(ahd, SG_CACHE_SHADOW) & 0x80) != 0
ahd               743 dev/ic/aic79xx.c 			sgptr |= ahd_inb(ahd, SG_CACHE_SHADOW)
ahd               745 dev/ic/aic79xx.c 			ahd_outl(ahd, SCB_RESIDUAL_SGPTR, sgptr);
ahd               746 dev/ic/aic79xx.c 			ahd_outb(ahd, SCB_RESIDUAL_DATACNT + 3, 0);
ahd               748 dev/ic/aic79xx.c 			ahd_outb(ahd, SCB_RESIDUAL_SGPTR,
ahd               754 dev/ic/aic79xx.c 		ahd_outq(ahd, SCB_DATAPTR, ahd_inq(ahd, SHADDR));
ahd               755 dev/ic/aic79xx.c 		ahd_outl(ahd, SCB_DATACNT, resid);
ahd               756 dev/ic/aic79xx.c 		ahd_outl(ahd, SCB_SGPTR, sgptr);
ahd               757 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRSEQINTSRC, CLRSAVEPTRS);
ahd               758 dev/ic/aic79xx.c 		ahd_outb(ahd, SEQIMODE,
ahd               759 dev/ic/aic79xx.c 			 ahd_inb(ahd, SEQIMODE) | ENSAVEPTRS);
ahd               764 dev/ic/aic79xx.c 		if ((ahd_inb(ahd, DFCNTRL) & DIRECTION) != 0)
ahd               766 dev/ic/aic79xx.c 	} else if ((ahd_inb(ahd, SG_STATE) & LOADING_NEEDED) != 0) {
ahd               777 dev/ic/aic79xx.c 		if ((ahd_inb(ahd, SG_STATE) & FETCH_INPROG) != 0) {
ahd               778 dev/ic/aic79xx.c 			ahd_outb(ahd, CCSGCTL, 0);
ahd               779 dev/ic/aic79xx.c 			ahd_outb(ahd, SG_STATE, LOADING_NEEDED);
ahd               788 dev/ic/aic79xx.c 		if ((ahd_inb(ahd, DFSTATUS) & PRELOAD_AVAIL) != 0
ahd               789 dev/ic/aic79xx.c 		 && (ahd_inb(ahd, DFCNTRL) & HDMAENACK) != 0) {
ahd               795 dev/ic/aic79xx.c 			sgptr = ahd_inl_scbram(ahd, SCB_RESIDUAL_SGPTR);
ahd               797 dev/ic/aic79xx.c 			if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0) {
ahd               800 dev/ic/aic79xx.c 				sg = ahd_sg_bus_to_virt(ahd, scb, sgptr);
ahd               807 dev/ic/aic79xx.c 				sg = ahd_sg_bus_to_virt(ahd, scb, sgptr);
ahd               818 dev/ic/aic79xx.c 			ahd_outb(ahd, SCB_RESIDUAL_DATACNT+3, data_len >> 24);
ahd               819 dev/ic/aic79xx.c 			ahd_outl(ahd, SCB_RESIDUAL_SGPTR, sgptr);
ahd               826 dev/ic/aic79xx.c 				ahd_outb(ahd, SG_STATE, 0);
ahd               828 dev/ic/aic79xx.c 			ahd_outq(ahd, HADDR, data_addr);
ahd               829 dev/ic/aic79xx.c 			ahd_outl(ahd, HCNT, data_len & AHD_SG_LEN_MASK);
ahd               830 dev/ic/aic79xx.c 			ahd_outb(ahd, SG_CACHE_PRE, sgptr & 0xFF);
ahd               835 dev/ic/aic79xx.c 			dfcntrl = ahd_inb(ahd, DFCNTRL)|PRELOADEN|HDMAEN;
ahd               836 dev/ic/aic79xx.c 			if ((ahd->features & AHD_NEW_DFCNTRL_OPTS) != 0) {
ahd               844 dev/ic/aic79xx.c 			ahd_outb(ahd, DFCNTRL, dfcntrl);
ahd               846 dev/ic/aic79xx.c 	} else if ((ahd_inb(ahd, SG_CACHE_SHADOW) & LAST_SEG_DONE) != 0) {
ahd               852 dev/ic/aic79xx.c 		ahd_outb(ahd, SCB_SGPTR,
ahd               853 dev/ic/aic79xx.c 			 ahd_inb_scbram(ahd, SCB_SGPTR) | SG_LIST_NULL);
ahd               855 dev/ic/aic79xx.c 	} else if ((ahd_inb(ahd, DFSTATUS) & FIFOEMP) != 0) {
ahd               862 dev/ic/aic79xx.c 		ahd_outb(ahd, LONGJMP_ADDR + 1, INVALID_ADDR);
ahd               863 dev/ic/aic79xx.c 		ahd_outb(ahd, SCB_FIFO_USE_COUNT,
ahd               864 dev/ic/aic79xx.c 			 ahd_inb_scbram(ahd, SCB_FIFO_USE_COUNT) - 1);
ahd               865 dev/ic/aic79xx.c 		ahd_outb(ahd, DFFSXFRCTL, CLRCHN);
ahd               880 dev/ic/aic79xx.c ahd_run_qoutfifo(struct ahd_softc *ahd)
ahd               886 dev/ic/aic79xx.c 	if ((ahd->flags & AHD_RUNNING_QOUTFIFO) != 0)
ahd               888 dev/ic/aic79xx.c 	ahd->flags |= AHD_RUNNING_QOUTFIFO;
ahd               889 dev/ic/aic79xx.c 	ahd_sync_qoutfifo(ahd, BUS_DMASYNC_POSTREAD);
ahd               891 dev/ic/aic79xx.c 		completion = &ahd->qoutfifo[ahd->qoutfifonext];
ahd               893 dev/ic/aic79xx.c 		if (completion->valid_tag != ahd->qoutfifonext_valid_tag)
ahd               897 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scb_index);
ahd               901 dev/ic/aic79xx.c 			       ahd_name(ahd), scb_index,
ahd               902 dev/ic/aic79xx.c 			       ahd->qoutfifonext);
ahd               903 dev/ic/aic79xx.c 			ahd_dump_card_state(ahd);
ahd               905 dev/ic/aic79xx.c 			ahd_handle_scb_status(ahd, scb);
ahd               907 dev/ic/aic79xx.c 			ahd_done(ahd, scb);
ahd               910 dev/ic/aic79xx.c 		ahd->qoutfifonext = (ahd->qoutfifonext+1) & (AHD_QOUT_SIZE-1);
ahd               911 dev/ic/aic79xx.c 		if (ahd->qoutfifonext == 0)
ahd               912 dev/ic/aic79xx.c 			ahd->qoutfifonext_valid_tag ^= QOUTFIFO_ENTRY_VALID;
ahd               914 dev/ic/aic79xx.c 	ahd->flags &= ~AHD_RUNNING_QOUTFIFO;
ahd               919 dev/ic/aic79xx.c ahd_handle_hwerrint(struct ahd_softc *ahd)
ahd               928 dev/ic/aic79xx.c 	error = ahd_inb(ahd, ERROR);
ahd               932 dev/ic/aic79xx.c 			       ahd_name(ahd), ahd_hard_errors[i].errmesg);
ahd               935 dev/ic/aic79xx.c 	ahd_dump_card_state(ahd);
ahd               939 dev/ic/aic79xx.c 	ahd_abort_scbs(ahd, CAM_TARGET_WILDCARD, ALL_CHANNELS,
ahd               944 dev/ic/aic79xx.c 	ahd_free(ahd);
ahd               948 dev/ic/aic79xx.c ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
ahd               957 dev/ic/aic79xx.c 	seqintcode = ahd_inb(ahd, SEQINTCODE);
ahd               958 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRINT, CLRSEQINT);
ahd               959 dev/ic/aic79xx.c 	if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) {
ahd               966 dev/ic/aic79xx.c 		ahd_unpause(ahd);
ahd               967 dev/ic/aic79xx.c 		while (!ahd_is_paused(ahd))
ahd               969 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRINT, CLRSEQINT);
ahd               971 dev/ic/aic79xx.c 	ahd_update_modes(ahd);
ahd               975 dev/ic/aic79xx.c 		       ahd_name(ahd), seqintcode);
ahd               983 dev/ic/aic79xx.c 		AHD_ASSERT_MODES(ahd, ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK),
ahd               985 dev/ic/aic79xx.c 		scbid = ahd_get_scbptr(ahd);
ahd               986 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scbid);
ahd               995 dev/ic/aic79xx.c 			ahd_outb(ahd, SAVED_SCSIID, scb->hscb->scsiid);
ahd               996 dev/ic/aic79xx.c 			ahd_outb(ahd, SAVED_LUN, scb->hscb->lun);
ahd               997 dev/ic/aic79xx.c 			ahd_outb(ahd, SEQ_FLAGS, 0x0);
ahd               999 dev/ic/aic79xx.c 		if ((ahd_inb(ahd, LQISTAT2) & LQIPHASE_OUTPKT) != 0
ahd              1000 dev/ic/aic79xx.c 		 && (ahd_inb(ahd, SCSISIGO) & ATNO) != 0) {
ahd              1009 dev/ic/aic79xx.c 				       "P0 assertion\n", ahd_name(ahd));
ahd              1014 dev/ic/aic79xx.c 			printf("%s: Entering NONPACK\n", ahd_name(ahd));
ahd              1020 dev/ic/aic79xx.c 		       ahd_name(ahd));
ahd              1021 dev/ic/aic79xx.c 		ahd_dump_card_state(ahd);
ahd              1022 dev/ic/aic79xx.c 		ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
ahd              1029 dev/ic/aic79xx.c 		scbid = ahd_get_scbptr(ahd);
ahd              1030 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scbid);
ahd              1032 dev/ic/aic79xx.c 			ahd_print_path(ahd, scb);
ahd              1034 dev/ic/aic79xx.c 			printf("%s: ", ahd_name(ahd));
ahd              1036 dev/ic/aic79xx.c 		ahd_dump_card_state(ahd);
ahd              1037 dev/ic/aic79xx.c 		ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
ahd              1045 dev/ic/aic79xx.c 		scbid = ahd_get_scbptr(ahd);
ahd              1046 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scbid);
ahd              1048 dev/ic/aic79xx.c 			ahd_dump_card_state(ahd);
ahd              1052 dev/ic/aic79xx.c 		ahd_outq(ahd, HADDR, scb->sense_busaddr);
ahd              1053 dev/ic/aic79xx.c 		ahd_outw(ahd, HCNT, AHD_SENSE_BUFSIZE);
ahd              1054 dev/ic/aic79xx.c 		ahd_outb(ahd, HCNT + 2, 0);
ahd              1055 dev/ic/aic79xx.c 		ahd_outb(ahd, SG_CACHE_PRE, SG_LAST_SEG);
ahd              1056 dev/ic/aic79xx.c 		ahd_outb(ahd, DFCNTRL, PRELOADEN|SCSIEN|HDMAEN);
ahd              1063 dev/ic/aic79xx.c 		bus_phase = ahd_inb(ahd, SCSISIGI) & PHASE_MASK;
ahd              1065 dev/ic/aic79xx.c 		       ahd_name(ahd), bus_phase);
ahd              1075 dev/ic/aic79xx.c 			ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
ahd              1076 dev/ic/aic79xx.c 			printf("%s: Issued Bus Reset.\n", ahd_name(ahd));
ahd              1098 dev/ic/aic79xx.c 			scbid = ahd_get_scbptr(ahd);
ahd              1099 dev/ic/aic79xx.c 			scb = ahd_lookup_scb(ahd, scbid);
ahd              1103 dev/ic/aic79xx.c 				ahd_reset_channel(ahd, 'A',
ahd              1108 dev/ic/aic79xx.c 					    SCB_GET_TARGET(ahd, scb),
ahd              1110 dev/ic/aic79xx.c 					    SCB_GET_CHANNEL(ahd, scb),
ahd              1112 dev/ic/aic79xx.c 			targ_info = ahd_fetch_transinfo(ahd,
ahd              1118 dev/ic/aic79xx.c 			ahd_set_width(ahd, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
ahd              1120 dev/ic/aic79xx.c 			ahd_set_syncrate(ahd, &devinfo, /*period*/0,
ahd              1123 dev/ic/aic79xx.c 			ahd_outb(ahd, SCB_CDB_STORE, 0);
ahd              1124 dev/ic/aic79xx.c 			ahd_outb(ahd, SCB_CDB_STORE+1, 0);
ahd              1125 dev/ic/aic79xx.c 			ahd_outb(ahd, SCB_CDB_STORE+2, 0);
ahd              1126 dev/ic/aic79xx.c 			ahd_outb(ahd, SCB_CDB_STORE+3, 0);
ahd              1127 dev/ic/aic79xx.c 			ahd_outb(ahd, SCB_CDB_STORE+4, 0);
ahd              1128 dev/ic/aic79xx.c 			ahd_outb(ahd, SCB_CDB_STORE+5, 0);
ahd              1129 dev/ic/aic79xx.c 			ahd_outb(ahd, SCB_CDB_LEN, 6);
ahd              1132 dev/ic/aic79xx.c 			ahd_outb(ahd, SCB_CONTROL, scb->hscb->control);
ahd              1133 dev/ic/aic79xx.c 			ahd_outb(ahd, MSG_OUT, HOST_MSG);
ahd              1134 dev/ic/aic79xx.c 			ahd_outb(ahd, SAVED_SCSIID, scb->hscb->scsiid);
ahd              1139 dev/ic/aic79xx.c 			ahd_outb(ahd, SAVED_LUN, 0);
ahd              1140 dev/ic/aic79xx.c 			ahd_outb(ahd, SEQ_FLAGS, 0);
ahd              1141 dev/ic/aic79xx.c 			ahd_assert_atn(ahd);
ahd              1144 dev/ic/aic79xx.c 			ahd_freeze_devq(ahd, scb);
ahd              1152 dev/ic/aic79xx.c 			ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              1153 dev/ic/aic79xx.c 			ahd_outb(ahd, CLRLQOINT1, CLRLQOPHACHGINPKT);
ahd              1154 dev/ic/aic79xx.c 			if ((ahd->bugs & AHD_CLRLQO_AUTOCLR_BUG) != 0) {
ahd              1155 dev/ic/aic79xx.c 				ahd_outb(ahd, CLRLQOINT1, 0);
ahd              1159 dev/ic/aic79xx.c 				ahd_print_path(ahd, scb);
ahd              1176 dev/ic/aic79xx.c 			printf("%s: CFG4OVERRUN mode = %x\n", ahd_name(ahd),
ahd              1177 dev/ic/aic79xx.c 			       ahd_inb(ahd, MODE_PTR));
ahd              1180 dev/ic/aic79xx.c 		scb_index = ahd_get_scbptr(ahd);
ahd              1181 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scb_index);
ahd              1187 dev/ic/aic79xx.c 			ahd_assert_atn(ahd);
ahd              1188 dev/ic/aic79xx.c 			ahd_outb(ahd, MSG_OUT, HOST_MSG);
ahd              1189 dev/ic/aic79xx.c 			ahd->msgout_buf[0] = MSG_ABORT_TASK;
ahd              1190 dev/ic/aic79xx.c 			ahd->msgout_len = 1;
ahd              1191 dev/ic/aic79xx.c 			ahd->msgout_index = 0;
ahd              1192 dev/ic/aic79xx.c 			ahd->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
ahd              1197 dev/ic/aic79xx.c 			ahd_outb(ahd, SCB_CONTROL,
ahd              1198 dev/ic/aic79xx.c 				 ahd_inb_scbram(ahd, SCB_CONTROL)
ahd              1205 dev/ic/aic79xx.c 		ahd_dump_card_state(ahd);
ahd              1214 dev/ic/aic79xx.c 			       ahd_name(ahd), ahd_inb(ahd, DFCNTRL),
ahd              1215 dev/ic/aic79xx.c 			       ahd_inb(ahd, SG_CACHE_SHADOW));
ahd              1218 dev/ic/aic79xx.c 		ahd_reinitialize_dataptrs(ahd);
ahd              1236 dev/ic/aic79xx.c 		ahd_fetch_devinfo(ahd, &devinfo);
ahd              1237 dev/ic/aic79xx.c 		if (ahd->msg_type == MSG_TYPE_NONE) {
ahd              1242 dev/ic/aic79xx.c 			bus_phase = ahd_inb(ahd, SCSISIGI) & PHASE_MASK;
ahd              1251 dev/ic/aic79xx.c 				ahd_dump_card_state(ahd);
ahd              1252 dev/ic/aic79xx.c 				ahd_clear_intstat(ahd);
ahd              1253 dev/ic/aic79xx.c 				ahd_restart(ahd);
ahd              1257 dev/ic/aic79xx.c 			scb_index = ahd_get_scbptr(ahd);
ahd              1258 dev/ic/aic79xx.c 			scb = ahd_lookup_scb(ahd, scb_index);
ahd              1261 dev/ic/aic79xx.c 					ahd_setup_initiator_msgout(ahd,
ahd              1265 dev/ic/aic79xx.c 					ahd->msg_type =
ahd              1267 dev/ic/aic79xx.c 					ahd->msgin_index = 0;
ahd              1273 dev/ic/aic79xx.c 					ahd->msg_type =
ahd              1275 dev/ic/aic79xx.c 					ahd->msgin_index = 0;
ahd              1278 dev/ic/aic79xx.c 					ahd_setup_target_msgin(ahd,
ahd              1285 dev/ic/aic79xx.c 		ahd_handle_message_phase(ahd);
ahd              1291 dev/ic/aic79xx.c 		AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
ahd              1292 dev/ic/aic79xx.c 		ahd_outb(ahd, SCSISEQ0, ahd_inb(ahd, SCSISEQ0) & ~ENSELO);
ahd              1296 dev/ic/aic79xx.c 		       ahd_name(ahd), 'A', ahd_inb(ahd, SELID) >> 4);
ahd              1299 dev/ic/aic79xx.c 		       ahd_inb(ahd, SAVED_SCSIID), ahd_inb(ahd, SAVED_LUN),
ahd              1300 dev/ic/aic79xx.c 		       ahd_inw(ahd, REG0), ahd_inb(ahd, ACCUM));
ahd              1303 dev/ic/aic79xx.c 		       ahd_inb(ahd, SEQ_FLAGS), ahd_get_scbptr(ahd),
ahd              1304 dev/ic/aic79xx.c 		       ahd_find_busy_tcl(ahd,
ahd              1305 dev/ic/aic79xx.c 					 BUILD_TCL(ahd_inb(ahd, SAVED_SCSIID),
ahd              1306 dev/ic/aic79xx.c 						   ahd_inb(ahd, SAVED_LUN))),
ahd              1307 dev/ic/aic79xx.c 		       ahd_inw(ahd, SINDEX));
ahd              1310 dev/ic/aic79xx.c 		       ahd_inb(ahd, SELID), ahd_inb_scbram(ahd, SCB_SCSIID),
ahd              1311 dev/ic/aic79xx.c 		       ahd_inb_scbram(ahd, SCB_LUN),
ahd              1312 dev/ic/aic79xx.c 		       ahd_inb_scbram(ahd, SCB_CONTROL));
ahd              1314 dev/ic/aic79xx.c 		       ahd_inb(ahd, SCSIBUS), ahd_inb(ahd, SCSISIGI));
ahd              1315 dev/ic/aic79xx.c 		printf("SXFRCTL0 == 0x%x\n", ahd_inb(ahd, SXFRCTL0));
ahd              1316 dev/ic/aic79xx.c 		printf("SEQCTL0 == 0x%x\n", ahd_inb(ahd, SEQCTL0));
ahd              1317 dev/ic/aic79xx.c 		ahd_dump_card_state(ahd);
ahd              1318 dev/ic/aic79xx.c 		ahd->msgout_buf[0] = MSG_BUS_DEV_RESET;
ahd              1319 dev/ic/aic79xx.c 		ahd->msgout_len = 1;
ahd              1320 dev/ic/aic79xx.c 		ahd->msgout_index = 0;
ahd              1321 dev/ic/aic79xx.c 		ahd->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
ahd              1322 dev/ic/aic79xx.c 		ahd_outb(ahd, MSG_OUT, HOST_MSG);
ahd              1323 dev/ic/aic79xx.c 		ahd_assert_atn(ahd);
ahd              1328 dev/ic/aic79xx.c 		ahd_handle_proto_violation(ahd);
ahd              1335 dev/ic/aic79xx.c 		ahd_fetch_devinfo(ahd, &devinfo);
ahd              1336 dev/ic/aic79xx.c 		ahd_handle_ign_wide_residue(ahd, &devinfo);
ahd              1343 dev/ic/aic79xx.c 		lastphase = ahd_inb(ahd, LASTPHASE);
ahd              1346 dev/ic/aic79xx.c 		       ahd_name(ahd), 'A',
ahd              1347 dev/ic/aic79xx.c 		       SCSIID_TARGET(ahd, ahd_inb(ahd, SAVED_SCSIID)),
ahd              1348 dev/ic/aic79xx.c 		       lastphase, ahd_inb(ahd, SCSISIGI));
ahd              1355 dev/ic/aic79xx.c 		lastphase = ahd_inb(ahd, LASTPHASE);
ahd              1358 dev/ic/aic79xx.c 		       ahd_name(ahd), 'A',
ahd              1359 dev/ic/aic79xx.c 		       SCSIID_TARGET(ahd, ahd_inb(ahd, SAVED_SCSIID)),
ahd              1360 dev/ic/aic79xx.c 		       lastphase, ahd_inb(ahd, SCSISIGI));
ahd              1361 dev/ic/aic79xx.c 		ahd_restart(ahd);
ahd              1380 dev/ic/aic79xx.c 		scbindex = ahd_get_scbptr(ahd);
ahd              1381 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scbindex);
ahd              1383 dev/ic/aic79xx.c 		lastphase = ahd_inb(ahd, LASTPHASE);
ahd              1385 dev/ic/aic79xx.c 			ahd_print_path(ahd, scb);
ahd              1389 dev/ic/aic79xx.c 			ahd_print_path(ahd, scb);
ahd              1392 dev/ic/aic79xx.c 			       ahd_inb(ahd, SEQ_FLAGS) & DPHASE
ahd              1403 dev/ic/aic79xx.c 		ahd_freeze_devq(ahd, scb);
ahd              1414 dev/ic/aic79xx.c 		ahd_fetch_devinfo(ahd, &devinfo);
ahd              1416 dev/ic/aic79xx.c 		       ahd_name(ahd), devinfo.channel, devinfo.target,
ahd              1418 dev/ic/aic79xx.c 		scbid = ahd_get_scbptr(ahd);
ahd              1419 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scbid);
ahd              1425 dev/ic/aic79xx.c 			ahd_search_qinfifo(ahd, SCB_GET_TARGET(ahd, scb),
ahd              1426 dev/ic/aic79xx.c 					   SCB_GET_CHANNEL(ahd, scb),
ahd              1430 dev/ic/aic79xx.c 		ahd_outb(ahd, SCB_CONTROL,
ahd              1431 dev/ic/aic79xx.c 			 ahd_inb_scbram(ahd, SCB_CONTROL) & ~MK_MESSAGE);
ahd              1439 dev/ic/aic79xx.c 		scbid = ahd_get_scbptr(ahd);
ahd              1440 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scbid);
ahd              1446 dev/ic/aic79xx.c 			ahd_print_path(ahd, scb);
ahd              1459 dev/ic/aic79xx.c 				ahd_abort_scbs(ahd, SCB_GET_TARGET(ahd, scb),
ahd              1469 dev/ic/aic79xx.c 				ahd_scb_devinfo(ahd, &devinfo, scb);
ahd              1471 dev/ic/aic79xx.c 				ahd_handle_devreset(ahd, &devinfo, lun,
ahd              1495 dev/ic/aic79xx.c 		scbid = ahd_get_scbptr(ahd);
ahd              1496 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scbid);
ahd              1502 dev/ic/aic79xx.c 			ahd_print_path(ahd, scb);
ahd              1511 dev/ic/aic79xx.c 			while ((ahd_inb(ahd, SCSISEQ0) & ENSELO) != 0
ahd              1512 dev/ic/aic79xx.c 			    && (ahd_inb(ahd, SSTAT0) & SELDO) == 0
ahd              1513 dev/ic/aic79xx.c 			    && (ahd_inb(ahd, SSTAT1) & SELTO) == 0)
ahd              1515 dev/ic/aic79xx.c 			ahd_outb(ahd, SCB_TASK_MANAGEMENT, 0);
ahd              1516 dev/ic/aic79xx.c 			ahd_search_qinfifo(ahd, SCB_GET_TARGET(ahd, scb),
ahd              1517 dev/ic/aic79xx.c 					   SCB_GET_CHANNEL(ahd, scb),  
ahd              1528 dev/ic/aic79xx.c 		printf("%s: Tracepoint %d\n", ahd_name(ahd),
ahd              1534 dev/ic/aic79xx.c 		ahd_handle_hwerrint(ahd);
ahd              1537 dev/ic/aic79xx.c 		printf("%s: Unexpected SEQINTCODE %d\n", ahd_name(ahd),
ahd              1546 dev/ic/aic79xx.c 	ahd_unpause(ahd);
ahd              1550 dev/ic/aic79xx.c ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat)
ahd              1561 dev/ic/aic79xx.c 	ahd_update_modes(ahd);
ahd              1562 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              1564 dev/ic/aic79xx.c 	status3 = ahd_inb(ahd, SSTAT3) & (NTRAMPERR|OSRAMPERR);
ahd              1565 dev/ic/aic79xx.c 	status0 = ahd_inb(ahd, SSTAT0) & (IOERR|OVERRUN|SELDI|SELDO);
ahd              1566 dev/ic/aic79xx.c 	status = ahd_inb(ahd, SSTAT1) & (SELTO|SCSIRSTI|BUSFREE|SCSIPERR);
ahd              1567 dev/ic/aic79xx.c 	lqistat1 = ahd_inb(ahd, LQISTAT1);
ahd              1568 dev/ic/aic79xx.c 	lqostat0 = ahd_inb(ahd, LQOSTAT0);
ahd              1569 dev/ic/aic79xx.c 	busfreetime = ahd_inb(ahd, SSTAT2) & BUSFREETIME;
ahd              1573 dev/ic/aic79xx.c 		ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
ahd              1574 dev/ic/aic79xx.c 		simode0 = ahd_inb(ahd, SIMODE0);
ahd              1576 dev/ic/aic79xx.c 		ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              1578 dev/ic/aic79xx.c 	scbid = ahd_get_scbptr(ahd);
ahd              1579 dev/ic/aic79xx.c 	scb = ahd_lookup_scb(ahd, scbid);
ahd              1581 dev/ic/aic79xx.c 	 && (ahd_inb(ahd, SEQ_FLAGS) & NOT_IDENTIFIED) != 0)
ahd              1587 dev/ic/aic79xx.c 		now_lvd = ahd_inb(ahd, SBLKCTL) & ENAB40;
ahd              1589 dev/ic/aic79xx.c 		       ahd_name(ahd), now_lvd ? "LVD" : "SE");
ahd              1590 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRSINT0, CLRIOERR);
ahd              1594 dev/ic/aic79xx.c 		ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
ahd              1595 dev/ic/aic79xx.c 		ahd_pause(ahd);
ahd              1596 dev/ic/aic79xx.c 		ahd_setup_iocell_workaround(ahd);
ahd              1597 dev/ic/aic79xx.c 		ahd_unpause(ahd);
ahd              1601 dev/ic/aic79xx.c 		       ahd_name(ahd));
ahd              1602 dev/ic/aic79xx.c 		ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
ahd              1605 dev/ic/aic79xx.c 		printf("%s: Someone reset channel A\n", ahd_name(ahd));
ahd              1606 dev/ic/aic79xx.c 		ahd_reset_channel(ahd, 'A', /*Initiate Reset*/FALSE);
ahd              1610 dev/ic/aic79xx.c 		ahd_clear_critical_section(ahd);
ahd              1612 dev/ic/aic79xx.c 		ahd_handle_transmission_error(ahd);
ahd              1615 dev/ic/aic79xx.c 		printf("%s: lqostat0 == 0x%x!\n", ahd_name(ahd), lqostat0);
ahd              1616 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRLQOINT0, lqostat0);
ahd              1617 dev/ic/aic79xx.c 		if ((ahd->bugs & AHD_CLRLQO_AUTOCLR_BUG) != 0)
ahd              1618 dev/ic/aic79xx.c 			ahd_outb(ahd, CLRLQOINT1, 0);
ahd              1623 dev/ic/aic79xx.c 		ahd_outb(ahd, SCSISEQ0, 0);
ahd              1626 dev/ic/aic79xx.c 		ahd_clear_critical_section(ahd);
ahd              1629 dev/ic/aic79xx.c 		ahd_clear_msg_state(ahd);
ahd              1632 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRSINT1, CLRSELTIMEO|CLRBUSFREE|CLRSCSIPERR);
ahd              1642 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRSINT0, CLRSELINGO);
ahd              1644 dev/ic/aic79xx.c 		scbid = ahd_inw(ahd, WAITING_TID_HEAD);
ahd              1645 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scbid);
ahd              1649 dev/ic/aic79xx.c 			       ahd_name(ahd), scbid);
ahd              1650 dev/ic/aic79xx.c 			ahd_dump_card_state(ahd);
ahd              1655 dev/ic/aic79xx.c 				ahd_print_path(ahd, scb);
ahd              1660 dev/ic/aic79xx.c 			ahd_scb_devinfo(ahd, &devinfo, scb);
ahd              1662 dev/ic/aic79xx.c 			ahd_freeze_devq(ahd, scb);
ahd              1670 dev/ic/aic79xx.c 			ahd_handle_devreset(ahd, &devinfo,
ahd              1676 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRINT, CLRSCSIINT);
ahd              1677 dev/ic/aic79xx.c 		ahd_iocell_first_selection(ahd);
ahd              1678 dev/ic/aic79xx.c 		ahd_unpause(ahd);
ahd              1681 dev/ic/aic79xx.c 		ahd_iocell_first_selection(ahd);
ahd              1682 dev/ic/aic79xx.c 		ahd_unpause(ahd);
ahd              1685 dev/ic/aic79xx.c 		       ahd_name(ahd), status3);
ahd              1686 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRSINT3, status3);
ahd              1690 dev/ic/aic79xx.c 		ahd_clear_critical_section(ahd);
ahd              1692 dev/ic/aic79xx.c 		ahd_handle_lqiphase_error(ahd, lqistat1);
ahd              1700 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRLQIINT1, CLRLQICRCI_NLQ);
ahd              1715 dev/ic/aic79xx.c 		ahd_outb(ahd, SCSISEQ0, 0);
ahd              1718 dev/ic/aic79xx.c 		ahd_clear_critical_section(ahd);
ahd              1725 dev/ic/aic79xx.c 		busfreetime = ahd_inb(ahd, SSTAT2) & BUSFREETIME;
ahd              1726 dev/ic/aic79xx.c 		lqostat1 = ahd_inb(ahd, LQOSTAT1);
ahd              1736 dev/ic/aic79xx.c 			ahd_set_modes(ahd, mode, mode);
ahd              1737 dev/ic/aic79xx.c 			scbid = ahd_get_scbptr(ahd);
ahd              1738 dev/ic/aic79xx.c 			scb = ahd_lookup_scb(ahd, scbid);
ahd              1742 dev/ic/aic79xx.c 				       ahd_name(ahd), scbid, mode);
ahd              1757 dev/ic/aic79xx.c 			 && ahd_inb(ahd, LASTPHASE) == P_BUSFREE
ahd              1758 dev/ic/aic79xx.c 			 && (ahd_inb(ahd, SSTAT0) & SELDI) == 0
ahd              1759 dev/ic/aic79xx.c 			 && ((ahd_inb(ahd, SSTAT0) & SELDO) == 0
ahd              1760 dev/ic/aic79xx.c 			  || (ahd_inb(ahd, SCSISEQ0) & ENSELO) == 0))
ahd              1780 dev/ic/aic79xx.c 		if (packetized && ahd_inb(ahd, LASTPHASE) == P_BUSFREE) {
ahd              1781 dev/ic/aic79xx.c 			restart = ahd_handle_pkt_busfree(ahd, busfreetime);
ahd              1784 dev/ic/aic79xx.c 			restart = ahd_handle_nonpkt_busfree(ahd);
ahd              1797 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRSINT1, CLRBUSFREE);
ahd              1799 dev/ic/aic79xx.c 		 && (ahd->bugs & AHD_BUSFREEREV_BUG) != 0)
ahd              1800 dev/ic/aic79xx.c 			ahd_outb(ahd, SIMODE1,
ahd              1801 dev/ic/aic79xx.c 				 ahd_inb(ahd, SIMODE1) & ~ENBUSFREE);
ahd              1804 dev/ic/aic79xx.c 			ahd_clear_fifo(ahd, mode);
ahd              1806 dev/ic/aic79xx.c 		ahd_clear_msg_state(ahd);
ahd              1807 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRINT, CLRSCSIINT);
ahd              1809 dev/ic/aic79xx.c 			ahd_restart(ahd);
ahd              1811 dev/ic/aic79xx.c 			ahd_unpause(ahd);
ahd              1815 dev/ic/aic79xx.c 		       ahd_name(ahd), status);
ahd              1816 dev/ic/aic79xx.c 		ahd_dump_card_state(ahd);
ahd              1817 dev/ic/aic79xx.c 		ahd_clear_intstat(ahd);
ahd              1818 dev/ic/aic79xx.c 		ahd_unpause(ahd);
ahd              1823 dev/ic/aic79xx.c ahd_handle_transmission_error(struct ahd_softc *ahd)
ahd              1837 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              1838 dev/ic/aic79xx.c 	lqistat1 = ahd_inb(ahd, LQISTAT1) & ~(LQIPHASE_LQ|LQIPHASE_NLQ);
ahd              1839 dev/ic/aic79xx.c 	lqistat2 = ahd_inb(ahd, LQISTAT2);
ahd              1841 dev/ic/aic79xx.c 	 && (ahd->bugs & AHD_NLQICRC_DELAYED_BUG) != 0) {
ahd              1844 dev/ic/aic79xx.c 		ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
ahd              1845 dev/ic/aic79xx.c 		lqistate = ahd_inb(ahd, LQISTATE);
ahd              1851 dev/ic/aic79xx.c 				       ahd_name(ahd));
ahd              1856 dev/ic/aic79xx.c 		ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              1859 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRLQIINT1, lqistat1);
ahd              1860 dev/ic/aic79xx.c 	lastphase = ahd_inb(ahd, LASTPHASE);
ahd              1861 dev/ic/aic79xx.c 	curphase = ahd_inb(ahd, SCSISIGI) & PHASE_MASK;
ahd              1862 dev/ic/aic79xx.c 	perrdiag = ahd_inb(ahd, PERRDIAG);
ahd              1864 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRSINT1, CLRSCSIPERR);
ahd              1873 dev/ic/aic79xx.c 			ahd_set_active_fifo(ahd);
ahd              1874 dev/ic/aic79xx.c 		scbid = ahd_get_scbptr(ahd);
ahd              1875 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scbid);
ahd              1882 dev/ic/aic79xx.c 		printf("%s: Transmission error detected\n", ahd_name(ahd));
ahd              1888 dev/ic/aic79xx.c 		ahd_dump_card_state(ahd);
ahd              1895 dev/ic/aic79xx.c 			       ahd_name(ahd), lqistat1);
ahd              1897 dev/ic/aic79xx.c 		ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
ahd              1921 dev/ic/aic79xx.c 		ahd_outb(ahd, LQCTL2, LQIRETRY);
ahd              1973 dev/ic/aic79xx.c 			       "Resetting bus\n", ahd_name(ahd));
ahd              1974 dev/ic/aic79xx.c 			ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
ahd              1979 dev/ic/aic79xx.c 		ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
ahd              1987 dev/ic/aic79xx.c 			ahd_inb(ahd, SCSIDAT);
ahd              2001 dev/ic/aic79xx.c 	ahd->send_msg_perror = msg_out;
ahd              2004 dev/ic/aic79xx.c 	ahd_outb(ahd, MSG_OUT, HOST_MSG);
ahd              2005 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRINT, CLRSCSIINT);
ahd              2006 dev/ic/aic79xx.c 	ahd_unpause(ahd);
ahd              2010 dev/ic/aic79xx.c ahd_handle_lqiphase_error(struct ahd_softc *ahd, u_int lqistat1)
ahd              2015 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              2016 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRLQIINT1, lqistat1);
ahd              2026 dev/ic/aic79xx.c 	ahd_set_active_fifo(ahd);
ahd              2027 dev/ic/aic79xx.c 	if ((ahd_inb(ahd, SCSISIGO) & ATNO) != 0
ahd              2028 dev/ic/aic79xx.c 	 && (ahd_inb(ahd, MDFFSTAT) & DLZERO) != 0) {
ahd              2031 dev/ic/aic79xx.c 			ahd_outb(ahd, LQCTL2, LQIRETRY);
ahd              2034 dev/ic/aic79xx.c 			ahd_outb(ahd, LQCTL2, LQIRETRY);
ahd              2037 dev/ic/aic79xx.c 		ahd_dump_card_state(ahd);
ahd              2038 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRINT, CLRSCSIINT);
ahd              2039 dev/ic/aic79xx.c 		ahd_unpause(ahd);
ahd              2042 dev/ic/aic79xx.c 		ahd_dump_card_state(ahd);
ahd              2043 dev/ic/aic79xx.c 		ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
ahd              2052 dev/ic/aic79xx.c ahd_handle_pkt_busfree(struct ahd_softc *ahd, u_int busfreetime)
ahd              2056 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK),
ahd              2058 dev/ic/aic79xx.c 	lqostat1 = ahd_inb(ahd, LQOSTAT1);
ahd              2082 dev/ic/aic79xx.c 		ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              2083 dev/ic/aic79xx.c 		scbid = ahd_inw(ahd, CURRSCB);
ahd              2084 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scbid);
ahd              2090 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRLQOINT1, CLRLQOBUSFREE);
ahd              2091 dev/ic/aic79xx.c 		if ((ahd->bugs & AHD_CLRLQO_AUTOCLR_BUG) != 0)
ahd              2092 dev/ic/aic79xx.c 			ahd_outb(ahd, CLRLQOINT1, 0);
ahd              2093 dev/ic/aic79xx.c 		ahd_outb(ahd, SCSISEQ0, ahd_inb(ahd, SCSISEQ0) & ~ENSELO);
ahd              2094 dev/ic/aic79xx.c 		ahd_flush_device_writes(ahd);
ahd              2095 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRSINT0, CLRSELDO);
ahd              2103 dev/ic/aic79xx.c 		ahd_outb(ahd, LQCTL2, ahd_inb(ahd, LQCTL2) | LQOTOIDLE);
ahd              2109 dev/ic/aic79xx.c 		waiting_h = ahd_inw(ahd, WAITING_TID_HEAD);
ahd              2110 dev/ic/aic79xx.c 		saved_scbptr = ahd_get_scbptr(ahd);
ahd              2113 dev/ic/aic79xx.c 			ahd_outw(ahd, WAITING_TID_HEAD, scbid);
ahd              2114 dev/ic/aic79xx.c 			waiting_t = ahd_inw(ahd, WAITING_TID_TAIL);
ahd              2116 dev/ic/aic79xx.c 				ahd_outw(ahd, WAITING_TID_TAIL, scbid);
ahd              2119 dev/ic/aic79xx.c 				ahd_set_scbptr(ahd, waiting_h);
ahd              2120 dev/ic/aic79xx.c 				next = ahd_inw_scbram(ahd, SCB_NEXT2);
ahd              2122 dev/ic/aic79xx.c 			ahd_set_scbptr(ahd, scbid);
ahd              2123 dev/ic/aic79xx.c 			ahd_outw(ahd, SCB_NEXT2, next);
ahd              2125 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, saved_scbptr);
ahd              2128 dev/ic/aic79xx.c 				ahd_print_path(ahd, scb);
ahd              2136 dev/ic/aic79xx.c 			ahd_freeze_devq(ahd, scb);
ahd              2140 dev/ic/aic79xx.c 	} else if ((ahd_inb(ahd, PERRDIAG) & PARITYERR) != 0) {
ahd              2148 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRSINT1, CLRSCSIPERR|CLRBUSFREE);
ahd              2153 dev/ic/aic79xx.c 			       ahd_name(ahd));
ahd              2158 dev/ic/aic79xx.c 	if (ahd->src_mode != AHD_MODE_SCSI) {
ahd              2162 dev/ic/aic79xx.c 		scbid = ahd_get_scbptr(ahd);
ahd              2163 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scbid);
ahd              2164 dev/ic/aic79xx.c 		ahd_print_path(ahd, scb);
ahd              2166 dev/ic/aic79xx.c 		ahd_dump_card_state(ahd);
ahd              2167 dev/ic/aic79xx.c 		ahd_abort_scbs(ahd, SCB_GET_TARGET(ahd, scb), 'A',
ahd              2174 dev/ic/aic79xx.c 	printf("%s: Unexpected PKT busfree condition\n", ahd_name(ahd));
ahd              2175 dev/ic/aic79xx.c 	ahd_dump_card_state(ahd);
ahd              2184 dev/ic/aic79xx.c ahd_handle_nonpkt_busfree(struct ahd_softc *ahd)
ahd              2202 dev/ic/aic79xx.c 	lastphase = ahd_inb(ahd, LASTPHASE);
ahd              2203 dev/ic/aic79xx.c 	saved_scsiid = ahd_inb(ahd, SAVED_SCSIID);
ahd              2204 dev/ic/aic79xx.c 	saved_lun = ahd_inb(ahd, SAVED_LUN);
ahd              2205 dev/ic/aic79xx.c 	target = SCSIID_TARGET(ahd, saved_scsiid);
ahd              2211 dev/ic/aic79xx.c 	scbid = ahd_get_scbptr(ahd);
ahd              2212 dev/ic/aic79xx.c 	scb = ahd_lookup_scb(ahd, scbid);
ahd              2214 dev/ic/aic79xx.c 	 && (ahd_inb(ahd, SEQ_FLAGS) & NOT_IDENTIFIED) != 0)
ahd              2217 dev/ic/aic79xx.c 	ppr_busfree = (ahd->msg_flags & MSG_FLAG_EXPECT_PPR_BUSFREE) != 0;
ahd              2222 dev/ic/aic79xx.c 		if (ahd_sent_msg(ahd, AHDMSG_1B, MSG_ABORT_TAG, TRUE)
ahd              2223 dev/ic/aic79xx.c 		 || ahd_sent_msg(ahd, AHDMSG_1B, MSG_ABORT, TRUE)) {
ahd              2228 dev/ic/aic79xx.c 				ahd_print_devinfo(ahd, &devinfo);
ahd              2234 dev/ic/aic79xx.c 			sent_msg = ahd->msgout_buf[ahd->msgout_index - 1];
ahd              2235 dev/ic/aic79xx.c 			ahd_print_path(ahd, scb);
ahd              2259 dev/ic/aic79xx.c 			found = ahd_abort_scbs(ahd, target, 'A', saved_lun,
ahd              2264 dev/ic/aic79xx.c 		} else if (ahd_sent_msg(ahd, AHDMSG_1B,
ahd              2274 dev/ic/aic79xx.c 			 && ahd_match_scb(ahd, scb, target, 'A',
ahd              2279 dev/ic/aic79xx.c 			ahd_handle_devreset(ahd, &devinfo, CAM_LUN_WILDCARD,
ahd              2283 dev/ic/aic79xx.c 		} else if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_PPR, FALSE)
ahd              2302 dev/ic/aic79xx.c 			tinfo = ahd_fetch_transinfo(ahd, devinfo.channel,
ahd              2306 dev/ic/aic79xx.c 				ahd_set_width(ahd, &devinfo,
ahd              2310 dev/ic/aic79xx.c 				ahd_set_syncrate(ahd, &devinfo,
ahd              2329 dev/ic/aic79xx.c 				ahd_freeze_devq(ahd, scb);
ahd              2330 dev/ic/aic79xx.c 				ahd_qinfifo_requeue_tail(ahd, scb);
ahd              2333 dev/ic/aic79xx.c 		} else if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_WDTR, FALSE)
ahd              2343 dev/ic/aic79xx.c 			ahd_set_width(ahd, &devinfo,
ahd              2352 dev/ic/aic79xx.c 			ahd_freeze_devq(ahd, scb);
ahd              2353 dev/ic/aic79xx.c 			ahd_qinfifo_requeue_tail(ahd, scb);
ahd              2355 dev/ic/aic79xx.c 		} else if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_SDTR, FALSE)
ahd              2365 dev/ic/aic79xx.c 			ahd_set_syncrate(ahd, &devinfo,
ahd              2375 dev/ic/aic79xx.c 			ahd_freeze_devq(ahd, scb);
ahd              2376 dev/ic/aic79xx.c 			ahd_qinfifo_requeue_tail(ahd, scb);
ahd              2378 dev/ic/aic79xx.c 		} else if ((ahd->msg_flags & MSG_FLAG_EXPECT_IDE_BUSFREE) != 0
ahd              2379 dev/ic/aic79xx.c 			&& ahd_sent_msg(ahd, AHDMSG_1B,
ahd              2387 dev/ic/aic79xx.c 		} else if ((ahd->msg_flags & MSG_FLAG_EXPECT_QASREJ_BUSFREE)
ahd              2388 dev/ic/aic79xx.c 			&& ahd_sent_msg(ahd, AHDMSG_1B,
ahd              2406 dev/ic/aic79xx.c 	 && ((ahd->msg_flags & MSG_FLAG_EXPECT_PPR_BUSFREE) != 0)) {
ahd              2408 dev/ic/aic79xx.c 		ahd_freeze_devq(ahd, scb);
ahd              2411 dev/ic/aic79xx.c 		if ((ahd->msg_flags & MSG_FLAG_IU_REQ_CHANGED) != 0) {
ahd              2412 dev/ic/aic79xx.c 			ahd_abort_scbs(ahd, SCB_GET_TARGET(ahd, scb),
ahd              2413 dev/ic/aic79xx.c 				       SCB_GET_CHANNEL(ahd, scb),
ahd              2421 dev/ic/aic79xx.c 			ahd_done(ahd, scb);
ahd              2436 dev/ic/aic79xx.c 			ahd_print_path(ahd, scb);
ahd              2437 dev/ic/aic79xx.c 			aborted = ahd_abort_scbs(ahd, target, 'A',
ahd              2446 dev/ic/aic79xx.c 			printf("%s: ", ahd_name(ahd));
ahd              2452 dev/ic/aic79xx.c 		       ahd_inw(ahd, PRGMCNT));
ahd              2453 dev/ic/aic79xx.c 		ahd_dump_card_state(ahd);
ahd              2455 dev/ic/aic79xx.c 			ahd_force_renegotiation(ahd, &devinfo);
ahd              2462 dev/ic/aic79xx.c ahd_handle_proto_violation(struct ahd_softc *ahd)
ahd              2472 dev/ic/aic79xx.c 	ahd_fetch_devinfo(ahd, &devinfo);
ahd              2473 dev/ic/aic79xx.c 	scbid = ahd_get_scbptr(ahd);
ahd              2474 dev/ic/aic79xx.c 	scb = ahd_lookup_scb(ahd, scbid);
ahd              2475 dev/ic/aic79xx.c 	seq_flags = ahd_inb(ahd, SEQ_FLAGS);
ahd              2476 dev/ic/aic79xx.c 	curphase = ahd_inb(ahd, SCSISIGI) & PHASE_MASK;
ahd              2477 dev/ic/aic79xx.c 	lastphase = ahd_inb(ahd, LASTPHASE);
ahd              2485 dev/ic/aic79xx.c 		ahd_print_devinfo(ahd, &devinfo);
ahd              2494 dev/ic/aic79xx.c 		ahd_print_devinfo(ahd, &devinfo);
ahd              2500 dev/ic/aic79xx.c 			ahd_print_path(ahd, scb);
ahd              2502 dev/ic/aic79xx.c 		} else if ((ahd_inb_scbram(ahd, SCB_CONTROL)
ahd              2511 dev/ic/aic79xx.c 			ahd_print_path(ahd, scb);
ahd              2514 dev/ic/aic79xx.c 			ahd_print_path(ahd, scb);
ahd              2516 dev/ic/aic79xx.c 			ahd_dump_card_state(ahd);
ahd              2528 dev/ic/aic79xx.c 		found = ahd_reset_channel(ahd, 'A', TRUE);
ahd              2530 dev/ic/aic79xx.c 		       "%d SCBs aborted\n", ahd_name(ahd), 'A', found);
ahd              2537 dev/ic/aic79xx.c 		ahd_outb(ahd, SCSISEQ0,
ahd              2538 dev/ic/aic79xx.c 			 ahd_inb(ahd, SCSISEQ0) & ~ENSELO);
ahd              2539 dev/ic/aic79xx.c 		ahd_assert_atn(ahd);
ahd              2540 dev/ic/aic79xx.c 		ahd_outb(ahd, MSG_OUT, HOST_MSG);
ahd              2542 dev/ic/aic79xx.c 			ahd_print_devinfo(ahd, &devinfo);
ahd              2543 dev/ic/aic79xx.c 			ahd->msgout_buf[0] = MSG_ABORT_TASK;
ahd              2544 dev/ic/aic79xx.c 			ahd->msgout_len = 1;
ahd              2545 dev/ic/aic79xx.c 			ahd->msgout_index = 0;
ahd              2546 dev/ic/aic79xx.c 			ahd->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
ahd              2548 dev/ic/aic79xx.c 			ahd_print_path(ahd, scb);
ahd              2561 dev/ic/aic79xx.c ahd_force_renegotiation(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
ahd              2568 dev/ic/aic79xx.c 		ahd_print_devinfo(ahd, devinfo);
ahd              2572 dev/ic/aic79xx.c 	targ_info = ahd_fetch_transinfo(ahd,
ahd              2577 dev/ic/aic79xx.c 	ahd_update_neg_request(ahd, devinfo, tstate,
ahd              2583 dev/ic/aic79xx.c ahd_clear_critical_section(struct ahd_softc *ahd)
ahd              2597 dev/ic/aic79xx.c 	if (ahd->num_critical_sections == 0)
ahd              2610 dev/ic/aic79xx.c 	saved_modes = ahd_save_modes(ahd);
ahd              2616 dev/ic/aic79xx.c 		ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              2617 dev/ic/aic79xx.c 		seqaddr = ahd_inw(ahd, CURADDR);
ahd              2619 dev/ic/aic79xx.c 		cs = ahd->critical_sections;
ahd              2620 dev/ic/aic79xx.c 		for (i = 0; i < ahd->num_critical_sections; i++, cs++) {
ahd              2626 dev/ic/aic79xx.c 		if (i == ahd->num_critical_sections)
ahd              2632 dev/ic/aic79xx.c 			       ahd_name(ahd), ahd_name(ahd), first_instr,
ahd              2634 dev/ic/aic79xx.c 			ahd_dump_card_state(ahd);
ahd              2641 dev/ic/aic79xx.c 			printf("%s: Single stepping at 0x%x\n", ahd_name(ahd),
ahd              2647 dev/ic/aic79xx.c   			ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
ahd              2648 dev/ic/aic79xx.c   			simode0 = ahd_inb(ahd, SIMODE0);
ahd              2649 dev/ic/aic79xx.c 			simode3 = ahd_inb(ahd, SIMODE3);
ahd              2650 dev/ic/aic79xx.c 			lqimode0 = ahd_inb(ahd, LQIMODE0);
ahd              2651 dev/ic/aic79xx.c 			lqimode1 = ahd_inb(ahd, LQIMODE1);
ahd              2652 dev/ic/aic79xx.c 			lqomode0 = ahd_inb(ahd, LQOMODE0);
ahd              2653 dev/ic/aic79xx.c 			lqomode1 = ahd_inb(ahd, LQOMODE1);
ahd              2654 dev/ic/aic79xx.c 			ahd_outb(ahd, SIMODE0, 0);
ahd              2655 dev/ic/aic79xx.c 			ahd_outb(ahd, SIMODE3, 0);
ahd              2656 dev/ic/aic79xx.c 			ahd_outb(ahd, LQIMODE0, 0);
ahd              2657 dev/ic/aic79xx.c 			ahd_outb(ahd, LQIMODE1, 0);
ahd              2658 dev/ic/aic79xx.c 			ahd_outb(ahd, LQOMODE0, 0);
ahd              2659 dev/ic/aic79xx.c 			ahd_outb(ahd, LQOMODE1, 0);
ahd              2660 dev/ic/aic79xx.c 			ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              2661 dev/ic/aic79xx.c 			simode1 = ahd_inb(ahd, SIMODE1);
ahd              2668 dev/ic/aic79xx.c 			ahd_outb(ahd, SIMODE1, simode1 & ENBUSFREE);
ahd              2669 dev/ic/aic79xx.c 			ahd_outb(ahd, SEQCTL0, ahd_inb(ahd, SEQCTL0) | STEP);
ahd              2672 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRSINT1, CLRBUSFREE);
ahd              2673 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRINT, CLRSCSIINT);
ahd              2674 dev/ic/aic79xx.c 		ahd_set_modes(ahd, ahd->saved_src_mode, ahd->saved_dst_mode);
ahd              2675 dev/ic/aic79xx.c 		ahd_outb(ahd, HCNTRL, ahd->unpause);
ahd              2676 dev/ic/aic79xx.c 		while (!ahd_is_paused(ahd))
ahd              2678 dev/ic/aic79xx.c 		ahd_update_modes(ahd);
ahd              2681 dev/ic/aic79xx.c 		ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
ahd              2682 dev/ic/aic79xx.c 		ahd_outb(ahd, SIMODE0, simode0);
ahd              2683 dev/ic/aic79xx.c 		ahd_outb(ahd, SIMODE3, simode3);
ahd              2684 dev/ic/aic79xx.c 		ahd_outb(ahd, LQIMODE0, lqimode0);
ahd              2685 dev/ic/aic79xx.c 		ahd_outb(ahd, LQIMODE1, lqimode1);
ahd              2686 dev/ic/aic79xx.c 		ahd_outb(ahd, LQOMODE0, lqomode0);
ahd              2687 dev/ic/aic79xx.c 		ahd_outb(ahd, LQOMODE1, lqomode1);
ahd              2688 dev/ic/aic79xx.c 		ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              2689 dev/ic/aic79xx.c 		ahd_outb(ahd, SEQCTL0, ahd_inb(ahd, SEQCTL0) & ~STEP);
ahd              2690 dev/ic/aic79xx.c   		ahd_outb(ahd, SIMODE1, simode1);
ahd              2697 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRINT, CLRSCSIINT);
ahd              2699 dev/ic/aic79xx.c 	ahd_restore_modes(ahd, saved_modes);
ahd              2706 dev/ic/aic79xx.c ahd_clear_intstat(struct ahd_softc *ahd)
ahd              2708 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK),
ahd              2711 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRLQIINT0, CLRLQIATNQAS|CLRLQICRCT1|CLRLQICRCT2
ahd              2713 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRLQIINT1, CLRLQIPHASE_LQ|CLRLQIPHASE_NLQ|CLRLIQABORT
ahd              2716 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRLQOINT0, CLRLQOTARGSCBPERR|CLRLQOSTOPT2|CLRLQOATNLQ
ahd              2718 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRLQOINT1, CLRLQOINITSCBPERR|CLRLQOSTOPI2|CLRLQOBADQAS
ahd              2720 dev/ic/aic79xx.c 	if ((ahd->bugs & AHD_CLRLQO_AUTOCLR_BUG) != 0) {
ahd              2721 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRLQOINT0, 0);
ahd              2722 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRLQOINT1, 0);
ahd              2724 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRSINT3, CLRNTRAMPERR|CLROSRAMPERR);
ahd              2725 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRSINT1, CLRSELTIMEO|CLRATNO|CLRSCSIRSTI
ahd              2727 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRSINT0, CLRSELDO|CLRSELDI|CLRSELINGO
ahd              2729 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRINT, CLRSCSIINT);
ahd              2810 dev/ic/aic79xx.c ahd_alloc_tstate(struct ahd_softc *ahd, u_int scsi_id, char channel)
ahd              2816 dev/ic/aic79xx.c 	master_tstate = ahd->enabled_targets[ahd->our_id];
ahd              2817 dev/ic/aic79xx.c 	if (ahd->enabled_targets[scsi_id] != NULL
ahd              2818 dev/ic/aic79xx.c 	 && ahd->enabled_targets[scsi_id] != master_tstate)
ahd              2820 dev/ic/aic79xx.c 		      ahd_name(ahd));
ahd              2842 dev/ic/aic79xx.c 	ahd->enabled_targets[scsi_id] = tstate;
ahd              2852 dev/ic/aic79xx.c ahd_free_tstate(struct ahd_softc *ahd, u_int scsi_id, char channel, int force)
ahd              2860 dev/ic/aic79xx.c 	if (scsi_id == ahd->our_id
ahd              2864 dev/ic/aic79xx.c 	tstate = ahd->enabled_targets[scsi_id];
ahd              2867 dev/ic/aic79xx.c 	ahd->enabled_targets[scsi_id] = NULL;
ahd              2878 dev/ic/aic79xx.c ahd_devlimited_syncrate(struct ahd_softc *ahd,
ahd              2885 dev/ic/aic79xx.c 	if ((ahd_inb(ahd, SBLKCTL) & ENAB40) != 0
ahd              2886 dev/ic/aic79xx.c 	 && (ahd_inb(ahd, SSTAT2) & EXP_ACTIVE) == 0) {
ahd              2917 dev/ic/aic79xx.c 		ahd_find_syncrate(ahd, period, ppr_options, maxsync);
ahd              2927 dev/ic/aic79xx.c ahd_find_syncrate(struct ahd_softc *ahd, u_int *period,
ahd              2966 dev/ic/aic79xx.c ahd_validate_offset(struct ahd_softc *ahd,
ahd              2977 dev/ic/aic79xx.c 		if ((ahd->bugs & AHD_PACED_NEGTABLE_BUG) != 0)
ahd              2997 dev/ic/aic79xx.c ahd_validate_width(struct ahd_softc *ahd, struct ahd_initiator_tinfo *tinfo,
ahd              3002 dev/ic/aic79xx.c 		if (ahd->features & AHD_WIDE) {
ahd              3027 dev/ic/aic79xx.c ahd_update_neg_request(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
ahd              3041 dev/ic/aic79xx.c 		if ((ahd->features & AHD_WIDE) != 0)
ahd              3070 dev/ic/aic79xx.c ahd_set_syncrate(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
ahd              3090 dev/ic/aic79xx.c 	tinfo = ahd_fetch_transinfo(ahd, devinfo->channel, devinfo->our_scsiid,
ahd              3120 dev/ic/aic79xx.c 		ahd_send_async(ahd, devinfo->channel, devinfo->target,
ahd              3129 dev/ic/aic79xx.c 				       ahd_name(ahd), devinfo->target,
ahd              3159 dev/ic/aic79xx.c 				       ahd_name(ahd), devinfo->target,
ahd              3175 dev/ic/aic79xx.c 			ahd_pause(ahd);
ahd              3176 dev/ic/aic79xx.c 		ahd_update_neg_table(ahd, devinfo, &tinfo->curr);
ahd              3178 dev/ic/aic79xx.c 			ahd_unpause(ahd);
ahd              3179 dev/ic/aic79xx.c 		if (ahd->msg_type != MSG_TYPE_NONE) {
ahd              3184 dev/ic/aic79xx.c 					ahd_print_devinfo(ahd, devinfo);
ahd              3188 dev/ic/aic79xx.c 				ahd->msg_flags |= MSG_FLAG_EXPECT_PPR_BUSFREE
ahd              3196 dev/ic/aic79xx.c 				ahd->msg_flags |= MSG_FLAG_EXPECT_PPR_BUSFREE;
ahd              3201 dev/ic/aic79xx.c 	update_needed += ahd_update_neg_request(ahd, devinfo, tstate,
ahd              3205 dev/ic/aic79xx.c 		ahd_update_pending_scbs(ahd);
ahd              3217 dev/ic/aic79xx.c ahd_set_width(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
ahd              3228 dev/ic/aic79xx.c 	tinfo = ahd_fetch_transinfo(ahd, devinfo->channel, devinfo->our_scsiid,
ahd              3244 dev/ic/aic79xx.c 		ahd_send_async(ahd, devinfo->channel, devinfo->target,
ahd              3249 dev/ic/aic79xx.c 			       ahd_name(ahd), devinfo->target,
ahd              3256 dev/ic/aic79xx.c 			ahd_pause(ahd);
ahd              3257 dev/ic/aic79xx.c 		ahd_update_neg_table(ahd, devinfo, &tinfo->curr);
ahd              3259 dev/ic/aic79xx.c 			ahd_unpause(ahd);
ahd              3262 dev/ic/aic79xx.c 	update_needed += ahd_update_neg_request(ahd, devinfo, tstate,
ahd              3265 dev/ic/aic79xx.c 		ahd_update_pending_scbs(ahd);
ahd              3273 dev/ic/aic79xx.c ahd_set_tags(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
ahd              3276 dev/ic/aic79xx.c 	ahd_platform_set_tags(ahd, devinfo, alg);
ahd              3278 dev/ic/aic79xx.c 	ahd_send_async(ahd, devinfo->channel, devinfo->target,
ahd              3284 dev/ic/aic79xx.c ahd_update_neg_table(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
ahd              3293 dev/ic/aic79xx.c 	uint8_t		iocell_opts[sizeof(ahd->iocell_opts)];
ahd              3295 dev/ic/aic79xx.c 	saved_modes = ahd_save_modes(ahd);
ahd              3296 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              3298 dev/ic/aic79xx.c 	saved_negoaddr = ahd_inb(ahd, NEGOADDR);
ahd              3299 dev/ic/aic79xx.c 	ahd_outb(ahd, NEGOADDR, devinfo->target);
ahd              3302 dev/ic/aic79xx.c 	memcpy(iocell_opts, ahd->iocell_opts, sizeof(ahd->iocell_opts)); 
ahd              3310 dev/ic/aic79xx.c 		if ((ahd->bugs & AHD_PACED_NEGTABLE_BUG) != 0) {
ahd              3342 dev/ic/aic79xx.c 		if ((ahd->features & AHD_NEW_IOCELL_OPTS) != 0
ahd              3354 dev/ic/aic79xx.c 		if ((ahd->bugs & AHD_PACED_NEGTABLE_BUG) != 0) {
ahd              3364 dev/ic/aic79xx.c 	ahd_outb(ahd, ANNEXCOL, AHD_ANNEXCOL_PRECOMP_SLEW);
ahd              3365 dev/ic/aic79xx.c 	ahd_outb(ahd, ANNEXDAT, iocell_opts[AHD_PRECOMP_SLEW_INDEX]);
ahd              3366 dev/ic/aic79xx.c 	ahd_outb(ahd, ANNEXCOL, AHD_ANNEXCOL_AMPLITUDE);
ahd              3367 dev/ic/aic79xx.c 	ahd_outb(ahd, ANNEXDAT, iocell_opts[AHD_AMPLITUDE_INDEX]);
ahd              3369 dev/ic/aic79xx.c 	ahd_outb(ahd, NEGPERIOD, period);
ahd              3370 dev/ic/aic79xx.c 	ahd_outb(ahd, NEGPPROPTS, ppr_opts);
ahd              3371 dev/ic/aic79xx.c 	ahd_outb(ahd, NEGOFFSET, offset);
ahd              3383 dev/ic/aic79xx.c 	ahd_outb(ahd, NEGCONOPTS, con_opts);
ahd              3384 dev/ic/aic79xx.c 	ahd_outb(ahd, NEGOADDR, saved_negoaddr);
ahd              3385 dev/ic/aic79xx.c 	ahd_restore_modes(ahd, saved_modes);
ahd              3395 dev/ic/aic79xx.c ahd_update_pending_scbs(struct ahd_softc *ahd)
ahd              3414 dev/ic/aic79xx.c 	LIST_FOREACH(pending_scb, &ahd->pending_scbs, pending_links) {
ahd              3419 dev/ic/aic79xx.c 		ahd_scb_devinfo(ahd, &devinfo, pending_scb);
ahd              3420 dev/ic/aic79xx.c 		tinfo = ahd_fetch_transinfo(ahd, devinfo.channel,
ahd              3428 dev/ic/aic79xx.c 		ahd_sync_scb(ahd, pending_scb,
ahd              3436 dev/ic/aic79xx.c 	if (ahd_is_paused(ahd)) {
ahd              3440 dev/ic/aic79xx.c 		ahd_pause(ahd);
ahd              3451 dev/ic/aic79xx.c 	saved_modes = ahd_save_modes(ahd);
ahd              3452 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              3453 dev/ic/aic79xx.c 	if ((ahd_inb(ahd, SCSISIGI) & BSYI) != 0
ahd              3454 dev/ic/aic79xx.c 	 && (ahd_inb(ahd, SSTAT0) & (SELDO|SELINGO)) == 0)
ahd              3455 dev/ic/aic79xx.c 		ahd_outb(ahd, SCSISEQ0, ahd_inb(ahd, SCSISEQ0) & ~ENSELO);
ahd              3456 dev/ic/aic79xx.c 	saved_scbptr = ahd_get_scbptr(ahd);
ahd              3458 dev/ic/aic79xx.c 	LIST_FOREACH(pending_scb, &ahd->pending_scbs, pending_links) {
ahd              3463 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, scb_tag);
ahd              3464 dev/ic/aic79xx.c 		control = ahd_inb_scbram(ahd, SCB_CONTROL);
ahd              3467 dev/ic/aic79xx.c 		ahd_outb(ahd, SCB_CONTROL, control);
ahd              3469 dev/ic/aic79xx.c 	ahd_set_scbptr(ahd, saved_scbptr);
ahd              3470 dev/ic/aic79xx.c 	ahd_restore_modes(ahd, saved_modes);
ahd              3473 dev/ic/aic79xx.c 		ahd_unpause(ahd);
ahd              3478 dev/ic/aic79xx.c ahd_fetch_devinfo(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
ahd              3485 dev/ic/aic79xx.c 	saved_modes = ahd_save_modes(ahd);
ahd              3486 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              3488 dev/ic/aic79xx.c 	if (ahd_inb(ahd, SSTAT0) & TARGET)
ahd              3494 dev/ic/aic79xx.c 	 && (ahd_inb(ahd, SEQ_FLAGS) & CMDPHASE_PENDING) != 0) {
ahd              3496 dev/ic/aic79xx.c 		our_id = ahd_inb(ahd, TARGIDIN) & OID;
ahd              3498 dev/ic/aic79xx.c 		our_id = ahd_inb(ahd, TOWNID);
ahd              3500 dev/ic/aic79xx.c 		our_id = ahd_inb(ahd, IOWNID);
ahd              3502 dev/ic/aic79xx.c 	saved_scsiid = ahd_inb(ahd, SAVED_SCSIID);
ahd              3505 dev/ic/aic79xx.c 			    SCSIID_TARGET(ahd, saved_scsiid),
ahd              3506 dev/ic/aic79xx.c 			    ahd_inb(ahd, SAVED_LUN),
ahd              3507 dev/ic/aic79xx.c 			    SCSIID_CHANNEL(ahd, saved_scsiid),
ahd              3509 dev/ic/aic79xx.c 	ahd_restore_modes(ahd, saved_modes);
ahd              3513 dev/ic/aic79xx.c ahd_print_devinfo(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
ahd              3515 dev/ic/aic79xx.c 	printf("%s:%c:%d:%d: ", ahd_name(ahd), 'A',
ahd              3553 dev/ic/aic79xx.c ahd_scb_devinfo(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
ahd              3563 dev/ic/aic79xx.c 	ahd_compile_devinfo(devinfo, our_id, SCB_GET_TARGET(ahd, scb),
ahd              3564 dev/ic/aic79xx.c 			    SCB_GET_LUN(scb), SCB_GET_CHANNEL(ahd, scb), role);
ahd              3576 dev/ic/aic79xx.c ahd_setup_initiator_msgout(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
ahd              3584 dev/ic/aic79xx.c 	ahd->msgout_index = 0;
ahd              3585 dev/ic/aic79xx.c 	ahd->msgout_len = 0;
ahd              3587 dev/ic/aic79xx.c 	if (ahd_currently_packetized(ahd))
ahd              3588 dev/ic/aic79xx.c 		ahd->msg_flags |= MSG_FLAG_PACKETIZED;
ahd              3590 dev/ic/aic79xx.c 	if (ahd->send_msg_perror
ahd              3591 dev/ic/aic79xx.c 	 && ahd_inb(ahd, MSG_OUT) == HOST_MSG) {
ahd              3592 dev/ic/aic79xx.c 		ahd->msgout_buf[ahd->msgout_index++] = ahd->send_msg_perror;
ahd              3593 dev/ic/aic79xx.c 		ahd->msgout_len++;
ahd              3594 dev/ic/aic79xx.c 		ahd->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
ahd              3602 dev/ic/aic79xx.c 		       "I_T msgin.  Issuing NO-OP\n", ahd_name(ahd));
ahd              3603 dev/ic/aic79xx.c 		ahd->msgout_buf[ahd->msgout_index++] = MSG_NOOP;
ahd              3604 dev/ic/aic79xx.c 		ahd->msgout_len++;
ahd              3605 dev/ic/aic79xx.c 		ahd->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
ahd              3611 dev/ic/aic79xx.c 	 && ahd_inb(ahd, MSG_OUT) == MSG_IDENTIFYFLAG) {
ahd              3617 dev/ic/aic79xx.c 		ahd->msgout_buf[ahd->msgout_index++] = identify_msg;
ahd              3618 dev/ic/aic79xx.c 		ahd->msgout_len++;
ahd              3621 dev/ic/aic79xx.c 			ahd->msgout_buf[ahd->msgout_index++] =
ahd              3623 dev/ic/aic79xx.c 			ahd->msgout_buf[ahd->msgout_index++] = SCB_GET_TAG(scb);
ahd              3624 dev/ic/aic79xx.c 			ahd->msgout_len += 2;
ahd              3629 dev/ic/aic79xx.c 		ahd->msgout_buf[ahd->msgout_index++] = MSG_BUS_DEV_RESET;
ahd              3630 dev/ic/aic79xx.c 		ahd->msgout_len++;
ahd              3631 dev/ic/aic79xx.c 		ahd_print_path(ahd, scb);
ahd              3640 dev/ic/aic79xx.c 		ahd_outb(ahd, SCSISEQ0, 0);
ahd              3644 dev/ic/aic79xx.c 			ahd->msgout_buf[ahd->msgout_index++] = MSG_ABORT_TAG;
ahd              3646 dev/ic/aic79xx.c 			ahd->msgout_buf[ahd->msgout_index++] = MSG_ABORT;
ahd              3648 dev/ic/aic79xx.c 		ahd->msgout_len++;
ahd              3649 dev/ic/aic79xx.c 		ahd_print_path(ahd, scb);
ahd              3659 dev/ic/aic79xx.c 		ahd_outb(ahd, SCSISEQ0, 0);
ahd              3661 dev/ic/aic79xx.c 		ahd_build_transfer_msg(ahd, devinfo);
ahd              3669 dev/ic/aic79xx.c 		ahd_outb(ahd, SCSISEQ0, 0);
ahd              3677 dev/ic/aic79xx.c 		      ahd_inb_scbram(ahd, SCB_CONTROL), ahd_inb(ahd, MSG_OUT),
ahd              3685 dev/ic/aic79xx.c 	ahd_outb(ahd, SCB_CONTROL,
ahd              3686 dev/ic/aic79xx.c 		 ahd_inb_scbram(ahd, SCB_CONTROL) & ~MK_MESSAGE);
ahd              3688 dev/ic/aic79xx.c 	ahd->msgout_index = 0;
ahd              3689 dev/ic/aic79xx.c 	ahd->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
ahd              3697 dev/ic/aic79xx.c ahd_build_transfer_msg(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
ahd              3713 dev/ic/aic79xx.c 	tinfo = ahd_fetch_transinfo(ahd, devinfo->channel, devinfo->our_scsiid,
ahd              3727 dev/ic/aic79xx.c 	ahd_devlimited_syncrate(ahd, tinfo, &period,
ahd              3748 dev/ic/aic79xx.c 		if ((ahd->features & AHD_WIDE) != 0)
ahd              3754 dev/ic/aic79xx.c 			ahd_print_devinfo(ahd, devinfo);
ahd              3773 dev/ic/aic79xx.c 		ahd_validate_offset(ahd, tinfo, period, &offset,
ahd              3778 dev/ic/aic79xx.c 			ahd_construct_ppr(ahd, devinfo, period, offset,
ahd              3781 dev/ic/aic79xx.c 			ahd_construct_sdtr(ahd, devinfo, period, offset);
ahd              3784 dev/ic/aic79xx.c 		ahd_construct_wdtr(ahd, devinfo, tinfo->goal.width);
ahd              3793 dev/ic/aic79xx.c ahd_construct_sdtr(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
ahd              3798 dev/ic/aic79xx.c 	ahd->msgout_buf[ahd->msgout_index++] = MSG_EXTENDED;
ahd              3799 dev/ic/aic79xx.c 	ahd->msgout_buf[ahd->msgout_index++] = MSG_EXT_SDTR_LEN;
ahd              3800 dev/ic/aic79xx.c 	ahd->msgout_buf[ahd->msgout_index++] = MSG_EXT_SDTR;
ahd              3801 dev/ic/aic79xx.c 	ahd->msgout_buf[ahd->msgout_index++] = period;
ahd              3802 dev/ic/aic79xx.c 	ahd->msgout_buf[ahd->msgout_index++] = offset;
ahd              3803 dev/ic/aic79xx.c 	ahd->msgout_len += 5;
ahd              3806 dev/ic/aic79xx.c 		       ahd_name(ahd), devinfo->channel, devinfo->target,
ahd              3816 dev/ic/aic79xx.c ahd_construct_wdtr(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
ahd              3819 dev/ic/aic79xx.c 	ahd->msgout_buf[ahd->msgout_index++] = MSG_EXTENDED;
ahd              3820 dev/ic/aic79xx.c 	ahd->msgout_buf[ahd->msgout_index++] = MSG_EXT_WDTR_LEN;
ahd              3821 dev/ic/aic79xx.c 	ahd->msgout_buf[ahd->msgout_index++] = MSG_EXT_WDTR;
ahd              3822 dev/ic/aic79xx.c 	ahd->msgout_buf[ahd->msgout_index++] = bus_width;
ahd              3823 dev/ic/aic79xx.c 	ahd->msgout_len += 4;
ahd              3826 dev/ic/aic79xx.c 		       ahd_name(ahd), devinfo->channel, devinfo->target,
ahd              3836 dev/ic/aic79xx.c ahd_construct_ppr(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
ahd              3849 dev/ic/aic79xx.c 	ahd->msgout_buf[ahd->msgout_index++] = MSG_EXTENDED;
ahd              3850 dev/ic/aic79xx.c 	ahd->msgout_buf[ahd->msgout_index++] = MSG_EXT_PPR_LEN;
ahd              3851 dev/ic/aic79xx.c 	ahd->msgout_buf[ahd->msgout_index++] = MSG_EXT_PPR;
ahd              3852 dev/ic/aic79xx.c 	ahd->msgout_buf[ahd->msgout_index++] = period;
ahd              3853 dev/ic/aic79xx.c 	ahd->msgout_buf[ahd->msgout_index++] = 0;
ahd              3854 dev/ic/aic79xx.c 	ahd->msgout_buf[ahd->msgout_index++] = offset;
ahd              3855 dev/ic/aic79xx.c 	ahd->msgout_buf[ahd->msgout_index++] = bus_width;
ahd              3856 dev/ic/aic79xx.c 	ahd->msgout_buf[ahd->msgout_index++] = ppr_options;
ahd              3857 dev/ic/aic79xx.c 	ahd->msgout_len += 8;
ahd              3860 dev/ic/aic79xx.c 		       "offset %x, ppr_options %x\n", ahd_name(ahd),
ahd              3870 dev/ic/aic79xx.c ahd_clear_msg_state(struct ahd_softc *ahd)
ahd              3874 dev/ic/aic79xx.c 	saved_modes = ahd_save_modes(ahd);
ahd              3875 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              3876 dev/ic/aic79xx.c 	ahd->send_msg_perror = 0;
ahd              3877 dev/ic/aic79xx.c 	ahd->msg_flags = MSG_FLAG_NONE;
ahd              3878 dev/ic/aic79xx.c 	ahd->msgout_len = 0;
ahd              3879 dev/ic/aic79xx.c 	ahd->msgin_index = 0;
ahd              3880 dev/ic/aic79xx.c 	ahd->msg_type = MSG_TYPE_NONE;
ahd              3881 dev/ic/aic79xx.c 	if ((ahd_inb(ahd, SCSISIGO) & ATNO) != 0) {
ahd              3886 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRSINT1, CLRATNO);
ahd              3888 dev/ic/aic79xx.c 	ahd_outb(ahd, MSG_OUT, MSG_NOOP);
ahd              3889 dev/ic/aic79xx.c 	ahd_outb(ahd, SEQ_FLAGS2,
ahd              3890 dev/ic/aic79xx.c 		 ahd_inb(ahd, SEQ_FLAGS2) & ~TARGET_MSG_PENDING);
ahd              3891 dev/ic/aic79xx.c 	ahd_restore_modes(ahd, saved_modes);
ahd              3898 dev/ic/aic79xx.c ahd_handle_message_phase(struct ahd_softc *ahd)
ahd              3904 dev/ic/aic79xx.c 	ahd_fetch_devinfo(ahd, &devinfo);
ahd              3906 dev/ic/aic79xx.c 	bus_phase = ahd_inb(ahd, LASTPHASE);
ahd              3908 dev/ic/aic79xx.c 	if ((ahd_inb(ahd, LQISTAT2) & LQIPHASE_OUTPKT) != 0) {
ahd              3910 dev/ic/aic79xx.c 		ahd_outb(ahd, LQCTL2, LQIRETRY);
ahd              3913 dev/ic/aic79xx.c 	switch (ahd->msg_type) {
ahd              3920 dev/ic/aic79xx.c 		if (ahd->msgout_len == 0 && ahd->send_msg_perror == 0)
ahd              3925 dev/ic/aic79xx.c 			ahd_print_devinfo(ahd, &devinfo);
ahd              3945 dev/ic/aic79xx.c 				ahd_outb(ahd, CLRSINT1, CLRATNO);
ahd              3946 dev/ic/aic79xx.c 				ahd->send_msg_perror = 0;
ahd              3947 dev/ic/aic79xx.c 				ahd->msg_type = MSG_TYPE_INITIATOR_MSGIN;
ahd              3948 dev/ic/aic79xx.c 				ahd->msgin_index = 0;
ahd              3955 dev/ic/aic79xx.c 		if (ahd->send_msg_perror) {
ahd              3956 dev/ic/aic79xx.c 			ahd_outb(ahd, CLRSINT1, CLRATNO);
ahd              3957 dev/ic/aic79xx.c 			ahd_outb(ahd, CLRSINT1, CLRREQINIT);
ahd              3960 dev/ic/aic79xx.c 				printf(" byte 0x%x\n", ahd->send_msg_perror);
ahd              3968 dev/ic/aic79xx.c 			if ((ahd->msg_flags & MSG_FLAG_PACKETIZED) != 0
ahd              3969 dev/ic/aic79xx.c 			 && ahd->send_msg_perror == MSG_INITIATOR_DET_ERR)
ahd              3970 dev/ic/aic79xx.c 				ahd->msg_flags |= MSG_FLAG_EXPECT_IDE_BUSFREE;
ahd              3972 dev/ic/aic79xx.c 			ahd_outb(ahd, RETURN_2, ahd->send_msg_perror);
ahd              3973 dev/ic/aic79xx.c 			ahd_outb(ahd, RETURN_1, CONT_MSG_LOOP_WRITE);
ahd              3977 dev/ic/aic79xx.c 		msgdone	= ahd->msgout_index == ahd->msgout_len;
ahd              3984 dev/ic/aic79xx.c 			ahd->msgout_index = 0;
ahd              3985 dev/ic/aic79xx.c 			ahd_assert_atn(ahd);
ahd              3988 dev/ic/aic79xx.c 		lastbyte = ahd->msgout_index == (ahd->msgout_len - 1);
ahd              3991 dev/ic/aic79xx.c 			ahd_outb(ahd, CLRSINT1, CLRATNO);
ahd              3998 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRSINT1, CLRREQINIT);
ahd              4002 dev/ic/aic79xx.c 			       ahd->msgout_buf[ahd->msgout_index]);
ahd              4004 dev/ic/aic79xx.c 		ahd_outb(ahd, RETURN_2, ahd->msgout_buf[ahd->msgout_index++]);
ahd              4005 dev/ic/aic79xx.c 		ahd_outb(ahd, RETURN_1, CONT_MSG_LOOP_WRITE);
ahd              4015 dev/ic/aic79xx.c 			ahd_print_devinfo(ahd, &devinfo);
ahd              4028 dev/ic/aic79xx.c 			ahd->msgin_index = 0;
ahd              4030 dev/ic/aic79xx.c 			 && (ahd->send_msg_perror != 0
ahd              4031 dev/ic/aic79xx.c 			  || (ahd->msgout_len != 0
ahd              4032 dev/ic/aic79xx.c 			   && ahd->msgout_index == 0))) {
ahd              4033 dev/ic/aic79xx.c 				ahd->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
ahd              4041 dev/ic/aic79xx.c 		ahd->msgin_buf[ahd->msgin_index] = ahd_inb(ahd, SCSIBUS);
ahd              4045 dev/ic/aic79xx.c 			       ahd->msgin_buf[ahd->msgin_index]);
ahd              4048 dev/ic/aic79xx.c 		message_done = ahd_parse_msg(ahd, &devinfo);
ahd              4055 dev/ic/aic79xx.c 			ahd->msgin_index = 0;
ahd              4062 dev/ic/aic79xx.c 			if (ahd->msgout_len != 0) {
ahd              4065 dev/ic/aic79xx.c 					ahd_print_devinfo(ahd, &devinfo);
ahd              4069 dev/ic/aic79xx.c 				ahd_assert_atn(ahd);
ahd              4072 dev/ic/aic79xx.c 			ahd->msgin_index++;
ahd              4078 dev/ic/aic79xx.c 			ahd_outb(ahd, CLRSINT1, CLRREQINIT);
ahd              4079 dev/ic/aic79xx.c 			ahd_outb(ahd, RETURN_1, CONT_MSG_LOOP_READ);
ahd              4091 dev/ic/aic79xx.c 		ahd_outb(ahd, RETURN_1, CONT_MSG_LOOP_TARG);
ahd              4093 dev/ic/aic79xx.c 		if (ahd->msgout_len == 0)
ahd              4102 dev/ic/aic79xx.c 		if ((ahd_inb(ahd, SCSISIGI) & ATNI) != 0
ahd              4103 dev/ic/aic79xx.c 		 && ahd->msgout_index > 0)
ahd              4116 dev/ic/aic79xx.c 			ahd->msg_type = MSG_TYPE_TARGET_MSGOUT;
ahd              4117 dev/ic/aic79xx.c 			ahd_outb(ahd, SCSISIGO, P_MESGOUT | BSYO);
ahd              4118 dev/ic/aic79xx.c 			ahd->msgin_index = 0;
ahd              4120 dev/ic/aic79xx.c 			ahd_inb(ahd, SCSIDAT);
ahd              4121 dev/ic/aic79xx.c 			ahd_outb(ahd, SXFRCTL0,
ahd              4122 dev/ic/aic79xx.c 				 ahd_inb(ahd, SXFRCTL0) | SPIOEN);
ahd              4126 dev/ic/aic79xx.c 		msgdone = ahd->msgout_index == ahd->msgout_len;
ahd              4128 dev/ic/aic79xx.c 			ahd_outb(ahd, SXFRCTL0,
ahd              4129 dev/ic/aic79xx.c 				 ahd_inb(ahd, SXFRCTL0) & ~SPIOEN);
ahd              4137 dev/ic/aic79xx.c 		ahd_outb(ahd, SXFRCTL0, ahd_inb(ahd, SXFRCTL0) | SPIOEN);
ahd              4138 dev/ic/aic79xx.c 		ahd_outb(ahd, SCSIDAT, ahd->msgout_buf[ahd->msgout_index++]);
ahd              4149 dev/ic/aic79xx.c 		ahd_outb(ahd, RETURN_1, CONT_MSG_LOOP_TARG);
ahd              4155 dev/ic/aic79xx.c 		lastbyte = (ahd_inb(ahd, SCSISIGI) & ATNI) == 0;
ahd              4162 dev/ic/aic79xx.c 		ahd_outb(ahd, SXFRCTL0, ahd_inb(ahd, SXFRCTL0) & ~SPIOEN);
ahd              4163 dev/ic/aic79xx.c 		ahd->msgin_buf[ahd->msgin_index] = ahd_inb(ahd, SCSIDAT);
ahd              4164 dev/ic/aic79xx.c 		msgdone = ahd_parse_msg(ahd, &devinfo);
ahd              4175 dev/ic/aic79xx.c 		ahd->msgin_index++;
ahd              4182 dev/ic/aic79xx.c 			ahd->msgin_index = 0;
ahd              4188 dev/ic/aic79xx.c 			if (ahd->msgout_len != 0) {
ahd              4189 dev/ic/aic79xx.c 				ahd_outb(ahd, SCSISIGO, P_MESGIN | BSYO);
ahd              4190 dev/ic/aic79xx.c 				ahd_outb(ahd, SXFRCTL0,
ahd              4191 dev/ic/aic79xx.c 					 ahd_inb(ahd, SXFRCTL0) | SPIOEN);
ahd              4192 dev/ic/aic79xx.c 				ahd->msg_type = MSG_TYPE_TARGET_MSGIN;
ahd              4193 dev/ic/aic79xx.c 				ahd->msgin_index = 0;
ahd              4202 dev/ic/aic79xx.c 			ahd_outb(ahd, SXFRCTL0,
ahd              4203 dev/ic/aic79xx.c 				 ahd_inb(ahd, SXFRCTL0) | SPIOEN);
ahd              4213 dev/ic/aic79xx.c 		if ((ahd->msg_flags & MSG_FLAG_PACKETIZED) != 0) {
ahd              4215 dev/ic/aic79xx.c 			       ahd_name(ahd));
ahd              4216 dev/ic/aic79xx.c 			ahd_clear_msg_state(ahd);
ahd              4221 dev/ic/aic79xx.c 			ahd_outb(ahd, LASTPHASE, P_BUSFREE);
ahd              4222 dev/ic/aic79xx.c 			ahd_outb(ahd, SEQ_FLAGS, NOT_IDENTIFIED|NO_CDB_SENT);
ahd              4223 dev/ic/aic79xx.c 			ahd_outb(ahd, SEQCTL0, FASTMODE|SEQRESET);
ahd              4225 dev/ic/aic79xx.c 			ahd_clear_msg_state(ahd);
ahd              4226 dev/ic/aic79xx.c 			ahd_outb(ahd, RETURN_1, EXIT_MSG_LOOP);
ahd              4238 dev/ic/aic79xx.c ahd_sent_msg(struct ahd_softc *ahd, ahd_msgtype type, u_int msgval, int full)
ahd              4246 dev/ic/aic79xx.c 	while (index < ahd->msgout_len) {
ahd              4247 dev/ic/aic79xx.c 		if (ahd->msgout_buf[index] == MSG_EXTENDED) {
ahd              4250 dev/ic/aic79xx.c 			end_index = index + 1 + ahd->msgout_buf[index + 1];
ahd              4251 dev/ic/aic79xx.c 			if (ahd->msgout_buf[index+2] == msgval
ahd              4255 dev/ic/aic79xx.c 					if (ahd->msgout_index > end_index)
ahd              4257 dev/ic/aic79xx.c 				} else if (ahd->msgout_index > index)
ahd              4261 dev/ic/aic79xx.c 		} else if (ahd->msgout_buf[index] >= MSG_SIMPLE_TASK
ahd              4262 dev/ic/aic79xx.c 			&& ahd->msgout_buf[index] <= MSG_IGN_WIDE_RESIDUE) {
ahd              4269 dev/ic/aic79xx.c 			 && ahd->msgout_index > index
ahd              4270 dev/ic/aic79xx.c 			 && (ahd->msgout_buf[index] == msgval
ahd              4271 dev/ic/aic79xx.c 			  || ((ahd->msgout_buf[index] & MSG_IDENTIFYFLAG) != 0
ahd              4287 dev/ic/aic79xx.c ahd_parse_msg(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
ahd              4298 dev/ic/aic79xx.c 	tinfo = ahd_fetch_transinfo(ahd, devinfo->channel, devinfo->our_scsiid,
ahd              4312 dev/ic/aic79xx.c 	switch (ahd->msgin_buf[0]) {
ahd              4325 dev/ic/aic79xx.c 		response = ahd_handle_msg_reject(ahd, devinfo);
ahd              4333 dev/ic/aic79xx.c 		if (ahd->msgin_index < 2)
ahd              4335 dev/ic/aic79xx.c 		switch (ahd->msgin_buf[2]) {
ahd              4343 dev/ic/aic79xx.c 			if (ahd->msgin_buf[1] != MSG_EXT_SDTR_LEN) {
ahd              4355 dev/ic/aic79xx.c 			if (ahd->msgin_index < (MSG_EXT_SDTR_LEN + 1))
ahd              4358 dev/ic/aic79xx.c 			period = ahd->msgin_buf[3];
ahd              4360 dev/ic/aic79xx.c 			saved_offset = offset = ahd->msgin_buf[4];
ahd              4361 dev/ic/aic79xx.c 			ahd_devlimited_syncrate(ahd, tinfo, &period,
ahd              4363 dev/ic/aic79xx.c 			ahd_validate_offset(ahd, tinfo, period, &offset,
ahd              4369 dev/ic/aic79xx.c 				       ahd_name(ahd), devinfo->channel,
ahd              4371 dev/ic/aic79xx.c 				       ahd->msgin_buf[3], saved_offset,
ahd              4374 dev/ic/aic79xx.c 			ahd_set_syncrate(ahd, devinfo, period,
ahd              4384 dev/ic/aic79xx.c 			if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_SDTR, TRUE)) {
ahd              4398 dev/ic/aic79xx.c 					       ahd_name(ahd), devinfo->channel,
ahd              4401 dev/ic/aic79xx.c 				ahd->msgout_index = 0;
ahd              4402 dev/ic/aic79xx.c 				ahd->msgout_len = 0;
ahd              4403 dev/ic/aic79xx.c 				ahd_construct_sdtr(ahd, devinfo,
ahd              4405 dev/ic/aic79xx.c 				ahd->msgout_index = 0;
ahd              4418 dev/ic/aic79xx.c 			if (ahd->msgin_buf[1] != MSG_EXT_WDTR_LEN) {
ahd              4430 dev/ic/aic79xx.c 			if (ahd->msgin_index < (MSG_EXT_WDTR_LEN + 1))
ahd              4433 dev/ic/aic79xx.c 			bus_width = ahd->msgin_buf[3];
ahd              4435 dev/ic/aic79xx.c 			ahd_validate_width(ahd, tinfo, &bus_width,
ahd              4440 dev/ic/aic79xx.c 				       ahd_name(ahd), devinfo->channel,
ahd              4445 dev/ic/aic79xx.c 			if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_WDTR, TRUE)) {
ahd              4456 dev/ic/aic79xx.c 					       ahd_name(ahd), devinfo->channel,
ahd              4469 dev/ic/aic79xx.c 					       ahd_name(ahd), devinfo->channel,
ahd              4472 dev/ic/aic79xx.c 				ahd->msgout_index = 0;
ahd              4473 dev/ic/aic79xx.c 				ahd->msgout_len = 0;
ahd              4474 dev/ic/aic79xx.c 				ahd_construct_wdtr(ahd, devinfo, bus_width);
ahd              4475 dev/ic/aic79xx.c 				ahd->msgout_index = 0;
ahd              4488 dev/ic/aic79xx.c 			ahd_update_neg_request(ahd, devinfo, tstate,
ahd              4490 dev/ic/aic79xx.c 			ahd_set_width(ahd, devinfo, bus_width,
ahd              4498 dev/ic/aic79xx.c 				ahd->msgout_index = 0;
ahd              4499 dev/ic/aic79xx.c 				ahd->msgout_len = 0;
ahd              4500 dev/ic/aic79xx.c 				ahd_build_transfer_msg(ahd, devinfo);
ahd              4501 dev/ic/aic79xx.c 				ahd->msgout_index = 0;
ahd              4517 dev/ic/aic79xx.c 			if (ahd->msgin_buf[1] != MSG_EXT_PPR_LEN) {
ahd              4529 dev/ic/aic79xx.c 			if (ahd->msgin_index < (MSG_EXT_PPR_LEN + 1))
ahd              4532 dev/ic/aic79xx.c 			period = ahd->msgin_buf[3];
ahd              4533 dev/ic/aic79xx.c 			offset = ahd->msgin_buf[5];
ahd              4534 dev/ic/aic79xx.c 			bus_width = ahd->msgin_buf[6];
ahd              4536 dev/ic/aic79xx.c 			ppr_options = ahd->msgin_buf[7];
ahd              4555 dev/ic/aic79xx.c 			ahd_validate_width(ahd, tinfo, &bus_width,
ahd              4557 dev/ic/aic79xx.c 			ahd_devlimited_syncrate(ahd, tinfo, &period,
ahd              4559 dev/ic/aic79xx.c 			ahd_validate_offset(ahd, tinfo, period, &offset,
ahd              4562 dev/ic/aic79xx.c 			if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_PPR, TRUE)) {
ahd              4581 dev/ic/aic79xx.c 					       ahd_name(ahd), devinfo->channel,
ahd              4586 dev/ic/aic79xx.c 					       ahd_name(ahd), devinfo->channel,
ahd              4588 dev/ic/aic79xx.c 				ahd->msgout_index = 0;
ahd              4589 dev/ic/aic79xx.c 				ahd->msgout_len = 0;
ahd              4590 dev/ic/aic79xx.c 				ahd_construct_ppr(ahd, devinfo, period, offset,
ahd              4592 dev/ic/aic79xx.c 				ahd->msgout_index = 0;
ahd              4600 dev/ic/aic79xx.c 				       ahd_name(ahd), devinfo->channel,
ahd              4602 dev/ic/aic79xx.c 				       saved_width, ahd->msgin_buf[3],
ahd              4606 dev/ic/aic79xx.c 			ahd_set_width(ahd, devinfo, bus_width,
ahd              4609 dev/ic/aic79xx.c 			ahd_set_syncrate(ahd, devinfo, period,
ahd              4626 dev/ic/aic79xx.c 		ahd_handle_devreset(ahd, devinfo, CAM_LUN_WILDCARD,
ahd              4630 dev/ic/aic79xx.c 		ahd_restart(ahd);
ahd              4645 dev/ic/aic79xx.c 		if (ahd->msgin_buf[0] == MSG_ABORT_TAG)
ahd              4646 dev/ic/aic79xx.c 			tag = ahd_inb(ahd, INITIATOR_TAG);
ahd              4647 dev/ic/aic79xx.c 		ahd_abort_scbs(ahd, devinfo->target, devinfo->channel,
ahd              4651 dev/ic/aic79xx.c 		tstate = ahd->enabled_targets[devinfo->our_scsiid];
ahd              4657 dev/ic/aic79xx.c 				ahd_queue_lstate_event(ahd, lstate,
ahd              4659 dev/ic/aic79xx.c 						       ahd->msgin_buf[0],
ahd              4661 dev/ic/aic79xx.c 				ahd_send_lstate_events(ahd, lstate);
ahd              4664 dev/ic/aic79xx.c 		ahd_restart(ahd);
ahd              4673 dev/ic/aic79xx.c 			       ahd_name(ahd), ahd_inb(ahd, SCSISIGI));
ahd              4675 dev/ic/aic79xx.c 		ahd->msg_flags |= MSG_FLAG_EXPECT_QASREJ_BUSFREE;
ahd              4687 dev/ic/aic79xx.c 		ahd->msgout_index = 0;
ahd              4688 dev/ic/aic79xx.c 		ahd->msgout_len = 1;
ahd              4689 dev/ic/aic79xx.c 		ahd->msgout_buf[0] = MSG_MESSAGE_REJECT;
ahd              4696 dev/ic/aic79xx.c 		ahd->msgout_len = 0;
ahd              4705 dev/ic/aic79xx.c ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
ahd              4720 dev/ic/aic79xx.c 	scb_index = ahd_get_scbptr(ahd);
ahd              4721 dev/ic/aic79xx.c 	scb = ahd_lookup_scb(ahd, scb_index);
ahd              4722 dev/ic/aic79xx.c 	tinfo = ahd_fetch_transinfo(ahd, devinfo->channel,
ahd              4726 dev/ic/aic79xx.c 	last_msg = ahd_inb(ahd, LAST_MSG);
ahd              4728 dev/ic/aic79xx.c 	if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_PPR, /*full*/FALSE)) {
ahd              4729 dev/ic/aic79xx.c 		if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_PPR, /*full*/TRUE)
ahd              4739 dev/ic/aic79xx.c 				       ahd_name(ahd), devinfo->channel,
ahd              4754 dev/ic/aic79xx.c 				       ahd_name(ahd), devinfo->channel,
ahd              4761 dev/ic/aic79xx.c 		ahd->msgout_index = 0;
ahd              4762 dev/ic/aic79xx.c 		ahd->msgout_len = 0;
ahd              4763 dev/ic/aic79xx.c 		ahd_build_transfer_msg(ahd, devinfo);
ahd              4764 dev/ic/aic79xx.c 		ahd->msgout_index = 0;
ahd              4766 dev/ic/aic79xx.c 	} else if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_WDTR, /*full*/FALSE)) {
ahd              4770 dev/ic/aic79xx.c 		       "8bit transfers\n", ahd_name(ahd),
ahd              4772 dev/ic/aic79xx.c 		ahd_set_width(ahd, devinfo, MSG_EXT_WDTR_BUS_8_BIT,
ahd              4785 dev/ic/aic79xx.c 			ahd->msgout_index = 0;
ahd              4786 dev/ic/aic79xx.c 			ahd->msgout_len = 0;
ahd              4787 dev/ic/aic79xx.c 			ahd_build_transfer_msg(ahd, devinfo);
ahd              4788 dev/ic/aic79xx.c 			ahd->msgout_index = 0;
ahd              4791 dev/ic/aic79xx.c 	} else if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_SDTR, /*full*/FALSE)) {
ahd              4793 dev/ic/aic79xx.c 		ahd_set_syncrate(ahd, devinfo, /*period*/0,
ahd              4799 dev/ic/aic79xx.c 		       ahd_name(ahd), devinfo->channel,
ahd              4809 dev/ic/aic79xx.c 			       "Performing non-tagged I/O\n", ahd_name(ahd),
ahd              4811 dev/ic/aic79xx.c 			ahd_set_tags(ahd, devinfo, AHD_QUEUE_NONE);
ahd              4816 dev/ic/aic79xx.c 			       ahd_name(ahd), devinfo->channel, devinfo->target,
ahd              4819 dev/ic/aic79xx.c 			ahd_set_tags(ahd, devinfo, AHD_QUEUE_BASIC);
ahd              4827 dev/ic/aic79xx.c 		ahd_outb(ahd, SCB_CONTROL,
ahd              4828 dev/ic/aic79xx.c 			 ahd_inb_scbram(ahd, SCB_CONTROL) & mask);
ahd              4832 dev/ic/aic79xx.c 		ahd_outb(ahd, MSG_OUT, MSG_IDENTIFYFLAG);
ahd              4833 dev/ic/aic79xx.c 		ahd_assert_atn(ahd);
ahd              4834 dev/ic/aic79xx.c 		ahd_busy_tcl(ahd, BUILD_TCL(scb->hscb->scsiid, devinfo->lun),
ahd              4842 dev/ic/aic79xx.c 		ahd_search_qinfifo(ahd, SCB_GET_TARGET(ahd, scb),
ahd              4843 dev/ic/aic79xx.c 				   SCB_GET_CHANNEL(ahd, scb),
ahd              4847 dev/ic/aic79xx.c 	} else if (ahd_sent_msg(ahd, AHDMSG_1B, MSG_IDENTIFYFLAG, TRUE)) {
ahd              4852 dev/ic/aic79xx.c 		ahd->msg_flags |= MSG_FLAG_EXPECT_PPR_BUSFREE
ahd              4855 dev/ic/aic79xx.c 		ahd_force_renegotiation(ahd, devinfo);
ahd              4856 dev/ic/aic79xx.c 		ahd->msgout_index = 0;
ahd              4857 dev/ic/aic79xx.c 		ahd->msgout_len = 0;
ahd              4858 dev/ic/aic79xx.c 		ahd_build_transfer_msg(ahd, devinfo);
ahd              4859 dev/ic/aic79xx.c 		ahd->msgout_index = 0;
ahd              4866 dev/ic/aic79xx.c 		       ahd_name(ahd), devinfo->channel, devinfo->target,
ahd              4876 dev/ic/aic79xx.c ahd_handle_ign_wide_residue(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
ahd              4881 dev/ic/aic79xx.c 	scb_index = ahd_get_scbptr(ahd);
ahd              4882 dev/ic/aic79xx.c 	scb = ahd_lookup_scb(ahd, scb_index);
ahd              4887 dev/ic/aic79xx.c 	if ((ahd_inb(ahd, SEQ_FLAGS) & DPHASE) == 0
ahd              4903 dev/ic/aic79xx.c 		sgptr = ahd_inb_scbram(ahd, SCB_RESIDUAL_SGPTR);
ahd              4905 dev/ic/aic79xx.c 		 && (ahd_inb_scbram(ahd, SCB_TASK_ATTRIBUTE)
ahd              4919 dev/ic/aic79xx.c 			sgptr = ahd_inl_scbram(ahd, SCB_RESIDUAL_SGPTR);
ahd              4920 dev/ic/aic79xx.c 			data_cnt = ahd_inl_scbram(ahd, SCB_RESIDUAL_DATACNT);
ahd              4929 dev/ic/aic79xx.c 			data_addr = ahd_inq(ahd, SHADDR);
ahd              4933 dev/ic/aic79xx.c 			if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0) {
ahd              4936 dev/ic/aic79xx.c 				sg = ahd_sg_bus_to_virt(ahd, scb, sgptr);
ahd              4963 dev/ic/aic79xx.c 					sgptr = ahd_sg_virt_to_bus(ahd, scb,
ahd              4969 dev/ic/aic79xx.c 				sg = ahd_sg_bus_to_virt(ahd, scb, sgptr);
ahd              4996 dev/ic/aic79xx.c 					sgptr = ahd_sg_virt_to_bus(ahd, scb,
ahd              5006 dev/ic/aic79xx.c 			ahd_outb(ahd, SCB_TASK_ATTRIBUTE,
ahd              5007 dev/ic/aic79xx.c 			    ahd_inb_scbram(ahd, SCB_TASK_ATTRIBUTE)
ahd              5010 dev/ic/aic79xx.c 			ahd_outl(ahd, SCB_RESIDUAL_SGPTR, sgptr);
ahd              5011 dev/ic/aic79xx.c 			ahd_outl(ahd, SCB_RESIDUAL_DATACNT, data_cnt);
ahd              5026 dev/ic/aic79xx.c ahd_reinitialize_dataptrs(struct ahd_softc *ahd)
ahd              5036 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_DFF0_MSK|AHD_MODE_DFF1_MSK,
ahd              5039 dev/ic/aic79xx.c 	scb_index = ahd_get_scbptr(ahd);
ahd              5040 dev/ic/aic79xx.c 	scb = ahd_lookup_scb(ahd, scb_index);
ahd              5046 dev/ic/aic79xx.c 	ahd_outb(ahd, DFFSXFRCTL, CLRCHN);
ahd              5048 dev/ic/aic79xx.c 	while (--wait && !(ahd_inb(ahd, MDFFSTAT) & FIFOFREE))
ahd              5051 dev/ic/aic79xx.c 		ahd_print_path(ahd, scb);
ahd              5053 dev/ic/aic79xx.c 		ahd_outb(ahd, DFFSXFRCTL, RSTCHN|CLRSHCNT);
ahd              5055 dev/ic/aic79xx.c 	saved_modes = ahd_save_modes(ahd);
ahd              5056 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              5057 dev/ic/aic79xx.c 	ahd_outb(ahd, DFFSTAT,
ahd              5058 dev/ic/aic79xx.c 		 ahd_inb(ahd, DFFSTAT)
ahd              5065 dev/ic/aic79xx.c 	sgptr = ahd_inl_scbram(ahd, SCB_RESIDUAL_SGPTR);
ahd              5068 dev/ic/aic79xx.c 	resid = (ahd_inb_scbram(ahd, SCB_RESIDUAL_DATACNT + 2) << 16)
ahd              5069 dev/ic/aic79xx.c 	      | (ahd_inb_scbram(ahd, SCB_RESIDUAL_DATACNT + 1) << 8)
ahd              5070 dev/ic/aic79xx.c 	      | ahd_inb_scbram(ahd, SCB_RESIDUAL_DATACNT);
ahd              5072 dev/ic/aic79xx.c 	if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0) {
ahd              5075 dev/ic/aic79xx.c 		sg = ahd_sg_bus_to_virt(ahd, scb, sgptr);
ahd              5083 dev/ic/aic79xx.c 		ahd_outl(ahd, HADDR + 4, dataptr >> 32);
ahd              5087 dev/ic/aic79xx.c 		sg = ahd_sg_bus_to_virt(ahd, scb, sgptr);
ahd              5095 dev/ic/aic79xx.c 		ahd_outb(ahd, HADDR + 4,
ahd              5098 dev/ic/aic79xx.c 	ahd_outl(ahd, HADDR, dataptr);
ahd              5099 dev/ic/aic79xx.c 	ahd_outb(ahd, HCNT + 2, resid >> 16);
ahd              5100 dev/ic/aic79xx.c 	ahd_outb(ahd, HCNT + 1, resid >> 8);
ahd              5101 dev/ic/aic79xx.c 	ahd_outb(ahd, HCNT, resid);
ahd              5108 dev/ic/aic79xx.c ahd_handle_devreset(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
ahd              5117 dev/ic/aic79xx.c 	found = ahd_abort_scbs(ahd, devinfo->target, devinfo->channel,
ahd              5126 dev/ic/aic79xx.c 	tstate = ahd->enabled_targets[devinfo->our_scsiid];
ahd              5145 dev/ic/aic79xx.c 			ahd_queue_lstate_event(ahd, lstate, devinfo->our_scsiid,
ahd              5147 dev/ic/aic79xx.c 			ahd_send_lstate_events(ahd, lstate);
ahd              5155 dev/ic/aic79xx.c 	ahd_set_width(ahd, devinfo, MSG_EXT_WDTR_BUS_8_BIT,
ahd              5157 dev/ic/aic79xx.c 	ahd_set_syncrate(ahd, devinfo, /*period*/0, /*offset*/0,
ahd              5163 dev/ic/aic79xx.c 		ahd_send_async(ahd, devinfo->channel, devinfo->target,
ahd              5169 dev/ic/aic79xx.c 		printf("%s: %s on %c:%d. %d SCBs aborted\n", ahd_name(ahd),
ahd              5175 dev/ic/aic79xx.c ahd_setup_target_msgin(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
ahd              5184 dev/ic/aic79xx.c 	ahd->msgout_index = 0;
ahd              5185 dev/ic/aic79xx.c 	ahd->msgout_len = 0;
ahd              5188 dev/ic/aic79xx.c 		ahd_build_transfer_msg(ahd, devinfo);
ahd              5192 dev/ic/aic79xx.c 	ahd->msgout_index = 0;
ahd              5193 dev/ic/aic79xx.c 	ahd->msg_type = MSG_TYPE_TARGET_MSGIN;
ahd              5198 dev/ic/aic79xx.c ahd_sglist_size(struct ahd_softc *ahd)
ahd              5203 dev/ic/aic79xx.c 	if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0)
ahd              5215 dev/ic/aic79xx.c ahd_sglist_allocsize(struct ahd_softc *ahd)
ahd              5223 dev/ic/aic79xx.c 	sg_list_increment = ahd_sglist_size(ahd);
ahd              5261 dev/ic/aic79xx.c 	struct ahd_softc *ahd = (struct ahd_softc *)platform_arg;
ahd              5263 dev/ic/aic79xx.c 	ahd->seep_config = malloc(sizeof(*ahd->seep_config),
ahd              5265 dev/ic/aic79xx.c 	if (ahd->seep_config == NULL)
ahd              5268 dev/ic/aic79xx.c 	LIST_INIT(&ahd->pending_scbs);
ahd              5269 dev/ic/aic79xx.c 	LIST_INIT(&ahd->timedout_scbs);
ahd              5272 dev/ic/aic79xx.c 	ahd->name = name;
ahd              5273 dev/ic/aic79xx.c 	ahd->unit = -1;
ahd              5274 dev/ic/aic79xx.c 	ahd->bus_description = NULL;
ahd              5275 dev/ic/aic79xx.c 	ahd->channel = 'A';
ahd              5276 dev/ic/aic79xx.c 	ahd->chip = AHD_NONE;
ahd              5277 dev/ic/aic79xx.c 	ahd->features = AHD_FENONE;
ahd              5278 dev/ic/aic79xx.c 	ahd->bugs = AHD_BUGNONE;
ahd              5279 dev/ic/aic79xx.c 	ahd->flags = AHD_SPCHK_ENB_A|AHD_RESET_BUS_A|AHD_TERM_ENB_A
ahd              5281 dev/ic/aic79xx.c 	ahd->int_coalescing_timer = AHD_INT_COALESCING_TIMER_DEFAULT;
ahd              5282 dev/ic/aic79xx.c 	ahd->int_coalescing_maxcmds = AHD_INT_COALESCING_MAXCMDS_DEFAULT;
ahd              5283 dev/ic/aic79xx.c 	ahd->int_coalescing_mincmds = AHD_INT_COALESCING_MINCMDS_DEFAULT;
ahd              5284 dev/ic/aic79xx.c 	ahd->int_coalescing_threshold = AHD_INT_COALESCING_THRESHOLD_DEFAULT;
ahd              5285 dev/ic/aic79xx.c 	ahd->int_coalescing_stop_threshold =
ahd              5288 dev/ic/aic79xx.c 	if (ahd_platform_alloc(ahd, platform_arg) != 0) {
ahd              5289 dev/ic/aic79xx.c 		free(ahd->seep_config, M_DEVBUF);
ahd              5296 dev/ic/aic79xx.c 		       ahd_name(ahd), (u_int)sizeof(struct scb),
ahd              5300 dev/ic/aic79xx.c 	return (ahd);
ahd              5304 dev/ic/aic79xx.c ahd_softc_init(struct ahd_softc *ahd)
ahd              5307 dev/ic/aic79xx.c 	ahd->unpause = 0;
ahd              5308 dev/ic/aic79xx.c 	ahd->pause = PAUSE; 
ahd              5313 dev/ic/aic79xx.c ahd_softc_insert(struct ahd_softc *ahd)
ahd              5322 dev/ic/aic79xx.c 	if ((ahd->features & AHD_MULTI_FUNC) != 0) {
ahd              5328 dev/ic/aic79xx.c 			pci = ahd->dev_softc;
ahd              5336 dev/ic/aic79xx.c 					slave = ahd;
ahd              5338 dev/ic/aic79xx.c 					master = ahd;
ahd              5355 dev/ic/aic79xx.c 	    && ahd_softc_comp(ahd, list_ahd) <= 0)
ahd              5358 dev/ic/aic79xx.c 		TAILQ_INSERT_BEFORE(list_ahd, ahd, links);
ahd              5360 dev/ic/aic79xx.c 		TAILQ_INSERT_TAIL(&ahd_tailq, ahd, links);
ahd              5361 dev/ic/aic79xx.c 	ahd->init_level++;
ahd              5369 dev/ic/aic79xx.c ahd_find_softc(struct ahd_softc *ahd)
ahd              5374 dev/ic/aic79xx.c 		if (list_ahd == ahd)
ahd              5375 dev/ic/aic79xx.c 			return (ahd);
ahd              5381 dev/ic/aic79xx.c ahd_set_unit(struct ahd_softc *ahd, int unit)
ahd              5383 dev/ic/aic79xx.c 	ahd->unit = unit;
ahd              5387 dev/ic/aic79xx.c ahd_set_name(struct ahd_softc *ahd, char *name)
ahd              5389 dev/ic/aic79xx.c 	if (ahd->name != NULL)
ahd              5390 dev/ic/aic79xx.c 		free(ahd->name, M_DEVBUF);
ahd              5391 dev/ic/aic79xx.c 	ahd->name = name;
ahd              5395 dev/ic/aic79xx.c ahd_free(struct ahd_softc *ahd)
ahd              5399 dev/ic/aic79xx.c 	switch (ahd->init_level) {
ahd              5402 dev/ic/aic79xx.c 		ahd_shutdown(ahd);
ahd              5403 dev/ic/aic79xx.c 		TAILQ_REMOVE(&ahd_tailq, ahd, links);
ahd              5406 dev/ic/aic79xx.c 		ahd_freedmamem(ahd, &ahd->shared_data_map);
ahd              5412 dev/ic/aic79xx.c 	ahd_platform_free(ahd);
ahd              5413 dev/ic/aic79xx.c 	ahd_fini_scbdata(ahd);
ahd              5417 dev/ic/aic79xx.c 		tstate = ahd->enabled_targets[i];
ahd              5436 dev/ic/aic79xx.c 	if (ahd->black_hole != NULL) {
ahd              5437 dev/ic/aic79xx.c 		xpt_free_path(ahd->black_hole->path);
ahd              5438 dev/ic/aic79xx.c 		free(ahd->black_hole, M_DEVBUF);
ahd              5441 dev/ic/aic79xx.c 	if (ahd->seep_config != NULL)
ahd              5442 dev/ic/aic79xx.c 		free(ahd->seep_config, M_DEVBUF);
ahd              5443 dev/ic/aic79xx.c 	if (ahd->saved_stack != NULL)
ahd              5444 dev/ic/aic79xx.c 		free(ahd->saved_stack, M_DEVBUF);
ahd              5451 dev/ic/aic79xx.c 	struct	ahd_softc *ahd;
ahd              5453 dev/ic/aic79xx.c 	ahd = (struct ahd_softc *)arg;
ahd              5458 dev/ic/aic79xx.c 	aic_timer_stop(&ahd->reset_timer);
ahd              5459 dev/ic/aic79xx.c 	aic_timer_stop(&ahd->stat_timer);
ahd              5462 dev/ic/aic79xx.c 	ahd_reset(ahd, /*reinit*/FALSE);
ahd              5475 dev/ic/aic79xx.c ahd_reset(struct ahd_softc *ahd, int reinit)
ahd              5477 dev/ic/aic79xx.c 	const pci_chipset_tag_t pc = ahd->dev_softc->pa_pc;
ahd              5478 dev/ic/aic79xx.c 	const pcitag_t tag = ahd->dev_softc->pa_tag;
ahd              5488 dev/ic/aic79xx.c 	ahd_pause(ahd);
ahd              5489 dev/ic/aic79xx.c 	ahd_update_modes(ahd);
ahd              5490 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              5491 dev/ic/aic79xx.c 	sxfrctl1 = ahd_inb(ahd, SXFRCTL1);
ahd              5495 dev/ic/aic79xx.c 	if ((ahd->bugs & AHD_PCIX_CHIPRST_BUG) != 0) {
ahd              5510 dev/ic/aic79xx.c 	ahd_outb(ahd, HCNTRL, CHIPRST | ahd->pause);
ahd              5521 dev/ic/aic79xx.c 	} while (--wait && !(ahd_inb(ahd, HCNTRL) & CHIPRSTACK));
ahd              5525 dev/ic/aic79xx.c 		       "Trying to initialize anyway.\n", ahd_name(ahd));
ahd              5527 dev/ic/aic79xx.c 	ahd_outb(ahd, HCNTRL, ahd->pause);
ahd              5529 dev/ic/aic79xx.c 	if ((ahd->bugs & AHD_PCIX_CHIPRST_BUG) != 0) {
ahd              5547 dev/ic/aic79xx.c 	ahd_known_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              5548 dev/ic/aic79xx.c 	ahd_outb(ahd, MODE_PTR,
ahd              5549 dev/ic/aic79xx.c 		 ahd_build_mode_state(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI));
ahd              5559 dev/ic/aic79xx.c 	ahd_outb(ahd, SXFRCTL1, sxfrctl1|STPWEN);
ahd              5560 dev/ic/aic79xx.c 	ahd_outb(ahd, SXFRCTL1, sxfrctl1);
ahd              5563 dev/ic/aic79xx.c 	ahd->features &= ~AHD_WIDE;
ahd              5564 dev/ic/aic79xx.c 	if ((ahd_inb(ahd, SBLKCTL) & SELWIDE) != 0)
ahd              5565 dev/ic/aic79xx.c 		ahd->features |= AHD_WIDE;
ahd              5572 dev/ic/aic79xx.c 		ahd_chip_init(ahd);
ahd              5581 dev/ic/aic79xx.c ahd_probe_scbs(struct ahd_softc *ahd) {
ahd              5584 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK),
ahd              5589 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, i);
ahd              5590 dev/ic/aic79xx.c 		ahd_outw(ahd, SCB_BASE, i);
ahd              5592 dev/ic/aic79xx.c 			ahd_outb(ahd, SCB_BASE+j, 0);
ahd              5594 dev/ic/aic79xx.c 		ahd_outb(ahd, SCB_CONTROL, MK_MESSAGE);
ahd              5595 dev/ic/aic79xx.c 		if (ahd_inw_scbram(ahd, SCB_BASE) != i)
ahd              5597 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, 0);
ahd              5598 dev/ic/aic79xx.c 		if (ahd_inw_scbram(ahd, SCB_BASE) != 0)
ahd              5605 dev/ic/aic79xx.c ahd_initialize_hscbs(struct ahd_softc *ahd)
ahd              5609 dev/ic/aic79xx.c 	for (i = 0; i < ahd->scb_data.maxhscbs; i++) {
ahd              5610 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, i);
ahd              5613 dev/ic/aic79xx.c 		ahd_outb(ahd, SCB_CONTROL, 0);
ahd              5616 dev/ic/aic79xx.c 		ahd_outw(ahd, SCB_NEXT, SCB_LIST_NULL);
ahd              5621 dev/ic/aic79xx.c ahd_init_scbdata(struct ahd_softc *ahd)
ahd              5626 dev/ic/aic79xx.c 	scb_data = &ahd->scb_data;
ahd              5636 dev/ic/aic79xx.c 	scb_data->maxhscbs = ahd_probe_scbs(ahd);
ahd              5638 dev/ic/aic79xx.c 		printf("%s: No SCB space found\n", ahd_name(ahd));
ahd              5642 dev/ic/aic79xx.c 	ahd_initialize_hscbs(ahd);
ahd              5657 dev/ic/aic79xx.c 		ahd_alloc_scbs(ahd);
ahd              5664 dev/ic/aic79xx.c 		       ahd_name(ahd));
ahd              5679 dev/ic/aic79xx.c ahd_find_scb_by_tag(struct ahd_softc *ahd, u_int tag)
ahd              5686 dev/ic/aic79xx.c 	LIST_FOREACH(scb, &ahd->pending_scbs, pending_links) {
ahd              5694 dev/ic/aic79xx.c 	TAILQ_FOREACH(scb, &ahd->scb_data.free_scbs, links.tqe) {
ahd              5708 dev/ic/aic79xx.c 	LIST_FOREACH(scb, &ahd->scb_data.any_dev_free_scb_list, links.le) {
ahd              5717 dev/ic/aic79xx.c ahd_fini_scbdata(struct ahd_softc *ahd)
ahd              5721 dev/ic/aic79xx.c 	scb_data = &ahd->scb_data;
ahd              5733 dev/ic/aic79xx.c 			ahd_freedmamem(ahd, sns_map);
ahd              5744 dev/ic/aic79xx.c 			ahd_freedmamem(ahd, sg_map);
ahd              5755 dev/ic/aic79xx.c 			ahd_freedmamem(ahd, hscb_map);
ahd              5770 dev/ic/aic79xx.c ahd_setup_iocell_workaround(struct ahd_softc *ahd)
ahd              5774 dev/ic/aic79xx.c 	saved_modes = ahd_save_modes(ahd);
ahd              5775 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
ahd              5776 dev/ic/aic79xx.c 	ahd_outb(ahd, DSPDATACTL, ahd_inb(ahd, DSPDATACTL)
ahd              5778 dev/ic/aic79xx.c 	ahd_outb(ahd, SIMODE0, ahd_inb(ahd, SIMODE0) | (ENSELDO|ENSELDI));
ahd              5781 dev/ic/aic79xx.c 		printf("%s: Setting up iocell workaround\n", ahd_name(ahd));
ahd              5783 dev/ic/aic79xx.c 	ahd_restore_modes(ahd, saved_modes);
ahd              5784 dev/ic/aic79xx.c 	ahd->flags &= ~AHD_HAD_FIRST_SEL;
ahd              5788 dev/ic/aic79xx.c ahd_iocell_first_selection(struct ahd_softc *ahd)
ahd              5793 dev/ic/aic79xx.c 	if ((ahd->flags & AHD_HAD_FIRST_SEL) != 0)
ahd              5795 dev/ic/aic79xx.c 	saved_modes = ahd_save_modes(ahd);
ahd              5796 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              5797 dev/ic/aic79xx.c 	sblkctl = ahd_inb(ahd, SBLKCTL);
ahd              5798 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
ahd              5801 dev/ic/aic79xx.c 		printf("%s: iocell first selection\n", ahd_name(ahd));
ahd              5804 dev/ic/aic79xx.c 		ahd_outb(ahd, DSPDATACTL,
ahd              5805 dev/ic/aic79xx.c 			 ahd_inb(ahd, DSPDATACTL) & ~BYPASSENAB);
ahd              5808 dev/ic/aic79xx.c 			printf("%s: BYPASS now disabled\n", ahd_name(ahd));
ahd              5811 dev/ic/aic79xx.c 	ahd_outb(ahd, SIMODE0, ahd_inb(ahd, SIMODE0) & ~(ENSELDO|ENSELDI));
ahd              5812 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRINT, CLRSCSIINT);
ahd              5813 dev/ic/aic79xx.c 	ahd_restore_modes(ahd, saved_modes);
ahd              5814 dev/ic/aic79xx.c 	ahd->flags |= AHD_HAD_FIRST_SEL;
ahd              5819 dev/ic/aic79xx.c ahd_add_col_list(struct ahd_softc *ahd, struct scb *scb, u_int col_idx)
ahd              5827 dev/ic/aic79xx.c 	free_list = &ahd->scb_data.free_scb_lists[col_idx];
ahd              5828 dev/ic/aic79xx.c 	free_tailq = &ahd->scb_data.free_scbs;
ahd              5839 dev/ic/aic79xx.c ahd_rem_col_list(struct ahd_softc *ahd, struct scb *scb)
ahd              5847 dev/ic/aic79xx.c 	col_idx = AHD_GET_SCB_COL_IDX(ahd, scb);
ahd              5848 dev/ic/aic79xx.c 	free_list = &ahd->scb_data.free_scb_lists[col_idx];
ahd              5849 dev/ic/aic79xx.c 	free_tailq = &ahd->scb_data.free_scbs;
ahd              5873 dev/ic/aic79xx.c ahd_get_scb(struct ahd_softc *ahd, u_int col_idx)
ahd              5877 dev/ic/aic79xx.c 	TAILQ_FOREACH(scb, &ahd->scb_data.free_scbs, links.tqe) {
ahd              5878 dev/ic/aic79xx.c 		if (AHD_GET_SCB_COL_IDX(ahd, scb) != col_idx) {
ahd              5879 dev/ic/aic79xx.c 			ahd_rem_col_list(ahd, scb);
ahd              5883 dev/ic/aic79xx.c 	if ((scb = LIST_FIRST(&ahd->scb_data.any_dev_free_scb_list)) == NULL) {
ahd              5892 dev/ic/aic79xx.c 		ahd_add_col_list(ahd, scb->col_scb, col_idx);
ahd              5903 dev/ic/aic79xx.c ahd_free_scb(struct ahd_softc *ahd, struct scb *scb)
ahd              5909 dev/ic/aic79xx.c 	ahd->scb_data.scbindex[SCB_GET_TAG(scb)] = NULL;
ahd              5916 dev/ic/aic79xx.c 		LIST_INSERT_HEAD(&ahd->scb_data.any_dev_free_scb_list,
ahd              5925 dev/ic/aic79xx.c 		ahd_rem_col_list(ahd, scb->col_scb);
ahd              5926 dev/ic/aic79xx.c 		LIST_INSERT_HEAD(&ahd->scb_data.any_dev_free_scb_list,
ahd              5928 dev/ic/aic79xx.c 		LIST_INSERT_HEAD(&ahd->scb_data.any_dev_free_scb_list,
ahd              5939 dev/ic/aic79xx.c 		ahd_add_col_list(ahd, scb,
ahd              5940 dev/ic/aic79xx.c 				 AHD_GET_SCB_COL_IDX(ahd, scb->col_scb));
ahd              5948 dev/ic/aic79xx.c 		LIST_INSERT_HEAD(&ahd->scb_data.any_dev_free_scb_list,
ahd              5952 dev/ic/aic79xx.c 	aic_platform_scb_free(ahd, scb);
ahd              5956 dev/ic/aic79xx.c ahd_alloc_scbs(struct ahd_softc *ahd)
ahd              5972 dev/ic/aic79xx.c 	scb_data = &ahd->scb_data;
ahd              5992 dev/ic/aic79xx.c 		if (ahd_createdmamem(ahd, PAGE_SIZE, hscb_map,
ahd              6010 dev/ic/aic79xx.c 		offset = ((ahd_sglist_allocsize(ahd) / ahd_sglist_size(ahd))
ahd              6011 dev/ic/aic79xx.c 		       - scb_data->sgs_left) * ahd_sglist_size(ahd);
ahd              6022 dev/ic/aic79xx.c 		if (ahd_createdmamem(ahd, ahd_sglist_allocsize(ahd), sg_map,
ahd              6033 dev/ic/aic79xx.c 		    ahd_sglist_allocsize(ahd) / ahd_sglist_size(ahd);
ahd              6036 dev/ic/aic79xx.c 			printf("%s: ahd_alloc_scbs - Mapped SG data\n", ahd_name(ahd));
ahd              6056 dev/ic/aic79xx.c 		if (ahd_createdmamem(ahd, PAGE_SIZE, sense_map,
ahd              6069 dev/ic/aic79xx.c 			printf("%s: ahd_alloc_scbs - Mapped sense data\n", ahd_name(ahd));
ahd              6118 dev/ic/aic79xx.c 		if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0)
ahd              6123 dev/ic/aic79xx.c 		next_scb->ahd_softc = ahd;
ahd              6126 dev/ic/aic79xx.c 		error = bus_dmamap_create(ahd->parent_dmat,
ahd              6137 dev/ic/aic79xx.c 		next_scb->col_scb = ahd_find_scb_by_tag(ahd, col_tag);
ahd              6140 dev/ic/aic79xx.c 		ahd_free_scb(ahd, next_scb);
ahd              6143 dev/ic/aic79xx.c 		segs += ahd_sglist_size(ahd);
ahd              6144 dev/ic/aic79xx.c 		sg_busaddr += ahd_sglist_size(ahd);
ahd              6152 dev/ic/aic79xx.c ahd_controller_info(struct ahd_softc *ahd, char *buf, size_t bufsz)
ahd              6155 dev/ic/aic79xx.c 	    ahd_name(ahd), ahd_chip_names[ahd->chip & AHD_CHIPID_MASK],
ahd              6156 dev/ic/aic79xx.c 	    ((ahd->features & AHD_WIDE) != 0) ? "Wide" : "Single",
ahd              6157 dev/ic/aic79xx.c 	    ahd->channel, ahd->our_id, ahd->bus_description,
ahd              6158 dev/ic/aic79xx.c 	    ahd->scb_data.maxhscbs);
ahd              6179 dev/ic/aic79xx.c ahd_init(struct ahd_softc *ahd)
ahd              6190 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
ahd              6192 dev/ic/aic79xx.c 	ahd->stack_size = ahd_probe_stack_size(ahd);
ahd              6193 dev/ic/aic79xx.c 	ahd->saved_stack = malloc(ahd->stack_size * sizeof(uint16_t),
ahd              6195 dev/ic/aic79xx.c 	if (ahd->saved_stack == NULL)
ahd              6199 dev/ic/aic79xx.c         memset(ahd->saved_stack, 0, ahd->stack_size * sizeof(uint16_t));
ahd              6210 dev/ic/aic79xx.c 		ahd->flags |= AHD_SEQUENCER_DEBUG;
ahd              6216 dev/ic/aic79xx.c 	ahd->flags |= AHD_INITIATORROLE;
ahd              6221 dev/ic/aic79xx.c 	if ((AHD_TMODE_ENABLE & (0x1 << ahd->unit)) == 0)
ahd              6222 dev/ic/aic79xx.c 		ahd->features &= ~AHD_TARGETMODE;
ahd              6231 dev/ic/aic79xx.c 	driver_data_size = AHD_SCB_MAX * sizeof(*ahd->qoutfifo)
ahd              6233 dev/ic/aic79xx.c 	if ((ahd->features & AHD_TARGETMODE) != 0)
ahd              6235 dev/ic/aic79xx.c 	if ((ahd->bugs & AHD_PKT_BITBUCKET_BUG) != 0)
ahd              6237 dev/ic/aic79xx.c         if (ahd_createdmamem(ahd, driver_data_size, &ahd->shared_data_map,
ahd              6241 dev/ic/aic79xx.c 	ahd->qoutfifo = (struct ahd_completion *)ahd->shared_data_map.vaddr;
ahd              6243 dev/ic/aic79xx.c 	ahd->init_level++;
ahd              6245 dev/ic/aic79xx.c 	next_vaddr = (uint8_t *)&ahd->qoutfifo[AHD_QOUT_SIZE];
ahd              6246 dev/ic/aic79xx.c 	next_baddr = ahd->shared_data_map.busaddr
ahd              6248 dev/ic/aic79xx.c 	if ((ahd->features & AHD_TARGETMODE) != 0) {
ahd              6249 dev/ic/aic79xx.c 		ahd->targetcmds = (struct target_cmd *)next_vaddr;
ahd              6254 dev/ic/aic79xx.c 	if ((ahd->bugs & AHD_PKT_BITBUCKET_BUG) != 0) {
ahd              6255 dev/ic/aic79xx.c 		ahd->overrun_buf = next_vaddr;
ahd              6267 dev/ic/aic79xx.c 	ahd->next_queued_hscb = (struct hardware_scb *)next_vaddr;
ahd              6268 dev/ic/aic79xx.c 	ahd->next_queued_hscb_map = &ahd->shared_data_map;
ahd              6269 dev/ic/aic79xx.c 	ahd->next_queued_hscb->hscb_busaddr = aic_htole32(next_baddr);
ahd              6272 dev/ic/aic79xx.c 	if (ahd_init_scbdata(ahd) != 0)
ahd              6275 dev/ic/aic79xx.c 	if ((ahd->flags & AHD_INITIATORROLE) == 0)
ahd              6276 dev/ic/aic79xx.c 		ahd->flags &= ~AHD_RESET_BUS_A;
ahd              6282 dev/ic/aic79xx.c 	ahd_platform_init(ahd);
ahd              6285 dev/ic/aic79xx.c 	ahd_chip_init(ahd);
ahd              6287 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
ahd              6289 dev/ic/aic79xx.c 	if ((ahd->flags & AHD_CURRENT_SENSING) == 0)
ahd              6296 dev/ic/aic79xx.c 	error = ahd_write_flexport(ahd, FLXADDR_ROMSTAT_CURSENSECTL,
ahd              6299 dev/ic/aic79xx.c 		printf("%s: current sensing timeout 1\n", ahd_name(ahd));
ahd              6304 dev/ic/aic79xx.c 		error = ahd_read_flexport(ahd, FLXADDR_FLEXSTAT, &fstat);
ahd              6307 dev/ic/aic79xx.c 			       ahd_name(ahd));
ahd              6313 dev/ic/aic79xx.c 		       ahd_name(ahd));
ahd              6318 dev/ic/aic79xx.c 	error = ahd_read_flexport(ahd, FLXADDR_CURRENT_STAT, &current_sensing);
ahd              6320 dev/ic/aic79xx.c 		printf("%s: current sensing timeout 3\n", ahd_name(ahd));
ahd              6325 dev/ic/aic79xx.c 	ahd_write_flexport(ahd, FLXADDR_ROMSTAT_CURSENSECTL, 0);
ahd              6330 dev/ic/aic79xx.c 		       ahd_name(ahd), current_sensing);
ahd              6346 dev/ic/aic79xx.c 			printf("%s: %s Channel %s\n", ahd_name(ahd),
ahd              6354 dev/ic/aic79xx.c 		       ahd_name(ahd), ahd_name(ahd));
ahd              6357 dev/ic/aic79xx.c 	ahd_reset_current_bus(ahd);
ahd              6358 dev/ic/aic79xx.c 	ahd_restart(ahd);
ahd              6359 dev/ic/aic79xx.c 	aic_timer_reset(&ahd->stat_timer, AHD_STAT_UPDATE_MS,
ahd              6360 dev/ic/aic79xx.c 			ahd_stat_timer, ahd);
ahd              6363 dev/ic/aic79xx.c         ahd->shutdown_hook = shutdownhook_establish(ahd_shutdown, ahd);
ahd              6371 dev/ic/aic79xx.c ahd_chip_init(struct ahd_softc *ahd)
ahd              6380 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              6384 dev/ic/aic79xx.c 	ahd_outb(ahd, SBLKCTL, ahd_inb(ahd, SBLKCTL) & ~(DIAGLEDEN|DIAGLEDON));
ahd              6389 dev/ic/aic79xx.c 	ahd->hs_mailbox = 0;
ahd              6390 dev/ic/aic79xx.c 	ahd_outb(ahd, HS_MAILBOX, 0);
ahd              6393 dev/ic/aic79xx.c 	ahd_outb(ahd, IOWNID, ahd->our_id);
ahd              6394 dev/ic/aic79xx.c 	ahd_outb(ahd, TOWNID, ahd->our_id);
ahd              6395 dev/ic/aic79xx.c 	sxfrctl1 = (ahd->flags & AHD_TERM_ENB_A) != 0 ? STPWEN : 0;
ahd              6396 dev/ic/aic79xx.c 	sxfrctl1 |= (ahd->flags & AHD_SPCHK_ENB_A) != 0 ? ENSPCHK : 0;
ahd              6397 dev/ic/aic79xx.c 	if ((ahd->bugs & AHD_LONG_SETIMO_BUG)
ahd              6398 dev/ic/aic79xx.c 	 && (ahd->seltime != STIMESEL_MIN)) {
ahd              6404 dev/ic/aic79xx.c 		sxfrctl1 |= ahd->seltime + STIMESEL_BUG_ADJ;
ahd              6406 dev/ic/aic79xx.c 		sxfrctl1 |= ahd->seltime;
ahd              6409 dev/ic/aic79xx.c 	ahd_outb(ahd, SXFRCTL0, DFON);
ahd              6410 dev/ic/aic79xx.c 	ahd_outb(ahd, SXFRCTL1, sxfrctl1|ahd->seltime|ENSTIMER|ACTNEGEN);
ahd              6411 dev/ic/aic79xx.c 	ahd_outb(ahd, SIMODE1, ENSELTIMO|ENSCSIRST|ENSCSIPERR);
ahd              6421 dev/ic/aic79xx.c 	     (ahd_inb(ahd, SBLKCTL) & (ENAB40|ENAB20)) == 0 && wait;
ahd              6426 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRSINT1, CLRSCSIRSTI);
ahd              6427 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRINT, CLRSCSIINT);
ahd              6431 dev/ic/aic79xx.c 		ahd_set_modes(ahd, AHD_MODE_DFF0 + i, AHD_MODE_DFF0 + i);
ahd              6432 dev/ic/aic79xx.c 		ahd_outb(ahd, LONGJMP_ADDR + 1, INVALID_ADDR);
ahd              6433 dev/ic/aic79xx.c 		ahd_outb(ahd, SG_STATE, 0);
ahd              6434 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRSEQINTSRC, 0xFF);
ahd              6435 dev/ic/aic79xx.c 		ahd_outb(ahd, SEQIMODE,
ahd              6440 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
ahd              6441 dev/ic/aic79xx.c 	ahd_outb(ahd, DSCOMMAND0, ahd_inb(ahd, DSCOMMAND0)|MPARCKEN|CACHETHEN);
ahd              6442 dev/ic/aic79xx.c 	ahd_outb(ahd, DFF_THRSH, RD_DFTHRSH_75|WR_DFTHRSH_75);
ahd              6443 dev/ic/aic79xx.c 	ahd_outb(ahd, SIMODE0, ENIOERR|ENOVERRUN);
ahd              6444 dev/ic/aic79xx.c 	ahd_outb(ahd, SIMODE3, ENNTRAMPERR|ENOSRAMPERR);
ahd              6445 dev/ic/aic79xx.c 	if ((ahd->bugs & AHD_BUSFREEREV_BUG) != 0) {
ahd              6446 dev/ic/aic79xx.c 		ahd_outb(ahd, OPTIONMODE, AUTOACKEN|AUTO_MSGOUT_DE);
ahd              6448 dev/ic/aic79xx.c 		ahd_outb(ahd, OPTIONMODE, AUTOACKEN|BUSFREEREV|AUTO_MSGOUT_DE);
ahd              6450 dev/ic/aic79xx.c 	ahd_outb(ahd, SCSCHKN, CURRFIFODEF|WIDERESEN|SHVALIDSTDIS);
ahd              6451 dev/ic/aic79xx.c 	if ((ahd->chip & AHD_BUS_MASK) == AHD_PCIX)
ahd              6457 dev/ic/aic79xx.c 		ahd_outb(ahd, PCIXCTL, ahd_inb(ahd, PCIXCTL) | SPLTSTADIS);
ahd              6459 dev/ic/aic79xx.c 	if ((ahd->bugs & AHD_LQOOVERRUN_BUG) != 0)
ahd              6460 dev/ic/aic79xx.c 		ahd_outb(ahd, LQOSCSCTL, LQONOCHKOVER);
ahd              6465 dev/ic/aic79xx.c 	if ((ahd->flags & AHD_HP_BOARD) != 0) {
ahd              6467 dev/ic/aic79xx.c 			ahd_outb(ahd, DSPSELECT, i);
ahd              6468 dev/ic/aic79xx.c 			ahd_outb(ahd, WRTBIASCTL, WRTBIASCTL_HP_DEFAULT);
ahd              6472 dev/ic/aic79xx.c 			printf("%s: WRTBIASCTL now 0x%x\n", ahd_name(ahd),
ahd              6476 dev/ic/aic79xx.c 	ahd_setup_iocell_workaround(ahd);
ahd              6481 dev/ic/aic79xx.c 	ahd_outb(ahd, LQIMODE1, ENLQIPHASE_LQ|ENLQIPHASE_NLQ|ENLIQABORT
ahd              6484 dev/ic/aic79xx.c 	ahd_outb(ahd, LQOMODE0, ENLQOATNLQ|ENLQOATNPKT|ENLQOTCRC);
ahd              6493 dev/ic/aic79xx.c 	ahd_outb(ahd, LQOMODE1, ENLQOBUSFREE);
ahd              6498 dev/ic/aic79xx.c 	ahd_outw(ahd, INTVEC1_ADDR, ahd_resolve_seqaddr(ahd, LABEL_seq_isr));
ahd              6499 dev/ic/aic79xx.c 	ahd_outw(ahd, INTVEC2_ADDR, ahd_resolve_seqaddr(ahd, LABEL_timer_isr));
ahd              6504 dev/ic/aic79xx.c 	if ((ahd->bugs & AHD_PKT_LUN_BUG) != 0) {
ahd              6505 dev/ic/aic79xx.c 		ahd_outb(ahd, LUNPTR, offsetof(struct hardware_scb,
ahd              6508 dev/ic/aic79xx.c 		ahd_outb(ahd, LUNPTR, offsetof(struct hardware_scb, lun));
ahd              6510 dev/ic/aic79xx.c 	ahd_outb(ahd, CMDLENPTR, offsetof(struct hardware_scb, cdb_len));
ahd              6511 dev/ic/aic79xx.c 	ahd_outb(ahd, ATTRPTR, offsetof(struct hardware_scb, task_attribute));
ahd              6512 dev/ic/aic79xx.c 	ahd_outb(ahd, FLAGPTR, offsetof(struct hardware_scb, task_management));
ahd              6513 dev/ic/aic79xx.c 	ahd_outb(ahd, CMDPTR, offsetof(struct hardware_scb,
ahd              6515 dev/ic/aic79xx.c 	ahd_outb(ahd, QNEXTPTR,
ahd              6517 dev/ic/aic79xx.c 	ahd_outb(ahd, ABRTBITPTR, MK_MESSAGE_BIT_OFFSET);
ahd              6518 dev/ic/aic79xx.c 	ahd_outb(ahd, ABRTBYTEPTR, offsetof(struct hardware_scb, control));
ahd              6519 dev/ic/aic79xx.c 	if ((ahd->bugs & AHD_PKT_LUN_BUG) != 0) {
ahd              6520 dev/ic/aic79xx.c 		ahd_outb(ahd, LUNLEN,
ahd              6521 dev/ic/aic79xx.c 			 sizeof(ahd->next_queued_hscb->pkt_long_lun) - 1);
ahd              6523 dev/ic/aic79xx.c 		ahd_outb(ahd, LUNLEN, LUNLEN_SINGLE_LEVEL_LUN);
ahd              6525 dev/ic/aic79xx.c 	ahd_outb(ahd, CDBLIMIT, SCB_CDB_LEN_PTR - 1);
ahd              6526 dev/ic/aic79xx.c 	ahd_outb(ahd, MAXCMD, 0xFF);
ahd              6527 dev/ic/aic79xx.c 	ahd_outb(ahd, SCBAUTOPTR,
ahd              6531 dev/ic/aic79xx.c 	ahd_outb(ahd, MULTARGID, 0);
ahd              6532 dev/ic/aic79xx.c 	ahd_outb(ahd, MULTARGID + 1, 0);
ahd              6534 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              6536 dev/ic/aic79xx.c 	if ((ahd->features & AHD_NEW_IOCELL_OPTS) == 0) {
ahd              6542 dev/ic/aic79xx.c 			ahd_outb(ahd, NEGOADDR, target);
ahd              6543 dev/ic/aic79xx.c 			ahd_outb(ahd, ANNEXCOL, AHD_ANNEXCOL_PER_DEV0);
ahd              6545 dev/ic/aic79xx.c 				ahd_outb(ahd, ANNEXDAT, 0);
ahd              6553 dev/ic/aic79xx.c 		tinfo = ahd_fetch_transinfo(ahd, 'A', ahd->our_id,
ahd              6555 dev/ic/aic79xx.c 		ahd_compile_devinfo(&devinfo, ahd->our_id,
ahd              6558 dev/ic/aic79xx.c 		ahd_update_neg_table(ahd, &devinfo, &tinfo->curr);
ahd              6561 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRSINT3, NTRAMPERR|OSRAMPERR);
ahd              6562 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRINT, CLRSCSIINT);
ahd              6569 dev/ic/aic79xx.c 	if ((ahd->bugs & AHD_ABORT_LQI_BUG) == 0)
ahd              6570 dev/ic/aic79xx.c 		ahd_outb(ahd, LQCTL1, ABORTPENDING);
ahd              6573 dev/ic/aic79xx.c 		ahd_outb(ahd, LQCTL1, 0);
ahd              6576 dev/ic/aic79xx.c 	ahd->qoutfifonext = 0;
ahd              6577 dev/ic/aic79xx.c 	ahd->qoutfifonext_valid_tag = QOUTFIFO_ENTRY_VALID;
ahd              6578 dev/ic/aic79xx.c 	ahd_outb(ahd, QOUTFIFO_ENTRY_VALID_TAG, QOUTFIFO_ENTRY_VALID);
ahd              6580 dev/ic/aic79xx.c 		ahd->qoutfifo[i].valid_tag = 0;
ahd              6581 dev/ic/aic79xx.c 	ahd_sync_qoutfifo(ahd, BUS_DMASYNC_PREREAD);
ahd              6583 dev/ic/aic79xx.c 	ahd->qinfifonext = 0;
ahd              6585 dev/ic/aic79xx.c 		ahd->qinfifo[i] = SCB_LIST_NULL;
ahd              6587 dev/ic/aic79xx.c 	if ((ahd->features & AHD_TARGETMODE) != 0) {
ahd              6590 dev/ic/aic79xx.c 			ahd->targetcmds[i].cmd_valid = 0;
ahd              6591 dev/ic/aic79xx.c 		ahd_sync_tqinfifo(ahd, BUS_DMASYNC_PREREAD);
ahd              6592 dev/ic/aic79xx.c 		ahd->tqinfifonext = 1;
ahd              6593 dev/ic/aic79xx.c 		ahd_outb(ahd, KERNEL_TQINPOS, ahd->tqinfifonext - 1);
ahd              6594 dev/ic/aic79xx.c 		ahd_outb(ahd, TQINPOS, ahd->tqinfifonext);
ahd              6598 dev/ic/aic79xx.c 	ahd_outb(ahd, SEQ_FLAGS, 0);
ahd              6599 dev/ic/aic79xx.c 	ahd_outb(ahd, SEQ_FLAGS2, 0);
ahd              6602 dev/ic/aic79xx.c 	ahd_outw(ahd, WAITING_TID_HEAD, SCB_LIST_NULL);
ahd              6603 dev/ic/aic79xx.c 	ahd_outw(ahd, WAITING_TID_TAIL, SCB_LIST_NULL);
ahd              6604 dev/ic/aic79xx.c 	ahd_outw(ahd, MK_MESSAGE_SCB, SCB_LIST_NULL);
ahd              6605 dev/ic/aic79xx.c 	ahd_outw(ahd, MK_MESSAGE_SCSIID, 0xFF);
ahd              6607 dev/ic/aic79xx.c 		ahd_outw(ahd, WAITING_SCB_TAILS + (2 * i), SCB_LIST_NULL);
ahd              6612 dev/ic/aic79xx.c 	ahd_outw(ahd, COMPLETE_SCB_HEAD, SCB_LIST_NULL);
ahd              6613 dev/ic/aic79xx.c 	ahd_outw(ahd, COMPLETE_SCB_DMAINPROG_HEAD, SCB_LIST_NULL);
ahd              6614 dev/ic/aic79xx.c 	ahd_outw(ahd, COMPLETE_DMA_SCB_HEAD, SCB_LIST_NULL);
ahd              6615 dev/ic/aic79xx.c 	ahd_outw(ahd, COMPLETE_DMA_SCB_TAIL, SCB_LIST_NULL);
ahd              6616 dev/ic/aic79xx.c 	ahd_outw(ahd, COMPLETE_ON_QFREEZE_HEAD, SCB_LIST_NULL);
ahd              6621 dev/ic/aic79xx.c 	ahd->qfreeze_cnt = 0;
ahd              6622 dev/ic/aic79xx.c 	ahd_outw(ahd, QFREEZE_COUNT, 0);
ahd              6623 dev/ic/aic79xx.c 	ahd_outw(ahd, KERNEL_QFREEZE_COUNT, 0);
ahd              6628 dev/ic/aic79xx.c 	busaddr = ahd->shared_data_map.busaddr;
ahd              6629 dev/ic/aic79xx.c 	ahd_outl(ahd, SHARED_DATA_ADDR, busaddr);
ahd              6630 dev/ic/aic79xx.c 	ahd_outl(ahd, QOUTFIFO_NEXT_ADDR, busaddr);
ahd              6638 dev/ic/aic79xx.c 	if ((ahd->flags & AHD_INITIATORROLE) != 0)
ahd              6640 dev/ic/aic79xx.c 	ahd_outb(ahd, SCSISEQ_TEMPLATE, scsiseq_template);
ahd              6647 dev/ic/aic79xx.c 			ahd_unbusy_tcl(ahd, BUILD_TCL_RAW(target, 'A', lun));
ahd              6656 dev/ic/aic79xx.c 	ahd_outb(ahd, CMDSIZE_TABLE, 5);
ahd              6657 dev/ic/aic79xx.c 	ahd_outb(ahd, CMDSIZE_TABLE + 1, 9);
ahd              6658 dev/ic/aic79xx.c 	ahd_outb(ahd, CMDSIZE_TABLE + 2, 9);
ahd              6659 dev/ic/aic79xx.c 	ahd_outb(ahd, CMDSIZE_TABLE + 3, 0);
ahd              6660 dev/ic/aic79xx.c 	ahd_outb(ahd, CMDSIZE_TABLE + 4, 15);
ahd              6661 dev/ic/aic79xx.c 	ahd_outb(ahd, CMDSIZE_TABLE + 5, 11);
ahd              6662 dev/ic/aic79xx.c 	ahd_outb(ahd, CMDSIZE_TABLE + 6, 0);
ahd              6663 dev/ic/aic79xx.c 	ahd_outb(ahd, CMDSIZE_TABLE + 7, 0);
ahd              6666 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_CCHAN, AHD_MODE_CCHAN);
ahd              6667 dev/ic/aic79xx.c 	ahd_outb(ahd, QOFF_CTLSTA, SCB_QSIZE_512);
ahd              6668 dev/ic/aic79xx.c 	ahd->qinfifonext = 0;
ahd              6669 dev/ic/aic79xx.c 	ahd_set_hnscb_qoff(ahd, ahd->qinfifonext);
ahd              6670 dev/ic/aic79xx.c 	ahd_set_hescb_qoff(ahd, 0);
ahd              6671 dev/ic/aic79xx.c 	ahd_set_snscb_qoff(ahd, 0);
ahd              6672 dev/ic/aic79xx.c 	ahd_set_sescb_qoff(ahd, 0);
ahd              6673 dev/ic/aic79xx.c 	ahd_set_sdscb_qoff(ahd, 0);
ahd              6678 dev/ic/aic79xx.c 	busaddr = aic_le32toh(ahd->next_queued_hscb->hscb_busaddr);
ahd              6679 dev/ic/aic79xx.c 	ahd_outl(ahd, NEXT_QUEUED_SCB_ADDR, busaddr);
ahd              6684 dev/ic/aic79xx.c 	ahd_outw(ahd, INT_COALESCING_CMDCOUNT, 0);
ahd              6685 dev/ic/aic79xx.c 	ahd_outw(ahd, CMDS_PENDING, 0);
ahd              6686 dev/ic/aic79xx.c 	ahd_update_coalescing_values(ahd, ahd->int_coalescing_timer,
ahd              6687 dev/ic/aic79xx.c 				     ahd->int_coalescing_maxcmds,
ahd              6688 dev/ic/aic79xx.c 				     ahd->int_coalescing_mincmds);
ahd              6689 dev/ic/aic79xx.c 	ahd_enable_coalescing(ahd, FALSE);
ahd              6691 dev/ic/aic79xx.c 	ahd_loadseq(ahd);
ahd              6692 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              6701 dev/ic/aic79xx.c ahd_default_config(struct ahd_softc *ahd)
ahd              6705 dev/ic/aic79xx.c 	ahd->our_id = 7;
ahd              6712 dev/ic/aic79xx.c 	if (ahd_alloc_tstate(ahd, ahd->our_id, 'A') == NULL) {
ahd              6714 dev/ic/aic79xx.c 		       "Failing attach\n", ahd_name(ahd));
ahd              6724 dev/ic/aic79xx.c 		tinfo = ahd_fetch_transinfo(ahd, 'A', ahd->our_id,
ahd              6733 dev/ic/aic79xx.c 		ahd->user_discenable |= target_mask;
ahd              6735 dev/ic/aic79xx.c 		ahd->user_tagenable |= target_mask;
ahd              6748 dev/ic/aic79xx.c 		if ((ahd->features & AHD_RTI) != 0)
ahd              6761 dev/ic/aic79xx.c 		ahd_compile_devinfo(&devinfo, ahd->our_id,
ahd              6765 dev/ic/aic79xx.c 		ahd_set_width(ahd, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
ahd              6767 dev/ic/aic79xx.c 		ahd_set_syncrate(ahd, &devinfo, /*period*/0, /*offset*/0,
ahd              6778 dev/ic/aic79xx.c ahd_parse_cfgdata(struct ahd_softc *ahd, struct seeprom_config *sc)
ahd              6784 dev/ic/aic79xx.c 	ahd->our_id = sc->brtime_id & CFSCSIID;
ahd              6791 dev/ic/aic79xx.c 	if (ahd_alloc_tstate(ahd, ahd->our_id, 'A') == NULL) {
ahd              6793 dev/ic/aic79xx.c 		       "Failing attach\n", ahd_name(ahd));
ahd              6804 dev/ic/aic79xx.c 		tinfo = ahd_fetch_transinfo(ahd, 'A', ahd->our_id,
ahd              6815 dev/ic/aic79xx.c 		ahd->user_discenable &= ~target_mask;
ahd              6817 dev/ic/aic79xx.c 		ahd->user_tagenable &= ~target_mask;
ahd              6820 dev/ic/aic79xx.c 			ahd->user_discenable |= target_mask;
ahd              6821 dev/ic/aic79xx.c 			ahd->user_tagenable |= target_mask;
ahd              6849 dev/ic/aic79xx.c 			if ((ahd->features & AHD_RTI) != 0)
ahd              6875 dev/ic/aic79xx.c 		ahd_compile_devinfo(&devinfo, ahd->our_id,
ahd              6878 dev/ic/aic79xx.c 		ahd_set_width(ahd, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
ahd              6880 dev/ic/aic79xx.c 		ahd_set_syncrate(ahd, &devinfo, /*period*/0, /*offset*/0,
ahd              6885 dev/ic/aic79xx.c 	ahd->flags &= ~AHD_SPCHK_ENB_A;
ahd              6887 dev/ic/aic79xx.c 		ahd->flags |= AHD_SPCHK_ENB_A;
ahd              6889 dev/ic/aic79xx.c 	ahd->flags &= ~AHD_RESET_BUS_A;
ahd              6891 dev/ic/aic79xx.c 		ahd->flags |= AHD_RESET_BUS_A;
ahd              6893 dev/ic/aic79xx.c 	ahd->flags &= ~AHD_EXTENDED_TRANS_A;
ahd              6895 dev/ic/aic79xx.c 		ahd->flags |= AHD_EXTENDED_TRANS_A;
ahd              6897 dev/ic/aic79xx.c 	ahd->flags &= ~AHD_BIOS_ENABLED;
ahd              6899 dev/ic/aic79xx.c 		ahd->flags |= AHD_BIOS_ENABLED;
ahd              6901 dev/ic/aic79xx.c 	ahd->flags &= ~AHD_STPWLEVEL_A;
ahd              6903 dev/ic/aic79xx.c 		ahd->flags |= AHD_STPWLEVEL_A;
ahd              6912 dev/ic/aic79xx.c ahd_parse_vpddata(struct ahd_softc *ahd, struct vpd_config *vpd)
ahd              6920 dev/ic/aic79xx.c 		ahd->flags |= AHD_BOOT_CHANNEL;
ahd              6925 dev/ic/aic79xx.c ahd_intr_enable(struct ahd_softc *ahd, int enable)
ahd              6929 dev/ic/aic79xx.c 	hcntrl = ahd_inb(ahd, HCNTRL);
ahd              6931 dev/ic/aic79xx.c 	ahd->pause &= ~INTEN;
ahd              6932 dev/ic/aic79xx.c 	ahd->unpause &= ~INTEN;
ahd              6935 dev/ic/aic79xx.c 		ahd->pause |= INTEN;
ahd              6936 dev/ic/aic79xx.c 		ahd->unpause |= INTEN;
ahd              6938 dev/ic/aic79xx.c 	ahd_outb(ahd, HCNTRL, hcntrl);
ahd              6942 dev/ic/aic79xx.c ahd_update_coalescing_values(struct ahd_softc *ahd, u_int timer, u_int maxcmds,
ahd              6947 dev/ic/aic79xx.c 	ahd->int_coalescing_timer = timer;
ahd              6953 dev/ic/aic79xx.c 	ahd->int_coalescing_maxcmds = maxcmds;
ahd              6954 dev/ic/aic79xx.c 	ahd_outw(ahd, INT_COALESCING_TIMER, timer / AHD_TIMER_US_PER_TICK);
ahd              6955 dev/ic/aic79xx.c 	ahd_outb(ahd, INT_COALESCING_MAXCMDS, -maxcmds);
ahd              6956 dev/ic/aic79xx.c 	ahd_outb(ahd, INT_COALESCING_MINCMDS, -mincmds);
ahd              6960 dev/ic/aic79xx.c ahd_enable_coalescing(struct ahd_softc *ahd, int enable)
ahd              6963 dev/ic/aic79xx.c 	ahd->hs_mailbox &= ~ENINT_COALESCE;
ahd              6965 dev/ic/aic79xx.c 		ahd->hs_mailbox |= ENINT_COALESCE;
ahd              6966 dev/ic/aic79xx.c 	ahd_outb(ahd, HS_MAILBOX, ahd->hs_mailbox);
ahd              6967 dev/ic/aic79xx.c 	ahd_flush_device_writes(ahd);
ahd              6968 dev/ic/aic79xx.c 	ahd_run_qoutfifo(ahd);
ahd              6979 dev/ic/aic79xx.c ahd_pause_and_flushwork(struct ahd_softc *ahd)
ahd              6985 dev/ic/aic79xx.c 	ahd->flags |= AHD_ALL_INTERRUPTS;
ahd              6986 dev/ic/aic79xx.c 	ahd_pause(ahd);
ahd              6992 dev/ic/aic79xx.c 	ahd->qfreeze_cnt--;
ahd              6993 dev/ic/aic79xx.c 	ahd_outw(ahd, KERNEL_QFREEZE_COUNT, ahd->qfreeze_cnt);
ahd              6994 dev/ic/aic79xx.c 	ahd_outb(ahd, SEQ_FLAGS2, ahd_inb(ahd, SEQ_FLAGS2) | SELECTOUT_QFROZEN);
ahd              6997 dev/ic/aic79xx.c 		ahd_unpause(ahd);
ahd              7004 dev/ic/aic79xx.c 		ahd_intr(ahd);
ahd              7005 dev/ic/aic79xx.c 		ahd_pause(ahd);
ahd              7006 dev/ic/aic79xx.c 		intstat = ahd_inb(ahd, INTSTAT);
ahd              7008 dev/ic/aic79xx.c 			ahd_clear_critical_section(ahd);
ahd              7009 dev/ic/aic79xx.c 			intstat = ahd_inb(ahd, INTSTAT);
ahd              7012 dev/ic/aic79xx.c 	      && (intstat != 0xFF || (ahd->features & AHD_REMOVABLE) == 0)
ahd              7014 dev/ic/aic79xx.c 	       || (ahd_inb(ahd, SCSISEQ0) & ENSELO) != 0
ahd              7015 dev/ic/aic79xx.c 	       || (ahd_inb(ahd, SSTAT0) & (SELDO|SELINGO)) != 0));
ahd              7019 dev/ic/aic79xx.c 		      ahd_inb(ahd, INTSTAT));
ahd              7021 dev/ic/aic79xx.c 	ahd->qfreeze_cnt++;
ahd              7022 dev/ic/aic79xx.c 	ahd_outw(ahd, KERNEL_QFREEZE_COUNT, ahd->qfreeze_cnt);
ahd              7024 dev/ic/aic79xx.c 	ahd_flush_qoutfifo(ahd);
ahd              7026 dev/ic/aic79xx.c 	ahd_platform_flushwork(ahd);
ahd              7027 dev/ic/aic79xx.c 	ahd->flags &= ~AHD_ALL_INTERRUPTS;
ahd              7031 dev/ic/aic79xx.c ahd_suspend(struct ahd_softc *ahd)
ahd              7034 dev/ic/aic79xx.c 	ahd_pause_and_flushwork(ahd);
ahd              7036 dev/ic/aic79xx.c 	if (LIST_FIRST(&ahd->pending_scbs) != NULL) {
ahd              7037 dev/ic/aic79xx.c 		ahd_unpause(ahd);
ahd              7040 dev/ic/aic79xx.c 	ahd_shutdown(ahd);
ahd              7045 dev/ic/aic79xx.c ahd_resume(struct ahd_softc *ahd)
ahd              7048 dev/ic/aic79xx.c 	ahd_reset(ahd, /*reinit*/TRUE);
ahd              7049 dev/ic/aic79xx.c 	ahd_intr_enable(ahd, TRUE); 
ahd              7050 dev/ic/aic79xx.c 	ahd_restart(ahd);
ahd              7065 dev/ic/aic79xx.c ahd_index_busy_tcl(struct ahd_softc *ahd, u_int *saved_scbid, u_int tcl)
ahd              7070 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
ahd              7071 dev/ic/aic79xx.c 	*saved_scbid = ahd_get_scbptr(ahd);
ahd              7072 dev/ic/aic79xx.c 	ahd_set_scbptr(ahd, TCL_LUN(tcl)
ahd              7087 dev/ic/aic79xx.c ahd_find_busy_tcl(struct ahd_softc *ahd, u_int tcl)
ahd              7093 dev/ic/aic79xx.c 	scb_offset = ahd_index_busy_tcl(ahd, &saved_scbptr, tcl);
ahd              7094 dev/ic/aic79xx.c 	scbid = ahd_inw_scbram(ahd, scb_offset);
ahd              7095 dev/ic/aic79xx.c 	ahd_set_scbptr(ahd, saved_scbptr);
ahd              7100 dev/ic/aic79xx.c ahd_busy_tcl(struct ahd_softc *ahd, u_int tcl, u_int scbid)
ahd              7105 dev/ic/aic79xx.c 	scb_offset = ahd_index_busy_tcl(ahd, &saved_scbptr, tcl);
ahd              7106 dev/ic/aic79xx.c 	ahd_outw(ahd, scb_offset, scbid);
ahd              7107 dev/ic/aic79xx.c 	ahd_set_scbptr(ahd, saved_scbptr);
ahd              7112 dev/ic/aic79xx.c ahd_match_scb(struct ahd_softc *ahd, struct scb *scb, int target,
ahd              7115 dev/ic/aic79xx.c 	int targ = SCB_GET_TARGET(ahd, scb);
ahd              7116 dev/ic/aic79xx.c 	char chan = SCB_GET_CHANNEL(ahd, scb);
ahd              7148 dev/ic/aic79xx.c ahd_freeze_devq(struct ahd_softc *ahd, struct scb *scb)
ahd              7154 dev/ic/aic79xx.c 	target = SCB_GET_TARGET(ahd, scb);
ahd              7156 dev/ic/aic79xx.c 	channel = SCB_GET_CHANNEL(ahd, scb);
ahd              7158 dev/ic/aic79xx.c 	ahd_search_qinfifo(ahd, target, channel, lun,
ahd              7162 dev/ic/aic79xx.c 	ahd_platform_freeze_devq(ahd, scb);
ahd              7166 dev/ic/aic79xx.c ahd_qinfifo_requeue_tail(struct ahd_softc *ahd, struct scb *scb)
ahd              7171 dev/ic/aic79xx.c 	saved_modes = ahd_save_modes(ahd);
ahd              7172 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_CCHAN, AHD_MODE_CCHAN);
ahd              7174 dev/ic/aic79xx.c 	if (ahd_qinfifo_count(ahd) != 0) {
ahd              7178 dev/ic/aic79xx.c 		prev_pos = AHD_QIN_WRAP(ahd->qinfifonext - 1);
ahd              7179 dev/ic/aic79xx.c 		prev_tag = ahd->qinfifo[prev_pos];
ahd              7180 dev/ic/aic79xx.c 		prev_scb = ahd_lookup_scb(ahd, prev_tag);
ahd              7182 dev/ic/aic79xx.c 	ahd_qinfifo_requeue(ahd, prev_scb, scb);
ahd              7183 dev/ic/aic79xx.c 	ahd_set_hnscb_qoff(ahd, ahd->qinfifonext);
ahd              7184 dev/ic/aic79xx.c 	ahd_restore_modes(ahd, saved_modes);
ahd              7188 dev/ic/aic79xx.c ahd_qinfifo_requeue(struct ahd_softc *ahd, struct scb *prev_scb,
ahd              7195 dev/ic/aic79xx.c 		ahd_outl(ahd, NEXT_QUEUED_SCB_ADDR, busaddr);
ahd              7198 dev/ic/aic79xx.c 		ahd_sync_scb(ahd, prev_scb, 
ahd              7201 dev/ic/aic79xx.c 	ahd->qinfifo[AHD_QIN_WRAP(ahd->qinfifonext)] = SCB_GET_TAG(scb);
ahd              7202 dev/ic/aic79xx.c 	ahd->qinfifonext++;
ahd              7203 dev/ic/aic79xx.c 	scb->hscb->next_hscb_busaddr = ahd->next_queued_hscb->hscb_busaddr;
ahd              7204 dev/ic/aic79xx.c 	ahd_sync_scb(ahd, scb, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
ahd              7208 dev/ic/aic79xx.c ahd_qinfifo_count(struct ahd_softc *ahd)
ahd              7214 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
ahd              7215 dev/ic/aic79xx.c 	qinpos = ahd_get_snscb_qoff(ahd);
ahd              7217 dev/ic/aic79xx.c 	wrap_qinfifonext = AHD_QIN_WRAP(ahd->qinfifonext);
ahd              7222 dev/ic/aic79xx.c 		      + NUM_ELEMENTS(ahd->qinfifo) - wrap_qinpos);
ahd              7226 dev/ic/aic79xx.c ahd_reset_cmds_pending(struct ahd_softc *ahd)
ahd              7232 dev/ic/aic79xx.c 	saved_modes = ahd_save_modes(ahd);
ahd              7233 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_CCHAN, AHD_MODE_CCHAN);
ahd              7239 dev/ic/aic79xx.c 	ahd_flush_qoutfifo(ahd);
ahd              7242 dev/ic/aic79xx.c 	LIST_FOREACH(scb, &ahd->pending_scbs, pending_links) {
ahd              7245 dev/ic/aic79xx.c 	ahd_outw(ahd, CMDS_PENDING, pending_cmds - ahd_qinfifo_count(ahd));
ahd              7246 dev/ic/aic79xx.c 	ahd_restore_modes(ahd, saved_modes);
ahd              7247 dev/ic/aic79xx.c 	ahd->flags &= ~AHD_UPDATE_PEND_CMDS;
ahd              7251 dev/ic/aic79xx.c ahd_done_with_status(struct ahd_softc *ahd, struct scb *scb, uint32_t status)
ahd              7262 dev/ic/aic79xx.c 	ahd_done(ahd, scb);
ahd              7266 dev/ic/aic79xx.c ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel,
ahd              7287 dev/ic/aic79xx.c 	saved_modes = ahd_save_modes(ahd);
ahd              7288 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_CCHAN, AHD_MODE_CCHAN);
ahd              7294 dev/ic/aic79xx.c 	if ((ahd_inb(ahd, CCSCBCTL) & (CCARREN|CCSCBEN|CCSCBDIR))
ahd              7296 dev/ic/aic79xx.c 		ahd_outb(ahd, CCSCBCTL,
ahd              7297 dev/ic/aic79xx.c 			 ahd_inb(ahd, CCSCBCTL) & ~(CCARREN|CCSCBEN));
ahd              7298 dev/ic/aic79xx.c 		while ((ahd_inb(ahd, CCSCBCTL) & (CCARREN|CCSCBEN)) != 0)
ahd              7302 dev/ic/aic79xx.c 	qintail = AHD_QIN_WRAP(ahd->qinfifonext);
ahd              7303 dev/ic/aic79xx.c 	qinstart = ahd_get_snscb_qoff(ahd);
ahd              7310 dev/ic/aic79xx.c 		       qinstart, ahd->qinfifonext);
ahd              7317 dev/ic/aic79xx.c 	ahd->qinfifonext = qinstart;
ahd              7318 dev/ic/aic79xx.c 	busaddr = aic_le32toh(ahd->next_queued_hscb->hscb_busaddr);
ahd              7319 dev/ic/aic79xx.c 	ahd_outl(ahd, NEXT_QUEUED_SCB_ADDR, busaddr);
ahd              7322 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, ahd->qinfifo[qinpos]);
ahd              7325 dev/ic/aic79xx.c 				qinpos, ahd->qinfifo[qinpos]);
ahd              7329 dev/ic/aic79xx.c 		if (ahd_match_scb(ahd, scb, target, channel, lun, tag, role)) {
ahd              7338 dev/ic/aic79xx.c 				ahd_done_with_status(ahd, scb, status);
ahd              7343 dev/ic/aic79xx.c 				printf(" 0x%x", ahd->qinfifo[qinpos]);
ahd              7346 dev/ic/aic79xx.c 				ahd_qinfifo_requeue(ahd, prev_scb, scb);
ahd              7351 dev/ic/aic79xx.c 			ahd_qinfifo_requeue(ahd, prev_scb, scb);
ahd              7357 dev/ic/aic79xx.c 	ahd_set_hnscb_qoff(ahd, ahd->qinfifonext);
ahd              7368 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              7369 dev/ic/aic79xx.c 	seq_flags2 = ahd_inb(ahd, SEQ_FLAGS2);
ahd              7371 dev/ic/aic79xx.c 		scbid = ahd_inw(ahd, MK_MESSAGE_SCB);
ahd              7372 dev/ic/aic79xx.c 		mk_msg_scb = ahd_lookup_scb(ahd, scbid);
ahd              7375 dev/ic/aic79xx.c 	savedscbptr = ahd_get_scbptr(ahd);
ahd              7376 dev/ic/aic79xx.c 	tid_next = ahd_inw(ahd, WAITING_TID_HEAD);
ahd              7387 dev/ic/aic79xx.c 		if (scbid >= ahd->scb_data.numscbs) {
ahd              7390 dev/ic/aic79xx.c 			       ahd_name(ahd), scbid, ahd->scb_data.numscbs);
ahd              7391 dev/ic/aic79xx.c 			ahd_dump_card_state(ahd);
ahd              7394 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scbid);
ahd              7397 dev/ic/aic79xx.c 			       ahd_name(ahd), scbid);
ahd              7400 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, scbid);
ahd              7401 dev/ic/aic79xx.c 		tid_next = ahd_inw_scbram(ahd, SCB_NEXT2);
ahd              7402 dev/ic/aic79xx.c 		if (ahd_match_scb(ahd, scb, target, channel, CAM_LUN_WILDCARD,
ahd              7412 dev/ic/aic79xx.c 			printf("       %d ( ", SCB_GET_TARGET(ahd, scb));
ahd              7414 dev/ic/aic79xx.c 		found += ahd_search_scb_list(ahd, target, channel,
ahd              7417 dev/ic/aic79xx.c 					     SCB_GET_TARGET(ahd, scb));
ahd              7423 dev/ic/aic79xx.c 		 && ahd_match_scb(ahd, mk_msg_scb, target, channel,
ahd              7434 dev/ic/aic79xx.c 				ahd_done_with_status(ahd, mk_msg_scb, status);
ahd              7447 dev/ic/aic79xx.c 				    + (2 * SCB_GET_TARGET(ahd, mk_msg_scb));
ahd              7448 dev/ic/aic79xx.c 				ahd_outw(ahd, tail_offset, tid_tail);
ahd              7451 dev/ic/aic79xx.c 				ahd_outb(ahd, SEQ_FLAGS2, seq_flags2);
ahd              7452 dev/ic/aic79xx.c 				ahd_outw(ahd, CMDS_PENDING,
ahd              7453 dev/ic/aic79xx.c 					 ahd_inw(ahd, CMDS_PENDING)-1);
ahd              7467 dev/ic/aic79xx.c 		 && ahd_match_scb(ahd, scb, target, channel, CAM_LUN_WILDCARD,
ahd              7476 dev/ic/aic79xx.c 			tid_head = ahd_inw(ahd, MK_MESSAGE_SCB);
ahd              7478 dev/ic/aic79xx.c 			ahd_outb(ahd, SEQ_FLAGS2, seq_flags2);
ahd              7482 dev/ic/aic79xx.c 			ahd_stitch_tid_list(ahd, tid_prev, tid_head, tid_next);
ahd              7490 dev/ic/aic79xx.c 	ahd_set_scbptr(ahd, savedscbptr);
ahd              7491 dev/ic/aic79xx.c 	ahd_restore_modes(ahd, saved_modes);
ahd              7496 dev/ic/aic79xx.c ahd_search_scb_list(struct ahd_softc *ahd, int target, char channel,
ahd              7507 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
ahd              7513 dev/ic/aic79xx.c 		if (scbid >= ahd->scb_data.numscbs) {
ahd              7516 dev/ic/aic79xx.c 			       ahd_name(ahd), scbid, ahd->scb_data.numscbs);
ahd              7517 dev/ic/aic79xx.c 			ahd_dump_card_state(ahd);
ahd              7520 dev/ic/aic79xx.c 		scb = ahd_lookup_scb(ahd, scbid);
ahd              7523 dev/ic/aic79xx.c 			       ahd_name(ahd), scbid);
ahd              7526 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, scbid);
ahd              7528 dev/ic/aic79xx.c 		next = ahd_inw_scbram(ahd, SCB_NEXT);
ahd              7529 dev/ic/aic79xx.c 		if (ahd_match_scb(ahd, scb, target, channel,
ahd              7539 dev/ic/aic79xx.c 			ahd_done_with_status(ahd, scb, status);
ahd              7542 dev/ic/aic79xx.c 			ahd_rem_wscb(ahd, scbid, prev, next, tid);
ahd              7558 dev/ic/aic79xx.c 		ahd_outw(ahd, CMDS_PENDING, ahd_inw(ahd, CMDS_PENDING) - found);
ahd              7563 dev/ic/aic79xx.c ahd_stitch_tid_list(struct ahd_softc *ahd, u_int tid_prev,
ahd              7566 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
ahd              7572 dev/ic/aic79xx.c 			ahd_outw(ahd, WAITING_TID_HEAD, tid_next);
ahd              7574 dev/ic/aic79xx.c 			ahd_set_scbptr(ahd, tid_prev);
ahd              7575 dev/ic/aic79xx.c 			ahd_outw(ahd, SCB_NEXT2, tid_next);
ahd              7578 dev/ic/aic79xx.c 			ahd_outw(ahd, WAITING_TID_TAIL, tid_prev);
ahd              7583 dev/ic/aic79xx.c 			ahd_outw(ahd, WAITING_TID_HEAD, tid_cur);
ahd              7585 dev/ic/aic79xx.c 			ahd_set_scbptr(ahd, tid_prev);
ahd              7586 dev/ic/aic79xx.c 			ahd_outw(ahd, SCB_NEXT2, tid_cur);
ahd              7588 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, tid_cur);
ahd              7589 dev/ic/aic79xx.c 		ahd_outw(ahd, SCB_NEXT2, tid_next);
ahd              7592 dev/ic/aic79xx.c 			ahd_outw(ahd, WAITING_TID_TAIL, tid_cur);
ahd              7601 dev/ic/aic79xx.c ahd_rem_wscb(struct ahd_softc *ahd, u_int scbid,
ahd              7606 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
ahd              7608 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, prev);
ahd              7609 dev/ic/aic79xx.c 		ahd_outw(ahd, SCB_NEXT, next);
ahd              7621 dev/ic/aic79xx.c 	 && ahd_inw(ahd, tail_offset) == scbid)
ahd              7622 dev/ic/aic79xx.c 		ahd_outw(ahd, tail_offset, prev);
ahd              7624 dev/ic/aic79xx.c 	ahd_add_scb_to_free_list(ahd, scbid);
ahd              7634 dev/ic/aic79xx.c ahd_add_scb_to_free_list(struct ahd_softc *ahd, u_int scbid)
ahd              7652 dev/ic/aic79xx.c ahd_abort_scbs(struct ahd_softc *ahd, int target, char channel,
ahd              7665 dev/ic/aic79xx.c 	saved_modes = ahd_save_modes(ahd);
ahd              7666 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              7668 dev/ic/aic79xx.c 	found = ahd_search_qinfifo(ahd, target, channel, lun, SCB_LIST_NULL,
ahd              7700 dev/ic/aic79xx.c 				scbid = ahd_find_busy_tcl(ahd, tcl);
ahd              7701 dev/ic/aic79xx.c 				scbp = ahd_lookup_scb(ahd, scbid);
ahd              7703 dev/ic/aic79xx.c 				 || ahd_match_scb(ahd, scbp, target, channel,
ahd              7706 dev/ic/aic79xx.c 				ahd_unbusy_tcl(ahd, BUILD_TCL_RAW(i, 'A', j));
ahd              7715 dev/ic/aic79xx.c 	ahd_flush_qoutfifo(ahd);
ahd              7723 dev/ic/aic79xx.c 	scbp_next = LIST_FIRST(&ahd->pending_scbs);
ahd              7727 dev/ic/aic79xx.c 		if (ahd_match_scb(ahd, scbp, target, channel, lun, tag, role)) {
ahd              7737 dev/ic/aic79xx.c 			ahd_done(ahd, scbp);
ahd              7741 dev/ic/aic79xx.c 	ahd_restore_modes(ahd, saved_modes);
ahd              7742 dev/ic/aic79xx.c 	ahd_platform_abort_scbs(ahd, target, channel, lun, tag, role, status);
ahd              7743 dev/ic/aic79xx.c 	ahd->flags |= AHD_UPDATE_PEND_CMDS;
ahd              7748 dev/ic/aic79xx.c ahd_reset_current_bus(struct ahd_softc *ahd)
ahd              7752 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
ahd              7753 dev/ic/aic79xx.c 	ahd_outb(ahd, SIMODE1, ahd_inb(ahd, SIMODE1) & ~ENSCSIRST);
ahd              7754 dev/ic/aic79xx.c 	scsiseq = ahd_inb(ahd, SCSISEQ0) & ~(ENSELO|ENARBO|SCSIRSTO);
ahd              7755 dev/ic/aic79xx.c 	ahd_outb(ahd, SCSISEQ0, scsiseq | SCSIRSTO);
ahd              7756 dev/ic/aic79xx.c 	ahd_flush_device_writes(ahd);
ahd              7759 dev/ic/aic79xx.c 	ahd_outb(ahd, SCSISEQ0, scsiseq);
ahd              7760 dev/ic/aic79xx.c 	ahd_flush_device_writes(ahd);
ahd              7762 dev/ic/aic79xx.c 	if ((ahd->bugs & AHD_SCSIRST_BUG) != 0) {
ahd              7769 dev/ic/aic79xx.c 		ahd_reset(ahd, /*reinit*/TRUE);
ahd              7770 dev/ic/aic79xx.c 		ahd_intr_enable(ahd, /*enable*/TRUE);
ahd              7771 dev/ic/aic79xx.c 		AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
ahd              7774 dev/ic/aic79xx.c 	ahd_clear_intstat(ahd);
ahd              7778 dev/ic/aic79xx.c ahd_reset_channel(struct ahd_softc *ahd, char channel, int initiate_reset)
ahd              7788 dev/ic/aic79xx.c 	ahd->pending_device = NULL;
ahd              7795 dev/ic/aic79xx.c 	ahd_pause(ahd);
ahd              7798 dev/ic/aic79xx.c 	ahd_clear_critical_section(ahd);
ahd              7801 dev/ic/aic79xx.c 	if ((ahd->flags & AHD_TARGETROLE) != 0) {
ahd              7802 dev/ic/aic79xx.c 		ahd_run_tqinfifo(ahd, /*paused*/TRUE);
ahd              7805 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              7811 dev/ic/aic79xx.c 	ahd_outb(ahd, SCSISEQ0, 0);
ahd              7812 dev/ic/aic79xx.c 	ahd_outb(ahd, SCSISEQ1, 0);
ahd              7819 dev/ic/aic79xx.c 	next_fifo = fifo = ahd_inb(ahd, DFFSTAT) & CURRFIFO;
ahd              7825 dev/ic/aic79xx.c 		ahd_set_modes(ahd, next_fifo, next_fifo);
ahd              7826 dev/ic/aic79xx.c 		ahd_outb(ahd, DFCNTRL,
ahd              7827 dev/ic/aic79xx.c 			 ahd_inb(ahd, DFCNTRL) & ~(SCSIEN|HDMAEN));
ahd              7828 dev/ic/aic79xx.c 		while ((ahd_inb(ahd, DFCNTRL) & HDMAENACK) != 0)
ahd              7833 dev/ic/aic79xx.c 		ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              7834 dev/ic/aic79xx.c 		ahd_outb(ahd, DFFSTAT, next_fifo);
ahd              7840 dev/ic/aic79xx.c 	ahd_clear_msg_state(ahd);
ahd              7841 dev/ic/aic79xx.c 	ahd_outb(ahd, SIMODE1,
ahd              7842 dev/ic/aic79xx.c 		 ahd_inb(ahd, SIMODE1) & ~(ENBUSFREE|ENSCSIRST));
ahd              7845 dev/ic/aic79xx.c 		ahd_reset_current_bus(ahd);
ahd              7847 dev/ic/aic79xx.c 	ahd_clear_intstat(ahd);
ahd              7853 dev/ic/aic79xx.c 	found = ahd_abort_scbs(ahd, CAM_TARGET_WILDCARD, channel,
ahd              7860 dev/ic/aic79xx.c 	ahd_clear_fifo(ahd, 0);
ahd              7861 dev/ic/aic79xx.c 	ahd_clear_fifo(ahd, 1);
ahd              7866 dev/ic/aic79xx.c 	max_scsiid = (ahd->features & AHD_WIDE) ? 15 : 7;
ahd              7869 dev/ic/aic79xx.c 		if (ahd->enabled_targets[target] == NULL)
ahd              7877 dev/ic/aic79xx.c 			ahd_set_width(ahd, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
ahd              7879 dev/ic/aic79xx.c 			ahd_set_syncrate(ahd, &devinfo, /*period*/0,
ahd              7886 dev/ic/aic79xx.c 	max_scsiid = (ahd->features & AHD_WIDE) ? 15 : 7;
ahd              7896 dev/ic/aic79xx.c 		tstate = ahd->enabled_targets[target];
ahd              7906 dev/ic/aic79xx.c 			ahd_queue_lstate_event(ahd, lstate, CAM_TARGET_WILDCARD,
ahd              7908 dev/ic/aic79xx.c 			ahd_send_lstate_events(ahd, lstate);
ahd              7914 dev/ic/aic79xx.c 	ahd_send_async(ahd, devinfo.channel, CAM_TARGET_WILDCARD,
ahd              7917 dev/ic/aic79xx.c 	ahd_restart(ahd);
ahd              7924 dev/ic/aic79xx.c 	if ((ahd->flags & AHD_RESET_POLL_ACTIVE) == 0) {
ahd              7925 dev/ic/aic79xx.c 		ahd->flags |= AHD_RESET_POLL_ACTIVE;
ahd              7926 dev/ic/aic79xx.c 		aic_freeze_simq(ahd);
ahd              7927 dev/ic/aic79xx.c 		aic_timer_reset(&ahd->reset_timer, 0, ahd_reset_poll, ahd);
ahd              7937 dev/ic/aic79xx.c 	struct	ahd_softc *ahd;
ahd              7943 dev/ic/aic79xx.c 	ahd = ahd_find_softc((struct ahd_softc *)arg);
ahd              7944 dev/ic/aic79xx.c 	if (ahd == NULL) {
ahd              7949 dev/ic/aic79xx.c 	ahd_lock(ahd, &s);
ahd              7950 dev/ic/aic79xx.c 	ahd_pause(ahd);
ahd              7951 dev/ic/aic79xx.c 	ahd_update_modes(ahd);
ahd              7952 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              7953 dev/ic/aic79xx.c 	ahd_outb(ahd, CLRSINT1, CLRSCSIRSTI);
ahd              7954 dev/ic/aic79xx.c 	if ((ahd_inb(ahd, SSTAT1) & SCSIRSTI) != 0) {
ahd              7955 dev/ic/aic79xx.c 		aic_timer_reset(&ahd->reset_timer, AHD_RESET_POLL_MS,
ahd              7956 dev/ic/aic79xx.c 				ahd_reset_poll, ahd);
ahd              7957 dev/ic/aic79xx.c 		ahd_unpause(ahd);
ahd              7958 dev/ic/aic79xx.c 		ahd_unlock(ahd, &s);
ahd              7964 dev/ic/aic79xx.c 	ahd_outb(ahd, SIMODE1, ahd_inb(ahd, SIMODE1) | ENSCSIRST);
ahd              7965 dev/ic/aic79xx.c 	scsiseq1 = ahd_inb(ahd, SCSISEQ_TEMPLATE);
ahd              7966 dev/ic/aic79xx.c 	ahd_outb(ahd, SCSISEQ1, scsiseq1 & (ENSELI|ENRSELI|ENAUTOATNP));
ahd              7967 dev/ic/aic79xx.c 	ahd_unpause(ahd);
ahd              7968 dev/ic/aic79xx.c 	ahd->flags &= ~AHD_RESET_POLL_ACTIVE;
ahd              7969 dev/ic/aic79xx.c 	ahd_unlock(ahd, &s);
ahd              7970 dev/ic/aic79xx.c 	aic_release_simq(ahd);
ahd              7978 dev/ic/aic79xx.c 	struct	ahd_softc *ahd;
ahd              7984 dev/ic/aic79xx.c 	ahd = ahd_find_softc((struct ahd_softc *)arg);
ahd              7985 dev/ic/aic79xx.c 	if (ahd == NULL) {
ahd              7990 dev/ic/aic79xx.c 	ahd_lock(ahd, &s);
ahd              7992 dev/ic/aic79xx.c 	enint_coal = ahd->hs_mailbox & ENINT_COALESCE;
ahd              7993 dev/ic/aic79xx.c 	if (ahd->cmdcmplt_total > ahd->int_coalescing_threshold)
ahd              7995 dev/ic/aic79xx.c 	else if (ahd->cmdcmplt_total < ahd->int_coalescing_stop_threshold)
ahd              7998 dev/ic/aic79xx.c 	if (enint_coal != (ahd->hs_mailbox & ENINT_COALESCE)) {
ahd              7999 dev/ic/aic79xx.c 		ahd_enable_coalescing(ahd, enint_coal);
ahd              8004 dev/ic/aic79xx.c 			       ahd_name(ahd),
ahd              8006 dev/ic/aic79xx.c 			       ahd->cmdcmplt_total);
ahd              8010 dev/ic/aic79xx.c 	ahd->cmdcmplt_bucket = (ahd->cmdcmplt_bucket+1) & (AHD_STAT_BUCKETS-1);
ahd              8011 dev/ic/aic79xx.c 	ahd->cmdcmplt_total -= ahd->cmdcmplt_counts[ahd->cmdcmplt_bucket];
ahd              8012 dev/ic/aic79xx.c 	ahd->cmdcmplt_counts[ahd->cmdcmplt_bucket] = 0;
ahd              8013 dev/ic/aic79xx.c 	aic_timer_reset(&ahd->stat_timer, AHD_STAT_UPDATE_MS,
ahd              8014 dev/ic/aic79xx.c 			ahd_stat_timer, ahd);
ahd              8015 dev/ic/aic79xx.c 	ahd_unlock(ahd, &s);
ahd              8021 dev/ic/aic79xx.c ahd_handle_scb_status(struct ahd_softc *ahd, struct scb *scb)
ahd              8024 dev/ic/aic79xx.c 		ahd_handle_scsi_status(ahd, scb);
ahd              8026 dev/ic/aic79xx.c 		ahd_calc_residual(ahd, scb);
ahd              8027 dev/ic/aic79xx.c 		ahd_done(ahd, scb);
ahd              8032 dev/ic/aic79xx.c ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb)
ahd              8048 dev/ic/aic79xx.c 	if (ahd_is_paused(ahd)) {
ahd              8052 dev/ic/aic79xx.c 		ahd_pause(ahd);
ahd              8056 dev/ic/aic79xx.c 	ahd_freeze_devq(ahd, scb);
ahd              8058 dev/ic/aic79xx.c 	ahd->qfreeze_cnt++;
ahd              8059 dev/ic/aic79xx.c 	ahd_outw(ahd, KERNEL_QFREEZE_COUNT, ahd->qfreeze_cnt);
ahd              8062 dev/ic/aic79xx.c 		ahd_unpause(ahd);
ahd              8072 dev/ic/aic79xx.c 		ahd_done(ahd, scb);
ahd              8082 dev/ic/aic79xx.c 		ahd_sync_sense(ahd, scb, BUS_DMASYNC_POSTREAD);
ahd              8087 dev/ic/aic79xx.c 			ahd_print_path(ahd, scb);
ahd              8097 dev/ic/aic79xx.c 			ahd_print_path(ahd, scb);
ahd              8135 dev/ic/aic79xx.c 		ahd_done(ahd, scb);
ahd              8149 dev/ic/aic79xx.c 			ahd_print_path(ahd, scb);
ahd              8159 dev/ic/aic79xx.c 				    SCB_GET_TARGET(ahd, scb),
ahd              8161 dev/ic/aic79xx.c 				    SCB_GET_CHANNEL(ahd, scb),
ahd              8163 dev/ic/aic79xx.c 		targ_info = ahd_fetch_transinfo(ahd,
ahd              8174 dev/ic/aic79xx.c 		ahd_update_residual(ahd, scb);
ahd              8177 dev/ic/aic79xx.c 			ahd_print_path(ahd, scb);
ahd              8182 dev/ic/aic79xx.c 		sg = ahd_sg_setup(ahd, scb, sg, ahd_get_sense_bufaddr(ahd, scb),
ahd              8183 dev/ic/aic79xx.c 				  aic_get_sense_bufsize(ahd, scb),
ahd              8192 dev/ic/aic79xx.c 		sc->length = aic_get_sense_bufsize(ahd, scb);
ahd              8213 dev/ic/aic79xx.c 			ahd_update_neg_request(ahd, &devinfo,
ahd              8224 dev/ic/aic79xx.c 		ahd_setup_data_scb(ahd, scb);
ahd              8226 dev/ic/aic79xx.c 		ahd_queue_scb(ahd, scb);
ahd              8239 dev/ic/aic79xx.c 		       ahd_name(ahd));
ahd              8242 dev/ic/aic79xx.c 		ahd_done(ahd, scb);
ahd              8251 dev/ic/aic79xx.c ahd_calc_residual(struct ahd_softc *ahd, struct scb *scb)
ahd              8301 dev/ic/aic79xx.c 		ahd_print_path(ahd, scb);
ahd              8304 dev/ic/aic79xx.c 		ahd_freeze_devq(ahd, scb);
ahd              8319 dev/ic/aic79xx.c 		sg = ahd_sg_bus_to_virt(ahd, scb, resid_sgptr & SG_PTR_MASK);
ahd              8341 dev/ic/aic79xx.c 		ahd_print_path(ahd, scb);
ahd              8354 dev/ic/aic79xx.c ahd_queue_lstate_event(struct ahd_softc *ahd, struct ahd_tmode_lstate *lstate,
ahd              8405 dev/ic/aic79xx.c ahd_send_lstate_events(struct ahd_softc *ahd, struct ahd_tmode_lstate *lstate)
ahd              8441 dev/ic/aic79xx.c ahd_dumpseq(struct ahd_softc* ahd)
ahd              8448 dev/ic/aic79xx.c 	ahd_outb(ahd, SEQCTL0, PERRORDIS|FAILDIS|FASTMODE|LOADRAM);
ahd              8449 dev/ic/aic79xx.c 	ahd_outw(ahd, PRGMCNT, 0);
ahd              8453 dev/ic/aic79xx.c 		ahd_insb(ahd, SEQRAM, ins_bytes, 4);
ahd              8463 dev/ic/aic79xx.c ahd_loadseq(struct ahd_softc *ahd)
ahd              8483 dev/ic/aic79xx.c 		       ahd_name(ahd));
ahd              8515 dev/ic/aic79xx.c 	sg_prefetch_align = ahd->pci_cachesize;
ahd              8538 dev/ic/aic79xx.c 	if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0)
ahd              8562 dev/ic/aic79xx.c 		(ahd->overrun_buf - (uint8_t *)ahd->qoutfifo) / 256;
ahd              8568 dev/ic/aic79xx.c 	ahd_outb(ahd, SEQCTL0, PERRORDIS|FAILDIS|FASTMODE|LOADRAM);
ahd              8569 dev/ic/aic79xx.c 	ahd_outw(ahd, PRGMCNT, 0);
ahd              8572 dev/ic/aic79xx.c 		if (ahd_check_patch(ahd, &cur_patch, i, &skip_addr) == 0) {
ahd              8600 dev/ic/aic79xx.c 		ahd_download_instr(ahd, i, download_consts);
ahd              8604 dev/ic/aic79xx.c 	ahd->num_critical_sections = cs_count;
ahd              8608 dev/ic/aic79xx.c 		ahd->critical_sections = malloc(cs_count, M_DEVBUF, M_NOWAIT);
ahd              8609 dev/ic/aic79xx.c 		if (ahd->critical_sections == NULL)
ahd              8611 dev/ic/aic79xx.c 		memcpy(ahd->critical_sections, cs_table, cs_count);
ahd              8613 dev/ic/aic79xx.c 	ahd_outb(ahd, SEQCTL0, PERRORDIS|FAILDIS|FASTMODE);
ahd              8618 dev/ic/aic79xx.c 		       ahd_name(ahd), ahd->features, ahd->bugs, ahd->flags);
ahd              8623 dev/ic/aic79xx.c ahd_check_patch(struct ahd_softc *ahd, const struct patch **start_patch,
ahd              8636 dev/ic/aic79xx.c 		if (cur_patch->patch_func(ahd) == 0) {
ahd              8659 dev/ic/aic79xx.c ahd_resolve_seqaddr(struct ahd_softc *ahd, u_int address)
ahd              8672 dev/ic/aic79xx.c 		ahd_check_patch(ahd, &cur_patch, i, &skip_addr);
ahd              8688 dev/ic/aic79xx.c ahd_download_instr(struct ahd_softc *ahd, u_int instrptr, uint8_t *dconsts)
ahd              8716 dev/ic/aic79xx.c 		fmt3_ins->address = ahd_resolve_seqaddr(ahd, fmt3_ins->address);
ahd              8747 dev/ic/aic79xx.c 		ahd_outsb(ahd, SEQRAM, instr.bytes, 4);
ahd              8757 dev/ic/aic79xx.c ahd_probe_stack_size(struct ahd_softc *ahd)
ahd              8772 dev/ic/aic79xx.c 		       ahd_outb(ahd, STACK, i & 0xFF);
ahd              8773 dev/ic/aic79xx.c 		       ahd_outb(ahd, STACK, (i >> 8) & 0xFF);
ahd              8780 dev/ic/aic79xx.c 			stack_entry = ahd_inb(ahd, STACK)
ahd              8781 dev/ic/aic79xx.c 				    |(ahd_inb(ahd, STACK) << 8);
ahd              8848 dev/ic/aic79xx.c ahd_dump_card_state(struct ahd_softc *ahd)
ahd              8859 dev/ic/aic79xx.c 	if (ahd_is_paused(ahd)) {
ahd              8863 dev/ic/aic79xx.c 		ahd_pause(ahd);
ahd              8865 dev/ic/aic79xx.c 	saved_modes = ahd_save_modes(ahd);
ahd              8866 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              8869 dev/ic/aic79xx.c 	       ahd_name(ahd), 
ahd              8870 dev/ic/aic79xx.c 	       ahd_inw(ahd, CURADDR),
ahd              8871 dev/ic/aic79xx.c 	       ahd_build_mode_state(ahd, ahd->saved_src_mode,
ahd              8872 dev/ic/aic79xx.c 				    ahd->saved_dst_mode));
ahd              8876 dev/ic/aic79xx.c 	if (ahd_check_cmdcmpltqueues(ahd))
ahd              8883 dev/ic/aic79xx.c 	ahd_intstat_print(ahd_inb(ahd, INTSTAT), &cur_col, 50);
ahd              8884 dev/ic/aic79xx.c 	ahd_seloid_print(ahd_inb(ahd, SELOID), &cur_col, 50);
ahd              8885 dev/ic/aic79xx.c 	ahd_selid_print(ahd_inb(ahd, SELID), &cur_col, 50);
ahd              8886 dev/ic/aic79xx.c 	ahd_hs_mailbox_print(ahd_inb(ahd, LOCAL_HS_MAILBOX), &cur_col, 50);
ahd              8887 dev/ic/aic79xx.c 	ahd_intctl_print(ahd_inb(ahd, INTCTL), &cur_col, 50);
ahd              8888 dev/ic/aic79xx.c 	ahd_seqintstat_print(ahd_inb(ahd, SEQINTSTAT), &cur_col, 50);
ahd              8889 dev/ic/aic79xx.c 	ahd_saved_mode_print(ahd_inb(ahd, SAVED_MODE), &cur_col, 50);
ahd              8890 dev/ic/aic79xx.c 	ahd_dffstat_print(ahd_inb(ahd, DFFSTAT), &cur_col, 50);
ahd              8891 dev/ic/aic79xx.c 	ahd_scsisigi_print(ahd_inb(ahd, SCSISIGI), &cur_col, 50);
ahd              8892 dev/ic/aic79xx.c 	ahd_scsiphase_print(ahd_inb(ahd, SCSIPHASE), &cur_col, 50);
ahd              8893 dev/ic/aic79xx.c 	ahd_scsibus_print(ahd_inb(ahd, SCSIBUS), &cur_col, 50);
ahd              8894 dev/ic/aic79xx.c 	ahd_lastphase_print(ahd_inb(ahd, LASTPHASE), &cur_col, 50);
ahd              8895 dev/ic/aic79xx.c 	ahd_scsiseq0_print(ahd_inb(ahd, SCSISEQ0), &cur_col, 50);
ahd              8896 dev/ic/aic79xx.c 	ahd_scsiseq1_print(ahd_inb(ahd, SCSISEQ1), &cur_col, 50);
ahd              8897 dev/ic/aic79xx.c 	ahd_seqctl0_print(ahd_inb(ahd, SEQCTL0), &cur_col, 50);
ahd              8898 dev/ic/aic79xx.c 	ahd_seqintctl_print(ahd_inb(ahd, SEQINTCTL), &cur_col, 50);
ahd              8899 dev/ic/aic79xx.c 	ahd_seq_flags_print(ahd_inb(ahd, SEQ_FLAGS), &cur_col, 50);
ahd              8900 dev/ic/aic79xx.c 	ahd_seq_flags2_print(ahd_inb(ahd, SEQ_FLAGS2), &cur_col, 50);
ahd              8901 dev/ic/aic79xx.c 	ahd_qfreeze_count_print(ahd_inw(ahd, QFREEZE_COUNT), &cur_col, 50);
ahd              8902 dev/ic/aic79xx.c 	ahd_kernel_qfreeze_count_print(ahd_inw(ahd, KERNEL_QFREEZE_COUNT),
ahd              8904 dev/ic/aic79xx.c 	ahd_mk_message_scb_print(ahd_inw(ahd, MK_MESSAGE_SCB), &cur_col, 50);
ahd              8905 dev/ic/aic79xx.c 	ahd_mk_message_scsiid_print(ahd_inb(ahd, MK_MESSAGE_SCSIID),
ahd              8907 dev/ic/aic79xx.c 	ahd_sstat0_print(ahd_inb(ahd, SSTAT0), &cur_col, 50);
ahd              8908 dev/ic/aic79xx.c 	ahd_sstat1_print(ahd_inb(ahd, SSTAT1), &cur_col, 50);
ahd              8909 dev/ic/aic79xx.c 	ahd_sstat2_print(ahd_inb(ahd, SSTAT2), &cur_col, 50);
ahd              8910 dev/ic/aic79xx.c 	ahd_sstat3_print(ahd_inb(ahd, SSTAT3), &cur_col, 50);
ahd              8911 dev/ic/aic79xx.c 	ahd_perrdiag_print(ahd_inb(ahd, PERRDIAG), &cur_col, 50);
ahd              8912 dev/ic/aic79xx.c 	ahd_simode1_print(ahd_inb(ahd, SIMODE1), &cur_col, 50);
ahd              8913 dev/ic/aic79xx.c 	ahd_lqistat0_print(ahd_inb(ahd, LQISTAT0), &cur_col, 50);
ahd              8914 dev/ic/aic79xx.c 	ahd_lqistat1_print(ahd_inb(ahd, LQISTAT1), &cur_col, 50);
ahd              8915 dev/ic/aic79xx.c 	ahd_lqistat2_print(ahd_inb(ahd, LQISTAT2), &cur_col, 50);
ahd              8916 dev/ic/aic79xx.c 	ahd_lqostat0_print(ahd_inb(ahd, LQOSTAT0), &cur_col, 50);
ahd              8917 dev/ic/aic79xx.c 	ahd_lqostat1_print(ahd_inb(ahd, LQOSTAT1), &cur_col, 50);
ahd              8918 dev/ic/aic79xx.c 	ahd_lqostat2_print(ahd_inb(ahd, LQOSTAT2), &cur_col, 50);
ahd              8922 dev/ic/aic79xx.c 	       ahd->scb_data.numscbs, ahd_inw(ahd, CMDS_PENDING),
ahd              8923 dev/ic/aic79xx.c 	       ahd_inw(ahd, LASTSCB), ahd_inw(ahd, CURRSCB),
ahd              8924 dev/ic/aic79xx.c 	       ahd_inw(ahd, NEXTSCB));
ahd              8927 dev/ic/aic79xx.c 	ahd_search_qinfifo(ahd, CAM_TARGET_WILDCARD, ALL_CHANNELS,
ahd              8930 dev/ic/aic79xx.c 	saved_scb_index = ahd_get_scbptr(ahd);
ahd              8933 dev/ic/aic79xx.c 	LIST_FOREACH(scb, &ahd->pending_scbs, pending_links) {
ahd              8937 dev/ic/aic79xx.c 				 ahd_inb_scbram(ahd, SCB_FIFO_USE_COUNT));
ahd              8938 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, SCB_GET_TAG(scb));
ahd              8939 dev/ic/aic79xx.c 		ahd_scb_control_print(ahd_inb_scbram(ahd, SCB_CONTROL),
ahd              8941 dev/ic/aic79xx.c 		ahd_scb_scsiid_print(ahd_inb_scbram(ahd, SCB_SCSIID),
ahd              8948 dev/ic/aic79xx.c 	TAILQ_FOREACH(scb, &ahd->scb_data.free_scbs, links.tqe) {
ahd              8958 dev/ic/aic79xx.c 	LIST_FOREACH(scb, &ahd->scb_data.any_dev_free_scb_list, links.le) {
ahd              8966 dev/ic/aic79xx.c 	scb_index = ahd_inw(ahd, COMPLETE_SCB_DMAINPROG_HEAD);
ahd              8969 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, scb_index);
ahd              8971 dev/ic/aic79xx.c 		scb_index = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE);
ahd              8976 dev/ic/aic79xx.c 	scb_index = ahd_inw(ahd, COMPLETE_SCB_HEAD);
ahd              8979 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, scb_index);
ahd              8981 dev/ic/aic79xx.c 		scb_index = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE);
ahd              8987 dev/ic/aic79xx.c 	scb_index = ahd_inw(ahd, COMPLETE_DMA_SCB_HEAD);
ahd              8990 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, scb_index);
ahd              8992 dev/ic/aic79xx.c 		scb_index = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE);
ahd              8996 dev/ic/aic79xx.c 	scb_index = ahd_inw(ahd, COMPLETE_ON_QFREEZE_HEAD);
ahd              8999 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, scb_index);
ahd              9001 dev/ic/aic79xx.c 		scb_index = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE);
ahd              9004 dev/ic/aic79xx.c 	ahd_set_scbptr(ahd, saved_scb_index);
ahd              9005 dev/ic/aic79xx.c 	dffstat = ahd_inb(ahd, DFFSTAT);
ahd              9012 dev/ic/aic79xx.c 		ahd_set_modes(ahd, AHD_MODE_DFF0 + i, AHD_MODE_DFF0 + i);
ahd              9013 dev/ic/aic79xx.c 		fifo_scbptr = ahd_get_scbptr(ahd);
ahd              9015 dev/ic/aic79xx.c 		       ahd_name(ahd), i,
ahd              9017 dev/ic/aic79xx.c 		       ahd_inw(ahd, LONGJMP_ADDR), fifo_scbptr);
ahd              9019 dev/ic/aic79xx.c 		ahd_seqimode_print(ahd_inb(ahd, SEQIMODE), &cur_col, 50);
ahd              9020 dev/ic/aic79xx.c 		ahd_seqintsrc_print(ahd_inb(ahd, SEQINTSRC), &cur_col, 50);
ahd              9021 dev/ic/aic79xx.c 		ahd_dfcntrl_print(ahd_inb(ahd, DFCNTRL), &cur_col, 50);
ahd              9022 dev/ic/aic79xx.c 		ahd_dfstatus_print(ahd_inb(ahd, DFSTATUS), &cur_col, 50);
ahd              9023 dev/ic/aic79xx.c 		ahd_sg_cache_shadow_print(ahd_inb(ahd, SG_CACHE_SHADOW),
ahd              9025 dev/ic/aic79xx.c 		ahd_sg_state_print(ahd_inb(ahd, SG_STATE), &cur_col, 50);
ahd              9026 dev/ic/aic79xx.c 		ahd_dffsxfrctl_print(ahd_inb(ahd, DFFSXFRCTL), &cur_col, 50);
ahd              9027 dev/ic/aic79xx.c 		ahd_soffcnt_print(ahd_inb(ahd, SOFFCNT), &cur_col, 50);
ahd              9028 dev/ic/aic79xx.c 		ahd_mdffstat_print(ahd_inb(ahd, MDFFSTAT), &cur_col, 50);
ahd              9034 dev/ic/aic79xx.c 				  ahd_inl(ahd, SHADDR+4),
ahd              9035 dev/ic/aic79xx.c 				  ahd_inl(ahd, SHADDR),
ahd              9036 dev/ic/aic79xx.c 				  (ahd_inb(ahd, SHCNT)
ahd              9037 dev/ic/aic79xx.c 				| (ahd_inb(ahd, SHCNT + 1) << 8)
ahd              9038 dev/ic/aic79xx.c 				| (ahd_inb(ahd, SHCNT + 2) << 16)));
ahd              9044 dev/ic/aic79xx.c 				  ahd_inl(ahd, HADDR+4),
ahd              9045 dev/ic/aic79xx.c 				  ahd_inl(ahd, HADDR),
ahd              9046 dev/ic/aic79xx.c 				  (ahd_inb(ahd, HCNT)
ahd              9047 dev/ic/aic79xx.c 				| (ahd_inb(ahd, HCNT + 1) << 8)
ahd              9048 dev/ic/aic79xx.c 				| (ahd_inb(ahd, HCNT + 2) << 16)));
ahd              9049 dev/ic/aic79xx.c 		ahd_ccsgctl_print(ahd_inb(ahd, CCSGCTL), &cur_col, 50);
ahd              9052 dev/ic/aic79xx.c 			fifo_scb = ahd_lookup_scb(ahd, fifo_scbptr);
ahd              9060 dev/ic/aic79xx.c 		printf("0x%x ", ahd_inb(ahd, LQIN + i));
ahd              9062 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
ahd              9064 dev/ic/aic79xx.c 	       ahd_name(ahd), ahd_inb(ahd, LQISTATE), ahd_inb(ahd, LQOSTATE),
ahd              9065 dev/ic/aic79xx.c 	       ahd_inb(ahd, OPTIONMODE));
ahd              9067 dev/ic/aic79xx.c 	       ahd_name(ahd), ahd_inb(ahd, OS_SPACE_CNT),
ahd              9068 dev/ic/aic79xx.c 	       ahd_inb(ahd, MAXCMDCNT));
ahd              9070 dev/ic/aic79xx.c 	       ahd_name(ahd), ahd_inb(ahd, SAVED_SCSIID),
ahd              9071 dev/ic/aic79xx.c 	       ahd_inb(ahd, SAVED_LUN));
ahd              9072 dev/ic/aic79xx.c 	ahd_simode0_print(ahd_inb(ahd, SIMODE0), &cur_col, 50);
ahd              9074 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_CCHAN, AHD_MODE_CCHAN);
ahd              9076 dev/ic/aic79xx.c 	ahd_ccscbctl_print(ahd_inb(ahd, CCSCBCTL), &cur_col, 50);
ahd              9078 dev/ic/aic79xx.c 	ahd_set_modes(ahd, ahd->saved_src_mode, ahd->saved_dst_mode);
ahd              9080 dev/ic/aic79xx.c 	       ahd_name(ahd), ahd_inw(ahd, REG0), ahd_inw(ahd, SINDEX),
ahd              9081 dev/ic/aic79xx.c 	       ahd_inw(ahd, DINDEX));
ahd              9083 dev/ic/aic79xx.c 	       ahd_name(ahd), ahd_get_scbptr(ahd),
ahd              9084 dev/ic/aic79xx.c 	       ahd_inw_scbram(ahd, SCB_NEXT),
ahd              9085 dev/ic/aic79xx.c 	       ahd_inw_scbram(ahd, SCB_NEXT2));
ahd              9087 dev/ic/aic79xx.c 	       ahd_inb_scbram(ahd, SCB_CDB_STORE),
ahd              9088 dev/ic/aic79xx.c 	       ahd_inb_scbram(ahd, SCB_CDB_STORE+1),
ahd              9089 dev/ic/aic79xx.c 	       ahd_inb_scbram(ahd, SCB_CDB_STORE+2),
ahd              9090 dev/ic/aic79xx.c 	       ahd_inb_scbram(ahd, SCB_CDB_STORE+3),
ahd              9091 dev/ic/aic79xx.c 	       ahd_inb_scbram(ahd, SCB_CDB_STORE+4),
ahd              9092 dev/ic/aic79xx.c 	       ahd_inb_scbram(ahd, SCB_CDB_STORE+5));
ahd              9094 dev/ic/aic79xx.c 	for (i = 0; i < ahd->stack_size; i++) {
ahd              9095 dev/ic/aic79xx.c 		ahd->saved_stack[i] =
ahd              9096 dev/ic/aic79xx.c 		    ahd_inb(ahd, STACK)|(ahd_inb(ahd, STACK) << 8);
ahd              9097 dev/ic/aic79xx.c 		printf(" 0x%x", ahd->saved_stack[i]);
ahd              9099 dev/ic/aic79xx.c 	for (i = ahd->stack_size-1; i >= 0; i--) {
ahd              9100 dev/ic/aic79xx.c 		ahd_outb(ahd, STACK, ahd->saved_stack[i] & 0xFF);
ahd              9101 dev/ic/aic79xx.c 		ahd_outb(ahd, STACK, (ahd->saved_stack[i] >> 8) & 0xFF);
ahd              9104 dev/ic/aic79xx.c 	ahd_platform_dump_card_state(ahd);
ahd              9105 dev/ic/aic79xx.c 	ahd_restore_modes(ahd, saved_modes);
ahd              9107 dev/ic/aic79xx.c 		ahd_unpause(ahd);
ahd              9111 dev/ic/aic79xx.c ahd_dump_scbs(struct ahd_softc *ahd)
ahd              9117 dev/ic/aic79xx.c 	saved_modes = ahd_save_modes(ahd);
ahd              9118 dev/ic/aic79xx.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd              9119 dev/ic/aic79xx.c 	saved_scb_index = ahd_get_scbptr(ahd);
ahd              9121 dev/ic/aic79xx.c 		ahd_set_scbptr(ahd, i);
ahd              9124 dev/ic/aic79xx.c 		       ahd_inb_scbram(ahd, SCB_CONTROL),
ahd              9125 dev/ic/aic79xx.c 		       ahd_inb_scbram(ahd, SCB_SCSIID),
ahd              9126 dev/ic/aic79xx.c 		       ahd_inw_scbram(ahd, SCB_NEXT),
ahd              9127 dev/ic/aic79xx.c 		       ahd_inw_scbram(ahd, SCB_NEXT2),
ahd              9128 dev/ic/aic79xx.c 		       ahd_inl_scbram(ahd, SCB_SGPTR),
ahd              9129 dev/ic/aic79xx.c 		       ahd_inl_scbram(ahd, SCB_RESIDUAL_SGPTR));
ahd              9132 dev/ic/aic79xx.c 	ahd_set_scbptr(ahd, saved_scb_index);
ahd              9133 dev/ic/aic79xx.c 	ahd_restore_modes(ahd, saved_modes);
ahd              9142 dev/ic/aic79xx.c 	struct ahd_softc *ahd;
ahd              9151 dev/ic/aic79xx.c 	ahd = scb->ahd_softc;
ahd              9153 dev/ic/aic79xx.c 	ahd_lock(ahd, &s);
ahd              9156 dev/ic/aic79xx.c 	was_paused = ahd_is_paused(ahd);
ahd              9157 dev/ic/aic79xx.c 	printf("%s: SCB %d timed out - Card was %spaused\n", ahd_name(ahd),
ahd              9159 dev/ic/aic79xx.c 	ahd_dump_card_state(ahd);
ahd              9162 dev/ic/aic79xx.c 	ahd_pause(ahd);
ahd              9171 dev/ic/aic79xx.c 		LIST_FOREACH(list_scb, &ahd->pending_scbs, pending_links) {
ahd              9175 dev/ic/aic79xx.c 		channel = SCB_GET_CHANNEL(ahd, scb);
ahd              9176 dev/ic/aic79xx.c 		found = ahd_reset_channel(ahd, channel, /*Initiate Reset*/TRUE);
ahd              9179 dev/ic/aic79xx.c 		    ahd_name(ahd), channel, found);
ahd              9183 dev/ic/aic79xx.c 	ahd_unpause(ahd);
ahd              9184 dev/ic/aic79xx.c 	ahd_unlock(ahd, &s);
ahd              9195 dev/ic/aic79xx.c ahd_read_seeprom(struct ahd_softc *ahd, uint16_t *buf,
ahd              9207 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
ahd              9211 dev/ic/aic79xx.c 		ahd_outb(ahd, SEEADR, cur_addr);
ahd              9212 dev/ic/aic79xx.c 		ahd_outb(ahd, SEECTL, SEEOP_READ | SEESTART);
ahd              9214 dev/ic/aic79xx.c 		error = ahd_wait_seeprom(ahd);
ahd              9216 dev/ic/aic79xx.c 			printf("%s: ahd_wait_seeprom timed out\n", ahd_name(ahd));
ahd              9223 dev/ic/aic79xx.c 			*bytestream_ptr++ = ahd_inb(ahd, SEEDAT);
ahd              9224 dev/ic/aic79xx.c 			*bytestream_ptr = ahd_inb(ahd, SEEDAT+1);
ahd              9229 dev/ic/aic79xx.c 			*buf = ahd_inw(ahd, SEEDAT);
ahd              9242 dev/ic/aic79xx.c ahd_write_seeprom(struct ahd_softc *ahd, uint16_t *buf,
ahd              9250 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
ahd              9254 dev/ic/aic79xx.c 	ahd_outb(ahd, SEEADR, SEEOP_EWEN_ADDR);
ahd              9255 dev/ic/aic79xx.c 	ahd_outb(ahd, SEECTL, SEEOP_EWEN | SEESTART);
ahd              9256 dev/ic/aic79xx.c 	error = ahd_wait_seeprom(ahd);
ahd              9267 dev/ic/aic79xx.c 		ahd_outw(ahd, SEEDAT, *buf++);
ahd              9268 dev/ic/aic79xx.c 		ahd_outb(ahd, SEEADR, cur_addr);
ahd              9269 dev/ic/aic79xx.c 		ahd_outb(ahd, SEECTL, SEEOP_WRITE | SEESTART);
ahd              9271 dev/ic/aic79xx.c 		retval = ahd_wait_seeprom(ahd);
ahd              9279 dev/ic/aic79xx.c 	ahd_outb(ahd, SEEADR, SEEOP_EWDS_ADDR);
ahd              9280 dev/ic/aic79xx.c 	ahd_outb(ahd, SEECTL, SEEOP_EWDS | SEESTART);
ahd              9281 dev/ic/aic79xx.c 	error = ahd_wait_seeprom(ahd);
ahd              9291 dev/ic/aic79xx.c ahd_wait_seeprom(struct ahd_softc *ahd)
ahd              9296 dev/ic/aic79xx.c 	while ((ahd_inb(ahd, SEESTAT) & (SEEARBACK|SEEBUSY)) != 0 && --cnt)
ahd              9359 dev/ic/aic79xx.c ahd_acquire_seeprom(struct ahd_softc *ahd)
ahd              9373 dev/ic/aic79xx.c 	error = ahd_read_flexport(ahd, FLXADDR_ROMSTAT_CURSENSECTL, &seetype);
ahd              9382 dev/ic/aic79xx.c ahd_release_seeprom(struct ahd_softc *ahd)
ahd              9388 dev/ic/aic79xx.c ahd_write_flexport(struct ahd_softc *ahd, u_int addr, u_int value)
ahd              9392 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
ahd              9395 dev/ic/aic79xx.c 	ahd_outb(ahd, BRDCTL, BRDEN|(addr << 3));
ahd              9396 dev/ic/aic79xx.c 	error = ahd_wait_flexport(ahd);
ahd              9399 dev/ic/aic79xx.c 	ahd_outb(ahd, BRDDAT, value);
ahd              9400 dev/ic/aic79xx.c 	ahd_flush_device_writes(ahd);
ahd              9401 dev/ic/aic79xx.c 	ahd_outb(ahd, BRDCTL, BRDSTB|BRDEN|(addr << 3));
ahd              9402 dev/ic/aic79xx.c 	ahd_flush_device_writes(ahd);
ahd              9403 dev/ic/aic79xx.c 	ahd_outb(ahd, BRDCTL, BRDEN|(addr << 3));
ahd              9404 dev/ic/aic79xx.c 	ahd_flush_device_writes(ahd);
ahd              9405 dev/ic/aic79xx.c 	ahd_outb(ahd, BRDCTL, 0);
ahd              9406 dev/ic/aic79xx.c 	ahd_flush_device_writes(ahd);
ahd              9411 dev/ic/aic79xx.c ahd_read_flexport(struct ahd_softc *ahd, u_int addr, uint8_t *value)
ahd              9415 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
ahd              9418 dev/ic/aic79xx.c 	ahd_outb(ahd, BRDCTL, BRDRW|BRDEN|(addr << 3));
ahd              9419 dev/ic/aic79xx.c 	error = ahd_wait_flexport(ahd);
ahd              9422 dev/ic/aic79xx.c 	*value = ahd_inb(ahd, BRDDAT);
ahd              9423 dev/ic/aic79xx.c 	ahd_outb(ahd, BRDCTL, 0);
ahd              9424 dev/ic/aic79xx.c 	ahd_flush_device_writes(ahd);
ahd              9432 dev/ic/aic79xx.c ahd_wait_flexport(struct ahd_softc *ahd)
ahd              9436 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
ahd              9438 dev/ic/aic79xx.c 	while ((ahd_inb(ahd, BRDCTL) & FLXARBACK) == 0 && --cnt)
ahd              9449 dev/ic/aic79xx.c ahd_find_tmode_devs(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb,
ahd              9455 dev/ic/aic79xx.c 	if ((ahd->features & AHD_TARGETMODE) == 0)
ahd              9465 dev/ic/aic79xx.c 		*lstate = ahd->black_hole;
ahd              9469 dev/ic/aic79xx.c 		max_id = (ahd->features & AHD_WIDE) ? 15 : 7;
ahd              9476 dev/ic/aic79xx.c 		*tstate = ahd->enabled_targets[ccb->ccb_h.target_id];
ahd              9490 dev/ic/aic79xx.c ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb)
ahd              9503 dev/ic/aic79xx.c 	status = ahd_find_tmode_devs(ahd, sim, ccb, &tstate, &lstate,
ahd              9511 dev/ic/aic79xx.c 	if ((ahd->features & AHD_MULTIROLE) != 0) {
ahd              9514 dev/ic/aic79xx.c 		our_id = ahd->our_id;
ahd              9516 dev/ic/aic79xx.c 			if ((ahd->features & AHD_MULTI_TID) != 0
ahd              9517 dev/ic/aic79xx.c 		   	 && (ahd->flags & AHD_INITIATORROLE) != 0) {
ahd              9526 dev/ic/aic79xx.c 			} else if ((ahd->flags & AHD_INITIATORROLE) != 0
ahd              9527 dev/ic/aic79xx.c 				|| ahd->enabled_luns > 0) {
ahd              9549 dev/ic/aic79xx.c 	if ((ahd->flags & AHD_TARGETROLE) == 0
ahd              9554 dev/ic/aic79xx.c 		ahd_lock(ahd, &s);
ahd              9555 dev/ic/aic79xx.c 		if (LIST_FIRST(&ahd->pending_scbs) != NULL) {
ahd              9557 dev/ic/aic79xx.c 			ahd_unlock(ahd, &s);
ahd              9560 dev/ic/aic79xx.c 		ahd->flags |= AHD_TARGETROLE;
ahd              9561 dev/ic/aic79xx.c 		if ((ahd->features & AHD_MULTIROLE) == 0)
ahd              9562 dev/ic/aic79xx.c 			ahd->flags &= ~AHD_INITIATORROLE;
ahd              9563 dev/ic/aic79xx.c 		ahd_pause(ahd);
ahd              9564 dev/ic/aic79xx.c 		ahd_loadseq(ahd);
ahd              9565 dev/ic/aic79xx.c 		ahd_restart(ahd);
ahd              9566 dev/ic/aic79xx.c 		ahd_unlock(ahd, &s);
ahd              9571 dev/ic/aic79xx.c 	channel = SCSI_CHANNEL(ahd, sim);
ahd              9603 dev/ic/aic79xx.c 			tstate = ahd_alloc_tstate(ahd, target, channel);
ahd              9632 dev/ic/aic79xx.c 		ahd_lock(ahd, &s);
ahd              9633 dev/ic/aic79xx.c 		ahd_pause(ahd);
ahd              9636 dev/ic/aic79xx.c 			ahd->enabled_luns++;
ahd              9638 dev/ic/aic79xx.c 			if ((ahd->features & AHD_MULTI_TID) != 0) {
ahd              9641 dev/ic/aic79xx.c 				targid_mask = ahd_inw(ahd, TARGID);
ahd              9643 dev/ic/aic79xx.c 				ahd_outw(ahd, TARGID, targid_mask);
ahd              9644 dev/ic/aic79xx.c 				ahd_update_scsiid(ahd, targid_mask);
ahd              9649 dev/ic/aic79xx.c 				channel = SCSI_CHANNEL(ahd, sim);
ahd              9650 dev/ic/aic79xx.c 				our_id = SCSI_SCSI_ID(ahd, sim);
ahd              9661 dev/ic/aic79xx.c 					sblkctl = ahd_inb(ahd, SBLKCTL);
ahd              9664 dev/ic/aic79xx.c 					if ((ahd->features & AHD_TWIN) == 0)
ahd              9667 dev/ic/aic79xx.c 					ahd->our_id = target;
ahd              9670 dev/ic/aic79xx.c 						ahd_outb(ahd, SBLKCTL,
ahd              9673 dev/ic/aic79xx.c 					ahd_outb(ahd, SCSIID, target);
ahd              9676 dev/ic/aic79xx.c 						ahd_outb(ahd, SBLKCTL, sblkctl);
ahd              9680 dev/ic/aic79xx.c 			ahd->black_hole = lstate;
ahd              9682 dev/ic/aic79xx.c 		if (ahd->black_hole != NULL && ahd->enabled_luns > 0) {
ahd              9683 dev/ic/aic79xx.c 			scsiseq1 = ahd_inb(ahd, SCSISEQ_TEMPLATE);
ahd              9685 dev/ic/aic79xx.c 			ahd_outb(ahd, SCSISEQ_TEMPLATE, scsiseq1);
ahd              9686 dev/ic/aic79xx.c 			scsiseq1 = ahd_inb(ahd, SCSISEQ1);
ahd              9688 dev/ic/aic79xx.c 			ahd_outb(ahd, SCSISEQ1, scsiseq1);
ahd              9690 dev/ic/aic79xx.c 		ahd_unpause(ahd);
ahd              9691 dev/ic/aic79xx.c 		ahd_unlock(ahd, &s);
ahd              9704 dev/ic/aic79xx.c 		ahd_lock(ahd, &s);
ahd              9707 dev/ic/aic79xx.c 		LIST_FOREACH(scb, &ahd->pending_scbs, pending_links) {
ahd              9715 dev/ic/aic79xx.c 				ahd_unlock(ahd, &s);
ahd              9731 dev/ic/aic79xx.c 			ahd_unlock(ahd, &s);
ahd              9740 dev/ic/aic79xx.c 		ahd_pause(ahd);
ahd              9744 dev/ic/aic79xx.c 			ahd->enabled_luns--;
ahd              9752 dev/ic/aic79xx.c 				ahd_free_tstate(ahd, target, channel,
ahd              9754 dev/ic/aic79xx.c 				if (ahd->features & AHD_MULTI_TID) {
ahd              9757 dev/ic/aic79xx.c 					targid_mask = ahd_inw(ahd, TARGID);
ahd              9759 dev/ic/aic79xx.c 					ahd_outw(ahd, TARGID, targid_mask);
ahd              9760 dev/ic/aic79xx.c 					ahd_update_scsiid(ahd, targid_mask);
ahd              9765 dev/ic/aic79xx.c 			ahd->black_hole = NULL;
ahd              9773 dev/ic/aic79xx.c 		if (ahd->enabled_luns == 0) {
ahd              9777 dev/ic/aic79xx.c 			scsiseq1 = ahd_inb(ahd, SCSISEQ_TEMPLATE);
ahd              9779 dev/ic/aic79xx.c 			ahd_outb(ahd, SCSISEQ_TEMPLATE, scsiseq1);
ahd              9780 dev/ic/aic79xx.c 			scsiseq1 = ahd_inb(ahd, SCSISEQ1);
ahd              9782 dev/ic/aic79xx.c 			ahd_outb(ahd, SCSISEQ1, scsiseq1);
ahd              9784 dev/ic/aic79xx.c 			if ((ahd->features & AHD_MULTIROLE) == 0) {
ahd              9786 dev/ic/aic79xx.c 				ahd->flags &= ~AHD_TARGETROLE;
ahd              9787 dev/ic/aic79xx.c 				ahd->flags |= AHD_INITIATORROLE;
ahd              9788 dev/ic/aic79xx.c 				ahd_pause(ahd);
ahd              9789 dev/ic/aic79xx.c 				ahd_loadseq(ahd);
ahd              9790 dev/ic/aic79xx.c 				ahd_restart(ahd);
ahd              9797 dev/ic/aic79xx.c 		ahd_unpause(ahd);
ahd              9798 dev/ic/aic79xx.c 		ahd_unlock(ahd, &s);
ahd              9804 dev/ic/aic79xx.c ahd_update_scsiid(struct ahd_softc *ahd, u_int targid_mask)
ahd              9810 dev/ic/aic79xx.c 	if ((ahd->features & AHD_MULTI_TID) == 0)
ahd              9819 dev/ic/aic79xx.c 	if ((ahd->features & AHD_ULTRA2) != 0)
ahd              9820 dev/ic/aic79xx.c 		scsiid = ahd_inb(ahd, SCSIID_ULTRA2);
ahd              9822 dev/ic/aic79xx.c 		scsiid = ahd_inb(ahd, SCSIID);
ahd              9830 dev/ic/aic79xx.c 			our_id = ahd->our_id;
ahd              9836 dev/ic/aic79xx.c 	if ((ahd->features & AHD_ULTRA2) != 0)
ahd              9837 dev/ic/aic79xx.c 		ahd_outb(ahd, SCSIID_ULTRA2, scsiid);
ahd              9839 dev/ic/aic79xx.c 		ahd_outb(ahd, SCSIID, scsiid);
ahd              9844 dev/ic/aic79xx.c ahd_run_tqinfifo(struct ahd_softc *ahd, int paused)
ahd              9848 dev/ic/aic79xx.c 	ahd_sync_tqinfifo(ahd, BUS_DMASYNC_POSTREAD);
ahd              9849 dev/ic/aic79xx.c 	while ((cmd = &ahd->targetcmds[ahd->tqinfifonext])->cmd_valid != 0) {
ahd              9855 dev/ic/aic79xx.c 		if (ahd_handle_target_cmd(ahd, cmd) != 0)
ahd              9859 dev/ic/aic79xx.c 		ahd_dmamap_sync(ahd, ahd->parent_dmat /*shared_data_dmat*/,
ahd              9860 dev/ic/aic79xx.c 				ahd->shared_data_dmamap,
ahd              9861 dev/ic/aic79xx.c 				ahd_targetcmd_offset(ahd, ahd->tqinfifonext),
ahd              9864 dev/ic/aic79xx.c 		ahd->tqinfifonext++;
ahd              9870 dev/ic/aic79xx.c 		if ((ahd->tqinfifonext & (HOST_TQINPOS - 1)) == 1) {
ahd              9873 dev/ic/aic79xx.c 			hs_mailbox = ahd_inb(ahd, HS_MAILBOX);
ahd              9875 dev/ic/aic79xx.c 			hs_mailbox |= ahd->tqinfifonext & HOST_TQINPOS;
ahd              9876 dev/ic/aic79xx.c 			ahd_outb(ahd, HS_MAILBOX, hs_mailbox);
ahd              9882 dev/ic/aic79xx.c ahd_handle_target_cmd(struct ahd_softc *ahd, struct target_cmd *cmd)
ahd              9892 dev/ic/aic79xx.c 	initiator = SCSIID_TARGET(ahd, cmd->scsiid);
ahd              9897 dev/ic/aic79xx.c 	tstate = ahd->enabled_targets[target];
ahd              9906 dev/ic/aic79xx.c 		lstate = ahd->black_hole;
ahd              9910 dev/ic/aic79xx.c 		ahd->flags |= AHD_TQINFIFO_BLOCKED;
ahd              9916 dev/ic/aic79xx.c 		ahd->flags &= ~AHD_TQINFIFO_BLOCKED;
ahd              9921 dev/ic/aic79xx.c 		       lstate == ahd->black_hole ? "(Black Holed)" : "");
ahd              9925 dev/ic/aic79xx.c 	if (lstate == ahd->black_hole) {
ahd              9984 dev/ic/aic79xx.c 			       initiator, target, lun, ahd->pending_device);
ahd              9986 dev/ic/aic79xx.c 		ahd->pending_device = lstate;
ahd              9997 dev/ic/aic79xx.c ahd_createdmamem(struct ahd_softc *ahd, size_t size, struct map_node *map,
ahd              10000 dev/ic/aic79xx.c 	bus_dma_tag_t tag = ahd->parent_dmat;
ahd              10008 dev/ic/aic79xx.c 		    ahd_name(ahd), what, error);
ahd              10015 dev/ic/aic79xx.c 		    ahd_name(ahd), what, error);
ahd              10022 dev/ic/aic79xx.c 		    ahd_name(ahd), what, error);
ahd              10029 dev/ic/aic79xx.c 		    ahd_name(ahd), what, error);
ahd              10049 dev/ic/aic79xx.c ahd_freedmamem(struct ahd_softc* ahd, struct map_node *map)
ahd              10051 dev/ic/aic79xx.c 	bus_dma_tag_t tag = ahd->parent_dmat;
ahd              10060 dev/ic/aic79xx.c ahd_name(struct ahd_softc *ahd)
ahd              10062 dev/ic/aic79xx.c 	return (ahd->name);
ahd              10066 dev/ic/aic79xx.c ahd_known_modes(struct ahd_softc *ahd, ahd_mode src, ahd_mode dst)
ahd              10068 dev/ic/aic79xx.c 	ahd->src_mode = src;
ahd              10069 dev/ic/aic79xx.c 	ahd->dst_mode = dst;
ahd              10070 dev/ic/aic79xx.c 	ahd->saved_src_mode = src;
ahd              10071 dev/ic/aic79xx.c 	ahd->saved_dst_mode = dst;
ahd              10075 dev/ic/aic79xx.c ahd_build_mode_state(struct ahd_softc *ahd, ahd_mode src, ahd_mode dst)
ahd              10081 dev/ic/aic79xx.c ahd_extract_mode_state(struct ahd_softc *ahd, ahd_mode_state state,
ahd              10089 dev/ic/aic79xx.c ahd_set_modes(struct ahd_softc *ahd, ahd_mode src, ahd_mode dst)
ahd              10091 dev/ic/aic79xx.c 	if (ahd->src_mode == src && ahd->dst_mode == dst)
ahd              10094 dev/ic/aic79xx.c 	if (ahd->src_mode == AHD_MODE_UNKNOWN
ahd              10095 dev/ic/aic79xx.c 	 || ahd->dst_mode == AHD_MODE_UNKNOWN)
ahd              10098 dev/ic/aic79xx.c 		printf("%s: Setting mode 0x%x\n", ahd_name(ahd),
ahd              10099 dev/ic/aic79xx.c 		       ahd_build_mode_state(ahd, src, dst));
ahd              10101 dev/ic/aic79xx.c 	ahd_outb(ahd, MODE_PTR, ahd_build_mode_state(ahd, src, dst));
ahd              10102 dev/ic/aic79xx.c 	ahd->src_mode = src;
ahd              10103 dev/ic/aic79xx.c 	ahd->dst_mode = dst;
ahd              10107 dev/ic/aic79xx.c ahd_update_modes(struct ahd_softc *ahd)
ahd              10113 dev/ic/aic79xx.c 	mode_ptr = ahd_inb(ahd, MODE_PTR);
ahd              10118 dev/ic/aic79xx.c 	ahd_extract_mode_state(ahd, mode_ptr, &src, &dst);
ahd              10119 dev/ic/aic79xx.c 	ahd_known_modes(ahd, src, dst);
ahd              10123 dev/ic/aic79xx.c ahd_assert_modes(struct ahd_softc *ahd, ahd_mode srcmode,
ahd              10127 dev/ic/aic79xx.c 	if ((srcmode & AHD_MK_MSK(ahd->src_mode)) == 0
ahd              10128 dev/ic/aic79xx.c 	 || (dstmode & AHD_MK_MSK(ahd->dst_mode)) == 0) {
ahd              10130 dev/ic/aic79xx.c 		       ahd_name(ahd), file, line);
ahd              10136 dev/ic/aic79xx.c ahd_save_modes(struct ahd_softc *ahd)
ahd              10138 dev/ic/aic79xx.c 	if (ahd->src_mode == AHD_MODE_UNKNOWN
ahd              10139 dev/ic/aic79xx.c 	 || ahd->dst_mode == AHD_MODE_UNKNOWN)
ahd              10140 dev/ic/aic79xx.c 		ahd_update_modes(ahd);
ahd              10142 dev/ic/aic79xx.c 	return (ahd_build_mode_state(ahd, ahd->src_mode, ahd->dst_mode));
ahd              10146 dev/ic/aic79xx.c ahd_restore_modes(struct ahd_softc *ahd, ahd_mode_state state)
ahd              10151 dev/ic/aic79xx.c 	ahd_extract_mode_state(ahd, state, &src, &dst);
ahd              10152 dev/ic/aic79xx.c 	ahd_set_modes(ahd, src, dst);
ahd              10160 dev/ic/aic79xx.c ahd_is_paused(struct ahd_softc *ahd)
ahd              10162 dev/ic/aic79xx.c 	return ((ahd_inb(ahd, HCNTRL) & PAUSE) != 0);
ahd              10173 dev/ic/aic79xx.c ahd_pause(struct ahd_softc *ahd)
ahd              10175 dev/ic/aic79xx.c 	ahd_outb(ahd, HCNTRL, ahd->pause);
ahd              10181 dev/ic/aic79xx.c 	while (ahd_is_paused(ahd) == 0)
ahd              10196 dev/ic/aic79xx.c ahd_unpause(struct ahd_softc *ahd)
ahd              10202 dev/ic/aic79xx.c 	if (ahd->saved_src_mode != AHD_MODE_UNKNOWN
ahd              10203 dev/ic/aic79xx.c 	 && ahd->saved_dst_mode != AHD_MODE_UNKNOWN) {
ahd              10204 dev/ic/aic79xx.c 		if ((ahd->flags & AHD_UPDATE_PEND_CMDS) != 0)
ahd              10205 dev/ic/aic79xx.c 			ahd_reset_cmds_pending(ahd);
ahd              10206 dev/ic/aic79xx.c 		ahd_set_modes(ahd, ahd->saved_src_mode, ahd->saved_dst_mode);
ahd              10209 dev/ic/aic79xx.c 	if ((ahd_inb(ahd, INTSTAT) & ~CMDCMPLT) == 0)
ahd              10210 dev/ic/aic79xx.c 		ahd_outb(ahd, HCNTRL, ahd->unpause);
ahd              10212 dev/ic/aic79xx.c 	ahd_known_modes(ahd, AHD_MODE_UNKNOWN, AHD_MODE_UNKNOWN);
ahd              10216 dev/ic/aic79xx.c ahd_sg_setup(struct ahd_softc *ahd, struct scb *scb,
ahd              10221 dev/ic/aic79xx.c 	 && (ahd->flags & AHD_64BIT_ADDRESSING) != 0) {
ahd              10240 dev/ic/aic79xx.c ahd_setup_scb_common(struct ahd_softc *ahd, struct scb *scb)
ahd              10261 dev/ic/aic79xx.c ahd_setup_data_scb(struct ahd_softc *ahd, struct scb *scb)
ahd              10266 dev/ic/aic79xx.c 	if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0) {
ahd              10280 dev/ic/aic79xx.c 		if ((ahd->flags & AHD_39BIT_ADDRESSING) != 0) {
ahd              10298 dev/ic/aic79xx.c ahd_setup_noxfer_scb(struct ahd_softc *ahd, struct scb *scb)
ahd              10306 dev/ic/aic79xx.c ahd_sg_size(struct ahd_softc *ahd)
ahd              10308 dev/ic/aic79xx.c 	if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0)
ahd              10314 dev/ic/aic79xx.c ahd_sg_bus_to_virt(struct ahd_softc *ahd, struct scb *scb, uint32_t sg_busaddr)
ahd              10319 dev/ic/aic79xx.c 	sg_offset = sg_busaddr - (scb->sg_list_busaddr - ahd_sg_size(ahd));
ahd              10324 dev/ic/aic79xx.c ahd_sg_virt_to_bus(struct ahd_softc *ahd, struct scb *scb, void *sg)
ahd              10330 dev/ic/aic79xx.c 		  - ahd_sg_size(ahd);
ahd              10336 dev/ic/aic79xx.c ahd_sync_scb(struct ahd_softc *ahd, struct scb *scb, int op)
ahd              10338 dev/ic/aic79xx.c 	ahd_dmamap_sync(ahd, ahd->parent_dmat, scb->hscb_map->dmamap,
ahd              10344 dev/ic/aic79xx.c ahd_sync_sglist(struct ahd_softc *ahd, struct scb *scb, int op)
ahd              10349 dev/ic/aic79xx.c 	ahd_dmamap_sync(ahd, ahd->parent_dmat,
ahd              10351 dev/ic/aic79xx.c 			/*offset*/scb->sg_list_busaddr - ahd_sg_size(ahd),
ahd              10352 dev/ic/aic79xx.c 			/*len*/ahd_sg_size(ahd) * scb->sg_count, op);
ahd              10356 dev/ic/aic79xx.c ahd_sync_sense(struct ahd_softc *ahd, struct scb *scb, int op)
ahd              10358 dev/ic/aic79xx.c 	ahd_dmamap_sync(ahd, ahd->parent_dmat,
ahd              10365 dev/ic/aic79xx.c ahd_targetcmd_offset(struct ahd_softc *ahd, u_int index)
ahd              10367 dev/ic/aic79xx.c 	return (((uint8_t *)&ahd->targetcmds[index])
ahd              10368 dev/ic/aic79xx.c 	       - (uint8_t *)ahd->qoutfifo);
ahd              10372 dev/ic/aic79xx.c ahd_complete_scb(struct ahd_softc *ahd, struct scb *scb)
ahd              10378 dev/ic/aic79xx.c 		ahd_handle_scb_status(ahd, scb);
ahd              10380 dev/ic/aic79xx.c 		ahd_done(ahd, scb);
ahd              10388 dev/ic/aic79xx.c ahd_update_residual(struct ahd_softc *ahd, struct scb *scb)
ahd              10394 dev/ic/aic79xx.c 		ahd_calc_residual(ahd, scb);
ahd              10402 dev/ic/aic79xx.c ahd_fetch_transinfo(struct ahd_softc *ahd, char channel, u_int our_id,
ahd              10413 dev/ic/aic79xx.c 	*tstate = ahd->enabled_targets[our_id];
ahd              10424 dev/ic/aic79xx.c ahd_inw(struct ahd_softc *ahd, u_int port)
ahd              10431 dev/ic/aic79xx.c 	return ((ahd_inb(ahd, port+1) << 8) | ahd_inb(ahd, port));
ahd              10435 dev/ic/aic79xx.c ahd_outw(struct ahd_softc *ahd, u_int port, u_int value)
ahd              10441 dev/ic/aic79xx.c 	ahd_outb(ahd, port, value & 0xFF);
ahd              10442 dev/ic/aic79xx.c 	ahd_outb(ahd, port+1, (value >> 8) & 0xFF);
ahd              10446 dev/ic/aic79xx.c ahd_inl(struct ahd_softc *ahd, u_int port)
ahd              10448 dev/ic/aic79xx.c 	return ((ahd_inb(ahd, port))
ahd              10449 dev/ic/aic79xx.c 	      | (ahd_inb(ahd, port+1) << 8)
ahd              10450 dev/ic/aic79xx.c 	      | (ahd_inb(ahd, port+2) << 16)
ahd              10451 dev/ic/aic79xx.c 	      | (ahd_inb(ahd, port+3) << 24));
ahd              10455 dev/ic/aic79xx.c ahd_outl(struct ahd_softc *ahd, u_int port, uint32_t value)
ahd              10457 dev/ic/aic79xx.c 	ahd_outb(ahd, port, (value) & 0xFF);
ahd              10458 dev/ic/aic79xx.c 	ahd_outb(ahd, port+1, ((value) >> 8) & 0xFF);
ahd              10459 dev/ic/aic79xx.c 	ahd_outb(ahd, port+2, ((value) >> 16) & 0xFF);
ahd              10460 dev/ic/aic79xx.c 	ahd_outb(ahd, port+3, ((value) >> 24) & 0xFF);
ahd              10464 dev/ic/aic79xx.c ahd_inq(struct ahd_softc *ahd, u_int port)
ahd              10466 dev/ic/aic79xx.c 	return ((ahd_inb(ahd, port))
ahd              10467 dev/ic/aic79xx.c 	      | (ahd_inb(ahd, port+1) << 8)
ahd              10468 dev/ic/aic79xx.c 	      | (ahd_inb(ahd, port+2) << 16)
ahd              10469 dev/ic/aic79xx.c 	      | (ahd_inb(ahd, port+3) << 24)
ahd              10470 dev/ic/aic79xx.c 	      | (((uint64_t)ahd_inb(ahd, port+4)) << 32)
ahd              10471 dev/ic/aic79xx.c 	      | (((uint64_t)ahd_inb(ahd, port+5)) << 40)
ahd              10472 dev/ic/aic79xx.c 	      | (((uint64_t)ahd_inb(ahd, port+6)) << 48)
ahd              10473 dev/ic/aic79xx.c 	      | (((uint64_t)ahd_inb(ahd, port+7)) << 56));
ahd              10477 dev/ic/aic79xx.c ahd_outq(struct ahd_softc *ahd, u_int port, uint64_t value)
ahd              10479 dev/ic/aic79xx.c 	ahd_outb(ahd, port, value & 0xFF);
ahd              10480 dev/ic/aic79xx.c 	ahd_outb(ahd, port+1, (value >> 8) & 0xFF);
ahd              10481 dev/ic/aic79xx.c 	ahd_outb(ahd, port+2, (value >> 16) & 0xFF);
ahd              10482 dev/ic/aic79xx.c 	ahd_outb(ahd, port+3, (value >> 24) & 0xFF);
ahd              10483 dev/ic/aic79xx.c 	ahd_outb(ahd, port+4, (value >> 32) & 0xFF);
ahd              10484 dev/ic/aic79xx.c 	ahd_outb(ahd, port+5, (value >> 40) & 0xFF);
ahd              10485 dev/ic/aic79xx.c 	ahd_outb(ahd, port+6, (value >> 48) & 0xFF);
ahd              10486 dev/ic/aic79xx.c 	ahd_outb(ahd, port+7, (value >> 56) & 0xFF);
ahd              10490 dev/ic/aic79xx.c ahd_get_scbptr(struct ahd_softc *ahd)
ahd              10492 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK),
ahd              10494 dev/ic/aic79xx.c 	return (ahd_inb(ahd, SCBPTR) | (ahd_inb(ahd, SCBPTR + 1) << 8));
ahd              10498 dev/ic/aic79xx.c ahd_set_scbptr(struct ahd_softc *ahd, u_int scbptr)
ahd              10500 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK),
ahd              10502 dev/ic/aic79xx.c 	ahd_outb(ahd, SCBPTR, scbptr & 0xFF);
ahd              10503 dev/ic/aic79xx.c 	ahd_outb(ahd, SCBPTR+1, (scbptr >> 8) & 0xFF);
ahd              10507 dev/ic/aic79xx.c ahd_get_hnscb_qoff(struct ahd_softc *ahd)
ahd              10509 dev/ic/aic79xx.c 	return (ahd_inw_atomic(ahd, HNSCB_QOFF));
ahd              10513 dev/ic/aic79xx.c ahd_set_hnscb_qoff(struct ahd_softc *ahd, u_int value)
ahd              10515 dev/ic/aic79xx.c 	ahd_outw_atomic(ahd, HNSCB_QOFF, value);
ahd              10519 dev/ic/aic79xx.c ahd_get_hescb_qoff(struct ahd_softc *ahd)
ahd              10521 dev/ic/aic79xx.c 	return (ahd_inb(ahd, HESCB_QOFF));
ahd              10525 dev/ic/aic79xx.c ahd_set_hescb_qoff(struct ahd_softc *ahd, u_int value)
ahd              10527 dev/ic/aic79xx.c 	ahd_outb(ahd, HESCB_QOFF, value);
ahd              10531 dev/ic/aic79xx.c ahd_get_snscb_qoff(struct ahd_softc *ahd)
ahd              10535 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
ahd              10536 dev/ic/aic79xx.c 	oldvalue = ahd_inw(ahd, SNSCB_QOFF);
ahd              10537 dev/ic/aic79xx.c 	ahd_outw(ahd, SNSCB_QOFF, oldvalue);
ahd              10542 dev/ic/aic79xx.c ahd_set_snscb_qoff(struct ahd_softc *ahd, u_int value)
ahd              10544 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
ahd              10545 dev/ic/aic79xx.c 	ahd_outw(ahd, SNSCB_QOFF, value);
ahd              10549 dev/ic/aic79xx.c ahd_get_sescb_qoff(struct ahd_softc *ahd)
ahd              10551 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
ahd              10552 dev/ic/aic79xx.c 	return (ahd_inb(ahd, SESCB_QOFF));
ahd              10556 dev/ic/aic79xx.c ahd_set_sescb_qoff(struct ahd_softc *ahd, u_int value)
ahd              10558 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
ahd              10559 dev/ic/aic79xx.c 	ahd_outb(ahd, SESCB_QOFF, value);
ahd              10563 dev/ic/aic79xx.c ahd_get_sdscb_qoff(struct ahd_softc *ahd)
ahd              10565 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
ahd              10566 dev/ic/aic79xx.c 	return (ahd_inb(ahd, SDSCB_QOFF) | (ahd_inb(ahd, SDSCB_QOFF + 1) << 8));
ahd              10570 dev/ic/aic79xx.c ahd_set_sdscb_qoff(struct ahd_softc *ahd, u_int value)
ahd              10572 dev/ic/aic79xx.c 	AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
ahd              10573 dev/ic/aic79xx.c 	ahd_outb(ahd, SDSCB_QOFF, value & 0xFF);
ahd              10574 dev/ic/aic79xx.c 	ahd_outb(ahd, SDSCB_QOFF+1, (value >> 8) & 0xFF);
ahd              10578 dev/ic/aic79xx.c ahd_inb_scbram(struct ahd_softc *ahd, u_int offset)
ahd              10596 dev/ic/aic79xx.c 	value = ahd_inb(ahd, offset);
ahd              10597 dev/ic/aic79xx.c 	if ((ahd->bugs & AHD_PCIX_SCBRAM_RD_BUG) != 0)
ahd              10598 dev/ic/aic79xx.c 		ahd_inb(ahd, MODE_PTR);
ahd              10603 dev/ic/aic79xx.c ahd_inw_scbram(struct ahd_softc *ahd, u_int offset)
ahd              10605 dev/ic/aic79xx.c 	return (ahd_inb_scbram(ahd, offset)
ahd              10606 dev/ic/aic79xx.c 	      | (ahd_inb_scbram(ahd, offset+1) << 8));
ahd              10610 dev/ic/aic79xx.c ahd_inl_scbram(struct ahd_softc *ahd, u_int offset)
ahd              10612 dev/ic/aic79xx.c 	return (ahd_inw_scbram(ahd, offset)
ahd              10613 dev/ic/aic79xx.c 	      | (ahd_inw_scbram(ahd, offset+2) << 16));
ahd              10617 dev/ic/aic79xx.c ahd_inq_scbram(struct ahd_softc *ahd, u_int offset)
ahd              10619 dev/ic/aic79xx.c 	return (ahd_inl_scbram(ahd, offset)
ahd              10620 dev/ic/aic79xx.c 	      | ((uint64_t)ahd_inl_scbram(ahd, offset+4)) << 32);
ahd              10624 dev/ic/aic79xx.c ahd_lookup_scb(struct ahd_softc *ahd, u_int tag)
ahd              10630 dev/ic/aic79xx.c 	scb = ahd->scb_data.scbindex[tag];
ahd              10632 dev/ic/aic79xx.c 		ahd_sync_scb(ahd, scb,
ahd              10638 dev/ic/aic79xx.c ahd_swap_with_next_hscb(struct ahd_softc *ahd, struct scb *scb)
ahd              10656 dev/ic/aic79xx.c 	q_hscb = ahd->next_queued_hscb;
ahd              10657 dev/ic/aic79xx.c 	q_hscb_map = ahd->next_queued_hscb_map;
ahd              10664 dev/ic/aic79xx.c 	ahd->next_queued_hscb = scb->hscb;
ahd              10665 dev/ic/aic79xx.c 	ahd->next_queued_hscb_map = scb->hscb_map;
ahd              10670 dev/ic/aic79xx.c 	ahd->scb_data.scbindex[SCB_GET_TAG(scb)] = scb;
ahd              10677 dev/ic/aic79xx.c ahd_queue_scb(struct ahd_softc *ahd, struct scb *scb)
ahd              10679 dev/ic/aic79xx.c 	ahd_swap_with_next_hscb(ahd, scb);
ahd              10688 dev/ic/aic79xx.c 	ahd->qinfifo[AHD_QIN_WRAP(ahd->qinfifonext)] = SCB_GET_TAG(scb);
ahd              10689 dev/ic/aic79xx.c 	ahd->qinfifonext++;
ahd              10692 dev/ic/aic79xx.c 		ahd_setup_data_scb(ahd, scb);
ahd              10694 dev/ic/aic79xx.c 		ahd_setup_noxfer_scb(ahd, scb);
ahd              10695 dev/ic/aic79xx.c 	ahd_setup_scb_common(ahd, scb);
ahd              10701 dev/ic/aic79xx.c 	ahd_sync_scb(ahd, scb, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
ahd              10709 dev/ic/aic79xx.c 		       ahd_name(ahd),
ahd              10718 dev/ic/aic79xx.c 	ahd_set_hnscb_qoff(ahd, ahd->qinfifonext);
ahd              10722 dev/ic/aic79xx.c ahd_get_sense_buf(struct ahd_softc *ahd, struct scb *scb)
ahd              10728 dev/ic/aic79xx.c ahd_get_sense_bufaddr(struct ahd_softc *ahd, struct scb *scb)
ahd              10734 dev/ic/aic79xx.c ahd_sync_qoutfifo(struct ahd_softc *ahd, int op)
ahd              10736 dev/ic/aic79xx.c 	ahd_dmamap_sync(ahd, ahd->parent_dmat, ahd->shared_data_map.dmamap,
ahd              10742 dev/ic/aic79xx.c ahd_sync_tqinfifo(struct ahd_softc *ahd, int op)
ahd              10745 dev/ic/aic79xx.c 	if ((ahd->flags & AHD_TARGETROLE) != 0) {
ahd              10746 dev/ic/aic79xx.c 		ahd_dmamap_sync(ahd, ahd->parent_dmat,
ahd              10747 dev/ic/aic79xx.c 				ahd->shared_data_map.dmamap,
ahd              10748 dev/ic/aic79xx.c 				ahd_targetcmd_offset(ahd, 0),
ahd              10762 dev/ic/aic79xx.c ahd_check_cmdcmpltqueues(struct ahd_softc *ahd)
ahd              10767 dev/ic/aic79xx.c 	ahd_dmamap_sync(ahd, ahd->parent_dmat, ahd->shared_data_map.dmamap,
ahd              10768 dev/ic/aic79xx.c 			/*offset*/ahd->qoutfifonext * sizeof(*ahd->qoutfifo),
ahd              10769 dev/ic/aic79xx.c 			/*len*/sizeof(*ahd->qoutfifo), BUS_DMASYNC_POSTREAD);
ahd              10770 dev/ic/aic79xx.c 	if (ahd->qoutfifo[ahd->qoutfifonext].valid_tag
ahd              10771 dev/ic/aic79xx.c 	  == ahd->qoutfifonext_valid_tag)
ahd              10774 dev/ic/aic79xx.c 	if ((ahd->flags & AHD_TARGETROLE) != 0
ahd              10775 dev/ic/aic79xx.c 	 && (ahd->flags & AHD_TQINFIFO_BLOCKED) == 0) {
ahd              10776 dev/ic/aic79xx.c 		ahd_dmamap_sync(ahd, ahd->parent_dmat
ahd              10777 dev/ic/aic79xx.c 				ahd->shared_data_map.dmamap,
ahd              10778 dev/ic/aic79xx.c 				ahd_targetcmd_offset(ahd, ahd->tqinfifofnext),
ahd              10781 dev/ic/aic79xx.c 		if (ahd->targetcmds[ahd->tqinfifonext].cmd_valid != 0)
ahd              10792 dev/ic/aic79xx.c ahd_intr(struct ahd_softc *ahd)
ahd              10796 dev/ic/aic79xx.c 	if ((ahd->pause & INTEN) == 0) {
ahd              10812 dev/ic/aic79xx.c 	if ((ahd->flags & AHD_ALL_INTERRUPTS) == 0
ahd              10813 dev/ic/aic79xx.c 	 && (ahd_check_cmdcmpltqueues(ahd) != 0))
ahd              10816 dev/ic/aic79xx.c 		intstat = ahd_inb(ahd, INTSTAT);
ahd              10822 dev/ic/aic79xx.c 		ahd_outb(ahd, CLRINT, CLRCMDINT);
ahd              10832 dev/ic/aic79xx.c 		if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) {
ahd              10833 dev/ic/aic79xx.c 			if (ahd_is_paused(ahd)) {
ahd              10839 dev/ic/aic79xx.c 				if (ahd_inb(ahd, SEQINTCODE) != NO_SEQINT)
ahd              10843 dev/ic/aic79xx.c 			ahd_flush_device_writes(ahd);
ahd              10845 dev/ic/aic79xx.c 		ahd_run_qoutfifo(ahd);
ahd              10846 dev/ic/aic79xx.c 		ahd->cmdcmplt_counts[ahd->cmdcmplt_bucket]++;
ahd              10847 dev/ic/aic79xx.c 		ahd->cmdcmplt_total++;
ahd              10849 dev/ic/aic79xx.c 		if ((ahd->flags & AHD_TARGETROLE) != 0)
ahd              10850 dev/ic/aic79xx.c 			ahd_run_tqinfifo(ahd, /*paused*/FALSE);
ahd              10858 dev/ic/aic79xx.c 	if (intstat == 0xFF && (ahd->features & AHD_REMOVABLE) != 0) {
ahd              10861 dev/ic/aic79xx.c 		ahd_handle_hwerrint(ahd);
ahd              10863 dev/ic/aic79xx.c 		ahd->bus_intr(ahd);
ahd              10867 dev/ic/aic79xx.c 			ahd_handle_seqint(ahd, intstat);
ahd              10870 dev/ic/aic79xx.c 			ahd_handle_scsiint(ahd, intstat);
ahd              10876 dev/ic/aic79xx.c ahd_unbusy_tcl(struct ahd_softc *ahd, u_int tcl)
ahd              10878 dev/ic/aic79xx.c 	ahd_busy_tcl(ahd, tcl, SCB_LIST_NULL);
ahd               114 dev/ic/aic79xx.h #define SCSIID_TARGET(ahd, scsiid)	\
ahd               118 dev/ic/aic79xx.h #define SCSIID_CHANNEL(ahd, scsiid) ('A')
ahd               119 dev/ic/aic79xx.h #define	SCB_IS_SCSIBUS_B(ahd, scb) (0)
ahd               122 dev/ic/aic79xx.h #define	SCB_GET_TARGET(ahd, scb) \
ahd               123 dev/ic/aic79xx.h 	SCSIID_TARGET((ahd), (scb)->hscb->scsiid)
ahd               124 dev/ic/aic79xx.h #define	SCB_GET_CHANNEL(ahd, scb) \
ahd               125 dev/ic/aic79xx.h 	SCSIID_CHANNEL(ahd, (scb)->hscb->scsiid)
ahd               128 dev/ic/aic79xx.h #define SCB_GET_TARGET_OFFSET(ahd, scb)	\
ahd               129 dev/ic/aic79xx.h 	SCB_GET_TARGET(ahd, scb)
ahd               130 dev/ic/aic79xx.h #define SCB_GET_TARGET_MASK(ahd, scb) \
ahd               131 dev/ic/aic79xx.h 	(0x01 << (SCB_GET_TARGET_OFFSET(ahd, scb)))
ahd               163 dev/ic/aic79xx.h #define AHD_GET_SCB_COL_IDX(ahd, scb)				\
ahd               164 dev/ic/aic79xx.h 	((SCB_GET_LUN(scb) << 4) | SCB_GET_TARGET(ahd, scb))
ahd              1004 dev/ic/aic79xx.h int		ahd_read_seeprom(struct ahd_softc *ahd, uint16_t *buf,
ahd              1007 dev/ic/aic79xx.h int		ahd_write_seeprom(struct ahd_softc *ahd, uint16_t *buf,
ahd              1009 dev/ic/aic79xx.h int		ahd_wait_seeprom(struct ahd_softc *ahd);
ahd              1012 dev/ic/aic79xx.h int		ahd_acquire_seeprom(struct ahd_softc *ahd);
ahd              1013 dev/ic/aic79xx.h void		ahd_release_seeprom(struct ahd_softc *ahd);
ahd              1323 dev/ic/aic79xx.h #define AHD_SET_SLEWRATE(ahd, new_slew)					\
ahd              1325 dev/ic/aic79xx.h     (ahd)->iocell_opts[AHD_PRECOMP_SLEW_INDEX] &= ~AHD_SLEWRATE_MASK;	\
ahd              1326 dev/ic/aic79xx.h     (ahd)->iocell_opts[AHD_PRECOMP_SLEW_INDEX] |=			\
ahd              1330 dev/ic/aic79xx.h #define AHD_SET_PRECOMP(ahd, new_pcomp)					\
ahd              1332 dev/ic/aic79xx.h     (ahd)->iocell_opts[AHD_PRECOMP_SLEW_INDEX] &= ~AHD_PRECOMP_MASK;	\
ahd              1333 dev/ic/aic79xx.h     (ahd)->iocell_opts[AHD_PRECOMP_SLEW_INDEX] |=			\
ahd              1337 dev/ic/aic79xx.h #define AHD_SET_AMPLITUDE(ahd, new_amp)					\
ahd              1339 dev/ic/aic79xx.h     (ahd)->iocell_opts[AHD_AMPLITUDE_INDEX] &= ~AHD_AMPLITUDE_MASK;	\
ahd              1340 dev/ic/aic79xx.h     (ahd)->iocell_opts[AHD_AMPLITUDE_INDEX] |=				\
ahd              1381 dev/ic/aic79xx.h void			ahd_reset_cmds_pending(struct ahd_softc *ahd);
ahd              1382 dev/ic/aic79xx.h u_int			ahd_find_busy_tcl(struct ahd_softc *ahd, u_int tcl);
ahd              1383 dev/ic/aic79xx.h void			ahd_busy_tcl(struct ahd_softc *ahd,
ahd              1385 dev/ic/aic79xx.h void			ahd_unbusy_tcl(struct ahd_softc *ahd, u_int tcl);
ahd              1395 dev/ic/aic79xx.h void		ahd_qinfifo_requeue_tail(struct ahd_softc *ahd,
ahd              1397 dev/ic/aic79xx.h int		ahd_match_scb(struct ahd_softc *ahd, struct scb *scb,
ahd              1404 dev/ic/aic79xx.h void			 ahd_controller_info(struct ahd_softc *ahd, char *buf,
ahd              1406 dev/ic/aic79xx.h int			 ahd_init(struct ahd_softc *ahd);
ahd              1407 dev/ic/aic79xx.h int			 ahd_default_config(struct ahd_softc *ahd);
ahd              1408 dev/ic/aic79xx.h int			 ahd_parse_vpddata(struct ahd_softc *ahd,
ahd              1410 dev/ic/aic79xx.h int			 ahd_parse_cfgdata(struct ahd_softc *ahd,
ahd              1412 dev/ic/aic79xx.h void			 ahd_intr_enable(struct ahd_softc *ahd, int enable);
ahd              1413 dev/ic/aic79xx.h void			 ahd_update_coalescing_values(struct ahd_softc *ahd,
ahd              1417 dev/ic/aic79xx.h void			 ahd_enable_coalescing(struct ahd_softc *ahd,
ahd              1419 dev/ic/aic79xx.h void			 ahd_pause_and_flushwork(struct ahd_softc *ahd);
ahd              1420 dev/ic/aic79xx.h int			 ahd_suspend(struct ahd_softc *ahd); 
ahd              1421 dev/ic/aic79xx.h int			 ahd_resume(struct ahd_softc *ahd);
ahd              1423 dev/ic/aic79xx.h struct ahd_softc	*ahd_find_softc(struct ahd_softc *ahd);
ahd              1426 dev/ic/aic79xx.h struct scb		*ahd_get_scb(struct ahd_softc *ahd, u_int col_idx);
ahd              1427 dev/ic/aic79xx.h void			 ahd_free_scb(struct ahd_softc *ahd, struct scb *scb);
ahd              1428 dev/ic/aic79xx.h void			 ahd_alloc_scbs(struct ahd_softc *ahd);
ahd              1429 dev/ic/aic79xx.h void			 ahd_free(struct ahd_softc *ahd);
ahd              1430 dev/ic/aic79xx.h int			 ahd_reset(struct ahd_softc *ahd, int reinit);
ahd              1432 dev/ic/aic79xx.h int			 ahd_write_flexport(struct ahd_softc *ahd,
ahd              1434 dev/ic/aic79xx.h int			 ahd_read_flexport(struct ahd_softc *ahd, u_int addr,
ahd              1436 dev/ic/aic79xx.h int			 ahd_wait_flexport(struct ahd_softc *ahd);
ahd              1439 dev/ic/aic79xx.h void			ahd_pci_intr(struct ahd_softc *ahd);
ahd              1440 dev/ic/aic79xx.h void			ahd_clear_intstat(struct ahd_softc *ahd);
ahd              1441 dev/ic/aic79xx.h void			ahd_flush_qoutfifo(struct ahd_softc *ahd);
ahd              1442 dev/ic/aic79xx.h void			ahd_run_qoutfifo(struct ahd_softc *ahd);
ahd              1444 dev/ic/aic79xx.h void			ahd_run_tqinfifo(struct ahd_softc *ahd, int paused);
ahd              1446 dev/ic/aic79xx.h void			ahd_handle_hwerrint(struct ahd_softc *ahd);
ahd              1447 dev/ic/aic79xx.h void			ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat);
ahd              1448 dev/ic/aic79xx.h void			ahd_handle_scsiint(struct ahd_softc *ahd,
ahd              1450 dev/ic/aic79xx.h void			ahd_clear_critical_section(struct ahd_softc *ahd);
ahd              1459 dev/ic/aic79xx.h void			ahd_done_with_status(struct ahd_softc *ahd,
ahd              1461 dev/ic/aic79xx.h int			ahd_search_qinfifo(struct ahd_softc *ahd, int target,
ahd              1465 dev/ic/aic79xx.h int			ahd_search_disc_list(struct ahd_softc *ahd, int target,
ahd              1469 dev/ic/aic79xx.h void			ahd_freeze_devq(struct ahd_softc *ahd, struct scb *scb);
ahd              1470 dev/ic/aic79xx.h int			ahd_reset_channel(struct ahd_softc *ahd, char channel,
ahd              1472 dev/ic/aic79xx.h int			ahd_abort_scbs(struct ahd_softc *ahd, int target,
ahd              1475 dev/ic/aic79xx.h void			ahd_restart(struct ahd_softc *ahd);
ahd              1476 dev/ic/aic79xx.h void			ahd_clear_fifo(struct ahd_softc *ahd, u_int fifo);
ahd              1477 dev/ic/aic79xx.h void			ahd_handle_scb_status(struct ahd_softc *ahd,
ahd              1479 dev/ic/aic79xx.h void			ahd_handle_scsi_status(struct ahd_softc *ahd,
ahd              1481 dev/ic/aic79xx.h void			ahd_calc_residual(struct ahd_softc *ahd,
ahd              1492 dev/ic/aic79xx.h void			ahd_find_syncrate(struct ahd_softc *ahd, u_int *period,
ahd              1494 dev/ic/aic79xx.h void			ahd_validate_offset(struct ahd_softc *ahd,
ahd              1498 dev/ic/aic79xx.h void			ahd_validate_width(struct ahd_softc *ahd,
ahd              1519 dev/ic/aic79xx.h void			ahd_set_width(struct ahd_softc *ahd,
ahd              1522 dev/ic/aic79xx.h void			ahd_set_syncrate(struct ahd_softc *ahd,
ahd              1533 dev/ic/aic79xx.h void			ahd_set_tags(struct ahd_softc *ahd,
ahd              1541 dev/ic/aic79xx.h void		ahd_handle_en_lun(struct ahd_softc *ahd,
ahd              1543 dev/ic/aic79xx.h cam_status	ahd_find_tmode_devs(struct ahd_softc *ahd,
ahd              1576 dev/ic/aic79xx.h void			ahd_print_devinfo(struct ahd_softc *ahd,
ahd              1580 dev/ic/aic79xx.h void			ahd_dump_card_state(struct ahd_softc *ahd);
ahd              1588 dev/ic/aic79xx.h void			ahd_dump_scbs(struct ahd_softc *ahd);
ahd                77 dev/ic/aic79xx_inline.h char *ahd_name(struct ahd_softc *ahd);
ahd                97 dev/ic/aic79xx_inline.h void	*ahd_sg_setup(struct ahd_softc *ahd, struct scb *scb,
ahd               100 dev/ic/aic79xx_inline.h void	 ahd_setup_scb_common(struct ahd_softc *ahd,
ahd               102 dev/ic/aic79xx_inline.h void	 ahd_setup_data_scb(struct ahd_softc *ahd,
ahd               104 dev/ic/aic79xx_inline.h void	 ahd_setup_noxfer_scb(struct ahd_softc *ahd,
ahd               135 dev/ic/aic79xx_inline.h u_int	ahd_get_scbptr(struct ahd_softc *ahd);
ahd               136 dev/ic/aic79xx_inline.h void	ahd_set_scbptr(struct ahd_softc *ahd, u_int scbptr);
ahd               137 dev/ic/aic79xx_inline.h u_int	ahd_get_hnscb_qoff(struct ahd_softc *ahd);
ahd               138 dev/ic/aic79xx_inline.h void	ahd_set_hnscb_qoff(struct ahd_softc *ahd, u_int value);
ahd               139 dev/ic/aic79xx_inline.h u_int	ahd_get_hescb_qoff(struct ahd_softc *ahd);
ahd               140 dev/ic/aic79xx_inline.h void	ahd_set_hescb_qoff(struct ahd_softc *ahd, u_int value);
ahd               141 dev/ic/aic79xx_inline.h u_int	ahd_get_snscb_qoff(struct ahd_softc *ahd);
ahd               142 dev/ic/aic79xx_inline.h void	ahd_set_snscb_qoff(struct ahd_softc *ahd, u_int value);
ahd               143 dev/ic/aic79xx_inline.h u_int	ahd_get_sescb_qoff(struct ahd_softc *ahd);
ahd               144 dev/ic/aic79xx_inline.h void	ahd_set_sescb_qoff(struct ahd_softc *ahd, u_int value);
ahd               145 dev/ic/aic79xx_inline.h u_int	ahd_get_sdscb_qoff(struct ahd_softc *ahd);
ahd               146 dev/ic/aic79xx_inline.h void	ahd_set_sdscb_qoff(struct ahd_softc *ahd, u_int value);
ahd               147 dev/ic/aic79xx_inline.h u_int	ahd_inb_scbram(struct ahd_softc *ahd, u_int offset);
ahd               148 dev/ic/aic79xx_inline.h u_int	ahd_inw_scbram(struct ahd_softc *ahd, u_int offset);
ahd               149 dev/ic/aic79xx_inline.h uint32_t ahd_inl_scbram(struct ahd_softc *ahd, u_int offset);
ahd               150 dev/ic/aic79xx_inline.h uint64_t ahd_inq_scbram(struct ahd_softc *ahd, u_int offset);
ahd               152 dev/ic/aic79xx_inline.h void	ahd_swap_with_next_hscb(struct ahd_softc *ahd, struct scb *scb);
ahd               153 dev/ic/aic79xx_inline.h void	ahd_queue_scb(struct ahd_softc *ahd, struct scb *scb);
ahd               154 dev/ic/aic79xx_inline.h uint8_t *ahd_get_sense_buf(struct ahd_softc *ahd, struct scb *scb);
ahd               155 dev/ic/aic79xx_inline.h uint32_t ahd_get_sense_bufaddr(struct ahd_softc *ahd, struct scb *scb);
ahd               158 dev/ic/aic79xx_inline.h void	ahd_sync_qoutfifo(struct ahd_softc *ahd, int op);
ahd               159 dev/ic/aic79xx_inline.h void	ahd_sync_tqinfifo(struct ahd_softc *ahd, int op);
ahd               160 dev/ic/aic79xx_inline.h u_int			ahd_check_cmdcmpltqueues(struct ahd_softc *ahd);
ahd               161 dev/ic/aic79xx_inline.h int			ahd_intr(struct ahd_softc *ahd);
ahd               163 dev/ic/aic79xx_inline.h #define AHD_ASSERT_MODES(ahd, source, dest) \
ahd               164 dev/ic/aic79xx_inline.h 	ahd_assert_modes(ahd, source, dest, __FILE__, __LINE__);
ahd               111 dev/ic/aic79xx_openbsd.c ahd_attach(struct ahd_softc *ahd)
ahd               117 dev/ic/aic79xx_openbsd.c 	ahd_controller_info(ahd, ahd_info, sizeof ahd_info);
ahd               119 dev/ic/aic79xx_openbsd.c 	ahd_lock(ahd, &s);
ahd               124 dev/ic/aic79xx_openbsd.c 	ahd->sc_channel.adapter_target = ahd->our_id;
ahd               125 dev/ic/aic79xx_openbsd.c 	if (ahd->features & AHD_WIDE)
ahd               126 dev/ic/aic79xx_openbsd.c 		ahd->sc_channel.adapter_buswidth = 16;
ahd               127 dev/ic/aic79xx_openbsd.c 	ahd->sc_channel.adapter_softc = ahd;
ahd               128 dev/ic/aic79xx_openbsd.c 	ahd->sc_channel.adapter = &ahd_switch;
ahd               129 dev/ic/aic79xx_openbsd.c 	ahd->sc_channel.openings = 16;
ahd               130 dev/ic/aic79xx_openbsd.c 	ahd->sc_channel.device = &ahd_dev;
ahd               133 dev/ic/aic79xx_openbsd.c 		ahd_controller_info(ahd, ahd_info, sizeof ahd_info);
ahd               134 dev/ic/aic79xx_openbsd.c 		printf("%s: %s\n", ahd->sc_dev.dv_xname, ahd_info);
ahd               137 dev/ic/aic79xx_openbsd.c 	ahd_intr_enable(ahd, TRUE);
ahd               139 dev/ic/aic79xx_openbsd.c 	if (ahd->flags & AHD_RESET_BUS_A)
ahd               140 dev/ic/aic79xx_openbsd.c 		ahd_reset_channel(ahd, 'A', TRUE);
ahd               143 dev/ic/aic79xx_openbsd.c 	saa.saa_sc_link = &ahd->sc_channel;
ahd               145 dev/ic/aic79xx_openbsd.c 	ahd->sc_child = config_found((void *)&ahd->sc_dev, &saa, scsiprint);
ahd               147 dev/ic/aic79xx_openbsd.c 	ahd_unlock(ahd, &s);
ahd               159 dev/ic/aic79xx_openbsd.c 	struct	ahd_softc *ahd;
ahd               163 dev/ic/aic79xx_openbsd.c 	ahd = (struct ahd_softc *)arg; 
ahd               164 dev/ic/aic79xx_openbsd.c 	return ahd_intr(ahd);
ahd               173 dev/ic/aic79xx_openbsd.c ahd_done(struct ahd_softc *ahd, struct scb *scb)
ahd               191 dev/ic/aic79xx_openbsd.c 		bus_dmamap_sync(ahd->parent_dmat, scb->dmamap, 0,
ahd               193 dev/ic/aic79xx_openbsd.c 		bus_dmamap_unload(ahd->parent_dmat, scb->dmamap);
ahd               264 dev/ic/aic79xx_openbsd.c 		memcpy(&xs->sense, ahd_get_sense_buf(ahd, scb),
ahd               279 dev/ic/aic79xx_openbsd.c 	ahd_lock(ahd, &s);
ahd               280 dev/ic/aic79xx_openbsd.c 	ahd_free_scb(ahd, scb);
ahd               281 dev/ic/aic79xx_openbsd.c 	ahd_unlock(ahd, &s);
ahd               306 dev/ic/aic79xx_openbsd.c 	struct	ahd_softc *ahd;
ahd               319 dev/ic/aic79xx_openbsd.c 	ahd = (struct ahd_softc *)xs->sc_link->adapter_softc;
ahd               325 dev/ic/aic79xx_openbsd.c 	our_id = SCSI_SCSI_ID(ahd, xs->sc_link);
ahd               327 dev/ic/aic79xx_openbsd.c 	if ((ahd->flags & AHD_INITIATORROLE) == 0) {
ahd               337 dev/ic/aic79xx_openbsd.c 	ahd_lock(ahd, &s);
ahd               338 dev/ic/aic79xx_openbsd.c 	tinfo = ahd_fetch_transinfo(ahd, 'A', our_id, target_id, &tstate);
ahd               348 dev/ic/aic79xx_openbsd.c 	if ((scb = ahd_get_scb(ahd, col_idx)) == NULL) {
ahd               349 dev/ic/aic79xx_openbsd.c 		ahd->flags |= AHD_RESOURCE_SHORTAGE;
ahd               350 dev/ic/aic79xx_openbsd.c 		ahd_unlock(ahd, &s);
ahd               353 dev/ic/aic79xx_openbsd.c 	ahd_unlock(ahd, &s);
ahd               366 dev/ic/aic79xx_openbsd.c 	hscb->scsiid = BUILD_SCSIID(ahd, xs->sc_link, target_id, our_id);
ahd               376 dev/ic/aic79xx_openbsd.c 		return (ahd_setup_data(ahd, xs, scb));
ahd               385 dev/ic/aic79xx_openbsd.c 	struct	ahd_softc *ahd;
ahd               395 dev/ic/aic79xx_openbsd.c 	ahd = (struct ahd_softc *)xs->sc_link->adapter_softc;
ahd               402 dev/ic/aic79xx_openbsd.c 		ahd_setup_data_scb(ahd, scb);
ahd               407 dev/ic/aic79xx_openbsd.c 			sg = ahd_sg_setup(ahd, scb, sg, dm_segs->ds_addr,
ahd               418 dev/ic/aic79xx_openbsd.c 		bus_dmamap_sync(ahd->parent_dmat, scb->dmamap, 0,
ahd               423 dev/ic/aic79xx_openbsd.c 	ahd_lock(ahd, &s);
ahd               431 dev/ic/aic79xx_openbsd.c 			bus_dmamap_unload(ahd->parent_dmat,
ahd               433 dev/ic/aic79xx_openbsd.c 		ahd_free_scb(ahd, scb);
ahd               434 dev/ic/aic79xx_openbsd.c 		ahd_unlock(ahd, &s);
ahd               438 dev/ic/aic79xx_openbsd.c 	tinfo = ahd_fetch_transinfo(ahd, SCSIID_CHANNEL(ahd, scb->hscb->scsiid),
ahd               440 dev/ic/aic79xx_openbsd.c 				    SCSIID_TARGET(ahd, scb->hscb->scsiid),
ahd               443 dev/ic/aic79xx_openbsd.c 	mask = SCB_GET_TARGET_MASK(ahd, scb);
ahd               464 dev/ic/aic79xx_openbsd.c 	LIST_INSERT_HEAD(&ahd->pending_scbs, scb, pending_links);
ahd               473 dev/ic/aic79xx_openbsd.c 		ahd->scb_data.scbindex[SCB_GET_TAG(scb)] = scb;
ahd               474 dev/ic/aic79xx_openbsd.c 		ahd_pause(ahd);
ahd               475 dev/ic/aic79xx_openbsd.c 		ahd_set_scbptr(ahd, SCB_GET_TAG(scb));
ahd               476 dev/ic/aic79xx_openbsd.c 		ahd_outb(ahd, RETURN_1, CONT_MSG_LOOP_TARG);
ahd               477 dev/ic/aic79xx_openbsd.c 		ahd_unpause(ahd);
ahd               479 dev/ic/aic79xx_openbsd.c 		ahd_queue_scb(ahd, scb);
ahd               486 dev/ic/aic79xx_openbsd.c 		if (ahd->inited_target[target] == 0) {
ahd               489 dev/ic/aic79xx_openbsd.c 			ahd_adapter_req_set_xfer_mode(ahd, scb);
ahd               490 dev/ic/aic79xx_openbsd.c 			ahd_compile_devinfo(&devinfo, ahd->our_id, target, lun,
ahd               492 dev/ic/aic79xx_openbsd.c 			ahd_scb_devinfo(ahd, &devinfo, scb);
ahd               493 dev/ic/aic79xx_openbsd.c 			ahd_update_neg_request(ahd, &devinfo, tstate, tinfo,
ahd               495 dev/ic/aic79xx_openbsd.c 			ahd->inited_target[target] = 1;
ahd               498 dev/ic/aic79xx_openbsd.c 		ahd_unlock(ahd, &s);
ahd               508 dev/ic/aic79xx_openbsd.c 		if (ahd_poll(ahd, xs->timeout)) {
ahd               516 dev/ic/aic79xx_openbsd.c 	ahd_unlock(ahd, &s);
ahd               521 dev/ic/aic79xx_openbsd.c ahd_poll(struct ahd_softc *ahd, int wait)
ahd               525 dev/ic/aic79xx_openbsd.c 		if (ahd_inb(ahd, INTSTAT) & INT_PEND)
ahd               530 dev/ic/aic79xx_openbsd.c 		printf("%s: board is not responding\n", ahd_name(ahd));
ahd               534 dev/ic/aic79xx_openbsd.c 	ahd_intr((void *)ahd);
ahd               539 dev/ic/aic79xx_openbsd.c ahd_setup_data(struct ahd_softc *ahd, struct scsi_xfer *xs,
ahd               551 dev/ic/aic79xx_openbsd.c 		ahd_lock(ahd, &s);
ahd               552 dev/ic/aic79xx_openbsd.c 		ahd_free_scb(ahd, scb);
ahd               553 dev/ic/aic79xx_openbsd.c 		ahd_unlock(ahd, &s);
ahd               566 dev/ic/aic79xx_openbsd.c 		error = bus_dmamap_load(ahd->parent_dmat,
ahd               577 dev/ic/aic79xx_openbsd.c 			    "= %d\n", ahd_name(ahd), error);
ahd               579 dev/ic/aic79xx_openbsd.c 			ahd_lock(ahd, &s);
ahd               580 dev/ic/aic79xx_openbsd.c 			ahd_free_scb(ahd, scb);
ahd               581 dev/ic/aic79xx_openbsd.c 			ahd_unlock(ahd, &s);
ahd               593 dev/ic/aic79xx_openbsd.c ahd_platform_set_tags(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
ahd               598 dev/ic/aic79xx_openbsd.c 	ahd_fetch_transinfo(ahd, devinfo->channel, devinfo->our_scsiid,
ahd               608 dev/ic/aic79xx_openbsd.c ahd_platform_alloc(struct ahd_softc *ahd, void *platform_arg)
ahd               611 dev/ic/aic79xx_openbsd.c 		ahd->platform_data = malloc(sizeof(struct ahd_platform_data),
ahd               613 dev/ic/aic79xx_openbsd.c 		if (ahd->platform_data == NULL)
ahd               615 dev/ic/aic79xx_openbsd.c 		bzero(ahd->platform_data, sizeof(struct ahd_platform_data));
ahd               622 dev/ic/aic79xx_openbsd.c ahd_platform_free(struct ahd_softc *ahd)
ahd               625 dev/ic/aic79xx_openbsd.c 		free(ahd->platform_data, M_DEVBUF);
ahd               640 dev/ic/aic79xx_openbsd.c 	struct ahd_softc *ahd = (struct ahd_softc*)self;
ahd               642 dev/ic/aic79xx_openbsd.c 	if (ahd->sc_child != NULL)
ahd               643 dev/ic/aic79xx_openbsd.c 		rv = config_detach((void *)ahd->sc_child, flags);
ahd               645 dev/ic/aic79xx_openbsd.c 	if (ahd->shutdown_hook != NULL)
ahd               646 dev/ic/aic79xx_openbsd.c 		shutdownhook_disestablish(ahd->shutdown_hook);
ahd               648 dev/ic/aic79xx_openbsd.c 	ahd_free(ahd);
ahd               654 dev/ic/aic79xx_openbsd.c ahd_adapter_req_set_xfer_mode(struct ahd_softc *ahd, struct scb *scb)
ahd               665 dev/ic/aic79xx_openbsd.c 	our_id = SCSI_SCSI_ID(ahd, scb->xs->sc_link);
ahd               670 dev/ic/aic79xx_openbsd.c 	tinfo = ahd_fetch_transinfo(ahd, 'A', our_id, target_id, &tstate);
ahd               674 dev/ic/aic79xx_openbsd.c 	tstate->discenable |= (ahd->user_discenable & devinfo.target_mask);
ahd               678 dev/ic/aic79xx_openbsd.c 	else if (ahd->user_tagenable & devinfo.target_mask)
ahd               686 dev/ic/aic79xx_openbsd.c 	ahd_validate_width(ahd, NULL, &width, ROLE_UNKNOWN);
ahd               689 dev/ic/aic79xx_openbsd.c 	ahd_set_width(ahd, &devinfo, width, AHD_TRANS_GOAL, FALSE);
ahd               709 dev/ic/aic79xx_openbsd.c 	ahd_find_syncrate(ahd, &period, &ppr_options, AHD_SYNCRATE_MAX);
ahd               710 dev/ic/aic79xx_openbsd.c 	ahd_validate_offset(ahd, NULL, period, &offset, width, ROLE_UNKNOWN);
ahd               722 dev/ic/aic79xx_openbsd.c 	ahd_set_syncrate(ahd, &devinfo, period, offset, ppr_options,
ahd               753 dev/ic/aic79xx_openbsd.c ahd_flush_device_writes(struct ahd_softc *ahd)
ahd               756 dev/ic/aic79xx_openbsd.c 	ahd_inb(ahd, INTSTAT);
ahd               760 dev/ic/aic79xx_openbsd.c aic_platform_scb_free(struct ahd_softc *ahd, struct scb *scb)
ahd               764 dev/ic/aic79xx_openbsd.c 	ahd_lock(ahd, &s);
ahd               766 dev/ic/aic79xx_openbsd.c 	if ((ahd->flags & AHD_RESOURCE_SHORTAGE) != 0) {
ahd               767 dev/ic/aic79xx_openbsd.c 		ahd->flags &= ~AHD_RESOURCE_SHORTAGE;
ahd               775 dev/ic/aic79xx_openbsd.c 	ahd_unlock(ahd, &s);
ahd               779 dev/ic/aic79xx_openbsd.c ahd_print_path(struct ahd_softc *ahd, struct scb *scb)
ahd               785 dev/ic/aic79xx_openbsd.c ahd_platform_dump_card_state(struct ahd_softc *ahd)
ahd               789 dev/ic/aic79xx_openbsd.c 		ahd->features, ahd->flags, ahd->chip, ahd->bugs);
ahd               793 dev/ic/aic79xx_openbsd.c ahd_platform_flushwork(struct ahd_softc *ahd)
ahd               100 dev/ic/aic79xx_openbsd.h #define	SCSI_IS_SCSIBUS_B(ahd, sc_link)	\
ahd               102 dev/ic/aic79xx_openbsd.h #define	SCSI_CHANNEL(ahd, sc_link)	\
ahd               104 dev/ic/aic79xx_openbsd.h #define	SCSI_SCSI_ID(ahd, sc_link)	\
ahd               105 dev/ic/aic79xx_openbsd.h 	(ahd->our_id)
ahd               106 dev/ic/aic79xx_openbsd.h #define BUILD_SCSIID(ahd, sc_link, target_id, our_id) \
ahd               167 dev/ic/aic79xx_openbsd.h #define ahd_inb(ahd, port)					\
ahd               168 dev/ic/aic79xx_openbsd.h 	bus_space_read_1((ahd)->tags[(port) >> 8],		\
ahd               169 dev/ic/aic79xx_openbsd.h 			 (ahd)->bshs[(port) >> 8], (port) & 0xFF)
ahd               171 dev/ic/aic79xx_openbsd.h #define ahd_outb(ahd, port, value)				\
ahd               172 dev/ic/aic79xx_openbsd.h 	bus_space_write_1((ahd)->tags[(port) >> 8],		\
ahd               173 dev/ic/aic79xx_openbsd.h 			  (ahd)->bshs[(port) >> 8], (port) & 0xFF, value)
ahd               175 dev/ic/aic79xx_openbsd.h #define ahd_inw_atomic(ahd, port)				\
ahd               176 dev/ic/aic79xx_openbsd.h 	aic_le16toh(bus_space_read_2((ahd)->tags[(port) >> 8],	\
ahd               177 dev/ic/aic79xx_openbsd.h 				     (ahd)->bshs[(port) >> 8], (port) & 0xFF))
ahd               179 dev/ic/aic79xx_openbsd.h #define ahd_outw_atomic(ahd, port, value)			\
ahd               180 dev/ic/aic79xx_openbsd.h 	bus_space_write_2((ahd)->tags[(port) >> 8],		\
ahd               181 dev/ic/aic79xx_openbsd.h 			  (ahd)->bshs[(port) >> 8],		\
ahd               184 dev/ic/aic79xx_openbsd.h #define ahd_outsb(ahd, port, valp, count)			\
ahd               185 dev/ic/aic79xx_openbsd.h 	bus_space_write_multi_1((ahd)->tags[(port) >> 8],	\
ahd               186 dev/ic/aic79xx_openbsd.h 				(ahd)->bshs[(port) >> 8],	\
ahd               189 dev/ic/aic79xx_openbsd.h #define ahd_insb(ahd, port, valp, count)			\
ahd               190 dev/ic/aic79xx_openbsd.h 	bus_space_read_multi_1((ahd)->tags[(port) >> 8],	\
ahd               191 dev/ic/aic79xx_openbsd.h 			       (ahd)->bshs[(port) >> 8],	\
ahd               198 dev/ic/aic79xx_openbsd.h #define ahd_lockinit(ahd)
ahd               199 dev/ic/aic79xx_openbsd.h #define ahd_lock(ahd, flags) *(flags) = splbio()
ahd               200 dev/ic/aic79xx_openbsd.h #define ahd_unlock(ahd, flags) splx(*(flags))
ahd               203 dev/ic/aic79xx_openbsd.h #define ahd_done_lockinit(ahd)
ahd               204 dev/ic/aic79xx_openbsd.h #define ahd_done_lock(ahd, flags)
ahd               205 dev/ic/aic79xx_openbsd.h #define ahd_done_unlock(ahd, flags)
ahd               229 dev/ic/aic79xx_openbsd.h #define aic_get_sense_bufsize(ahd, scb) (sizeof(struct scsi_sense_data))
ahd               233 dev/ic/aic79xx_openbsd.h #define aic_freeze_simq(ahd)
ahd               234 dev/ic/aic79xx_openbsd.h #define aic_release_simq(ahd)
ahd               236 dev/ic/aic79xx_openbsd.h #define ahd_platform_freeze_devq(ahd, scb)
ahd               237 dev/ic/aic79xx_openbsd.h #define ahd_platform_abort_scbs(ahd, target, channel, lun, tag, role, status)
ahd               263 dev/ic/aic79xx_openbsd.h void	ahd_platform_dump_card_state(struct ahd_softc *ahd);
ahd               278 dev/ic/aic79xx_openbsd.h #define	ahd_platform_init(ahd)
ahd               282 dev/ic/aic79xx_openbsd.h void	ahd_platform_flushwork(struct ahd_softc *ahd);
ahd               838 dev/microcode/aic7xxx/aic79xx_seq.h typedef int ahd_patch_func_t (struct ahd_softc *ahd);
ahd               842 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch23_func(struct ahd_softc *ahd)
ahd               844 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->bugs & AHD_PKT_BITBUCKET_BUG) != 0);
ahd               850 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch22_func(struct ahd_softc *ahd)
ahd               852 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->bugs & AHD_PKT_BITBUCKET_BUG) == 0);
ahd               858 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch21_func(struct ahd_softc *ahd)
ahd               860 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->flags & AHD_INITIATORROLE) != 0);
ahd               866 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch20_func(struct ahd_softc *ahd)
ahd               868 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->flags & AHD_TARGETROLE) != 0);
ahd               874 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch19_func(struct ahd_softc *ahd)
ahd               876 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->bugs & AHD_AUTOFLUSH_BUG) != 0);
ahd               882 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch18_func(struct ahd_softc *ahd)
ahd               884 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->features & AHD_NEW_DFCNTRL_OPTS) != 0);
ahd               890 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch17_func(struct ahd_softc *ahd)
ahd               892 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->flags & AHD_39BIT_ADDRESSING) != 0);
ahd               898 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch16_func(struct ahd_softc *ahd)
ahd               900 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->flags & AHD_64BIT_ADDRESSING) != 0);
ahd               906 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch15_func(struct ahd_softc *ahd)
ahd               908 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->features & AHD_NEW_DFCNTRL_OPTS) == 0);
ahd               914 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch14_func(struct ahd_softc *ahd)
ahd               916 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->bugs & AHD_REG_SLOW_SETTLE_BUG) != 0);
ahd               922 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch13_func(struct ahd_softc *ahd)
ahd               924 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->features & AHD_RTI) == 0);
ahd               930 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch12_func(struct ahd_softc *ahd)
ahd               932 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->bugs & AHD_EARLY_REQ_BUG) != 0);
ahd               938 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch11_func(struct ahd_softc *ahd)
ahd               940 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->bugs & AHD_BUSFREEREV_BUG) == 0);
ahd               946 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch10_func(struct ahd_softc *ahd)
ahd               948 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->flags & AHD_SEQUENCER_DEBUG) != 0);
ahd               954 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch9_func(struct ahd_softc *ahd)
ahd               956 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->features & AHD_FAST_CDB_DELIVERY) != 0);
ahd               962 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch8_func(struct ahd_softc *ahd)
ahd               964 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->bugs & AHD_LQO_ATNO_BUG) != 0);
ahd               970 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch7_func(struct ahd_softc *ahd)
ahd               972 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->bugs & AHD_BUSFREEREV_BUG) != 0);
ahd               978 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch6_func(struct ahd_softc *ahd)
ahd               980 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->bugs & AHD_NONPACKFIFO_BUG) != 0);
ahd               986 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch5_func(struct ahd_softc *ahd)
ahd               988 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->bugs & AHD_SENT_SCB_UPDATE_BUG) != 0);
ahd               994 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch4_func(struct ahd_softc *ahd)
ahd               996 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->bugs & AHD_PKT_LUN_BUG) != 0);
ahd              1002 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch3_func(struct ahd_softc *ahd)
ahd              1004 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->bugs & AHD_FAINT_LED_BUG) != 0);
ahd              1010 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch2_func(struct ahd_softc *ahd)
ahd              1012 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->bugs & AHD_SET_MODE_BUG) != 0);
ahd              1018 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch1_func(struct ahd_softc *ahd)
ahd              1020 dev/microcode/aic7xxx/aic79xx_seq.h 	return ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0);
ahd              1026 dev/microcode/aic7xxx/aic79xx_seq.h ahd_patch0_func(struct ahd_softc *ahd)
ahd               290 dev/pci/ahd_pci.c int	ahd_check_extport(struct ahd_softc *ahd);
ahd               291 dev/pci/ahd_pci.c void	ahd_configure_termination(struct ahd_softc *ahd,
ahd               293 dev/pci/ahd_pci.c void	ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat);
ahd               339 dev/pci/ahd_pci.c 	struct ahd_softc *ahd = (void *)self;
ahd               346 dev/pci/ahd_pci.c 	ahd->dev_softc = pa;
ahd               347 dev/pci/ahd_pci.c 	ahd->parent_dmat = pa->pa_dmat;
ahd               349 dev/pci/ahd_pci.c 	if (ahd_alloc(ahd, ahd->sc_dev.dv_xname) == NULL)
ahd               362 dev/pci/ahd_pci.c 		ahd->flags |= AHD_HOSTRAID_BOARD;
ahd               369 dev/pci/ahd_pci.c 		ahd->flags |= AHD_HP_BOARD;
ahd               371 dev/pci/ahd_pci.c 	error = entry->setup(ahd, pa);
ahd               379 dev/pci/ahd_pci.c 		ahd->chip |= AHD_PCI;
ahd               381 dev/pci/ahd_pci.c 		ahd->bugs &= ~AHD_PCIX_BUG_MASK;
ahd               383 dev/pci/ahd_pci.c 		ahd->chip |= AHD_PCIX;
ahd               385 dev/pci/ahd_pci.c 	ahd->bus_description = pci_bus_modes[PCI_BUS_MODES_INDEX(devconfig)];
ahd               390 dev/pci/ahd_pci.c 	    &ahd->pcix_off, NULL)) {
ahd               391 dev/pci/ahd_pci.c 		if (ahd->chip & AHD_PCIX)
ahd               393 dev/pci/ahd_pci.c 			    ahd_name(ahd));
ahd               394 dev/pci/ahd_pci.c 		ahd->chip &= ~AHD_PCIX;
ahd               395 dev/pci/ahd_pci.c 		ahd->chip |= AHD_PCI;
ahd               396 dev/pci/ahd_pci.c 		ahd->bugs &= ~AHD_PCIX_BUG_MASK;
ahd               402 dev/pci/ahd_pci.c 	if ((ahd->bugs & AHD_PCIX_MMAPIO_BUG) == 0) {
ahd               409 dev/pci/ahd_pci.c 			    memtype, 0, &ahd->tags[0], &ahd->bshs[0], NULL,
ahd               412 dev/pci/ahd_pci.c 				ahd->tags[1] = ahd->tags[0];
ahd               413 dev/pci/ahd_pci.c 				bus_space_subregion(ahd->tags[0], ahd->bshs[0],
ahd               415 dev/pci/ahd_pci.c 				    &ahd->bshs[1]);
ahd               416 dev/pci/ahd_pci.c 				if (ahd_pci_test_register_access(ahd) != 0)
ahd               423 dev/pci/ahd_pci.c 			ahd_name(ahd), memtype);
ahd               429 dev/pci/ahd_pci.c 		    "0x%lx, shs1 0x%lx\n", ahd_name(ahd), ahd->tags[0],
ahd               430 dev/pci/ahd_pci.c 		    ahd->tags[1], ahd->bshs[0], ahd->bshs[1]);
ahd               437 dev/pci/ahd_pci.c 		    PCI_MAPREG_TYPE_IO, 0, &ahd->tags[0], &ahd->bshs[0], NULL,
ahd               442 dev/pci/ahd_pci.c 		    PCI_MAPREG_TYPE_IO, 0, &ahd->tags[1], &ahd->bshs[1], NULL,
ahd               447 dev/pci/ahd_pci.c 		    "shs1 0x%lx\n", ahd_name(ahd), ahd->tags[0], ahd->tags[1],
ahd               448 dev/pci/ahd_pci.c 		    ahd->bshs[0], ahd->bshs[1]);
ahd               453 dev/pci/ahd_pci.c 		printf("%s: unable to map registers\n", ahd_name(ahd));
ahd               476 dev/pci/ahd_pci.c 		ahd->flags |= AHD_39BIT_ADDRESSING;
ahd               484 dev/pci/ahd_pci.c 	if ((ahd->flags & (AHD_39BIT_ADDRESSING|AHD_64BIT_ADDRESSING)) != 0) {
ahd               489 dev/pci/ahd_pci.c 			       ahd_name(ahd));
ahd               495 dev/pci/ahd_pci.c 	ahd_softc_init(ahd);
ahd               500 dev/pci/ahd_pci.c 	ahd->bus_intr = ahd_pci_intr;
ahd               502 dev/pci/ahd_pci.c 	error = ahd_reset(ahd, /*reinit*/FALSE);
ahd               504 dev/pci/ahd_pci.c 		ahd_free(ahd);
ahd               509 dev/pci/ahd_pci.c 		printf("%s: couldn't map interrupt\n", ahd_name(ahd));
ahd               510 dev/pci/ahd_pci.c 		ahd_free(ahd);
ahd               514 dev/pci/ahd_pci.c 	ahd->ih = pci_intr_establish(pa->pa_pc, ih, IPL_BIO,
ahd               515 dev/pci/ahd_pci.c 	ahd_platform_intr, ahd, ahd->sc_dev.dv_xname);
ahd               516 dev/pci/ahd_pci.c 	if (ahd->ih == NULL) {
ahd               517 dev/pci/ahd_pci.c 		printf("%s: couldn't establish interrupt", ahd_name(ahd));
ahd               521 dev/pci/ahd_pci.c 		ahd_free(ahd);
ahd               528 dev/pci/ahd_pci.c 	ahd->pci_cachesize = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_BHLC_REG);
ahd               529 dev/pci/ahd_pci.c 	ahd->pci_cachesize *= 4;
ahd               531 dev/pci/ahd_pci.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd               533 dev/pci/ahd_pci.c 	error = ahd_check_extport(ahd);
ahd               538 dev/pci/ahd_pci.c 	error = ahd_init(ahd);
ahd               546 dev/pci/ahd_pci.c 	ahd_softc_insert(ahd);
ahd               550 dev/pci/ahd_pci.c 	ahd_attach(ahd);
ahd               558 dev/pci/ahd_pci.c ahd_pci_test_register_access(struct ahd_softc *ahd)
ahd               560 dev/pci/ahd_pci.c 	const pci_chipset_tag_t pc = ahd->dev_softc->pa_pc;
ahd               561 dev/pci/ahd_pci.c 	const pcitag_t tag = ahd->dev_softc->pa_tag;
ahd               586 dev/pci/ahd_pci.c 	hcntrl = ahd_inb(ahd, HCNTRL);
ahd               599 dev/pci/ahd_pci.c 	ahd_outb(ahd, HCNTRL, hcntrl|PAUSE);
ahd               600 dev/pci/ahd_pci.c 	while (ahd_is_paused(ahd) == 0)
ahd               604 dev/pci/ahd_pci.c 	ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
ahd               605 dev/pci/ahd_pci.c 	targpcistat = ahd_inb(ahd, TARGPCISTAT);
ahd               606 dev/pci/ahd_pci.c 	ahd_outb(ahd, TARGPCISTAT, targpcistat);
ahd               609 dev/pci/ahd_pci.c 	ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
ahd               610 dev/pci/ahd_pci.c 	ahd_outb(ahd, CLRINT, CLRPCIINT);
ahd               612 dev/pci/ahd_pci.c 	ahd_outb(ahd, SEQCTL0, PERRORDIS);
ahd               613 dev/pci/ahd_pci.c 	ahd_outl(ahd, SRAM_BASE, 0x5aa555aa);
ahd               614 dev/pci/ahd_pci.c 	if (ahd_inl(ahd, SRAM_BASE) != 0x5aa555aa)
ahd               617 dev/pci/ahd_pci.c 	if ((ahd_inb(ahd, INTSTAT) & PCIINT) != 0) {
ahd               620 dev/pci/ahd_pci.c 		ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
ahd               621 dev/pci/ahd_pci.c 		targpcistat = ahd_inb(ahd, TARGPCISTAT);
ahd               629 dev/pci/ahd_pci.c 	if ((ahd_inb(ahd, INTSTAT) & PCIINT) != 0) {
ahd               631 dev/pci/ahd_pci.c 		ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
ahd               632 dev/pci/ahd_pci.c 		targpcistat = ahd_inb(ahd, TARGPCISTAT);
ahd               635 dev/pci/ahd_pci.c 		ahd_outb(ahd, TARGPCISTAT, targpcistat);
ahd               638 dev/pci/ahd_pci.c 		ahd_outb(ahd, CLRINT, CLRPCIINT);
ahd               640 dev/pci/ahd_pci.c 	ahd_outb(ahd, SEQCTL0, PERRORDIS|FAILDIS);
ahd               650 dev/pci/ahd_pci.c ahd_check_extport(struct ahd_softc *ahd)
ahd               658 dev/pci/ahd_pci.c 	sc = ahd->seep_config;
ahd               659 dev/pci/ahd_pci.c 	have_seeprom = ahd_acquire_seeprom(ahd);
ahd               668 dev/pci/ahd_pci.c 			       ahd_name(ahd));
ahd               672 dev/pci/ahd_pci.c 			    + (sizeof(vpd) * (ahd->channel - 'A'))) / 2;
ahd               674 dev/pci/ahd_pci.c 		error = ahd_read_seeprom(ahd, (uint16_t *)&vpd,
ahd               678 dev/pci/ahd_pci.c 			error = ahd_parse_vpddata(ahd, &vpd);
ahd               681 dev/pci/ahd_pci.c 			       ahd_name(ahd),
ahd               685 dev/pci/ahd_pci.c 			printf("%s: Reading SEEPROM...", ahd_name(ahd));
ahd               688 dev/pci/ahd_pci.c 		start_addr = (sizeof(*sc) / 2) * (ahd->channel - 'A');
ahd               690 dev/pci/ahd_pci.c 		error = ahd_read_seeprom(ahd, (uint16_t *)sc,
ahd               707 dev/pci/ahd_pci.c 		ahd_release_seeprom(ahd);
ahd               720 dev/pci/ahd_pci.c 		ahd_set_scbptr(ahd, 0xFF);
ahd               721 dev/pci/ahd_pci.c 		nvram_scb = ahd_inb_scbram(ahd, SCB_BASE + NVRAM_SCB_OFFSET);
ahd               723 dev/pci/ahd_pci.c 		 && ((ahd_inb_scbram(ahd, SCB_BASE + 0) == 'A'
ahd               724 dev/pci/ahd_pci.c 		   && ahd_inb_scbram(ahd, SCB_BASE + 1) == 'D'
ahd               725 dev/pci/ahd_pci.c 		   && ahd_inb_scbram(ahd, SCB_BASE + 2) == 'P'
ahd               726 dev/pci/ahd_pci.c 		   && ahd_inb_scbram(ahd, SCB_BASE + 3) == 'T')
ahd               727 dev/pci/ahd_pci.c 		  || (ahd_inb_scbram(ahd, SCB_BASE + 0) == 'B'
ahd               728 dev/pci/ahd_pci.c 		   && ahd_inb_scbram(ahd, SCB_BASE + 1) == 'I'
ahd               729 dev/pci/ahd_pci.c 		   && ahd_inb_scbram(ahd, SCB_BASE + 2) == 'O'
ahd               730 dev/pci/ahd_pci.c 		   && ahd_inb_scbram(ahd, SCB_BASE + 3) == 'S')
ahd               731 dev/pci/ahd_pci.c 		  || (ahd_inb_scbram(ahd, SCB_BASE + 0) == 'A'
ahd               732 dev/pci/ahd_pci.c 		   && ahd_inb_scbram(ahd, SCB_BASE + 1) == 'S'
ahd               733 dev/pci/ahd_pci.c 		   && ahd_inb_scbram(ahd, SCB_BASE + 2) == 'P'
ahd               734 dev/pci/ahd_pci.c 		   && ahd_inb_scbram(ahd, SCB_BASE + 3) == 'I'))) {
ahd               738 dev/pci/ahd_pci.c 			ahd_set_scbptr(ahd, nvram_scb);
ahd               741 dev/pci/ahd_pci.c 				*sc_data++ = ahd_inw_scbram(ahd, SCB_BASE+i);
ahd               744 dev/pci/ahd_pci.c 				ahd->flags |= AHD_SCB_CONFIG_USED;
ahd               754 dev/pci/ahd_pci.c 		printf("%s: Seeprom Contents:", ahd_name(ahd));
ahd               764 dev/pci/ahd_pci.c 			printf("%s: No SEEPROM available.\n", ahd_name(ahd));
ahd               765 dev/pci/ahd_pci.c 		ahd->flags |= AHD_USEDEFAULTS;
ahd               766 dev/pci/ahd_pci.c 		error = ahd_default_config(ahd);
ahd               768 dev/pci/ahd_pci.c 		free(ahd->seep_config, M_DEVBUF);
ahd               769 dev/pci/ahd_pci.c 		ahd->seep_config = NULL;
ahd               771 dev/pci/ahd_pci.c 		error = ahd_parse_cfgdata(ahd, sc);
ahd               777 dev/pci/ahd_pci.c 	ahd_configure_termination(ahd, adapter_control);
ahd               783 dev/pci/ahd_pci.c ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control)
ahd               785 dev/pci/ahd_pci.c 	const pci_chipset_tag_t pc = ahd->dev_softc->pa_pc;
ahd               786 dev/pci/ahd_pci.c 	const pcitag_t tag = ahd->dev_softc->pa_tag;
ahd               794 dev/pci/ahd_pci.c 	if ((ahd->flags & AHD_STPWLEVEL_A) != 0)
ahd               798 dev/pci/ahd_pci.c 		       ahd_name(ahd), (devconfig & STPWLEVEL) ? "on" : "off");
ahd               802 dev/pci/ahd_pci.c 	if ((ahd->flags & AHD_CURRENT_SENSING) != 0) {
ahd               803 dev/pci/ahd_pci.c 		(void)ahd_write_flexport(ahd, FLXADDR_ROMSTAT_CURSENSECTL, 0);
ahd               809 dev/pci/ahd_pci.c 	error = ahd_read_flexport(ahd, FLXADDR_TERMCTL, &termctl);
ahd               813 dev/pci/ahd_pci.c 			       ahd_name(ahd));
ahd               821 dev/pci/ahd_pci.c 		       "Using Defaults.\n", ahd_name(ahd));
ahd               828 dev/pci/ahd_pci.c 			       ahd_name(ahd));
ahd               836 dev/pci/ahd_pci.c 		       "Using Defaults.\n", ahd_name(ahd));
ahd               843 dev/pci/ahd_pci.c 	sxfrctl1 = ahd_inb(ahd, SXFRCTL1) & ~STPWEN;
ahd               844 dev/pci/ahd_pci.c 	ahd->flags &= ~AHD_TERM_ENB_A;
ahd               846 dev/pci/ahd_pci.c 		ahd->flags |= AHD_TERM_ENB_A;
ahd               850 dev/pci/ahd_pci.c 	ahd_outb(ahd, SXFRCTL1, sxfrctl1|STPWEN);
ahd               851 dev/pci/ahd_pci.c 	ahd_outb(ahd, SXFRCTL1, sxfrctl1);
ahd               853 dev/pci/ahd_pci.c 	error = ahd_write_flexport(ahd, FLXADDR_TERMCTL, termctl);
ahd               856 dev/pci/ahd_pci.c 		       ahd_name(ahd));
ahd               859 dev/pci/ahd_pci.c 		       ahd_name(ahd),
ahd               863 dev/pci/ahd_pci.c 		       ahd_name(ahd),
ahd               867 dev/pci/ahd_pci.c 		       ahd_name(ahd),
ahd               871 dev/pci/ahd_pci.c 		       ahd_name(ahd),
ahd               929 dev/pci/ahd_pci.c ahd_pci_intr(struct ahd_softc *ahd)
ahd               931 dev/pci/ahd_pci.c 	const pci_chipset_tag_t pc = ahd->dev_softc->pa_pc;
ahd               932 dev/pci/ahd_pci.c 	const pcitag_t tag = ahd->dev_softc->pa_tag;
ahd               940 dev/pci/ahd_pci.c 	intstat = ahd_inb(ahd, INTSTAT);
ahd               943 dev/pci/ahd_pci.c 		ahd_pci_split_intr(ahd, intstat);
ahd               948 dev/pci/ahd_pci.c 	printf("%s: PCI error Interrupt\n", ahd_name(ahd));
ahd               949 dev/pci/ahd_pci.c 	saved_modes = ahd_save_modes(ahd);
ahd               950 dev/pci/ahd_pci.c 	ahd_dump_card_state(ahd);
ahd               951 dev/pci/ahd_pci.c 	ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
ahd               956 dev/pci/ahd_pci.c 		pci_status[i] = ahd_inb(ahd, reg);
ahd               958 dev/pci/ahd_pci.c 		ahd_outb(ahd, reg, pci_status[i]);
ahd               975 dev/pci/ahd_pci.c 				printf(s, ahd_name(ahd), pci_status_source[i]);
ahd               982 dev/pci/ahd_pci.c 	ahd_restore_modes(ahd, saved_modes);
ahd               983 dev/pci/ahd_pci.c 	ahd_outb(ahd, CLRINT, CLRPCIINT);
ahd               984 dev/pci/ahd_pci.c 	ahd_unpause(ahd);
ahd               990 dev/pci/ahd_pci.c ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat)
ahd               992 dev/pci/ahd_pci.c 	const pci_chipset_tag_t pc = ahd->dev_softc->pa_pc;
ahd               993 dev/pci/ahd_pci.c 	const pcitag_t tag = ahd->dev_softc->pa_tag;
ahd              1006 dev/pci/ahd_pci.c 	pcix_status = pci_conf_read(pc, tag, ahd->pcix_off + 0x04);
ahd              1008 dev/pci/ahd_pci.c 	       ahd_name(ahd), pcix_status);
ahd              1010 dev/pci/ahd_pci.c 	saved_modes = ahd_save_modes(ahd);
ahd              1012 dev/pci/ahd_pci.c 		ahd_set_modes(ahd, i, i);
ahd              1014 dev/pci/ahd_pci.c 		split_status[i] = ahd_inb(ahd, DCHSPLTSTAT0);
ahd              1015 dev/pci/ahd_pci.c 		split_status1[i] = ahd_inb(ahd, DCHSPLTSTAT1);
ahd              1017 dev/pci/ahd_pci.c 		ahd_outb(ahd, DCHSPLTSTAT0, split_status[i]);
ahd              1018 dev/pci/ahd_pci.c 		ahd_outb(ahd, DCHSPLTSTAT1, split_status1[i]);
ahd              1021 dev/pci/ahd_pci.c 		sg_split_status[i] = ahd_inb(ahd, SGSPLTSTAT0);
ahd              1022 dev/pci/ahd_pci.c 		sg_split_status1[i] = ahd_inb(ahd, SGSPLTSTAT1);
ahd              1024 dev/pci/ahd_pci.c 		ahd_outb(ahd, SGSPLTSTAT0, sg_split_status[i]);
ahd              1025 dev/pci/ahd_pci.c 		ahd_outb(ahd, SGSPLTSTAT1, sg_split_status1[i]);
ahd              1037 dev/pci/ahd_pci.c 				printf(s, ahd_name(ahd),
ahd              1048 dev/pci/ahd_pci.c 				printf(s, ahd_name(ahd), "SG");
ahd              1055 dev/pci/ahd_pci.c 	pci_conf_write(pc, tag, ahd->pcix_off + 0x04, pcix_status);
ahd              1056 dev/pci/ahd_pci.c 	ahd_outb(ahd, CLRINT, CLRSPLTINT);
ahd              1057 dev/pci/ahd_pci.c 	ahd_restore_modes(ahd, saved_modes);
ahd              1061 dev/pci/ahd_pci.c ahd_aic7901_setup(struct ahd_softc *ahd, struct pci_attach_args *pa)
ahd              1064 dev/pci/ahd_pci.c 	ahd->chip = AHD_AIC7901;
ahd              1065 dev/pci/ahd_pci.c 	ahd->features = AHD_AIC7901_FE;
ahd              1066 dev/pci/ahd_pci.c 	return (ahd_aic790X_setup(ahd, pa));
ahd              1070 dev/pci/ahd_pci.c ahd_aic7901A_setup(struct ahd_softc *ahd, struct pci_attach_args *pa)
ahd              1073 dev/pci/ahd_pci.c 	ahd->chip = AHD_AIC7901A;
ahd              1074 dev/pci/ahd_pci.c 	ahd->features = AHD_AIC7901A_FE;
ahd              1075 dev/pci/ahd_pci.c 	return (ahd_aic790X_setup(ahd, pa));
ahd              1079 dev/pci/ahd_pci.c ahd_aic7902_setup(struct ahd_softc *ahd, struct pci_attach_args *pa)
ahd              1081 dev/pci/ahd_pci.c 	ahd->chip = AHD_AIC7902;
ahd              1082 dev/pci/ahd_pci.c 	ahd->features = AHD_AIC7902_FE;
ahd              1083 dev/pci/ahd_pci.c 	return (ahd_aic790X_setup(ahd, pa));
ahd              1087 dev/pci/ahd_pci.c ahd_aic790X_setup(struct ahd_softc *ahd, struct pci_attach_args *pa)
ahd              1093 dev/pci/ahd_pci.c 	printf("\n%s: aic7902 chip revision 0x%x\n", ahd_name(ahd), rev);
ahd              1097 dev/pci/ahd_pci.c 		       ahd_name(ahd), rev);
ahd              1102 dev/pci/ahd_pci.c 	ahd->channel = (pa->pa_function == 1) ? 'B' : 'A';
ahd              1107 dev/pci/ahd_pci.c 		ahd->bugs |= AHD_SENT_SCB_UPDATE_BUG|AHD_ABORT_LQI_BUG
ahd              1122 dev/pci/ahd_pci.c 		AHD_SET_PRECOMP(ahd, AHD_PRECOMP_CUTBACK_29);
ahd              1124 dev/pci/ahd_pci.c 		if ((ahd->flags & AHD_HP_BOARD) == 0)
ahd              1125 dev/pci/ahd_pci.c 			AHD_SET_SLEWRATE(ahd, AHD_SLEWRATE_DEF_REVA);
ahd              1129 dev/pci/ahd_pci.c 		ahd->features |= AHD_RTI|AHD_NEW_IOCELL_OPTS
ahd              1131 dev/pci/ahd_pci.c 		ahd->bugs |= AHD_LQOOVERRUN_BUG|AHD_EARLY_REQ_BUG
ahd              1137 dev/pci/ahd_pci.c 		if ((ahd->features & AHD_MULTI_FUNC) != 0)
ahd              1138 dev/pci/ahd_pci.c 			ahd->bugs |= AHD_INTCOLLISION_BUG|AHD_ABORT_LQI_BUG;
ahd              1143 dev/pci/ahd_pci.c 		AHD_SET_PRECOMP(ahd, AHD_PRECOMP_CUTBACK_29);
ahd              1144 dev/pci/ahd_pci.c 		AHD_SET_SLEWRATE(ahd, AHD_SLEWRATE_DEF_REVB);
ahd              1145 dev/pci/ahd_pci.c 		AHD_SET_AMPLITUDE(ahd, AHD_AMPLITUDE_DEF);