* Add device class, subclass and protocol to the quirky device structure.

* Add these to the usb_support_descriptor when adding from the quirky devices.
* Extend the SIXAXIS comment a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42000 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2011-06-06 23:48:28 +00:00
parent cac918bed0
commit c67c6b5300
3 changed files with 20 additions and 7 deletions

View File

@ -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,

View File

@ -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

View File

@ -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;
};