hildevs.h revision 1.2.2.2 1 1.2.2.2 rmind /* $NetBSD: hildevs.h,v 1.2.2.2 2011/03/05 20:53:09 rmind Exp $ */
2 1.2.2.2 rmind /* $OpenBSD: hildevs.h,v 1.4 2005/05/13 14:54:44 miod Exp $ */
3 1.2.2.2 rmind /*
4 1.2.2.2 rmind * Copyright (c) 2003, Miodrag Vallat.
5 1.2.2.2 rmind * All rights reserved.
6 1.2.2.2 rmind *
7 1.2.2.2 rmind * Redistribution and use in source and binary forms, with or without
8 1.2.2.2 rmind * modification, are permitted provided that the following conditions
9 1.2.2.2 rmind * are met:
10 1.2.2.2 rmind * 1. Redistributions of source code must retain the above copyright
11 1.2.2.2 rmind * notice, this list of conditions and the following disclaimer.
12 1.2.2.2 rmind * 2. Redistributions in binary form must reproduce the above copyright
13 1.2.2.2 rmind * notice, this list of conditions and the following disclaimer in the
14 1.2.2.2 rmind * documentation and/or other materials provided with the distribution.
15 1.2.2.2 rmind *
16 1.2.2.2 rmind * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 1.2.2.2 rmind * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 1.2.2.2 rmind * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 1.2.2.2 rmind * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
20 1.2.2.2 rmind * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 1.2.2.2 rmind * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 1.2.2.2 rmind * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 1.2.2.2 rmind * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
24 1.2.2.2 rmind * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
25 1.2.2.2 rmind * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 1.2.2.2 rmind * POSSIBILITY OF SUCH DAMAGE.
27 1.2.2.2 rmind *
28 1.2.2.2 rmind */
29 1.2.2.2 rmind
30 1.2.2.2 rmind /* Entries in hildevs_data.h for device probe */
31 1.2.2.2 rmind struct hildevice {
32 1.2.2.2 rmind int minid;
33 1.2.2.2 rmind int maxid;
34 1.2.2.2 rmind int type;
35 1.2.2.2 rmind const char *descr;
36 1.2.2.2 rmind };
37 1.2.2.2 rmind
38 1.2.2.2 rmind /* Arguments passed to attach routines */
39 1.2.2.2 rmind struct hil_attach_args {
40 1.2.2.2 rmind int ha_code; /* hil code */
41 1.2.2.2 rmind int ha_type; /* hil device type */
42 1.2.2.2 rmind int ha_console; /* console set to hil */
43 1.2.2.2 rmind int ha_infolen; /* identify info length */
44 1.2.2.2 rmind uint8_t ha_info[HILBUFSIZE]; /* identify info bits */
45 1.2.2.2 rmind #define ha_id ha_info[0] /* hil probe id */
46 1.2.2.2 rmind
47 1.2.2.2 rmind const char *ha_descr; /* device description */
48 1.2.2.2 rmind };
49 1.2.2.2 rmind
50 1.2.2.2 rmind /* ha_type values */
51 1.2.2.2 rmind #define HIL_DEVICE_KEYBOARD 1
52 1.2.2.2 rmind #define HIL_DEVICE_IDMODULE 2
53 1.2.2.2 rmind #define HIL_DEVICE_MOUSE 3
54 1.2.2.2 rmind #define HIL_DEVICE_BUTTONBOX 4
55 1.2.2.2 rmind
56 1.2.2.2 rmind /* Common softc part for hil devices */
57 1.2.2.2 rmind struct hildev_softc {
58 1.2.2.2 rmind device_t sc_dev;
59 1.2.2.2 rmind
60 1.2.2.2 rmind int sc_code; /* hil code */
61 1.2.2.2 rmind int sc_type; /* hil device type */
62 1.2.2.2 rmind
63 1.2.2.2 rmind int sc_infolen; /* identify info length */
64 1.2.2.2 rmind uint8_t sc_info[HILBUFSIZE]; /* identify info bits */
65 1.2.2.2 rmind
66 1.2.2.2 rmind void (*sc_fn)(struct hildev_softc *, u_int, uint8_t *);
67 1.2.2.2 rmind };
68 1.2.2.2 rmind
69 1.2.2.2 rmind #define hd_code sc_hildev.sc_code
70 1.2.2.2 rmind #define hd_fn sc_hildev.sc_fn
71 1.2.2.2 rmind #define hd_info sc_hildev.sc_info
72 1.2.2.2 rmind #define hd_infolen sc_hildev.sc_infolen
73 1.2.2.2 rmind #define hd_type sc_hildev.sc_type
74