Skip to content

ZD Ultimate Legend gamepad support (fixing 2.4GHz dongle wireless mode) #350

@mocksoul

Description

@mocksoul

This one: https://zd-gaming.com/products/zd-ultimate-legend-wireless-controller

Sadly, it mimics to be original xbox360 controller:

Dec 26 13:04:04 rbro kernel: usb 5-3.3: New USB device found, idVendor=045e, idProduct=028e, bcdDevice= 5.72
Dec 26 13:04:04 rbro kernel: usb 5-3.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Dec 26 13:04:04 rbro kernel: usb 5-3.3: Product: XBOX 360 For Windows Controller
Dec 26 13:04:04 rbro kernel: usb 5-3.3: Manufacturer: Microsoft

Without any fixes - wired mode works, but in wireless mode controller does not send any events at all. I was able to fix by sending magic trash:

for d in __import__("usb").core.find(find_all=True, idVendor=0x045E, idProduct=0x028E):
    s = d.ctrl_transfer(0xC0, 0x1, 0x0, 0x0, 0x04)

In xpad driver code this could look like this:

status = usb_control_msg(xpad->udev,
    usb_rcvctrlpipe(xpad->udev, 0),
    0x1, 0xc0,
    cpu_to_le16(0x0), cpu_to_le16(0x0), data, cpu_to_le16(4),
    TIMEOUT);

After this quirk there are some warnings from linux kernel, but everything works

Dec 26 12:46:19 rbro kernel: input input122: unable to receive magic message: -110
Dec 26 12:46:19 rbro kernel: input input122: unable to receive magic message: -110
Dec 26 12:46:20 rbro kernel: input input122: unable to receive magic message: -110
Dec 26 12:46:21 rbro kernel: input input122: unable to receive magic message: -110

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions