xref: /haiku/src/add-ons/kernel/bus_managers/ps2/ps2_alps.h (revision 4a55cc230cf7566cadcbb23b1928eefff8aea9a2)
1 /*
2  * Copyright 2011, Haiku, Inc.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Clemens Zeidler (haiku@Clemens-Zeidler.de)
7  */
8 #ifndef ALPS_H
9 #define ALPS_H
10 
11 #include <KernelExport.h>
12 
13 #include "packet_buffer.h"
14 #include "ps2_dev.h"
15 
16 
17 typedef struct {
18 			ps2_dev*			dev;
19 
20 			sem_id				sem;
21 	struct	packet_buffer*		ring_buffer;
22 			size_t				packet_index;
23 			uint8				buffer[PS2_PACKET_ALPS];
24 			uint8				mode;
25 
26 			uint8				previousZ;
27 } alps_cookie;
28 
29 
30 status_t probe_alps(ps2_dev *dev);
31 
32 status_t alps_open(const char *name, uint32 flags, void **_cookie);
33 status_t alps_close(void *_cookie);
34 status_t alps_freecookie(void *_cookie);
35 status_t alps_ioctl(void *_cookie, uint32 op, void *buffer, size_t length);
36 
37 int32 alps_handle_int(ps2_dev *dev);
38 void alps_disconnect(ps2_dev *dev);
39 
40 extern device_hooks gALPSDeviceHooks;
41 
42 
43 #endif /* ALPS_H */
44