Home | History | Annotate | Line # | Download | only in isa
      1 /* $NetBSD: pcppivar.h,v 1.12 2017/06/14 05:01:35 pgoyette 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 (at) 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 	void (*pa_bell_func)(pcppi_tag_t, int, int, int);
     38 };
     39 
     40 struct pcppi_softc {
     41 	device_t sc_dv;
     42 
     43 	bus_space_tag_t sc_iot;
     44 	bus_space_handle_t sc_ppi_ioh;
     45 	bus_size_t sc_size;
     46 	device_t sc_timer;
     47 
     48 	int sc_bellactive, sc_bellpitch;
     49 	int sc_timeout;
     50 
     51 	kcondvar_t sc_slp;
     52 	callout_t sc_bell_ch;
     53 };
     54 
     55 void pcppi_attach(struct pcppi_softc *);
     56 int pcppi_detach(device_t, int);
     57 
     58 #define	PCPPI_BELL_SLEEP	0x01	/* synchronous; sleep for complete */
     59 #define	PCPPI_BELL_POLL		0x02	/* synchronous; poll for complete */
     60 
     61 void pcppi_bell(pcppi_tag_t, int, int, int);
     62 void pcppi_bell_locked(pcppi_tag_t, int, int, int);
     63 
     64 #endif /* ! _PCPPIVAR_H_ */
     65