ucsi_bitfield_read(9)
π NAME π
Okay bestie, welcome to the Kernel API Manual β today's main character is ucsi_bitfield_read(9), and its whole gig is reading a field from a UCSI command response. It's giving small function, big version-check energy, and we're obsessed. π
β¨ SYNOPSIS β¨
ucsi_bitfield_read (_map_ , _field_ , _ver_ );
π ARGUMENTS π
_map_β the UCSI command response. Like, the data blob you're reading from, bestie. π«Ά_field_β the field offset in the response data structure. It's telling you where the field sits. π_ver_β the UCSI version where the field was introduced. This is the minimum-version gate, no cap. πͺ
π¦ DESCRIPTION π¦
So here's the tea, fr fr: ucsi_bitfield_read reads the fields in the command responses. First it checks that the field is valid with the UCSI interface version that's used in the system. _ver_ is the minimum UCSI version for _field_. If the UCSI interface is older than _ver_, a warning is generated. Not me being dramatic β that's just what it does. π
π Caveats
- Removed fields are not checked β
_ver_is just the minimum UCSI version. So don't expect a full removed-field audit, bestie; it said minimum and it meant minimum. π
It returns the value of _field_, or 0 when the UCSI interface is older than _ver_. That's the return vibe check: value or zero. β¨
π SEE ALSO π
Go peek at the kernel file ./drivers/usb/typec/ucsi/ucsi.h and struct ucsi_operations(9). That's the whole SEE ALSO situation, and honestly? Useful. π
This page is from ./drivers/usb/typec/ucsi, dated October 2026. Thanks for coming to my TED talk, bestie β now go read those fields. π
π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms