STRUCT V4L2_SUBDEV_ROUTING(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct v4l2_subdev_routing(9) ✨

okay so bestie, welcome to the Kernel API Manual πŸ’… this one's called struct v4l2_subdev_routing and it's literally the subdev routing info glow-up you've been waiting for πŸ¦‹ no cap, it's giving "everything you need to know about how routes get from here to there" and honestly? obsessed.


🌸 NAME 🌸

struct v4l2_subdev_routing β€” Subdev routing information πŸŽ€ the whole vibe of this struct is just: here's the routing tea, drink up.


✨ SYNOPSIS ✨

struct v4l2_subdev_routing {
    __u32 which;
    __u32 len_routes;
    __u64 routes;
    __u32 num_routes;
    __u32 reserved[11];
 };

like, look at her. main character struct energy πŸ”₯ every field is doing its little job and honestly we stan a tidy layout πŸ‘‘


πŸ’– Members πŸ’–

  • which β€” the configuration type, and it comes straight from enum v4l2_subdev_format_whence 🫢 so it's telling you which config situation we're in rn.
  • len_routes β€” the length of the routes array, measured in routes (yes, routes are the unit, periodt πŸ’…). set by the user and not modified by the kernel β€” so like, the kernel is respectfully not touching it, it's yours, keep it πŸŽ€
  • routes β€” a pointer to the routes array 🌈 just a lil pointer, living its truth, pointing at the array.
  • num_routes β€” the total number of routes πŸ‘‘ and lowkey the tea here is it can be possibly more than fits in the routes array β€” so like, it might overflow the array you gave it, ngl, that's a thing you need to know 😭
  • reserved β€” this is the reserved[11] array and bestie, listen: drivers and applications must zero this array 🚨 not "should", not "maybe", must. zero it. fr fr. don't be the one who didn't zero it πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

go check these out, they're all in the same friend group iykyk πŸ’œ:

  • Kernel file ./include/uapi/linux/v4l2-subdev.h enum
  • v4l2_subdev_format_whence(9)
  • struct v4l2_subdev_format(9)
  • struct v4l2_subdev_crop(9)
  • struct v4l2_subdev_mbus_code_enum(9)
  • struct v4l2_subdev_frame_size_enum(9)
  • struct v4l2_subdev_frame_interval(9)
  • struct v4l2_subdev_frame_interval_enum(9)
  • struct v4l2_subdev_selection(9)
  • struct v4l2_subdev_capability(9)
  • struct v4l2_subdev_route(9)
  • struct v4l2_subdev_client_capability(9)

πŸ’€ reminder reminder: reserved must be zeroed by drivers AND applications. that's the one. don't forget it. i'm not mad, i'm just disappointed (i'm kidding, i love u, just zero the array).

and that's the whole page bestie, you ate that πŸ“πŸ’… this was pulled from ./include/uapi/linux, dated October 2026, and it's the struct v4l2_subdev_routing(9) moment β€” go forth and route responsibly πŸ§šβ€β™€οΈβ­πŸ’–

πŸ“¦ where this page comes from