cp->phys.smsg.addr	= cpu_to_scr(CCB_BA(cp, scsi_smsg)); 
cp->phys.smsg.addr	= CCB_BA(cp, scsi_smsg); 
int sym_queue_scsiio(struct sym_hcb *np, struct scsi_cmnd *cmd, struct sym_ccb *cp){	struct scsi_device *sdev = cmd->device;	struct sym_tcb *tp;	struct sym_lcb *lp;	u_char	*msgptr;	u_int   msglen;	int can_disconnect;	/*	 *  Keep track of the IO in our CCB.	 */	cp->cmd = cmd;	/*	 *  Retrieve the target descriptor.	 */	tp = &np->target[cp->target];	/*	 *  Retrieve the lun descriptor.	 */	lp = sym_lp(tp, sdev->lun);	can_disconnect = (cp->tag != NO_TAG) ||		(lp && (lp->curr_flags & SYM_DISC_ENABLED));	msgptr = cp->scsi_smsg;	msglen = 0;	msgptr[msglen++] = IDENTIFY(can_disconnect, sdev->lun);	/*	 *  Build the tag message if present.	 */	if (cp->tag != NO_TAG) {		u_char order = cp->order;		switch(order) {		case M_ORDERED_TAG:			break;		case M_HEAD_TAG:			break;		default:			order = M_SIMPLE_TAG;		}#ifdef SYM_OPT_LIMIT_COMMAND_REORDERING		/*		 *  Avoid too much reordering of SCSI commands.		 *  The algorithm tries to prevent completion of any 		 *  tagged command from being delayed against more 		 *  than 3 times the max number of queued commands.		 */		if (lp && lp->tags_since > 3*SYM_CONF_MAX_TAG) {			lp->tags_si = !(lp->tags_si);			if (lp->tags_sum[lp->tags_si]) {				order = M_ORDERED_TAG;				if ((DEBUG_FLAGS & DEBUG_TAGS)||sym_verbose>1) {					sym_print_addr(cmd,						"ordered tag forced.\n");				}			}			lp->tags_since = 0;		}#endif		msgptr[msglen++] = order;		/*		 *  For less than 128 tags, actual tags are numbered 		 *  1,3,5,..2*MAXTAGS+1,since we may have to deal 		 *  with devices that have problems with #TAG 0 or too 		 *  great #TAG numbers. For more tags (up to 256), 		 *  we use directly our tag number.		 */#if SYM_CONF_MAX_TASK > (512/4)		msgptr[msglen++] = cp->tag;#else		msgptr[msglen++] = (cp->tag << 1) + 1;#endif	}	/*	 *  Build a negotiation message if needed.	 *  (nego_status is filled by sym_prepare_nego())	 */	cp->nego_status = 0;	if (tp->tgoal.check_nego && !tp->nego_cp && lp) {		msglen += sym_prepare_nego(np, cp, msgptr + msglen);	}	/*	 *  Startqueue	 */	cp->phys.head.go.start   = cpu_to_scr(SCRIPTA_BA(np, select));	cp->phys.head.go.restart = cpu_to_scr(SCRIPTA_BA(np, resel_dsa));	/*	 *  select	 */	cp->phys.select.sel_id		= cp->target;	cp->phys.select.sel_scntl3	= tp->head.wval;	cp->phys.select.sel_sxfer	= tp->head.sval;	cp->phys.select.sel_scntl4	= tp->head.uval;	/*	 *  message	 */	cp->phys.smsg.addr	= cpu_to_scr(CCB_BA(cp, scsi_smsg));	cp->phys.smsg.size	= cpu_to_scr(msglen);	/*	 *  status	 */	cp->host_xflags		= 0;	cp->host_status		= cp->nego_status ? HS_NEGOTIATE : HS_BUSY;	cp->ssss_status		= S_ILLEGAL;	cp->xerr_status		= 0;	cp->host_flags		= 0;	cp->extra_bytes		= 0;	/*	 *  extreme data pointer.	 *  shall be positive, so -1 is lower than lowest.:)	 */	cp->ext_sg  = -1;	cp->ext_ofs = 0;	/*	 *  Build the CDB and DATA descriptor block 	 *  and start the IO.	 */	return sym_setup_data_and_start(np, cmd, cp);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/53222b906903fd861dc24ebccfa07ee125941313/sym_hipd.c/buggy/drivers/scsi/sym53c8xx_2/sym_hipd.c