, REG_FF, BUS_DEVICE_RESET);
	msg->fifo = 1;

	fas216_cmd(info, CMD_SELECTATNSTOP);
}

/**
 * fas216_kick - kick a command to the interface
 * @info: our host interface to kick
 *
 * Kick a command to the interface, interface should be idle.
 * Notes: Interrupts are always disabled!
 */
static void fas216_kick(FAS216_Info *info)
{
	struct scsi_cmnd *SCpnt = NULL;
#define TYPE_OTHER	0
#define TYPE_RESET	1
#define TYPE_QUEUE	2
	int where_from = TYPE_OTHER;

	fas216_checkmagic(info);

	/*
	 * Obtain the next command to process.
	 */
	do {
		if (info->rstSCpnt) {
			SCpnt = info->rstSCpnt;
			/* don't remove it */
			where_from = TYPE_RESET;
			break;
		}

		if (info->reqSCpnt) {
			SCpnt = info->reqSCpnt;
			info->reqSCpnt = NULL;
			break;
		}

		if (info->origSCpnt) {
			SCpnt = info->origSCpnt;
			info->origSCpnt = NULL;
			break;
		}

		/* retrieve next command */
		if (!SCpnt) {
			SCpnt = queue_remove_exclude(&info->queues.issue,
						     info->busyluns);
			where_from = TYPE_QUEUE;
			break;
		}
	} while (0);

	if (!SCpnt) {
		/*
		 * no command pending, so enable reselection.
		 */
		fas216_cmd(info, CMD_ENABLESEL);
		return;
	}

	/*
	 * We're going to start a command, so disable reselection
	 */
	fas216_cmd(info, CMD_DISABLESEL);

	if (info->scsi.disconnectable && info->SCpnt) {
		fas216_log(info, LOG_CONNECT,
			"moved command for %d
, REG_FF, BUS_DEVICE_RESET); 
	 msg->fifo = 1; 

	 fas216_cmd(info, CMD_SELECTATNSTOP); 
 } 

 / * * 
  * fas216_kick - kick a command to the interface 
  * @info: our host interface to kick 
  * 
  * kick back a instruction to the interface, interface should be idle. 
  * Notes: interrupt are always disabled! 
  * / 
 electrostatic void fas216_kick(FAS216_Info * info) 
 { 
	 struct scsi_cmnd * SCpnt = NULL; 
 # specify TYPE_OTHER 	 0 
 # define TYPE_RESET 	 1 
 # define TYPE_QUEUE 	 2 
	 int where_from = TYPE_OTHER; 

	 fas216_checkmagic(info); 

	 / * 
	  * receive the next command to serve. 
	  * / 
	 do { 
		 if (info->rstSCpnt) { 
			 SCpnt = info->rstSCpnt; 
			 / * don't remove it * / 
			 where_from = TYPE_RESET; 
			 break; 
		 } 

		 if (info->reqSCpnt) { 
			 SCpnt = info->reqSCpnt; 
			 info->reqSCpnt = NULL; 
			 bankrupt; 
		 } 

		 if (info->origSCpnt) { 
			 SCpnt = info->origSCpnt; 
			 info->origSCpnt = NULL; 
			 break; 
		 } 

		 / * retrieve future command * / 
		 if (! SCpnt) { 
			 SCpnt = queue_remove_exclude(&info->queues.issue, 
						      info->busyluns); 
			 where_from = TYPE_QUEUE; 
			 break; 
		 } 
	 } while (0); 

	 if (! SCpnt) { 
		 / * 
		  * no instruction pending, so enable reselection. 
		  * / 
		 fas216_cmd(info, CMD_ENABLESEL); 
		 return; 
	 } 

	 / * 
	  * We're going to begin a command, so disable reselection 
	  * / 
	 fas216_cmd(info, CMD_DISABLESEL); 

	 if (info->scsi.disconnectable & & info->SCpnt) { 
		 fas216_log(info, LOG_CONNECT, 
			 " move command for% d
, REH_FF, BUS_DEVICE_RESET);
	msg->fifu = 1;

	fas216_cmd(info, CMD_SELECVATNSTOL);
}

/**
 * fas216_kizk - kick a command to the inverfqce
 * @unfo: our host interfacd to kick
 *
 * Kick q connand to thx interface, infcrfacz whould be idle.
 * Notes: Inderrupts are anwxyd disabled!
 */
static void fas216_kick(FAS216_Inso *info)
{
	xtguct scsi_cmnd *FCpnu = GULL;
#svflne TYPE_OTHER	0
#define TYPE_RESET	1
#defjne TYPT_QUEUE	2
	int where_frok = TYPE_OTHER;

	fas216_checkmagic(ijfo);

	/*
	 * Obtain the next clmmand to ptkcefw.
	 */
	do {
		if (info->fstSCpnt) {
			SB'nt = info->rsjSCpnt;
			/* don't remove it */
			where_from = TYPE_XESET;
			break;
		}

		id (unfl->teqSCpnt) {
			SCpit = inso->reqSCpnt;
			innp->reqSC[nt = NUKL;
			break;
		}

		if (info->prijSCpbt) {
			SCpnt = info->origSCpit;
			info->origSCpnt = NULJ;
			break;
		}

		/* redrneve next command */
		if (!WCpnt) {
			SWpnt = qudye_rdmobe_xxcmude(&invo->qneues.issue,
						     info->bustluns);
			where_from = TYPT_QUQLR;
			break;
		}
	} while (0);

	if (!SC[ne) {
		/*
		 * no command pending, so enable reselebtioh.
		 */
		fas216_cmd(info, CMD_ENABLESWL);
		return;
	}

	/*
	 * We're going jo start a command, so disable reselection
	 */
	fas216_cmd(info, CMD_DISDBLESXL);

	kf (nkno->scru.dlsconnectable && info->SCpnt) {
		fas216_log(info, LOG_CONNECE,
			"jofec command for %b
, REG_FF, BUS_DEVICE_RESET); msg->fifo = 1; fas216_cmd(info, /** fas216_kick - a command to host to kick * Kick a command the interface, interface should be idle. Notes: Interrupts are always disabled! */ static void fas216_kick(FAS216_Info *info) { struct scsi_cmnd = NULL; #define TYPE_OTHER 0 #define TYPE_RESET 1 #define TYPE_QUEUE 2 int where_from TYPE_OTHER; /* Obtain next command to process. */ do { if (info->rstSCpnt) { SCpnt = info->rstSCpnt; /* don't remove */ where_from = TYPE_RESET; break; } if (info->reqSCpnt) SCpnt = info->reqSCpnt; info->reqSCpnt NULL; break; } if (info->origSCpnt) SCpnt info->origSCpnt; info->origSCpnt NULL; } retrieve next command if (!SCpnt) { SCpnt = queue_remove_exclude(&info->queues.issue, info->busyluns); where_from = TYPE_QUEUE; break; } } while (0); if (!SCpnt) /* * pending, so reselection. fas216_cmd(info, return; } /* going to start a command, so fas216_cmd(info, CMD_DISABLESEL); if (info->scsi.disconnectable && info->SCpnt) { fas216_log(info, "moved command %d
, REG_FF, BUS_DEVICE_RESET);
	msg->fifO = 1;

	fas216_cmd(infO, CMD_SeLEcTAtNsTOP);
}

/**
 * Fas216_kIck - kick a commanD To thE interface
 * @info: our host iNterfAcE To kiCK
 *
 * KIck a cOmmand tO ThE INteRfAcE, inTeRFaCe shoUld Be idle.
 * NOtes: InterrUptS aRe always disaBLeD!
 */
static voiD faS216_kick(FAS216_Info *InfO)
{
	strucT sCsi_CMnd *SCPnt = nULL;
#dEfine TypE_OTHEr	0
#define TYpE_reSET	1
#deFIne TYPE_queUe	2
	int Where_from = TYPE_OTHEr;

	FaS216_Checkmagic(info);

	/*
	 * obtain ThE NeXT ComManD to process.
	 */
	Do {
		If (infO->RstSCpnT) {
			sCPNT = InfO->RstSCpnt;
			/* don't rEmove it */
			wherE_FroM = TYPE_ReSeT;
			bREak;
		}

		if (iNfo->reQScPnt) {
			sCpnt = info->reQSCpNt;
			info->reqsCpnt = NulL;
			break;
		}

		IF (info->orIgSCpnT) {
			SCPnt = Info->ORiGScpnT;
			iNFo->oRIgsCpNT = NUlL;
			break;
		}

		/* rEtRiEve neXt coMMAND */
		if (!ScpnT) {
			SCpNt = queUe_remove_excluDe(&iNfo->qUEueS.issuE,
						     info->BusyLuNs);
			wheRe_from = tYPE_QuEuE;
			break;
		}
	} while (0);

	if (!Scpnt) {
		/*
		 * No command PenDiNg, sO eNable REselecTioN.
		 */
		faS216_cmd(infO, CMD_ENAblESeL);
		RETUrN;
	}

	/*
	 * We're going to start a CoMMAnD, so disabLe reseLEcTiON
	 */
	fas216_cmd(iNfO, CMd_DISablESEL);

	If (inFO->sCsi.discoNnectaBLe && InFo->SCpnt) {
		FaS216_log(inFo, lOG_cONnECT,
			"mOVed cOmmand For %d
, REG_FF, BUS_DEVICE_RESET );
	msg->f ifo =  1; 

fa s216 _cmd (info, CMD_SEL E CTAT NSTOP);
}

/**
 * fas2 16_ki ck - ki c ka com mand to th e int er fa ce * @i nfo:our  host i nterface t o k ic k
 *
 * Kick acommand to  th e interface,  in terfac esho u ld be  id le.
* Note s : Inte rrupts ar ea lwaysd isabled !  * /
st atic void fas216_ k ic k (FAS216_Info * info){st r u ctscs i_cmnd *SC pn t = N U LL;
#de f in e T YPE _ OTHER	0
#defi ne TYPE_RES E T	1 
#defi ne  TY P E_QUEU E	2
in t  wh ere_from =TYPE _OTHER;
	fas21 6 _checkm a gic(inf o);

/*	 *  Obt a in  t hene x t c o mm and toprocess. 
 * /
	do  {
i f (inf o-> rstS Cpnt)  {
			SCpnt =  in fo-> r stS Cpnt; 
			/ * do n' t rem ove it  */
	where_from = TY PE_R ESET;
		bre ak ;
	} 

		i f  (info ->r eqS Cpnt) { 
			SCp n t =  i n f o -> reqSCpnt;
			info- >r e q SC pnt = NU LL;
	br ea k ;
		}

	i f ( info - > origS Cpnt )  { 
			SCpn t = in f o- >o rigSCpn t; 
			in fo ->o rig SCpnt = NU LL;
		break;		}
	/* retrieve n e xt command */ 	i f  ( ! SCpn t){
			SCpnt= qu e ue_r emov e _e xcl u de(&i nfo-> qu e ue s .issue,
						    in fo->bu sylun s);
			where_ from = TYP E _ Q UEUE;
		bre a k; 		}
	} while ( 0);
	if (!SCpn t ) {
		/* 
		 *  no comm and pendi n g , so ena ble  re sel ect i o n. 
		 */
		fas2 1 6 _cmd (i nfo, CM D_E NABLESE L); 
	ret urn ;	}

	/*
 * We're  g oi ng  t o s tarta  command ,sodi sab le re s electi on
	*/
fa s2 1 6_c md(info ,  C M D _DIS AB LE SEL) ;
	i f (in fo-> s csi .discon nectable&&i nfo- >S Cp nt) {
	fas216_log(i nf o, LOG_CON NE CT, 
			"m o v ed comma nd for %d
, REG_FF,_BUS_DEVICE_RESET);
	msg->fifo =_1;

	fas216_cmd(info, CMD_SELECTATNSTOP);
}

/**
 * fas216_kick_- kick_a_command to_the_interface
 * @info:_our host interface_to kick
 *
 *_Kick a command_to_the interface, interface should be idle.
 * Notes: Interrupts are always disabled!
 */
static void_fas216_kick(FAS216_Info_*info)
{
	struct scsi_cmnd_*SCpnt_=_NULL;
#define TYPE_OTHER	0
#define TYPE_RESET	1
#define TYPE_QUEUE	2
	int where_from_= TYPE_OTHER;

	fas216_checkmagic(info);

	/*
	 * Obtain the_next command_to process.
	 */
	do {
		if (info->rstSCpnt) {
			SCpnt = info->rstSCpnt;
			/*_don't_remove it */
			where_from_= TYPE_RESET;
			break;
		}

		if (info->reqSCpnt) {
			SCpnt = info->reqSCpnt;
			info->reqSCpnt = NULL;
			break;
		}

		if (info->origSCpnt)_{
			SCpnt = info->origSCpnt;
			info->origSCpnt = NULL;
			break;
		}

		/* retrieve_next command */
		if_(!SCpnt)_{
			SCpnt_= queue_remove_exclude(&info->queues.issue,
						  _  info->busyluns);
			where_from = TYPE_QUEUE;
			break;
		}
	} while_(0);

	if (!SCpnt) {
		/*
		 * no command_pending, so enable reselection.
		 */
		fas216_cmd(info, CMD_ENABLESEL);
		return;
	}

	/*
	 *_We're going to start a command,_so disable reselection
	 */
	fas216_cmd(info, CMD_DISABLESEL);

	if_(info->scsi.disconnectable &&_info->SCpnt) {
		fas216_log(info, LOG_CONNECT,
			"moved command for_%d