xref: /illumos-gate/usr/src/uts/common/sys/usb/clients/hid/hid_polled.h (revision d29f5a711240f866521445b1656d114da090335e)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 /*
26  * HID : This header file defines  project private interfaces between
27  * the USB keyboard module (usbkbm) and hid.
28  */
29 
30 #ifndef _SYS_USB_HID_POLLED_H
31 #define	_SYS_USB_HID_POLLED_H
32 
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 
39 /*
40  * These are project private interfaces between the USB keyboard
41  * module (usbkbm) and hid.
42  */
43 
44 /*
45  * These two messages are sent from usbkbm to hid to get and
46  * release the hid_polled_input_callback structure.
47  */
48 #define	HID_OPEN_POLLED_INPUT		0x1001
49 #define	HID_CLOSE_POLLED_INPUT	0x1002
50 
51 /*
52  * The version of this structure.  Increment this value if you change
53  * the structure.
54  */
55 #define	HID_POLLED_INPUT_V0		0
56 
57 /*
58  * Opaque handle.
59  */
60 typedef struct hid_polled_handle	*hid_polled_handle_t;
61 
62 typedef struct hid_polled_input_callback {
63 
64 	/*
65 	 * Structure version.
66 	 */
67 	unsigned		hid_polled_version;
68 
69 	/*
70 	 * This routine is called when we are entering polled mode.
71 	 */
72 	int		(*hid_polled_input_enter)(hid_polled_handle_t);
73 
74 	/*
75 	 * This is the routine used to read characters in polled mode.
76 	 */
77 	int		(*hid_polled_read)(hid_polled_handle_t,
78 					    uchar_t **);
79 
80 	/*
81 	 * This routine is called when we are exiting polled mode.
82 	 */
83 	int		(*hid_polled_input_exit)(hid_polled_handle_t);
84 
85 	/*
86 	 * Only one hid instance is allowed to be the console input
87 	 */
88 	int			hid_polled_instance;
89 
90 	/*
91 	 * Opaque handle used by hid.
92 	 */
93 	hid_polled_handle_t	hid_polled_input_handle;
94 } hid_polled_input_callback_t;
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #endif	/* _SYS_USB_HID_POLLED_H */
101