"mpt_interrupt: Invalid mf (%p) req_idx (%d)!\n", ioc->name, (void *)mf, req_idx); 
"mpt_interrupt: Invalid mf (%p)!\n", ioc->name, (void *)mf); 
mpt_interrupt(int irq, void *bus_id, struct pt_regs *r){	MPT_ADAPTER	*ioc;	MPT_FRAME_HDR	*mf;	MPT_FRAME_HDR	*mr;	u32		 pa;	int		 req_idx;	int		 cb_idx;	int		 type;	int		 freeme;	ioc = (MPT_ADAPTER *)bus_id;	/*	 *  Drain the reply FIFO!	 *	 * NOTES: I've seen up to 10 replies processed in this loop, so far...	 * Update: I've seen up to 9182 replies processed in this loop! ??	 * Update: Limit ourselves to processing max of N replies	 *	(bottom of loop).	 */	while (1) {		if ((pa = CHIPREG_READ32_dmasync(&ioc->chip->ReplyFifo)) == 0xFFFFFFFF)			return IRQ_HANDLED;		cb_idx = 0;		freeme = 0;		/*		 *  Check for non-TURBO reply!		 */		if (pa & MPI_ADDRESS_REPLY_A_BIT) {			u32 reply_dma_low;			u16 ioc_stat;			/* non-TURBO reply!  Hmmm, something may be up...			 *  Newest turbo reply mechanism; get address			 *  via left shift 1 (get rid of MPI_ADDRESS_REPLY_A_BIT)!			 */			/* Map DMA address of reply header to cpu address.			 * pa is 32 bits - but the dma address may be 32 or 64 bits			 * get offset based only only the low addresses			 */			reply_dma_low = (pa = (pa << 1));			mr = (MPT_FRAME_HDR *)((u8 *)ioc->reply_frames +					 (reply_dma_low - ioc->reply_frames_low_dma));			req_idx = le16_to_cpu(mr->u.frame.hwhdr.msgctxu.fld.req_idx);			cb_idx = mr->u.frame.hwhdr.msgctxu.fld.cb_idx;			mf = MPT_INDEX_2_MFPTR(ioc, req_idx);			dmfprintk((MYIOC_s_INFO_FMT "Got non-TURBO reply=%p req_idx=%x\n",					ioc->name, mr, req_idx));			DBG_DUMP_REPLY_FRAME(mr)			/*  Check/log IOC log info			 */			ioc_stat = le16_to_cpu(mr->u.reply.IOCStatus);			if (ioc_stat & MPI_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) {				u32	 log_info = le32_to_cpu(mr->u.reply.IOCLogInfo);				if (ioc->bus_type == FC)					mpt_fc_log_info(ioc, log_info);				else if (ioc->bus_type == SCSI)					mpt_sp_log_info(ioc, log_info);			}			if (ioc_stat & MPI_IOCSTATUS_MASK) {				if (ioc->bus_type == SCSI)					mpt_sp_ioc_info(ioc, (u32)ioc_stat, mf);			}		} else {			/*			 *  Process turbo (context) reply...			 */			dmfprintk((MYIOC_s_INFO_FMT "Got TURBO reply req_idx=%08x\n", ioc->name, pa));			type = (pa >> MPI_CONTEXT_REPLY_TYPE_SHIFT);			if (type == MPI_CONTEXT_REPLY_TYPE_SCSI_TARGET) {				cb_idx = mpt_stm_index;				mf = NULL;				mr = (MPT_FRAME_HDR *) CAST_U32_TO_PTR(pa);			} else if (type == MPI_CONTEXT_REPLY_TYPE_LAN) {				cb_idx = mpt_lan_index;				 /*  Blind set of mf to NULL here was fatal				 *  after lan_reply says "freeme"				 *  Fix sort of combined with an optimization here;				 *  added explicit check for case where lan_reply				 *  was just returning 1 and doing nothing else.				 *  For this case skip the callback, but set up				 *  proper mf value first here:-)				 */				if ((pa & 0x58000000) == 0x58000000) {					req_idx = pa & 0x0000FFFF;					mf = MPT_INDEX_2_MFPTR(ioc, req_idx);					freeme = 1;					/*					 *  IMPORTANT!  Invalidate the callback!					 */					cb_idx = 0;				} else {					mf = NULL;				}				mr = (MPT_FRAME_HDR *) CAST_U32_TO_PTR(pa);			} else {				req_idx = pa & 0x0000FFFF;				cb_idx = (pa & 0x00FF0000) >> 16;				mf = MPT_INDEX_2_MFPTR(ioc, req_idx);				mr = NULL;			}			pa = 0;					/* No reply flush! */		}#ifdef MPT_DEBUG_IRQ		if (ioc->bus_type == SCSI) {			/* Verify mf, mr are reasonable.			 */			if ((mf) && ((mf >= MPT_INDEX_2_MFPTR(ioc, ioc->req_depth))				|| (mf < ioc->req_frames)) ) {				printk(MYIOC_s_WARN_FMT					"mpt_interrupt: Invalid mf (%p) req_idx (%d)!\n", ioc->name, (void *)mf, req_idx);				cb_idx = 0;				pa = 0;				freeme = 0;			}			if ((pa) && (mr) && ((mr >= MPT_INDEX_2_RFPTR(ioc, ioc->req_depth))				|| (mr < ioc->reply_frames)) ) {				printk(MYIOC_s_WARN_FMT					"mpt_interrupt: Invalid rf (%p)!\n", ioc->name, (void *)mr);				cb_idx = 0;				pa = 0;				freeme = 0;			}			if (cb_idx > (MPT_MAX_PROTOCOL_DRIVERS-1)) {				printk(MYIOC_s_WARN_FMT					"mpt_interrupt: Invalid cb_idx (%d)!\n", ioc->name, cb_idx);				cb_idx = 0;				pa = 0;				freeme = 0;			}		}#endif		/*  Check for (valid) IO callback!  */		if (cb_idx) {			/*  Do the callback!  */			freeme = (*(MptCallbacks[cb_idx]))(ioc, mf, mr);		}		if (pa) {			/*  Flush (non-TURBO) reply with a WRITE!  */			CHIPREG_WRITE32(&ioc->chip->ReplyFifo, pa);		}		if (freeme) {			/*  Put Request back on FreeQ!  */			mpt_free_msg_frame(ioc, mf);		}		mb();	}	/* drain reply FIFO */	return IRQ_HANDLED;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/c6678e0cfb41b029c3600c54b5bb65954de1230a/mptbase.c/clean/drivers/message/fusion/mptbase.c