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

1.1     ! root        1: #include       "scsi.h"
        !             2: 
        !             3: s_inquiry(id, drive)
        !             4: {
        !             5:        struct scsi_i input;
        !             6:        struct scsi_o output;
        !             7: 
        !             8:        input.bus_id = id;
        !             9:        input.cmd[0] = 0x12;
        !            10:        input.cmd[1] = drive<<5;
        !            11:        input.cmd[2] = 0;
        !            12:        input.cmd[3] = 0;
        !            13:        input.cmd[4] = 6;
        !            14:        input.cmd[5] = 0;
        !            15:        if(scsiio(&input, 0, &output, 6, "inquiry") < 0)
        !            16:                return(1);
        !            17:        Fprint(1, "drive %d,%d: ", id, drive);
        !            18:        if(output.data[5]&0x80)
        !            19:                Fprint(1, "power off (0x%x)\n", output.data[5]&0xFF);
        !            20:        else
        !            21:                Fprint(1, "%s,%s,%s,%s,%s (0x%x)\n",
        !            22:                        (output.data[5]&0x40)?"no disk":"disk",
        !            23:                        (output.data[5]&0x08)?"write protect":"writable",
        !            24:                        (output.data[5]&0x04)?"no alternate":"",
        !            25:                        (output.data[5]&0x02)?"drive error":"",
        !            26:                        (output.data[5]&0x01)?"ready":"not ready",
        !            27:                        output.data[5]&0xFF);
        !            28:        return(0);
        !            29: }

unix.superglobalmegacorp.com

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