diff --git a/src/add-ons/kernel/drivers/input/usb_hid/Driver.cpp b/src/add-ons/kernel/drivers/input/usb_hid/Driver.cpp index c2cc5b0b8d..e525175f3a 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/Driver.cpp +++ b/src/add-ons/kernel/drivers/input/usb_hid/Driver.cpp @@ -323,11 +323,12 @@ init_driver() if (sSupportDescriptors != NULL) { sSupportDescriptors[0] = genericHIDSupportDescriptor; for (int32 i = 0; i < gQuirkyDeviceCount; i++) { - sSupportDescriptors[i + 1].dev_class = 0; - sSupportDescriptors[i + 1].dev_subclass = 0; - sSupportDescriptors[i + 1].dev_protocol = 0; - sSupportDescriptors[i + 1].vendor = gQuirkyDevices[i].vendor_id; - sSupportDescriptors[i + 1].product = gQuirkyDevices[i].product_id; + usb_support_descriptor &descriptor = sSupportDescriptors[i + 1]; + descriptor.dev_class = gQuirkyDevices[i].device_class; + descriptor.dev_subclass = gQuirkyDevices[i].device_subclass; + descriptor.dev_protocol = gQuirkyDevices[i].device_protocol; + descriptor.vendor = gQuirkyDevices[i].vendor_id; + descriptor.product = gQuirkyDevices[i].product_id; } gUSBModule->register_driver(DRIVER_NAME, sSupportDescriptors, diff --git a/src/add-ons/kernel/drivers/input/usb_hid/QuirkyDevices.cpp b/src/add-ons/kernel/drivers/input/usb_hid/QuirkyDevices.cpp index 528094e336..81da30ee12 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/QuirkyDevices.cpp +++ b/src/add-ons/kernel/drivers/input/usb_hid/QuirkyDevices.cpp @@ -88,8 +88,15 @@ sixaxis_build_descriptor(HIDWriter &writer) usb_hid_quirky_device gQuirkyDevices[] = { - // Sony SIXAXIS controller (PS3) needs a GET_REPORT to become operational - { 0x054c, 0x0268, sixaxis_init, sixaxis_build_descriptor } + { + // The Sony SIXAXIS controller (PS3) needs a GET_REPORT to become + // operational which we do in sixaxis_init. Also the normal report + // descriptor doesn't contain items for the motion sensing data + // and pressure sensitive buttons, so we constrcut a new report + // descriptor that includes those extra items. + 0x054c, 0x0268, USB_INTERFACE_CLASS_HID, 0, 0, + sixaxis_init, sixaxis_build_descriptor + } }; int32 gQuirkyDeviceCount diff --git a/src/add-ons/kernel/drivers/input/usb_hid/QuirkyDevices.h b/src/add-ons/kernel/drivers/input/usb_hid/QuirkyDevices.h index d7f90b86c1..e22229e47e 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/QuirkyDevices.h +++ b/src/add-ons/kernel/drivers/input/usb_hid/QuirkyDevices.h @@ -16,6 +16,11 @@ typedef status_t (*quirky_build_descriptor)(HIDWriter &writer); struct usb_hid_quirky_device { uint16 vendor_id; uint16 product_id; + + uint8 device_class; + uint8 device_subclass; + uint8 device_protocol; + quirky_init_function init_function; quirky_build_descriptor build_descriptor; };