scmd->state = 0;  
mega_internal_command(adapter_t *adapter, lockscope_t ls, megacmd_t *mc,		mega_passthru *pthru ){	Scsi_Cmnd	*scmd;	struct	scsi_device *sdev;	unsigned long	flags = 0;	scb_t	*scb;	int	rval;	/*	 * The internal commands share one command id and hence are	 * serialized. This is so because we want to reserve maximum number of	 * available command ids for the I/O commands.	 */	down(&adapter->int_mtx);	scb = &adapter->int_scb;	memset(scb, 0, sizeof(scb_t));	scmd = &adapter->int_scmd;	memset(scmd, 0, sizeof(Scsi_Cmnd));	sdev = kmalloc(sizeof(struct scsi_device), GFP_KERNEL);	memset(sdev, 0, sizeof(struct scsi_device));	scmd->device = sdev;	scmd->device->host = adapter->host;	scmd->buffer = (void *)scb;	scmd->cmnd[0] = MEGA_INTERNAL_CMD;	scb->state |= SCB_ACTIVE;	scb->cmd = scmd;	memcpy(scb->raw_mbox, mc, sizeof(megacmd_t));	/*	 * Is it a passthru command	 */	if( mc->cmd == MEGA_MBOXCMD_PASSTHRU ) {		scb->pthru = pthru;	}	scb->idx = CMDID_INT_CMDS;	scmd->state = 0;	/*	 * Get the lock only if the caller has not acquired it already	 */	if( ls == LOCK_INT ) spin_lock_irqsave(&adapter->lock, flags);	megaraid_queue(scmd, mega_internal_done);	if( ls == LOCK_INT ) spin_unlock_irqrestore(&adapter->lock, flags);	/*	 * Wait till this command finishes. Do not use	 * wait_event_interruptible(). It causes panic if CTRL-C is hit when	 * dumping e.g., physical disk information through /proc interface.	 */#if 0	wait_event_interruptible(adapter->int_waitq, scmd->state);#endif	wait_event(adapter->int_waitq, scmd->state);	rval = scmd->result;	mc->status = scmd->result;	kfree(sdev);	/*	 * Print a debug message for all failed commands. Applications can use	 * this information.	 */	if( scmd->result && trace_level ) {		printk("megaraid: cmd [%x, %x, %x] status:[%x]\n",			mc->cmd, mc->opcode, mc->subopcode, scmd->result);	}	up(&adapter->int_mtx);	return rval;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/8d115f845a0bd59cd263e791f739964f42b7b0e8/megaraid.c/clean/drivers/scsi/megaraid.c