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