Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!sun-barr!cs.utexas.edu!uwm.edu!src.honeywell.com!msi.umn.edu!cs.umn.edu!atc!s5000!nightowl!hawkmoon!det From: det@hawkmoon.MN.ORG (Derek E. Terveer) Newsgroups: comp.unix.sysv386 Subject: power sequencing patch for ST-01 BETA Keywords: ESIX Message-ID: <1991Jan15.094414.1158@hawkmoon.MN.ORG> Date: 15 Jan 91 09:44:14 GMT Organization: Home System (One of the Eternal Champions); Eagan, MN, 55123-2507, USA Lines: 260 Here is the power sequencing patch for the recently posted st-01 beta driver (posted by mike@cimcor.mn.org) This power sequencing code works for me on my esix 5.3.2-d system running a wren iv. Your milage may vary. If anyone can tell me why i can't get the power down code at shutdown time to work, please let me know! (i'm no scsi expert, you see) *** scsi.c.old Sun Jan 13 20:53:57 1991 --- scsi.c Tue Jan 15 02:28:03 1991 *************** *** 25,34 **** #include #include #include #include "st01.h" #include "scommands.h" ! #define COPYRIGHT "scsi disk driver V2.0" #define ASM /* use certain routines coded in assembly */ #define TICKSPERSECOND HZ /* system timer ticks per second */ --- 25,42 ---- #include #include #include + #include #include "st01.h" #include "scommands.h" ! #define then ! #define FALSE 0 ! #define FAIL 0 ! #define TRUE 1 ! #define SUCCESS 1 ! char *pid="st01: "; /* this program's identification */ + #define COPYRIGHT "scsi disk driver V2.1" + #define ASM /* use certain routines coded in assembly */ #define TICKSPERSECOND HZ /* system timer ticks per second */ *************** *** 1183,1188 **** --- 1191,1265 ---- return 1; } + /******************************************************************************* + * * + * start_unit() * + * * + ******************************************************************************/ + + + /* This starts/stops the motor on a drive. + */ + + static int + start_unit(unit,start) + + int unit; + int start; /* true if start, else stop */ + + { + int cc; + char cmd[6]; + + #if defined(DEBUG) + printf("start_unit(%d,st%s)\n",unit,start?"art":"op"); + #endif + + cmd[0]=SS_ST_SP; + cmd[1]=unit<<5 + start?0:1; /* return status immediately if stop */ + cmd[2]=0; + cmd[3]=0; + cmd[4]=start?1:0; /* turn motor on or off */ + cmd[5]=0; + + cc=doscsicmd(unit,cmd,NULL,0,start?250:10,2,0,0,0,NULL); + if (cc!=COK && cc!=CDISCONNECT) { + printf("%scouldn't st%s unit %d! (%d)\n",pid,start?"art":"op",unit,cc); + return(FAIL); + } + return(SUCCESS); + } /* start_unit */ + + /******************************************************************************* + * * + * scsihalt() * + * * + * This routine is *not* called during reboot operations, i.e., init 5 or init * + * 6. Only when init 0 is invoked. * + * * + ******************************************************************************/ + + + extern + scsihalt() + + { long l; + int unit; + + /* stop all drives + */ + + #if defined(DEBUG) + printf("scsihalt()\n"); + #endif + + for (unit=0; unit