Annotation of 43BSDTahoe/cci/dr11/loop.c, revision 1.1

1.1     ! root        1: 
        !             2: #include <stdio.h>
        !             3: #include <sys/types.h>
        !             4: #include <sys/buf.h>
        !             5: #include <sys/drreg.h>
        !             6: #include <sys/ioctl.h>
        !             7: 
        !             8: struct dr11io drio;
        !             9: 
        !            10: /*
        !            11: *      DR11 loop back test
        !            12: *      usage: loop [unit]
        !            13: */
        !            14: main(argc,argv)
        !            15: long argc;
        !            16: char *argv[];
        !            17: {      long fd;
        !            18:        char *DR11 = "/dev/dr11";
        !            19:        long unit = 0;
        !            20: 
        !            21:        fd = open(DR11,2);
        !            22:        if (fd == -1) {
        !            23:                fprintf(stderr,"\nloop: cannot open %s",DR11);
        !            24:                perror(" : ");
        !            25:                exit(1);
        !            26:        }
        !            27:        if (argc > 1)
        !            28:                sscanf(argv[1],"%ld",&unit);
        !            29:        drio.arg[0] = unit;     /* Unit no. */
        !            30:        ioctl(fd,DR11STAT,(caddr_t)&drio);
        !            31:        prdrio(&drio,unit);
        !            32: 
        !            33:        printf("\n ---- Perform loopback test ----");
        !            34:        drio.arg[0] = unit;     /* Unit 0 */
        !            35:        ioctl(fd,DR11LOOP,(caddr_t)&drio);
        !            36:        printf("\n Done....");
        !            37: 
        !            38:        drio.arg[0] = unit;
        !            39:        ioctl(fd,DR11STAT,(caddr_t)&drio);
        !            40:        prdrio(&drio,unit);
        !            41: 
        !            42:        close(fd);
        !            43: }
        !            44: 
        !            45: 
        !            46: prdrio(drio,unit)
        !            47: struct dr11io *drio;
        !            48: {
        !            49:        printf("\n\t------------- DR11 unit %ld Status ------------",unit);
        !            50:        printf("\n\t  dr_flags  CSR   istat  idata  modvec  dmacnt  hiadr  loadr");
        !            51:        printf("\n\t    %04lx    %04lx  %04lx   %04lx   %04lx    %04ld    %04lx   %04lx",
        !            52:                drio->arg[0],drio->arg[1],drio->arg[2],drio->arg[3] & 0xffff,
        !            53:                drio->arg[4],drio->arg[5],drio->arg[6],drio->arg[7]);
        !            54:        printf("\n");
        !            55: }
        !            56: 

unix.superglobalmegacorp.com

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