⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sym_fw2.h

📁 linux-2.6.15.6
💻 H
📖 第 1 页 / 共 4 页
字号:
		PADDR_A (datai_done_wsr),	SCR_JUMP ^ IFTRUE (WHEN (SCR_STATUS)),		PADDR_A (status),	SCR_JUMP,		PADDR_A (dispatch),}/*-------------------------< DATAI_DONE_WSR >-------------------*/,{	/*	 *  The SWIDE is full.	 *  Clear this condition.	 */	SCR_REG_REG (scntl2, SCR_OR, WSR),		0,	/*	 *  We are expecting an IGNORE RESIDUE message 	 *  from the device, otherwise we are in data 	 *  overrun condition. Check against MSG_IN phase.	 */	SCR_INT ^ IFFALSE (WHEN (SCR_MSG_IN)),		SIR_SWIDE_OVERRUN,	SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_IN)),		PADDR_A (dispatch),	/*	 *  We are in MSG_IN phase,	 *  Read the first byte of the message.	 *  If it is not an IGNORE RESIDUE message,	 *  signal overrun and jump to message 	 *  processing.	 */	SCR_MOVE_ABS (1) ^ SCR_MSG_IN,		HADDR_1 (msgin[0]),	SCR_INT ^ IFFALSE (DATA (M_IGN_RESIDUE)),		SIR_SWIDE_OVERRUN,	SCR_JUMP ^ IFFALSE (DATA (M_IGN_RESIDUE)),		PADDR_A (msg_in2),	/*	 *  We got the message we expected.	 *  Read the 2nd byte, and jump to dispatcher.	 */	SCR_CLR (SCR_ACK),		0,	SCR_MOVE_ABS (1) ^ SCR_MSG_IN,		HADDR_1 (msgin[1]),	SCR_CLR (SCR_ACK),		0,	SCR_JUMP,		PADDR_A (dispatch),}/*-------------------------< DATAO_DONE >-----------------------*/,{	/*	 *  Save current pointer to LASTP.	 */	SCR_STORE_REL (temp, 4),		offsetof (struct sym_ccb, phys.head.lastp),	/*	 *  If the SODL is not full jump to dispatcher.	 *  We anticipate a STATUS phase.	 */	SCR_FROM_REG (scntl2),		0,	SCR_JUMP ^ IFTRUE (MASK (WSS, WSS)),		PADDR_A (datao_done_wss),	SCR_JUMP ^ IFTRUE (WHEN (SCR_STATUS)),		PADDR_A (status),	SCR_JUMP,		PADDR_A (dispatch),}/*-------------------------< DATAO_DONE_WSS >-------------------*/,{	/*	 *  The SODL is full, clear this condition.	 */	SCR_REG_REG (scntl2, SCR_OR, WSS),		0,	/*	 *  And signal a DATA UNDERRUN condition 	 *  to the C code.	 */	SCR_INT,		SIR_SODL_UNDERRUN,	SCR_JUMP,		PADDR_A (dispatch),}/*-------------------------< DATAI_PHASE >----------------------*/,{	/*	 *  Jump to current pointer.	 */	SCR_LOAD_REL (temp, 4),		offsetof (struct sym_ccb, phys.head.lastp),	SCR_RETURN,		0,}/*-------------------------< DATAO_PHASE >----------------------*/,{	/*	 *  C1010-66 errata work-around.	 *  Extra clocks of data hold must be inserted 	 *  in DATA OUT phase on 33 MHz PCI BUS.	 *  Patched with a NOOP for other chips.	 */	SCR_REG_REG (scntl4, SCR_OR, (XCLKH_DT|XCLKH_ST)),		0,	/*	 *  Jump to current pointer.	 */	SCR_LOAD_REL (temp, 4),		offsetof (struct sym_ccb, phys.head.lastp),	SCR_RETURN,		0,}/*-------------------------< MSG_IN >---------------------------*/,{	/*	 *  Get the first byte of the message.	 *	 *  The script processor doesn't negate the	 *  ACK signal after this transfer.	 */	SCR_MOVE_ABS (1) ^ SCR_MSG_IN,		HADDR_1 (msgin[0]),}/*-------------------------< MSG_IN2 >--------------------------*/,{	/*	 *  Check first against 1 byte messages 	 *  that we handle from SCRIPTS.	 */	SCR_JUMP ^ IFTRUE (DATA (M_COMPLETE)),		PADDR_A (complete),	SCR_JUMP ^ IFTRUE (DATA (M_DISCONNECT)),		PADDR_A (disconnect),	SCR_JUMP ^ IFTRUE (DATA (M_SAVE_DP)),		PADDR_A (save_dp),	SCR_JUMP ^ IFTRUE (DATA (M_RESTORE_DP)),		PADDR_A (restore_dp),	/*	 *  We handle all other messages from the 	 *  C code, so no need to waste on-chip RAM 	 *  for those ones.	 */	SCR_JUMP,		PADDR_B (msg_in_etc),}/*-------------------------< STATUS >---------------------------*/,{	/*	 *  get the status	 */	SCR_MOVE_ABS (1) ^ SCR_STATUS,		HADDR_1 (scratch),#ifdef SYM_CONF_IARB_SUPPORT	/*	 *  If STATUS is not GOOD, clear IMMEDIATE ARBITRATION, 	 *  since we may have to tamper the start queue from 	 *  the C code.	 */	SCR_JUMPR ^ IFTRUE (DATA (S_GOOD)),		8,	SCR_REG_REG (scntl1, SCR_AND, ~IARB),		0,#endif	/*	 *  save status to scsi_status.	 *  mark as complete.	 */	SCR_TO_REG (SS_REG),		0,	SCR_LOAD_REG (HS_REG, HS_COMPLETE),		0,	/*	 *  Anticipate the MESSAGE PHASE for 	 *  the TASK COMPLETE message.	 */	SCR_JUMP ^ IFTRUE (WHEN (SCR_MSG_IN)),		PADDR_A (msg_in),	SCR_JUMP,		PADDR_A (dispatch),}/*-------------------------< COMPLETE >-------------------------*/,{	/*	 *  Complete message.	 *	 *  When we terminate the cycle by clearing ACK,	 *  the target may disconnect immediately.	 *	 *  We don't want to be told of an "unexpected disconnect",	 *  so we disable this feature.	 */	SCR_REG_REG (scntl2, SCR_AND, 0x7f),		0,	/*	 *  Terminate cycle ...	 */	SCR_CLR (SCR_ACK|SCR_ATN),		0,	/*	 *  ... and wait for the disconnect.	 */	SCR_WAIT_DISC,		0,}/*-------------------------< COMPLETE2 >------------------------*/,{	/*	 *  Save host status.	 */	SCR_STORE_REL (scr0, 4),		offsetof (struct sym_ccb, phys.head.status),	/*	 *  Some bridges may reorder DMA writes to memory.	 *  We donnot want the CPU to deal with completions  	 *  without all the posted write having been flushed 	 *  to memory. This DUMMY READ should flush posted 	 *  buffers prior to the CPU having to deal with 	 *  completions.	 */	SCR_LOAD_REL (scr0, 4),	/* DUMMY READ */		offsetof (struct sym_ccb, phys.head.status),	/*	 *  If command resulted in not GOOD status,	 *  call the C code if needed.	 */	SCR_FROM_REG (SS_REG),		0,	SCR_CALL ^ IFFALSE (DATA (S_GOOD)),		PADDR_B (bad_status),	/*	 *  If we performed an auto-sense, call 	 *  the C code to synchronyze task aborts 	 *  with UNIT ATTENTION conditions.	 */	SCR_FROM_REG (HF_REG),		0,	SCR_JUMP ^ IFFALSE (MASK (0 ,(HF_SENSE|HF_EXT_ERR))),		PADDR_A (complete_error),}/*-------------------------< DONE >-----------------------------*/,{	/*	 *  Copy the DSA to the DONE QUEUE and 	 *  signal completion to the host.	 *  If we are interrupted between DONE 	 *  and DONE_END, we must reset, otherwise 	 *  the completed CCB may be lost.	 */	SCR_STORE_ABS (dsa, 4),		PADDR_B (scratch),	SCR_LOAD_ABS (dsa, 4),		PADDR_B (done_pos),	SCR_LOAD_ABS (scratcha, 4),		PADDR_B (scratch),	SCR_STORE_REL (scratcha, 4),		0,	/*	 *  The instruction below reads the DONE QUEUE next 	 *  free position from memory.	 *  In addition it ensures that all PCI posted writes  	 *  are flushed and so the DSA value of the done 	 *  CCB is visible by the CPU before INTFLY is raised.	 */	SCR_LOAD_REL (scratcha, 4),		4,	SCR_INT_FLY,		0,	SCR_STORE_ABS (scratcha, 4),		PADDR_B (done_pos),}/*-------------------------< DONE_END >-------------------------*/,{	SCR_JUMP,		PADDR_A (start),}/*-------------------------< COMPLETE_ERROR >-------------------*/,{	SCR_LOAD_ABS (scratcha, 4),		PADDR_B (startpos),	SCR_INT,		SIR_COMPLETE_ERROR,}/*-------------------------< SAVE_DP >--------------------------*/,{	/*	 *  Clear ACK immediately.	 *  No need to delay it.	 */	SCR_CLR (SCR_ACK),		0,	/*	 *  Keep track we received a SAVE DP, so 	 *  we will switch to the other PM context 	 *  on the next PM since the DP may point 	 *  to the current PM context.	 */	SCR_REG_REG (HF_REG, SCR_OR, HF_DP_SAVED),		0,	/*	 *  SAVE_DP message:	 *  Copy LASTP to SAVEP.	 */	SCR_LOAD_REL (scratcha, 4),		offsetof (struct sym_ccb, phys.head.lastp),	SCR_STORE_REL (scratcha, 4),		offsetof (struct sym_ccb, phys.head.savep),	/*	 *  Anticipate the MESSAGE PHASE for 	 *  the DISCONNECT message.	 */	SCR_JUMP ^ IFTRUE (WHEN (SCR_MSG_IN)),		PADDR_A (msg_in),	SCR_JUMP,		PADDR_A (dispatch),}/*-------------------------< RESTORE_DP >-----------------------*/,{	/*	 *  Clear ACK immediately.	 *  No need to delay it.	 */	SCR_CLR (SCR_ACK),		0,	/*	 *  Copy SAVEP to LASTP.	 */	SCR_LOAD_REL  (scratcha, 4),		offsetof (struct sym_ccb, phys.head.savep),	SCR_STORE_REL (scratcha, 4),		offsetof (struct sym_ccb, phys.head.lastp),	SCR_JUMP,		PADDR_A (dispatch),}/*-------------------------< DISCONNECT >-----------------------*/,{	/*	 *  DISCONNECTing  ...	 *	 *  disable the "unexpected disconnect" feature,	 *  and remove the ACK signal.	 */	SCR_REG_REG (scntl2, SCR_AND, 0x7f),		0,	SCR_CLR (SCR_ACK|SCR_ATN),		0,	/*	 *  Wait for the disconnect.	 */	SCR_WAIT_DISC,		0,	/*	 *  Status is: DISCONNECTED.	 */	SCR_LOAD_REG (HS_REG, HS_DISCONNECT),		0,	/*	 *  Save host status.	 */	SCR_STORE_REL (scr0, 4),		offsetof (struct sym_ccb, phys.head.status),	SCR_JUMP,		PADDR_A (start),}/*-------------------------< IDLE >-----------------------------*/,{	/*	 *  Nothing to do?	 *  Switch the LED off and wait for reselect.	 *  Will be patched with a NO_OP if LED	 *  not needed or not desired.	 */	SCR_REG_REG (gpreg, SCR_OR, 0x01),		0,#ifdef SYM_CONF_IARB_SUPPORT	SCR_JUMPR,		8,#endif}/*-------------------------< UNGETJOB >-------------------------*/,{#ifdef SYM_CONF_IARB_SUPPORT	/*	 *  Set IMMEDIATE ARBITRATION, for the next time.	 *  This will give us better chance to win arbitration 	 *  for the job we just wanted to do.	 */	SCR_REG_REG (scntl1, SCR_OR, IARB),		0,#endif	/*	 *  We are not able to restart the SCRIPTS if we are 	 *  interrupted and these instruction haven't been 	 *  all executed. BTW, this is very unlikely to 	 *  happen, but we check that from the C code.	 */	SCR_LOAD_REG (dsa, 0xff),		0,	SCR_STORE_ABS (scratcha, 4),		PADDR_B (startpos),}/*-------------------------< RESELECT >-------------------------*/,{#ifdef SYM_CONF_TARGET_ROLE_SUPPORT	/*	 *  Make sure we are in initiator mode.	 */	SCR_CLR (SCR_TRG),		0,#endif	/*	 *  Sleep waiting for a reselection.	 */	SCR_WAIT_RESEL,		PADDR_A(start),}/*-------------------------< RESELECTED >-----------------------*/,{	/*	 *  Switch the LED on.	 *  Will be patched with a NO_OP if LED	 *  not needed or not desired.	 */	SCR_REG_REG (gpreg, SCR_AND, 0xfe),		0,	/*	 *  load the target id into the sdid	 */	SCR_REG_SFBR (ssid, SCR_AND, 0x8F),		0,	SCR_TO_REG (sdid),		0,	/*	 *  Load the target control block address	 */	SCR_LOAD_ABS (dsa, 4),		PADDR_B (targtbl),	SCR_SFBR_REG (dsa, SCR_SHL, 0),		0,	SCR_REG_REG (dsa, SCR_SHL, 0),		0,	SCR_REG_REG (dsa, SCR_AND, 0x3c),		0,	SCR_LOAD_REL (dsa, 4),		0,	/*	 *  We expect MESSAGE IN phase.	 *  If not, get help from the C code.	 */	SCR_INT ^ IFFALSE (WHEN (SCR_MSG_IN)),		SIR_RESEL_NO_MSG_IN,	/*	 *  Load the legacy synchronous transfer registers.	 */	SCR_LOAD_REL (scntl3, 1),		offsetof(struct sym_tcb, head.wval),	SCR_LOAD_REL (sxfer, 1),		offsetof(struct sym_tcb, head.sval),}/*-------------------------< RESEL_SCNTL4 >---------------------*/,{	/*	 *  The C1010 uses a new synchronous timing scheme.	 *  Will be patched with a NO_OP if not a C1010.	 */	SCR_LOAD_REL (scntl4, 1),		offsetof(struct sym_tcb, head.uval),	/*	 *  Get the IDENTIFY message.	 */	SCR_MOVE_ABS (1) ^ SCR_MSG_IN,		HADDR_1 (msgin),	/*	 *  If IDENTIFY LUN #0, use a faster path 	 *  to find the LCB structure.	 */	SCR_JUMP ^ IFTRUE (MASK (0x80, 0xbf)),		PADDR_A (resel_lun0),	/*	 *  If message isn't an IDENTIFY, 	 *  tell the C code about.	 */	SCR_INT ^ IFFALSE (MASK (0x80, 0x80)),		SIR_RESEL_NO_IDENTIFY,	/*	 *  It is an IDENTIFY message,	 *  Load the LUN control block address.	 */	SCR_LOAD_REL (dsa, 4),		offsetof(struct sym_tcb, head.luntbl_sa),	SCR_SFBR_REG (dsa, SCR_SHL, 0),		0,	SCR_REG_REG (dsa, SCR_SHL, 0),		0,	SCR_REG_REG (dsa, SCR_AND, 0xfc),		0,	SCR_LOAD_REL (dsa, 4),		0,	SCR_JUMPR,		8,}/*-------------------------< RESEL_LUN0 >-----------------------*/,{	/*	 *  LUN 0 special case (but usual one :))	 */	SCR_LOAD_REL (dsa, 4),		offsetof(struct sym_tcb, head.lun0_sa),	/*	 *  Jump indirectly to the reselect action for this LUN.	 */	SCR_LOAD_REL (temp, 4),		offsetof(struct sym_lcb, head.resel_sa),	SCR_RETURN,		0,	/* In normal situations, we jump to RESEL_TAG or RESEL_NO_TAG */}/*-------------------------< RESEL_TAG >------------------------*/,{	/*	 *  ACK the IDENTIFY previously received.	 */	SCR_CLR (SCR_ACK),		0,	/*	 *  It shall be a tagged command.	 *  Read SIMPLE+TAG.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -