Article 89368 of comp.os.vms:
Xref: mv comp.os.vms:89368 comp.periphs.scsi:47039 comp.sys.dec:29414 comp.unix.osf.misc:2917 comp.unix.osf.osf1:12834
Newsgroups: comp.os.vms,comp.sys.dec,comp.unix.osf.misc,comp.unix.osf.osf1,comp.periphs.scsi
Path: mv!mv.mv.com!morris
From: morris@mv.mv.com (Skip Morris)
Subject: Re: Can an RZ23/24 spin up at power up?
Message-ID: <DID8DF.Co0@mv.mv.com>
Organization: MV Communications, Inc.
Date: Mon, 20 Nov 1995 23:39:14 GMT
References: <48l8qk$lpm@amhux3.amherst.edu> <DIBr7E.K81@world.std.com>
X-Nntp-Posting-Host: mv.mv.com
Lines: 309

From foley@axel.enet.dec.com Fri Jan 20 14:42:53 1995
Received: from inet-gw-2.pa.dec.com by mv.mv.com (8.6.9/mv(b)/mem-940616)
	id OAA14613 for <morris@mv.mv.com>; Fri, 20 Jan 1995 14:42:45 -0500
Received: from us2rmc.zko.dec.com by inet-gw-2.pa.dec.com (5.65/10Aug94)
	id AA11928; Fri, 20 Jan 95 11:06:24 -0800
Received: from axel.enet by us2rmc.zko.dec.com (5.65/rmc-22feb94)
	id AA15303; Fri, 20 Jan 95 14:05:49 -0500
Message-Id: <9501201905.AA15303@us2rmc.zko.dec.com>
Received: from axel.enet; by us2rmc.enet; Fri, 20 Jan 95 14:05:53 EST
Date: Fri, 20 Jan 95 14:05:53 EST
From: "We are all just prisoners here, of our own device" <foley@axel.enet.dec.com>
To: skip@axel.enet.dec.com
Apparently-To: morris@mv.MV.COM
Subject: RZ23_SPINUP.MAR
Status: RO

;        <<< NOTED::DISK$NOTES10:[NOTES$LIBRARY_10OF4]IBMPC-93.NOTE;1 >>>
;                        -< IBM PCs, clones, DOS, etc. >-
;===============================================================================
;Note 734.38                 Help with RZ23 on a a PC                    38 of38
;USWRSL::HARRIS_MA "Sales Consultant"                284 lines  10-NOV-199312:32
;                           -< VMS Code does it too! >-
;-------------------------------------------------------------------------------
;    And then there is the OLD standby that can be edited on any uVAX 3100
;    type system and run.
;    1. Extract this to SPINUP.MAR
;    2. Edit the line dealing with DKA100
;    3. at DCL:	$ MACRO SPINUP
;    		$ LINK SPINUP
;    		$ RUN SPINUP
;    4. It should return with a Message 000000000.
;    5. All set!
;
;	This works also. Set to enable spinup for dka100.
;	Find the line below in the source and change to the 
;	device you want to spinup on power on.
;
; Look for the following line to change unit/dev number 
;devnam:	.ascid	/dkA100/	SCSI unit 1 on "A" SCSI bus
;                        ^^^^^^
;-----------------------
	.TITLE	spe - Spin up enable for RZ23-type disk drives
	.IDENT	/x01.00/
 
;++
; FACILITY: [~tbs~]
; 
; FUNCTIONAL DESCRIPTION:
; 
;	 This routine enables spin up on power up for RZ23 drives.  It uses the
;	 GKDRIVER generic SCSI port interface to send the appropriate command
;	 directly to the device.
; 
; ENVIRONMENT: VMS V5.3 with support for generic SCSI devices
; 
; AUTHOR: Todd Little, CREATION-DATE: 11-Sep-1989
; 
; MODIFIED BY: 
; 
;--
;
	.SUBTITLE DECLARATIONS
 
 
; OWN STORAGE:
 
ms_cmd:
	.byte	^x15		; opcode - MODE_SELECT
	.byte	1		; flags - Save Parameters
	.byte	0		; reserved
	.byte	0		; reserved
	.byte	ms_data_len	; parameter list length
	.byte	0		; control byte

ms_cmd_len = .-ms_cmd

;
; parameter list for the MODE_SELECT
;
ms_data:
;
; Mode Sense/Select header
;
	.byte	0		; reserved
	.byte	0		; medium type (direct access)
	.byte	0		; reserved
	.byte	8		; block descriptor length
;
; Block Descriptor
;
	.byte	0		; density code
	.byte	3		; number of blocks (MSB)
	.byte	^x20		;        "
	.byte	^x40		;        "         (LSB)
	.byte	0		; reserved
	.byte	0		; block length (MSB)
	.byte	2		;       "
	.byte	0		;       "      (LSB)

;
; Contents of page 25h
;
	.byte	^x25		; page code
	.byte	^X17		; length
	.byte	0		; bit 0 means spin up disable
	.byte	0[22]		; remaining 22 bytes reserved

ms_data_len = .-ms_data

;
; SCSI descriptors for GKDRIVER IO$_DIAGNOSE functions
;
ms_desc:
	.long		1		; opcode - pass-through
	.long		0		; flags
	.address	ms_cmd		; address of command buffer
	.long		ms_cmd_len	; length of SCSI command
	.address	ms_data		; address of data buffer
	.long		ms_data_len	; length of data buffer
	.long		0		; SCSI pad length
	.long		0		; phase change timeout
	.long		0		; disconnect timeout
	.long		0[6]		; reserved

