Annotation of researchv10dc/cmd/worm/scsi/generic/display.c, revision 1.1.1.1

1.1       root        1: #include       <stdio.h>
                      2: #include       "../scsi.h"
                      3: #include       "../scsish.h"
                      4: #include       "../tcl.h"
                      5: #include       "fns.h"
                      6: 
                      7: extern char *gen_rmb[2];
                      8: extern char *gen_devtype[256];
                      9: 
                     10: int
                     11: gen_display(ClientData cd, Tcl_Interp *it, int argc, char **argv)
                     12: {
                     13:        struct scsi_cmd cmd;
                     14:        struct scsi_return ret;
                     15:        int n, i, old_id;
                     16:        int retv = TCL_OK;
                     17:        char rev[100], vendor[100], product[100];
                     18: 
                     19: #pragma ref argc
                     20: #pragma ref argv
                     21: 
                     22:        old_id = s_id;
                     23:        for(s_id = 0; s_id < 8; s_id++){
                     24:                printf("target %d:\n");
                     25:                set6(cmd, 0x00, 0, 0, 0, 0, 0);
                     26:                if(s_io(0, &cmd, 0, &ret, 0, cd->err))
                     27:                        continue;
                     28:        printf("responded to test unit ready\n");
                     29:        continue;
                     30:                for(i = 0; i < 8; i++){
                     31:                        set6(cmd, 0x12, i<<5, 0, 0, 36, 0);
                     32:                        if(s_io(0, &cmd, 0, &ret, -36, cd->err)){
                     33:                                it->result = cd->err;
                     34:                                retv = TCL_ERROR;
                     35:                                break;
                     36:                        }
                     37:                        if(ret.nread >= 16)
                     38:                                fixedstr(&ret.data[8], 8, vendor);
                     39:                        else
                     40:                                sprintf(vendor, "??");
                     41:                        if(ret.nread >= 32)
                     42:                                fixedstr(&ret.data[16], 16, product);
                     43:                        else
                     44:                                sprintf(product, "??");
                     45:                        if(ret.nread >= 16)
                     46:                                fixedstr(&ret.data[32], 4, rev);
                     47:                        else
                     48:                                sprintf(vendor, "??");
                     49:                        printf("\tlun(%d): %s %s, %s/%s rev=%s\n", i,
                     50:                                gen_rmb[ret.data[1]>>7], gen_devtype[ret.data[0]],
                     51:                                vendor, product, rev);
                     52:                }
                     53:        }
                     54:        s_id = old_id;
                     55:        return(retv);
                     56: }

unix.superglobalmegacorp.com

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