1*30294Ssam /* vbavar.h 1.4 86/12/15 */ 223998Ssam 323998Ssam /* 423998Ssam * This file contains definitions related to the kernel structures 525923Ssam * for dealing with the VERSAbus adapters. 623998Ssam * 725923Ssam * Each VERSAbus has a vba_hd structure. 825923Ssam * Each VERSAbus controller which is not a device has a vba_ctlr structure. 925923Ssam * Each VERSAbus device has a vba_device structure. 1023998Ssam */ 1123998Ssam 1223998Ssam #ifndef LOCORE 1323998Ssam /* 1425857Ssam * Per-vba structure. 1525857Ssam */ 1625857Ssam struct vba_hd { 1725857Ssam int vh_lastiv; /* last interrupt vector assigned */ 1825857Ssam }; 1925857Ssam 2025857Ssam /* 2123998Ssam * Per-controller structure. 2223998Ssam * (E.g. one for each disk and tape controller, and other things 2323998Ssam * which use and release buffered data paths.) 2423998Ssam * 2523998Ssam * If a controller has devices attached, then there are 2623998Ssam * cross-referenced vba_drive structures. 2725923Ssam * This structure is the one which is queued in VERSAbus resource wait, 2825923Ssam * and saves the information about VERSAbus resources which are used. 2923998Ssam * The queue of devices waiting to transfer is also attached here. 3023998Ssam */ 3123998Ssam struct vba_ctlr { 3223998Ssam struct vba_driver *um_driver; 3323998Ssam short um_ctlr; /* controller index in driver */ 3423998Ssam short um_vbanum; /* the vba it is on */ 3523998Ssam short um_alive; /* controller exists */ 3623998Ssam int (**um_intr)(); /* interrupt handler(s) */ 3723998Ssam caddr_t um_addr; /* address of device in i/o space */ 3825857Ssam struct vba_hd *um_hd; 3923998Ssam /* the driver saves the prototype command here for use in its go routine */ 4023998Ssam int um_cmd; /* communication to dgo() */ 4125923Ssam int um_vbinfo; /* save VERSAbus registers, etc */ 4223998Ssam struct buf um_tab; /* queue of devices for this controller */ 4323998Ssam }; 4423998Ssam 4523998Ssam /* 4623998Ssam * Per ``device'' structure. 4723998Ssam * (A controller has devices or uses and releases buffered data paths). 4823998Ssam * (Everything else is a ``device''.) 4923998Ssam * 5023998Ssam * If a controller has many drives attached, then there will 5123998Ssam * be several vba_device structures associated with a single vba_ctlr 5223998Ssam * structure. 5323998Ssam * 5423998Ssam * This structure contains all the information necessary to run 5525923Ssam * a VERSAbus device. It also contains information 5625923Ssam * for slaves of VERSAbus controllers as to which device on the slave 5723998Ssam * this is. A flags field here can also be given in the system specification 5825923Ssam * and is used to tell which tty lines are hard wired or other device 5923998Ssam * specific parameters. 6023998Ssam */ 6123998Ssam struct vba_device { 6223998Ssam struct vba_driver *ui_driver; 6323998Ssam short ui_unit; /* unit number on the system */ 6423998Ssam short ui_ctlr; /* mass ctlr number; -1 if none */ 6523998Ssam short ui_vbanum; /* the vba it is on */ 6623998Ssam short ui_slave; /* slave on controller */ 6723998Ssam int (**ui_intr)(); /* interrupt handler(s) */ 6823998Ssam caddr_t ui_addr; /* address of device in i/o space */ 6923998Ssam short ui_dk; /* if init 1 set to number for iostat */ 7025923Ssam long ui_flags; /* parameter from system specification */ 7123998Ssam short ui_alive; /* device exists */ 7223998Ssam short ui_type; /* driver specific type information */ 7323998Ssam caddr_t ui_physaddr; /* phys addr, for standalone (dump) code */ 7423998Ssam /* this is the forward link in a list of devices on a controller */ 7523998Ssam struct vba_device *ui_forw; 7623998Ssam /* if the device is connected to a controller, this is the controller */ 7723998Ssam struct vba_ctlr *ui_mi; 7825857Ssam struct vba_hd *ui_hd; 7923998Ssam }; 8023998Ssam #endif 8123998Ssam 8223998Ssam /* 8323998Ssam * Per-driver structure. 8423998Ssam * 8525923Ssam * Each VERSAbus driver defines entries for a set of routines 8623998Ssam * as well as an array of types which are acceptable to it. 8723998Ssam * These are used at boot time by the configuration program. 8823998Ssam */ 8923998Ssam struct vba_driver { 9023998Ssam int (*ud_probe)(); /* see if a driver is really there */ 9123998Ssam int (*ud_slave)(); /* see if a slave is there */ 9223998Ssam int (*ud_attach)(); /* setup driver for a slave */ 9323998Ssam int (*ud_dgo)(); /* fill csr/ba to start transfer */ 9423998Ssam long *ud_addr; /* device csr addresses */ 9523998Ssam char *ud_dname; /* name of a device */ 9623998Ssam struct vba_device **ud_dinfo; /* backpointers to vbdinit structs */ 9723998Ssam char *ud_mname; /* name of a controller */ 9823998Ssam struct vba_ctlr **ud_minfo; /* backpointers to vbminit structs */ 9923998Ssam }; 10023998Ssam 10123998Ssam #ifndef LOCORE 10223998Ssam #ifdef KERNEL 10323998Ssam /* 10423998Ssam * VBA related kernel variables 10523998Ssam */ 10625857Ssam int numvba; /* number of uba's */ 10725857Ssam struct vba_hd vba_hd[]; 10823998Ssam 10923998Ssam /* 11023998Ssam * Vbminit and vbdinit initialize the mass storage controller and 11123998Ssam * device tables specifying possible devices. 11223998Ssam */ 11323998Ssam extern struct vba_ctlr vbminit[]; 11423998Ssam extern struct vba_device vbdinit[]; 11523998Ssam 11623998Ssam /* 11725923Ssam * VERSAbus device address space is mapped by VMEMmap 11825923Ssam * into virtual address vmem[][]. 11923998Ssam */ 12023998Ssam extern struct pte VMEMmap[]; /* vba device addr pte's */ 121*30294Ssam extern caddr_t vmem; /* vba device addr space */ 12223998Ssam #endif KERNEL 12323998Ssam #endif !LOCORE 124