Merge Mainline
Signed-off-by: ZiMing Mo <msylgj@immortalwrt.org>
This commit is contained in:
commit
7e87cf2080
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-5.10 = .135
|
||||
LINUX_KERNEL_HASH-5.10.135 = e499a61be9ce670716dd27b5124bb9ef6c6bc0e8fab443abf717a77136543344
|
||||
LINUX_VERSION-5.10 = .136
|
||||
LINUX_KERNEL_HASH-5.10.136 = 1c099d0d59e7d9f671dfc947e16891b7a3a45efd7dfcc6b1e55a194961e45159
|
||||
|
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-5.15 = .59
|
||||
LINUX_KERNEL_HASH-5.15.59 = e6ddc642057340db06b3b921c2b31bfed2c611359e8f144c3e5cf9c3ac33bccb
|
||||
LINUX_VERSION-5.15 = .60
|
||||
LINUX_KERNEL_HASH-5.15.60 = 2d9545f7c96faffd8407522011b9533adefd1360118494dfb6c862f2f15e237a
|
||||
|
@ -224,11 +224,6 @@ $(eval $(call nf_add,NF_NATHELPER_EXTRA,CONFIG_NF_CONNTRACK_IRC, $(P_XT)nf_connt
|
||||
$(eval $(call nf_add,NF_NATHELPER_EXTRA,CONFIG_NF_NAT_IRC, $(P_XT)nf_nat_irc))
|
||||
|
||||
|
||||
# ulog
|
||||
|
||||
$(eval $(call nf_add,IPT_ULOG,CONFIG_IP_NF_TARGET_ULOG, $(P_V4)ipt_ULOG))
|
||||
|
||||
|
||||
# nflog
|
||||
|
||||
$(eval $(call nf_add,IPT_NFLOG,CONFIG_NETFILTER_XT_TARGET_NFLOG, $(P_XT)xt_NFLOG))
|
||||
@ -315,7 +310,6 @@ $(eval $(call nf_add,EBTABLES_IP4,CONFIG_BRIDGE_EBT_SNAT, $(P_EBT)ebt_snat))
|
||||
|
||||
# watchers
|
||||
$(eval $(call nf_add,EBTABLES_WATCHERS,CONFIG_BRIDGE_EBT_LOG, $(P_EBT)ebt_log))
|
||||
$(eval $(call nf_add,EBTABLES_WATCHERS,CONFIG_BRIDGE_EBT_ULOG, $(P_EBT)ebt_ulog))
|
||||
$(eval $(call nf_add,EBTABLES_WATCHERS,CONFIG_BRIDGE_EBT_NFLOG, $(P_EBT)ebt_nflog))
|
||||
$(eval $(call nf_add,EBTABLES_WATCHERS,CONFIG_BRIDGE_EBT_NFQUEUE, $(P_EBT)ebt_nfqueue))
|
||||
|
||||
@ -341,12 +335,7 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_BRIDGE,CONFIG_NF_CONNTRACK_BRIDGE, $(P_
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_NAT, $(P_XT)nft_nat),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_NAT, $(P_XT)nft_chain_nat),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_REDIR_IPV4, $(P_V4)nft_redir_ipv4),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_MASQ, $(P_XT)nft_masq),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_MASQ_IPV4, $(P_V4)nft_masq_ipv4),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT6,CONFIG_NFT_REDIR_IPV6, $(P_V6)nft_redir_ipv6),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT6,CONFIG_NFT_MASQ_IPV6, $(P_V6)nft_masq_ipv6),))
|
||||
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_FIB,CONFIG_NFT_FIB, $(P_XT)nft_fib),))
|
||||
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_FIB,CONFIG_NFT_FIB_INET, $(P_XT)nft_fib_inet),))
|
||||
@ -387,7 +376,6 @@ IPT_BUILTIN += $(IPT_NAT6-y)
|
||||
IPT_BUILTIN += $(IPT_NAT_EXTRA-y)
|
||||
IPT_BUILTIN += $(NF_NATHELPER-y)
|
||||
IPT_BUILTIN += $(NF_NATHELPER_EXTRA-y)
|
||||
IPT_BUILTIN += $(IPT_ULOG-y)
|
||||
IPT_BUILTIN += $(IPT_TPROXY-y)
|
||||
IPT_BUILTIN += $(NFNETLINK-y)
|
||||
IPT_BUILTIN += $(NFNETLINK_LOG-y)
|
||||
|
@ -169,20 +169,22 @@ $(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \
|
||||
$(eval $(call CleanupPython2))
|
||||
|
||||
$(eval $(call SetupHostCommand,python,Please install Python >= 3.6, \
|
||||
python3.11 -V 2>&1 | grep 'Python 3', \
|
||||
python3.10 -V 2>&1 | grep 'Python 3', \
|
||||
python3.9 -V 2>&1 | grep 'Python 3', \
|
||||
python3.8 -V 2>&1 | grep 'Python 3', \
|
||||
python3.7 -V 2>&1 | grep 'Python 3', \
|
||||
python3.6 -V 2>&1 | grep 'Python 3', \
|
||||
python3 -V 2>&1 | grep -E 'Python 3\.([6-9]|10)\.?'))
|
||||
python3 -V 2>&1 | grep -E 'Python 3\.([6-9]|[0-9][0-9])\.?'))
|
||||
|
||||
$(eval $(call SetupHostCommand,python3,Please install Python >= 3.6, \
|
||||
python3.11 -V 2>&1 | grep 'Python 3', \
|
||||
python3.10 -V 2>&1 | grep 'Python 3', \
|
||||
python3.9 -V 2>&1 | grep 'Python 3', \
|
||||
python3.8 -V 2>&1 | grep 'Python 3', \
|
||||
python3.7 -V 2>&1 | grep 'Python 3', \
|
||||
python3.6 -V 2>&1 | grep 'Python 3', \
|
||||
python3 -V 2>&1 | grep -E 'Python 3\.([6-9]|10)\.?'))
|
||||
python3 -V 2>&1 | grep -E 'Python 3\.([6-9]|[0-9][0-9])\.?'))
|
||||
|
||||
$(eval $(call TestHostCommand,python3-distutils, \
|
||||
Please install the Python3 distutils module, \
|
||||
|
@ -0,0 +1,40 @@
|
||||
--- a/plat/mediatek/mt7622/bl2_boot_snand.c
|
||||
+++ b/plat/mediatek/mt7622/bl2_boot_snand.c
|
||||
@@ -21,6 +21,10 @@
|
||||
#define FIP_BASE 0x80000
|
||||
#define FIP_SIZE 0x200000
|
||||
|
||||
+#ifndef NMBM
|
||||
+#define SNAND_MAX_BAD_BLOCK 3
|
||||
+#endif
|
||||
+
|
||||
struct snfi_gpio_mux_info {
|
||||
const uint32_t *pins;
|
||||
uint32_t count;
|
||||
@@ -45,12 +49,26 @@ static size_t snand_read_range(int lba,
|
||||
size_t sizeremain = size, chunksize;
|
||||
uint64_t off = lba * cinfo.pagesize;
|
||||
uint8_t *ptr = (uint8_t *)buf;
|
||||
+ struct mtk_snand_chip_info info;
|
||||
+ unsigned int bad_blocks = 0;
|
||||
int ret = 0;
|
||||
|
||||
if (!snf)
|
||||
return 0;
|
||||
|
||||
+ ret = mtk_snand_get_chip_info(snf, &info);
|
||||
+ if (ret)
|
||||
+ return 0;
|
||||
+
|
||||
while (sizeremain) {
|
||||
+ while (mtk_snand_block_isbad(snf, off)) {
|
||||
+ if (bad_blocks > SNAND_MAX_BAD_BLOCK)
|
||||
+ return size - sizeremain;
|
||||
+
|
||||
+ off += info.blocksize;
|
||||
+ ++bad_blocks;
|
||||
+ }
|
||||
+
|
||||
chunksize = cinfo.pagesize;
|
||||
if (chunksize > sizeremain)
|
||||
chunksize = sizeremain;
|
@ -31,7 +31,8 @@ ampedwireless,ally-00x19k|\
|
||||
ampedwireless,ally-r1900k)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
|
||||
;;
|
||||
beeline,smartbox-giga)
|
||||
beeline,smartbox-giga|\
|
||||
beeline,smartbox-turbo)
|
||||
ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000"
|
||||
;;
|
||||
buffalo,wsr-1166dhp|\
|
||||
|
@ -28,6 +28,11 @@ zyxel,gs1900-24hp-v2)
|
||||
[ -n "$idx2" ] && \
|
||||
ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x1000" "0x10000"
|
||||
;;
|
||||
tplink,sg2008p-v1)
|
||||
idx="$(find_mtd_index u-boot-env)"
|
||||
[ -n "$idx" ] && \
|
||||
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x20000" "0x10000"
|
||||
;;
|
||||
iodata,bsh-g24mb)
|
||||
idx="$(find_mtd_index u-boot-env)"
|
||||
[ -n "$idx" ] && \
|
||||
|
@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/u-boot.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
|
||||
MT7621_LOWLEVEL_PRELOADER_URL:=https://raw.githubusercontent.com/mtk-openwrt/mt7621-lowlevel-preloader/master/
|
||||
MT7621_LOWLEVEL_PRELOADER_URL:=https://raw.githubusercontent.com/mtk-openwrt/mt7621-lowlevel-preloader/a03b07c60bf1ba4add9b671d32caa102fe948180/
|
||||
|
||||
define Download/mt7621-stage-sram
|
||||
FILE:=mt7621_stage_sram.bin
|
||||
@ -17,8 +17,18 @@ define Download/mt7621-stage-sram
|
||||
HASH:=1dda68aa089f0ff262e01539b990dea478952e9fb68bcc0a8cd6f76f0135c62e
|
||||
endef
|
||||
|
||||
define Download/mt7621-stage-sram-noprint
|
||||
FILE:=mt7621_stage_sram_noprint.bin
|
||||
URL:=$(MT7621_LOWLEVEL_PRELOADER_URL)
|
||||
HASH:=8ee419275144fc298e9444d413d98e965a55d283152a74ea6a1f8de79eb516b6
|
||||
endef
|
||||
|
||||
ifdef CONFIG_TARGET_ramips_mt7621
|
||||
ifdef CONFIG_DEBUG
|
||||
$(eval $(call Download,mt7621-stage-sram))
|
||||
else
|
||||
$(eval $(call Download,mt7621-stage-sram-noprint))
|
||||
endif
|
||||
endif
|
||||
|
||||
define U-Boot/Default
|
||||
@ -195,7 +205,11 @@ endef
|
||||
ifdef CONFIG_TARGET_ramips_mt7621
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
ifdef CONFIG_DEBUG
|
||||
$(CP) $(DL_DIR)/mt7621_stage_sram.bin $(PKG_BUILD_DIR)/
|
||||
else
|
||||
$(CP) $(DL_DIR)/mt7621_stage_sram_noprint.bin $(PKG_BUILD_DIR)/mt7621_stage_sram.bin
|
||||
endif
|
||||
endef
|
||||
endif
|
||||
|
||||
|
@ -0,0 +1,45 @@
|
||||
From a3ba6adb70c91ec3b9312c3a025faa44acd39cfa Mon Sep 17 00:00:00 2001
|
||||
From: Weijie Gao <weijie.gao@mediatek.com>
|
||||
Date: Wed, 13 Jul 2022 11:16:39 +0800
|
||||
Subject: [PATCH] arm: dts: mt7622: remove default pinctrl of uart0
|
||||
|
||||
Currently u-boot running on mt7622 will print an warning log at beginning:
|
||||
> serial_mtk serial@11002000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19
|
||||
|
||||
It turns out that the pinctrl uclass can't work properly in board_f stage.
|
||||
|
||||
Since the uart0 is the default UART device used by bootrom, and will be
|
||||
initialized in both bootrom and tf-a bl2. It's ok not to setup pinctrl for
|
||||
uart0 in u-boot.
|
||||
|
||||
This patch removes the default pinctrl of uart0 to suppress the unwanted
|
||||
warning.
|
||||
|
||||
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
---
|
||||
arch/arm/dts/mt7622-bananapi-bpi-r64.dts | 2 --
|
||||
arch/arm/dts/mt7622-rfb.dts | 2 --
|
||||
2 files changed, 4 deletions(-)
|
||||
|
||||
--- a/arch/arm/dts/mt7622-bananapi-bpi-r64.dts
|
||||
+++ b/arch/arm/dts/mt7622-bananapi-bpi-r64.dts
|
||||
@@ -182,8 +182,6 @@
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
- pinctrl-names = "default";
|
||||
- pinctrl-0 = <&uart0_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
--- a/arch/arm/dts/mt7622-rfb.dts
|
||||
+++ b/arch/arm/dts/mt7622-rfb.dts
|
||||
@@ -196,8 +196,6 @@
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
- pinctrl-names = "default";
|
||||
- pinctrl-0 = <&uart0_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
@ -51,7 +51,7 @@
|
||||
reg_1p8v: regulator-1p8v {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "fixed-1.8V";
|
||||
@@ -199,7 +236,7 @@
|
||||
@@ -197,7 +234,7 @@
|
||||
status = "okay";
|
||||
bus-width = <8>;
|
||||
max-frequency = <50000000>;
|
||||
@ -60,7 +60,7 @@
|
||||
vmmc-supply = <®_3p3v>;
|
||||
vqmmc-supply = <®_3p3v>;
|
||||
non-removable;
|
||||
@@ -210,7 +247,7 @@
|
||||
@@ -208,7 +245,7 @@
|
||||
pinctrl-0 = <&mmc1_pins_default>;
|
||||
status = "okay";
|
||||
bus-width = <4>;
|
||||
|
@ -139,7 +139,7 @@
|
||||
+CONFIG_USB_STORAGE=y
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/mt7622-linksys-e8450-ubi.dts
|
||||
@@ -0,0 +1,195 @@
|
||||
@@ -0,0 +1,193 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+/*
|
||||
+ * Copyright (c) 2019 MediaTek Inc.
|
||||
@ -302,8 +302,6 @@
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart0_pins>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
|
@ -144,7 +144,7 @@
|
||||
+CONFIG_SPI_FLASH_XMC=y
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/mt7622-ubnt-unifi-6-lr.dts
|
||||
@@ -0,0 +1,202 @@
|
||||
@@ -0,0 +1,200 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+/*
|
||||
+ * Copyright (c) 2019 MediaTek Inc.
|
||||
@ -311,8 +311,6 @@
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart0_pins>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
|
@ -69,13 +69,6 @@ define Package/rtl8192se-firmware/install
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8192se-firmware))
|
||||
|
||||
Package/rtl8192su-firmware = $(call Package/firmware-default,RealTek RTL8192SU firmware)
|
||||
define Package/rtl8192su-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8712u.bin $(1)/lib/firmware/rtlwifi
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8192su-firmware))
|
||||
|
||||
Package/rtl8723au-firmware = $(call Package/firmware-default,RealTek RTL8723AU firmware)
|
||||
define Package/rtl8723au-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
|
||||
|
@ -69,8 +69,10 @@ define KernelPackage/crypto-authenc
|
||||
TITLE:=Combined mode wrapper for IPsec
|
||||
DEPENDS:=+kmod-crypto-manager +kmod-crypto-null
|
||||
KCONFIG:=CONFIG_CRYPTO_AUTHENC
|
||||
FILES:=$(LINUX_DIR)/crypto/authenc.ko
|
||||
AUTOLOAD:=$(call AutoLoad,09,authenc)
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/crypto/authenc.ko \
|
||||
$(LINUX_DIR)/crypto/authencesn.ko
|
||||
AUTOLOAD:=$(call AutoLoad,09,authenc authencesn)
|
||||
$(call AddDepends/crypto)
|
||||
endef
|
||||
|
||||
|
@ -260,16 +260,18 @@ define KernelPackage/fs-fscache
|
||||
TITLE:=General filesystem local cache manager
|
||||
DEPENDS:=+kmod-fs-netfs
|
||||
KCONFIG:=\
|
||||
CONFIG_FSCACHE=m \
|
||||
CONFIG_FSCACHE \
|
||||
CONFIG_FSCACHE_STATS=y \
|
||||
CONFIG_FSCACHE_HISTOGRAM=n \
|
||||
CONFIG_FSCACHE_DEBUG=n \
|
||||
CONFIG_FSCACHE_OBJECT_LIST=n \
|
||||
CONFIG_CACHEFILES=y \
|
||||
CONFIG_CACHEFILES \
|
||||
CONFIG_CACHEFILES_DEBUG=n \
|
||||
CONFIG_CACHEFILES_HISTOGRAM=n
|
||||
FILES:=$(LINUX_DIR)/fs/fscache/fscache.ko
|
||||
AUTOLOAD:=$(call AutoLoad,29,fscache)
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/fs/fscache/fscache.ko \
|
||||
$(LINUX_DIR)/fs/cachefiles/cachefiles.ko
|
||||
AUTOLOAD:=$(call AutoLoad,29,fscache cachefiles)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-fscache))
|
||||
|
@ -519,6 +519,20 @@ endef
|
||||
$(eval $(call KernelPackage,hwmon-tmp421))
|
||||
|
||||
|
||||
define KernelPackage/hwmon-tps23861
|
||||
TITLE:=Texas Instruments TPS23861 PoE PSE
|
||||
KCONFIG:=CONFIG_SENSORS_TPS23861
|
||||
FILES:=$(LINUX_DIR)/drivers/hwmon/tps23861.ko
|
||||
AUTOLOAD:=$(call AutoProbe,tps23861)
|
||||
$(call AddDepends/hwmon,+kmod-i2c-core +kmod-regmap-i2c)
|
||||
endef
|
||||
|
||||
define KernelPackage/hwmon-tps23861/description
|
||||
Kernel module for the Texas Instruments TPS23861 802.3at PoE PSE chips.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,hwmon-tps23861))
|
||||
|
||||
define KernelPackage/hwmon-vid
|
||||
TITLE:=VID/VRM/VRD voltage conversion module.
|
||||
KCONFIG:=CONFIG_HWMON_VID
|
||||
|
@ -431,9 +431,13 @@ define KernelPackage/iio-sps30
|
||||
SUBMENU:=$(IIO_MENU)
|
||||
DEPENDS:=+kmod-i2c-core +kmod-iio-core +kmod-industrialio-triggered-buffer +kmod-lib-crc8
|
||||
TITLE:=Sensirion SPS30 particulate matter sensor
|
||||
KCONFIG:=CONFIG_SPS30
|
||||
FILES:=$(LINUX_DIR)/drivers/iio/chemical/sps30.ko
|
||||
AUTOLOAD:=$(call AutoProbe,sps30)
|
||||
KCONFIG:= \
|
||||
CONFIG_SPS30 \
|
||||
CONFIG_SPS30_I2C
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/iio/chemical/sps30.ko \
|
||||
$(LINUX_DIR)/drivers/iio/chemical/sps30_i2c.ko@ge5.14
|
||||
AUTOLOAD:=$(call AutoProbe,sps30 sps30_i2c)
|
||||
endef
|
||||
|
||||
define KernelPackage/iio-sps30/description
|
||||
|
@ -92,7 +92,7 @@ $(eval $(call KernelPackage,input-gpio-keys))
|
||||
define KernelPackage/input-gpio-keys-polled
|
||||
SUBMENU:=$(INPUT_MODULES_MENU)
|
||||
TITLE:=Polled GPIO key support
|
||||
DEPENDS:=@GPIO_SUPPORT +kmod-input-polldev
|
||||
DEPENDS:=@GPIO_SUPPORT +kmod-input-core +LINUX_5_10:kmod-input-polldev
|
||||
KCONFIG:= \
|
||||
CONFIG_KEYBOARD_GPIO_POLLED \
|
||||
CONFIG_INPUT_KEYBOARD=y
|
||||
@ -145,7 +145,7 @@ $(eval $(call KernelPackage,input-joydev))
|
||||
define KernelPackage/input-polldev
|
||||
SUBMENU:=$(INPUT_MODULES_MENU)
|
||||
TITLE:=Polled Input device support
|
||||
DEPENDS:=+kmod-input-core
|
||||
DEPENDS:=+kmod-input-core @LINUX_5_10
|
||||
KCONFIG:=CONFIG_INPUT_POLLDEV
|
||||
FILES:=$(LINUX_DIR)/drivers/input/input-polldev.ko
|
||||
endef
|
||||
|
@ -141,7 +141,7 @@ $(eval $(call KernelPackage,mii))
|
||||
define KernelPackage/mdio-devres
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Supports MDIO device registration
|
||||
DEPENDS:=+kmod-libphy +(TARGET_armvirt||TARGET_bcm27xx_bcm2708||TARGET_tegra):kmod-of-mdio
|
||||
DEPENDS:=+kmod-libphy +(TARGET_armvirt||TARGET_bcm27xx_bcm2708||TARGET_malta||TARGET_tegra):kmod-of-mdio
|
||||
KCONFIG:=CONFIG_MDIO_DEVRES
|
||||
HIDDEN:=1
|
||||
FILES:=$(LINUX_DIR)/drivers/net/phy/mdio_devres.ko
|
||||
@ -158,7 +158,7 @@ $(eval $(call KernelPackage,mdio-devres))
|
||||
define KernelPackage/mdio-gpio
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:= Supports GPIO lib-based MDIO busses
|
||||
DEPENDS:=+kmod-libphy @GPIO_SUPPORT +(TARGET_armvirt||TARGET_bcm27xx_bcm2708||TARGET_tegra):kmod-of-mdio
|
||||
DEPENDS:=+kmod-libphy @GPIO_SUPPORT +(TARGET_armvirt||TARGET_bcm27xx_bcm2708||TARGET_malta||TARGET_tegra):kmod-of-mdio
|
||||
KCONFIG:= \
|
||||
CONFIG_MDIO_BITBANG \
|
||||
CONFIG_MDIO_GPIO
|
||||
@ -223,6 +223,23 @@ endef
|
||||
$(eval $(call KernelPackage,phylib-broadcom))
|
||||
|
||||
|
||||
define KernelPackage/phy-ax88796b
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Asix PHY driver
|
||||
KCONFIG:=CONFIG_AX88796B_PHY
|
||||
DEPENDS:=+kmod-libphy
|
||||
FILES:=$(LINUX_DIR)/drivers/net/phy/ax88796b.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ax88796b)
|
||||
endef
|
||||
|
||||
define KernelPackage/phy-ax88796b/description
|
||||
Currently supports the Asix Electronics PHY found in the X-Surf 100
|
||||
AX88796B package.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,phy-ax88796b))
|
||||
|
||||
|
||||
define KernelPackage/phy-broadcom
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Broadcom Ethernet PHY driver
|
||||
@ -273,6 +290,22 @@ endef
|
||||
$(eval $(call KernelPackage,phy-realtek))
|
||||
|
||||
|
||||
define KernelPackage/phy-smsc
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=SMSC PHY driver
|
||||
KCONFIG:=CONFIG_SMSC_PHY
|
||||
DEPENDS:=+kmod-libphy
|
||||
FILES:=$(LINUX_DIR)/drivers/net/phy/smsc.ko
|
||||
AUTOLOAD:=$(call AutoProbe,smsc)
|
||||
endef
|
||||
|
||||
define KernelPackage/phy-smsc/description
|
||||
Currently supports the LAN83C185, LAN8187 and LAN8700 PHYs
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,phy-smsc))
|
||||
|
||||
|
||||
define KernelPackage/swconfig
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=switch configuration API
|
||||
@ -354,7 +387,7 @@ $(eval $(call KernelPackage,switch-rtl8306))
|
||||
define KernelPackage/switch-rtl8366-smi
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Realtek RTL8366 SMI switch interface support
|
||||
DEPENDS:=@GPIO_SUPPORT +kmod-swconfig +(TARGET_armvirt||TARGET_bcm27xx_bcm2708||TARGET_tegra):kmod-of-mdio
|
||||
DEPENDS:=@GPIO_SUPPORT +kmod-swconfig +(TARGET_armvirt||TARGET_bcm27xx_bcm2708||TARGET_malta||TARGET_tegra):kmod-of-mdio
|
||||
KCONFIG:=CONFIG_RTL8366_SMI
|
||||
FILES:=$(LINUX_DIR)/drivers/net/phy/rtl8366_smi.ko
|
||||
AUTOLOAD:=$(call AutoLoad,42,rtl8366_smi,1)
|
||||
@ -434,7 +467,7 @@ $(eval $(call KernelPackage,switch-rtl8367b))
|
||||
define KernelPackage/switch-ar8xxx
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Atheros AR8216/8327 switch support
|
||||
DEPENDS:=+kmod-swconfig
|
||||
DEPENDS:=+kmod-swconfig +kmod-mdio-devres
|
||||
KCONFIG:=CONFIG_AR8216_PHY
|
||||
FILES:=$(LINUX_DIR)/drivers/net/phy/ar8xxx.ko
|
||||
AUTOLOAD:=$(call AutoLoad,43,ar8xxx,1)
|
||||
@ -1383,6 +1416,23 @@ endef
|
||||
|
||||
$(eval $(call KernelPackage,sfc-falcon))
|
||||
|
||||
|
||||
define KernelPackage/wwan
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=WWAN Driver Core
|
||||
DEPENDS:=@LINUX_5_15
|
||||
KCONFIG:=CONFIG_WWAN
|
||||
FILES:=$(LINUX_DIR)/drivers/net/wwan/wwan.ko
|
||||
AUTOLOAD:=$(call AutoProbe,wwan)
|
||||
endef
|
||||
|
||||
define KernelPackage/wwan/description
|
||||
his driver provides a common framework for WWAN drivers.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,wwan))
|
||||
|
||||
|
||||
define KernelPackage/mhi-net
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=MHI Network Device
|
||||
@ -1401,9 +1451,8 @@ $(eval $(call KernelPackage,mhi-net))
|
||||
define KernelPackage/mhi-wwan-ctrl
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=MHI WWAN Control
|
||||
DEPENDS:=@LINUX_5_15 @PCI_SUPPORT +kmod-mhi-bus
|
||||
KCONFIG:=CONFIG_MHI_WWAN_CTRL \
|
||||
CONFIG_WWAN=y
|
||||
DEPENDS:=@LINUX_5_15 @PCI_SUPPORT +kmod-mhi-bus +kmod-wwan
|
||||
KCONFIG:=CONFIG_MHI_WWAN_CTRL
|
||||
FILES:=$(LINUX_DIR)/drivers/net/wwan/mhi_wwan_ctrl.ko
|
||||
AUTOLOAD:=$(call AutoProbe,mhi_wwan_ctrl)
|
||||
endef
|
||||
@ -1418,9 +1467,8 @@ $(eval $(call KernelPackage,mhi-wwan-ctrl))
|
||||
define KernelPackage/mhi-wwan-mbim
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=MHI MBIM
|
||||
DEPENDS:=@LINUX_5_15 @PCI_SUPPORT +kmod-mhi-bus
|
||||
KCONFIG:=CONFIG_MHI_WWAN_MBIM \
|
||||
CONFIG_WWAN=y
|
||||
DEPENDS:=@LINUX_5_15 @PCI_SUPPORT +kmod-mhi-bus +kmod-wwan
|
||||
KCONFIG:=CONFIG_MHI_WWAN_MBIM
|
||||
FILES:=$(LINUX_DIR)/drivers/net/wwan/mhi_wwan_mbim.ko
|
||||
AUTOLOAD:=$(call AutoProbe,mhi_wwan_mbim)
|
||||
endef
|
||||
|
@ -606,23 +606,6 @@ endef
|
||||
$(eval $(call KernelPackage,nf-nathelper-extra))
|
||||
|
||||
|
||||
define KernelPackage/ipt-ulog
|
||||
TITLE:=Module for user-space packet logging
|
||||
KCONFIG:=$(KCONFIG_IPT_ULOG)
|
||||
FILES:=$(foreach mod,$(IPT_ULOG-m),$(LINUX_DIR)/net/$(mod).ko)
|
||||
AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_ULOG-m)))
|
||||
$(call AddDepends/ipt)
|
||||
endef
|
||||
|
||||
define KernelPackage/ipt-ulog/description
|
||||
Netfilter (IPv4) module for user-space packet logging
|
||||
Includes:
|
||||
- ULOG
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,ipt-ulog))
|
||||
|
||||
|
||||
define KernelPackage/ipt-nflog
|
||||
TITLE:=Module for user-space packet logging
|
||||
KCONFIG:=$(KCONFIG_IPT_NFLOG)
|
||||
@ -1184,17 +1167,6 @@ endef
|
||||
$(eval $(call KernelPackage,nft-offload))
|
||||
|
||||
|
||||
define KernelPackage/nft-nat6
|
||||
SUBMENU:=$(NF_MENU)
|
||||
TITLE:=Netfilter nf_tables IPv6-NAT support
|
||||
DEPENDS:=+kmod-nft-nat +kmod-nf-nat6
|
||||
FILES:=$(foreach mod,$(NFT_NAT6-m),$(LINUX_DIR)/net/$(mod).ko)
|
||||
AUTOLOAD:=$(call AutoProbe,$(notdir $(NFT_NAT6-m)))
|
||||
KCONFIG:=$(KCONFIG_NFT_NAT6)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,nft-nat6))
|
||||
|
||||
define KernelPackage/nft-netdev
|
||||
SUBMENU:=$(NF_MENU)
|
||||
TITLE:=Netfilter nf_tables netdev support
|
||||
|
@ -163,38 +163,6 @@ endef
|
||||
$(eval $(call KernelPackage,misdn))
|
||||
|
||||
|
||||
define KernelPackage/isdn4linux
|
||||
SUBMENU:=$(NETWORK_SUPPORT_MENU)
|
||||
TITLE:=Old ISDN4Linux (deprecated)
|
||||
DEPENDS:=+kmod-ppp
|
||||
KCONFIG:= \
|
||||
CONFIG_ISDN=y \
|
||||
CONFIG_ISDN_I4L \
|
||||
CONFIG_ISDN_PPP=y \
|
||||
CONFIG_ISDN_PPP_VJ=y \
|
||||
CONFIG_ISDN_MPP=y \
|
||||
CONFIG_IPPP_FILTER=y \
|
||||
CONFIG_ISDN_PPP_BSDCOMP \
|
||||
CONFIG_ISDN_CAPI_MIDDLEWARE=y \
|
||||
CONFIG_ISDN_CAPI_CAPIFS_BOOL=y \
|
||||
CONFIG_ISDN_AUDIO=y \
|
||||
CONFIG_ISDN_TTY_FAX=y \
|
||||
CONFIG_ISDN_X25=y \
|
||||
CONFIG_ISDN_DIVERSION
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/isdn/divert/dss1_divert.ko \
|
||||
$(LINUX_DIR)/drivers/isdn/i4l/isdn.ko \
|
||||
$(LINUX_DIR)/drivers/isdn/i4l/isdn_bsdcomp.ko
|
||||
AUTOLOAD:=$(call AutoLoad,40,isdn isdn_bsdcomp dss1_divert)
|
||||
endef
|
||||
|
||||
define KernelPackage/isdn4linux/description
|
||||
This driver allows you to use an ISDN adapter for networking
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,isdn4linux))
|
||||
|
||||
|
||||
define KernelPackage/ipip
|
||||
SUBMENU:=$(NETWORK_SUPPORT_MENU)
|
||||
TITLE:=IP-in-IP encapsulation
|
||||
@ -807,6 +775,22 @@ endef
|
||||
$(eval $(call KernelPackage,sched-act-sample))
|
||||
|
||||
|
||||
define KernelPackage/sched-act-ipt
|
||||
SUBMENU:=$(NETWORK_SUPPORT_MENU)
|
||||
TITLE:=IPtables targets
|
||||
DEPENDS:=+kmod-ipt-core +kmod-sched-core
|
||||
KCONFIG:=CONFIG_NET_ACT_IPT
|
||||
FILES:=$(LINUX_DIR)/net/sched/act_ipt.ko
|
||||
AUTOLOAD:=$(call AutoProbe, act_ipt)
|
||||
endef
|
||||
|
||||
define KernelPackage/sched-act-ipt/description
|
||||
Allows to invoke iptables targets after successful classification.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,sched-act-ipt))
|
||||
|
||||
|
||||
define KernelPackage/sched-act-vlan
|
||||
SUBMENU:=$(NETWORK_SUPPORT_MENU)
|
||||
TITLE:=Traffic VLAN manipulation
|
||||
@ -980,13 +964,13 @@ endef
|
||||
$(eval $(call KernelPackage,bpf-test))
|
||||
|
||||
|
||||
SCHED_MODULES_EXTRA = sch_codel sch_dsmark sch_gred sch_multiq sch_sfq sch_teql sch_fq sch_pie act_ipt act_pedit act_simple act_csum em_cmp em_nbyte em_meta em_text
|
||||
SCHED_MODULES_EXTRA = sch_codel sch_dsmark sch_gred sch_multiq sch_sfq sch_teql sch_fq sch_pie act_pedit act_simple act_csum em_cmp em_nbyte em_meta em_text
|
||||
SCHED_FILES_EXTRA = $(foreach mod,$(SCHED_MODULES_EXTRA),$(LINUX_DIR)/net/sched/$(mod).ko)
|
||||
|
||||
define KernelPackage/sched
|
||||
SUBMENU:=$(NETWORK_SUPPORT_MENU)
|
||||
TITLE:=Extra traffic schedulers
|
||||
DEPENDS:=+kmod-sched-core +kmod-ipt-core +kmod-lib-crc32c +kmod-lib-textsearch
|
||||
DEPENDS:=+kmod-sched-core +kmod-lib-crc32c +kmod-lib-textsearch
|
||||
KCONFIG:= \
|
||||
CONFIG_NET_SCH_CODEL \
|
||||
CONFIG_NET_SCH_DSMARK \
|
||||
@ -996,7 +980,6 @@ define KernelPackage/sched
|
||||
CONFIG_NET_SCH_TEQL \
|
||||
CONFIG_NET_SCH_FQ \
|
||||
CONFIG_NET_SCH_PIE \
|
||||
CONFIG_NET_ACT_IPT \
|
||||
CONFIG_NET_ACT_PEDIT \
|
||||
CONFIG_NET_ACT_SIMP \
|
||||
CONFIG_NET_ACT_CSUM \
|
||||
|
@ -135,8 +135,10 @@ define KernelPackage/nls-cp932
|
||||
SUBMENU:=Native Language Support
|
||||
TITLE:=Codepage 932 (Japanese)
|
||||
KCONFIG:=CONFIG_NLS_CODEPAGE_932
|
||||
FILES:=$(LINUX_DIR)/fs/nls/nls_cp932.ko
|
||||
AUTOLOAD:=$(call AutoLoad,25,nls_cp932)
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/fs/nls/nls_cp932.ko \
|
||||
$(LINUX_DIR)/fs/nls/nls_euc-jp.ko
|
||||
AUTOLOAD:=$(call AutoLoad,25,nls_cp932 nls_euc-jp)
|
||||
$(call AddDepends/nls)
|
||||
endef
|
||||
|
||||
|
@ -401,7 +401,6 @@ define KernelPackage/mmc
|
||||
CONFIG_MMC_BLOCK \
|
||||
CONFIG_MMC_DEBUG=n \
|
||||
CONFIG_MMC_UNSAFE_RESUME=n \
|
||||
CONFIG_MMC_BLOCK_BOUNCE=y \
|
||||
CONFIG_MMC_TIFM_SD=n \
|
||||
CONFIG_MMC_WBSD=n \
|
||||
CONFIG_SDIO_UART=n
|
||||
@ -691,22 +690,6 @@ endef
|
||||
|
||||
$(eval $(call KernelPackage,rtc-pcf2127))
|
||||
|
||||
define KernelPackage/rtc-pt7c4338
|
||||
SUBMENU:=$(OTHER_MENU)
|
||||
TITLE:=Pericom PT7C4338 RTC support
|
||||
DEFAULT:=m if ALL_KMODS && RTC_SUPPORT
|
||||
DEPENDS:=+kmod-i2c-core
|
||||
KCONFIG:=CONFIG_RTC_DRV_PT7C4338 \
|
||||
CONFIG_RTC_CLASS=y
|
||||
FILES:=$(LINUX_DIR)/drivers/rtc/rtc-pt7c4338.ko
|
||||
AUTOLOAD:=$(call AutoProbe,rtc-pt7c4338)
|
||||
endef
|
||||
|
||||
define KernelPackage/rtc-pt7c4338/description
|
||||
Kernel module for Pericom PT7C4338 i2c RTC chip
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,rtc-pt7c4338))
|
||||
|
||||
define KernelPackage/rtc-rs5c372a
|
||||
SUBMENU:=$(OTHER_MENU)
|
||||
|
@ -431,10 +431,7 @@ define KernelPackage/usb-dwc2
|
||||
TITLE:=DWC2 USB controller driver
|
||||
DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget +kmod-usb-roles
|
||||
KCONFIG:= \
|
||||
CONFIG_USB_PCI=y \
|
||||
CONFIG_USB_DWC2 \
|
||||
CONFIG_USB_DWC2_PCI \
|
||||
CONFIG_USB_DWC2_PLATFORM \
|
||||
CONFIG_USB_DWC2_DEBUG=n \
|
||||
CONFIG_USB_DWC2_VERBOSE=n \
|
||||
CONFIG_USB_DWC2_TRACK_MISSED_SOFS=n \
|
||||
@ -453,6 +450,26 @@ endef
|
||||
$(eval $(call KernelPackage,usb-dwc2))
|
||||
|
||||
|
||||
define KernelPackage/usb-dwc2-pci
|
||||
TITLE:=DWC2 USB controller driver (PCI)
|
||||
DEPENDS:=@PCI_SUPPORT +kmod-usb-dwc2 +kmod-usb-phy-nop
|
||||
KCONFIG:= \
|
||||
CONFIG_USB_PCI=y \
|
||||
CONFIG_USB_DWC2_PCI
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/usb/dwc2/dwc2_pci.ko
|
||||
AUTOLOAD:=$(call AutoLoad,54,dwc2_pci,1)
|
||||
$(call AddDepends/usb)
|
||||
endef
|
||||
|
||||
define KernelPackage/usb-dwc2-pci/description
|
||||
The Designware USB2.0 PCI interface module for controllers
|
||||
connected to a PCI bus.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,usb-dwc2-pci))
|
||||
|
||||
|
||||
define KernelPackage/usb-dwc3
|
||||
TITLE:=DWC3 USB controller driver
|
||||
KCONFIG:= \
|
||||
@ -1139,7 +1156,7 @@ $(eval $(call KernelPackage,usb-net-aqc111))
|
||||
|
||||
define KernelPackage/usb-net-asix
|
||||
TITLE:=Kernel module for USB-to-Ethernet Asix convertors
|
||||
DEPENDS:=+kmod-libphy +LINUX_5_15:kmod-net-selftests +LINUX_5_15:kmod-mdio-devres
|
||||
DEPENDS:=+kmod-libphy +LINUX_5_15:kmod-net-selftests +LINUX_5_15:kmod-mdio-devres +kmod-phy-ax88796b
|
||||
KCONFIG:=CONFIG_USB_NET_AX8817X
|
||||
FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/asix.ko
|
||||
AUTOLOAD:=$(call AutoProbe,asix)
|
||||
@ -1267,7 +1284,7 @@ $(eval $(call KernelPackage,usb-net-smsc75xx))
|
||||
|
||||
define KernelPackage/usb-net-smsc95xx
|
||||
TITLE:=SMSC LAN95XX based USB 2.0 10/100 ethernet devices
|
||||
DEPENDS:=+kmod-libphy
|
||||
DEPENDS:=+kmod-libphy +kmod-phy-smsc
|
||||
KCONFIG:=CONFIG_USB_NET_SMSC95XX
|
||||
FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/smsc95xx.ko
|
||||
AUTOLOAD:=$(call AutoProbe,smsc95xx)
|
||||
|
@ -160,23 +160,6 @@ endef
|
||||
$(eval $(call KernelPackage,w1-slave-ds2433))
|
||||
|
||||
|
||||
define KernelPackage/w1-slave-ds2760
|
||||
TITLE:=Dallas 2760 battery monitor chip (HP iPAQ & others)
|
||||
KCONFIG:= \
|
||||
CONFIG_W1_SLAVE_DS2760 \
|
||||
CONFIG_W1_SLAVE_DS2433_CRC=n
|
||||
FILES:=$(W1_SLAVES_DIR)/w1_ds2760.ko
|
||||
AUTOLOAD:=$(call AutoProbe,w1_ds2760)
|
||||
$(call AddDepends/w1)
|
||||
endef
|
||||
|
||||
define KernelPackage/w1-slave-ds2760/description
|
||||
Kernel module for 1-wire DS2760 battery monitor chip support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,w1-slave-ds2760))
|
||||
|
||||
|
||||
define KernelPackage/w1-slave-ds2413
|
||||
TITLE:=DS2413 2 Ch. Addressable Switch
|
||||
KCONFIG:= \
|
||||
|
@ -1,25 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2006-2008 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
WIRELESS_MENU:=Wireless Drivers
|
||||
|
||||
define KernelPackage/net-rtl8192su
|
||||
SUBMENU:=$(WIRELESS_MENU)
|
||||
TITLE:=RTL8192SU support (staging)
|
||||
DEPENDS:=@USB_SUPPORT +@DRIVER_WEXT_SUPPORT +kmod-usb-core +rtl8192su-firmware
|
||||
KCONFIG:=\
|
||||
CONFIG_STAGING=y \
|
||||
CONFIG_R8712U
|
||||
FILES:=$(LINUX_DIR)/drivers/staging/rtl8712/r8712u.ko
|
||||
AUTOLOAD:=$(call AutoProbe,r8712u)
|
||||
endef
|
||||
|
||||
define KernelPackage/net-rtl8192su/description
|
||||
Kernel modules for RealTek RTL8712 and RTL81XXSU fullmac support.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,net-rtl8192su))
|
@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
PKG_NAME:=mac80211
|
||||
|
||||
PKG_VERSION:=5.15.58-1
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.15.58/
|
||||
PKG_HASH:=a3c2a2b7bbaf8943c65fd72f4e7d7ad5e205aeae28b26c835f9d8afa0f9810bf
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
. /lib/netifd/netifd-wireless.sh
|
||||
. /lib/netifd/hostapd.sh
|
||||
. /lib/functions/system.sh
|
||||
|
||||
init_wireless_driver "$@"
|
||||
|
||||
@ -667,10 +668,12 @@ mac80211_prepare_vif() {
|
||||
|
||||
json_select ..
|
||||
|
||||
[ -n "$macaddr" ] || {
|
||||
if [ -z "$macaddr" ]; then
|
||||
macaddr="$(mac80211_generate_mac $phy)"
|
||||
macidx="$(($macidx + 1))"
|
||||
}
|
||||
elif [ "$macaddr" = 'random' ]; then
|
||||
macaddr="$(macaddr_random)"
|
||||
fi
|
||||
|
||||
json_add_object data
|
||||
json_add_string ifname "$ifname"
|
||||
|
@ -318,6 +318,10 @@ hostapd_bss_get_clients(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
blobmsg_add_u8(&b, sta_flags[i].name,
|
||||
!!(sta->flags & sta_flags[i].flag));
|
||||
|
||||
#ifdef CONFIG_MBO
|
||||
blobmsg_add_u8(&b, "mbo", !!(sta->cell_capa));
|
||||
#endif
|
||||
|
||||
r = blobmsg_open_array(&b, "rrm");
|
||||
for (i = 0; i < ARRAY_SIZE(sta->rrm_enabled_capa); i++)
|
||||
blobmsg_add_u32(&b, "", sta->rrm_enabled_capa[i]);
|
||||
|
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=iproute2
|
||||
PKG_VERSION:=5.15.0
|
||||
PKG_VERSION:=5.19.0
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
|
||||
PKG_HASH:=38e3e4a5f9a7f5575c015027a10df097c149111eeb739993128e5b2b35b291ff
|
||||
PKG_HASH:=26b7a34d6a7fd2f7a42e2b39c5a90cb61bac522d1096067ffeb195e5693d7791
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_DEPENDS:=iptables
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
@ -184,6 +184,7 @@ MAKE_FLAGS += \
|
||||
HAVE_ELF=$(HAVE_ELF) \
|
||||
HAVE_MNL=$(HAVE_MNL) \
|
||||
HAVE_CAP=$(HAVE_CAP) \
|
||||
HAVE_TIRPC=n \
|
||||
IPT_LIB_DIR=/usr/lib/iptables \
|
||||
XT_LIB_DIR=/usr/lib/iptables \
|
||||
TC_CONFIG_XT=$(TC_CONFIG_XT) \
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -34,7 +34,8 @@ int main(int argc, char **argv) {
|
||||
@@ -36,7 +36,8 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
EOF
|
||||
|
||||
|
@ -0,0 +1,27 @@
|
||||
From c69e8e474936795a2cd7638b11ce3e99ff4d5ae7 Mon Sep 17 00:00:00 2001
|
||||
From: Nick Hainke <vincent@systemli.org>
|
||||
Date: Sat, 6 Aug 2022 10:00:20 +0200
|
||||
Subject: [PATCH] ipstats: Define MIN function to fix undefined references
|
||||
|
||||
Fixes errors in the form of:
|
||||
in function `ipstats_show_64':
|
||||
<artificial>:(.text+0x4e30): undefined reference to `MIN'
|
||||
|
||||
Signed-off-by: Nick Hainke <vincent@systemli.org>
|
||||
---
|
||||
ip/ipstats.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
--- a/ip/ipstats.c
|
||||
+++ b/ip/ipstats.c
|
||||
@@ -6,6 +6,10 @@
|
||||
#include "utils.h"
|
||||
#include "ip_common.h"
|
||||
|
||||
+#ifndef MIN
|
||||
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
+#endif
|
||||
+
|
||||
struct ipstats_stat_dump_filters {
|
||||
/* mask[0] filters outer attributes. Then individual nests have their
|
||||
* filtering mask at the index of the nested attribute.
|
@ -1,11 +1,14 @@
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -55,7 +55,7 @@ WFLAGS += -Wmissing-declarations -Wold-s
|
||||
@@ -65,9 +65,9 @@ WFLAGS += -Wmissing-declarations -Wold-s
|
||||
CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS)
|
||||
YACCFLAGS = -d -t -v
|
||||
|
||||
-SUBDIRS=lib ip tc bridge misc netem genl tipc devlink rdma dcb man vdpa
|
||||
+SUBDIRS=lib ip tc bridge misc genl devlink rdma
|
||||
-SUBDIRS=lib ip tc bridge misc netem genl man
|
||||
+SUBDIRS=lib ip tc bridge misc genl
|
||||
ifeq ($(HAVE_MNL),y)
|
||||
-SUBDIRS += tipc devlink rdma dcb vdpa
|
||||
+SUBDIRS += devlink rdma
|
||||
endif
|
||||
|
||||
LIBNETLINK=../lib/libutil.a ../lib/libnetlink.a
|
||||
LDLIBS += $(LIBNETLINK)
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -387,7 +387,7 @@ check_selinux()
|
||||
@@ -411,7 +411,7 @@ check_tirpc()
|
||||
|
||||
check_mnl()
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -255,7 +255,7 @@ EOF
|
||||
@@ -266,7 +266,7 @@ EOF
|
||||
|
||||
check_elf()
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -445,7 +445,7 @@ EOF
|
||||
@@ -469,7 +469,7 @@ EOF
|
||||
|
||||
check_cap()
|
||||
{
|
||||
|
@ -0,0 +1,11 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -398,7 +398,7 @@ check_selinux()
|
||||
|
||||
check_tirpc()
|
||||
{
|
||||
- if ${PKG_CONFIG} libtirpc --exists; then
|
||||
+ if [ "${HAVE_TIRPC}" = "y" ] && ${PKG_CONFIG} libtirpc --exists; then
|
||||
echo "HAVE_RPC:=y" >>$CONFIG
|
||||
echo "yes"
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/ip/Makefile
|
||||
+++ b/ip/Makefile
|
||||
@@ -17,6 +17,13 @@ RTMONOBJ=rtmon.o
|
||||
@@ -19,6 +19,13 @@ RTMONOBJ=rtmon.o
|
||||
|
||||
include ../config.mk
|
||||
|
||||
@ -12,9 +12,9 @@
|
||||
+STATIC_SYM_SOURCES:=$(filter-out $(STATIC_SYM_FILTER),$(wildcard *.c))
|
||||
+
|
||||
ALLOBJ=$(IPOBJ) $(RTMONOBJ)
|
||||
SCRIPTS=ifcfg rtpr routel routef
|
||||
SCRIPTS=routel
|
||||
TARGETS=ip rtmon
|
||||
@@ -46,7 +53,7 @@ else
|
||||
@@ -48,7 +55,7 @@ else
|
||||
|
||||
ip: static-syms.o
|
||||
static-syms.o: static-syms.h
|
||||
@ -30,20 +30,20 @@
|
||||
"Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n"
|
||||
" ip [ -force ] -batch filename\n"
|
||||
+#ifndef IPROUTE2_TINY
|
||||
"where OBJECT := { address | addrlabel | fou | help | ila | ioam | l2tp | link |\n"
|
||||
" macsec | maddress | monitor | mptcp | mroute | mrule |\n"
|
||||
"where OBJECT := { address | addrlabel | amt | fou | help | ila | ioam | l2tp |\n"
|
||||
" link | macsec | maddress | monitor | mptcp | mroute | mrule |\n"
|
||||
" neighbor | neighbour | netconf | netns | nexthop | ntable |\n"
|
||||
" ntbl | route | rule | sr | tap | tcpmetrics |\n"
|
||||
" token | tunnel | tuntap | vrf | xfrm }\n"
|
||||
+#else
|
||||
+ "where OBJECT := { address | ila | link | macsec | maddress | monitor |\n"
|
||||
+ " mroute | mrule | neighbor | neighbour | netns | route |\n"
|
||||
+ " rule | sr | token | tunnel | vrf }\n"
|
||||
+ "where OBJECT := { address | link | maddress | monitor |\n"
|
||||
+ " neighbor | neighbour | netns | route |\n"
|
||||
+ " rule | token | tunnel }\n"
|
||||
+#endif
|
||||
" OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
|
||||
" -h[uman-readable] | -iec | -j[son] | -p[retty] |\n"
|
||||
" -f[amily] { inet | inet6 | mpls | bridge | link } |\n"
|
||||
@@ -91,37 +97,51 @@ static const struct cmd {
|
||||
@@ -91,37 +97,49 @@ static const struct cmd {
|
||||
int (*func)(int argc, char **argv);
|
||||
} cmds[] = {
|
||||
{ "address", do_ipaddr },
|
||||
@ -63,9 +63,9 @@
|
||||
+#ifndef IPROUTE2_TINY
|
||||
{ "l2tp", do_ipl2tp },
|
||||
{ "fou", do_ipfou },
|
||||
+#endif
|
||||
{ "ila", do_ipila },
|
||||
{ "macsec", do_ipmacsec },
|
||||
+#endif
|
||||
{ "tunnel", do_iptunnel },
|
||||
{ "tunl", do_iptunnel },
|
||||
+#ifndef IPROUTE2_TINY
|
||||
@ -78,23 +78,21 @@
|
||||
{ "monitor", do_ipmonitor },
|
||||
+#ifndef IPROUTE2_TINY
|
||||
{ "xfrm", do_xfrm },
|
||||
+#endif
|
||||
{ "mroute", do_multiroute },
|
||||
{ "mrule", do_multirule },
|
||||
+#endif
|
||||
{ "netns", do_netns },
|
||||
+#ifndef IPROUTE2_TINY
|
||||
{ "netconf", do_ipnetconf },
|
||||
+#endif
|
||||
{ "vrf", do_ipvrf},
|
||||
{ "sr", do_seg6 },
|
||||
+#ifndef IPROUTE2_TINY
|
||||
{ "nexthop", do_ipnh },
|
||||
{ "mptcp", do_mptcp },
|
||||
{ "ioam", do_ioam6 },
|
||||
+#endif
|
||||
{ "help", do_help },
|
||||
{ "stats", do_ipstats },
|
||||
{ 0 }
|
||||
};
|
||||
--- a/lib/Makefile
|
||||
+++ b/lib/Makefile
|
||||
@@ -3,6 +3,10 @@ include ../config.mk
|
||||
|
@ -31,7 +31,7 @@ Subject: [PATCH] add support for dropping with FAILED_POLICY
|
||||
if (!end || end == arg || *end || res > 255)
|
||||
--- a/include/uapi/linux/rtnetlink.h
|
||||
+++ b/include/uapi/linux/rtnetlink.h
|
||||
@@ -256,6 +256,7 @@ enum {
|
||||
@@ -265,6 +265,7 @@ enum {
|
||||
RTN_THROW, /* Not in this table */
|
||||
RTN_NAT, /* Translate this address */
|
||||
RTN_XRESOLVE, /* Use external resolver */
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -279,7 +279,7 @@ int main(int argc, char **argv) {
|
||||
@@ -290,7 +290,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
EOF
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
local ret=$?
|
||||
|
||||
rm -f $TMPDIR/libbpf_test.c $TMPDIR/libbpf_test
|
||||
@@ -297,7 +297,7 @@ int main(int argc, char **argv) {
|
||||
@@ -308,7 +308,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
EOF
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
--- a/ip/Makefile
|
||||
+++ b/ip/Makefile
|
||||
@@ -26,7 +26,7 @@ STATIC_SYM_SOURCES:=$(filter-out $(STATI
|
||||
@@ -28,7 +28,7 @@ STATIC_SYM_SOURCES:=$(filter-out $(STATI
|
||||
|
||||
ALLOBJ=$(IPOBJ) $(RTMONOBJ)
|
||||
SCRIPTS=ifcfg rtpr routel routef
|
||||
SCRIPTS=routel
|
||||
-TARGETS=ip rtmon
|
||||
+TARGETS=$(findstring ip,$(BUILD_VARIANT)) rtmon
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -431,14 +431,8 @@ EOF
|
||||
@@ -455,14 +455,8 @@ EOF
|
||||
if $CC -I$INCLUDE -o $TMPDIR/strtest $TMPDIR/strtest.c >/dev/null 2>&1; then
|
||||
echo "no"
|
||||
else
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -374,7 +374,7 @@ check_libbpf()
|
||||
@@ -385,7 +385,7 @@ check_libbpf()
|
||||
check_selinux()
|
||||
# SELinux is a compile time option in the ss utility
|
||||
{
|
||||
|
@ -251,19 +251,6 @@ iptables extensions for extra NAT targets.
|
||||
- NETMAP
|
||||
endef
|
||||
|
||||
define Package/iptables-mod-ulog
|
||||
$(call Package/iptables/Module, +kmod-ipt-ulog)
|
||||
TITLE:=user-space packet logging
|
||||
endef
|
||||
|
||||
define Package/iptables-mod-ulog/description
|
||||
iptables extensions for user-space packet logging.
|
||||
|
||||
Targets:
|
||||
- ULOG
|
||||
|
||||
endef
|
||||
|
||||
define Package/iptables-mod-nflog
|
||||
$(call Package/iptables/Module, +kmod-nfnetlink-log +kmod-ipt-nflog)
|
||||
TITLE:=Netfilter NFLOG target
|
||||
@ -779,7 +766,6 @@ $(eval $(call BuildPlugin,iptables-mod-nat-extra,$(IPT_NAT_EXTRA-m)))
|
||||
$(eval $(call BuildPlugin,iptables-mod-iprange,$(IPT_IPRANGE-m)))
|
||||
$(eval $(call BuildPlugin,iptables-mod-cluster,$(IPT_CLUSTER-m)))
|
||||
$(eval $(call BuildPlugin,iptables-mod-clusterip,$(IPT_CLUSTERIP-m)))
|
||||
$(eval $(call BuildPlugin,iptables-mod-ulog,$(IPT_ULOG-m)))
|
||||
$(eval $(call BuildPlugin,iptables-mod-hashlimit,$(IPT_HASHLIMIT-m)))
|
||||
$(eval $(call BuildPlugin,iptables-mod-rpfilter,$(IPT_RPFILTER-m)))
|
||||
$(eval $(call BuildPlugin,iptables-mod-led,$(IPT_LED-m)))
|
||||
|
@ -11,9 +11,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git
|
||||
PKG_SOURCE_DATE:=2022-04-26
|
||||
PKG_SOURCE_VERSION:=dc6847eb5ec8747867bc20f1024723c6397c1df7
|
||||
PKG_MIRROR_HASH:=3f243cf75f4cec02e9e8ecc2087577146845346c0172808f64dea066f84f88d4
|
||||
PKG_SOURCE_DATE:=2022-08-13
|
||||
PKG_SOURCE_VERSION:=705d3b5cc30ed1ac3b2fed131259bcbc61177e41
|
||||
PKG_MIRROR_HASH:=091b7f20e95e9f1dfb993d71172d96590041f985e422b7248e15b11798a73644
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
|
@ -5,9 +5,9 @@ PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/umbim.git
|
||||
PKG_SOURCE_DATE:=2021-08-18
|
||||
PKG_SOURCE_VERSION:=de5623104baee6e0c13c92f05c15bf4b4145c0b1
|
||||
PKG_MIRROR_HASH:=2d4a75d2b53c8413521a2fd138895e327bff3f4b4d29a540342b2d2e1e009852
|
||||
PKG_SOURCE_DATE:=2022-08-13
|
||||
PKG_SOURCE_VERSION:=146bc77c98ace3d1cc672986669650d2e1da71f3
|
||||
PKG_MIRROR_HASH:=3cf04858ff5c3f529904f9789b094aa9645ad41c91f553e6fc3fcd3cb341d359
|
||||
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
@ -12,9 +12,9 @@ PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git
|
||||
PKG_MIRROR_HASH:=b0cf3e4dea4f86883409d8597e89aa1d022118bd7087881165fe67622da5a903
|
||||
PKG_SOURCE_DATE:=2022-07-17
|
||||
PKG_SOURCE_VERSION:=ebf7e9028f2facf1a87c56dd261bda82ab9bcc59
|
||||
PKG_MIRROR_HASH:=aecd54ca2421fee691d2fb4a77e0348d225c6949d5254dd9da0827da9728cb2d
|
||||
PKG_SOURCE_DATE:=2022-08-13
|
||||
PKG_SOURCE_VERSION:=81785c1b9a9c1b797e7406a3542c01d972c61315
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
@ -75,6 +75,10 @@ define Package/snapshot-tool
|
||||
DEPENDS:=+libubox +fstools
|
||||
endef
|
||||
|
||||
define Package/block-mount/conffiles
|
||||
/etc/config/fstab
|
||||
endef
|
||||
|
||||
define Package/block-mount
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
|
@ -5,9 +5,9 @@ PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubox.git
|
||||
PKG_SOURCE_DATE:=2022-07-17
|
||||
PKG_SOURCE_VERSION:=46a33b8be298e1e700e56f05b5ba4f06daf83efa
|
||||
PKG_MIRROR_HASH:=551560cc481dd5d12e1dc81f368af8be29027891ce091ba71fee8fe5d9afcb87
|
||||
PKG_SOURCE_DATE:=2022-08-13
|
||||
PKG_SOURCE_VERSION:=4c7b720b9c63b826fb9404e454ae54f2ef5649d5
|
||||
PKG_MIRROR_HASH:=35178148034dfef36c5fda2bc8217617920bc1a3b86f72efbe87e85048a6a2a8
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
@ -92,7 +92,6 @@ CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
# CONFIG_GEN_RTC is not set
|
||||
# CONFIG_GLACIER is not set
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_GENERIC_PLATFORM=y
|
||||
CONFIG_HAS_DMA=y
|
||||
|
@ -92,7 +92,6 @@ CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
# CONFIG_GEN_RTC is not set
|
||||
# CONFIG_GLACIER is not set
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_GENERIC_PLATFORM=y
|
||||
|
@ -12,7 +12,6 @@ CONFIG_SATA_DWC=y
|
||||
# CONFIG_SATA_DWC_DEBUG is not set
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_GENERIC_PLATFORM=y
|
||||
CONFIG_LEDS_TRIGGER_DISK=y
|
||||
|
@ -18,7 +18,6 @@ CONFIG_FW_CACHE=y
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_BLK_PM=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_GENERIC_PLATFORM=y
|
||||
CONFIG_GPIO_74XX_MMIO=y
|
||||
|
@ -117,7 +117,6 @@ CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_PENDING_IRQ=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_DWAPB=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_SNPS_CREG=y
|
||||
|
@ -67,7 +67,6 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_PL061=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
|
@ -64,7 +64,6 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
CONFIG_GPIO_PL061=y
|
||||
|
@ -121,7 +121,6 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GLOB=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
CONFIG_HARDIRQS_SW_RESEND=y
|
||||
|
@ -188,7 +188,6 @@ CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GENERIC_VDSO_32=y
|
||||
CONFIG_GLOB=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
CONFIG_HARDEN_BRANCH_PREDICTOR=y
|
||||
|
@ -175,7 +175,6 @@ CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GENERIC_VDSO_32=y
|
||||
CONFIG_GLOB=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GRACE_PERIOD=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
|
@ -54,7 +54,6 @@ CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_AR2315=y
|
||||
CONFIG_GPIO_AR5312=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
|
@ -43,7 +43,7 @@ endef
|
||||
define Build/copy-kernel
|
||||
rm -f $@ $@.elf
|
||||
cp $< $@
|
||||
cp $< $@.elf
|
||||
cp $<.elf $@.elf
|
||||
endef
|
||||
|
||||
define Build/elf-kernel
|
||||
@ -54,6 +54,9 @@ endef
|
||||
define Device/Default
|
||||
PROFILES = Default $$(DEVICE_NAME)
|
||||
KERNEL := copy-kernel | lzma-kernel
|
||||
KERNEL_INITRAMFS = kernel-bin
|
||||
KERNEL_INITRAMFS_NAME := vmlinux-initramfs.elf
|
||||
KERNEL_INITRAMFS_SUFFIX := -kernel.elf
|
||||
IMAGES := sysupgrade.bin
|
||||
FILESYSTEMS := squashfs
|
||||
endef
|
||||
|
@ -70,7 +70,6 @@ CONFIG_GENERIC_PINMUX_FUNCTIONS=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_74X164=y
|
||||
CONFIG_GPIO_ATH79=y
|
||||
|
@ -68,7 +68,6 @@ CONFIG_GENERIC_PINMUX_FUNCTIONS=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_74X164=y
|
||||
CONFIG_GPIO_ATH79=y
|
||||
|
@ -181,7 +181,6 @@ CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
# CONFIG_GPIO_BCM_VIRT is not set
|
||||
CONFIG_GPIO_CDEV=y
|
||||
|
@ -228,7 +228,6 @@ CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GENERIC_VDSO_32=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_BCM_VIRT=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
|
@ -231,7 +231,6 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_BCM_VIRT=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
|
@ -237,7 +237,6 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_BCM_VIRT=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
|
@ -85,7 +85,6 @@ CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_WDT=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
|
@ -99,7 +99,6 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_GENERIC_PLATFORM=y
|
||||
CONFIG_GRO_CELLS=y
|
||||
|
@ -146,7 +146,6 @@ CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GENERIC_VDSO_32=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_74X164=y
|
||||
CONFIG_GPIO_BCM_XGS_IPROC=y
|
||||
|
@ -151,7 +151,6 @@ CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GENERIC_VDSO_32=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_74X164=y
|
||||
CONFIG_GPIO_BCM_XGS_IPROC=y
|
||||
|
@ -86,7 +86,6 @@ CONFIG_GENERIC_PINMUX_FUNCTIONS=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_BCM63XX=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
|
@ -90,7 +90,6 @@ CONFIG_GENERIC_PINMUX_FUNCTIONS=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_BCM63XX=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
|
@ -111,7 +111,6 @@ CONFIG_GENERIC_PINMUX_FUNCTIONS=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB=y
|
||||
# CONFIG_GPIO_BRCMSTB is not set
|
||||
CONFIG_GPIO_CDEV=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
|
@ -187,7 +187,6 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GLOB=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
CONFIG_GPIO_FTGPIO010=y
|
||||
|
@ -187,7 +187,6 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GLOB=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
CONFIG_GPIO_FTGPIO010=y
|
||||
|
@ -0,0 +1,41 @@
|
||||
From 78ed0a9bc6db76f8e5f5f4cb0d2b2f0d1bb21b24 Mon Sep 17 00:00:00 2001
|
||||
From: Roi Dayan <roid@nvidia.com>
|
||||
Date: Tue, 13 Apr 2021 11:06:05 +0300
|
||||
Subject: [PATCH] netfilter: flowtable: Add FLOW_OFFLOAD_XMIT_UNSPEC xmit type
|
||||
|
||||
It could be xmit type was not set and would default to FLOW_OFFLOAD_XMIT_NEIGH
|
||||
and in this type the gc expect to have a route info.
|
||||
Fix that by adding FLOW_OFFLOAD_XMIT_UNSPEC which defaults to 0.
|
||||
|
||||
Fixes: 8b9229d15877 ("netfilter: flowtable: dst_check() from garbage collector path")
|
||||
Signed-off-by: Roi Dayan <roid@nvidia.com>
|
||||
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
---
|
||||
include/net/netfilter/nf_flow_table.h | 3 ++-
|
||||
net/netfilter/nf_flow_table_core.c | 3 +++
|
||||
2 files changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/include/net/netfilter/nf_flow_table.h
|
||||
+++ b/include/net/netfilter/nf_flow_table.h
|
||||
@@ -90,7 +90,8 @@ enum flow_offload_tuple_dir {
|
||||
#define FLOW_OFFLOAD_DIR_MAX IP_CT_DIR_MAX
|
||||
|
||||
enum flow_offload_xmit_type {
|
||||
- FLOW_OFFLOAD_XMIT_NEIGH = 0,
|
||||
+ FLOW_OFFLOAD_XMIT_UNSPEC = 0,
|
||||
+ FLOW_OFFLOAD_XMIT_NEIGH,
|
||||
FLOW_OFFLOAD_XMIT_XFRM,
|
||||
FLOW_OFFLOAD_XMIT_DIRECT,
|
||||
};
|
||||
--- a/net/netfilter/nf_flow_table_core.c
|
||||
+++ b/net/netfilter/nf_flow_table_core.c
|
||||
@@ -130,6 +130,9 @@ static int flow_offload_fill_route(struc
|
||||
flow_tuple->dst_cache = dst;
|
||||
flow_tuple->dst_cookie = flow_offload_dst_cookie(flow_tuple);
|
||||
break;
|
||||
+ default:
|
||||
+ WARN_ON_ONCE(1);
|
||||
+ break;
|
||||
}
|
||||
flow_tuple->xmit_type = route->tuple[dir].xmit_type;
|
||||
|
@ -12,7 +12,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
|
||||
--- a/net/netfilter/nf_flow_table_core.c
|
||||
+++ b/net/netfilter/nf_flow_table_core.c
|
||||
@@ -328,7 +328,11 @@ EXPORT_SYMBOL_GPL(flow_offload_add);
|
||||
@@ -331,7 +331,11 @@ EXPORT_SYMBOL_GPL(flow_offload_add);
|
||||
void flow_offload_refresh(struct nf_flowtable *flow_table,
|
||||
struct flow_offload *flow)
|
||||
{
|
||||
|
@ -20,7 +20,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
|
||||
--- a/net/netfilter/nf_flow_table_core.c
|
||||
+++ b/net/netfilter/nf_flow_table_core.c
|
||||
@@ -433,33 +433,12 @@ nf_flow_table_iterate(struct nf_flowtabl
|
||||
@@ -436,33 +436,12 @@ nf_flow_table_iterate(struct nf_flowtabl
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,47 @@
|
||||
From 92fb15513edc6ae1eb51f717e70d4d3d538c2d09 Mon Sep 17 00:00:00 2001
|
||||
From: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
Date: Mon, 19 Jul 2021 18:04:01 +0200
|
||||
Subject: [PATCH] netfilter: flowtable: remove nf_ct_l4proto_find() call
|
||||
|
||||
TCP and UDP are built-in conntrack protocol trackers and the flowtable
|
||||
only supports for TCP and UDP, remove this call.
|
||||
|
||||
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
---
|
||||
net/netfilter/nf_flow_table_core.c | 10 ----------
|
||||
1 file changed, 10 deletions(-)
|
||||
|
||||
--- a/net/netfilter/nf_flow_table_core.c
|
||||
+++ b/net/netfilter/nf_flow_table_core.c
|
||||
@@ -180,15 +180,10 @@ static void flow_offload_fixup_tcp(struc
|
||||
|
||||
static void flow_offload_fixup_ct_timeout(struct nf_conn *ct)
|
||||
{
|
||||
- const struct nf_conntrack_l4proto *l4proto;
|
||||
struct net *net = nf_ct_net(ct);
|
||||
int l4num = nf_ct_protonum(ct);
|
||||
unsigned int timeout;
|
||||
|
||||
- l4proto = nf_ct_l4proto_find(l4num);
|
||||
- if (!l4proto)
|
||||
- return;
|
||||
-
|
||||
if (l4num == IPPROTO_TCP) {
|
||||
struct nf_tcp_net *tn = nf_tcp_pernet(net);
|
||||
|
||||
@@ -273,15 +268,10 @@ static const struct rhashtable_params nf
|
||||
|
||||
unsigned long flow_offload_get_timeout(struct flow_offload *flow)
|
||||
{
|
||||
- const struct nf_conntrack_l4proto *l4proto;
|
||||
unsigned long timeout = NF_FLOW_TIMEOUT;
|
||||
struct net *net = nf_ct_net(flow->ct);
|
||||
int l4num = nf_ct_protonum(flow->ct);
|
||||
|
||||
- l4proto = nf_ct_l4proto_find(l4num);
|
||||
- if (!l4proto)
|
||||
- return timeout;
|
||||
-
|
||||
if (l4num == IPPROTO_TCP) {
|
||||
struct nf_tcp_net *tn = nf_tcp_pernet(net);
|
||||
|
@ -0,0 +1,184 @@
|
||||
From 4592ee7f525c4683ec9e290381601fdee50ae110 Mon Sep 17 00:00:00 2001
|
||||
From: Florian Westphal <fw@strlen.de>
|
||||
Date: Wed, 4 Aug 2021 15:02:15 +0200
|
||||
Subject: [PATCH] netfilter: conntrack: remove offload_pickup sysctl again
|
||||
|
||||
These two sysctls were added because the hardcoded defaults (2 minutes,
|
||||
tcp, 30 seconds, udp) turned out to be too low for some setups.
|
||||
|
||||
They appeared in 5.14-rc1 so it should be fine to remove it again.
|
||||
|
||||
Marcelo convinced me that there should be no difference between a flow
|
||||
that was offloaded vs. a flow that was not wrt. timeout handling.
|
||||
Thus the default is changed to those for TCP established and UDP stream,
|
||||
5 days and 120 seconds, respectively.
|
||||
|
||||
Marcelo also suggested to account for the timeout value used for the
|
||||
offloading, this avoids increase beyond the value in the conntrack-sysctl
|
||||
and will also instantly expire the conntrack entry with altered sysctls.
|
||||
|
||||
Example:
|
||||
nf_conntrack_udp_timeout_stream=60
|
||||
nf_flowtable_udp_timeout=60
|
||||
|
||||
This will remove offloaded udp flows after one minute, rather than two.
|
||||
|
||||
An earlier version of this patch also cleared the ASSURED bit to
|
||||
allow nf_conntrack to evict the entry via early_drop (i.e., table full).
|
||||
However, it looks like we can safely assume that connection timed out
|
||||
via HW is still in established state, so this isn't needed.
|
||||
|
||||
Quoting Oz:
|
||||
[..] the hardware sends all packets with a set FIN flags to sw.
|
||||
[..] Connections that are aged in hardware are expected to be in the
|
||||
established state.
|
||||
|
||||
In case it turns out that back-to-sw-path transition can occur for
|
||||
'dodgy' connections too (e.g., one side disappeared while software-path
|
||||
would have been in RETRANS timeout), we can adjust this later.
|
||||
|
||||
Cc: Oz Shlomo <ozsh@nvidia.com>
|
||||
Cc: Paul Blakey <paulb@nvidia.com>
|
||||
Suggested-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
|
||||
Signed-off-by: Florian Westphal <fw@strlen.de>
|
||||
Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
|
||||
Reviewed-by: Oz Shlomo <ozsh@nvidia.com>
|
||||
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
---
|
||||
Documentation/networking/nf_conntrack-sysctl.rst | 10 ----------
|
||||
include/net/netns/conntrack.h | 2 --
|
||||
net/netfilter/nf_conntrack_proto_tcp.c | 1 -
|
||||
net/netfilter/nf_conntrack_proto_udp.c | 1 -
|
||||
net/netfilter/nf_conntrack_standalone.c | 16 ----------------
|
||||
net/netfilter/nf_flow_table_core.c | 11 ++++++++---
|
||||
6 files changed, 8 insertions(+), 33 deletions(-)
|
||||
|
||||
--- a/include/net/netns/conntrack.h
|
||||
+++ b/include/net/netns/conntrack.h
|
||||
@@ -29,7 +29,6 @@ struct nf_tcp_net {
|
||||
int tcp_max_retrans;
|
||||
#if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
|
||||
unsigned int offload_timeout;
|
||||
- unsigned int offload_pickup;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -43,7 +42,6 @@ struct nf_udp_net {
|
||||
unsigned int timeouts[UDP_CT_MAX];
|
||||
#if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
|
||||
unsigned int offload_timeout;
|
||||
- unsigned int offload_pickup;
|
||||
#endif
|
||||
};
|
||||
|
||||
--- a/net/netfilter/nf_conntrack_proto_tcp.c
|
||||
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
|
||||
@@ -1450,7 +1450,6 @@ void nf_conntrack_tcp_init_net(struct ne
|
||||
|
||||
#if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
|
||||
tn->offload_timeout = 30 * HZ;
|
||||
- tn->offload_pickup = 120 * HZ;
|
||||
#endif
|
||||
}
|
||||
|
||||
--- a/net/netfilter/nf_conntrack_proto_udp.c
|
||||
+++ b/net/netfilter/nf_conntrack_proto_udp.c
|
||||
@@ -276,7 +276,6 @@ void nf_conntrack_udp_init_net(struct ne
|
||||
|
||||
#if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
|
||||
un->offload_timeout = 30 * HZ;
|
||||
- un->offload_pickup = 30 * HZ;
|
||||
#endif
|
||||
}
|
||||
|
||||
--- a/net/netfilter/nf_conntrack_standalone.c
|
||||
+++ b/net/netfilter/nf_conntrack_standalone.c
|
||||
@@ -569,7 +569,6 @@ enum nf_ct_sysctl_index {
|
||||
NF_SYSCTL_CT_PROTO_TIMEOUT_TCP_UNACK,
|
||||
#if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
|
||||
NF_SYSCTL_CT_PROTO_TIMEOUT_TCP_OFFLOAD,
|
||||
- NF_SYSCTL_CT_PROTO_TIMEOUT_TCP_OFFLOAD_PICKUP,
|
||||
#endif
|
||||
NF_SYSCTL_CT_PROTO_TCP_LOOSE,
|
||||
NF_SYSCTL_CT_PROTO_TCP_LIBERAL,
|
||||
@@ -578,7 +577,6 @@ enum nf_ct_sysctl_index {
|
||||
NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_STREAM,
|
||||
#if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
|
||||
NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_OFFLOAD,
|
||||
- NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_OFFLOAD_PICKUP,
|
||||
#endif
|
||||
NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP,
|
||||
NF_SYSCTL_CT_PROTO_TIMEOUT_ICMPV6,
|
||||
@@ -773,12 +771,6 @@ static struct ctl_table nf_ct_sysctl_tab
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dointvec_jiffies,
|
||||
},
|
||||
- [NF_SYSCTL_CT_PROTO_TIMEOUT_TCP_OFFLOAD_PICKUP] = {
|
||||
- .procname = "nf_flowtable_tcp_pickup",
|
||||
- .maxlen = sizeof(unsigned int),
|
||||
- .mode = 0644,
|
||||
- .proc_handler = proc_dointvec_jiffies,
|
||||
- },
|
||||
#endif
|
||||
[NF_SYSCTL_CT_PROTO_TCP_LOOSE] = {
|
||||
.procname = "nf_conntrack_tcp_loose",
|
||||
@@ -821,12 +813,6 @@ static struct ctl_table nf_ct_sysctl_tab
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dointvec_jiffies,
|
||||
},
|
||||
- [NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_OFFLOAD_PICKUP] = {
|
||||
- .procname = "nf_flowtable_udp_pickup",
|
||||
- .maxlen = sizeof(unsigned int),
|
||||
- .mode = 0644,
|
||||
- .proc_handler = proc_dointvec_jiffies,
|
||||
- },
|
||||
#endif
|
||||
[NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP] = {
|
||||
.procname = "nf_conntrack_icmp_timeout",
|
||||
@@ -1006,7 +992,6 @@ static void nf_conntrack_standalone_init
|
||||
|
||||
#if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
|
||||
table[NF_SYSCTL_CT_PROTO_TIMEOUT_TCP_OFFLOAD].data = &tn->offload_timeout;
|
||||
- table[NF_SYSCTL_CT_PROTO_TIMEOUT_TCP_OFFLOAD_PICKUP].data = &tn->offload_pickup;
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -1098,7 +1083,6 @@ static int nf_conntrack_standalone_init_
|
||||
table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_STREAM].data = &un->timeouts[UDP_CT_REPLIED];
|
||||
#if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
|
||||
table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_OFFLOAD].data = &un->offload_timeout;
|
||||
- table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_OFFLOAD_PICKUP].data = &un->offload_pickup;
|
||||
#endif
|
||||
|
||||
nf_conntrack_standalone_init_tcp_sysctl(net, table);
|
||||
--- a/net/netfilter/nf_flow_table_core.c
|
||||
+++ b/net/netfilter/nf_flow_table_core.c
|
||||
@@ -182,20 +182,25 @@ static void flow_offload_fixup_ct_timeou
|
||||
{
|
||||
struct net *net = nf_ct_net(ct);
|
||||
int l4num = nf_ct_protonum(ct);
|
||||
- unsigned int timeout;
|
||||
+ s32 timeout;
|
||||
|
||||
if (l4num == IPPROTO_TCP) {
|
||||
struct nf_tcp_net *tn = nf_tcp_pernet(net);
|
||||
|
||||
- timeout = tn->offload_pickup;
|
||||
+ timeout = tn->timeouts[TCP_CONNTRACK_ESTABLISHED];
|
||||
+ timeout -= tn->offload_timeout;
|
||||
} else if (l4num == IPPROTO_UDP) {
|
||||
struct nf_udp_net *tn = nf_udp_pernet(net);
|
||||
|
||||
- timeout = tn->offload_pickup;
|
||||
+ timeout = tn->timeouts[UDP_CT_REPLIED];
|
||||
+ timeout -= tn->offload_timeout;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (timeout < 0)
|
||||
+ timeout = 0;
|
||||
+
|
||||
if (nf_flow_timeout_delta(READ_ONCE(ct->timeout)) > (__s32)timeout)
|
||||
WRITE_ONCE(ct->timeout, nfct_time_stamp + timeout);
|
||||
}
|
@ -0,0 +1,166 @@
|
||||
From b8835ba8c029b5c9ada5666754526c2b00f7ea80 Mon Sep 17 00:00:00 2001
|
||||
From: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
Date: Tue, 17 May 2022 10:44:14 +0200
|
||||
Subject: netfilter: flowtable: fix TCP flow teardown
|
||||
|
||||
[ Upstream commit e5eaac2beb54f0a16ff851125082d9faeb475572 ]
|
||||
|
||||
This patch addresses three possible problems:
|
||||
|
||||
1. ct gc may race to undo the timeout adjustment of the packet path, leaving
|
||||
the conntrack entry in place with the internal offload timeout (one day).
|
||||
|
||||
2. ct gc removes the ct because the IPS_OFFLOAD_BIT is not set and the CLOSE
|
||||
timeout is reached before the flow offload del.
|
||||
|
||||
3. tcp ct is always set to ESTABLISHED with a very long timeout
|
||||
in flow offload teardown/delete even though the state might be already
|
||||
CLOSED. Also as a remark we cannot assume that the FIN or RST packet
|
||||
is hitting flow table teardown as the packet might get bumped to the
|
||||
slow path in nftables.
|
||||
|
||||
This patch resets IPS_OFFLOAD_BIT from flow_offload_teardown(), so
|
||||
conntrack handles the tcp rst/fin packet which triggers the CLOSE/FIN
|
||||
state transition.
|
||||
|
||||
Moreover, teturn the connection's ownership to conntrack upon teardown
|
||||
by clearing the offload flag and fixing the established timeout value.
|
||||
The flow table GC thread will asynchonrnously free the flow table and
|
||||
hardware offload entries.
|
||||
|
||||
Before this patch, the IPS_OFFLOAD_BIT remained set for expired flows on
|
||||
which is also misleading since the flow is back to classic conntrack
|
||||
path.
|
||||
|
||||
If nf_ct_delete() removes the entry from the conntrack table, then it
|
||||
calls nf_ct_put() which decrements the refcnt. This is not a problem
|
||||
because the flowtable holds a reference to the conntrack object from
|
||||
flow_offload_alloc() path which is released via flow_offload_free().
|
||||
|
||||
This patch also updates nft_flow_offload to skip packets in SYN_RECV
|
||||
state. Since we might miss or bump packets to slow path, we do not know
|
||||
what will happen there while we are still in SYN_RECV, this patch
|
||||
postpones offload up to the next packet which also aligns to the
|
||||
existing behaviour in tc-ct.
|
||||
|
||||
flow_offload_teardown() does not reset the existing tcp state from
|
||||
flow_offload_fixup_tcp() to ESTABLISHED anymore, packets bump to slow
|
||||
path might have already update the state to CLOSE/FIN.
|
||||
|
||||
Joint work with Oz and Sven.
|
||||
|
||||
Fixes: 1e5b2471bcc4 ("netfilter: nf_flow_table: teardown flow timeout race")
|
||||
Signed-off-by: Oz Shlomo <ozsh@nvidia.com>
|
||||
Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>
|
||||
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
Signed-off-by: Sasha Levin <sashal@kernel.org>
|
||||
---
|
||||
net/netfilter/nf_flow_table_core.c | 33 +++++++-----------------------
|
||||
net/netfilter/nft_flow_offload.c | 3 ++-
|
||||
2 files changed, 9 insertions(+), 27 deletions(-)
|
||||
|
||||
--- a/net/netfilter/nf_flow_table_core.c
|
||||
+++ b/net/netfilter/nf_flow_table_core.c
|
||||
@@ -173,12 +173,11 @@ EXPORT_SYMBOL_GPL(flow_offload_route_ini
|
||||
|
||||
static void flow_offload_fixup_tcp(struct ip_ct_tcp *tcp)
|
||||
{
|
||||
- tcp->state = TCP_CONNTRACK_ESTABLISHED;
|
||||
tcp->seen[0].td_maxwin = 0;
|
||||
tcp->seen[1].td_maxwin = 0;
|
||||
}
|
||||
|
||||
-static void flow_offload_fixup_ct_timeout(struct nf_conn *ct)
|
||||
+static void flow_offload_fixup_ct(struct nf_conn *ct)
|
||||
{
|
||||
struct net *net = nf_ct_net(ct);
|
||||
int l4num = nf_ct_protonum(ct);
|
||||
@@ -187,7 +186,9 @@ static void flow_offload_fixup_ct_timeou
|
||||
if (l4num == IPPROTO_TCP) {
|
||||
struct nf_tcp_net *tn = nf_tcp_pernet(net);
|
||||
|
||||
- timeout = tn->timeouts[TCP_CONNTRACK_ESTABLISHED];
|
||||
+ flow_offload_fixup_tcp(&ct->proto.tcp);
|
||||
+
|
||||
+ timeout = tn->timeouts[ct->proto.tcp.state];
|
||||
timeout -= tn->offload_timeout;
|
||||
} else if (l4num == IPPROTO_UDP) {
|
||||
struct nf_udp_net *tn = nf_udp_pernet(net);
|
||||
@@ -205,18 +206,6 @@ static void flow_offload_fixup_ct_timeou
|
||||
WRITE_ONCE(ct->timeout, nfct_time_stamp + timeout);
|
||||
}
|
||||
|
||||
-static void flow_offload_fixup_ct_state(struct nf_conn *ct)
|
||||
-{
|
||||
- if (nf_ct_protonum(ct) == IPPROTO_TCP)
|
||||
- flow_offload_fixup_tcp(&ct->proto.tcp);
|
||||
-}
|
||||
-
|
||||
-static void flow_offload_fixup_ct(struct nf_conn *ct)
|
||||
-{
|
||||
- flow_offload_fixup_ct_state(ct);
|
||||
- flow_offload_fixup_ct_timeout(ct);
|
||||
-}
|
||||
-
|
||||
static void flow_offload_route_release(struct flow_offload *flow)
|
||||
{
|
||||
nft_flow_dst_release(flow, FLOW_OFFLOAD_DIR_ORIGINAL);
|
||||
@@ -353,22 +342,14 @@ static void flow_offload_del(struct nf_f
|
||||
rhashtable_remove_fast(&flow_table->rhashtable,
|
||||
&flow->tuplehash[FLOW_OFFLOAD_DIR_REPLY].node,
|
||||
nf_flow_offload_rhash_params);
|
||||
-
|
||||
- clear_bit(IPS_OFFLOAD_BIT, &flow->ct->status);
|
||||
-
|
||||
- if (nf_flow_has_expired(flow))
|
||||
- flow_offload_fixup_ct(flow->ct);
|
||||
- else
|
||||
- flow_offload_fixup_ct_timeout(flow->ct);
|
||||
-
|
||||
flow_offload_free(flow);
|
||||
}
|
||||
|
||||
void flow_offload_teardown(struct flow_offload *flow)
|
||||
{
|
||||
+ clear_bit(IPS_OFFLOAD_BIT, &flow->ct->status);
|
||||
set_bit(NF_FLOW_TEARDOWN, &flow->flags);
|
||||
-
|
||||
- flow_offload_fixup_ct_state(flow->ct);
|
||||
+ flow_offload_fixup_ct(flow->ct);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(flow_offload_teardown);
|
||||
|
||||
@@ -437,7 +418,7 @@ static void nf_flow_offload_gc_step(stru
|
||||
|
||||
if (nf_flow_has_expired(flow) ||
|
||||
nf_ct_is_dying(flow->ct))
|
||||
- set_bit(NF_FLOW_TEARDOWN, &flow->flags);
|
||||
+ flow_offload_teardown(flow);
|
||||
|
||||
if (test_bit(NF_FLOW_TEARDOWN, &flow->flags)) {
|
||||
if (test_bit(NF_FLOW_HW, &flow->flags)) {
|
||||
--- a/net/netfilter/nft_flow_offload.c
|
||||
+++ b/net/netfilter/nft_flow_offload.c
|
||||
@@ -268,6 +268,12 @@ static bool nft_flow_offload_skip(struct
|
||||
return false;
|
||||
}
|
||||
|
||||
+static bool nf_conntrack_tcp_established(const struct nf_conn *ct)
|
||||
+{
|
||||
+ return ct->proto.tcp.state == TCP_CONNTRACK_ESTABLISHED &&
|
||||
+ test_bit(IPS_ASSURED_BIT, &ct->status);
|
||||
+}
|
||||
+
|
||||
static void nft_flow_offload_eval(const struct nft_expr *expr,
|
||||
struct nft_regs *regs,
|
||||
const struct nft_pktinfo *pkt)
|
||||
@@ -293,7 +299,8 @@ static void nft_flow_offload_eval(const
|
||||
case IPPROTO_TCP:
|
||||
tcph = skb_header_pointer(pkt->skb, pkt->xt.thoff,
|
||||
sizeof(_tcph), &_tcph);
|
||||
- if (unlikely(!tcph || tcph->fin || tcph->rst))
|
||||
+ if (unlikely(!tcph || tcph->fin || tcph->rst ||
|
||||
+ !nf_conntrack_tcp_established(ct)))
|
||||
goto out;
|
||||
break;
|
||||
case IPPROTO_UDP:
|
@ -0,0 +1,711 @@
|
||||
From 97c95dbbba64dbd6e98e033e396695f328033966 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robert.marko@sartura.hr>
|
||||
Date: Thu, 21 Jan 2021 14:44:33 +0100
|
||||
Subject: [PATCH 1/4] hwmon: add Texas Instruments TPS23861 driver
|
||||
|
||||
Add basic monitoring support as well as port on/off control for Texas
|
||||
Instruments TPS23861 PoE PSE IC.
|
||||
|
||||
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
|
||||
Cc: Luka Perkov <luka.perkov@sartura.hr>
|
||||
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
|
||||
Link: https://lore.kernel.org/r/20210121134434.2782405-2-robert.marko@sartura.hr
|
||||
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
|
||||
---
|
||||
Documentation/hwmon/index.rst | 1 +
|
||||
Documentation/hwmon/tps23861.rst | 41 +++
|
||||
drivers/hwmon/Kconfig | 11 +
|
||||
drivers/hwmon/Makefile | 1 +
|
||||
drivers/hwmon/tps23861.c | 601 +++++++++++++++++++++++++++++++
|
||||
5 files changed, 655 insertions(+)
|
||||
create mode 100644 Documentation/hwmon/tps23861.rst
|
||||
create mode 100644 drivers/hwmon/tps23861.c
|
||||
|
||||
--- a/Documentation/hwmon/index.rst
|
||||
+++ b/Documentation/hwmon/index.rst
|
||||
@@ -172,6 +172,7 @@ Hardware Monitoring Kernel Drivers
|
||||
tmp401
|
||||
tmp421
|
||||
tmp513
|
||||
+ tps23861
|
||||
tps40422
|
||||
tps53679
|
||||
twl4030-madc-hwmon
|
||||
--- /dev/null
|
||||
+++ b/Documentation/hwmon/tps23861.rst
|
||||
@@ -0,0 +1,41 @@
|
||||
+.. SPDX-License-Identifier: GPL-2.0-only
|
||||
+
|
||||
+Kernel driver tps23861
|
||||
+======================
|
||||
+
|
||||
+Supported chips:
|
||||
+ * Texas Instruments TPS23861
|
||||
+
|
||||
+ Prefix: 'tps23861'
|
||||
+
|
||||
+ Datasheet: https://www.ti.com/lit/gpn/tps23861
|
||||
+
|
||||
+Author: Robert Marko <robert.marko@sartura.hr>
|
||||
+
|
||||
+Description
|
||||
+-----------
|
||||
+
|
||||
+This driver supports hardware monitoring for Texas Instruments TPS23861 PoE PSE.
|
||||
+
|
||||
+TPS23861 is a quad port IEEE802.3at PSE controller with optional I2C control
|
||||
+and monitoring capabilities.
|
||||
+
|
||||
+TPS23861 offers three modes of operation: Auto, Semi-Auto and Manual.
|
||||
+
|
||||
+This driver only supports the Auto mode of operation providing monitoring
|
||||
+as well as enabling/disabling the four ports.
|
||||
+
|
||||
+Sysfs entries
|
||||
+-------------
|
||||
+
|
||||
+======================= =====================================================================
|
||||
+in[0-3]_input Voltage on ports [1-4]
|
||||
+in[0-3]_label "Port[1-4]"
|
||||
+in4_input IC input voltage
|
||||
+in4_label "Input"
|
||||
+temp1_input IC die temperature
|
||||
+temp1_label "Die"
|
||||
+curr[1-4]_input Current on ports [1-4]
|
||||
+in[1-4]_label "Port[1-4]"
|
||||
+in[0-3]_enable Enable/disable ports [1-4]
|
||||
+======================= =====================================================================
|
||||
--- a/drivers/hwmon/Kconfig
|
||||
+++ b/drivers/hwmon/Kconfig
|
||||
@@ -1102,6 +1102,17 @@ config SENSORS_TC654
|
||||
This driver can also be built as a module. If so, the module
|
||||
will be called tc654.
|
||||
|
||||
+config SENSORS_TPS23861
|
||||
+ tristate "Texas Instruments TPS23861 PoE PSE"
|
||||
+ depends on I2C
|
||||
+ select REGMAP_I2C
|
||||
+ help
|
||||
+ If you say yes here you get support for Texas Instruments
|
||||
+ TPS23861 802.3at PoE PSE chips.
|
||||
+
|
||||
+ This driver can also be built as a module. If so, the module
|
||||
+ will be called tps23861.
|
||||
+
|
||||
config SENSORS_MENF21BMC_HWMON
|
||||
tristate "MEN 14F021P00 BMC Hardware Monitoring"
|
||||
depends on MFD_MENF21BMC
|
||||
--- a/drivers/hwmon/Makefile
|
||||
+++ b/drivers/hwmon/Makefile
|
||||
@@ -141,6 +141,7 @@ obj-$(CONFIG_SENSORS_MAX31790) += max317
|
||||
obj-$(CONFIG_SENSORS_MC13783_ADC)+= mc13783-adc.o
|
||||
obj-$(CONFIG_SENSORS_MCP3021) += mcp3021.o
|
||||
obj-$(CONFIG_SENSORS_TC654) += tc654.o
|
||||
+obj-$(CONFIG_SENSORS_TPS23861) += tps23861.o
|
||||
obj-$(CONFIG_SENSORS_MLXREG_FAN) += mlxreg-fan.o
|
||||
obj-$(CONFIG_SENSORS_MENF21BMC_HWMON) += menf21bmc_hwmon.o
|
||||
obj-$(CONFIG_SENSORS_MR75203) += mr75203.o
|
||||
--- /dev/null
|
||||
+++ b/drivers/hwmon/tps23861.c
|
||||
@@ -0,0 +1,601 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-only
|
||||
+/*
|
||||
+ * Copyright (c) 2020 Sartura Ltd.
|
||||
+ *
|
||||
+ * Driver for the TI TPS23861 PoE PSE.
|
||||
+ *
|
||||
+ * Author: Robert Marko <robert.marko@sartura.hr>
|
||||
+ */
|
||||
+
|
||||
+#include <linux/bitfield.h>
|
||||
+#include <linux/debugfs.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/hwmon-sysfs.h>
|
||||
+#include <linux/hwmon.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/of_device.h>
|
||||
+#include <linux/regmap.h>
|
||||
+
|
||||
+#define TEMPERATURE 0x2c
|
||||
+#define INPUT_VOLTAGE_LSB 0x2e
|
||||
+#define INPUT_VOLTAGE_MSB 0x2f
|
||||
+#define PORT_1_CURRENT_LSB 0x30
|
||||
+#define PORT_1_CURRENT_MSB 0x31
|
||||
+#define PORT_1_VOLTAGE_LSB 0x32
|
||||
+#define PORT_1_VOLTAGE_MSB 0x33
|
||||
+#define PORT_2_CURRENT_LSB 0x34
|
||||
+#define PORT_2_CURRENT_MSB 0x35
|
||||
+#define PORT_2_VOLTAGE_LSB 0x36
|
||||
+#define PORT_2_VOLTAGE_MSB 0x37
|
||||
+#define PORT_3_CURRENT_LSB 0x38
|
||||
+#define PORT_3_CURRENT_MSB 0x39
|
||||
+#define PORT_3_VOLTAGE_LSB 0x3a
|
||||
+#define PORT_3_VOLTAGE_MSB 0x3b
|
||||
+#define PORT_4_CURRENT_LSB 0x3c
|
||||
+#define PORT_4_CURRENT_MSB 0x3d
|
||||
+#define PORT_4_VOLTAGE_LSB 0x3e
|
||||
+#define PORT_4_VOLTAGE_MSB 0x3f
|
||||
+#define PORT_N_CURRENT_LSB_OFFSET 0x04
|
||||
+#define PORT_N_VOLTAGE_LSB_OFFSET 0x04
|
||||
+#define VOLTAGE_CURRENT_MASK GENMASK(13, 0)
|
||||
+#define PORT_1_RESISTANCE_LSB 0x60
|
||||
+#define PORT_1_RESISTANCE_MSB 0x61
|
||||
+#define PORT_2_RESISTANCE_LSB 0x62
|
||||
+#define PORT_2_RESISTANCE_MSB 0x63
|
||||
+#define PORT_3_RESISTANCE_LSB 0x64
|
||||
+#define PORT_3_RESISTANCE_MSB 0x65
|
||||
+#define PORT_4_RESISTANCE_LSB 0x66
|
||||
+#define PORT_4_RESISTANCE_MSB 0x67
|
||||
+#define PORT_N_RESISTANCE_LSB_OFFSET 0x02
|
||||
+#define PORT_RESISTANCE_MASK GENMASK(13, 0)
|
||||
+#define PORT_RESISTANCE_RSN_MASK GENMASK(15, 14)
|
||||
+#define PORT_RESISTANCE_RSN_OTHER 0
|
||||
+#define PORT_RESISTANCE_RSN_LOW 1
|
||||
+#define PORT_RESISTANCE_RSN_OPEN 2
|
||||
+#define PORT_RESISTANCE_RSN_SHORT 3
|
||||
+#define PORT_1_STATUS 0x0c
|
||||
+#define PORT_2_STATUS 0x0d
|
||||
+#define PORT_3_STATUS 0x0e
|
||||
+#define PORT_4_STATUS 0x0f
|
||||
+#define PORT_STATUS_CLASS_MASK GENMASK(7, 4)
|
||||
+#define PORT_STATUS_DETECT_MASK GENMASK(3, 0)
|
||||
+#define PORT_CLASS_UNKNOWN 0
|
||||
+#define PORT_CLASS_1 1
|
||||
+#define PORT_CLASS_2 2
|
||||
+#define PORT_CLASS_3 3
|
||||
+#define PORT_CLASS_4 4
|
||||
+#define PORT_CLASS_RESERVED 5
|
||||
+#define PORT_CLASS_0 6
|
||||
+#define PORT_CLASS_OVERCURRENT 7
|
||||
+#define PORT_CLASS_MISMATCH 8
|
||||
+#define PORT_DETECT_UNKNOWN 0
|
||||
+#define PORT_DETECT_SHORT 1
|
||||
+#define PORT_DETECT_RESERVED 2
|
||||
+#define PORT_DETECT_RESISTANCE_LOW 3
|
||||
+#define PORT_DETECT_RESISTANCE_OK 4
|
||||
+#define PORT_DETECT_RESISTANCE_HIGH 5
|
||||
+#define PORT_DETECT_OPEN_CIRCUIT 6
|
||||
+#define PORT_DETECT_RESERVED_2 7
|
||||
+#define PORT_DETECT_MOSFET_FAULT 8
|
||||
+#define PORT_DETECT_LEGACY 9
|
||||
+/* Measurment beyond clamp voltage */
|
||||
+#define PORT_DETECT_CAPACITANCE_INVALID_BEYOND 10
|
||||
+/* Insufficient voltage delta */
|
||||
+#define PORT_DETECT_CAPACITANCE_INVALID_DELTA 11
|
||||
+#define PORT_DETECT_CAPACITANCE_OUT_OF_RANGE 12
|
||||
+#define POE_PLUS 0x40
|
||||
+#define OPERATING_MODE 0x12
|
||||
+#define OPERATING_MODE_OFF 0
|
||||
+#define OPERATING_MODE_MANUAL 1
|
||||
+#define OPERATING_MODE_SEMI 2
|
||||
+#define OPERATING_MODE_AUTO 3
|
||||
+#define OPERATING_MODE_PORT_1_MASK GENMASK(1, 0)
|
||||
+#define OPERATING_MODE_PORT_2_MASK GENMASK(3, 2)
|
||||
+#define OPERATING_MODE_PORT_3_MASK GENMASK(5, 4)
|
||||
+#define OPERATING_MODE_PORT_4_MASK GENMASK(7, 6)
|
||||
+
|
||||
+#define DETECT_CLASS_RESTART 0x18
|
||||
+#define POWER_ENABLE 0x19
|
||||
+#define TPS23861_NUM_PORTS 4
|
||||
+
|
||||
+#define TEMPERATURE_LSB 652 /* 0.652 degrees Celsius */
|
||||
+#define VOLTAGE_LSB 3662 /* 3.662 mV */
|
||||
+#define SHUNT_RESISTOR_DEFAULT 255000 /* 255 mOhm */
|
||||
+#define CURRENT_LSB_255 62260 /* 62.260 uA */
|
||||
+#define CURRENT_LSB_250 61039 /* 61.039 uA */
|
||||
+#define RESISTANCE_LSB 110966 /* 11.0966 Ohm*/
|
||||
+#define RESISTANCE_LSB_LOW 157216 /* 15.7216 Ohm*/
|
||||
+
|
||||
+struct tps23861_data {
|
||||
+ struct regmap *regmap;
|
||||
+ u32 shunt_resistor;
|
||||
+ struct i2c_client *client;
|
||||
+ struct dentry *debugfs_dir;
|
||||
+};
|
||||
+
|
||||
+static struct regmap_config tps23861_regmap_config = {
|
||||
+ .reg_bits = 8,
|
||||
+ .val_bits = 8,
|
||||
+};
|
||||
+
|
||||
+static int tps23861_read_temp(struct tps23861_data *data, long *val)
|
||||
+{
|
||||
+ unsigned int regval;
|
||||
+ int err;
|
||||
+
|
||||
+ err = regmap_read(data->regmap, TEMPERATURE, ®val);
|
||||
+ if (err < 0)
|
||||
+ return err;
|
||||
+
|
||||
+ *val = (regval * TEMPERATURE_LSB) - 20000;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int tps23861_read_voltage(struct tps23861_data *data, int channel,
|
||||
+ long *val)
|
||||
+{
|
||||
+ unsigned int regval;
|
||||
+ int err;
|
||||
+
|
||||
+ if (channel < TPS23861_NUM_PORTS) {
|
||||
+ err = regmap_bulk_read(data->regmap,
|
||||
+ PORT_1_VOLTAGE_LSB + channel * PORT_N_VOLTAGE_LSB_OFFSET,
|
||||
+ ®val, 2);
|
||||
+ } else {
|
||||
+ err = regmap_bulk_read(data->regmap,
|
||||
+ INPUT_VOLTAGE_LSB,
|
||||
+ ®val, 2);
|
||||
+ }
|
||||
+ if (err < 0)
|
||||
+ return err;
|
||||
+
|
||||
+ *val = (FIELD_GET(VOLTAGE_CURRENT_MASK, regval) * VOLTAGE_LSB) / 1000;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int tps23861_read_current(struct tps23861_data *data, int channel,
|
||||
+ long *val)
|
||||
+{
|
||||
+ unsigned int current_lsb;
|
||||
+ unsigned int regval;
|
||||
+ int err;
|
||||
+
|
||||
+ if (data->shunt_resistor == SHUNT_RESISTOR_DEFAULT)
|
||||
+ current_lsb = CURRENT_LSB_255;
|
||||
+ else
|
||||
+ current_lsb = CURRENT_LSB_250;
|
||||
+
|
||||
+ err = regmap_bulk_read(data->regmap,
|
||||
+ PORT_1_CURRENT_LSB + channel * PORT_N_CURRENT_LSB_OFFSET,
|
||||
+ ®val, 2);
|
||||
+ if (err < 0)
|
||||
+ return err;
|
||||
+
|
||||
+ *val = (FIELD_GET(VOLTAGE_CURRENT_MASK, regval) * current_lsb) / 1000000;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int tps23861_port_disable(struct tps23861_data *data, int channel)
|
||||
+{
|
||||
+ unsigned int regval = 0;
|
||||
+ int err;
|
||||
+
|
||||
+ regval |= BIT(channel + 4);
|
||||
+ err = regmap_write(data->regmap, POWER_ENABLE, regval);
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static int tps23861_port_enable(struct tps23861_data *data, int channel)
|
||||
+{
|
||||
+ unsigned int regval = 0;
|
||||
+ int err;
|
||||
+
|
||||
+ regval |= BIT(channel);
|
||||
+ regval |= BIT(channel + 4);
|
||||
+ err = regmap_write(data->regmap, DETECT_CLASS_RESTART, regval);
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static umode_t tps23861_is_visible(const void *data, enum hwmon_sensor_types type,
|
||||
+ u32 attr, int channel)
|
||||
+{
|
||||
+ switch (type) {
|
||||
+ case hwmon_temp:
|
||||
+ switch (attr) {
|
||||
+ case hwmon_temp_input:
|
||||
+ case hwmon_temp_label:
|
||||
+ return 0444;
|
||||
+ default:
|
||||
+ return 0;
|
||||
+ }
|
||||
+ case hwmon_in:
|
||||
+ switch (attr) {
|
||||
+ case hwmon_in_input:
|
||||
+ case hwmon_in_label:
|
||||
+ return 0444;
|
||||
+ case hwmon_in_enable:
|
||||
+ return 0200;
|
||||
+ default:
|
||||
+ return 0;
|
||||
+ }
|
||||
+ case hwmon_curr:
|
||||
+ switch (attr) {
|
||||
+ case hwmon_curr_input:
|
||||
+ case hwmon_curr_label:
|
||||
+ return 0444;
|
||||
+ default:
|
||||
+ return 0;
|
||||
+ }
|
||||
+ default:
|
||||
+ return 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int tps23861_write(struct device *dev, enum hwmon_sensor_types type,
|
||||
+ u32 attr, int channel, long val)
|
||||
+{
|
||||
+ struct tps23861_data *data = dev_get_drvdata(dev);
|
||||
+ int err;
|
||||
+
|
||||
+ switch (type) {
|
||||
+ case hwmon_in:
|
||||
+ switch (attr) {
|
||||
+ case hwmon_in_enable:
|
||||
+ if (val == 0)
|
||||
+ err = tps23861_port_disable(data, channel);
|
||||
+ else if (val == 1)
|
||||
+ err = tps23861_port_enable(data, channel);
|
||||
+ else
|
||||
+ err = -EINVAL;
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static int tps23861_read(struct device *dev, enum hwmon_sensor_types type,
|
||||
+ u32 attr, int channel, long *val)
|
||||
+{
|
||||
+ struct tps23861_data *data = dev_get_drvdata(dev);
|
||||
+ int err;
|
||||
+
|
||||
+ switch (type) {
|
||||
+ case hwmon_temp:
|
||||
+ switch (attr) {
|
||||
+ case hwmon_temp_input:
|
||||
+ err = tps23861_read_temp(data, val);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ case hwmon_in:
|
||||
+ switch (attr) {
|
||||
+ case hwmon_in_input:
|
||||
+ err = tps23861_read_voltage(data, channel, val);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ case hwmon_curr:
|
||||
+ switch (attr) {
|
||||
+ case hwmon_curr_input:
|
||||
+ err = tps23861_read_current(data, channel, val);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static const char * const tps23861_port_label[] = {
|
||||
+ "Port1",
|
||||
+ "Port2",
|
||||
+ "Port3",
|
||||
+ "Port4",
|
||||
+ "Input",
|
||||
+};
|
||||
+
|
||||
+static int tps23861_read_string(struct device *dev,
|
||||
+ enum hwmon_sensor_types type,
|
||||
+ u32 attr, int channel, const char **str)
|
||||
+{
|
||||
+ switch (type) {
|
||||
+ case hwmon_in:
|
||||
+ case hwmon_curr:
|
||||
+ *str = tps23861_port_label[channel];
|
||||
+ break;
|
||||
+ case hwmon_temp:
|
||||
+ *str = "Die";
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct hwmon_channel_info *tps23861_info[] = {
|
||||
+ HWMON_CHANNEL_INFO(chip,
|
||||
+ HWMON_C_REGISTER_TZ),
|
||||
+ HWMON_CHANNEL_INFO(temp,
|
||||
+ HWMON_T_INPUT | HWMON_T_LABEL),
|
||||
+ HWMON_CHANNEL_INFO(in,
|
||||
+ HWMON_I_INPUT | HWMON_I_ENABLE | HWMON_I_LABEL,
|
||||
+ HWMON_I_INPUT | HWMON_I_ENABLE | HWMON_I_LABEL,
|
||||
+ HWMON_I_INPUT | HWMON_I_ENABLE | HWMON_I_LABEL,
|
||||
+ HWMON_I_INPUT | HWMON_I_ENABLE | HWMON_I_LABEL,
|
||||
+ HWMON_I_INPUT | HWMON_I_LABEL),
|
||||
+ HWMON_CHANNEL_INFO(curr,
|
||||
+ HWMON_C_INPUT | HWMON_C_LABEL,
|
||||
+ HWMON_C_INPUT | HWMON_C_LABEL,
|
||||
+ HWMON_C_INPUT | HWMON_C_LABEL,
|
||||
+ HWMON_C_INPUT | HWMON_C_LABEL),
|
||||
+ NULL
|
||||
+};
|
||||
+
|
||||
+static const struct hwmon_ops tps23861_hwmon_ops = {
|
||||
+ .is_visible = tps23861_is_visible,
|
||||
+ .write = tps23861_write,
|
||||
+ .read = tps23861_read,
|
||||
+ .read_string = tps23861_read_string,
|
||||
+};
|
||||
+
|
||||
+static const struct hwmon_chip_info tps23861_chip_info = {
|
||||
+ .ops = &tps23861_hwmon_ops,
|
||||
+ .info = tps23861_info,
|
||||
+};
|
||||
+
|
||||
+static char *tps23861_port_operating_mode(struct tps23861_data *data, int port)
|
||||
+{
|
||||
+ unsigned int regval;
|
||||
+ int mode;
|
||||
+
|
||||
+ regmap_read(data->regmap, OPERATING_MODE, ®val);
|
||||
+
|
||||
+ switch (port) {
|
||||
+ case 1:
|
||||
+ mode = FIELD_GET(OPERATING_MODE_PORT_1_MASK, regval);
|
||||
+ break;
|
||||
+ case 2:
|
||||
+ mode = FIELD_GET(OPERATING_MODE_PORT_2_MASK, regval);
|
||||
+ break;
|
||||
+ case 3:
|
||||
+ mode = FIELD_GET(OPERATING_MODE_PORT_3_MASK, regval);
|
||||
+ break;
|
||||
+ case 4:
|
||||
+ mode = FIELD_GET(OPERATING_MODE_PORT_4_MASK, regval);
|
||||
+ break;
|
||||
+ default:
|
||||
+ mode = -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ switch (mode) {
|
||||
+ case OPERATING_MODE_OFF:
|
||||
+ return "Off";
|
||||
+ case OPERATING_MODE_MANUAL:
|
||||
+ return "Manual";
|
||||
+ case OPERATING_MODE_SEMI:
|
||||
+ return "Semi-Auto";
|
||||
+ case OPERATING_MODE_AUTO:
|
||||
+ return "Auto";
|
||||
+ default:
|
||||
+ return "Invalid";
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static char *tps23861_port_detect_status(struct tps23861_data *data, int port)
|
||||
+{
|
||||
+ unsigned int regval;
|
||||
+
|
||||
+ regmap_read(data->regmap,
|
||||
+ PORT_1_STATUS + (port - 1),
|
||||
+ ®val);
|
||||
+
|
||||
+ switch (FIELD_GET(PORT_STATUS_DETECT_MASK, regval)) {
|
||||
+ case PORT_DETECT_UNKNOWN:
|
||||
+ return "Unknown device";
|
||||
+ case PORT_DETECT_SHORT:
|
||||
+ return "Short circuit";
|
||||
+ case PORT_DETECT_RESISTANCE_LOW:
|
||||
+ return "Too low resistance";
|
||||
+ case PORT_DETECT_RESISTANCE_OK:
|
||||
+ return "Valid resistance";
|
||||
+ case PORT_DETECT_RESISTANCE_HIGH:
|
||||
+ return "Too high resistance";
|
||||
+ case PORT_DETECT_OPEN_CIRCUIT:
|
||||
+ return "Open circuit";
|
||||
+ case PORT_DETECT_MOSFET_FAULT:
|
||||
+ return "MOSFET fault";
|
||||
+ case PORT_DETECT_LEGACY:
|
||||
+ return "Legacy device";
|
||||
+ case PORT_DETECT_CAPACITANCE_INVALID_BEYOND:
|
||||
+ return "Invalid capacitance, beyond clamp voltage";
|
||||
+ case PORT_DETECT_CAPACITANCE_INVALID_DELTA:
|
||||
+ return "Invalid capacitance, insufficient voltage delta";
|
||||
+ case PORT_DETECT_CAPACITANCE_OUT_OF_RANGE:
|
||||
+ return "Valid capacitance, outside of legacy range";
|
||||
+ case PORT_DETECT_RESERVED:
|
||||
+ case PORT_DETECT_RESERVED_2:
|
||||
+ default:
|
||||
+ return "Invalid";
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static char *tps23861_port_class_status(struct tps23861_data *data, int port)
|
||||
+{
|
||||
+ unsigned int regval;
|
||||
+
|
||||
+ regmap_read(data->regmap,
|
||||
+ PORT_1_STATUS + (port - 1),
|
||||
+ ®val);
|
||||
+
|
||||
+ switch (FIELD_GET(PORT_STATUS_CLASS_MASK, regval)) {
|
||||
+ case PORT_CLASS_UNKNOWN:
|
||||
+ return "Unknown";
|
||||
+ case PORT_CLASS_RESERVED:
|
||||
+ case PORT_CLASS_0:
|
||||
+ return "0";
|
||||
+ case PORT_CLASS_1:
|
||||
+ return "1";
|
||||
+ case PORT_CLASS_2:
|
||||
+ return "2";
|
||||
+ case PORT_CLASS_3:
|
||||
+ return "3";
|
||||
+ case PORT_CLASS_4:
|
||||
+ return "4";
|
||||
+ case PORT_CLASS_OVERCURRENT:
|
||||
+ return "Overcurrent";
|
||||
+ case PORT_CLASS_MISMATCH:
|
||||
+ return "Mismatch";
|
||||
+ default:
|
||||
+ return "Invalid";
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static char *tps23861_port_poe_plus_status(struct tps23861_data *data, int port)
|
||||
+{
|
||||
+ unsigned int regval;
|
||||
+
|
||||
+ regmap_read(data->regmap, POE_PLUS, ®val);
|
||||
+
|
||||
+ if (BIT(port + 3) & regval)
|
||||
+ return "Yes";
|
||||
+ else
|
||||
+ return "No";
|
||||
+}
|
||||
+
|
||||
+static int tps23861_port_resistance(struct tps23861_data *data, int port)
|
||||
+{
|
||||
+ u16 regval;
|
||||
+
|
||||
+ regmap_bulk_read(data->regmap,
|
||||
+ PORT_1_RESISTANCE_LSB + PORT_N_RESISTANCE_LSB_OFFSET * (port - 1),
|
||||
+ ®val,
|
||||
+ 2);
|
||||
+
|
||||
+ switch (FIELD_GET(PORT_RESISTANCE_RSN_MASK, regval)) {
|
||||
+ case PORT_RESISTANCE_RSN_OTHER:
|
||||
+ return (FIELD_GET(PORT_RESISTANCE_MASK, regval) * RESISTANCE_LSB) / 10000;
|
||||
+ case PORT_RESISTANCE_RSN_LOW:
|
||||
+ return (FIELD_GET(PORT_RESISTANCE_MASK, regval) * RESISTANCE_LSB_LOW) / 10000;
|
||||
+ case PORT_RESISTANCE_RSN_SHORT:
|
||||
+ case PORT_RESISTANCE_RSN_OPEN:
|
||||
+ default:
|
||||
+ return 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int tps23861_port_status_show(struct seq_file *s, void *data)
|
||||
+{
|
||||
+ struct tps23861_data *priv = s->private;
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 1; i < TPS23861_NUM_PORTS + 1; i++) {
|
||||
+ seq_printf(s, "Port: \t\t%d\n", i);
|
||||
+ seq_printf(s, "Operating mode: %s\n", tps23861_port_operating_mode(priv, i));
|
||||
+ seq_printf(s, "Detected: \t%s\n", tps23861_port_detect_status(priv, i));
|
||||
+ seq_printf(s, "Class: \t\t%s\n", tps23861_port_class_status(priv, i));
|
||||
+ seq_printf(s, "PoE Plus: \t%s\n", tps23861_port_poe_plus_status(priv, i));
|
||||
+ seq_printf(s, "Resistance: \t%d\n", tps23861_port_resistance(priv, i));
|
||||
+ seq_putc(s, '\n');
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+DEFINE_SHOW_ATTRIBUTE(tps23861_port_status);
|
||||
+
|
||||
+static void tps23861_init_debugfs(struct tps23861_data *data)
|
||||
+{
|
||||
+ data->debugfs_dir = debugfs_create_dir(data->client->name, NULL);
|
||||
+
|
||||
+ debugfs_create_file("port_status",
|
||||
+ 0400,
|
||||
+ data->debugfs_dir,
|
||||
+ data,
|
||||
+ &tps23861_port_status_fops);
|
||||
+}
|
||||
+
|
||||
+static int tps23861_probe(struct i2c_client *client)
|
||||
+{
|
||||
+ struct device *dev = &client->dev;
|
||||
+ struct tps23861_data *data;
|
||||
+ struct device *hwmon_dev;
|
||||
+ u32 shunt_resistor;
|
||||
+
|
||||
+ data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
|
||||
+ if (!data)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ data->client = client;
|
||||
+ i2c_set_clientdata(client, data);
|
||||
+
|
||||
+ data->regmap = devm_regmap_init_i2c(client, &tps23861_regmap_config);
|
||||
+ if (IS_ERR(data->regmap)) {
|
||||
+ dev_err(dev, "failed to allocate register map\n");
|
||||
+ return PTR_ERR(data->regmap);
|
||||
+ }
|
||||
+
|
||||
+ if (!of_property_read_u32(dev->of_node, "shunt-resistor-micro-ohms", &shunt_resistor))
|
||||
+ data->shunt_resistor = shunt_resistor;
|
||||
+ else
|
||||
+ data->shunt_resistor = SHUNT_RESISTOR_DEFAULT;
|
||||
+
|
||||
+ hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name,
|
||||
+ data, &tps23861_chip_info,
|
||||
+ NULL);
|
||||
+ if (IS_ERR(hwmon_dev))
|
||||
+ return PTR_ERR(hwmon_dev);
|
||||
+
|
||||
+ tps23861_init_debugfs(data);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int tps23861_remove(struct i2c_client *client)
|
||||
+{
|
||||
+ struct tps23861_data *data = i2c_get_clientdata(client);
|
||||
+
|
||||
+ debugfs_remove_recursive(data->debugfs_dir);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct of_device_id __maybe_unused tps23861_of_match[] = {
|
||||
+ { .compatible = "ti,tps23861", },
|
||||
+ { },
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, tps23861_of_match);
|
||||
+
|
||||
+static struct i2c_driver tps23861_driver = {
|
||||
+ .probe_new = tps23861_probe,
|
||||
+ .remove = tps23861_remove,
|
||||
+ .driver = {
|
||||
+ .name = "tps23861",
|
||||
+ .of_match_table = of_match_ptr(tps23861_of_match),
|
||||
+ },
|
||||
+};
|
||||
+module_i2c_driver(tps23861_driver);
|
||||
+
|
||||
+MODULE_LICENSE("GPL");
|
||||
+MODULE_AUTHOR("Robert Marko <robert.marko@sartura.hr>");
|
||||
+MODULE_DESCRIPTION("TI TPS23861 PoE PSE");
|
@ -0,0 +1,29 @@
|
||||
From 3d61a7b3a714eb3ef1777e3c576576aca2b85365 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robert.marko@sartura.hr>
|
||||
Date: Thu, 10 Jun 2021 00:07:26 +0200
|
||||
Subject: [PATCH 2/4] hwmon: (tps23861) define regmap max register
|
||||
|
||||
Define the max register address the device supports.
|
||||
This allows reading the whole register space via
|
||||
regmap debugfs, without it only register 0x0 is visible.
|
||||
|
||||
This was forgotten in the original driver commit.
|
||||
|
||||
Fixes: fff7b8ab2255 ("hwmon: add Texas Instruments TPS23861 driver")
|
||||
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
|
||||
Link: https://lore.kernel.org/r/20210609220728.499879-1-robert.marko@sartura.hr
|
||||
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
|
||||
---
|
||||
drivers/hwmon/tps23861.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/drivers/hwmon/tps23861.c
|
||||
+++ b/drivers/hwmon/tps23861.c
|
||||
@@ -117,6 +117,7 @@ struct tps23861_data {
|
||||
static struct regmap_config tps23861_regmap_config = {
|
||||
.reg_bits = 8,
|
||||
.val_bits = 8,
|
||||
+ .max_register = 0x6f,
|
||||
};
|
||||
|
||||
static int tps23861_read_temp(struct tps23861_data *data, long *val)
|
@ -0,0 +1,57 @@
|
||||
From 9bca598d4a86e88afb29fdb516c68b2519bd0fb9 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robert.marko@sartura.hr>
|
||||
Date: Thu, 10 Jun 2021 00:07:27 +0200
|
||||
Subject: [PATCH 3/4] hwmon: (tps23861) set current shunt value
|
||||
|
||||
TPS23861 has a configuration bit for setting of the
|
||||
current shunt value used on the board.
|
||||
Its bit 0 of the General Mask 1 register.
|
||||
|
||||
According to the datasheet bit values are:
|
||||
0 for 255 mOhm (Default)
|
||||
1 for 250 mOhm
|
||||
|
||||
So, configure the bit before registering the hwmon
|
||||
device according to the value passed in the DTS or
|
||||
default one if none is passed.
|
||||
|
||||
This caused potentially reading slightly skewed values
|
||||
due to max current value being 1.02A when 250mOhm shunt
|
||||
is used instead of 1.0A when 255mOhm is used.
|
||||
|
||||
Fixes: fff7b8ab2255 ("hwmon: add Texas Instruments TPS23861 driver")
|
||||
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
|
||||
Link: https://lore.kernel.org/r/20210609220728.499879-2-robert.marko@sartura.hr
|
||||
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
|
||||
---
|
||||
drivers/hwmon/tps23861.c | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
--- a/drivers/hwmon/tps23861.c
|
||||
+++ b/drivers/hwmon/tps23861.c
|
||||
@@ -99,6 +99,9 @@
|
||||
#define POWER_ENABLE 0x19
|
||||
#define TPS23861_NUM_PORTS 4
|
||||
|
||||
+#define TPS23861_GENERAL_MASK_1 0x17
|
||||
+#define TPS23861_CURRENT_SHUNT_MASK BIT(0)
|
||||
+
|
||||
#define TEMPERATURE_LSB 652 /* 0.652 degrees Celsius */
|
||||
#define VOLTAGE_LSB 3662 /* 3.662 mV */
|
||||
#define SHUNT_RESISTOR_DEFAULT 255000 /* 255 mOhm */
|
||||
@@ -561,6 +564,15 @@ static int tps23861_probe(struct i2c_cli
|
||||
else
|
||||
data->shunt_resistor = SHUNT_RESISTOR_DEFAULT;
|
||||
|
||||
+ if (data->shunt_resistor == SHUNT_RESISTOR_DEFAULT)
|
||||
+ regmap_clear_bits(data->regmap,
|
||||
+ TPS23861_GENERAL_MASK_1,
|
||||
+ TPS23861_CURRENT_SHUNT_MASK);
|
||||
+ else
|
||||
+ regmap_set_bits(data->regmap,
|
||||
+ TPS23861_GENERAL_MASK_1,
|
||||
+ TPS23861_CURRENT_SHUNT_MASK);
|
||||
+
|
||||
hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name,
|
||||
data, &tps23861_chip_info,
|
||||
NULL);
|
@ -0,0 +1,34 @@
|
||||
From b447e689a26614ce08a431e8000e8a650a63dcb3 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robert.marko@sartura.hr>
|
||||
Date: Thu, 10 Jun 2021 00:07:28 +0200
|
||||
Subject: [PATCH 4/4] hwmon: (tps23861) correct shunt LSB values
|
||||
|
||||
Current shunt LSB values got reversed during in the
|
||||
original driver commit.
|
||||
|
||||
So, correct the current shunt LSB values according to
|
||||
the datasheet.
|
||||
|
||||
This caused reading slightly skewed current values.
|
||||
|
||||
Fixes: fff7b8ab2255 ("hwmon: add Texas Instruments TPS23861 driver")
|
||||
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
|
||||
Link: https://lore.kernel.org/r/20210609220728.499879-3-robert.marko@sartura.hr
|
||||
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
|
||||
---
|
||||
drivers/hwmon/tps23861.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/hwmon/tps23861.c
|
||||
+++ b/drivers/hwmon/tps23861.c
|
||||
@@ -105,8 +105,8 @@
|
||||
#define TEMPERATURE_LSB 652 /* 0.652 degrees Celsius */
|
||||
#define VOLTAGE_LSB 3662 /* 3.662 mV */
|
||||
#define SHUNT_RESISTOR_DEFAULT 255000 /* 255 mOhm */
|
||||
-#define CURRENT_LSB_255 62260 /* 62.260 uA */
|
||||
-#define CURRENT_LSB_250 61039 /* 61.039 uA */
|
||||
+#define CURRENT_LSB_250 62260 /* 62.260 uA */
|
||||
+#define CURRENT_LSB_255 61039 /* 61.039 uA */
|
||||
#define RESISTANCE_LSB 110966 /* 11.0966 Ohm*/
|
||||
#define RESISTANCE_LSB_LOW 157216 /* 15.7216 Ohm*/
|
||||
|
@ -0,0 +1,66 @@
|
||||
From 0eabb1396656f215a5333a9444158b17b0fd3247 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
||||
Date: Wed, 20 Jul 2022 22:22:55 -0500
|
||||
Subject: hwmon: (tps23861) fix byte order in current and voltage registers
|
||||
|
||||
Trying to use this driver on a big-endian machine results in garbage
|
||||
values for voltage and current. The tps23861 registers are little-
|
||||
endian, and regmap_read_bulk() does not do byte order conversion. Thus
|
||||
on BE machines, the most significant bytes got modified, and were
|
||||
trimmed by the VOLTAGE_CURRENT_MASK.
|
||||
|
||||
To resolve this use uint16_t values, and convert them to host byte
|
||||
order using le16_to_cpu(). This results in correct readings on MIPS.
|
||||
|
||||
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
||||
Link: https://lore.kernel.org/r/20220721032255.2850647-1-mr.nuke.me@gmail.com
|
||||
[groeck: Use __le16 instead of uint16_t]
|
||||
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
|
||||
---
|
||||
drivers/hwmon/tps23861.c | 14 +++++++++-----
|
||||
1 file changed, 9 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/hwmon/tps23861.c
|
||||
+++ b/drivers/hwmon/tps23861.c
|
||||
@@ -140,7 +140,8 @@ static int tps23861_read_temp(struct tps
|
||||
static int tps23861_read_voltage(struct tps23861_data *data, int channel,
|
||||
long *val)
|
||||
{
|
||||
- unsigned int regval;
|
||||
+ __le16 regval;
|
||||
+ long raw_val;
|
||||
int err;
|
||||
|
||||
if (channel < TPS23861_NUM_PORTS) {
|
||||
@@ -155,7 +156,8 @@ static int tps23861_read_voltage(struct
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
- *val = (FIELD_GET(VOLTAGE_CURRENT_MASK, regval) * VOLTAGE_LSB) / 1000;
|
||||
+ raw_val = le16_to_cpu(regval);
|
||||
+ *val = (FIELD_GET(VOLTAGE_CURRENT_MASK, raw_val) * VOLTAGE_LSB) / 1000;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -163,8 +165,9 @@ static int tps23861_read_voltage(struct
|
||||
static int tps23861_read_current(struct tps23861_data *data, int channel,
|
||||
long *val)
|
||||
{
|
||||
- unsigned int current_lsb;
|
||||
- unsigned int regval;
|
||||
+ long raw_val, current_lsb;
|
||||
+ __le16 regval;
|
||||
+
|
||||
int err;
|
||||
|
||||
if (data->shunt_resistor == SHUNT_RESISTOR_DEFAULT)
|
||||
@@ -178,7 +181,8 @@ static int tps23861_read_current(struct
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
- *val = (FIELD_GET(VOLTAGE_CURRENT_MASK, regval) * current_lsb) / 1000000;
|
||||
+ raw_val = le16_to_cpu(regval);
|
||||
+ *val = (FIELD_GET(VOLTAGE_CURRENT_MASK, raw_val) * current_lsb) / 1000000;
|
||||
|
||||
return 0;
|
||||
}
|
@ -2082,7 +2082,7 @@ CONFIG_GENERIC_VDSO_TIME_NS=y
|
||||
# CONFIG_GP2AP002 is not set
|
||||
# CONFIG_GP2AP020A00F is not set
|
||||
# CONFIG_GPD_POCKET_FAN is not set
|
||||
# CONFIG_GPIOLIB is not set
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_FASTPATH_LIMIT=512
|
||||
# CONFIG_GPIO_104_DIO_48E is not set
|
||||
# CONFIG_GPIO_104_IDIO_16 is not set
|
||||
@ -3466,7 +3466,6 @@ CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY=y
|
||||
# CONFIG_MMC_ARMMMCI is not set
|
||||
# CONFIG_MMC_AU1X is not set
|
||||
# CONFIG_MMC_BLOCK is not set
|
||||
CONFIG_MMC_BLOCK_BOUNCE=y
|
||||
CONFIG_MMC_BLOCK_MINORS=8
|
||||
# CONFIG_MMC_CAVIUM_THUNDERX is not set
|
||||
# CONFIG_MMC_CB710 is not set
|
||||
@ -4155,10 +4154,7 @@ CONFIG_NF_CONNTRACK_PROCFS=y
|
||||
# CONFIG_NF_NAT_AMANDA is not set
|
||||
# CONFIG_NF_NAT_FTP is not set
|
||||
# CONFIG_NF_NAT_H323 is not set
|
||||
# CONFIG_NF_NAT_IPV6 is not set
|
||||
# CONFIG_NF_NAT_IRC is not set
|
||||
CONFIG_NF_NAT_MASQUERADE_IPV4=y
|
||||
CONFIG_NF_NAT_MASQUERADE_IPV6=y
|
||||
# CONFIG_NF_NAT_NEEDED is not set
|
||||
# CONFIG_NF_NAT_PPTP is not set
|
||||
# CONFIG_NF_NAT_PROTO_GRE is not set
|
||||
@ -5329,6 +5325,7 @@ CONFIG_SELECT_MEMORY_MODEL=y
|
||||
# CONFIG_SENSORS_TMP401 is not set
|
||||
# CONFIG_SENSORS_TMP421 is not set
|
||||
# CONFIG_SENSORS_TMP513 is not set
|
||||
# CONFIG_SENSORS_TPS23861 is not set
|
||||
# CONFIG_SENSORS_TPS40422 is not set
|
||||
# CONFIG_SENSORS_TPS53679 is not set
|
||||
# CONFIG_SENSORS_TSL2550 is not set
|
||||
|
@ -2159,7 +2159,7 @@ CONFIG_GENERIC_VDSO_TIME_NS=y
|
||||
# CONFIG_GP2AP002 is not set
|
||||
# CONFIG_GP2AP020A00F is not set
|
||||
# CONFIG_GPD_POCKET_FAN is not set
|
||||
# CONFIG_GPIOLIB is not set
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_FASTPATH_LIMIT=512
|
||||
# CONFIG_GPIO_104_DIO_48E is not set
|
||||
# CONFIG_GPIO_104_IDIO_16 is not set
|
||||
@ -2775,6 +2775,7 @@ CONFIG_INPUT_MISC=y
|
||||
# CONFIG_IOMMU_SUPPORT is not set
|
||||
# CONFIG_IONIC is not set
|
||||
# CONFIG_IOSCHED_BFQ is not set
|
||||
# CONFIG_IOSM is not set
|
||||
CONFIG_IO_STRICT_DEVMEM=y
|
||||
# CONFIG_IO_URING is not set
|
||||
CONFIG_IO_WQ=y
|
||||
@ -3598,7 +3599,6 @@ CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY=y
|
||||
# CONFIG_MMC_ARMMMCI is not set
|
||||
# CONFIG_MMC_AU1X is not set
|
||||
# CONFIG_MMC_BLOCK is not set
|
||||
CONFIG_MMC_BLOCK_BOUNCE=y
|
||||
CONFIG_MMC_BLOCK_MINORS=8
|
||||
# CONFIG_MMC_CAVIUM_THUNDERX is not set
|
||||
# CONFIG_MMC_CB710 is not set
|
||||
@ -4314,10 +4314,7 @@ CONFIG_NF_CONNTRACK_PROCFS=y
|
||||
# CONFIG_NF_NAT_AMANDA is not set
|
||||
# CONFIG_NF_NAT_FTP is not set
|
||||
# CONFIG_NF_NAT_H323 is not set
|
||||
# CONFIG_NF_NAT_IPV6 is not set
|
||||
# CONFIG_NF_NAT_IRC is not set
|
||||
CONFIG_NF_NAT_MASQUERADE_IPV4=y
|
||||
CONFIG_NF_NAT_MASQUERADE_IPV6=y
|
||||
# CONFIG_NF_NAT_NEEDED is not set
|
||||
# CONFIG_NF_NAT_PPTP is not set
|
||||
# CONFIG_NF_NAT_PROTO_GRE is not set
|
||||
@ -5080,6 +5077,7 @@ CONFIG_RFKILL=y
|
||||
# CONFIG_RPCSEC_GSS_KRB5 is not set
|
||||
# CONFIG_RPMSG_QCOM_GLINK_RPM is not set
|
||||
# CONFIG_RPMSG_VIRTIO is not set
|
||||
# CONFIG_RPMSG_WWAN_CTRL is not set
|
||||
# CONFIG_RPR0521 is not set
|
||||
# CONFIG_RSEQ is not set
|
||||
# CONFIG_RT2X00 is not set
|
||||
|
@ -821,7 +821,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
#include <net/netfilter/nf_flow_table.h>
|
||||
#include <net/netfilter/nf_conntrack.h>
|
||||
#include <net/netfilter/nf_conntrack_core.h>
|
||||
@@ -401,8 +400,7 @@ flow_offload_lookup(struct nf_flowtable
|
||||
@@ -380,8 +379,7 @@ flow_offload_lookup(struct nf_flowtable
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(flow_offload_lookup);
|
||||
|
||||
@ -831,7 +831,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
void (*iter)(struct flow_offload *flow, void *data),
|
||||
void *data)
|
||||
{
|
||||
@@ -434,6 +432,7 @@ nf_flow_table_iterate(struct nf_flowtabl
|
||||
@@ -413,6 +411,7 @@ nf_flow_table_iterate(struct nf_flowtabl
|
||||
|
||||
return err;
|
||||
}
|
||||
@ -861,7 +861,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+#endif /* _XT_FLOWOFFLOAD_H */
|
||||
--- a/include/net/netfilter/nf_flow_table.h
|
||||
+++ b/include/net/netfilter/nf_flow_table.h
|
||||
@@ -270,6 +270,10 @@ void nf_flow_table_free(struct nf_flowta
|
||||
@@ -271,6 +271,10 @@ void nf_flow_table_free(struct nf_flowta
|
||||
|
||||
void flow_offload_teardown(struct flow_offload *flow);
|
||||
|
||||
|
@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
static bool enable_hooks __read_mostly;
|
||||
MODULE_PARM_DESC(enable_hooks, "Always enable conntrack hooks");
|
||||
module_param(enable_hooks, bool, 0000);
|
||||
@@ -660,6 +663,7 @@ enum nf_ct_sysctl_index {
|
||||
@@ -658,6 +661,7 @@ enum nf_ct_sysctl_index {
|
||||
NF_SYSCTL_CT_PROTO_TIMEOUT_GRE_STREAM,
|
||||
#endif
|
||||
|
||||
@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
__NF_SYSCTL_CT_LAST_SYSCTL,
|
||||
};
|
||||
|
||||
@@ -1014,6 +1018,13 @@ static struct ctl_table nf_ct_sysctl_tab
|
||||
@@ -1000,6 +1004,13 @@ static struct ctl_table nf_ct_sysctl_tab
|
||||
.proc_handler = proc_dointvec_jiffies,
|
||||
},
|
||||
#endif
|
||||
|
@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/netfilter/nf_flow_table_core.c
|
||||
+++ b/net/netfilter/nf_flow_table_core.c
|
||||
@@ -331,8 +331,10 @@ void flow_offload_refresh(struct nf_flow
|
||||
@@ -318,8 +318,10 @@ void flow_offload_refresh(struct nf_flow
|
||||
u32 timeout;
|
||||
|
||||
timeout = nf_flowtable_time_stamp + flow_offload_get_timeout(flow);
|
||||
|
@ -199,7 +199,6 @@ CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GENERIC_VDSO_32=y
|
||||
# CONFIG_GIANFAR is not set
|
||||
CONFIG_GLOB=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_MXC=y
|
||||
|
@ -178,7 +178,6 @@ CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GENERIC_VDSO_32=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_74X164=y
|
||||
CONFIG_GPIO_WATCHDOG=y
|
||||
|
@ -182,7 +182,6 @@ CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GENERIC_VDSO_32=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_74X164=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
|
@ -167,7 +167,6 @@ CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GENERIC_VDSO_32=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GRO_CELLS=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
|
@ -171,7 +171,6 @@ CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GENERIC_VDSO_32=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
CONFIG_GRO_CELLS=y
|
||||
|
@ -115,7 +115,6 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GLOB=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_MVEBU=y
|
||||
CONFIG_GRO_CELLS=y
|
||||
|
@ -114,7 +114,6 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GLOB=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
CONFIG_GPIO_MVEBU=y
|
||||
|
@ -72,7 +72,6 @@ CONFIG_GENERIC_PHY=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_MM_LANTIQ=y
|
||||
CONFIG_GPIO_STP_XWAY=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
|
@ -252,7 +252,6 @@ CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GENERIC_VDSO_32=y
|
||||
CONFIG_GIANFAR=y
|
||||
CONFIG_GLOB=y
|
||||
CONFIG_GPIOLIB=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_GENERIC_PLATFORM=y
|
||||
CONFIG_GPIO_MPC8XXX=y
|
||||
@ -306,7 +305,6 @@ CONFIG_IMX_SDMA=y
|
||||
# CONFIG_IMX_WEIM is not set
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
CONFIG_INPUT=y
|
||||
# CONFIG_INPUT_MISC is not set
|
||||
# CONFIG_IOMMU_DEBUGFS is not set
|
||||
# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set
|
||||
# CONFIG_IOMMU_IO_PGTABLE_LPAE is not set
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user