| 1 | /* $NetBSD: pcppivar.h,v 1.11 2011/11/23 23:07:32 jmcneill 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 | int sc_bellactive, sc_bellpitch; |
| 48 | int sc_timeout; |
| 49 | |
| 50 | kcondvar_t sc_slp; |
| 51 | callout_t sc_bell_ch; |
| 52 | }; |
| 53 | |
| 54 | void pcppi_attach(struct pcppi_softc *); |
| 55 | int pcppi_detach(device_t, int); |
| 56 | |
| 57 | #define PCPPI_BELL_SLEEP 0x01 /* synchronous; sleep for complete */ |
| 58 | #define PCPPI_BELL_POLL 0x02 /* synchronous; poll for complete */ |
| 59 | |
| 60 | void pcppi_bell(pcppi_tag_t, int, int, int); |
| 61 | void pcppi_bell_locked(pcppi_tag_t, int, int, int); |
| 62 | |
| 63 | #endif /* ! _PCPPIVAR_H_ */ |
| 64 | |