xref: /csrg-svn/sys/luna68k/stand/device.h (revision 57083)
1*57083Sakito /*
2*57083Sakito  * Copyright (c) 1992 OMRON Corporation.
3*57083Sakito  * Copyright (c) 1992 The Regents of the University of California.
4*57083Sakito  * All rights reserved.
5*57083Sakito  *
6*57083Sakito  * This code is derived from software contributed to Berkeley by
7*57083Sakito  * OMRON Corporation.
8*57083Sakito  *
9*57083Sakito  * %sccs.include.redist.c%
10*57083Sakito  *
11*57083Sakito  *	@(#)device.h	7.1 (Berkeley) 12/13/92
12*57083Sakito  */
13*57083Sakito 
14*57083Sakito struct driver {
15*57083Sakito 	int	(*d_init)();
16*57083Sakito 	char	*d_name;
17*57083Sakito 	int	(*d_start)();
18*57083Sakito 	int	(*d_go)();
19*57083Sakito 	int	(*d_intr)();
20*57083Sakito 	int	(*d_done)();
21*57083Sakito };
22*57083Sakito 
23*57083Sakito struct hp_ctlr {
24*57083Sakito 	struct driver	*hp_driver;
25*57083Sakito 	int		hp_unit;
26*57083Sakito 	int		hp_alive;
27*57083Sakito 	char		*hp_addr;
28*57083Sakito 	int		hp_flags;
29*57083Sakito 	int		hp_ipl;
30*57083Sakito };
31*57083Sakito 
32*57083Sakito struct hp_device {
33*57083Sakito 	struct driver	*hp_driver;
34*57083Sakito 	struct driver	*hp_cdriver;
35*57083Sakito 	int		hp_unit;
36*57083Sakito 	int		hp_ctlr;
37*57083Sakito 	int		hp_slave;
38*57083Sakito 	char		*hp_addr;
39*57083Sakito 	int		hp_dk;
40*57083Sakito 	int		hp_flags;
41*57083Sakito 	int		hp_alive;
42*57083Sakito 	int		hp_ipl;
43*57083Sakito };
44*57083Sakito 
45*57083Sakito struct	devqueue {
46*57083Sakito 	struct	devqueue *dq_forw;
47*57083Sakito 	struct	devqueue *dq_back;
48*57083Sakito 	int	dq_ctlr;
49*57083Sakito 	int	dq_unit;
50*57083Sakito 	int	dq_slave;
51*57083Sakito 	struct	driver *dq_driver;
52*57083Sakito };
53*57083Sakito 
54*57083Sakito struct hp_hw {
55*57083Sakito 	char	*hw_addr;	/* physical address of registers */
56*57083Sakito 	short	hw_sc;		/* select code (if applicable) */
57*57083Sakito 	short	hw_type;	/* type (defined below) */
58*57083Sakito 	short	hw_id;		/* HW returned id */
59*57083Sakito 	short	hw_id2;		/* secondary HW id (displays) */
60*57083Sakito 	char	*hw_name;	/* HP product name */
61*57083Sakito };
62*57083Sakito 
63*57083Sakito #define	MAX_CTLR	16	/* Totally arbitrary */
64*57083Sakito #define	MAXSLAVES	8	/* Currently the HPIB limit */
65*57083Sakito 
66*57083Sakito #define	WILD_CARD_CTLR	0
67*57083Sakito 
68*57083Sakito /* A controller is a card which can have one or more slaves attached */
69*57083Sakito #define	CONTROLLER	0x10
70*57083Sakito #define	HPIB		0x16
71*57083Sakito #define	SCSI		0x17
72*57083Sakito #define	VME		0x18
73*57083Sakito #define	FLINK		0x19
74*57083Sakito 
75*57083Sakito /* Slaves are devices which attach to controllers, e.g. disks, tapes */
76*57083Sakito #define	RD		0x2a
77*57083Sakito #define	PPI		0x2b
78*57083Sakito #define	CT		0x2c
79*57083Sakito 
80*57083Sakito /* These are not controllers, but may have their own HPIB address */
81*57083Sakito #define	BITMAP		1
82*57083Sakito #define	NET		2
83*57083Sakito #define	FPA		4
84*57083Sakito #define	MISC		5
85*57083Sakito #define	KEYBOARD	6
86*57083Sakito #define	COMMDCA		7
87*57083Sakito #define	COMMDCM		8
88*57083Sakito #define	COMMDCL		9
89*57083Sakito #define	PPORT		10
90*57083Sakito #define	SIO		11
91*57083Sakito 
92*57083Sakito #ifdef KERNEL
93*57083Sakito extern struct hp_ctlr	hp_cinit[];
94*57083Sakito extern struct hp_device	hp_dinit[];
95*57083Sakito extern struct hp_hw	sc_table[];
96*57083Sakito #endif
97