diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-05-03 09:10:29 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-05-03 09:10:29 +0000 |
commit | 595cbd2e050401adf0cab2bab6ce52f902dfbb54 (patch) | |
tree | 8474c159022572bb93d15b7f2c287d1044321bc1 /sys/arch/vax/mba/mbavar.h | |
parent | 3472e7ae763d3e453e57b218243b6d60ece25b43 (diff) |
sync w/ 0430
Diffstat (limited to 'sys/arch/vax/mba/mbavar.h')
-rw-r--r-- | sys/arch/vax/mba/mbavar.h | 107 |
1 files changed, 67 insertions, 40 deletions
diff --git a/sys/arch/vax/mba/mbavar.h b/sys/arch/vax/mba/mbavar.h index b020564bee6..212e489a77f 100644 --- a/sys/arch/vax/mba/mbavar.h +++ b/sys/arch/vax/mba/mbavar.h @@ -1,4 +1,4 @@ -/* $NetBSD: mbavar.h,v 1.1 1995/02/13 00:44:04 ragge Exp $ */ +/* $NetBSD: mbavar.h,v 1.4 1996/04/08 18:39:01 ragge Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden * All rights reserved. @@ -29,9 +29,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - /* All bugs are subject to removal without further notice */ - -/* Mba n}nting... ragge 940311 */ +#include <sys/device.h> #define MBCR_INIT 1 #define MBCR_IE (1<<2) @@ -47,48 +45,77 @@ #define OPEN 3 #define OPENRAW 4 -struct mba_ctrl { - struct mba_regs *mba_regs; - struct mba_device *mba_device[8]; +#define MAXMBADEV 8 /* Max units per MBA */ + +/* + * Devices that have different device drivers. + */ +enum mb_devices { + MB_RP, /* RM/RP disk */ + MB_TU, /* TM03 based tape, ex. TU45 or TU77 */ + MB_MT /* TU78 tape */ +}; + +/* + * Current state of the adapter. + */ +enum sc_state { + SC_AUTOCONF, + SC_ACTIVE, + SC_IDLE +}; + +/* + * Return value after a finished data transfer, from device driver. + */ +enum xfer_action { + XFER_RESTART, + XFER_FINISH }; -struct mba_device { - struct mba_driver *driver; - int unit; - int mbanum; - int drive; - int dk; - int alive; - int type; - struct mba_regs *mi_mba; - struct mba_hd *hd; - int drv; - int device; +/* + * Info passed do unit device driver during autoconfig. + */ +struct mba_attach_args { + int unit; + int type; + char *name; + enum mb_devices devtyp; }; -struct mba_slave { - struct mba_driver *driver; - int ctlr; - int unit; - int slave; - int alive; +/* + * Common struct used to communicate between the mba device driver + * and the unit device driver. + */ +struct mba_device { + struct mba_device *md_back; /* linked list of runnable devices */ + /* Start routine to be called by mbastart. */ + void (*md_start) __P((struct mba_device *)); + /* Routine to be called after attn intr */ + int (*md_attn)__P((struct mba_device *)); + /* Call after xfer finish */ + enum xfer_action (*md_finish) __P((struct mba_device *, int, int *)); + void *md_softc; /* Backpointer to this units softc. */ + struct mba_softc *md_mba; + struct buf md_q; /* Buffer head for transfers */ }; -struct mba_driver { - int (*slave)(); - char *sname; - char *dname; - short *type; - int (*attach)(); - struct mba_device **info; +struct mba_softc { + struct device sc_dev; + struct ivec_dsp sc_dsp; /* Interrupt catch routine */ + struct mba_regs *sc_mbareg; + struct mba_device *sc_first, *sc_last; + enum sc_state sc_state; + int sc_physnr; /* Physical number of this mba */ + struct mba_device *sc_md[MAXMBADEV]; }; -struct mba_hd { - struct mba_device *device[8]; /* XXX - Var tidigare mh_mbip */ - int ndrive; - int mh_active; - struct mba_regs *mh_mba; - struct mba_regs *mh_physmba; - struct mba_device *mh_actf; - struct mba_device *mh_actl; +struct mbaunit { + int nr; + char *name; + enum mb_devices devtyp; }; + +/* Common prototypes */ +void mbaqueue __P((struct mba_device *)); + |