hdlc_encoded_length(9)
π 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:
struct gb_beagleplay(9)struct hdlc_payload(9)struct hdlc_greybus_frame(9)enum cc1352_bootloader_cmd(9)enum cc1352_bootloader_status(9)struct cc1352_bootloader_packet(9)struct cc1352_bootloader_download_cmd_data(9)struct cc1352_bootloader_crc32_cmd_data(9)hdlc_write(9)hdlc_append(9)hdlc_tx_frames(9)csum8(9)cc1352_bootloader_pkt_rx(9)gb_message_send(9)cc1352_bootloader_empty_pkt(9)
π 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
- 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