Changed active queue structure.
[unix-history] / usr / src / sys / news3400 / hbdev / hbvar.h
CommitLineData
af5295ff
KM
1/*
2 * Copyright (c) 1992 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
7 *
8 * %sccs.include.redist.c%
9 *
10 * from: $Hdr: hbvar.h,v 4.300 91/06/09 06:21:52 root Rel41 $ SONY
11 *
12 * @(#)hbvar.h 7.1 (Berkeley) %G%
13 */
14
15/*
16 * Copyright (c) 1987,1988 by SONY Corporation.
17 */
18
19/*
20 * hbvar.h.c ver 0.1
21 * Form Fri Dec 11 16:07:41 JST 1987
22 * Modify Thu Feb 2 08:57:52 JST 1989
23 *
24 */
25
26#ifndef __HBVAR__
27#define __HBVAR__ 1
28
29/*
30 * This file contains definitions related to the kernel structures
31 * for dealing with the HYPER-BUS interface.
32 *
33 * Each HYPER-BUS has a hb_hd structure.
34 * Each HYPER-BUS controller which is not a device has a hb_ctlr structure.
35 * Each HYPER-BUS device has a hb_device structure.
36 */
37
38#ifndef LOCORE
39/*
40 * Per-HYPER-BUS structure.
41 *
42 * This structure holds the interrupt vector for the HYPER-BUS,
43 * and its address in physical and virtual space. At boot time
44 * we determine the devices attached to the HYPER-BUS and their
45 * interrupt vectors, filling in vh_vec. We free the map
46 * register resources of the HYPER-BUS into the structures
47 * defined here.
48 *
49 * During normal operation, resources are allocated and returned
50 * to the structures here. We watch the number of passive releases
51 * on each HYPER-BUS, and if the number is excessive may reset the HYPER-BUS.
52 *
53 * When HYPER-BUS resources are needed and not available,
54 * then device drivers may have to wait to get to the bus and are
55 * queued here. It is also possible for processes to block in
56 * the HYPER-BUS driver in resource wait (mrwant); these
57 * wait states are also recorded here.
58 */
59struct hb_hd {
60 caddr_t hh_phys; /* Not used and init now. */
61};
62
63/*
64 * Per-controller structure.
65 *
66 * If a controller has devices attached, then there are
67 * cross-referenced hb_drive structures.
68 * This structure is the one which is queued in HYPER-BUS resource wait,
69 * and saves the information about HYPER-BUS resources which are used.
70 * The queue of devices waiting to transfer is also attached here.
71 */
72struct hb_ctlr {
73 struct hb_driver *hm_driver;
74 short hm_ctlr; /* controller index in driver */
75 short hm_alive; /* controller exists */
76 caddr_t hm_addr; /* address of command area */
77 int hm_intr; /* interrupt number */
78 short hm_scnum ; /* the scsi it is on */
79 struct hb_hd *hm_hd;
80 int hm_hbinfo; /* save map registers, etc */
81 struct buf hm_tab; /* queue of devices for this controller */
82};
83
84/*
85 * Per ``device'' structure.
86 *
87 * If a controller has many drives attached, then there will
88 * be several hb_device structures associated with a single hb_ctlr
89 * structure.
90 */
91struct hb_device {
92 struct hb_driver *hi_driver;
93 short hi_unit; /* unit number on the system */
94 short hi_ctlr; /* mass ctlr number; -1 if none */
95 short hi_slave; /* slave on controller */
96 caddr_t hi_addr; /* address of command area */
97 int hi_intr; /* interrupt number */
98 short hi_dk; /* if init 1 set to number for iostat */
99 int hi_flags; /* parameter from system specification */
100 short hi_alive; /* device exists */
101 short hi_type; /* driver specific type information */
102/* caddr_t hi_physaddr; /* phys addr, for standalone (dump) code */
103/* this is the forward link in a list of devices on a controller */
104 struct hb_device *hi_forw;
105/* if the device is connected to a controller, this is the controller */
106 struct hb_ctlr *hi_mi;
107 struct hb_hd *hi_hd;
108};
109
110/*
111 * Per-driver structure.
112 *
113 * Each HYPER-BUS driver defines entries for a set of routines
114 * as well as an array of types which are acceptable to it.
115 * These are used at boot time by the configuration program.
116 */
117struct hb_driver {
118 int (*hd_probe)(); /* see if a driver is really there */
119 int (*hd_slave)(); /* see if a slave is there */
120 int (*hd_attach)(); /* setup driver for a slave */
121 int (*hd_dgo)(); /* start transfer */
122 int (*hd_intr)(); /* interrupt handler */
123 char *hd_dname; /* name of a device */
124 struct hb_device **hd_dinfo; /* backpointers to hdinit structs */
125 char *hd_mname; /* name of a controller */
126 struct hb_ctlr **hd_minfo; /* backpointers to hminit structs */
127 short hd_xclu; /* want exclusive use */
128};
129
130#ifdef KERNEL
131
132/*
133 * HYPER-BUS related kernel variables
134 */
135struct hb_hd hb_hd;
136
137/*
138 * Hbinit and hdinit initialize the mass storage controller and
139 * device tables specifying possible devices.
140 */
141extern struct hb_ctlr hminit[];
142extern struct hb_device hdinit[];
143
144#endif /* KERNEL */
145
146#endif /* !LOCORE */
147
148#endif /* !__HBVAR__ */