From a68db5f2dff5ab808b1a3ad792a7edd8fd0e1423 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sat, 28 Mar 2020 23:37:17 +0800 Subject: [PATCH] treewide: sync with upstream source --- package/devel/gdb-arc/Makefile | 94 --- .../patches/100-no_extern_inline.patch | 32 - .../gdb-arc/patches/110-no_testsuite.patch | 21 - .../120-fix-compile-flag-mismatch.patch | 11 - package/libs/gettext-full/Makefile | 5 +- package/libs/gmp/Makefile | 3 +- package/libs/libconfig/Makefile | 5 +- package/libs/libcxx/Makefile | 14 +- package/libs/libevent2/Makefile | 13 +- package/libs/libiconv-full/Makefile | 8 +- package/libs/libiconv/COPYING | 0 package/libs/libiconv/COPYRIGHT | 0 package/libs/libjson-c/Makefile | 7 +- package/libs/libjson-c/patches/000-libm.patch | 31 +- package/libs/libnetfilter-conntrack/Makefile | 9 +- package/libs/libnetfilter-cthelper/Makefile | 3 +- package/libs/libnetfilter-cttimeout/Makefile | 3 +- package/libs/libnetfilter-log/Makefile | 3 +- package/libs/libnetfilter-queue/Makefile | 3 +- package/libs/libnfnetlink/Makefile | 8 +- package/libs/libroxml/Makefile | 9 +- package/libs/libtool/Makefile | 3 +- package/libs/libunwind/Makefile | 14 +- .../libunwind/patches/001-disable-tests.patch | 11 - package/libs/libusb-compat/Makefile | 3 +- package/libs/libusb/Makefile | 5 +- package/libs/lzo/Makefile | 5 +- package/libs/popt/Makefile | 10 +- package/libs/sysfsutils/Makefile | 5 +- package/libs/sysfsutils/files/sysfsutils | 0 .../toolchain/eglibc-files/etc/nsswitch.conf | 13 - package/libs/uclient/Makefile | 9 +- .../config/firewall/files/firewall.hotplug | 0 package/network/ipv6/6rd/files/6rd.sh | 0 package/network/ipv6/ds-lite/files/dslite.sh | 0 .../network/services/ead/src/tinysrp/missing | 0 .../services/ead/src/tinysrp/mkinstalldirs | 0 .../network/services/ead/src/tinysrp/t_pw.c | 4 +- .../services/igmpproxy/files/igmpproxy.init | 0 .../services/odhcpd/files/odhcpd.defaults | 0 .../network/services/odhcpd/files/odhcpd.init | 0 package/network/services/omcproxy/Makefile | 14 +- .../services/omcproxy/files/omcproxy.init | 99 +-- ...-use-cpu_to_be32-outside-of-function.patch | 35 - .../services/openvpn/files/openvpn.init | 5 +- .../services/openvpn/files/openvpn.options | 3 +- .../network/services/relayd/files/relay.init | 0 .../network/services/umdns/files/umdns.init | 0 .../adb-enablemodem/files/adb-enablemodem | 0 package/network/utils/comgt/Makefile | 6 +- package/network/utils/comgt/files/3g.sh | 4 + package/network/utils/comgt/files/3g.usb | 8 +- package/network/utils/comgt/files/directip.sh | 0 package/network/utils/comgt/files/ncm.sh | 0 .../network/utils/conntrack-tools/Makefile | 79 --- .../conntrack-tools/files/conntrackd.init | 18 - package/network/utils/dante/Makefile | 5 +- package/network/utils/iftop/Makefile | 6 +- package/network/utils/iputils/Makefile | 182 ----- .../utils/iputils/patches/001-iputils.patch | 14 - .../utils/iputils/patches/002-fix-ipv6.patch | 14 - .../iputils/patches/003-fix-makefile.patch | 18 - .../patches/010-ping6_uclibc_resolv.patch | 200 ------ .../patches/011-ping6_use_gnu_source.patch | 11 - .../iputils/patches/020-include_fixes.patch | 71 -- package/network/utils/iw/Makefile | 5 +- package/network/utils/iw/iw/Makefile | 74 +++ .../iw/iw/patches/001-nl80211_h_sync.patch | 629 ++++++++++++++++++ .../iw/iw/patches/120-antenna_gain.patch | 33 + .../utils/iw/iw/patches/200-reduce_size.patch | 355 ++++++++++ .../utils/iw/patches/001-nl80211_h_sync.patch | 626 +---------------- .../utils/iw/patches/120-antenna_gain.patch | 8 +- .../iw/patches/130-survey-bss-rx-time.patch | 12 + .../utils/iw/patches/200-reduce_size.patch | 118 ++-- .../network/utils/layerscape/restool/Makefile | 6 +- .../network/utils/linux-atm/files/atm.hotplug | 0 .../network/utils/linux-atm/files/br2684-up | 0 .../utils/linux-atm/files/br2684ctl_wrap | 0 .../linux-atm/patches/300-objcopy_path.patch | 40 ++ .../linux-atm/patches/rtability_fixes.patch | 0 package/network/utils/phytool/Makefile | 47 -- package/network/utils/rssileds/Makefile | 4 +- .../utils/rssileds/files/rssileds.init | 2 +- package/network/utils/umbim/Makefile | 7 +- .../utils/uqmi/files/lib/netifd/proto/qmi.sh | 20 +- package/network/utils/wireless-tools/Makefile | 3 +- package/network/utils/wpan-tools/Makefile | 4 - package/network/utils/wwan/Makefile | 2 +- package/network/utils/wwan/files/wwan.sh | 65 +- package/network/utils/wwan/files/wwan.usb | 0 package/network/utils/wwan/files/wwan.usbmisc | 3 +- package/utils/admswconfig/Makefile | 53 -- package/utils/admswconfig/files/admswconfig | 68 -- .../utils/admswconfig/files/admswswitch.sh | 28 - .../admswconfig/patches/001-matrix.patch | 15 - .../admswconfig/patches/002-fix-musl.patch | 11 - package/utils/busybox/Config-defaults.in | 1 + package/utils/ct-bugcheck/src/bugcheck.sh | 2 +- package/utils/fuse/Makefile | 3 +- package/utils/mtd-utils/Makefile | 6 +- ...rrect-error-number-in-ubi_get_vol_in.patch | 30 - package/utils/px5g/Makefile | 5 +- package/utils/px5g/px5g.c | 86 ++- package/utils/spidev_test/Makefile | 27 +- package/utils/spidev_test/src/spidev_test.c | 318 --------- 105 files changed, 1609 insertions(+), 2263 deletions(-) delete mode 100644 package/devel/gdb-arc/Makefile delete mode 100644 package/devel/gdb-arc/patches/100-no_extern_inline.patch delete mode 100644 package/devel/gdb-arc/patches/110-no_testsuite.patch delete mode 100644 package/devel/gdb-arc/patches/120-fix-compile-flag-mismatch.patch mode change 100755 => 100644 package/libs/libiconv/COPYING mode change 100755 => 100644 package/libs/libiconv/COPYRIGHT delete mode 100644 package/libs/libunwind/patches/001-disable-tests.patch mode change 100755 => 100644 package/libs/sysfsutils/files/sysfsutils delete mode 100644 package/libs/toolchain/eglibc-files/etc/nsswitch.conf mode change 100755 => 100644 package/network/config/firewall/files/firewall.hotplug mode change 100755 => 100644 package/network/ipv6/6rd/files/6rd.sh mode change 100755 => 100644 package/network/ipv6/ds-lite/files/dslite.sh mode change 100644 => 100755 package/network/services/ead/src/tinysrp/missing mode change 100644 => 100755 package/network/services/ead/src/tinysrp/mkinstalldirs mode change 100755 => 100644 package/network/services/igmpproxy/files/igmpproxy.init mode change 100755 => 100644 package/network/services/odhcpd/files/odhcpd.defaults mode change 100755 => 100644 package/network/services/odhcpd/files/odhcpd.init mode change 100755 => 100644 package/network/services/omcproxy/files/omcproxy.init delete mode 100644 package/network/services/omcproxy/patches/100-mrib.c-don-t-use-cpu_to_be32-outside-of-function.patch mode change 100755 => 100644 package/network/services/openvpn/files/openvpn.init mode change 100755 => 100644 package/network/services/relayd/files/relay.init mode change 100755 => 100644 package/network/services/umdns/files/umdns.init mode change 100755 => 100644 package/network/utils/adb-enablemodem/files/adb-enablemodem mode change 100755 => 100644 package/network/utils/comgt/files/3g.sh mode change 100755 => 100644 package/network/utils/comgt/files/directip.sh mode change 100755 => 100644 package/network/utils/comgt/files/ncm.sh delete mode 100644 package/network/utils/conntrack-tools/Makefile delete mode 100755 package/network/utils/conntrack-tools/files/conntrackd.init delete mode 100644 package/network/utils/iputils/Makefile delete mode 100644 package/network/utils/iputils/patches/001-iputils.patch delete mode 100644 package/network/utils/iputils/patches/002-fix-ipv6.patch delete mode 100644 package/network/utils/iputils/patches/003-fix-makefile.patch delete mode 100644 package/network/utils/iputils/patches/010-ping6_uclibc_resolv.patch delete mode 100644 package/network/utils/iputils/patches/011-ping6_use_gnu_source.patch delete mode 100644 package/network/utils/iputils/patches/020-include_fixes.patch create mode 100644 package/network/utils/iw/iw/Makefile create mode 100644 package/network/utils/iw/iw/patches/001-nl80211_h_sync.patch create mode 100644 package/network/utils/iw/iw/patches/120-antenna_gain.patch create mode 100644 package/network/utils/iw/iw/patches/200-reduce_size.patch create mode 100644 package/network/utils/iw/patches/130-survey-bss-rx-time.patch mode change 100755 => 100644 package/network/utils/linux-atm/files/atm.hotplug mode change 100755 => 100644 package/network/utils/linux-atm/files/br2684-up mode change 100755 => 100644 package/network/utils/linux-atm/files/br2684ctl_wrap create mode 100644 package/network/utils/linux-atm/patches/300-objcopy_path.patch delete mode 100644 package/network/utils/linux-atm/patches/rtability_fixes.patch delete mode 100644 package/network/utils/phytool/Makefile mode change 100755 => 100644 package/network/utils/rssileds/files/rssileds.init mode change 100755 => 100644 package/network/utils/wwan/files/wwan.usb mode change 100755 => 100644 package/network/utils/wwan/files/wwan.usbmisc delete mode 100644 package/utils/admswconfig/Makefile delete mode 100644 package/utils/admswconfig/files/admswconfig delete mode 100644 package/utils/admswconfig/files/admswswitch.sh delete mode 100644 package/utils/admswconfig/patches/001-matrix.patch delete mode 100644 package/utils/admswconfig/patches/002-fix-musl.patch delete mode 100644 package/utils/mtd-utils/patches/200-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch delete mode 100644 package/utils/spidev_test/src/spidev_test.c diff --git a/package/devel/gdb-arc/Makefile b/package/devel/gdb-arc/Makefile deleted file mode 100644 index 7d087ffcb6..0000000000 --- a/package/devel/gdb-arc/Makefile +++ /dev/null @@ -1,94 +0,0 @@ -# -# Copyright (C) 2006-2016 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:=gdb-arc -PKG_VERSION:=arc-2017.09-gdb -PKG_RELEASE:=1 - -PKG_SOURCE:=gdb-arc-2017.09-gdb.tar.gz -PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/$(PKG_VERSION) -PKG_HASH:=6a91f86cc487c1548d3f5d4f29f7226d2019c0db8a63633aeabd5914a340f3f9 - -PKG_BUILD_DIR:=$(BUILD_DIR)/binutils-gdb-arc-2017.09-gdb - -PKG_BUILD_PARALLEL:=1 -PKG_INSTALL:=1 -PKG_LICENSE:=GPL-3.0+ - -include $(INCLUDE_DIR)/package.mk - -define Package/gdb-arc/Default - SECTION:=devel - CATEGORY:=Development - DEPENDS:=+!USE_MUSL:libthread-db +PACKAGE_zlib:zlib @arc - URL:=http://www.gnu.org/software/gdb/ -endef - -define Package/gdb-arc -$(call Package/gdb-arc/Default) - TITLE:=GNU Debugger for ARC - DEPENDS+=+libreadline +libncurses +zlib -endef - -define Package/gdb-arc/description -GDB, the GNU Project debugger, allows you to see what is going on `inside' -another program while it executes -- or what another program was doing at the -moment it crashed. -endef - -define Package/gdbserver-arc -$(call Package/gdb-arc/Default) - TITLE:=Remote server for GNU Debugger -endef - -define Package/gdbserver-arc/description -GDBSERVER is a program that allows you to run GDB on a different machine than the -one which is running the program being debugged. -endef - -# XXX: add --disable-werror to prevent build failure with arm -CONFIGURE_ARGS+= \ - --with-system-readline \ - --without-expat \ - --without-lzma \ - --disable-werror \ - --disable-binutils \ - --disable-ld \ - --disable-gas \ - --disable-sim - -CONFIGURE_VARS+= \ - ac_cv_search_tgetent="$(TARGET_LDFLAGS) -lncurses -lreadline" - -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - CPPFLAGS="$(TARGET_CPPFLAGS)" \ - all -endef - -define Build/Install - $(MAKE) -C $(PKG_BUILD_DIR) \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - CPPFLAGS="$(TARGET_CPPFLAGS)" \ - install-gdb -endef - -define Package/gdb-arc/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gdb $(1)/usr/bin/ -endef - -define Package/gdbserver-arc/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gdbserver $(1)/usr/bin/ -endef - -$(eval $(call BuildPackage,gdb-arc)) -$(eval $(call BuildPackage,gdbserver-arc)) diff --git a/package/devel/gdb-arc/patches/100-no_extern_inline.patch b/package/devel/gdb-arc/patches/100-no_extern_inline.patch deleted file mode 100644 index 8c18c6e2e7..0000000000 --- a/package/devel/gdb-arc/patches/100-no_extern_inline.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/sim/common/sim-arange.c -+++ b/sim/common/sim-arange.c -@@ -280,11 +280,7 @@ sim_addr_range_delete (ADDR_RANGE *ar, a - build_search_tree (ar); - } - --#endif /* DEFINE_NON_INLINE_P */ -- --#if DEFINE_INLINE_P -- --SIM_ARANGE_INLINE int -+int - sim_addr_range_hit_p (ADDR_RANGE *ar, address_word addr) - { - ADDR_RANGE_TREE *t = ar->range_tree; -@@ -301,4 +297,4 @@ sim_addr_range_hit_p (ADDR_RANGE *ar, ad - return 0; - } - --#endif /* DEFINE_INLINE_P */ -+#endif /* DEFINE_NON_INLINE_P */ ---- a/sim/common/sim-arange.h -+++ b/sim/common/sim-arange.h -@@ -73,7 +73,7 @@ extern void sim_addr_range_delete (ADDR_ - - /* Return non-zero if ADDR is in range AR, traversing the entire tree. - If no range is specified, that is defined to mean "everything". */ --SIM_ARANGE_INLINE int -+extern int - sim_addr_range_hit_p (ADDR_RANGE * /*ar*/, address_word /*addr*/); - #define ADDR_RANGE_HIT_P(ar, addr) \ - ((ar)->range_tree == NULL || sim_addr_range_hit_p ((ar), (addr))) diff --git a/package/devel/gdb-arc/patches/110-no_testsuite.patch b/package/devel/gdb-arc/patches/110-no_testsuite.patch deleted file mode 100644 index 1b284ea767..0000000000 --- a/package/devel/gdb-arc/patches/110-no_testsuite.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/gdb/configure -+++ b/gdb/configure -@@ -870,8 +870,7 @@ MAKEINFOFLAGS - YACC - YFLAGS - XMKMF' --ac_subdirs_all='testsuite --gdbtk -+ac_subdirs_all='gdbtk - multi-ice - gdbserver' - -@@ -5610,7 +5610,7 @@ $as_echo "$with_auto_load_safe_path" >&6 - - - --subdirs="$subdirs testsuite" -+subdirs="$subdirs" - - - # Check whether to support alternative target configurations diff --git a/package/devel/gdb-arc/patches/120-fix-compile-flag-mismatch.patch b/package/devel/gdb-arc/patches/120-fix-compile-flag-mismatch.patch deleted file mode 100644 index c8b41f264a..0000000000 --- a/package/devel/gdb-arc/patches/120-fix-compile-flag-mismatch.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gdb/gdbserver/configure -+++ b/gdb/gdbserver/configure -@@ -2468,7 +2468,7 @@ $as_echo "$as_me: error: \`$ac_var' was - ac_cache_corrupted=: ;; - ,);; - *) -- if test "x$ac_old_val" != "x$ac_new_val"; then -+ if test "`echo x$ac_old_val`" != "`echo x$ac_new_val`"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` diff --git a/package/libs/gettext-full/Makefile b/package/libs/gettext-full/Makefile index 4cb8d8d618..2e65571701 100644 --- a/package/libs/gettext-full/Makefile +++ b/package/libs/gettext-full/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gettext-full PKG_VERSION:=0.19.8.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=gettext-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gettext @@ -34,6 +34,7 @@ define Package/libintl-full CATEGORY:=Libraries TITLE:=GNU Internationalization library URL:=http://www.gnu.org/software/gettext/ + ABI_VERSION:=8 endef TARGET_CFLAGS += $(FPIC) @@ -94,7 +95,7 @@ endef define Package/libintl-full/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libintl.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libintl.so.* $(1)/usr/lib/ endef $(eval $(call HostBuild)) diff --git a/package/libs/gmp/Makefile b/package/libs/gmp/Makefile index b5737505b7..4ea69019f6 100644 --- a/package/libs/gmp/Makefile +++ b/package/libs/gmp/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gmp PKG_VERSION:=6.1.2 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)$(PKG_REVISION).tar.xz PKG_SOURCE_URL:=@GNU/gmp/ @@ -30,6 +30,7 @@ define Package/libgmp CATEGORY:=Libraries TITLE:=GNU multiprecision arithmetic library URL:=http://gmplib.org/ + ABI_VERSION:=10 endef define Package/libgmp/description diff --git a/package/libs/libconfig/Makefile b/package/libs/libconfig/Makefile index d7b2f312b9..39fcddf082 100644 --- a/package/libs/libconfig/Makefile +++ b/package/libs/libconfig/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libconfig PKG_VERSION:=1.7.2 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://hyperrealm.github.io/libconfig/dist/ @@ -28,6 +28,7 @@ define Package/libconfig CATEGORY:=Libraries TITLE:=Configuration File Library URL:=http://www.hyperrealm.com/libconfig/ + ABI_VERSION:=11 endef define Package/libconfig/description @@ -53,7 +54,7 @@ endef define Package/libconfig/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libconfig.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libconfig.so.* $(1)/usr/lib/ endef $(eval $(call BuildPackage,libconfig)) diff --git a/package/libs/libcxx/Makefile b/package/libs/libcxx/Makefile index c1fa1d6b07..8343cbb427 100644 --- a/package/libs/libcxx/Makefile +++ b/package/libs/libcxx/Makefile @@ -1,3 +1,4 @@ + # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -7,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libcxx PKG_VERSION:=9.0.1 -PKG_RELEASE:=1 +PKG_RELEASE:=4 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://git.llvm.org/git/libcxx PKG_SOURCE_VERSION:=2076f539f410805ef88692b9c0ce0a0b882a7680 -PKG_MIRROR_HASH:=6dff036660d478bfaa14e407fc5de26d22da1087118c897b1a3ad2e90cb7bf39 +PKG_MIRROR_HASH:=d527880a18dec9109575c76717cf5288fb91c11381b9d261cae2e5bebcbdab2e PKG_MAINTAINER:=Rosen Penev PKG_LICENSE:=MIT @@ -37,16 +38,19 @@ define Package/libcxx/description endef CMAKE_OPTIONS += \ + -DLIBCXX_CXX_ABI="libsupc++" \ + -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/include/c++/$(CONFIG_GCC_VERSION);$(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/include/c++/$(CONFIG_GCC_VERSION)/$(REAL_GNU_TARGET_NAME)" \ -DLIBCXX_ENABLE_ASSERTIONS=OFF \ -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF \ -DLIBCXX_INCLUDE_BENCHMARKS=OFF \ -DLIBCXX_INCLUDE_DOCS=OFF \ -DLIBCXX_INCLUDE_TESTS=OFF \ - -DLIBCXX_HAS_MUSL_LIBC=ON \ - -DLIBCXX_STANDALONE_BUILD=ON + -DLIBCXX_LIBDIR_SUFFIX="" \ + -DLIBCXX_STANDALONE_BUILD=ON \ + -DLIBCXX_HAS_MUSL_LIBC=$(if $(CONFIG_USE_MUSL),ON,OFF) TARGET_CXXFLAGS += -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -Wno-attributes -flto -TARGET_LDFLAGS += -Wl,--as-needed +TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed define Build/InstallDev $(call Build/InstallDev/cmake,$(1)) diff --git a/package/libs/libevent2/Makefile b/package/libs/libevent2/Makefile index 687f1b93a7..b949c9f9d6 100644 --- a/package/libs/libevent2/Makefile +++ b/package/libs/libevent2/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libevent2 PKG_VERSION:=2.1.11 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=libevent-$(PKG_VERSION)-stable.tar.gz PKG_SOURCE_URL:=https://github.com/libevent/libevent/releases/download/release-$(PKG_VERSION)-stable @@ -18,6 +18,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/libevent-$(PKG_VERSION)-stable PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE PKG_CPE_ID:=cpe:/a:libevent_project:libevent PKG_CONFIG_DEPENDS:= \ @@ -124,13 +125,9 @@ CMAKE_OPTIONS += \ -DBUILD_TESTING:BOOL=OFF define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include - $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent*.{a,so}* $(1)/usr/lib/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/cmake $(1)/usr/lib/ - $(INSTALL_DIR) $(1)/usr/lib/pkgconfig - $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libevent*.pc $(1)/usr/lib/pkgconfig/ + $(call Build/InstallDev/cmake,$(1)) + $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libevent*.pc + $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libevent*.pc endef define Package/libevent2/install diff --git a/package/libs/libiconv-full/Makefile b/package/libs/libiconv-full/Makefile index ac7bfddf56..b01db76d2a 100644 --- a/package/libs/libiconv-full/Makefile +++ b/package/libs/libiconv-full/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libiconv-full PKG_VERSION:=1.11.1 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_MAINTAINER:=Jo-Philipp Wich @@ -34,6 +34,7 @@ define Package/libiconv-full SECTION:=libs CATEGORY:=Libraries TITLE+= library + ABI_VERSION:=2 endef define Package/libcharset @@ -41,6 +42,7 @@ define Package/libcharset SECTION:=libs CATEGORY:=Libraries TITLE+= library + ABI_VERSION:=1 endef define Package/iconv @@ -77,12 +79,12 @@ endef define Package/libcharset/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcharset.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcharset.so.* $(1)/usr/lib/ endef define Package/libiconv-full/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libiconv.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libiconv.so.* $(1)/usr/lib/ endef define Package/iconv/install diff --git a/package/libs/libiconv/COPYING b/package/libs/libiconv/COPYING old mode 100755 new mode 100644 diff --git a/package/libs/libiconv/COPYRIGHT b/package/libs/libiconv/COPYRIGHT old mode 100755 new mode 100644 diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile index 118d618a6f..b61d99cc99 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.12.1 -PKG_RELEASE:=2 +PKG_VERSION:=0.13.1 +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:=5a617da9aade997938197ef0f8aabd7f97b670c216dc173977e1d56eef9e1291 +PKG_HASH:=94a26340c0785fcff4f46ff38609cf84ebcd670df0c8efd75d039cc951d80132 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) @@ -38,6 +38,7 @@ define Package/libjson-c CATEGORY:=Libraries TITLE:=javascript object notation URL:=https://json-c.github.io/json-c/ + ABI_VERSION:=4 endef define Package/libjson-c/description diff --git a/package/libs/libjson-c/patches/000-libm.patch b/package/libs/libjson-c/patches/000-libm.patch index 45adb0597f..de98e35d43 100644 --- a/package/libs/libjson-c/patches/000-libm.patch +++ b/package/libs/libjson-c/patches/000-libm.patch @@ -1,8 +1,8 @@ --- a/configure.ac +++ b/configure.ac -@@ -43,12 +43,6 @@ - AC_FUNC_MALLOC - AC_FUNC_REALLOC +@@ -76,12 +76,6 @@ AC_FUNC_VPRINTF + AC_FUNC_MEMCMP + AC_CHECK_FUNCS([realloc]) AC_CHECK_FUNCS(strcasecmp strdup strerror snprintf vsnprintf vasprintf open vsyslog strncasecmp setlocale) -AC_CHECK_DECLS([INFINITY], [], [], [[#include ]]) -AC_CHECK_DECLS([nan], [], [], [[#include ]]) @@ -10,16 +10,16 @@ -AC_CHECK_DECLS([isinf], [], [], [[#include ]]) -AC_CHECK_DECLS([_isnan], [], [], [[#include ]]) -AC_CHECK_DECLS([_finite], [], [], [[#include ]]) - - #check if .section.gnu.warning accepts long strings (for __warn_references) - AC_LANG_PUSH([C]) + AC_MSG_CHECKING(for GCC atomic builtins) + AC_LINK_IFELSE( + [ --- a/math_compat.h +++ b/math_compat.h -@@ -1,28 +1,9 @@ - #ifndef __math_compat_h - #define __math_compat_h +@@ -6,31 +6,9 @@ + * @brief Do not use, json-c internal, may be changed or removed at any time. + */ --/* Define isnan and isinf on Windows/MSVC */ +-/* Define isnan, isinf, infinity and nan on Windows/MSVC */ - -#ifndef HAVE_DECL_ISNAN -# ifdef HAVE_DECL__ISNAN @@ -35,12 +35,15 @@ -# endif -#endif - --#ifndef HAVE_DECL_NAN --#error This platform does not have nan() +-#ifndef HAVE_DECL_INFINITY +-#include +-#define INFINITY (DBL_MAX + DBL_MAX) +-#define HAVE_DECL_INFINITY -#endif - --#ifndef HAVE_DECL_INFINITY --#error This platform does not have INFINITY +-#ifndef HAVE_DECL_NAN +-#define NAN (INFINITY - INFINITY) +-#define HAVE_DECL_NAN -#endif +#undef isnan +#define isnan(x) __builtin_isnan(x) diff --git a/package/libs/libnetfilter-conntrack/Makefile b/package/libs/libnetfilter-conntrack/Makefile index be82285317..a97482ecc0 100644 --- a/package/libs/libnetfilter-conntrack/Makefile +++ b/package/libs/libnetfilter-conntrack/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnetfilter_conntrack -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://git.netfilter.org/libnetfilter_conntrack -PKG_SOURCE_DATE:=2017-07-25 -PKG_SOURCE_VERSION:=e870432649955d377a73ee5a72cb23f0f6b5e4c5 -PKG_MIRROR_HASH:=6891e6bea956d5d3514524918f439dfe8b5806397d8d40d1afc69b9bfebc1d57 +PKG_SOURCE_DATE:=2018-05-01 +PKG_SOURCE_VERSION:=3ccae9f5b2a9564cd63699ba60e54a46bc0d73b6 +PKG_MIRROR_HASH:=c978ef0fa5b7379de2909ca5d9c599ac63b4f8166f5971d58f6e074a922d996f PKG_MAINTAINER:=Jo-Philipp Wich @@ -31,6 +31,7 @@ define Package/libnetfilter-conntrack DEPENDS:=+libnfnetlink +kmod-nf-conntrack-netlink +libmnl TITLE:=API to the in-kernel connection tracking state table URL:=http://www.netfilter.org/projects/libnetfilter_conntrack/ + ABI_VERSION:=3 endef define Package/libnetfilter-conntrack/description diff --git a/package/libs/libnetfilter-cthelper/Makefile b/package/libs/libnetfilter-cthelper/Makefile index a67296a1f2..3a28f186aa 100644 --- a/package/libs/libnetfilter-cthelper/Makefile +++ b/package/libs/libnetfilter-cthelper/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnetfilter_cthelper PKG_VERSION:=1.0.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ @@ -30,6 +30,7 @@ define Package/libnetfilter-cthelper DEPENDS:=+libmnl TITLE:=API to the in-kernel connection tracking helper infrastructure URL:=http://www.netfilter.org/projects/libnetfilter_cthelper/ + ABI_VERSION:=0 endef define Package/libnetfilter-cthelper/description diff --git a/package/libs/libnetfilter-cttimeout/Makefile b/package/libs/libnetfilter-cttimeout/Makefile index acd1b7b342..3cb7d5cf93 100644 --- a/package/libs/libnetfilter-cttimeout/Makefile +++ b/package/libs/libnetfilter-cttimeout/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnetfilter_cttimeout PKG_VERSION:=1.0.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ @@ -30,6 +30,7 @@ define Package/libnetfilter-cttimeout DEPENDS:=+libmnl TITLE:=API to the in-kernel connection tracking timeout infrastructure URL:=http://www.netfilter.org/projects/libnetfilter_cttimeout/ + ABI_VERSION:=1 endef define Package/libnetfilter-cttimeout/description diff --git a/package/libs/libnetfilter-log/Makefile b/package/libs/libnetfilter-log/Makefile index c80c46f930..642a462e15 100644 --- a/package/libs/libnetfilter-log/Makefile +++ b/package/libs/libnetfilter-log/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnetfilter_log PKG_VERSION:=1.0.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ @@ -31,6 +31,7 @@ define Package/libnetfilter-log DEPENDS:=+libnfnetlink +kmod-nfnetlink-log +libmnl TITLE:=API to receive to-be-logged packets from the kernel nfnetlink_log subsystem URL:=http://www.netfilter.org/projects/libnetfilter_log/ + ABI_VERSION:=1 endef define Package/libnetfilter-log/description diff --git a/package/libs/libnetfilter-queue/Makefile b/package/libs/libnetfilter-queue/Makefile index 8a11d07988..5ce5b8ff5e 100644 --- a/package/libs/libnetfilter-queue/Makefile +++ b/package/libs/libnetfilter-queue/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnetfilter_queue -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=https://git.netfilter.org/libnetfilter_queue @@ -29,6 +29,7 @@ define Package/libnetfilter-queue DEPENDS:=+libmnl +libnfnetlink TITLE:=API to the in-kernel connection tracking queue infrastructure URL:=http://www.netfilter.org/projects/libnetfilter_queue/ + ABI_VERSION:=1 endef define Package/libnetfilter-queue/description diff --git a/package/libs/libnfnetlink/Makefile b/package/libs/libnfnetlink/Makefile index 3de556fa85..7d65d63857 100644 --- a/package/libs/libnfnetlink/Makefile +++ b/package/libs/libnfnetlink/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnfnetlink PKG_VERSION:=1.0.1 -PKG_RELEASE:=1 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ @@ -30,6 +30,7 @@ define Package/libnfnetlink CATEGORY:=Libraries TITLE:=A low-level library for netfilter related kernel/userspace communication URL:=http://netfilter.org/projects/libnfnetlink/ + ABI_VERSION:=0 endef define Package/libnfnetlink/description @@ -39,12 +40,13 @@ define Package/libnfnetlink/description and/or management tools in userspace. endef -TARGET_CFLAGS += $(FPIC) - CONFIGURE_ARGS += \ --enable-static \ --enable-shared +CONFIGURE_VARS += \ + lt_prog_compiler_pic=$(FPIC) + define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include/libnfnetlink $(CP) \ diff --git a/package/libs/libroxml/Makefile b/package/libs/libroxml/Makefile index 60d61716de..f60312b1ed 100644 --- a/package/libs/libroxml/Makefile +++ b/package/libs/libroxml/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libroxml -PKG_VERSION:=2.3.0 -PKG_RELEASE:=2 +PKG_VERSION:=3.0.2 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://download.libroxml.net/pool/v2.x -PKG_HASH:=1da8f20b530eba4409f2b217587d2f1281ff5d9ba45b24aeac71b94c6c621b78 +PKG_SOURCE_URL:=http://download.libroxml.net/pool/v3.x +PKG_HASH:=ed6d68d1bceabf98e5e76907411e2e4d93b2dbd48479ab41dede851f59dad6a3 PKG_MAINTAINER:=Felix Fietkau PKG_INSTALL:=1 @@ -27,6 +27,7 @@ define Package/libroxml CATEGORY:=Libraries TITLE:=Minimum, easy-to-use, C implementation for xml file parsing URL:=http://www.libroxml.net/ + ABI_VERSION:=3.0.2 endef CONFIGURE_ARGS += \ diff --git a/package/libs/libtool/Makefile b/package/libs/libtool/Makefile index 37b91dce7a..4b54ac495d 100644 --- a/package/libs/libtool/Makefile +++ b/package/libs/libtool/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libtool PKG_VERSION:=2.4.6 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/libtool @@ -31,6 +31,7 @@ define Package/libltdl CATEGORY:=Libraries TITLE:=A generic dynamic object loading library URL:=http://www.gnu.org/software/libtool/ + ABI_VERSION:=7 endef define Build/InstallDev diff --git a/package/libs/libunwind/Makefile b/package/libs/libunwind/Makefile index ddb467f656..994ee97a17 100644 --- a/package/libs/libunwind/Makefile +++ b/package/libs/libunwind/Makefile @@ -1,6 +1,6 @@ # # Copyright (C) 2008-2013 OpenWrt.org -# Copyright (C) 2017 Yousong Zhou +# Copyright (C) 2017-2019 Yousong Zhou # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libunwind -PKG_VERSION:=1.2.1 -PKG_RELEASE:=2 +PKG_VERSION:=1.3.1 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME) -PKG_HASH:=3f3ecb90e28cbe53fba7a4a27ccce7aad188d3210bb1964a923a731a27a75acb +PKG_HASH:=43997a3939b6ccdf2f669b50fdb8a4d3205374728c2923ddc2354c65260214f8 PKG_FIXUP:=autoreconf PKG_INSTALL:=1 @@ -32,7 +32,8 @@ define Package/libunwind CATEGORY:=Libraries TITLE:=The libunwind project URL:=http://www.nongnu.org/libunwind/ - DEPENDS:=@(mips||mipsel||powerpc||i386||x86_64||arm||aarch64) + DEPENDS:=@((mips||mipsel||x86_64||arm||aarch64)||(USE_GLIBC&&(powerpc||i386))) + ABI_VERSION:=8 endef define Package/libunwind/description @@ -41,12 +42,13 @@ endef CONFIGURE_ARGS += \ --disable-documentation \ + --disable-tests \ --enable-minidebuginfo=no \ define Package/libunwind/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunwin*.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunwin*.so.* $(1)/usr/lib/ endef define Build/InstallDev diff --git a/package/libs/libunwind/patches/001-disable-tests.patch b/package/libs/libunwind/patches/001-disable-tests.patch deleted file mode 100644 index 667b6a71e2..0000000000 --- a/package/libs/libunwind/patches/001-disable-tests.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Makefile.am -+++ b/Makefile.am -@@ -42,7 +42,7 @@ endif - - nodist_include_HEADERS = include/libunwind-common.h - --SUBDIRS = src tests -+SUBDIRS = src - - if CONFIG_DOCS - SUBDIRS += doc diff --git a/package/libs/libusb-compat/Makefile b/package/libs/libusb-compat/Makefile index 0dc93941a9..5f9b2385c8 100644 --- a/package/libs/libusb-compat/Makefile +++ b/package/libs/libusb-compat/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libusb-compat PKG_VERSION:=0.1.5 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/libusb @@ -29,6 +29,7 @@ define Package/libusb-compat TITLE:=libusb-0.1 compatibility library DEPENDS:=+libusb-1.0 URL:=http://libusb.wiki.sourceforge.net/ + ABI_VERSION:=4 endef define Package/libusb-compat/description diff --git a/package/libs/libusb/Makefile b/package/libs/libusb/Makefile index 54008212b9..6ce33d3f86 100644 --- a/package/libs/libusb/Makefile +++ b/package/libs/libusb/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libusb PKG_VERSION:=1.0.22 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=\ @@ -31,6 +31,7 @@ define Package/libusb-1.0 TITLE:=A library for accessing Linux USB devices DEPENDS:=+libpthread +librt URL:=http://libusb.info/ + ABI_VERSION:=0 endef define Package/libusb-1.0/description @@ -49,7 +50,7 @@ endef define Package/libusb-1.0/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb*.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb*.so.* $(1)/usr/lib/ endef $(eval $(call BuildPackage,libusb-1.0)) diff --git a/package/libs/lzo/Makefile b/package/libs/lzo/Makefile index ef33619d88..1ae2f3ce05 100644 --- a/package/libs/lzo/Makefile +++ b/package/libs/lzo/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lzo PKG_VERSION:=2.10 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.oberhumer.com/opensource/lzo/download/ @@ -28,6 +28,7 @@ define Package/liblzo CATEGORY:=Libraries TITLE:=A real-time data compression library URL:=http://www.oberhumer.com/opensource/lzo/ + ABI_VERSION:=2 endef define Package/liblzo/description @@ -50,7 +51,7 @@ endef define Package/liblzo/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzo2.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzo2.so.* $(1)/usr/lib/ endef $(eval $(call BuildPackage,liblzo)) diff --git a/package/libs/popt/Makefile b/package/libs/popt/Makefile index 10983d1586..34ae4d7c61 100644 --- a/package/libs/popt/Makefile +++ b/package/libs/popt/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=popt PKG_VERSION:=1.16 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:= \ @@ -34,14 +34,10 @@ define Package/libpopt CATEGORY:=Libraries TITLE:=A command line option parsing library URL:=http://rpm5.org/files/popt/ + ABI_VERSION:=0 endef -define Build/Configure - $(call Build/Configure/Default, \ - --enable-shared \ - --enable-static \ - ) -endef +CONFIGURE_ARGS += --enable-shared --enable-static define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include diff --git a/package/libs/sysfsutils/Makefile b/package/libs/sysfsutils/Makefile index 60275ec343..8ce9a40f91 100644 --- a/package/libs/sysfsutils/Makefile +++ b/package/libs/sysfsutils/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sysfsutils PKG_VERSION:=2.1.0 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/linux-diag @@ -31,6 +31,7 @@ define Package/libsysfs SUBMENU:=Filesystem TITLE:=Sysfs library URL:=http://linux-diag.sourceforge.net/Sysfsutils.html + ABI_VERSION:=2 endef define Package/sysfsutils @@ -61,7 +62,7 @@ endef define Package/libsysfs/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsysfs.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsysfs.so.* $(1)/usr/lib/ endef define Package/sysfsutils/install diff --git a/package/libs/sysfsutils/files/sysfsutils b/package/libs/sysfsutils/files/sysfsutils old mode 100755 new mode 100644 diff --git a/package/libs/toolchain/eglibc-files/etc/nsswitch.conf b/package/libs/toolchain/eglibc-files/etc/nsswitch.conf deleted file mode 100644 index 981c425da6..0000000000 --- a/package/libs/toolchain/eglibc-files/etc/nsswitch.conf +++ /dev/null @@ -1,13 +0,0 @@ -passwd:files -shadow:files -group:files -hosts:dns files -bootparams:files -ethers:files -netmasks:files -networks:files -protocols:files -rpc:files -services:files -automount:files -aliases:files diff --git a/package/libs/uclient/Makefile b/package/libs/uclient/Makefile index 01dc48e35e..92c1e1d1e0 100644 --- a/package/libs/uclient/Makefile +++ b/package/libs/uclient/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/uclient.git -PKG_SOURCE_DATE:=2018-11-24 -PKG_SOURCE_VERSION:=3ba74ebc9363993ea2a83fd73b4c1b1a96e73940 -PKG_MIRROR_HASH:=3c456a8ab965ed8db216ac1bfaf2b974e2f689137a7c35d0220e5b7d9c42a994 +PKG_MIRROR_HASH:=8b71b02feb721ec0ed9cd7fe6761aa6a40216563a294d04243779ebe98891355 +PKG_SOURCE_DATE:=2020-02-15 +PKG_SOURCE_VERSION:=af585dbd1d444faafa370a73c1db43aece731f85 CMAKE_INSTALL:=1 PKG_BUILD_DEPENDS:=ustream-ssl @@ -32,6 +32,8 @@ define Package/uclient-fetch SECTION:=net CATEGORY:=Network TITLE:=Tiny wget replacement using libuclient + ALTERNATIVES:=200:/usr/bin/wget:/bin/uclient-fetch + PROVIDES:=wget DEPENDS:=+libuclient endef @@ -43,7 +45,6 @@ endef define Package/uclient-fetch/install $(INSTALL_DIR) $(1)/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/uclient-fetch $(1)/bin/ - ln -s uclient-fetch $(1)/bin/wget endef $(eval $(call BuildPackage,libuclient)) diff --git a/package/network/config/firewall/files/firewall.hotplug b/package/network/config/firewall/files/firewall.hotplug old mode 100755 new mode 100644 diff --git a/package/network/ipv6/6rd/files/6rd.sh b/package/network/ipv6/6rd/files/6rd.sh old mode 100755 new mode 100644 diff --git a/package/network/ipv6/ds-lite/files/dslite.sh b/package/network/ipv6/ds-lite/files/dslite.sh old mode 100755 new mode 100644 diff --git a/package/network/services/ead/src/tinysrp/missing b/package/network/services/ead/src/tinysrp/missing old mode 100644 new mode 100755 diff --git a/package/network/services/ead/src/tinysrp/mkinstalldirs b/package/network/services/ead/src/tinysrp/mkinstalldirs old mode 100644 new mode 100755 diff --git a/package/network/services/ead/src/tinysrp/t_pw.c b/package/network/services/ead/src/tinysrp/t_pw.c index 18e929bb79..5da5e26b78 100644 --- a/package/network/services/ead/src/tinysrp/t_pw.c +++ b/package/network/services/ead/src/tinysrp/t_pw.c @@ -94,8 +94,10 @@ t_openpw(fp) else close_flag = 0; - if((tpw = malloc(sizeof(struct t_pw))) == NULL) + if((tpw = malloc(sizeof(struct t_pw))) == NULL) { + fclose(fp); return NULL; + } tpw->instream = fp; tpw->close_on_exit = close_flag; tpw->state = FILE_ONLY; diff --git a/package/network/services/igmpproxy/files/igmpproxy.init b/package/network/services/igmpproxy/files/igmpproxy.init old mode 100755 new mode 100644 diff --git a/package/network/services/odhcpd/files/odhcpd.defaults b/package/network/services/odhcpd/files/odhcpd.defaults old mode 100755 new mode 100644 diff --git a/package/network/services/odhcpd/files/odhcpd.init b/package/network/services/odhcpd/files/odhcpd.init old mode 100755 new mode 100644 diff --git a/package/network/services/omcproxy/Makefile b/package/network/services/omcproxy/Makefile index e121fa0b23..26c7893384 100644 --- a/package/network/services/omcproxy/Makefile +++ b/package/network/services/omcproxy/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=omcproxy -PKG_RELEASE:=5 +PKG_RELEASE:=9 -PKG_SOURCE_URL:=https://github.com/sbyx/omcproxy.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2017-02-14 -PKG_SOURCE_VERSION:=1fe6f48f8a5067685cbcf6427baf1b3e8b889da1 -PKG_MIRROR_HASH:=b5a5e09149bd08a945ada8a29a30c3e42834524747d7fd0911717f5a0ec59c72 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/omcproxy.git +PKG_SOURCE_DATE:=2018-12-14 +PKG_SOURCE_VERSION:=722151f04348cf1b759613c087bced52fb45790a +PKG_MIRROR_HASH:=4d218923c149e2dc9010b8932ea92ab7e06f30df06814ffedaba7e081f2d4640 PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=Apache-2.0 @@ -28,6 +28,10 @@ define Package/omcproxy TITLE:=IGMPv3 and MLDv2 Multicast Proxy endef +define Package/omcproxy/conffiles +/etc/config/omcproxy +endef + CMAKE_OPTIONS += -DWITH_LIBUBOX=1 define Package/omcproxy/install diff --git a/package/network/services/omcproxy/files/omcproxy.init b/package/network/services/omcproxy/files/omcproxy.init old mode 100755 new mode 100644 index 970b3a128e..757b7794ef --- a/package/network/services/omcproxy/files/omcproxy.init +++ b/package/network/services/omcproxy/files/omcproxy.init @@ -1,55 +1,74 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2010-2014 OpenWrt.org +# Copyright (C) 2018 OpenWrt.org START=99 USE_PROCD=1 PROG=/usr/sbin/omcproxy -# Uncomment to enable verbosity -#OPTIONS="-v" +# Uncomment to enable verbosity +#OPTIONS="-v" PROXIES="" - omcproxy_add_proxy() { - local uplink downlink scope proxy + local proxy scope uplink updevice downlinks + config_get uplink $1 uplink - config_get downlink $1 downlink - config_get scope $1 scope + [ -n "$uplink" ] || return - proxy="" + network_get_device updevice "$uplink" || { + procd_append_param error "$uplink is not up" + return; + } - network_get_device updev $uplink - [ -n "$updev" ] || return 0 + config_get downlinks $1 downlink + for downlink in $downlinks; do + local device - for network in $downlink; do - network_get_device downdev $network - [ -n "$downdev" ] && proxy="$proxy,$downdev" + network_get_device device "$downlink" || { + procd_append_param error "$downlink is not up" + continue; + } - # Disable in-kernel querier while ours is active - [ -f /sys/class/net/$downdev/bridge/multicast_querier ] && \ - echo 0 > /sys/class/net/$downdev/bridge/multicast_querier + proxy="$proxy,$device" + + # Disable in-kernel querier while ours is active, default is 1. + [ -f /sys/class/net/$device/bridge/multicast_querier ] && \ + echo 0 > /sys/class/net/$device/bridge/multicast_querier done [ -n "$proxy" ] || return 0 + + config_get scope $1 scope [ -n "$scope" ] && proxy="$proxy,scope=$scope" - PROXIES="$PROXIES $updev$proxy" - + PROXIES="$PROXIES $updevice$proxy" } -omcproxy_add_trigger() { - local uplink downlink - config_get uplink $1 uplink - config_get downlink $1 downlink +omcproxy_add_network_triggers() { + local uplink downlinks - for network in $uplink $downlink; do - procd_add_interface_trigger "interface.*" $network /etc/init.d/omcproxy restart + config_get uplink $1 uplink + config_get downlinks $1 downlink + + for link in $uplink $downlinks; do + local duplicate=0 + + for l in $LINKS; do + [ "$l" = "$link" ] && duplicate=1 + done + + [ "$duplicate" = 0 ] && { + LINKS="$LINKS $link" + procd_add_interface_trigger "interface.*" $link /etc/init.d/omcproxy restart + } done } -omcproxy_add_firewall() { +omcproxy_add_firewall_rules() { + local uplink downlinks + config_get uplink $1 uplink - config_get downlink $1 downlink + config_get downlinks $1 downlink upzone=$(fw3 -q network $uplink 2>/dev/null) [ -n "$upzone" ] || return 0 @@ -57,6 +76,7 @@ omcproxy_add_firewall() { json_add_object "" json_add_string type rule json_add_string src "$upzone" + json_add_string family ipv4 json_add_string proto igmp json_add_string target ACCEPT json_close_object @@ -76,8 +96,8 @@ omcproxy_add_firewall() { json_add_string target ACCEPT json_close_object - for network in $downlink; do - downzone=$(fw3 -q network $network 2>/dev/null) + for downlink in $downlinks; do + downzone=$(fw3 -q network $downlink 2>/dev/null) [ -n "$downzone" ] || continue json_add_object "" @@ -85,7 +105,7 @@ omcproxy_add_firewall() { json_add_string src "$upzone" json_add_string dest "$downzone" json_add_string family ipv4 - json_add_string proto any + json_add_string proto udp json_add_string dest_ip "224.0.0.0/4" json_add_string target ACCEPT json_close_object @@ -95,7 +115,7 @@ omcproxy_add_firewall() { json_add_string src "$upzone" json_add_string dest "$downzone" json_add_string family ipv6 - json_add_string proto any + json_add_string proto udp json_add_string dest_ip "ff00::/8" json_add_string target ACCEPT json_close_object @@ -103,15 +123,18 @@ omcproxy_add_firewall() { } service_triggers() { + LINKS="" + procd_add_reload_trigger "omcproxy" + config_foreach omcproxy_add_network_triggers proxy } start_service() { - include /lib/functions + . /lib/functions/network.sh config_load omcproxy - config_foreach omcproxy_add_proxy proxy + config_foreach omcproxy_add_proxy proxy [ -n "$PROXIES" ] || return 0 procd_open_instance @@ -120,24 +143,24 @@ start_service() { procd_append_param command $PROXIES procd_set_param respawn - procd_open_trigger - config_foreach omcproxy_add_trigger proxy - procd_close_trigger - procd_open_data json_add_array firewall - config_foreach omcproxy_add_firewall proxy + config_foreach omcproxy_add_firewall_rules proxy json_close_array procd_close_data procd_close_instance - # Increase maximum IPv4 group memberships per socket + # Increase maximum IPv4 group memberships per socket, default is 100. echo 128 > /proc/sys/net/ipv4/igmp_max_memberships } service_started() { procd_set_config_changed firewall } + +stop_service() { + procd_set_config_changed firewall +} diff --git a/package/network/services/omcproxy/patches/100-mrib.c-don-t-use-cpu_to_be32-outside-of-function.patch b/package/network/services/omcproxy/patches/100-mrib.c-don-t-use-cpu_to_be32-outside-of-function.patch deleted file mode 100644 index d71315b60e..0000000000 --- a/package/network/services/omcproxy/patches/100-mrib.c-don-t-use-cpu_to_be32-outside-of-function.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 721064f2eb1dabe5bda63dcaff249b73ab891e6c Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Fri, 14 Dec 2018 15:13:41 -0200 -Subject: [PATCH] mrib.c: don't use cpu_to_be32 outside of function - -cpu_to_be32 is not a constant, so it can't be used outside of a -function. - -Signed-off-by: Eneas U de Queiroz - ---- a/src/mrib.c -+++ b/src/mrib.c -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -54,7 +55,13 @@ struct mrib_iface { - struct uloop_timeout timer; - }; - --static uint32_t ipv4_rtr_alert = cpu_to_be32(0x94040000); -+/* we can't use cpu_to_be32 outside a function */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+static uint32_t ipv4_rtr_alert = 0x94040000; -+#else -+static uint32_t ipv4_rtr_alert = 0x00000494; -+#endif -+ - static struct { - struct ip6_hbh hdr; - struct ip6_opt_router rt; diff --git a/package/network/services/openvpn/files/openvpn.init b/package/network/services/openvpn/files/openvpn.init old mode 100755 new mode 100644 index ebb05640d8..a7d35d1a98 --- a/package/network/services/openvpn/files/openvpn.init +++ b/package/network/services/openvpn/files/openvpn.init @@ -53,13 +53,14 @@ append_list() { local p; local v; local s="$1"; shift list_cb_append() { - v="$1:${v}" + v="${v}:$1" } for p in $*; do + unset v config_list_foreach "$s" "$p" list_cb_append + [ -n "$v" ] && append_param "$s" "$p" && echo " ${v:1}" >> "/var/etc/openvpn-$s.conf" done - [ -n "$v" ] && append_param "$s" "$p" && echo " ${v%*:}" >> "/var/etc/openvpn-$s.conf" } section_enabled() { diff --git a/package/network/services/openvpn/files/openvpn.options b/package/network/services/openvpn/files/openvpn.options index f4b048c48c..2da563968c 100644 --- a/package/network/services/openvpn/files/openvpn.options +++ b/package/network/services/openvpn/files/openvpn.options @@ -191,6 +191,7 @@ username_as_common_name ' OPENVPN_LIST=' -tls_cipher ncp_ciphers +tls_cipher +tls_ciphersuites ' diff --git a/package/network/services/relayd/files/relay.init b/package/network/services/relayd/files/relay.init old mode 100755 new mode 100644 diff --git a/package/network/services/umdns/files/umdns.init b/package/network/services/umdns/files/umdns.init old mode 100755 new mode 100644 diff --git a/package/network/utils/adb-enablemodem/files/adb-enablemodem b/package/network/utils/adb-enablemodem/files/adb-enablemodem old mode 100755 new mode 100644 diff --git a/package/network/utils/comgt/Makefile b/package/network/utils/comgt/Makefile index 3b7f4b9022..db5ea57473 100644 --- a/package/network/utils/comgt/Makefile +++ b/package/network/utils/comgt/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=comgt PKG_VERSION:=0.32 -PKG_RELEASE:=30 +PKG_RELEASE:=33 PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz PKG_SOURCE_URL:=@SF/comgt @@ -47,7 +47,7 @@ endef define Package/comgt-ncm $(call Package/comgt/Default) TITLE+=NCM 3G/4G Support - DEPENDS:=+comgt +wwan + DEPENDS:=+comgt +wwan +kmod-usb-serial-option +kmod-usb-net-huawei-cdc-ncm endef define Package/comgt/description @@ -80,7 +80,7 @@ define Package/comgt/install $(INSTALL_DATA) ./files/getcnum.gcom $(1)/etc/gcom/getcnum.gcom $(INSTALL_DATA) ./files/getimsi.gcom $(1)/etc/gcom/getimsi.gcom $(INSTALL_DIR) $(1)/etc/hotplug.d/tty - $(INSTALL_DATA) ./files/3g.usb $(1)/etc/hotplug.d/tty/30-3g + $(INSTALL_CONF) ./files/3g.usb $(1)/etc/hotplug.d/tty/30-3g $(INSTALL_DIR) $(1)/lib/netifd/proto $(INSTALL_BIN) ./files/3g.sh $(1)/lib/netifd/proto/3g.sh endef diff --git a/package/network/utils/comgt/files/3g.sh b/package/network/utils/comgt/files/3g.sh old mode 100755 new mode 100644 index 0d02d4c4b9..9220cbf5a0 --- a/package/network/utils/comgt/files/3g.sh +++ b/package/network/utils/comgt/files/3g.sh @@ -17,6 +17,7 @@ proto_3g_init_config() { proto_config_add_string "apn" proto_config_add_string "service" proto_config_add_string "pincode" + proto_config_add_string "delay" proto_config_add_string "dialnumber" } @@ -29,6 +30,7 @@ proto_3g_setup() { json_get_var service service json_get_var pincode pincode json_get_var dialnumber dialnumber + json_get_var delay delay [ -n "$dat_device" ] && device=$dat_device @@ -38,6 +40,8 @@ proto_3g_setup() { return 1 } + [ -n "$delay" ] && sleep "$delay" + case "$service" in cdma|evdo) chat="/etc/chatscripts/evdo.chat" diff --git a/package/network/utils/comgt/files/3g.usb b/package/network/utils/comgt/files/3g.usb index ac8326b710..8f0d62ca83 100644 --- a/package/network/utils/comgt/files/3g.usb +++ b/package/network/utils/comgt/files/3g.usb @@ -15,11 +15,11 @@ find_3g_iface() { if [ "${dev##*/}" = "${tty##*/}" ]; then if [ "$ACTION" = add ]; then - available=1 - else - available=0 + proto_set_available "$cfg" 1 + fi + if [ "$ACTION" = remove ]; then + proto_set_available "$cfg" 0 fi - proto_set_available "$cfg" $available fi } diff --git a/package/network/utils/comgt/files/directip.sh b/package/network/utils/comgt/files/directip.sh old mode 100755 new mode 100644 diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh old mode 100755 new mode 100644 diff --git a/package/network/utils/conntrack-tools/Makefile b/package/network/utils/conntrack-tools/Makefile deleted file mode 100644 index f04ac69d2e..0000000000 --- a/package/network/utils/conntrack-tools/Makefile +++ /dev/null @@ -1,79 +0,0 @@ -# -# Copyright (C) 2009-2011 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:=conntrack-tools -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://git.netfilter.org/conntrack-tools -PKG_SOURCE_DATE:=2017-09-27 -PKG_SOURCE_VERSION:=eefe649ca51ed0cbb995454cdc366f5072f6443c -PKG_MIRROR_HASH:=1c207c3e423d741fbb31e3c29486a811e6dad493f26ec47a2df75b6262a1b4bd - -PKG_MAINTAINER:=Jo-Philipp Wich -PKG_LICENSE:=GPL-2.0 -PKG_CPE_ID:=cpe:/a:conntrack-tools_project:conntrack-tools - -PKG_FIXUP:=autoreconf -PKG_INSTALL:=1 - -PKG_BUILD_DEPENDS:=librpc - -include $(INCLUDE_DIR)/package.mk - -define Package/conntrack-tools/default - SECTION:=net - CATEGORY:=Network - DEPENDS:=+libnetfilter-conntrack +libnetfilter-cttimeout +libnetfilter-cthelper +libnetfilter-queue - SUBMENU:=Firewall - URL:=http://conntrack-tools.netfilter.org/ -endef - -define Package/conntrack -$(call Package/conntrack-tools/default) - TITLE:=Connection tracking tool -endef - -define Package/conntrack/description - Conntrack is a userspace command line program targeted at system - administrators. It enables them to view and manage the in-kernel - connection tracking state table. -endef - -define Package/conntrack/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/conntrack $(1)/usr/sbin/ -endef - -define Package/conntrackd -$(call Package/conntrack-tools/default) - TITLE:=Connection tracking daemon -endef - -define Package/conntrackd/conffiles -/etc/conntrackd/ -endef - -define Package/conntrackd/description - Conntrackd can replicate the status of the connections that are - currently being processed by your stateful firewall based on Linux. - Conntrackd can also run as statistics daemon. -endef - -define Package/conntrackd/install - $(INSTALL_DIR) \ - $(1)/etc/conntrackd \ - $(1)/etc/init.d \ - $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/conntrackd $(1)/usr/sbin/ - $(INSTALL_BIN) ./files/conntrackd.init $(1)/etc/init.d/conntrackd -endef - -$(eval $(call BuildPackage,conntrack)) -$(eval $(call BuildPackage,conntrackd)) diff --git a/package/network/utils/conntrack-tools/files/conntrackd.init b/package/network/utils/conntrack-tools/files/conntrackd.init deleted file mode 100755 index 0e2945c9a5..0000000000 --- a/package/network/utils/conntrack-tools/files/conntrackd.init +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2015 OpenWrt.org - -START=21 -STOP=89 - -USE_PROCD=1 -PROG="/usr/sbin/conntrackd" - -start_service() { - [ -e /etc/conntrackd/conntrackd.conf ] || return - procd_open_instance - - procd_set_param command $PROG -C /etc/conntrackd/conntrackd.conf - procd_set_param respawn - - procd_close_instance -} diff --git a/package/network/utils/dante/Makefile b/package/network/utils/dante/Makefile index 1c57b120f8..4f5d08724c 100644 --- a/package/network/utils/dante/Makefile +++ b/package/network/utils/dante/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dante PKG_VERSION:=1.4.1 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.inet.no/dante/files/ @@ -58,6 +58,7 @@ define Package/libsocks SECTION:=libs CATEGORY:=Libraries TITLE+= Library + ABI_VERSION:=0 endef define Package/libsocks/description @@ -67,7 +68,7 @@ endef define Package/libsocks/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsocks.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsocks.so.* $(1)/usr/lib/ endef diff --git a/package/network/utils/iftop/Makefile b/package/network/utils/iftop/Makefile index ed22eb81b1..98fe15c8f5 100644 --- a/package/network/utils/iftop/Makefile +++ b/package/network/utils/iftop/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://code.blinkace.com/pdw/iftop.git -PKG_SOURCE_DATE:=2017-03-22 -PKG_SOURCE_VERSION:=949ed0f7e2c54c598868c270b82c2d702131a339 -PKG_MIRROR_HASH:=2ba96d9a2adf4e43aaab439a9ccab8f21b415da48d1c8939f6dcea8e6e11524f +PKG_SOURCE_DATE:=2018-10-03 +PKG_SOURCE_VERSION:=77901c8c53e01359d83b8090aacfe62214658183 +PKG_MIRROR_HASH:=219231541a437f5aecd497796be0202d337e13f141359a93595bf2cd8c5c5544 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/iputils/Makefile b/package/network/utils/iputils/Makefile deleted file mode 100644 index 344af07afd..0000000000 --- a/package/network/utils/iputils/Makefile +++ /dev/null @@ -1,182 +0,0 @@ -# -# Copyright (C) 2006-2010 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:=iputils -PKG_VERSION:=20101006 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-s$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=http://www.skbuff.net/iputils -PKG_HASH:=fd3af46c80ebb99607c2ca1f2a3608b6fe828e25bbec6e54f2afd25f6ddb6ee7 - -PKG_MAINTAINER:=Jo-Philipp Wich -PKG_LICENSE:=GPL-2.0+ -PKG_CPE_ID:=cpe:/a:skbuff:iputils - -PKG_BUILD_DEPENDS:=sysfsutils -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-s$(PKG_VERSION) - -include $(INCLUDE_DIR)/package.mk - - -define Package/iputils/Default - SECTION:=net - CATEGORY:=Network - URL:=http://www.skbuff.net/iputils -endef - - -define Package/iputils-arping -$(call Package/iputils/Default) - TITLE:=iputils - arping - DEPENDS+= +libsysfs -endef - -define Package/iputils-arping/description - Program arping from iputils. - Sends ARP REQUEST to a neighbour host. -endef - - -define Package/iputils-clockdiff -$(call Package/iputils/Default) - TITLE:=iputils - clockdiff -endef - -define Package/iputils-clockdiff/description - Program clockdiff from iputils. - Measures clock difference between hosts. -endef - - -define Package/iputils-ping -$(call Package/iputils/Default) - TITLE:=iputils - ping -endef - -define Package/iputils-ping/description - Program ping from iputils. - Sends ICMP ECHO_REQUEST to network hosts (IPv4). -endef - - -define Package/iputils-ping6 -$(call Package/iputils/Default) - TITLE:=iputils - ping6 - DEPENDS+= @IPV6 +USE_GLIBC:libopenssl -endef - -define Package/iputils-ping6/description - Program ping6 from iputils. - Sends ICMP ECHO_REQUEST to network hosts (IPv6). -endef - - -define Package/iputils-tftpd -$(call Package/iputils/Default) - TITLE:=iputils - tftpd -endef - -define Package/iputils-tftpd/description - Program tftpd from iputils - Trivial File Transfer Protocol server. -endef - - -define Package/iputils-tracepath -$(call Package/iputils/Default) - TITLE:=iputils - tracepath -endef - -define Package/iputils-tracepath/description - Program tracepath from iputils. - Traces path to a network host discovering MTU along this path (IPv4). -endef - - -define Package/iputils-tracepath6 -$(call Package/iputils/Default) - TITLE:=iputils - tracepath6 - DEPENDS+= @IPV6 -endef - -define Package/iputils-tracepath6/description - Program tracepath6 from iputils. - Traces path to a network host discovering MTU along this path (IPv6). -endef - - -define Package/iputils-traceroute6 -$(call Package/iputils/Default) - TITLE:=iputils - traceroute6 - DEPENDS+= @IPV6 -endef - -define Package/iputils-traceroute6/description - Program traceroute6 from iputils. - Traces path to a network host (IPv6). -endef - -ifdef CONFIG_USE_MUSL - TARGET_CFLAGS += -D__UCLIBC__ -endif - -MAKE_FLAGS += \ - CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)" \ - CONFIG_IPV6="$(CONFIG_IPV6)" \ - CONFIG_USE_UCLIBC="$(CONFIG_USE_UCLIBC)$(CONFIG_USE_MUSL)" \ - -define Package/iputils-arping/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/arping $(1)/usr/bin/ -endef - -define Package/iputils-clockdiff/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/clockdiff $(1)/usr/bin/ -endef - -define Package/iputils-ping/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/ping $(1)/usr/bin/ -endef - -define Package/iputils-ping6/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/ping6 $(1)/usr/bin/ -endef - -define Package/iputils-tftpd/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/tftpd $(1)/usr/sbin/ -endef - -define Package/iputils-tracepath/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/tracepath $(1)/usr/bin/ -endef - -define Package/iputils-tracepath6/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/tracepath6 $(1)/usr/bin/ -endef - -define Package/iputils-traceroute6/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/traceroute6 $(1)/usr/bin/ -endef - -$(eval $(call BuildPackage,iputils-arping)) -$(eval $(call BuildPackage,iputils-clockdiff)) -$(eval $(call BuildPackage,iputils-ping)) -$(eval $(call BuildPackage,iputils-tftpd)) -$(eval $(call BuildPackage,iputils-tracepath)) -$(eval $(call BuildPackage,iputils-ping6)) -$(eval $(call BuildPackage,iputils-tracepath6)) -$(eval $(call BuildPackage,iputils-traceroute6)) diff --git a/package/network/utils/iputils/patches/001-iputils.patch b/package/network/utils/iputils/patches/001-iputils.patch deleted file mode 100644 index e57db1379e..0000000000 --- a/package/network/utils/iputils/patches/001-iputils.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -ur a/Makefile b/Makefile ---- a/Makefile 2002-09-20 18:23:55.000000000 +0000 -+++ b/Makefile 2007-05-17 13:59:55.000000000 +0000 -@@ -16,8 +16,8 @@ - CCOPT=-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g - CFLAGS=$(CCOPT) $(GLIBCFIX) $(DEFINES) - --IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd --IPV6_TARGETS=tracepath6 traceroute6 ping6 -+IPV4_TARGETS=tracepath ping clockdiff arping tftpd -+IPV6_TARGETS=tracepath6 traceroute6 ping6 - TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS) - - LASTTAG:=`git describe HEAD | sed -e 's/-.*//'` diff --git a/package/network/utils/iputils/patches/002-fix-ipv6.patch b/package/network/utils/iputils/patches/002-fix-ipv6.patch deleted file mode 100644 index 4411ca7ef3..0000000000 --- a/package/network/utils/iputils/patches/002-fix-ipv6.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -18,7 +18,10 @@ CFLAGS=$(CCOPT) $(GLIBCFIX) $(DEFINES) - - IPV4_TARGETS=tracepath ping clockdiff arping tftpd - IPV6_TARGETS=tracepath6 traceroute6 ping6 --TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS) -+TARGETS=$(IPV4_TARGETS) -+ifeq ($(CONFIG_IPV6),y) -+ TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS) -+endif - - LASTTAG:=`git describe HEAD | sed -e 's/-.*//'` - TAG:=`date +s%Y%m%d` diff --git a/package/network/utils/iputils/patches/003-fix-makefile.patch b/package/network/utils/iputils/patches/003-fix-makefile.patch deleted file mode 100644 index 926c685519..0000000000 --- a/package/network/utils/iputils/patches/003-fix-makefile.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -30,9 +30,13 @@ all: $(TARGETS) - - - tftpd: tftpd.o tftpsubs.o --arping: arping.o -lsysfs -+arping: arping.o -+ $(CC) $(CFLAGS) -o $@ arping.o -lsysfs - ping: ping.o ping_common.o --ping6: ping6.o ping_common.o -lresolv -lcrypto -+ping6: ping6.o ping_common.o -+ifneq ($(CONFIG_USE_UCLIBC),y) -+ $(CC) $(CFLAGS) -o $@ ping6.o ping_common.o -lresolv -lcrypto -+endif - ping.o ping6.o ping_common.o: ping_common.h - tftpd.o tftpsubs.o: tftp.h - diff --git a/package/network/utils/iputils/patches/010-ping6_uclibc_resolv.patch b/package/network/utils/iputils/patches/010-ping6_uclibc_resolv.patch deleted file mode 100644 index 695580347b..0000000000 --- a/package/network/utils/iputils/patches/010-ping6_uclibc_resolv.patch +++ /dev/null @@ -1,200 +0,0 @@ -diff --git a/ping6.c b/ping6.c -index c5ff881..ef2243f 100644 ---- a/ping6.c -+++ b/ping6.c -@@ -71,9 +71,11 @@ char copyright[] = - #include - #include - #include -+#ifndef __UCLIBC__ - #include - - #include "ping6_niquery.h" -+#endif /* __UCLIBC__ */ - - #ifndef SOL_IPV6 - #define SOL_IPV6 IPPROTO_IPV6 -@@ -154,6 +156,7 @@ int pmtudisc=-1; - - static int icmp_sock; - -+#ifndef __UCLIBC__ - #include - - /* Node Information query */ -@@ -165,6 +168,7 @@ int ni_subject_type = 0; - char *ni_group; - - __u8 ni_nonce[8]; -+#endif /* __UCLIBC__ */ - - static struct in6_addr in6_anyaddr; - static __inline__ int ipv6_addr_any(struct in6_addr *addr) -@@ -223,6 +227,7 @@ unsigned int if_name2index(const char *ifname) - return i; - } - -+#ifndef __UCLIBC__ - struct niquery_option { - char *name; - int namelen; -@@ -512,6 +517,7 @@ char *ni_groupaddr(const char *name) - strcat(nigroup_buf, q); - return nigroup_buf; - } -+#endif /* __UCLIBC__ */ - - int main(int argc, char *argv[]) - { -@@ -595,12 +601,14 @@ int main(int argc, char *argv[]) - case 'V': - printf("ping6 utility, iputils-ss%s\n", SNAPSHOT); - exit(0); -+#ifndef __UCLIBC__ - case 'N': - if (niquery_option_handler(optarg) < 0) { - usage(); - break; - } - break; -+#endif /* __UCLIBC__ */ - COMMON_OPTIONS - common_options(ch); - break; -@@ -663,6 +671,7 @@ int main(int argc, char *argv[]) - argc--; - } - -+#ifndef __UCLIBC__ - if (ni_query >= 0) { - int i; - for (i = 0; i < 8; i++) -@@ -674,15 +683,20 @@ int main(int argc, char *argv[]) - ni_subject_type = NI_SUBJ_IPV6; - } - } -+#endif /* __UCLIBC__ */ - - if (argc > 1) - usage(); - else if (argc == 1) { - target = *argv; - } else { -+#ifndef __UCLIBC__ - if (ni_query < 0 && ni_subject_type != NI_SUBJ_NAME) -+#endif /* __UCLIBC__ */ - usage(); -+#ifndef __UCLIBC__ - target = ni_group; -+#endif /* __UCLIBC__ */ - } - - memset(&hints, 0, sizeof(hints)); -@@ -817,7 +831,11 @@ int main(int argc, char *argv[]) - exit(2); - } - -+#ifndef __UCLIBC__ - if (datalen >= sizeof(struct timeval) && (ni_query < 0)) { -+#else -+ if (datalen >= sizeof(struct timeval)) { -+#endif /* __UCLIBC__ */ - /* can we time transfer */ - timing = 1; - } -@@ -866,9 +884,11 @@ int main(int argc, char *argv[]) - ICMP6_FILTER_SETPASS(ICMP6_PARAM_PROB, &filter); - } - -+#ifndef __UCLIBC__ - if (ni_query >= 0) - ICMP6_FILTER_SETPASS(ICMPV6_NI_REPLY, &filter); - else -+#endif /* __UCLIBC__ */ - ICMP6_FILTER_SETPASS(ICMP6_ECHO_REPLY, &filter); - - err = setsockopt(icmp_sock, IPPROTO_ICMPV6, ICMP6_FILTER, &filter, -@@ -1100,6 +1120,7 @@ int build_echo(__u8 *_icmph) - return cc; - } - -+#ifndef __UCLIBC__ - int build_niquery(__u8 *_nih) - { - struct ni_hdr *nih; -@@ -1125,6 +1146,7 @@ int build_niquery(__u8 *_nih) - - return cc; - } -+#endif /* __UCLIBC__ */ - - int send_probe(void) - { -@@ -1132,9 +1154,11 @@ int send_probe(void) - - CLR((ntransmitted+1) % mx_dup_ck); - -+#ifndef __UCLIBC__ - if (ni_query >= 0) - len = build_niquery(outpack); - else -+#endif /* __UCLIBC__ */ - len = build_echo(outpack); - - if (cmsglen == 0) { -@@ -1176,6 +1200,7 @@ static void putchar_safe(char c) - printf("\\%03o", c); - } - -+#ifndef __UCLIBC__ - void pr_niquery_reply_name(struct ni_hdr *nih, int len) - { - __u8 *h = (__u8 *)(nih + 1); -@@ -1304,6 +1329,7 @@ void pr_niquery_reply(__u8 *_nih, int len) - } - putchar(';'); - } -+#endif /* __UCLIBC__ */ - - /* - * parse_reply -- -@@ -1353,6 +1379,7 @@ parse_reply(struct msghdr *msg, int cc, void *addr, struct timeval *tv) - hops, 0, tv, pr_addr(&from->sin6_addr), - pr_echo_reply)) - return 0; -+#ifndef __UCLIBC__ - } else if (icmph->icmp6_type == ICMPV6_NI_REPLY) { - struct ni_hdr *nih = (struct ni_hdr *)icmph; - __u16 seq = ntohs(*(__u16 *)nih->ni_nonce); -@@ -1363,6 +1390,7 @@ parse_reply(struct msghdr *msg, int cc, void *addr, struct timeval *tv) - hops, 0, tv, pr_addr(&from->sin6_addr), - pr_niquery_reply)) - return 0; -+#endif /* __UCLIBC__ */ - } else { - int nexthdr; - struct ip6_hdr *iph1 = (struct ip6_hdr*)(icmph+1); -@@ -1557,7 +1585,9 @@ void usage(void) - "Usage: ping6 [-LUdfnqrvVaAD] [-c count] [-i interval] [-w deadline]\n" - " [-p pattern] [-s packetsize] [-t ttl] [-I interface]\n" - " [-M pmtudisc-hint] [-S sndbuf] [-F flowlabel] [-Q tclass]\n" -+#ifndef __UCLIBC__ - " [[-N nodeinfo-option] ...]\n" -+#endif /* __UCLIBC__ */ - " [hop1 ...] destination\n"); - exit(2); - } -diff --git a/ping6_niquery.h b/ping6_niquery.h -index 61a5cfa..34c31f8 100644 ---- a/ping6_niquery.h -+++ b/ping6_niquery.h -@@ -1,3 +1,4 @@ -+#ifndef __UCLIBC__ - #include - - /* Node Information Query */ -@@ -45,3 +46,4 @@ struct ni_hdr { - #define NI_IPV4ADDR_F_TRUNCATE NI_IPV6ADDR_F_TRUNCATE - #define NI_IPV4ADDR_F_ALL NI_IPV6ADDR_F_ALL - -+#endif /* __UCLIBC__ */ diff --git a/package/network/utils/iputils/patches/011-ping6_use_gnu_source.patch b/package/network/utils/iputils/patches/011-ping6_use_gnu_source.patch deleted file mode 100644 index dc61b8c22f..0000000000 --- a/package/network/utils/iputils/patches/011-ping6_use_gnu_source.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/ping6.c -+++ b/ping6.c -@@ -66,6 +66,8 @@ char copyright[] = - * More statistics could always be gathered. - * This program has to run SUID to ROOT to access the ICMP socket. - */ -+ -+#define _GNU_SOURCE - #include "ping_common.h" - - #include diff --git a/package/network/utils/iputils/patches/020-include_fixes.patch b/package/network/utils/iputils/patches/020-include_fixes.patch deleted file mode 100644 index e982dabc37..0000000000 --- a/package/network/utils/iputils/patches/020-include_fixes.patch +++ /dev/null @@ -1,71 +0,0 @@ ---- a/ping_common.h -+++ b/ping_common.h -@@ -2,6 +2,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -11,7 +12,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include -@@ -24,6 +25,10 @@ - - #include "SNAPSHOT.h" - -+#ifndef HZ -+#define HZ 100 -+#endif -+ - #define DEFDATALEN (64 - 8) /* default data length */ - - #define MAXWAIT 10 /* max seconds to wait for response */ ---- a/clockdiff.c -+++ b/clockdiff.c -@@ -13,8 +13,6 @@ - #include - #include - #include --#define TSPTYPES --#include - #include - #include - #include ---- a/tracepath.c -+++ b/tracepath.c -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - #include - #include - #include ---- a/ping.c -+++ b/ping.c -@@ -661,8 +661,15 @@ int send_probe() - - do { - static struct iovec iov = {outpack, 0}; -- static struct msghdr m = { &whereto, sizeof(whereto), -- &iov, 1, &cmsg, 0, 0 }; -+ static struct msghdr m = { -+ .msg_name = &whereto, -+ .msg_namelen = sizeof(whereto), -+ .msg_iov = &iov, -+ .msg_iovlen = 1, -+ .msg_control = &cmsg, -+ .msg_controllen = 0, -+ .msg_flags = 0 -+ }; - m.msg_controllen = cmsg_len; - iov.iov_len = cc; - diff --git a/package/network/utils/iw/Makefile b/package/network/utils/iw/Makefile index ef39ee6724..7abf93e01e 100644 --- a/package/network/utils/iw/Makefile +++ b/package/network/utils/iw/Makefile @@ -8,14 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iw -PKG_VERSION:=4.14 +PKG_VERSION:=5.4 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/software/network/iw -PKG_HASH:=f01671c0074bfdec082a884057edba1b9efd35c89eda554638496f03b769ad89 +PKG_HASH:=a2469f677088d7b1070a7fbb28f3c747041697e8f6ec70783339cb1bc27a395f -PKG_BUILD_DIR:=$(BUILD_DIR)/iw-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/iw/iw/Makefile b/package/network/utils/iw/iw/Makefile new file mode 100644 index 0000000000..ef39ee6724 --- /dev/null +++ b/package/network/utils/iw/iw/Makefile @@ -0,0 +1,74 @@ +# +# Copyright (C) 2007-2011 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:=iw +PKG_VERSION:=4.14 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@KERNEL/software/network/iw +PKG_HASH:=f01671c0074bfdec082a884057edba1b9efd35c89eda554638496f03b769ad89 + +PKG_BUILD_DIR:=$(BUILD_DIR)/iw-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_MAINTAINER:=Felix Fietkau +PKG_LICENSE:=GPL-2.0 + +include $(INCLUDE_DIR)/package.mk + +define Package/iw + SECTION:=net + CATEGORY:=Network + TITLE:=cfg80211 interface configuration utility + URL:=http://wireless.kernel.org/en/users/Documentation/iw + DEPENDS:= +libnl-tiny + VARIANT:=tiny +endef + +define Package/iw-full + $(Package/iw) + TITLE += (full version) + VARIANT:=full + PROVIDES:=iw +endef + +define Build/Configure + echo "const char iw_version[] = \"$(PKG_VERSION)\";" > $(PKG_BUILD_DIR)/version.c + echo "#!/bin/sh" > $(PKG_BUILD_DIR)/version.sh + chmod +x $(PKG_BUILD_DIR)/version.sh +endef + +TARGET_CPPFLAGS:= \ + -I$(STAGING_DIR)/usr/include/libnl-tiny \ + $(TARGET_CPPFLAGS) \ + -DCONFIG_LIBNL20 \ + -D_GNU_SOURCE \ + -flto + +ifeq ($(BUILD_VARIANT),full) + TARGET_CPPFLAGS += -DIW_FULL + MAKE_FLAGS += IW_FULL=1 +endif + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -ffunction-sections -fdata-sections" \ + LDFLAGS="$(TARGET_LDFLAGS) -Wl,--gc-sections -flto" \ + NL1FOUND="" NL2FOUND=Y \ + NLLIBNAME="libnl-tiny" \ + LIBS="-lm -lnl-tiny" \ + V=1 + +define Package/iw/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/iw $(1)/usr/sbin/ +endef + +Package/iw-full/install=$(Package/iw/install) + +$(eval $(call BuildPackage,iw)) +$(eval $(call BuildPackage,iw-full)) diff --git a/package/network/utils/iw/iw/patches/001-nl80211_h_sync.patch b/package/network/utils/iw/iw/patches/001-nl80211_h_sync.patch new file mode 100644 index 0000000000..4fd37579a9 --- /dev/null +++ b/package/network/utils/iw/iw/patches/001-nl80211_h_sync.patch @@ -0,0 +1,629 @@ +diff --git a/nl80211.h b/nl80211.h +index c587a61..255a971 100644 +--- a/nl80211.h ++++ b/nl80211.h +@@ -11,6 +11,7 @@ + * Copyright 2008 Jouni Malinen + * Copyright 2008 Colin McCabe + * Copyright 2015-2017 Intel Deutschland GmbH ++ * Copyright (C) 2018 Intel Corporation + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above +@@ -203,7 +204,8 @@ + * FILS shared key authentication offload should be able to construct the + * authentication and association frames for FILS shared key authentication and + * eventually do a key derivation as per IEEE 802.11ai. The below additional +- * parameters should be given to driver in %NL80211_CMD_CONNECT. ++ * parameters should be given to driver in %NL80211_CMD_CONNECT and/or in ++ * %NL80211_CMD_UPDATE_CONNECT_PARAMS. + * %NL80211_ATTR_FILS_ERP_USERNAME - used to construct keyname_nai + * %NL80211_ATTR_FILS_ERP_REALM - used to construct keyname_nai + * %NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM - used to construct erp message +@@ -214,7 +216,8 @@ + * as specified in IETF RFC 6696. + * + * When FILS shared key authentication is completed, driver needs to provide the +- * below additional parameters to userspace. ++ * below additional parameters to userspace, which can be either after setting ++ * up a connection or after roaming. + * %NL80211_ATTR_FILS_KEK - used for key renewal + * %NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM - used in further EAP-RP exchanges + * %NL80211_ATTR_PMKID - used to identify the PMKSA used/generated +@@ -542,7 +545,8 @@ + * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_USE_MFP, + * %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT, + * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, +- * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT, %NL80211_ATTR_MAC_HINT, and ++ * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT, ++ * %NL80211_ATTR_CONTROL_PORT_OVER_NL80211, %NL80211_ATTR_MAC_HINT, and + * %NL80211_ATTR_WIPHY_FREQ_HINT. + * If included, %NL80211_ATTR_MAC and %NL80211_ATTR_WIPHY_FREQ are + * restrictions on BSS selection, i.e., they effectively prevent roaming +@@ -977,21 +981,58 @@ + * only the %NL80211_ATTR_IE data is used and updated with this command. + * + * @NL80211_CMD_SET_PMK: For offloaded 4-Way handshake, set the PMK or PMK-R0 +- * for the given authenticator address (specified with &NL80211_ATTR_MAC). +- * When &NL80211_ATTR_PMKR0_NAME is set, &NL80211_ATTR_PMK specifies the ++ * for the given authenticator address (specified with %NL80211_ATTR_MAC). ++ * When %NL80211_ATTR_PMKR0_NAME is set, %NL80211_ATTR_PMK specifies the + * PMK-R0, otherwise it specifies the PMK. + * @NL80211_CMD_DEL_PMK: For offloaded 4-Way handshake, delete the previously + * configured PMK for the authenticator address identified by +- * &NL80211_ATTR_MAC. ++ * %NL80211_ATTR_MAC. + * @NL80211_CMD_PORT_AUTHORIZED: An event that indicates that the 4 way + * handshake was completed successfully by the driver. The BSSID is +- * specified with &NL80211_ATTR_MAC. Drivers that support 4 way handshake ++ * specified with %NL80211_ATTR_MAC. Drivers that support 4 way handshake + * offload should send this event after indicating 802.11 association with +- * &NL80211_CMD_CONNECT or &NL80211_CMD_ROAM. If the 4 way handshake failed +- * &NL80211_CMD_DISCONNECT should be indicated instead. ++ * %NL80211_CMD_CONNECT or %NL80211_CMD_ROAM. If the 4 way handshake failed ++ * %NL80211_CMD_DISCONNECT should be indicated instead. ++ * ++ * @NL80211_CMD_CONTROL_PORT_FRAME: Control Port (e.g. PAE) frame TX request ++ * and RX notification. This command is used both as a request to transmit ++ * a control port frame and as a notification that a control port frame ++ * has been received. %NL80211_ATTR_FRAME is used to specify the ++ * frame contents. The frame is the raw EAPoL data, without ethernet or ++ * 802.11 headers. ++ * When used as an event indication %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, ++ * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT and %NL80211_ATTR_MAC are added ++ * indicating the protocol type of the received frame; whether the frame ++ * was received unencrypted and the MAC address of the peer respectively. + * + * @NL80211_CMD_RELOAD_REGDB: Request that the regdb firmware file is reloaded. + * ++ * @NL80211_CMD_EXTERNAL_AUTH: This interface is exclusively defined for host ++ * drivers that do not define separate commands for authentication and ++ * association, but rely on user space for the authentication to happen. ++ * This interface acts both as the event request (driver to user space) ++ * to trigger the authentication and command response (userspace to ++ * driver) to indicate the authentication status. ++ * ++ * User space uses the %NL80211_CMD_CONNECT command to the host driver to ++ * trigger a connection. The host driver selects a BSS and further uses ++ * this interface to offload only the authentication part to the user ++ * space. Authentication frames are passed between the driver and user ++ * space through the %NL80211_CMD_FRAME interface. Host driver proceeds ++ * further with the association after getting successful authentication ++ * status. User space indicates the authentication status through ++ * %NL80211_ATTR_STATUS_CODE attribute in %NL80211_CMD_EXTERNAL_AUTH ++ * command interface. ++ * ++ * Host driver reports this status on an authentication failure to the ++ * user space through the connect result as the user space would have ++ * initiated the connection through the connect request. ++ * ++ * @NL80211_CMD_STA_OPMODE_CHANGED: An event that notify station's ++ * ht opmode or vht opmode changes using any of %NL80211_ATTR_SMPS_MODE, ++ * %NL80211_ATTR_CHANNEL_WIDTH,%NL80211_ATTR_NSS attributes with its ++ * address(specified in %NL80211_ATTR_MAC). ++ * + * @NL80211_CMD_MAX: highest used command number + * @__NL80211_CMD_AFTER_LAST: internal use + */ +@@ -1198,6 +1239,12 @@ enum nl80211_commands { + + NL80211_CMD_RELOAD_REGDB, + ++ NL80211_CMD_EXTERNAL_AUTH, ++ ++ NL80211_CMD_STA_OPMODE_CHANGED, ++ ++ NL80211_CMD_CONTROL_PORT_FRAME, ++ + /* add new commands above here */ + + /* used to define NL80211_CMD_MAX below */ +@@ -1445,6 +1492,15 @@ enum nl80211_commands { + * @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with + * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom + * ethertype frames used for key negotiation must not be encrypted. ++ * @NL80211_ATTR_CONTROL_PORT_OVER_NL80211: A flag indicating whether control ++ * port frames (e.g. of type given in %NL80211_ATTR_CONTROL_PORT_ETHERTYPE) ++ * will be sent directly to the network interface or sent via the NL80211 ++ * socket. If this attribute is missing, then legacy behavior of sending ++ * control port frames directly to the network interface is used. If the ++ * flag is included, then control port frames are sent over NL80211 instead ++ * using %CMD_CONTROL_PORT_FRAME. If control port routing over NL80211 is ++ * to be used then userspace must also use the %NL80211_ATTR_SOCKET_OWNER ++ * flag. + * + * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver. + * We recommend using nested, driver-specific attributes within this. +@@ -1932,6 +1988,12 @@ enum nl80211_commands { + * multicast group. + * If set during %NL80211_CMD_ASSOCIATE or %NL80211_CMD_CONNECT the + * station will deauthenticate when the socket is closed. ++ * If set during %NL80211_CMD_JOIN_IBSS the IBSS will be automatically ++ * torn down when the socket is closed. ++ * If set during %NL80211_CMD_JOIN_MESH the mesh setup will be ++ * automatically torn down when the socket is closed. ++ * If set during %NL80211_CMD_START_AP the AP will be automatically ++ * disabled when the socket is closed. + * + * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is + * the TDLS link initiator. +@@ -2153,6 +2215,35 @@ enum nl80211_commands { + * @NL80211_ATTR_PMKR0_NAME: PMK-R0 Name for offloaded FT. + * @NL80211_ATTR_PORT_AUTHORIZED: (reserved) + * ++ * @NL80211_ATTR_EXTERNAL_AUTH_ACTION: Identify the requested external ++ * authentication operation (u32 attribute with an ++ * &enum nl80211_external_auth_action value). This is used with the ++ * %NL80211_CMD_EXTERNAL_AUTH request event. ++ * @NL80211_ATTR_EXTERNAL_AUTH_SUPPORT: Flag attribute indicating that the user ++ * space supports external authentication. This attribute shall be used ++ * only with %NL80211_CMD_CONNECT request. The driver may offload ++ * authentication processing to user space if this capability is indicated ++ * in NL80211_CMD_CONNECT requests from the user space. ++ * ++ * @NL80211_ATTR_NSS: Station's New/updated RX_NSS value notified using this ++ * u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED. ++ * ++ * @NL80211_ATTR_TXQ_STATS: TXQ statistics (nested attribute, see &enum ++ * nl80211_txq_stats) ++ * @NL80211_ATTR_TXQ_LIMIT: Total packet limit for the TXQ queues for this phy. ++ * The smaller of this and the memory limit is enforced. ++ * @NL80211_ATTR_TXQ_MEMORY_LIMIT: Total memory memory limit (in bytes) for the ++ * TXQ queues for this phy. The smaller of this and the packet limit is ++ * enforced. ++ * @NL80211_ATTR_TXQ_QUANTUM: TXQ scheduler quantum (bytes). Number of bytes ++ * a flow is assigned on each round of the DRR scheduler. ++ * @NL80211_ATTR_HE_CAPABILITY: HE Capability information element (from ++ * association request when used with NL80211_CMD_NEW_STATION). Can be set ++ * only if %NL80211_STA_FLAG_WME is set. ++ * ++ * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce ++ * transmit power to stay within regulatory limits. u32, dBi. ++ * + * @NUM_NL80211_ATTR: total number of nl80211_attrs available + * @NL80211_ATTR_MAX: highest attribute number currently defined + * @__NL80211_ATTR_AFTER_LAST: internal use +@@ -2579,6 +2670,23 @@ enum nl80211_attrs { + NL80211_ATTR_PMKR0_NAME, + NL80211_ATTR_PORT_AUTHORIZED, + ++ NL80211_ATTR_EXTERNAL_AUTH_ACTION, ++ NL80211_ATTR_EXTERNAL_AUTH_SUPPORT, ++ ++ NL80211_ATTR_NSS, ++ NL80211_ATTR_ACK_SIGNAL, ++ ++ NL80211_ATTR_CONTROL_PORT_OVER_NL80211, ++ ++ NL80211_ATTR_TXQ_STATS, ++ NL80211_ATTR_TXQ_LIMIT, ++ NL80211_ATTR_TXQ_MEMORY_LIMIT, ++ NL80211_ATTR_TXQ_QUANTUM, ++ ++ NL80211_ATTR_HE_CAPABILITY, ++ ++ NL80211_ATTR_WIPHY_ANTENNA_GAIN, ++ + /* add attributes here, update the policy in nl80211.c */ + + __NL80211_ATTR_AFTER_LAST, +@@ -2618,6 +2726,8 @@ enum nl80211_attrs { + #define NL80211_ATTR_KEYS NL80211_ATTR_KEYS + #define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS + ++#define NL80211_WIPHY_NAME_MAXLEN 64 ++ + #define NL80211_MAX_SUPP_RATES 32 + #define NL80211_MAX_SUPP_HT_RATES 77 + #define NL80211_MAX_SUPP_REG_RULES 64 +@@ -2626,7 +2736,8 @@ enum nl80211_attrs { + #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 + #define NL80211_HT_CAPABILITY_LEN 26 + #define NL80211_VHT_CAPABILITY_LEN 12 +- ++#define NL80211_HE_MIN_CAPABILITY_LEN 16 ++#define NL80211_HE_MAX_CAPABILITY_LEN 51 + #define NL80211_MAX_NR_CIPHER_SUITES 5 + #define NL80211_MAX_NR_AKM_SUITES 2 + +@@ -2754,6 +2865,38 @@ struct nl80211_sta_flag_update { + } __attribute__((packed)); + + /** ++ * enum nl80211_he_gi - HE guard interval ++ * @NL80211_RATE_INFO_HE_GI_0_8: 0.8 usec ++ * @NL80211_RATE_INFO_HE_GI_1_6: 1.6 usec ++ * @NL80211_RATE_INFO_HE_GI_3_2: 3.2 usec ++ */ ++enum nl80211_he_gi { ++ NL80211_RATE_INFO_HE_GI_0_8, ++ NL80211_RATE_INFO_HE_GI_1_6, ++ NL80211_RATE_INFO_HE_GI_3_2, ++}; ++ ++/** ++ * enum nl80211_he_ru_alloc - HE RU allocation values ++ * @NL80211_RATE_INFO_HE_RU_ALLOC_26: 26-tone RU allocation ++ * @NL80211_RATE_INFO_HE_RU_ALLOC_52: 52-tone RU allocation ++ * @NL80211_RATE_INFO_HE_RU_ALLOC_106: 106-tone RU allocation ++ * @NL80211_RATE_INFO_HE_RU_ALLOC_242: 242-tone RU allocation ++ * @NL80211_RATE_INFO_HE_RU_ALLOC_484: 484-tone RU allocation ++ * @NL80211_RATE_INFO_HE_RU_ALLOC_996: 996-tone RU allocation ++ * @NL80211_RATE_INFO_HE_RU_ALLOC_2x996: 2x996-tone RU allocation ++ */ ++enum nl80211_he_ru_alloc { ++ NL80211_RATE_INFO_HE_RU_ALLOC_26, ++ NL80211_RATE_INFO_HE_RU_ALLOC_52, ++ NL80211_RATE_INFO_HE_RU_ALLOC_106, ++ NL80211_RATE_INFO_HE_RU_ALLOC_242, ++ NL80211_RATE_INFO_HE_RU_ALLOC_484, ++ NL80211_RATE_INFO_HE_RU_ALLOC_996, ++ NL80211_RATE_INFO_HE_RU_ALLOC_2x996, ++}; ++ ++/** + * enum nl80211_rate_info - bitrate information + * + * These attribute types are used with %NL80211_STA_INFO_TXRATE +@@ -2785,6 +2928,13 @@ struct nl80211_sta_flag_update { + * @NL80211_RATE_INFO_5_MHZ_WIDTH: 5 MHz width - note that this is + * a legacy rate and will be reported as the actual bitrate, i.e. + * a quarter of the base (20 MHz) rate ++ * @NL80211_RATE_INFO_HE_MCS: HE MCS index (u8, 0-11) ++ * @NL80211_RATE_INFO_HE_NSS: HE NSS value (u8, 1-8) ++ * @NL80211_RATE_INFO_HE_GI: HE guard interval identifier ++ * (u8, see &enum nl80211_he_gi) ++ * @NL80211_RATE_INFO_HE_DCM: HE DCM value (u8, 0/1) ++ * @NL80211_RATE_INFO_RU_ALLOC: HE RU allocation, if not present then ++ * non-OFDMA was used (u8, see &enum nl80211_he_ru_alloc) + * @__NL80211_RATE_INFO_AFTER_LAST: internal use + */ + enum nl80211_rate_info { +@@ -2801,6 +2951,11 @@ enum nl80211_rate_info { + NL80211_RATE_INFO_160_MHZ_WIDTH, + NL80211_RATE_INFO_10_MHZ_WIDTH, + NL80211_RATE_INFO_5_MHZ_WIDTH, ++ NL80211_RATE_INFO_HE_MCS, ++ NL80211_RATE_INFO_HE_NSS, ++ NL80211_RATE_INFO_HE_GI, ++ NL80211_RATE_INFO_HE_DCM, ++ NL80211_RATE_INFO_HE_RU_ALLOC, + + /* keep last */ + __NL80211_RATE_INFO_AFTER_LAST, +@@ -2899,6 +3054,9 @@ enum nl80211_sta_bss_param { + * @NL80211_STA_INFO_RX_DURATION: aggregate PPDU duration for all frames + * received from the station (u64, usec) + * @NL80211_STA_INFO_PAD: attribute used for padding for 64-bit alignment ++ * @NL80211_STA_INFO_ACK_SIGNAL: signal strength of the last ACK frame(u8, dBm) ++ * @NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG: avg signal strength of (data) ++ * ACK frame (s8, dBm) + * @__NL80211_STA_INFO_AFTER_LAST: internal + * @NL80211_STA_INFO_MAX: highest possible station info attribute + */ +@@ -2937,6 +3095,8 @@ enum nl80211_sta_info { + NL80211_STA_INFO_TID_STATS, + NL80211_STA_INFO_RX_DURATION, + NL80211_STA_INFO_PAD, ++ NL80211_STA_INFO_ACK_SIGNAL, ++ NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG, + + /* keep last */ + __NL80211_STA_INFO_AFTER_LAST, +@@ -2954,6 +3114,7 @@ enum nl80211_sta_info { + * @NL80211_TID_STATS_TX_MSDU_FAILED: number of failed transmitted + * MSDUs (u64) + * @NL80211_TID_STATS_PAD: attribute used for padding for 64-bit alignment ++ * @NL80211_TID_STATS_TXQ_STATS: TXQ stats (nested attribute) + * @NUM_NL80211_TID_STATS: number of attributes here + * @NL80211_TID_STATS_MAX: highest numbered attribute here + */ +@@ -2964,6 +3125,7 @@ enum nl80211_tid_stats { + NL80211_TID_STATS_TX_MSDU_RETRIES, + NL80211_TID_STATS_TX_MSDU_FAILED, + NL80211_TID_STATS_PAD, ++ NL80211_TID_STATS_TXQ_STATS, + + /* keep last */ + NUM_NL80211_TID_STATS, +@@ -2971,6 +3133,44 @@ enum nl80211_tid_stats { + }; + + /** ++ * enum nl80211_txq_stats - per TXQ statistics attributes ++ * @__NL80211_TXQ_STATS_INVALID: attribute number 0 is reserved ++ * @NUM_NL80211_TXQ_STATS: number of attributes here ++ * @NL80211_TXQ_STATS_BACKLOG_BYTES: number of bytes currently backlogged ++ * @NL80211_TXQ_STATS_BACKLOG_PACKETS: number of packets currently ++ * backlogged ++ * @NL80211_TXQ_STATS_FLOWS: total number of new flows seen ++ * @NL80211_TXQ_STATS_DROPS: total number of packet drops ++ * @NL80211_TXQ_STATS_ECN_MARKS: total number of packet ECN marks ++ * @NL80211_TXQ_STATS_OVERLIMIT: number of drops due to queue space overflow ++ * @NL80211_TXQ_STATS_OVERMEMORY: number of drops due to memory limit overflow ++ * (only for per-phy stats) ++ * @NL80211_TXQ_STATS_COLLISIONS: number of hash collisions ++ * @NL80211_TXQ_STATS_TX_BYTES: total number of bytes dequeued from TXQ ++ * @NL80211_TXQ_STATS_TX_PACKETS: total number of packets dequeued from TXQ ++ * @NL80211_TXQ_STATS_MAX_FLOWS: number of flow buckets for PHY ++ * @NL80211_TXQ_STATS_MAX: highest numbered attribute here ++ */ ++enum nl80211_txq_stats { ++ __NL80211_TXQ_STATS_INVALID, ++ NL80211_TXQ_STATS_BACKLOG_BYTES, ++ NL80211_TXQ_STATS_BACKLOG_PACKETS, ++ NL80211_TXQ_STATS_FLOWS, ++ NL80211_TXQ_STATS_DROPS, ++ NL80211_TXQ_STATS_ECN_MARKS, ++ NL80211_TXQ_STATS_OVERLIMIT, ++ NL80211_TXQ_STATS_OVERMEMORY, ++ NL80211_TXQ_STATS_COLLISIONS, ++ NL80211_TXQ_STATS_TX_BYTES, ++ NL80211_TXQ_STATS_TX_PACKETS, ++ NL80211_TXQ_STATS_MAX_FLOWS, ++ ++ /* keep last */ ++ NUM_NL80211_TXQ_STATS, ++ NL80211_TXQ_STATS_MAX = NUM_NL80211_TXQ_STATS - 1 ++}; ++ ++/** + * enum nl80211_mpath_flags - nl80211 mesh path flags + * + * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active +@@ -3022,6 +3222,38 @@ enum nl80211_mpath_info { + }; + + /** ++ * enum nl80211_band_iftype_attr - Interface type data attributes ++ * ++ * @__NL80211_BAND_IFTYPE_ATTR_INVALID: attribute number 0 is reserved ++ * @NL80211_BAND_IFTYPE_ATTR_IFTYPES: nested attribute containing a flag attribute ++ * for each interface type that supports the band data ++ * @NL80211_BAND_IFTYPE_ATTR_HE_CAP_MAC: HE MAC capabilities as in HE ++ * capabilities IE ++ * @NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY: HE PHY capabilities as in HE ++ * capabilities IE ++ * @NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET: HE supported NSS/MCS as in HE ++ * capabilities IE ++ * @NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE: HE PPE thresholds information as ++ * defined in HE capabilities IE ++ * @NL80211_BAND_IFTYPE_ATTR_MAX: highest band HE capability attribute currently ++ * defined ++ * @__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST: internal use ++ */ ++enum nl80211_band_iftype_attr { ++ __NL80211_BAND_IFTYPE_ATTR_INVALID, ++ ++ NL80211_BAND_IFTYPE_ATTR_IFTYPES, ++ NL80211_BAND_IFTYPE_ATTR_HE_CAP_MAC, ++ NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY, ++ NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET, ++ NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE, ++ ++ /* keep last */ ++ __NL80211_BAND_IFTYPE_ATTR_AFTER_LAST, ++ NL80211_BAND_IFTYPE_ATTR_MAX = __NL80211_BAND_IFTYPE_ATTR_AFTER_LAST - 1 ++}; ++ ++/** + * enum nl80211_band_attr - band attributes + * @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved + * @NL80211_BAND_ATTR_FREQS: supported frequencies in this band, +@@ -3036,6 +3268,8 @@ enum nl80211_mpath_info { + * @NL80211_BAND_ATTR_VHT_MCS_SET: 32-byte attribute containing the MCS set as + * defined in 802.11ac + * @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE ++ * @NL80211_BAND_ATTR_IFTYPE_DATA: nested array attribute, with each entry using ++ * attributes from &enum nl80211_band_iftype_attr + * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined + * @__NL80211_BAND_ATTR_AFTER_LAST: internal use + */ +@@ -3051,6 +3285,7 @@ enum nl80211_band_attr { + + NL80211_BAND_ATTR_VHT_MCS_SET, + NL80211_BAND_ATTR_VHT_CAPA, ++ NL80211_BAND_ATTR_IFTYPE_DATA, + + /* keep last */ + __NL80211_BAND_ATTR_AFTER_LAST, +@@ -3060,6 +3295,29 @@ enum nl80211_band_attr { + #define NL80211_BAND_ATTR_HT_CAPA NL80211_BAND_ATTR_HT_CAPA + + /** ++ * enum nl80211_wmm_rule - regulatory wmm rule ++ * ++ * @__NL80211_WMMR_INVALID: attribute number 0 is reserved ++ * @NL80211_WMMR_CW_MIN: Minimum contention window slot. ++ * @NL80211_WMMR_CW_MAX: Maximum contention window slot. ++ * @NL80211_WMMR_AIFSN: Arbitration Inter Frame Space. ++ * @NL80211_WMMR_TXOP: Maximum allowed tx operation time. ++ * @nl80211_WMMR_MAX: highest possible wmm rule. ++ * @__NL80211_WMMR_LAST: Internal use. ++ */ ++enum nl80211_wmm_rule { ++ __NL80211_WMMR_INVALID, ++ NL80211_WMMR_CW_MIN, ++ NL80211_WMMR_CW_MAX, ++ NL80211_WMMR_AIFSN, ++ NL80211_WMMR_TXOP, ++ ++ /* keep last */ ++ __NL80211_WMMR_LAST, ++ NL80211_WMMR_MAX = __NL80211_WMMR_LAST - 1 ++}; ++ ++/** + * enum nl80211_frequency_attr - frequency attributes + * @__NL80211_FREQUENCY_ATTR_INVALID: attribute number 0 is reserved + * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz +@@ -3108,6 +3366,9 @@ enum nl80211_band_attr { + * on this channel in current regulatory domain. + * @NL80211_FREQUENCY_ATTR_NO_10MHZ: 10 MHz operation is not allowed + * on this channel in current regulatory domain. ++ * @NL80211_FREQUENCY_ATTR_WMM: this channel has wmm limitations. ++ * This is a nested attribute that contains the wmm limitation per AC. ++ * (see &enum nl80211_wmm_rule) + * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number + * currently defined + * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use +@@ -3136,6 +3397,7 @@ enum nl80211_frequency_attr { + NL80211_FREQUENCY_ATTR_IR_CONCURRENT, + NL80211_FREQUENCY_ATTR_NO_20MHZ, + NL80211_FREQUENCY_ATTR_NO_10MHZ, ++ NL80211_FREQUENCY_ATTR_WMM, + + /* keep last */ + __NL80211_FREQUENCY_ATTR_AFTER_LAST, +@@ -3319,7 +3581,7 @@ enum nl80211_sched_scan_match_attr { + * @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated + * base on contiguous rules and wider channels will be allowed to cross + * multiple contiguous/overlapping frequency ranges. +- * @NL80211_RRF_IR_CONCURRENT: See &NL80211_FREQUENCY_ATTR_IR_CONCURRENT ++ * @NL80211_RRF_IR_CONCURRENT: See %NL80211_FREQUENCY_ATTR_IR_CONCURRENT + * @NL80211_RRF_NO_HT40MINUS: channels can't be used in HT40- operation + * @NL80211_RRF_NO_HT40PLUS: channels can't be used in HT40+ operation + * @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed +@@ -4945,6 +5207,27 @@ enum nl80211_feature_flags { + * probe request tx deferral and suppression + * @NL80211_EXT_FEATURE_MFP_OPTIONAL: Driver supports the %NL80211_MFP_OPTIONAL + * value in %NL80211_ATTR_USE_MFP. ++ * @NL80211_EXT_FEATURE_LOW_SPAN_SCAN: Driver supports low span scan. ++ * @NL80211_EXT_FEATURE_LOW_POWER_SCAN: Driver supports low power scan. ++ * @NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN: Driver supports high accuracy scan. ++ * @NL80211_EXT_FEATURE_DFS_OFFLOAD: HW/driver will offload DFS actions. ++ * Device or driver will do all DFS-related actions by itself, ++ * informing user-space about CAC progress, radar detection event, ++ * channel change triggered by radar detection event. ++ * No need to start CAC from user-space, no need to react to ++ * "radar detected" event. ++ * @NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211: Driver supports sending and ++ * receiving control port frames over nl80211 instead of the netdevice. ++ * @NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT: This Driver support data ack ++ * rssi if firmware support, this flag is to intimate about ack rssi ++ * support to nl80211. ++ * @NL80211_EXT_FEATURE_TXQS: Driver supports FQ-CoDel-enabled intermediate ++ * TXQs. ++ * @NL80211_EXT_FEATURE_SCAN_RANDOM_SN: Driver/device supports randomizing the ++ * SN in probe request frames if requested by %NL80211_SCAN_FLAG_RANDOM_SN. ++ * @NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT: Driver/device can omit all data ++ * except for supported rates from the probe request content if requested ++ * by the %NL80211_SCAN_FLAG_MIN_PREQ_CONTENT flag. + * + * @NUM_NL80211_EXT_FEATURES: number of extended features. + * @MAX_NL80211_EXT_FEATURES: highest extended feature index. +@@ -4972,6 +5255,15 @@ enum nl80211_ext_feature_index { + NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE, + NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION, + NL80211_EXT_FEATURE_MFP_OPTIONAL, ++ NL80211_EXT_FEATURE_LOW_SPAN_SCAN, ++ NL80211_EXT_FEATURE_LOW_POWER_SCAN, ++ NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN, ++ NL80211_EXT_FEATURE_DFS_OFFLOAD, ++ NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211, ++ NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT, ++ NL80211_EXT_FEATURE_TXQS, ++ NL80211_EXT_FEATURE_SCAN_RANDOM_SN, ++ NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT, + + /* add new features before the definition below */ + NUM_NL80211_EXT_FEATURES, +@@ -5032,6 +5324,10 @@ enum nl80211_timeout_reason { + * of NL80211_CMD_TRIGGER_SCAN and NL80211_CMD_START_SCHED_SCAN + * requests. + * ++ * NL80211_SCAN_FLAG_LOW_SPAN, NL80211_SCAN_FLAG_LOW_POWER, and ++ * NL80211_SCAN_FLAG_HIGH_ACCURACY flags are exclusive of each other, i.e., only ++ * one of them can be used in the request. ++ * + * @NL80211_SCAN_FLAG_LOW_PRIORITY: scan request has low priority + * @NL80211_SCAN_FLAG_FLUSH: flush cache before scanning + * @NL80211_SCAN_FLAG_AP: force a scan even if the interface is configured +@@ -5059,7 +5355,26 @@ enum nl80211_timeout_reason { + * and suppression (if it has received a broadcast Probe Response frame, + * Beacon frame or FILS Discovery frame from an AP that the STA considers + * a suitable candidate for (re-)association - suitable in terms of +- * SSID and/or RSSI ++ * SSID and/or RSSI. ++ * @NL80211_SCAN_FLAG_LOW_SPAN: Span corresponds to the total time taken to ++ * accomplish the scan. Thus, this flag intends the driver to perform the ++ * scan request with lesser span/duration. It is specific to the driver ++ * implementations on how this is accomplished. Scan accuracy may get ++ * impacted with this flag. ++ * @NL80211_SCAN_FLAG_LOW_POWER: This flag intends the scan attempts to consume ++ * optimal possible power. Drivers can resort to their specific means to ++ * optimize the power. Scan accuracy may get impacted with this flag. ++ * @NL80211_SCAN_FLAG_HIGH_ACCURACY: Accuracy here intends to the extent of scan ++ * results obtained. Thus HIGH_ACCURACY scan flag aims to get maximum ++ * possible scan results. This flag hints the driver to use the best ++ * possible scan configuration to improve the accuracy in scanning. ++ * Latency and power use may get impacted with this flag. ++ * @NL80211_SCAN_FLAG_RANDOM_SN: randomize the sequence number in probe ++ * request frames from this scan to avoid correlation/tracking being ++ * possible. ++ * @NL80211_SCAN_FLAG_MIN_PREQ_CONTENT: minimize probe request content to ++ * only have supported rates and no additional capabilities (unless ++ * added by userspace explicitly.) + */ + enum nl80211_scan_flags { + NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0, +@@ -5070,6 +5385,11 @@ enum nl80211_scan_flags { + NL80211_SCAN_FLAG_ACCEPT_BCAST_PROBE_RESP = 1<<5, + NL80211_SCAN_FLAG_OCE_PROBE_REQ_HIGH_TX_RATE = 1<<6, + NL80211_SCAN_FLAG_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION = 1<<7, ++ NL80211_SCAN_FLAG_LOW_SPAN = 1<<8, ++ NL80211_SCAN_FLAG_LOW_POWER = 1<<9, ++ NL80211_SCAN_FLAG_HIGH_ACCURACY = 1<<10, ++ NL80211_SCAN_FLAG_RANDOM_SN = 1<<11, ++ NL80211_SCAN_FLAG_MIN_PREQ_CONTENT = 1<<12, + }; + + /** +@@ -5127,6 +5447,8 @@ enum nl80211_smps_mode { + * non-operating channel is expired and no longer valid. New CAC must + * be done on this channel before starting the operation. This is not + * applicable for ETSI dfs domain where pre-CAC is valid for ever. ++ * @NL80211_RADAR_CAC_STARTED: Channel Availability Check has been started, ++ * should be generated by HW if NL80211_EXT_FEATURE_DFS_OFFLOAD is enabled. + */ + enum nl80211_radar_event { + NL80211_RADAR_DETECTED, +@@ -5134,6 +5456,7 @@ enum nl80211_radar_event { + NL80211_RADAR_CAC_ABORTED, + NL80211_RADAR_NOP_FINISHED, + NL80211_RADAR_PRE_CAC_EXPIRED, ++ NL80211_RADAR_CAC_STARTED, + }; + + /** +@@ -5425,11 +5748,11 @@ enum nl80211_nan_func_attributes { + * @NL80211_NAN_SRF_INCLUDE: present if the include bit of the SRF set. + * This is a flag. + * @NL80211_NAN_SRF_BF: Bloom Filter. Present if and only if +- * &NL80211_NAN_SRF_MAC_ADDRS isn't present. This attribute is binary. ++ * %NL80211_NAN_SRF_MAC_ADDRS isn't present. This attribute is binary. + * @NL80211_NAN_SRF_BF_IDX: index of the Bloom Filter. Mandatory if +- * &NL80211_NAN_SRF_BF is present. This is a u8. ++ * %NL80211_NAN_SRF_BF is present. This is a u8. + * @NL80211_NAN_SRF_MAC_ADDRS: list of MAC addresses for the SRF. Present if +- * and only if &NL80211_NAN_SRF_BF isn't present. This is a nested ++ * and only if %NL80211_NAN_SRF_BF isn't present. This is a nested + * attribute. Each nested attribute is a MAC address. + * @NUM_NL80211_NAN_SRF_ATTR: internal + * @NL80211_NAN_SRF_ATTR_MAX: highest NAN SRF attribute +@@ -5469,4 +5792,15 @@ enum nl80211_nan_match_attributes { + NL80211_NAN_MATCH_ATTR_MAX = NUM_NL80211_NAN_MATCH_ATTR - 1 + }; + ++/** ++ * nl80211_external_auth_action - Action to perform with external ++ * authentication request. Used by NL80211_ATTR_EXTERNAL_AUTH_ACTION. ++ * @NL80211_EXTERNAL_AUTH_START: Start the authentication. ++ * @NL80211_EXTERNAL_AUTH_ABORT: Abort the ongoing authentication. ++ */ ++enum nl80211_external_auth_action { ++ NL80211_EXTERNAL_AUTH_START, ++ NL80211_EXTERNAL_AUTH_ABORT, ++}; ++ + #endif /* __LINUX_NL80211_H */ diff --git a/package/network/utils/iw/iw/patches/120-antenna_gain.patch b/package/network/utils/iw/iw/patches/120-antenna_gain.patch new file mode 100644 index 0000000000..27ba390c7f --- /dev/null +++ b/package/network/utils/iw/iw/patches/120-antenna_gain.patch @@ -0,0 +1,33 @@ +--- a/phy.c ++++ b/phy.c +@@ -727,3 +727,30 @@ COMMAND(set, antenna, " | all | + NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_antenna, + "Set a bitmap of allowed antennas to use for TX and RX.\n" + "The driver may reject antenna configurations it cannot support."); ++ ++static int handle_antenna_gain(struct nl80211_state *state, ++ struct nl_msg *msg, ++ int argc, char **argv, ++ enum id_input id) ++{ ++ char *endptr; ++ int dbm; ++ ++ /* get the required args */ ++ if (argc != 1) ++ return 1; ++ ++ dbm = strtol(argv[0], &endptr, 10); ++ if (*endptr) ++ return 2; ++ ++ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_GAIN, dbm); ++ ++ return 0; ++ ++ nla_put_failure: ++ return -ENOBUFS; ++} ++COMMAND(set, antenna_gain, "", ++ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_antenna_gain, ++ "Specify antenna gain."); diff --git a/package/network/utils/iw/iw/patches/200-reduce_size.patch b/package/network/utils/iw/iw/patches/200-reduce_size.patch new file mode 100644 index 0000000000..5f4bce6a8b --- /dev/null +++ b/package/network/utils/iw/iw/patches/200-reduce_size.patch @@ -0,0 +1,355 @@ +--- a/event.c ++++ b/event.c +@@ -342,6 +342,7 @@ static int print_event(struct nl_msg *ms + } + + switch (gnlh->cmd) { ++#ifdef IW_FULL + case NL80211_CMD_NEW_WIPHY: + printf("renamed to %s\n", nla_get_string(tb[NL80211_ATTR_WIPHY_NAME])); + break; +@@ -376,6 +377,7 @@ static int print_event(struct nl_msg *ms + case NL80211_CMD_SCHED_SCAN_RESULTS: + printf("got scheduled scan results\n"); + break; ++#endif + case NL80211_CMD_REG_CHANGE: + printf("regulatory domain change: "); + +@@ -454,6 +456,7 @@ static int print_event(struct nl_msg *ms + mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC])); + printf("del station %s\n", macbuf); + break; ++#ifdef IW_FULL + case NL80211_CMD_JOIN_IBSS: + mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC])); + printf("IBSS %s joined\n", macbuf); +@@ -618,9 +621,9 @@ static int print_event(struct nl_msg *ms + case NL80211_CMD_DEL_WIPHY: + printf("delete wiphy\n"); + break; ++#endif + default: +- printf("unknown event %d (%s)\n", +- gnlh->cmd, command_name(gnlh->cmd)); ++ printf("unknown event %d\n", gnlh->cmd); + break; + } + +--- a/info.c ++++ b/info.c +@@ -197,6 +197,7 @@ next: + } + } + ++#ifdef IW_FULL + if (tb_band[NL80211_BAND_ATTR_RATES]) { + printf("\t\tBitrates (non-HT):\n"); + nla_for_each_nested(nl_rate, tb_band[NL80211_BAND_ATTR_RATES], rem_rate) { +@@ -213,6 +214,7 @@ next: + printf("\n"); + } + } ++#endif + } + } + +@@ -278,6 +280,7 @@ next: + printf("\tCoverage class: %d (up to %dm)\n", coverage, 450 * coverage); + } + ++#ifdef IW_FULL + if (tb_msg[NL80211_ATTR_CIPHER_SUITES]) { + int num = nla_len(tb_msg[NL80211_ATTR_CIPHER_SUITES]) / sizeof(__u32); + int i; +@@ -289,6 +292,7 @@ next: + cipher_name(ciphers[i])); + } + } ++#endif + + if (tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX] && + tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX]) +@@ -308,11 +312,13 @@ next: + printf("\t\t * %s\n", iftype_name(nla_type(nl_mode))); + } + ++#ifdef IW_FULL + if (tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES]) { + printf("\tsoftware interface modes (can always be added):\n"); + nla_for_each_nested(nl_mode, tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES], rem_mode) + printf("\t\t * %s\n", iftype_name(nla_type(nl_mode))); + } ++#endif + + if (tb_msg[NL80211_ATTR_INTERFACE_COMBINATIONS]) { + struct nlattr *nl_combi; +@@ -409,6 +415,7 @@ broken_combination: + printf("\tinterface combinations are not supported\n"); + } + ++#ifdef IW_FULL + if (tb_msg[NL80211_ATTR_SUPPORTED_COMMANDS]) { + printf("\tSupported commands:\n"); + nla_for_each_nested(nl_cmd, tb_msg[NL80211_ATTR_SUPPORTED_COMMANDS], rem_cmd) +@@ -506,6 +513,7 @@ broken_combination: + printf("\t\t * wake up on TCP connection\n"); + } + } ++#endif + + if (tb_msg[NL80211_ATTR_ROAM_SUPPORT]) + printf("\tDevice supports roaming.\n"); +@@ -544,6 +552,7 @@ broken_combination: + } + } + ++#ifdef IW_FULL + if (tb_msg[NL80211_ATTR_FEATURE_FLAGS]) { + unsigned int features = nla_get_u32(tb_msg[NL80211_ATTR_FEATURE_FLAGS]); + +@@ -602,6 +611,7 @@ broken_combination: + if (features & NL80211_FEATURE_TDLS_CHANNEL_SWITCH) + printf("\tDevice supports TDLS channel switching\n"); + } ++#endif + + if (tb_msg[NL80211_ATTR_EXT_FEATURES]) { + struct nlattr *tb = tb_msg[NL80211_ATTR_EXT_FEATURES]; +@@ -658,6 +668,7 @@ TOPLEVEL(list, NULL, NL80211_CMD_GET_WIP + "List all wireless devices and their capabilities."); + TOPLEVEL(phy, NULL, NL80211_CMD_GET_WIPHY, NLM_F_DUMP, CIB_NONE, handle_info, NULL); + ++#ifdef IW_FULL + static int handle_commands(struct nl80211_state *state, struct nl_msg *msg, + int argc, char **argv, enum id_input id) + { +@@ -669,6 +680,7 @@ static int handle_commands(struct nl8021 + } + TOPLEVEL(commands, NULL, NL80211_CMD_GET_WIPHY, 0, CIB_NONE, handle_commands, + "list all known commands and their decimal & hex value"); ++#endif + + static int print_feature_handler(struct nl_msg *msg, void *arg) + { +--- a/scan.c ++++ b/scan.c +@@ -1170,6 +1170,7 @@ static void print_ht_op(const uint8_t ty + printf("\t\t * secondary channel offset: %s\n", + ht_secondary_offset[data[1] & 0x3]); + printf("\t\t * STA channel width: %s\n", sta_chan_width[(data[1] & 0x4)>>2]); ++ return; + printf("\t\t * RIFS: %d\n", (data[1] & 0x8)>>3); + printf("\t\t * HT protection: %s\n", protection[data[2] & 0x3]); + printf("\t\t * non-GF present: %d\n", (data[2] & 0x4) >> 2); +@@ -1497,6 +1498,14 @@ static void print_ie(const struct ie_pri + + static const struct ie_print ieprinters[] = { + [0] = { "SSID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), }, ++ [45] = { "HT capabilities", print_ht_capa, 26, 26, BIT(PRINT_SCAN), }, ++ [48] = { "RSN", print_rsn, 2, 255, BIT(PRINT_SCAN), }, ++ [61] = { "HT operation", print_ht_op, 22, 22, BIT(PRINT_SCAN), }, ++ [62] = { "Secondary Channel Offset", print_secchan_offs, 1, 1, BIT(PRINT_SCAN), }, ++ [114] = { "MESH ID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), }, ++ [191] = { "VHT capabilities", print_vht_capa, 12, 255, BIT(PRINT_SCAN), }, ++ [192] = { "VHT operation", print_vht_oper, 5, 255, BIT(PRINT_SCAN), }, ++#ifdef IW_FULL + [1] = { "Supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), }, + [3] = { "DS Parameter set", print_ds, 1, 1, BIT(PRINT_SCAN), }, + [5] = { "TIM", print_tim, 4, 255, BIT(PRINT_SCAN), }, +@@ -1506,21 +1515,15 @@ static const struct ie_print ieprinters[ + [32] = { "Power constraint", print_powerconstraint, 1, 1, BIT(PRINT_SCAN), }, + [35] = { "TPC report", print_tpcreport, 2, 2, BIT(PRINT_SCAN), }, + [42] = { "ERP", print_erp, 1, 255, BIT(PRINT_SCAN), }, +- [45] = { "HT capabilities", print_ht_capa, 26, 26, BIT(PRINT_SCAN), }, + [47] = { "ERP D4.0", print_erp, 1, 255, BIT(PRINT_SCAN), }, + [74] = { "Overlapping BSS scan params", print_obss_scan_params, 14, 255, BIT(PRINT_SCAN), }, +- [61] = { "HT operation", print_ht_op, 22, 22, BIT(PRINT_SCAN), }, +- [62] = { "Secondary Channel Offset", print_secchan_offs, 1, 1, BIT(PRINT_SCAN), }, +- [191] = { "VHT capabilities", print_vht_capa, 12, 255, BIT(PRINT_SCAN), }, +- [192] = { "VHT operation", print_vht_oper, 5, 255, BIT(PRINT_SCAN), }, +- [48] = { "RSN", print_rsn, 2, 255, BIT(PRINT_SCAN), }, + [50] = { "Extended supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), }, + [113] = { "MESH Configuration", print_mesh_conf, 7, 7, BIT(PRINT_SCAN), }, +- [114] = { "MESH ID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), }, + [127] = { "Extended capabilities", print_capabilities, 0, 255, BIT(PRINT_SCAN), }, + [107] = { "802.11u Interworking", print_interworking, 0, 255, BIT(PRINT_SCAN), }, + [108] = { "802.11u Advertisement", print_11u_advert, 0, 255, BIT(PRINT_SCAN), }, + [111] = { "802.11u Roaming Consortium", print_11u_rcon, 0, 255, BIT(PRINT_SCAN), }, ++#endif + }; + + static void print_wifi_wpa(const uint8_t type, uint8_t len, const uint8_t *data, +@@ -1968,6 +1971,7 @@ void print_ies(unsigned char *ie, int ie + ieprinters[ie[0]].flags & BIT(ptype)) { + print_ie(&ieprinters[ie[0]], + ie[0], ie[1], ie + 2, &ie_buffer); ++#ifdef IW_FULL + } else if (ie[0] == 221 /* vendor */) { + print_vendor(ie[1], ie + 2, unknown, ptype); + } else if (unknown) { +@@ -1977,6 +1981,7 @@ void print_ies(unsigned char *ie, int ie + for (i=0; i 45000) + is_dmg = true; ++#endif + } + if (bss[NL80211_BSS_BEACON_INTERVAL]) + printf("\tbeacon interval: %d TUs\n", +@@ -2319,6 +2328,7 @@ static int handle_stop_sched_scan(struct + return 0; + } + ++#ifdef IW_FULL + COMMAND(scan, sched_start, + SCHED_SCAN_OPTIONS, + NL80211_CMD_START_SCHED_SCAN, 0, CIB_NETDEV, handle_start_sched_scan, +@@ -2329,3 +2339,4 @@ COMMAND(scan, sched_start, + COMMAND(scan, sched_stop, "", + NL80211_CMD_STOP_SCHED_SCAN, 0, CIB_NETDEV, handle_stop_sched_scan, + "Stop an ongoing scheduled scan."); ++#endif +--- a/util.c ++++ b/util.c +@@ -281,6 +281,7 @@ static const char *commands[NL80211_CMD_ + + static char cmdbuf[100]; + ++#ifdef IW_FULL + const char *command_name(enum nl80211_commands cmd) + { + if (cmd <= NL80211_CMD_MAX && commands[cmd]) +@@ -288,6 +289,7 @@ const char *command_name(enum nl80211_co + sprintf(cmdbuf, "Unknown command (%d)", cmd); + return cmdbuf; + } ++#endif + + int ieee80211_channel_to_frequency(int chan, enum nl80211_band band) + { +@@ -426,6 +428,9 @@ int parse_keys(struct nl_msg *msg, char + char keybuf[13]; + int pos = 0; + ++#ifndef IW_FULL ++ return 1; ++#endif + if (!argc) + return 1; + +--- a/Makefile ++++ b/Makefile +@@ -25,6 +25,12 @@ OBJS-$(HWSIM) += hwsim.o + + OBJS += $(OBJS-y) $(OBJS-Y) + ++OBJS_FULL = ocb offch cqm wowlan coalesce roc p2p ap mgmt vendor ++ifdef IW_FULL ++ CFLAGS += -DIW_FULL ++else ++ OBJS:=$(filter-out $(patsubst %,%.o,$(OBJS_FULL)),$(OBJS)) ++endif + ALL = iw + + ifeq ($(NO_PKG_CONFIG),) +--- a/station.c ++++ b/station.c +@@ -629,10 +629,12 @@ static int handle_station_set_plink(stru + nla_put_failure: + return -ENOBUFS; + } ++#ifdef IW_FULL + COMMAND_ALIAS(station, set, " plink_action ", + NL80211_CMD_SET_STATION, 0, CIB_NETDEV, handle_station_set_plink, + "Set mesh peer link action for this station (peer).", + select_station_cmd, station_set_plink); ++#endif + + static int handle_station_set_vlan(struct nl80211_state *state, + struct nl_msg *msg, +@@ -727,11 +729,13 @@ static int handle_station_set_mesh_power + nla_put_failure: + return -ENOBUFS; + } ++#ifdef IW_FULL + COMMAND_ALIAS(station, set, " mesh_power_mode " + "", NL80211_CMD_SET_STATION, 0, CIB_NETDEV, + handle_station_set_mesh_power_mode, + "Set link-specific mesh power mode for this station", + select_station_cmd, station_set_mesh_power_mode); ++#endif + + static int handle_station_dump(struct nl80211_state *state, + struct nl_msg *msg, +--- a/interface.c ++++ b/interface.c +@@ -615,9 +615,11 @@ static int handle_interface_wds_peer(str + nla_put_failure: + return -ENOBUFS; + } ++#ifdef IW_FULL + COMMAND(set, peer, "", + NL80211_CMD_SET_WDS_PEER, 0, CIB_NETDEV, handle_interface_wds_peer, + "Set interface WDS peer."); ++#endif + + static int set_mcast_rate(struct nl80211_state *state, + struct nl_msg *msg, +@@ -707,6 +709,7 @@ static int handle_chan(struct nl80211_st + return handle_chanfreq(state, msg, true, argc, argv, id); + } + ++#ifdef IW_FULL + SECTION(switch); + COMMAND(switch, freq, + " [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons ] [block-tx]\n" +@@ -715,3 +718,4 @@ COMMAND(switch, freq, + "Switch the operating channel by sending a channel switch announcement (CSA)."); + COMMAND(switch, channel, " [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons ] [block-tx]", + NL80211_CMD_CHANNEL_SWITCH, 0, CIB_NETDEV, handle_chan, NULL); ++#endif +--- a/phy.c ++++ b/phy.c +@@ -359,6 +359,7 @@ static int handle_cac(struct nl80211_sta + + return 0; + } ++#ifdef IW_FULL + TOPLEVEL(cac, "channel [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n" + "freq [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n" + "freq [5|10|20|40|80|80+80|160] [ []]", +@@ -370,6 +371,7 @@ COMMAND(cac, trigger, + NL80211_CMD_RADAR_DETECT, 0, CIB_NETDEV, handle_cac_trigger, + "Start or trigger a channel availability check (CAC) looking to look for\n" + "radars on the given channel."); ++#endif + + static int handle_fragmentation(struct nl80211_state *state, + struct nl_msg *msg, diff --git a/package/network/utils/iw/patches/001-nl80211_h_sync.patch b/package/network/utils/iw/patches/001-nl80211_h_sync.patch index 4fd37579a9..6b65f61846 100644 --- a/package/network/utils/iw/patches/001-nl80211_h_sync.patch +++ b/package/network/utils/iw/patches/001-nl80211_h_sync.patch @@ -1,629 +1,41 @@ -diff --git a/nl80211.h b/nl80211.h -index c587a61..255a971 100644 --- a/nl80211.h +++ b/nl80211.h -@@ -11,6 +11,7 @@ - * Copyright 2008 Jouni Malinen - * Copyright 2008 Colin McCabe - * Copyright 2015-2017 Intel Deutschland GmbH -+ * Copyright (C) 2018 Intel Corporation +@@ -2373,6 +2373,9 @@ enum nl80211_commands { + * the allowed channel bandwidth configurations. (u8 attribute) + * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13. * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above -@@ -203,7 +204,8 @@ - * FILS shared key authentication offload should be able to construct the - * authentication and association frames for FILS shared key authentication and - * eventually do a key derivation as per IEEE 802.11ai. The below additional -- * parameters should be given to driver in %NL80211_CMD_CONNECT. -+ * parameters should be given to driver in %NL80211_CMD_CONNECT and/or in -+ * %NL80211_CMD_UPDATE_CONNECT_PARAMS. - * %NL80211_ATTR_FILS_ERP_USERNAME - used to construct keyname_nai - * %NL80211_ATTR_FILS_ERP_REALM - used to construct keyname_nai - * %NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM - used to construct erp message -@@ -214,7 +216,8 @@ - * as specified in IETF RFC 6696. - * - * When FILS shared key authentication is completed, driver needs to provide the -- * below additional parameters to userspace. -+ * below additional parameters to userspace, which can be either after setting -+ * up a connection or after roaming. - * %NL80211_ATTR_FILS_KEK - used for key renewal - * %NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM - used in further EAP-RP exchanges - * %NL80211_ATTR_PMKID - used to identify the PMKSA used/generated -@@ -542,7 +545,8 @@ - * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_USE_MFP, - * %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT, - * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, -- * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT, %NL80211_ATTR_MAC_HINT, and -+ * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT, -+ * %NL80211_ATTR_CONTROL_PORT_OVER_NL80211, %NL80211_ATTR_MAC_HINT, and - * %NL80211_ATTR_WIPHY_FREQ_HINT. - * If included, %NL80211_ATTR_MAC and %NL80211_ATTR_WIPHY_FREQ are - * restrictions on BSS selection, i.e., they effectively prevent roaming -@@ -977,21 +981,58 @@ - * only the %NL80211_ATTR_IE data is used and updated with this command. - * - * @NL80211_CMD_SET_PMK: For offloaded 4-Way handshake, set the PMK or PMK-R0 -- * for the given authenticator address (specified with &NL80211_ATTR_MAC). -- * When &NL80211_ATTR_PMKR0_NAME is set, &NL80211_ATTR_PMK specifies the -+ * for the given authenticator address (specified with %NL80211_ATTR_MAC). -+ * When %NL80211_ATTR_PMKR0_NAME is set, %NL80211_ATTR_PMK specifies the - * PMK-R0, otherwise it specifies the PMK. - * @NL80211_CMD_DEL_PMK: For offloaded 4-Way handshake, delete the previously - * configured PMK for the authenticator address identified by -- * &NL80211_ATTR_MAC. -+ * %NL80211_ATTR_MAC. - * @NL80211_CMD_PORT_AUTHORIZED: An event that indicates that the 4 way - * handshake was completed successfully by the driver. The BSSID is -- * specified with &NL80211_ATTR_MAC. Drivers that support 4 way handshake -+ * specified with %NL80211_ATTR_MAC. Drivers that support 4 way handshake - * offload should send this event after indicating 802.11 association with -- * &NL80211_CMD_CONNECT or &NL80211_CMD_ROAM. If the 4 way handshake failed -- * &NL80211_CMD_DISCONNECT should be indicated instead. -+ * %NL80211_CMD_CONNECT or %NL80211_CMD_ROAM. If the 4 way handshake failed -+ * %NL80211_CMD_DISCONNECT should be indicated instead. -+ * -+ * @NL80211_CMD_CONTROL_PORT_FRAME: Control Port (e.g. PAE) frame TX request -+ * and RX notification. This command is used both as a request to transmit -+ * a control port frame and as a notification that a control port frame -+ * has been received. %NL80211_ATTR_FRAME is used to specify the -+ * frame contents. The frame is the raw EAPoL data, without ethernet or -+ * 802.11 headers. -+ * When used as an event indication %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, -+ * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT and %NL80211_ATTR_MAC are added -+ * indicating the protocol type of the received frame; whether the frame -+ * was received unencrypted and the MAC address of the peer respectively. - * - * @NL80211_CMD_RELOAD_REGDB: Request that the regdb firmware file is reloaded. - * -+ * @NL80211_CMD_EXTERNAL_AUTH: This interface is exclusively defined for host -+ * drivers that do not define separate commands for authentication and -+ * association, but rely on user space for the authentication to happen. -+ * This interface acts both as the event request (driver to user space) -+ * to trigger the authentication and command response (userspace to -+ * driver) to indicate the authentication status. -+ * -+ * User space uses the %NL80211_CMD_CONNECT command to the host driver to -+ * trigger a connection. The host driver selects a BSS and further uses -+ * this interface to offload only the authentication part to the user -+ * space. Authentication frames are passed between the driver and user -+ * space through the %NL80211_CMD_FRAME interface. Host driver proceeds -+ * further with the association after getting successful authentication -+ * status. User space indicates the authentication status through -+ * %NL80211_ATTR_STATUS_CODE attribute in %NL80211_CMD_EXTERNAL_AUTH -+ * command interface. -+ * -+ * Host driver reports this status on an authentication failure to the -+ * user space through the connect result as the user space would have -+ * initiated the connection through the connect request. -+ * -+ * @NL80211_CMD_STA_OPMODE_CHANGED: An event that notify station's -+ * ht opmode or vht opmode changes using any of %NL80211_ATTR_SMPS_MODE, -+ * %NL80211_ATTR_CHANNEL_WIDTH,%NL80211_ATTR_NSS attributes with its -+ * address(specified in %NL80211_ATTR_MAC). -+ * - * @NL80211_CMD_MAX: highest used command number - * @__NL80211_CMD_AFTER_LAST: internal use - */ -@@ -1198,6 +1239,12 @@ enum nl80211_commands { - - NL80211_CMD_RELOAD_REGDB, - -+ NL80211_CMD_EXTERNAL_AUTH, -+ -+ NL80211_CMD_STA_OPMODE_CHANGED, -+ -+ NL80211_CMD_CONTROL_PORT_FRAME, -+ - /* add new commands above here */ - - /* used to define NL80211_CMD_MAX below */ -@@ -1445,6 +1492,15 @@ enum nl80211_commands { - * @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with - * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom - * ethertype frames used for key negotiation must not be encrypted. -+ * @NL80211_ATTR_CONTROL_PORT_OVER_NL80211: A flag indicating whether control -+ * port frames (e.g. of type given in %NL80211_ATTR_CONTROL_PORT_ETHERTYPE) -+ * will be sent directly to the network interface or sent via the NL80211 -+ * socket. If this attribute is missing, then legacy behavior of sending -+ * control port frames directly to the network interface is used. If the -+ * flag is included, then control port frames are sent over NL80211 instead -+ * using %CMD_CONTROL_PORT_FRAME. If control port routing over NL80211 is -+ * to be used then userspace must also use the %NL80211_ATTR_SOCKET_OWNER -+ * flag. - * - * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver. - * We recommend using nested, driver-specific attributes within this. -@@ -1932,6 +1988,12 @@ enum nl80211_commands { - * multicast group. - * If set during %NL80211_CMD_ASSOCIATE or %NL80211_CMD_CONNECT the - * station will deauthenticate when the socket is closed. -+ * If set during %NL80211_CMD_JOIN_IBSS the IBSS will be automatically -+ * torn down when the socket is closed. -+ * If set during %NL80211_CMD_JOIN_MESH the mesh setup will be -+ * automatically torn down when the socket is closed. -+ * If set during %NL80211_CMD_START_AP the AP will be automatically -+ * disabled when the socket is closed. - * - * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is - * the TDLS link initiator. -@@ -2153,6 +2215,35 @@ enum nl80211_commands { - * @NL80211_ATTR_PMKR0_NAME: PMK-R0 Name for offloaded FT. - * @NL80211_ATTR_PORT_AUTHORIZED: (reserved) - * -+ * @NL80211_ATTR_EXTERNAL_AUTH_ACTION: Identify the requested external -+ * authentication operation (u32 attribute with an -+ * &enum nl80211_external_auth_action value). This is used with the -+ * %NL80211_CMD_EXTERNAL_AUTH request event. -+ * @NL80211_ATTR_EXTERNAL_AUTH_SUPPORT: Flag attribute indicating that the user -+ * space supports external authentication. This attribute shall be used -+ * only with %NL80211_CMD_CONNECT request. The driver may offload -+ * authentication processing to user space if this capability is indicated -+ * in NL80211_CMD_CONNECT requests from the user space. -+ * -+ * @NL80211_ATTR_NSS: Station's New/updated RX_NSS value notified using this -+ * u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED. -+ * -+ * @NL80211_ATTR_TXQ_STATS: TXQ statistics (nested attribute, see &enum -+ * nl80211_txq_stats) -+ * @NL80211_ATTR_TXQ_LIMIT: Total packet limit for the TXQ queues for this phy. -+ * The smaller of this and the memory limit is enforced. -+ * @NL80211_ATTR_TXQ_MEMORY_LIMIT: Total memory memory limit (in bytes) for the -+ * TXQ queues for this phy. The smaller of this and the packet limit is -+ * enforced. -+ * @NL80211_ATTR_TXQ_QUANTUM: TXQ scheduler quantum (bytes). Number of bytes -+ * a flow is assigned on each round of the DRR scheduler. -+ * @NL80211_ATTR_HE_CAPABILITY: HE Capability information element (from -+ * association request when used with NL80211_CMD_NEW_STATION). Can be set -+ * only if %NL80211_STA_FLAG_WME is set. -+ * + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce + * transmit power to stay within regulatory limits. u32, dBi. + * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -2579,6 +2670,23 @@ enum nl80211_attrs { - NL80211_ATTR_PMKR0_NAME, - NL80211_ATTR_PORT_AUTHORIZED, +@@ -2835,6 +2838,8 @@ enum nl80211_attrs { + NL80211_ATTR_WIPHY_EDMG_CHANNELS, + NL80211_ATTR_WIPHY_EDMG_BW_CONFIG, -+ NL80211_ATTR_EXTERNAL_AUTH_ACTION, -+ NL80211_ATTR_EXTERNAL_AUTH_SUPPORT, -+ -+ NL80211_ATTR_NSS, -+ NL80211_ATTR_ACK_SIGNAL, -+ -+ NL80211_ATTR_CONTROL_PORT_OVER_NL80211, -+ -+ NL80211_ATTR_TXQ_STATS, -+ NL80211_ATTR_TXQ_LIMIT, -+ NL80211_ATTR_TXQ_MEMORY_LIMIT, -+ NL80211_ATTR_TXQ_QUANTUM, -+ -+ NL80211_ATTR_HE_CAPABILITY, -+ + NL80211_ATTR_WIPHY_ANTENNA_GAIN, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, -@@ -2618,6 +2726,8 @@ enum nl80211_attrs { - #define NL80211_ATTR_KEYS NL80211_ATTR_KEYS - #define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS - -+#define NL80211_WIPHY_NAME_MAXLEN 64 -+ - #define NL80211_MAX_SUPP_RATES 32 - #define NL80211_MAX_SUPP_HT_RATES 77 - #define NL80211_MAX_SUPP_REG_RULES 64 -@@ -2626,7 +2736,8 @@ enum nl80211_attrs { - #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 - #define NL80211_HT_CAPABILITY_LEN 26 - #define NL80211_VHT_CAPABILITY_LEN 12 -- -+#define NL80211_HE_MIN_CAPABILITY_LEN 16 -+#define NL80211_HE_MAX_CAPABILITY_LEN 51 - #define NL80211_MAX_NR_CIPHER_SUITES 5 - #define NL80211_MAX_NR_AKM_SUITES 2 - -@@ -2754,6 +2865,38 @@ struct nl80211_sta_flag_update { - } __attribute__((packed)); - - /** -+ * enum nl80211_he_gi - HE guard interval -+ * @NL80211_RATE_INFO_HE_GI_0_8: 0.8 usec -+ * @NL80211_RATE_INFO_HE_GI_1_6: 1.6 usec -+ * @NL80211_RATE_INFO_HE_GI_3_2: 3.2 usec -+ */ -+enum nl80211_he_gi { -+ NL80211_RATE_INFO_HE_GI_0_8, -+ NL80211_RATE_INFO_HE_GI_1_6, -+ NL80211_RATE_INFO_HE_GI_3_2, -+}; -+ -+/** -+ * enum nl80211_he_ru_alloc - HE RU allocation values -+ * @NL80211_RATE_INFO_HE_RU_ALLOC_26: 26-tone RU allocation -+ * @NL80211_RATE_INFO_HE_RU_ALLOC_52: 52-tone RU allocation -+ * @NL80211_RATE_INFO_HE_RU_ALLOC_106: 106-tone RU allocation -+ * @NL80211_RATE_INFO_HE_RU_ALLOC_242: 242-tone RU allocation -+ * @NL80211_RATE_INFO_HE_RU_ALLOC_484: 484-tone RU allocation -+ * @NL80211_RATE_INFO_HE_RU_ALLOC_996: 996-tone RU allocation -+ * @NL80211_RATE_INFO_HE_RU_ALLOC_2x996: 2x996-tone RU allocation -+ */ -+enum nl80211_he_ru_alloc { -+ NL80211_RATE_INFO_HE_RU_ALLOC_26, -+ NL80211_RATE_INFO_HE_RU_ALLOC_52, -+ NL80211_RATE_INFO_HE_RU_ALLOC_106, -+ NL80211_RATE_INFO_HE_RU_ALLOC_242, -+ NL80211_RATE_INFO_HE_RU_ALLOC_484, -+ NL80211_RATE_INFO_HE_RU_ALLOC_996, -+ NL80211_RATE_INFO_HE_RU_ALLOC_2x996, -+}; -+ -+/** - * enum nl80211_rate_info - bitrate information +@@ -5484,6 +5489,10 @@ enum nl80211_feature_flags { + * @NL80211_EXT_FEATURE_SAE_OFFLOAD: Device wants to do SAE authentication in + * station mode (SAE password is passed as part of the connect command). * - * These attribute types are used with %NL80211_STA_INFO_TXRATE -@@ -2785,6 +2928,13 @@ struct nl80211_sta_flag_update { - * @NL80211_RATE_INFO_5_MHZ_WIDTH: 5 MHz width - note that this is - * a legacy rate and will be reported as the actual bitrate, i.e. - * a quarter of the base (20 MHz) rate -+ * @NL80211_RATE_INFO_HE_MCS: HE MCS index (u8, 0-11) -+ * @NL80211_RATE_INFO_HE_NSS: HE NSS value (u8, 1-8) -+ * @NL80211_RATE_INFO_HE_GI: HE guard interval identifier -+ * (u8, see &enum nl80211_he_gi) -+ * @NL80211_RATE_INFO_HE_DCM: HE DCM value (u8, 0/1) -+ * @NL80211_RATE_INFO_RU_ALLOC: HE RU allocation, if not present then -+ * non-OFDMA was used (u8, see &enum nl80211_he_ru_alloc) - * @__NL80211_RATE_INFO_AFTER_LAST: internal use - */ - enum nl80211_rate_info { -@@ -2801,6 +2951,11 @@ enum nl80211_rate_info { - NL80211_RATE_INFO_160_MHZ_WIDTH, - NL80211_RATE_INFO_10_MHZ_WIDTH, - NL80211_RATE_INFO_5_MHZ_WIDTH, -+ NL80211_RATE_INFO_HE_MCS, -+ NL80211_RATE_INFO_HE_NSS, -+ NL80211_RATE_INFO_HE_GI, -+ NL80211_RATE_INFO_HE_DCM, -+ NL80211_RATE_INFO_HE_RU_ALLOC, - - /* keep last */ - __NL80211_RATE_INFO_AFTER_LAST, -@@ -2899,6 +3054,9 @@ enum nl80211_sta_bss_param { - * @NL80211_STA_INFO_RX_DURATION: aggregate PPDU duration for all frames - * received from the station (u64, usec) - * @NL80211_STA_INFO_PAD: attribute used for padding for 64-bit alignment -+ * @NL80211_STA_INFO_ACK_SIGNAL: signal strength of the last ACK frame(u8, dBm) -+ * @NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG: avg signal strength of (data) -+ * ACK frame (s8, dBm) - * @__NL80211_STA_INFO_AFTER_LAST: internal - * @NL80211_STA_INFO_MAX: highest possible station info attribute - */ -@@ -2937,6 +3095,8 @@ enum nl80211_sta_info { - NL80211_STA_INFO_TID_STATS, - NL80211_STA_INFO_RX_DURATION, - NL80211_STA_INFO_PAD, -+ NL80211_STA_INFO_ACK_SIGNAL, -+ NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG, - - /* keep last */ - __NL80211_STA_INFO_AFTER_LAST, -@@ -2954,6 +3114,7 @@ enum nl80211_sta_info { - * @NL80211_TID_STATS_TX_MSDU_FAILED: number of failed transmitted - * MSDUs (u64) - * @NL80211_TID_STATS_PAD: attribute used for padding for 64-bit alignment -+ * @NL80211_TID_STATS_TXQ_STATS: TXQ stats (nested attribute) - * @NUM_NL80211_TID_STATS: number of attributes here - * @NL80211_TID_STATS_MAX: highest numbered attribute here - */ -@@ -2964,6 +3125,7 @@ enum nl80211_tid_stats { - NL80211_TID_STATS_TX_MSDU_RETRIES, - NL80211_TID_STATS_TX_MSDU_FAILED, - NL80211_TID_STATS_PAD, -+ NL80211_TID_STATS_TXQ_STATS, - - /* keep last */ - NUM_NL80211_TID_STATS, -@@ -2971,6 +3133,44 @@ enum nl80211_tid_stats { - }; - - /** -+ * enum nl80211_txq_stats - per TXQ statistics attributes -+ * @__NL80211_TXQ_STATS_INVALID: attribute number 0 is reserved -+ * @NUM_NL80211_TXQ_STATS: number of attributes here -+ * @NL80211_TXQ_STATS_BACKLOG_BYTES: number of bytes currently backlogged -+ * @NL80211_TXQ_STATS_BACKLOG_PACKETS: number of packets currently -+ * backlogged -+ * @NL80211_TXQ_STATS_FLOWS: total number of new flows seen -+ * @NL80211_TXQ_STATS_DROPS: total number of packet drops -+ * @NL80211_TXQ_STATS_ECN_MARKS: total number of packet ECN marks -+ * @NL80211_TXQ_STATS_OVERLIMIT: number of drops due to queue space overflow -+ * @NL80211_TXQ_STATS_OVERMEMORY: number of drops due to memory limit overflow -+ * (only for per-phy stats) -+ * @NL80211_TXQ_STATS_COLLISIONS: number of hash collisions -+ * @NL80211_TXQ_STATS_TX_BYTES: total number of bytes dequeued from TXQ -+ * @NL80211_TXQ_STATS_TX_PACKETS: total number of packets dequeued from TXQ -+ * @NL80211_TXQ_STATS_MAX_FLOWS: number of flow buckets for PHY -+ * @NL80211_TXQ_STATS_MAX: highest numbered attribute here -+ */ -+enum nl80211_txq_stats { -+ __NL80211_TXQ_STATS_INVALID, -+ NL80211_TXQ_STATS_BACKLOG_BYTES, -+ NL80211_TXQ_STATS_BACKLOG_PACKETS, -+ NL80211_TXQ_STATS_FLOWS, -+ NL80211_TXQ_STATS_DROPS, -+ NL80211_TXQ_STATS_ECN_MARKS, -+ NL80211_TXQ_STATS_OVERLIMIT, -+ NL80211_TXQ_STATS_OVERMEMORY, -+ NL80211_TXQ_STATS_COLLISIONS, -+ NL80211_TXQ_STATS_TX_BYTES, -+ NL80211_TXQ_STATS_TX_PACKETS, -+ NL80211_TXQ_STATS_MAX_FLOWS, -+ -+ /* keep last */ -+ NUM_NL80211_TXQ_STATS, -+ NL80211_TXQ_STATS_MAX = NUM_NL80211_TXQ_STATS - 1 -+}; -+ -+/** - * enum nl80211_mpath_flags - nl80211 mesh path flags - * - * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active -@@ -3022,6 +3222,38 @@ enum nl80211_mpath_info { - }; - - /** -+ * enum nl80211_band_iftype_attr - Interface type data attributes ++ * @NL80211_EXT_FEATURE_AQL: The driver supports the Airtime Queue Limit (AQL) ++ * feature, which prevents bufferbloat by using the expected transmission ++ * time to limit the amount of data buffered in the hardware. + * -+ * @__NL80211_BAND_IFTYPE_ATTR_INVALID: attribute number 0 is reserved -+ * @NL80211_BAND_IFTYPE_ATTR_IFTYPES: nested attribute containing a flag attribute -+ * for each interface type that supports the band data -+ * @NL80211_BAND_IFTYPE_ATTR_HE_CAP_MAC: HE MAC capabilities as in HE -+ * capabilities IE -+ * @NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY: HE PHY capabilities as in HE -+ * capabilities IE -+ * @NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET: HE supported NSS/MCS as in HE -+ * capabilities IE -+ * @NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE: HE PPE thresholds information as -+ * defined in HE capabilities IE -+ * @NL80211_BAND_IFTYPE_ATTR_MAX: highest band HE capability attribute currently -+ * defined -+ * @__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST: internal use -+ */ -+enum nl80211_band_iftype_attr { -+ __NL80211_BAND_IFTYPE_ATTR_INVALID, -+ -+ NL80211_BAND_IFTYPE_ATTR_IFTYPES, -+ NL80211_BAND_IFTYPE_ATTR_HE_CAP_MAC, -+ NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY, -+ NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET, -+ NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE, -+ -+ /* keep last */ -+ __NL80211_BAND_IFTYPE_ATTR_AFTER_LAST, -+ NL80211_BAND_IFTYPE_ATTR_MAX = __NL80211_BAND_IFTYPE_ATTR_AFTER_LAST - 1 -+}; -+ -+/** - * enum nl80211_band_attr - band attributes - * @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved - * @NL80211_BAND_ATTR_FREQS: supported frequencies in this band, -@@ -3036,6 +3268,8 @@ enum nl80211_mpath_info { - * @NL80211_BAND_ATTR_VHT_MCS_SET: 32-byte attribute containing the MCS set as - * defined in 802.11ac - * @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE -+ * @NL80211_BAND_ATTR_IFTYPE_DATA: nested array attribute, with each entry using -+ * attributes from &enum nl80211_band_iftype_attr - * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined - * @__NL80211_BAND_ATTR_AFTER_LAST: internal use - */ -@@ -3051,6 +3285,7 @@ enum nl80211_band_attr { - - NL80211_BAND_ATTR_VHT_MCS_SET, - NL80211_BAND_ATTR_VHT_CAPA, -+ NL80211_BAND_ATTR_IFTYPE_DATA, - - /* keep last */ - __NL80211_BAND_ATTR_AFTER_LAST, -@@ -3060,6 +3295,29 @@ enum nl80211_band_attr { - #define NL80211_BAND_ATTR_HT_CAPA NL80211_BAND_ATTR_HT_CAPA - - /** -+ * enum nl80211_wmm_rule - regulatory wmm rule -+ * -+ * @__NL80211_WMMR_INVALID: attribute number 0 is reserved -+ * @NL80211_WMMR_CW_MIN: Minimum contention window slot. -+ * @NL80211_WMMR_CW_MAX: Maximum contention window slot. -+ * @NL80211_WMMR_AIFSN: Arbitration Inter Frame Space. -+ * @NL80211_WMMR_TXOP: Maximum allowed tx operation time. -+ * @nl80211_WMMR_MAX: highest possible wmm rule. -+ * @__NL80211_WMMR_LAST: Internal use. -+ */ -+enum nl80211_wmm_rule { -+ __NL80211_WMMR_INVALID, -+ NL80211_WMMR_CW_MIN, -+ NL80211_WMMR_CW_MAX, -+ NL80211_WMMR_AIFSN, -+ NL80211_WMMR_TXOP, -+ -+ /* keep last */ -+ __NL80211_WMMR_LAST, -+ NL80211_WMMR_MAX = __NL80211_WMMR_LAST - 1 -+}; -+ -+/** - * enum nl80211_frequency_attr - frequency attributes - * @__NL80211_FREQUENCY_ATTR_INVALID: attribute number 0 is reserved - * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz -@@ -3108,6 +3366,9 @@ enum nl80211_band_attr { - * on this channel in current regulatory domain. - * @NL80211_FREQUENCY_ATTR_NO_10MHZ: 10 MHz operation is not allowed - * on this channel in current regulatory domain. -+ * @NL80211_FREQUENCY_ATTR_WMM: this channel has wmm limitations. -+ * This is a nested attribute that contains the wmm limitation per AC. -+ * (see &enum nl80211_wmm_rule) - * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number - * currently defined - * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use -@@ -3136,6 +3397,7 @@ enum nl80211_frequency_attr { - NL80211_FREQUENCY_ATTR_IR_CONCURRENT, - NL80211_FREQUENCY_ATTR_NO_20MHZ, - NL80211_FREQUENCY_ATTR_NO_10MHZ, -+ NL80211_FREQUENCY_ATTR_WMM, - - /* keep last */ - __NL80211_FREQUENCY_ATTR_AFTER_LAST, -@@ -3319,7 +3581,7 @@ enum nl80211_sched_scan_match_attr { - * @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated - * base on contiguous rules and wider channels will be allowed to cross - * multiple contiguous/overlapping frequency ranges. -- * @NL80211_RRF_IR_CONCURRENT: See &NL80211_FREQUENCY_ATTR_IR_CONCURRENT -+ * @NL80211_RRF_IR_CONCURRENT: See %NL80211_FREQUENCY_ATTR_IR_CONCURRENT - * @NL80211_RRF_NO_HT40MINUS: channels can't be used in HT40- operation - * @NL80211_RRF_NO_HT40PLUS: channels can't be used in HT40+ operation - * @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed -@@ -4945,6 +5207,27 @@ enum nl80211_feature_flags { - * probe request tx deferral and suppression - * @NL80211_EXT_FEATURE_MFP_OPTIONAL: Driver supports the %NL80211_MFP_OPTIONAL - * value in %NL80211_ATTR_USE_MFP. -+ * @NL80211_EXT_FEATURE_LOW_SPAN_SCAN: Driver supports low span scan. -+ * @NL80211_EXT_FEATURE_LOW_POWER_SCAN: Driver supports low power scan. -+ * @NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN: Driver supports high accuracy scan. -+ * @NL80211_EXT_FEATURE_DFS_OFFLOAD: HW/driver will offload DFS actions. -+ * Device or driver will do all DFS-related actions by itself, -+ * informing user-space about CAC progress, radar detection event, -+ * channel change triggered by radar detection event. -+ * No need to start CAC from user-space, no need to react to -+ * "radar detected" event. -+ * @NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211: Driver supports sending and -+ * receiving control port frames over nl80211 instead of the netdevice. -+ * @NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT: This Driver support data ack -+ * rssi if firmware support, this flag is to intimate about ack rssi -+ * support to nl80211. -+ * @NL80211_EXT_FEATURE_TXQS: Driver supports FQ-CoDel-enabled intermediate -+ * TXQs. -+ * @NL80211_EXT_FEATURE_SCAN_RANDOM_SN: Driver/device supports randomizing the -+ * SN in probe request frames if requested by %NL80211_SCAN_FLAG_RANDOM_SN. -+ * @NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT: Driver/device can omit all data -+ * except for supported rates from the probe request content if requested -+ * by the %NL80211_SCAN_FLAG_MIN_PREQ_CONTENT flag. - * * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index. -@@ -4972,6 +5255,15 @@ enum nl80211_ext_feature_index { - NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE, - NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION, - NL80211_EXT_FEATURE_MFP_OPTIONAL, -+ NL80211_EXT_FEATURE_LOW_SPAN_SCAN, -+ NL80211_EXT_FEATURE_LOW_POWER_SCAN, -+ NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN, -+ NL80211_EXT_FEATURE_DFS_OFFLOAD, -+ NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211, -+ NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT, -+ NL80211_EXT_FEATURE_TXQS, -+ NL80211_EXT_FEATURE_SCAN_RANDOM_SN, -+ NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT, + */ +@@ -5529,6 +5538,8 @@ enum nl80211_ext_feature_index { + NL80211_EXT_FEATURE_EXT_KEY_ID, + NL80211_EXT_FEATURE_STA_TX_PWR, + NL80211_EXT_FEATURE_SAE_OFFLOAD, ++ NL80211_EXT_FEATURE_VLAN_OFFLOAD, ++ NL80211_EXT_FEATURE_AQL, /* add new features before the definition below */ NUM_NL80211_EXT_FEATURES, -@@ -5032,6 +5324,10 @@ enum nl80211_timeout_reason { - * of NL80211_CMD_TRIGGER_SCAN and NL80211_CMD_START_SCHED_SCAN - * requests. - * -+ * NL80211_SCAN_FLAG_LOW_SPAN, NL80211_SCAN_FLAG_LOW_POWER, and -+ * NL80211_SCAN_FLAG_HIGH_ACCURACY flags are exclusive of each other, i.e., only -+ * one of them can be used in the request. -+ * - * @NL80211_SCAN_FLAG_LOW_PRIORITY: scan request has low priority - * @NL80211_SCAN_FLAG_FLUSH: flush cache before scanning - * @NL80211_SCAN_FLAG_AP: force a scan even if the interface is configured -@@ -5059,7 +5355,26 @@ enum nl80211_timeout_reason { - * and suppression (if it has received a broadcast Probe Response frame, - * Beacon frame or FILS Discovery frame from an AP that the STA considers - * a suitable candidate for (re-)association - suitable in terms of -- * SSID and/or RSSI -+ * SSID and/or RSSI. -+ * @NL80211_SCAN_FLAG_LOW_SPAN: Span corresponds to the total time taken to -+ * accomplish the scan. Thus, this flag intends the driver to perform the -+ * scan request with lesser span/duration. It is specific to the driver -+ * implementations on how this is accomplished. Scan accuracy may get -+ * impacted with this flag. -+ * @NL80211_SCAN_FLAG_LOW_POWER: This flag intends the scan attempts to consume -+ * optimal possible power. Drivers can resort to their specific means to -+ * optimize the power. Scan accuracy may get impacted with this flag. -+ * @NL80211_SCAN_FLAG_HIGH_ACCURACY: Accuracy here intends to the extent of scan -+ * results obtained. Thus HIGH_ACCURACY scan flag aims to get maximum -+ * possible scan results. This flag hints the driver to use the best -+ * possible scan configuration to improve the accuracy in scanning. -+ * Latency and power use may get impacted with this flag. -+ * @NL80211_SCAN_FLAG_RANDOM_SN: randomize the sequence number in probe -+ * request frames from this scan to avoid correlation/tracking being -+ * possible. -+ * @NL80211_SCAN_FLAG_MIN_PREQ_CONTENT: minimize probe request content to -+ * only have supported rates and no additional capabilities (unless -+ * added by userspace explicitly.) - */ - enum nl80211_scan_flags { - NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0, -@@ -5070,6 +5385,11 @@ enum nl80211_scan_flags { - NL80211_SCAN_FLAG_ACCEPT_BCAST_PROBE_RESP = 1<<5, - NL80211_SCAN_FLAG_OCE_PROBE_REQ_HIGH_TX_RATE = 1<<6, - NL80211_SCAN_FLAG_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION = 1<<7, -+ NL80211_SCAN_FLAG_LOW_SPAN = 1<<8, -+ NL80211_SCAN_FLAG_LOW_POWER = 1<<9, -+ NL80211_SCAN_FLAG_HIGH_ACCURACY = 1<<10, -+ NL80211_SCAN_FLAG_RANDOM_SN = 1<<11, -+ NL80211_SCAN_FLAG_MIN_PREQ_CONTENT = 1<<12, - }; - - /** -@@ -5127,6 +5447,8 @@ enum nl80211_smps_mode { - * non-operating channel is expired and no longer valid. New CAC must - * be done on this channel before starting the operation. This is not - * applicable for ETSI dfs domain where pre-CAC is valid for ever. -+ * @NL80211_RADAR_CAC_STARTED: Channel Availability Check has been started, -+ * should be generated by HW if NL80211_EXT_FEATURE_DFS_OFFLOAD is enabled. - */ - enum nl80211_radar_event { - NL80211_RADAR_DETECTED, -@@ -5134,6 +5456,7 @@ enum nl80211_radar_event { - NL80211_RADAR_CAC_ABORTED, - NL80211_RADAR_NOP_FINISHED, - NL80211_RADAR_PRE_CAC_EXPIRED, -+ NL80211_RADAR_CAC_STARTED, - }; - - /** -@@ -5425,11 +5748,11 @@ enum nl80211_nan_func_attributes { - * @NL80211_NAN_SRF_INCLUDE: present if the include bit of the SRF set. - * This is a flag. - * @NL80211_NAN_SRF_BF: Bloom Filter. Present if and only if -- * &NL80211_NAN_SRF_MAC_ADDRS isn't present. This attribute is binary. -+ * %NL80211_NAN_SRF_MAC_ADDRS isn't present. This attribute is binary. - * @NL80211_NAN_SRF_BF_IDX: index of the Bloom Filter. Mandatory if -- * &NL80211_NAN_SRF_BF is present. This is a u8. -+ * %NL80211_NAN_SRF_BF is present. This is a u8. - * @NL80211_NAN_SRF_MAC_ADDRS: list of MAC addresses for the SRF. Present if -- * and only if &NL80211_NAN_SRF_BF isn't present. This is a nested -+ * and only if %NL80211_NAN_SRF_BF isn't present. This is a nested - * attribute. Each nested attribute is a MAC address. - * @NUM_NL80211_NAN_SRF_ATTR: internal - * @NL80211_NAN_SRF_ATTR_MAX: highest NAN SRF attribute -@@ -5469,4 +5792,15 @@ enum nl80211_nan_match_attributes { - NL80211_NAN_MATCH_ATTR_MAX = NUM_NL80211_NAN_MATCH_ATTR - 1 - }; - -+/** -+ * nl80211_external_auth_action - Action to perform with external -+ * authentication request. Used by NL80211_ATTR_EXTERNAL_AUTH_ACTION. -+ * @NL80211_EXTERNAL_AUTH_START: Start the authentication. -+ * @NL80211_EXTERNAL_AUTH_ABORT: Abort the ongoing authentication. -+ */ -+enum nl80211_external_auth_action { -+ NL80211_EXTERNAL_AUTH_START, -+ NL80211_EXTERNAL_AUTH_ABORT, -+}; -+ - #endif /* __LINUX_NL80211_H */ diff --git a/package/network/utils/iw/patches/120-antenna_gain.patch b/package/network/utils/iw/patches/120-antenna_gain.patch index 27ba390c7f..f8d537fe1e 100644 --- a/package/network/utils/iw/patches/120-antenna_gain.patch +++ b/package/network/utils/iw/patches/120-antenna_gain.patch @@ -1,9 +1,9 @@ --- a/phy.c +++ b/phy.c -@@ -727,3 +727,30 @@ COMMAND(set, antenna, " | all | - NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_antenna, - "Set a bitmap of allowed antennas to use for TX and RX.\n" - "The driver may reject antenna configurations it cannot support."); +@@ -855,3 +855,30 @@ static int handle_get_txq(struct nl80211 + COMMAND(get, txq, "", + NL80211_CMD_GET_WIPHY, 0, CIB_PHY, handle_get_txq, + "Get TXQ parameters."); + +static int handle_antenna_gain(struct nl80211_state *state, + struct nl_msg *msg, diff --git a/package/network/utils/iw/patches/130-survey-bss-rx-time.patch b/package/network/utils/iw/patches/130-survey-bss-rx-time.patch new file mode 100644 index 0000000000..d488c141c9 --- /dev/null +++ b/package/network/utils/iw/patches/130-survey-bss-rx-time.patch @@ -0,0 +1,12 @@ +--- a/survey.c ++++ b/survey.c +@@ -60,6 +60,9 @@ static int print_survey_handler(struct n + if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_RX]) + printf("\tchannel receive time:\t\t%llu ms\n", + (unsigned long long)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_RX])); ++ if (sinfo[NL80211_SURVEY_INFO_TIME_BSS_RX]) ++ printf("\tchannel BSS receive time:\t%llu ms\n", ++ (unsigned long long)nla_get_u64(sinfo[NL80211_SURVEY_INFO_TIME_BSS_RX])); + if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_TX]) + printf("\tchannel transmit time:\t\t%llu ms\n", + (unsigned long long)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_TX])); diff --git a/package/network/utils/iw/patches/200-reduce_size.patch b/package/network/utils/iw/patches/200-reduce_size.patch index 5f4bce6a8b..58613d59a0 100644 --- a/package/network/utils/iw/patches/200-reduce_size.patch +++ b/package/network/utils/iw/patches/200-reduce_size.patch @@ -1,6 +1,6 @@ --- a/event.c +++ b/event.c -@@ -342,6 +342,7 @@ static int print_event(struct nl_msg *ms +@@ -699,6 +699,7 @@ static int print_event(struct nl_msg *ms } switch (gnlh->cmd) { @@ -8,7 +8,7 @@ case NL80211_CMD_NEW_WIPHY: printf("renamed to %s\n", nla_get_string(tb[NL80211_ATTR_WIPHY_NAME])); break; -@@ -376,6 +377,7 @@ static int print_event(struct nl_msg *ms +@@ -734,6 +735,7 @@ static int print_event(struct nl_msg *ms case NL80211_CMD_SCHED_SCAN_RESULTS: printf("got scheduled scan results\n"); break; @@ -16,7 +16,7 @@ case NL80211_CMD_REG_CHANGE: printf("regulatory domain change: "); -@@ -454,6 +456,7 @@ static int print_event(struct nl_msg *ms +@@ -812,6 +814,7 @@ static int print_event(struct nl_msg *ms mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC])); printf("del station %s\n", macbuf); break; @@ -24,10 +24,10 @@ case NL80211_CMD_JOIN_IBSS: mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC])); printf("IBSS %s joined\n", macbuf); -@@ -618,9 +621,9 @@ static int print_event(struct nl_msg *ms - case NL80211_CMD_DEL_WIPHY: - printf("delete wiphy\n"); +@@ -989,9 +992,9 @@ static int print_event(struct nl_msg *ms + parse_nan_match(tb); break; + } +#endif default: - printf("unknown event %d (%s)\n", @@ -38,7 +38,23 @@ --- a/info.c +++ b/info.c -@@ -197,6 +197,7 @@ next: +@@ -164,6 +164,7 @@ static int print_phy_handler(struct nl_m + tb_band[NL80211_BAND_ATTR_VHT_MCS_SET]) + print_vht_info(nla_get_u32(tb_band[NL80211_BAND_ATTR_VHT_CAPA]), + nla_data(tb_band[NL80211_BAND_ATTR_VHT_MCS_SET])); ++#ifdef IW_FULL + if (tb_band[NL80211_BAND_ATTR_IFTYPE_DATA]) { + struct nlattr *nl_iftype; + int rem_band; +@@ -171,6 +172,7 @@ static int print_phy_handler(struct nl_m + nla_for_each_nested(nl_iftype, tb_band[NL80211_BAND_ATTR_IFTYPE_DATA], rem_band) + print_he_info(nl_iftype); + } ++#endif + if (tb_band[NL80211_BAND_ATTR_FREQS]) { + if (!band_had_freq) { + printf("\t\tFrequencies:\n"); +@@ -213,6 +215,7 @@ next: } } @@ -46,7 +62,7 @@ if (tb_band[NL80211_BAND_ATTR_RATES]) { printf("\t\tBitrates (non-HT):\n"); nla_for_each_nested(nl_rate, tb_band[NL80211_BAND_ATTR_RATES], rem_rate) { -@@ -213,6 +214,7 @@ next: +@@ -229,6 +232,7 @@ next: printf("\n"); } } @@ -54,7 +70,7 @@ } } -@@ -278,6 +280,7 @@ next: +@@ -294,6 +298,7 @@ next: printf("\tCoverage class: %d (up to %dm)\n", coverage, 450 * coverage); } @@ -62,7 +78,7 @@ if (tb_msg[NL80211_ATTR_CIPHER_SUITES]) { int num = nla_len(tb_msg[NL80211_ATTR_CIPHER_SUITES]) / sizeof(__u32); int i; -@@ -289,6 +292,7 @@ next: +@@ -305,6 +310,7 @@ next: cipher_name(ciphers[i])); } } @@ -70,7 +86,7 @@ if (tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX] && tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX]) -@@ -308,11 +312,13 @@ next: +@@ -324,11 +330,13 @@ next: printf("\t\t * %s\n", iftype_name(nla_type(nl_mode))); } @@ -84,7 +100,7 @@ if (tb_msg[NL80211_ATTR_INTERFACE_COMBINATIONS]) { struct nlattr *nl_combi; -@@ -409,6 +415,7 @@ broken_combination: +@@ -425,6 +433,7 @@ broken_combination: printf("\tinterface combinations are not supported\n"); } @@ -92,7 +108,7 @@ if (tb_msg[NL80211_ATTR_SUPPORTED_COMMANDS]) { printf("\tSupported commands:\n"); nla_for_each_nested(nl_cmd, tb_msg[NL80211_ATTR_SUPPORTED_COMMANDS], rem_cmd) -@@ -506,6 +513,7 @@ broken_combination: +@@ -522,6 +531,7 @@ broken_combination: printf("\t\t * wake up on TCP connection\n"); } } @@ -100,7 +116,7 @@ if (tb_msg[NL80211_ATTR_ROAM_SUPPORT]) printf("\tDevice supports roaming.\n"); -@@ -544,6 +552,7 @@ broken_combination: +@@ -560,6 +570,7 @@ broken_combination: } } @@ -108,15 +124,15 @@ if (tb_msg[NL80211_ATTR_FEATURE_FLAGS]) { unsigned int features = nla_get_u32(tb_msg[NL80211_ATTR_FEATURE_FLAGS]); -@@ -602,6 +611,7 @@ broken_combination: - if (features & NL80211_FEATURE_TDLS_CHANNEL_SWITCH) - printf("\tDevice supports TDLS channel switching\n"); +@@ -624,6 +635,7 @@ broken_combination: + if (features & NL80211_FEATURE_ND_RANDOM_MAC_ADDR) + printf("\tDevice supports randomizing MAC-addr in net-detect scans.\n"); } +#endif - if (tb_msg[NL80211_ATTR_EXT_FEATURES]) { - struct nlattr *tb = tb_msg[NL80211_ATTR_EXT_FEATURES]; -@@ -658,6 +668,7 @@ TOPLEVEL(list, NULL, NL80211_CMD_GET_WIP + if (tb_msg[NL80211_ATTR_TDLS_SUPPORT]) + printf("\tDevice supports T-DLS.\n"); +@@ -732,6 +744,7 @@ TOPLEVEL(list, NULL, NL80211_CMD_GET_WIP "List all wireless devices and their capabilities."); TOPLEVEL(phy, NULL, NL80211_CMD_GET_WIPHY, NLM_F_DUMP, CIB_NONE, handle_info, NULL); @@ -124,7 +140,7 @@ static int handle_commands(struct nl80211_state *state, struct nl_msg *msg, int argc, char **argv, enum id_input id) { -@@ -669,6 +680,7 @@ static int handle_commands(struct nl8021 +@@ -743,6 +756,7 @@ static int handle_commands(struct nl8021 } TOPLEVEL(commands, NULL, NL80211_CMD_GET_WIPHY, 0, CIB_NONE, handle_commands, "list all known commands and their decimal & hex value"); @@ -134,15 +150,17 @@ { --- a/scan.c +++ b/scan.c -@@ -1170,6 +1170,7 @@ static void print_ht_op(const uint8_t ty +@@ -1195,6 +1195,9 @@ static void print_ht_op(const uint8_t ty printf("\t\t * secondary channel offset: %s\n", ht_secondary_offset[data[1] & 0x3]); printf("\t\t * STA channel width: %s\n", sta_chan_width[(data[1] & 0x4)>>2]); ++#ifndef IW_FULL + return; ++#endif printf("\t\t * RIFS: %d\n", (data[1] & 0x8)>>3); printf("\t\t * HT protection: %s\n", protection[data[2] & 0x3]); printf("\t\t * non-GF present: %d\n", (data[2] & 0x4) >> 2); -@@ -1497,6 +1498,14 @@ static void print_ie(const struct ie_pri +@@ -1522,6 +1525,14 @@ static void print_ie(const struct ie_pri static const struct ie_print ieprinters[] = { [0] = { "SSID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), }, @@ -157,7 +175,7 @@ [1] = { "Supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), }, [3] = { "DS Parameter set", print_ds, 1, 1, BIT(PRINT_SCAN), }, [5] = { "TIM", print_tim, 4, 255, BIT(PRINT_SCAN), }, -@@ -1506,21 +1515,15 @@ static const struct ie_print ieprinters[ +@@ -1531,21 +1542,15 @@ static const struct ie_print ieprinters[ [32] = { "Power constraint", print_powerconstraint, 1, 1, BIT(PRINT_SCAN), }, [35] = { "TPC report", print_tpcreport, 2, 2, BIT(PRINT_SCAN), }, [42] = { "ERP", print_erp, 1, 255, BIT(PRINT_SCAN), }, @@ -180,7 +198,7 @@ }; static void print_wifi_wpa(const uint8_t type, uint8_t len, const uint8_t *data, -@@ -1968,6 +1971,7 @@ void print_ies(unsigned char *ie, int ie +@@ -2024,6 +2029,7 @@ void print_ies(unsigned char *ie, int ie ieprinters[ie[0]].flags & BIT(ptype)) { print_ie(&ieprinters[ie[0]], ie[0], ie[1], ie + 2, &ie_buffer); @@ -188,7 +206,7 @@ } else if (ie[0] == 221 /* vendor */) { print_vendor(ie[1], ie + 2, unknown, ptype); } else if (unknown) { -@@ -1977,6 +1981,7 @@ void print_ies(unsigned char *ie, int ie +@@ -2033,6 +2039,7 @@ void print_ies(unsigned char *ie, int ie for (i=0; i [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons ] [block-tx]\n" -@@ -715,3 +718,4 @@ COMMAND(switch, freq, +@@ -727,3 +730,4 @@ COMMAND(switch, freq, "Switch the operating channel by sending a channel switch announcement (CSA)."); COMMAND(switch, channel, " [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons ] [block-tx]", NL80211_CMD_CHANNEL_SWITCH, 0, CIB_NETDEV, handle_chan, NULL); +#endif --- a/phy.c +++ b/phy.c -@@ -359,6 +359,7 @@ static int handle_cac(struct nl80211_sta - - return 0; +@@ -369,6 +369,7 @@ err_out: + free(cac_trigger_argv); + return err; } +#ifdef IW_FULL TOPLEVEL(cac, "channel [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n" "freq [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n" "freq [5|10|20|40|80|80+80|160] [ []]", -@@ -370,6 +371,7 @@ COMMAND(cac, trigger, +@@ -380,6 +381,7 @@ COMMAND(cac, trigger, NL80211_CMD_RADAR_DETECT, 0, CIB_NETDEV, handle_cac_trigger, "Start or trigger a channel availability check (CAC) looking to look for\n" "radars on the given channel."); diff --git a/package/network/utils/layerscape/restool/Makefile b/package/network/utils/layerscape/restool/Makefile index d87649ebe4..4dc0967651 100644 --- a/package/network/utils/layerscape/restool/Makefile +++ b/package/network/utils/layerscape/restool/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=restool -PKG_VERSION:=lsdk-1806 +PKG_VERSION:=lsdk-1903 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/restool -PKG_SOURCE_VERSION:=2815572ab25029a8fb47f0dc6a0b56ae5ff76713 -PKG_MIRROR_HASH:=cf76a8fd1239bb9b7696c25d5c26c6e81ea73497ad1ada9488390daf0ef7c291 +PKG_SOURCE_VERSION:=8b1dd407bbd48b4f1a50c71b78083112a6397619 +PKG_MIRROR_HASH:=2bb086dd4fc4975268b89867e7fc95b42a764b56c4a498518ef0d54694ffe40e include $(INCLUDE_DIR)/package.mk diff --git a/package/network/utils/linux-atm/files/atm.hotplug b/package/network/utils/linux-atm/files/atm.hotplug old mode 100755 new mode 100644 diff --git a/package/network/utils/linux-atm/files/br2684-up b/package/network/utils/linux-atm/files/br2684-up old mode 100755 new mode 100644 diff --git a/package/network/utils/linux-atm/files/br2684ctl_wrap b/package/network/utils/linux-atm/files/br2684ctl_wrap old mode 100755 new mode 100644 diff --git a/package/network/utils/linux-atm/patches/300-objcopy_path.patch b/package/network/utils/linux-atm/patches/300-objcopy_path.patch new file mode 100644 index 0000000000..4f11516b2f --- /dev/null +++ b/package/network/utils/linux-atm/patches/300-objcopy_path.patch @@ -0,0 +1,40 @@ +--- a/src/extra/Makefile.am ++++ b/src/extra/Makefile.am +@@ -7,6 +7,8 @@ EXTRA_DIST = linux-atm.spec.in \ + BUILT_SOURCES = pca200e.bin pca200e_ecd.bin2 sba200e_ecd.bin2 + CLEANFILES = pca200e.bin pca200e_ecd.bin2 sba200e_ecd.bin2 + ++OBJCOPY = objcopy ++ + install-exec-hook: + $(MKDIR_P) $(DESTDIR)/lib/firmware + $(INSTALL_DATA) $(srcdir)/pca200e.bin $(DESTDIR)/lib/firmware +@@ -14,7 +16,7 @@ install-exec-hook: + $(INSTALL_DATA) $(srcdir)/sba200e_ecd.bin2 $(DESTDIR)/lib/firmware + + %.bin %.bin2: %.data +- objcopy -Iihex $< -Obinary $@.gz ++ $(OBJCOPY) -Iihex $< -Obinary $@.gz + gzip -n -df $@.gz + + +--- a/src/extra/Makefile.in ++++ b/src/extra/Makefile.in +@@ -187,6 +187,8 @@ CLEANFILES = pca200e.bin pca200e_ecd.bin + all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + ++OBJCOPY = objcopy ++ + .SUFFIXES: + $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ +@@ -385,7 +387,7 @@ install-exec-hook: + $(INSTALL_DATA) $(srcdir)/sba200e_ecd.bin2 $(DESTDIR)/lib/firmware + + %.bin %.bin2: %.data +- objcopy -Iihex $< -Obinary $@.gz ++ $(OBJCOPY) -Iihex $< -Obinary $@.gz + gzip -n -df $@.gz + + # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/package/network/utils/linux-atm/patches/rtability_fixes.patch b/package/network/utils/linux-atm/patches/rtability_fixes.patch deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/package/network/utils/phytool/Makefile b/package/network/utils/phytool/Makefile deleted file mode 100644 index e385d5ebaf..0000000000 --- a/package/network/utils/phytool/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=phytool -PKG_RELEASE:=1 - -PKG_RELEASE=$(PKG_SOURCE_VERSION) - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/wkz/phytool.git -PKG_SOURCE_DATE:=2017-09-12 -PKG_SOURCE_VERSION:=8882328c08ba2efb13c049812098f1d0cb8adf0c -PKG_MIRROR_HASH:=11d406bfe5e4e8372e7e7fed05440e28d6567918910e8cc3671ff3c51dbd165f - -PKG_LICENSE:=GPL-2.0 -PKG_LICENSE_FILES:=COPYING - -PKG_MAINTAINER:=Christian Lamparter - -include $(INCLUDE_DIR)/package.mk - -define Package/phytool - SECTION:=net - CATEGORY:=Network - TITLE:=phytool Linux MDIO register access - URL:=https://github.com/wkz/phytool.git -endef - -define Package/phytool/description - Linux MDIO register access -endef - -define Build/Configure -endef - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - CC="$(TARGET_CC)" \ - CFLAGS="$(TARGET_CFLAGS) -Wall" \ - LDFLAGS="$(TARGET_LDFLAGS)" -endef - -define Package/phytool/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/phytool $(1)/usr/bin/ -endef - -$(eval $(call BuildPackage,phytool)) diff --git a/package/network/utils/rssileds/Makefile b/package/network/utils/rssileds/Makefile index d3fb66adc9..7a59314693 100644 --- a/package/network/utils/rssileds/Makefile +++ b/package/network/utils/rssileds/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rssileds PKG_VERSION:=0.2 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_LICNESE:=GPL-2.0+ include $(INCLUDE_DIR)/package.mk @@ -18,7 +18,7 @@ define Package/rssileds SECTION:=net CATEGORY:=Network TITLE:=RSSI real-time LED indicator - DEPENDS:=+libiwinfo + DEPENDS:=+libiwinfo +libnl-tiny +libubox +libuci MAINTAINER:=Daniel Golle endef diff --git a/package/network/utils/rssileds/files/rssileds.init b/package/network/utils/rssileds/files/rssileds.init old mode 100755 new mode 100644 index b0d262725b..4c9b54909e --- a/package/network/utils/rssileds/files/rssileds.init +++ b/package/network/utils/rssileds/files/rssileds.init @@ -2,7 +2,7 @@ # (C) 2012 Daniel Golle, Allnet GmbH START=96 -STOP=96 +STOP=89 RSSILEDS_BIN="/usr/sbin/rssileds" SERVICE_DAEMONIZE=1 diff --git a/package/network/utils/umbim/Makefile b/package/network/utils/umbim/Makefile index 4faa5acf90..cc34002f6e 100644 --- a/package/network/utils/umbim/Makefile +++ b/package/network/utils/umbim/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/umbim.git -PKG_SOURCE_DATE:=2015-07-04 -PKG_SOURCE_VERSION:=29aaf43b097ee57f7aa1bb24341db6cc4148cbf3 -PKG_MIRROR_HASH:=56e612d9da1ac26de96c4929fbabd047862d725a13ceb904807a9d3d7db43a30 +PKG_SOURCE_DATE:=2019-09-11 +PKG_SOURCE_VERSION:=184b707ddaa0acee84d02e0ffe599cb8b67782bd +PKG_MIRROR_HASH:=482ff69144f81fafed99035840f5a24e772472f2df2f3ac0219d6de791ac5835 PKG_MAINTAINER:=John Crispin PKG_LICENSE:=GPL-2.0 @@ -23,6 +23,7 @@ include $(INCLUDE_DIR)/cmake.mk define Package/umbim SECTION:=net CATEGORY:=Network + SUBMENU:=WWAN DEPENDS:=+libubox +kmod-usb-net +kmod-usb-net-cdc-mbim +wwan TITLE:=Control utility for mobile broadband modems endef diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index f4b30b87eb..8cbe9e97e7 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -23,17 +23,22 @@ proto_qmi_init_config() { proto_config_add_boolean autoconnect proto_config_add_int plmn proto_config_add_int timeout + proto_config_add_int mtu proto_config_add_defaults } proto_qmi_setup() { local interface="$1" local dataformat connstat - local device apn auth username password pincode delay modes pdptype profile dhcpv6 autoconnect plmn timeout $PROTO_DEFAULT_OPTIONS + local device apn auth username password pincode delay modes pdptype + local profile dhcpv6 autoconnect plmn timeout mtu $PROTO_DEFAULT_OPTIONS local ip4table ip6table local cid_4 pdh_4 cid_6 pdh_6 local ip_6 ip_prefix_length gateway_6 dns1_6 dns2_6 - json_get_vars device apn auth username password pincode delay modes pdptype profile dhcpv6 autoconnect plmn ip4table ip6table timeout $PROTO_DEFAULT_OPTIONS + + json_get_vars device apn auth username password pincode delay modes + json_get_vars pdptype profile dhcpv6 autoconnect plmn ip4table + json_get_vars ip6table timeout mtu $PROTO_DEFAULT_OPTIONS [ "$timeout" = "" ] && timeout="10" @@ -68,6 +73,11 @@ proto_qmi_setup() { return 1 } + [ -n "$mtu" ] && { + echo "Setting MTU to $mtu" + /sbin/ip link set dev $ifname mtu $mtu + } + echo "Waiting for SIM initialization" local uninitialized_timeout=0 while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do @@ -322,9 +332,9 @@ proto_qmi_setup() { proto_add_dns_server "$dns2_6" } [ -n "$zone" ] && { - proto_add_data - json_add_string zone "$zone" - proto_close_data + proto_add_data + json_add_string zone "$zone" + proto_close_data } proto_send_update "$interface" else diff --git a/package/network/utils/wireless-tools/Makefile b/package/network/utils/wireless-tools/Makefile index dd3430a426..485b85ddc7 100644 --- a/package/network/utils/wireless-tools/Makefile +++ b/package/network/utils/wireless-tools/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wireless-tools PKG_VERSION:=29 PKG_MINOR:= -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_SOURCE:=wireless_tools.$(PKG_VERSION)$(PKG_MINOR).tar.gz PKG_SOURCE_URL:=https://hewlettpackard.github.io/wireless-tools @@ -45,6 +45,7 @@ $(call Package/wireless-tools/Default) SECTION:=libs CATEGORY:=Libraries TITLE:=Library for manipulating Linux Wireless Extensions + ABI_VERSION:=29 endef define Package/libiw/description diff --git a/package/network/utils/wpan-tools/Makefile b/package/network/utils/wpan-tools/Makefile index e57223dee4..060aaf5046 100644 --- a/package/network/utils/wpan-tools/Makefile +++ b/package/network/utils/wpan-tools/Makefile @@ -24,10 +24,6 @@ define Package/wpan-tools DEPENDS:= +libnl endef -define Build/Configure - $(call Build/Configure/Default) -endef - define Package/wpan-tools/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/iwpan $(1)/usr/sbin/ diff --git a/package/network/utils/wwan/Makefile b/package/network/utils/wwan/Makefile index bb829b5e2c..1c5a5e6669 100644 --- a/package/network/utils/wwan/Makefile +++ b/package/network/utils/wwan/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wwan PKG_VERSION:=2019-04-29 -PKG_RELEASE=4 +PKG_RELEASE=5 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:= diff --git a/package/network/utils/wwan/files/wwan.sh b/package/network/utils/wwan/files/wwan.sh index 303fa9e99e..1ffb94a92b 100755 --- a/package/network/utils/wwan/files/wwan.sh +++ b/package/network/utils/wwan/files/wwan.sh @@ -32,31 +32,55 @@ proto_wwan_init_config() { proto_config_add_string pincode proto_config_add_string delay proto_config_add_string modes + proto_config_add_string bus } proto_wwan_setup() { - local driver usb devicename desc + local driver usb devicename desc bus - for a in `ls /sys/bus/usb/devices`; do - local vendor product - [ -z "$usb" -a -f /sys/bus/usb/devices/$a/idVendor -a -f /sys/bus/usb/devices/$a/idProduct ] || continue - vendor=$(cat /sys/bus/usb/devices/$a/idVendor) - product=$(cat /sys/bus/usb/devices/$a/idProduct) - [ -f /lib/network/wwan/$vendor:$product ] && { - usb=/lib/network/wwan/$vendor:$product - devicename=$a - } - done + json_get_vars bus + + if [ -L "/sys/bus/usb/devices/${bus}" ]; then + if [ -f "/sys/bus/usb/devices/${bus}/idVendor" ] \ + && [ -f "/sys/bus/usb/devices/${bus}/idProduct" ]; then + local vendor product + vendor=$(cat /sys/bus/usb/devices/${bus}/idVendor) + product=$(cat /sys/bus/usb/devices/${bus}/idProduct) + [ -f /lib/network/wwan/$vendor:$product ] && { + usb=/lib/network/wwan/$vendor:$product + devicename=$bus + } + else + echo "wwan[$$]" "Specified usb bus ${bus} was not found" + proto_notify_error "$interface" NO_USB + proto_block_restart "$interface" + return 1 + fi + else + echo "wwan[$$]" "Searching for a valid wwan usb device..." + for a in `ls /sys/bus/usb/devices`; do + local vendor product + [ -z "$usb" -a -f /sys/bus/usb/devices/$a/idVendor -a -f /sys/bus/usb/devices/$a/idProduct ] || continue + vendor=$(cat /sys/bus/usb/devices/$a/idVendor) + product=$(cat /sys/bus/usb/devices/$a/idProduct) + [ -f /lib/network/wwan/$vendor:$product ] && { + usb=/lib/network/wwan/$vendor:$product + devicename=$a + } + done + fi + + echo "wwan[$$]" "Using wwan usb device on bus $devicename" [ -n "$usb" ] && { local old_cb control data json_set_namespace wwan old_cb json_init - json_load "$(cat $usb)" + json_load "$(cat "$usb")" json_select json_get_vars desc control data - json_set_namespace $old_cb + json_set_namespace "$old_cb" [ -n "$control" -a -n "$data" ] && { ttys=$(ls -d /sys/bus/usb/devices/$devicename/${devicename}*/tty?* /sys/bus/usb/devices/$devicename/${devicename}*/tty/tty?* | sed "s/.*\///g" | tr "\n" " ") @@ -68,6 +92,9 @@ proto_wwan_setup() { [ -z "$ctl_device" ] && for net in $(ls /sys/class/net/ | grep -e wwan -e usb); do [ -z "$ctl_device" ] || continue + [ -n "$bus" ] && { + [ $(readlink /sys/class/net/$net | grep $bus) ] || continue + } driver=$(grep DRIVER /sys/class/net/$net/device/uevent | cut -d= -f2) case "$driver" in qmi_wwan|cdc_mbim) @@ -88,9 +115,9 @@ proto_wwan_setup() { return 1 } - uci_set_state network $interface driver "$driver" - uci_set_state network $interface ctl_device "$ctl_device" - uci_set_state network $interface dat_device "$dat_device" + uci_set_state network "$interface" driver "$driver" + uci_set_state network "$interface" ctl_device "$ctl_device" + uci_set_state network "$interface" dat_device "$dat_device" case $driver in qmi_wwan) proto_qmi_setup $@ ;; @@ -103,9 +130,9 @@ proto_wwan_setup() { proto_wwan_teardown() { local interface=$1 - local driver=$(uci_get_state network $interface driver) - ctl_device=$(uci_get_state network $interface ctl_device) - dat_device=$(uci_get_state network $interface dat_device) + local driver=$(uci_get_state network "$interface" driver) + ctl_device=$(uci_get_state network "$interface" ctl_device) + dat_device=$(uci_get_state network "$interface" dat_device) case $driver in qmi_wwan) proto_qmi_teardown $@ ;; diff --git a/package/network/utils/wwan/files/wwan.usb b/package/network/utils/wwan/files/wwan.usb old mode 100755 new mode 100644 diff --git a/package/network/utils/wwan/files/wwan.usbmisc b/package/network/utils/wwan/files/wwan.usbmisc old mode 100755 new mode 100644 index 4079a7fd8f..a86ff5d98b --- a/package/network/utils/wwan/files/wwan.usbmisc +++ b/package/network/utils/wwan/files/wwan.usbmisc @@ -17,7 +17,8 @@ find_wwan_iface() { [ -z "$device" -a "$proto" = wwan ] || [ "$device" = "/dev/$DEVNAME" ] || return 0 if [ "$ACTION" = add ]; then proto_set_available "$cfg" 1 - else + fi + if [ "$ACTION" = remove ]; then proto_set_available "$cfg" 0 fi exit 0 diff --git a/package/utils/admswconfig/Makefile b/package/utils/admswconfig/Makefile deleted file mode 100644 index b2a163248a..0000000000 --- a/package/utils/admswconfig/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -# -# Copyright (C) 2007 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:=admswconfig -PKG_VERSION:=0.1 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://downloads.openwrt.org/sources -PKG_HASH:=37b4409ea2105520b4a7327e53c3210251000ddf58f81a8e4c19e6ff9d615afe - -PKG_FLAGS:=nonshared - -include $(INCLUDE_DIR)/package.mk - -define Package/admswconfig - SECTION:=utils - CATEGORY:=Utilities - TITLE:=ADM5120 Switch configuration tool - DEPENDS:=@TARGET_adm5120 - MAINTAINER:=Florian Fainelli -endef - -define Package/admswconfig/description - A program to configure the internal ethernet switch of an ADM5120 processor. - You need the corresponding driver for the switch in the kernel. - With this program you can configure which ports of the switch belong - to the different ethernet devices. -endef - -define Build/Configure -endef - -define Build/Compile - $(TARGET_CC) $(TARGET_CFLAGS) -Os $(PKG_BUILD_DIR)/admswconfig.c -o $(PKG_BUILD_DIR)/$(PKG_NAME) -endef - -define Package/admswconfig/install - $(INSTALL_DIR) $(1)/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/admswconfig $(1)/sbin/ - $(INSTALL_DIR) $(1)/lib/network/ - $(INSTALL_DATA) ./files/admswswitch.sh $(1)/lib/network/admswswitch.sh - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/admswconfig $(1)/etc/init.d/admswconfig -endef - -$(eval $(call BuildPackage,admswconfig)) diff --git a/package/utils/admswconfig/files/admswconfig b/package/utils/admswconfig/files/admswconfig deleted file mode 100644 index 7231030650..0000000000 --- a/package/utils/admswconfig/files/admswconfig +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2006 OpenWrt.org - -START=05 - -start() { - [ -e /etc/config/network ] && exit 0 - - mkdir -p /etc/config - - board_name=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /system type/ {print $2}' /proc/cpuinfo) - - case "$board_name" in - "Compex WP54"*) - board="Compex WP54";; - esac - - echo "$board" |awk ' - function p(cfgname, name) { - if (c[name] != "") print " option " cfgname " \"" c[name] "\"" - } - - BEGIN { - FS="=" - c["lan_ifname"]="eth0" - c["wan_ifname"]="eth1" - c["eth0ports"]="1 2 3 4" - c["eth1ports"]="0" - } - END { - board=$1 - if (board == "Compex WP54") { - c["eth0ports"]="0" - c["eth1ports"]="1" - } - - print "#### VLAN configuration " - print "config switch" - p("eth0", "eth0ports") - p("eth1", "eth1ports") - print "" - print "" - print "#### Loopback configuration" - print "config interface loopback" - print " option ifname \"lo\"" - print " option proto static" - print " option ipaddr 127.0.0.1" - print " option netmask 255.0.0.0" - print "" - print "" - print "#### LAN configuration" - print "config interface lan" - print " option type bridge" - p("ifname", "lan_ifname") - p("macaddr", "lan_macaddr") - print " option proto static" - print " option ipaddr 192.168.1.1" - print " option netmask 255.255.255.0" - print "" - print "" - print "#### WAN configuration" - print "config interface wan" - p("ifname", "wan_ifname") - p("macaddr", "wan_macaddr") - print " option proto dhcp" - }' > /etc/config/network -} - diff --git a/package/utils/admswconfig/files/admswswitch.sh b/package/utils/admswconfig/files/admswswitch.sh deleted file mode 100644 index 3b8aabf34d..0000000000 --- a/package/utils/admswconfig/files/admswswitch.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# Copyright (C) 2006 OpenWrt.org - -setup_switch_vlan() { - config_get ports "$CONFIG_SECTION" "eth$1" - ports=`echo "$ports"| sed s/" "/""/g` - ip link set dev eth$1 down - admswconfig eth$1 ${ports}c - ip link set dev eth$1 up -} - -setup_switch() { - config_cb() { - case "$1" in - switch) - option_cb() { - case "$1" in - eth*) setup_switch_vlan "${1##eth}";; - esac - } - ;; - *) - option_cb() { return 0; } - ;; - esac - } - config_load network -} diff --git a/package/utils/admswconfig/patches/001-matrix.patch b/package/utils/admswconfig/patches/001-matrix.patch deleted file mode 100644 index e50d515757..0000000000 --- a/package/utils/admswconfig/patches/001-matrix.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/admswconfig.c -+++ b/admswconfig.c -@@ -111,9 +111,9 @@ int main(int argc, char **argv) - } - } else { - /* display matrix */ -- printf("ethX\tport0\tport1\tport2\tport3\tport4"); -- if (info.ports == 6) -- printf("\tport5"); -+ printf("ethX"); -+ for (i = 0; i < info.ports; i++) -+ printf("\tport%d", i); - printf("\tCPU\n"); - for (i = 0; i < info.ports; i++) { - printf("%d", i); diff --git a/package/utils/admswconfig/patches/002-fix-musl.patch b/package/utils/admswconfig/patches/002-fix-musl.patch deleted file mode 100644 index 3dad1f99d5..0000000000 --- a/package/utils/admswconfig/patches/002-fix-musl.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/admswconfig.c -+++ b/admswconfig.c -@@ -68,7 +68,7 @@ int main(int argc, char **argv) - return 1; - } - strcpy(ifr.ifr_name, device); -- ifr.ifr_data = (caddr_t)&info; -+ ifr.ifr_data = (void *)&info; - if (ioctl(fd, SIOCGADMINFO, &ifr) < 0) { - perror("SIOCGADMINFO"); - return 1; diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index c0aaecbb30..91c9b9b5b9 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -846,6 +846,7 @@ config BUSYBOX_DEFAULT_TRUE default y config BUSYBOX_DEFAULT_TRUNCATE bool + default y if TARGET_bcm53xx default n config BUSYBOX_DEFAULT_TTY bool diff --git a/package/utils/ct-bugcheck/src/bugcheck.sh b/package/utils/ct-bugcheck/src/bugcheck.sh index 389e10ccf4..3ee472066f 100755 --- a/package/utils/ct-bugcheck/src/bugcheck.sh +++ b/package/utils/ct-bugcheck/src/bugcheck.sh @@ -89,7 +89,7 @@ do echo "https://github.com/greearb/ath10k-ct/issues" >> $CRASHDIR/report_to.txt else # Not sure who would want these bug reports for upstream... - echo "https://www.lede-project.org/" >> $CRASHDIR/report_to.txt + echo "https://openwrt.org/" >> $CRASHDIR/report_to.txt fi echo >> $CRASHDIR/report_to.txt echo "Please attach all files in this directory to bug reports." >> $CRASHDIR/report_to.txt diff --git a/package/utils/fuse/Makefile b/package/utils/fuse/Makefile index e853a8e041..be80b03c42 100644 --- a/package/utils/fuse/Makefile +++ b/package/utils/fuse/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=fuse PKG_VERSION:=2.9.7 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/libfuse/libfuse/releases/download/$(PKG_NAME)-$(PKG_VERSION) @@ -56,6 +56,7 @@ $(call Package/fuse/Default) TITLE+= (library) DEPENDS:=+kmod-fuse +libpthread SUBMENU:=Filesystem + ABI_VERSION:=1 endef define Package/libfuse/description diff --git a/package/utils/mtd-utils/Makefile b/package/utils/mtd-utils/Makefile index ca60726d81..8acd46747e 100644 --- a/package/utils/mtd-utils/Makefile +++ b/package/utils/mtd-utils/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mtd-utils -PKG_VERSION:=2.0.2 +PKG_VERSION:=2.1.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/mtd-utils/ -PKG_HASH:=fb3de61be8e932abb424e8ea3c30298f553d5f970ad158a737bb303bbf9660b8 +PKG_HASH:=8d15e8b70f036d6af1a66011f8ca0e048e9675fa7983d33bea92c24313a232d2 PKG_INSTALL:=1 PKG_FIXUP:=autoreconf @@ -58,7 +58,9 @@ MAKE_FLAGS += LDLIBS+="$(LIBGCC_S)" CONFIGURE_ARGS += \ --disable-tests \ + --without-crypto \ --without-xattr \ + --without-zstd \ --without-lzo TARGET_CFLAGS += -ffunction-sections -fdata-sections diff --git a/package/utils/mtd-utils/patches/200-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch b/package/utils/mtd-utils/patches/200-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch deleted file mode 100644 index 79695c4954..0000000000 --- a/package/utils/mtd-utils/patches/200-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 7d27becbb355853ba778e8b83fe171eecb8195d2 Mon Sep 17 00:00:00 2001 -From: Christian Lamparter -Date: Thu, 7 Jun 2018 22:36:19 +0200 -Subject: [PATCH] Revert "Return correct error number in ubi_get_vol_info1" - -This reverts commit dede98ffb706676309488d7cc660f569548d5930. ---- - lib/libubi.c | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/lib/libubi.c b/lib/libubi.c -index b50e68a..978b433 100644 ---- a/lib/libubi.c -+++ b/lib/libubi.c -@@ -1240,11 +1240,8 @@ int ubi_get_vol_info1(libubi_t desc, int dev_num, int vol_id, - info->dev_num = dev_num; - info->vol_id = vol_id; - -- if (vol_get_major(lib, dev_num, vol_id, &info->major, &info->minor)) { -- if (errno == ENOENT) -- errno = ENODEV; -+ if (vol_get_major(lib, dev_num, vol_id, &info->major, &info->minor)) - return -1; -- } - - ret = vol_read_data(lib->vol_type, dev_num, vol_id, buf, 50); - if (ret < 0) --- -2.17.1 - diff --git a/package/utils/px5g/Makefile b/package/utils/px5g/Makefile index 7b5748425d..f4be6cb5ee 100644 --- a/package/utils/px5g/Makefile +++ b/package/utils/px5g/Makefile @@ -8,9 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=px5g -PKG_RELEASE:=8 +PKG_RELEASE:=9 PKG_LICENSE:=LGPL-2.1 -PKG_BUILD_DIR:=$(BUILD_DIR)/px5g-$(BUILD_VARIANT) PKG_USE_MIPS16:=0 @@ -53,7 +52,7 @@ ifeq ($(BUILD_VARIANT),standalone) TARGET_LDFLAGS := -Wl,-Bstatic $(TARGET_LDFLAGS) -Wl,-Bdynamic endif -TARGET_CFLAGS += -Wl,--gc-sections +TARGET_CFLAGS += -Wl,--gc-sections -Wall -Werror define Build/Compile $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/px5g px5g.c $(TARGET_LDFLAGS) diff --git a/package/utils/px5g/px5g.c b/package/utils/px5g/px5g.c index f0fe4dcfd3..0b72154509 100644 --- a/package/utils/px5g/px5g.c +++ b/package/utils/px5g/px5g.c @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -73,6 +74,23 @@ static void write_file(const char *path, int len, bool pem) fclose(f); } +static mbedtls_ecp_group_id ecp_curve(const char *name) +{ + const mbedtls_ecp_curve_info *curve_info; + + if (!strcmp(name, "P-256")) + return MBEDTLS_ECP_DP_SECP256R1; + else if (!strcmp(name, "P-384")) + return MBEDTLS_ECP_DP_SECP384R1; + else if (!strcmp(name, "P-521")) + return MBEDTLS_ECP_DP_SECP521R1; + curve_info = mbedtls_ecp_curve_info_from_name(name); + if (curve_info == NULL) + return MBEDTLS_ECP_DP_NONE; + else + return curve_info->grp_id; +} + static void write_key(mbedtls_pk_context *key, const char *path, bool pem) { int len = 0; @@ -89,24 +107,33 @@ static void write_key(mbedtls_pk_context *key, const char *path, bool pem) write_file(path, len, pem); } -static void gen_key(mbedtls_pk_context *key, int ksize, int exp, bool pem) +static void gen_key(mbedtls_pk_context *key, bool rsa, int ksize, int exp, + mbedtls_ecp_group_id curve, bool pem) { mbedtls_pk_init(key); - fprintf(stderr, "Generating RSA private key, %i bit long modulus\n", ksize); - mbedtls_pk_setup(key, mbedtls_pk_info_from_type(MBEDTLS_PK_RSA)); - if (mbedtls_rsa_gen_key(mbedtls_pk_rsa(*key), _urandom, NULL, ksize, exp)) { - fprintf(stderr, "error: key generation failed\n"); - exit(1); + if (rsa) { + fprintf(stderr, "Generating RSA private key, %i bit long modulus\n", ksize); + mbedtls_pk_setup(key, mbedtls_pk_info_from_type(MBEDTLS_PK_RSA)); + if (!mbedtls_rsa_gen_key(mbedtls_pk_rsa(*key), _urandom, NULL, ksize, exp)) + return; + } else { + fprintf(stderr, "Generating EC private key\n"); + mbedtls_pk_setup(key, mbedtls_pk_info_from_type(MBEDTLS_PK_ECKEY)); + if (!mbedtls_ecp_gen_key(curve, mbedtls_pk_ec(*key), _urandom, NULL)) + return; } + fprintf(stderr, "error: key generation failed\n"); + exit(1); } -int rsakey(char **arg) +int dokey(bool rsa, char **arg) { mbedtls_pk_context key; unsigned int ksize = 512; int exp = 65537; char *path = NULL; bool pem = true; + mbedtls_ecp_group_id curve = MBEDTLS_ECP_DP_SECP256R1; while (*arg && **arg == '-') { if (!strcmp(*arg, "-out") && arg[1]) { @@ -120,10 +147,17 @@ int rsakey(char **arg) arg++; } - if (*arg) + if (*arg && rsa) { ksize = (unsigned int)atoi(*arg); + } else if (*arg) { + curve = ecp_curve((const char *)*arg); + if (curve == MBEDTLS_ECP_DP_NONE) { + fprintf(stderr, "error: invalid curve name: %s\n", *arg); + return 1; + } + } - gen_key(&key, ksize, exp, pem); + gen_key(&key, rsa, ksize, exp, curve, pem); write_key(&key, path, pem); mbedtls_pk_free(&key); @@ -146,20 +180,37 @@ int selfsigned(char **arg) time_t from = time(NULL), to; char fstr[20], tstr[20], sstr[17]; int len; + bool rsa = true; + mbedtls_ecp_group_id curve = MBEDTLS_ECP_DP_SECP256R1; while (*arg && **arg == '-') { if (!strcmp(*arg, "-der")) { pem = false; } else if (!strcmp(*arg, "-newkey") && arg[1]) { - if (strncmp(arg[1], "rsa:", 4)) { - fprintf(stderr, "error: invalid algorithm"); + if (!strncmp(arg[1], "rsa:", 4)) { + rsa = true; + ksize = (unsigned int)atoi(arg[1] + 4); + } else if (!strcmp(arg[1], "ec")) { + rsa = false; + } else { + fprintf(stderr, "error: invalid algorithm\n"); return 1; } - ksize = (unsigned int)atoi(arg[1] + 4); arg++; } else if (!strcmp(*arg, "-days") && arg[1]) { days = (unsigned int)atoi(arg[1]); arg++; + } else if (!strcmp(*arg, "-pkeyopt") && arg[1]) { + if (strncmp(arg[1], "ec_paramgen_curve:", 18)) { + fprintf(stderr, "error: invalid pkey option: %s\n", arg[1]); + return 1; + } + curve = ecp_curve((const char *)(arg[1] + 18)); + if (curve == MBEDTLS_ECP_DP_NONE) { + fprintf(stderr, "error: invalid curve name: %s\n", arg[1] + 18); + return 1; + } + arg++; } else if (!strcmp(*arg, "-keyout") && arg[1]) { keypath = arg[1]; arg++; @@ -196,8 +247,7 @@ int selfsigned(char **arg) } arg++; } - - gen_key(&key, ksize, exp, pem); + gen_key(&key, rsa, ksize, exp, curve, pem); if (keypath) write_key(&key, keypath, pem); @@ -223,7 +273,7 @@ int selfsigned(char **arg) mbedtls_x509write_crt_set_subject_key_identifier(&cert); mbedtls_x509write_crt_set_authority_key_identifier(&cert); - _urandom(NULL, buf, 8); + _urandom(NULL, (void *) buf, 8); for (len = 0; len < 8; len++) sprintf(sstr + len*2, "%02x", (unsigned char) buf[len]); @@ -260,8 +310,10 @@ int main(int argc, char *argv[]) if (!argv[1]) { //Usage + } else if (!strcmp(argv[1], "eckey")) { + return dokey(false, argv+2); } else if (!strcmp(argv[1], "rsakey")) { - return rsakey(argv+2); + return dokey(true, argv+2); } else if (!strcmp(argv[1], "selfsigned")) { return selfsigned(argv+2); } @@ -269,6 +321,6 @@ int main(int argc, char *argv[]) fprintf(stderr, "PX5G X.509 Certificate Generator Utility v" PX5G_VERSION "\n" PX5G_COPY "\nbased on PolarSSL by Christophe Devine and Paul Bakker\n\n"); - fprintf(stderr, "Usage: %s [rsakey|selfsigned]\n", *argv); + fprintf(stderr, "Usage: %s [eckey|rsakey|selfsigned]\n", *argv); return 1; } diff --git a/package/utils/spidev_test/Makefile b/package/utils/spidev_test/Makefile index b7c5227f91..0f288ad010 100644 --- a/package/utils/spidev_test/Makefile +++ b/package/utils/spidev_test/Makefile @@ -10,26 +10,45 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=spidev-test PKG_RELEASE:=$(LINUX_VERSION) +PKG_FLAGS:=nonshared +PKG_BUILD_DIR:=$(LINUX_DIR)/tools/spi-$(TARGET_DIR_NAME) +PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk define Package/spidev-test SECTION:=utils CATEGORY:=Utilities - DEPENDS:=+kmod-spi-dev + DEPENDS:=+kmod-spi-dev @!IN_SDK TITLE:=SPI testing utility VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE) URL:=http://www.kernel.org - MAINTAINER:=Florian Fainelli endef define Package/spidev-test/description SPI testing utility. endef +define Build/Prepare + $(CP) $(LINUX_DIR)/tools/spi/* $(PKG_BUILD_DIR)/ +endef + +MAKE_FLAGS = \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + CC="$(TARGET_CC)" \ + LD="$(TARGET_CROSS)ld" \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \ + WERROR=0 \ + prefix=/usr + define Build/Compile - $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/spidev_test \ - $(PKG_BUILD_DIR)/spidev_test.c + +$(MAKE_FLAGS) $(MAKE) $(PKG_JOBS) \ + -C $(PKG_BUILD_DIR) \ + -f Makefile \ + --no-print-directory endef define Package/spidev-test/install diff --git a/package/utils/spidev_test/src/spidev_test.c b/package/utils/spidev_test/src/spidev_test.c deleted file mode 100644 index 135b3f592b..0000000000 --- a/package/utils/spidev_test/src/spidev_test.c +++ /dev/null @@ -1,318 +0,0 @@ -/* - * SPI testing utility (using spidev driver) - * - * Copyright (c) 2007 MontaVista Software, Inc. - * Copyright (c) 2007 Anton Vorontsov - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License. - * - * Cross-compile with cross-gcc -I/path/to/cross-kernel/include - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) - -static void pabort(const char *s) -{ - perror(s); - abort(); -} - -static const char *device = "/dev/spidev1.1"; -static uint32_t mode; -static uint8_t bits = 8; -static uint32_t speed = 500000; -static uint16_t delay; -static int verbose; - -uint8_t default_tx[] = { - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0x40, 0x00, 0x00, 0x00, 0x00, 0x95, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xF0, 0x0D, -}; - -uint8_t default_rx[ARRAY_SIZE(default_tx)] = {0, }; -char *input_tx; - -static void hex_dump(const void *src, size_t length, size_t line_size, char *prefix) -{ - int i = 0; - const unsigned char *address = src; - const unsigned char *line = address; - unsigned char c; - - printf("%s | ", prefix); - while (length-- > 0) { - printf("%02X ", *address++); - if (!(++i % line_size) || (length == 0 && i % line_size)) { - if (length == 0) { - while (i++ % line_size) - printf("__ "); - } - printf(" | "); /* right close */ - while (line < address) { - c = *line++; - printf("%c", (c < 33 || c == 255) ? 0x2E : c); - } - printf("\n"); - if (length > 0) - printf("%s | ", prefix); - } - } -} - -/* - * Unescape - process hexadecimal escape character - * converts shell input "\x23" -> 0x23 - */ -static int unescape(char *_dst, char *_src, size_t len) -{ - int ret = 0; - char *src = _src; - char *dst = _dst; - unsigned int ch; - - while (*src) { - if (*src == '\\' && *(src+1) == 'x') { - sscanf(src + 2, "%2x", &ch); - src += 4; - *dst++ = (unsigned char)ch; - } else { - *dst++ = *src++; - } - ret++; - } - return ret; -} - -static void transfer(int fd, uint8_t const *tx, uint8_t const *rx, size_t len) -{ - int ret; - - struct spi_ioc_transfer tr = { - .tx_buf = (unsigned long)tx, - .rx_buf = (unsigned long)rx, - .len = len, - .delay_usecs = delay, - .speed_hz = speed, - .bits_per_word = bits, - }; - - if (mode & SPI_TX_QUAD) - tr.tx_nbits = 4; - else if (mode & SPI_TX_DUAL) - tr.tx_nbits = 2; - if (mode & SPI_RX_QUAD) - tr.rx_nbits = 4; - else if (mode & SPI_RX_DUAL) - tr.rx_nbits = 2; - if (!(mode & SPI_LOOP)) { - if (mode & (SPI_TX_QUAD | SPI_TX_DUAL)) - tr.rx_buf = 0; - else if (mode & (SPI_RX_QUAD | SPI_RX_DUAL)) - tr.tx_buf = 0; - } - - ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr); - if (ret < 1) - pabort("can't send spi message"); - - if (verbose) - hex_dump(tx, len, 32, "TX"); - hex_dump(rx, len, 32, "RX"); -} - -static void print_usage(const char *prog) -{ - printf("Usage: %s [-DsbdlHOLC3]\n", prog); - puts(" -D --device device to use (default /dev/spidev1.1)\n" - " -s --speed max speed (Hz)\n" - " -d --delay delay (usec)\n" - " -b --bpw bits per word \n" - " -l --loop loopback\n" - " -H --cpha clock phase\n" - " -O --cpol clock polarity\n" - " -L --lsb least significant bit first\n" - " -C --cs-high chip select active high\n" - " -3 --3wire SI/SO signals shared\n" - " -v --verbose Verbose (show tx buffer)\n" - " -p Send data (e.g. \"1234\\xde\\xad\")\n" - " -N --no-cs no chip select\n" - " -R --ready slave pulls low to pause\n" - " -2 --dual dual transfer\n" - " -4 --quad quad transfer\n"); - exit(1); -} - -static void parse_opts(int argc, char *argv[]) -{ - while (1) { - static const struct option lopts[] = { - { "device", 1, 0, 'D' }, - { "speed", 1, 0, 's' }, - { "delay", 1, 0, 'd' }, - { "bpw", 1, 0, 'b' }, - { "loop", 0, 0, 'l' }, - { "cpha", 0, 0, 'H' }, - { "cpol", 0, 0, 'O' }, - { "lsb", 0, 0, 'L' }, - { "cs-high", 0, 0, 'C' }, - { "3wire", 0, 0, '3' }, - { "no-cs", 0, 0, 'N' }, - { "ready", 0, 0, 'R' }, - { "dual", 0, 0, '2' }, - { "verbose", 0, 0, 'v' }, - { "quad", 0, 0, '4' }, - { NULL, 0, 0, 0 }, - }; - int c; - - c = getopt_long(argc, argv, "D:s:d:b:lHOLC3NR24p:v", lopts, NULL); - - if (c == -1) - break; - - switch (c) { - case 'D': - device = optarg; - break; - case 's': - speed = atoi(optarg); - break; - case 'd': - delay = atoi(optarg); - break; - case 'b': - bits = atoi(optarg); - break; - case 'l': - mode |= SPI_LOOP; - break; - case 'H': - mode |= SPI_CPHA; - break; - case 'O': - mode |= SPI_CPOL; - break; - case 'L': - mode |= SPI_LSB_FIRST; - break; - case 'C': - mode |= SPI_CS_HIGH; - break; - case '3': - mode |= SPI_3WIRE; - break; - case 'N': - mode |= SPI_NO_CS; - break; - case 'v': - verbose = 1; - break; - case 'R': - mode |= SPI_READY; - break; - case 'p': - input_tx = optarg; - break; - case '2': - mode |= SPI_TX_DUAL; - break; - case '4': - mode |= SPI_TX_QUAD; - break; - default: - print_usage(argv[0]); - break; - } - } - if (mode & SPI_LOOP) { - if (mode & SPI_TX_DUAL) - mode |= SPI_RX_DUAL; - if (mode & SPI_TX_QUAD) - mode |= SPI_RX_QUAD; - } -} - -int main(int argc, char *argv[]) -{ - int ret = 0; - int fd; - uint8_t *tx; - uint8_t *rx; - int size; - - parse_opts(argc, argv); - - fd = open(device, O_RDWR); - if (fd < 0) - pabort("can't open device"); - - /* - * spi mode - */ - ret = ioctl(fd, SPI_IOC_WR_MODE32, &mode); - if (ret == -1) - pabort("can't set spi mode"); - - ret = ioctl(fd, SPI_IOC_RD_MODE32, &mode); - if (ret == -1) - pabort("can't get spi mode"); - - /* - * bits per word - */ - ret = ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &bits); - if (ret == -1) - pabort("can't set bits per word"); - - ret = ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits); - if (ret == -1) - pabort("can't get bits per word"); - - /* - * max speed hz - */ - ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed); - if (ret == -1) - pabort("can't set max speed hz"); - - ret = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed); - if (ret == -1) - pabort("can't get max speed hz"); - - printf("spi mode: 0x%x\n", mode); - printf("bits per word: %d\n", bits); - printf("max speed: %d Hz (%d KHz)\n", speed, speed/1000); - - if (input_tx) { - size = strlen(input_tx+1); - tx = malloc(size); - rx = malloc(size); - size = unescape((char *)tx, input_tx, size); - transfer(fd, tx, rx, size); - free(rx); - free(tx); - } else { - transfer(fd, default_tx, default_rx, sizeof(default_tx)); - } - - close(fd); - - return ret; -}