Annotation of lucent/sys/src/9/pc/scsi.c, revision 1.1

1.1     ! root        1: #include "u.h"
        !             2: #include "../port/lib.h"
        !             3: #include "mem.h"
        !             4: #include "dat.h"
        !             5: #include "fns.h"
        !             6: #include "io.h"
        !             7: #include "../port/error.h"
        !             8: 
        !             9: /*
        !            10:  * Known to devscsi.c.
        !            11: int scsidebugs[8];
        !            12: int scsiownid = CtlrID;
        !            13:  */
        !            14: 
        !            15: void
        !            16: initscsi(void)
        !            17: {
        !            18: }
        !            19: 
        !            20: /*
        !            21:  * Quick hack. Need to do a better job of dynamic initialisation
        !            22:  * for machines with peculiar memory/cache restictions.
        !            23:  * Also, what about 16Mb address limit on the Adaptec?
        !            24:  */
        !            25: static ulong bufdatasize;
        !            26: 
        !            27: void
        !            28: scsibufreset(ulong datasize)
        !            29: {
        !            30:        bufdatasize = datasize;
        !            31: }
        !            32: 
        !            33: Scsibuf *
        !            34: scsibuf(void)
        !            35: {
        !            36:        Scsibuf *b;
        !            37: 
        !            38:        b = smalloc(sizeof(*b));
        !            39:        b->virt = smalloc(bufdatasize);
        !            40:        b->phys = (void *)(PADDR(b->virt));
        !            41:        return b;
        !            42: }
        !            43: 
        !            44: void
        !            45: scsifree(Scsibuf *b)
        !            46: {
        !            47:        free(b->virt);
        !            48:        free(b);
        !            49: }
        !            50: 
        !            51: extern int (*aha1542reset(void))(Scsi*, int);
        !            52: extern int (*ultra14freset(void))(Scsi*, int);
        !            53: 
        !            54: static int (*exec)(Scsi*, int);
        !            55: 
        !            56: int
        !            57: scsiexec(Scsi *p, int rflag)
        !            58: {
        !            59:        if(exec == 0)
        !            60:                error(Enonexist);
        !            61:        return (*exec)(p, rflag);
        !            62: }
        !            63: 
        !            64: void
        !            65: resetscsi(void)
        !            66: {
        !            67:        if(exec = aha1542reset())
        !            68:                return;
        !            69:        exec = ultra14freset();
        !            70: }

unix.superglobalmegacorp.com

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