sym_fw1.h
来自「linux 内核源代码」· C头文件 代码 · 共 1,791 行 · 第 1/3 页
H
1,791 行
PADDR_A (pm0_data_out), /* * Actual phase is DATA IN. * Check against expected direction. */ SCR_JUMP ^ IFFALSE (MASK (HF_DATA_IN, HF_DATA_IN)), PADDR_B (data_ovrun), /* * Keep track we are moving data from the * PM0 DATA mini-script. */ SCR_REG_REG (HF_REG, SCR_OR, HF_IN_PM0), 0, /* * Move the data to memory. */ SCR_CHMOV_TBL ^ SCR_DATA_IN, offsetof (struct sym_ccb, phys.pm0.sg), SCR_JUMP, PADDR_A (pm0_data_end),}/*-------------------------< PM0_DATA_OUT >---------------------*/,{ /* * Actual phase is DATA OUT. * Check against expected direction. */ SCR_JUMP ^ IFTRUE (MASK (HF_DATA_IN, HF_DATA_IN)), PADDR_B (data_ovrun), /* * Keep track we are moving data from the * PM0 DATA mini-script. */ SCR_REG_REG (HF_REG, SCR_OR, HF_IN_PM0), 0, /* * Move the data from memory. */ SCR_CHMOV_TBL ^ SCR_DATA_OUT, offsetof (struct sym_ccb, phys.pm0.sg),}/*-------------------------< PM0_DATA_END >---------------------*/,{ /* * Clear the flag that told we were moving * data from the PM0 DATA mini-script. */ SCR_REG_REG (HF_REG, SCR_AND, (~HF_IN_PM0)), 0, /* * Return to the previous DATA script which * is guaranteed by design (if no bug) to be * the main DATA script for this transfer. */ SCR_COPY (4), RADDR_1 (dsa), RADDR_1 (scratcha), SCR_REG_REG (scratcha, SCR_ADD, offsetof (struct sym_ccb,phys.pm0.ret)), 0,}/*-------------------------< PM_DATA_END >----------------------*/,{ SCR_COPY (4), RADDR_1 (scratcha), PADDR_A (_sms_a150), SCR_COPY (4),}/*-------------------------< _SMS_A150 >------------------------*/,{ 0, RADDR_1 (temp), SCR_RETURN, 0,}/*-------------------------< PM1_DATA >-------------------------*/,{ /* * Read our host flags to SFBR, so we will be able * to check against the data direction we expect. */ SCR_FROM_REG (HF_REG), 0, /* * Check against actual DATA PHASE. */ SCR_JUMP ^ IFFALSE (WHEN (SCR_DATA_IN)), PADDR_A (pm1_data_out), /* * Actual phase is DATA IN. * Check against expected direction. */ SCR_JUMP ^ IFFALSE (MASK (HF_DATA_IN, HF_DATA_IN)), PADDR_B (data_ovrun), /* * Keep track we are moving data from the * PM1 DATA mini-script. */ SCR_REG_REG (HF_REG, SCR_OR, HF_IN_PM1), 0, /* * Move the data to memory. */ SCR_CHMOV_TBL ^ SCR_DATA_IN, offsetof (struct sym_ccb, phys.pm1.sg), SCR_JUMP, PADDR_A (pm1_data_end),}/*-------------------------< PM1_DATA_OUT >---------------------*/,{ /* * Actual phase is DATA OUT. * Check against expected direction. */ SCR_JUMP ^ IFTRUE (MASK (HF_DATA_IN, HF_DATA_IN)), PADDR_B (data_ovrun), /* * Keep track we are moving data from the * PM1 DATA mini-script. */ SCR_REG_REG (HF_REG, SCR_OR, HF_IN_PM1), 0, /* * Move the data from memory. */ SCR_CHMOV_TBL ^ SCR_DATA_OUT, offsetof (struct sym_ccb, phys.pm1.sg),}/*-------------------------< PM1_DATA_END >---------------------*/,{ /* * Clear the flag that told we were moving * data from the PM1 DATA mini-script. */ SCR_REG_REG (HF_REG, SCR_AND, (~HF_IN_PM1)), 0, /* * Return to the previous DATA script which * is guaranteed by design (if no bug) to be * the main DATA script for this transfer. */ SCR_COPY (4), RADDR_1 (dsa), RADDR_1 (scratcha), SCR_REG_REG (scratcha, SCR_ADD, offsetof (struct sym_ccb,phys.pm1.ret)), 0, SCR_JUMP, PADDR_A (pm_data_end),}/*--------------------------<>----------------------------------*/};static struct SYM_FWB_SCR SYM_FWB_SCR = {/*-------------------------< NO_DATA >--------------------------*/ { SCR_JUMP, PADDR_B (data_ovrun),}/*-------------------------< SEL_FOR_ABORT >--------------------*/,{ /* * We are jumped here by the C code, if we have * some target to reset or some disconnected * job to abort. Since error recovery is a serious * busyness, we will really reset the SCSI BUS, if * case of a SCSI interrupt occurring in this path. */#ifdef SYM_CONF_TARGET_ROLE_SUPPORT /* * Set initiator mode. */ SCR_CLR (SCR_TRG), 0,#endif /* * And try to select this target. */ SCR_SEL_TBL_ATN ^ offsetof (struct sym_hcb, abrt_sel), PADDR_A (reselect), /* * Wait for the selection to complete or * the selection to time out. */ SCR_JUMPR ^ IFFALSE (WHEN (SCR_MSG_OUT)), -8, /* * Call the C code. */ SCR_INT, SIR_TARGET_SELECTED, /* * The C code should let us continue here. * Send the 'kiss of death' message. * We expect an immediate disconnect once * the target has eaten the message. */ SCR_REG_REG (scntl2, SCR_AND, 0x7f), 0, SCR_MOVE_TBL ^ SCR_MSG_OUT, offsetof (struct sym_hcb, abrt_tbl), SCR_CLR (SCR_ACK|SCR_ATN), 0, SCR_WAIT_DISC, 0, /* * Tell the C code that we are done. */ SCR_INT, SIR_ABORT_SENT,}/*-------------------------< SEL_FOR_ABORT_1 >------------------*/,{ /* * Jump at scheduler. */ SCR_JUMP, PADDR_A (start),}/*-------------------------< MSG_IN_ETC >-----------------------*/,{ /* * If it is an EXTENDED (variable size message) * Handle it. */ SCR_JUMP ^ IFTRUE (DATA (M_EXTENDED)), PADDR_B (msg_extended), /* * Let the C code handle any other * 1 byte message. */ SCR_JUMP ^ IFTRUE (MASK (0x00, 0xf0)), PADDR_B (msg_received), SCR_JUMP ^ IFTRUE (MASK (0x10, 0xf0)), PADDR_B (msg_received), /* * We donnot handle 2 bytes messages from SCRIPTS. * So, let the C code deal with these ones too. */ SCR_JUMP ^ IFFALSE (MASK (0x20, 0xf0)), PADDR_B (msg_weird_seen), SCR_CLR (SCR_ACK), 0, SCR_MOVE_ABS (1) ^ SCR_MSG_IN, HADDR_1 (msgin[1]),}/*-------------------------< MSG_RECEIVED >---------------------*/,{ SCR_COPY (4), /* DUMMY READ */ HADDR_1 (scratch), RADDR_1 (scratcha), SCR_INT, SIR_MSG_RECEIVED,}/*-------------------------< MSG_WEIRD_SEEN >-------------------*/,{ SCR_COPY (4), /* DUMMY READ */ HADDR_1 (scratch), RADDR_1 (scratcha), SCR_INT, SIR_MSG_WEIRD,}/*-------------------------< MSG_EXTENDED >---------------------*/,{ /* * Clear ACK and get the next byte * assumed to be the message length. */ SCR_CLR (SCR_ACK), 0, SCR_MOVE_ABS (1) ^ SCR_MSG_IN, HADDR_1 (msgin[1]), /* * Try to catch some unlikely situations as 0 length * or too large the length. */ SCR_JUMP ^ IFTRUE (DATA (0)), PADDR_B (msg_weird_seen), SCR_TO_REG (scratcha), 0, SCR_REG_REG (sfbr, SCR_ADD, (256-8)), 0, SCR_JUMP ^ IFTRUE (CARRYSET), PADDR_B (msg_weird_seen), /* * We donnot handle extended messages from SCRIPTS. * Read the amount of data correponding to the * message length and call the C code. */ SCR_COPY (1), RADDR_1 (scratcha), PADDR_B (_sms_b10), SCR_CLR (SCR_ACK), 0,}/*-------------------------< _SMS_B10 >-------------------------*/,{ SCR_MOVE_ABS (0) ^ SCR_MSG_IN, HADDR_1 (msgin[2]), SCR_JUMP, PADDR_B (msg_received),}/*-------------------------< MSG_BAD >--------------------------*/,{ /* * unimplemented message - reject it. */ SCR_INT, SIR_REJECT_TO_SEND, SCR_SET (SCR_ATN), 0, SCR_JUMP, PADDR_A (clrack),}/*-------------------------< MSG_WEIRD >------------------------*/,{ /* * weird message received * ignore all MSG IN phases and reject it. */ SCR_INT, SIR_REJECT_TO_SEND, SCR_SET (SCR_ATN), 0,}/*-------------------------< MSG_WEIRD1 >-----------------------*/,{ SCR_CLR (SCR_ACK), 0, SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_IN)), PADDR_A (dispatch), SCR_MOVE_ABS (1) ^ SCR_MSG_IN, HADDR_1 (scratch), SCR_JUMP, PADDR_B (msg_weird1),}/*-------------------------< WDTR_RESP >------------------------*/,{ /* * let the target fetch our answer. */ SCR_SET (SCR_ATN), 0, SCR_CLR (SCR_ACK), 0, SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_OUT)), PADDR_B (nego_bad_phase),}/*-------------------------< SEND_WDTR >------------------------*/,{ /* * Send the M_X_WIDE_REQ */ SCR_MOVE_ABS (4) ^ SCR_MSG_OUT, HADDR_1 (msgout), SCR_JUMP, PADDR_B (msg_out_done),}/*-------------------------< SDTR_RESP >------------------------*/,{ /* * let the target fetch our answer. */ SCR_SET (SCR_ATN), 0, SCR_CLR (SCR_ACK), 0, SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_OUT)), PADDR_B (nego_bad_phase),}/*-------------------------< SEND_SDTR >------------------------*/,{ /* * Send the M_X_SYNC_REQ */ SCR_MOVE_ABS (5) ^ SCR_MSG_OUT, HADDR_1 (msgout), SCR_JUMP, PADDR_B (msg_out_done),}/*-------------------------< PPR_RESP >-------------------------*/,{ /* * let the target fetch our answer. */ SCR_SET (SCR_ATN), 0, SCR_CLR (SCR_ACK), 0, SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_OUT)), PADDR_B (nego_bad_phase),}/*-------------------------< SEND_PPR >-------------------------*/,{ /* * Send the M_X_PPR_REQ */ SCR_MOVE_ABS (8) ^ SCR_MSG_OUT, HADDR_1 (msgout), SCR_JUMP, PADDR_B (msg_out_done),}/*-------------------------< NEGO_BAD_PHASE >-------------------*/,{ SCR_INT, SIR_NEGO_PROTO, SCR_JUMP, PADDR_A (dispatch),}/*-------------------------< MSG_OUT >--------------------------*/,{ /* * The target requests a message. * We donnot send messages that may * require the device to go to bus free. */ SCR_MOVE_ABS (1) ^ SCR_MSG_OUT, HADDR_1 (msgout), /* * ... wait for the next phase * if it's a message out, send it again, ... */ SCR_JUMP ^ IFTRUE (WHEN (SCR_MSG_OUT)), PADDR_B (msg_out),}/*-------------------------< MSG_OUT_DONE >---------------------*/,{ /* * Let the C code be aware of the * sent message and clear the message. */ SCR_INT, SIR_MSG_OUT_DONE, /* * ... and process the next phase */ SCR_JUMP, PADDR_A (dispatch),}/*-------------------------< DATA_OVRUN >-----------------------*/,{ /* * Zero scratcha that will count the * extras bytes. */ SCR_COPY (4), PADDR_B (zero), RADDR_1 (scratcha),}/*-------------------------< DATA_OVRUN1 >----------------------*/,{ /* * The target may want to transfer too much data. * * If phase is DATA OUT write 1 byte and count it. */ SCR_JUMPR ^ IFFALSE (WHEN (SCR_DATA_OUT)), 16, SCR_CHMOV_ABS (1) ^ SCR_DATA_OUT, HADDR_1 (scratch), SCR_JUMP, PADDR_B (data_ovrun2), /* * If WSR is set, clear this condition, and * count this byte. */ SCR_FROM_REG (scntl2), 0, SCR_JUMPR ^ IFFALSE (MASK (WSR, WSR)), 16, SCR_REG_REG (scntl2, SCR_OR, WSR), 0, SCR_JUMP, PADDR_B (data_ovrun2), /* * Finally check against DATA IN phase. * Signal data overrun to the C code * and jump to dispatcher if not so. * Read 1 byte otherwise and count it. */ SCR_JUMPR ^ IFTRUE (WHEN (SCR_DATA_IN)), 16, SCR_INT, SIR_DATA_OVERRUN, SCR_JUMP, PADDR_A (dispatch), SCR_CHMOV_ABS (1) ^ SCR_DATA_IN, HADDR_1 (scratch),}/*-------------------------< DATA_OVRUN2 >----------------------*/,{ /* * Count this byte. * This will allow to return a negative * residual to user. */ SCR_REG_REG (scratcha, SCR_ADD, 0x01), 0, SCR_REG_REG (scratcha1, SCR_ADDC, 0), 0, SCR_REG_REG (scratcha2, SCR_ADDC, 0), 0, /* * .. and repeat as required. */ SCR_JUMP, PADDR_B (data_ovrun1),}/*-------------------------< ABORT_RESEL >----------------------*/,{ SCR_SET (SCR_ATN), 0, SCR_CLR (SCR_ACK), 0, /* * send the abort/abortag/reset message * we expect an immediate disconnect */ SCR_REG_REG (scntl2, SCR_AND, 0x7f), 0, SCR_MOVE_ABS (1) ^ SCR_MSG_OUT, HADDR_1 (msgout), SCR_CLR (SCR_ACK|SCR_ATN), 0, SCR_WAIT_DISC, 0, SCR_INT, SIR_RESEL_ABORTED, SCR_JUMP, PADDR_A (start),}/*-------------------------< RESEND_IDENT >---------------------*/,{ /* * The target stays in MSG OUT phase after having acked * Identify [+ Tag [+ Extended message ]]. Targets shall * behave this way on parity error. * We must send it again all the messages. */ SCR_SET (SCR_ATN), /* Shall be asserted 2 deskew delays before the */ 0, /* 1rst ACK = 90 ns. Hope the chip isn't too fast */ SCR_JUMP, PADDR_A (send_ident),}/*-------------------------< IDENT_BREAK >----------------------*/,{ SCR_CLR (SCR_ATN), 0, SCR_JUMP, PADDR_A (select2),}/*-------------------------< IDENT_BREAK_ATN >------------------*/,{ SCR_SET (SCR_ATN), 0, SCR_JUMP, PADDR_A (select2),}/*-------------------------< SDATA_IN >-------------------------*/,{ SCR_CHMOV_TBL ^ SCR_DATA_IN, offsetof (struct sym_dsb, sense), SCR_CALL, PADDR_A (datai_done), SCR_JUMP, PADDR_B (data_ovrun),}/*-------------------------< RESEL_BAD_LUN >--------------------*/,{ /* * Message is an IDENTIFY, but lun is unknown. * Signal problem to C code for logging the event. * Send a M_ABORT to clear all pending tasks. */ SCR_INT, SIR_RESEL_BAD_LUN, SCR_JUMP, PADDR_B (abort_resel),}/*-------------------------< BAD_I_T_L >------------------------*/,{ /* * We donnot have a task for that I_T_L. * Signal problem to C code for logging the event. * Send a M_ABORT message. */ SCR_INT, SIR_RESEL_BAD_I_T_L, SCR_JUMP, PADDR_B (abort_resel),}/*-------------------------< BAD_I_T_L_Q >----------------------*/,{ /* * We donnot have a task that matches the tag. * Signal problem to C code for logging the event. * Send a M_ABORTTAG message. */ SCR_INT, SIR_RESEL_BAD_I_T_L_Q, SCR_JUMP, PADDR_B (abort_resel),}/*-------------------------< BAD_STATUS >-----------------------*/,{ /* * Anything different from INTERMEDIATE * CONDITION MET should be a bad SCSI status, * given that GOOD status has already been tested. * Call the C code. */ SCR_COPY (4), PADDR_B (startpos), RADDR_1 (scratcha), SCR_INT ^ IFFALSE (DATA (S_COND_MET)), SIR_BAD_SCSI_STATUS, SCR_RETURN, 0,}/*-------------------------< WSR_MA_HELPER >--------------------*/,{ /* * Helper for the C code when WSR bit is set. * Perform the move of the residual byte. */ SCR_CHMOV_TBL ^ SCR_DATA_IN, offsetof (struct sym_ccb, phys.wresid), SCR_JUMP, PADDR_A (dispatch),}/*-------------------------< ZERO >-----------------------------*/,{ SCR_DATA_ZERO,}/*-------------------------< SCRATCH >--------------------------*/,{ SCR_DATA_ZERO, /* MUST BE BEFORE SCRATCH1 */}/*-------------------------< SCRATCH1 >-------------------------*/,{ SCR_DATA_ZERO,}/*-------------------------< PREV_DONE >------------------------*/,{ SCR_DATA_ZERO, /* MUST BE BEFORE DONE_POS ! */}/*-------------------------< DONE_POS >-------------------------*/,{ SCR_DATA_ZERO,}/*-------------------------< NEXTJOB >--------------------------*/,{ SCR_DATA_ZERO, /* MUST BE BEFORE STARTPOS ! */}/*-------------------------< STARTPOS >-------------------------*/,{ SCR_DATA_ZERO,}/*-------------------------< TARGTBL >--------------------------*/,{ SCR_DATA_ZERO,}/*--------------------------<>----------------------------------*/};static struct SYM_FWZ_SCR SYM_FWZ_SCR = { /*-------------------------< SNOOPTEST >------------------------*/{ /* * Read the variable. */ SCR_COPY (4), HADDR_1 (scratch), RADDR_1 (scratcha), /* * Write the variable. */ SCR_COPY (4), RADDR_1 (temp), HADDR_1 (scratch), /* * Read back the variable. */ SCR_COPY (4), HADDR_1 (scratch), RADDR_1 (temp),}/*-------------------------< SNOOPEND >-------------------------*/,{ /* * And stop. */ SCR_INT, 99,}/*--------------------------<>----------------------------------*/};
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?