1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-10-19 22:18:16 +02:00
openwrt/package/kernel/lantiq/ltq-adsl/Makefile
Jan Hoffmann db4bf4b968 ltq-vdsl/ltq-adsl: fix elapsed time calculation
The driver maintains elapsed times by repeatedly accumulating the time
since the previous update in a loop. For the elapsed showtime time, the
time difference is truncated to seconds before adding it, leading to a
sizable error over time.

Move the truncation to before calculation of the time difference in
order to remove this error. Also maintain the total elapsed time in the
same way in full seconds, to prevent the unsigned 32-bit counter from
wrapping around after about 50 days.

Testing on a VR9 device shows that the reported line uptime now matches
the actual elapsed wall time. The ADSL variant is only compile-tested,
but it should also work as the relevant code is identical.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
2022-05-04 01:38:04 +01:00

96 lines
2.8 KiB
Makefile

#
# Copyright (C) 2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ltq-adsl
PKG_VERSION:=3.24.4.4
PKG_RELEASE:=4
PKG_SOURCE:=drv_dsl_cpe_api_danube-$(PKG_VERSION).tar.gz
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-dsl-$(BUILD_VARIANT)/drv_dsl_cpe_api-$(PKG_VERSION)
PKG_SOURCE_URL:=@OPENWRT
PKG_HASH:=eb2ed59715d3bf4e8a1460bbbe2f1660039e0a9f9d72afb1b2b16590094eb33c
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_CHECK_FORMAT_SECURITY:=0
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/package.mk
define KernelPackage/ltq-adsl-template
SECTION:=sys
CATEGORY:=Kernel modules
SUBMENU:=Network Devices
TITLE:=adsl driver for $(1)
URL:=http://www.lantiq.com/
VARIANT:=$(1)
DEPENDS:=@$(2) +kmod-ltq-adsl-$(1)-mei
FILES:=$(PKG_BUILD_DIR)/src/drv_dsl_cpe_api.ko
AUTOLOAD:=$(call AutoLoad,51,drv_dsl_cpe_api)
endef
KernelPackage/ltq-adsl-danube=$(call KernelPackage/ltq-adsl-template,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy))
KernelPackage/ltq-adsl-ar9=$(call KernelPackage/ltq-adsl-template,ar9,TARGET_lantiq_xway)
KernelPackage/ltq-adsl-ase=$(call KernelPackage/ltq-adsl-template,ase,TARGET_lantiq_ase)
define KernelPackage/ltq-adsl/config
source "$(SOURCE)/Config.in"
endef
IFX_DSL_MAX_DEVICE=1
IFX_DSL_LINES_PER_DEVICE=1
IFX_DSL_CHANNELS_PER_LINE=1
MAKE_FLAGS += \
$(KERNEL_MAKE_FLAGS)
CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_DIR)/include" \
--with-max-device="$(IFX_DSL_MAX_DEVICE)" \
--with-lines-per-device="$(IFX_DSL_LINES_PER_DEVICE)" \
--with-channels-per-line="$(IFX_DSL_CHANNELS_PER_LINE)" \
--disable-dsl-delt-static \
--disable-adsl-led \
--enable-dsl-ceoc \
--enable-dsl-pm \
--enable-dsl-pm-total \
--enable-dsl-pm-history \
--enable-dsl-pm-showtime \
--enable-dsl-pm-channel-counters \
--enable-dsl-pm-datapath-counters \
--enable-dsl-pm-line-counters \
--enable-dsl-pm-channel-thresholds \
--enable-dsl-pm-datapath-thresholds \
--enable-dsl-pm-line-thresholds \
--enable-dsl-pm-optional-parameters \
--enable-linux-26 \
--enable-kernelbuild="$(LINUX_DIR)" \
ARCH=$(LINUX_KARCH)
CONFIG_TAG_danube:=DANUBE
CONFIG_TAG_ase:=AMAZON_SE
CONFIG_TAG_ar9:=AR9
CONFIGURE_ARGS += --enable-add-drv-cflags="-DMODULE -DCONFIG_$(CONFIG_TAG_$(BUILD_VARIANT))"
CONFIGURE_ARGS += --enable-danube
ifeq ($(CONFIG_LANTIQ_ADSL_DEBUG),y)
CONFIGURE_ARGS += \
--enable-debug=yes \
--enable-debug-prints=yes
EXTRA_CFLAGS += -DDEBUG
endif
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/adsl
$(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_*.h $(1)/usr/include/adsl/
endef
$(eval $(call KernelPackage,ltq-adsl-danube))
$(eval $(call KernelPackage,ltq-adsl-ase))
$(eval $(call KernelPackage,ltq-adsl-ar9))