printf("Disconnected List inconsistency. " "SCB index == %d, yet numscbs == %d.", scb_index, ahc->scb_data->numscbs); ahc_dump_card_state(ahc); panic("for safety"); }  if (next == prev) { panic("Disconnected List Loop. " "cur SCBPTR == %x, prev SCBPTR == %x.", next, prev); } scbp = ahc_lookup_scb(ahc, scb_index); if (ahc_match_scb(ahc, scbp, target, channel, lun,
panic("Disconnected List inconsistency. " "SCB index == %d, yet numscbs == %d.", scb_index, ahc->scb_data->numscbs); } scbp = &ahc->scb_data->scbarray[scb_index]; if (ahc_match_scb(scbp, target, channel, lun,
ahc_search_disc_list(struct ahc_softc *ahc, int target, char channel,		     int lun, u_int tag, int stop_on_first, int remove,		     int save_state){	struct	scb *scbp;	u_int	next;	u_int	prev;	u_int	count;	u_int	active_scb;	count = 0;	next = ahc_inb(ahc, DISCONNECTED_SCBH);	prev = SCB_LIST_NULL;	if (save_state) {		/* restore this when we're done */		active_scb = ahc_inb(ahc, SCBPTR);	} else		/* Silence compiler */		active_scb = SCB_LIST_NULL;	while (next != SCB_LIST_NULL) {		u_int scb_index;		ahc_outb(ahc, SCBPTR, next);		scb_index = ahc_inb(ahc, SCB_TAG);		if (scb_index >= ahc->scb_data->numscbs) {			printf("Disconnected List inconsistency. "			       "SCB index == %d, yet numscbs == %d.",			       scb_index, ahc->scb_data->numscbs);			ahc_dump_card_state(ahc);			panic("for safety");		}		if (next == prev) {			panic("Disconnected List Loop. "			      "cur SCBPTR == %x, prev SCBPTR == %x.",			      next, prev);		}		scbp = ahc_lookup_scb(ahc, scb_index);		if (ahc_match_scb(ahc, scbp, target, channel, lun,				  tag, ROLE_INITIATOR)) {			count++;			if (remove) {				next =				    ahc_rem_scb_from_disc_list(ahc, prev, next);			} else {				prev = next;				next = ahc_inb(ahc, SCB_NEXT);			}			if (stop_on_first)				break;		} else {			prev = next;			next = ahc_inb(ahc, SCB_NEXT);		}	}	if (save_state)		ahc_outb(ahc, SCBPTR, active_scb);	return (count);}