Skip to content

WIP: xpadneo, device: Fix up NUL byte before final End Collection#622

Draft
kakra wants to merge 1 commit into
atar-axis:masterfrom
kakra:fixes/descriptor-missing-end-collections
Draft

WIP: xpadneo, device: Fix up NUL byte before final End Collection#622
kakra wants to merge 1 commit into
atar-axis:masterfrom
kakra:fixes/descriptor-missing-end-collections

Conversation

@kakra

@kakra kakra commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Some firmwares write 0x00 where a second End Collection (0xC0) was needed to close a nested collection, followed by a correct final 0xC0. The HID parser then sees an unknown Main item instead of the closing End Collection, breaking descriptor parsing for the affected report.

Replace the stray 0x00 with 0xC0 so the descriptor ends with two valid End Collections. Do not shrink the descriptor: both bytes are required to close the two open collections.

TODO:

  • Needs descriptor dump to find and validate both opening offsets

Link: #603

  • I agree that my contribution is accepted under the project's existing license terms, and that contributions to
    the module source code are accepted under GPL-2.0-only.
  • My contribution has been created with the help of AI, including prior research with AI chatbots or AI-assisted
    reviews and suggestions (e.g. GitHub Copilot PR suggestions). I will not contribute commits with a
    Co-authored-by signature of an AI agent because I confirm that my contribution has been verified, reviewed and
    tested by a human being, and I take full responsibility as the author of the commit using my own Signed-off-by.
  • My contribution has not been created with the help of AI coding agents, prior research with AI chatbots, or any
    other interaction with AI.

@GloriousEggroll Are you able to provide the missing broken descriptor so we can implement this evidence-based?

Some firmwares write 0x00 where a second End Collection (0xC0) was
needed to close a nested collection, followed by a correct final
0xC0. The HID parser then sees an unknown Main item instead of the
closing End Collection, breaking descriptor parsing for the affected
report.

Replace the stray 0x00 with 0xC0 so the descriptor ends with two
valid End Collections. Do not shrink the descriptor: both bytes are
required to close the two open collections.

TODO:
- [ ] Needs descriptor dump to find and validate both opening offsets

Link: atar-axis#603
Co-authored-by: GloriousEggroll <gloriouseggroll@gmail.com>
Signed-off-by: Kai Krakow <kai@kaishome.de>
@kakra kakra added this to the v0.11 milestone Jul 4, 2026
@kakra kakra added 0 | type: enhancement New feature or request 0 | type: third party bug 0 | type: hardware support Support third-party hardware and clones labels Jul 4, 2026
@GloriousEggroll

Copy link
Copy Markdown
Contributor

sorry ive been away from this for a little while with other projects taking priority, which device(s) did you need descriptor dumps from?

@kakra

kakra commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator Author

I have two queued commits which miss descriptors as evidence for the checksums and fixups:

New known checksums:

- Xbox One Elite Series 2 legacy firmware
- Xbox One S 1708 (fw 0x0903 with truncated rumble descriptor)

From the C code:

{ .crc16 = 0x28FA, .name = "Xbox One Elite Series 2 (legacy)" },
{ .crc16 = 0x6BA1, .name = "Xbox One S 1708 (fw 0x0903, truncated rumble descriptor)" },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0 | type: enhancement New feature or request 0 | type: hardware support Support third-party hardware and clones 0 | type: third party bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants