Annotation of researchv10dc/cmd/oworm/oscsi/disk.c, revision 1.1

1.1     ! root        1: #include       "scsi.h"
        !             2: 
        !             3: s_diskset(shelf, side, drive, complain)
        !             4: {
        !             5:        struct scsi_i input;
        !             6:        struct scsi_o output;
        !             7: 
        !             8:        input.bus_id = 1<<scsi_id;
        !             9:        input.cmd[0] = 0xD6;
        !            10:        input.cmd[1] = drive<<5;
        !            11:        input.cmd[2] = 0;
        !            12:        input.cmd[3] = (shelf<<1)|side;
        !            13:        input.cmd[4] = 0;
        !            14:        input.cmd[5] = 0;
        !            15:        if(scsiio(&input, &output, 0, "set") < 0)
        !            16:                return(1);
        !            17:        if(CHECK(output)){
        !            18:                if(complain)
        !            19:                        scsidump(&output);
        !            20:                return(1);
        !            21:        }
        !            22:        return(0);
        !            23: }
        !            24: 
        !            25: s_diskrelease(shelf, side, drive, complain)
        !            26: {
        !            27:        struct scsi_i input;
        !            28:        struct scsi_o output;
        !            29: 
        !            30:        input.bus_id = 1<<scsi_id;
        !            31:        input.cmd[0] = 0xD7;
        !            32:        input.cmd[1] = (drive<<5)|(shelf >= 0);
        !            33:        input.cmd[2] = 0;
        !            34:        input.cmd[3] = (shelf<<1)|side;
        !            35:        input.cmd[4] = 0;
        !            36:        input.cmd[5] = 0;
        !            37:        if(scsiio(&input, &output, 0, "release") < 0)
        !            38:                return(1);
        !            39:        if(CHECK(output)){
        !            40:                if(complain) scsidump(&output);
        !            41:                return(1);
        !            42:        }
        !            43:        return(0);
        !            44: }
        !            45: 
        !            46: s_diskeject(drive)
        !            47: {
        !            48:        struct scsi_i input;
        !            49:        struct scsi_o output;
        !            50: 
        !            51:        input.bus_id = 1<<scsi_id;
        !            52:        input.cmd[0] = 0xC0;
        !            53:        input.cmd[1] = drive<<5;
        !            54:        input.cmd[2] = 0;
        !            55:        input.cmd[3] = 0;
        !            56:        input.cmd[4] = 0;
        !            57:        input.cmd[5] = 0;
        !            58:        if(scsiio(&input, &output, 0, "eject") < 0)
        !            59:                return(1);
        !            60:        if(CHECK(output)){
        !            61:                scsidump(&output);
        !            62:                return(1);
        !            63:        }
        !            64:        return(0);
        !            65: }

unix.superglobalmegacorp.com

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