ucsi_bitfield_read(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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