iocStatus = reply->u.reply.IOCStatus & MPI_IOCSTATUS_MASK; 
iocStatus = le16_to_cpu(reply->u.reply.IOCStatus) & MPI_IOCSTATUS_MASK; 
mptctl_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply){	char *sense_data;	int sz, req_index;	u16 iocStatus;	u8 cmd;	dctlprintk(("mptctl_reply()!\n"));	if (req)		 cmd = req->u.hdr.Function;	else		return 1;	if (ioc->ioctl) {		if (reply==NULL) {			dctlprintk(("mptctl_reply() NULL Reply "				"Function=%x!\n", cmd));			ioc->ioctl->status |= MPT_IOCTL_STATUS_COMMAND_GOOD;			ioc->ioctl->reset &= ~MPTCTL_RESET_OK;			/* We are done, issue wake up	 		*/			ioc->ioctl->wait_done = 1;			wake_up (&mptctl_wait);			return 1;		}		dctlprintk(("mptctl_reply() with req=%p "			"reply=%p Function=%x!\n", req, reply, cmd));		/* Copy the reply frame (which much exist		 * for non-SCSI I/O) to the IOC structure.		 */		dctlprintk(("Copying Reply Frame @%p to ioc%d!\n",			reply, ioc->id));		memcpy(ioc->ioctl->ReplyFrame, reply,			min(ioc->reply_sz, 4*reply->u.reply.MsgLength));		ioc->ioctl->status |= MPT_IOCTL_STATUS_RF_VALID;		/* Set the command status to GOOD if IOC Status is GOOD		 * OR if SCSI I/O cmd and data underrun or recovered error.		 */		iocStatus = reply->u.reply.IOCStatus & MPI_IOCSTATUS_MASK;		if (iocStatus  == MPI_IOCSTATUS_SUCCESS)			ioc->ioctl->status |= MPT_IOCTL_STATUS_COMMAND_GOOD;		if ((cmd == MPI_FUNCTION_SCSI_IO_REQUEST) ||			(cmd == MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH)) {			ioc->ioctl->reset &= ~MPTCTL_RESET_OK;			if ((iocStatus == MPI_IOCSTATUS_SCSI_DATA_UNDERRUN) ||			(iocStatus == MPI_IOCSTATUS_SCSI_RECOVERED_ERROR)) {			ioc->ioctl->status |= MPT_IOCTL_STATUS_COMMAND_GOOD;			}		}		/* Copy the sense data - if present		 */		if ((cmd == MPI_FUNCTION_SCSI_IO_REQUEST) &&			(reply->u.sreply.SCSIState &			 MPI_SCSI_STATE_AUTOSENSE_VALID)){			sz = req->u.scsireq.SenseBufferLength;			req_index =			    le16_to_cpu(req->u.frame.hwhdr.msgctxu.fld.req_idx);			sense_data =			    ((u8 *)ioc->sense_buf_pool +			     (req_index * MPT_SENSE_BUFFER_ALLOC));			memcpy(ioc->ioctl->sense, sense_data, sz);			ioc->ioctl->status |= MPT_IOCTL_STATUS_SENSE_VALID;		}		if (cmd == MPI_FUNCTION_SCSI_TASK_MGMT)			mptctl_free_tm_flags(ioc);		/* We are done, issue wake up		 */		ioc->ioctl->wait_done = 1;		wake_up (&mptctl_wait);	}	return 1;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/637fa99b86a00a0b5767a982b83a512ff48ad6d2/mptctl.c/buggy/drivers/message/fusion/mptctl.c