mirror of
https://github.com/reactos/reactos.git
synced 2025-01-04 05:20:54 +00:00
[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
This commit is contained in:
parent
e06b7ac5cc
commit
79bfd697d0
6 changed files with 1083 additions and 28 deletions
|
@ -6,6 +6,7 @@ add_definitions(-D_WIN32_WINNT=0x600)
|
|||
|
||||
add_library(usbehci SHARED
|
||||
usbehci.cpp
|
||||
usb_device.cpp
|
||||
hcd_controller.cpp
|
||||
hardware.cpp
|
||||
misc.cpp
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -475,4 +475,127 @@ DECLARE_INTERFACE_(IDispatchIrp, IUnknown)
|
|||
|
||||
typedef IDispatchIrp *PDISPATCHIRP;
|
||||
|
||||
//=========================================================================================
|
||||
//
|
||||
// class IUSBDevice
|
||||
//
|
||||
// Description: This class is used to abstract details of a usb device
|
||||
//
|
||||
|
||||
DECLARE_INTERFACE_(IUSBDevice, IUnknown)
|
||||
{
|
||||
DEFINE_ABSTRACT_UNKNOWN()
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
//
|
||||
// Initialize
|
||||
//
|
||||
// Description: Initializes the usb device
|
||||
|
||||
virtual NTSTATUS Initialize(IN PHUBCONTROLLER HubController,
|
||||
IN PUSBHARDWAREDEVICE Device,
|
||||
IN PVOID Parent,
|
||||
IN ULONG Port) = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//
|
||||
// IsHub
|
||||
//
|
||||
// Description: returns true when device is a hub
|
||||
|
||||
virtual BOOLEAN IsHub() = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//
|
||||
// GetParent
|
||||
//
|
||||
// Description: gets the parent device of the this device
|
||||
|
||||
virtual NTSTATUS GetParent(PVOID * Parent) = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//
|
||||
// GetDeviceAddress
|
||||
//
|
||||
// Description: gets the device address of the this device
|
||||
|
||||
virtual ULONG GetDeviceAddress() = 0;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//
|
||||
// GetPort
|
||||
//
|
||||
// Description: gets the port to which this device is connected
|
||||
|
||||
virtual ULONG GetPort() = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//
|
||||
// GetSpeed
|
||||
//
|
||||
// Description: gets the speed of the device
|
||||
|
||||
virtual USB_DEVICE_SPEED GetSpeed() = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//
|
||||
// GetType
|
||||
//
|
||||
// Description: gets the type of the device, either 1.1 or 2.0 device
|
||||
|
||||
virtual USB_DEVICE_TYPE GetType() = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//
|
||||
// GetState
|
||||
//
|
||||
// Description: gets the device state
|
||||
|
||||
virtual ULONG GetState() = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//
|
||||
// SetDeviceHandleData
|
||||
//
|
||||
// Description: sets device handle data
|
||||
|
||||
virtual void SetDeviceHandleData(PVOID Data) = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//
|
||||
// SetDeviceAddress
|
||||
//
|
||||
// Description: sets device handle data
|
||||
|
||||
virtual NTSTATUS SetDeviceAddress(ULONG DeviceAddress) = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//
|
||||
// GetDeviceDescriptor
|
||||
//
|
||||
// Description: sets device handle data
|
||||
|
||||
virtual void GetDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR DeviceDescriptor) = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//
|
||||
// GetConfigurationValue
|
||||
//
|
||||
// Description: gets current selected configuration index
|
||||
|
||||
virtual UCHAR GetConfigurationValue();
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//
|
||||
// SubmitUrb
|
||||
//
|
||||
// Description: submits an urb
|
||||
|
||||
virtual NTSTATUS SubmitUrb(PURB Urb) = 0;
|
||||
|
||||
};
|
||||
|
||||
typedef IUSBDevice *PUSBDEVICE;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -85,7 +85,7 @@ CDMAMemoryManager::Initialize(
|
|||
//
|
||||
// calculate bitmap length
|
||||
//
|
||||
BitmapLength = (DmaBufferSize / DefaultBlockSize) / sizeof(ULONG);
|
||||
BitmapLength = (DmaBufferSize / DefaultBlockSize) / 8;
|
||||
|
||||
//
|
||||
// allocate bitmap buffer
|
||||
|
@ -102,7 +102,7 @@ CDMAMemoryManager::Initialize(
|
|||
//
|
||||
// initialize bitmap
|
||||
//
|
||||
RtlInitializeBitMap(&m_Bitmap, m_BitmapBuffer, BitmapLength);
|
||||
RtlInitializeBitMap(&m_Bitmap, m_BitmapBuffer, BitmapLength * 8);
|
||||
|
||||
//
|
||||
// clear all bits
|
||||
|
|
22
drivers/usb/usbehci_new/usb_device.cpp
Normal file
22
drivers/usb/usbehci_new/usb_device.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* PROJECT: ReactOS Universal Serial Bus Bulk Enhanced Host Controller Interface
|
||||
* LICENSE: GPL - See COPYING in the top level directory
|
||||
* FILE: drivers/usb/usbehci/usb_device.cpp
|
||||
* PURPOSE: USB EHCI device driver.
|
||||
* PROGRAMMERS:
|
||||
* Michael Martin (michael.martin@reactos.org)
|
||||
* Johannes Anderwald (johannes.anderwald@reactos.org)
|
||||
*/
|
||||
|
||||
#define INITGUID
|
||||
#include "usbehci.h"
|
||||
|
||||
|
||||
NTSTATUS
|
||||
CreateUSBDevice(
|
||||
PUSBDEVICE *OutDevice)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
|
@ -54,7 +54,6 @@ NTSTATUS CreateUSBHardware(PUSBHARDWAREDEVICE *OutHardware);
|
|||
// misc.cpp
|
||||
//
|
||||
NTSTATUS NTAPI SyncForwardIrp(PDEVICE_OBJECT DeviceObject, PIRP Irp);
|
||||
|
||||
NTSTATUS NTAPI GetBusInterface(PDEVICE_OBJECT DeviceObject, PBUS_INTERFACE_STANDARD busInterface);
|
||||
|
||||
//
|
||||
|
@ -67,4 +66,10 @@ NTSTATUS CreateHubController(PHUBCONTROLLER * OutHubController);
|
|||
//
|
||||
NTSTATUS CreateDMAMemoryManager(PDMAMEMORYMANAGER *OutMemoryManager);
|
||||
|
||||
|
||||
//
|
||||
// usb_device.cpp
|
||||
//
|
||||
NTSTATUS CreateUSBDevice(PUSBDEVICE *OutDevice);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue