+/*
+ * Bits in mbd_ds.
+ */
+#define MBD_DRY 0x80 /* drive ready */
+#define MBD_MOL 0x1000 /* medium on line */
+#define MBD_DPR 0x100 /* drive present */
+#define MBD_ERR 0x4000 /* error in drive */
+
+/*
+ * Bits in mbd_dt
+ */
+#define MBDT_NSA 0x8000 /* not sector addressible */
+#define MBDT_TAP 0x4000 /* is a tape */
+#define MBDT_MOH 0x2000 /* moving head */
+#define MBDT_7CH 0x1000 /* 7 channel */
+#define MBDT_DRQ 0x800 /* drive request required */
+#define MBDT_SPR 0x400 /* slave present */
+
+#define MBDT_TYPE 0x1ff
+#define MBDT_MASK (MBDT_NSA|MBDT_TAP|MBDT_TYPE)
+
+/* type codes for disk drives */
+#define MBDT_RP04 020
+#define MBDT_RP05 021
+#define MBDT_RP06 022
+#define MBDT_RP07 042
+#define MBDT_RM03 024
+#define MBDT_RM05 027
+#define MBDT_RM80 026
+
+/* type codes for tape drives */
+#define MBDT_TM03 050
+#define MBDT_TE16 051
+#define MBDT_TU45 052
+#define MBDT_TU77 054
+#define MBDT_TU78 0140 /* can't handle these (yet) */
+
+/*
+ * Each driver has an array of pointers to these structures, one for
+ * each device it is willing to handle. At bootstrap time, the
+ * driver tables are filled in;
+ */
+struct mba_info {
+ struct mba_driver *mi_driver;
+ short mi_name; /* two character generic name */
+ short mi_unit; /* unit number to the system */
+ short mi_mbanum; /* the mba it is on */
+ short mi_drive; /* controller on mba */
+ short mi_slave; /* slave to controller (TM03/TU16) */
+ short mi_dk; /* driver number for iostat */
+ short mi_alive; /* device exists */
+ short mi_type; /* driver specific unit type */
+ struct buf mi_tab; /* head of queue for this device */
+ struct mba_info *mi_forw;
+/* we could compute these every time, but hereby save time */
+ struct mba_regs *mi_mba;
+ struct mba_drv *mi_drv;
+ struct mba_hd *mi_hd;
+};
+
+/*
+ * The initialization routine uses the information in the mbinit table
+ * to initialize the drive type routines in the drivers and the
+ * mbahd array summarizing which devices are hooked to which massbus slots.
+ */
+struct mba_hd {
+ short mh_active;
+ short mh_flags;
+ struct mba_regs *mh_mba; /* virt addr of mba */
+ struct mba_regs *mh_physmba; /* phys addr of mba */
+ struct mba_info *mh_mbip[8]; /* what is attached */
+ struct mba_info *mh_actf; /* head of queue to transfer */
+ struct mba_info *mh_actl; /* tail of queue to transfer */
+} mba_hd[4];
+/*
+ * Values for flags; normally MH_NOSEEK will be set when there is
+ * only a single drive on an massbus.
+ */
+#define MH_NOSEEK 1
+#define MH_NOSEARCH 2
+
+/*
+ * Each massbus driver defines entries for a set of routines
+ * as well as an array of types which are acceptable to it.
+ */
+struct mba_driver {
+ int (*md_dkinit)(); /* setup dk info (mspw) */
+ int (*md_ustart)(); /* unit start routine */
+ int (*md_start)(); /* setup a data transfer */
+ int (*md_dtint)(); /* data transfer complete */
+ int (*md_ndint)(); /* non-data transfer interrupt */
+ short *md_type; /* array of drive type codes */
+ struct mba_info **md_info; /* backpointers to mbinit structs */