antoine-source/scsi2/SCSI.Drivers/SCSI Set Vol:Disk

1 line
20 KiB
Plaintext
Raw Normal View History

;******************************************************* ; ; SCSI Driver Set Volume/Disk Parms code. ; ; Written by Matt Gulick. Started April 17,1991 ; ; Copyright Apple Computer, Inc. 1990 ; ;******************************************************* ;******************************************************* ; ; This file contains the Set Volume/Disk Parms as ; defined in the ERS. ; ;******************************************************* ;******************************************************* ; ; Revision History: ; ;******************************************************* ; April 17, 1991 File started. IMPORT chk_count IMPORT length IMPORT rqst IMPORT gc_buff_ptr IMPORT count IMPORT temp IMPORT error IMPORT ddm_index IMPORT pre_load_ddm IMPORT pdata_block IMPORT find_drvr_part IMPORT set_drvr_ndex EJECT ;******************************************************* ; ; 's_vol_parms' ; ; This routine is used to set information about the ; volume. Calls should have the DIB Pointer set to ; the volume for which the information is being ; requested. ; ; The structure of the parameter list is defined in the ; SCSI Driver ERS. The parameters are going to depend ; greatly on the type of device that this driver is ; written for. That means that the info for the Scanner ; will not be the same in any form as that for a Hard ; Disk, or a Tape drive. These calls will be particular ; for the device type supported. ; ; Called via 'JSR' ; ; Inputs: [dib_ptr] = Target DIB (LONG) ; [buff_ptr] = Data Buffer Pointer (LONG) ; Acc = Unspecified ; Carry = Unspecified ; Y register = Unspecified ; X register = Unspecified ; P register = 0=M=X=e ; Direct Page = Ours ; Data Bank = Ours ; ; Returns via 'RTS' ; ; Outputs: Acc = 0 ; Carry = 0 ; or ; Acc = Error ; Carry = 1 ; ; Y register = Unspecified ; X register = Unspecified ; P register = 0=M=X=e ; Direct Page = Ours ; Data Bank = Ours ; ; Errors: See Spec. ; ;******************************************************* EXPORT svp svp ; ; Check the Request Count. Volume calls ; need 2 bytes. ; lda <rqst_cnt+2 bne @rqst_cnt_ok lda <rqst_cnt cmp #$0002 blt @bad_cnt ; ; Check Bitmap. ; @rqst_cnt_ok lda [buff_ptr] ; ; Do the Volume Parms Here. ; Acc = Bitmap on entry. ; sta |bitmap and #vconf_resv2++\ vconf_resv3++\ ;Check Bits that are not supported vconf_resv4++\ ;at this time. vconf_resv5++\ vconf_resv6 bne @exit_parm ;If unsupported bit set then error out. ; ; Check for Remount Bit ; lda |bitmap and #vconf_remount beq @next_0 jsr remount_vol ; ; Check Status Bits Flag. If set, then we ; use the low byte of this word to set the ; status bits in the Partition Map and in ; the DIB Status. ; @next_0 lda |bitmap and #vconf_set_stat beq @next_1 jsr set_stat_bits @next_1 bcs @rts lda #$0002 sta <trans_cnt lda #null sta <trans_cnt+2 clc @rts rts ; ; Error exit point. ; @bad_cnt lda #drvr_bad_cnt brl exit_none ; ; Drive is Offline. ; @not_online lda #drvr_off_line sec rts ; ; Not from a partition. ; @exit_parm brl exit_parm ; ; Routines used by the above code to ; perform the requested task. ; remount_vol ; ; Mark this DIB as Switched and Hard ; Offline. ; ldy #dib.dvcflag lda [dib_ptr],y ora #dvc_online++\ dvc_switch and #dvc_hardofl--\ $ffff sta [dib_ptr],y ; ; Generate a Disk Switched Event ; jsr set_disk_sw ; ; Clean E