period = tinfo->goal.period; ppr_options = tinfo->goal.ppr_options;  if (devinfo->role == ROLE_TARGET) ppr_options = 0; rate = ahc_devlimited_syncrate(ahc, tinfo, &period, &ppr_options, devinfo->role); dowide = tinfo->curr.width != tinfo->goal.width; dosync = tinfo->curr.period != period; doppr = tinfo->curr.ppr_options != ppr_options;  if (!dowide && !dosync && !doppr) {
dowide = tinfo->current.width != tinfo->goal.width; dosync = tinfo->current.period != tinfo->goal.period;  if (!dowide && !dosync) {
ahc_build_transfer_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo){	/*	 * We need to initiate transfer negotiations.	 * If our current and goal settings are identical,	 * we want to renegotiate due to a check condition.	 */	struct	ahc_initiator_tinfo *tinfo;	struct	ahc_tmode_tstate *tstate;	struct	ahc_syncrate *rate;	int	dowide;	int	dosync;	int	doppr;	int	use_ppr;	u_int	period;	u_int	ppr_options;	u_int	offset;	tinfo = ahc_fetch_transinfo(ahc, devinfo->channel, devinfo->our_scsiid,				    devinfo->target, &tstate);	/*	 * Filter our period based on the current connection.	 * If we can't perform DT transfers on this segment (not in LVD	 * mode for instance), then our decision to issue a PPR message	 * may change.	 */	period = tinfo->goal.period;	ppr_options = tinfo->goal.ppr_options;	/* Target initiated PPR is not allowed in the SCSI spec */	if (devinfo->role == ROLE_TARGET)		ppr_options = 0;	rate = ahc_devlimited_syncrate(ahc, tinfo, &period,				       &ppr_options, devinfo->role);	dowide = tinfo->curr.width != tinfo->goal.width;	dosync = tinfo->curr.period != period;	doppr = tinfo->curr.ppr_options != ppr_options;	if (!dowide && !dosync && !doppr) {		dowide = tinfo->goal.width != MSG_EXT_WDTR_BUS_8_BIT;		dosync = tinfo->goal.period != 0;		doppr = tinfo->goal.ppr_options != 0;	}	if (!dowide && !dosync && !doppr) {		panic("ahc_intr: AWAITING_MSG for negotiation, "		      "but no negotiation needed\n");		}	use_ppr = (tinfo->curr.transport_version >= 3) || doppr;	/* Target initiated PPR is not allowed in the SCSI spec */	if (devinfo->role == ROLE_TARGET)		use_ppr = 0;	/*	 * Both the PPR message and SDTR message require the	 * goal syncrate to be limited to what the target device	 * is capable of handling (based on whether an LVD->SE	 * expander is on the bus), so combine these two cases.	 * Regardless, guarantee that if we are using WDTR and SDTR	 * messages that WDTR comes first.	 */	if (use_ppr || (dosync && !dowide)) {		offset = tinfo->goal.offset;		ahc_validate_offset(ahc, tinfo, rate, &offset,				    use_ppr ? tinfo->goal.width					    : tinfo->curr.width,				    devinfo->role);		if (use_ppr) {			ahc_construct_ppr(ahc, devinfo, period, offset,					  tinfo->goal.width, ppr_options);		} else {			ahc_construct_sdtr(ahc, devinfo, period, offset);		}	} else {		ahc_construct_wdtr(ahc, devinfo, tinfo->goal.width);	}}