hdlc_encoded_length(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– hdlc_encoded_length(9) β€” Kernel API Manual πŸ’–

✨ NAME ✨

hdlc_encoded_length β€” Calculate worst-case encoded length of an HDLC frame. Bestie, it’s literally the β€œhow big could this get” function for an HDLC frame, no cap.

🌸 SYNOPSIS 🌸

size_t hdlc_encoded_length (const struct hdlc_payload payloads[] , size_t count );

πŸŽ€ ARGUMENTS πŸŽ€

  • payloads β€” array of payload buffers. It’s the lineup of buffers you’re handing over, fr fr.
  • count β€” number of payloads. Basically how many buffers are in that array, periodt.

πŸ’… DESCRIPTION πŸ’…

Okay so every data byte may need HDLC escaping, and escaping can double its size β€” that’s the whole reason this is a worst-case calculation, iykyk.

The frame layout is giving:

flag(1) + address(1-2) + control(1-2) + payload + CRC(2-4) + flag(1)

It returns the maximum number of bytes needed in the circular buffer. That’s the whole slay: max bytes, circular buffer, done. πŸ’…

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/greybus/gb-beagleplay.c is right there in the mix, and the whole squad is:


πŸ’– that’s the tea, bestie β€” source/version ./drivers/greybus, date October 2026. The Kernel API Manual ate, and hdlc_encoded_length(9) is iconic. periodt. πŸ’–

πŸ“¦ where this page comes from