hildevs.h revision 1.2.8.2 1 1.2.8.2 jruoho /* $NetBSD: hildevs.h,v 1.2.8.2 2011/06/06 09:07:49 jruoho Exp $ */
2 1.2.8.2 jruoho /* $OpenBSD: hildevs.h,v 1.4 2005/05/13 14:54:44 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 /* Entries in hildevs_data.h for device probe */
31 1.2.8.2 jruoho struct hildevice {
32 1.2.8.2 jruoho int minid;
33 1.2.8.2 jruoho int maxid;
34 1.2.8.2 jruoho int type;
35 1.2.8.2 jruoho const char *descr;
36 1.2.8.2 jruoho };
37 1.2.8.2 jruoho
38 1.2.8.2 jruoho /* Arguments passed to attach routines */
39 1.2.8.2 jruoho struct hil_attach_args {
40 1.2.8.2 jruoho int ha_code; /* hil code */
41 1.2.8.2 jruoho int ha_type; /* hil device type */
42 1.2.8.2 jruoho int ha_console; /* console set to hil */
43 1.2.8.2 jruoho int ha_infolen; /* identify info length */
44 1.2.8.2 jruoho uint8_t ha_info[HILBUFSIZE]; /* identify info bits */
45 1.2.8.2 jruoho #define ha_id ha_info[0] /* hil probe id */
46 1.2.8.2 jruoho
47 1.2.8.2 jruoho const char *ha_descr; /* device description */
48 1.2.8.2 jruoho };
49 1.2.8.2 jruoho
50 1.2.8.2 jruoho /* ha_type values */
51 1.2.8.2 jruoho #define HIL_DEVICE_KEYBOARD 1
52 1.2.8.2 jruoho #define HIL_DEVICE_IDMODULE 2
53 1.2.8.2 jruoho #define HIL_DEVICE_MOUSE 3
54 1.2.8.2 jruoho #define HIL_DEVICE_BUTTONBOX 4
55 1.2.8.2 jruoho
56 1.2.8.2 jruoho /* Common softc part for hil devices */
57 1.2.8.2 jruoho struct hildev_softc {
58 1.2.8.2 jruoho device_t sc_dev;
59 1.2.8.2 jruoho
60 1.2.8.2 jruoho int sc_code; /* hil code */
61 1.2.8.2 jruoho int sc_type; /* hil device type */
62 1.2.8.2 jruoho
63 1.2.8.2 jruoho int sc_infolen; /* identify info length */
64 1.2.8.2 jruoho uint8_t sc_info[HILBUFSIZE]; /* identify info bits */
65 1.2.8.2 jruoho
66 1.2.8.2 jruoho void (*sc_fn)(struct hildev_softc *, u_int, uint8_t *);
67 1.2.8.2 jruoho };
68 1.2.8.2 jruoho
69 1.2.8.2 jruoho #define hd_code sc_hildev.sc_code
70 1.2.8.2 jruoho #define hd_fn sc_hildev.sc_fn
71 1.2.8.2 jruoho #define hd_info sc_hildev.sc_info
72 1.2.8.2 jruoho #define hd_infolen sc_hildev.sc_infolen
73 1.2.8.2 jruoho #define hd_type sc_hildev.sc_type
74