15bb8f085SStephan Aßmus /* 2*819b4547SJohn Scipione * Copyright 2001-2014 Haiku, Inc. All rights reserved. 35bb8f085SStephan Aßmus * Distributed under the terms of the MIT License. 45bb8f085SStephan Aßmus * 55bb8f085SStephan Aßmus * Authors (in chronological order): 6*819b4547SJohn Scipione * Elad Lahav, elad@eldarshany.com 7*819b4547SJohn Scipione * Stefano Ceccherini, burton666@libero.it 85bb8f085SStephan Aßmus * Axel Dörfler, axeld@pinc-software.de 9*819b4547SJohn Scipione * Marcus Overhagen, marcus@overhagen.de 10*819b4547SJohn Scipione * Clemens Zeidler, czeidler@gmx.de 11*819b4547SJohn Scipione * John Scipione, jscipione@gmail.com 125bb8f085SStephan Aßmus */ 13802b6330SStephan Aßmus #ifndef __PS2_STANDARD_MOUSE_H 14802b6330SStephan Aßmus #define __PS2_STANDARD_MOUSE_H 155bb8f085SStephan Aßmus 162c494653SAxel Dörfler 175bb8f085SStephan Aßmus #include <Drivers.h> 185bb8f085SStephan Aßmus 195bb8f085SStephan Aßmus #include "packet_buffer.h" 205bb8f085SStephan Aßmus 212c494653SAxel Dörfler 22802b6330SStephan Aßmus #define MOUSE_HISTORY_SIZE 256 235bb8f085SStephan Aßmus // we record that many mouse packets before we start to drop them 245bb8f085SStephan Aßmus 25802b6330SStephan Aßmus #define F_MOUSE_TYPE_STANDARD 0x1 26802b6330SStephan Aßmus #define F_MOUSE_TYPE_INTELLIMOUSE 0x2 275bb8f085SStephan Aßmus 282c494653SAxel Dörfler typedef struct { 295bb8f085SStephan Aßmus ps2_dev* dev; 305bb8f085SStephan Aßmus 315bb8f085SStephan Aßmus sem_id standard_mouse_sem; 32e637ccf5SClemens Zeidler struct packet_buffer* standard_mouse_buffer; 335bb8f085SStephan Aßmus bigtime_t click_last_time; 345bb8f085SStephan Aßmus bigtime_t click_speed; 355bb8f085SStephan Aßmus int click_count; 365bb8f085SStephan Aßmus int buttons_state; 375bb8f085SStephan Aßmus int flags; 385bb8f085SStephan Aßmus size_t packet_index; 39e637ccf5SClemens Zeidler uint8 buffer[PS2_MAX_PACKET_SIZE]; 405bb8f085SStephan Aßmus } standard_mouse_cookie; 415bb8f085SStephan Aßmus 425bb8f085SStephan Aßmus 435bb8f085SStephan Aßmus status_t probe_standard_mouse(ps2_dev* dev); 445bb8f085SStephan Aßmus 455bb8f085SStephan Aßmus status_t standard_mouse_open(const char* name, uint32 flags, void** _cookie); 465bb8f085SStephan Aßmus status_t standard_mouse_close(void* _cookie); 475bb8f085SStephan Aßmus status_t standard_mouse_freecookie(void* _cookie); 485bb8f085SStephan Aßmus status_t standard_mouse_ioctl(void* _cookie, uint32 op, void* buffer, 495bb8f085SStephan Aßmus size_t length); 505bb8f085SStephan Aßmus 515bb8f085SStephan Aßmus int32 standard_mouse_handle_int(ps2_dev* dev); 525bb8f085SStephan Aßmus void standard_mouse_disconnect(ps2_dev* dev); 535bb8f085SStephan Aßmus 54e637ccf5SClemens Zeidler extern device_hooks gStandardMouseDeviceHooks; 552c494653SAxel Dörfler 565bb8f085SStephan Aßmus 57802b6330SStephan Aßmus #endif /* __PS2_STANDARD_MOUSE_H */ 58