mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 14:05:42 +00:00
[HIDCLASS]
- Implement set idle request. The device should only send data when there is actual data. May also fix the mouse debug flood when mouse is ejected - Not yet supported in OHCI - Add missing constants svn path=/branches/usb-bringup-trunk/; revision=55356
This commit is contained in:
parent
c07fd3b20f
commit
3bb6d463d3
4 changed files with 85 additions and 1 deletions
|
@ -1230,6 +1230,72 @@ Hid_SelectConfiguration(
|
|||
return Status;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
Hid_SetIdle(
|
||||
IN PDEVICE_OBJECT DeviceObject)
|
||||
{
|
||||
PHID_USB_DEVICE_EXTENSION HidDeviceExtension;
|
||||
PHID_DEVICE_EXTENSION DeviceExtension;
|
||||
PURB Urb;
|
||||
NTSTATUS Status;
|
||||
|
||||
//
|
||||
// get device extension
|
||||
//
|
||||
DeviceExtension = (PHID_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||
HidDeviceExtension = (PHID_USB_DEVICE_EXTENSION)DeviceExtension->MiniDeviceExtension;
|
||||
|
||||
//
|
||||
// allocate urb
|
||||
//
|
||||
Urb = ExAllocatePool(NonPagedPool, sizeof(struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST));
|
||||
if (!Urb)
|
||||
{
|
||||
//
|
||||
// no memory
|
||||
//
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
//
|
||||
// zero urb
|
||||
//
|
||||
RtlZeroMemory(Urb, sizeof(struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST));
|
||||
|
||||
//
|
||||
// format urb
|
||||
//
|
||||
UsbBuildVendorRequest(Urb,
|
||||
URB_FUNCTION_CLASS_INTERFACE,
|
||||
sizeof(struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST),
|
||||
0,
|
||||
HID_REPORT_DESCRIPTOR_TYPE,
|
||||
USB_SET_IDLE_REQUEST, // HID_SET_IDLE
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
0,
|
||||
NULL);
|
||||
|
||||
//
|
||||
// dispatch urb
|
||||
//
|
||||
Status = Hid_DispatchUrb(DeviceObject, Urb);
|
||||
|
||||
//
|
||||
// free urb
|
||||
//
|
||||
ExFreePool(Urb);
|
||||
|
||||
//
|
||||
// print status
|
||||
//
|
||||
DPRINT1("Status %x\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
NTSTATUS
|
||||
Hid_PnpStart(
|
||||
|
@ -1333,6 +1399,12 @@ Hid_PnpStart(
|
|||
ASSERT(InterfaceDescriptor->bDescriptorType == USB_INTERFACE_DESCRIPTOR_TYPE);
|
||||
ASSERT(InterfaceDescriptor->bLength == sizeof(USB_INTERFACE_DESCRIPTOR));
|
||||
|
||||
//
|
||||
// now set the device idle
|
||||
//
|
||||
Hid_SetIdle(DeviceObject);
|
||||
|
||||
|
||||
//
|
||||
// move to next descriptor
|
||||
//
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#include <usb.h>
|
||||
#include <usbdlib.h>
|
||||
|
||||
#include <hidport.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
//
|
||||
|
@ -80,3 +82,5 @@ NTSTATUS
|
|||
Hid_DispatchUrb(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PURB Urb);
|
||||
|
||||
#define USB_SET_IDLE_REQUEST 0xA
|
||||
|
|
|
@ -1731,7 +1731,10 @@ CHubController::HandleClassInterface(
|
|||
|
||||
if (Urb->UrbControlVendorClassRequest.TransferBufferLength == 0)
|
||||
{
|
||||
DPRINT1("Invalid request length\n");
|
||||
//
|
||||
// FIXME: support requests w/o data stage
|
||||
//;
|
||||
ASSERT(FALSE);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,11 @@ typedef struct _HID_DESCRIPTOR
|
|||
|
||||
#include <poppack.h>
|
||||
|
||||
#define HID_HID_DESCRIPTOR_TYPE 0x21
|
||||
#define HID_REPORT_DESCRIPTOR_TYPE 0x22
|
||||
#define HID_PHYSICAL_DESCRIPTOR_TYPE 0x23
|
||||
|
||||
|
||||
|
||||
typedef
|
||||
VOID
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue