2011-04-14 11:35:16 +00:00
|
|
|
#ifndef USBEHCI_H__
|
|
|
|
#define USBEHCI_H__
|
|
|
|
|
|
|
|
#include <ntddk.h>
|
2011-04-30 18:46:10 +00:00
|
|
|
#define NDEBUG
|
2011-04-14 11:35:16 +00:00
|
|
|
#include <debug.h>
|
|
|
|
#include <hubbusif.h>
|
|
|
|
#include <usbbusif.h>
|
|
|
|
#include <usbioctl.h>
|
2011-04-19 06:56:30 +00:00
|
|
|
//
|
|
|
|
// FIXME:
|
|
|
|
// #include <usbprotocoldefs.h>
|
|
|
|
//
|
2011-04-14 11:35:16 +00:00
|
|
|
#include <usb.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <wdmguid.h>
|
|
|
|
|
|
|
|
//
|
|
|
|
// FIXME:
|
|
|
|
// the following includes are required to get kcom to compile
|
|
|
|
//
|
|
|
|
#include <portcls.h>
|
|
|
|
#include <dmusicks.h>
|
|
|
|
#include <kcom.h>
|
|
|
|
|
|
|
|
#include "interfaces.h"
|
|
|
|
|
2011-04-19 06:56:30 +00:00
|
|
|
//
|
|
|
|
// flags for handling USB_REQUEST_SET_FEATURE / USB_REQUEST_GET_FEATURE
|
|
|
|
//
|
|
|
|
#define PORT_ENABLE 1
|
|
|
|
#define PORT_SUSPEND 2
|
|
|
|
#define PORT_OVER_CURRENT 3
|
|
|
|
#define PORT_RESET 4
|
|
|
|
#define PORT_POWER 8
|
|
|
|
#define C_PORT_CONNECTION 16
|
|
|
|
#define C_PORT_ENABLE 17
|
|
|
|
#define C_PORT_SUSPEND 18
|
|
|
|
#define C_PORT_OVER_CURRENT 19
|
|
|
|
#define C_PORT_RESET 20
|
|
|
|
|
2011-04-14 11:35:16 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
BOOLEAN IsFDO; // is device a FDO or PDO
|
|
|
|
BOOLEAN IsHub; // is device a hub / child - not yet used
|
2011-04-15 17:57:24 +00:00
|
|
|
PDISPATCHIRP Dispatcher; // dispatches the code
|
2011-04-14 11:35:16 +00:00
|
|
|
}COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION;
|
|
|
|
|
2011-04-15 15:45:09 +00:00
|
|
|
//
|
|
|
|
// tag for allocations
|
|
|
|
//
|
|
|
|
#define TAG_USBEHCI 'ICHE'
|
2011-04-14 11:35:16 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// assert for c++ - taken from portcls
|
|
|
|
//
|
|
|
|
#define PC_ASSERT(exp) \
|
|
|
|
(VOID)((!(exp)) ? \
|
|
|
|
RtlAssert((PVOID) #exp, (PVOID)__FILE__, __LINE__, NULL ), FALSE : TRUE)
|
|
|
|
|
|
|
|
//
|
|
|
|
// hcd_controller.cpp
|
|
|
|
//
|
|
|
|
NTSTATUS CreateHCDController(PHCDCONTROLLER *HcdController);
|
|
|
|
|
|
|
|
//
|
|
|
|
// hardware.cpp
|
|
|
|
//
|
|
|
|
NTSTATUS CreateUSBHardware(PUSBHARDWAREDEVICE *OutHardware);
|
|
|
|
|
2011-04-14 16:42:02 +00:00
|
|
|
//
|
|
|
|
// misc.cpp
|
|
|
|
//
|
|
|
|
NTSTATUS NTAPI SyncForwardIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp);
|
2011-04-16 06:59:45 +00:00
|
|
|
NTSTATUS NTAPI GetBusInterface(PDEVICE_OBJECT DeviceObject, PBUS_INTERFACE_STANDARD busInterface);
|
|
|
|
|
2011-04-15 15:45:09 +00:00
|
|
|
//
|
|
|
|
// root_hub_controller.cpp
|
|
|
|
//
|
2011-04-15 17:57:24 +00:00
|
|
|
NTSTATUS CreateHubController(PHUBCONTROLLER * OutHubController);
|
2011-04-15 15:45:09 +00:00
|
|
|
|
2011-04-16 12:26:06 +00:00
|
|
|
//
|
|
|
|
// memory_manager.cpp
|
|
|
|
//
|
|
|
|
NTSTATUS CreateDMAMemoryManager(PDMAMEMORYMANAGER *OutMemoryManager);
|
|
|
|
|
[USBEHCI_NEW]
- Fix bug in CDMAMemoryManager initialization, which calculated the bitmap length wrong
- Create interface IUSBDevice, which will be used to abstract connected usb devices
- Implement support functions for the device interface.
- Implement USBHI_CreateUsbDevice, USBHI_InitializeUsbDevice, USBHI_GetUsbDescriptors, USBHI_RemoveUsbDevice, USBHI_GetExtendedHubInformation, USBHI_RootHubInitNotification, USBHI_SetDeviceHandleData, USBDI_GetUSBDIVersion, USBDI_IsDeviceHighSpeed
- Partly implement USBHI_QueryDeviceInformation
- Based on mjmartin usbehci
svn path=/branches/usb-bringup/; revision=51372
2011-04-17 08:20:40 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// usb_device.cpp
|
|
|
|
//
|
|
|
|
NTSTATUS CreateUSBDevice(PUSBDEVICE *OutDevice);
|
|
|
|
|
2011-04-17 22:06:20 +00:00
|
|
|
//
|
|
|
|
// usb_queue.cpp
|
|
|
|
//
|
|
|
|
NTSTATUS CreateUSBQueue(PUSBQUEUE *OutUsbQueue);
|
|
|
|
|
2011-04-20 04:30:22 +00:00
|
|
|
//
|
|
|
|
// usb_request.cpp
|
|
|
|
//
|
|
|
|
NTSTATUS InternalCreateUSBRequest(PUSBREQUEST *OutRequest);
|
|
|
|
|
2011-04-14 11:35:16 +00:00
|
|
|
#endif
|