qmi_encode_struct_elem(9)
β¨ qmi_encode_struct_elem(9) β¨
okay so bestie, we're in the Kernel API Manual today and the star of the show is qmi_encode_struct_elem β the lil function that encodes elements of struct data type π
literally its whole job. no cap.
π SYNOPSIS π
int qmi_encode_struct_elem (const struct qmi_elem_info *ei_array , void
*buf_dst , const void *buf_src , u32 elem_len , u32 out_buf_len , int
enc_level );
like, six args, all business, no filler π
πΈ ARGUMENTS πΈ
ei_arrayβ the struct info array that describes the struct element. it's giving instruction manual energy πbuf_dstβ the buffer where the encoded info goes to live. destination era β¨buf_srcβ the buffer holding the elements you wanna encode. the source, the origin, the main character πelem_lenβ how many elements inbuf_srcyou're encoding, bestie. a count, a number, that's it π¦out_buf_lenβ the available space in the encode buffer. respect the limit or perish πenc_levelβ depth of the nested structure from the main structure. how deep in the struct-ception we are π
π¦ DESCRIPTION π¦
so this function encodes the "elem_len" number of struct elements, and each one is "ei_array->elem_size" bytes big, pulling straight from the source buffer "buf_src", and then it stores the encoded information in the destination buffer "buf_dst". obsessed with the flow honestly β¨
the elements are of struct data type β and lowkey that includes any C structure, so yeah, it's flexible like that π
and the return? it hands you back the number of bytes of encoded information. iconic behavior, fr fr π
β RETURN β
the number of bytes of encoded information on success π β or a negative errno on error π. so basically, positive = slay, negative = vibe check failed.
π SEE ALSO π
kernel file ./drivers/soc/qcom/qmi_encdec.c and its whole friend group π«Ά:
skip_to_next_elem(9)qmi_calc_min_msg_len(9)qmi_encode_basic_elem(9)qmi_encode_string_elem(9)qmi_encode(9)qmi_decode_basic_elem(9)qmi_decode_struct_elem(9)qmi_decode_string_elem(9)find_ei(9)qmi_decode(9)qmi_encode_message(9)qmi_decode_message(9)
aaaand that's the page!! π§ sign-off time: this one comes to you from ./drivers/soc/qcom, dated October 2026, and it's the qmi_encode_struct_elem(9) page β go forth and encode those structs, bestie ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms