diff --git a/config/Config-devel.in b/config/Config-devel.in index a068f694e5..87f9157106 100644 --- a/config/Config-devel.in +++ b/config/Config-devel.in @@ -76,6 +76,7 @@ menuconfig DEVEL config KERNEL_CFLAGS string "Kernel extra CFLAGS" if DEVEL + default "-falign-functions=32" if TARGET_bcm53xx default "" config EXTERNAL_KERNEL_TREE diff --git a/include/kernel-5.15 b/include/kernel-5.15 index 298602d595..1319666eb8 100644 --- a/include/kernel-5.15 +++ b/include/kernel-5.15 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.15 = .49 -LINUX_KERNEL_HASH-5.15.49 = 32497893ba47f4ad32a59fa4254e8c25e41bc821798e3b2f2443822fa00059dc +LINUX_VERSION-5.15 = .50 +LINUX_KERNEL_HASH-5.15.50 = 554d507d37a23810fe8c83912761e4a4f73c40794bc685ff7ca98042fe1bd70f diff --git a/include/toolchain-build.mk b/include/toolchain-build.mk index b7a253b71b..87ba8313df 100644 --- a/include/toolchain-build.mk +++ b/include/toolchain-build.mk @@ -18,6 +18,6 @@ define FixupLibdir mkdir -p $(1)/lib; \ mv $(1)/lib64/* $(1)/lib/; \ rm -rf $(1)/lib64; \ + ln -sf lib $(1)/lib64; \ fi - ln -sf lib $(1)/lib64 endef diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index eebc08d65d..2034749832 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -31,6 +31,9 @@ ampedwireless,ally-00x19k|\ ampedwireless,ally-r1900k) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4" ;; +beeline,smartbox-giga) + ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000" + ;; buffalo,wsr-1166dhp|\ buffalo,wsr-600dhp|\ mediatek,linkit-smart-7688|\ diff --git a/package/devel/strace/Makefile b/package/devel/strace/Makefile index 8f66ffbe47..d95fd41c33 100644 --- a/package/devel/strace/Makefile +++ b/package/devel/strace/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=strace -PKG_VERSION:=5.16 +PKG_VERSION:=5.18 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION) -PKG_HASH:=dc7db230ff3e57c249830ba94acab2b862da1fcaac55417e9b85041a833ca285 +PKG_HASH:=60293ea79ac9253d600cdc9be077ad2988ca22284a439c9e66be5150db3d1187 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=LGPL-2.1-or-later diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index d0cb102f3a..a23f2e8e0b 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -373,7 +373,7 @@ define KernelPackage/switch-rtl8366rb DEPENDS:=+kmod-switch-rtl8366-smi KCONFIG:=CONFIG_RTL8366RB_PHY FILES:=$(LINUX_DIR)/drivers/net/phy/rtl8366rb.ko - AUTOLOAD:=$(call AutoLoad,43,rtl8366rb) + AUTOLOAD:=$(call AutoLoad,43,rtl8366rb,1) endef define KernelPackage/switch-rtl8366rb/description @@ -389,7 +389,7 @@ define KernelPackage/switch-rtl8366s DEPENDS:=+kmod-switch-rtl8366-smi KCONFIG:=CONFIG_RTL8366S_PHY FILES:=$(LINUX_DIR)/drivers/net/phy/rtl8366s.ko - AUTOLOAD:=$(call AutoLoad,43,rtl8366s) + AUTOLOAD:=$(call AutoLoad,43,rtl8366s,1) endef define KernelPackage/switch-rtl8366s/description @@ -399,6 +399,22 @@ endef $(eval $(call KernelPackage,switch-rtl8366s)) +define KernelPackage/switch-rtl8367 + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Realtek RTL8367 switch support + DEPENDS:=+kmod-switch-rtl8366-smi + KCONFIG:=CONFIG_RTL8367_PHY + FILES:=$(LINUX_DIR)/drivers/net/phy/rtl8367.ko + AUTOLOAD:=$(call AutoLoad,43,rtl8367,1) +endef + +define KernelPackage/switch-rtl8367/description + Realtek RTL8367 switch support +endef + +$(eval $(call KernelPackage,switch-rtl8367)) + + define KernelPackage/switch-rtl8367b SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=Realtek RTL8367R/B switch support diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index e51208aaba..3917f48f05 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -252,7 +252,7 @@ endef define KernelPackage/mac80211-hwsim $(call KernelPackage/mac80211/Default) TITLE:=mac80211 HW simulation device - DEPENDS+= +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT + DEPENDS+= +kmod-mac80211 +@DRIVER_11AX_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko AUTOLOAD:=$(call AutoProbe,mac80211_hwsim) endef diff --git a/package/kernel/mac80211/intel.mk b/package/kernel/mac80211/intel.mk index 8bab727a41..a915f94bf9 100644 --- a/package/kernel/mac80211/intel.mk +++ b/package/kernel/mac80211/intel.mk @@ -15,7 +15,7 @@ config-$(call config_package,ipw2200) += IPW2200 define KernelPackage/iwlwifi $(call KernelPackage/mac80211/Default) - DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT + DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11AX_SUPPORT TITLE:=Intel AGN Wireless support FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlwifi/iwlwifi.ko \ diff --git a/package/kernel/mac80211/patches/subsys/338-mac80211-fix-queue-selection-for-mesh-OCB-interfaces.patch b/package/kernel/mac80211/patches/subsys/338-mac80211-fix-queue-selection-for-mesh-OCB-interfaces.patch new file mode 100644 index 0000000000..9547db03d1 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/338-mac80211-fix-queue-selection-for-mesh-OCB-interfaces.patch @@ -0,0 +1,28 @@ +From: Felix Fietkau +Date: Sat, 2 Jul 2022 16:41:32 +0200 +Subject: [PATCH] mac80211: fix queue selection for mesh/OCB interfaces + +When using iTXQ, the code assumes that there is only one vif queue for +broadcast packets, using the BE queue. Allowing non-BE queue marking +violates that assumption and txq->ac == skb_queue_mapping is no longer +guaranteed. This can cause issues with queue handling in the driver and +also causes issues with the recent ATF change, resulting in an AQL +underflow warning. + +Cc: stable@vger.kernel.org +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/wme.c ++++ b/net/mac80211/wme.c +@@ -147,8 +147,8 @@ u16 __ieee80211_select_queue(struct ieee + bool qos; + + /* all mesh/ocb stations are required to support WME */ +- if (sdata->vif.type == NL80211_IFTYPE_MESH_POINT || +- sdata->vif.type == NL80211_IFTYPE_OCB) ++ if (sta && (sdata->vif.type == NL80211_IFTYPE_MESH_POINT || ++ sdata->vif.type == NL80211_IFTYPE_OCB)) + qos = true; + else if (sta) + qos = sta->sta.wme; diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 13d744bce9..354449b810 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2022-06-24 -PKG_SOURCE_VERSION:=b6e865e2cc7080c91ec34a9dd3648d25f7ce04c6 -PKG_MIRROR_HASH:=4d311e55431400266a1d58534ea22421b080670f937df3d9ad1fb9a9d0362bda +PKG_SOURCE_DATE:=2022-07-03 +PKG_SOURCE_VERSION:=93e3fce916c62d06892d41bf00d0f4c2926c9a0b +PKG_MIRROR_HASH:=ad966e7aa81301f0601ceb7aae2ecb471c452f5d8366f701add807152fd08971 PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0 diff --git a/package/libs/libiconv-full/Makefile b/package/libs/libiconv-full/Makefile index e4f925a1ae..2f052aa3ed 100644 --- a/package/libs/libiconv-full/Makefile +++ b/package/libs/libiconv-full/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libiconv-full -PKG_VERSION:=1.16 +PKG_VERSION:=1.17 PKG_RELEASE:=1 PKG_SOURCE:=libiconv-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@GNU/libiconv -PKG_HASH:=e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04 +PKG_HASH:=8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313 PKG_BUILD_DIR:=$(BUILD_DIR)/libiconv-$(PKG_VERSION) PKG_MAINTAINER:=Jo-Philipp Wich diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile index 0f13883a3b..2b90c27a4a 100644 --- a/package/libs/libjson-c/Makefile +++ b/package/libs/libjson-c/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=json-c -PKG_VERSION:=0.15 -PKG_RELEASE:=2 +PKG_VERSION:=0.16 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-nodoc.tar.gz PKG_SOURCE_URL:=https://s3.amazonaws.com/json-c_releases/releases/ -PKG_HASH:=99bca4f944b8ced8ae0bbc6310d6a3528ca715e69541793a1ef51f8c5b4b0878 +PKG_HASH:=ac8a3dd6820daaca579b23fbc74664310fbc3d67f52f6707cda67d21dde5570f PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=MIT diff --git a/package/libs/libjson-c/patches/001-dont-build-docs.patch b/package/libs/libjson-c/patches/001-dont-build-docs.patch index 1aa0da4f59..f35da80724 100644 --- a/package/libs/libjson-c/patches/001-dont-build-docs.patch +++ b/package/libs/libjson-c/patches/001-dont-build-docs.patch @@ -1,11 +1,11 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -401,8 +401,6 @@ set(JSON_C_SOURCES +@@ -433,8 +433,6 @@ configure_file(json.h.cmakein ${PROJECT_ include_directories(${PROJECT_SOURCE_DIR}) include_directories(${PROJECT_BINARY_DIR}) -add_subdirectory(doc) - - # uninstall - add_custom_target(uninstall - COMMAND cat ${PROJECT_BINARY_DIR}/install_manifest.txt | xargs rm + # "uninstall" custom target for make generators in unix like operating systems + # and if that target is not present + if (CMAKE_GENERATOR STREQUAL "Unix Makefiles") diff --git a/package/libs/libjson-c/patches/010-clang.patch b/package/libs/libjson-c/patches/010-clang.patch deleted file mode 100644 index 9ef73f1a82..0000000000 --- a/package/libs/libjson-c/patches/010-clang.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -265,7 +265,7 @@ message(STATUS "Wrote ${PROJECT_BINARY_D - configure_file(${PROJECT_SOURCE_DIR}/cmake/json_config.h.in ${PROJECT_BINARY_DIR}/json_config.h) - message(STATUS "Wrote ${PROJECT_BINARY_DIR}/json_config.h") - --if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") -+if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections") - if ("${DISABLE_WERROR}" STREQUAL "OFF") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") diff --git a/package/libs/libnl/Makefile b/package/libs/libnl/Makefile index db0c65c7a7..b6eae82651 100644 --- a/package/libs/libnl/Makefile +++ b/package/libs/libnl/Makefile @@ -1,20 +1,20 @@ +# SPDX-License-Identifier: GPL-2.0-only # # Copyright (C) 2006-2013 OpenWrt.org # -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# include $(TOPDIR)/rules.mk PKG_NAME:=libnl -PKG_VERSION:=3.5.0 +PKG_VERSION:=3.6.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl$(subst .,_,$(PKG_VERSION)) -PKG_HASH:=352133ec9545da76f77e70ccb48c9d7e5324d67f6474744647a7ed382b5e05fa +PKG_HASH:=532155fd011e5a805bd67121b87a01c757e2bb24112ac17e69cb86013b970009 + PKG_LICENSE:=LGPL-2.1 +PKG_LICENSE_FILES:=COPYING PKG_INSTALL:=1 PKG_FIXUP:=autoreconf diff --git a/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch b/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch deleted file mode 100644 index cec720b8e8..0000000000 --- a/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch +++ /dev/null @@ -1,25 +0,0 @@ -From db0d59cd06f3ffd350379847c0885e1bfb85af0f Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Sat, 7 Mar 2015 11:34:42 +0100 -Subject: [PATCH 2/2] build: add Libs.private field in libnl pkg-config file - -In order to support static linking, the libnl pkg-config file should -indicate in its Libs.private field the libraries that libnl-3.0.a -requires. The LIBS variable contains the appropriate list of -libraries: -lm in all cases, and -lpthread when pthread support is -enabled. This allows to statically link applications against libnl -properly. - -Signed-off-by: Thomas Petazzoni ---- - libnl-3.0.pc.in | 1 + - 1 file changed, 1 insertion(+) - ---- a/libnl-3.0.pc.in -+++ b/libnl-3.0.pc.in -@@ -7,4 +7,5 @@ Name: libnl - Description: Convenience library for netlink sockets - Version: @PACKAGE_VERSION@ - Libs: -L${libdir} -lnl-@MAJ_VERSION@ -+Libs.private: @LIBS@ - Cflags: -I${includedir}/libnl@MAJ_VERSION@ diff --git a/package/libs/nettle/Makefile b/package/libs/nettle/Makefile index 87853baa82..0c06205ec2 100644 --- a/package/libs/nettle/Makefile +++ b/package/libs/nettle/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nettle -PKG_VERSION:=3.7.3 +PKG_VERSION:=3.8 PKG_RELEASE:=$(AUTORELEASE) PKG_USE_MIPS16:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@GNU/nettle -PKG_HASH:=661f5eb03f048a3b924c3a8ad2515d4068e40f67e774e8a26827658007e3bcf0 +PKG_HASH:=7576c68481c198f644b08c160d1a4850ba9449e308069455b5213319f234e8e6 PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=COPYING diff --git a/package/libs/nettle/patches/100-portability.patch b/package/libs/nettle/patches/100-portability.patch index 5bbae22752..b4677ec020 100644 --- a/package/libs/nettle/patches/100-portability.patch +++ b/package/libs/nettle/patches/100-portability.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -4661,6 +4661,7 @@ $as_echo_n "checking build system compil +@@ -4704,6 +4704,7 @@ $as_echo_n "checking build system compil # remove anything that might look like compiler output to our "||" expression rm -f conftest* a.out b.out a.exe a_out.exe cat >conftest.c <conftest.c <conftest.c <conftest.c < PKG_LICENSE:=BSD-3-Clause @@ -58,8 +58,8 @@ ifeq ($(BUILD_VARIANT),mini) endif define Package/tcpdump/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tcpdump $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tcpdump $(1)/usr/bin/ endef Package/tcpdump-mini/install = $(Package/tcpdump/install) diff --git a/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch b/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch index 3da979dd35..e79de526a1 100644 --- a/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch +++ b/package/network/utils/tcpdump/patches/001-remove_pcap_debug.patch @@ -1,8 +1,8 @@ --- a/configure +++ b/configure -@@ -6183,97 +6183,6 @@ $as_echo "no" >&6; } - fi - fi +@@ -6230,97 +6230,6 @@ fi + + -# -# Check for special debugging functions diff --git a/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch b/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch index 17477d2799..ad7c3feb4e 100644 --- a/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch +++ b/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch @@ -1,13 +1,14 @@ --- a/Makefile.in +++ b/Makefile.in -@@ -72,6 +72,80 @@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@ +@@ -73,6 +73,85 @@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@ - CSRC = setsignal.c tcpdump.c + CSRC = fptype.c tcpdump.c +ifdef TCPDUMP_MINI + +LIBNETDISSECT_SRC=\ + netdissect.c \ ++ netdissect-alloc.c \ + addrtoname.c \ + addrtostr.c \ + af.c \ @@ -15,17 +16,18 @@ + checksum.c \ + cpack.c \ + gmpls.c \ -+ gmt2local.c \ + in_cksum.c \ + ipproto.c \ + l2vpn.c \ + machdep.c \ ++ ntp.c \ + nlpid.c \ + oui.c \ + parsenfsfh.c \ + print.c \ + print-802_11.c \ + print-aodv.c \ ++ print-arista.c \ + print-arp.c \ + print-ascii.c \ + print-bootp.c \ @@ -39,6 +41,7 @@ + print-icmp.c \ + print-icmp6.c \ + print-igmp.c \ ++ print-ip-demux.c \ + print-ip.c \ + print-ip6.c \ + print-ip6opts.c \ @@ -47,6 +50,7 @@ + print-llc.c \ + print-lldp.c \ + print-loopback.c \ ++ print-macsec.c \ + print-nfs.c \ + print-ntp.c \ + print-null.c \ @@ -72,6 +76,7 @@ + print-telnet.c \ + print-tftp.c \ + print-udp.c \ ++ print-unsupported.c \ + signature.c \ + strtoaddr.c \ + util-print.c @@ -81,19 +86,19 @@ LIBNETDISSECT_SRC=\ addrtoname.c \ addrtostr.c \ -@@ -237,6 +311,8 @@ LIBNETDISSECT_SRC=\ +@@ -252,6 +331,8 @@ LIBNETDISSECT_SRC=\ strtoaddr.c \ util-print.c +endif + LOCALSRC = @LOCALSRC@ - GENSRC = version.c LIBOBJS = @LIBOBJS@ + --- a/addrtoname.c +++ b/addrtoname.c -@@ -578,8 +578,10 @@ linkaddr_string(netdissect_options *ndo, - if (type == LINKADDR_ETHER && len == ETHER_ADDR_LEN) +@@ -683,8 +683,10 @@ linkaddr_string(netdissect_options *ndo, + if (type == LINKADDR_ETHER && len == MAC_ADDR_LEN) return (etheraddr_string(ndo, ep)); +#ifndef TCPDUMP_MINI @@ -103,7 +108,7 @@ tp = lookup_bytestring(ndo, ep, len); if (tp->bs_name) -@@ -1214,6 +1216,7 @@ init_addrtoname(netdissect_options *ndo, +@@ -1263,6 +1265,7 @@ init_addrtoname(netdissect_options *ndo, init_ipxsaparray(ndo); } @@ -111,7 +116,7 @@ const char * dnaddr_string(netdissect_options *ndo, u_short dnaddr) { -@@ -1230,6 +1233,7 @@ dnaddr_string(netdissect_options *ndo, u +@@ -1279,6 +1282,7 @@ dnaddr_string(netdissect_options *ndo, u return(tp->name); } @@ -119,138 +124,45 @@ /* Return a zero'ed hnamemem struct and cuts down on calloc() overhead */ struct hnamemem * ---- a/print.c -+++ b/print.c -@@ -48,6 +48,7 @@ static const struct printer printers[] = - #ifdef DLT_IPNET - { ipnet_if_print, DLT_IPNET }, - #endif -+#ifndef TCPDUMP_MINI - #ifdef DLT_IEEE802_15_4 - { ieee802_15_4_if_print, DLT_IEEE802_15_4 }, - #endif -@@ -57,12 +58,14 @@ static const struct printer printers[] = - #ifdef DLT_PPI - { ppi_if_print, DLT_PPI }, - #endif -+#endif - #ifdef DLT_NETANALYZER - { netanalyzer_if_print, DLT_NETANALYZER }, - #endif - #ifdef DLT_NETANALYZER_TRANSPARENT - { netanalyzer_transparent_if_print, DLT_NETANALYZER_TRANSPARENT }, - #endif -+#ifndef TCPDUMP_MINI - #if defined(DLT_NFLOG) && defined(HAVE_PCAP_NFLOG_H) - { nflog_if_print, DLT_NFLOG}, - #endif -@@ -75,10 +78,12 @@ static const struct printer printers[] = - #ifdef DLT_IP_OVER_FC - { ipfc_if_print, DLT_IP_OVER_FC }, - #endif -+#endif - { null_if_print, DLT_NULL }, - #ifdef DLT_LOOP - { null_if_print, DLT_LOOP }, - #endif -+#ifndef TCPDUMP_MINI - #ifdef DLT_APPLE_IP_OVER_IEEE1394 - { ap1394_if_print, DLT_APPLE_IP_OVER_IEEE1394 }, - #endif -@@ -92,7 +97,9 @@ static const struct printer printers[] = - #ifdef DLT_ARCNET_LINUX - { arcnet_linux_if_print, DLT_ARCNET_LINUX }, - #endif -+#endif - { raw_if_print, DLT_RAW }, -+#ifndef TCPDUMP_MINI - #ifdef DLT_IPV4 - { raw_if_print, DLT_IPV4 }, - #endif -@@ -116,17 +123,21 @@ static const struct printer printers[] = - #ifdef DLT_HDLC - { chdlc_if_print, DLT_HDLC }, - #endif -+#endif - #ifdef DLT_PPP_ETHER - { pppoe_if_print, DLT_PPP_ETHER }, - #endif -+#ifndef TCPDUMP_MINI - #if defined(DLT_PFLOG) && defined(HAVE_NET_IF_PFLOG_H) - { pflog_if_print, DLT_PFLOG }, - #endif - { token_if_print, DLT_IEEE802 }, - { fddi_if_print, DLT_FDDI }, -+#endif - #ifdef DLT_LINUX_SLL - { sll_if_print, DLT_LINUX_SLL }, - #endif -+#ifndef TCPDUMP_MINI - #ifdef DLT_FR - { fr_if_print, DLT_FR }, - #endif -@@ -198,6 +209,7 @@ static const struct printer printers[] = - #ifdef DLT_PKTAP - { pktap_if_print, DLT_PKTAP }, - #endif -+#endif - #ifdef DLT_IEEE802_11_RADIO - { ieee802_11_radio_if_print, DLT_IEEE802_11_RADIO }, - #endif -@@ -214,12 +226,14 @@ static const struct printer printers[] = - #ifdef DLT_PPP_WITHDIRECTION - { ppp_if_print, DLT_PPP_WITHDIRECTION }, - #endif -+#ifndef TCPDUMP_MINI - #ifdef DLT_PPP_BSDOS - { ppp_bsdos_if_print, DLT_PPP_BSDOS }, - #endif - #ifdef DLT_PPP_SERIAL - { ppp_hdlc_if_print, DLT_PPP_SERIAL }, - #endif -+#endif - { NULL, 0 }, - }; - --- a/print-ether.c +++ b/print-ether.c -@@ -342,6 +342,7 @@ ethertype_print(netdissect_options *ndo, - arp_print(ndo, p, length, caplen); +@@ -539,6 +539,7 @@ ethertype_print(netdissect_options *ndo, + arp_print(ndo, p, length, caplen); return (1); +#ifndef TCPDUMP_MINI case ETHERTYPE_DN: decnet_print(ndo, p, length, caplen); return (1); -@@ -368,6 +369,7 @@ ethertype_print(netdissect_options *ndo, - } +@@ -569,6 +570,7 @@ ethertype_print(netdissect_options *ndo, + ND_TCHECK_LEN(p, 1); isoclns_print(ndo, p + 1, length - 1); return(1); +#endif case ETHERTYPE_PPPOED: case ETHERTYPE_PPPOES: -@@ -380,9 +382,11 @@ ethertype_print(netdissect_options *ndo, - eap_print(ndo, p, length); +@@ -581,9 +583,11 @@ ethertype_print(netdissect_options *ndo, + eapol_print(ndo, p); return (1); +#ifndef TCPDUMP_MINI case ETHERTYPE_RRCP: - rrcp_print(ndo, p, length, src, dst); + rrcp_print(ndo, p, length, src, dst); return (1); +#endif case ETHERTYPE_PPP: if (length) { -@@ -391,6 +395,7 @@ ethertype_print(netdissect_options *ndo, +@@ -592,6 +596,7 @@ ethertype_print(netdissect_options *ndo, } return (1); +#ifndef TCPDUMP_MINI case ETHERTYPE_MPCP: - mpcp_print(ndo, p, length); + mpcp_print(ndo, p, length); return (1); -@@ -403,6 +408,7 @@ ethertype_print(netdissect_options *ndo, +@@ -604,19 +609,23 @@ ethertype_print(netdissect_options *ndo, case ETHERTYPE_CFM_OLD: cfm_print(ndo, p, length); return (1); @@ -258,17 +170,25 @@ case ETHERTYPE_LLDP: lldp_print(ndo, p, length); -@@ -412,6 +418,7 @@ ethertype_print(netdissect_options *ndo, + return (1); + ++#ifndef TCPDUMP_MINI + case ETHERTYPE_NSH: + nsh_print(ndo, p, length); + return (1); ++#endif + + case ETHERTYPE_LOOPBACK: loopback_print(ndo, p, length); - return (1); + return (1); +#ifndef TCPDUMP_MINI case ETHERTYPE_MPLS: case ETHERTYPE_MPLS_MULTI: mpls_print(ndo, p, length); -@@ -441,6 +448,7 @@ ethertype_print(netdissect_options *ndo, - case ETHERTYPE_MEDSA: - medsa_print(ndo, p, length, caplen, src, dst); +@@ -646,6 +655,7 @@ ethertype_print(netdissect_options *ndo, + case ETHERTYPE_PTP: + ptp_print(ndo, p, length); return (1); +#endif @@ -276,7 +196,7 @@ case ETHERTYPE_SCA: --- a/print-gre.c +++ b/print-gre.c -@@ -216,6 +216,7 @@ gre_print_0(netdissect_options *ndo, con +@@ -207,6 +207,7 @@ gre_print_0(netdissect_options *ndo, con case ETHERTYPE_IPV6: ip6_print(ndo, bp, len); break; @@ -284,104 +204,63 @@ case ETHERTYPE_MPLS: mpls_print(ndo, bp, len); break; -@@ -231,6 +232,7 @@ gre_print_0(netdissect_options *ndo, con - case ETHERTYPE_TEB: - ether_print(ndo, bp, len, ndo->ndo_snapend - bp, NULL, NULL); +@@ -219,6 +220,7 @@ gre_print_0(netdissect_options *ndo, con + case ETHERTYPE_GRE_ISO: + isoclns_print(ndo, bp, len); break; +#endif - default: - ND_PRINT((ndo, "gre-proto-0x%x", prot)); - } + case ETHERTYPE_TEB: + ether_print(ndo, bp, len, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL); + break; +--- a/print-icmp6.c ++++ b/print-icmp6.c +@@ -1384,7 +1384,7 @@ get_upperlayer(netdissect_options *ndo, + nh = GET_U_1(fragh->ip6f_nxt); + hlen = sizeof(struct ip6_frag); + break; +- ++#ifndef TCPDUMP_MINI + case IPPROTO_AH: + ah = (const struct ah *)bp; + if (!ND_TTEST_1(ah->ah_len)) +@@ -1392,7 +1392,7 @@ get_upperlayer(netdissect_options *ndo, + nh = GET_U_1(ah->ah_nxt); + hlen = (GET_U_1(ah->ah_len) + 2) << 2; + break; +- ++#endif + default: /* unknown or undecodable header */ + *prot = nh; /* meaningless, but set here anyway */ + return(NULL); --- a/print-igmp.c +++ b/print-igmp.c -@@ -306,6 +306,7 @@ igmp_print(netdissect_options *ndo, - ND_TCHECK2(bp[4], 4); - ND_PRINT((ndo, "igmp leave %s", ipaddr_string(ndo, &bp[4]))); +@@ -269,6 +269,7 @@ igmp_print(netdissect_options *ndo, + case 0x17: + ND_PRINT("igmp leave %s", GET_IPADDR_STRING(bp + 4)); break; +#ifndef TCPDUMP_MINI case 0x13: - ND_PRINT((ndo, "igmp dvmrp")); + ND_PRINT("igmp dvmrp"); if (len < 8) -@@ -317,6 +318,7 @@ igmp_print(netdissect_options *ndo, - ND_PRINT((ndo, "igmp pimv1")); +@@ -280,6 +281,7 @@ igmp_print(netdissect_options *ndo, + ND_PRINT("igmp pimv1"); pimv1_print(ndo, bp, len); break; +#endif case 0x1e: - print_mresp(ndo, bp, len); + print_mtrace(ndo, "mresp", bp, len); break; ---- a/print-ip6.c -+++ b/print-ip6.c -@@ -305,6 +305,7 @@ ip6_print(netdissect_options *ndo, const - return; - nh = *cp; - break; -+#ifndef TCPDUMP_MINI - case IPPROTO_FRAGMENT: - advance = frag6_print(ndo, cp, (const u_char *)ip6); - if (advance < 0 || ndo->ndo_snapend <= cp + advance) -@@ -328,6 +329,7 @@ ip6_print(netdissect_options *ndo, const - return; - nh = *cp; - return; -+#endif - case IPPROTO_ROUTING: - ND_TCHECK(*cp); - advance = rt6_print(ndo, cp, (const u_char *)ip6); -@@ -335,12 +337,14 @@ ip6_print(netdissect_options *ndo, const - return; - nh = *cp; - break; -+#ifndef TCPDUMP_MINI - case IPPROTO_SCTP: - sctp_print(ndo, cp, (const u_char *)ip6, len); - return; - case IPPROTO_DCCP: - dccp_print(ndo, cp, (const u_char *)ip6, len); - return; -+#endif - case IPPROTO_TCP: - tcp_print(ndo, cp, len, (const u_char *)ip6, fragmented); - return; -@@ -350,6 +354,7 @@ ip6_print(netdissect_options *ndo, const - case IPPROTO_ICMPV6: - icmp6_print(ndo, cp, len, (const u_char *)ip6, fragmented); - return; -+#ifndef TCPDUMP_MINI - case IPPROTO_AH: - advance = ah_print(ndo, cp); - if (advance < 0) -@@ -382,6 +387,7 @@ ip6_print(netdissect_options *ndo, const - case IPPROTO_PIM: - pim_print(ndo, cp, len, (const u_char *)ip6); - return; -+#endif - - case IPPROTO_OSPF: - ospf6_print(ndo, cp, len); -@@ -395,9 +401,11 @@ ip6_print(netdissect_options *ndo, const - ip_print(ndo, cp, len); - return; - -+#ifndef TCPDUMP_MINI - case IPPROTO_PGM: - pgm_print(ndo, cp, len, (const u_char *)ip6); - return; -+#endif - - case IPPROTO_GRE: - gre_print(ndo, cp, len); ---- a/print-ip.c -+++ b/print-ip.c -@@ -344,6 +344,7 @@ ip_print_demux(netdissect_options *ndo, +--- a/print-ip-demux.c ++++ b/print-ip-demux.c +@@ -48,6 +48,7 @@ ip_demux_print(netdissect_options *ndo, again: - switch (ipds->nh) { + switch (nh) { +#ifndef TCPDUMP_MINI case IPPROTO_AH: - if (!ND_TTEST(*ipds->cp)) { - ND_PRINT((ndo, "[|AH]")); -@@ -382,7 +383,9 @@ again: + if (!ND_TTEST_1(bp)) { + ndo->ndo_protocol = "ah"; +@@ -85,7 +86,9 @@ again: */ break; } @@ -389,61 +268,94 @@ +#ifndef TCPDUMP_MINI case IPPROTO_SCTP: - sctp_print(ndo, ipds->cp, (const u_char *)ipds->ip, ipds->len); + sctp_print(ndo, bp, iph, length); break; -@@ -390,6 +393,7 @@ again: +@@ -93,7 +96,7 @@ again: case IPPROTO_DCCP: - dccp_print(ndo, ipds->cp, (const u_char *)ipds->ip, ipds->len); + dccp_print(ndo, bp, iph, length); break; +- +#endif - case IPPROTO_TCP: - /* pass on the MF bit plus the offset to detect fragments */ -@@ -409,6 +413,7 @@ again: - ipds->off & (IP_MF|IP_OFFMASK)); + tcp_print(ndo, bp, length, iph, fragmented); + break; +@@ -122,6 +125,7 @@ again: + } break; +#ifndef TCPDUMP_MINI case IPPROTO_PIGP: /* * XXX - the current IANA protocol number assignments -@@ -429,14 +434,17 @@ again: +@@ -142,14 +146,17 @@ again: case IPPROTO_EIGRP: - eigrp_print(ndo, ipds->cp, ipds->len); + eigrp_print(ndo, bp, length); break; +#endif case IPPROTO_ND: - ND_PRINT((ndo, " nd %d", ipds->len)); + ND_PRINT(" nd %u", length); break; +#ifndef TCPDUMP_MINI case IPPROTO_EGP: - egp_print(ndo, ipds->cp, ipds->len); + egp_print(ndo, bp, length); break; +#endif case IPPROTO_OSPF: - ospf_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip); -@@ -469,6 +477,7 @@ again: - gre_print(ndo, ipds->cp, ipds->len); + if (ver == 6) +@@ -186,6 +193,7 @@ again: + gre_print(ndo, bp, length); break; +#ifndef TCPDUMP_MINI case IPPROTO_MOBILE: - mobile_print(ndo, ipds->cp, ipds->len); + mobile_print(ndo, bp, length); break; -@@ -497,6 +506,7 @@ again: +@@ -205,6 +213,7 @@ again: case IPPROTO_PGM: - pgm_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip); + pgm_print(ndo, bp, length, iph); break; +#endif - default: - if (ndo->ndo_nflag==0 && (p_name = netdb_protoname(ipds->nh)) != NULL) + case IPPROTO_ETHERNET: + if (ver == 6) +--- a/print-ip6.c ++++ b/print-ip6.c +@@ -135,10 +135,11 @@ ip6_finddst(netdissect_options *ndo, nd_ + * Only one routing header to a customer. + */ + goto done; +- ++#ifndef TCPDUMP_MINI + case IPPROTO_AH: + case IPPROTO_ESP: + case IPPROTO_IPCOMP: ++#endif + default: + /* + * AH and ESP are, in the RFCs that describe them, +@@ -357,6 +358,7 @@ ip6_print(netdissect_options *ndo, const + nh = GET_U_1(cp); + break; + ++#ifndef TCPDUMP_MINI + case IPPROTO_FRAGMENT: + advance = frag6_print(ndo, cp, (const u_char *)ip6); + if (advance < 0 || ndo->ndo_snapend <= cp + advance) { +@@ -387,7 +389,7 @@ ip6_print(netdissect_options *ndo, const + nh = GET_U_1(cp); + nd_pop_packet_info(ndo); + return; +- ++#endif + case IPPROTO_ROUTING: + ND_TCHECK_1(cp); + advance = rt6_print(ndo, cp, (const u_char *)ip6); --- a/print-llc.c +++ b/print-llc.c -@@ -206,6 +206,7 @@ llc_print(netdissect_options *ndo, const +@@ -207,6 +207,7 @@ llc_print(netdissect_options *ndo, const hdrlen = 4; /* DSAP, SSAP, 2-byte control field */ } @@ -451,7 +363,7 @@ if (ssap_field == LLCSAP_GLOBAL && dsap_field == LLCSAP_GLOBAL) { /* * This is an Ethernet_802.3 IPX frame; it has an -@@ -228,6 +229,7 @@ llc_print(netdissect_options *ndo, const +@@ -229,6 +230,7 @@ llc_print(netdissect_options *ndo, const ipx_print(ndo, p, length); return (0); /* no LLC header */ } @@ -459,7 +371,7 @@ dsap = dsap_field & ~LLC_IG; ssap = ssap_field & ~LLC_GSAP; -@@ -291,6 +293,7 @@ llc_print(netdissect_options *ndo, const +@@ -292,6 +294,7 @@ llc_print(netdissect_options *ndo, const return (hdrlen); } @@ -467,7 +379,7 @@ if (ssap == LLCSAP_IPX && dsap == LLCSAP_IPX && control == LLC_UI) { /* -@@ -304,6 +307,7 @@ llc_print(netdissect_options *ndo, const +@@ -305,6 +308,7 @@ llc_print(netdissect_options *ndo, const ipx_print(ndo, p, length); return (hdrlen); } @@ -475,7 +387,7 @@ #ifdef ENABLE_SMB if (ssap == LLCSAP_NETBEUI && dsap == LLCSAP_NETBEUI -@@ -322,12 +326,13 @@ llc_print(netdissect_options *ndo, const +@@ -323,12 +327,13 @@ llc_print(netdissect_options *ndo, const return (hdrlen); } #endif @@ -490,15 +402,15 @@ if (!ndo->ndo_eflag) { if (ssap == dsap) { if (src == NULL || dst == NULL) -@@ -480,6 +485,7 @@ snap_print(netdissect_options *ndo, cons +@@ -484,6 +489,7 @@ snap_print(netdissect_options *ndo, cons case OUI_CISCO: switch (et) { +#ifndef TCPDUMP_MINI case PID_CISCO_CDP: - cdp_print(ndo, p, length, caplen); + cdp_print(ndo, p, length); return (1); -@@ -492,6 +498,7 @@ snap_print(netdissect_options *ndo, cons +@@ -496,6 +502,7 @@ snap_print(netdissect_options *ndo, cons case PID_CISCO_VTP: vtp_print(ndo, p, length); return (1); @@ -506,7 +418,7 @@ case PID_CISCO_PVST: case PID_CISCO_VLANBRIDGE: stp_print(ndo, p, length); -@@ -504,6 +511,7 @@ snap_print(netdissect_options *ndo, cons +@@ -508,6 +515,7 @@ snap_print(netdissect_options *ndo, cons case OUI_RFC2684: switch (et) { @@ -514,7 +426,7 @@ case PID_RFC2684_ETH_FCS: case PID_RFC2684_ETH_NOFCS: /* -@@ -565,6 +573,7 @@ snap_print(netdissect_options *ndo, cons +@@ -569,6 +577,7 @@ snap_print(netdissect_options *ndo, cons */ fddi_print(ndo, p, length, caplen); return (1); @@ -542,25 +454,25 @@ /* unknown AF_ value */ --- a/print-ppp.c +++ b/print-ppp.c -@@ -1367,6 +1367,7 @@ trunc: - return 0; - } - +@@ -1355,6 +1355,7 @@ trunc: + * The length argument is the on-the-wire length, not the captured + * length; we can only un-escape the captured part. + */ +#ifndef TCPDUMP_MINI static void ppp_hdlc(netdissect_options *ndo, - const u_char *p, int length) -@@ -1445,6 +1446,7 @@ trunc: - free(b); - ND_PRINT((ndo, "[|ppp]")); + const u_char *p, u_int length) +@@ -1440,17 +1441,19 @@ trunc: + ndo->ndo_snapend = se; + nd_print_trunc(ndo); } +- +#endif - /* PPP */ -@@ -1452,10 +1454,12 @@ static void + static void handle_ppp(netdissect_options *ndo, - u_int proto, const u_char *p, int length) + u_int proto, const u_char *p, u_int length) { +#ifndef TCPDUMP_MINI if ((proto & 0xff00) == 0x7e00) { /* is this an escape code ? */ @@ -571,7 +483,7 @@ switch (proto) { case PPP_LCP: /* fall through */ -@@ -1488,6 +1492,7 @@ handle_ppp(netdissect_options *ndo, +@@ -1483,6 +1486,7 @@ handle_ppp(netdissect_options *ndo, case PPP_IPV6: ip6_print(ndo, p, length); break; @@ -579,33 +491,30 @@ case ETHERTYPE_IPX: /*XXX*/ case PPP_IPX: ipx_print(ndo, p, length); -@@ -1499,6 +1504,7 @@ handle_ppp(netdissect_options *ndo, +@@ -1494,6 +1498,7 @@ handle_ppp(netdissect_options *ndo, case PPP_MPLS_MCAST: mpls_print(ndo, p, length); break; +#endif case PPP_COMP: - ND_PRINT((ndo, "compressed PPP data")); + ND_PRINT("compressed PPP data"); break; -@@ -1639,6 +1645,7 @@ ppp_if_print(netdissect_options *ndo, - return (0); +@@ -1634,6 +1639,7 @@ ppp_if_print(netdissect_options *ndo, + ppp_print(ndo, p, length); } +#ifndef TCPDUMP_MINI /* * PPP I/F printer to use if we know that RFC 1662-style PPP in HDLC-like * framing, or Cisco PPP with HDLC framing as per section 4.3.1 of RFC 1547, -@@ -1866,6 +1873,7 @@ printx: +@@ -1877,3 +1883,4 @@ printx: #endif /* __bsdi__ */ - return (hdrlength); + ndo->ndo_ll_hdr_len += hdrlength; } +#endif - - - /* --- a/print-sll.c +++ b/print-sll.c -@@ -249,12 +249,14 @@ recurse: +@@ -460,12 +460,14 @@ recurse: */ switch (ether_type) { @@ -622,22 +531,24 @@ /* --- a/print-tcp.c +++ b/print-tcp.c -@@ -589,12 +589,14 @@ tcp_print(netdissect_options *ndo, - ND_PRINT((ndo, " %u", utoval)); +@@ -612,6 +612,7 @@ tcp_print(netdissect_options *ndo, + ND_PRINT(" %u", utoval); break; +#ifndef TCPDUMP_MINI case TCPOPT_MPTCP: - datalen = len - 2; - LENCHECK(datalen); - if (!mptcp_print(ndo, cp-2, len, flags)) + { + const u_char *snapend_save; +@@ -635,7 +636,7 @@ tcp_print(netdissect_options *ndo, goto bad; break; + } +- +#endif - case TCPOPT_FASTOPEN: datalen = len - 2; -@@ -670,6 +672,7 @@ tcp_print(netdissect_options *ndo, + LENCHECK(datalen); +@@ -720,6 +721,7 @@ tcp_print(netdissect_options *ndo, return; } @@ -645,7 +556,7 @@ if (ndo->ndo_packettype) { switch (ndo->ndo_packettype) { case PT_ZMTP1: -@@ -681,28 +684,36 @@ tcp_print(netdissect_options *ndo, +@@ -735,6 +737,7 @@ tcp_print(netdissect_options *ndo, } return; } @@ -653,11 +564,12 @@ if (IS_SRC_OR_DST_PORT(TELNET_PORT)) { telnet_print(ndo, bp, length); - } else if (IS_SRC_OR_DST_PORT(SMTP_PORT)) { - ND_PRINT((ndo, ": ")); - smtp_print(ndo, bp, length); +@@ -745,24 +748,31 @@ tcp_print(netdissect_options *ndo, + ND_PRINT(": "); + ndo->ndo_protocol = "whois"; /* needed by txtproto_print() */ + txtproto_print(ndo, bp, length, NULL, 0); /* RFC 3912 */ - } else if (IS_SRC_OR_DST_PORT(BGP_PORT)) -+ } ++ } +#ifndef TCPDUMP_MINI + else if (IS_SRC_OR_DST_PORT(BGP_PORT)) bgp_print(ndo, bp, length); @@ -667,12 +579,14 @@ +#ifndef TCPDUMP_MINI else if (IS_SRC_OR_DST_PORT(REDIS_PORT)) resp_print(ndo, bp, length); + else if (IS_SRC_OR_DST_PORT(SSH_PORT)) + ssh_print(ndo, bp, length); +#endif #ifdef ENABLE_SMB else if (IS_SRC_OR_DST_PORT(NETBIOS_SSN_PORT)) nbt_tcp_print(ndo, bp, length); - else if (IS_SRC_OR_DST_PORT(SMB_PORT)) - smb_tcp_print(ndo, bp, length); + else if (IS_SRC_OR_DST_PORT(SMB_PORT)) + smb_tcp_print(ndo, bp, length); #endif +#ifndef TCPDUMP_MINI else if (IS_SRC_OR_DST_PORT(BEEP_PORT)) @@ -681,41 +595,40 @@ openflow_print(ndo, bp, length); +#endif else if (IS_SRC_OR_DST_PORT(FTP_PORT)) { - ND_PRINT((ndo, ": ")); + ND_PRINT(": "); ftp_print(ndo, bp, length); -@@ -725,6 +736,7 @@ tcp_print(netdissect_options *ndo, - * XXX packet could be unaligned, it can go strange - */ - ns_print(ndo, bp + 2, length - 2, 0); +@@ -775,12 +785,14 @@ tcp_print(netdissect_options *ndo, + } else if (IS_SRC_OR_DST_PORT(NAMESERVER_PORT)) { + /* over_tcp: TRUE, is_mdns: FALSE */ + domain_print(ndo, bp, length, TRUE, FALSE); +#ifndef TCPDUMP_MINI } else if (IS_SRC_OR_DST_PORT(MSDP_PORT)) { msdp_print(ndo, bp, length); } else if (IS_SRC_OR_DST_PORT(RPKI_RTR_PORT)) { -@@ -732,6 +744,7 @@ tcp_print(netdissect_options *ndo, - } - else if (length > 0 && (IS_SRC_OR_DST_PORT(LDP_PORT))) { + rpki_rtr_print(ndo, bp, length); + } else if (IS_SRC_OR_DST_PORT(LDP_PORT)) { ldp_print(ndo, bp, length); +#endif - } - else if ((IS_SRC_OR_DST_PORT(NFS_PORT)) && - length >= 4 && ND_TTEST2(*bp, 4)) { + } else if ((IS_SRC_OR_DST_PORT(NFS_PORT)) && + length >= 4 && ND_TTEST_4(bp)) { + /* --- a/print-udp.c +++ b/print-udp.c -@@ -430,10 +430,12 @@ udp_print(netdissect_options *ndo, regis - vat_print(ndo, (const void *)(up + 1), up); +@@ -435,10 +435,12 @@ udp_print(netdissect_options *ndo, const + vat_print(ndo, cp, length); break; +#ifndef TCPDUMP_MINI case PT_WB: udpipaddr_print(ndo, ip, sport, dport); - wb_print(ndo, (const void *)(up + 1), length); + wb_print(ndo, cp, length); break; +#endif case PT_RPC: - rp = (const struct sunrpc_msg *)(up + 1); -@@ -462,10 +464,12 @@ udp_print(netdissect_options *ndo, regis - snmp_print(ndo, (const u_char *)(up + 1), length); + rp = (const struct sunrpc_msg *)cp; +@@ -467,10 +469,12 @@ udp_print(netdissect_options *ndo, const + snmp_print(ndo, cp, length); break; +#ifndef TCPDUMP_MINI @@ -727,131 +640,221 @@ case PT_TFTP: udpipaddr_print(ndo, ip, sport, dport); -@@ -483,6 +487,7 @@ udp_print(netdissect_options *ndo, regis +@@ -488,6 +492,7 @@ udp_print(netdissect_options *ndo, const radius_print(ndo, cp, length); break; +#ifndef TCPDUMP_MINI case PT_VXLAN: udpipaddr_print(ndo, ip, sport, dport); - vxlan_print(ndo, (const u_char *)(up + 1), length); -@@ -497,6 +502,7 @@ udp_print(netdissect_options *ndo, regis + vxlan_print(ndo, cp, length); +@@ -510,6 +515,7 @@ udp_print(netdissect_options *ndo, const udpipaddr_print(ndo, ip, sport, dport); - lmp_print(ndo, cp, length); + someip_print(ndo, cp, length); break; +#endif - } - return; - } -@@ -574,31 +580,40 @@ udp_print(netdissect_options *ndo, regis - ns_print(ndo, (const u_char *)(up + 1), length, 0); + case PT_DOMAIN: + udpipaddr_print(ndo, ip, sport, dport); + /* over_tcp: FALSE, is_mdns: FALSE */ +@@ -596,29 +602,37 @@ udp_print(netdissect_options *ndo, const else if (IS_SRC_OR_DST_PORT(MULTICASTDNS_PORT)) - ns_print(ndo, (const u_char *)(up + 1), length, 1); + /* over_tcp: FALSE, is_mdns: TRUE */ + domain_print(ndo, cp, length, FALSE, TRUE); +#ifndef TCPDUMP_MINI else if (IS_SRC_OR_DST_PORT(TIMED_PORT)) - timed_print(ndo, (const u_char *)(up + 1)); + timed_print(ndo, (const u_char *)cp); +#endif else if (IS_SRC_OR_DST_PORT(TFTP_PORT)) - tftp_print(ndo, (const u_char *)(up + 1), length); + tftp_print(ndo, cp, length); else if (IS_SRC_OR_DST_PORT(BOOTPC_PORT) || IS_SRC_OR_DST_PORT(BOOTPS_PORT)) - bootp_print(ndo, (const u_char *)(up + 1), length); + bootp_print(ndo, cp, length); +#ifndef TCPDUMP_MINI else if (IS_SRC_OR_DST_PORT(RIP_PORT)) - rip_print(ndo, (const u_char *)(up + 1), length); + rip_print(ndo, cp, length); +#endif else if (IS_SRC_OR_DST_PORT(AODV_PORT)) - aodv_print(ndo, (const u_char *)(up + 1), length, + aodv_print(ndo, cp, length, ip6 != NULL); +#ifndef TCPDUMP_MINI - else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT)) - isakmp_print(ndo, (const u_char *)(up + 1), length, bp2); -+ - else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_NATT)) - isakmp_rfc3948_print(ndo, (const u_char *)(up + 1), length, bp2); - #if 1 /*???*/ - else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER1) || IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER2)) - isakmp_print(ndo, (const u_char *)(up + 1), length, bp2); - #endif + else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT)) + isakmp_print(ndo, cp, length, bp2); + else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_NATT)) + isakmp_rfc3948_print(ndo, cp, length, bp2, IP_V(ip), fragmented, ttl_hl); + else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER1) || IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER2)) + isakmp_print(ndo, cp, length, bp2); +#endif else if (IS_SRC_OR_DST_PORT(SNMP_PORT) || IS_SRC_OR_DST_PORT(SNMPTRAP_PORT)) - snmp_print(ndo, (const u_char *)(up + 1), length); + snmp_print(ndo, cp, length); else if (IS_SRC_OR_DST_PORT(NTP_PORT)) - ntp_print(ndo, (const u_char *)(up + 1), length); + ntp_print(ndo, cp, length); +#ifndef TCPDUMP_MINI else if (IS_SRC_OR_DST_PORT(KERBEROS_PORT) || IS_SRC_OR_DST_PORT(KERBEROS_SEC_PORT)) - krb_print(ndo, (const void *)(up + 1)); + krb_print(ndo, (const u_char *)cp); +#endif else if (IS_SRC_OR_DST_PORT(L2TP_PORT)) - l2tp_print(ndo, (const u_char *)(up + 1), length); + l2tp_print(ndo, cp, length); #ifdef ENABLE_SMB -@@ -609,6 +624,7 @@ udp_print(netdissect_options *ndo, regis +@@ -629,6 +643,7 @@ udp_print(netdissect_options *ndo, const #endif else if (dport == VAT_PORT) - vat_print(ndo, (const void *)(up + 1), up); + vat_print(ndo, cp, length); +#ifndef TCPDUMP_MINI else if (IS_SRC_OR_DST_PORT(ZEPHYR_SRV_PORT) || IS_SRC_OR_DST_PORT(ZEPHYR_CLT_PORT)) - zephyr_print(ndo, (const void *)(up + 1), length); + zephyr_print(ndo, cp, length); /* -@@ -621,8 +637,11 @@ udp_print(netdissect_options *ndo, regis +@@ -641,8 +656,11 @@ udp_print(netdissect_options *ndo, const (const u_char *) ip); else if (IS_SRC_OR_DST_PORT(RIPNG_PORT)) - ripng_print(ndo, (const u_char *)(up + 1), length); + ripng_print(ndo, cp, length); +#endif + else if (IS_SRC_OR_DST_PORT(DHCP6_SERV_PORT) || IS_SRC_OR_DST_PORT(DHCP6_CLI_PORT)) - dhcp6_print(ndo, (const u_char *)(up + 1), length); + dhcp6_print(ndo, cp, length); +#ifndef TCPDUMP_MINI else if (IS_SRC_OR_DST_PORT(AHCP_PORT)) - ahcp_print(ndo, (const u_char *)(up + 1), length); + ahcp_print(ndo, cp, length); else if (IS_SRC_OR_DST_PORT(BABEL_PORT) || IS_SRC_OR_DST_PORT(BABEL_PORT_OLD)) -@@ -636,6 +655,7 @@ udp_print(netdissect_options *ndo, regis - wb_print(ndo, (const void *)(up + 1), length); +@@ -656,6 +674,7 @@ udp_print(netdissect_options *ndo, const + wb_print(ndo, cp, length); else if (IS_SRC_OR_DST_PORT(CISCO_AUTORP_PORT)) - cisco_autorp_print(ndo, (const void *)(up + 1), length); + cisco_autorp_print(ndo, cp, length); +#endif else if (IS_SRC_OR_DST_PORT(RADIUS_PORT) || IS_SRC_OR_DST_PORT(RADIUS_NEW_PORT) || IS_SRC_OR_DST_PORT(RADIUS_ACCOUNTING_PORT) || -@@ -643,15 +663,18 @@ udp_print(netdissect_options *ndo, regis +@@ -663,15 +682,18 @@ udp_print(netdissect_options *ndo, const IS_SRC_OR_DST_PORT(RADIUS_CISCO_COA_PORT) || IS_SRC_OR_DST_PORT(RADIUS_COA_PORT) ) - radius_print(ndo, (const u_char *)(up+1), length); + radius_print(ndo, cp, length); +#ifndef TCPDUMP_MINI else if (dport == HSRP_PORT) - hsrp_print(ndo, (const u_char *)(up + 1), length); + hsrp_print(ndo, cp, length); else if (IS_SRC_OR_DST_PORT(LWRES_PORT)) - lwres_print(ndo, (const u_char *)(up + 1), length); + lwres_print(ndo, cp, length); else if (IS_SRC_OR_DST_PORT(LDP_PORT)) - ldp_print(ndo, (const u_char *)(up + 1), length); + ldp_print(ndo, cp, length); +#endif else if (IS_SRC_OR_DST_PORT(OLSR_PORT)) - olsr_print(ndo, (const u_char *)(up + 1), length, + olsr_print(ndo, cp, length, (IP_V(ip) == 6) ? 1 : 0); +#ifndef TCPDUMP_MINI else if (IS_SRC_OR_DST_PORT(MPLS_LSP_PING_PORT)) - lspping_print(ndo, (const u_char *)(up + 1), length); - else if (dport == BFD_CONTROL_PORT || -@@ -669,10 +692,12 @@ udp_print(netdissect_options *ndo, regis - lwapp_control_print(ndo, (const u_char *)(up + 1), length, 0); - else if (IS_SRC_OR_DST_PORT(LWAPP_DATA_PORT)) - lwapp_data_print(ndo, (const u_char *)(up + 1), length); + lspping_print(ndo, cp, length); + else if (sport == BCM_LI_PORT) +@@ -693,10 +715,12 @@ udp_print(netdissect_options *ndo, const + lwapp_control_print(ndo, cp, length, 0); + else if (IS_SRC_OR_DST_PORT(LWAPP_DATA_PORT)) + lwapp_data_print(ndo, cp, length); +#endif - else if (IS_SRC_OR_DST_PORT(SIP_PORT)) - sip_print(ndo, (const u_char *)(up + 1), length); - else if (IS_SRC_OR_DST_PORT(SYSLOG_PORT)) - syslog_print(ndo, (const u_char *)(up + 1), length); + else if (IS_SRC_OR_DST_PORT(SIP_PORT)) + sip_print(ndo, cp, length); + else if (IS_SRC_OR_DST_PORT(SYSLOG_PORT)) + syslog_print(ndo, cp, length); +#ifndef TCPDUMP_MINI - else if (IS_SRC_OR_DST_PORT(OTV_PORT)) - otv_print(ndo, (const u_char *)(up + 1), length); - else if (IS_SRC_OR_DST_PORT(VXLAN_PORT)) -@@ -689,7 +714,9 @@ udp_print(netdissect_options *ndo, regis - if (ndo->ndo_vflag) - ND_PRINT((ndo, "kip ")); - llap_print(ndo, cp, length); -- } else { -+ } + else if (IS_SRC_OR_DST_PORT(OTV_PORT)) + otv_print(ndo, cp, length); + else if (IS_SRC_OR_DST_PORT(VXLAN_PORT)) +@@ -722,6 +746,7 @@ udp_print(netdissect_options *ndo, const + ptp_print(ndo, cp, length); + } else if (IS_SRC_OR_DST_PORT(SOMEIP_PORT)) + someip_print(ndo, cp, length); +#endif -+ else { - if (ulen > length) - ND_PRINT((ndo, "UDP, bad length %u > %u", - ulen, length)); + else { + if (ulen > length && !fragmented) + ND_PRINT("UDP, bad length %u > %u", +--- a/print.c ++++ b/print.c +@@ -48,6 +48,7 @@ struct printer { + }; + + static const struct printer printers[] = { ++#ifndef TCPDUMP_MINI + #ifdef DLT_APPLE_IP_OVER_IEEE1394 + { ap1394_if_print, DLT_APPLE_IP_OVER_IEEE1394 }, + #endif +@@ -86,7 +87,9 @@ static const struct printer printers[] = + #ifdef DLT_ENC + { enc_if_print, DLT_ENC }, + #endif ++#endif + { ether_if_print, DLT_EN10MB }, ++#ifndef TCPDUMP_MINI + { fddi_if_print, DLT_FDDI }, + #ifdef DLT_FR + { fr_if_print, DLT_FR }, +@@ -94,6 +97,7 @@ static const struct printer printers[] = + #ifdef DLT_FRELAY + { fr_if_print, DLT_FRELAY }, + #endif ++#endif + #ifdef DLT_IEEE802_11 + { ieee802_11_if_print, DLT_IEEE802_11}, + #endif +@@ -103,6 +107,7 @@ static const struct printer printers[] = + #ifdef DLT_IEEE802_11_RADIO + { ieee802_11_radio_if_print, DLT_IEEE802_11_RADIO }, + #endif ++#ifndef TCPDUMP_MINI + #ifdef DLT_IEEE802_15_4 + { ieee802_15_4_if_print, DLT_IEEE802_15_4 }, + #endif +@@ -115,9 +120,11 @@ static const struct printer printers[] = + #ifdef DLT_IP_OVER_FC + { ipfc_if_print, DLT_IP_OVER_FC }, + #endif ++#endif + #ifdef DLT_IPNET + { ipnet_if_print, DLT_IPNET }, + #endif ++#ifndef TCPDUMP_MINI + #ifdef DLT_IPOIB + { ipoib_if_print, DLT_IPOIB }, + #endif +@@ -172,19 +179,23 @@ static const struct printer printers[] = + #ifdef DLT_MFR + { mfr_if_print, DLT_MFR }, + #endif ++#endif + #ifdef DLT_NETANALYZER + { netanalyzer_if_print, DLT_NETANALYZER }, + #endif + #ifdef DLT_NETANALYZER_TRANSPARENT + { netanalyzer_transparent_if_print, DLT_NETANALYZER_TRANSPARENT }, + #endif ++#ifndef TCPDUMP_MINI + #ifdef DLT_NFLOG + { nflog_if_print, DLT_NFLOG}, + #endif ++#endif + { null_if_print, DLT_NULL }, + #ifdef DLT_LOOP + { null_if_print, DLT_LOOP }, + #endif ++#ifndef TCPDUMP_MINI + #if defined(DLT_PFLOG) && defined(HAVE_NET_IF_PFLOG_H) + { pflog_if_print, DLT_PFLOG }, + #endif +@@ -200,6 +211,7 @@ static const struct printer printers[] = + #ifdef DLT_PPP_SERIAL + { ppp_hdlc_if_print, DLT_PPP_SERIAL }, + #endif ++#endif + { ppp_if_print, DLT_PPP }, + #ifdef DLT_PPP_PPPD + { ppp_if_print, DLT_PPP_PPPD }, +@@ -211,6 +223,7 @@ static const struct printer printers[] = + { prism_if_print, DLT_PRISM_HEADER }, + #endif + { raw_if_print, DLT_RAW }, ++#ifndef TCPDUMP_MINI + #ifdef DLT_IPV4 + { raw_if_print, DLT_IPV4 }, + #endif +@@ -243,6 +256,7 @@ static const struct printer printers[] = + #ifdef DLT_VSOCK + { vsock_if_print, DLT_VSOCK }, + #endif ++#endif + { NULL, 0 }, + }; + diff --git a/package/network/utils/tcpdump/patches/101-CVE-2020-8037.patch b/package/network/utils/tcpdump/patches/101-CVE-2020-8037.patch deleted file mode 100644 index 281854777d..0000000000 --- a/package/network/utils/tcpdump/patches/101-CVE-2020-8037.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/print-ppp.c -+++ b/print-ppp.c -@@ -1368,19 +1368,29 @@ trunc: - } - - #ifndef TCPDUMP_MINI -+/* -+ * Un-escape RFC 1662 PPP in HDLC-like framing, with octet escapes. -+ * The length argument is the on-the-wire length, not the captured -+ * length; we can only un-escape the captured part. -+ */ - static void - ppp_hdlc(netdissect_options *ndo, - const u_char *p, int length) - { -+ u_int caplen = ndo->ndo_snapend - p; - u_char *b, *t, c; - const u_char *s; -- int i, proto; -+ u_int i; -+ int proto; - const void *se; - -+ if (caplen == 0) -+ return; -+ - if (length <= 0) - return; - -- b = (u_char *)malloc(length); -+ b = (u_char *)malloc(caplen); - if (b == NULL) - return; - -@@ -1389,10 +1399,10 @@ ppp_hdlc(netdissect_options *ndo, - * Do this so that we dont overwrite the original packet - * contents. - */ -- for (s = p, t = b, i = length; i > 0 && ND_TTEST(*s); i--) { -+ for (s = p, t = b, i = caplen; i != 0; i--) { - c = *s++; - if (c == 0x7d) { -- if (i <= 1 || !ND_TTEST(*s)) -+ if (i <= 1) - break; - i--; - c = *s++ ^ 0x20; diff --git a/package/network/utils/tcpdump/patches/102-CVE-2018-16301.patch b/package/network/utils/tcpdump/patches/102-CVE-2018-16301.patch deleted file mode 100644 index 39cd368915..0000000000 --- a/package/network/utils/tcpdump/patches/102-CVE-2018-16301.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 8ab211a7ec728bb0ad8c766c8eeb12deb0a13b86 Mon Sep 17 00:00:00 2001 -From: Guy Harris -Date: Wed, 30 Sep 2020 11:37:30 -0700 -Subject: [PATCH] Handle very large -f files by rejecting them. - -_read(), on Windows, has a 32-bit size argument and a 32-bit return -value, so reject -f files that have more than 2^31-1 characters. - -Add some #defines so that, on Windows, we use _fstati64 to get the size -of that file, to handle large files. - -Don't assume that our definition for ssize_t is the same size as size_t; -by the time we want to print the return value of the read, we know it'll -fit into an int, so just cast it to int and print it with %d. - -(cherry picked from commit faf8fb70af3a013e5d662b8283dec742fd6b1a77) ---- - netdissect-stdinc.h | 16 +++++++++++++++- - tcpdump.c | 15 ++++++++++++--- - 2 files changed, 27 insertions(+), 4 deletions(-) - ---- a/netdissect-stdinc.h -+++ b/netdissect-stdinc.h -@@ -149,10 +149,17 @@ - #ifdef _MSC_VER - #define stat _stat - #define open _open --#define fstat _fstat - #define read _read - #define close _close - #define O_RDONLY _O_RDONLY -+ -+/* -+ * We define our_fstat64 as _fstati64, and define our_statb as -+ * struct _stati64, so we get 64-bit file sizes. -+ */ -+#define our_fstat _fstati64 -+#define our_statb struct _stati64 -+ - #endif /* _MSC_VER */ - - /* -@@ -211,6 +218,13 @@ typedef char* caddr_t; - - #include - -+/* -+ * We should have large file support enabled, if it's available, -+ * so just use fstat as our_fstat and struct stat as our_statb. -+ */ -+#define our_fstat fstat -+#define our_statb struct stat -+ - #endif /* _WIN32 */ - - #ifndef HAVE___ATTRIBUTE__ ---- a/tcpdump.c -+++ b/tcpdump.c -@@ -108,6 +108,7 @@ The Regents of the University of Califor - #endif /* HAVE_CAP_NG_H */ - #endif /* HAVE_LIBCAP_NG */ - -+#include "netdissect-stdinc.h" - #include "netdissect.h" - #include "interface.h" - #include "addrtoname.h" -@@ -861,15 +862,22 @@ read_infile(char *fname) - { - register int i, fd, cc; - register char *cp; -- struct stat buf; -+ our_statb buf; - - fd = open(fname, O_RDONLY|O_BINARY); - if (fd < 0) - error("can't open %s: %s", fname, pcap_strerror(errno)); - -- if (fstat(fd, &buf) < 0) -+ if (our_fstat(fd, &buf) < 0) - error("can't stat %s: %s", fname, pcap_strerror(errno)); - -+ /* -+ * Reject files whose size doesn't fit into an int; a filter -+ * *that* large will probably be too big. -+ */ -+ if (buf.st_size > INT_MAX) -+ error("%s is too large", fname); -+ - cp = malloc((u_int)buf.st_size + 1); - if (cp == NULL) - error("malloc(%d) for %s: %s", (u_int)buf.st_size + 1, -@@ -878,7 +886,8 @@ read_infile(char *fname) - if (cc < 0) - error("read %s: %s", fname, pcap_strerror(errno)); - if (cc != buf.st_size) -- error("short read %s (%d != %d)", fname, cc, (int)buf.st_size); -+ error("short read %s (%d != %d)", fname, (int) cc, -+ (int)buf.st_size); - - close(fd); - /* replace "# comment" with spaces */ diff --git a/package/utils/f2fs-tools/Makefile b/package/utils/f2fs-tools/Makefile index 3c53f27d79..8f53516d34 100644 --- a/package/utils/f2fs-tools/Makefile +++ b/package/utils/f2fs-tools/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=f2fs-tools -PKG_VERSION:=1.14.0 -PKG_RELEASE:=3 +PKG_VERSION:=1.15.0 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/ -PKG_HASH:=619263d4e2022152a1472c1d912eaae104f20bd227ce0bb9d41d1d6608094bd1 +PKG_HASH:=147d471040b44900283ce2c935f1d35d13d7f40008e7cb8fab2b69f54da01a4f PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0-only diff --git a/package/utils/f2fs-tools/patches/100-configure.ac-fix-AC_ARG_WITH.patch b/package/utils/f2fs-tools/patches/100-configure.ac-fix-AC_ARG_WITH.patch new file mode 100644 index 0000000000..a7fb50a63d --- /dev/null +++ b/package/utils/f2fs-tools/patches/100-configure.ac-fix-AC_ARG_WITH.patch @@ -0,0 +1,88 @@ +From 9af8ee5baceab59d46154c96da62b52935f363fe Mon Sep 17 00:00:00 2001 +From: Nick Hainke +Date: Mon, 27 Jun 2022 20:43:11 +0200 +Subject: [PATCH] configure.ac: fix AC_ARG_WITH + +In the new version the configuration no longer respects the +--without/--with blkid/selinux parameters. Add the tests for +"with_blkid" and "with_selinux" back to configure.ac as described +in the manual. + +Link: https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/External-Software.html + +Fixes: c48335416a09 ("configure.ac: Enable cross-compilation") + +Signed-off-by: Nick Hainke +--- + configure.ac | 44 ++++++++++++++++++++++++++++++-------------- + 1 file changed, 30 insertions(+), 14 deletions(-) + +--- a/configure.ac ++++ b/configure.ac +@@ -39,12 +39,16 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign + + # Test configure options. + AC_ARG_WITH([selinux], +- AS_HELP_STRING([--without-selinux], +- [Ignore presence of libselinux and disable selinux support])) ++ [AS_HELP_STRING([--without-selinux], ++ [Ignore presence of libselinux and disable selinux support])], ++ [], ++ [with_selinux=check]) + + AC_ARG_WITH([blkid], +- AS_HELP_STRING([--without-blkid], +- [Ignore presence of libblkid and disable blkid support])) ++ [AS_HELP_STRING([--without-blkid], ++ [Ignore presence of libblkid and disable blkid support])], ++ [], ++ [with_blkid=check]) + + # Checks for programs. + AC_PROG_CC +@@ -55,11 +59,17 @@ AC_PATH_PROG([LDCONFIG], [ldconfig], + [$PATH:/sbin]) + + # Checks for libraries. +-AC_CHECK_LIB([blkid], [blkid_probe_all], +- [AC_SUBST([libblkid_LIBS], ["-lblkid"]) +- AC_DEFINE([HAVE_LIBBLKID], [1], +- [Define if you have libblkid]) +- ], [], []) ++AS_IF([test "x$with_blkid" != xno], ++ [AC_CHECK_LIB([blkid], [blkid_probe_all], ++ [AC_SUBST([libblkid_LIBS], ["-lblkid"]) ++ AC_DEFINE([HAVE_LIBBLKID], [1], ++ [Define if you have libblkid]) ++ ], ++ [if test "x$with_blkid" != xcheck; then ++ AC_MSG_FAILURE( ++ [--with-blkid was given, but test for blkid failed]) ++ fi ++ ], -lblkid)]) + + AC_CHECK_LIB([lzo2], [main], + [AC_SUBST([liblzo2_LIBS], ["-llzo2"]) +@@ -73,11 +83,17 @@ AC_CHECK_LIB([lz4], [main], + [Define if you have liblz4]) + ], [], []) + +-AC_CHECK_LIB([selinux], [getcon], +- [AC_SUBST([libselinux_LIBS], ["-lselinux"]) +- AC_DEFINE([HAVE_LIBSELINUX], [1], +- [Define if you have libselinux]) +- ], [], []) ++AS_IF([test "x$with_selinux" != xno], ++ [AC_CHECK_LIB([selinux], [getcon], ++ [AC_SUBST([libselinux_LIBS], ["-lselinux"]) ++ AC_DEFINE([HAVE_LIBSELINUX], [1], ++ [Define if you have libselinux]) ++ ], ++ [if test "x$with_selinux" != xcheck; then ++ AC_MSG_FAILURE( ++ [--with-selinux was given, but test for selinux failed]) ++ fi ++ ], -lselinux)]) + + AC_CHECK_LIB([uuid], [uuid_clear], + [AC_SUBST([libuuid_LIBS], ["-luuid"]) diff --git a/package/utils/f2fs-tools/patches/200-resize_f2fs-fix_wrong_ovp_calculation.patch b/package/utils/f2fs-tools/patches/200-resize_f2fs-fix_wrong_ovp_calculation.patch deleted file mode 100644 index 0b433f76c4..0000000000 --- a/package/utils/f2fs-tools/patches/200-resize_f2fs-fix_wrong_ovp_calculation.patch +++ /dev/null @@ -1,46 +0,0 @@ -From f056fbeff08d30a6d9acdb9e06704461ceee3500 Mon Sep 17 00:00:00 2001 -From: Jaegeuk Kim -Date: Thu, 1 Apr 2021 20:13:55 -0700 -Subject: resize.f2fs: fix wrong ovp calculation - -beroal reported a mount failure due to broken valid_user_blocks. -[ 6890.647749] F2FS-fs (loop0): Wrong valid_user_blocks: 16040048, -user_block_count: 10016768 - -From fsck, - -segment_count_main [0x 9a95 : 39573] --> 39573 * 2MB = 78GB as user space - -overprov_segment_count [0x 4e29 : 20009] --> 20009 * 2MB = 40GB as overprovisioned space which user can't see. - -But, -[FSCK] valid_block_count matching with CP [Ok..] [0xf4c070] --> 0xf4c070 = 16040048 - -valid_block_count [0x f4c070 : 16040048] --> So, this is correct. - -It turns out resize.f2fs gave very large and wrong overprovisioning space -result in shortage of user blocks. The root cause was f2fs_get_usable_segments() -didn't consider resize case which needs segment_count_main from new superblock. - -Fixes: f8410857b7a8 ("f2fs-tools: zns zone-capacity support") -Signed-off-by: Jaegeuk Kim ---- - lib/libf2fs_zoned.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/lib/libf2fs_zoned.c -+++ b/lib/libf2fs_zoned.c -@@ -495,6 +495,9 @@ uint32_t f2fs_get_usable_segments(struct - int i, j; - uint32_t usable_segs = 0, zone_segs; - -+ if (c.func == RESIZE) -+ return get_sb(segment_count_main); -+ - for (i = 0; i < c.ndevs; i++) { - if (c.devices[i].zoned_model != F2FS_ZONED_HM) { - usable_segs += c.devices[i].total_segments; diff --git a/scripts/sercomm-kernel-header.py b/scripts/sercomm-kernel-header.py new file mode 100755 index 0000000000..bfb29c6fe0 --- /dev/null +++ b/scripts/sercomm-kernel-header.py @@ -0,0 +1,121 @@ +#!/usr/bin/env python3 +""" +# SPDX-License-Identifier: GPL-2.0-or-later +# +# sercomm-kernel-header.py: Creates Sercomm kernel header +# +# Copyright © 2022 Mikhail Zhilkin +""" + +import argparse +import binascii +import os +import struct + +KERNEL_HEADER_SIZE = 0x100 +PADDING = 0xff +ROOTFS_FAKE_HEADER = "UBI#" + +def auto_int(x): + return int(x, 0) + +def create_kernel_header(args): + out_file = open(args.header_file, "wb") + header = get_kernel_header(args) + out_file.write(header) + out_file.close() + +def get_kernel_header(args): + header = bytearray([PADDING] * KERNEL_HEADER_SIZE) + + struct.pack_into('8s', buf, 0x0, enc) + + enc = binascii.hexlify(args.hw_id.encode()) + struct.pack_into('>6s', buf, 0x8, enc) + + enc = args.sw_version.rjust(4, '0').encode('ascii') + struct.pack_into('>4s', buf, 0x64, enc) + + if (args.extra_padd_size): + tail = bytearray([PADDING_TAIL] * args.extra_padd_size) + if (args.extra_padd_byte): + struct.pack_into (' --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -1725,6 +1725,23 @@ static void pl011_put_poll_char(struct u +@@ -1718,6 +1718,23 @@ static void pl011_put_poll_char(struct u #endif /* CONFIG_CONSOLE_POLL */ @@ -50,7 +50,7 @@ Signed-off-by: Phil Elwell static int pl011_hwinit(struct uart_port *port) { struct uart_amba_port *uap = -@@ -1741,7 +1758,7 @@ static int pl011_hwinit(struct uart_port +@@ -1734,7 +1751,7 @@ static int pl011_hwinit(struct uart_port if (retval) return retval; @@ -59,7 +59,7 @@ Signed-off-by: Phil Elwell /* Clear pending error and receive interrupts */ pl011_write(UART011_OEIS | UART011_BEIS | UART011_PEIS | -@@ -2434,7 +2451,7 @@ static int pl011_console_setup(struct co +@@ -2421,7 +2438,7 @@ static int pl011_console_setup(struct co plat->init(); } @@ -68,7 +68,7 @@ Signed-off-by: Phil Elwell if (uap->vendor->fixed_options) { baud = uap->fixed_baud; -@@ -2651,6 +2668,7 @@ static struct uart_driver amba_reg = { +@@ -2638,6 +2655,7 @@ static struct uart_driver amba_reg = { .cons = AMBA_CONSOLE, }; @@ -76,7 +76,7 @@ Signed-off-by: Phil Elwell static int pl011_probe_dt_alias(int index, struct device *dev) { struct device_node *np; -@@ -2682,6 +2700,7 @@ static int pl011_probe_dt_alias(int inde +@@ -2669,6 +2687,7 @@ static int pl011_probe_dt_alias(int inde return ret; } diff --git a/target/linux/bcm27xx/patches-5.15/950-0059-amba_pl011-Add-cts-event-workaround-DT-property.patch b/target/linux/bcm27xx/patches-5.15/950-0059-amba_pl011-Add-cts-event-workaround-DT-property.patch index 4ef26a10e3..5dfe214100 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0059-amba_pl011-Add-cts-event-workaround-DT-property.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0059-amba_pl011-Add-cts-event-workaround-DT-property.patch @@ -36,7 +36,7 @@ Signed-off-by: Phil Elwell - reg --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -2829,6 +2829,11 @@ static int pl011_probe(struct amba_devic +@@ -2816,6 +2816,11 @@ static int pl011_probe(struct amba_devic if (IS_ERR(uap->clk)) return PTR_ERR(uap->clk); diff --git a/target/linux/bcm27xx/patches-5.15/950-0060-tty-amba-pl011-Add-un-throttle-support.patch b/target/linux/bcm27xx/patches-5.15/950-0060-tty-amba-pl011-Add-un-throttle-support.patch index db01441aa0..3b0bca7adb 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0060-tty-amba-pl011-Add-un-throttle-support.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0060-tty-amba-pl011-Add-un-throttle-support.patch @@ -50,7 +50,7 @@ Signed-off-by: Phil Elwell static void pl011_stop_rx(struct uart_port *port) { struct uart_amba_port *uap = -@@ -2276,6 +2302,8 @@ static const struct uart_ops amba_pl011_ +@@ -2263,6 +2289,8 @@ static const struct uart_ops amba_pl011_ .stop_tx = pl011_stop_tx, .start_tx = pl011_start_tx, .stop_rx = pl011_stop_rx, diff --git a/target/linux/generic/hack-5.15/402-mtd-blktrans-call-add-disks-after-mtd-device.patch b/target/linux/generic/hack-5.15/402-mtd-blktrans-call-add-disks-after-mtd-device.patch index d0f81c485b..88ca07f517 100644 --- a/target/linux/generic/hack-5.15/402-mtd-blktrans-call-add-disks-after-mtd-device.patch +++ b/target/linux/generic/hack-5.15/402-mtd-blktrans-call-add-disks-after-mtd-device.patch @@ -77,7 +77,7 @@ Signed-off-by: Daniel Golle #include "mtdcore.h" -@@ -1002,6 +1003,8 @@ int mtd_device_parse_register(struct mtd +@@ -1012,6 +1013,8 @@ int mtd_device_parse_register(struct mtd ret = mtd_otp_nvmem_add(mtd); diff --git a/target/linux/generic/hack-5.15/420-mtd-set-rootfs-to-be-root-dev.patch b/target/linux/generic/hack-5.15/420-mtd-set-rootfs-to-be-root-dev.patch index 8ac1dca238..4cefe35e55 100644 --- a/target/linux/generic/hack-5.15/420-mtd-set-rootfs-to-be-root-dev.patch +++ b/target/linux/generic/hack-5.15/420-mtd-set-rootfs-to-be-root-dev.patch @@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos #include #include -@@ -697,6 +698,16 @@ int add_mtd_device(struct mtd_info *mtd) +@@ -707,6 +708,16 @@ int add_mtd_device(struct mtd_info *mtd) of this try_ nonsense, and no bitching about it either. :) */ __module_get(THIS_MODULE); diff --git a/target/linux/generic/pending-5.15/495-mtd-core-add-get_mtd_device_by_node.patch b/target/linux/generic/pending-5.15/495-mtd-core-add-get_mtd_device_by_node.patch index a708a46b04..d1b2c9d1a5 100644 --- a/target/linux/generic/pending-5.15/495-mtd-core-add-get_mtd_device_by_node.patch +++ b/target/linux/generic/pending-5.15/495-mtd-core-add-get_mtd_device_by_node.patch @@ -17,7 +17,7 @@ Reviewed-by: Miquel Raynal --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c -@@ -1203,6 +1203,44 @@ out_unlock: +@@ -1213,6 +1213,44 @@ out_unlock: } EXPORT_SYMBOL_GPL(get_mtd_device_nm); diff --git a/target/linux/mediatek/patches-5.15/510-net-mediatek-add-flow-offload-for-mt7623.patch b/target/linux/mediatek/patches-5.15/510-net-mediatek-add-flow-offload-for-mt7623.patch index b521bd529d..deb25e652d 100644 --- a/target/linux/mediatek/patches-5.15/510-net-mediatek-add-flow-offload-for-mt7623.patch +++ b/target/linux/mediatek/patches-5.15/510-net-mediatek-add-flow-offload-for-mt7623.patch @@ -14,7 +14,7 @@ Signed-off-by: Frank Wunderlich --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3678,6 +3678,7 @@ static const struct mtk_soc_data mt2701_ +@@ -3675,6 +3675,7 @@ static const struct mtk_soc_data mt2701_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7623_CLKS_BITMAP, .required_pctl = true, diff --git a/target/linux/mediatek/patches-5.15/920-dts-mt7622-bpi-r64-fix-wps-button.patch b/target/linux/mediatek/patches-5.15/920-dts-mt7622-bpi-r64-fix-wps-button.patch new file mode 100644 index 0000000000..ba852ad286 --- /dev/null +++ b/target/linux/mediatek/patches-5.15/920-dts-mt7622-bpi-r64-fix-wps-button.patch @@ -0,0 +1,40 @@ +From dd1d420f40e75c3881a04001e6f2798492ee83c2 Mon Sep 17 00:00:00 2001 +From: Nick Hainke +Date: Thu, 30 Jun 2022 12:32:20 +0200 +Subject: [PATCH] arm64: dts: mt7622: fix BPI-R64 WPS button + +The bananapi R64 (BPI-R64) experiences wrong WPS button signals. +In OpenWrt pushing the WPS button while powering on the device will set +it to recovery mode. Currently, this also happens without any user +interaction. In particular, the wrong signals appear while booting the +device or restarting it, e.g. after doing a system upgrade. If the +device is in recovery mode the user needs to manually power cycle or +restart it. + +The official BPI-R64 sources set the WPS button to GPIO_ACTIVE_LOW in +the device tree. This setting seems to suppress the unwanted WPS button +press signals. So this commit changes the button from GPIO_ACTIVE_HIGH to +GPIO_ACTIVE_LOW. + +The official BPI-R64 sources can be found on +https://github.com/BPI-SINOVOIP/BPI-R64-openwrt + +Fixes: 0b6286dd96c0 ("arm64: dts: mt7622: add bananapi BPI-R64 board") + +Suggested-by: INAGAKI Hiroshi +Signed-off-by: Nick Hainke +--- + arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts ++++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +@@ -54,7 +54,7 @@ + wps { + label = "wps"; + linux,code = ; +- gpios = <&pio 102 GPIO_ACTIVE_HIGH>; ++ gpios = <&pio 102 GPIO_ACTIVE_LOW>; + }; + }; + diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts new file mode 100644 index 0000000000..efea79e2e2 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts @@ -0,0 +1,237 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + compatible = "beeline,smartbox-giga", "mediatek,mt7621-soc"; + model = "Beeline SmartBox GIGA"; + + aliases { + label-mac-device = &gmac0; + + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_red; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: led-0 { + label = "green:status"; + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + }; + + led-1 { + label = "blue:wan"; + color = ; + function = LED_FUNCTION_WAN; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + }; + + led_status_red: led-2 { + label = "red:status"; + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + ubi-concat { + compatible = "mtd-concat"; + devices = <&ubiconcat0 &ubiconcat1 &ubiconcat2 \ + &ubiconcat3>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "ubi"; + reg = <0x0 0x5400000>; + }; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "sercomm,sc-partitions", "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x100000>; + sercomm,scpart-id = <0>; + read-only; + }; + + partition@100000 { + label = "dynamic partition map"; + reg = <0x100000 0x100000>; + sercomm,scpart-id = <1>; + }; + + factory: partition@200000 { + label = "Factory"; + reg = <0x200000 0x100000>; + sercomm,scpart-id = <2>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_21000: macaddr@21000 { + reg = <0x21000 0x6>; + }; + }; + + partition@300000 { + label = "Boot Flag"; + reg = <0x300000 0x100000>; + sercomm,scpart-id = <3>; + }; + + partition@400000 { + label = "kernel"; + reg = <0x400000 0x600000>; + sercomm,scpart-id = <4>; + }; + + partition@a00000 { + label = "Kernel 2"; + reg = <0xa00000 0x600000>; + sercomm,scpart-id = <5>; + read-only; + }; + + ubiconcat0: partition@1000000 { + label = "File System 1"; + reg = <0x1000000 0x1800000>; + sercomm,scpart-id = <6>; + }; + + partition@2800000 { + label = "File System 2"; + reg = <0x2800000 0x1800000>; + sercomm,scpart-id = <7>; + read-only; + }; + + ubiconcat1: partition@4000000 { + label = "Configuration/log"; + reg = <0x4000000 0x800000>; + sercomm,scpart-id = <8>; + }; + + ubiconcat2: partition@4800000 { + label = "application tmp buffer (Ftool)"; + reg = <0x4800000 0xc00000>; + sercomm,scpart-id = <9>; + }; + + ubiconcat3: partition@5400000 { + label = "container"; + reg = <0x5400000 0x2800000>; + sercomm,scpart-id = <10>; + }; + + partition@7c00000 { + label = "bad block reserved"; + reg = <0x7c00000 0x380000>; + sercomm,scpart-id = <11>; + read-only; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + + nvmem-cells = <&macaddr_factory_21000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(5)>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + ieee80211-freq-limit = <2400000 2500000>; + + nvmem-cells = <&macaddr_factory_21000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(4)>; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_21000>; + nvmem-cell-names = "mac-address"; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "wan"; + + nvmem-cells = <&macaddr_factory_21000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(1)>; + }; + + port@1 { + status = "okay"; + label = "lan1"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + }; +}; + +&uartlite3 { + status = "okay"; +}; + +&state_default { + gpio { + groups = "i2c", "jtag"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_yuncore_ax820.dts b/target/linux/ramips/dts/mt7621_yuncore_ax820.dts index fe0e9daf7f..9638f1f060 100644 --- a/target/linux/ramips/dts/mt7621_yuncore_ax820.dts +++ b/target/linux/ramips/dts/mt7621_yuncore_ax820.dts @@ -10,10 +10,10 @@ model = "YunCore AX820"; aliases { - led-boot = &led_status_green; - led-failsafe = &led_status_green; - led-running = &led_status_green; - led-upgrade = &led_status_green; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; }; chosen { @@ -23,10 +23,30 @@ leds { compatible = "gpio-leds"; - led_status_green: status_green { - label = "green:status"; + /* At least 2 AX820 variants are known and cannot be distinguished (same hw rev): + - System LED green GPIO 15; red and blue apparently not connected + - System LED red GPIO 15, WLAN2G LED green GPIO 14, WLAN5G LED blue GPIO 16 + The canonical values taken from a Yuncore datasheet are: + - System LED green GPIO 15, WLAN2G LED blue GPIO 14, WLAN5G LED red GPIO 16 + All 3 colors relate to the same single RGB LED showing up on the front lightpipe. + As a result, all 3 LEDs are defined even if only one may be available, and + the color information is absent as it is not reliable */ + wlan2g { + label = "wlan2g"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0radio"; + }; + + led_system: system { + label = "system"; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; }; + + wlan5g { + label = "wlan5g"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1radio"; + }; }; watchdog { diff --git a/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts b/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts new file mode 100644 index 0000000000..81734ed4fb --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts @@ -0,0 +1,123 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7628an.dtsi" +#include +#include + +/ { + compatible = "comfast,cf-wr617ac", "mediatek,mt7628an-soc"; + model = "Comfast CF-WR617AC"; + + keys { + compatible = "gpio-keys"; + reset { + label = "reset"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + led_status_blue: status_blue { + label = "blue:status"; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + }; + led_status_red: status_red { + label = "red:status"; + gpios = <&gpio 37 GPIO_ACTIVE_LOW>; + }; + }; + + aliases { + led-boot = &led_status_red; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_red; + }; + + + chosen { + bootargs = "console=ttyS0,115200"; + }; + +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x760000>; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + mtd-mac-address = < 0x8004>; + mac-address-increment = <2>; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; +}; + +&esw { + mediatek,portmap = <0x2f>; +}; + +&wmac { + status = "okay"; + mediatek,mtd-eeprom = <&factory 0x0>; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + macaddr_factory_e000: macaddr@4 { + reg = <0xe000 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts new file mode 100644 index 0000000000..cdf259c51a --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an_xiaomi_mi-router-4.dtsi" + +/ { + compatible = "xiaomi,mi-router-4a-100m-intl", "mediatek,mt7628an-soc"; + model = "Xiaomi Mi Router 4A (100M International Edition)"; +}; + +&partitions { + partition@60000 { + label = "overlay"; + reg = <0x60000 0x200000>; + read-only; + }; + + partition@260000 { + label = "firmware"; + reg = <0x260000 0xda0000>; + compatible = "denx,uimage"; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +&esw { + mediatek,portmap = <0x3e>; + mediatek,portdisable = <0x2a>; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; +}; diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index f481e6e447..d48b220231 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -DEVICE_VARS += LOADER_TYPE LOADER_FLASH_OFFS +DEVICE_VARS += LOADER_TYPE LOADER_FLASH_OFFS LZMA_TEXT_START DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID DEVICE_VARS += BUFFALO_TAG_PLATFORM BUFFALO_TAG_VERSION BUFFALO_TAG_MINOR DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK @@ -22,6 +22,7 @@ ldrplatform-$(CONFIG_TARGET_ramips_mt7621) := mt7621 ldrflashstart-y := 0x1c000000 ldrflashstart-$(CONFIG_TARGET_ramips_mt7621) := 0x1fc00000 +LOADADDR := $(loadaddr-y) LOADER_PLATFORM := $(ldrplatform-y) LOADER_FLASH_START := $(ldrflashstart-y) @@ -45,7 +46,8 @@ define Build/loader-common PKG_BUILD_DIR="$@.src" \ TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \ BOARD="$(BOARDNAME)" PLATFORM="$(LOADER_PLATFORM)" \ - LZMA_TEXT_START=0x81800000 LOADADDR=$(KERNEL_LOADADDR) \ + LZMA_TEXT_START=$(LZMA_TEXT_START) \ + LOADADDR=$(LOADADDR) \ $(1) compile loader.$(LOADER_TYPE) mv "$@.$(LOADER_TYPE)" "$@" rm -rf $@.src @@ -176,6 +178,7 @@ define Device/Default PROFILES = Default KERNEL := $(KERNEL_DTB) | uImage lzma KERNEL_LOADADDR := $(loadaddr-y) + LZMA_TEXT_START := 0x81800000 SOC := $(DEFAULT_SOC) DEVICE_DTS_DIR := ../dts DEVICE_DTS = $$(SOC)_$(1) diff --git a/target/linux/ramips/image/common-sercomm.mk b/target/linux/ramips/image/common-sercomm.mk new file mode 100644 index 0000000000..e96cba879c --- /dev/null +++ b/target/linux/ramips/image/common-sercomm.mk @@ -0,0 +1,87 @@ +DEVICE_VARS += SERCOMM_KERNEL_OFFSET SERCOMM_ROOTFS_OFFSET + +define Build/sercomm-crypto + $(TOPDIR)/scripts/sercomm-crypto.py \ + --input-file $@ \ + --key-file $@.key \ + --output-file $@.ser \ + --version $(SERCOMM_SWVER) + $(STAGING_DIR_HOST)/bin/openssl enc -md md5 -aes-256-cbc \ + -in $@ \ + -out $@.enc \ + -K `cat $@.key` \ + -iv 00000000000000000000000000000000 + dd if=$@.enc >> $@.ser 2>/dev/null + mv $@.ser $@ + rm -f $@.enc $@.key +endef + +define Build/sercomm-kernel + $(TOPDIR)/scripts/sercomm-kernel-header.py \ + --kernel-image $@ \ + --kernel-offset $(SERCOMM_KERNEL_OFFSET) \ + --rootfs-offset $(SERCOMM_ROOTFS_OFFSET) \ + --output-header $@.hdr + dd if=$@ >> $@.hdr 2>/dev/null + mv $@.hdr $@ +endef + +define Build/sercomm-part-tag + $(call Build/sercomm-part-tag-common,$(word 1,$(1)) $@) +endef + +define Build/sercomm-part-tag-common + $(eval file=$(word 2,$(1))) + $(TOPDIR)/scripts/sercomm-partition-tag.py \ + --input-file $(file) \ + --output-file $(file).tmp \ + --part-name $(word 1,$(1)) \ + --part-version $(SERCOMM_SWVER) + mv $(file).tmp $(file) +endef + +define Build/sercomm-payload + $(TOPDIR)/scripts/sercomm-pid.py \ + --hw-version $(SERCOMM_HWVER) \ + --hw-id $(SERCOMM_HWID) \ + --sw-version $(SERCOMM_SWVER) \ + --pid-file $@.pid \ + --extra-padding-size 0x10 \ + --extra-padding-first-byte 0x0a + $(TOPDIR)/scripts/sercomm-payload.py \ + --input-file $@ \ + --output-file $@.tmp \ + --pid "$$(cat $@.pid | od -t x1 -An -v | tr -d '\n')" + mv $@.tmp $@ + rm $@.pid +endef + +define Build/sercomm-prepend-tagged-kernel + $(CP) $(IMAGE_KERNEL) $(IMAGE_KERNEL).tagged + $(call Build/sercomm-part-tag-common,$(word 1,$(1)) \ + $(IMAGE_KERNEL).tagged) + dd if=$@ >> $(IMAGE_KERNEL).tagged 2>/dev/null + mv $(IMAGE_KERNEL).tagged $@ +endef + +define Device/sercomm_dxx + $(Device/dsa-migration) + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 6144k + UBINIZE_OPTS := -E 5 + LOADER_TYPE := bin + KERNEL_LOADADDR := 0x81001000 + LZMA_TEXT_START := 0x82800000 + KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | lzma -a0 | \ + uImage lzma | sercomm-kernel + KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel | \ + lzma -a0 | uImage lzma + IMAGES += factory.img + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + IMAGE/factory.img := append-ubi | sercomm-part-tag rootfs | \ + sercomm-prepend-tagged-kernel kernel | gzip | sercomm-payload | \ + sercomm-crypto + SERCOMM_KERNEL_OFFSET := 0x400100 + SERCOMM_ROOTFS_OFFSET := 0x1000000 +endef diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 71ff8069da..eae4ee0d20 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -2,6 +2,7 @@ # MT7621 Profiles # +include ./common-sercomm.mk include ./common-tp-link.mk DEFAULT_SOC := mt7621 @@ -285,6 +286,19 @@ define Device/beeline_smartbox-flash endef TARGET_DEVICES += beeline_smartbox-flash +define Device/beeline_smartbox-giga + $(Device/sercomm_dxx) + IMAGE_SIZE := 24576k + SERCOMM_HWID := DBE + SERCOMM_HWVER := 10100 + SERCOMM_SWVER := 1001 + DEVICE_VENDOR := Beeline + DEVICE_MODEL := SmartBox GIGA + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap \ + kmod-usb3 uboot-envtools +endef +TARGET_DEVICES += beeline_smartbox-giga + define Device/buffalo_wsr-1166dhp $(Device/dsa-migration) $(Device/uimage-lzma-loader) diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 478b46abce..1203645d0e 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -107,6 +107,15 @@ define Device/buffalo_wcr-1166ds endef TARGET_DEVICES += buffalo_wcr-1166ds +define Device/comfast_cf-wr617ac + IMAGE_SIZE := 7872k + DTS := CF-WR617AC + DEVICE_VENDOR := Comfast + DEVICE_MODEL := CF-WR617AC + DEVICE_PACKAGES := kmod-mt76x2 kmod-rt2800-pci +endef +TARGET_DEVICES += comfast_cf-wr617ac + define Device/comfast_cf-wr758ac IMAGE_SIZE := 7872k DEVICE_VENDOR := COMFAST @@ -911,6 +920,16 @@ define Device/xiaomi_mi-router-4a-100m endef TARGET_DEVICES += xiaomi_mi-router-4a-100m +define Device/xiaomi_mi-router-4a-100m-intl + IMAGE_SIZE := 14976k + DEVICE_VENDOR := Xiaomi + DEVICE_MODEL := Mi Router 4A + DEVICE_VARIANT := 100M International Edition + DEVICE_PACKAGES := kmod-mt76x2 + SUPPORTED_DEVICES += xiaomi,mir4a-100m-intl +endef +TARGET_DEVICES += xiaomi_mi-router-4a-100m-intl + define Device/xiaomi_mi-router-4c IMAGE_SIZE := 14976k DEVICE_VENDOR := Xiaomi diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 37207a52d3..0caa23feac 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -23,7 +23,8 @@ asus,rt-n56u-b1) ucidef_set_led_netdev "lan" "LAN link" "blue:lan" "br-lan" ucidef_set_led_netdev "wan" "WAN link" "blue:wan" "wan" ;; -beeline,smartbox-flash) +beeline,smartbox-flash|\ +beeline,smartbox-giga) ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" ;; cudy,wr2100) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 29336bad68..8abee198a5 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -42,6 +42,7 @@ ramips_setup_interfaces() ;; asiarf,ap7621-nv1|\ beeline,smartbox-flash|\ + beeline,smartbox-giga|\ glinet,gl-mt1300|\ iptime,a3002mesh|\ jcg,q20|\ diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index b4dc34fbec..7d44fcf90f 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -55,6 +55,7 @@ platform_do_upgrade() { asus,rt-ac85p|\ asus,rt-ax53u|\ beeline,smartbox-flash|\ + beeline,smartbox-giga|\ dlink,dir-1960-a1|\ dlink,dir-2640-a1|\ dlink,dir-2660-a1|\ diff --git a/target/linux/ramips/mt7621/config-5.10 b/target/linux/ramips/mt7621/config-5.10 index 804dbe3edb..182da755cf 100644 --- a/target/linux/ramips/mt7621/config-5.10 +++ b/target/linux/ramips/mt7621/config-5.10 @@ -162,6 +162,7 @@ CONFIG_MTD_NAND_MTK_BMT=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_RAW_NAND=y CONFIG_MTD_ROUTERBOOT_PARTS=y +CONFIG_MTD_SERCOMM_PARTS=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE=y CONFIG_MTD_SPLIT_FIT_FW=y diff --git a/target/linux/ramips/mt7621/config-5.15 b/target/linux/ramips/mt7621/config-5.15 index 02d934e11b..3072a5177e 100644 --- a/target/linux/ramips/mt7621/config-5.15 +++ b/target/linux/ramips/mt7621/config-5.15 @@ -169,6 +169,7 @@ CONFIG_MTD_NAND_MTK_BMT=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_RAW_NAND=y CONFIG_MTD_ROUTERBOOT_PARTS=y +CONFIG_MTD_SERCOMM_PARTS=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE=y CONFIG_MTD_SPLIT_FIT_FW=y diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 408f5f5e01..1c3d43d821 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -77,6 +77,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "3:lan" "4:wan" "6@eth0" ;; + comfast,cf-wr617ac) + ucidef_add_switch "switch0" \ + "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0" + ;; comfast,cf-wr758ac-v1|\ comfast,cf-wr758ac-v2|\ tplink,tl-wr902ac-v3|\ @@ -148,7 +152,8 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:wan" "3:lan" "4:lan" "6@eth0" ;; - xiaomi,mi-router-4a-100m) + xiaomi,mi-router-4a-100m|\ + xiaomi,mi-router-4a-100m-intl) ucidef_add_switch "switch0" \ "4:lan:1" "2:lan:2" "0:wan" "6@eth0" ;; @@ -191,6 +196,10 @@ ramips_setup_macs() lan_mac=$wan_mac label_mac=$wan_mac ;; + comfast,cf-wr617ac) + lan_mac=$(mtd_get_mac_binary factory 0xe000) + wan_mac=$(macaddr_add "$lan_mac" 1) + ;; cudy,wr1000|\ hilink,hlk-7628n|\ hilink,hlk-7688a|\ @@ -272,6 +281,7 @@ ramips_setup_macs() wan_mac=$(mtd_get_mac_binary factory 0x28) ;; xiaomi,mi-router-4a-100m|\ + xiaomi,mi-router-4a-100m-intl|\ xiaomi,mi-router-4c) wan_mac=$(mtd_get_mac_binary factory 0x4) ;; diff --git a/target/linux/ramips/patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch b/target/linux/ramips/patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch index 267d3d5dd6..f6ac8360ee 100644 --- a/target/linux/ramips/patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch +++ b/target/linux/ramips/patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch @@ -14,7 +14,7 @@ Signed-off-by: René van Dorst --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3293,6 +3293,7 @@ static const struct net_device_ops mtk_n +@@ -3290,6 +3290,7 @@ static const struct net_device_ops mtk_n static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) { @@ -22,7 +22,7 @@ Signed-off-by: René van Dorst const __be32 *_id = of_get_property(np, "reg", NULL); phy_interface_t phy_mode; struct phylink *phylink; -@@ -3388,6 +3389,9 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -3385,6 +3386,9 @@ static int mtk_add_mac(struct mtk_eth *e else eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH_2K - MTK_RX_ETH_HLEN; diff --git a/target/linux/ramips/patches-5.15/840-serial-add-ugly-custom-baud-rate-hack.patch b/target/linux/ramips/patches-5.15/840-serial-add-ugly-custom-baud-rate-hack.patch index d7cf2dfd48..7148bb16f3 100644 --- a/target/linux/ramips/patches-5.15/840-serial-add-ugly-custom-baud-rate-hack.patch +++ b/target/linux/ramips/patches-5.15/840-serial-add-ugly-custom-baud-rate-hack.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c -@@ -401,6 +401,9 @@ uart_get_baud_rate(struct uart_port *por +@@ -393,6 +393,9 @@ uart_get_baud_rate(struct uart_port *por break; } diff --git a/target/linux/realtek/dts-5.10/rtl8380_engenius_ews2910p.dts b/target/linux/realtek/dts-5.10/rtl8380_engenius_ews2910p.dts index f87c9585f9..dd57b2bf48 100644 --- a/target/linux/realtek/dts-5.10/rtl8380_engenius_ews2910p.dts +++ b/target/linux/realtek/dts-5.10/rtl8380_engenius_ews2910p.dts @@ -43,6 +43,13 @@ gpio-controller; indirect-access-bus-id = <0>; + poe_enable { + gpio-hog; + gpios = <1 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "poe-enable"; + }; + sff_p9_gpios { gpio-hog; gpios = < 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>,