ahc               121 arch/i386/isa/ahc_isa.c void	aha2840_load_seeprom(struct ahc_softc *ahc);
ahc               336 arch/i386/isa/ahc_isa.c 	struct ahc_softc *ahc = (void *)self;
ahc               345 arch/i386/isa/ahc_isa.c 	ahc_set_name(ahc, ahc->sc_dev.dv_xname);
ahc               346 arch/i386/isa/ahc_isa.c 	ahc_set_unit(ahc, ahc->sc_dev.dv_unit);
ahc               349 arch/i386/isa/ahc_isa.c 	ahc->parent_dmat = ia->ia_dmat;
ahc               351 arch/i386/isa/ahc_isa.c 	ahc->chip = AHC_VL; /* We are a VL Bus Controller */  
ahc               369 arch/i386/isa/ahc_isa.c 	ahc->channel = 'A';
ahc               370 arch/i386/isa/ahc_isa.c 	ahc->chip = AHC_AIC7770;
ahc               371 arch/i386/isa/ahc_isa.c 	ahc->features = AHC_AIC7770_FE;
ahc               372 arch/i386/isa/ahc_isa.c 	ahc->bugs |= AHC_TMODE_WIDEODD_BUG;
ahc               373 arch/i386/isa/ahc_isa.c 	ahc->flags |= AHC_PAGESCBS;
ahc               376 arch/i386/isa/ahc_isa.c 	ahc->tag = iot;
ahc               377 arch/i386/isa/ahc_isa.c 	ahc->bsh = ioh;
ahc               384 arch/i386/isa/ahc_isa.c 	printf( "%s: Using %s Interrupts\n", ahc_name(ahc),
ahc               385 arch/i386/isa/ahc_isa.c 	    ahc->pause & IRQMS ?  "Level Sensitive" : "Edge Triggered");
ahc               388 arch/i386/isa/ahc_isa.c 	if (ahc_reset(ahc, /*reinit*/FALSE) != 0)
ahc               392 arch/i386/isa/ahc_isa.c 	intdef = ahc_inb(ahc, INTDEF);
ahc               394 arch/i386/isa/ahc_isa.c 		ahc->flags |= AHC_EDGE_INTERRUPT;
ahc               400 arch/i386/isa/ahc_isa.c 	aha2840_load_seeprom(ahc);
ahc               415 arch/i386/isa/ahc_isa.c 		sblkctl_orig = ahc_inb(ahc, SBLKCTL);
ahc               417 arch/i386/isa/ahc_isa.c 		ahc_outb(ahc, SBLKCTL, sblkctl);
ahc               418 arch/i386/isa/ahc_isa.c 		sblkctl = ahc_inb(ahc, SBLKCTL);
ahc               426 arch/i386/isa/ahc_isa.c 			ahc_outb(ahc, SBLKCTL, sblkctl);
ahc               429 arch/i386/isa/ahc_isa.c 			ahc->flags |= AHC_PAGESCBS;
ahc               434 arch/i386/isa/ahc_isa.c 		printf("%s: %s", ahc_name(ahc), id_string);
ahc               439 arch/i386/isa/ahc_isa.c 		u_char hostconf = ahc_inb(ahc, HOSTCONF);
ahc               440 arch/i386/isa/ahc_isa.c 		ahc_outb(ahc, BUSSPD, hostconf & DFTHRSH);
ahc               441 arch/i386/isa/ahc_isa.c 		ahc_outb(ahc, BUSTIME, (hostconf << 2) & BOFF);
ahc               447 arch/i386/isa/ahc_isa.c 	if(ahc_init(ahc)){
ahc               448 arch/i386/isa/ahc_isa.c 		ahc_free(ahc);
ahc               455 arch/i386/isa/ahc_isa.c 	ahc_softc_insert(ahc);
ahc               460 arch/i386/isa/ahc_isa.c 	ahc_outb(ahc, BCTL, ENABLE);
ahc               466 arch/i386/isa/ahc_isa.c 	ahc->ih = isa_intr_establish(ia->ia_ic, irq,
ahc               467 arch/i386/isa/ahc_isa.c 	    ahc->pause & IRQMS ? IST_LEVEL : IST_EDGE, IPL_BIO, ahc_platform_intr,
ahc               468 arch/i386/isa/ahc_isa.c 	    ahc, ahc->sc_dev.dv_xname);
ahc               469 arch/i386/isa/ahc_isa.c 	if (ahc->ih == NULL) {
ahc               471 arch/i386/isa/ahc_isa.c 		       ahc->sc_dev.dv_xname);
ahc               472 arch/i386/isa/ahc_isa.c 		ahc_free(ahc);
ahc               476 arch/i386/isa/ahc_isa.c 	ahc_intr_enable(ahc, TRUE);
ahc               479 arch/i386/isa/ahc_isa.c 	ahc_attach(ahc);
ahc               486 arch/i386/isa/ahc_isa.c aha2840_load_seeprom(struct ahc_softc *ahc)
ahc               494 arch/i386/isa/ahc_isa.c 	sd.sd_tag = ahc->tag;
ahc               495 arch/i386/isa/ahc_isa.c 	sd.sd_bsh = ahc->bsh;
ahc               509 arch/i386/isa/ahc_isa.c 		printf("%s: Reading SEEPROM...", ahc_name(ahc));
ahc               534 arch/i386/isa/ahc_isa.c 			printf("%s: No SEEPROM available\n", ahc_name(ahc));
ahc               535 arch/i386/isa/ahc_isa.c 		ahc->flags |= AHC_USEDEFAULTS;
ahc               542 arch/i386/isa/ahc_isa.c 		int max_targ = (ahc->features & AHC_WIDE) != 0 ? 16 : 8;
ahc               555 arch/i386/isa/ahc_isa.c 			ahc_outb(ahc, TARG_SCSIRATE + i, target_settings);
ahc               557 arch/i386/isa/ahc_isa.c 		ahc_outb(ahc, DISC_DSB, ~(discenable & 0xff));
ahc               558 arch/i386/isa/ahc_isa.c 		ahc_outb(ahc, DISC_DSB + 1, ~((discenable >> 8) & 0xff));
ahc               560 arch/i386/isa/ahc_isa.c 		ahc->our_id = sc.brtime_id & CFSCSIID;
ahc               562 arch/i386/isa/ahc_isa.c 		scsi_conf = (ahc->our_id & 0x7);
ahc               569 arch/i386/isa/ahc_isa.c 			ahc->flags |= AHC_EXTENDED_TRANS_A;
ahc               571 arch/i386/isa/ahc_isa.c 		ahc_outb(ahc, SCSICONF, scsi_conf);
ahc               574 arch/i386/isa/ahc_isa.c 			ahc->flags |= AHC_TERM_ENB_A;
ahc               144 dev/eisa/ahc_eisa.c 	struct ahc_softc *ahc = (void *)self;
ahc               157 dev/eisa/ahc_eisa.c 	ahc_set_name(ahc, ahc->sc_dev.dv_xname);
ahc               158 dev/eisa/ahc_eisa.c 	ahc_set_unit(ahc, ahc->sc_dev.dv_unit);
ahc               161 dev/eisa/ahc_eisa.c 	ahc->parent_dmat = ea->ea_dmat;
ahc               179 dev/eisa/ahc_eisa.c 	ahc->channel = 'A';
ahc               180 dev/eisa/ahc_eisa.c 	ahc->chip = AHC_AIC7770|AHC_EISA;
ahc               181 dev/eisa/ahc_eisa.c 	ahc->features = AHC_AIC7770_FE;
ahc               182 dev/eisa/ahc_eisa.c 	ahc->bugs |= AHC_TMODE_WIDEODD_BUG;
ahc               183 dev/eisa/ahc_eisa.c 	ahc->flags |= AHC_PAGESCBS;
ahc               185 dev/eisa/ahc_eisa.c 	if (ahc_reset(ahc, /*reinit*/FALSE) != 0)
ahc               189 dev/eisa/ahc_eisa.c 	intdef = ahc_inb(ahc, INTDEF);
ahc               191 dev/eisa/ahc_eisa.c 		ahc->flags |= AHC_EDGE_INTERRUPT;
ahc               195 dev/eisa/ahc_eisa.c 		       ahc->sc_dev.dv_xname, irq);
ahc               205 dev/eisa/ahc_eisa.c 		       ahc_name(ahc),
ahc               206 dev/eisa/ahc_eisa.c 		       ahc->pause & IRQMS ?
ahc               216 dev/eisa/ahc_eisa.c 	biosctrl = ahc_inb(ahc, HA_274_BIOSCTRL);
ahc               217 dev/eisa/ahc_eisa.c 	scsiconf = ahc_inb(ahc, SCSICONF);
ahc               218 dev/eisa/ahc_eisa.c 	scsiconf1 = ahc_inb(ahc, SCSICONF + 1);
ahc               222 dev/eisa/ahc_eisa.c 		ahc->flags |= AHC_PRIMARY_CHANNEL;
ahc               225 dev/eisa/ahc_eisa.c 		ahc->flags |= AHC_USEDEFAULTS;
ahc               226 dev/eisa/ahc_eisa.c 	} else if ((ahc->features & AHC_WIDE) != 0) {
ahc               227 dev/eisa/ahc_eisa.c 		ahc->our_id = scsiconf1 & HWSCSIID;
ahc               229 dev/eisa/ahc_eisa.c 			ahc->flags |= AHC_TERM_ENB_A;
ahc               231 dev/eisa/ahc_eisa.c 		ahc->our_id = scsiconf & HSCSIID;
ahc               232 dev/eisa/ahc_eisa.c 		ahc->our_id_b = scsiconf1 & HSCSIID;
ahc               234 dev/eisa/ahc_eisa.c 			ahc->flags |= AHC_TERM_ENB_A;
ahc               236 dev/eisa/ahc_eisa.c 			ahc->flags |= AHC_TERM_ENB_B;
ahc               243 dev/eisa/ahc_eisa.c 	ahc->flags |= AHC_EXTENDED_TRANS_A|AHC_EXTENDED_TRANS_B;
ahc               258 dev/eisa/ahc_eisa.c 		sblkctl_orig = ahc_inb(ahc, SBLKCTL);
ahc               260 dev/eisa/ahc_eisa.c 		ahc_outb(ahc, SBLKCTL, sblkctl);
ahc               261 dev/eisa/ahc_eisa.c 		sblkctl = ahc_inb(ahc, SBLKCTL);
ahc               268 dev/eisa/ahc_eisa.c 			ahc_outb(ahc, SBLKCTL, sblkctl);
ahc               271 dev/eisa/ahc_eisa.c 			ahc->flags |= AHC_PAGESCBS;
ahc               275 dev/eisa/ahc_eisa.c 		printf("%s: %s", ahc_name(ahc), id_string);
ahc               280 dev/eisa/ahc_eisa.c 		u_char hostconf = ahc_inb(ahc, HOSTCONF);
ahc               281 dev/eisa/ahc_eisa.c 		ahc_outb(ahc, BUSSPD, hostconf & DFTHRSH);
ahc               282 dev/eisa/ahc_eisa.c 		ahc_outb(ahc, BUSTIME, (hostconf << 2) & BOFF);
ahc               288 dev/eisa/ahc_eisa.c 	if (ahc_init(ahc)) {
ahc               289 dev/eisa/ahc_eisa.c 		ahc_free(ahc);
ahc               296 dev/eisa/ahc_eisa.c 	ahc_softc_insert(ahc);
ahc               301 dev/eisa/ahc_eisa.c 	ahc_outb(ahc, BCTL, ENABLE);
ahc               308 dev/eisa/ahc_eisa.c 	ahc->ih = eisa_intr_establish(ec, ih,
ahc               309 dev/eisa/ahc_eisa.c 	    ahc->pause & IRQMS ? IST_LEVEL : IST_EDGE, IPL_BIO,
ahc               310 dev/eisa/ahc_eisa.c 	    ahc_platform_intr, ahc, ahc->sc_dev.dv_xname);
ahc               311 dev/eisa/ahc_eisa.c 	if (ahc->ih == NULL) {
ahc               313 dev/eisa/ahc_eisa.c 		       ahc->sc_dev.dv_xname);
ahc               317 dev/eisa/ahc_eisa.c 		ahc_free(ahc);
ahc               321 dev/eisa/ahc_eisa.c 		printf("%s: interrupting at %s\n", ahc->sc_dev.dv_xname,
ahc               324 dev/eisa/ahc_eisa.c 	ahc_intr_enable(ahc, TRUE);
ahc               327 dev/eisa/ahc_eisa.c 	ahc_attach(ahc);
ahc               119 dev/ic/aic79xx_openbsd.h #define ahd_dmamap_sync(ahc, dma_tag, dmamap, offset, len, op)		\
ahc               152 dev/ic/aic7xxx.c static void		ahc_force_renegotiation(struct ahc_softc *ahc,
ahc               155 dev/ic/aic7xxx.c 			ahc_alloc_tstate(struct ahc_softc *ahc,
ahc               158 dev/ic/aic7xxx.c static void		ahc_free_tstate(struct ahc_softc *ahc,
ahc               162 dev/ic/aic7xxx.c 			ahc_devlimited_syncrate(struct ahc_softc *ahc,
ahc               167 dev/ic/aic7xxx.c static void		ahc_update_pending_scbs(struct ahc_softc *ahc);
ahc               168 dev/ic/aic7xxx.c static void		ahc_fetch_devinfo(struct ahc_softc *ahc,
ahc               170 dev/ic/aic7xxx.c static void		ahc_assert_atn(struct ahc_softc *ahc);
ahc               171 dev/ic/aic7xxx.c static void		ahc_setup_initiator_msgout(struct ahc_softc *ahc,
ahc               174 dev/ic/aic7xxx.c static void		ahc_build_transfer_msg(struct ahc_softc *ahc,
ahc               176 dev/ic/aic7xxx.c static void		ahc_construct_sdtr(struct ahc_softc *ahc,
ahc               179 dev/ic/aic7xxx.c static void		ahc_construct_wdtr(struct ahc_softc *ahc,
ahc               182 dev/ic/aic7xxx.c static void		ahc_construct_ppr(struct ahc_softc *ahc,
ahc               186 dev/ic/aic7xxx.c static void		ahc_clear_msg_state(struct ahc_softc *ahc);
ahc               187 dev/ic/aic7xxx.c static void		ahc_handle_proto_violation(struct ahc_softc *ahc);
ahc               188 dev/ic/aic7xxx.c static void		ahc_handle_message_phase(struct ahc_softc *ahc);
ahc               194 dev/ic/aic7xxx.c static int		ahc_sent_msg(struct ahc_softc *ahc, ahc_msgtype type,
ahc               196 dev/ic/aic7xxx.c static int		ahc_parse_msg(struct ahc_softc *ahc,
ahc               198 dev/ic/aic7xxx.c static int		ahc_handle_msg_reject(struct ahc_softc *ahc,
ahc               200 dev/ic/aic7xxx.c static void		ahc_handle_ign_wide_residue(struct ahc_softc *ahc,
ahc               202 dev/ic/aic7xxx.c static void		ahc_reinitialize_dataptrs(struct ahc_softc *ahc);
ahc               203 dev/ic/aic7xxx.c static void		ahc_handle_devreset(struct ahc_softc *ahc,
ahc               208 dev/ic/aic7xxx.c static void		ahc_setup_target_msgin(struct ahc_softc *ahc,
ahc               214 dev/ic/aic7xxx.c static void			ahc_build_free_scb_list(struct ahc_softc *ahc);
ahc               215 dev/ic/aic7xxx.c static int			ahc_init_scbdata(struct ahc_softc *ahc);
ahc               216 dev/ic/aic7xxx.c static void			ahc_fini_scbdata(struct ahc_softc *ahc);
ahc               217 dev/ic/aic7xxx.c static void		ahc_qinfifo_requeue(struct ahc_softc *ahc,
ahc               220 dev/ic/aic7xxx.c static int		ahc_qinfifo_count(struct ahc_softc *ahc);
ahc               221 dev/ic/aic7xxx.c static u_int		ahc_rem_scb_from_disc_list(struct ahc_softc *ahc,
ahc               223 dev/ic/aic7xxx.c static void		ahc_add_curscb_to_free_list(struct ahc_softc *ahc);
ahc               224 dev/ic/aic7xxx.c static u_int		ahc_rem_wscb(struct ahc_softc *ahc,
ahc               226 dev/ic/aic7xxx.c static void		ahc_reset_current_bus(struct ahc_softc *ahc);
ahc               228 dev/ic/aic7xxx.c static void		ahc_dumpseq(struct ahc_softc *ahc);
ahc               230 dev/ic/aic7xxx.c static int		ahc_loadseq(struct ahc_softc *ahc);
ahc               231 dev/ic/aic7xxx.c static int		ahc_check_patch(struct ahc_softc *ahc,
ahc               234 dev/ic/aic7xxx.c static void		ahc_download_instr(struct ahc_softc *ahc,
ahc               237 dev/ic/aic7xxx.c static void		ahc_queue_lstate_event(struct ahc_softc *ahc,
ahc               242 dev/ic/aic7xxx.c static void		ahc_update_scsiid(struct ahc_softc *ahc,
ahc               244 dev/ic/aic7xxx.c static int		ahc_handle_target_cmd(struct ahc_softc *ahc,
ahc               270 dev/ic/aic7xxx.c ahc_restart(struct ahc_softc *ahc)
ahc               273 dev/ic/aic7xxx.c 	ahc_pause(ahc);
ahc               276 dev/ic/aic7xxx.c 	ahc_clear_msg_state(ahc);
ahc               278 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCSISIGO, 0);		/* De-assert BSY */
ahc               279 dev/ic/aic7xxx.c 	ahc_outb(ahc, MSG_OUT, MSG_NOOP);	/* No message to send */
ahc               280 dev/ic/aic7xxx.c 	ahc_outb(ahc, SXFRCTL1, ahc_inb(ahc, SXFRCTL1) & ~BITBUCKET);
ahc               281 dev/ic/aic7xxx.c 	ahc_outb(ahc, LASTPHASE, P_BUSFREE);
ahc               282 dev/ic/aic7xxx.c 	ahc_outb(ahc, SAVED_SCSIID, 0xFF);
ahc               283 dev/ic/aic7xxx.c 	ahc_outb(ahc, SAVED_LUN, 0xFF);
ahc               292 dev/ic/aic7xxx.c 	ahc_outb(ahc, TQINPOS, ahc->tqinfifonext);
ahc               295 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCSISEQ,
ahc               296 dev/ic/aic7xxx.c 		 ahc_inb(ahc, SCSISEQ_TEMPLATE) & (ENSELI|ENRSELI|ENAUTOATNP));
ahc               297 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_CMD_CHAN) != 0) {
ahc               299 dev/ic/aic7xxx.c 		ahc_outb(ahc, CCSCBCNT, 0);
ahc               300 dev/ic/aic7xxx.c 		ahc_outb(ahc, CCSGCTL, 0);
ahc               301 dev/ic/aic7xxx.c 		ahc_outb(ahc, CCSCBCTL, 0);
ahc               308 dev/ic/aic7xxx.c 	if ((ahc_inb(ahc, SEQ_FLAGS2) & SCB_DMA) != 0) {
ahc               309 dev/ic/aic7xxx.c 		ahc_add_curscb_to_free_list(ahc);
ahc               310 dev/ic/aic7xxx.c 		ahc_outb(ahc, SEQ_FLAGS2,
ahc               311 dev/ic/aic7xxx.c 			 ahc_inb(ahc, SEQ_FLAGS2) & ~SCB_DMA);
ahc               319 dev/ic/aic7xxx.c 	ahc_outb(ahc, CLRINT, CLRSEQINT);
ahc               321 dev/ic/aic7xxx.c 	ahc_outb(ahc, MWI_RESIDUAL, 0);
ahc               322 dev/ic/aic7xxx.c 	ahc_outb(ahc, SEQCTL, ahc->seqctl);
ahc               323 dev/ic/aic7xxx.c 	ahc_outb(ahc, SEQADDR0, 0);
ahc               324 dev/ic/aic7xxx.c 	ahc_outb(ahc, SEQADDR1, 0);
ahc               326 dev/ic/aic7xxx.c 	ahc_unpause(ahc);
ahc               331 dev/ic/aic7xxx.c ahc_run_qoutfifo(struct ahc_softc *ahc)
ahc               336 dev/ic/aic7xxx.c 	ahc_sync_qoutfifo(ahc, BUS_DMASYNC_POSTREAD);
ahc               337 dev/ic/aic7xxx.c 	while (ahc->qoutfifo[ahc->qoutfifonext] != SCB_LIST_NULL) {
ahc               339 dev/ic/aic7xxx.c 		scb_index = ahc->qoutfifo[ahc->qoutfifonext];
ahc               341 dev/ic/aic7xxx.c 		if ((ahc->qoutfifonext & 0x1f) == 0x1f) {
ahc               351 dev/ic/aic7xxx.c 			modnext = ahc->qoutfifonext & ~0x1f;
ahc               352 dev/ic/aic7xxx.c 			nextp = (uint32_t *)(&ahc->qoutfifo[modnext]);
ahc               361 dev/ic/aic7xxx.c 			ahc_dmamap_sync(ahc, ahc->parent_dmat /*shared_data_dmat*/,
ahc               362 dev/ic/aic7xxx.c 					ahc->shared_data_dmamap,
ahc               367 dev/ic/aic7xxx.c 		if ((ahc->qoutfifonext & 0x03) == 0x03) {
ahc               377 dev/ic/aic7xxx.c 			modnext = ahc->qoutfifonext & ~0x3;
ahc               378 dev/ic/aic7xxx.c 			*((uint32_t *)(&ahc->qoutfifo[modnext])) = 0xFFFFFFFFUL;
ahc               379 dev/ic/aic7xxx.c 			ahc_dmamap_sync(ahc, ahc->parent_dmat /*shared_data_dmat*/,
ahc               380 dev/ic/aic7xxx.c 					ahc->shared_data_dmamap,
ahc               385 dev/ic/aic7xxx.c 		ahc->qoutfifonext++;
ahc               387 dev/ic/aic7xxx.c 		scb = ahc_lookup_scb(ahc, scb_index);
ahc               391 dev/ic/aic7xxx.c 			       ahc_name(ahc), scb_index,
ahc               392 dev/ic/aic7xxx.c 			       (ahc->qoutfifonext - 1) & 0xFF);
ahc               400 dev/ic/aic7xxx.c 		ahc_update_residual(ahc, scb);
ahc               401 dev/ic/aic7xxx.c 		ahc_done(ahc, scb);
ahc               406 dev/ic/aic7xxx.c ahc_run_untagged_queues(struct ahc_softc *ahc)
ahc               411 dev/ic/aic7xxx.c 		ahc_run_untagged_queue(ahc, &ahc->untagged_queues[i]);
ahc               415 dev/ic/aic7xxx.c ahc_run_untagged_queue(struct ahc_softc *ahc, struct scb_tailq *queue)
ahc               419 dev/ic/aic7xxx.c 	if (ahc->untagged_queue_lock != 0)
ahc               425 dev/ic/aic7xxx.c 		ahc_queue_scb(ahc, scb);
ahc               431 dev/ic/aic7xxx.c ahc_handle_brkadrint(struct ahc_softc *ahc)
ahc               441 dev/ic/aic7xxx.c 	error = ahc_inb(ahc, ERROR);
ahc               445 dev/ic/aic7xxx.c 	       ahc_name(ahc), ahc_hard_errors[i].errmesg,
ahc               446 dev/ic/aic7xxx.c 	       ahc_inb(ahc, SEQADDR0) |
ahc               447 dev/ic/aic7xxx.c 	       (ahc_inb(ahc, SEQADDR1) << 8));
ahc               449 dev/ic/aic7xxx.c 	ahc_dump_card_state(ahc);
ahc               453 dev/ic/aic7xxx.c 	ahc_abort_scbs(ahc, CAM_TARGET_WILDCARD, ALL_CHANNELS,
ahc               458 dev/ic/aic7xxx.c 	ahc_shutdown(ahc);
ahc               462 dev/ic/aic7xxx.c ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
ahc               467 dev/ic/aic7xxx.c 	ahc_fetch_devinfo(ahc, &devinfo);
ahc               475 dev/ic/aic7xxx.c 	ahc_outb(ahc, CLRINT, CLRSEQINT);
ahc               487 dev/ic/aic7xxx.c 		ahc_outb(ahc, RETURN_1, 0);
ahc               498 dev/ic/aic7xxx.c 		scb_index = ahc_inb(ahc, SCB_TAG);
ahc               499 dev/ic/aic7xxx.c 		scb = ahc_lookup_scb(ahc, scb_index);
ahc               501 dev/ic/aic7xxx.c 			ahc_print_devinfo(ahc, &devinfo);
ahc               505 dev/ic/aic7xxx.c 			ahc_dump_card_state(ahc);
ahc               525 dev/ic/aic7xxx.c 		ahc_freeze_devq(ahc, scb);
ahc               531 dev/ic/aic7xxx.c 			       ahc_name(ahc));
ahc               543 dev/ic/aic7xxx.c 				ahc_print_path(ahc, scb);
ahc               552 dev/ic/aic7xxx.c 			targ_info = ahc_fetch_transinfo(ahc,
ahc               563 dev/ic/aic7xxx.c 			ahc_update_residual(ahc, scb);
ahc               566 dev/ic/aic7xxx.c 				ahc_print_path(ahc, scb);
ahc               570 dev/ic/aic7xxx.c 			sg->addr = ahc_get_sense_bufaddr(ahc, scb);
ahc               571 dev/ic/aic7xxx.c 			sg->len = ahc_get_sense_bufsize(ahc, scb);
ahc               607 dev/ic/aic7xxx.c 				ahc_update_neg_request(ahc, &devinfo,
ahc               622 dev/ic/aic7xxx.c 			bus_dmamap_sync(ahc->parent_dmat,
ahc               623 dev/ic/aic7xxx.c 			    ahc->scb_data->sense_dmamap,
ahc               624 dev/ic/aic7xxx.c 			    (scb - ahc->scb_data->scbarray) *
ahc               628 dev/ic/aic7xxx.c 			bus_dmamap_sync(ahc->parent_dmat,
ahc               632 dev/ic/aic7xxx.c 			bus_dmamap_sync(ahc->parent_dmat,
ahc               633 dev/ic/aic7xxx.c 			    ahc->scb_data->hscb_dmamap,
ahc               634 dev/ic/aic7xxx.c 			    0, ahc->scb_data->hscb_dmamap->dm_mapsize,
ahc               639 dev/ic/aic7xxx.c 			ahc_qinfifo_requeue_tail(ahc, scb);
ahc               640 dev/ic/aic7xxx.c 			ahc_outb(ahc, RETURN_1, SEND_SENSE);
ahc               656 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCSISEQ,
ahc               657 dev/ic/aic7xxx.c 			 ahc_inb(ahc, SCSISEQ) & (ENSELI|ENRSELI|ENAUTOATNP));
ahc               661 dev/ic/aic7xxx.c 		       ahc_name(ahc), devinfo.channel, devinfo.target);
ahc               664 dev/ic/aic7xxx.c 		       ahc_inb(ahc, SAVED_SCSIID), ahc_inb(ahc, SAVED_LUN),
ahc               665 dev/ic/aic7xxx.c 		       ahc_inb(ahc, ARG_1), ahc_inb(ahc, ACCUM));
ahc               668 dev/ic/aic7xxx.c 		       ahc_inb(ahc, SEQ_FLAGS), ahc_inb(ahc, SCBPTR),
ahc               669 dev/ic/aic7xxx.c 		       ahc_index_busy_tcl(ahc,
ahc               670 dev/ic/aic7xxx.c 			    BUILD_TCL(ahc_inb(ahc, SAVED_SCSIID),
ahc               671 dev/ic/aic7xxx.c 				      ahc_inb(ahc, SAVED_LUN))),
ahc               672 dev/ic/aic7xxx.c 		       ahc_inb(ahc, SINDEX));
ahc               675 dev/ic/aic7xxx.c 		       ahc_inb(ahc, SCSIID), ahc_inb(ahc, SCB_SCSIID),
ahc               676 dev/ic/aic7xxx.c 		       ahc_inb(ahc, SCB_LUN), ahc_inb(ahc, SCB_TAG),
ahc               677 dev/ic/aic7xxx.c 		       ahc_inb(ahc, SCB_CONTROL));
ahc               679 dev/ic/aic7xxx.c 		       ahc_inb(ahc, SCSIBUSL), ahc_inb(ahc, SCSISIGI));
ahc               680 dev/ic/aic7xxx.c 		printf("SXFRCTL0 == 0x%x\n", ahc_inb(ahc, SXFRCTL0));
ahc               681 dev/ic/aic7xxx.c 		printf("SEQCTL == 0x%x\n", ahc_inb(ahc, SEQCTL));
ahc               682 dev/ic/aic7xxx.c 		ahc_dump_card_state(ahc);
ahc               683 dev/ic/aic7xxx.c 		ahc->msgout_buf[0] = MSG_BUS_DEV_RESET;
ahc               684 dev/ic/aic7xxx.c 		ahc->msgout_len = 1;
ahc               685 dev/ic/aic7xxx.c 		ahc->msgout_index = 0;
ahc               686 dev/ic/aic7xxx.c 		ahc->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
ahc               687 dev/ic/aic7xxx.c 		ahc_outb(ahc, MSG_OUT, HOST_MSG);
ahc               688 dev/ic/aic7xxx.c 		ahc_assert_atn(ahc);
ahc               693 dev/ic/aic7xxx.c 		u_int rejbyte = ahc_inb(ahc, ACCUM);
ahc               696 dev/ic/aic7xxx.c 		       ahc_name(ahc), devinfo.channel, devinfo.target, rejbyte);
ahc               701 dev/ic/aic7xxx.c 		ahc_handle_proto_violation(ahc);
ahc               705 dev/ic/aic7xxx.c 		ahc_handle_ign_wide_residue(ahc, &devinfo);
ahc               708 dev/ic/aic7xxx.c 		ahc_reinitialize_dataptrs(ahc);
ahc               714 dev/ic/aic7xxx.c 		lastphase = ahc_inb(ahc, LASTPHASE);
ahc               717 dev/ic/aic7xxx.c 		       ahc_name(ahc), devinfo.channel, devinfo.target,
ahc               718 dev/ic/aic7xxx.c 		       lastphase, ahc_inb(ahc, SCSISIGI));
ahc               725 dev/ic/aic7xxx.c 		lastphase = ahc_inb(ahc, LASTPHASE);
ahc               728 dev/ic/aic7xxx.c 		       ahc_name(ahc), devinfo.channel, devinfo.target,
ahc               729 dev/ic/aic7xxx.c 		       lastphase, ahc_inb(ahc, SCSISIGI));
ahc               730 dev/ic/aic7xxx.c 		ahc_restart(ahc);
ahc               746 dev/ic/aic7xxx.c 		if (ahc->msg_type == MSG_TYPE_NONE) {
ahc               751 dev/ic/aic7xxx.c 			bus_phase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK;
ahc               761 dev/ic/aic7xxx.c 				ahc_clear_intstat(ahc);
ahc               762 dev/ic/aic7xxx.c 				ahc_restart(ahc);
ahc               766 dev/ic/aic7xxx.c 			scb_index = ahc_inb(ahc, SCB_TAG);
ahc               767 dev/ic/aic7xxx.c 			scb = ahc_lookup_scb(ahc, scb_index);
ahc               774 dev/ic/aic7xxx.c 					ahc_setup_initiator_msgout(ahc,
ahc               778 dev/ic/aic7xxx.c 					ahc->msg_type =
ahc               780 dev/ic/aic7xxx.c 					ahc->msgin_index = 0;
ahc               786 dev/ic/aic7xxx.c 					ahc->msg_type =
ahc               788 dev/ic/aic7xxx.c 					ahc->msgin_index = 0;
ahc               791 dev/ic/aic7xxx.c 					ahc_setup_target_msgin(ahc,
ahc               798 dev/ic/aic7xxx.c 		ahc_handle_message_phase(ahc);
ahc               815 dev/ic/aic7xxx.c 		 && (ahc_inb(ahc, SSTAT1) & SCSIPERR) != 0) {
ahc               817 dev/ic/aic7xxx.c 			if ((ahc->features & AHC_DT) == 0) {
ahc               826 dev/ic/aic7xxx.c 				curphase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK;
ahc               827 dev/ic/aic7xxx.c 				ahc_outb(ahc, LASTPHASE, curphase);
ahc               828 dev/ic/aic7xxx.c 				ahc_outb(ahc, SCSISIGO, curphase);
ahc               830 dev/ic/aic7xxx.c 			if ((ahc_inb(ahc, SCSISIGI) & (CDI|MSGI)) == 0) {
ahc               839 dev/ic/aic7xxx.c 				ahc_outb(ahc, SXFRCTL1,
ahc               840 dev/ic/aic7xxx.c 					 ahc_inb(ahc, SXFRCTL1) | BITBUCKET);
ahc               843 dev/ic/aic7xxx.c 					if ((ahc_inb(ahc, SCSISIGI)
ahc               848 dev/ic/aic7xxx.c 				ahc_outb(ahc, SXFRCTL1,
ahc               849 dev/ic/aic7xxx.c 					 ahc_inb(ahc, SXFRCTL1) & ~BITBUCKET);
ahc               854 dev/ic/aic7xxx.c 					ahc_print_devinfo(ahc, &devinfo);
ahc               857 dev/ic/aic7xxx.c 					scb_index = ahc_inb(ahc, SCB_TAG);
ahc               858 dev/ic/aic7xxx.c 					scb = ahc_lookup_scb(ahc, scb_index);
ahc               862 dev/ic/aic7xxx.c 					ahc_reset_channel(ahc, devinfo.channel, 
ahc               866 dev/ic/aic7xxx.c 				ahc_inb(ahc, SCSIDATL);
ahc               881 dev/ic/aic7xxx.c 		u_int scbindex = ahc_inb(ahc, SCB_TAG);
ahc               882 dev/ic/aic7xxx.c 		u_int lastphase = ahc_inb(ahc, LASTPHASE);
ahc               885 dev/ic/aic7xxx.c 		scb = ahc_lookup_scb(ahc, scbindex);
ahc               890 dev/ic/aic7xxx.c 		ahc_print_path(ahc, scb);
ahc               896 dev/ic/aic7xxx.c 		ahc_print_path(ahc, scb);
ahc               898 dev/ic/aic7xxx.c 		       ahc_inb(ahc, SEQ_FLAGS) & DPHASE ? "Have" : "Haven't",
ahc               917 dev/ic/aic7xxx.c 		ahc_freeze_devq(ahc, scb);
ahc               926 dev/ic/aic7xxx.c 		if ((ahc->features & AHC_ULTRA2) != 0) {
ahc               931 dev/ic/aic7xxx.c 			ahc_outb(ahc, SXFRCTL0,
ahc               932 dev/ic/aic7xxx.c 				 ahc_inb(ahc, SXFRCTL0) | CLRSTCNT|CLRCHN);
ahc               933 dev/ic/aic7xxx.c 			ahc_outb(ahc, SXFRCTL0,
ahc               934 dev/ic/aic7xxx.c 				 ahc_inb(ahc, SXFRCTL0) | CLRSTCNT|CLRCHN);
ahc               936 dev/ic/aic7xxx.c 		if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) {
ahc               940 dev/ic/aic7xxx.c 			dscommand1 = ahc_inb(ahc, DSCOMMAND1);
ahc               941 dev/ic/aic7xxx.c 			ahc_outb(ahc, DSCOMMAND1, dscommand1 | HADDLDSEL0);
ahc               942 dev/ic/aic7xxx.c 			ahc_outb(ahc, HADDR, 0);
ahc               943 dev/ic/aic7xxx.c 			ahc_outb(ahc, DSCOMMAND1, dscommand1);
ahc               952 dev/ic/aic7xxx.c 		       ahc_name(ahc), devinfo.channel, devinfo.target,
ahc               954 dev/ic/aic7xxx.c 		scbindex = ahc_inb(ahc, SCB_TAG);
ahc               955 dev/ic/aic7xxx.c 		scb = ahc_lookup_scb(ahc, scbindex);
ahc               961 dev/ic/aic7xxx.c 			ahc_search_qinfifo(ahc, SCB_GET_TARGET(ahc, scb),
ahc               962 dev/ic/aic7xxx.c 					   SCB_GET_CHANNEL(ahc, scb),
ahc               970 dev/ic/aic7xxx.c 		printf("%s: No free or disconnected SCBs\n", ahc_name(ahc));
ahc               971 dev/ic/aic7xxx.c 		ahc_dump_card_state(ahc);
ahc               979 dev/ic/aic7xxx.c 		scbptr = ahc_inb(ahc, SCBPTR);
ahc               981 dev/ic/aic7xxx.c 		       scbptr, ahc_inb(ahc, ARG_1),
ahc               982 dev/ic/aic7xxx.c 		       ahc->scb_data->hscbs[scbptr].tag);
ahc               983 dev/ic/aic7xxx.c 		ahc_dump_card_state(ahc);
ahc               990 dev/ic/aic7xxx.c 		printf("%s: BTT calculation out of range\n", ahc_name(ahc));
ahc               993 dev/ic/aic7xxx.c 		       ahc_inb(ahc, SAVED_SCSIID), ahc_inb(ahc, SAVED_LUN),
ahc               994 dev/ic/aic7xxx.c 		       ahc_inb(ahc, ARG_1), ahc_inb(ahc, ACCUM));
ahc               997 dev/ic/aic7xxx.c 		       ahc_inb(ahc, SEQ_FLAGS), ahc_inb(ahc, SCBPTR),
ahc               998 dev/ic/aic7xxx.c 		       ahc_index_busy_tcl(ahc,
ahc               999 dev/ic/aic7xxx.c 			    BUILD_TCL(ahc_inb(ahc, SAVED_SCSIID),
ahc              1000 dev/ic/aic7xxx.c 				      ahc_inb(ahc, SAVED_LUN))),
ahc              1001 dev/ic/aic7xxx.c 		       ahc_inb(ahc, SINDEX),
ahc              1002 dev/ic/aic7xxx.c 		       ahc_inb(ahc, ACCUM));
ahc              1005 dev/ic/aic7xxx.c 		       ahc_inb(ahc, SCSIID), ahc_inb(ahc, SCB_SCSIID),
ahc              1006 dev/ic/aic7xxx.c 		       ahc_inb(ahc, SCB_LUN), ahc_inb(ahc, SCB_TAG),
ahc              1007 dev/ic/aic7xxx.c 		       ahc_inb(ahc, SCB_CONTROL));
ahc              1009 dev/ic/aic7xxx.c 		       ahc_inb(ahc, SCSIBUSL), ahc_inb(ahc, SCSISIGI));
ahc              1011 dev/ic/aic7xxx.c 		ahc_dump_card_state(ahc);
ahc              1018 dev/ic/aic7xxx.c 		       intstat, ahc_inb(ahc, SCSISIGI));
ahc              1027 dev/ic/aic7xxx.c 	ahc_unpause(ahc);
ahc              1031 dev/ic/aic7xxx.c ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat)
ahc              1040 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_TWIN) != 0
ahc              1041 dev/ic/aic7xxx.c 	    && ((ahc_inb(ahc, SBLKCTL) & SELBUSB) != 0))
ahc              1047 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_ULTRA2) != 0)
ahc              1048 dev/ic/aic7xxx.c 		status0 = ahc_inb(ahc, SSTAT0) & IOERR;
ahc              1051 dev/ic/aic7xxx.c 	status = ahc_inb(ahc, SSTAT1) & (SELTO|SCSIRSTI|BUSFREE|SCSIPERR);
ahc              1053 dev/ic/aic7xxx.c 		if ((ahc->features & AHC_TWIN) != 0) {
ahc              1055 dev/ic/aic7xxx.c 		 	ahc_outb(ahc, SBLKCTL, ahc_inb(ahc, SBLKCTL) ^ SELBUSB);
ahc              1056 dev/ic/aic7xxx.c 			status = ahc_inb(ahc, SSTAT1)
ahc              1061 dev/ic/aic7xxx.c 			printf("%s: Spurious SCSI interrupt\n", ahc_name(ahc));
ahc              1062 dev/ic/aic7xxx.c 			ahc_outb(ahc, CLRINT, CLRSCSIINT);
ahc              1063 dev/ic/aic7xxx.c 			ahc_unpause(ahc);
ahc              1069 dev/ic/aic7xxx.c 	ahc_clear_critical_section(ahc);
ahc              1071 dev/ic/aic7xxx.c 	scb_index = ahc_inb(ahc, SCB_TAG);
ahc              1072 dev/ic/aic7xxx.c 	scb = ahc_lookup_scb(ahc, scb_index);
ahc              1074 dev/ic/aic7xxx.c 	 && (ahc_inb(ahc, SEQ_FLAGS) & NOT_IDENTIFIED) != 0)
ahc              1077 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_ULTRA2) != 0
ahc              1081 dev/ic/aic7xxx.c 		now_lvd = ahc_inb(ahc, SBLKCTL) & ENAB40;
ahc              1083 dev/ic/aic7xxx.c 		       ahc_name(ahc), now_lvd ? "LVD" : "SE");
ahc              1084 dev/ic/aic7xxx.c 		ahc_outb(ahc, CLRSINT0, CLRIOERR);
ahc              1095 dev/ic/aic7xxx.c 		ahc_reset_channel(ahc, intr_channel,
ahc              1099 dev/ic/aic7xxx.c 			ahc_name(ahc), intr_channel);
ahc              1101 dev/ic/aic7xxx.c 		 	ahc_outb(ahc, SBLKCTL, ahc_inb(ahc, SBLKCTL) ^ SELBUSB);
ahc              1102 dev/ic/aic7xxx.c 		ahc_reset_channel(ahc, intr_channel, /*Initiate Reset*/FALSE);
ahc              1124 dev/ic/aic7xxx.c 		lastphase = ahc_inb(ahc, LASTPHASE);
ahc              1125 dev/ic/aic7xxx.c 		curphase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK;
ahc              1126 dev/ic/aic7xxx.c 		sstat2 = ahc_inb(ahc, SSTAT2);
ahc              1127 dev/ic/aic7xxx.c 		ahc_outb(ahc, CLRSINT1, CLRSCSIPERR);
ahc              1139 dev/ic/aic7xxx.c 		if ((ahc_inb(ahc, SSTAT1) & SCSIPERR) != 0
ahc              1155 dev/ic/aic7xxx.c 				ahc_print_path(ahc, scb);
ahc              1158 dev/ic/aic7xxx.c 			printf("%s:%c:%d: ", ahc_name(ahc), intr_channel,
ahc              1159 dev/ic/aic7xxx.c 			       SCSIID_TARGET(ahc, ahc_inb(ahc, SAVED_SCSIID)));
ahc              1160 dev/ic/aic7xxx.c 		scsirate = ahc_inb(ahc, SCSIRATE);
ahc              1165 dev/ic/aic7xxx.c 			       ahc_inw(ahc, SEQADDR0),
ahc              1167 dev/ic/aic7xxx.c 			if ((ahc->features & AHC_DT) != 0) {
ahc              1183 dev/ic/aic7xxx.c 		if ((ahc->features & AHC_DT) != 0
ahc              1201 dev/ic/aic7xxx.c 			if (ahc->msg_type != MSG_TYPE_NONE)
ahc              1202 dev/ic/aic7xxx.c 				ahc->send_msg_perror = TRUE;
ahc              1204 dev/ic/aic7xxx.c 				ahc_outb(ahc, MSG_OUT, mesg_out);
ahc              1211 dev/ic/aic7xxx.c 		ahc_fetch_devinfo(ahc, &devinfo);
ahc              1212 dev/ic/aic7xxx.c 		ahc_force_renegotiation(ahc, &devinfo);
ahc              1214 dev/ic/aic7xxx.c 		ahc_outb(ahc, CLRINT, CLRSCSIINT);
ahc              1215 dev/ic/aic7xxx.c 		ahc_unpause(ahc);
ahc              1220 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCSISEQ, 0);
ahc              1223 dev/ic/aic7xxx.c 		ahc_clear_msg_state(ahc);
ahc              1226 dev/ic/aic7xxx.c 		ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) & ~ENBUSFREE);
ahc              1227 dev/ic/aic7xxx.c 		ahc_outb(ahc, CLRSINT1, CLRSELTIMEO|CLRBUSFREE|CLRSCSIPERR);
ahc              1237 dev/ic/aic7xxx.c 		ahc_outb(ahc, CLRSINT0, CLRSELINGO);
ahc              1239 dev/ic/aic7xxx.c 		scbptr = ahc_inb(ahc, WAITING_SCBH);
ahc              1240 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, scbptr);
ahc              1241 dev/ic/aic7xxx.c 		scb_index = ahc_inb(ahc, SCB_TAG);
ahc              1243 dev/ic/aic7xxx.c 		scb = ahc_lookup_scb(ahc, scb_index);
ahc              1247 dev/ic/aic7xxx.c 			       ahc_name(ahc), scbptr, scb_index);
ahc              1248 dev/ic/aic7xxx.c 			ahc_dump_card_state(ahc);
ahc              1253 dev/ic/aic7xxx.c 				ahc_print_path(ahc, scb);
ahc              1258 dev/ic/aic7xxx.c 			ahc_scb_devinfo(ahc, &devinfo, scb);
ahc              1260 dev/ic/aic7xxx.c 			ahc_freeze_devq(ahc, scb);
ahc              1268 dev/ic/aic7xxx.c 			ahc_handle_devreset(ahc, &devinfo,
ahc              1273 dev/ic/aic7xxx.c 		ahc_outb(ahc, CLRINT, CLRSCSIINT);
ahc              1274 dev/ic/aic7xxx.c 		ahc_restart(ahc);
ahc              1276 dev/ic/aic7xxx.c 		&& (ahc_inb(ahc, SIMODE1) & ENBUSFREE) != 0) {
ahc              1292 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCSISEQ,
ahc              1293 dev/ic/aic7xxx.c 			 ahc_inb(ahc, SCSISEQ) & (ENSELI|ENRSELI|ENAUTOATNP));
ahc              1301 dev/ic/aic7xxx.c 		ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) & ~ENBUSFREE);
ahc              1302 dev/ic/aic7xxx.c 		ahc_outb(ahc, CLRSINT1, CLRBUSFREE|CLRSCSIPERR);
ahc              1310 dev/ic/aic7xxx.c 		lastphase = ahc_inb(ahc, LASTPHASE);
ahc              1311 dev/ic/aic7xxx.c 		saved_scsiid = ahc_inb(ahc, SAVED_SCSIID);
ahc              1312 dev/ic/aic7xxx.c 		saved_lun = ahc_inb(ahc, SAVED_LUN);
ahc              1313 dev/ic/aic7xxx.c 		target = SCSIID_TARGET(ahc, saved_scsiid);
ahc              1315 dev/ic/aic7xxx.c 		channel = SCSIID_CHANNEL(ahc, saved_scsiid);
ahc              1324 dev/ic/aic7xxx.c 			if (ahc_sent_msg(ahc, AHCMSG_1B, MSG_ABORT_TAG, TRUE)
ahc              1325 dev/ic/aic7xxx.c 			    || ahc_sent_msg(ahc, AHCMSG_1B, MSG_ABORT, TRUE)) {
ahc              1326 dev/ic/aic7xxx.c 				if (ahc->msgout_buf[ahc->msgout_index - 1]
ahc              1329 dev/ic/aic7xxx.c 				ahc_print_path(ahc, scb);
ahc              1333 dev/ic/aic7xxx.c 				ahc_abort_scbs(ahc, target, channel,
ahc              1338 dev/ic/aic7xxx.c 			} else if (ahc_sent_msg(ahc, AHCMSG_1B,
ahc              1348 dev/ic/aic7xxx.c 				 && ahc_match_scb(ahc, scb, target, channel,
ahc              1361 dev/ic/aic7xxx.c 				ahc_handle_devreset(ahc, &devinfo,
ahc              1366 dev/ic/aic7xxx.c 			} else if (ahc_sent_msg(ahc, AHCMSG_EXT,
ahc              1375 dev/ic/aic7xxx.c 				tinfo = ahc_fetch_transinfo(ahc,
ahc              1383 dev/ic/aic7xxx.c 				ahc_qinfifo_requeue_tail(ahc, scb);
ahc              1385 dev/ic/aic7xxx.c 			} else if (ahc_sent_msg(ahc, AHCMSG_EXT,
ahc              1391 dev/ic/aic7xxx.c 				ahc_set_width(ahc, &devinfo,
ahc              1395 dev/ic/aic7xxx.c 				ahc_qinfifo_requeue_tail(ahc, scb);
ahc              1397 dev/ic/aic7xxx.c 			} else if (ahc_sent_msg(ahc, AHCMSG_EXT,
ahc              1403 dev/ic/aic7xxx.c 				ahc_set_syncrate(ahc, &devinfo,
ahc              1409 dev/ic/aic7xxx.c 				ahc_qinfifo_requeue_tail(ahc, scb);
ahc              1423 dev/ic/aic7xxx.c 				ahc_print_path(ahc, scb);
ahc              1424 dev/ic/aic7xxx.c 				ahc_abort_scbs(ahc, target, channel,
ahc              1433 dev/ic/aic7xxx.c 				printf("%s: ", ahc_name(ahc));
ahc              1446 dev/ic/aic7xxx.c 				ahc_force_renegotiation(ahc, &devinfo);
ahc              1451 dev/ic/aic7xxx.c 			       ahc_inb(ahc, SEQADDR0)
ahc              1452 dev/ic/aic7xxx.c 				| (ahc_inb(ahc, SEQADDR1) << 8));
ahc              1454 dev/ic/aic7xxx.c 		ahc_outb(ahc, CLRINT, CLRSCSIINT);
ahc              1455 dev/ic/aic7xxx.c 		ahc_restart(ahc);
ahc              1458 dev/ic/aic7xxx.c 		       ahc_name(ahc), status);
ahc              1459 dev/ic/aic7xxx.c 		ahc_outb(ahc, CLRINT, CLRSCSIINT);
ahc              1468 dev/ic/aic7xxx.c ahc_force_renegotiation(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
ahc              1473 dev/ic/aic7xxx.c 	targ_info = ahc_fetch_transinfo(ahc,
ahc              1478 dev/ic/aic7xxx.c 	ahc_update_neg_request(ahc, devinfo, tstate,
ahc              1484 dev/ic/aic7xxx.c ahc_clear_critical_section(struct ahc_softc *ahc)
ahc              1491 dev/ic/aic7xxx.c 	if (ahc->num_critical_sections == 0)
ahc              1503 dev/ic/aic7xxx.c 		seqaddr = ahc_inb(ahc, SEQADDR0)
ahc              1504 dev/ic/aic7xxx.c 			| (ahc_inb(ahc, SEQADDR1) << 8);
ahc              1511 dev/ic/aic7xxx.c 		cs = ahc->critical_sections;
ahc              1512 dev/ic/aic7xxx.c 		for (i = 0; i < ahc->num_critical_sections; i++, cs++) {
ahc              1518 dev/ic/aic7xxx.c 		if (i == ahc->num_critical_sections)
ahc              1523 dev/ic/aic7xxx.c 			       ahc_name(ahc));
ahc              1524 dev/ic/aic7xxx.c 			ahc_dump_card_state(ahc);
ahc              1537 dev/ic/aic7xxx.c 			simode0 = ahc_inb(ahc, SIMODE0);
ahc              1538 dev/ic/aic7xxx.c 			ahc_outb(ahc, SIMODE0, 0);
ahc              1539 dev/ic/aic7xxx.c 			simode1 = ahc_inb(ahc, SIMODE1);
ahc              1540 dev/ic/aic7xxx.c 			if ((ahc->features & AHC_DT) != 0)
ahc              1549 dev/ic/aic7xxx.c 				ahc_outb(ahc, SIMODE1, simode1 & ENBUSFREE);
ahc              1551 dev/ic/aic7xxx.c 				ahc_outb(ahc, SIMODE1, 0);
ahc              1552 dev/ic/aic7xxx.c 			ahc_outb(ahc, CLRINT, CLRSCSIINT);
ahc              1553 dev/ic/aic7xxx.c 			ahc_outb(ahc, SEQCTL, ahc->seqctl | STEP);
ahc              1556 dev/ic/aic7xxx.c 		if ((ahc->features & AHC_DT) != 0) {
ahc              1557 dev/ic/aic7xxx.c 			ahc_outb(ahc, CLRSINT1, CLRBUSFREE);
ahc              1558 dev/ic/aic7xxx.c 			ahc_outb(ahc, CLRINT, CLRSCSIINT);
ahc              1560 dev/ic/aic7xxx.c 		ahc_outb(ahc, HCNTRL, ahc->unpause);
ahc              1561 dev/ic/aic7xxx.c 		while (!ahc_is_paused(ahc))
ahc              1565 dev/ic/aic7xxx.c 		ahc_outb(ahc, SIMODE0, simode0);
ahc              1566 dev/ic/aic7xxx.c 		ahc_outb(ahc, SIMODE1, simode1);
ahc              1567 dev/ic/aic7xxx.c 		ahc_outb(ahc, SEQCTL, ahc->seqctl);
ahc              1575 dev/ic/aic7xxx.c ahc_clear_intstat(struct ahc_softc *ahc)
ahc              1578 dev/ic/aic7xxx.c 	ahc_outb(ahc, CLRSINT1, CLRSELTIMEO|CLRATNO|CLRSCSIRSTI
ahc              1581 dev/ic/aic7xxx.c 	ahc_flush_device_writes(ahc);
ahc              1582 dev/ic/aic7xxx.c 	ahc_outb(ahc, CLRSINT0, CLRSELDO|CLRSELDI|CLRSELINGO);
ahc              1583 dev/ic/aic7xxx.c  	ahc_flush_device_writes(ahc);
ahc              1584 dev/ic/aic7xxx.c 	ahc_outb(ahc, CLRINT, CLRSCSIINT);
ahc              1585 dev/ic/aic7xxx.c 	ahc_flush_device_writes(ahc);
ahc              1632 dev/ic/aic7xxx.c ahc_alloc_tstate(struct ahc_softc *ahc, u_int scsi_id, char channel)
ahc              1638 dev/ic/aic7xxx.c 	master_tstate = ahc->enabled_targets[ahc->our_id];
ahc              1641 dev/ic/aic7xxx.c 		master_tstate = ahc->enabled_targets[ahc->our_id_b + 8];
ahc              1643 dev/ic/aic7xxx.c 	if (ahc->enabled_targets[scsi_id] != NULL
ahc              1644 dev/ic/aic7xxx.c 	    && ahc->enabled_targets[scsi_id] != master_tstate)
ahc              1646 dev/ic/aic7xxx.c 		      ahc_name(ahc));
ahc              1670 dev/ic/aic7xxx.c 	ahc->enabled_targets[scsi_id] = tstate;
ahc              1680 dev/ic/aic7xxx.c ahc_free_tstate(struct ahc_softc *ahc, u_int scsi_id, char channel, int force)
ahc              1688 dev/ic/aic7xxx.c 	if (((channel == 'B' && scsi_id == ahc->our_id_b)
ahc              1689 dev/ic/aic7xxx.c 	  || (channel == 'A' && scsi_id == ahc->our_id))
ahc              1695 dev/ic/aic7xxx.c 	tstate = ahc->enabled_targets[scsi_id];
ahc              1698 dev/ic/aic7xxx.c 	ahc->enabled_targets[scsi_id] = NULL;
ahc              1709 dev/ic/aic7xxx.c ahc_devlimited_syncrate(struct ahc_softc *ahc,
ahc              1716 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_ULTRA2) != 0) {
ahc              1717 dev/ic/aic7xxx.c 		if ((ahc_inb(ahc, SBLKCTL) & ENAB40) != 0
ahc              1718 dev/ic/aic7xxx.c 		 && (ahc_inb(ahc, SSTAT2) & EXP_ACTIVE) == 0) {
ahc              1725 dev/ic/aic7xxx.c 	} else if ((ahc->features & AHC_ULTRA) != 0) {
ahc              1755 dev/ic/aic7xxx.c 	return (ahc_find_syncrate(ahc, period, ppr_options, maxsync));
ahc              1764 dev/ic/aic7xxx.c ahc_find_syncrate(struct ahc_softc *ahc, u_int *period,
ahc              1769 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_DT) == 0)
ahc              1785 dev/ic/aic7xxx.c 		if ((ahc->features & AHC_ULTRA2) != 0
ahc              1816 dev/ic/aic7xxx.c 	 || ((ahc->features & AHC_ULTRA2) != 0
ahc              1831 dev/ic/aic7xxx.c ahc_find_period(struct ahc_softc *ahc, u_int scsirate, u_int maxsync)
ahc              1835 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_ULTRA2) != 0)
ahc              1843 dev/ic/aic7xxx.c 		if ((ahc->features & AHC_ULTRA2) != 0) {
ahc              1861 dev/ic/aic7xxx.c ahc_validate_offset(struct ahc_softc *ahc,
ahc              1871 dev/ic/aic7xxx.c 	} else if ((ahc->features & AHC_ULTRA2) != 0) {
ahc              1893 dev/ic/aic7xxx.c ahc_validate_width(struct ahc_softc *ahc, struct ahc_initiator_tinfo *tinfo,
ahc              1898 dev/ic/aic7xxx.c 		if (ahc->features & AHC_WIDE) {
ahc              1923 dev/ic/aic7xxx.c ahc_update_neg_request(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
ahc              1937 dev/ic/aic7xxx.c 		if ((ahc->features & AHC_WIDE) != 0)
ahc              1966 dev/ic/aic7xxx.c ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
ahc              1986 dev/ic/aic7xxx.c 	tinfo = ahc_fetch_transinfo(ahc, devinfo->channel, devinfo->our_scsiid,
ahc              2013 dev/ic/aic7xxx.c 		if ((ahc->features & AHC_ULTRA2) != 0) {
ahc              2042 dev/ic/aic7xxx.c 				sxfrctl0 = ahc_inb(ahc, SXFRCTL0);
ahc              2046 dev/ic/aic7xxx.c 				ahc_outb(ahc, SXFRCTL0, sxfrctl0);
ahc              2050 dev/ic/aic7xxx.c 			ahc_outb(ahc, SCSIRATE, scsirate);
ahc              2051 dev/ic/aic7xxx.c 			if ((ahc->features & AHC_ULTRA2) != 0)
ahc              2052 dev/ic/aic7xxx.c 				ahc_outb(ahc, SCSIOFFSET, offset);
ahc              2060 dev/ic/aic7xxx.c 		ahc_send_async(ahc, devinfo->channel, devinfo->target,
ahc              2065 dev/ic/aic7xxx.c 				       "offset = 0x%x\n", ahc_name(ahc),
ahc              2072 dev/ic/aic7xxx.c 				       ahc_name(ahc), devinfo->target);
ahc              2077 dev/ic/aic7xxx.c 	update_needed += ahc_update_neg_request(ahc, devinfo, tstate,
ahc              2081 dev/ic/aic7xxx.c 		ahc_update_pending_scbs(ahc);
ahc              2093 dev/ic/aic7xxx.c ahc_set_width(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
ahc              2104 dev/ic/aic7xxx.c 	tinfo = ahc_fetch_transinfo(ahc, devinfo->channel, devinfo->our_scsiid,
ahc              2126 dev/ic/aic7xxx.c 			ahc_outb(ahc, SCSIRATE, scsirate);
ahc              2130 dev/ic/aic7xxx.c 		ahc_send_async(ahc, devinfo->channel, devinfo->target,
ahc              2134 dev/ic/aic7xxx.c 			       ahc_name(ahc), devinfo->target,
ahc              2139 dev/ic/aic7xxx.c 	update_needed += ahc_update_neg_request(ahc, devinfo, tstate,
ahc              2142 dev/ic/aic7xxx.c 		ahc_update_pending_scbs(ahc);
ahc              2149 dev/ic/aic7xxx.c ahc_set_tags(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
ahc              2152 dev/ic/aic7xxx.c  	ahc_platform_set_tags(ahc, devinfo, alg);
ahc              2153 dev/ic/aic7xxx.c  	ahc_send_async(ahc, devinfo->channel, devinfo->target,
ahc              2163 dev/ic/aic7xxx.c ahc_update_pending_scbs(struct ahc_softc *ahc)
ahc              2176 dev/ic/aic7xxx.c 	LIST_FOREACH(pending_scb, &ahc->pending_scbs, pending_links) {
ahc              2182 dev/ic/aic7xxx.c 		ahc_scb_devinfo(ahc, &devinfo, pending_scb);
ahc              2183 dev/ic/aic7xxx.c 		tinfo = ahc_fetch_transinfo(ahc, devinfo.channel,
ahc              2197 dev/ic/aic7xxx.c 		ahc_sync_scb(ahc, pending_scb,
ahc              2205 dev/ic/aic7xxx.c 	if (ahc_is_paused(ahc)) {
ahc              2209 dev/ic/aic7xxx.c 		ahc_pause(ahc);
ahc              2212 dev/ic/aic7xxx.c 	saved_scbptr = ahc_inb(ahc, SCBPTR);
ahc              2214 dev/ic/aic7xxx.c 	for (i = 0; i < ahc->scb_data->maxhscbs; i++) {
ahc              2219 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, i);
ahc              2220 dev/ic/aic7xxx.c 		scb_tag = ahc_inb(ahc, SCB_TAG);
ahc              2221 dev/ic/aic7xxx.c 		pending_scb = ahc_lookup_scb(ahc, scb_tag);
ahc              2226 dev/ic/aic7xxx.c 		control = ahc_inb(ahc, SCB_CONTROL);
ahc              2229 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCB_CONTROL, control);
ahc              2230 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCB_SCSIRATE, pending_hscb->scsirate);
ahc              2231 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCB_SCSIOFFSET, pending_hscb->scsioffset);
ahc              2233 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCBPTR, saved_scbptr);
ahc              2236 dev/ic/aic7xxx.c 		ahc_unpause(ahc);
ahc              2241 dev/ic/aic7xxx.c ahc_fetch_devinfo(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
ahc              2247 dev/ic/aic7xxx.c 	if (ahc_inb(ahc, SSTAT0) & TARGET)
ahc              2253 dev/ic/aic7xxx.c 	 && (ahc->features & AHC_MULTI_TID) != 0
ahc              2254 dev/ic/aic7xxx.c 	 && (ahc_inb(ahc, SEQ_FLAGS)
ahc              2257 dev/ic/aic7xxx.c 		our_id = ahc_inb(ahc, TARGIDIN) & OID;
ahc              2258 dev/ic/aic7xxx.c 	} else if ((ahc->features & AHC_ULTRA2) != 0)
ahc              2259 dev/ic/aic7xxx.c 		our_id = ahc_inb(ahc, SCSIID_ULTRA2) & OID;
ahc              2261 dev/ic/aic7xxx.c 		our_id = ahc_inb(ahc, SCSIID) & OID;
ahc              2263 dev/ic/aic7xxx.c 	saved_scsiid = ahc_inb(ahc, SAVED_SCSIID);
ahc              2266 dev/ic/aic7xxx.c 			    SCSIID_TARGET(ahc, saved_scsiid),
ahc              2267 dev/ic/aic7xxx.c 			    ahc_inb(ahc, SAVED_LUN),
ahc              2268 dev/ic/aic7xxx.c 			    SCSIID_CHANNEL(ahc, saved_scsiid),
ahc              2306 dev/ic/aic7xxx.c ahc_print_devinfo(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
ahc              2308 dev/ic/aic7xxx.c 	printf("%s:%c:%d:%d: ", ahc_name(ahc), devinfo->channel,
ahc              2313 dev/ic/aic7xxx.c ahc_scb_devinfo(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
ahc              2323 dev/ic/aic7xxx.c 	ahc_compile_devinfo(devinfo, our_id, SCB_GET_TARGET(ahc, scb),
ahc              2324 dev/ic/aic7xxx.c 			    SCB_GET_LUN(scb), SCB_GET_CHANNEL(ahc, scb), role);
ahc              2330 dev/ic/aic7xxx.c ahc_assert_atn(struct ahc_softc *ahc)
ahc              2335 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_DT) == 0)
ahc              2336 dev/ic/aic7xxx.c 		scsisigo |= ahc_inb(ahc, SCSISIGI);
ahc              2337 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCSISIGO, scsisigo);
ahc              2347 dev/ic/aic7xxx.c ahc_setup_initiator_msgout(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
ahc              2355 dev/ic/aic7xxx.c 	ahc->msgout_index = 0;
ahc              2356 dev/ic/aic7xxx.c 	ahc->msgout_len = 0;
ahc              2359 dev/ic/aic7xxx.c 	 && ahc_inb(ahc, MSG_OUT) == MSG_IDENTIFYFLAG) {
ahc              2365 dev/ic/aic7xxx.c 		ahc->msgout_buf[ahc->msgout_index++] = identify_msg;
ahc              2366 dev/ic/aic7xxx.c 		ahc->msgout_len++;
ahc              2369 dev/ic/aic7xxx.c 			ahc->msgout_buf[ahc->msgout_index++] =
ahc              2371 dev/ic/aic7xxx.c 			ahc->msgout_buf[ahc->msgout_index++] = scb->hscb->tag;
ahc              2372 dev/ic/aic7xxx.c 			ahc->msgout_len += 2;
ahc              2377 dev/ic/aic7xxx.c 		ahc->msgout_buf[ahc->msgout_index++] = MSG_BUS_DEV_RESET;
ahc              2378 dev/ic/aic7xxx.c 		ahc->msgout_len++;
ahc              2379 dev/ic/aic7xxx.c 		ahc_print_path(ahc, scb);
ahc              2388 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCSISEQ, (ahc_inb(ahc, SCSISEQ) & ~ENSELO));
ahc              2391 dev/ic/aic7xxx.c 			ahc->msgout_buf[ahc->msgout_index++] = MSG_ABORT_TAG;
ahc              2393 dev/ic/aic7xxx.c 			ahc->msgout_buf[ahc->msgout_index++] = MSG_ABORT;
ahc              2394 dev/ic/aic7xxx.c 		ahc->msgout_len++;
ahc              2395 dev/ic/aic7xxx.c 		ahc_print_path(ahc, scb);
ahc              2405 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCSISEQ, (ahc_inb(ahc, SCSISEQ) & ~ENSELO));
ahc              2407 dev/ic/aic7xxx.c 		ahc_build_transfer_msg(ahc, devinfo);
ahc              2415 dev/ic/aic7xxx.c 		      ahc_inb(ahc, MSG_OUT), scb->flags);
ahc              2422 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCB_CONTROL, ahc_inb(ahc, SCB_CONTROL) & ~MK_MESSAGE);
ahc              2424 dev/ic/aic7xxx.c 	ahc->msgout_index = 0;
ahc              2425 dev/ic/aic7xxx.c 	ahc->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
ahc              2433 dev/ic/aic7xxx.c ahc_build_transfer_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
ahc              2450 dev/ic/aic7xxx.c 	tinfo = ahc_fetch_transinfo(ahc, devinfo->channel, devinfo->our_scsiid,
ahc              2464 dev/ic/aic7xxx.c 	rate = ahc_devlimited_syncrate(ahc, tinfo, &period,
ahc              2485 dev/ic/aic7xxx.c 		if ((ahc->features & AHC_WIDE) != 0)
ahc              2491 dev/ic/aic7xxx.c 			ahc_print_devinfo(ahc, devinfo);
ahc              2511 dev/ic/aic7xxx.c 		ahc_validate_offset(ahc, tinfo, rate, &offset,
ahc              2516 dev/ic/aic7xxx.c 			ahc_construct_ppr(ahc, devinfo, period, offset,
ahc              2519 dev/ic/aic7xxx.c 			ahc_construct_sdtr(ahc, devinfo, period, offset);
ahc              2522 dev/ic/aic7xxx.c 		ahc_construct_wdtr(ahc, devinfo, tinfo->goal.width);
ahc              2531 dev/ic/aic7xxx.c ahc_construct_sdtr(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
ahc              2536 dev/ic/aic7xxx.c 	ahc->msgout_buf[ahc->msgout_index++] = MSG_EXTENDED;
ahc              2537 dev/ic/aic7xxx.c 	ahc->msgout_buf[ahc->msgout_index++] = MSG_EXT_SDTR_LEN;
ahc              2538 dev/ic/aic7xxx.c 	ahc->msgout_buf[ahc->msgout_index++] = MSG_EXT_SDTR;
ahc              2539 dev/ic/aic7xxx.c 	ahc->msgout_buf[ahc->msgout_index++] = period;
ahc              2540 dev/ic/aic7xxx.c 	ahc->msgout_buf[ahc->msgout_index++] = offset;
ahc              2541 dev/ic/aic7xxx.c 	ahc->msgout_len += 5;
ahc              2544 dev/ic/aic7xxx.c 		       ahc_name(ahc), devinfo->channel, devinfo->target,
ahc              2554 dev/ic/aic7xxx.c ahc_construct_wdtr(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
ahc              2557 dev/ic/aic7xxx.c 	ahc->msgout_buf[ahc->msgout_index++] = MSG_EXTENDED;
ahc              2558 dev/ic/aic7xxx.c 	ahc->msgout_buf[ahc->msgout_index++] = MSG_EXT_WDTR_LEN;
ahc              2559 dev/ic/aic7xxx.c 	ahc->msgout_buf[ahc->msgout_index++] = MSG_EXT_WDTR;
ahc              2560 dev/ic/aic7xxx.c 	ahc->msgout_buf[ahc->msgout_index++] = bus_width;
ahc              2561 dev/ic/aic7xxx.c 	ahc->msgout_len += 4;
ahc              2564 dev/ic/aic7xxx.c 		       ahc_name(ahc), devinfo->channel, devinfo->target,
ahc              2574 dev/ic/aic7xxx.c ahc_construct_ppr(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
ahc              2580 dev/ic/aic7xxx.c 	ahc->msgout_buf[ahc->msgout_index++] = MSG_EXTENDED;
ahc              2581 dev/ic/aic7xxx.c 	ahc->msgout_buf[ahc->msgout_index++] = MSG_EXT_PPR_LEN;
ahc              2582 dev/ic/aic7xxx.c 	ahc->msgout_buf[ahc->msgout_index++] = MSG_EXT_PPR;
ahc              2583 dev/ic/aic7xxx.c 	ahc->msgout_buf[ahc->msgout_index++] = period;
ahc              2584 dev/ic/aic7xxx.c 	ahc->msgout_buf[ahc->msgout_index++] = 0;
ahc              2585 dev/ic/aic7xxx.c 	ahc->msgout_buf[ahc->msgout_index++] = offset;
ahc              2586 dev/ic/aic7xxx.c 	ahc->msgout_buf[ahc->msgout_index++] = bus_width;
ahc              2587 dev/ic/aic7xxx.c 	ahc->msgout_buf[ahc->msgout_index++] = ppr_options;
ahc              2588 dev/ic/aic7xxx.c 	ahc->msgout_len += 8;
ahc              2591 dev/ic/aic7xxx.c 		       "offset %x, ppr_options %x\n", ahc_name(ahc),
ahc              2601 dev/ic/aic7xxx.c ahc_clear_msg_state(struct ahc_softc *ahc)
ahc              2603 dev/ic/aic7xxx.c 	ahc->msgout_len = 0;
ahc              2604 dev/ic/aic7xxx.c 	ahc->msgin_index = 0;
ahc              2605 dev/ic/aic7xxx.c 	ahc->msg_type = MSG_TYPE_NONE;
ahc              2606 dev/ic/aic7xxx.c 	if ((ahc_inb(ahc, SCSISIGI) & ATNI) != 0) {
ahc              2611 dev/ic/aic7xxx.c 		ahc_outb(ahc, CLRSINT1, CLRATNO);
ahc              2613 dev/ic/aic7xxx.c 	ahc_outb(ahc, MSG_OUT, MSG_NOOP);
ahc              2614 dev/ic/aic7xxx.c 	ahc_outb(ahc, SEQ_FLAGS2,
ahc              2615 dev/ic/aic7xxx.c 		 ahc_inb(ahc, SEQ_FLAGS2) & ~TARGET_MSG_PENDING);
ahc              2619 dev/ic/aic7xxx.c ahc_handle_proto_violation(struct ahc_softc *ahc)
ahc              2629 dev/ic/aic7xxx.c 	ahc_fetch_devinfo(ahc, &devinfo);
ahc              2630 dev/ic/aic7xxx.c 	scbid = ahc_inb(ahc, SCB_TAG);
ahc              2631 dev/ic/aic7xxx.c 	scb = ahc_lookup_scb(ahc, scbid);
ahc              2632 dev/ic/aic7xxx.c 	seq_flags = ahc_inb(ahc, SEQ_FLAGS);
ahc              2633 dev/ic/aic7xxx.c 	curphase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK;
ahc              2634 dev/ic/aic7xxx.c 	lastphase = ahc_inb(ahc, LASTPHASE);
ahc              2642 dev/ic/aic7xxx.c 		ahc_print_devinfo(ahc, &devinfo);
ahc              2651 dev/ic/aic7xxx.c 		ahc_print_devinfo(ahc, &devinfo);
ahc              2657 dev/ic/aic7xxx.c 			ahc_print_path(ahc, scb);
ahc              2659 dev/ic/aic7xxx.c 		} else if ((ahc_inb(ahc, SCB_CONTROL) & STATUS_RCVD) == 0) {
ahc              2667 dev/ic/aic7xxx.c 			ahc_print_path(ahc, scb);
ahc              2670 dev/ic/aic7xxx.c 			ahc_print_path(ahc, scb);
ahc              2672 dev/ic/aic7xxx.c 			ahc_dump_card_state(ahc);
ahc              2684 dev/ic/aic7xxx.c 		found = ahc_reset_channel(ahc, 'A', TRUE);
ahc              2686 dev/ic/aic7xxx.c 		       "%d SCBs aborted\n", ahc_name(ahc), 'A', found);
ahc              2693 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCSISEQ,
ahc              2694 dev/ic/aic7xxx.c 			 ahc_inb(ahc, SCSISEQ) & ~ENSELO);
ahc              2695 dev/ic/aic7xxx.c 		ahc_assert_atn(ahc);
ahc              2696 dev/ic/aic7xxx.c 		ahc_outb(ahc, MSG_OUT, HOST_MSG);
ahc              2698 dev/ic/aic7xxx.c 			ahc_print_devinfo(ahc, &devinfo);
ahc              2699 dev/ic/aic7xxx.c 			ahc->msgout_buf[0] = MSG_ABORT_TASK;
ahc              2700 dev/ic/aic7xxx.c 			ahc->msgout_len = 1;
ahc              2701 dev/ic/aic7xxx.c 			ahc->msgout_index = 0;
ahc              2702 dev/ic/aic7xxx.c 			ahc->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
ahc              2704 dev/ic/aic7xxx.c 			ahc_print_path(ahc, scb);
ahc              2716 dev/ic/aic7xxx.c ahc_handle_message_phase(struct ahc_softc *ahc)
ahc              2722 dev/ic/aic7xxx.c 	ahc_fetch_devinfo(ahc, &devinfo);
ahc              2724 dev/ic/aic7xxx.c 	bus_phase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK;
ahc              2727 dev/ic/aic7xxx.c 	switch (ahc->msg_type) {
ahc              2734 dev/ic/aic7xxx.c 		if (ahc->msgout_len == 0)
ahc              2739 dev/ic/aic7xxx.c 			ahc_print_devinfo(ahc, &devinfo);
ahc              2759 dev/ic/aic7xxx.c 				ahc_outb(ahc, CLRSINT1, CLRATNO);
ahc              2760 dev/ic/aic7xxx.c 				ahc->send_msg_perror = FALSE;
ahc              2761 dev/ic/aic7xxx.c 				ahc->msg_type = MSG_TYPE_INITIATOR_MSGIN;
ahc              2762 dev/ic/aic7xxx.c 				ahc->msgin_index = 0;
ahc              2769 dev/ic/aic7xxx.c 		if (ahc->send_msg_perror) {
ahc              2770 dev/ic/aic7xxx.c 			ahc_outb(ahc, CLRSINT1, CLRATNO);
ahc              2771 dev/ic/aic7xxx.c 			ahc_outb(ahc, CLRSINT1, CLRREQINIT);
ahc              2774 dev/ic/aic7xxx.c 				printf(" byte 0x%x\n", ahc->send_msg_perror);
ahc              2776 dev/ic/aic7xxx.c 			ahc_outb(ahc, SCSIDATL, MSG_PARITY_ERROR);
ahc              2780 dev/ic/aic7xxx.c 		msgdone	= ahc->msgout_index == ahc->msgout_len;
ahc              2787 dev/ic/aic7xxx.c 			ahc->msgout_index = 0;
ahc              2788 dev/ic/aic7xxx.c 			ahc_assert_atn(ahc);
ahc              2791 dev/ic/aic7xxx.c 		lastbyte = ahc->msgout_index == (ahc->msgout_len - 1);
ahc              2794 dev/ic/aic7xxx.c 			ahc_outb(ahc, CLRSINT1, CLRATNO);
ahc              2801 dev/ic/aic7xxx.c 		ahc_outb(ahc, CLRSINT1, CLRREQINIT);
ahc              2805 dev/ic/aic7xxx.c 			       ahc->msgout_buf[ahc->msgout_index]);
ahc              2807 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCSIDATL, ahc->msgout_buf[ahc->msgout_index++]);
ahc              2817 dev/ic/aic7xxx.c 			ahc_print_devinfo(ahc, &devinfo);
ahc              2830 dev/ic/aic7xxx.c 			ahc->msgin_index = 0;
ahc              2832 dev/ic/aic7xxx.c 			 && (ahc->send_msg_perror == TRUE
ahc              2833 dev/ic/aic7xxx.c 			  || (ahc->msgout_len != 0
ahc              2834 dev/ic/aic7xxx.c 			   && ahc->msgout_index == 0))) {
ahc              2835 dev/ic/aic7xxx.c 				ahc->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
ahc              2843 dev/ic/aic7xxx.c 		ahc->msgin_buf[ahc->msgin_index] = ahc_inb(ahc, SCSIBUSL);
ahc              2847 dev/ic/aic7xxx.c 			       ahc->msgin_buf[ahc->msgin_index]);
ahc              2850 dev/ic/aic7xxx.c 		message_done = ahc_parse_msg(ahc, &devinfo);
ahc              2857 dev/ic/aic7xxx.c 			ahc->msgin_index = 0;
ahc              2864 dev/ic/aic7xxx.c 			if (ahc->msgout_len != 0) {
ahc              2867 dev/ic/aic7xxx.c 					ahc_print_devinfo(ahc, &devinfo);
ahc              2871 dev/ic/aic7xxx.c 				ahc_assert_atn(ahc);
ahc              2874 dev/ic/aic7xxx.c 			ahc->msgin_index++;
ahc              2880 dev/ic/aic7xxx.c 			ahc_outb(ahc, CLRSINT1, CLRREQINIT);
ahc              2881 dev/ic/aic7xxx.c 			ahc_inb(ahc, SCSIDATL);
ahc              2890 dev/ic/aic7xxx.c 		if (ahc->msgout_len == 0)
ahc              2899 dev/ic/aic7xxx.c 		if ((ahc_inb(ahc, SCSISIGI) & ATNI) != 0
ahc              2900 dev/ic/aic7xxx.c 		 && ahc->msgout_index > 0)
ahc              2913 dev/ic/aic7xxx.c 			ahc->msg_type = MSG_TYPE_TARGET_MSGOUT;
ahc              2914 dev/ic/aic7xxx.c 			ahc_outb(ahc, SCSISIGO, P_MESGOUT | BSYO);
ahc              2915 dev/ic/aic7xxx.c 			ahc->msgin_index = 0;
ahc              2917 dev/ic/aic7xxx.c 			ahc_inb(ahc, SCSIDATL);
ahc              2918 dev/ic/aic7xxx.c 			ahc_outb(ahc, SXFRCTL0,
ahc              2919 dev/ic/aic7xxx.c 				 ahc_inb(ahc, SXFRCTL0) | SPIOEN);
ahc              2923 dev/ic/aic7xxx.c 		msgdone = ahc->msgout_index == ahc->msgout_len;
ahc              2925 dev/ic/aic7xxx.c 			ahc_outb(ahc, SXFRCTL0,
ahc              2926 dev/ic/aic7xxx.c 				 ahc_inb(ahc, SXFRCTL0) & ~SPIOEN);
ahc              2934 dev/ic/aic7xxx.c 		ahc_outb(ahc, SXFRCTL0, ahc_inb(ahc, SXFRCTL0) | SPIOEN);
ahc              2935 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCSIDATL, ahc->msgout_buf[ahc->msgout_index++]);
ahc              2947 dev/ic/aic7xxx.c 		lastbyte = (ahc_inb(ahc, SCSISIGI) & ATNI) == 0;
ahc              2954 dev/ic/aic7xxx.c 		ahc_outb(ahc, SXFRCTL0, ahc_inb(ahc, SXFRCTL0) & ~SPIOEN);
ahc              2955 dev/ic/aic7xxx.c 		ahc->msgin_buf[ahc->msgin_index] = ahc_inb(ahc, SCSIDATL);
ahc              2956 dev/ic/aic7xxx.c 		msgdone = ahc_parse_msg(ahc, &devinfo);
ahc              2967 dev/ic/aic7xxx.c 		ahc->msgin_index++;
ahc              2974 dev/ic/aic7xxx.c 			ahc->msgin_index = 0;
ahc              2980 dev/ic/aic7xxx.c 			if (ahc->msgout_len != 0) {
ahc              2981 dev/ic/aic7xxx.c 				ahc_outb(ahc, SCSISIGO, P_MESGIN | BSYO);
ahc              2982 dev/ic/aic7xxx.c 				ahc_outb(ahc, SXFRCTL0,
ahc              2983 dev/ic/aic7xxx.c 					 ahc_inb(ahc, SXFRCTL0) | SPIOEN);
ahc              2984 dev/ic/aic7xxx.c 				ahc->msg_type = MSG_TYPE_TARGET_MSGIN;
ahc              2985 dev/ic/aic7xxx.c 				ahc->msgin_index = 0;
ahc              2994 dev/ic/aic7xxx.c 			ahc_outb(ahc, SXFRCTL0,
ahc              2995 dev/ic/aic7xxx.c 				 ahc_inb(ahc, SXFRCTL0) | SPIOEN);
ahc              3005 dev/ic/aic7xxx.c 		ahc_clear_msg_state(ahc);
ahc              3006 dev/ic/aic7xxx.c 		ahc_outb(ahc, RETURN_1, EXIT_MSG_LOOP);
ahc              3008 dev/ic/aic7xxx.c 		ahc_outb(ahc, RETURN_1, CONT_MSG_LOOP);
ahc              3018 dev/ic/aic7xxx.c ahc_sent_msg(struct ahc_softc *ahc, ahc_msgtype type, u_int msgval, int full)
ahc              3026 dev/ic/aic7xxx.c 	while (index < ahc->msgout_len) {
ahc              3027 dev/ic/aic7xxx.c 		if (ahc->msgout_buf[index] == MSG_EXTENDED) {
ahc              3030 dev/ic/aic7xxx.c 			end_index = index + 1 + ahc->msgout_buf[index + 1];
ahc              3031 dev/ic/aic7xxx.c 			if (ahc->msgout_buf[index+2] == msgval
ahc              3035 dev/ic/aic7xxx.c 					if (ahc->msgout_index > end_index)
ahc              3037 dev/ic/aic7xxx.c 				} else if (ahc->msgout_index > index)
ahc              3041 dev/ic/aic7xxx.c 		} else if (ahc->msgout_buf[index] >= MSG_SIMPLE_TASK
ahc              3042 dev/ic/aic7xxx.c 			&& ahc->msgout_buf[index] <= MSG_IGN_WIDE_RESIDUE) {
ahc              3049 dev/ic/aic7xxx.c 			 && ahc->msgout_buf[index] == msgval
ahc              3050 dev/ic/aic7xxx.c 			 && ahc->msgout_index > index)
ahc              3065 dev/ic/aic7xxx.c ahc_parse_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
ahc              3077 dev/ic/aic7xxx.c 	tinfo = ahc_fetch_transinfo(ahc, devinfo->channel, devinfo->our_scsiid,
ahc              3092 dev/ic/aic7xxx.c 	switch (ahc->msgin_buf[0]) {
ahc              3105 dev/ic/aic7xxx.c 		response = ahc_handle_msg_reject(ahc, devinfo);
ahc              3113 dev/ic/aic7xxx.c 		if (ahc->msgin_index < 2)
ahc              3115 dev/ic/aic7xxx.c 		switch (ahc->msgin_buf[2]) {
ahc              3124 dev/ic/aic7xxx.c 			if (ahc->msgin_buf[1] != MSG_EXT_SDTR_LEN) {
ahc              3136 dev/ic/aic7xxx.c 			if (ahc->msgin_index < (MSG_EXT_SDTR_LEN + 1))
ahc              3139 dev/ic/aic7xxx.c 			period = ahc->msgin_buf[3];
ahc              3141 dev/ic/aic7xxx.c 			saved_offset = offset = ahc->msgin_buf[4];
ahc              3142 dev/ic/aic7xxx.c 			syncrate = ahc_devlimited_syncrate(ahc, tinfo, &period,
ahc              3145 dev/ic/aic7xxx.c 			ahc_validate_offset(ahc, tinfo, syncrate, &offset,
ahc              3152 dev/ic/aic7xxx.c 				       ahc_name(ahc), devinfo->channel,
ahc              3154 dev/ic/aic7xxx.c 				       ahc->msgin_buf[3], saved_offset,
ahc              3157 dev/ic/aic7xxx.c 			ahc_set_syncrate(ahc, devinfo, 
ahc              3168 dev/ic/aic7xxx.c 			if (ahc_sent_msg(ahc, AHCMSG_EXT, MSG_EXT_SDTR, TRUE)) {
ahc              3182 dev/ic/aic7xxx.c 					       ahc_name(ahc), devinfo->channel,
ahc              3185 dev/ic/aic7xxx.c 				ahc->msgout_index = 0;
ahc              3186 dev/ic/aic7xxx.c 				ahc->msgout_len = 0;
ahc              3187 dev/ic/aic7xxx.c 				ahc_construct_sdtr(ahc, devinfo,
ahc              3189 dev/ic/aic7xxx.c 				ahc->msgout_index = 0;
ahc              3202 dev/ic/aic7xxx.c 			if (ahc->msgin_buf[1] != MSG_EXT_WDTR_LEN) {
ahc              3214 dev/ic/aic7xxx.c 			if (ahc->msgin_index < (MSG_EXT_WDTR_LEN + 1))
ahc              3217 dev/ic/aic7xxx.c 			bus_width = ahc->msgin_buf[3];
ahc              3219 dev/ic/aic7xxx.c 			ahc_validate_width(ahc, tinfo, &bus_width,
ahc              3224 dev/ic/aic7xxx.c 				       ahc_name(ahc), devinfo->channel,
ahc              3229 dev/ic/aic7xxx.c 			if (ahc_sent_msg(ahc, AHCMSG_EXT, MSG_EXT_WDTR, TRUE)) {
ahc              3240 dev/ic/aic7xxx.c 					       ahc_name(ahc), devinfo->channel,
ahc              3253 dev/ic/aic7xxx.c 					       ahc_name(ahc), devinfo->channel,
ahc              3256 dev/ic/aic7xxx.c 				ahc->msgout_index = 0;
ahc              3257 dev/ic/aic7xxx.c 				ahc->msgout_len = 0;
ahc              3258 dev/ic/aic7xxx.c 				ahc_construct_wdtr(ahc, devinfo, bus_width);
ahc              3259 dev/ic/aic7xxx.c 				ahc->msgout_index = 0;
ahc              3272 dev/ic/aic7xxx.c 			ahc_update_neg_request(ahc, devinfo, tstate,
ahc              3274 dev/ic/aic7xxx.c 			ahc_set_width(ahc, devinfo, bus_width,
ahc              3282 dev/ic/aic7xxx.c 				ahc->msgout_index = 0;
ahc              3283 dev/ic/aic7xxx.c 				ahc->msgout_len = 0;
ahc              3284 dev/ic/aic7xxx.c 				ahc_build_transfer_msg(ahc, devinfo);
ahc              3285 dev/ic/aic7xxx.c 				ahc->msgout_index = 0;
ahc              3302 dev/ic/aic7xxx.c 			if (ahc->msgin_buf[1] != MSG_EXT_PPR_LEN) {
ahc              3314 dev/ic/aic7xxx.c 			if (ahc->msgin_index < (MSG_EXT_PPR_LEN + 1))
ahc              3317 dev/ic/aic7xxx.c 			period = ahc->msgin_buf[3];
ahc              3318 dev/ic/aic7xxx.c 			offset = ahc->msgin_buf[5];
ahc              3319 dev/ic/aic7xxx.c 			bus_width = ahc->msgin_buf[6];
ahc              3321 dev/ic/aic7xxx.c 			ppr_options = ahc->msgin_buf[7];
ahc              3342 dev/ic/aic7xxx.c 			ahc_validate_width(ahc, tinfo, &bus_width,
ahc              3344 dev/ic/aic7xxx.c 			syncrate = ahc_devlimited_syncrate(ahc, tinfo, &period,
ahc              3347 dev/ic/aic7xxx.c 			ahc_validate_offset(ahc, tinfo, syncrate,
ahc              3351 dev/ic/aic7xxx.c 			if (ahc_sent_msg(ahc, AHCMSG_EXT, MSG_EXT_PPR, TRUE)) {
ahc              3371 dev/ic/aic7xxx.c 					       ahc_name(ahc), devinfo->channel,
ahc              3376 dev/ic/aic7xxx.c 					       ahc_name(ahc), devinfo->channel,
ahc              3378 dev/ic/aic7xxx.c 				ahc->msgout_index = 0;
ahc              3379 dev/ic/aic7xxx.c 				ahc->msgout_len = 0;
ahc              3380 dev/ic/aic7xxx.c 				ahc_construct_ppr(ahc, devinfo, period, offset,
ahc              3382 dev/ic/aic7xxx.c 				ahc->msgout_index = 0;
ahc              3390 dev/ic/aic7xxx.c 				       ahc_name(ahc), devinfo->channel,
ahc              3392 dev/ic/aic7xxx.c 				       saved_width, ahc->msgin_buf[3],
ahc              3396 dev/ic/aic7xxx.c 			ahc_set_width(ahc, devinfo, bus_width,
ahc              3399 dev/ic/aic7xxx.c 			ahc_set_syncrate(ahc, devinfo,
ahc              3416 dev/ic/aic7xxx.c 		ahc_handle_devreset(ahc, devinfo,
ahc              3420 dev/ic/aic7xxx.c 		ahc_restart(ahc);
ahc              3435 dev/ic/aic7xxx.c 		if (ahc->msgin_buf[0] == MSG_ABORT_TAG)
ahc              3436 dev/ic/aic7xxx.c 			tag = ahc_inb(ahc, INITIATOR_TAG);
ahc              3437 dev/ic/aic7xxx.c 		ahc_abort_scbs(ahc, devinfo->target, devinfo->channel,
ahc              3441 dev/ic/aic7xxx.c 		tstate = ahc->enabled_targets[devinfo->our_scsiid];
ahc              3447 dev/ic/aic7xxx.c 				ahc_queue_lstate_event(ahc, lstate,
ahc              3449 dev/ic/aic7xxx.c 						       ahc->msgin_buf[0],
ahc              3451 dev/ic/aic7xxx.c 				ahc_send_lstate_events(ahc, lstate);
ahc              3454 dev/ic/aic7xxx.c 		ahc_restart(ahc);
ahc              3469 dev/ic/aic7xxx.c 		ahc->msgout_index = 0;
ahc              3470 dev/ic/aic7xxx.c 		ahc->msgout_len = 1;
ahc              3471 dev/ic/aic7xxx.c 		ahc->msgout_buf[0] = MSG_MESSAGE_REJECT;
ahc              3478 dev/ic/aic7xxx.c 		ahc->msgout_len = 0;
ahc              3487 dev/ic/aic7xxx.c ahc_handle_msg_reject(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
ahc              3502 dev/ic/aic7xxx.c 	scb_index = ahc_inb(ahc, SCB_TAG);
ahc              3503 dev/ic/aic7xxx.c 	scb = ahc_lookup_scb(ahc, scb_index);
ahc              3504 dev/ic/aic7xxx.c 	tinfo = ahc_fetch_transinfo(ahc, devinfo->channel,
ahc              3508 dev/ic/aic7xxx.c 	last_msg = ahc_inb(ahc, LAST_MSG);
ahc              3510 dev/ic/aic7xxx.c 	if (ahc_sent_msg(ahc, AHCMSG_EXT, MSG_EXT_PPR, /*full*/FALSE)) {
ahc              3518 dev/ic/aic7xxx.c 			       ahc_name(ahc), devinfo->channel,
ahc              3524 dev/ic/aic7xxx.c 		ahc->msgout_index = 0;
ahc              3525 dev/ic/aic7xxx.c 		ahc->msgout_len = 0;
ahc              3526 dev/ic/aic7xxx.c 		ahc_build_transfer_msg(ahc, devinfo);
ahc              3527 dev/ic/aic7xxx.c 		ahc->msgout_index = 0;
ahc              3529 dev/ic/aic7xxx.c 	} else if (ahc_sent_msg(ahc, AHCMSG_EXT, MSG_EXT_WDTR, /*full*/FALSE)) {
ahc              3533 dev/ic/aic7xxx.c 		       "8bit transfers\n", ahc_name(ahc),
ahc              3535 dev/ic/aic7xxx.c 		ahc_set_width(ahc, devinfo, MSG_EXT_WDTR_BUS_8_BIT,
ahc              3548 dev/ic/aic7xxx.c 			ahc->msgout_index = 0;
ahc              3549 dev/ic/aic7xxx.c 			ahc->msgout_len = 0;
ahc              3550 dev/ic/aic7xxx.c 			ahc_build_transfer_msg(ahc, devinfo);
ahc              3551 dev/ic/aic7xxx.c 			ahc->msgout_index = 0;
ahc              3554 dev/ic/aic7xxx.c 	} else if (ahc_sent_msg(ahc, AHCMSG_EXT, MSG_EXT_SDTR, /*full*/FALSE)) {
ahc              3556 dev/ic/aic7xxx.c 		ahc_set_syncrate(ahc, devinfo, /*syncrate*/NULL, /*period*/0,
ahc              3562 dev/ic/aic7xxx.c 		       ahc_name(ahc), devinfo->channel,
ahc              3572 dev/ic/aic7xxx.c 			       "Performing non-tagged I/O\n", ahc_name(ahc),
ahc              3574 dev/ic/aic7xxx.c 			ahc_set_tags(ahc, devinfo, AHC_QUEUE_NONE);
ahc              3579 dev/ic/aic7xxx.c 			       ahc_name(ahc), devinfo->channel, devinfo->target,
ahc              3582 dev/ic/aic7xxx.c 			ahc_set_tags(ahc, devinfo, AHC_QUEUE_BASIC);
ahc              3590 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCB_CONTROL,
ahc              3591 dev/ic/aic7xxx.c 			 ahc_inb(ahc, SCB_CONTROL) & mask);
ahc              3595 dev/ic/aic7xxx.c 		ahc_outb(ahc, MSG_OUT, MSG_IDENTIFYFLAG);
ahc              3596 dev/ic/aic7xxx.c 		ahc_assert_atn(ahc);
ahc              3602 dev/ic/aic7xxx.c 		if ((ahc->flags & AHC_SCB_BTT) == 0) {
ahc              3606 dev/ic/aic7xxx.c 			    &(ahc->untagged_queues[devinfo->target_offset]);
ahc              3610 dev/ic/aic7xxx.c 		ahc_busy_tcl(ahc, BUILD_TCL(scb->hscb->scsiid, devinfo->lun),
ahc              3618 dev/ic/aic7xxx.c 		ahc_search_qinfifo(ahc, SCB_GET_TARGET(ahc, scb),
ahc              3619 dev/ic/aic7xxx.c 				   SCB_GET_CHANNEL(ahc, scb),
ahc              3628 dev/ic/aic7xxx.c 		       ahc_name(ahc), devinfo->channel, devinfo->target,
ahc              3638 dev/ic/aic7xxx.c ahc_handle_ign_wide_residue(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
ahc              3643 dev/ic/aic7xxx.c 	scb_index = ahc_inb(ahc, SCB_TAG);
ahc              3644 dev/ic/aic7xxx.c 	scb = ahc_lookup_scb(ahc, scb_index);
ahc              3649 dev/ic/aic7xxx.c 	if ((ahc_inb(ahc, SEQ_FLAGS) & DPHASE) == 0
ahc              3665 dev/ic/aic7xxx.c 		sgptr = ahc_inb(ahc, SCB_RESIDUAL_SGPTR);
ahc              3667 dev/ic/aic7xxx.c 		 && (ahc_inb(ahc, SCB_LUN) & SCB_XFERLEN_ODD) != 0) {
ahc              3681 dev/ic/aic7xxx.c 			sgptr = ahc_inl(ahc, SCB_RESIDUAL_SGPTR);
ahc              3682 dev/ic/aic7xxx.c 			data_cnt = ahc_inl(ahc, SCB_RESIDUAL_DATACNT);
ahc              3693 dev/ic/aic7xxx.c 			data_addr = ahc_inl(ahc, SHADDR);
ahc              3727 dev/ic/aic7xxx.c 			ahc_outl(ahc, SCB_RESIDUAL_SGPTR, sgptr);
ahc              3728 dev/ic/aic7xxx.c 			ahc_outl(ahc, SCB_RESIDUAL_DATACNT, data_cnt);
ahc              3735 dev/ic/aic7xxx.c 			ahc_outb(ahc, SCB_LUN,
ahc              3736 dev/ic/aic7xxx.c 				 ahc_inb(ahc, SCB_LUN) ^ SCB_XFERLEN_ODD);
ahc              3747 dev/ic/aic7xxx.c ahc_reinitialize_dataptrs(struct ahc_softc *ahc)
ahc              3756 dev/ic/aic7xxx.c 	scb_index = ahc_inb(ahc, SCB_TAG);
ahc              3757 dev/ic/aic7xxx.c 	scb = ahc_lookup_scb(ahc, scb_index);
ahc              3758 dev/ic/aic7xxx.c 	sgptr = (ahc_inb(ahc, SCB_RESIDUAL_SGPTR + 3) << 24)
ahc              3759 dev/ic/aic7xxx.c 	      | (ahc_inb(ahc, SCB_RESIDUAL_SGPTR + 2) << 16)
ahc              3760 dev/ic/aic7xxx.c 	      | (ahc_inb(ahc, SCB_RESIDUAL_SGPTR + 1) << 8)
ahc              3761 dev/ic/aic7xxx.c 	      |	ahc_inb(ahc, SCB_RESIDUAL_SGPTR);
ahc              3769 dev/ic/aic7xxx.c 	resid = (ahc_inb(ahc, SCB_RESIDUAL_DATACNT + 2) << 16)
ahc              3770 dev/ic/aic7xxx.c 	      | (ahc_inb(ahc, SCB_RESIDUAL_DATACNT + 1) << 8)
ahc              3771 dev/ic/aic7xxx.c 	      | ahc_inb(ahc, SCB_RESIDUAL_DATACNT);
ahc              3776 dev/ic/aic7xxx.c 	if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) {
ahc              3779 dev/ic/aic7xxx.c 		dscommand1 = ahc_inb(ahc, DSCOMMAND1);
ahc              3780 dev/ic/aic7xxx.c 		ahc_outb(ahc, DSCOMMAND1, dscommand1 | HADDLDSEL0);
ahc              3781 dev/ic/aic7xxx.c 		ahc_outb(ahc, HADDR,
ahc              3783 dev/ic/aic7xxx.c 		ahc_outb(ahc, DSCOMMAND1, dscommand1);
ahc              3785 dev/ic/aic7xxx.c 	ahc_outb(ahc, HADDR + 3, dataptr >> 24);
ahc              3786 dev/ic/aic7xxx.c 	ahc_outb(ahc, HADDR + 2, dataptr >> 16);
ahc              3787 dev/ic/aic7xxx.c 	ahc_outb(ahc, HADDR + 1, dataptr >> 8);
ahc              3788 dev/ic/aic7xxx.c 	ahc_outb(ahc, HADDR, dataptr);
ahc              3789 dev/ic/aic7xxx.c 	ahc_outb(ahc, HCNT + 2, resid >> 16);
ahc              3790 dev/ic/aic7xxx.c 	ahc_outb(ahc, HCNT + 1, resid >> 8);
ahc              3791 dev/ic/aic7xxx.c 	ahc_outb(ahc, HCNT, resid);
ahc              3792 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_ULTRA2) == 0) {
ahc              3793 dev/ic/aic7xxx.c 		ahc_outb(ahc, STCNT + 2, resid >> 16);
ahc              3794 dev/ic/aic7xxx.c 		ahc_outb(ahc, STCNT + 1, resid >> 8);
ahc              3795 dev/ic/aic7xxx.c 		ahc_outb(ahc, STCNT, resid);
ahc              3803 dev/ic/aic7xxx.c ahc_handle_devreset(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
ahc              3812 dev/ic/aic7xxx.c 	found = ahc_abort_scbs(ahc, devinfo->target, devinfo->channel,
ahc              3821 dev/ic/aic7xxx.c 	tstate = ahc->enabled_targets[devinfo->our_scsiid];
ahc              3830 dev/ic/aic7xxx.c 			ahc_queue_lstate_event(ahc, lstate, devinfo->our_scsiid,
ahc              3832 dev/ic/aic7xxx.c 			ahc_send_lstate_events(ahc, lstate);
ahc              3840 dev/ic/aic7xxx.c 	ahc_set_width(ahc, devinfo, MSG_EXT_WDTR_BUS_8_BIT,
ahc              3842 dev/ic/aic7xxx.c 	ahc_set_syncrate(ahc, devinfo, /*syncrate*/NULL,
ahc              3847 dev/ic/aic7xxx.c 		ahc_send_async(ahc, devinfo->channel, devinfo->target,
ahc              3852 dev/ic/aic7xxx.c 		printf("%s: %s on %c:%d. %d SCBs aborted\n", ahc_name(ahc),
ahc              3858 dev/ic/aic7xxx.c ahc_setup_target_msgin(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
ahc              3867 dev/ic/aic7xxx.c 	ahc->msgout_index = 0;
ahc              3868 dev/ic/aic7xxx.c 	ahc->msgout_len = 0;
ahc              3871 dev/ic/aic7xxx.c 		ahc_build_transfer_msg(ahc, devinfo);
ahc              3875 dev/ic/aic7xxx.c 	ahc->msgout_index = 0;
ahc              3876 dev/ic/aic7xxx.c 	ahc->msg_type = MSG_TYPE_TARGET_MSGIN;
ahc              3881 dev/ic/aic7xxx.c ahc_softc_init(struct ahc_softc *ahc)
ahc              3885 dev/ic/aic7xxx.c 	if ((ahc->chip & AHC_PCI) == 0)
ahc              3886 dev/ic/aic7xxx.c 		ahc->unpause = ahc_inb(ahc, HCNTRL) & IRQMS;
ahc              3888 dev/ic/aic7xxx.c 		ahc->unpause = 0;
ahc              3889 dev/ic/aic7xxx.c 	ahc->pause = ahc->unpause | PAUSE; 
ahc              3891 dev/ic/aic7xxx.c 	if (ahc->scb_data == NULL) {
ahc              3892 dev/ic/aic7xxx.c 		ahc->scb_data = malloc(sizeof(*ahc->scb_data),
ahc              3894 dev/ic/aic7xxx.c 		if (ahc->scb_data == NULL)
ahc              3896 dev/ic/aic7xxx.c 		memset(ahc->scb_data, 0, sizeof(*ahc->scb_data));
ahc              3903 dev/ic/aic7xxx.c ahc_softc_insert(struct ahc_softc *ahc)
ahc              3912 dev/ic/aic7xxx.c 	if ((ahc->chip & AHC_BUS_MASK) == AHC_PCI
ahc              3913 dev/ic/aic7xxx.c 	 && (ahc->features & AHC_MULTI_FUNC) != 0) {
ahc              3919 dev/ic/aic7xxx.c 			pci = ahc->dev_softc;
ahc              3927 dev/ic/aic7xxx.c 					slave = ahc;
ahc              3929 dev/ic/aic7xxx.c 					master = ahc;
ahc              3949 dev/ic/aic7xxx.c 	    && ahc_softc_comp(ahc, list_ahc) <= 0)
ahc              3952 dev/ic/aic7xxx.c 		TAILQ_INSERT_BEFORE(list_ahc, ahc, links);
ahc              3954 dev/ic/aic7xxx.c 		TAILQ_INSERT_TAIL(&ahc_tailq, ahc, links);
ahc              3955 dev/ic/aic7xxx.c 	ahc->init_level++;
ahc              3959 dev/ic/aic7xxx.c ahc_set_unit(struct ahc_softc *ahc, int unit)
ahc              3961 dev/ic/aic7xxx.c 	ahc->unit = unit;
ahc              3965 dev/ic/aic7xxx.c ahc_set_name(struct ahc_softc *ahc, char *name)
ahc              3967 dev/ic/aic7xxx.c 	if (ahc->name != NULL)
ahc              3968 dev/ic/aic7xxx.c 		free(ahc->name, M_DEVBUF);
ahc              3969 dev/ic/aic7xxx.c 	ahc->name = name;
ahc              3973 dev/ic/aic7xxx.c ahc_free(struct ahc_softc *ahc)
ahc              3977 dev/ic/aic7xxx.c 	switch (ahc->init_level) {
ahc              3980 dev/ic/aic7xxx.c 		ahc_shutdown(ahc);
ahc              3983 dev/ic/aic7xxx.c 		bus_dmamap_unload(ahc->parent_dmat, ahc->shared_data_dmamap);
ahc              3984 dev/ic/aic7xxx.c 		bus_dmamap_destroy(ahc->parent_dmat, ahc->shared_data_dmamap);
ahc              3985 dev/ic/aic7xxx.c 		bus_dmamem_unmap(ahc->parent_dmat, (caddr_t)ahc->qoutfifo, ahc->shared_data_size);
ahc              3986 dev/ic/aic7xxx.c 		bus_dmamem_free(ahc->parent_dmat, &ahc->shared_data_seg, ahc->shared_data_nseg);
ahc              3992 dev/ic/aic7xxx.c 	ahc_platform_free(ahc);
ahc              3993 dev/ic/aic7xxx.c 	ahc_fini_scbdata(ahc);
ahc              3997 dev/ic/aic7xxx.c 		tstate = ahc->enabled_targets[i];
ahc              4016 dev/ic/aic7xxx.c 	if (ahc->black_hole != NULL) {
ahc              4018 dev/ic/aic7xxx.c 		free(ahc->black_hole, M_DEVBUF);
ahc              4022 dev/ic/aic7xxx.c 	if (ahc->name != NULL)
ahc              4023 dev/ic/aic7xxx.c 		free(ahc->name, M_DEVBUF);
ahc              4025 dev/ic/aic7xxx.c 	if (ahc->seep_config != NULL)
ahc              4026 dev/ic/aic7xxx.c 		free(ahc->seep_config, M_DEVBUF);
ahc              4028 dev/ic/aic7xxx.c 	free(ahc, M_DEVBUF);
ahc              4036 dev/ic/aic7xxx.c 	struct	ahc_softc *ahc;
ahc              4039 dev/ic/aic7xxx.c 	ahc = (struct ahc_softc *)arg;
ahc              4042 dev/ic/aic7xxx.c 	ahc_reset(ahc, /*reinit*/FALSE);
ahc              4043 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCSISEQ, 0);
ahc              4044 dev/ic/aic7xxx.c 	ahc_outb(ahc, SXFRCTL0, 0);
ahc              4045 dev/ic/aic7xxx.c 	ahc_outb(ahc, DSPCISTATUS, 0);
ahc              4048 dev/ic/aic7xxx.c 		ahc_outb(ahc, i, 0);
ahc              4061 dev/ic/aic7xxx.c ahc_reset(struct ahc_softc *ahc, int reinit)
ahc              4073 dev/ic/aic7xxx.c 	ahc_pause(ahc);
ahc              4075 dev/ic/aic7xxx.c 	if ((ahc->chip & AHC_CHIPID_MASK) == AHC_AIC7770) {
ahc              4082 dev/ic/aic7xxx.c 		sblkctl = ahc_inb(ahc, SBLKCTL);
ahc              4083 dev/ic/aic7xxx.c 		ahc_outb(ahc, SBLKCTL, sblkctl | SELBUSB);
ahc              4084 dev/ic/aic7xxx.c 		sxfrctl1_b = ahc_inb(ahc, SXFRCTL1);
ahc              4085 dev/ic/aic7xxx.c 		ahc_outb(ahc, SBLKCTL, sblkctl & ~SELBUSB);
ahc              4087 dev/ic/aic7xxx.c 	sxfrctl1_a = ahc_inb(ahc, SXFRCTL1);
ahc              4089 dev/ic/aic7xxx.c 	ahc_outb(ahc, HCNTRL, CHIPRST | ahc->pause);
ahc              4100 dev/ic/aic7xxx.c 	} while (--wait && !(ahc_inb(ahc, HCNTRL) & CHIPRSTACK));
ahc              4104 dev/ic/aic7xxx.c 		       "Trying to initialize anyway.\n", ahc_name(ahc));
ahc              4106 dev/ic/aic7xxx.c 	ahc_outb(ahc, HCNTRL, ahc->pause);
ahc              4109 dev/ic/aic7xxx.c 	sblkctl = ahc_inb(ahc, SBLKCTL) & (SELBUSB|SELWIDE);
ahc              4111 dev/ic/aic7xxx.c 	if ((ahc->chip & AHC_PCI) != 0)
ahc              4119 dev/ic/aic7xxx.c 		ahc->features |= AHC_WIDE;
ahc              4123 dev/ic/aic7xxx.c 		ahc->features |= AHC_TWIN;
ahc              4138 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_TWIN) != 0) {
ahc              4141 dev/ic/aic7xxx.c 		sblkctl = ahc_inb(ahc, SBLKCTL);
ahc              4142 dev/ic/aic7xxx.c 		ahc_outb(ahc, SBLKCTL, sblkctl | SELBUSB);
ahc              4143 dev/ic/aic7xxx.c 		ahc_outb(ahc, SXFRCTL1, sxfrctl1_b);
ahc              4144 dev/ic/aic7xxx.c 		ahc_outb(ahc, SBLKCTL, sblkctl & ~SELBUSB);
ahc              4146 dev/ic/aic7xxx.c 	ahc_outb(ahc, SXFRCTL1, sxfrctl1_a);
ahc              4154 dev/ic/aic7xxx.c 		error = ahc->bus_chip_init(ahc);
ahc              4157 dev/ic/aic7xxx.c 		ahc_dumpseq(ahc);
ahc              4167 dev/ic/aic7xxx.c ahc_probe_scbs(struct ahc_softc *ahc) {
ahc              4172 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, i);
ahc              4173 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCB_BASE, i);
ahc              4174 dev/ic/aic7xxx.c 		if (ahc_inb(ahc, SCB_BASE) != i)
ahc              4176 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, 0);
ahc              4177 dev/ic/aic7xxx.c 		if (ahc_inb(ahc, SCB_BASE) != 0)
ahc              4195 dev/ic/aic7xxx.c ahc_build_free_scb_list(struct ahc_softc *ahc)
ahc              4201 dev/ic/aic7xxx.c 	if ((ahc->flags & AHC_LSCBS_ENABLED) != 0)
ahc              4204 dev/ic/aic7xxx.c 	for (i = 0; i < ahc->scb_data->maxhscbs; i++) {
ahc              4207 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, i);
ahc              4215 dev/ic/aic7xxx.c 			ahc_outb(ahc, SCB_BASE+j, 0xFF);
ahc              4218 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCB_CONTROL, 0);
ahc              4221 dev/ic/aic7xxx.c 		if ((ahc->flags & AHC_PAGESCBS) != 0)
ahc              4222 dev/ic/aic7xxx.c 			ahc_outb(ahc, SCB_NEXT, i+1);
ahc              4224 dev/ic/aic7xxx.c 			ahc_outb(ahc, SCB_NEXT, SCB_LIST_NULL);
ahc              4227 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCB_TAG, SCB_LIST_NULL);
ahc              4228 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCB_SCSIID, 0xFF);
ahc              4229 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCB_LUN, 0xFF);
ahc              4232 dev/ic/aic7xxx.c 	if ((ahc->flags & AHC_PAGESCBS) != 0) {
ahc              4234 dev/ic/aic7xxx.c 		ahc_outb(ahc, FREE_SCBH, 0);
ahc              4237 dev/ic/aic7xxx.c 		ahc_outb(ahc, FREE_SCBH, SCB_LIST_NULL);
ahc              4241 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCBPTR, i-1);
ahc              4242 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCB_NEXT, SCB_LIST_NULL);
ahc              4246 dev/ic/aic7xxx.c ahc_init_scbdata(struct ahc_softc *ahc)
ahc              4251 dev/ic/aic7xxx.c 	scb_data = ahc->scb_data;
ahc              4265 dev/ic/aic7xxx.c 	scb_data->maxhscbs = ahc_probe_scbs(ahc);
ahc              4266 dev/ic/aic7xxx.c 	if (ahc->scb_data->maxhscbs == 0) {
ahc              4267 dev/ic/aic7xxx.c 		printf("%s: No SCB space found\n", ahc_name(ahc));
ahc              4281 dev/ic/aic7xxx.c 	if (ahc_createdmamem(ahc->parent_dmat,
ahc              4282 dev/ic/aic7xxx.c 	     AHC_SCB_MAX * sizeof(struct hardware_scb), ahc->sc_dmaflags,
ahc              4285 dev/ic/aic7xxx.c 	     &scb_data->hscb_seg, &scb_data->hscb_nseg, ahc_name(ahc),
ahc              4291 dev/ic/aic7xxx.c 	if (ahc_createdmamem(ahc->parent_dmat,
ahc              4292 dev/ic/aic7xxx.c 	     AHC_SCB_MAX * sizeof(struct scsi_sense_data), ahc->sc_dmaflags,
ahc              4295 dev/ic/aic7xxx.c 	     &scb_data->sense_nseg, ahc_name(ahc), "sense buffers") < 0)
ahc              4305 dev/ic/aic7xxx.c 		ahc_alloc_scbs(ahc);
ahc              4312 dev/ic/aic7xxx.c 		       ahc_name(ahc));
ahc              4319 dev/ic/aic7xxx.c 	ahc->next_queued_scb = ahc_get_scb(ahc);
ahc              4332 dev/ic/aic7xxx.c ahc_fini_scbdata(struct ahc_softc *ahc)
ahc              4336 dev/ic/aic7xxx.c 	scb_data = ahc->scb_data;
ahc              4348 dev/ic/aic7xxx.c 			ahc_freedmamem(ahc->parent_dmat, PAGE_SIZE,
ahc              4356 dev/ic/aic7xxx.c 		ahc_freedmamem(ahc->parent_dmat,
ahc              4362 dev/ic/aic7xxx.c 		ahc_freedmamem(ahc->parent_dmat,
ahc              4377 dev/ic/aic7xxx.c ahc_alloc_scbs(struct ahc_softc *ahc)
ahc              4387 dev/ic/aic7xxx.c 	scb_data = ahc->scb_data;
ahc              4400 dev/ic/aic7xxx.c 	if (ahc_createdmamem(ahc->parent_dmat, PAGE_SIZE, ahc->sc_dmaflags,
ahc              4403 dev/ic/aic7xxx.c 			     &sg_map->sg_dmasegs, &sg_map->sg_nseg, ahc_name(ahc),
ahc              4436 dev/ic/aic7xxx.c 		next_scb->ahc_softc = ahc;
ahc              4439 dev/ic/aic7xxx.c 		error = bus_dmamap_create(ahc->parent_dmat, 
ahc              4441 dev/ic/aic7xxx.c 			  BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW|ahc->sc_dmaflags,
ahc              4447 dev/ic/aic7xxx.c 		next_scb->hscb->tag = ahc->scb_data->numscbs;
ahc              4448 dev/ic/aic7xxx.c 		SLIST_INSERT_HEAD(&ahc->scb_data->free_scbs,
ahc              4453 dev/ic/aic7xxx.c 		ahc->scb_data->numscbs++;
ahc              4459 dev/ic/aic7xxx.c ahc_controller_info(struct ahc_softc *ahc, char *buf, size_t buf_len)
ahc              4464 dev/ic/aic7xxx.c 		 ahc_chip_names[ahc->chip & AHC_CHIPID_MASK]);
ahc              4466 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_TWIN) != 0)
ahc              4469 dev/ic/aic7xxx.c 			 "primary %c, ", ahc->our_id, ahc->our_id_b,
ahc              4470 dev/ic/aic7xxx.c 			 (ahc->flags & AHC_PRIMARY_CHANNEL) + 'A');
ahc              4476 dev/ic/aic7xxx.c 		if ((ahc->features & AHC_ULTRA) != 0) {
ahc              4478 dev/ic/aic7xxx.c 		} else if ((ahc->features & AHC_DT) != 0) {
ahc              4480 dev/ic/aic7xxx.c 		} else if ((ahc->features & AHC_ULTRA2) != 0) {
ahc              4483 dev/ic/aic7xxx.c 		if ((ahc->features & AHC_WIDE) != 0) {
ahc              4490 dev/ic/aic7xxx.c 			 speed, type, ahc->channel, ahc->our_id);
ahc              4494 dev/ic/aic7xxx.c 	if ((ahc->flags & AHC_PAGESCBS) != 0)
ahc              4496 dev/ic/aic7xxx.c 			 ahc->scb_data->maxhscbs, AHC_MAX_QUEUE);
ahc              4499 dev/ic/aic7xxx.c 			 ahc->scb_data->maxhscbs);
ahc              4504 dev/ic/aic7xxx.c ahc_chip_init(struct ahc_softc *ahc)
ahc              4513 dev/ic/aic7xxx.c 	ahc_outb(ahc, SEQ_FLAGS, 0);
ahc              4514 dev/ic/aic7xxx.c 	ahc_outb(ahc, SEQ_FLAGS2, 0);
ahc              4517 dev/ic/aic7xxx.c 	if (ahc->features & AHC_TWIN) {
ahc              4522 dev/ic/aic7xxx.c 		ahc_outb(ahc, SBLKCTL, ahc_inb(ahc, SBLKCTL) | SELBUSB);
ahc              4523 dev/ic/aic7xxx.c 		term = (ahc->flags & AHC_TERM_ENB_B) != 0 ? STPWEN : 0;
ahc              4524 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCSIID, ahc->our_id_b);
ahc              4525 dev/ic/aic7xxx.c 		scsi_conf = ahc_inb(ahc, SCSICONF + 1);
ahc              4526 dev/ic/aic7xxx.c 		ahc_outb(ahc, SXFRCTL1, (scsi_conf & (ENSPCHK|STIMESEL))
ahc              4527 dev/ic/aic7xxx.c 					|term|ahc->seltime_b|ENSTIMER|ACTNEGEN);
ahc              4528 dev/ic/aic7xxx.c 		if ((ahc->features & AHC_ULTRA2) != 0)
ahc              4529 dev/ic/aic7xxx.c 			ahc_outb(ahc, SIMODE0, ahc_inb(ahc, SIMODE0)|ENIOERR);
ahc              4530 dev/ic/aic7xxx.c 		ahc_outb(ahc, SIMODE1, ENSELTIMO|ENSCSIRST|ENSCSIPERR);
ahc              4531 dev/ic/aic7xxx.c 		ahc_outb(ahc, SXFRCTL0, DFON|SPIOEN);
ahc              4534 dev/ic/aic7xxx.c 		ahc_outb(ahc, SBLKCTL, ahc_inb(ahc, SBLKCTL) & ~SELBUSB);
ahc              4536 dev/ic/aic7xxx.c 	term = (ahc->flags & AHC_TERM_ENB_A) != 0 ? STPWEN : 0;
ahc              4537 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_ULTRA2) != 0)
ahc              4538 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCSIID_ULTRA2, ahc->our_id);
ahc              4540 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCSIID, ahc->our_id);
ahc              4541 dev/ic/aic7xxx.c 	scsi_conf = ahc_inb(ahc, SCSICONF);
ahc              4542 dev/ic/aic7xxx.c 	ahc_outb(ahc, SXFRCTL1, (scsi_conf & (ENSPCHK|STIMESEL))
ahc              4543 dev/ic/aic7xxx.c 				|term|ahc->seltime
ahc              4545 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_ULTRA2) != 0)
ahc              4546 dev/ic/aic7xxx.c 		ahc_outb(ahc, SIMODE0, ahc_inb(ahc, SIMODE0)|ENIOERR);
ahc              4547 dev/ic/aic7xxx.c 	ahc_outb(ahc, SIMODE1, ENSELTIMO|ENSCSIRST|ENSCSIPERR);
ahc              4548 dev/ic/aic7xxx.c 	ahc_outb(ahc, SXFRCTL0, DFON|SPIOEN);
ahc              4552 dev/ic/aic7xxx.c 		ahc_unbusy_tcl(ahc, BUILD_TCL(i << 4, 0));
ahc              4553 dev/ic/aic7xxx.c 		if ((ahc->flags & AHC_SCB_BTT) != 0) {
ahc              4561 dev/ic/aic7xxx.c 				ahc_unbusy_tcl(ahc, BUILD_TCL(i << 4, lun));
ahc              4567 dev/ic/aic7xxx.c 		ahc->qoutfifo[i] = SCB_LIST_NULL;
ahc              4569 dev/ic/aic7xxx.c 	ahc_sync_qoutfifo(ahc, BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD);
ahc              4571 dev/ic/aic7xxx.c 	ahc_sync_qoutfifo(ahc, BUS_DMASYNC_PREREAD);
ahc              4574 dev/ic/aic7xxx.c 		ahc->qinfifo[i] = SCB_LIST_NULL;
ahc              4576 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_MULTI_TID) != 0) {
ahc              4577 dev/ic/aic7xxx.c 		ahc_outb(ahc, TARGID, 0);
ahc              4578 dev/ic/aic7xxx.c 		ahc_outb(ahc, TARGID + 1, 0);
ahc              4584 dev/ic/aic7xxx.c 	physaddr = ahc->scb_data->hscb_busaddr;
ahc              4585 dev/ic/aic7xxx.c 	ahc_outb(ahc, HSCB_ADDR, physaddr & 0xFF);
ahc              4586 dev/ic/aic7xxx.c 	ahc_outb(ahc, HSCB_ADDR + 1, (physaddr >> 8) & 0xFF);
ahc              4587 dev/ic/aic7xxx.c 	ahc_outb(ahc, HSCB_ADDR + 2, (physaddr >> 16) & 0xFF);
ahc              4588 dev/ic/aic7xxx.c 	ahc_outb(ahc, HSCB_ADDR + 3, (physaddr >> 24) & 0xFF);
ahc              4590 dev/ic/aic7xxx.c 	physaddr = ahc->shared_data_busaddr;
ahc              4591 dev/ic/aic7xxx.c 	ahc_outb(ahc, SHARED_DATA_ADDR, physaddr & 0xFF);
ahc              4592 dev/ic/aic7xxx.c 	ahc_outb(ahc, SHARED_DATA_ADDR + 1, (physaddr >> 8) & 0xFF);
ahc              4593 dev/ic/aic7xxx.c 	ahc_outb(ahc, SHARED_DATA_ADDR + 2, (physaddr >> 16) & 0xFF);
ahc              4594 dev/ic/aic7xxx.c 	ahc_outb(ahc, SHARED_DATA_ADDR + 3, (physaddr >> 24) & 0xFF);
ahc              4601 dev/ic/aic7xxx.c 	ahc_outb(ahc, CMDSIZE_TABLE, 5);
ahc              4602 dev/ic/aic7xxx.c 	ahc_outb(ahc, CMDSIZE_TABLE + 1, 9);
ahc              4603 dev/ic/aic7xxx.c 	ahc_outb(ahc, CMDSIZE_TABLE + 2, 9);
ahc              4604 dev/ic/aic7xxx.c 	ahc_outb(ahc, CMDSIZE_TABLE + 3, 0);
ahc              4605 dev/ic/aic7xxx.c 	ahc_outb(ahc, CMDSIZE_TABLE + 4, 15);
ahc              4606 dev/ic/aic7xxx.c 	ahc_outb(ahc, CMDSIZE_TABLE + 5, 11);
ahc              4607 dev/ic/aic7xxx.c 	ahc_outb(ahc, CMDSIZE_TABLE + 6, 0);
ahc              4608 dev/ic/aic7xxx.c 	ahc_outb(ahc, CMDSIZE_TABLE + 7, 0);
ahc              4610 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_HS_MAILBOX) != 0)
ahc              4611 dev/ic/aic7xxx.c 		ahc_outb(ahc, HS_MAILBOX, 0);
ahc              4614 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_TARGETMODE) != 0) {
ahc              4615 dev/ic/aic7xxx.c 		ahc->tqinfifonext = 1;
ahc              4616 dev/ic/aic7xxx.c 		ahc_outb(ahc, KERNEL_TQINPOS, ahc->tqinfifonext - 1);
ahc              4617 dev/ic/aic7xxx.c 		ahc_outb(ahc, TQINPOS, ahc->tqinfifonext);
ahc              4619 dev/ic/aic7xxx.c 	ahc->qinfifonext = 0;
ahc              4620 dev/ic/aic7xxx.c 	ahc->qoutfifonext = 0;
ahc              4621 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_QUEUE_REGS) != 0) {
ahc              4622 dev/ic/aic7xxx.c 		ahc_outb(ahc, QOFF_CTLSTA, SCB_QSIZE_256);
ahc              4623 dev/ic/aic7xxx.c 		ahc_outb(ahc, HNSCB_QOFF, ahc->qinfifonext);
ahc              4624 dev/ic/aic7xxx.c 		ahc_outb(ahc, SNSCB_QOFF, ahc->qinfifonext);
ahc              4625 dev/ic/aic7xxx.c 		ahc_outb(ahc, SDSCB_QOFF, 0);
ahc              4627 dev/ic/aic7xxx.c 		ahc_outb(ahc, KERNEL_QINPOS, ahc->qinfifonext);
ahc              4628 dev/ic/aic7xxx.c 		ahc_outb(ahc, QINPOS, ahc->qinfifonext);
ahc              4629 dev/ic/aic7xxx.c 		ahc_outb(ahc, QOUTPOS, ahc->qoutfifonext);
ahc              4633 dev/ic/aic7xxx.c 	ahc_outb(ahc, WAITING_SCBH, SCB_LIST_NULL);
ahc              4636 dev/ic/aic7xxx.c 	ahc_outb(ahc, DISCONNECTED_SCBH, SCB_LIST_NULL);
ahc              4639 dev/ic/aic7xxx.c 	ahc_outb(ahc, MSG_OUT, MSG_NOOP);
ahc              4647 dev/ic/aic7xxx.c 	if ((ahc->flags & AHC_INITIATORROLE) != 0)
ahc              4649 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCSISEQ_TEMPLATE, scsiseq_template);
ahc              4652 dev/ic/aic7xxx.c 	ahc_build_free_scb_list(ahc);
ahc              4657 dev/ic/aic7xxx.c 	ahc_outb(ahc, NEXT_QUEUED_SCB, ahc->next_queued_scb->hscb->tag);
ahc              4665 dev/ic/aic7xxx.c 		       ahc_name(ahc));
ahc              4667 dev/ic/aic7xxx.c 	error = ahc_loadseq(ahc);
ahc              4671 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_ULTRA2) != 0) {
ahc              4682 dev/ic/aic7xxx.c 		     (ahc_inb(ahc, SBLKCTL) & (ENAB40|ENAB20)) == 0 && wait;
ahc              4686 dev/ic/aic7xxx.c 	ahc_restart(ahc);
ahc              4694 dev/ic/aic7xxx.c ahc_init(struct ahc_softc *ahc)
ahc              4706 dev/ic/aic7xxx.c 		ahc->flags |= AHC_SEQUENCER_DEBUG;
ahc              4715 dev/ic/aic7xxx.c 		printf (" 0x%x", ahc_inb(ahc, i));
ahc              4717 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_MORE_SRAM) != 0) {
ahc              4722 dev/ic/aic7xxx.c 			printf (" 0x%x", ahc_inb(ahc, i));
ahc              4730 dev/ic/aic7xxx.c 	ahc_outb(ahc, CLRINT, CLRPARERR);
ahc              4731 dev/ic/aic7xxx.c 	ahc_outb(ahc, CLRINT, CLRBRKADRINT);
ahc              4738 dev/ic/aic7xxx.c 	if ((ahc->flags & AHC_USEDEFAULTS) != 0)
ahc              4739 dev/ic/aic7xxx.c 		ahc->our_id = ahc->our_id_b = 7;
ahc              4744 dev/ic/aic7xxx.c 	ahc->flags |= AHC_INITIATORROLE;
ahc              4750 dev/ic/aic7xxx.c 		ahc->features &= ~AHC_TARGETMODE;
ahc              4762 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_TARGETMODE) != 0)
ahc              4766 dev/ic/aic7xxx.c 	ahc->init_level++;
ahc              4768 dev/ic/aic7xxx.c 	if (ahc_createdmamem(ahc->parent_dmat, driver_data_size,
ahc              4769 dev/ic/aic7xxx.c 			     ahc->sc_dmaflags,
ahc              4770 dev/ic/aic7xxx.c 			     &ahc->shared_data_dmamap, (caddr_t *)&ahc->qoutfifo,
ahc              4771 dev/ic/aic7xxx.c 			     &ahc->shared_data_busaddr, &ahc->shared_data_seg,
ahc              4772 dev/ic/aic7xxx.c 			     &ahc->shared_data_nseg, ahc_name(ahc), "shared data") < 0)
ahc              4775 dev/ic/aic7xxx.c 	ahc->init_level++;
ahc              4777 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_TARGETMODE) != 0) {
ahc              4778 dev/ic/aic7xxx.c 		ahc->targetcmds = (struct target_cmd *)ahc->qoutfifo;
ahc              4779 dev/ic/aic7xxx.c 		ahc->qoutfifo = (uint8_t *)&ahc->targetcmds[AHC_TMODE_CMDS];
ahc              4780 dev/ic/aic7xxx.c 		ahc->dma_bug_buf = ahc->shared_data_busaddr
ahc              4784 dev/ic/aic7xxx.c 			ahc->targetcmds[i].cmd_valid = 0;
ahc              4786 dev/ic/aic7xxx.c 		ahc_sync_tqinfifo(ahc, BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD);
ahc              4788 dev/ic/aic7xxx.c 		ahc_sync_tqinfifo(ahc, BUS_DMASYNC_PREREAD);
ahc              4790 dev/ic/aic7xxx.c 		ahc->qoutfifo = (uint8_t *)&ahc->targetcmds[256];
ahc              4792 dev/ic/aic7xxx.c 	ahc->qinfifo = &ahc->qoutfifo[256];
ahc              4794 dev/ic/aic7xxx.c 	ahc->init_level++;
ahc              4797 dev/ic/aic7xxx.c 	if (ahc->scb_data->maxhscbs == 0)
ahc              4798 dev/ic/aic7xxx.c 		if (ahc_init_scbdata(ahc) != 0)
ahc              4806 dev/ic/aic7xxx.c 	if (ahc_alloc_tstate(ahc, ahc->our_id, 'A') == NULL) {
ahc              4808 dev/ic/aic7xxx.c 		       "Failing attach\n", ahc_name(ahc));
ahc              4812 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_TWIN) != 0) {
ahc              4813 dev/ic/aic7xxx.c 		if (ahc_alloc_tstate(ahc, ahc->our_id_b, 'B') == NULL) {
ahc              4815 dev/ic/aic7xxx.c 			       "Failing attach\n", ahc_name(ahc));
ahc              4820 dev/ic/aic7xxx.c 	ahc_outb(ahc, SEQ_FLAGS, 0);
ahc              4821 dev/ic/aic7xxx.c 	ahc_outb(ahc, SEQ_FLAGS2, 0);
ahc              4823 dev/ic/aic7xxx.c 	if (ahc->scb_data->maxhscbs < AHC_SCB_MAX_ALLOC) {
ahc              4824 dev/ic/aic7xxx.c 		ahc->flags |= AHC_PAGESCBS;
ahc              4826 dev/ic/aic7xxx.c 		ahc->flags &= ~AHC_PAGESCBS;
ahc              4833 dev/ic/aic7xxx.c 			ahc_name(ahc),
ahc              4844 dev/ic/aic7xxx.c 	if (ahc->features & AHC_TWIN) {
ahc              4845 dev/ic/aic7xxx.c 		scsi_conf = ahc_inb(ahc, SCSICONF + 1);
ahc              4847 dev/ic/aic7xxx.c 		 && (ahc->flags & AHC_INITIATORROLE) != 0)
ahc              4848 dev/ic/aic7xxx.c 			ahc->flags |= AHC_RESET_BUS_B;
ahc              4851 dev/ic/aic7xxx.c 	scsi_conf = ahc_inb(ahc, SCSICONF);
ahc              4853 dev/ic/aic7xxx.c 	 && (ahc->flags & AHC_INITIATORROLE) != 0)
ahc              4854 dev/ic/aic7xxx.c 		ahc->flags |= AHC_RESET_BUS_A;
ahc              4860 dev/ic/aic7xxx.c 	if ((ahc->flags & AHC_USEDEFAULTS) != 0) {
ahc              4862 dev/ic/aic7xxx.c 			"device parameters\n", ahc_name(ahc));
ahc              4863 dev/ic/aic7xxx.c 		ahc->flags |= AHC_EXTENDED_TRANS_A|AHC_EXTENDED_TRANS_B|
ahc              4866 dev/ic/aic7xxx.c 		if ((ahc->features & AHC_ULTRA) != 0)
ahc              4869 dev/ic/aic7xxx.c 		discenable = ~((ahc_inb(ahc, DISC_DSB + 1) << 8)
ahc              4870 dev/ic/aic7xxx.c 			   | ahc_inb(ahc, DISC_DSB));
ahc              4871 dev/ic/aic7xxx.c 		if ((ahc->features & (AHC_ULTRA|AHC_ULTRA2)) != 0)
ahc              4872 dev/ic/aic7xxx.c 			ultraenb = (ahc_inb(ahc, ULTRA_ENB + 1) << 8)
ahc              4873 dev/ic/aic7xxx.c 				      | ahc_inb(ahc, ULTRA_ENB);
ahc              4876 dev/ic/aic7xxx.c 	if ((ahc->features & (AHC_WIDE|AHC_TWIN)) == 0)
ahc              4887 dev/ic/aic7xxx.c 		our_id = ahc->our_id;
ahc              4889 dev/ic/aic7xxx.c 		if (i > 7 && (ahc->features & AHC_TWIN) != 0) {
ahc              4891 dev/ic/aic7xxx.c 			our_id = ahc->our_id_b;
ahc              4894 dev/ic/aic7xxx.c 		tinfo = ahc_fetch_transinfo(ahc, channel, our_id,
ahc              4898 dev/ic/aic7xxx.c 		if (ahc->flags & AHC_USEDEFAULTS) {
ahc              4899 dev/ic/aic7xxx.c 			if ((ahc->features & AHC_WIDE) != 0)
ahc              4913 dev/ic/aic7xxx.c 			scsirate = ahc_inb(ahc, TARG_SCSIRATE + i);
ahc              4915 dev/ic/aic7xxx.c 			if ((ahc->features & AHC_ULTRA2) != 0) {
ahc              4930 dev/ic/aic7xxx.c 					offset = ahc_inb(ahc, TARG_OFFSET + i);
ahc              4935 dev/ic/aic7xxx.c 				if ((ahc->features & AHC_DT) != 0)
ahc              4938 dev/ic/aic7xxx.c 				    ahc_find_period(ahc, scsirate, maxsync);
ahc              4944 dev/ic/aic7xxx.c 				 && (ahc->features & AHC_DT) != 0)
ahc              4955 dev/ic/aic7xxx.c 				    ahc_find_period(ahc, scsirate,
ahc              4965 dev/ic/aic7xxx.c 			 && (ahc->features & AHC_WIDE) != 0)
ahc              4968 dev/ic/aic7xxx.c 			if ((ahc->features & AHC_DT) != 0)
ahc              4980 dev/ic/aic7xxx.c 	ahc->user_discenable = discenable;
ahc              4981 dev/ic/aic7xxx.c 	ahc->user_tagenable = tagenable;
ahc              4983 dev/ic/aic7xxx.c 	return (ahc->bus_chip_init(ahc));
ahc              4987 dev/ic/aic7xxx.c ahc_intr_enable(struct ahc_softc *ahc, int enable)
ahc              4991 dev/ic/aic7xxx.c 	hcntrl = ahc_inb(ahc, HCNTRL);
ahc              4993 dev/ic/aic7xxx.c 	ahc->pause &= ~INTEN;
ahc              4994 dev/ic/aic7xxx.c 	ahc->unpause &= ~INTEN;
ahc              4997 dev/ic/aic7xxx.c 		ahc->pause |= INTEN;
ahc              4998 dev/ic/aic7xxx.c 		ahc->unpause |= INTEN;
ahc              5000 dev/ic/aic7xxx.c 	ahc_outb(ahc, HCNTRL, hcntrl);
ahc              5009 dev/ic/aic7xxx.c ahc_index_busy_tcl(struct ahc_softc *ahc, u_int tcl)
ahc              5014 dev/ic/aic7xxx.c 	if ((ahc->flags & AHC_SCB_BTT) != 0) {
ahc              5017 dev/ic/aic7xxx.c 		saved_scbptr = ahc_inb(ahc, SCBPTR);
ahc              5018 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, TCL_LUN(tcl));
ahc              5019 dev/ic/aic7xxx.c 		scbid = ahc_inb(ahc, SCB_64_BTT + TCL_TARGET_OFFSET(tcl));
ahc              5020 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, saved_scbptr);
ahc              5023 dev/ic/aic7xxx.c 		scbid = ahc_inb(ahc, BUSY_TARGETS + target_offset);
ahc              5030 dev/ic/aic7xxx.c ahc_unbusy_tcl(struct ahc_softc *ahc, u_int tcl)
ahc              5034 dev/ic/aic7xxx.c 	if ((ahc->flags & AHC_SCB_BTT) != 0) {
ahc              5037 dev/ic/aic7xxx.c 		saved_scbptr = ahc_inb(ahc, SCBPTR);
ahc              5038 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, TCL_LUN(tcl));
ahc              5039 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCB_64_BTT+TCL_TARGET_OFFSET(tcl), SCB_LIST_NULL);
ahc              5040 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, saved_scbptr);
ahc              5043 dev/ic/aic7xxx.c 		ahc_outb(ahc, BUSY_TARGETS + target_offset, SCB_LIST_NULL);
ahc              5048 dev/ic/aic7xxx.c ahc_busy_tcl(struct ahc_softc *ahc, u_int tcl, u_int scbid)
ahc              5052 dev/ic/aic7xxx.c 	if ((ahc->flags & AHC_SCB_BTT) != 0) {
ahc              5055 dev/ic/aic7xxx.c 		saved_scbptr = ahc_inb(ahc, SCBPTR);
ahc              5056 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, TCL_LUN(tcl));
ahc              5057 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCB_64_BTT + TCL_TARGET_OFFSET(tcl), scbid);
ahc              5058 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, saved_scbptr);
ahc              5061 dev/ic/aic7xxx.c 		ahc_outb(ahc, BUSY_TARGETS + target_offset, scbid);
ahc              5067 dev/ic/aic7xxx.c ahc_match_scb(struct ahc_softc *ahc, struct scb *scb, int target,
ahc              5076 dev/ic/aic7xxx.c 	targ = SCB_GET_TARGET(ahc, scb);
ahc              5077 dev/ic/aic7xxx.c 	chan = SCB_GET_CHANNEL(ahc, scb);
ahc              5108 dev/ic/aic7xxx.c ahc_freeze_devq(struct ahc_softc *ahc, struct scb *scb)
ahc              5114 dev/ic/aic7xxx.c 	target = SCB_GET_TARGET(ahc, scb);
ahc              5116 dev/ic/aic7xxx.c 	channel = SCB_GET_CHANNEL(ahc, scb);
ahc              5118 dev/ic/aic7xxx.c 	ahc_search_qinfifo(ahc, target, channel, lun,
ahc              5122 dev/ic/aic7xxx.c 	ahc_platform_freeze_devq(ahc, scb);
ahc              5126 dev/ic/aic7xxx.c ahc_qinfifo_requeue_tail(struct ahc_softc *ahc, struct scb *scb)
ahc              5131 dev/ic/aic7xxx.c 	if (ahc_qinfifo_count(ahc) != 0) {
ahc              5135 dev/ic/aic7xxx.c 		prev_pos = ahc->qinfifonext - 1;
ahc              5136 dev/ic/aic7xxx.c 		prev_tag = ahc->qinfifo[prev_pos];
ahc              5137 dev/ic/aic7xxx.c 		prev_scb = ahc_lookup_scb(ahc, prev_tag);
ahc              5139 dev/ic/aic7xxx.c 	ahc_qinfifo_requeue(ahc, prev_scb, scb);
ahc              5140 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_QUEUE_REGS) != 0) {
ahc              5141 dev/ic/aic7xxx.c 		ahc_outb(ahc, HNSCB_QOFF, ahc->qinfifonext);
ahc              5143 dev/ic/aic7xxx.c 		ahc_outb(ahc, KERNEL_QINPOS, ahc->qinfifonext);
ahc              5148 dev/ic/aic7xxx.c ahc_qinfifo_requeue(struct ahc_softc *ahc, struct scb *prev_scb,
ahc              5152 dev/ic/aic7xxx.c 		ahc_outb(ahc, NEXT_QUEUED_SCB, scb->hscb->tag);
ahc              5155 dev/ic/aic7xxx.c 		ahc_sync_scb(ahc, prev_scb, 
ahc              5158 dev/ic/aic7xxx.c 	ahc->qinfifo[ahc->qinfifonext] = scb->hscb->tag;
ahc              5159 dev/ic/aic7xxx.c 	ahc_dmamap_sync(ahc, ahc->parent_dmat, ahc->shared_data_dmamap,
ahc              5160 dev/ic/aic7xxx.c 			/*offset*/ahc->qinfifonext+256, /*len*/1,
ahc              5162 dev/ic/aic7xxx.c 	ahc->qinfifonext++;
ahc              5163 dev/ic/aic7xxx.c 	scb->hscb->next = ahc->next_queued_scb->hscb->tag;
ahc              5164 dev/ic/aic7xxx.c 	ahc_sync_scb(ahc, scb, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
ahc              5168 dev/ic/aic7xxx.c ahc_qinfifo_count(struct ahc_softc *ahc)
ahc              5173 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_QUEUE_REGS) != 0) {
ahc              5174 dev/ic/aic7xxx.c 		qinpos = ahc_inb(ahc, SNSCB_QOFF);
ahc              5175 dev/ic/aic7xxx.c 		ahc_outb(ahc, SNSCB_QOFF, qinpos);
ahc              5177 dev/ic/aic7xxx.c 		qinpos = ahc_inb(ahc, QINPOS);
ahc              5178 dev/ic/aic7xxx.c 	diff = ahc->qinfifonext - qinpos;
ahc              5183 dev/ic/aic7xxx.c ahc_search_qinfifo(struct ahc_softc *ahc, int target, char channel,
ahc              5198 dev/ic/aic7xxx.c 	qintail = ahc->qinfifonext;
ahc              5199 dev/ic/aic7xxx.c 	have_qregs = (ahc->features & AHC_QUEUE_REGS) != 0;
ahc              5201 dev/ic/aic7xxx.c 		qinstart = ahc_inb(ahc, SNSCB_QOFF);
ahc              5202 dev/ic/aic7xxx.c 		ahc_outb(ahc, SNSCB_QOFF, qinstart);
ahc              5204 dev/ic/aic7xxx.c 		qinstart = ahc_inb(ahc, QINPOS);
ahc              5214 dev/ic/aic7xxx.c 		ahc_freeze_untagged_queues(ahc);
ahc              5221 dev/ic/aic7xxx.c 	ahc->qinfifonext = qinpos;
ahc              5222 dev/ic/aic7xxx.c 	ahc_outb(ahc, NEXT_QUEUED_SCB, ahc->next_queued_scb->hscb->tag);
ahc              5225 dev/ic/aic7xxx.c 		scb = ahc_lookup_scb(ahc, ahc->qinfifo[qinpos]);
ahc              5228 dev/ic/aic7xxx.c 				qinpos, ahc->qinfifo[qinpos]);
ahc              5232 dev/ic/aic7xxx.c 		if (ahc_match_scb(ahc, scb, target, channel, lun, tag, role)) {
ahc              5251 dev/ic/aic7xxx.c 				ahc_done(ahc, scb);
ahc              5258 dev/ic/aic7xxx.c 				ahc_qinfifo_requeue(ahc, prev_scb, scb);
ahc              5263 dev/ic/aic7xxx.c 			ahc_qinfifo_requeue(ahc, prev_scb, scb);
ahc              5269 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_QUEUE_REGS) != 0) {
ahc              5270 dev/ic/aic7xxx.c 		ahc_outb(ahc, HNSCB_QOFF, ahc->qinfifonext);
ahc              5272 dev/ic/aic7xxx.c 		ahc_outb(ahc, KERNEL_QINPOS, ahc->qinfifonext);
ahc              5277 dev/ic/aic7xxx.c 	 && (qinstart != ahc->qinfifonext)) {
ahc              5290 dev/ic/aic7xxx.c 		scb = ahc_lookup_scb(ahc, ahc->qinfifo[qinstart]);
ahc              5294 dev/ic/aic7xxx.c 				found, qinstart, ahc->qinfifonext);
ahc              5304 dev/ic/aic7xxx.c 		ahc->scb_data->scbindex[scb->hscb->tag] = NULL;
ahc              5305 dev/ic/aic7xxx.c 		ahc_swap_with_next_hscb(ahc, scb);
ahc              5307 dev/ic/aic7xxx.c 		ahc->qinfifo[qinstart] = scb->hscb->tag;
ahc              5310 dev/ic/aic7xxx.c 		ahc_outb(ahc, NEXT_QUEUED_SCB, scb->hscb->tag);
ahc              5313 dev/ic/aic7xxx.c 		qintail = ahc->qinfifonext - 1;
ahc              5314 dev/ic/aic7xxx.c 		scb = ahc_lookup_scb(ahc, ahc->qinfifo[qintail]);
ahc              5315 dev/ic/aic7xxx.c 		scb->hscb->next = ahc->next_queued_scb->hscb->tag;
ahc              5321 dev/ic/aic7xxx.c 	curscbptr = ahc_inb(ahc, SCBPTR);
ahc              5322 dev/ic/aic7xxx.c 	next = ahc_inb(ahc, WAITING_SCBH);  /* Start at head of list. */
ahc              5328 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, next);
ahc              5329 dev/ic/aic7xxx.c 		scb_index = ahc_inb(ahc, SCB_TAG);
ahc              5330 dev/ic/aic7xxx.c 		if (scb_index >= ahc->scb_data->numscbs) {
ahc              5333 dev/ic/aic7xxx.c 			       scb_index, ahc->scb_data->numscbs);
ahc              5334 dev/ic/aic7xxx.c 			ahc_dump_card_state(ahc);
ahc              5337 dev/ic/aic7xxx.c 		scb = ahc_lookup_scb(ahc, scb_index);
ahc              5343 dev/ic/aic7xxx.c 		if (ahc_match_scb(ahc, scb, target, channel,
ahc              5363 dev/ic/aic7xxx.c 				ahc_done(ahc, scb);
ahc              5367 dev/ic/aic7xxx.c 				next = ahc_rem_wscb(ahc, next, prev);
ahc              5371 dev/ic/aic7xxx.c 				next = ahc_inb(ahc, SCB_NEXT);
ahc              5377 dev/ic/aic7xxx.c 			next = ahc_inb(ahc, SCB_NEXT);
ahc              5380 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCBPTR, curscbptr);
ahc              5382 dev/ic/aic7xxx.c 	found += ahc_search_untagged_queues(ahc, /*scsi_xfer*/NULL, target,
ahc              5386 dev/ic/aic7xxx.c 		ahc_release_untagged_queues(ahc);
ahc              5391 dev/ic/aic7xxx.c ahc_search_untagged_queues(struct ahc_softc *ahc, struct scsi_xfer *xs,
ahc              5405 dev/ic/aic7xxx.c 		ahc_freeze_untagged_queues(ahc);
ahc              5410 dev/ic/aic7xxx.c 	if ((ahc->flags & AHC_SCB_BTT) == 0) {
ahc              5428 dev/ic/aic7xxx.c 		untagged_q = &(ahc->untagged_queues[i]);
ahc              5447 dev/ic/aic7xxx.c 			if (ahc_match_scb(ahc, scb, target, channel, lun,
ahc              5468 dev/ic/aic7xxx.c 				ahc_done(ahc, scb);
ahc              5482 dev/ic/aic7xxx.c 		ahc_release_untagged_queues(ahc);
ahc              5487 dev/ic/aic7xxx.c ahc_search_disc_list(struct ahc_softc *ahc, int target, char channel,
ahc              5498 dev/ic/aic7xxx.c 	next = ahc_inb(ahc, DISCONNECTED_SCBH);
ahc              5503 dev/ic/aic7xxx.c 		active_scb = ahc_inb(ahc, SCBPTR);
ahc              5511 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, next);
ahc              5512 dev/ic/aic7xxx.c 		scb_index = ahc_inb(ahc, SCB_TAG);
ahc              5513 dev/ic/aic7xxx.c 		if (scb_index >= ahc->scb_data->numscbs) {
ahc              5516 dev/ic/aic7xxx.c 			       scb_index, ahc->scb_data->numscbs);
ahc              5517 dev/ic/aic7xxx.c 			ahc_dump_card_state(ahc);
ahc              5526 dev/ic/aic7xxx.c 		scbp = ahc_lookup_scb(ahc, scb_index);
ahc              5527 dev/ic/aic7xxx.c 		if (ahc_match_scb(ahc, scbp, target, channel, lun,
ahc              5532 dev/ic/aic7xxx.c 				    ahc_rem_scb_from_disc_list(ahc, prev, next);
ahc              5535 dev/ic/aic7xxx.c 				next = ahc_inb(ahc, SCB_NEXT);
ahc              5541 dev/ic/aic7xxx.c 			next = ahc_inb(ahc, SCB_NEXT);
ahc              5545 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, active_scb);
ahc              5554 dev/ic/aic7xxx.c ahc_rem_scb_from_disc_list(struct ahc_softc *ahc, u_int prev, u_int scbptr)
ahc              5558 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCBPTR, scbptr);
ahc              5559 dev/ic/aic7xxx.c 	next = ahc_inb(ahc, SCB_NEXT);
ahc              5561 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCB_CONTROL, 0);
ahc              5563 dev/ic/aic7xxx.c 	ahc_add_curscb_to_free_list(ahc);
ahc              5566 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, prev);
ahc              5567 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCB_NEXT, next);
ahc              5569 dev/ic/aic7xxx.c 		ahc_outb(ahc, DISCONNECTED_SCBH, next);
ahc              5580 dev/ic/aic7xxx.c ahc_add_curscb_to_free_list(struct ahc_softc *ahc)
ahc              5586 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCB_TAG, SCB_LIST_NULL);
ahc              5588 dev/ic/aic7xxx.c 	if ((ahc->flags & AHC_PAGESCBS) != 0) {
ahc              5589 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCB_NEXT, ahc_inb(ahc, FREE_SCBH));
ahc              5590 dev/ic/aic7xxx.c 		ahc_outb(ahc, FREE_SCBH, ahc_inb(ahc, SCBPTR));
ahc              5599 dev/ic/aic7xxx.c ahc_rem_wscb(struct ahc_softc *ahc, u_int scbpos, u_int prev)
ahc              5607 dev/ic/aic7xxx.c 	curscb = ahc_inb(ahc, SCBPTR);
ahc              5608 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCBPTR, scbpos);
ahc              5609 dev/ic/aic7xxx.c 	next = ahc_inb(ahc, SCB_NEXT);
ahc              5612 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCB_CONTROL, 0);
ahc              5614 dev/ic/aic7xxx.c 	ahc_add_curscb_to_free_list(ahc);
ahc              5619 dev/ic/aic7xxx.c 		ahc_outb(ahc, WAITING_SCBH, next); 
ahc              5625 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCSISEQ, (ahc_inb(ahc, SCSISEQ) & ~ENSELO));
ahc              5631 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, prev);
ahc              5632 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCB_NEXT, next);
ahc              5638 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCBPTR, curscb);
ahc              5650 dev/ic/aic7xxx.c ahc_abort_scbs(struct ahc_softc *ahc, int target, char channel,
ahc              5667 dev/ic/aic7xxx.c 	ahc_freeze_untagged_queues(ahc);
ahc              5670 dev/ic/aic7xxx.c 	active_scb = ahc_inb(ahc, SCBPTR);
ahc              5672 dev/ic/aic7xxx.c 	found = ahc_search_qinfifo(ahc, target, channel, lun, SCB_LIST_NULL,
ahc              5697 dev/ic/aic7xxx.c 		if ((ahc->flags & AHC_SCB_BTT) != 0)
ahc              5711 dev/ic/aic7xxx.c 				scbid = ahc_index_busy_tcl(ahc, tcl);
ahc              5712 dev/ic/aic7xxx.c 				scbp = ahc_lookup_scb(ahc, scbid);
ahc              5714 dev/ic/aic7xxx.c 				 || ahc_match_scb(ahc, scbp, target, channel,
ahc              5717 dev/ic/aic7xxx.c 				ahc_unbusy_tcl(ahc, BUILD_TCL(i << 4, j));
ahc              5727 dev/ic/aic7xxx.c 		ahc_search_disc_list(ahc, target, channel, lun, tag,
ahc              5739 dev/ic/aic7xxx.c 	for (i = 0; i < ahc->scb_data->maxhscbs; i++) {
ahc              5742 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, i);
ahc              5743 dev/ic/aic7xxx.c 		scbid = ahc_inb(ahc, SCB_TAG);
ahc              5744 dev/ic/aic7xxx.c 		scbp = ahc_lookup_scb(ahc, scbid);
ahc              5747 dev/ic/aic7xxx.c 		  && ahc_match_scb(ahc, scbp, target, channel, lun, tag, role)))
ahc              5748 dev/ic/aic7xxx.c 			ahc_add_curscb_to_free_list(ahc);
ahc              5757 dev/ic/aic7xxx.c 	scbp_next = LIST_FIRST(&ahc->pending_scbs);
ahc              5761 dev/ic/aic7xxx.c 		if (ahc_match_scb(ahc, scbp, target, channel, lun, tag, role)) {
ahc              5771 dev/ic/aic7xxx.c 			ahc_done(ahc, scbp);
ahc              5775 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCBPTR, active_scb);
ahc              5776 dev/ic/aic7xxx.c 	ahc_platform_abort_scbs(ahc, target, channel, lun, tag, role, status);
ahc              5777 dev/ic/aic7xxx.c 	ahc_release_untagged_queues(ahc);
ahc              5782 dev/ic/aic7xxx.c ahc_reset_current_bus(struct ahc_softc *ahc)
ahc              5786 dev/ic/aic7xxx.c 	ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) & ~ENSCSIRST);
ahc              5787 dev/ic/aic7xxx.c 	scsiseq = ahc_inb(ahc, SCSISEQ);
ahc              5788 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCSISEQ, scsiseq | SCSIRSTO);
ahc              5789 dev/ic/aic7xxx.c 	ahc_flush_device_writes(ahc);
ahc              5792 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCSISEQ, scsiseq & ~SCSIRSTO);
ahc              5794 dev/ic/aic7xxx.c 	ahc_clear_intstat(ahc);
ahc              5797 dev/ic/aic7xxx.c 	ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) | ENSCSIRST);
ahc              5801 dev/ic/aic7xxx.c ahc_reset_channel(struct ahc_softc *ahc, char channel, int initiate_reset)
ahc              5812 dev/ic/aic7xxx.c 	ahc->pending_device = NULL;
ahc              5819 dev/ic/aic7xxx.c 	ahc_pause(ahc);
ahc              5822 dev/ic/aic7xxx.c 	ahc_clear_critical_section(ahc);
ahc              5829 dev/ic/aic7xxx.c 	ahc_run_qoutfifo(ahc);
ahc              5841 dev/ic/aic7xxx.c 	if ((ahc->flags & AHC_TARGETROLE) != 0) {
ahc              5842 dev/ic/aic7xxx.c 		ahc_run_tqinfifo(ahc, /*paused*/TRUE);
ahc              5849 dev/ic/aic7xxx.c 	sblkctl = ahc_inb(ahc, SBLKCTL);
ahc              5851 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_TWIN) != 0
ahc              5854 dev/ic/aic7xxx.c 	scsiseq = ahc_inb(ahc, SCSISEQ_TEMPLATE);
ahc              5860 dev/ic/aic7xxx.c 		ahc_outb(ahc, SBLKCTL, sblkctl ^ SELBUSB);
ahc              5861 dev/ic/aic7xxx.c 		simode1 = ahc_inb(ahc, SIMODE1) & ~(ENBUSFREE|ENSCSIRST);
ahc              5868 dev/ic/aic7xxx.c 		if ((ahc->flags & AHC_TARGETROLE) != 0)
ahc              5871 dev/ic/aic7xxx.c 		ahc_outb(ahc, SIMODE1, simode1);
ahc              5873 dev/ic/aic7xxx.c 			ahc_reset_current_bus(ahc);
ahc              5874 dev/ic/aic7xxx.c 		ahc_clear_intstat(ahc);
ahc              5875 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCSISEQ, scsiseq & (ENSELI|ENRSELI|ENAUTOATNP));
ahc              5876 dev/ic/aic7xxx.c 		ahc_outb(ahc, SBLKCTL, sblkctl);
ahc              5880 dev/ic/aic7xxx.c 		simode1 = ahc_inb(ahc, SIMODE1) & ~(ENBUSFREE|ENSCSIRST);
ahc              5887 dev/ic/aic7xxx.c 		if ((ahc->flags & AHC_TARGETROLE) != 0)
ahc              5890 dev/ic/aic7xxx.c 		ahc_outb(ahc, SIMODE1, simode1);
ahc              5892 dev/ic/aic7xxx.c 			ahc_reset_current_bus(ahc);
ahc              5893 dev/ic/aic7xxx.c 		ahc_clear_intstat(ahc);
ahc              5894 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCSISEQ, scsiseq & (ENSELI|ENRSELI|ENAUTOATNP));
ahc              5902 dev/ic/aic7xxx.c 	found = ahc_abort_scbs(ahc, CAM_TARGET_WILDCARD, channel,
ahc              5906 dev/ic/aic7xxx.c 	max_scsiid = (ahc->features & AHC_WIDE) ? 15 : 7;
ahc              5917 dev/ic/aic7xxx.c 		tstate = ahc->enabled_targets[target];
ahc              5927 dev/ic/aic7xxx.c 			ahc_queue_lstate_event(ahc, lstate, CAM_TARGET_WILDCARD,
ahc              5929 dev/ic/aic7xxx.c 			ahc_send_lstate_events(ahc, lstate);
ahc              5934 dev/ic/aic7xxx.c 	ahc_send_async(ahc, devinfo.channel, CAM_TARGET_WILDCARD,
ahc              5942 dev/ic/aic7xxx.c 		if (ahc->enabled_targets[target] == NULL)
ahc              5950 dev/ic/aic7xxx.c 			ahc_set_width(ahc, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
ahc              5952 dev/ic/aic7xxx.c 			ahc_set_syncrate(ahc, &devinfo, /*syncrate*/NULL,
ahc              5960 dev/ic/aic7xxx.c 		ahc_restart(ahc);
ahc              5962 dev/ic/aic7xxx.c 		ahc_unpause(ahc);
ahc              5972 dev/ic/aic7xxx.c ahc_calc_residual(struct ahc_softc *ahc, struct scb *scb)
ahc              6047 dev/ic/aic7xxx.c 		ahc_print_path(ahc, scb);
ahc              6060 dev/ic/aic7xxx.c ahc_queue_lstate_event(struct ahc_softc *ahc, struct ahc_tmode_lstate *lstate,
ahc              6111 dev/ic/aic7xxx.c ahc_send_lstate_events(struct ahc_softc *ahc, struct ahc_tmode_lstate *lstate)
ahc              6147 dev/ic/aic7xxx.c ahc_dumpseq(struct ahc_softc* ahc)
ahc              6151 dev/ic/aic7xxx.c 	ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS|FASTMODE|LOADRAM);
ahc              6152 dev/ic/aic7xxx.c 	ahc_outb(ahc, SEQADDR0, 0);
ahc              6153 dev/ic/aic7xxx.c 	ahc_outb(ahc, SEQADDR1, 0);
ahc              6154 dev/ic/aic7xxx.c 	for (i = 0; i < ahc->instruction_ram_size; i++) {
ahc              6157 dev/ic/aic7xxx.c 		ahc_insb(ahc, SEQRAM, ins_bytes, 4);
ahc              6167 dev/ic/aic7xxx.c ahc_loadseq(struct ahc_softc *ahc)
ahc              6192 dev/ic/aic7xxx.c 	if (ahc->targetcmds != NULL)
ahc              6195 dev/ic/aic7xxx.c 	download_consts[CACHESIZE_MASK] = ahc->pci_cachesize - 1;
ahc              6196 dev/ic/aic7xxx.c 	download_consts[INVERTED_CACHESIZE_MASK] = ~(ahc->pci_cachesize - 1);
ahc              6197 dev/ic/aic7xxx.c 	sg_prefetch_cnt = ahc->pci_cachesize;
ahc              6207 dev/ic/aic7xxx.c 	ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS|FASTMODE|LOADRAM);
ahc              6208 dev/ic/aic7xxx.c 	ahc_outb(ahc, SEQADDR0, 0);
ahc              6209 dev/ic/aic7xxx.c 	ahc_outb(ahc, SEQADDR1, 0);
ahc              6212 dev/ic/aic7xxx.c 		if (ahc_check_patch(ahc, &cur_patch, i, &skip_addr) == 0) {
ahc              6220 dev/ic/aic7xxx.c 		if (downloaded == ahc->instruction_ram_size) {
ahc              6227 dev/ic/aic7xxx.c 			       "size of %d!\n", ahc_name(ahc),
ahc              6228 dev/ic/aic7xxx.c 			       ahc->instruction_ram_size);
ahc              6253 dev/ic/aic7xxx.c 		ahc_download_instr(ahc, i, download_consts);
ahc              6257 dev/ic/aic7xxx.c 	ahc->num_critical_sections = cs_count;
ahc              6261 dev/ic/aic7xxx.c 		ahc->critical_sections = malloc(cs_count, M_DEVBUF, M_NOWAIT);
ahc              6262 dev/ic/aic7xxx.c 		if (ahc->critical_sections == NULL)
ahc              6264 dev/ic/aic7xxx.c 		memcpy(ahc->critical_sections, cs_table, cs_count);
ahc              6266 dev/ic/aic7xxx.c 	ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS|FASTMODE);
ahc              6271 dev/ic/aic7xxx.c 		       ahc_name(ahc), ahc->features, ahc->bugs, ahc->flags);
ahc              6277 dev/ic/aic7xxx.c ahc_check_patch(struct ahc_softc *ahc, const struct patch **start_patch,
ahc              6290 dev/ic/aic7xxx.c 		if (cur_patch->patch_func(ahc) == 0) {
ahc              6313 dev/ic/aic7xxx.c ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, uint8_t *dconsts)
ahc              6354 dev/ic/aic7xxx.c 			ahc_check_patch(ahc, &cur_patch, i, &skip_addr);
ahc              6380 dev/ic/aic7xxx.c 		if ((ahc->features & AHC_CMD_CHAN) == 0
ahc              6391 dev/ic/aic7xxx.c 				      ahc_name(ahc));
ahc              6397 dev/ic/aic7xxx.c 		if ((ahc->features & AHC_ULTRA2) != 0) {
ahc              6429 dev/ic/aic7xxx.c 		ahc_outsb(ahc, SEQRAM, instr.bytes, 4);
ahc              6486 dev/ic/aic7xxx.c ahc_dump_card_state(struct ahc_softc *ahc)
ahc              6503 dev/ic/aic7xxx.c 	if (ahc_is_paused(ahc)) {
ahc              6507 dev/ic/aic7xxx.c 		ahc_pause(ahc);
ahc              6510 dev/ic/aic7xxx.c 	saved_scbptr = ahc_inb(ahc, SCBPTR);
ahc              6511 dev/ic/aic7xxx.c 	last_phase = ahc_inb(ahc, LASTPHASE);
ahc              6514 dev/ic/aic7xxx.c 	       ahc_name(ahc), ahc_lookup_phase_entry(last_phase)->phasemsg,
ahc              6515 dev/ic/aic7xxx.c 	       ahc_inb(ahc, SEQADDR0) | (ahc_inb(ahc, SEQADDR1) << 8));
ahc              6519 dev/ic/aic7xxx.c 	       ahc_inb(ahc, ACCUM), ahc_inb(ahc, SINDEX), ahc_inb(ahc, DINDEX),
ahc              6520 dev/ic/aic7xxx.c 	       ahc_inb(ahc, ARG_2));
ahc              6521 dev/ic/aic7xxx.c 	printf("HCNT = 0x%x SCBPTR = 0x%x\n", ahc_inb(ahc, HCNT),
ahc              6522 dev/ic/aic7xxx.c 	       ahc_inb(ahc, SCBPTR));
ahc              6524 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_DT) != 0)
ahc              6525 dev/ic/aic7xxx.c 		ahc_scsiphase_print(ahc_inb(ahc, SCSIPHASE), &cur_col, 50);
ahc              6526 dev/ic/aic7xxx.c 	ahc_scsisigi_print(ahc_inb(ahc, SCSISIGI), &cur_col, 50);
ahc              6527 dev/ic/aic7xxx.c 	ahc_error_print(ahc_inb(ahc, ERROR), &cur_col, 50);
ahc              6528 dev/ic/aic7xxx.c 	ahc_scsibusl_print(ahc_inb(ahc, SCSIBUSL), &cur_col, 50);
ahc              6529 dev/ic/aic7xxx.c 	ahc_lastphase_print(ahc_inb(ahc, LASTPHASE), &cur_col, 50);
ahc              6530 dev/ic/aic7xxx.c 	ahc_scsiseq_print(ahc_inb(ahc, SCSISEQ), &cur_col, 50);
ahc              6531 dev/ic/aic7xxx.c 	ahc_sblkctl_print(ahc_inb(ahc, SBLKCTL), &cur_col, 50);
ahc              6532 dev/ic/aic7xxx.c 	ahc_scsirate_print(ahc_inb(ahc, SCSIRATE), &cur_col, 50);
ahc              6533 dev/ic/aic7xxx.c 	ahc_seqctl_print(ahc_inb(ahc, SEQCTL), &cur_col, 50);
ahc              6534 dev/ic/aic7xxx.c 	ahc_seq_flags_print(ahc_inb(ahc, SEQ_FLAGS), &cur_col, 50);
ahc              6535 dev/ic/aic7xxx.c 	ahc_sstat0_print(ahc_inb(ahc, SSTAT0), &cur_col, 50);
ahc              6536 dev/ic/aic7xxx.c 	ahc_sstat1_print(ahc_inb(ahc, SSTAT1), &cur_col, 50);
ahc              6537 dev/ic/aic7xxx.c 	ahc_sstat2_print(ahc_inb(ahc, SSTAT2), &cur_col, 50);
ahc              6538 dev/ic/aic7xxx.c 	ahc_sstat3_print(ahc_inb(ahc, SSTAT3), &cur_col, 50);
ahc              6539 dev/ic/aic7xxx.c 	ahc_simode0_print(ahc_inb(ahc, SIMODE0), &cur_col, 50);
ahc              6540 dev/ic/aic7xxx.c 	ahc_simode1_print(ahc_inb(ahc, SIMODE1), &cur_col, 50);
ahc              6541 dev/ic/aic7xxx.c 	ahc_sxfrctl0_print(ahc_inb(ahc, SXFRCTL0), &cur_col, 50);
ahc              6542 dev/ic/aic7xxx.c 	ahc_dfcntrl_print(ahc_inb(ahc, DFCNTRL), &cur_col, 50);
ahc              6543 dev/ic/aic7xxx.c 	ahc_dfstatus_print(ahc_inb(ahc, DFSTATUS), &cur_col, 50);
ahc              6548 dev/ic/aic7xxx.c 	       printf(" 0x%x", ahc_inb(ahc, STACK)|(ahc_inb(ahc, STACK) << 8));
ahc              6549 dev/ic/aic7xxx.c 	printf("\nSCB count = %d\n", ahc->scb_data->numscbs);
ahc              6550 dev/ic/aic7xxx.c 	printf("Kernel NEXTQSCB = %d\n", ahc->next_queued_scb->hscb->tag);
ahc              6551 dev/ic/aic7xxx.c 	printf("Card NEXTQSCB = %d\n", ahc_inb(ahc, NEXT_QUEUED_SCB));
ahc              6554 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_QUEUE_REGS) != 0) {
ahc              6555 dev/ic/aic7xxx.c 		qinpos = ahc_inb(ahc, SNSCB_QOFF);
ahc              6556 dev/ic/aic7xxx.c 		ahc_outb(ahc, SNSCB_QOFF, qinpos);
ahc              6558 dev/ic/aic7xxx.c 		qinpos = ahc_inb(ahc, QINPOS);
ahc              6559 dev/ic/aic7xxx.c 	qintail = ahc->qinfifonext;
ahc              6561 dev/ic/aic7xxx.c 		printf("%d ", ahc->qinfifo[qinpos]);
ahc              6567 dev/ic/aic7xxx.c 	scb_index = ahc_inb(ahc, WAITING_SCBH);
ahc              6570 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, scb_index);
ahc              6571 dev/ic/aic7xxx.c 		printf("%d:%d ", scb_index, ahc_inb(ahc, SCB_TAG));
ahc              6572 dev/ic/aic7xxx.c 		scb_index = ahc_inb(ahc, SCB_NEXT);
ahc              6577 dev/ic/aic7xxx.c 	scb_index = ahc_inb(ahc, DISCONNECTED_SCBH);
ahc              6580 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, scb_index);
ahc              6581 dev/ic/aic7xxx.c 		printf("%d:%d ", scb_index, ahc_inb(ahc, SCB_TAG));
ahc              6582 dev/ic/aic7xxx.c 		scb_index = ahc_inb(ahc, SCB_NEXT);
ahc              6586 dev/ic/aic7xxx.c 	ahc_sync_qoutfifo(ahc, BUS_DMASYNC_POSTREAD);
ahc              6588 dev/ic/aic7xxx.c 	qoutpos = ahc->qoutfifonext;
ahc              6590 dev/ic/aic7xxx.c 	while (ahc->qoutfifo[qoutpos] != SCB_LIST_NULL && i++ < 256) {
ahc              6591 dev/ic/aic7xxx.c 		printf("%d ", ahc->qoutfifo[qoutpos]);
ahc              6597 dev/ic/aic7xxx.c 	scb_index = ahc_inb(ahc, FREE_SCBH);
ahc              6600 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, scb_index);
ahc              6602 dev/ic/aic7xxx.c 		scb_index = ahc_inb(ahc, SCB_NEXT);
ahc              6607 dev/ic/aic7xxx.c 	for (i = 0; i < ahc->scb_data->maxhscbs; i++) {
ahc              6608 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCBPTR, i);
ahc              6611 dev/ic/aic7xxx.c 		ahc_scb_control_print(ahc_inb(ahc, SCB_CONTROL), &cur_col, 60);
ahc              6612 dev/ic/aic7xxx.c 		ahc_scb_scsiid_print(ahc_inb(ahc, SCB_SCSIID), &cur_col, 60);
ahc              6613 dev/ic/aic7xxx.c 		ahc_scb_lun_print(ahc_inb(ahc, SCB_LUN), &cur_col, 60);
ahc              6614 dev/ic/aic7xxx.c 		ahc_scb_tag_print(ahc_inb(ahc, SCB_TAG), &cur_col, 60);
ahc              6620 dev/ic/aic7xxx.c 	LIST_FOREACH(scb, &ahc->pending_scbs, pending_links) {
ahc              6627 dev/ic/aic7xxx.c 		if ((ahc->flags & AHC_PAGESCBS) == 0) {
ahc              6628 dev/ic/aic7xxx.c 			ahc_outb(ahc, SCBPTR, scb->hscb->tag);
ahc              6630 dev/ic/aic7xxx.c 			ahc_scb_control_print(ahc_inb(ahc, SCB_CONTROL),
ahc              6632 dev/ic/aic7xxx.c 			ahc_scb_tag_print(ahc_inb(ahc, SCB_TAG), &cur_col, 60);
ahc              6640 dev/ic/aic7xxx.c 	SLIST_FOREACH(scb, &ahc->scb_data->free_scbs, links.sle) {
ahc              6647 dev/ic/aic7xxx.c 	maxtarget = (ahc->features & (AHC_WIDE|AHC_TWIN)) ? 15 : 7;
ahc              6649 dev/ic/aic7xxx.c 		untagged_q = &ahc->untagged_queues[target];
ahc              6662 dev/ic/aic7xxx.c 	ahc_platform_dump_card_state(ahc);
ahc              6664 dev/ic/aic7xxx.c 	ahc_outb(ahc, SCBPTR, saved_scbptr);
ahc              6666 dev/ic/aic7xxx.c 		ahc_unpause(ahc);
ahc              6673 dev/ic/aic7xxx.c ahc_find_tmode_devs(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb,
ahc              6679 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_TARGETMODE) == 0)
ahc              6689 dev/ic/aic7xxx.c 		*lstate = ahc->black_hole;
ahc              6693 dev/ic/aic7xxx.c 		max_id = (ahc->features & AHC_WIDE) ? 15 : 7;
ahc              6700 dev/ic/aic7xxx.c 		*tstate = ahc->enabled_targets[ccb->ccb_h.target_id];
ahc              6714 dev/ic/aic7xxx.c ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
ahc              6728 dev/ic/aic7xxx.c 	status = ahc_find_tmode_devs(ahc, sim, ccb, &tstate, &lstate,
ahc              6737 dev/ic/aic7xxx.c 		our_id = ahc->our_id;
ahc              6739 dev/ic/aic7xxx.c 		our_id = ahc->our_id_b;
ahc              6761 dev/ic/aic7xxx.c 		if ((ahc->features & AHC_MULTIROLE) != 0) {
ahc              6763 dev/ic/aic7xxx.c 			if ((ahc->features & AHC_MULTI_TID) != 0
ahc              6764 dev/ic/aic7xxx.c 		   	 && (ahc->flags & AHC_INITIATORROLE) != 0) {
ahc              6773 dev/ic/aic7xxx.c 			} else if ((ahc->flags & AHC_INITIATORROLE) != 0
ahc              6774 dev/ic/aic7xxx.c 				|| ahc->enabled_luns > 0) {
ahc              6784 dev/ic/aic7xxx.c 		} else if ((ahc->features & AHC_MULTI_TID) == 0
ahc              6785 dev/ic/aic7xxx.c 			&& ahc->enabled_luns > 0) {
ahc              6800 dev/ic/aic7xxx.c 	if ((ahc->flags & AHC_TARGETROLE) == 0
ahc              6807 dev/ic/aic7xxx.c 		if (LIST_FIRST(&ahc->pending_scbs) != NULL) {
ahc              6812 dev/ic/aic7xxx.c 		saved_flags = ahc->flags;
ahc              6813 dev/ic/aic7xxx.c 		ahc->flags |= AHC_TARGETROLE;
ahc              6814 dev/ic/aic7xxx.c 		if ((ahc->features & AHC_MULTIROLE) == 0)
ahc              6815 dev/ic/aic7xxx.c 			ahc->flags &= ~AHC_INITIATORROLE;
ahc              6816 dev/ic/aic7xxx.c 		ahc_pause(ahc);
ahc              6817 dev/ic/aic7xxx.c 		error = ahc_loadseq(ahc);
ahc              6827 dev/ic/aic7xxx.c 			ahc->flags = saved_flags;
ahc              6828 dev/ic/aic7xxx.c 			(void)ahc_loadseq(ahc);
ahc              6829 dev/ic/aic7xxx.c 			ahc_restart(ahc);
ahc              6834 dev/ic/aic7xxx.c 		ahc_restart(ahc);
ahc              6840 dev/ic/aic7xxx.c 	channel = SIM_CHANNEL(ahc, sim);
ahc              6872 dev/ic/aic7xxx.c 			tstate = ahc_alloc_tstate(ahc, target, channel);
ahc              6902 dev/ic/aic7xxx.c 		ahc_pause(ahc);
ahc              6905 dev/ic/aic7xxx.c 			ahc->enabled_luns++;
ahc              6907 dev/ic/aic7xxx.c 			if ((ahc->features & AHC_MULTI_TID) != 0) {
ahc              6910 dev/ic/aic7xxx.c 				targid_mask = ahc_inb(ahc, TARGID)
ahc              6911 dev/ic/aic7xxx.c 					    | (ahc_inb(ahc, TARGID + 1) << 8);
ahc              6914 dev/ic/aic7xxx.c 				ahc_outb(ahc, TARGID, targid_mask);
ahc              6915 dev/ic/aic7xxx.c 				ahc_outb(ahc, TARGID+1, (targid_mask >> 8));
ahc              6917 dev/ic/aic7xxx.c 				ahc_update_scsiid(ahc, targid_mask);
ahc              6922 dev/ic/aic7xxx.c 				channel = SIM_CHANNEL(ahc, sim);
ahc              6923 dev/ic/aic7xxx.c 				our_id = SIM_SCSI_ID(ahc, sim);
ahc              6934 dev/ic/aic7xxx.c 					sblkctl = ahc_inb(ahc, SBLKCTL);
ahc              6937 dev/ic/aic7xxx.c 					if ((ahc->features & AHC_TWIN) == 0)
ahc              6941 dev/ic/aic7xxx.c 						ahc->our_id = target;
ahc              6943 dev/ic/aic7xxx.c 						ahc->our_id_b = target;
ahc              6946 dev/ic/aic7xxx.c 						ahc_outb(ahc, SBLKCTL,
ahc              6949 dev/ic/aic7xxx.c 					ahc_outb(ahc, SCSIID, target);
ahc              6952 dev/ic/aic7xxx.c 						ahc_outb(ahc, SBLKCTL, sblkctl);
ahc              6956 dev/ic/aic7xxx.c 			ahc->black_hole = lstate;
ahc              6958 dev/ic/aic7xxx.c 		if (ahc->black_hole != NULL && ahc->enabled_luns > 0) {
ahc              6959 dev/ic/aic7xxx.c 			scsiseq = ahc_inb(ahc, SCSISEQ_TEMPLATE);
ahc              6961 dev/ic/aic7xxx.c 			ahc_outb(ahc, SCSISEQ_TEMPLATE, scsiseq);
ahc              6962 dev/ic/aic7xxx.c 			scsiseq = ahc_inb(ahc, SCSISEQ);
ahc              6964 dev/ic/aic7xxx.c 			ahc_outb(ahc, SCSISEQ, scsiseq);
ahc              6966 dev/ic/aic7xxx.c 		ahc_unpause(ahc);
ahc              6983 dev/ic/aic7xxx.c 		LIST_FOREACH(scb, &ahc->pending_scbs, pending_links) {
ahc              7016 dev/ic/aic7xxx.c 		ahc_pause(ahc);
ahc              7020 dev/ic/aic7xxx.c 			ahc->enabled_luns--;
ahc              7028 dev/ic/aic7xxx.c 				ahc_free_tstate(ahc, target, channel,
ahc              7030 dev/ic/aic7xxx.c 				if (ahc->features & AHC_MULTI_TID) {
ahc              7033 dev/ic/aic7xxx.c 					targid_mask = ahc_inb(ahc, TARGID)
ahc              7034 dev/ic/aic7xxx.c 						    | (ahc_inb(ahc, TARGID + 1)
ahc              7038 dev/ic/aic7xxx.c 					ahc_outb(ahc, TARGID, targid_mask);
ahc              7039 dev/ic/aic7xxx.c 					ahc_outb(ahc, TARGID+1,
ahc              7041 dev/ic/aic7xxx.c 					ahc_update_scsiid(ahc, targid_mask);
ahc              7046 dev/ic/aic7xxx.c 			ahc->black_hole = NULL;
ahc              7054 dev/ic/aic7xxx.c 		if (ahc->enabled_luns == 0) {
ahc              7058 dev/ic/aic7xxx.c 			scsiseq = ahc_inb(ahc, SCSISEQ_TEMPLATE);
ahc              7060 dev/ic/aic7xxx.c 			ahc_outb(ahc, SCSISEQ_TEMPLATE, scsiseq);
ahc              7061 dev/ic/aic7xxx.c 			scsiseq = ahc_inb(ahc, SCSISEQ);
ahc              7063 dev/ic/aic7xxx.c 			ahc_outb(ahc, SCSISEQ, scsiseq);
ahc              7065 dev/ic/aic7xxx.c 			if ((ahc->features & AHC_MULTIROLE) == 0) {
ahc              7067 dev/ic/aic7xxx.c 				ahc->flags &= ~AHC_TARGETROLE;
ahc              7068 dev/ic/aic7xxx.c 				ahc->flags |= AHC_INITIATORROLE;
ahc              7073 dev/ic/aic7xxx.c 				(void)ahc_loadseq(ahc);
ahc              7074 dev/ic/aic7xxx.c 				ahc_restart(ahc);
ahc              7081 dev/ic/aic7xxx.c 		ahc_unpause(ahc);
ahc              7087 dev/ic/aic7xxx.c ahc_update_scsiid(struct ahc_softc *ahc, u_int targid_mask)
ahc              7092 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_MULTI_TID) == 0)
ahc              7101 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_ULTRA2) != 0)
ahc              7102 dev/ic/aic7xxx.c 		scsiid = ahc_inb(ahc, SCSIID_ULTRA2);
ahc              7104 dev/ic/aic7xxx.c 		scsiid = ahc_inb(ahc, SCSIID);
ahc              7112 dev/ic/aic7xxx.c 			our_id = ahc->our_id;
ahc              7118 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_ULTRA2) != 0)
ahc              7119 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCSIID_ULTRA2, scsiid);
ahc              7121 dev/ic/aic7xxx.c 		ahc_outb(ahc, SCSIID, scsiid);
ahc              7126 dev/ic/aic7xxx.c ahc_run_tqinfifo(struct ahc_softc *ahc, int paused)
ahc              7135 dev/ic/aic7xxx.c 	if ((ahc->features & AHC_AUTOPAUSE) != 0)
ahc              7138 dev/ic/aic7xxx.c 	ahc_sync_tqinfifo(ahc, BUS_DMASYNC_POSTREAD);
ahc              7139 dev/ic/aic7xxx.c 	while ((cmd = &ahc->targetcmds[ahc->tqinfifonext])->cmd_valid != 0) {
ahc              7145 dev/ic/aic7xxx.c 		if (ahc_handle_target_cmd(ahc, cmd) != 0)
ahc              7149 dev/ic/aic7xxx.c 		ahc_dmamap_sync(ahc, ahc->parent_dmat/*shared_data_dmat*/,
ahc              7150 dev/ic/aic7xxx.c 				ahc->shared_data_dmamap,
ahc              7151 dev/ic/aic7xxx.c 				ahc_targetcmd_offset(ahc, ahc->tqinfifonext),
ahc              7158 dev/ic/aic7xxx.c 		ahc->tqinfifonext++;
ahc              7164 dev/ic/aic7xxx.c 		if ((ahc->tqinfifonext & (HOST_TQINPOS - 1)) == 1) {
ahc              7165 dev/ic/aic7xxx.c 			if ((ahc->features & AHC_HS_MAILBOX) != 0) {
ahc              7168 dev/ic/aic7xxx.c 				hs_mailbox = ahc_inb(ahc, HS_MAILBOX);
ahc              7170 dev/ic/aic7xxx.c 				hs_mailbox |= ahc->tqinfifonext & HOST_TQINPOS;
ahc              7171 dev/ic/aic7xxx.c 				ahc_outb(ahc, HS_MAILBOX, hs_mailbox);
ahc              7174 dev/ic/aic7xxx.c 					ahc_pause(ahc);	
ahc              7175 dev/ic/aic7xxx.c 				ahc_outb(ahc, KERNEL_TQINPOS,
ahc              7176 dev/ic/aic7xxx.c 					 ahc->tqinfifonext & HOST_TQINPOS);
ahc              7178 dev/ic/aic7xxx.c 					ahc_unpause(ahc);
ahc              7186 dev/ic/aic7xxx.c ahc_handle_target_cmd(struct ahc_softc *ahc, struct target_cmd *cmd)
ahc              7196 dev/ic/aic7xxx.c 	initiator = SCSIID_TARGET(ahc, cmd->scsiid);
ahc              7201 dev/ic/aic7xxx.c 	tstate = ahc->enabled_targets[target];
ahc              7210 dev/ic/aic7xxx.c 		lstate = ahc->black_hole;
ahc              7214 dev/ic/aic7xxx.c 		ahc->flags |= AHC_TQINFIFO_BLOCKED;
ahc              7219 dev/ic/aic7xxx.c 			printf("%s: ATIOs exhausted\n", ahc_name(ahc));
ahc              7222 dev/ic/aic7xxx.c 		ahc->flags &= ~AHC_TQINFIFO_BLOCKED;
ahc              7226 dev/ic/aic7xxx.c 	       lstate == ahc->black_hole ? "(Black Holed)" : "");
ahc              7230 dev/ic/aic7xxx.c 	if (lstate == ahc->black_hole) {
ahc              7288 dev/ic/aic7xxx.c 		       initiator, target, lun, ahc->pending_device);
ahc              7290 dev/ic/aic7xxx.c 		ahc->pending_device = lstate;
ahc                62 dev/ic/aic7xxx_inline.h IO_INLINE void ahc_pause_bug_fix(struct ahc_softc *ahc);
ahc                63 dev/ic/aic7xxx_inline.h IO_INLINE int  ahc_is_paused(struct ahc_softc *ahc);
ahc                64 dev/ic/aic7xxx_inline.h IO_INLINE void ahc_pause(struct ahc_softc *ahc);
ahc                65 dev/ic/aic7xxx_inline.h IO_INLINE void ahc_unpause(struct ahc_softc *ahc);
ahc                77 dev/ic/aic7xxx_inline.h ahc_pause_bug_fix(struct ahc_softc *ahc)
ahc                79 dev/ic/aic7xxx_inline.h 	if ((ahc->features & AHC_ULTRA2) != 0)
ahc                80 dev/ic/aic7xxx_inline.h 		(void)ahc_inb(ahc, CCSCBCTL);
ahc                88 dev/ic/aic7xxx_inline.h ahc_is_paused(struct ahc_softc *ahc)
ahc                90 dev/ic/aic7xxx_inline.h 	return ((ahc_inb(ahc, HCNTRL) & PAUSE) != 0);
ahc               101 dev/ic/aic7xxx_inline.h ahc_pause(struct ahc_softc *ahc)
ahc               103 dev/ic/aic7xxx_inline.h 	ahc_outb(ahc, HCNTRL, ahc->pause);
ahc               109 dev/ic/aic7xxx_inline.h 	while (ahc_is_paused(ahc) == 0)
ahc               112 dev/ic/aic7xxx_inline.h 	ahc_pause_bug_fix(ahc);
ahc               126 dev/ic/aic7xxx_inline.h ahc_unpause(struct ahc_softc *ahc)
ahc               128 dev/ic/aic7xxx_inline.h 	if ((ahc_inb(ahc, INTSTAT) & (SCSIINT | SEQINT | BRKADRINT)) == 0)
ahc               129 dev/ic/aic7xxx_inline.h 		ahc_outb(ahc, HCNTRL, ahc->unpause);
ahc               134 dev/ic/aic7xxx_inline.h IO_INLINE void	ahc_freeze_untagged_queues(struct ahc_softc *ahc);
ahc               135 dev/ic/aic7xxx_inline.h IO_INLINE void	ahc_release_untagged_queues(struct ahc_softc *ahc);
ahc               143 dev/ic/aic7xxx_inline.h ahc_freeze_untagged_queues(struct ahc_softc *ahc)
ahc               145 dev/ic/aic7xxx_inline.h 	if ((ahc->flags & AHC_SCB_BTT) == 0)
ahc               146 dev/ic/aic7xxx_inline.h 		ahc->untagged_queue_lock++;
ahc               156 dev/ic/aic7xxx_inline.h ahc_release_untagged_queues(struct ahc_softc *ahc)
ahc               158 dev/ic/aic7xxx_inline.h 	if ((ahc->flags & AHC_SCB_BTT) == 0) {
ahc               159 dev/ic/aic7xxx_inline.h 		ahc->untagged_queue_lock--;
ahc               160 dev/ic/aic7xxx_inline.h 		if (ahc->untagged_queue_lock == 0)
ahc               161 dev/ic/aic7xxx_inline.h 			ahc_run_untagged_queues(ahc);
ahc               175 dev/ic/aic7xxx_inline.h 			ahc_hscb_busaddr(struct ahc_softc *ahc, u_int index);
ahc               176 dev/ic/aic7xxx_inline.h IO_INLINE void		ahc_sync_scb(struct ahc_softc *ahc,
ahc               180 dev/ic/aic7xxx_inline.h 			ahc_targetcmd_offset(struct ahc_softc *ahc,
ahc               210 dev/ic/aic7xxx_inline.h ahc_hscb_busaddr(struct ahc_softc *ahc, u_int index)
ahc               212 dev/ic/aic7xxx_inline.h 	return (ahc->scb_data->hscb_busaddr
ahc               217 dev/ic/aic7xxx_inline.h ahc_sync_scb(struct ahc_softc *ahc, struct scb *scb, int op)
ahc               219 dev/ic/aic7xxx_inline.h 	ahc_dmamap_sync(ahc, ahc->parent_dmat,
ahc               220 dev/ic/aic7xxx_inline.h 			ahc->scb_data->hscb_dmamap,
ahc               221 dev/ic/aic7xxx_inline.h 			/*offset*/(scb->hscb - ahc->scb_data->hscbs) * sizeof(*scb->hscb),
ahc               227 dev/ic/aic7xxx_inline.h ahc_targetcmd_offset(struct ahc_softc *ahc, u_int index)
ahc               229 dev/ic/aic7xxx_inline.h 	return (((uint8_t *)&ahc->targetcmds[index]) - ahc->qoutfifo);
ahc               235 dev/ic/aic7xxx_inline.h static __inline char *ahc_name(struct ahc_softc *ahc);
ahc               238 dev/ic/aic7xxx_inline.h ahc_name(struct ahc_softc *ahc)
ahc               240 dev/ic/aic7xxx_inline.h 	return (ahc->name);
ahc               245 dev/ic/aic7xxx_inline.h IO_INLINE void	ahc_update_residual(struct ahc_softc *ahc,
ahc               248 dev/ic/aic7xxx_inline.h 			ahc_fetch_transinfo(struct ahc_softc *ahc,
ahc               254 dev/ic/aic7xxx_inline.h 			ahc_inw(struct ahc_softc *ahc, u_int port);
ahc               255 dev/ic/aic7xxx_inline.h IO_INLINE void	ahc_outw(struct ahc_softc *ahc, u_int port,
ahc               258 dev/ic/aic7xxx_inline.h 			ahc_inl(struct ahc_softc *ahc, u_int port);
ahc               259 dev/ic/aic7xxx_inline.h IO_INLINE void	ahc_outl(struct ahc_softc *ahc, u_int port,
ahc               262 dev/ic/aic7xxx_inline.h 			ahc_get_scb(struct ahc_softc *ahc);
ahc               263 dev/ic/aic7xxx_inline.h IO_INLINE void		ahc_free_scb(struct ahc_softc *ahc, struct scb *scb);
ahc               264 dev/ic/aic7xxx_inline.h IO_INLINE struct scb *ahc_lookup_scb(struct ahc_softc *ahc, u_int tag);
ahc               265 dev/ic/aic7xxx_inline.h IO_INLINE void		ahc_swap_with_next_hscb(struct ahc_softc *ahc,
ahc               267 dev/ic/aic7xxx_inline.h IO_INLINE void		ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb);
ahc               269 dev/ic/aic7xxx_inline.h 			ahc_get_sense_buf(struct ahc_softc *ahc,
ahc               272 dev/ic/aic7xxx_inline.h 			ahc_get_sense_bufaddr(struct ahc_softc *ahc,
ahc               282 dev/ic/aic7xxx_inline.h ahc_update_residual(struct ahc_softc *ahc, struct scb *scb)
ahc               288 dev/ic/aic7xxx_inline.h 		ahc_calc_residual(ahc, scb);
ahc               296 dev/ic/aic7xxx_inline.h ahc_fetch_transinfo(struct ahc_softc *ahc, char channel, u_int our_id,
ahc               307 dev/ic/aic7xxx_inline.h 	*tstate = ahc->enabled_targets[our_id];
ahc               312 dev/ic/aic7xxx_inline.h ahc_inw(struct ahc_softc *ahc, u_int port)
ahc               314 dev/ic/aic7xxx_inline.h 	return ((ahc_inb(ahc, port+1) << 8) | ahc_inb(ahc, port));
ahc               318 dev/ic/aic7xxx_inline.h ahc_outw(struct ahc_softc *ahc, u_int port, u_int value)
ahc               320 dev/ic/aic7xxx_inline.h 	ahc_outb(ahc, port, value & 0xFF);
ahc               321 dev/ic/aic7xxx_inline.h 	ahc_outb(ahc, port+1, (value >> 8) & 0xFF);
ahc               325 dev/ic/aic7xxx_inline.h ahc_inl(struct ahc_softc *ahc, u_int port)
ahc               327 dev/ic/aic7xxx_inline.h 	return ((ahc_inb(ahc, port))
ahc               328 dev/ic/aic7xxx_inline.h 	      | (ahc_inb(ahc, port+1) << 8)
ahc               329 dev/ic/aic7xxx_inline.h 	      | (ahc_inb(ahc, port+2) << 16)
ahc               330 dev/ic/aic7xxx_inline.h 	      | (ahc_inb(ahc, port+3) << 24));
ahc               334 dev/ic/aic7xxx_inline.h ahc_outl(struct ahc_softc *ahc, u_int port, uint32_t value)
ahc               336 dev/ic/aic7xxx_inline.h 	ahc_outb(ahc, port, (value) & 0xFF);
ahc               337 dev/ic/aic7xxx_inline.h 	ahc_outb(ahc, port+1, ((value) >> 8) & 0xFF);
ahc               338 dev/ic/aic7xxx_inline.h 	ahc_outb(ahc, port+2, ((value) >> 16) & 0xFF);
ahc               339 dev/ic/aic7xxx_inline.h 	ahc_outb(ahc, port+3, ((value) >> 24) & 0xFF);
ahc               346 dev/ic/aic7xxx_inline.h ahc_get_scb(struct ahc_softc *ahc)
ahc               350 dev/ic/aic7xxx_inline.h 	scb = SLIST_FIRST(&ahc->scb_data->free_scbs);
ahc               353 dev/ic/aic7xxx_inline.h 		SLIST_REMOVE_HEAD(&ahc->scb_data->free_scbs, links.sle);
ahc               362 dev/ic/aic7xxx_inline.h ahc_free_scb(struct ahc_softc *ahc, struct scb *scb)
ahc               368 dev/ic/aic7xxx_inline.h 	ahc->scb_data->scbindex[hscb->tag] = NULL;
ahc               372 dev/ic/aic7xxx_inline.h 	SLIST_INSERT_HEAD(&ahc->scb_data->free_scbs, scb, links.sle);
ahc               375 dev/ic/aic7xxx_inline.h 	ahc_platform_scb_free(ahc, scb);
ahc               380 dev/ic/aic7xxx_inline.h ahc_lookup_scb(struct ahc_softc *ahc, u_int tag)
ahc               384 dev/ic/aic7xxx_inline.h 	scb = ahc->scb_data->scbindex[tag];
ahc               386 dev/ic/aic7xxx_inline.h 		ahc_sync_scb(ahc, scb,
ahc               393 dev/ic/aic7xxx_inline.h ahc_swap_with_next_hscb(struct ahc_softc *ahc, struct scb *scb)
ahc               410 dev/ic/aic7xxx_inline.h 	q_hscb = ahc->next_queued_scb->hscb;
ahc               415 dev/ic/aic7xxx_inline.h 		    aic_htole32(ahc_hscb_busaddr(ahc, q_hscb->tag)
ahc               422 dev/ic/aic7xxx_inline.h 	ahc->next_queued_scb->hscb = scb->hscb;
ahc               426 dev/ic/aic7xxx_inline.h 	ahc->scb_data->scbindex[scb->hscb->tag] = scb;
ahc               433 dev/ic/aic7xxx_inline.h ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb)
ahc               435 dev/ic/aic7xxx_inline.h 	ahc_swap_with_next_hscb(ahc, scb);
ahc               452 dev/ic/aic7xxx_inline.h 	ahc->qinfifo[ahc->qinfifonext] = scb->hscb->tag;
ahc               453 dev/ic/aic7xxx_inline.h 	ahc_dmamap_sync(ahc, ahc->parent_dmat, ahc->shared_data_dmamap,
ahc               454 dev/ic/aic7xxx_inline.h 			/*offset*/ahc->qinfifonext+256, /*len*/1,
ahc               456 dev/ic/aic7xxx_inline.h 	ahc->qinfifonext++;
ahc               462 dev/ic/aic7xxx_inline.h 	ahc_sync_scb(ahc, scb, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
ahc               465 dev/ic/aic7xxx_inline.h 	if ((ahc->features & AHC_QUEUE_REGS) != 0) {
ahc               466 dev/ic/aic7xxx_inline.h 		ahc_outb(ahc, HNSCB_QOFF, ahc->qinfifonext);
ahc               468 dev/ic/aic7xxx_inline.h 		if ((ahc->features & AHC_AUTOPAUSE) == 0)
ahc               469 dev/ic/aic7xxx_inline.h 			ahc_pause(ahc);
ahc               470 dev/ic/aic7xxx_inline.h 		ahc_outb(ahc, KERNEL_QINPOS, ahc->qinfifonext);
ahc               471 dev/ic/aic7xxx_inline.h 		if ((ahc->features & AHC_AUTOPAUSE) == 0)
ahc               472 dev/ic/aic7xxx_inline.h 			ahc_unpause(ahc);
ahc               478 dev/ic/aic7xxx_inline.h ahc_get_sense_buf(struct ahc_softc *ahc, struct scb *scb)
ahc               482 dev/ic/aic7xxx_inline.h 	offset = scb - ahc->scb_data->scbarray;
ahc               483 dev/ic/aic7xxx_inline.h 	return (&ahc->scb_data->sense[offset]);
ahc               487 dev/ic/aic7xxx_inline.h ahc_get_sense_bufaddr(struct ahc_softc *ahc, struct scb *scb)
ahc               491 dev/ic/aic7xxx_inline.h 	offset = scb - ahc->scb_data->scbarray;
ahc               492 dev/ic/aic7xxx_inline.h 	return (ahc->scb_data->sense_busaddr
ahc               498 dev/ic/aic7xxx_inline.h IO_INLINE void	ahc_sync_qoutfifo(struct ahc_softc *ahc, int op);
ahc               499 dev/ic/aic7xxx_inline.h IO_INLINE void	ahc_sync_tqinfifo(struct ahc_softc *ahc, int op);
ahc               500 dev/ic/aic7xxx_inline.h IO_INLINE u_int	ahc_check_cmdcmpltqueues(struct ahc_softc *ahc);
ahc               501 dev/ic/aic7xxx_inline.h IO_INLINE int	ahc_intr(struct ahc_softc *ahc);
ahc               505 dev/ic/aic7xxx_inline.h ahc_sync_qoutfifo(struct ahc_softc *ahc, int op)
ahc               507 dev/ic/aic7xxx_inline.h 	ahc_dmamap_sync(ahc, ahc->parent_dmat, ahc->shared_data_dmamap,
ahc               512 dev/ic/aic7xxx_inline.h ahc_sync_tqinfifo(struct ahc_softc *ahc, int op)
ahc               515 dev/ic/aic7xxx_inline.h 	if ((ahc->flags & AHC_TARGETROLE) != 0) {
ahc               516 dev/ic/aic7xxx_inline.h 	  ahc_dmamap_sync(ahc, ahc->parent_dmat /*shared_data_dmat*/,
ahc               517 dev/ic/aic7xxx_inline.h 				ahc->shared_data_dmamap,
ahc               518 dev/ic/aic7xxx_inline.h 				ahc_targetcmd_offset(ahc, 0),
ahc               532 dev/ic/aic7xxx_inline.h ahc_check_cmdcmpltqueues(struct ahc_softc *ahc)
ahc               537 dev/ic/aic7xxx_inline.h 	ahc_dmamap_sync(ahc, ahc->parent_dmat /*shared_data_dmat*/, ahc->shared_data_dmamap,
ahc               538 dev/ic/aic7xxx_inline.h 			/*offset*/ahc->qoutfifonext, /*len*/1,
ahc               540 dev/ic/aic7xxx_inline.h 	if (ahc->qoutfifo[ahc->qoutfifonext] != SCB_LIST_NULL)
ahc               543 dev/ic/aic7xxx_inline.h 	if ((ahc->flags & AHC_TARGETROLE) != 0
ahc               544 dev/ic/aic7xxx_inline.h 	    && (ahc->flags & AHC_TQINFIFO_BLOCKED) == 0) {
ahc               545 dev/ic/aic7xxx_inline.h 	  ahc_dmamap_sync(ahc, ahc->parent_dmat /*shared_data_dmat*/,
ahc               546 dev/ic/aic7xxx_inline.h 			  ahc->shared_data_dmamap,
ahc               547 dev/ic/aic7xxx_inline.h 			  ahc_targetcmd_offset(ahc, ahc->tqinfifonext),
ahc               550 dev/ic/aic7xxx_inline.h 		if (ahc->targetcmds[ahc->tqinfifonext].cmd_valid != 0)
ahc               562 dev/ic/aic7xxx_inline.h ahc_intr(struct ahc_softc *ahc)
ahc               566 dev/ic/aic7xxx_inline.h 	if ((ahc->pause & INTEN) == 0) {
ahc               581 dev/ic/aic7xxx_inline.h 	if ((ahc->flags & (AHC_ALL_INTERRUPTS|AHC_EDGE_INTERRUPT)) == 0
ahc               582 dev/ic/aic7xxx_inline.h 	    && (ahc_check_cmdcmpltqueues(ahc) != 0))
ahc               585 dev/ic/aic7xxx_inline.h                 intstat = ahc_inb(ahc, INTSTAT);
ahc               589 dev/ic/aic7xxx_inline.h 		ahc_outb(ahc, CLRINT, CLRCMDINT);
ahc               599 dev/ic/aic7xxx_inline.h 		ahc_flush_device_writes(ahc);
ahc               600 dev/ic/aic7xxx_inline.h 		ahc_run_qoutfifo(ahc);
ahc               602 dev/ic/aic7xxx_inline.h 		if ((ahc->flags & AHC_TARGETROLE) != 0)
ahc               603 dev/ic/aic7xxx_inline.h 			ahc_run_tqinfifo(ahc, /*paused*/FALSE);
ahc               607 dev/ic/aic7xxx_inline.h 	if (intstat == 0xFF && (ahc->features & AHC_REMOVABLE) != 0)
ahc               613 dev/ic/aic7xxx_inline.h 		if (ahc->unsolicited_ints > 500) {
ahc               614 dev/ic/aic7xxx_inline.h 			ahc->unsolicited_ints = 0;
ahc               615 dev/ic/aic7xxx_inline.h 			if ((ahc->chip & AHC_PCI) != 0
ahc               616 dev/ic/aic7xxx_inline.h 			 && (ahc_inb(ahc, ERROR) & PCIERRSTAT) != 0)
ahc               617 dev/ic/aic7xxx_inline.h 				ahc->bus_intr(ahc);
ahc               619 dev/ic/aic7xxx_inline.h 		ahc->unsolicited_ints++;
ahc               623 dev/ic/aic7xxx_inline.h 	ahc->unsolicited_ints = 0;
ahc               626 dev/ic/aic7xxx_inline.h 		ahc_handle_brkadrint(ahc);
ahc               632 dev/ic/aic7xxx_inline.h 		ahc_pause_bug_fix(ahc);
ahc               635 dev/ic/aic7xxx_inline.h 		ahc_handle_seqint(ahc, intstat);
ahc               638 dev/ic/aic7xxx_inline.h 		ahc_handle_scsiint(ahc, intstat);
ahc                88 dev/ic/aic7xxx_openbsd.c ahc_attach(struct ahc_softc *ahc)
ahc                98 dev/ic/aic7xxx_openbsd.c 	ahc->sc_channel.adapter_target = ahc->our_id;
ahc                99 dev/ic/aic7xxx_openbsd.c 	if (ahc->features & AHC_WIDE)
ahc               100 dev/ic/aic7xxx_openbsd.c 		ahc->sc_channel.adapter_buswidth = 16;
ahc               101 dev/ic/aic7xxx_openbsd.c 	ahc->sc_channel.adapter_softc = ahc;
ahc               102 dev/ic/aic7xxx_openbsd.c 	ahc->sc_channel.adapter = &ahc_switch;
ahc               103 dev/ic/aic7xxx_openbsd.c 	ahc->sc_channel.openings = 16;
ahc               104 dev/ic/aic7xxx_openbsd.c 	ahc->sc_channel.device = &ahc_dev;
ahc               106 dev/ic/aic7xxx_openbsd.c 	if (ahc->features & AHC_TWIN) {
ahc               108 dev/ic/aic7xxx_openbsd.c 		ahc->sc_channel_b = ahc->sc_channel;
ahc               109 dev/ic/aic7xxx_openbsd.c 		ahc->sc_channel_b.adapter_target = ahc->our_id_b;
ahc               115 dev/ic/aic7xxx_openbsd.c 		ahc_controller_info(ahc, ahc_info, sizeof ahc_info);
ahc               116 dev/ic/aic7xxx_openbsd.c 		printf("%s: %s\n", ahc->sc_dev.dv_xname, ahc_info);
ahc               120 dev/ic/aic7xxx_openbsd.c 	ahc_intr_enable(ahc, TRUE);
ahc               122 dev/ic/aic7xxx_openbsd.c 	if (ahc->flags & AHC_RESET_BUS_A)
ahc               123 dev/ic/aic7xxx_openbsd.c 		ahc_reset_channel(ahc, 'A', TRUE);
ahc               124 dev/ic/aic7xxx_openbsd.c 	if ((ahc->features & AHC_TWIN) && ahc->flags & AHC_RESET_BUS_B)
ahc               125 dev/ic/aic7xxx_openbsd.c 		ahc_reset_channel(ahc, 'B', TRUE);
ahc               128 dev/ic/aic7xxx_openbsd.c 	if ((ahc->flags & AHC_PRIMARY_CHANNEL) == 0) {
ahc               129 dev/ic/aic7xxx_openbsd.c 		saa.saa_sc_link = &ahc->sc_channel;
ahc               130 dev/ic/aic7xxx_openbsd.c 		ahc->sc_child = config_found((void *)&ahc->sc_dev,
ahc               132 dev/ic/aic7xxx_openbsd.c 		if (ahc->features & AHC_TWIN) {
ahc               133 dev/ic/aic7xxx_openbsd.c 			saa.saa_sc_link = &ahc->sc_channel_b;
ahc               134 dev/ic/aic7xxx_openbsd.c 			ahc->sc_child_b = config_found((void *)&ahc->sc_dev,
ahc               138 dev/ic/aic7xxx_openbsd.c 		if (ahc->features & AHC_TWIN) {
ahc               139 dev/ic/aic7xxx_openbsd.c 			saa.saa_sc_link = &ahc->sc_channel_b;
ahc               140 dev/ic/aic7xxx_openbsd.c 			ahc->sc_child = config_found((void *)&ahc->sc_dev,
ahc               143 dev/ic/aic7xxx_openbsd.c 		saa.saa_sc_link = &ahc->sc_channel;
ahc               144 dev/ic/aic7xxx_openbsd.c 		ahc->sc_child_b = config_found((void *)&ahc->sc_dev,
ahc               158 dev/ic/aic7xxx_openbsd.c 	struct	ahc_softc *ahc = (struct ahc_softc *)arg;
ahc               160 dev/ic/aic7xxx_openbsd.c 	bus_dmamap_sync(ahc->parent_dmat, ahc->scb_data->hscb_dmamap,
ahc               161 dev/ic/aic7xxx_openbsd.c 	    0, ahc->scb_data->hscb_dmamap->dm_mapsize,
ahc               164 dev/ic/aic7xxx_openbsd.c 	return ahc_intr(ahc);
ahc               173 dev/ic/aic7xxx_openbsd.c ahc_done(struct ahc_softc *ahc, struct scb *scb)
ahc               178 dev/ic/aic7xxx_openbsd.c 	bus_dmamap_sync(ahc->parent_dmat, ahc->scb_data->hscb_dmamap,
ahc               179 dev/ic/aic7xxx_openbsd.c 	    0, ahc->scb_data->hscb_dmamap->dm_mapsize,
ahc               187 dev/ic/aic7xxx_openbsd.c 		target_offset = SCB_GET_TARGET_OFFSET(ahc, scb);
ahc               188 dev/ic/aic7xxx_openbsd.c 		untagged_q = &ahc->untagged_queues[target_offset];
ahc               191 dev/ic/aic7xxx_openbsd.c 		ahc_run_untagged_queue(ahc, untagged_q);
ahc               203 dev/ic/aic7xxx_openbsd.c 		bus_dmamap_sync(ahc->parent_dmat, scb->dmamap, 0,
ahc               205 dev/ic/aic7xxx_openbsd.c 		bus_dmamap_unload(ahc->parent_dmat, scb->dmamap);
ahc               277 dev/ic/aic7xxx_openbsd.c 		memcpy(&xs->sense, ahc_get_sense_buf(ahc, scb),
ahc               283 dev/ic/aic7xxx_openbsd.c 	ahc_free_scb(ahc, scb);
ahc               310 dev/ic/aic7xxx_openbsd.c 	struct ahc_softc *ahc;
ahc               319 dev/ic/aic7xxx_openbsd.c 	ahc = (struct ahc_softc *)xs->sc_link->adapter_softc;
ahc               325 dev/ic/aic7xxx_openbsd.c 	our_id = SCSI_SCSI_ID(ahc, xs->sc_link);
ahc               331 dev/ic/aic7xxx_openbsd.c 	if ((scb = ahc_get_scb(ahc)) == NULL) {
ahc               347 dev/ic/aic7xxx_openbsd.c 	hscb->scsiid = BUILD_SCSIID(ahc, xs->sc_link, target_id, our_id);
ahc               356 dev/ic/aic7xxx_openbsd.c 	return (ahc_setup_data(ahc, xs, scb));
ahc               364 dev/ic/aic7xxx_openbsd.c 	struct	ahc_softc *ahc;
ahc               375 dev/ic/aic7xxx_openbsd.c 	ahc = (struct ahc_softc *)xs->sc_link->adapter_softc;
ahc               410 dev/ic/aic7xxx_openbsd.c 		bus_dmamap_sync(ahc->parent_dmat, scb->dmamap, 0,
ahc               416 dev/ic/aic7xxx_openbsd.c 		bus_dmamap_sync(ahc->parent_dmat, scb->sg_map->sg_dmamap,
ahc               439 dev/ic/aic7xxx_openbsd.c 			bus_dmamap_unload(ahc->parent_dmat, scb->dmamap);
ahc               441 dev/ic/aic7xxx_openbsd.c 		ahc_free_scb(ahc, scb);
ahc               446 dev/ic/aic7xxx_openbsd.c 	tinfo = ahc_fetch_transinfo(ahc, SCSIID_CHANNEL(ahc, scb->hscb->scsiid),
ahc               448 dev/ic/aic7xxx_openbsd.c 				    SCSIID_TARGET(ahc, scb->hscb->scsiid),
ahc               451 dev/ic/aic7xxx_openbsd.c 	mask = SCB_GET_TARGET_MASK(ahc, scb);
ahc               469 dev/ic/aic7xxx_openbsd.c 	bus_dmamap_sync(ahc->parent_dmat, ahc->scb_data->hscb_dmamap,
ahc               470 dev/ic/aic7xxx_openbsd.c 	    0, ahc->scb_data->hscb_dmamap->dm_mapsize,
ahc               473 dev/ic/aic7xxx_openbsd.c 	LIST_INSERT_HEAD(&ahc->pending_scbs, scb, pending_links);
ahc               489 dev/ic/aic7xxx_openbsd.c 	    && (ahc->flags & AHC_SCB_BTT) == 0) {
ahc               493 dev/ic/aic7xxx_openbsd.c 		target_offset = SCB_GET_TARGET_OFFSET(ahc, scb);
ahc               494 dev/ic/aic7xxx_openbsd.c 		untagged_q = &(ahc->untagged_queues[target_offset]);
ahc               510 dev/ic/aic7xxx_openbsd.c 		ahc->scb_data->scbindex[scb->hscb->tag] = scb;
ahc               511 dev/ic/aic7xxx_openbsd.c 		ahc_pause(ahc);
ahc               512 dev/ic/aic7xxx_openbsd.c 		if ((ahc->flags & AHC_PAGESCBS) == 0)
ahc               513 dev/ic/aic7xxx_openbsd.c 			ahc_outb(ahc, SCBPTR, scb->hscb->tag);
ahc               514 dev/ic/aic7xxx_openbsd.c 		ahc_outb(ahc, TARG_IMMEDIATE_SCB, scb->hscb->tag);
ahc               515 dev/ic/aic7xxx_openbsd.c 		ahc_unpause(ahc);
ahc               517 dev/ic/aic7xxx_openbsd.c 		ahc_queue_scb(ahc, scb);
ahc               521 dev/ic/aic7xxx_openbsd.c 		if (ahc->inited_target[xs->sc_link->target] == 0) {
ahc               524 dev/ic/aic7xxx_openbsd.c 			ahc_adapter_req_set_xfer_mode(ahc, scb);
ahc               525 dev/ic/aic7xxx_openbsd.c 			ahc_scb_devinfo(ahc, &devinfo, scb);
ahc               526 dev/ic/aic7xxx_openbsd.c 			ahc_update_neg_request(ahc, &devinfo, tstate, tinfo,
ahc               529 dev/ic/aic7xxx_openbsd.c 			ahc->inited_target[xs->sc_link->target] = 1;
ahc               542 dev/ic/aic7xxx_openbsd.c 		if (ahc_poll(ahc, xs->timeout)) {
ahc               555 dev/ic/aic7xxx_openbsd.c ahc_poll(struct ahc_softc *ahc, int wait)
ahc               559 dev/ic/aic7xxx_openbsd.c 		if (ahc_inb(ahc, INTSTAT) & INT_PEND)
ahc               564 dev/ic/aic7xxx_openbsd.c 		printf("%s: board is not responding\n", ahc_name(ahc));
ahc               568 dev/ic/aic7xxx_openbsd.c 	ahc_intr((void *)ahc);
ahc               573 dev/ic/aic7xxx_openbsd.c ahc_setup_data(struct ahc_softc *ahc, struct scsi_xfer *xs,
ahc               586 dev/ic/aic7xxx_openbsd.c 		ahc_free_scb(ahc, scb);
ahc               605 dev/ic/aic7xxx_openbsd.c                 error = bus_dmamap_load(ahc->parent_dmat,
ahc               614 dev/ic/aic7xxx_openbsd.c 			       ahc_name(ahc), error);
ahc               617 dev/ic/aic7xxx_openbsd.c 			ahc_free_scb(ahc, scb);
ahc               634 dev/ic/aic7xxx_openbsd.c 	struct	ahc_softc *ahc;
ahc               640 dev/ic/aic7xxx_openbsd.c 	ahc = (struct ahc_softc *)scb->xs->sc_link->adapter_softc;
ahc               645 dev/ic/aic7xxx_openbsd.c 	printf("%s: SCB %d timed out\n", ahc_name(ahc), scb->hscb->tag);
ahc               646 dev/ic/aic7xxx_openbsd.c 	ahc_dump_card_state(ahc);
ahc               649 dev/ic/aic7xxx_openbsd.c 	ahc_pause(ahc);
ahc               652 dev/ic/aic7xxx_openbsd.c 		channel = SCB_GET_CHANNEL(ahc, scb);
ahc               659 dev/ic/aic7xxx_openbsd.c 		LIST_FOREACH(list_scb, &ahc->pending_scbs, pending_links) {
ahc               663 dev/ic/aic7xxx_openbsd.c 		found = ahc_reset_channel(ahc, channel, /*Initiate Reset*/TRUE);
ahc               666 dev/ic/aic7xxx_openbsd.c 		    ahc_name(ahc), channel, found);
ahc               670 dev/ic/aic7xxx_openbsd.c 	ahc_unpause(ahc);
ahc               676 dev/ic/aic7xxx_openbsd.c ahc_platform_set_tags(struct ahc_softc *ahc,
ahc               681 dev/ic/aic7xxx_openbsd.c 	ahc_fetch_transinfo(ahc, devinfo->channel, devinfo->our_scsiid,
ahc               698 dev/ic/aic7xxx_openbsd.c ahc_platform_alloc(struct ahc_softc *ahc, void *platform_arg)
ahc               701 dev/ic/aic7xxx_openbsd.c 		ahc->platform_data = malloc(sizeof(struct ahc_platform_data),
ahc               703 dev/ic/aic7xxx_openbsd.c 		if (ahc->platform_data == NULL)
ahc               705 dev/ic/aic7xxx_openbsd.c 		bzero(ahc->platform_data, sizeof(struct ahc_platform_data));
ahc               712 dev/ic/aic7xxx_openbsd.c ahc_platform_free(struct ahc_softc *ahc)
ahc               715 dev/ic/aic7xxx_openbsd.c 		free(ahc->platform_data, M_DEVBUF);
ahc               725 dev/ic/aic7xxx_openbsd.c ahc_send_async(struct ahc_softc *ahc, char channel, u_int target, u_int lun,
ahc               732 dev/ic/aic7xxx_openbsd.c ahc_adapter_req_set_xfer_mode(struct ahc_softc *ahc, struct scb *scb)
ahc               744 dev/ic/aic7xxx_openbsd.c 	ahc_scb_devinfo(ahc, &devinfo, scb);
ahc               746 dev/ic/aic7xxx_openbsd.c 	tinfo = ahc_fetch_transinfo(ahc, devinfo.channel,
ahc               749 dev/ic/aic7xxx_openbsd.c 	tstate->discenable |= (ahc->user_discenable & devinfo.target_mask);
ahc               753 dev/ic/aic7xxx_openbsd.c 	else if (ahc->user_tagenable & devinfo.target_mask)
ahc               761 dev/ic/aic7xxx_openbsd.c 	ahc_validate_width(ahc, NULL, &width, ROLE_UNKNOWN);
ahc               764 dev/ic/aic7xxx_openbsd.c 	ahc_set_width(ahc, &devinfo, width, AHC_TRANS_GOAL, FALSE);
ahc               784 dev/ic/aic7xxx_openbsd.c 	syncrate = ahc_find_syncrate(ahc, &period, &ppr_options,
ahc               786 dev/ic/aic7xxx_openbsd.c 	ahc_validate_offset(ahc, NULL, syncrate, &offset, width,
ahc               799 dev/ic/aic7xxx_openbsd.c 	ahc_set_syncrate(ahc, &devinfo, syncrate, period, offset, ppr_options,
ahc                90 dev/ic/aic7xxx_openbsd.h #define	SCSI_IS_SCSIBUS_B(ahc, sc_link)	\
ahc                91 dev/ic/aic7xxx_openbsd.h 	((sc_link)->scsibus == (ahc)->sc_channel_b.scsibus)
ahc                92 dev/ic/aic7xxx_openbsd.h #define	SCSI_SCSI_ID(ahc, sc_link)	\
ahc                93 dev/ic/aic7xxx_openbsd.h 	(SCSI_IS_SCSIBUS_B(ahc, sc_link) ? ahc->our_id_b : ahc->our_id)
ahc                94 dev/ic/aic7xxx_openbsd.h #define	SCSI_CHANNEL(ahc, sc_link)	\
ahc                95 dev/ic/aic7xxx_openbsd.h 	(SCSI_IS_SCSIBUS_B(ahc, sc_link) ? 'B' : 'A')
ahc                96 dev/ic/aic7xxx_openbsd.h #define BUILD_SCSIID(ahc, sc_link, target_id, our_id) \
ahc                98 dev/ic/aic7xxx_openbsd.h         | (SCSI_IS_SCSIBUS_B(ahc, sc_link) ? TWIN_CHNLB : 0))
ahc               109 dev/ic/aic7xxx_openbsd.h #define ahc_dmamap_sync(ahc, dma_tag, dmamap, offset, len, op)		\
ahc               179 dev/ic/aic7xxx_openbsd.h #define ahc_inb(ahc, port)				\
ahc               180 dev/ic/aic7xxx_openbsd.h 	bus_space_read_1((ahc)->tag, (ahc)->bsh, port)
ahc               182 dev/ic/aic7xxx_openbsd.h #define ahc_outb(ahc, port, value)			\
ahc               183 dev/ic/aic7xxx_openbsd.h 	bus_space_write_1((ahc)->tag, (ahc)->bsh, port, value)
ahc               185 dev/ic/aic7xxx_openbsd.h #define ahc_outsb(ahc, port, valp, count)		\
ahc               186 dev/ic/aic7xxx_openbsd.h 	bus_space_write_multi_1((ahc)->tag, (ahc)->bsh, port, valp, count)
ahc               188 dev/ic/aic7xxx_openbsd.h #define ahc_insb(ahc, port, valp, count)		\
ahc               189 dev/ic/aic7xxx_openbsd.h 	bus_space_read_multi_1((ahc)->tag, (ahc)->bsh, port, valp, count)
ahc               194 dev/ic/aic7xxx_openbsd.h ahc_flush_device_writes(struct ahc_softc *ahc)
ahc               197 dev/ic/aic7xxx_openbsd.h 	ahc_inb(ahc, INTSTAT);
ahc               293 dev/ic/aic7xxx_openbsd.h ahc_get_sense_bufsize(struct ahc_softc *ahc, struct scb *scb)
ahc               304 dev/ic/aic7xxx_openbsd.h ahc_platform_freeze_devq(struct ahc_softc *ahc, struct scb *scb)
ahc               309 dev/ic/aic7xxx_openbsd.h ahc_platform_abort_scbs(struct ahc_softc *ahc, int target,
ahc               317 dev/ic/aic7xxx_openbsd.h ahc_platform_scb_free(struct ahc_softc *ahc, struct scb *scb)
ahc               323 dev/ic/aic7xxx_openbsd.h 	if ((ahc->flags & AHC_RESOURCE_SHORTAGE) != 0) {
ahc               324 dev/ic/aic7xxx_openbsd.h 		ahc->flags &= ~AHC_RESOURCE_SHORTAGE;
ahc               393 dev/ic/aic7xxx_openbsd.h ahc_print_path(struct ahc_softc *ahc, struct scb *scb)
ahc               399 dev/ic/aic7xxx_openbsd.h ahc_platform_dump_card_state(struct ahc_softc *ahc)
ahc               403 dev/ic/aic7xxx_openbsd.h 	       ahc->features, ahc->flags, ahc->chip, ahc->bugs);
ahc               422 dev/ic/aic7xxx_openbsd.h ahc_platform_flushwork(struct ahc_softc *ahc)
ahc                98 dev/ic/aic7xxx_seeprom.c ahc_check_extport(struct ahc_softc *ahc, u_int *sxfrctl1)
ahc               105 dev/ic/aic7xxx_seeprom.c 	sd.sd_tag = ahc->tag;
ahc               106 dev/ic/aic7xxx_seeprom.c 	sd.sd_bsh = ahc->bsh;
ahc               111 dev/ic/aic7xxx_seeprom.c 	sc = ahc->seep_config;
ahc               119 dev/ic/aic7xxx_seeprom.c 	if (ahc->flags & AHC_LARGE_SEEPROM)
ahc               131 dev/ic/aic7xxx_seeprom.c 	have_seeprom = ahc_acquire_seeprom(ahc, &sd);
ahc               135 dev/ic/aic7xxx_seeprom.c 			printf("%s: Reading SEEPROM...", ahc_name(ahc));
ahc               140 dev/ic/aic7xxx_seeprom.c 			start_addr = 32 * (ahc->channel - 'A');
ahc               170 dev/ic/aic7xxx_seeprom.c 		ahc_outb(ahc, SCBPTR, 2);
ahc               171 dev/ic/aic7xxx_seeprom.c 		if (ahc_inb(ahc, SCB_BASE) == 'A'
ahc               172 dev/ic/aic7xxx_seeprom.c 		 && ahc_inb(ahc, SCB_BASE + 1) == 'D'
ahc               173 dev/ic/aic7xxx_seeprom.c 		 && ahc_inb(ahc, SCB_BASE + 2) == 'P'
ahc               174 dev/ic/aic7xxx_seeprom.c 		 && ahc_inb(ahc, SCB_BASE + 3) == 'T') {
ahc               183 dev/ic/aic7xxx_seeprom.c 				*sc_data = ahc_inb(ahc, SRAM_BASE + j)
ahc               184 dev/ic/aic7xxx_seeprom.c 					 | ahc_inb(ahc, SRAM_BASE + j + 1) << 8;
ahc               188 dev/ic/aic7xxx_seeprom.c 				ahc->flags |= AHC_SCB_CONFIG_USED;
ahc               194 dev/ic/aic7xxx_seeprom.c 		ahc_outb(ahc, CLRINT, CLRPARERR);
ahc               195 dev/ic/aic7xxx_seeprom.c 		ahc_outb(ahc, CLRINT, CLRBRKADRINT);
ahc               200 dev/ic/aic7xxx_seeprom.c 			printf("%s: No SEEPROM available.\n", ahc_name(ahc));
ahc               201 dev/ic/aic7xxx_seeprom.c 		ahc->flags |= AHC_USEDEFAULTS | AHC_NO_BIOS_INIT;
ahc               202 dev/ic/aic7xxx_seeprom.c 		free(ahc->seep_config, M_DEVBUF);
ahc               203 dev/ic/aic7xxx_seeprom.c 		ahc->seep_config = NULL;
ahc               206 dev/ic/aic7xxx_seeprom.c 		ahc_parse_pci_eeprom(ahc, sc);
ahc               222 dev/ic/aic7xxx_seeprom.c 	if ((ahc->features & AHC_SPIOCAP) != 0) {
ahc               223 dev/ic/aic7xxx_seeprom.c 		if ((ahc_inb(ahc, SPIOCAP) & SSPIOCPS) == 0)
ahc               228 dev/ic/aic7xxx_seeprom.c 		ahc_acquire_seeprom(ahc, &sd);
ahc               229 dev/ic/aic7xxx_seeprom.c 		configure_termination(ahc, &sd, sc->adapter_control, sxfrctl1);
ahc               237 dev/ic/aic7xxx_seeprom.c 			       ahc_name(ahc),
ahc               243 dev/ic/aic7xxx_seeprom.c ahc_parse_pci_eeprom(struct ahc_softc *ahc, struct seeprom_config *sc)
ahc               264 dev/ic/aic7xxx_seeprom.c 				ahc->flags |= AHC_NEWEEPROM_FMT;
ahc               277 dev/ic/aic7xxx_seeprom.c 		if ((ahc->flags & AHC_NEWEEPROM_FMT) != 0) {
ahc               289 dev/ic/aic7xxx_seeprom.c 		if ((ahc->features & AHC_ULTRA2) != 0) {
ahc               296 dev/ic/aic7xxx_seeprom.c 			ahc_outb(ahc, TARG_OFFSET + i, offset);
ahc               314 dev/ic/aic7xxx_seeprom.c 		ahc_outb(ahc, TARG_SCSIRATE + i, scsirate);
ahc               316 dev/ic/aic7xxx_seeprom.c 	ahc->our_id = sc->brtime_id & CFSCSIID;
ahc               318 dev/ic/aic7xxx_seeprom.c 	scsi_conf = (ahc->our_id & 0x7);
ahc               324 dev/ic/aic7xxx_seeprom.c 	ahc->flags |= (sc->adapter_control & CFBOOTCHAN) >> CFBOOTCHANSHIFT;
ahc               327 dev/ic/aic7xxx_seeprom.c 		ahc->flags |= AHC_EXTENDED_TRANS_A;
ahc               330 dev/ic/aic7xxx_seeprom.c 		ahc->flags |= AHC_BIOS_ENABLED;
ahc               331 dev/ic/aic7xxx_seeprom.c 	if (ahc->features & AHC_ULTRA
ahc               332 dev/ic/aic7xxx_seeprom.c 	    && (ahc->flags & AHC_NEWEEPROM_FMT) == 0) {
ahc               344 dev/ic/aic7xxx_seeprom.c 		devconfig = pci_conf_read(ahc->bd->pc, ahc->bd->tag, DEVCONFIG);
ahc               348 dev/ic/aic7xxx_seeprom.c 		pci_conf_write(ahc->bd->pc, ahc->bd->tag, DEVCONFIG,  devconfig);
ahc               351 dev/ic/aic7xxx_seeprom.c 	ahc_outb(ahc, SCSICONF, scsi_conf);
ahc               352 dev/ic/aic7xxx_seeprom.c 	ahc_outb(ahc, DISC_DSB, ~(discenable & 0xff));
ahc               353 dev/ic/aic7xxx_seeprom.c 	ahc_outb(ahc, DISC_DSB + 1, ~((discenable >> 8) & 0xff));
ahc               354 dev/ic/aic7xxx_seeprom.c 	ahc_outb(ahc, ULTRA_ENB, ultraenb & 0xff);
ahc               355 dev/ic/aic7xxx_seeprom.c 	ahc_outb(ahc, ULTRA_ENB + 1, (ultraenb >> 8) & 0xff);
ahc               359 dev/ic/aic7xxx_seeprom.c configure_termination(struct ahc_softc *ahc,
ahc               381 dev/ic/aic7xxx_seeprom.c 	 || (ahc->features & AHC_NEW_TERMCTL) != 0) {
ahc               396 dev/ic/aic7xxx_seeprom.c 		if ((ahc->features & AHC_NEW_TERMCTL) != 0) {
ahc               397 dev/ic/aic7xxx_seeprom.c 			ahc_new_term_detect(ahc, &enableSEC_low,
ahc               405 dev/ic/aic7xxx_seeprom.c 					       ahc_name(ahc));
ahc               413 dev/ic/aic7xxx_seeprom.c 					       ahc_name(ahc));
ahc               421 dev/ic/aic7xxx_seeprom.c 		} else if ((ahc->features & AHC_SPIOCAP) != 0) {
ahc               422 dev/ic/aic7xxx_seeprom.c 			aic785X_cable_detect(ahc, &internal50_present,
ahc               428 dev/ic/aic7xxx_seeprom.c 			aic787X_cable_detect(ahc, &internal50_present,
ahc               434 dev/ic/aic7xxx_seeprom.c 		if ((ahc->features & AHC_WIDE) == 0)
ahc               438 dev/ic/aic7xxx_seeprom.c 		 && (ahc->features & AHC_ULTRA2) == 0) {
ahc               440 dev/ic/aic7xxx_seeprom.c 			       ahc_name(ahc),
ahc               443 dev/ic/aic7xxx_seeprom.c 			if ((ahc->features & AHC_WIDE) != 0)
ahc               447 dev/ic/aic7xxx_seeprom.c 			       ahc_name(ahc),
ahc               452 dev/ic/aic7xxx_seeprom.c 			       ahc_name(ahc), eeprom_present ? "is" : "not");
ahc               454 dev/ic/aic7xxx_seeprom.c 		if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0) {
ahc               473 dev/ic/aic7xxx_seeprom.c 		if ((ahc->features & AHC_ULTRA2) == 0
ahc               480 dev/ic/aic7xxx_seeprom.c 			       "time!\n", ahc_name(ahc));
ahc               492 dev/ic/aic7xxx_seeprom.c 		if ((ahc->features & AHC_WIDE) != 0
ahc               498 dev/ic/aic7xxx_seeprom.c 				if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0)
ahc               500 dev/ic/aic7xxx_seeprom.c 					       "Enabled\n", ahc_name(ahc));
ahc               503 dev/ic/aic7xxx_seeprom.c 					       "Enabled\n", ahc_name(ahc),
ahc               512 dev/ic/aic7xxx_seeprom.c 			if ((ahc->features & AHC_ULTRA2) != 0)
ahc               517 dev/ic/aic7xxx_seeprom.c 				if ((ahc->flags & AHC_INT50_SPEEDFLEX) != 0)
ahc               519 dev/ic/aic7xxx_seeprom.c 					       "Enabled\n", ahc_name(ahc));
ahc               522 dev/ic/aic7xxx_seeprom.c 					       "Enabled\n", ahc_name(ahc),
ahc               532 dev/ic/aic7xxx_seeprom.c 				       "Enabled\n", ahc_name(ahc));
ahc               539 dev/ic/aic7xxx_seeprom.c 		ahc_outb(ahc, SXFRCTL1, *sxfrctl1);
ahc               546 dev/ic/aic7xxx_seeprom.c 				       ahc_name(ahc));
ahc               549 dev/ic/aic7xxx_seeprom.c 		write_brdctl(ahc, brddat);
ahc               557 dev/ic/aic7xxx_seeprom.c 				       ahc_name(ahc),
ahc               558 dev/ic/aic7xxx_seeprom.c 				       (ahc->features & AHC_ULTRA2) ? "Primary "
ahc               563 dev/ic/aic7xxx_seeprom.c 		 && (ahc->features & AHC_WIDE) != 0) {
ahc               567 dev/ic/aic7xxx_seeprom.c 				       ahc_name(ahc),
ahc               568 dev/ic/aic7xxx_seeprom.c 				       (ahc->features & AHC_ULTRA2)
ahc               576 dev/ic/aic7xxx_seeprom.c 		ahc_outb(ahc, SXFRCTL1, *sxfrctl1);
ahc               578 dev/ic/aic7xxx_seeprom.c 		if ((ahc->features & AHC_WIDE) != 0)
ahc               579 dev/ic/aic7xxx_seeprom.c 			write_brdctl(ahc, brddat);
ahc               585 dev/ic/aic7xxx_seeprom.c ahc_new_term_detect(struct ahc_softc *ahc, int *enableSEC_low,
ahc               598 dev/ic/aic7xxx_seeprom.c 	brdctl = read_brdctl(ahc);
ahc               607 dev/ic/aic7xxx_seeprom.c aic787X_cable_detect(struct ahc_softc *ahc, int *internal50_present,
ahc               620 dev/ic/aic7xxx_seeprom.c 	write_brdctl(ahc, 0);
ahc               627 dev/ic/aic7xxx_seeprom.c 	brdctl = read_brdctl(ahc);
ahc               635 dev/ic/aic7xxx_seeprom.c 	write_brdctl(ahc, BRDDAT5);
ahc               642 dev/ic/aic7xxx_seeprom.c 	brdctl = read_brdctl(ahc);
ahc               648 dev/ic/aic7xxx_seeprom.c aic785X_cable_detect(struct ahc_softc *ahc, int *internal50_present,
ahc               654 dev/ic/aic7xxx_seeprom.c 	spiocap = ahc_inb(ahc, SPIOCAP);
ahc               657 dev/ic/aic7xxx_seeprom.c 	ahc_outb(ahc, SPIOCAP, spiocap);
ahc               658 dev/ic/aic7xxx_seeprom.c 	ahc_outb(ahc, BRDCTL, BRDRW|BRDCS);
ahc               659 dev/ic/aic7xxx_seeprom.c 	ahc_outb(ahc, BRDCTL, 0);
ahc               660 dev/ic/aic7xxx_seeprom.c 	brdctl = ahc_inb(ahc, BRDCTL);
ahc               664 dev/ic/aic7xxx_seeprom.c 	*eeprom_present = (ahc_inb(ahc, SPIOCAP) & EEPROM) ? 1 : 0;
ahc               668 dev/ic/aic7xxx_seeprom.c ahc_acquire_seeprom(struct ahc_softc *ahc, struct seeprom_descriptor *sd)
ahc               672 dev/ic/aic7xxx_seeprom.c 	if ((ahc->features & AHC_SPIOCAP) != 0
ahc               673 dev/ic/aic7xxx_seeprom.c 	    && (ahc_inb(ahc, SPIOCAP) & SEEPROM) == 0)
ahc               703 dev/ic/aic7xxx_seeprom.c write_brdctl(struct ahc_softc *ahc, uint8_t value)
ahc               707 dev/ic/aic7xxx_seeprom.c 	if ((ahc->chip & AHC_CHIPID_MASK) == AHC_AIC7895) {
ahc               709 dev/ic/aic7xxx_seeprom.c 	 	if (ahc->channel == 'B')
ahc               711 dev/ic/aic7xxx_seeprom.c 	} else if ((ahc->features & AHC_ULTRA2) != 0) {
ahc               716 dev/ic/aic7xxx_seeprom.c 	ahc_outb(ahc, BRDCTL, brdctl);
ahc               717 dev/ic/aic7xxx_seeprom.c 	ahc_flush_device_writes(ahc);
ahc               719 dev/ic/aic7xxx_seeprom.c 	ahc_outb(ahc, BRDCTL, brdctl);
ahc               720 dev/ic/aic7xxx_seeprom.c 	ahc_flush_device_writes(ahc);
ahc               721 dev/ic/aic7xxx_seeprom.c 	if ((ahc->features & AHC_ULTRA2) != 0)
ahc               725 dev/ic/aic7xxx_seeprom.c 	ahc_outb(ahc, BRDCTL, brdctl);
ahc               726 dev/ic/aic7xxx_seeprom.c 	ahc_flush_device_writes(ahc);
ahc               727 dev/ic/aic7xxx_seeprom.c 	if ((ahc->features & AHC_ULTRA2) != 0)
ahc               731 dev/ic/aic7xxx_seeprom.c 	ahc_outb(ahc, BRDCTL, brdctl);
ahc               735 dev/ic/aic7xxx_seeprom.c read_brdctl(ahc)
ahc               736 dev/ic/aic7xxx_seeprom.c 	struct 	ahc_softc *ahc;
ahc               741 dev/ic/aic7xxx_seeprom.c 	if ((ahc->chip & AHC_CHIPID_MASK) == AHC_AIC7895) {
ahc               743 dev/ic/aic7xxx_seeprom.c 	 	if (ahc->channel == 'B')
ahc               745 dev/ic/aic7xxx_seeprom.c 	} else if ((ahc->features & AHC_ULTRA2) != 0) {
ahc               750 dev/ic/aic7xxx_seeprom.c 	ahc_outb(ahc, BRDCTL, brdctl);
ahc               751 dev/ic/aic7xxx_seeprom.c 	ahc_flush_device_writes(ahc);
ahc               752 dev/ic/aic7xxx_seeprom.c 	value = ahc_inb(ahc, BRDCTL);
ahc               753 dev/ic/aic7xxx_seeprom.c 	ahc_outb(ahc, BRDCTL, 0);
ahc                85 dev/ic/aic7xxxvar.h #define SCSIID_TARGET(ahc, scsiid) \
ahc                86 dev/ic/aic7xxxvar.h 	(((scsiid) & ((((ahc)->features & AHC_TWIN) != 0) ? TWIN_TID : TID)) \
ahc                90 dev/ic/aic7xxxvar.h #define SCSIID_CHANNEL(ahc, scsiid) \
ahc                91 dev/ic/aic7xxxvar.h 	((((ahc)->features & AHC_TWIN) != 0) \
ahc                94 dev/ic/aic7xxxvar.h #define	SCB_IS_SCSIBUS_B(ahc, scb) \
ahc                95 dev/ic/aic7xxxvar.h 	(SCSIID_CHANNEL(ahc, (scb)->hscb->scsiid) == 'B')
ahc                98 dev/ic/aic7xxxvar.h #define	SCB_GET_TARGET(ahc, scb) \
ahc                99 dev/ic/aic7xxxvar.h 	SCSIID_TARGET((ahc), (scb)->hscb->scsiid)
ahc               100 dev/ic/aic7xxxvar.h #define	SCB_GET_CHANNEL(ahc, scb) \
ahc               101 dev/ic/aic7xxxvar.h 	SCSIID_CHANNEL(ahc, (scb)->hscb->scsiid)
ahc               104 dev/ic/aic7xxxvar.h #define SCB_GET_TARGET_OFFSET(ahc, scb)	\
ahc               105 dev/ic/aic7xxxvar.h 	(SCB_GET_TARGET(ahc, scb))
ahc               106 dev/ic/aic7xxxvar.h #define SCB_GET_TARGET_MASK(ahc, scb) \
ahc               107 dev/ic/aic7xxxvar.h 	(0x01 << (SCB_GET_TARGET_OFFSET(ahc, scb)))
ahc              1214 dev/ic/aic7xxxvar.h void		ahc_run_untagged_queues(struct ahc_softc *ahc);
ahc              1215 dev/ic/aic7xxxvar.h void		ahc_run_untagged_queue(struct ahc_softc *ahc,
ahc              1217 dev/ic/aic7xxxvar.h void		ahc_qinfifo_requeue_tail(struct ahc_softc *ahc,
ahc              1219 dev/ic/aic7xxxvar.h int		ahc_match_scb(struct ahc_softc *ahc, struct scb *scb,
ahc              1228 dev/ic/aic7xxxvar.h int			 ahc_chip_init(struct ahc_softc *ahc);
ahc              1229 dev/ic/aic7xxxvar.h int			 ahc_init(struct ahc_softc *ahc);
ahc              1230 dev/ic/aic7xxxvar.h void			 ahc_intr_enable(struct ahc_softc *ahc, int enable);
ahc              1234 dev/ic/aic7xxxvar.h void			 ahc_alloc_scbs(struct ahc_softc *ahc);
ahc              1235 dev/ic/aic7xxxvar.h void			 ahc_free(struct ahc_softc *ahc);
ahc              1236 dev/ic/aic7xxxvar.h int			 ahc_reset(struct ahc_softc *ahc, int reinit);
ahc              1244 dev/ic/aic7xxxvar.h void			ahc_run_tqinfifo(struct ahc_softc *ahc, int paused);
ahc              1246 dev/ic/aic7xxxvar.h void			ahc_handle_brkadrint(struct ahc_softc *ahc);
ahc              1247 dev/ic/aic7xxxvar.h void			ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat);
ahc              1248 dev/ic/aic7xxxvar.h void			ahc_handle_scsiint(struct ahc_softc *ahc,
ahc              1250 dev/ic/aic7xxxvar.h void			ahc_clear_critical_section(struct ahc_softc *ahc);
ahc              1279 dev/ic/aic7xxxvar.h struct ahc_syncrate*	ahc_find_syncrate(struct ahc_softc *ahc, u_int *period,
ahc              1281 dev/ic/aic7xxxvar.h u_int			ahc_find_period(struct ahc_softc *ahc,
ahc              1283 dev/ic/aic7xxxvar.h void			ahc_validate_offset(struct ahc_softc *ahc,
ahc              1288 dev/ic/aic7xxxvar.h void			ahc_validate_width(struct ahc_softc *ahc,
ahc              1319 dev/ic/aic7xxxvar.h void			ahc_set_tags(struct ahc_softc *ahc,
ahc              1353 dev/ic/aic7xxxvar.h void			ahc_print_devinfo(struct ahc_softc *ahc,
ahc              1355 dev/ic/aic7xxxvar.h void			ahc_dump_card_state(struct ahc_softc *ahc);
ahc              1364 dev/ic/aic7xxxvar.h int		ahc_acquire_seeprom(struct ahc_softc *ahc,
ahc               892 dev/microcode/aic7xxx/aic7xxx_seq.h typedef int ahc_patch_func_t (struct ahc_softc *ahc);
ahc               896 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch23_func(struct ahc_softc *ahc)
ahc               898 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->bugs & AHC_SCBCHAN_UPLOAD_BUG) != 0);
ahc               904 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch22_func(struct ahc_softc *ahc)
ahc               906 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->features & AHC_CMD_CHAN) == 0);
ahc               912 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch21_func(struct ahc_softc *ahc)
ahc               914 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->features & AHC_QUEUE_REGS) == 0);
ahc               920 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch20_func(struct ahc_softc *ahc)
ahc               922 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->features & AHC_WIDE) != 0);
ahc               928 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch19_func(struct ahc_softc *ahc)
ahc               930 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->flags & AHC_SCB_BTT) != 0);
ahc               936 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch18_func(struct ahc_softc *ahc)
ahc               938 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->bugs & AHC_PCI_2_1_RETRY_BUG) != 0);
ahc               944 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch17_func(struct ahc_softc *ahc)
ahc               946 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->bugs & AHC_TMODE_WIDEODD_BUG) != 0);
ahc               952 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch16_func(struct ahc_softc *ahc)
ahc               954 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->bugs & AHC_AUTOFLUSH_BUG) != 0);
ahc               960 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch15_func(struct ahc_softc *ahc)
ahc               962 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->features & AHC_ULTRA2) == 0);
ahc               968 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch14_func(struct ahc_softc *ahc)
ahc               970 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->bugs & AHC_PCI_MWI_BUG) != 0 && ahc->pci_cachesize != 0);
ahc               976 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch13_func(struct ahc_softc *ahc)
ahc               978 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->flags & AHC_39BIT_ADDRESSING) != 0);
ahc               984 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch12_func(struct ahc_softc *ahc)
ahc               986 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->features & AHC_HS_MAILBOX) != 0);
ahc               992 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch11_func(struct ahc_softc *ahc)
ahc               994 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->features & AHC_ULTRA) != 0);
ahc              1000 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch10_func(struct ahc_softc *ahc)
ahc              1002 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->features & AHC_MULTI_TID) != 0);
ahc              1008 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch9_func(struct ahc_softc *ahc)
ahc              1010 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->features & AHC_CMD_CHAN) != 0);
ahc              1016 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch8_func(struct ahc_softc *ahc)
ahc              1018 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->flags & AHC_INITIATORROLE) != 0);
ahc              1024 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch7_func(struct ahc_softc *ahc)
ahc              1026 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->flags & AHC_TARGETROLE) != 0);
ahc              1032 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch6_func(struct ahc_softc *ahc)
ahc              1034 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->features & AHC_DT) == 0);
ahc              1040 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch5_func(struct ahc_softc *ahc)
ahc              1042 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->flags & AHC_SEQUENCER_DEBUG) != 0);
ahc              1048 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch4_func(struct ahc_softc *ahc)
ahc              1050 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->flags & AHC_PAGESCBS) != 0);
ahc              1056 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch3_func(struct ahc_softc *ahc)
ahc              1058 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->features & AHC_QUEUE_REGS) != 0);
ahc              1064 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch2_func(struct ahc_softc *ahc)
ahc              1066 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->features & AHC_TWIN) != 0);
ahc              1072 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch1_func(struct ahc_softc *ahc)
ahc              1074 dev/microcode/aic7xxx/aic7xxx_seq.h 	return ((ahc->features & AHC_ULTRA2) != 0);
ahc              1080 dev/microcode/aic7xxx/aic7xxx_seq.h ahc_patch0_func(struct ahc_softc *ahc)
ahc               639 dev/pci/ahc_pci.c static int ahc_ext_scbram_present(struct ahc_softc *ahc);
ahc               640 dev/pci/ahc_pci.c static void ahc_scbram_config(struct ahc_softc *ahc, int enable,
ahc               642 dev/pci/ahc_pci.c static void ahc_probe_ext_scbram(struct ahc_softc *ahc);
ahc               643 dev/pci/ahc_pci.c static int  ahc_pci_chip_init(struct ahc_softc *ahc);
ahc               707 dev/pci/ahc_pci.c 	struct		   ahc_softc *ahc = (void *)self;
ahc               735 dev/pci/ahc_pci.c 	LIST_INIT(&ahc->pending_scbs);
ahc               736 dev/pci/ahc_pci.c 	ahc->channel = 'A';
ahc               737 dev/pci/ahc_pci.c 	ahc->seqctl = FASTMODE;
ahc               739 dev/pci/ahc_pci.c 		TAILQ_INIT(&ahc->untagged_queues[i]);
ahc               745 dev/pci/ahc_pci.c 	ahc->sc_channel_b.scsibus = 0xff;
ahc               747 dev/pci/ahc_pci.c 	ahc->dev_softc = pa;
ahc               749 dev/pci/ahc_pci.c 	ahc_set_name(ahc, ahc->sc_dev.dv_xname);
ahc               750 dev/pci/ahc_pci.c 	ahc->parent_dmat = pa->pa_dmat;
ahc               760 dev/pci/ahc_pci.c 		printf("%s: unable to allocate bus-specific data\n", ahc_name(ahc));
ahc               771 dev/pci/ahc_pci.c 	ahc->bd = bd;
ahc               773 dev/pci/ahc_pci.c 	error = entry->setup(ahc);
ahc               797 dev/pci/ahc_pci.c 	       ahc_name(ahc), memt, (u_int32_t)memh, (u_int32_t)iot, ioh);
ahc               812 dev/pci/ahc_pci.c 	ahc->tag = st;
ahc               813 dev/pci/ahc_pci.c 	ahc->bsh = sh;
ahc               815 dev/pci/ahc_pci.c 	ahc->chip |= AHC_PCI;
ahc               822 dev/pci/ahc_pci.c 	ahc_intr_enable(ahc, FALSE);
ahc               838 dev/pci/ahc_pci.c 	if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) {
ahc               842 dev/pci/ahc_pci.c 			       ahc_name(ahc));
ahc               857 dev/pci/ahc_pci.c 	if ((ahc->flags & AHC_DISABLE_PCI_PERR) != 0) {
ahc               865 dev/pci/ahc_pci.c 	ahc->flags |= AHC_PAGESCBS;
ahc               866 dev/pci/ahc_pci.c 	error = ahc_softc_init(ahc);
ahc               870 dev/pci/ahc_pci.c 	ahc->bus_intr = ahc_pci_intr;
ahc               871 dev/pci/ahc_pci.c 	ahc->bus_chip_init = ahc_pci_chip_init;
ahc               874 dev/pci/ahc_pci.c 	if ((ahc_inb(ahc, HCNTRL) & POWRDN) == 0) {
ahc               875 dev/pci/ahc_pci.c 		ahc_pause(ahc);
ahc               876 dev/pci/ahc_pci.c 		if ((ahc->features & AHC_ULTRA2) != 0)
ahc               877 dev/pci/ahc_pci.c 			our_id = ahc_inb(ahc, SCSIID_ULTRA2) & OID;
ahc               879 dev/pci/ahc_pci.c 			our_id = ahc_inb(ahc, SCSIID) & OID;
ahc               880 dev/pci/ahc_pci.c 		sxfrctl1 = ahc_inb(ahc, SXFRCTL1) & STPWEN;
ahc               881 dev/pci/ahc_pci.c 		scsiseq = ahc_inb(ahc, SCSISEQ);
ahc               888 dev/pci/ahc_pci.c 	error = ahc_reset(ahc, /*reinit*/FALSE);
ahc               892 dev/pci/ahc_pci.c 	if ((ahc->features & AHC_DT) != 0) {
ahc               896 dev/pci/ahc_pci.c 		sfunct = ahc_inb(ahc, SFUNCT) & ~ALT_MODE;
ahc               897 dev/pci/ahc_pci.c 		ahc_outb(ahc, SFUNCT, sfunct | ALT_MODE);
ahc               898 dev/pci/ahc_pci.c 		ahc_outb(ahc, OPTIONMODE,
ahc               900 dev/pci/ahc_pci.c 		ahc_outb(ahc, SFUNCT, sfunct);
ahc               903 dev/pci/ahc_pci.c 		ahc_outb(ahc, CRCCONTROL1, CRCVALCHKEN|CRCENDCHKEN|CRCREQCHKEN
ahc               908 dev/pci/ahc_pci.c 		printf("%s: couldn't map interrupt\n", ahc_name(ahc));
ahc               909 dev/pci/ahc_pci.c 		ahc_free(ahc);
ahc               913 dev/pci/ahc_pci.c 	ahc->ih = pci_intr_establish(pa->pa_pc, ih, IPL_BIO,
ahc               914 dev/pci/ahc_pci.c 	    ahc_platform_intr, ahc, ahc->sc_dev.dv_xname);
ahc               915 dev/pci/ahc_pci.c 	if (ahc->ih == NULL) {
ahc               920 dev/pci/ahc_pci.c 		ahc_free(ahc);
ahc               925 dev/pci/ahc_pci.c 	dscommand0 = ahc_inb(ahc, DSCOMMAND0);
ahc               927 dev/pci/ahc_pci.c 	if ((ahc->features & AHC_ULTRA2) != 0) {
ahc               940 dev/pci/ahc_pci.c 	if ((ahc->bugs & AHC_CACHETHEN_DIS_BUG) != 0)
ahc               943 dev/pci/ahc_pci.c 	if ((ahc->bugs & AHC_CACHETHEN_BUG) != 0)
ahc               946 dev/pci/ahc_pci.c 	ahc_outb(ahc, DSCOMMAND0, dscommand0);
ahc               948 dev/pci/ahc_pci.c 	ahc->pci_cachesize =
ahc               950 dev/pci/ahc_pci.c 	ahc->pci_cachesize *= 4;
ahc               952 dev/pci/ahc_pci.c 	if ((ahc->bugs & AHC_PCI_2_1_RETRY_BUG) != 0
ahc               953 dev/pci/ahc_pci.c 	    && ahc->pci_cachesize == 4) {
ahc               955 dev/pci/ahc_pci.c 		ahc->pci_cachesize = 0;
ahc               962 dev/pci/ahc_pci.c 	if ((ahc->features & AHC_ULTRA) != 0) {
ahc               967 dev/pci/ahc_pci.c 			ahc->features &= ~AHC_ULTRA;
ahc               970 dev/pci/ahc_pci.c 	ahc->seep_config = malloc(sizeof(*ahc->seep_config),
ahc               972 dev/pci/ahc_pci.c 	if (ahc->seep_config == NULL)
ahc               975 dev/pci/ahc_pci.c 	memset(ahc->seep_config, 0, sizeof(*ahc->seep_config));
ahc               978 dev/pci/ahc_pci.c 	ahc_check_extport(ahc, &sxfrctl1);
ahc               983 dev/pci/ahc_pci.c 	sblkctl = ahc_inb(ahc, SBLKCTL);
ahc               984 dev/pci/ahc_pci.c 	ahc_outb(ahc, SBLKCTL, (sblkctl & ~(DIAGLEDEN|DIAGLEDON)));
ahc               986 dev/pci/ahc_pci.c 	if ((ahc->features & AHC_ULTRA2) != 0) {
ahc               987 dev/pci/ahc_pci.c 		ahc_outb(ahc, DFF_THRSH, RD_DFTHRSH_MAX|WR_DFTHRSH_MAX);
ahc               989 dev/pci/ahc_pci.c 		ahc_outb(ahc, DSPCISTATUS, DFTHRSH_100);
ahc               992 dev/pci/ahc_pci.c 	if (ahc->flags & AHC_USEDEFAULTS) {
ahc               999 dev/pci/ahc_pci.c 		if ((ahc->flags & AHC_NO_BIOS_INIT) == 0
ahc              1002 dev/pci/ahc_pci.c 				ahc_name(ahc));
ahc              1003 dev/pci/ahc_pci.c 			ahc->flags &= ~AHC_USEDEFAULTS;
ahc              1004 dev/pci/ahc_pci.c 			ahc->flags |= AHC_BIOS_ENABLED;
ahc              1013 dev/pci/ahc_pci.c 		ahc_outb(ahc, SCSICONF, our_id|ENSPCHK|RESET_SCSI);
ahc              1015 dev/pci/ahc_pci.c 		ahc->our_id = our_id;
ahc              1023 dev/pci/ahc_pci.c 	ahc_probe_ext_scbram(ahc);
ahc              1030 dev/pci/ahc_pci.c 		ahc->flags |= AHC_TERM_ENB_A;
ahc              1036 dev/pci/ahc_pci.c 	ahc->bus_softc.pci_softc.devconfig =
ahc              1038 dev/pci/ahc_pci.c 	ahc->bus_softc.pci_softc.command =
ahc              1040 dev/pci/ahc_pci.c 	ahc->bus_softc.pci_softc.csize_lattime =
ahc              1042 dev/pci/ahc_pci.c 	ahc->bus_softc.pci_softc.dscommand0 = ahc_inb(ahc, DSCOMMAND0);
ahc              1043 dev/pci/ahc_pci.c 	ahc->bus_softc.pci_softc.dspcistatus = ahc_inb(ahc, DSPCISTATUS);
ahc              1044 dev/pci/ahc_pci.c 	if ((ahc->features & AHC_DT) != 0) {
ahc              1047 dev/pci/ahc_pci.c 		sfunct = ahc_inb(ahc, SFUNCT) & ~ALT_MODE;
ahc              1048 dev/pci/ahc_pci.c 		ahc_outb(ahc, SFUNCT, sfunct | ALT_MODE);
ahc              1049 dev/pci/ahc_pci.c 		ahc->bus_softc.pci_softc.optionmode = ahc_inb(ahc, OPTIONMODE);
ahc              1050 dev/pci/ahc_pci.c 		ahc->bus_softc.pci_softc.targcrccnt = ahc_inw(ahc, TARGCRCCNT);
ahc              1051 dev/pci/ahc_pci.c 		ahc_outb(ahc, SFUNCT, sfunct);
ahc              1052 dev/pci/ahc_pci.c 		ahc->bus_softc.pci_softc.crccontrol1 =
ahc              1053 dev/pci/ahc_pci.c 		    ahc_inb(ahc, CRCCONTROL1);
ahc              1055 dev/pci/ahc_pci.c 	if ((ahc->features & AHC_MULTI_FUNC) != 0)
ahc              1056 dev/pci/ahc_pci.c 		ahc->bus_softc.pci_softc.scbbaddr = ahc_inb(ahc, SCBBADDR);
ahc              1058 dev/pci/ahc_pci.c 	if ((ahc->features & AHC_ULTRA2) != 0)
ahc              1059 dev/pci/ahc_pci.c 		ahc->bus_softc.pci_softc.dff_thrsh = ahc_inb(ahc, DFF_THRSH);
ahc              1062 dev/pci/ahc_pci.c 	if (ahc_init(ahc))
ahc              1065 dev/pci/ahc_pci.c 	ahc_attach(ahc);
ahc              1070 dev/pci/ahc_pci.c 	ahc_free(ahc);
ahc              1114 dev/pci/ahc_pci.c ahc_ext_scbram_present(struct ahc_softc *ahc)
ahc              1121 dev/pci/ahc_pci.c 	chip = ahc->chip & AHC_CHIPID_MASK;
ahc              1122 dev/pci/ahc_pci.c 	devconfig = pci_conf_read(ahc->bd->pc, ahc->bd->tag, DEVCONFIG);
ahc              1125 dev/pci/ahc_pci.c 	if ((ahc->features & AHC_ULTRA2) != 0)
ahc              1126 dev/pci/ahc_pci.c 		ramps = (ahc_inb(ahc, DSCOMMAND0) & RAMPS) != 0;
ahc              1149 dev/pci/ahc_pci.c ahc_scbram_config(struct ahc_softc *ahc, int enable, int pcheck,
ahc              1154 dev/pci/ahc_pci.c 	if (ahc->features & AHC_MULTI_FUNC) {
ahc              1159 dev/pci/ahc_pci.c 		ahc_outb(ahc, SCBBADDR, ahc->bd->func);
ahc              1162 dev/pci/ahc_pci.c 	ahc->flags &= ~AHC_LSCBS_ENABLED;
ahc              1164 dev/pci/ahc_pci.c 		ahc->flags |= AHC_LSCBS_ENABLED;
ahc              1165 dev/pci/ahc_pci.c 	devconfig = pci_conf_read(ahc->bd->pc, ahc->bd->tag, DEVCONFIG);
ahc              1166 dev/pci/ahc_pci.c 	if ((ahc->features & AHC_ULTRA2) != 0) {
ahc              1169 dev/pci/ahc_pci.c 		dscommand0 = ahc_inb(ahc, DSCOMMAND0);
ahc              1178 dev/pci/ahc_pci.c 		ahc_outb(ahc, DSCOMMAND0, dscommand0);
ahc              1198 dev/pci/ahc_pci.c 	pci_conf_write(ahc->bd->pc, ahc->bd->tag, DEVCONFIG, devconfig);
ahc              1207 dev/pci/ahc_pci.c ahc_probe_ext_scbram(struct ahc_softc *ahc)
ahc              1222 dev/pci/ahc_pci.c 	if (ahc_ext_scbram_present(ahc) == 0)
ahc              1228 dev/pci/ahc_pci.c 	ahc_scbram_config(ahc, /*enable*/TRUE, pcheck, fast, large);
ahc              1229 dev/pci/ahc_pci.c 	num_scbs = ahc_probe_scbs(ahc);
ahc              1241 dev/pci/ahc_pci.c 	ahc_outb(ahc, SEQCTL, 0);
ahc              1242 dev/pci/ahc_pci.c 	ahc_outb(ahc, CLRINT, CLRPARERR);
ahc              1243 dev/pci/ahc_pci.c 	ahc_outb(ahc, CLRINT, CLRBRKADRINT);
ahc              1246 dev/pci/ahc_pci.c 	ahc_scbram_config(ahc, enable, /*pcheck*/TRUE, fast, large);
ahc              1247 dev/pci/ahc_pci.c 	num_scbs = ahc_probe_scbs(ahc);
ahc              1248 dev/pci/ahc_pci.c 	if ((ahc_inb(ahc, INTSTAT) & BRKADRINT) == 0
ahc              1249 dev/pci/ahc_pci.c 	 || (ahc_inb(ahc, ERROR) & MPARERR) == 0)
ahc              1253 dev/pci/ahc_pci.c 	ahc_outb(ahc, CLRINT, CLRPARERR);
ahc              1254 dev/pci/ahc_pci.c 	ahc_outb(ahc, CLRINT, CLRBRKADRINT);
ahc              1257 dev/pci/ahc_pci.c 	ahc_scbram_config(ahc, enable, pcheck, /*fast*/TRUE, large);
ahc              1258 dev/pci/ahc_pci.c 	test_num_scbs = ahc_probe_scbs(ahc);
ahc              1260 dev/pci/ahc_pci.c 	 && ((ahc_inb(ahc, INTSTAT) & BRKADRINT) == 0
ahc              1261 dev/pci/ahc_pci.c 	  || (ahc_inb(ahc, ERROR) & MPARERR) == 0))
ahc              1268 dev/pci/ahc_pci.c 	if ((ahc->features & AHC_LARGE_SCBS) != 0) {
ahc              1269 dev/pci/ahc_pci.c 		ahc_scbram_config(ahc, enable, pcheck, fast, /*large*/TRUE);
ahc              1270 dev/pci/ahc_pci.c 		test_num_scbs = ahc_probe_scbs(ahc);
ahc              1281 dev/pci/ahc_pci.c 				ahc->flags |= AHC_SCB_BTT;
ahc              1290 dev/pci/ahc_pci.c 	ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS);
ahc              1292 dev/pci/ahc_pci.c 	ahc_outb(ahc, CLRINT, CLRPARERR);
ahc              1293 dev/pci/ahc_pci.c 	ahc_outb(ahc, CLRINT, CLRBRKADRINT);
ahc              1296 dev/pci/ahc_pci.c 		       ahc_name(ahc), fast ? "fast" : "slow", 
ahc              1300 dev/pci/ahc_pci.c 	ahc_scbram_config(ahc, enable, pcheck, fast, large);
ahc              1309 dev/pci/ahc_pci.c ahc_pci_test_register_access(struct ahc_softc *ahc)
ahc              1322 dev/pci/ahc_pci.c 	cmd = pci_conf_read(ahc->bd->pc, ahc->bd->tag, PCIR_COMMAND);
ahc              1323 dev/pci/ahc_pci.c 	pci_conf_write(ahc->bd->pc, ahc->bd->tag, PCIR_COMMAND,
ahc              1334 dev/pci/ahc_pci.c 	hcntrl = ahc_inb(ahc, HCNTRL);
ahc              1345 dev/pci/ahc_pci.c 	ahc_outb(ahc, HCNTRL, hcntrl|PAUSE);
ahc              1346 dev/pci/ahc_pci.c 	while (ahc_is_paused(ahc) == 0)
ahc              1348 dev/pci/ahc_pci.c 	ahc_outb(ahc, SEQCTL, PERRORDIS);
ahc              1349 dev/pci/ahc_pci.c 	ahc_outb(ahc, SCBPTR, 0);
ahc              1350 dev/pci/ahc_pci.c 	ahc_outl(ahc, SCB_BASE, 0x5aa555aa);
ahc              1351 dev/pci/ahc_pci.c 	if (ahc_inl(ahc, SCB_BASE) != 0x5aa555aa)
ahc              1354 dev/pci/ahc_pci.c 	status1 = pci_conf_read(ahc->bd->pc, ahc->bd->tag,
ahc              1363 dev/pci/ahc_pci.c 	status1 = pci_conf_read(ahc->bd->pc, ahc->bd->tag, PCI_COMMAND_STATUS_REG + 1);
ahc              1364 dev/pci/ahc_pci.c 	ahc_pci_write_config(ahc->dev_softc, PCIR_STATUS + 1,
ahc              1366 dev/pci/ahc_pci.c 	ahc_outb(ahc, CLRINT, CLRPARERR);
ahc              1367 dev/pci/ahc_pci.c 	ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS);
ahc              1368 dev/pci/ahc_pci.c 	ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, cmd, /*bytes*/2);
ahc              1374 dev/pci/ahc_pci.c ahc_pci_intr(struct ahc_softc *ahc)
ahc              1379 dev/pci/ahc_pci.c 	error = ahc_inb(ahc, ERROR);
ahc              1383 dev/pci/ahc_pci.c 	status1 = pci_conf_read(ahc->bd->pc, ahc->bd->tag, PCI_COMMAND_STATUS_REG);
ahc              1386 dev/pci/ahc_pci.c 	      ahc_name(ahc),
ahc              1387 dev/pci/ahc_pci.c 	      ahc_inb(ahc, SEQADDR0) | (ahc_inb(ahc, SEQADDR1) << 8));
ahc              1391 dev/pci/ahc_pci.c 		       "or write data phase\n", ahc_name(ahc));
ahc              1394 dev/pci/ahc_pci.c 		printf("%s: Signal System Error Detected\n", ahc_name(ahc));
ahc              1397 dev/pci/ahc_pci.c 		printf("%s: Received a Master Abort\n", ahc_name(ahc));
ahc              1400 dev/pci/ahc_pci.c 		printf("%s: Received a Target Abort\n", ahc_name(ahc));
ahc              1403 dev/pci/ahc_pci.c 		printf("%s: Signaled a Target Abort\n", ahc_name(ahc));
ahc              1407 dev/pci/ahc_pci.c 		       ahc_name(ahc));
ahc              1411 dev/pci/ahc_pci.c 	pci_conf_write(ahc->bd->pc, ahc->bd->tag,  PCI_COMMAND_STATUS_REG, status1);
ahc              1415 dev/pci/ahc_pci.c 		       "no status bits set\n", ahc_name(ahc)); 
ahc              1417 dev/pci/ahc_pci.c 		ahc_outb(ahc, CLRINT, CLRPARERR);
ahc              1420 dev/pci/ahc_pci.c 	ahc_unpause(ahc);
ahc              1424 dev/pci/ahc_pci.c ahc_pci_chip_init(struct ahc_softc *ahc)
ahc              1426 dev/pci/ahc_pci.c 	ahc_outb(ahc, DSCOMMAND0, ahc->bus_softc.pci_softc.dscommand0);
ahc              1427 dev/pci/ahc_pci.c 	ahc_outb(ahc, DSPCISTATUS, ahc->bus_softc.pci_softc.dspcistatus);
ahc              1428 dev/pci/ahc_pci.c 	if ((ahc->features & AHC_DT) != 0) {
ahc              1431 dev/pci/ahc_pci.c 		sfunct = ahc_inb(ahc, SFUNCT) & ~ALT_MODE;
ahc              1432 dev/pci/ahc_pci.c 		ahc_outb(ahc, SFUNCT, sfunct | ALT_MODE);
ahc              1433 dev/pci/ahc_pci.c 		ahc_outb(ahc, OPTIONMODE, ahc->bus_softc.pci_softc.optionmode);
ahc              1434 dev/pci/ahc_pci.c 		ahc_outw(ahc, TARGCRCCNT, ahc->bus_softc.pci_softc.targcrccnt);
ahc              1435 dev/pci/ahc_pci.c 		ahc_outb(ahc, SFUNCT, sfunct);
ahc              1436 dev/pci/ahc_pci.c 		ahc_outb(ahc, CRCCONTROL1,
ahc              1437 dev/pci/ahc_pci.c 			 ahc->bus_softc.pci_softc.crccontrol1);
ahc              1439 dev/pci/ahc_pci.c 	if ((ahc->features & AHC_MULTI_FUNC) != 0)
ahc              1440 dev/pci/ahc_pci.c 		ahc_outb(ahc, SCBBADDR, ahc->bus_softc.pci_softc.scbbaddr);
ahc              1442 dev/pci/ahc_pci.c 	if ((ahc->features & AHC_ULTRA2) != 0)
ahc              1443 dev/pci/ahc_pci.c 		ahc_outb(ahc, DFF_THRSH, ahc->bus_softc.pci_softc.dff_thrsh);
ahc              1445 dev/pci/ahc_pci.c 	return (ahc_chip_init(ahc));
ahc              1449 dev/pci/ahc_pci.c ahc_aic785X_setup(struct ahc_softc *ahc)
ahc              1453 dev/pci/ahc_pci.c 	ahc->channel = 'A';
ahc              1454 dev/pci/ahc_pci.c 	ahc->chip = AHC_AIC7850;
ahc              1455 dev/pci/ahc_pci.c 	ahc->features = AHC_AIC7850_FE;
ahc              1456 dev/pci/ahc_pci.c 	ahc->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG;
ahc              1457 dev/pci/ahc_pci.c 	rev = PCI_REVISION(ahc->bd->class);
ahc              1459 dev/pci/ahc_pci.c 		ahc->bugs |= AHC_PCI_2_1_RETRY_BUG;
ahc              1460 dev/pci/ahc_pci.c 	ahc->instruction_ram_size = 512;
ahc              1465 dev/pci/ahc_pci.c ahc_aic7860_setup(struct ahc_softc *ahc)
ahc              1469 dev/pci/ahc_pci.c 	ahc->channel = 'A';
ahc              1470 dev/pci/ahc_pci.c 	ahc->chip = AHC_AIC7860;
ahc              1471 dev/pci/ahc_pci.c 	ahc->features = AHC_AIC7860_FE;
ahc              1472 dev/pci/ahc_pci.c 	ahc->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG;
ahc              1473 dev/pci/ahc_pci.c 	rev = PCI_REVISION(ahc->bd->class);
ahc              1475 dev/pci/ahc_pci.c 		ahc->bugs |= AHC_PCI_2_1_RETRY_BUG;
ahc              1476 dev/pci/ahc_pci.c 	ahc->instruction_ram_size = 512;
ahc              1481 dev/pci/ahc_pci.c ahc_apa1480_setup(struct ahc_softc *ahc)
ahc              1485 dev/pci/ahc_pci.c 	error = ahc_aic7860_setup(ahc);
ahc              1488 dev/pci/ahc_pci.c 	ahc->features |= AHC_REMOVABLE;
ahc              1493 dev/pci/ahc_pci.c ahc_aic7870_setup(struct ahc_softc *ahc)
ahc              1496 dev/pci/ahc_pci.c 	ahc->channel = 'A';
ahc              1497 dev/pci/ahc_pci.c 	ahc->chip = AHC_AIC7870;
ahc              1498 dev/pci/ahc_pci.c 	ahc->features = AHC_AIC7870_FE;
ahc              1499 dev/pci/ahc_pci.c 	ahc->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG;
ahc              1500 dev/pci/ahc_pci.c 	ahc->instruction_ram_size = 512;
ahc              1505 dev/pci/ahc_pci.c ahc_aha394X_setup(struct ahc_softc *ahc)
ahc              1509 dev/pci/ahc_pci.c 	error = ahc_aic7870_setup(ahc);
ahc              1511 dev/pci/ahc_pci.c 		error = ahc_aha394XX_setup(ahc);
ahc              1516 dev/pci/ahc_pci.c ahc_aha398X_setup(struct ahc_softc *ahc)
ahc              1520 dev/pci/ahc_pci.c 	error = ahc_aic7870_setup(ahc);
ahc              1522 dev/pci/ahc_pci.c 		error = ahc_aha398XX_setup(ahc);
ahc              1527 dev/pci/ahc_pci.c ahc_aha494X_setup(struct ahc_softc *ahc)
ahc              1531 dev/pci/ahc_pci.c 	error = ahc_aic7870_setup(ahc);
ahc              1533 dev/pci/ahc_pci.c 		error = ahc_aha494XX_setup(ahc);
ahc              1538 dev/pci/ahc_pci.c ahc_aic7880_setup(struct ahc_softc *ahc)
ahc              1542 dev/pci/ahc_pci.c 	ahc->channel = 'A';
ahc              1543 dev/pci/ahc_pci.c 	ahc->chip = AHC_AIC7880;
ahc              1544 dev/pci/ahc_pci.c 	ahc->features = AHC_AIC7880_FE;
ahc              1545 dev/pci/ahc_pci.c 	ahc->bugs |= AHC_TMODE_WIDEODD_BUG;
ahc              1546 dev/pci/ahc_pci.c 	rev = PCI_REVISION(ahc->bd->class);
ahc              1548 dev/pci/ahc_pci.c 		ahc->bugs |= AHC_PCI_2_1_RETRY_BUG;
ahc              1550 dev/pci/ahc_pci.c 		ahc->bugs |= AHC_CACHETHEN_BUG|AHC_PCI_MWI_BUG;
ahc              1552 dev/pci/ahc_pci.c 	ahc->instruction_ram_size = 512;
ahc              1557 dev/pci/ahc_pci.c ahc_aha2940Pro_setup(struct ahc_softc *ahc)
ahc              1560 dev/pci/ahc_pci.c 	ahc->flags |= AHC_INT50_SPEEDFLEX;
ahc              1561 dev/pci/ahc_pci.c 	return (ahc_aic7880_setup(ahc));
ahc              1565 dev/pci/ahc_pci.c ahc_aha394XU_setup(struct ahc_softc *ahc)
ahc              1569 dev/pci/ahc_pci.c 	error = ahc_aic7880_setup(ahc);
ahc              1571 dev/pci/ahc_pci.c 		error = ahc_aha394XX_setup(ahc);
ahc              1576 dev/pci/ahc_pci.c ahc_aha398XU_setup(struct ahc_softc *ahc)
ahc              1580 dev/pci/ahc_pci.c 	error = ahc_aic7880_setup(ahc);
ahc              1582 dev/pci/ahc_pci.c 		error = ahc_aha398XX_setup(ahc);
ahc              1587 dev/pci/ahc_pci.c ahc_aic7890_setup(struct ahc_softc *ahc)
ahc              1591 dev/pci/ahc_pci.c 	ahc->channel = 'A';
ahc              1592 dev/pci/ahc_pci.c 	ahc->chip = AHC_AIC7890;
ahc              1593 dev/pci/ahc_pci.c 	ahc->features = AHC_AIC7890_FE;
ahc              1594 dev/pci/ahc_pci.c 	ahc->flags |= AHC_NEWEEPROM_FMT;
ahc              1595 dev/pci/ahc_pci.c 	rev = PCI_REVISION(ahc->bd->class);
ahc              1597 dev/pci/ahc_pci.c 		ahc->bugs |= AHC_AUTOFLUSH_BUG|AHC_CACHETHEN_BUG;
ahc              1598 dev/pci/ahc_pci.c 	ahc->instruction_ram_size = 768;
ahc              1603 dev/pci/ahc_pci.c ahc_aic7892_setup(struct ahc_softc *ahc)
ahc              1606 dev/pci/ahc_pci.c 	ahc->channel = 'A';
ahc              1607 dev/pci/ahc_pci.c 	ahc->chip = AHC_AIC7892;
ahc              1608 dev/pci/ahc_pci.c 	ahc->features = AHC_AIC7892_FE;
ahc              1609 dev/pci/ahc_pci.c 	ahc->flags |= AHC_NEWEEPROM_FMT;
ahc              1610 dev/pci/ahc_pci.c 	ahc->bugs |= AHC_SCBCHAN_UPLOAD_BUG;
ahc              1611 dev/pci/ahc_pci.c 	ahc->instruction_ram_size = 1024;
ahc              1616 dev/pci/ahc_pci.c ahc_aic7895_setup(struct ahc_softc *ahc)
ahc              1620 dev/pci/ahc_pci.c 	ahc->channel = (ahc->bd->func == 1) ? 'B' : 'A';
ahc              1624 dev/pci/ahc_pci.c 	rev = PCI_REVISION(ahc->bd->class);
ahc              1626 dev/pci/ahc_pci.c 		ahc->chip = AHC_AIC7895C;
ahc              1627 dev/pci/ahc_pci.c 		ahc->features = AHC_AIC7895C_FE;
ahc              1631 dev/pci/ahc_pci.c 		ahc->chip = AHC_AIC7895;
ahc              1632 dev/pci/ahc_pci.c 		ahc->features = AHC_AIC7895_FE;
ahc              1640 dev/pci/ahc_pci.c 		command = pci_conf_read(ahc->bd->pc, ahc->bd->tag, PCI_COMMAND_STATUS_REG);
ahc              1642 dev/pci/ahc_pci.c 		pci_conf_write(ahc->bd->pc, ahc->bd->tag, PCI_COMMAND_STATUS_REG, command);
ahc              1643 dev/pci/ahc_pci.c 		ahc->bugs |= AHC_PCI_MWI_BUG;
ahc              1649 dev/pci/ahc_pci.c 	ahc->bugs |= AHC_TMODE_WIDEODD_BUG|AHC_PCI_2_1_RETRY_BUG
ahc              1659 dev/pci/ahc_pci.c 	pci_conf_write(ahc->bd->pc, ahc->bd->tag, CSIZE_LATTIME, 0);
ahc              1660 dev/pci/ahc_pci.c 	devconfig = pci_conf_read(ahc->bd->pc, ahc->bd->tag, DEVCONFIG);
ahc              1662 dev/pci/ahc_pci.c 	pci_conf_write(ahc->bd->pc, ahc->bd->tag, DEVCONFIG, devconfig);
ahc              1664 dev/pci/ahc_pci.c 	ahc->flags |= AHC_NEWEEPROM_FMT;
ahc              1665 dev/pci/ahc_pci.c 	ahc->instruction_ram_size = 512;
ahc              1670 dev/pci/ahc_pci.c ahc_aic7896_setup(struct ahc_softc *ahc)
ahc              1672 dev/pci/ahc_pci.c 	ahc->channel = (ahc->bd->func == 1) ? 'B' : 'A';
ahc              1673 dev/pci/ahc_pci.c 	ahc->chip = AHC_AIC7896;
ahc              1674 dev/pci/ahc_pci.c 	ahc->features = AHC_AIC7896_FE;
ahc              1675 dev/pci/ahc_pci.c 	ahc->flags |= AHC_NEWEEPROM_FMT;
ahc              1676 dev/pci/ahc_pci.c 	ahc->bugs |= AHC_CACHETHEN_DIS_BUG;
ahc              1677 dev/pci/ahc_pci.c 	ahc->instruction_ram_size = 768;
ahc              1682 dev/pci/ahc_pci.c ahc_aic7899_setup(struct ahc_softc *ahc)
ahc              1684 dev/pci/ahc_pci.c 	ahc->channel = (ahc->bd->func == 1) ? 'B' : 'A';
ahc              1685 dev/pci/ahc_pci.c 	ahc->chip = AHC_AIC7899;
ahc              1686 dev/pci/ahc_pci.c 	ahc->features = AHC_AIC7899_FE;
ahc              1687 dev/pci/ahc_pci.c 	ahc->flags |= AHC_NEWEEPROM_FMT;
ahc              1688 dev/pci/ahc_pci.c 	ahc->bugs |= AHC_SCBCHAN_UPLOAD_BUG;
ahc              1689 dev/pci/ahc_pci.c 	ahc->instruction_ram_size = 1024;
ahc              1694 dev/pci/ahc_pci.c ahc_aha29160C_setup(struct ahc_softc *ahc)
ahc              1698 dev/pci/ahc_pci.c 	error = ahc_aic7899_setup(ahc);
ahc              1701 dev/pci/ahc_pci.c 	ahc->features |= AHC_REMOVABLE;
ahc              1706 dev/pci/ahc_pci.c ahc_raid_setup(struct ahc_softc *ahc)
ahc              1713 dev/pci/ahc_pci.c ahc_aha394XX_setup(struct ahc_softc *ahc)
ahc              1716 dev/pci/ahc_pci.c 	switch (ahc->bd->dev) {
ahc              1718 dev/pci/ahc_pci.c 		ahc->channel = 'A';
ahc              1721 dev/pci/ahc_pci.c 		ahc->channel = 'B';
ahc              1726 dev/pci/ahc_pci.c 		       ahc->bd->dev);
ahc              1727 dev/pci/ahc_pci.c 		ahc->channel = 'A';
ahc              1733 dev/pci/ahc_pci.c ahc_aha398XX_setup(struct ahc_softc *ahc)
ahc              1736 dev/pci/ahc_pci.c 	switch (ahc->bd->dev) {
ahc              1738 dev/pci/ahc_pci.c 		ahc->channel = 'A';
ahc              1741 dev/pci/ahc_pci.c 		ahc->channel = 'B';
ahc              1744 dev/pci/ahc_pci.c 		ahc->channel = 'C';
ahc              1749 dev/pci/ahc_pci.c 		       ahc->bd->dev);
ahc              1750 dev/pci/ahc_pci.c 		ahc->channel = 'A';
ahc              1753 dev/pci/ahc_pci.c 	ahc->flags |= AHC_LARGE_SEEPROM;
ahc              1758 dev/pci/ahc_pci.c ahc_aha494XX_setup(struct ahc_softc *ahc)
ahc              1761 dev/pci/ahc_pci.c 	switch (ahc->bd->dev) {
ahc              1763 dev/pci/ahc_pci.c 		ahc->channel = 'A';
ahc              1766 dev/pci/ahc_pci.c 		ahc->channel = 'B';
ahc              1769 dev/pci/ahc_pci.c 		ahc->channel = 'C';
ahc              1772 dev/pci/ahc_pci.c 		ahc->channel = 'D';
ahc              1777 dev/pci/ahc_pci.c 		       ahc->bd->dev);
ahc              1778 dev/pci/ahc_pci.c 		ahc->channel = 'A';
ahc              1780 dev/pci/ahc_pci.c 	ahc->flags |= AHC_LARGE_SEEPROM;