comedi_bytes_per_scan(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ comedi_bytes_per_scan(9) ✨

okay so bestie, welcome to the Kernel API Manual πŸ’– this one's about comedi_bytes_per_scan, and it is literally about figuring out how big a "scan" is in bytes. no cap. let's get into it 🫢


🌸 NAME 🌸

comedi_bytes_per_scan β€” get the length of an asynchronous command "scan", in bytes πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

unsigned int comedi_bytes_per_scan (struct comedi_subdevice *s );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • s β€” the COMEDI subdevice. that's the one, that's the whole argument, she's simple and she's iconic πŸ‘‘

🌈 DESCRIPTION 🌈

so the way this works: it determines the overall scan length according to the subdevice type and the number of channels in the scan for the current command. both of those things matter, periodt.

for digital input, output, or input/output subdevices, samples for multiple channels are assumed to be packed into one or more unsigned short or unsigned int values β€” and which one it is depends on the subdevice's SDF_LSAMPL flag ✨

for other types of subdevice, samples are assumed to occupy a whole unsigned short or unsigned int, again according to the SDF_LSAMPL flag. same flag, different packing situation, iykyk πŸ’«

and then it returns the overall scan length in bytes. that's the whole vibe check πŸ“


πŸ”₯ SEE ALSO πŸ”₯

kernel file ./drivers/comedi/drivers.c, plus all these besties:


πŸ’€ friendly reminder that __comedi_check_request_region(9) has two leading underscores and comedi_check_request_region(9) doesn't β€” they are two different functions, do not come for me, copy them exactly bestie πŸ™ˆ

and that's the page!! πŸŽ€ sign-off time: this one lives in ./drivers/comedi, dated October 2026, from the Kernel API Manual β€” mwah, go read your kernel source, ily, bye πŸ’–πŸ§šβ€β™€οΈβ­

πŸ“¦ where this page comes from