mirror of
https://github.com/reactos/reactos.git
synced 2024-08-11 13:48:01 +00:00
Move shareable part of USB miniport drivers to a new directory. UHCI uses it.
svn path=/trunk/; revision=17782
This commit is contained in:
parent
d672727c6a
commit
23d2ee98f5
|
@ -1,21 +1,23 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS UHCI controller driver (Cromwell type)
|
* PROJECT: ReactOS USB miniport driver (Cromwell type)
|
||||||
* FILE: drivers/usb/cromwell/uhci/cleanup.c
|
* FILE: drivers/usb/miniport/common/cleanup.c
|
||||||
* PURPOSE: IRP_MJ_CLEANUP operations
|
* PURPOSE: IRP_MJ_CLEANUP operations
|
||||||
*
|
*
|
||||||
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.com)
|
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include "uhci.h"
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include "usbcommon.h"
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
UhciCleanup(
|
UsbMpCleanup(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp)
|
IN PIRP Irp)
|
||||||
{
|
{
|
||||||
DPRINT("UHCI: IRP_MJ_CLEANUP\n");
|
DPRINT("USBMP: IRP_MJ_CLEANUP\n");
|
||||||
|
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
|
|
|
@ -1,24 +1,26 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS UHCI controller driver (Cromwell type)
|
* PROJECT: ReactOS USB miniport driver (Cromwell type)
|
||||||
* FILE: drivers/usb/cromwell/uhci/close.c
|
* FILE: drivers/usb/miniport/common/close.c
|
||||||
* PURPOSE: IRP_MJ_CLOSE operations
|
* PURPOSE: IRP_MJ_CLOSE operations
|
||||||
*
|
*
|
||||||
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.com)
|
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include "uhci.h"
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include "usbcommon.h"
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
UhciClose(
|
UsbMpClose(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp)
|
IN PIRP Irp)
|
||||||
{
|
{
|
||||||
POHCI_DEVICE_EXTENSION pDeviceExtension;
|
PUSBMP_DEVICE_EXTENSION pDeviceExtension;
|
||||||
|
|
||||||
DPRINT("UHCI: IRP_MJ_CLOSE\n");
|
DPRINT("USBMP: IRP_MJ_CLOSE\n");
|
||||||
pDeviceExtension = (POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
pDeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||||
InterlockedDecrement((PLONG)&pDeviceExtension->DeviceOpened);
|
InterlockedDecrement((PLONG)&pDeviceExtension->DeviceOpened);
|
||||||
|
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
<define name="__USE_W32API" />
|
<define name="__USE_W32API" />
|
||||||
<define name="DEBUG_MODE" />
|
<define name="DEBUG_MODE" />
|
||||||
<include>../linux</include>
|
<include>../linux</include>
|
||||||
<include base="usbport"></include>
|
<include base="usbport">.</include>
|
||||||
<file>cleanup.c</file>
|
<file>cleanup.c</file>
|
||||||
<file>close.c</file>
|
<file>close.c</file>
|
||||||
<file>create.c</file>
|
<file>create.c</file>
|
||||||
<file>fdo.c</file>
|
<file>fdo.c</file>
|
||||||
|
<file>main.c</file>
|
||||||
<file>misc.c</file>
|
<file>misc.c</file>
|
||||||
<file>pdo.c</file>
|
<file>pdo.c</file>
|
||||||
<file>uhci.c</file>
|
|
||||||
</module>
|
</module>
|
||||||
|
|
|
@ -1,27 +1,29 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS UHCI controller driver (Cromwell type)
|
* PROJECT: ReactOS USB miniport driver (Cromwell type)
|
||||||
* FILE: drivers/usb/cromwell/uhci/create.c
|
* FILE: drivers/usb/miniport/common/create.c
|
||||||
* PURPOSE: IRP_MJ_CREATE operations
|
* PURPOSE: IRP_MJ_CREATE operations
|
||||||
*
|
*
|
||||||
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.com)
|
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include "uhci.h"
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include "usbcommon.h"
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
UhciCreate(
|
UsbMpCreate(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp)
|
IN PIRP Irp)
|
||||||
{
|
{
|
||||||
PIO_STACK_LOCATION Stack;
|
PIO_STACK_LOCATION Stack;
|
||||||
POHCI_DEVICE_EXTENSION DeviceExtension;
|
PUSBMP_DEVICE_EXTENSION DeviceExtension;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT("UHCI: IRP_MJ_CREATE\n");
|
DPRINT("USBMP: IRP_MJ_CREATE\n");
|
||||||
Stack = IoGetCurrentIrpStackLocation(Irp);
|
Stack = IoGetCurrentIrpStackLocation(Irp);
|
||||||
DeviceExtension = (POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||||
|
|
||||||
if (Stack->Parameters.Create.Options & FILE_DIRECTORY_FILE)
|
if (Stack->Parameters.Create.Options & FILE_DIRECTORY_FILE)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,20 +1,22 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS UHCI controller driver (Cromwell type)
|
* PROJECT: ReactOS USB miniport driver (Cromwell type)
|
||||||
* FILE: drivers/usb/cromwell/uhci/fdo.c
|
* FILE: drivers/usb/miniport/common/fdo.c
|
||||||
* PURPOSE: IRP_MJ_PNP/IRP_MJ_DEVICE_CONTROL operations for FDOs
|
* PURPOSE: IRP_MJ_PNP/IRP_MJ_DEVICE_CONTROL operations for FDOs
|
||||||
*
|
*
|
||||||
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.com),
|
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org),
|
||||||
* James Tabor (jimtabor@adsl-64-217-116-74.dsl.hstntx.swbell.net)
|
* James Tabor (jimtabor@adsl-64-217-116-74.dsl.hstntx.swbell.net)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include "uhci.h"
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include "usbcommon.h"
|
||||||
|
|
||||||
#define IO_METHOD_FROM_CTL_CODE(ctlCode) (ctlCode&0x00000003)
|
#define IO_METHOD_FROM_CTL_CODE(ctlCode) (ctlCode&0x00000003)
|
||||||
|
|
||||||
static VOID
|
static VOID
|
||||||
UhciGetUserBuffers(
|
UsbMpGetUserBuffers(
|
||||||
IN PIRP Irp,
|
IN PIRP Irp,
|
||||||
IN ULONG IoControlCode,
|
IN ULONG IoControlCode,
|
||||||
OUT PVOID* BufferIn,
|
OUT PVOID* BufferIn,
|
||||||
|
@ -47,14 +49,14 @@ UhciGetUserBuffers(
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
UhciFdoStartDevice(
|
UsbMpFdoStartDevice(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp)
|
IN PIRP Irp)
|
||||||
{
|
{
|
||||||
PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp);
|
PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp);
|
||||||
PDRIVER_OBJECT DriverObject;
|
PDRIVER_OBJECT DriverObject;
|
||||||
POHCI_DRIVER_EXTENSION DriverExtension;
|
PUSBMP_DRIVER_EXTENSION DriverExtension;
|
||||||
POHCI_DEVICE_EXTENSION DeviceExtension;
|
PUSBMP_DEVICE_EXTENSION DeviceExtension;
|
||||||
PCM_RESOURCE_LIST AllocatedResources;
|
PCM_RESOURCE_LIST AllocatedResources;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -62,7 +64,7 @@ UhciFdoStartDevice(
|
||||||
*/
|
*/
|
||||||
DriverObject = DeviceObject->DriverObject;
|
DriverObject = DeviceObject->DriverObject;
|
||||||
DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject);
|
DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject);
|
||||||
DeviceExtension = (POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Store some resources in the DeviceExtension.
|
* Store some resources in the DeviceExtension.
|
||||||
|
@ -131,7 +133,7 @@ UhciFdoStartDevice(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print assigned resources */
|
/* Print assigned resources */
|
||||||
DPRINT("UHCI: Interrupt Vector 0x%lx, %S base 0x%lx, Length 0x%lx\n",
|
DPRINT("USBMP: Interrupt Vector 0x%lx, %S base 0x%lx, Length 0x%lx\n",
|
||||||
DeviceExtension->InterruptVector,
|
DeviceExtension->InterruptVector,
|
||||||
((struct hc_driver *)(*pci_ids)->driver_data)->flags & HCD_MEMORY ? L"Memory" : L"I/O",
|
((struct hc_driver *)(*pci_ids)->driver_data)->flags & HCD_MEMORY ? L"Memory" : L"I/O",
|
||||||
DeviceExtension->BaseAddress,
|
DeviceExtension->BaseAddress,
|
||||||
|
@ -142,15 +144,15 @@ UhciFdoStartDevice(
|
||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
UhciFdoQueryBusRelations(
|
UsbMpFdoQueryBusRelations(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
OUT PDEVICE_RELATIONS* pDeviceRelations)
|
OUT PDEVICE_RELATIONS* pDeviceRelations)
|
||||||
{
|
{
|
||||||
POHCI_DEVICE_EXTENSION DeviceExtension;
|
PUSBMP_DEVICE_EXTENSION DeviceExtension;
|
||||||
PDEVICE_RELATIONS DeviceRelations;
|
PDEVICE_RELATIONS DeviceRelations;
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
DeviceExtension = (POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||||
|
|
||||||
/* Handling this IRP is easy, as we only
|
/* Handling this IRP is easy, as we only
|
||||||
* have one child: the root hub
|
* have one child: the root hub
|
||||||
|
@ -171,7 +173,7 @@ UhciFdoQueryBusRelations(
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
UhciPnpFdo(
|
UsbMpPnpFdo(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp)
|
IN PIRP Irp)
|
||||||
{
|
{
|
||||||
|
@ -189,7 +191,7 @@ UhciPnpFdo(
|
||||||
{
|
{
|
||||||
Status = ForwardIrpAndWait(DeviceObject, Irp);
|
Status = ForwardIrpAndWait(DeviceObject, Irp);
|
||||||
if (NT_SUCCESS(Status) && NT_SUCCESS(Irp->IoStatus.Status))
|
if (NT_SUCCESS(Status) && NT_SUCCESS(Irp->IoStatus.Status))
|
||||||
Status = UhciFdoStartDevice(DeviceObject, Irp);
|
Status = UsbMpFdoStartDevice(DeviceObject, Irp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,18 +221,18 @@ UhciPnpFdo(
|
||||||
case BusRelations:
|
case BusRelations:
|
||||||
{
|
{
|
||||||
PDEVICE_RELATIONS DeviceRelations;
|
PDEVICE_RELATIONS DeviceRelations;
|
||||||
DPRINT("UHCI: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
|
DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
|
||||||
Status = UhciFdoQueryBusRelations(DeviceObject, &DeviceRelations);
|
Status = UsbMpFdoQueryBusRelations(DeviceObject, &DeviceRelations);
|
||||||
Information = (ULONG_PTR)DeviceRelations;
|
Information = (ULONG_PTR)DeviceRelations;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case RemovalRelations:
|
case RemovalRelations:
|
||||||
{
|
{
|
||||||
DPRINT1("UHCI: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n");
|
DPRINT1("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n");
|
||||||
return ForwardIrpAndForget(DeviceObject, Irp);
|
return ForwardIrpAndForget(DeviceObject, Irp);
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
DPRINT1("UHCI: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
|
DPRINT1("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
|
||||||
IrpSp->Parameters.QueryDeviceRelations.Type);
|
IrpSp->Parameters.QueryDeviceRelations.Type);
|
||||||
return ForwardIrpAndForget(DeviceObject, Irp);
|
return ForwardIrpAndForget(DeviceObject, Irp);
|
||||||
}
|
}
|
||||||
|
@ -239,7 +241,7 @@ UhciPnpFdo(
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
DPRINT1("UHCI: unknown minor function 0x%lx\n", MinorFunction);
|
DPRINT1("USBMP: unknown minor function 0x%lx\n", MinorFunction);
|
||||||
return ForwardIrpAndForget(DeviceObject, Irp);
|
return ForwardIrpAndForget(DeviceObject, Irp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -250,32 +252,32 @@ UhciPnpFdo(
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
UhciDeviceControlFdo(
|
UsbMpDeviceControlFdo(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp)
|
IN PIRP Irp)
|
||||||
{
|
{
|
||||||
PIO_STACK_LOCATION Stack;
|
PIO_STACK_LOCATION Stack;
|
||||||
ULONG IoControlCode;
|
ULONG IoControlCode;
|
||||||
POHCI_DEVICE_EXTENSION DeviceExtension;
|
PUSBMP_DEVICE_EXTENSION DeviceExtension;
|
||||||
ULONG LengthIn, LengthOut;
|
ULONG LengthIn, LengthOut;
|
||||||
ULONG_PTR Information = 0;
|
ULONG_PTR Information = 0;
|
||||||
PVOID BufferIn, BufferOut;
|
PVOID BufferIn, BufferOut;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT("UHCI: UsbDeviceControlFdo() called\n");
|
DPRINT("USBMP: UsbDeviceControlFdo() called\n");
|
||||||
|
|
||||||
Stack = IoGetCurrentIrpStackLocation(Irp);
|
Stack = IoGetCurrentIrpStackLocation(Irp);
|
||||||
LengthIn = Stack->Parameters.DeviceIoControl.InputBufferLength;
|
LengthIn = Stack->Parameters.DeviceIoControl.InputBufferLength;
|
||||||
LengthOut = Stack->Parameters.DeviceIoControl.OutputBufferLength;
|
LengthOut = Stack->Parameters.DeviceIoControl.OutputBufferLength;
|
||||||
DeviceExtension = (POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||||
IoControlCode = Stack->Parameters.DeviceIoControl.IoControlCode;
|
IoControlCode = Stack->Parameters.DeviceIoControl.IoControlCode;
|
||||||
UhciGetUserBuffers(Irp, IoControlCode, &BufferIn, &BufferOut);
|
UsbMpGetUserBuffers(Irp, IoControlCode, &BufferIn, &BufferOut);
|
||||||
|
|
||||||
switch (IoControlCode)
|
switch (IoControlCode)
|
||||||
{
|
{
|
||||||
case IOCTL_GET_HCD_DRIVERKEY_NAME:
|
case IOCTL_GET_HCD_DRIVERKEY_NAME:
|
||||||
{
|
{
|
||||||
DPRINT("UHCI: IOCTL_GET_HCD_DRIVERKEY_NAME\n");
|
DPRINT("USBMP: IOCTL_GET_HCD_DRIVERKEY_NAME\n");
|
||||||
if (LengthOut < sizeof(USB_HCD_DRIVERKEY_NAME))
|
if (LengthOut < sizeof(USB_HCD_DRIVERKEY_NAME))
|
||||||
Status = STATUS_BUFFER_TOO_SMALL;
|
Status = STATUS_BUFFER_TOO_SMALL;
|
||||||
else if (BufferOut == NULL)
|
else if (BufferOut == NULL)
|
||||||
|
@ -286,7 +288,7 @@ UhciDeviceControlFdo(
|
||||||
ULONG StringSize;
|
ULONG StringSize;
|
||||||
StringDescriptor = (PUSB_HCD_DRIVERKEY_NAME)BufferOut;
|
StringDescriptor = (PUSB_HCD_DRIVERKEY_NAME)BufferOut;
|
||||||
Status = IoGetDeviceProperty(
|
Status = IoGetDeviceProperty(
|
||||||
((POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->PhysicalDeviceObject,
|
((PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->PhysicalDeviceObject,
|
||||||
DevicePropertyDriverKeyName,
|
DevicePropertyDriverKeyName,
|
||||||
LengthOut - FIELD_OFFSET(USB_HCD_DRIVERKEY_NAME, DriverKeyName),
|
LengthOut - FIELD_OFFSET(USB_HCD_DRIVERKEY_NAME, DriverKeyName),
|
||||||
StringDescriptor->DriverKeyName,
|
StringDescriptor->DriverKeyName,
|
||||||
|
@ -302,7 +304,7 @@ UhciDeviceControlFdo(
|
||||||
}
|
}
|
||||||
case IOCTL_USB_GET_ROOT_HUB_NAME:
|
case IOCTL_USB_GET_ROOT_HUB_NAME:
|
||||||
{
|
{
|
||||||
DPRINT("UHCI: IOCTL_USB_GET_ROOT_HUB_NAME\n");
|
DPRINT("USBMP: IOCTL_USB_GET_ROOT_HUB_NAME\n");
|
||||||
if (LengthOut < sizeof(USB_ROOT_HUB_NAME))
|
if (LengthOut < sizeof(USB_ROOT_HUB_NAME))
|
||||||
Status = STATUS_BUFFER_TOO_SMALL;
|
Status = STATUS_BUFFER_TOO_SMALL;
|
||||||
else if (BufferOut == NULL)
|
else if (BufferOut == NULL)
|
||||||
|
@ -312,8 +314,8 @@ UhciDeviceControlFdo(
|
||||||
PUSB_ROOT_HUB_NAME StringDescriptor;
|
PUSB_ROOT_HUB_NAME StringDescriptor;
|
||||||
PUNICODE_STRING RootHubInterfaceName;
|
PUNICODE_STRING RootHubInterfaceName;
|
||||||
StringDescriptor = (PUSB_ROOT_HUB_NAME)BufferOut;
|
StringDescriptor = (PUSB_ROOT_HUB_NAME)BufferOut;
|
||||||
DeviceObject = ((POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->RootHubPdo;
|
DeviceObject = ((PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->RootHubPdo;
|
||||||
RootHubInterfaceName = &((POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->HcdInterfaceName;
|
RootHubInterfaceName = &((PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->HcdInterfaceName;
|
||||||
|
|
||||||
StringDescriptor->ActualLength = RootHubInterfaceName->Length + sizeof(WCHAR) + FIELD_OFFSET(USB_ROOT_HUB_NAME, RootHubName);
|
StringDescriptor->ActualLength = RootHubInterfaceName->Length + sizeof(WCHAR) + FIELD_OFFSET(USB_ROOT_HUB_NAME, RootHubName);
|
||||||
if (StringDescriptor->ActualLength <= LengthOut)
|
if (StringDescriptor->ActualLength <= LengthOut)
|
||||||
|
@ -324,7 +326,7 @@ UhciDeviceControlFdo(
|
||||||
RootHubInterfaceName->Buffer,
|
RootHubInterfaceName->Buffer,
|
||||||
RootHubInterfaceName->Length);
|
RootHubInterfaceName->Length);
|
||||||
StringDescriptor->RootHubName[RootHubInterfaceName->Length / sizeof(WCHAR)] = UNICODE_NULL;
|
StringDescriptor->RootHubName[RootHubInterfaceName->Length / sizeof(WCHAR)] = UNICODE_NULL;
|
||||||
DPRINT("UHCI: IOCTL_USB_GET_ROOT_HUB_NAME returns '%S'\n", StringDescriptor->RootHubName);
|
DPRINT("USBMP: IOCTL_USB_GET_ROOT_HUB_NAME returns '%S'\n", StringDescriptor->RootHubName);
|
||||||
Information = StringDescriptor->ActualLength;
|
Information = StringDescriptor->ActualLength;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -337,7 +339,7 @@ UhciDeviceControlFdo(
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
/* Pass Irp to lower driver */
|
/* Pass Irp to lower driver */
|
||||||
DPRINT1("UHCI: Unknown IOCTL code 0x%lx\n", Stack->Parameters.DeviceIoControl.IoControlCode);
|
DPRINT1("USBMP: Unknown IOCTL code 0x%lx\n", Stack->Parameters.DeviceIoControl.IoControlCode);
|
||||||
IoSkipCurrentIrpStackLocation(Irp);
|
IoSkipCurrentIrpStackLocation(Irp);
|
||||||
return IoCallDriver(DeviceExtension->NextDeviceObject, Irp);
|
return IoCallDriver(DeviceExtension->NextDeviceObject, Irp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,21 @@
|
||||||
/*
|
/*
|
||||||
ReactOS specific functions for UHCI module
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
by Aleksey Bragin (aleksey@reactos.com)
|
* PROJECT: ReactOS USB miniport driver (Cromwell type)
|
||||||
and Hervé Poussineau (hpoussin@reactos.com)
|
* FILE: drivers/usb/miniport/common/main.c
|
||||||
Some parts of code are inspired (or even just copied) from ReactOS Videoport driver
|
* PURPOSE: Driver entry
|
||||||
*/
|
*
|
||||||
|
* PROGRAMMERS: Aleksey Bragin (aleksey@reactos.com)
|
||||||
|
* Hervé Poussineau (hpoussin@reactos.org),
|
||||||
|
*
|
||||||
|
* Some parts of code are inspired (or even just copied) from
|
||||||
|
* ReactOS Videoport driver (drivers/video/videoprt)
|
||||||
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
#define INITGUID
|
#define INITGUID
|
||||||
#include "uhci.h"
|
#include "usbcommon.h"
|
||||||
|
|
||||||
static ULONG DeviceNumber = 0; /* FIXME: what is that? */
|
static ULONG DeviceNumber = 0; /* FIXME: what is that? */
|
||||||
|
|
||||||
|
@ -17,14 +26,14 @@ CreateRootHubPdo(
|
||||||
OUT PDEVICE_OBJECT* pPdo)
|
OUT PDEVICE_OBJECT* pPdo)
|
||||||
{
|
{
|
||||||
PDEVICE_OBJECT Pdo;
|
PDEVICE_OBJECT Pdo;
|
||||||
POHCI_DEVICE_EXTENSION DeviceExtension;
|
PUSBMP_DEVICE_EXTENSION DeviceExtension;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT("UHCI: CreateRootHubPdo()\n");
|
DPRINT("USBMP: CreateRootHubPdo()\n");
|
||||||
|
|
||||||
Status = IoCreateDevice(
|
Status = IoCreateDevice(
|
||||||
DriverObject,
|
DriverObject,
|
||||||
sizeof(OHCI_DEVICE_EXTENSION),
|
sizeof(USBMP_DEVICE_EXTENSION),
|
||||||
NULL, /* DeviceName */
|
NULL, /* DeviceName */
|
||||||
FILE_DEVICE_BUS_EXTENDER,
|
FILE_DEVICE_BUS_EXTENDER,
|
||||||
FILE_DEVICE_SECURE_OPEN | FILE_AUTOGENERATED_DEVICE_NAME,
|
FILE_DEVICE_SECURE_OPEN | FILE_AUTOGENERATED_DEVICE_NAME,
|
||||||
|
@ -32,7 +41,7 @@ CreateRootHubPdo(
|
||||||
&Pdo);
|
&Pdo);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("UHCI: IoCreateDevice() call failed with status 0x%08x\n", Status);
|
DPRINT("USBMP: IoCreateDevice() call failed with status 0x%08x\n", Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,8 +49,8 @@ CreateRootHubPdo(
|
||||||
Pdo->Flags |= DO_POWER_PAGABLE;
|
Pdo->Flags |= DO_POWER_PAGABLE;
|
||||||
|
|
||||||
// zerofill device extension
|
// zerofill device extension
|
||||||
DeviceExtension = (POHCI_DEVICE_EXTENSION)Pdo->DeviceExtension;
|
DeviceExtension = (PUSBMP_DEVICE_EXTENSION)Pdo->DeviceExtension;
|
||||||
RtlZeroMemory(DeviceExtension, sizeof(OHCI_DEVICE_EXTENSION));
|
RtlZeroMemory(DeviceExtension, sizeof(USBMP_DEVICE_EXTENSION));
|
||||||
|
|
||||||
DeviceExtension->IsFDO = FALSE;
|
DeviceExtension->IsFDO = FALSE;
|
||||||
DeviceExtension->FunctionalDeviceObject = Fdo;
|
DeviceExtension->FunctionalDeviceObject = Fdo;
|
||||||
|
@ -63,10 +72,10 @@ AddDevice(
|
||||||
WCHAR LinkDeviceBuffer[20];
|
WCHAR LinkDeviceBuffer[20];
|
||||||
UNICODE_STRING DeviceName;
|
UNICODE_STRING DeviceName;
|
||||||
UNICODE_STRING LinkDeviceName;
|
UNICODE_STRING LinkDeviceName;
|
||||||
POHCI_DRIVER_EXTENSION DriverExtension;
|
PUSBMP_DRIVER_EXTENSION DriverExtension;
|
||||||
POHCI_DEVICE_EXTENSION DeviceExtension;
|
PUSBMP_DEVICE_EXTENSION DeviceExtension;
|
||||||
|
|
||||||
DPRINT("UHCI: AddDevice called\n");
|
DPRINT("USBMP: AddDevice called\n");
|
||||||
|
|
||||||
// Allocate driver extension now
|
// Allocate driver extension now
|
||||||
DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject);
|
DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject);
|
||||||
|
@ -75,12 +84,12 @@ AddDevice(
|
||||||
Status = IoAllocateDriverObjectExtension(
|
Status = IoAllocateDriverObjectExtension(
|
||||||
DriverObject,
|
DriverObject,
|
||||||
DriverObject,
|
DriverObject,
|
||||||
sizeof(OHCI_DRIVER_EXTENSION),
|
sizeof(USBMP_DRIVER_EXTENSION),
|
||||||
(PVOID *)&DriverExtension);
|
(PVOID *)&DriverExtension);
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("UHCI: Allocating DriverObjectExtension failed.\n");
|
DPRINT("USBMP: Allocating DriverObjectExtension failed.\n");
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,7 +100,7 @@ AddDevice(
|
||||||
RtlInitUnicodeString(&DeviceName, DeviceBuffer);
|
RtlInitUnicodeString(&DeviceName, DeviceBuffer);
|
||||||
|
|
||||||
Status = IoCreateDevice(DriverObject,
|
Status = IoCreateDevice(DriverObject,
|
||||||
sizeof(OHCI_DEVICE_EXTENSION),
|
sizeof(USBMP_DEVICE_EXTENSION),
|
||||||
&DeviceName,
|
&DeviceName,
|
||||||
FILE_DEVICE_BUS_EXTENDER,
|
FILE_DEVICE_BUS_EXTENDER,
|
||||||
0,
|
0,
|
||||||
|
@ -100,19 +109,19 @@ AddDevice(
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("UHCI: IoCreateDevice call failed with status 0x%08lx\n", Status);
|
DPRINT("USBMP: IoCreateDevice call failed with status 0x%08lx\n", Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
// zerofill device extension
|
// zerofill device extension
|
||||||
DeviceExtension = (POHCI_DEVICE_EXTENSION)fdo->DeviceExtension;
|
DeviceExtension = (PUSBMP_DEVICE_EXTENSION)fdo->DeviceExtension;
|
||||||
RtlZeroMemory(DeviceExtension, sizeof(OHCI_DEVICE_EXTENSION));
|
RtlZeroMemory(DeviceExtension, sizeof(USBMP_DEVICE_EXTENSION));
|
||||||
|
|
||||||
/* Create root hub Pdo */
|
/* Create root hub Pdo */
|
||||||
Status = CreateRootHubPdo(DriverObject, fdo, &DeviceExtension->RootHubPdo);
|
Status = CreateRootHubPdo(DriverObject, fdo, &DeviceExtension->RootHubPdo);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("UHCI: CreateRootHubPdo() failed with status 0x%08lx\n", Status);
|
DPRINT("USBMP: CreateRootHubPdo() failed with status 0x%08lx\n", Status);
|
||||||
IoDeleteDevice(fdo);
|
IoDeleteDevice(fdo);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -125,7 +134,7 @@ AddDevice(
|
||||||
&DeviceExtension->HcdInterfaceName);
|
&DeviceExtension->HcdInterfaceName);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("UHCI: IoRegisterDeviceInterface() failed with status 0x%08lx\n", Status);
|
DPRINT("USBMP: IoRegisterDeviceInterface() failed with status 0x%08lx\n", Status);
|
||||||
IoDeleteDevice(DeviceExtension->RootHubPdo);
|
IoDeleteDevice(DeviceExtension->RootHubPdo);
|
||||||
IoDeleteDevice(fdo);
|
IoDeleteDevice(fdo);
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -151,7 +160,7 @@ AddDevice(
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("UHCI: IoCreateSymbolicLink call failed with status 0x%08x\n", Status);
|
DPRINT("USBMP: IoCreateSymbolicLink call failed with status 0x%08x\n", Status);
|
||||||
IoDeleteDevice(DeviceExtension->RootHubPdo);
|
IoDeleteDevice(DeviceExtension->RootHubPdo);
|
||||||
IoDeleteDevice(fdo);
|
IoDeleteDevice(fdo);
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -167,9 +176,9 @@ IrpStub(
|
||||||
{
|
{
|
||||||
NTSTATUS Status = STATUS_NOT_SUPPORTED;
|
NTSTATUS Status = STATUS_NOT_SUPPORTED;
|
||||||
|
|
||||||
if (((POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
|
if (((PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
|
||||||
{
|
{
|
||||||
DPRINT1("UHCI: FDO stub for major function 0x%lx\n",
|
DPRINT1("USBMP: FDO stub for major function 0x%lx\n",
|
||||||
IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
|
IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
DbgBreakPoint();
|
DbgBreakPoint();
|
||||||
|
@ -181,7 +190,7 @@ IrpStub(
|
||||||
/* We can't forward request to the lower driver, because
|
/* We can't forward request to the lower driver, because
|
||||||
* we are a Pdo, so we don't have lower driver...
|
* we are a Pdo, so we don't have lower driver...
|
||||||
*/
|
*/
|
||||||
DPRINT1("UHCI: PDO stub for major function 0x%lx\n",
|
DPRINT1("USBMP: PDO stub for major function 0x%lx\n",
|
||||||
IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
|
IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
DbgBreakPoint();
|
DbgBreakPoint();
|
||||||
|
@ -196,8 +205,8 @@ IrpStub(
|
||||||
static NTSTATUS STDCALL
|
static NTSTATUS STDCALL
|
||||||
DispatchCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
DispatchCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
{
|
{
|
||||||
if (((POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
|
if (((PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
|
||||||
return UhciCreate(DeviceObject, Irp);
|
return UsbMpCreate(DeviceObject, Irp);
|
||||||
else
|
else
|
||||||
return IrpStub(DeviceObject, Irp);
|
return IrpStub(DeviceObject, Irp);
|
||||||
}
|
}
|
||||||
|
@ -205,8 +214,8 @@ DispatchCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
static NTSTATUS STDCALL
|
static NTSTATUS STDCALL
|
||||||
DispatchClose(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
DispatchClose(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
{
|
{
|
||||||
if (((POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
|
if (((PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
|
||||||
return UhciClose(DeviceObject, Irp);
|
return UsbMpClose(DeviceObject, Irp);
|
||||||
else
|
else
|
||||||
return IrpStub(DeviceObject, Irp);
|
return IrpStub(DeviceObject, Irp);
|
||||||
}
|
}
|
||||||
|
@ -214,8 +223,8 @@ DispatchClose(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
static NTSTATUS STDCALL
|
static NTSTATUS STDCALL
|
||||||
DispatchCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
DispatchCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
{
|
{
|
||||||
if (((POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
|
if (((PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
|
||||||
return UhciCleanup(DeviceObject, Irp);
|
return UsbMpCleanup(DeviceObject, Irp);
|
||||||
else
|
else
|
||||||
return IrpStub(DeviceObject, Irp);
|
return IrpStub(DeviceObject, Irp);
|
||||||
}
|
}
|
||||||
|
@ -223,25 +232,25 @@ DispatchCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
static NTSTATUS STDCALL
|
static NTSTATUS STDCALL
|
||||||
DispatchDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
DispatchDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
{
|
{
|
||||||
if (((POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
|
if (((PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
|
||||||
return UhciDeviceControlFdo(DeviceObject, Irp);
|
return UsbMpDeviceControlFdo(DeviceObject, Irp);
|
||||||
else
|
else
|
||||||
return UhciDeviceControlPdo(DeviceObject, Irp);
|
return UsbMpDeviceControlPdo(DeviceObject, Irp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS STDCALL
|
static NTSTATUS STDCALL
|
||||||
DispatchPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
DispatchPnp(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
{
|
{
|
||||||
if (((POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
|
if (((PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
|
||||||
return UhciPnpFdo(DeviceObject, Irp);
|
return UsbMpPnpFdo(DeviceObject, Irp);
|
||||||
else
|
else
|
||||||
return UhciPnpPdo(DeviceObject, Irp);
|
return UsbMpPnpPdo(DeviceObject, Irp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS STDCALL
|
static NTSTATUS STDCALL
|
||||||
DispatchPower(PDEVICE_OBJECT fido, PIRP Irp)
|
DispatchPower(PDEVICE_OBJECT fido, PIRP Irp)
|
||||||
{
|
{
|
||||||
DPRINT1("UHCI: IRP_MJ_POWER unimplemented\n");
|
DPRINT1("USBMP: IRP_MJ_POWER unimplemented\n");
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
|
@ -255,7 +264,6 @@ NTSTATUS STDCALL
|
||||||
DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegPath)
|
DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegPath)
|
||||||
{
|
{
|
||||||
ULONG i;
|
ULONG i;
|
||||||
DPRINT("********* Cromwell UHCI *********\n");
|
|
||||||
|
|
||||||
DriverObject->DriverUnload = DriverUnload;
|
DriverObject->DriverUnload = DriverUnload;
|
||||||
DriverObject->DriverExtension->AddDevice = AddDevice;
|
DriverObject->DriverExtension->AddDevice = AddDevice;
|
|
@ -1,14 +1,16 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS UHCI controller driver (Cromwell type)
|
* PROJECT: ReactOS USB miniport driver (Cromwell type)
|
||||||
* FILE: drivers/usb/cromwell/uhci/misc.c
|
* FILE: drivers/usb/miniport/common/misc.c
|
||||||
* PURPOSE: Misceallenous operations
|
* PURPOSE: Misceallenous operations
|
||||||
*
|
*
|
||||||
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.com),
|
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org),
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include "uhci.h"
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include "usbcommon.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
|
@ -27,7 +29,7 @@ ForwardIrpAndWait(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp)
|
IN PIRP Irp)
|
||||||
{
|
{
|
||||||
PDEVICE_OBJECT LowerDevice = ((POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->NextDeviceObject;
|
PDEVICE_OBJECT LowerDevice = ((PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->NextDeviceObject;
|
||||||
KEVENT Event;
|
KEVENT Event;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
@ -36,7 +38,7 @@ ForwardIrpAndWait(
|
||||||
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
||||||
IoCopyCurrentIrpStackLocationToNext(Irp);
|
IoCopyCurrentIrpStackLocationToNext(Irp);
|
||||||
|
|
||||||
DPRINT("UHCI: Calling lower device %p [%wZ]\n", LowerDevice, &LowerDevice->DriverObject->DriverName);
|
DPRINT("USBMP: Calling lower device %p [%wZ]\n", LowerDevice, &LowerDevice->DriverObject->DriverName);
|
||||||
IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE);
|
IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE);
|
||||||
|
|
||||||
Status = IoCallDriver(LowerDevice, Irp);
|
Status = IoCallDriver(LowerDevice, Irp);
|
||||||
|
@ -55,7 +57,7 @@ ForwardIrpAndForget(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp)
|
IN PIRP Irp)
|
||||||
{
|
{
|
||||||
PDEVICE_OBJECT LowerDevice = ((POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->NextDeviceObject;
|
PDEVICE_OBJECT LowerDevice = ((PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->NextDeviceObject;
|
||||||
|
|
||||||
ASSERT(LowerDevice);
|
ASSERT(LowerDevice);
|
||||||
|
|
||||||
|
@ -67,7 +69,7 @@ ForwardIrpAndForget(
|
||||||
* PnP ids are ANSI-encoded in PnP device string
|
* PnP ids are ANSI-encoded in PnP device string
|
||||||
* identification */
|
* identification */
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
UhciInitMultiSzString(
|
UsbMpInitMultiSzString(
|
||||||
OUT PUNICODE_STRING Destination,
|
OUT PUNICODE_STRING Destination,
|
||||||
... /* list of PCSZ */)
|
... /* list of PCSZ */)
|
||||||
{
|
{
|
||||||
|
@ -103,7 +105,7 @@ UhciInitMultiSzString(
|
||||||
|
|
||||||
/* Initialize destination string */
|
/* Initialize destination string */
|
||||||
DestinationSize += sizeof(WCHAR); // final NULL
|
DestinationSize += sizeof(WCHAR); // final NULL
|
||||||
Destination->Buffer = (PWSTR)ExAllocatePoolWithTag(PagedPool, DestinationSize, USB_UHCI_TAG);
|
Destination->Buffer = (PWSTR)ExAllocatePoolWithTag(PagedPool, DestinationSize, USB_MINIPORT_TAG);
|
||||||
if (!Destination->Buffer)
|
if (!Destination->Buffer)
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
Destination->Length = 0;
|
Destination->Length = 0;
|
||||||
|
@ -123,7 +125,7 @@ UhciInitMultiSzString(
|
||||||
Status = RtlAnsiStringToUnicodeString(&UnicodeString, &AnsiString, FALSE);
|
Status = RtlAnsiStringToUnicodeString(&UnicodeString, &AnsiString, FALSE);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ExFreePoolWithTag(Destination->Buffer, USB_UHCI_TAG);
|
ExFreePoolWithTag(Destination->Buffer, USB_MINIPORT_TAG);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Destination->Length += UnicodeString.Length + sizeof(WCHAR);
|
Destination->Length += UnicodeString.Length + sizeof(WCHAR);
|
||||||
|
@ -143,7 +145,7 @@ UhciInitMultiSzString(
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
UhciDuplicateUnicodeString(
|
UsbMpDuplicateUnicodeString(
|
||||||
OUT PUNICODE_STRING Destination,
|
OUT PUNICODE_STRING Destination,
|
||||||
IN PUNICODE_STRING Source,
|
IN PUNICODE_STRING Source,
|
||||||
IN POOL_TYPE PoolType)
|
IN POOL_TYPE PoolType)
|
||||||
|
|
|
@ -1,22 +1,24 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS UHCI controller driver (Cromwell type)
|
* PROJECT: ReactOS USB miniport driver (Cromwell type)
|
||||||
* FILE: drivers/usb/cromwell/uhci/pdo.c
|
* FILE: drivers/usb/miniport/common/pdo.c
|
||||||
* PURPOSE: IRP_MJ_PNP/IRP_MJ_DEVICE_CONTROL operations for PDOs
|
* PURPOSE: IRP_MJ_PNP/IRP_MJ_DEVICE_CONTROL operations for PDOs
|
||||||
*
|
*
|
||||||
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.com),
|
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org),
|
||||||
* James Tabor (jimtabor@adsl-64-217-116-74.dsl.hstntx.swbell.net)
|
* James Tabor (jimtabor@adsl-64-217-116-74.dsl.hstntx.swbell.net)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include "uhci.h"
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include "usbcommon.h"
|
||||||
|
|
||||||
extern struct usb_driver hub_driver;
|
extern struct usb_driver hub_driver;
|
||||||
|
|
||||||
#define IO_METHOD_FROM_CTL_CODE(ctlCode) (ctlCode&0x00000003)
|
#define IO_METHOD_FROM_CTL_CODE(ctlCode) (ctlCode&0x00000003)
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
UhciDeviceControlPdo(
|
UsbMpDeviceControlPdo(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp)
|
IN PIRP Irp)
|
||||||
{
|
{
|
||||||
|
@ -24,7 +26,7 @@ UhciDeviceControlPdo(
|
||||||
ULONG_PTR Information = 0;
|
ULONG_PTR Information = 0;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT("UHCI: UhciDeviceControlPdo() called\n");
|
DPRINT("USBMP: UsbMpDeviceControlPdo() called\n");
|
||||||
|
|
||||||
Stack = IoGetCurrentIrpStackLocation(Irp);
|
Stack = IoGetCurrentIrpStackLocation(Irp);
|
||||||
Status = Irp->IoStatus.Status;
|
Status = Irp->IoStatus.Status;
|
||||||
|
@ -33,9 +35,9 @@ UhciDeviceControlPdo(
|
||||||
{
|
{
|
||||||
case IOCTL_INTERNAL_USB_GET_ROOT_USB_DEVICE:
|
case IOCTL_INTERNAL_USB_GET_ROOT_USB_DEVICE:
|
||||||
{
|
{
|
||||||
POHCI_DEVICE_EXTENSION DeviceExtension;
|
PUSBMP_DEVICE_EXTENSION DeviceExtension;
|
||||||
|
|
||||||
DPRINT("UHCI: IOCTL_INTERNAL_USB_GET_ROOT_USB_DEVICE\n");
|
DPRINT("USBMP: IOCTL_INTERNAL_USB_GET_ROOT_USB_DEVICE\n");
|
||||||
if (Irp->AssociatedIrp.SystemBuffer == NULL
|
if (Irp->AssociatedIrp.SystemBuffer == NULL
|
||||||
|| Stack->Parameters.DeviceIoControl.OutputBufferLength != sizeof(PVOID))
|
|| Stack->Parameters.DeviceIoControl.OutputBufferLength != sizeof(PVOID))
|
||||||
{
|
{
|
||||||
|
@ -44,8 +46,8 @@ UhciDeviceControlPdo(
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PVOID* pRootHubPointer;
|
PVOID* pRootHubPointer;
|
||||||
DeviceExtension = (POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||||
DeviceExtension = (POHCI_DEVICE_EXTENSION)DeviceExtension->FunctionalDeviceObject->DeviceExtension;
|
DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceExtension->FunctionalDeviceObject->DeviceExtension;
|
||||||
|
|
||||||
pRootHubPointer = (PVOID*)Irp->AssociatedIrp.SystemBuffer;
|
pRootHubPointer = (PVOID*)Irp->AssociatedIrp.SystemBuffer;
|
||||||
*pRootHubPointer = (PVOID)DeviceExtension->pdev->bus; /* struct usb_device* */
|
*pRootHubPointer = (PVOID)DeviceExtension->pdev->bus; /* struct usb_device* */
|
||||||
|
@ -56,7 +58,7 @@ UhciDeviceControlPdo(
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
DPRINT1("UHCI: Unknown IOCTL code 0x%lx\n", Stack->Parameters.DeviceIoControl.IoControlCode);
|
DPRINT1("USBMP: Unknown IOCTL code 0x%lx\n", Stack->Parameters.DeviceIoControl.IoControlCode);
|
||||||
Information = Irp->IoStatus.Information;
|
Information = Irp->IoStatus.Information;
|
||||||
Status = Irp->IoStatus.Status;
|
Status = Irp->IoStatus.Status;
|
||||||
}
|
}
|
||||||
|
@ -69,57 +71,57 @@ UhciDeviceControlPdo(
|
||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
UhciPdoQueryId(
|
UsbMpPdoQueryId(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp,
|
IN PIRP Irp,
|
||||||
OUT ULONG_PTR* Information)
|
OUT ULONG_PTR* Information)
|
||||||
{
|
{
|
||||||
POHCI_DEVICE_EXTENSION DeviceExtension;
|
PUSBMP_DEVICE_EXTENSION DeviceExtension;
|
||||||
ULONG IdType;
|
ULONG IdType;
|
||||||
UNICODE_STRING SourceString;
|
UNICODE_STRING SourceString;
|
||||||
UNICODE_STRING String;
|
UNICODE_STRING String;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
IdType = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryId.IdType;
|
IdType = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryId.IdType;
|
||||||
DeviceExtension = (POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||||
RtlInitUnicodeString(&String, NULL);
|
RtlInitUnicodeString(&String, NULL);
|
||||||
|
|
||||||
switch (IdType)
|
switch (IdType)
|
||||||
{
|
{
|
||||||
case BusQueryDeviceID:
|
case BusQueryDeviceID:
|
||||||
{
|
{
|
||||||
DPRINT("UHCI: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryDeviceID\n");
|
DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryDeviceID\n");
|
||||||
RtlInitUnicodeString(&SourceString, L"USB\\ROOT_HUB");
|
RtlInitUnicodeString(&SourceString, L"USB\\ROOT_HUB");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BusQueryHardwareIDs:
|
case BusQueryHardwareIDs:
|
||||||
{
|
{
|
||||||
DPRINT("UHCI: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs\n");
|
DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs\n");
|
||||||
/* FIXME: Should return
|
/* FIXME: Should return
|
||||||
USB\ROOT_HUB&VID????&PID????&REV????
|
USB\ROOT_HUB&VID????&PID????&REV????
|
||||||
USB\ROOT_HUB&VID????&PID????
|
USB\ROOT_HUB&VID????&PID????
|
||||||
USB\ROOT_HUB
|
USB\ROOT_HUB
|
||||||
*/
|
*/
|
||||||
UhciInitMultiSzString(&SourceString, "USB\\ROOT_HUB", NULL);
|
UsbMpInitMultiSzString(&SourceString, "USB\\ROOT_HUB", NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BusQueryCompatibleIDs:
|
case BusQueryCompatibleIDs:
|
||||||
DPRINT("UHCI: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryCompatibleIDs\n");
|
DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryCompatibleIDs\n");
|
||||||
/* No compatible ID */
|
/* No compatible ID */
|
||||||
*Information = 0;
|
*Information = 0;
|
||||||
return STATUS_NOT_SUPPORTED;
|
return STATUS_NOT_SUPPORTED;
|
||||||
case BusQueryInstanceID:
|
case BusQueryInstanceID:
|
||||||
{
|
{
|
||||||
DPRINT("UHCI: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID\n");
|
DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID\n");
|
||||||
RtlInitUnicodeString(&SourceString, L"0000"); /* FIXME */
|
RtlInitUnicodeString(&SourceString, L"0000"); /* FIXME */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
DPRINT1("UHCI: IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n", IdType);
|
DPRINT1("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n", IdType);
|
||||||
return STATUS_NOT_SUPPORTED;
|
return STATUS_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = UhciDuplicateUnicodeString(
|
Status = UsbMpDuplicateUnicodeString(
|
||||||
&String,
|
&String,
|
||||||
&SourceString,
|
&SourceString,
|
||||||
PagedPool);
|
PagedPool);
|
||||||
|
@ -128,13 +130,13 @@ UhciPdoQueryId(
|
||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
UhciPnpStartDevice(
|
UsbMpPnpStartDevice(
|
||||||
IN PDEVICE_OBJECT DeviceObject)
|
IN PDEVICE_OBJECT DeviceObject)
|
||||||
{
|
{
|
||||||
POHCI_DEVICE_EXTENSION DeviceExtension;
|
PUSBMP_DEVICE_EXTENSION DeviceExtension;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DeviceExtension = (POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||||
|
|
||||||
/* Register device interface for root hub */
|
/* Register device interface for root hub */
|
||||||
Status = IoRegisterDeviceInterface(
|
Status = IoRegisterDeviceInterface(
|
||||||
|
@ -144,7 +146,7 @@ UhciPnpStartDevice(
|
||||||
&DeviceExtension->HcdInterfaceName);
|
&DeviceExtension->HcdInterfaceName);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("UHCI: IoRegisterDeviceInterface() failed with status 0x%08lx\n", Status);
|
DPRINT("USBMP: IoRegisterDeviceInterface() failed with status 0x%08lx\n", Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +154,7 @@ UhciPnpStartDevice(
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
UhciPnpPdo(
|
UsbMpPnpPdo(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp)
|
IN PIRP Irp)
|
||||||
{
|
{
|
||||||
|
@ -168,15 +170,15 @@ UhciPnpPdo(
|
||||||
{
|
{
|
||||||
case IRP_MN_START_DEVICE: /* 0x00 */
|
case IRP_MN_START_DEVICE: /* 0x00 */
|
||||||
{
|
{
|
||||||
DPRINT("UHCI: IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
|
DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
|
||||||
Status = UhciPnpStartDevice(DeviceObject);
|
Status = UsbMpPnpStartDevice(DeviceObject);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IRP_MN_QUERY_CAPABILITIES: /* 0x09 */
|
case IRP_MN_QUERY_CAPABILITIES: /* 0x09 */
|
||||||
{
|
{
|
||||||
PDEVICE_CAPABILITIES DeviceCapabilities;
|
PDEVICE_CAPABILITIES DeviceCapabilities;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
DPRINT("UHCI: IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES\n");
|
DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES\n");
|
||||||
|
|
||||||
DeviceCapabilities = (PDEVICE_CAPABILITIES)Stack->Parameters.DeviceCapabilities.Capabilities;
|
DeviceCapabilities = (PDEVICE_CAPABILITIES)Stack->Parameters.DeviceCapabilities.Capabilities;
|
||||||
/* FIXME: capabilities can change with connected device */
|
/* FIXME: capabilities can change with connected device */
|
||||||
|
@ -202,7 +204,7 @@ UhciPnpPdo(
|
||||||
}
|
}
|
||||||
case IRP_MN_QUERY_RESOURCES: /* 0x0a */
|
case IRP_MN_QUERY_RESOURCES: /* 0x0a */
|
||||||
{
|
{
|
||||||
DPRINT("UHCI: IRP_MJ_PNP / IRP_MN_QUERY_RESOURCES\n");
|
DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_RESOURCES\n");
|
||||||
/* Root buses don't need resources, except the ones of
|
/* Root buses don't need resources, except the ones of
|
||||||
* the usb controller. This PDO is the root bus PDO, so
|
* the usb controller. This PDO is the root bus PDO, so
|
||||||
* report no resource by not changing Information and
|
* report no resource by not changing Information and
|
||||||
|
@ -214,7 +216,7 @@ UhciPnpPdo(
|
||||||
}
|
}
|
||||||
case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: /* 0x0b */
|
case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: /* 0x0b */
|
||||||
{
|
{
|
||||||
DPRINT("UHCI: IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n");
|
DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n");
|
||||||
/* Root buses don't need resources, except the ones of
|
/* Root buses don't need resources, except the ones of
|
||||||
* the usb controller. This PDO is the root bus PDO, so
|
* the usb controller. This PDO is the root bus PDO, so
|
||||||
* report no resource by not changing Information and
|
* report no resource by not changing Information and
|
||||||
|
@ -233,7 +235,7 @@ UhciPnpPdo(
|
||||||
{
|
{
|
||||||
ULONG DescriptionSize;
|
ULONG DescriptionSize;
|
||||||
PWSTR Description;
|
PWSTR Description;
|
||||||
DPRINT("UHCI: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextDescription\n");
|
DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextDescription\n");
|
||||||
|
|
||||||
Status = IoGetDeviceProperty(
|
Status = IoGetDeviceProperty(
|
||||||
DeviceObject,
|
DeviceObject,
|
||||||
|
@ -268,7 +270,7 @@ UhciPnpPdo(
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
DPRINT1("UHCI: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / unknown type 0x%lx\n",
|
DPRINT1("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / unknown type 0x%lx\n",
|
||||||
Stack->Parameters.QueryDeviceText.DeviceTextType);
|
Stack->Parameters.QueryDeviceText.DeviceTextType);
|
||||||
Status = STATUS_NOT_SUPPORTED;
|
Status = STATUS_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
@ -278,7 +280,7 @@ UhciPnpPdo(
|
||||||
#endif
|
#endif
|
||||||
case IRP_MN_QUERY_ID: /* 0x13 */
|
case IRP_MN_QUERY_ID: /* 0x13 */
|
||||||
{
|
{
|
||||||
Status = UhciPdoQueryId(DeviceObject, Irp, &Information);
|
Status = UsbMpPdoQueryId(DeviceObject, Irp, &Information);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -286,7 +288,7 @@ UhciPnpPdo(
|
||||||
/* We can't forward request to the lower driver, because
|
/* We can't forward request to the lower driver, because
|
||||||
* we are a Pdo, so we don't have lower driver...
|
* we are a Pdo, so we don't have lower driver...
|
||||||
*/
|
*/
|
||||||
DPRINT1("UHCI: IRP_MJ_PNP / unknown minor function 0x%lx\n", MinorFunction);
|
DPRINT1("USBMP: IRP_MJ_PNP / unknown minor function 0x%lx\n", MinorFunction);
|
||||||
Information = Irp->IoStatus.Information;
|
Information = Irp->IoStatus.Information;
|
||||||
Status = Irp->IoStatus.Status;
|
Status = Irp->IoStatus.Status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,43 +1,45 @@
|
||||||
//#include <ddk/ntddk.h>
|
#ifndef _USBMP_COMMON_H_
|
||||||
|
#define _USBMP_COMMON_H_
|
||||||
|
|
||||||
// config and include core/hcd.h, for hc_device struct struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, unsigned ifnum)
|
// config and include core/hcd.h, for hc_device struct struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, unsigned ifnum)
|
||||||
|
|
||||||
#include "../usb_wrapper.h"
|
#include "../usb_wrapper.h"
|
||||||
#include <ddk/usbdi.h>
|
#include <usbdi.h>
|
||||||
#include <ddk/usbiodef.h>
|
#include <usbiodef.h>
|
||||||
#include <initguid.h>
|
#include <initguid.h>
|
||||||
|
|
||||||
#include "hcd.h"
|
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
|
||||||
|
#define USB_MINIPORT_TAG TAG('u','s','b','m')
|
||||||
|
|
||||||
#include "../usbohci/ohci_main.h"
|
#include "../../usbport/hcd.h"
|
||||||
|
#include "usbcommon_types.h"
|
||||||
#define USB_UHCI_TAG TAG('u','s','b','u')
|
|
||||||
|
|
||||||
/* cleanup.c */
|
/* cleanup.c */
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
UhciCleanup(
|
UsbMpCleanup(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp);
|
IN PIRP Irp);
|
||||||
|
|
||||||
/* close.c */
|
/* close.c */
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
UhciClose(
|
UsbMpClose(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp);
|
IN PIRP Irp);
|
||||||
|
|
||||||
/* create.c */
|
/* create.c */
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
UhciCreate(
|
UsbMpCreate(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp);
|
IN PIRP Irp);
|
||||||
|
|
||||||
/* fdo.c */
|
/* fdo.c */
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
UhciPnpFdo(
|
UsbMpPnpFdo(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp);
|
IN PIRP Irp);
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
UhciDeviceControlFdo(
|
UsbMpDeviceControlFdo(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp);
|
IN PIRP Irp);
|
||||||
|
|
||||||
|
@ -53,24 +55,24 @@ ForwardIrpAndForget(
|
||||||
IN PIRP Irp);
|
IN PIRP Irp);
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
UhciDuplicateUnicodeString(
|
UsbMpDuplicateUnicodeString(
|
||||||
OUT PUNICODE_STRING Destination,
|
OUT PUNICODE_STRING Destination,
|
||||||
IN PUNICODE_STRING Source,
|
IN PUNICODE_STRING Source,
|
||||||
IN POOL_TYPE PoolType);
|
IN POOL_TYPE PoolType);
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
UhciInitMultiSzString(
|
UsbMpInitMultiSzString(
|
||||||
OUT PUNICODE_STRING Destination,
|
OUT PUNICODE_STRING Destination,
|
||||||
... /* list of PCSZ */);
|
... /* list of PCSZ */);
|
||||||
|
|
||||||
/* pdo.c */
|
/* pdo.c */
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
UhciPnpPdo(
|
UsbMpPnpPdo(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp);
|
IN PIRP Irp);
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
UhciDeviceControlPdo(
|
UsbMpDeviceControlPdo(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp);
|
IN PIRP Irp);
|
||||||
|
|
||||||
|
@ -82,3 +84,5 @@ NTSTATUS
|
||||||
InitLinuxWrapper(PDEVICE_OBJECT DeviceObject);
|
InitLinuxWrapper(PDEVICE_OBJECT DeviceObject);
|
||||||
|
|
||||||
extern struct pci_device_id** pci_ids;
|
extern struct pci_device_id** pci_ids;
|
||||||
|
|
||||||
|
#endif
|
56
reactos/drivers/usb/miniport/common/usbcommon_types.h
Normal file
56
reactos/drivers/usb/miniport/common/usbcommon_types.h
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
#ifndef _USBMP_COMMON_TYPES_H_
|
||||||
|
#define _USBMP_COMMON_TYPES_H_
|
||||||
|
|
||||||
|
typedef struct _USBMP_DRIVER_EXTENSION
|
||||||
|
{
|
||||||
|
//OHCI_HW_INITIALIZATION_DATA InitializationData;
|
||||||
|
//PVOID HwContext;
|
||||||
|
//UNICODE_STRING RegistryPath;
|
||||||
|
|
||||||
|
} USBMP_DRIVER_EXTENSION, *PUSBMP_DRIVER_EXTENSION;
|
||||||
|
|
||||||
|
typedef struct _USBMP_DEVICE_EXTENSTION
|
||||||
|
{
|
||||||
|
ULONG DeviceNumber;
|
||||||
|
PDEVICE_OBJECT PhysicalDeviceObject;
|
||||||
|
PDEVICE_OBJECT FunctionalDeviceObject;
|
||||||
|
PDEVICE_OBJECT NextDeviceObject;
|
||||||
|
//UNICODE_STRING RegistryPath;
|
||||||
|
UNICODE_STRING HcdInterfaceName;
|
||||||
|
//PKINTERRUPT InterruptObject;
|
||||||
|
//KSPIN_LOCK InterruptSpinLock;
|
||||||
|
PCM_RESOURCE_LIST AllocatedResources;
|
||||||
|
ULONG InterruptVector;
|
||||||
|
ULONG InterruptLevel;
|
||||||
|
PHYSICAL_ADDRESS BaseAddress;
|
||||||
|
ULONG BaseAddrLength;
|
||||||
|
ULONG Flags;
|
||||||
|
//ULONG AdapterInterfaceType;
|
||||||
|
//ULONG SystemIoBusNumber;
|
||||||
|
ULONG SystemIoSlotNumber;
|
||||||
|
//LIST_ENTRY AddressMappingListHead;
|
||||||
|
|
||||||
|
// DMA stuff, and buffers
|
||||||
|
PDMA_ADAPTER pDmaAdapter;
|
||||||
|
//PVOID MapRegisterBase;
|
||||||
|
ULONG mapRegisterCount;
|
||||||
|
#ifdef USB_DMA_SINGLE_SUPPORT
|
||||||
|
//PHYSICAL_ADDRESS Buffer;
|
||||||
|
//PVOID VirtualBuffer;
|
||||||
|
//ULONG BufferSize;
|
||||||
|
|
||||||
|
// Mdl used for single DMA transfers
|
||||||
|
//PMDL Mdl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//KDPC DpcObject;
|
||||||
|
PUSBMP_DRIVER_EXTENSION DriverExtension;
|
||||||
|
ULONG DeviceOpened;
|
||||||
|
//KMUTEX DeviceLock;
|
||||||
|
//CHAR MiniPortDeviceExtension[1];
|
||||||
|
BOOLEAN IsFDO;
|
||||||
|
struct pci_dev * pdev;
|
||||||
|
PDEVICE_OBJECT RootHubPdo;
|
||||||
|
} USBMP_DEVICE_EXTENSION, *PUSBMP_DEVICE_EXTENSION;
|
||||||
|
|
||||||
|
#endif
|
|
@ -2,7 +2,7 @@
|
||||||
// this file is part of linux_wrapper.h
|
// this file is part of linux_wrapper.h
|
||||||
|
|
||||||
//FIXME: Move this file, make its definitions more general
|
//FIXME: Move this file, make its definitions more general
|
||||||
#include "../usbohci/ohci_main.h"
|
#include "../common/usbcommon_types.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Initialize device before it's used by a driver. Ask low-level code to enable I/O and memory.
|
Initialize device before it's used by a driver. Ask low-level code to enable I/O and memory.
|
||||||
|
@ -17,7 +17,7 @@ static int __inline__ pci_enable_device(struct pci_dev *dev)
|
||||||
// Get physical address where resource x resides
|
// Get physical address where resource x resides
|
||||||
static PHYSICAL_ADDRESS __inline__ pci_resource_start (struct pci_dev *dev, int x)
|
static PHYSICAL_ADDRESS __inline__ pci_resource_start (struct pci_dev *dev, int x)
|
||||||
{
|
{
|
||||||
POHCI_DEVICE_EXTENSION dev_ext = (POHCI_DEVICE_EXTENSION)dev->dev_ext;
|
PUSBMP_DEVICE_EXTENSION dev_ext = (PUSBMP_DEVICE_EXTENSION)dev->dev_ext;
|
||||||
DPRINT1("pci_resource_start() called, x=0x%x\n", x);
|
DPRINT1("pci_resource_start() called, x=0x%x\n", x);
|
||||||
|
|
||||||
//FIXME: Take x into account
|
//FIXME: Take x into account
|
||||||
|
@ -28,7 +28,7 @@ static PHYSICAL_ADDRESS __inline__ pci_resource_start (struct pci_dev *dev, int
|
||||||
// ???
|
// ???
|
||||||
static unsigned long __inline__ pci_resource_len (struct pci_dev *dev, int x)
|
static unsigned long __inline__ pci_resource_len (struct pci_dev *dev, int x)
|
||||||
{
|
{
|
||||||
POHCI_DEVICE_EXTENSION ext = (POHCI_DEVICE_EXTENSION)dev->dev_ext;
|
PUSBMP_DEVICE_EXTENSION ext = (PUSBMP_DEVICE_EXTENSION)dev->dev_ext;
|
||||||
|
|
||||||
DPRINT1("pci_resource_len() called, x=0x%x\n", x);
|
DPRINT1("pci_resource_len() called, x=0x%x\n", x);
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ static unsigned long __inline__ pci_resource_len (struct pci_dev *dev, int x)
|
||||||
// ???
|
// ???
|
||||||
static int __inline__ pci_resource_flags(struct pci_dev *dev, int x)
|
static int __inline__ pci_resource_flags(struct pci_dev *dev, int x)
|
||||||
{
|
{
|
||||||
POHCI_DEVICE_EXTENSION ext = (POHCI_DEVICE_EXTENSION)dev->dev_ext;
|
PUSBMP_DEVICE_EXTENSION ext = (PUSBMP_DEVICE_EXTENSION)dev->dev_ext;
|
||||||
|
|
||||||
DPRINT1("pci_resource_flags() called, x=0x%x\n", x);
|
DPRINT1("pci_resource_flags() called, x=0x%x\n", x);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* 1) Forget all device interrupts, scheduling, semaphores, threads etc.
|
* 1) Forget all device interrupts, scheduling, semaphores, threads etc.
|
||||||
* 1a) Forget all DMA and PCI helper functions
|
* 1a) Forget all DMA and PCI helper functions
|
||||||
* 2) Forget usbdevfs, procfs and ioctls
|
* 2) Forget usbdevfs, procfs and ioctls
|
||||||
* 3) Emulate OHCI interrupts and root hub timer by polling
|
* 3) Emulate xHCI interrupts and root hub timer by polling
|
||||||
* 4) Emulate hub kernel thread by polling
|
* 4) Emulate hub kernel thread by polling
|
||||||
* 5) Emulate synchronous USB-messages (usb_*_msg) with busy waiting
|
* 5) Emulate synchronous USB-messages (usb_*_msg) with busy waiting
|
||||||
*
|
*
|
||||||
|
@ -43,7 +43,7 @@ static struct device_driver *m_drivers[MAX_DRVS];
|
||||||
static int drvs_num=0;
|
static int drvs_num=0;
|
||||||
unsigned int LAST_USB_EVENT_TICK;
|
unsigned int LAST_USB_EVENT_TICK;
|
||||||
|
|
||||||
NTSTATUS init_dma(POHCI_DEVICE_EXTENSION pDevExt);
|
NTSTATUS init_dma(PUSBMP_DEVICE_EXTENSION pDevExt);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
/*
|
/*
|
||||||
|
@ -357,7 +357,7 @@ struct pci_dev *my_pci_find_slot(int a,int b)
|
||||||
int my_pci_write_config_word(struct pci_dev *dev, int where, u16 val)
|
int my_pci_write_config_word(struct pci_dev *dev, int where, u16 val)
|
||||||
{
|
{
|
||||||
//dev->bus, dev->devfn, where, val
|
//dev->bus, dev->devfn, where, val
|
||||||
OHCI_DEVICE_EXTENSION *dev_ext = (OHCI_DEVICE_EXTENSION *)dev->dev_ext;
|
PUSBMP_DEVICE_EXTENSION dev_ext = (PUSBMP_DEVICE_EXTENSION)dev->dev_ext;
|
||||||
|
|
||||||
//FIXME: Is returning this value correct?
|
//FIXME: Is returning this value correct?
|
||||||
//FIXME: Mixing pci_dev and win structs isn't a good thing at all
|
//FIXME: Mixing pci_dev and win structs isn't a good thing at all
|
||||||
|
@ -440,7 +440,7 @@ static IO_ALLOCATION_ACTION NTAPI MapRegisterCallback(PDEVICE_OBJECT DeviceObjec
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
init_dma(POHCI_DEVICE_EXTENSION pDevExt)
|
init_dma(PUSBMP_DEVICE_EXTENSION pDevExt)
|
||||||
{
|
{
|
||||||
// Prepare device descriptor structure
|
// Prepare device descriptor structure
|
||||||
DEVICE_DESCRIPTION dd;
|
DEVICE_DESCRIPTION dd;
|
||||||
|
@ -552,7 +552,7 @@ static IO_ALLOCATION_ACTION NTAPI MapRegisterCallback(PDEVICE_OBJECT DeviceObjec
|
||||||
PVOID MapRegisterBase,
|
PVOID MapRegisterBase,
|
||||||
PVOID Context)
|
PVOID Context)
|
||||||
{
|
{
|
||||||
POHCI_DEVICE_EXTENSION pDevExt = (POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
PUSBMP_DEVICE_EXTENSION pDevExt = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||||
UNREFERENCED_PARAMETER(Irp);
|
UNREFERENCED_PARAMETER(Irp);
|
||||||
|
|
||||||
DPRINT("usb_linuxwrapper: MapRegisterCallback Called, base=0x%08x\n", MapRegisterBase);
|
DPRINT("usb_linuxwrapper: MapRegisterCallback Called, base=0x%08x\n", MapRegisterBase);
|
||||||
|
@ -664,7 +664,7 @@ address through the handle. If such a memory block can't be allocated, null is r
|
||||||
void * my_pci_pool_alloc(struct pci_pool * pool, int mem_flags, dma_addr_t *dma_handle)
|
void * my_pci_pool_alloc(struct pci_pool * pool, int mem_flags, dma_addr_t *dma_handle)
|
||||||
{
|
{
|
||||||
PVOID result;
|
PVOID result;
|
||||||
POHCI_DEVICE_EXTENSION devExt = (POHCI_DEVICE_EXTENSION)pool->pdev->dev_ext;
|
PUSBMP_DEVICE_EXTENSION devExt = (PUSBMP_DEVICE_EXTENSION)pool->pdev->dev_ext;
|
||||||
int page=0, offset;
|
int page=0, offset;
|
||||||
int map, i, block;
|
int map, i, block;
|
||||||
|
|
||||||
|
@ -789,7 +789,7 @@ void __inline__ my_pci_pool_destroy (struct pci_pool * pool)
|
||||||
|
|
||||||
void *my_pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle)
|
void *my_pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle)
|
||||||
{
|
{
|
||||||
POHCI_DEVICE_EXTENSION devExt = (POHCI_DEVICE_EXTENSION)hwdev->dev_ext;
|
PUSBMP_DEVICE_EXTENSION devExt = (PUSBMP_DEVICE_EXTENSION)hwdev->dev_ext;
|
||||||
DPRINT1("pci_alloc_consistent() size=%d\n", size);
|
DPRINT1("pci_alloc_consistent() size=%d\n", size);
|
||||||
|
|
||||||
return devExt->pDmaAdapter->DmaOperations->AllocateCommonBuffer(devExt->pDmaAdapter, size, (PPHYSICAL_ADDRESS)dma_handle, FALSE); //FIXME: Cache-enabled?
|
return devExt->pDmaAdapter->DmaOperations->AllocateCommonBuffer(devExt->pDmaAdapter, size, (PPHYSICAL_ADDRESS)dma_handle, FALSE); //FIXME: Cache-enabled?
|
||||||
|
@ -798,7 +798,7 @@ void *my_pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *d
|
||||||
dma_addr_t my_dma_map_single(struct device *hwdev, void *ptr, size_t size, enum dma_data_direction direction)
|
dma_addr_t my_dma_map_single(struct device *hwdev, void *ptr, size_t size, enum dma_data_direction direction)
|
||||||
{
|
{
|
||||||
//PHYSICAL_ADDRESS BaseAddress;
|
//PHYSICAL_ADDRESS BaseAddress;
|
||||||
//POHCI_DEVICE_EXTENSION pDevExt = (POHCI_DEVICE_EXTENSION)hwdev->dev_ext;
|
//PUSBMP_DEVICE_EXTENSION pDevExt = (PUSBMP_DEVICE_EXTENSION)hwdev->dev_ext;
|
||||||
//PUCHAR VirtualAddress = (PUCHAR) MmGetMdlVirtualAddress(pDevExt->Mdl);
|
//PUCHAR VirtualAddress = (PUCHAR) MmGetMdlVirtualAddress(pDevExt->Mdl);
|
||||||
//ULONG transferSize = size;
|
//ULONG transferSize = size;
|
||||||
//BOOLEAN WriteToDevice;
|
//BOOLEAN WriteToDevice;
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
|
|
||||||
#include "uhci_config.h"
|
#include "uhci_config.h"
|
||||||
#include "../usb_wrapper.h"
|
#include "../usb_wrapper.h"
|
||||||
#include "hcd.h"
|
#include "../../usbport/hcd.h"
|
||||||
#include "uhci-hcd.h"
|
#include "uhci-hcd.h"
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -7,12 +7,6 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include "uhci.h"
|
#include "uhci.h"
|
||||||
|
|
||||||
/* declare basic init functions and structures */
|
|
||||||
int uhci_hcd_init(void);
|
|
||||||
void uhci_hcd_cleanup(void);
|
|
||||||
int STDCALL usb_init(void);
|
|
||||||
void STDCALL usb_exit(void);
|
|
||||||
|
|
||||||
extern struct pci_driver uhci_pci_driver;
|
extern struct pci_driver uhci_pci_driver;
|
||||||
extern struct pci_device_id* uhci_pci_ids;
|
extern struct pci_device_id* uhci_pci_ids;
|
||||||
struct pci_device_id** pci_ids = &uhci_pci_ids;
|
struct pci_device_id** pci_ids = &uhci_pci_ids;
|
||||||
|
@ -22,7 +16,7 @@ InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
|
||||||
{
|
{
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
POHCI_DEVICE_EXTENSION DeviceExtension = (POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
PUSBMP_DEVICE_EXTENSION DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||||
|
|
||||||
/* Create generic linux structure */
|
/* Create generic linux structure */
|
||||||
struct pci_dev *dev;
|
struct pci_dev *dev;
|
||||||
|
@ -38,7 +32,7 @@ InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
|
||||||
strcpy(dev->dev.name, "UnivHCI PCI-USB Controller");
|
strcpy(dev->dev.name, "UnivHCI PCI-USB Controller");
|
||||||
strcpy(dev->slot_name, "UHCD PCI Slot");
|
strcpy(dev->slot_name, "UHCD PCI Slot");
|
||||||
|
|
||||||
/* Init the OHCI HCD. Probe will be called automatically, but will fail because id=NULL */
|
/* Init the HCD. Probe will be called automatically, but will fail because id=NULL */
|
||||||
Status = uhci_hcd_init();
|
Status = uhci_hcd_init();
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -64,12 +58,12 @@ InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
|
||||||
VOID STDCALL
|
VOID STDCALL
|
||||||
DriverUnload(PDRIVER_OBJECT DriverObject)
|
DriverUnload(PDRIVER_OBJECT DriverObject)
|
||||||
{
|
{
|
||||||
POHCI_DEVICE_EXTENSION DeviceExtension;
|
PUSBMP_DEVICE_EXTENSION DeviceExtension;
|
||||||
PDEVICE_OBJECT DeviceObject;
|
PDEVICE_OBJECT DeviceObject;
|
||||||
struct pci_dev *dev;
|
struct pci_dev *dev;
|
||||||
|
|
||||||
DeviceObject = DriverObject->DeviceObject;
|
DeviceObject = DriverObject->DeviceObject;
|
||||||
DeviceExtension = (POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||||
|
|
||||||
dev = DeviceExtension->pdev;
|
dev = DeviceExtension->pdev;
|
||||||
|
|
||||||
|
@ -78,7 +72,7 @@ DriverUnload(PDRIVER_OBJECT DriverObject)
|
||||||
// Exit usb device
|
// Exit usb device
|
||||||
usb_exit();
|
usb_exit();
|
||||||
|
|
||||||
// Remove device (ohci_pci_driver.remove)
|
// Remove device (uhci_pci_driver.remove)
|
||||||
uhci_pci_driver.remove(dev);
|
uhci_pci_driver.remove(dev);
|
||||||
|
|
||||||
ExFreePool(dev->slot_name);
|
ExFreePool(dev->slot_name);
|
||||||
|
|
9
reactos/drivers/usb/miniport/usbuhci/uhci.h
Normal file
9
reactos/drivers/usb/miniport/usbuhci/uhci.h
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#include "usbcommon.h"
|
||||||
|
|
||||||
|
#define USB_UHCI_TAG TAG('u','s','b','u')
|
||||||
|
|
||||||
|
/* declare basic init functions and structures */
|
||||||
|
int uhci_hcd_init(void);
|
||||||
|
void uhci_hcd_cleanup(void);
|
||||||
|
int STDCALL usb_init(void);
|
||||||
|
void STDCALL usb_exit(void);
|
|
@ -2,7 +2,6 @@
|
||||||
<define name="__USE_W32API" />
|
<define name="__USE_W32API" />
|
||||||
<define name="DEBUG_MODE" />
|
<define name="DEBUG_MODE" />
|
||||||
<include>../linux</include>
|
<include>../linux</include>
|
||||||
<include base="usbport"></include>
|
|
||||||
<include base="usbminiportcommon"></include>
|
<include base="usbminiportcommon"></include>
|
||||||
<library>sys_base</library>
|
<library>sys_base</library>
|
||||||
<library>usbminiportcommon</library>
|
<library>usbminiportcommon</library>
|
||||||
|
|
Loading…
Reference in a new issue