libnvme_mi_admin_xfer(9)

πŸ“¦ version 3.2, in arch rolling

πŸ’… libnvme_mi_admin_xfer

okay bestie, welcome to the libnvme API manual β€” this one's the raw admin transfer interface, and it is literally the main character of "just send the thing to the controller already" πŸŽ€


✨ NAME ✨

libnvme_mi_admin_xfer β€” raw admin transfer interface, fr fr.


🌸 SYNOPSIS 🌸

int libnvme_mi_admin_xfer (struct libnvme_transport_handle *hdl , struct
       nvme_mi_admin_req_hdr *admin_req , size_t req_data_size , struct
       nvme_mi_admin_resp_hdr *admin_resp , off_t resp_data_offset , size_t
       *resp_data_size );

like… six arguments, no cap. she's built different 😀


πŸ¦‹ ARGUMENTS πŸ¦‹

  • hdl β€” the transport handle you're sending the admin command to. this is your ride πŸ‘‘
  • admin_req β€” request data. the actual ask πŸ’Œ
  • req_data_size β€” size of request data payload. payload only, bestie β€” not the header πŸ“
  • admin_resp β€” buffer for response data. where the controller's reply lands 🫢
  • resp_data_offset β€” offset into request data to retrieve from controller. yeah, that's what it says β€” keep it exactly like that, don't @ me πŸ™ˆ
  • resp_data_size β€” size of response data buffer, updated to received size. she goes in as a size and comes out as the size ✨

πŸ’œ DESCRIPTION πŸ’œ

So what this does: it performs an arbitrary NVMe Admin command, using the provided request data in admin_req. simple as that, lowkey iconic.

the size of the request data payload is specified in req_data_size β€” and listen, this does not include the standard header length. so a header-only request would have a size of 0. zero. nada. that's not a bug, that's the vibe check βœ…

On success, response data is stored in admin_resp, which has an optional appended payload buffer of resp_data_size bytes. The actual payload transferred will be stored in resp_data_size (she updates herself, we love a self-aware buffer πŸ’…). These sizes do not include the Admin request header, so 0 represents no payload. same rules, both directions πŸͺž

As with all Admin commands, we can request partial data from the Admin Response payload, offset by resp_data_offset. partial reads ate, honestly πŸ”₯

See: struct nvme_mi_admin_req_hdr and struct nvme_mi_admin_resp_hdr. go look at the structs bestie, iykyk 🧚

⭐ RETURN ⭐

The nvme command status if a response was received (see enum nvme_status_field) or a negative error code otherwise. so either you get a status, or you get a negative number and a little sadness 😭


and that's the whole page, bestie β€” go forth and xfer πŸŒˆπŸ¦‹

this has been the libnvme API manual, dated October 2026 β€” libnvme_mi_admin_xfer(9) out πŸ’– slay, bye πŸ‘‹

πŸ“¦ where this page comes from