From 4ce820ab8d0820c664afb07e9ea62fdc41eb00ad Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 30 Nov 2022 23:00:18 +0100 Subject: [PATCH] isdndlc: Fix documentation The documentation was copied 1:1 from the Linux kernel, where it already was wrong and apparently described an earlier implementation. Change-Id: Ib5def2ae3c79f408f2ee0bb4c20fba1437d30c64 --- src/core/isdnhdlc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/isdnhdlc.c b/src/core/isdnhdlc.c index 8ec1c956c..4ced5afd5 100644 --- a/src/core/isdnhdlc.c +++ b/src/core/isdnhdlc.c @@ -97,13 +97,12 @@ check_frame(struct osmo_isdnhdlc_vars *hdlc) When a new flag is found, the complete frame has been received and the CRC is checked. If a valid frame is found, the function returns the frame length - excluding the CRC with the bit HDLC_END_OF_FRAME set. + excluding the CRC. If the beginning of a valid frame is found, the function returns the length. If a framing error is found (too many 1s and not a flag) the function - returns the length with the bit OSMO_HDLC_FRAMING_ERROR set. - If a CRC error is found the function returns the length with the - bit OSMO_HDLC_CRC_ERROR set. + returns -OSMO_HDLC_FRAMING_ERROR. + If a CRC error is found the function returns -OSMO_HDLC_CRC_ERROR. If the frame length exceeds the destination buffer size, the function returns the length with the bit OSMO_HDLC_LENGTH_ERROR set.