Annotation of researchv10dc/cmd/oworm/scsi/reset.c, revision 1.1

1.1     ! root        1: #include       "scsi.h"
        !             2: 
        !             3: s_reset()
        !             4: {
        !             5:        struct scsi_i input;
        !             6:        struct scsi_o output;
        !             7:        register i, n;
        !             8: 
        !             9:        input.bus_id = 0x8000;
        !            10:        input.cmd[0] = 0x0;     /* test unit ready */
        !            11:        input.cmd[1] = 0<<5;
        !            12:        input.cmd[2] = 0;
        !            13:        input.cmd[3] = 0;
        !            14:        input.cmd[4] = 0;
        !            15:        input.cmd[5] = 0;
        !            16:        if(scsiio(&input, 0, &output, 0, "reset") < 0)
        !            17:                return(1);
        !            18:        sleep(5);
        !            19:        for(i = 0; i < 60; i++){
        !            20:                sleep(2);
        !            21: s_sense(0, 0);
        !            22:                n = s_sensei(&input, 0, 0);
        !            23:                if(scsiio(&input, 0, &output, n, "reset sense") < 0)
        !            24:                        return(1);
        !            25:                if(output.scsistatus == 0){
        !            26:                        print("done\n");
        !            27:                        return(0);
        !            28:                }
        !            29:                print(".");
        !            30:        }
        !            31:        return(0);
        !            32: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.