struct scsi_target *starget = tp->sdev->sdev_target; 
struct scsi_target *starget = tp->starget; 
static int sym_prepare_nego(struct sym_hcb *np, struct sym_ccb *cp, u_char *msgptr){	struct sym_tcb *tp = &np->target[cp->target];	struct scsi_target *starget = tp->sdev->sdev_target;	struct sym_trans *goal = &tp->tgoal;	int msglen = 0;	int nego;	sym_check_goals(np, starget, goal);	/*	 * Many devices implement PPR in a buggy way, so only use it if we	 * really want to.	 */	if (goal->iu || goal->dt || goal->qas || (goal->period < 0xa)) {		nego = NS_PPR;	} else if (spi_width(starget) != goal->width) {		nego = NS_WIDE;	} else if (spi_period(starget) != goal->period ||		   spi_offset(starget) != goal->offset) {		nego = NS_SYNC;	} else {		goal->check_nego = 0;		nego = 0;	}	switch (nego) {	case NS_SYNC:		msgptr[msglen++] = M_EXTENDED;		msgptr[msglen++] = 3;		msgptr[msglen++] = M_X_SYNC_REQ;		msgptr[msglen++] = goal->period;		msgptr[msglen++] = goal->offset;		break;	case NS_WIDE:		msgptr[msglen++] = M_EXTENDED;		msgptr[msglen++] = 2;		msgptr[msglen++] = M_X_WIDE_REQ;		msgptr[msglen++] = goal->width;		break;	case NS_PPR:		msgptr[msglen++] = M_EXTENDED;		msgptr[msglen++] = 6;		msgptr[msglen++] = M_X_PPR_REQ;		msgptr[msglen++] = goal->period;		msgptr[msglen++] = 0;		msgptr[msglen++] = goal->offset;		msgptr[msglen++] = goal->width;		msgptr[msglen++] = (goal->iu ? PPR_OPT_IU : 0) |					(goal->dt ? PPR_OPT_DT : 0) |					(goal->qas ? PPR_OPT_QAS : 0);		break;	}	cp->nego_status = nego;	if (nego) {		tp->nego_cp = cp; /* Keep track a nego will be performed */		if (DEBUG_FLAGS & DEBUG_NEGO) {			sym_print_nego_msg(np, cp->target, 					  nego == NS_SYNC ? "sync msgout" :					  nego == NS_WIDE ? "wide msgout" :					  "ppr msgout", msgptr);		}	}	return msglen;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/53222b906903fd861dc24ebccfa07ee125941313/sym_hipd.c/clean/drivers/scsi/sym53c8xx_2/sym_hipd.c