if ((type & AHC_TRANS_USER) != 0) tinfo->user.width = width;  if ((type & AHC_TRANS_GOAL) != 0) tinfo->goal.width = width;  oldwidth = tinfo->curr.width;
old_period = tinfo->current.period; old_offset = tinfo->current.offset;  if ((type & AHC_TRANS_CUR) != 0 && (old_period != period || old_offset != offset)) { u_int	scsirate;  scsirate = tinfo->scsirate; if ((ahc->features & AHC_ULTRA2) != 0) {    scsirate &= ~(SXFR_ULTRA2|SINGLE_EDGE|ENABLE_CRC); if (syncrate != NULL) scsirate |= syncrate->sxfr_u2|SINGLE_EDGE;  if (active) ahc_outb(ahc, SCSIOFFSET, offset); } else {  scsirate &= ~(SXFR|SOFS);  tstate->ultraenb &= ~devinfo->target_mask; if (syncrate != NULL) { if (syncrate->sxfr & ULTRA_SXFR) { tstate->ultraenb |= devinfo->target_mask; } scsirate |= syncrate->sxfr & SXFR; scsirate |= offset & SOFS; } if (active) { u_int sxfrctl0;  sxfrctl0 = ahc_inb(ahc, SXFRCTL0); sxfrctl0 &= ~FAST20; if (tstate->ultraenb & devinfo->target_mask) sxfrctl0 |= FAST20; ahc_outb(ahc, SXFRCTL0, sxfrctl0); } } if (active) ahc_outb(ahc, SCSIRATE, scsirate);  tinfo->scsirate = scsirate; tinfo->current.period = period; tinfo->current.offset = offset;   ahc_update_pending_syncrates(ahc); }   if (done) { if (offset != 0) { printf("%s: target %d synchronous at %sMHz, " "offset = 0x%x\n", ahc_name(ahc), devinfo->target, syncrate->rate, offset); } else { printf("%s: target %d using " "asynchronous transfers\n", ahc_name(ahc), devinfo->target); } }  if ((type & AHC_TRANS_GOAL) != 0) { tinfo->goal.period = period; tinfo->goal.offset = offset; }  if ((type & AHC_TRANS_USER) != 0) { tinfo->user.period = period; tinfo->user.offset = offset; }  ahc_update_target_msg_request(ahc, devinfo, tinfo, FALSE, paused); }  STATIC void ahc_set_width(ahc, devinfo, width, type, paused, done) struct ahc_softc *ahc; struct ahc_devinfo *devinfo; u_int width; u_int type; int paused; int done; { struct ahc_initiator_tinfo *tinfo; struct tmode_tstate *tstate; u_int  oldwidth; int    active = (type & AHC_TRANS_ACTIVE) == AHC_TRANS_ACTIVE;  tinfo = ahc_fetch_transinfo(ahc, devinfo->channel, devinfo->our_scsiid, devinfo->target, &tstate); oldwidth = tinfo->current.width;
ahc_set_width(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,	      u_int width, u_int type, int paused){	struct	ahc_initiator_tinfo *tinfo;	struct	ahc_tmode_tstate *tstate;	u_int	oldwidth;	int	active;	int	update_needed;	active = (type & AHC_TRANS_ACTIVE) == AHC_TRANS_ACTIVE;	update_needed = 0;	tinfo = ahc_fetch_transinfo(ahc, devinfo->channel, devinfo->our_scsiid,				    devinfo->target, &tstate);	if ((type & AHC_TRANS_USER) != 0)		tinfo->user.width = width;	if ((type & AHC_TRANS_GOAL) != 0)		tinfo->goal.width = width;	oldwidth = tinfo->curr.width;	if ((type & AHC_TRANS_CUR) != 0 && oldwidth != width) {		u_int	scsirate;		update_needed++;		scsirate =  tinfo->scsirate;		scsirate &= ~WIDEXFER;		if (width == MSG_EXT_WDTR_BUS_16_BIT)			scsirate |= WIDEXFER;		tinfo->scsirate = scsirate;		if (active)			ahc_outb(ahc, SCSIRATE, scsirate);		tinfo->curr.width = width;		ahc_send_async(ahc, devinfo->channel, devinfo->target,			       CAM_LUN_WILDCARD, AC_TRANSFER_NEG, NULL);		if (bootverbose) {			printf("%s: target %d using %dbit transfers\n",			       ahc_name(ahc), devinfo->target,			       8 * (0x01 << width));		}	}	update_needed += ahc_update_neg_request(ahc, devinfo, tstate,						tinfo, /*force*/FALSE);	if (update_needed)		ahc_update_pending_scbs(ahc);}