;*********************************************************************** ; Synchronous Negotiation (53c710/53c720) ;*********************************************************************** ; ABSOLUTE declarations ABSOLUTE SCSI_id = 0 ; Messages ABSOLUTE CMD_COMPLETE = 0x00 ABSOLUTE EXTEND_MSG = 0x01 ABSOLUTE SAVE_DATAPTR = 0x02 ABSOLUTE DISCONNECT = 0x04 ABSOLUTE MSG_REJECT = 0x07 ; Interrupt codes ABSOLUTE error_not_cmd_phase = 0x01 ABSOLUTE error_not_data_in_phase = 0x02 ABSOLUTE error_not_data_out_phase = 0x03 ABSOLUTE error_not_msg_in_phase = 0x04 ABSOLUTE error_not_msg_out_phase = 0x05 ABSOLUTE error_not_status_phase = 0x06 ABSOLUTE error_unexpected_phase = 0x07 ABSOLUTE error_jump_not_taken = 0x10 ABSOLUTE error_not_cmd_complete = 0x20 ABSOLUTE error_not_extended_msg = 0x21 ABSOLUTE io_complete = 0x0A ABSOLUTE setup_SXFER = 0x888 ABSOLUTE select_error = 0xfff ;*********************************************************************** ; TABLE declarations TABLE Table_Indirect \ SCSI_ID = ID{0x00,0x00,0x38,0x00} \ ; FORMAT ID_to_SELECT = ID{0x00,ID,SXFER,0x00} For 53c710 ; FORMAT ID_to_SELECT = ID{SCNTL3,ID,SXFER,0x00} for 53c720 identify_msg_buf = {0x80} \ ident_and_synch_msg_buf = {0x80,0x01,0x03,0x01,0x19,0x08}\ synch_msgi_buf = 4{??} \ cmd_buf = {0x00,0x00,0x00,0x00,0x00,0x00} \ ; test unit ready cmd status_buf = {??} \ msg_in_buf = {??} \ read_data_buf = 512{??} \ write_data_buf = 512{ff} \ ;*********************************************************************** ; ENTRY declarations ENTRY synch_negot ENTRY to_decisions ENTRY id_msg_out ENTRY msg_in_phase ENTRY synch_msg_in ENTRY cmd_phase ENTRY data_in_phase ENTRY data_out_phase ENTRY status_phase ENTRY alternate_address ;*********************************************************************** ; SCRIPT code synch_negot: SELECT ATN from SCSI_id, alternate_address JUMP to_decisions, WHEN NOT MSG_OUT ; The extended message (synchronouse negotiation) will be sent along ; with the identify message. This will allow synchronous ; negotiation before ATN is deasserted. ; ; note: ATN is automatically deasserted after a block move for ; message out phase id_msg_out: MOVE FROM ident_and_synch_msg_buf, WHEN MSG_OUT JUMP to_decisions, WHEN NOT MSG_IN synch_msg_in_phase: MOVE FROM msg_in_buf, WHEN MSG_IN CLEAR ACK JUMP to_decisions, IF MSG_REJECT ;compare with message reject ;and wait for valid phase JUMP to_decisions, WHEN NOT MSG_IN INT error_not_extended_msg, IF NOT EXTEND_MSG MOVE FROM synch_msgi_buf, WHEN MSG_IN CLEAR ACK INT setup_SXFER ;Interrupt to determine ;synchronous parameters cmd_phase: clear ATN ; For SCSI-1 Compatability MOVE FROM cmd_buf, WHEN CMD JUMP to_decisions, WHEN NOT DATA_IN data_in_phase: MOVE FROM read_data_buf, WHEN DATA_IN JUMP status_phase, WHEN STATUS JUMP to_decisions data_out_phase: MOVE FROM write_data_buf, WHEN DATA_OUT JUMP to_decisions, WHEN NOT STATUS status_phase: MOVE FROM status_buf, WHEN STATUS JUMP to_decisions, WHEN NOT MSG_IN message_in_phase: MOVE FROM msg_buf, WHEN MSG_IN INT error_cmd_not_complete, IF NOT 0x00 CLEAR ACK ; Need the following SCRIPT for 53c720 and above ; MOVE 0x00 TO SCNTL2 ; This will turn off the Unexpected Disconnect bit WAIT DISCONNECT INT command_complete to_decisions: JUMP msg_in_phase, WHEN MSG_IN JUMP cmd_phase, WHEN CMD JUMP data_in_phase, WHEN DATA_IN JUMP data_out_phase, WHEN DATA_OUT JUMP status_phase, WHEN STATUS INT error_unexpected_phase alternate_address: INT select_error