;*********************************************************************** ; Synchronous Negotiation (53c700) ;*********************************************************************** ; 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 ;*********************************************************************** ; RELATIVE declarations RELATIVE buffers = 0 ;start of data buffers RELATIVE identify_msg_buf=0 ;identify_msg_buf=1 byte RELATIVE ident_and_synch_msg_buf=identify_msg_buf+1;6 bytes RELATIVE synch_msgo_buf=ident_and_synch_msg_buf+6;synch_msgo_buf=5 bytes RELATIVE synch_msgi_buf=synch_msgo_buf+5 ;synch_msgi_buf=5 bytes RELATIVE cmd_buf=synch_msgi_buf+5 ;cmd_buf=12 bytes RELATIVE status_buf=cmd_buf+12 ;stat_buf=1 bytes RELATIVE msg_in_buf=status_buf+1 ;msg_in_buf=10 bytes RELATIVE read_data_buf = msg_in_buf+10 ;longword aligned RELATIVE write_data_buf = read_data_buf + 512 ;*********************************************************************** ; 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 SCSI_id, alternate_address JUMP to_decisions, WHEN NOT MSG_OUT ; The extended message (synchronous 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 6, ident_and_synch_msg_buf, WHEN MSG_OUT JUMP to_decisions, WHEN NOT MSG_IN synch_msg_in_phase: MOVE 1, 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 4, 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 6,cmd_buf, WHEN CMD JUMP to_decisions, WHEN NOT DATA_IN data_in_phase: MOVE 512,read_data_buf, WHEN DATA_IN JUMP status_phase, WHEN STATUS JUMP to_decisions data_out_phase: MOVE 512,write_data_buf, WHEN DATA_OUT JUMP to_decisions, WHEN NOT STATUS status_phase: MOVE 1,status_buf, WHEN STATUS JUMP to_decisions, WHEN NOT MSG_IN message_in_phase: MOVE 1,msg_buf, WHEN MSG_IN INT error_cmd_not_complete, IF NOT 0x00 CLEAR ACK 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