1 /* 2 * Copyright 2004-2010 Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 * 5 * PS/2 bus manager 6 * 7 * Authors (in chronological order): 8 * Elad Lahav (elad@eldarshany.com) 9 * Stefano Ceccherini (burton666@libero.it) 10 * Axel Dörfler, axeld@pinc-software.de 11 * Marcus Overhagen <marcus@overhagen.de> 12 */ 13 #ifndef __PS2_COMMON_H 14 #define __PS2_COMMON_H 15 16 17 #include <ISA.h> 18 #include <Drivers.h> 19 #include <KernelExport.h> 20 #include <OS.h> 21 22 #include "ps2_defs.h" 23 #include "ps2_dev.h" 24 25 26 #if 1 27 # define INFO(x...) dprintf(x) 28 #else 29 # define INFO(x...) 30 #endif 31 #define ERROR(x...) dprintf(x) 32 33 //#define TRACE_PS2 34 #ifdef TRACE_PS2 35 #define TRACE_PS2_ALPS 36 #define TRACE_PS2_COMMON 37 #define TRACE_PS2_DEV 38 #define TRACE_PS2_ELANTECH 39 #define TRACE_PS2_MOUSE 40 #define TRACE_PS2_KEYBOARD 41 #define TRACE_PS2_SERVICE 42 #define TRACE_PS2_SYNAPTICS 43 #define TRACE_PS2_TRACKPOINT 44 #endif 45 46 47 // global variables 48 extern isa_module_info *gIsa; 49 50 extern device_hooks gKeyboardDeviceHooks; 51 extern device_hooks gPointingDeviceHooks; 52 53 extern bool gActiveMultiplexingEnabled; 54 extern sem_id gControllerSem; 55 56 57 #ifdef __cplusplus 58 extern "C" { 59 #endif 60 61 // prototypes from common.c 62 status_t ps2_init(void); 63 void ps2_uninit(void); 64 65 uint8 ps2_read_ctrl(void); 66 uint8 ps2_read_data(void); 67 void ps2_write_ctrl(uint8 ctrl); 68 void ps2_write_data(uint8 data); 69 status_t ps2_wait_read(void); 70 status_t ps2_wait_write(void); 71 72 void ps2_flush(void); 73 74 extern status_t ps2_command(uint8 cmd, const uint8 *out, int out_count, 75 uint8 *in, int in_count); 76 77 // prototypes from keyboard.c & mouse.c 78 extern status_t probe_keyboard(void); 79 80 #ifdef __cplusplus 81 } 82 #endif 83 84 85 #endif /* __PS2_COMMON_H */ 86