dlog(ms, "bus0 was %.2x explictly asserting ATN", mr->bus_status0); 
dlog(ms, "bus0 was %.2x explicitly asserting ATN", mr->bus_status0); 
static void start_phase(struct mesh_state *ms){	int i, seq, nb;	volatile struct mesh_regs __iomem *mr = ms->mesh;	volatile struct dbdma_regs __iomem *md = ms->dma;	struct scsi_cmnd *cmd = ms->current_req;	struct mesh_target *tp = &ms->tgts[ms->conn_tgt];	dlog(ms, "start_phase nmo/exc/fc/seq = %.8x",	     MKWORD(ms->n_msgout, mr->exception, mr->fifo_count, mr->sequence));	out_8(&mr->interrupt, INT_ERROR | INT_EXCEPTION | INT_CMDDONE);	seq = use_active_neg + (ms->n_msgout? SEQ_ATN: 0);	switch (ms->msgphase) {	case msg_none:		break;	case msg_in:		out_8(&mr->count_hi, 0);		out_8(&mr->count_lo, 1);		out_8(&mr->sequence, SEQ_MSGIN + seq);		ms->n_msgin = 0;		return;	case msg_out:		/*		 * To make sure ATN drops before we assert ACK for		 * the last byte of the message, we have to do the		 * last byte specially.		 */		if (ms->n_msgout <= 0) {			printk(KERN_ERR "mesh: msg_out but n_msgout=%d\n",			       ms->n_msgout);			mesh_dump_regs(ms);			ms->msgphase = msg_none;			break;		}		if (ALLOW_DEBUG(ms->conn_tgt)) {			printk(KERN_DEBUG "mesh: sending %d msg bytes:",			       ms->n_msgout);			for (i = 0; i < ms->n_msgout; ++i)				printk(" %x", ms->msgout[i]);			printk("\n");		}		dlog(ms, "msgout msg=%.8x", MKWORD(ms->n_msgout, ms->msgout[0],						ms->msgout[1], ms->msgout[2]));		out_8(&mr->count_hi, 0);		out_8(&mr->sequence, SEQ_FLUSHFIFO);		mesh_flush_io(mr);		udelay(1);		/*		 * If ATN is not already asserted, we assert it, then		 * issue a SEQ_MSGOUT to get the mesh to drop ACK.		 */		if ((in_8(&mr->bus_status0) & BS0_ATN) == 0) {			dlog(ms, "bus0 was %.2x explictly asserting ATN", mr->bus_status0);			out_8(&mr->bus_status0, BS0_ATN); /* explicit ATN */			mesh_flush_io(mr);			udelay(1);			out_8(&mr->count_lo, 1);			out_8(&mr->sequence, SEQ_MSGOUT + seq);			out_8(&mr->bus_status0, 0); /* release explicit ATN */			dlog(ms,"hace: after explicit ATN bus0=%.2x",mr->bus_status0);		}		if (ms->n_msgout == 1) {			/*			 * We can't issue the SEQ_MSGOUT without ATN			 * until the target has asserted REQ.  The logic			 * in cmd_complete handles both situations:			 * REQ already asserted or not.			 */			cmd_complete(ms);		} else {			out_8(&mr->count_lo, ms->n_msgout - 1);			out_8(&mr->sequence, SEQ_MSGOUT + seq);			for (i = 0; i < ms->n_msgout - 1; ++i)				out_8(&mr->fifo, ms->msgout[i]);		}		return;	default:		printk(KERN_ERR "mesh bug: start_phase msgphase=%d\n",		       ms->msgphase);	}	switch (ms->phase) {	case selecting:		out_8(&mr->dest_id, ms->conn_tgt);		out_8(&mr->sequence, SEQ_SELECT + SEQ_ATN);		break;	case commanding:		out_8(&mr->sync_params, tp->sync_params);		out_8(&mr->count_hi, 0);		if (cmd) {			out_8(&mr->count_lo, cmd->cmd_len);			out_8(&mr->sequence, SEQ_COMMAND + seq);			for (i = 0; i < cmd->cmd_len; ++i)				out_8(&mr->fifo, cmd->cmnd[i]);		} else {			out_8(&mr->count_lo, 6);			out_8(&mr->sequence, SEQ_COMMAND + seq);			for (i = 0; i < 6; ++i)				out_8(&mr->fifo, 0);		}		break;	case dataing:		/* transfer data, if any */		if (!ms->dma_started) {			set_dma_cmds(ms, cmd);			out_le32(&md->cmdptr, virt_to_phys(ms->dma_cmds));			out_le32(&md->control, (RUN << 16) | RUN);			ms->dma_started = 1;		}		nb = ms->dma_count;		if (nb > 0xfff0)			nb = 0xfff0;		ms->dma_count -= nb;		ms->data_ptr += nb;		out_8(&mr->count_lo, nb);		out_8(&mr->count_hi, nb >> 8);		out_8(&mr->sequence, (tp->data_goes_out?				SEQ_DATAOUT: SEQ_DATAIN) + SEQ_DMA_MODE + seq);		break;	case statusing:		out_8(&mr->count_hi, 0);		out_8(&mr->count_lo, 1);		out_8(&mr->sequence, SEQ_STATUS + seq);		break;	case busfreeing:	case disconnecting:		out_8(&mr->sequence, SEQ_ENBRESEL);		mesh_flush_io(mr);		udelay(1);		dlog(ms, "enbresel intr/exc/err/fc=%.8x",		     MKWORD(mr->interrupt, mr->exception, mr->error,			    mr->fifo_count));		out_8(&mr->sequence, SEQ_BUSFREE);		break;	default:		printk(KERN_ERR "mesh: start_phase called with phase=%d\n",		       ms->phase);		dumpslog(ms);	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/33430dc593f866f5d67ff6a6213b6dd6d7ea3ce1/mesh.c/clean/drivers/scsi/mesh.c