From 79ee2f54db03524047d52957a7cd164d4d131c25 Mon Sep 17 00:00:00 2001 From: Jan Hoffmann Date: Fri, 6 Oct 2023 23:46:43 +0200 Subject: [PATCH] Fix upstream Hlog scaling for Fritzbox devices on VDSL2 Profile 35b Normally, the QLN and Hlog data in the support data seem to be reported in groups as defined by the VDSL2 specification. The group size is not reported, so it is guessed from the bands data. However, it looks like AVM applies some scaling to the upstream data when VDSL2 Profile 35b is in use, so that the guessed group size is incorrect. As an attempt to fix this, adjust the group size by a factor of 2 in that case. --- fritzbox/supportdata.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fritzbox/supportdata.go b/fritzbox/supportdata.go index 75533db..5c66851 100644 --- a/fritzbox/supportdata.go +++ b/fritzbox/supportdata.go @@ -66,6 +66,13 @@ func parseSupportData(status *models.Status, bins *models.Bins, d *rawDataSuppor bins.QLN.Downstream = parseSupportDataBins(bins.Bands.Downstream, values, "QLN DS Array", "QLN Array") bins.QLN.Upstream = parseSupportDataBins(bins.Bands.Upstream, values, "QLN US Array") + + if bins.Mode.Type == models.ModeTypeVDSL2 && bins.Mode.Subtype == models.ModeSubtypeProfile35b { + // It seems like the AVM firmware applies some scaling to the upstream data for VDSL2 Profile 35b, + // so adjust the guessed group size to take this into account. + bins.Hlog.Upstream.GroupSize *= 2 + bins.QLN.Upstream.GroupSize *= 2 + } } func parseSupportDataValues(supportData string) map[string]string {