rio_lock_device(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… rio_lock_device β€” the "pls can I have the lock" function

So this is a page straight out of the Kernel API Manual, and it's about rio_lock_device β€” the little guy that politely (or not so politely) asks a host device to hand over its lock. Bestie, it's giving "knocking on the door of the group chat" energy. πŸšͺ✨


✨ SYNOPSIS ✨

int rio_lock_device (struct rio_mport *port , u16 destid , u8 hopcount ,
       int wait_ms );

Like, that's the whole signature. Four args. No cap. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • port β€” the master port that's gonna send the transaction. It's the main character doing the actual sending. πŸ‘‘
  • destid β€” the Destination ID for the device/switch you're trying to reach. Your little address label. 🏷️
  • hopcount β€” the hopcount to reach the switch. How many little hoops we're jumping through. πŸ¦‹
  • wait_ms β€” max wait time in msec, and listen: 0 means no timeout. Zero = the girl is gonna wait forever, literally. 😭
Heads up bestie: wait_ms of 0 is not "instant", it's "no timeout at all". Read it twice, I'm serious. πŸ’€

🌸 DESCRIPTION 🌸

Okay so the actual job: it attempts to acquire the host device lock for the specified device. That's it, that's the plot. πŸ”’

And when it's done it tells you how it went:

  • returns 0 if the device lock was acquired (slay, you got it πŸ’–)
  • returns EINVAL if the timeout expires (oop, you waited and it never happened πŸ™ˆ)

πŸ”₯ SEE ALSO πŸ”₯

The kernel file this lives in is ./drivers/rapidio/rio.c, and here is the full little friend group β€” every single one, no skips, iykyk:

rio_local_get_device_id(9), rio_query_mport(9), rio_alloc_net(9), rio_local_set_device_id(9), rio_add_device(9), rio_request_inb_mbox(9), rio_release_inb_mbox(9), rio_request_outb_mbox(9), rio_release_outb_mbox(9), rio_setup_inb_dbell(9), rio_request_inb_dbell(9), rio_release_inb_dbell(9), rio_request_outb_dbell(9), rio_release_outb_dbell(9), rio_add_mport_pw_handler(9), rio_del_mport_pw_handler(9), rio_request_inb_pwrite(9), rio_release_inb_pwrite(9), rio_pw_enable(9), rio_map_inb_region(9), rio_unmap_inb_region(9), rio_map_outb_region(9), rio_unmap_outb_region(9), rio_mport_get_physefb(9), rio_get_comptag(9), rio_set_port_lockout(9), rio_enable_rx_tx_port(9), rio_chk_dev_route(9), rio_mport_chk_dev_access(9), rio_chk_dev_access(9), rio_get_input_status(9), rio_clr_err_stopped(9), rio_inb_pwrite_handler(9), rio_mport_get_efb(9), rio_mport_get_feature(9), rio_std_route_add_entry(9), rio_std_route_get_entry(9), rio_std_route_clr_table(9), rio_unlock_device(9), rio_route_add_entry(9), rio_route_get_entry(9), rio_route_clr_table(9), rio_request_mport_dma(9), rio_release_dma(9), rio_dma_prep_xfer(9), rio_register_scan(9), rio_mport_scan(9)


And that's the whole page, bestie. Mwah. πŸ’‹

Sign-off time πŸŽ€ β€” this lil page comes from ./drivers/rapidio, it's the October 2026 era of the Kernel API Manual, and it's filed under rio_lock_device(9). Go lock something and be iconic about it. πŸ‘‘βœ¨

πŸ“¦ where this page comes from