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