xref: /haiku/src/add-ons/kernel/bus_managers/ps2/ps2_dev.h (revision 487f65913b5901349b64b0c15d881486c644381c)
1d61a52a7SMarcus Overhagen /*
2d61a52a7SMarcus Overhagen  * Copyright 2005 Haiku, Inc.
3d61a52a7SMarcus Overhagen  * Distributed under the terms of the MIT License.
4d61a52a7SMarcus Overhagen  *
5d61a52a7SMarcus Overhagen  * PS/2 hid device driver
6d61a52a7SMarcus Overhagen  *
7d61a52a7SMarcus Overhagen  * Authors (in chronological order):
8d61a52a7SMarcus Overhagen  *		Marcus Overhagen (marcus@overhagen.de)
9d61a52a7SMarcus Overhagen  */
10d61a52a7SMarcus Overhagen #ifndef __PS2_DEV_H
11d61a52a7SMarcus Overhagen #define __PS2_DEV_H
12d61a52a7SMarcus Overhagen 
13*487f6591SMarcus Overhagen #include "ps2_common.h"
14d61a52a7SMarcus Overhagen 
15d61a52a7SMarcus Overhagen typedef struct
16d61a52a7SMarcus Overhagen {
17d61a52a7SMarcus Overhagen 	const char *	name;
18d61a52a7SMarcus Overhagen 	bool			active;
19d61a52a7SMarcus Overhagen 	uint32			flags;
20d61a52a7SMarcus Overhagen 	sem_id			result_sem;
21d61a52a7SMarcus Overhagen 	uint8 *			result_buf;
22d61a52a7SMarcus Overhagen 	int				result_buf_idx;
23d61a52a7SMarcus Overhagen 	int				result_buf_cnt;
24d61a52a7SMarcus Overhagen } ps2_dev;
25d61a52a7SMarcus Overhagen 
26d61a52a7SMarcus Overhagen extern ps2_dev ps2_device[5];
27d61a52a7SMarcus Overhagen 
28d61a52a7SMarcus Overhagen #define PS2_DEVICE_MOUSE 0
29d61a52a7SMarcus Overhagen #define PS2_DEVICE_KEYB  4
30d61a52a7SMarcus Overhagen 
31d61a52a7SMarcus Overhagen #define PS2_FLAG_KEYB    1
32d61a52a7SMarcus Overhagen 
33d61a52a7SMarcus Overhagen status_t	ps2_dev_init(void);
34d61a52a7SMarcus Overhagen void		ps2_dev_exit(void);
35d61a52a7SMarcus Overhagen 
36d61a52a7SMarcus Overhagen void		ps2_dev_publish(ps2_dev *dev);
37d61a52a7SMarcus Overhagen void		ps2_dev_unpublish(ps2_dev *dev);
38d61a52a7SMarcus Overhagen 
39d61a52a7SMarcus Overhagen int32		ps2_dev_handle_int(ps2_dev *dev, uint8 data);
40d61a52a7SMarcus Overhagen 
41d61a52a7SMarcus Overhagen #endif
42