get_valid_routes(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… get_valid_routes(9) β€” the Kernel API Manual page, but make it make sense πŸŽ€

okay so bestie, welcome to the glow-up of get_valid_routes(9) from the Kernel API Manual ✨ this is the little helper that rings up your low-level driver's own get_valid_routes function and asks it to either hand back a count of valid routes to userspace or copy the whole list of all valid device routes into a userspace buffer πŸ¦‹ two jobs, one function, main character energy fr fr πŸ’–


✨ SYNOPSIS ✨

int get_valid_routes (struct comedi_device *dev , unsigned int *data );

that's it, that's the whole vibe check πŸ‘‘ no cap 🌸


🫢 ARGUMENTS 🫢

  • dev β€” a comedi device pointer πŸ’œ your ticket to the device, basically.
  • data β€” the data from the user insn call. Now listen, this one's the whole personality, so let's break it down 🧚:
    • the length of data must be >= 2 β€” not optional, lowkey non-negotiable 😭
    • data[0] must contain the INSN_DEVICE_CONFIG config_id β€” that's the whole point of showing up πŸ’…
    • data[1] (input) contains the number of pairs that memory is allotted for from the user. so it's pairs, not routes-singular, keep up bestie πŸ’€
    • if the user specifies '0' there, then only the number of pairs available is returned β€” no copying, just the count, like a little peek πŸ”₯
    • data[1] (output) returns either the number of pairs available (if none were requested) or the number of pairs that actually got copied back to the user ⭐
    • data[2::2] returns each (source, destination) pair πŸ¦‹ so it's the pair list, strutting out two at a time 🌈
ngl the data[1] slot is doing double duty as input and output and honestly it's giving versatility, we stan πŸŽ€ β€” just remember which direction the info is flowing in at any given moment, bestie πŸ™ˆ

🌸 RETURN 🌸

  • -EINVAL β€” if the low-level driver does not allocate and return routes as expected. iykyk, the driver didn't slay 😭
  • 0 β€” returned otherwise. success, periodt πŸ’–

πŸ‘‘ SEE ALSO πŸ‘‘

these are the girlies in the same friend group, go say hi ✨


and that's the page, bestie 🫢 this little icon comes from ./drivers/comedi, dated October 2026, and it's filed under get_valid_routes(9) forever πŸ’œ mwah πŸ’‹

πŸ“¦ where this page comes from