reactos/reactos/drivers/hid/hidclass/precomp.h
Cameron Gutman 022f4b2ce5 [USB]
- We proudly merge the first charge of the usb-bringup branch. We do want to stress hardware support is still under heavy development and testing in real hardware is experimental
- Merge the Human Interface Device Stack(HID) which is used for mice / keyboards and other devices which use the USB interface, consisting of hidusb, hidparse, hidclass, mouhid, kbdhid
- Merge the composite driver, supports USB composite devices, laid out in usbccgp
- Merge the generic hub driver, which supports the USB root hub and in future USB hubs. Driver is usbhub
- Merge the Open Host Controller Interface driver (ohci)
- Merge the Enhanced Host Controller Interface driver (ehci)
- Merge the many fixes in other areas of ReactOS needed for USB to work (ntoskrnl, pci, inf, umpnpmgr, usetup)
- Special thanks goes the Haiku team, whose excellent code has provided a great base for the development of the new ReactOS USB / HID stack
- The development of the USB stack has shown the great potential when ReactOS developers team up together to achieve a common goal. The involved developers are here, listed alphabetically:

Alex Ionescu
Amine Khaldi
Cameron Gutman
Johannes Anderwald
Michel Martin
Thomas Faber
Thomas Lotz(Haiku)

Let's start the ReactOS revolution

svn path=/trunk/; revision=55555
2012-02-12 04:59:51 +00:00

203 lines
3.4 KiB
C

#pragma once
#define _HIDPI_NO_FUNCTION_MACROS_
#define NDEBUG
#include <ntddk.h>
#include <initguid.h>
#include <hidport.h>
#include <hidpddi.h>
#include <stdio.h>
#include <wdmguid.h>
#include <debug.h>
typedef struct
{
PDRIVER_OBJECT DriverObject;
ULONG DeviceExtensionSize;
BOOLEAN DevicesArePolled;
PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION + 1];
PDRIVER_ADD_DEVICE AddDevice;
PDRIVER_UNLOAD DriverUnload;
KSPIN_LOCK Lock;
}HIDCLASS_DRIVER_EXTENSION, *PHIDCLASS_DRIVER_EXTENSION;
typedef struct
{
//
// hid device extension
//
HID_DEVICE_EXTENSION HidDeviceExtension;
//
// if it is a pdo
//
BOOLEAN IsFDO;
//
// driver extension
//
PHIDCLASS_DRIVER_EXTENSION DriverExtension;
//
// device description
//
HIDP_DEVICE_DESC DeviceDescription;
//
// hid attributes
//
HID_DEVICE_ATTRIBUTES Attributes;
}HIDCLASS_COMMON_DEVICE_EXTENSION, *PHIDCLASS_COMMON_DEVICE_EXTENSION;
typedef struct
{
//
// parts shared by fdo and pdo
//
HIDCLASS_COMMON_DEVICE_EXTENSION Common;
//
// device capabilities
//
DEVICE_CAPABILITIES Capabilities;
//
// hid descriptor
//
HID_DESCRIPTOR HidDescriptor;
//
// report descriptor
//
PUCHAR ReportDescriptor;
//
// device relations
//
PDEVICE_RELATIONS DeviceRelations;
}HIDCLASS_FDO_EXTENSION, *PHIDCLASS_FDO_EXTENSION;
typedef struct
{
//
// parts shared by fdo and pdo
//
HIDCLASS_COMMON_DEVICE_EXTENSION Common;
//
// device capabilities
//
DEVICE_CAPABILITIES Capabilities;
//
// collection index
//
ULONG CollectionNumber;
//
// device interface
//
UNICODE_STRING DeviceInterface;
//
// FDO device object
//
PDEVICE_OBJECT FDODeviceObject;
//
// fdo device extension
//
PHIDCLASS_FDO_EXTENSION FDODeviceExtension;
}HIDCLASS_PDO_DEVICE_EXTENSION, *PHIDCLASS_PDO_DEVICE_EXTENSION;
typedef struct __HIDCLASS_FILEOP_CONTEXT__
{
//
// device extension
//
PHIDCLASS_PDO_DEVICE_EXTENSION DeviceExtension;
//
// spin lock
//
KSPIN_LOCK Lock;
//
// read irp pending list
//
LIST_ENTRY ReadPendingIrpListHead;
//
// completed irp list
//
LIST_ENTRY IrpCompletedListHead;
}HIDCLASS_FILEOP_CONTEXT, *PHIDCLASS_FILEOP_CONTEXT;
typedef struct
{
//
// original request
//
PIRP OriginalIrp;
//
// file op
//
PHIDCLASS_FILEOP_CONTEXT FileOp;
//
// buffer for reading report
//
PVOID InputReportBuffer;
//
// buffer length
//
ULONG InputReportBufferLength;
//
// work item
//
PIO_WORKITEM CompletionWorkItem;
}HIDCLASS_IRP_CONTEXT, *PHIDCLASS_IRP_CONTEXT;
/* fdo.c */
NTSTATUS
HidClassFDO_PnP(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
NTSTATUS
HidClassFDO_DispatchRequestSynchronous(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
/* pdo.c */
NTSTATUS
HidClassPDO_CreatePDO(
IN PDEVICE_OBJECT DeviceObject,
OUT PDEVICE_RELATIONS *OutDeviceRelations);
NTSTATUS
HidClassPDO_PnP(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
PHIDP_COLLECTION_DESC
HidClassPDO_GetCollectionDescription(
PHIDP_DEVICE_DESC DeviceDescription,
ULONG CollectionNumber);
PHIDP_REPORT_IDS
HidClassPDO_GetReportDescription(
PHIDP_DEVICE_DESC DeviceDescription,
ULONG CollectionNumber);
/* eof */