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

1.1     ! root        1: #include       "scsi.h"
        !             2: 
        !             3: static
        !             4: table(drive, tab, data)
        !             5:        unsigned char *data;
        !             6: {
        !             7:        int n, i;
        !             8: 
        !             9:        n = data[6];
        !            10:        Fprint(1, "drive %d: alternate table %d (%d entries)\n", drive, tab, n);
        !            11:        for(data += 0x18, i = 0; i < n; data += 4, i++)
        !            12:                Fprint(1, "%lud%c", data[0]+256L*data[1]+256L*256*data[2],
        !            13:                        (i%10 == 9)? '\n':' ');
        !            14:        if((i%10) && n)
        !            15:                Fputc(1, '\n');
        !            16: }
        !            17: 
        !            18: s_alternate(drive)
        !            19: {
        !            20:        struct scsi_i input;
        !            21:        struct scsi_o output;
        !            22:        int i;
        !            23: 
        !            24:        input.bus_id = scsi_id;
        !            25:        input.cmd[0] = 0xC3;
        !            26:        input.cmd[1] = drive<<5;
        !            27:        input.cmd[2] = 0;
        !            28:        input.cmd[3] = 0;
        !            29:        input.cmd[4] = 0;
        !            30:        input.cmd[5] = 0;
        !            31:        if(scsiio(&input, 0, &output, 4096, "alternate") < 0)
        !            32:                return(1);
        !            33:        if(CHECK(output)){
        !            34:                prcheck(1, &output);
        !            35:                return(1);
        !            36:        } else {
        !            37:                for(i = 0; i < 4; i++)
        !            38:                        table(drive, i+1, &output.data[i*1024]);
        !            39:                return(0);
        !            40:        }
        !            41: }

unix.superglobalmegacorp.com

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