* 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:
parent
cac918bed0
commit
c67c6b5300
@ -323,11 +323,12 @@ init_driver()
|
|||||||
if (sSupportDescriptors != NULL) {
|
if (sSupportDescriptors != NULL) {
|
||||||
sSupportDescriptors[0] = genericHIDSupportDescriptor;
|
sSupportDescriptors[0] = genericHIDSupportDescriptor;
|
||||||
for (int32 i = 0; i < gQuirkyDeviceCount; i++) {
|
for (int32 i = 0; i < gQuirkyDeviceCount; i++) {
|
||||||
sSupportDescriptors[i + 1].dev_class = 0;
|
usb_support_descriptor &descriptor = sSupportDescriptors[i + 1];
|
||||||
sSupportDescriptors[i + 1].dev_subclass = 0;
|
descriptor.dev_class = gQuirkyDevices[i].device_class;
|
||||||
sSupportDescriptors[i + 1].dev_protocol = 0;
|
descriptor.dev_subclass = gQuirkyDevices[i].device_subclass;
|
||||||
sSupportDescriptors[i + 1].vendor = gQuirkyDevices[i].vendor_id;
|
descriptor.dev_protocol = gQuirkyDevices[i].device_protocol;
|
||||||
sSupportDescriptors[i + 1].product = gQuirkyDevices[i].product_id;
|
descriptor.vendor = gQuirkyDevices[i].vendor_id;
|
||||||
|
descriptor.product = gQuirkyDevices[i].product_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
gUSBModule->register_driver(DRIVER_NAME, sSupportDescriptors,
|
gUSBModule->register_driver(DRIVER_NAME, sSupportDescriptors,
|
||||||
|
@ -88,8 +88,15 @@ sixaxis_build_descriptor(HIDWriter &writer)
|
|||||||
|
|
||||||
|
|
||||||
usb_hid_quirky_device gQuirkyDevices[] = {
|
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
|
int32 gQuirkyDeviceCount
|
||||||
|
@ -16,6 +16,11 @@ typedef status_t (*quirky_build_descriptor)(HIDWriter &writer);
|
|||||||
struct usb_hid_quirky_device {
|
struct usb_hid_quirky_device {
|
||||||
uint16 vendor_id;
|
uint16 vendor_id;
|
||||||
uint16 product_id;
|
uint16 product_id;
|
||||||
|
|
||||||
|
uint8 device_class;
|
||||||
|
uint8 device_subclass;
|
||||||
|
uint8 device_protocol;
|
||||||
|
|
||||||
quirky_init_function init_function;
|
quirky_init_function init_function;
|
||||||
quirky_build_descriptor build_descriptor;
|
quirky_build_descriptor build_descriptor;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user