hilvar.h revision 1.2.8.2 1 1.2.8.2 jruoho /* $NetBSD: hilvar.h,v 1.2.8.2 2011/06/06 09:07:49 jruoho Exp $ */
2 1.2.8.2 jruoho /* $OpenBSD: hilvar.h,v 1.10 2006/11/05 14:39:32 miod Exp $ */
3 1.2.8.2 jruoho /*
4 1.2.8.2 jruoho * Copyright (c) 2003, Miodrag Vallat.
5 1.2.8.2 jruoho * All rights reserved.
6 1.2.8.2 jruoho *
7 1.2.8.2 jruoho * Redistribution and use in source and binary forms, with or without
8 1.2.8.2 jruoho * modification, are permitted provided that the following conditions
9 1.2.8.2 jruoho * are met:
10 1.2.8.2 jruoho * 1. Redistributions of source code must retain the above copyright
11 1.2.8.2 jruoho * notice, this list of conditions and the following disclaimer.
12 1.2.8.2 jruoho * 2. Redistributions in binary form must reproduce the above copyright
13 1.2.8.2 jruoho * notice, this list of conditions and the following disclaimer in the
14 1.2.8.2 jruoho * documentation and/or other materials provided with the distribution.
15 1.2.8.2 jruoho *
16 1.2.8.2 jruoho * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 1.2.8.2 jruoho * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 1.2.8.2 jruoho * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 1.2.8.2 jruoho * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
20 1.2.8.2 jruoho * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 1.2.8.2 jruoho * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 1.2.8.2 jruoho * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 1.2.8.2 jruoho * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
24 1.2.8.2 jruoho * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
25 1.2.8.2 jruoho * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 1.2.8.2 jruoho * POSSIBILITY OF SUCH DAMAGE.
27 1.2.8.2 jruoho *
28 1.2.8.2 jruoho */
29 1.2.8.2 jruoho
30 1.2.8.2 jruoho /*
31 1.2.8.2 jruoho * Copyright (c) 1988 University of Utah.
32 1.2.8.2 jruoho * Copyright (c) 1990, 1993
33 1.2.8.2 jruoho * The Regents of the University of California. All rights reserved.
34 1.2.8.2 jruoho *
35 1.2.8.2 jruoho * This code is derived from software contributed to Berkeley by
36 1.2.8.2 jruoho * the Systems Programming Group of the University of Utah Computer
37 1.2.8.2 jruoho * Science Department.
38 1.2.8.2 jruoho *
39 1.2.8.2 jruoho * Redistribution and use in source and binary forms, with or without
40 1.2.8.2 jruoho * modification, are permitted provided that the following conditions
41 1.2.8.2 jruoho * are met:
42 1.2.8.2 jruoho * 1. Redistributions of source code must retain the above copyright
43 1.2.8.2 jruoho * notice, this list of conditions and the following disclaimer.
44 1.2.8.2 jruoho * 2. Redistributions in binary form must reproduce the above copyright
45 1.2.8.2 jruoho * notice, this list of conditions and the following disclaimer in the
46 1.2.8.2 jruoho * documentation and/or other materials provided with the distribution.
47 1.2.8.2 jruoho * 3. Neither the name of the University nor the names of its contributors
48 1.2.8.2 jruoho * may be used to endorse or promote products derived from this software
49 1.2.8.2 jruoho * without specific prior written permission.
50 1.2.8.2 jruoho *
51 1.2.8.2 jruoho * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
52 1.2.8.2 jruoho * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
53 1.2.8.2 jruoho * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
54 1.2.8.2 jruoho * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
55 1.2.8.2 jruoho * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
56 1.2.8.2 jruoho * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
57 1.2.8.2 jruoho * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
58 1.2.8.2 jruoho * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
59 1.2.8.2 jruoho * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
60 1.2.8.2 jruoho * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
61 1.2.8.2 jruoho * SUCH DAMAGE.
62 1.2.8.2 jruoho *
63 1.2.8.2 jruoho * from: Utah $Hdr: hilvar.h 1.3 92/01/21$
64 1.2.8.2 jruoho *
65 1.2.8.2 jruoho * @(#)hilvar.h 8.1 (Berkeley) 6/10/93
66 1.2.8.2 jruoho */
67 1.2.8.2 jruoho
68 1.2.8.2 jruoho #define NHILD 8 /* 7 actual + loop pseudo (dev 0) */
69 1.2.8.2 jruoho
70 1.2.8.2 jruoho struct hildev_softc;
71 1.2.8.2 jruoho
72 1.2.8.2 jruoho struct hil_softc {
73 1.2.8.2 jruoho device_t sc_dev;
74 1.2.8.2 jruoho bus_space_handle_t sc_bsh;
75 1.2.8.2 jruoho bus_space_tag_t sc_bst;
76 1.2.8.2 jruoho int *sc_console; /* console path set to hil */
77 1.2.8.2 jruoho
78 1.2.8.2 jruoho lwp_t *sc_thread; /* event handling thread */
79 1.2.8.2 jruoho
80 1.2.8.2 jruoho int sc_cmddone;
81 1.2.8.2 jruoho int sc_cmdending;
82 1.2.8.2 jruoho u_int sc_actdev; /* current input device */
83 1.2.8.2 jruoho u_int sc_cmddev; /* device to perform command on */
84 1.2.8.2 jruoho uint8_t sc_pollbuf[HILBUFSIZE]; /* interrupt time input buf */
85 1.2.8.2 jruoho uint8_t sc_cmdbuf[HILBUFSIZE];
86 1.2.8.2 jruoho uint8_t *sc_pollbp; /* pointer into sc_pollbuf */
87 1.2.8.2 jruoho uint8_t *sc_cmdbp; /* pointer into sc_cmdbuf */
88 1.2.8.2 jruoho
89 1.2.8.2 jruoho int sc_status; /* initialization status */
90 1.2.8.2 jruoho #define HIL_STATUS_BUSY 0x00
91 1.2.8.2 jruoho #define HIL_STATUS_READY 0x01
92 1.2.8.2 jruoho int sc_pending; /* reconfiguration events in progress */
93 1.2.8.2 jruoho #define HIL_PENDING_RECONFIG 0x01
94 1.2.8.2 jruoho #define HIL_PENDING_UNPLUGGED 0x02
95 1.2.8.2 jruoho u_int sc_maxdev; /* number of devices on loop */
96 1.2.8.2 jruoho device_t sc_devices[NHILD]; /* interrupt dispatcher */
97 1.2.8.2 jruoho };
98 1.2.8.2 jruoho
99 1.2.8.2 jruoho #ifdef _KERNEL
100 1.2.8.2 jruoho
101 1.2.8.2 jruoho int send_hil_cmd(struct hil_softc *, u_int, uint8_t *, u_int, uint8_t *);
102 1.2.8.2 jruoho int send_hildev_cmd(struct hildev_softc *, u_int, uint8_t *, u_int *);
103 1.2.8.2 jruoho void hil_set_poll(struct hil_softc *, int);
104 1.2.8.2 jruoho int hil_poll_data(struct hildev_softc *, uint8_t *, uint8_t *);
105 1.2.8.2 jruoho
106 1.2.8.2 jruoho void hil_attach(struct hil_softc *, int *);
107 1.2.8.2 jruoho void hil_attach_deferred(device_t);
108 1.2.8.2 jruoho int hil_intr(void *);
109 1.2.8.2 jruoho int hildevprint(void *, const char *);
110 1.2.8.2 jruoho
111 1.2.8.2 jruoho #endif /* _KERNEL */
112