antoine-source/scsi2/SCSI.Drivers/SCSI Filter read

1 line
23 KiB
Plaintext
Raw Normal View History

;******************************************************* ; ; SCSI Driver 'Read' filter. ; ; Written by Matt Gulick. Started June 13,1988 ; ; Copyright Apple Computer, Inc. 1988,89 ; ;******************************************************* ;******************************************************* ; ; This file contains the 'Read' filter as defined in ; the ERS. ; ;******************************************************* ;******************************************************* ; ; Revision History: ; ;******************************************************* ; June 13, 1988 File started. ; June 20, 1988 Registers in and out are STRING PASCAL BLANKS OFF PAGESIZE 70 PRINT NOGEN PRINT NOMDIR MACHINE M65816 IMPORT unit_state IMPORT main_drvr IMPORT call_type IMPORT r_get_cache IMPORT r_all_in_cache IMPORT divend IMPORT divsor IMPORT result IMPORT max_blk_cnt IMPORT m_blk_size IMPORT m_blk_cnt IMPORT calc_bytes IMPORT m_rslt IMPORT gsos_dpage IMPORT divide IMPORT check_532_rw IMPORT chk_play_mode IMPORT auto_sense_data IMPORT sense_data IMPORT open_flag IMPORT get_data_status IMPORT internal_buff IMPORT scratch0 IMPORT internal PRINT OFF INCLUDE 'scsihd.equates' INCLUDE 'M16.MEMORY' INCLUDE 'M16.UTIL' PRINT ON EJECT IF block_dvc = true\ AND character_dvc = false THEN ;******************************************************* ; ; Main Entry point to the 'Read' filter. This ; "Filter" takes the information given by the caller ; on direct page and builds the equivilent to a Read ; Extended Status Call. In order of appearence: ; ; Verify that Device # <09> $0000 ; Call Number = $0002 ; Block Size = dib.blksize ; ; We now Build the SCSI Main Driver Command and send ; it. ; ; The following will be validated by the Main Driver ; when it builds the command. ; ; Request Count = Block Size * i ; Block Number = Blk Num + Offset ; This is for partitions. ; ; After calling the Main driver and if no errors were ; encountered, then the Transfer count will be ; updated. ; ; Inputs: None. ; ; Outputs: Acc = 0 ; Carry = 0 ; Y register = Unspecified ; X register = Unspecified ; P register = 0=M=X=e ; Direct Page = Ours ; Data Bank = Ours ; ; Errors: See Spec. ; ;******************************************************* ENDIF IF character_dvc = true\ AND block_dvc = false THEN ;******************************************************* ; ; Main Entry point to the 'Read' filter. This ; "Filter" takes the information given by the caller ; on direct page and builds the equivilent to a Read ; Extended Status Call. In order of appearence: ; ; Verify that Device # <09> $0000 ; Call Number = $0002 ; Block Size = $0000 ; Device Opened = True ; ; We now Build the SCSI Main Driver Command and send ; it. ; ; After calling the Main driver and if no errors were ; encountered, then the Transfer count will be ; updated. ; ; Inputs: None. ; ; Outputs: Acc = 0 ; Carry = 0 ; Y register = Unspecified ; X register = Unspecified ; P register = 0=M=X=e ; Direct Page = Ours ; Data Bank = Ours ; ; Errors: See Spec. ; ;******************************************************* ENDIF EXPORT Read Read PROC ;------------------------------------------------------------------------------- IF block_dvc = true\ AND character_dvc = false THEN stz @cache ; ; Is the device Removable? ; ldy #dib.dvcchar lda [dib_ptr],y and #removable beq @online ;No. ; ; This device is removable. Now we ; need to check to see if the unit ; has gone offline, (then we need to ; report that to the OS) or if the ; unit has come back online (Rebuild ; the DIBs). ; jsr unit_state bcs @rts_out ; ; Is the device online?