qmi_send_message(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’Œ qmi_send_message(9) πŸ’Œ

okay so bestie, welcome to the Kernel API Manual β€” this is the qmi_send_message(9) page and honestly it's a whole vibe. it's giving "one function, eight arguments, zero chill" ✨


✨ NAME ✨

qmi_send_message β€” send a QMI message 🫢


🌸 SYNOPSIS 🌸

ssize_t qmi_send_message (struct qmi_handle *qmi , struct sockaddr_qrtr
*sq , struct qmi_txn *txn , int type , int msg_id , size_t len , const
struct qmi_elem_info *ei , const void *c_struct );

like, yes, that's a lot of parameters. count them. eight. she's an icon, she's a legend, she is the moment πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • qmi β€” the QMI client handle. your main character struct πŸ‘‘
  • sq β€” destination sockaddr. this is where the message is going, iykyk
  • txn β€” the transaction object to use for the message. gotta keep track of your business fr fr
  • type β€” type of message to send
  • msg_id β€” message id. her little name tag 🏷️
  • len β€” max length of the QMI message
  • ei β€” QMI message description. the blueprint, the vision board 🌈
  • c_struct β€” object to be encoded. the raw material bestie πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, and I mean the literal encoding tea β˜•

This function encodes c_struct using ei into a message of type type, with msg_id and txn into a buffer of maximum size len, and sends this to sq.

the way that it just… takes your struct, reads the description, builds the message, and ships it off? obsessed. no cap, that's the whole function. lowkey elegant, highkey iconic ✨


πŸ”₯ RETURN πŸ”₯

0 on success, negative errno on failure.

so like β€” zero means slay πŸ’…, negative errno means something went sideways and you should probably go look at it 😭

ngl bestie, check your return value. always. no exceptions. not me being serious for one second πŸ™ˆ

⭐ SEE ALSO ⭐

Kernel file ./drivers/soc/qcom/qmi_interface.c β€” and honestly the whole qmi friend group showed up for this one:

the whole squad, together again πŸ«ΆπŸ’œ


and that's the page!! mwah πŸ’‹ this gem lives in ./drivers/soc/qcom and it was dated October 2026 β€” so like, future vibes only. go forth and send some messages bestie, you've got this πŸ§šβ€β™€οΈπŸ“

πŸ“¦ where this page comes from