vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / kernel / bus_managers / ps2 / ps2_alps.h
blob4e25dc6485d97b0634d250f5ab72ca0c60ed214e
1 /*
2 * Copyright 2011, Haiku, Inc.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Clemens Zeidler (haiku@Clemens-Zeidler.de)
7 */
8 #ifndef ALPS_H
9 #define ALPS_H
11 #include <KernelExport.h>
13 #include <touchpad_settings.h>
15 #include "movement_maker.h"
16 #include "packet_buffer.h"
17 #include "ps2_dev.h"
20 typedef struct {
21 ps2_dev* dev;
23 sem_id sem;
24 struct packet_buffer* ring_buffer;
25 size_t packet_index;
26 uint8 buffer[PS2_PACKET_ALPS];
27 uint8 mode;
29 uint8 previousZ;
30 TouchpadMovement movementMaker;
32 touchpad_settings settings;
33 } alps_cookie;
36 status_t probe_alps(ps2_dev *dev);
38 status_t alps_open(const char *name, uint32 flags, void **_cookie);
39 status_t alps_close(void *_cookie);
40 status_t alps_freecookie(void *_cookie);
41 status_t alps_ioctl(void *_cookie, uint32 op, void *buffer, size_t length);
43 int32 alps_handle_int(ps2_dev *dev);
44 void alps_disconnect(ps2_dev *dev);
46 extern device_hooks gALPSDeviceHooks;
49 #endif /* ALPS_H */