IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
- UNIMPLEMENTED
- return STATUS_NOT_IMPLEMENTED;
+ PHIDCLASS_COMMON_DEVICE_EXTENSION CommonDeviceExtension;
+ CommonDeviceExtension = DeviceObject->DeviceExtension;
+
+ if (CommonDeviceExtension->IsFDO)
+ {
+ IoCopyCurrentIrpStackLocationToNext(Irp);
+ return HidClassFDO_DispatchRequest(DeviceObject, Irp);
+ }
+ else
+ {
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ PoStartNextPowerIrp(Irp);
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_SUCCESS;
+ }
}
NTSTATUS
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
+NTSTATUS
+HidClassFDO_DispatchRequest(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp);
+
NTSTATUS
HidClassFDO_DispatchRequestSynchronous(
IN PDEVICE_OBJECT DeviceObject,
NTSTATUS
FDO_DeviceRelations(
- PDEVICE_OBJECT DeviceObject,
+ PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
ULONG DeviceCount = 0;
NTSTATUS
FDO_StartDevice(
- PDEVICE_OBJECT DeviceObject,
+ PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
NTSTATUS Status;
/* Get stack location */
IoStack = IoGetCurrentIrpStackLocation(Irp);
- if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_INTERNAL_USB_RESET_PORT ||
+ if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_INTERNAL_USB_RESET_PORT ||
IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_INTERNAL_USB_CYCLE_PORT)
{
/* Handle reset / cycle ports */
return IoCallDriver(FDODeviceExtension->NextDeviceObject, Irp);
}
+NTSTATUS
+FDO_HandleSystemControl(
+ PDEVICE_OBJECT DeviceObject,
+ PIRP Irp)
+{
+ PFDO_DEVICE_EXTENSION FDODeviceExtension;
+
+ /* Get device extension */
+ FDODeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
+ ASSERT(FDODeviceExtension->Common.IsFDO);
+
+ /* Forward and forget request */
+ IoSkipCurrentIrpStackLocation(Irp);
+ return IoCallDriver(FDODeviceExtension->NextDeviceObject, Irp);
+}
+
NTSTATUS
FDO_Dispatch(
- PDEVICE_OBJECT DeviceObject,
+ PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
PIO_STACK_LOCATION IoStack;
NTSTATUS Status;
+ PFDO_DEVICE_EXTENSION FDODeviceExtension;
+
+ /* Get device extension */
+ FDODeviceExtension = DeviceObject->DeviceExtension;
+ ASSERT(FDODeviceExtension->Common.IsFDO);
/* Get stack location */
IoStack = IoGetCurrentIrpStackLocation(Irp);
{
case IRP_MJ_PNP:
return FDO_HandlePnp(DeviceObject, Irp);
- case IRP_MJ_INTERNAL_DEVICE_CONTROL:
+ case IRP_MJ_INTERNAL_DEVICE_CONTROL:
return FDO_HandleInternalDeviceControl(DeviceObject, Irp);
+ case IRP_MJ_POWER:
+ PoStartNextPowerIrp(Irp);
+ IoSkipCurrentIrpStackLocation(Irp);
+ return PoCallDriver(FDODeviceExtension->NextDeviceObject, Irp);
+ case IRP_MJ_SYSTEM_CONTROL:
+ return FDO_HandleSystemControl(DeviceObject, Irp);
default:
DPRINT1("FDO_Dispatch Function %x not implemented\n", IoStack->MajorFunction);
ASSERT(FALSE);
return PDO_HandlePnp(DeviceObject, Irp);
case IRP_MJ_INTERNAL_DEVICE_CONTROL:
return PDO_HandleInternalDeviceControl(DeviceObject, Irp);
+ case IRP_MJ_POWER:
+ PoStartNextPowerIrp(Irp);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_SUCCESS;
default:
DPRINT1("PDO_Dispatch Function %x not implemented\n", IoStack->MajorFunction);
Status = Irp->IoStatus.Status;
DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = USBCCGP_Dispatch;
DriverObject->MajorFunction[IRP_MJ_POWER] = USBCCGP_Dispatch;
DriverObject->MajorFunction[IRP_MJ_PNP] = USBCCGP_Dispatch;
- DriverObject->DriverUnload = USBCCGP_Unload;
+ DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = USBCCGP_Dispatch;
+ DriverObject->DriverUnload = USBCCGP_Unload;
/* FIMXE query GenericCompositeUSBDeviceString */
}
else
{
- // HACK: logical boundaries are absolute values
+ // logical boundaries are absolute values
return HIDPARSER_STATUS_BAD_LOG_PHY_VALUES;
}
//
// Is the Request for the root hub
//
- if (Urb->UrbHeader.UsbdDeviceHandle == PVOID(this))
+ if (Urb->UrbHeader.UsbdDeviceHandle == PVOID(this) || Urb->UrbHeader.UsbdDeviceHandle == NULL)
{
ASSERT(m_PendingSCEIrp == NULL);
if (QueryStatusChageEndpoint(Irp))
DeviceStatus = (PUSHORT)Urb->UrbControlGetStatusRequest.TransferBuffer;
- if (Urb->UrbHeader.UsbdDeviceHandle == PVOID(this))
+ if (Urb->UrbHeader.UsbdDeviceHandle == PVOID(this) || Urb->UrbHeader.UsbdDeviceHandle == NULL)
{
//
// FIXME need more flags ?
case USB_DEVICE_CLASS_RESERVED: // FALL THROUGH
case USB_DEVICE_CLASS_HUB:
{
- if (Urb->UrbHeader.UsbdDeviceHandle == PVOID(this))
+ if (Urb->UrbHeader.UsbdDeviceHandle == PVOID(this) || Urb->UrbHeader.UsbdDeviceHandle == NULL)
{
//
// sanity checks
PC_ASSERT(Urb->UrbControlDescriptorRequest.TransferBufferLength >= sizeof(USB_DEVICE_DESCRIPTOR));
PC_ASSERT(Urb->UrbControlDescriptorRequest.TransferBuffer);
- if (Urb->UrbHeader.UsbdDeviceHandle == PVOID(this))
+ if (Urb->UrbHeader.UsbdDeviceHandle == PVOID(this) || Urb->UrbHeader.UsbdDeviceHandle == NULL)
{
//
// copy root hub device descriptor
BufferLength = Urb->UrbControlDescriptorRequest.TransferBufferLength;
Buffer = (PUCHAR) Urb->UrbControlDescriptorRequest.TransferBuffer;
- if (Urb->UrbHeader.UsbdDeviceHandle == PVOID(this))
+ if (Urb->UrbHeader.UsbdDeviceHandle == PVOID(this) || Urb->UrbHeader.UsbdDeviceHandle == NULL)
{
//
// request is for the root bus controller