xref: /netbsd-src/sys/dev/isa/pcppivar.h (revision a5847cc334d9a7029f6352b847e9e8d71a0f9e0c)
1 /* $NetBSD: pcppivar.h,v 1.10 2011/05/03 04:27:13 mrg Exp $ */
2 
3 /*
4  * Copyright (c) 1996 Carnegie-Mellon University.
5  * All rights reserved.
6  *
7  * Author: Chris G. Demetriou
8  *
9  * Permission to use, copy, modify and distribute this software and
10  * its documentation is hereby granted, provided that both the copyright
11  * notice and this permission notice appear in all copies of the
12  * software, derivative works or modified versions, and any portions
13  * thereof, and that both notices appear in supporting documentation.
14  *
15  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18  *
19  * Carnegie Mellon requests users of this software to return to
20  *
21  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
22  *  School of Computer Science
23  *  Carnegie Mellon University
24  *  Pittsburgh PA 15213-3890
25  *
26  * any improvements or extensions that they make and grant Carnegie the
27  * rights to redistribute these changes.
28  */
29 
30 #ifndef _PCPPIVAR_H_
31 #define _PCPPIVAR_H_
32 
33 typedef void *pcppi_tag_t;
34 
35 struct pcppi_attach_args {
36 	pcppi_tag_t pa_cookie;
37 };
38 
39 struct pcppi_softc {
40 	device_t sc_dv;
41 
42 	bus_space_tag_t sc_iot;
43 	bus_space_handle_t sc_ppi_ioh;
44 	bus_size_t sc_size;
45 	device_t sc_timer;
46 
47 	struct callout sc_bell_ch;
48 
49 	int sc_bellactive, sc_bellpitch;
50 	int sc_slp;
51 	int sc_timeout;
52 
53 	kmutex_t sc_lock;
54 	kcondvar_t sc_stop_cv;
55 };
56 
57 void pcppi_attach(struct pcppi_softc *);
58 int pcppi_detach(device_t, int);
59 
60 #define	PCPPI_BELL_SLEEP	0x01	/* synchronous; sleep for complete */
61 #define	PCPPI_BELL_POLL		0x02	/* synchronous; poll for complete */
62 
63 void pcppi_bell(pcppi_tag_t, int, int, int);
64 
65 #endif /* ! _PCPPIVAR_H_ */
66