[PR #43] [2/5] MAC handling: Mac struct + pooled allocation (PS5) #46

Open
opened 2026-10-15 12:51:36 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/inputtino/pull/43
Author: @kmreisi
Created: 6/28/2026
Status: 🔄 Open

Base: stable ← Head: feat/mac-struct-pool


📝 Commits (6)

  • 2ca4e07 Align PS5 MAC handling via shared uhid helpers
  • 7a88920 Introduce Mac struct with shared helpers
  • 342f6c3 Use pooled MAC allocation with reuse on release
  • b24e301 fix(mac): monotonic counter allocation, validate parse input
  • d010cdb refactor(uhid): move find_uhid_sys_nodes out of the header
  • b4f7fe9 test(capi): assert every switch node path, not just the first

📊 Changes

10 files changed (+276 additions, -113 deletions)

View changed files

📝 CMakeLists.txt (+2 -1)
📝 include/inputtino/input.hpp (+2 -8)
➕ include/inputtino/mac.hpp (+42 -0)
➕ src/mac.cpp (+103 -0)
📝 src/uhid/include/uhid/protected_types.hpp (+1 -11)
📝 src/uhid/include/uhid/uhid.hpp (+10 -2)
📝 src/uhid/joypad_ps5.cpp (+17 -84)
➕ src/uhid/uhid.cpp (+50 -0)
📝 tests/testCAPI.cpp (+11 -7)
📝 tests/testUHID.cpp (+38 -0)

📄 Description

[2/5] in the dynamic-UHID-joypads roadmap (see #44).

Foundational refactor of the PS5 virtual-device MAC handling, pulled out ahead of
the joypad work so it can land on its own:

  • Introduce a Mac struct (include/inputtino/mac.hpp) with parse/format/compare
    helpers; implementation in src/mac.cpp so the public header stays light.
  • Allocate MACs from a small pool with reuse-on-release, checking existing UHID
    devices to avoid collisions (the kernel rejects duplicate MACs).
  • Align the existing PS5 pad onto these shared helpers.

PS5-only and behavior-preserving (PS5Joypad::create unchanged); the Switch pad
adopts the same Mac struct in [4/5]. Builds, tests pass, Sunshine + wolf compile.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/games-on-whales/inputtino/pull/43 **Author:** [@kmreisi](https://github.com/kmreisi) **Created:** 6/28/2026 **Status:** 🔄 Open **Base:** `stable` ← **Head:** `feat/mac-struct-pool` --- ### 📝 Commits (6) - [`2ca4e07`](https://github.com/games-on-whales/inputtino/commit/2ca4e07cd5ffb60cd3cffe17f500e6e1c067c86f) Align PS5 MAC handling via shared uhid helpers - [`7a88920`](https://github.com/games-on-whales/inputtino/commit/7a889203b0338efa5aafa2bb6442319217cfd63a) Introduce Mac struct with shared helpers - [`342f6c3`](https://github.com/games-on-whales/inputtino/commit/342f6c3a8557b58ca509d4fe09071e61dc4d6291) Use pooled MAC allocation with reuse on release - [`b24e301`](https://github.com/games-on-whales/inputtino/commit/b24e3012ec9d530ab03a08aa05092ef33d66f1ba) fix(mac): monotonic counter allocation, validate parse input - [`d010cdb`](https://github.com/games-on-whales/inputtino/commit/d010cdb4cf64f58a97651fe14263616740a3d7b8) refactor(uhid): move find_uhid_sys_nodes out of the header - [`b4f7fe9`](https://github.com/games-on-whales/inputtino/commit/b4f7fe9a36b4a9b532b83949daee8e28c5017bd9) test(capi): assert every switch node path, not just the first ### 📊 Changes **10 files changed** (+276 additions, -113 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+2 -1) 📝 `include/inputtino/input.hpp` (+2 -8) ➕ `include/inputtino/mac.hpp` (+42 -0) ➕ `src/mac.cpp` (+103 -0) 📝 `src/uhid/include/uhid/protected_types.hpp` (+1 -11) 📝 `src/uhid/include/uhid/uhid.hpp` (+10 -2) 📝 `src/uhid/joypad_ps5.cpp` (+17 -84) ➕ `src/uhid/uhid.cpp` (+50 -0) 📝 `tests/testCAPI.cpp` (+11 -7) 📝 `tests/testUHID.cpp` (+38 -0) </details> ### 📄 Description **`[2/5]` in the dynamic-UHID-joypads roadmap (see #44).** Foundational refactor of the PS5 virtual-device MAC handling, pulled out ahead of the joypad work so it can land on its own: - Introduce a `Mac` struct (`include/inputtino/mac.hpp`) with parse/format/compare helpers; implementation in `src/mac.cpp` so the public header stays light. - Allocate MACs from a small pool with reuse-on-release, checking existing UHID devices to avoid collisions (the kernel rejects duplicate MACs). - Align the existing PS5 pad onto these shared helpers. PS5-only and behavior-preserving (`PS5Joypad::create` unchanged); the Switch pad adopts the same `Mac` struct in `[4/5]`. Builds, tests pass, Sunshine + wolf compile. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/inputtino#46
No description provided.