ms_desc_len = .-ms_desc


tur_cmd:
	.byte	0		; opcode - TEST UNIT READY
	.byte	0		; LUN and reserved
	.byte	0		; reserved
	.byte	0		; reserved
	.byte	0		; reserved
	.byte	0		; control byte

tur_cmd_len = .-tur_cmd

tur_desc:
	.long		1		; opcode - pass-through
	.long		0		; flags
	.address	tur_cmd		; address of command buffer
	.long		tur_cmd_len	; length of SCSI command
	.long		0		; address of data
	.long		0		; length of data buffer
	.long		0		; SCSI pad length
	.long		0		; phase change timeout
	.long		0		; disconnect timeout
	.long		0[6]		; reserved

tur_desc_len = .-tur_desc

ssu_cmd:
	.byte	^x1b		; opcode - START_STOP_UNIT
	.byte	0		; 1 - return immed, 0 return after spin up
	.byte	0		; reserved
	.byte	0		; reserved
	.byte	1		; 0 - stop unit, 1 start unit
	.byte	0		; control byte

ssu_cmd_len = .-ssu_cmd

ssu_desc:
	.long		1		; opcode - pass-through
	.long		0		; flags
	.address	ssu_cmd		; address of command buffer
	.long		ssu_cmd_len	; length of SCSI command
	.long		0		; address of data buffer
	.long		0		; length of data buffer
	.long		0		; SCSI pad length
	.long		0		; phase change timeout
	.long		0		; disconnect timeout
	.long		0[6]		; reserved

ssu_desc_len = .-ssu_desc

devnam:	.ascid	/dka100/		; SCSI unit 1 on A SCSI bus

chan:	.blkw	1		; channel number
iosb:	.blkw	4		; I/O status block

 


















	.SUBTITLE Main routine
 
;++
; FUNCTIONAL DESCRIPTION:
; 
;	 [~tbs~]
; 
; CALLING SEQUENCE:
; 
;	 [~tbs~]
; 
; INPUT PARAMETERS:
; 
;	 [~tbs~]
; 
; IMPLICIT INPUTS:
; 
;	 [~tbs~]
; 
; OUTPUT PARAMETERS:
; 
;	 [~tbs~]
; 
; IMPLICIT OUTPUTS:
; 
;	 [~tbs~]
; 
; COMPLETION CODES:
; 
;	 [~tbs~]
; 
; SIDE EFFECTS:
; 
;	 [~tbs~]
; 
;--
;
	.ENTRY	spe,0
	$assign_s -
		devnam = devnam, -
		chan   = chan
	blbs	r0,1$				; go on if no error
	pushl	r0
	calls	#1,g^lib$signal			; otherwise, signal the error

1$:
	$qiow_s -				; issue the SCSI command
		chan   = chan, -
		efn    = #1, -
		func   = #IO$_DIAGNOSE, -
		iosb   = iosb, -
		p1     = tur_desc, -
		p2     = #tur_desc_len
	blbs	r0,2$				; go on if no error
	pushl	r0
	calls	#1,g^lib$signal			; otherwise, signal error
2$:	blbs	iosb,3$				; check the IOSB
	movzwl	iosb,-(sp)
	calls	#1,g^lib$signal			; signal any IOSB errors
3$:

	$qiow_s -				; issue the SCSI command
		chan   = chan, -
		efn    = #1, -
		func   = #IO$_DIAGNOSE, -
		iosb   = iosb, -
		p1     = tur_desc, -
		p2     = #tur_desc_len
	blbs	r0,4$				; go on if no error
	pushl	r0
	calls	#1,g^lib$signal			; otherwise, signal error
4$:	blbs	iosb,5$				; check the IOSB
	movzwl	iosb,-(sp)
	calls	#1,g^lib$signal			; signal any IOSB errors
5$:
	$qiow_s -				; issue the SCSI command
		chan   = chan, -
		efn    = #1, -
		func   = #IO$_DIAGNOSE, -
		iosb   = iosb, -
		p1     = ssu_desc, -
		p2     = #ssu_desc_len
	blbs	r0,6$				; go on if no error
	pushl	r0
	calls	#1,g^lib$signal			; otherwise, signal error
6$:	blbs	iosb,7$				; check the IOSB
	movzwl	iosb,-(sp)
	calls	#1,g^lib$signal			; signal any IOSB errors
7$:

	$qiow_s -				; issue the SCSI command
		chan   = chan, -
		efn    = #1, -
		func   = #IO$_DIAGNOSE, -
		iosb   = iosb, -
		p1     = tur_desc, -
		p2     = #tur_desc_len
	blbs	r0,8$				; go on if no error
	pushl	r0
	calls	#1,g^lib$signal			; otherwise, signal error
8$:	blbs	iosb,9$				; check the IOSB
	movzwl	iosb,-(sp)
	calls	#1,g^lib$signal			; signal any IOSB errors
9$:

	$qiow_s -				; issue the SCSI command
		chan   = chan, -
		efn    = #1, -
		func   = #IO$_DIAGNOSE, -
		iosb   = iosb, -
		p1     = ms_desc, -
		p2     = #ms_desc_len
	blbs	r0,10$				; go on if no error
	pushl	r0
	calls	#1,g^lib$signal			; otherwise, signal error
10$:	blbs	iosb,11$			; check the IOSB
	movzwl	iosb,-(sp)
	calls	#1,g^lib$signal			; signal any IOSB errors
11$:

	movzbl	iosb+7,r0
	$exit_s -
		code   = r0
	.END	spe
    




