[Toybox] Proposal: Add ucsicontrol (USB Type-C UCSI utility) to toybox

Rob Landley rob at landley.net
Tue Jul 14 23:18:40 UTC 2026


On 7/14/26 07:42, M, Madhu wrote:
> Hi Rob,
> 
> Thanks for the review. I have addressed the portability and readability comments in v2.

As I mentioned last email, I checked the first version you sent me in to 
toys/pending already:

https://codeberg.org/landley/toybox/commit/3633a0137626

(Pending is part of toybox and builds fine, it's just not enabled in 
defconfig until it's less of a moving target.)

While I can turn the patch you just sent me into a relative patch 
against the previous one myself, it's a bit awkward to do that while 
still giving you proper attribution in the metadata. Could you do a 
relative patch from previous version to current version that I can apply 
on top of the first one without fudging the history? :)

Possibly I should add a https://landley.net/toybox/faq.html entry about 
codeberg?

I started migrating from Microsoft Copilot/Github 6 months ago:

https://github.com/landley/toybox/commit/ea6c172dadd0

https://en.wikipedia.org/wiki/Codeberg

https://mstdn.jp/@landley/115023782984779498
https://mstdn.jp/@landley/115334344144553768

In part because Microsoft Github is now a subsidiary of Copilot. (It 
doesn't "contain" copilot, their engineers report to, are funded by, and 
exist to support Microsoft's LLM division. Copilot owns Github within 
Microsoft.)

https://www.reddit.com/r/microsoft/comments/1mniwzx/github_is_no_longer_independent_at_microsoft/

But even before that, Microsoft restricted my account (sort of like the 
current age restriction stuff, except they hadn't all collaborated on 
that as the One True Excuse to demand a license to use the internet yet):

https://github.com/landley/toybox/commit/5229f56b4c53

The toybox 0.8.14 release notes explicitly said the Microsoft 
Copilot/Github mirror would no longer be regularly updated without a 
pressing reason:

https://github.com/landley/toybox/blob/0.8.14/www/news.html#L65

I'm hoping the next toybox release can be 0.9.0 (I.E. promoting the 
shell out of pending), at which point I was thinking of doing a zap 
commit like https://github.com/landley/mkroot (where the history is all 
still there, but the most RECENT commit deletes all the files and 
changes the readme to say "Go here instead"). But I didn't want to 
spring that on people without months and months of warning, and I dunno 
if I'll wind up doing a 0.8.15 in between. At which point yes, I might 
do another flush to Microsoft Copilot/Github. The license allows them to 
LLM scrape it all anyway, I just think they're not just useless but 
actively counterproductive:

https://www.computerworld.com/article/4196309/with-its-latest-layoffs-microsoft-goes-all-in-on-ai.html

I've told people on multiple occasions "you don't need me, you have 
ChatGPT". (And/or Gemini/Copilot/Claude/Claudia/OpenClaw... but the 
chatgpt one rhymes.) And I mean it: you have your LLM. Go, have fun with 
it. No I'm not interested in the results, go back and play with the LLM 
some more. The Lotus Eater Machine loves you more than I ever could.

That said, I'm still fine taking bug reports from almost anywhere, and 
emails from Microsoft Copilot/Github are no stranger than emails from 
people running previous static analysis tools, ala:

https://lists.landley.net/pipermail/toybox/2014-February/001578.html

As long as it's emailing them to me and I can reply via email, I don't 
want to _dissuade_ people from sending me issues I can fix. Just today I 
got emailed an embedded NUL byte test case that makes grep misbehave. I 
haven't looked at their code change because they said they LLM'd it up 
(which is like telling  me your patch is GPLv3) but the reproducible bug 
report is generally the hard part and it's probably only about an hour 
to fix. Maybe after dinner...

Yes I'm aware moving off Microsoft Copilot/Github in 2026 is like moving 
off twitter in 2022. Or never having had a facebook account (and never 
having an AOL account before that). Or never having programmed for 
windows (seriously, I did c64->dos->desqview->OS/2->java->linux with a 
sprinkling of Amiga and Solaris and such along the way)...

> Changes in v2:
> - Removed C bitfield and packed protocol struct decoding.
> - Decode UCSI responses using explicit byte reads, masks, shifts, get_bits(), and toybox peek_le().
> - Added named UCSI command constants instead of raw command literals.
> - Added helper macros for one-based connector numbers and connector command fields.
> - Added UCSI_MIN_MESSAGE_IN_LEN instead of raw 16-byte response checks.
> - Renamed the command failure helper to xucsi_cmd() to follow toybox style.
> - Added UCSI_BIT() and named decoded constants for clearer bit/value checks.
> - Kept the debugfs response parser aligned with the kernel format: ext, high, low is restored to low-first protocol byte order before decoding.
> - Added raw MESSAGE_IN printing for get_pdos responses before decoded PDO output.
> - Added short comments for the non-obvious debugfs/UCSI details.

Sounds good. Happy to apply a relative patch on top of the first one.

> Pls take look, new version.

I'd still like to have a test environment, if there's an easy way to do 
that.

Rob


More information about the Toybox mailing list