ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

ntdd8042.h
Go to the documentation of this file.
00001 /*
00002  * ntdd8042.h
00003  *
00004  * i8042 IOCTL interface.
00005  *
00006  * This file is part of the w32api package.
00007  *
00008  * Contributors:
00009  *   Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
00010  *
00011  * THIS SOFTWARE IS NOT COPYRIGHTED
00012  *
00013  * This source code is offered for use in the public domain. You may
00014  * use, modify or distribute it freely.
00015  *
00016  * This code is distributed in the hope that it will be useful but
00017  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
00018  * DISCLAIMED. This includes but is not limited to warranties of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00020  *
00021  */
00022 
00023 #ifndef _NTDD8042_
00024 #define _NTDD8042_
00025 
00026 #include "ntddkbd.h"
00027 #include "ntddmou.h"
00028 
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032 
00033 #define IOCTL_INTERNAL_I8042_CONTROLLER_WRITE_BUFFER \
00034   CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0FF2, METHOD_NEITHER, FILE_ANY_ACCESS)
00035 
00036 #define IOCTL_INTERNAL_I8042_HOOK_KEYBOARD \
00037   CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0FF0, METHOD_NEITHER, FILE_ANY_ACCESS)
00038 
00039 #define IOCTL_INTERNAL_I8042_KEYBOARD_START_INFORMATION \
00040   CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0FF3, METHOD_NEITHER, FILE_ANY_ACCESS)
00041 
00042 #define IOCTL_INTERNAL_I8042_KEYBOARD_WRITE_BUFFER \
00043   CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0FF1, METHOD_NEITHER, FILE_ANY_ACCESS)
00044 
00045 #define IOCTL_INTERNAL_I8042_HOOK_MOUSE \
00046   CTL_CODE(FILE_DEVICE_MOUSE, 0x0FF0, METHOD_NEITHER, FILE_ANY_ACCESS)
00047 
00048 #define IOCTL_INTERNAL_I8042_MOUSE_START_INFORMATION \
00049   CTL_CODE(FILE_DEVICE_MOUSE, 0x0FF3, METHOD_NEITHER, FILE_ANY_ACCESS)
00050 
00051 #define IOCTL_INTERNAL_I8042_MOUSE_WRITE_BUFFER \
00052   CTL_CODE(FILE_DEVICE_MOUSE, 0x0FF1, METHOD_NEITHER, FILE_ANY_ACCESS)
00053 
00054 #define I8042_POWER_SYS_BUTTON            0x0001
00055 #define I8042_SLEEP_SYS_BUTTON            0x0002
00056 #define I8042_WAKE_SYS_BUTTON             0x0004
00057 #define I8042_SYS_BUTTONS                 (I8042_POWER_SYS_BUTTON | \
00058                                            I8042_SLEEP_SYS_BUTTON | \
00059                                            I8042_WAKE_SYS_BUTTON)
00060 
00061 typedef enum _TRANSMIT_STATE {
00062   Idle = 0,
00063   SendingBytes
00064 } TRANSMIT_STATE;
00065 
00066 typedef struct _OUTPUT_PACKET {
00067   PUCHAR  Bytes;
00068   ULONG  CurrentByte;
00069   ULONG  ByteCount;
00070   TRANSMIT_STATE  State;
00071 } OUTPUT_PACKET, *POUTPUT_PACKET;
00072 
00073 typedef enum _KEYBOARD_SCAN_STATE {
00074   Normal,
00075   GotE0,
00076   GotE1
00077 } KEYBOARD_SCAN_STATE, *PKEYBOARD_SCAN_STATE;
00078 
00079 typedef enum _MOUSE_STATE {
00080   MouseIdle,
00081   XMovement,
00082   YMovement,
00083   ZMovement,
00084   MouseExpectingACK,
00085   MouseResetting
00086 } MOUSE_STATE, *PMOUSE_STATE;
00087 
00088 typedef enum _MOUSE_RESET_SUBSTATE {
00089     ExpectingReset,
00090     ExpectingResetId,
00091     ExpectingGetDeviceIdACK,
00092     ExpectingGetDeviceIdValue,
00093     ExpectingSetResolutionDefaultACK,
00094     ExpectingSetResolutionDefaultValueACK,
00095     ExpectingSetResolutionACK,
00096     ExpectingSetResolutionValueACK,
00097     ExpectingSetScaling1to1ACK,
00098     ExpectingSetScaling1to1ACK2,
00099     ExpectingSetScaling1to1ACK3,
00100     ExpectingReadMouseStatusACK,
00101     ExpectingReadMouseStatusByte1,
00102     ExpectingReadMouseStatusByte2,
00103     ExpectingReadMouseStatusByte3,
00104     StartPnPIdDetection,
00105     ExpectingLoopSetSamplingRateACK,
00106     ExpectingLoopSetSamplingRateValueACK,
00107     ExpectingPnpIdByte1,
00108     ExpectingPnpIdByte2,
00109     ExpectingPnpIdByte3,
00110     ExpectingPnpIdByte4,
00111     ExpectingPnpIdByte5,
00112     ExpectingPnpIdByte6,
00113     ExpectingPnpIdByte7,
00114     EnableWheel,
00115     Enable5Buttons,
00116     ExpectingGetDeviceId2ACK,
00117     ExpectingGetDeviceId2Value,
00118     ExpectingSetSamplingRateACK,
00119     ExpectingSetSamplingRateValueACK,
00120     ExpectingEnableACK,
00121     ExpectingFinalResolutionACK,
00122     ExpectingFinalResolutionValueACK,
00123     ExpectingGetDeviceIdDetectACK,
00124     ExpectingGetDeviceIdDetectValue,
00125     CustomHookStateMinimum = 100,
00126     CustomHookStateMaximum = 999,
00127     I8042ReservedMinimum = 1000
00128 } MOUSE_RESET_SUBSTATE, *PMOUSE_RESET_SUBSTATE;
00129 
00130 typedef struct _INTERNAL_I8042_START_INFORMATION {
00131   ULONG  Size;
00132   PKINTERRUPT  InterruptObject;
00133   ULONG  Reserved[8];
00134 } INTERNAL_I8042_START_INFORMATION, *PINTERNAL_I8042_START_INFORMATION;
00135 
00136 typedef VOID
00137 (NTAPI *PI8042_ISR_WRITE_PORT)(
00138   IN PVOID  Context,
00139   IN UCHAR  Value);
00140 
00141 typedef VOID
00142 (NTAPI *PI8042_QUEUE_PACKET)(
00143   IN PVOID  Context);
00144 
00145 typedef NTSTATUS
00146 (NTAPI *PI8042_SYNCH_READ_PORT) (
00147   IN PVOID  Context,
00148   OUT PUCHAR  Value,
00149   IN BOOLEAN  WaitForACK);
00150 
00151 typedef NTSTATUS
00152 (NTAPI *PI8042_SYNCH_WRITE_PORT)(
00153   IN PVOID  Context,
00154   IN UCHAR  Value,
00155   IN BOOLEAN  WaitForACK);
00156 
00157 
00158 typedef NTSTATUS
00159 (NTAPI *PI8042_KEYBOARD_INITIALIZATION_ROUTINE)(
00160   IN PVOID  InitializationContext,
00161   IN PVOID  SynchFuncContext,
00162   IN PI8042_SYNCH_READ_PORT  ReadPort,
00163   IN PI8042_SYNCH_WRITE_PORT  WritePort,
00164   OUT PBOOLEAN  TurnTranslationOn);
00165 
00166 typedef BOOLEAN
00167 (NTAPI *PI8042_KEYBOARD_ISR)(
00168   PVOID  IsrContext,
00169   PKEYBOARD_INPUT_DATA  CurrentInput,
00170   POUTPUT_PACKET  CurrentOutput,
00171   UCHAR  StatusByte,
00172   PUCHAR  Byte,
00173   PBOOLEAN  ContinueProcessing,
00174   PKEYBOARD_SCAN_STATE  ScanState);
00175 
00176 typedef struct _INTERNAL_I8042_HOOK_KEYBOARD {
00177     OUT PVOID  Context;
00178     OUT PI8042_KEYBOARD_INITIALIZATION_ROUTINE  InitializationRoutine;
00179     OUT PI8042_KEYBOARD_ISR  IsrRoutine;
00180     IN PI8042_ISR_WRITE_PORT  IsrWritePort;
00181     IN PI8042_QUEUE_PACKET  QueueKeyboardPacket;
00182     IN PVOID  CallContext;
00183 } INTERNAL_I8042_HOOK_KEYBOARD, *PINTERNAL_I8042_HOOK_KEYBOARD;
00184 
00185 typedef BOOLEAN
00186 (NTAPI *PI8042_MOUSE_ISR)(
00187   PVOID  IsrContext,
00188   PMOUSE_INPUT_DATA  CurrentInput,
00189   POUTPUT_PACKET  CurrentOutput,
00190   UCHAR  StatusByte,
00191   PUCHAR  Byte,
00192   PBOOLEAN  ContinueProcessing,
00193   PMOUSE_STATE  MouseState,
00194   PMOUSE_RESET_SUBSTATE  ResetSubState);
00195 
00196 typedef struct _INTERNAL_I8042_HOOK_MOUSE {
00197   OUT PVOID  Context;
00198   OUT PI8042_MOUSE_ISR  IsrRoutine;
00199   IN PI8042_ISR_WRITE_PORT  IsrWritePort;
00200   IN PI8042_QUEUE_PACKET  QueueMousePacket;
00201   IN PVOID  CallContext;
00202 } INTERNAL_I8042_HOOK_MOUSE, *PINTERNAL_I8042_HOOK_MOUSE;
00203 
00204 #ifdef __cplusplus
00205 }
00206 #endif
00207 
00208 #endif /* _NTDD8042_ */

Generated on Sun May 27 2012 04:32:04 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.