[ros-diffs] [janderwald] 55255: [USBCCGP] - Use Function index than interface number. Fixes invalid hardware ids - Fix construction of compatible id - USB Audio device now installs on XP when usbccgp is used -...
janderwald at svn.reactos.org
janderwald at svn.reactos.org
Fri Jan 27 18:33:41 UTC 2012
Author: janderwald
Date: Fri Jan 27 18:33:41 2012
New Revision: 55255
URL: http://svn.reactos.org/svn/reactos?rev=55255&view=rev
Log:
[USBCCGP]
- Use Function index than interface number. Fixes invalid hardware ids
- Fix construction of compatible id
- USB Audio device now installs on XP when usbccgp is used
- Now asserts in sb-bringup-trunk\drivers\usb\usbccgp\pdo.c:343) PDO_Dispatch Function f not implemented, which is implemented next
Modified:
branches/usb-bringup-trunk/drivers/usb/usbccgp/function.c
Modified: branches/usb-bringup-trunk/drivers/usb/usbccgp/function.c
URL: http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/usbccgp/function.c?rev=55255&r1=55254&r2=55255&view=diff
==============================================================================
--- branches/usb-bringup-trunk/drivers/usb/usbccgp/function.c [iso-8859-1] (original)
+++ branches/usb-bringup-trunk/drivers/usb/usbccgp/function.c [iso-8859-1] Fri Jan 27 18:33:41 2012
@@ -514,6 +514,7 @@
USBCCG_InitIdsWithInterfaceDescriptor(
IN PFDO_DEVICE_EXTENSION FDODeviceExtension,
IN PUSB_INTERFACE_DESCRIPTOR Descriptor,
+ IN ULONG FunctionIndex,
OUT PUSBC_FUNCTION_DESCRIPTOR FunctionDescriptor)
{
ULONG Index;
@@ -553,17 +554,16 @@
}
-
//
// now init hardware id
//
Index = swprintf(Buffer, L"USB\\VID_%04x&PID_%04x&Rev_%04x&MI_%02x", FDODeviceExtension->DeviceDescriptor->idVendor,
FDODeviceExtension->DeviceDescriptor->idProduct,
FDODeviceExtension->DeviceDescriptor->bcdDevice,
- Descriptor->bInterfaceNumber) + 1;
+ FunctionIndex) + 1;
Index += swprintf(&Buffer[Index], L"USB\\VID_%04x&PID_%04x&MI_%02x", FDODeviceExtension->DeviceDescriptor->idVendor,
FDODeviceExtension->DeviceDescriptor->idProduct,
- Descriptor->bInterfaceNumber) + 1;
+ FunctionIndex) + 1;
// allocate result buffer
DescriptionBuffer = AllocateItem(NonPagedPool, (Index + 1) * sizeof(WCHAR));
@@ -581,13 +581,12 @@
FunctionDescriptor->HardwareId.Length = Index * sizeof(WCHAR);
FunctionDescriptor->HardwareId.MaximumLength = (Index + 1) * sizeof(WCHAR);
-
//
// now init the compatible id
//
Index = swprintf(Buffer, L"USB\\Class_%02x&SubClass_%02x&Prot_%02x", Descriptor->bInterfaceClass, Descriptor->bInterfaceSubClass, Descriptor->bInterfaceProtocol) + 1;
- Index += swprintf(&Buffer[Index], L"USB\\Class_%04x&SubClass_%04x", Descriptor->bInterfaceClass, Descriptor->bInterfaceSubClass) + 1;
- Index += swprintf(&Buffer[Index], L"USB\\Class_%04x", Descriptor->bInterfaceClass) + 1;
+ Index += swprintf(&Buffer[Index], L"USB\\Class_%02x&SubClass_%02x", Descriptor->bInterfaceClass, Descriptor->bInterfaceSubClass) + 1;
+ Index += swprintf(&Buffer[Index], L"USB\\Class_%02x", Descriptor->bInterfaceClass) + 1;
// allocate result buffer
DescriptionBuffer = AllocateItem(NonPagedPool, (Index + 1) * sizeof(WCHAR));
@@ -604,6 +603,11 @@
FunctionDescriptor->CompatibleId.Buffer = DescriptionBuffer;
FunctionDescriptor->CompatibleId.Length = Index * sizeof(WCHAR);
FunctionDescriptor->CompatibleId.MaximumLength = (Index + 1) * sizeof(WCHAR);
+
+ //
+ // done
+ //
+ return STATUS_SUCCESS;
}
@@ -678,7 +682,7 @@
//
// now init the device ids
//
- Status = USBCCG_InitIdsWithInterfaceDescriptor(FDODeviceExtension, InterfaceDescriptor, &FDODeviceExtension->FunctionDescriptor[Index]);
+ Status = USBCCG_InitIdsWithInterfaceDescriptor(FDODeviceExtension, InterfaceDescriptor, Index, &FDODeviceExtension->FunctionDescriptor[Index]);
if (!NT_SUCCESS(Status))
{
//
@@ -803,7 +807,7 @@
//
// now init the device ids
//
- Status = USBCCG_InitIdsWithInterfaceDescriptor(FDODeviceExtension, InterfaceDescriptor, &FDODeviceExtension->FunctionDescriptor[0]);
+ Status = USBCCG_InitIdsWithInterfaceDescriptor(FDODeviceExtension, FirstDescriptor, 0, &FDODeviceExtension->FunctionDescriptor[0]);
if (!NT_SUCCESS(Status))
{
//
More information about the Ros-diffs
mailing list