From 57f148ba25cac2998b2cb217a90a42987fd28bd9 Mon Sep 17 00:00:00 2001 From: David Lam Date: Sun, 19 Sep 2021 22:42:14 -0700 Subject: [PATCH 01/33] 6rd: delete tunnel on interface teardown Delete tunnel on 6rd interface teardown. Should solve problem related to tunnel stuck on restart loop with "Unknown Command" on tunnel restart due to wan connection drop. This patch is similar to the one written by Ansuel on Aug 2, 2021 but the 6rd teardown produces the same symptoms when the network service is restarted. Signed-off-by: David Lam --- package/network/ipv6/6rd/Makefile | 2 +- package/network/ipv6/6rd/files/6rd.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package/network/ipv6/6rd/Makefile b/package/network/ipv6/6rd/Makefile index 9836ae9361..f9c4c6f7a5 100644 --- a/package/network/ipv6/6rd/Makefile +++ b/package/network/ipv6/6rd/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=6rd -PKG_RELEASE:=10 +PKG_RELEASE:=11 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/6rd/files/6rd.sh b/package/network/ipv6/6rd/files/6rd.sh index 62a20314d9..3c913e54f1 100644 --- a/package/network/ipv6/6rd/files/6rd.sh +++ b/package/network/ipv6/6rd/files/6rd.sh @@ -82,6 +82,8 @@ proto_6rd_setup() { proto_6rd_teardown() { local cfg="$1" + local link="6rd-$cfg" + ip link del $link } proto_6rd_init_config() { From 0a5c569b9972eb70d7e1592f42da7ee5f1a96843 Mon Sep 17 00:00:00 2001 From: Timo Sigurdsson Date: Sat, 26 Jun 2021 13:04:49 +0200 Subject: [PATCH 02/33] fstools: ensure filesystems are mounted before log service starts Currently, the fstab service starts after the log service which breaks the ability to write a persistent log file to a filesystem mounted by the fstab service. Thus, change the start order of the fstab service so it starts right before the log service. Fixes: b131853 ("ubox: update to latest git revision") Signed-off-by: Timo Sigurdsson [set to 11 to be explicitly before log, not only alphabetically, SPDX] Signed-off-by: Paul Spooren --- package/system/fstools/files/fstab.init | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package/system/fstools/files/fstab.init b/package/system/fstools/files/fstab.init index 5289355114..484d868950 100755 --- a/package/system/fstools/files/fstab.init +++ b/package/system/fstools/files/fstab.init @@ -1,7 +1,9 @@ #!/bin/sh /etc/rc.common -# (C) 2013 openwrt.org +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2013-2020 OpenWrt.org -START=40 +START=11 boot() { /sbin/block mount From 3eb78a8e0cfcee7f0a5a0aa94edb6e38a8ed5890 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 23 Sep 2021 13:36:45 +0200 Subject: [PATCH 03/33] libtool: Revert "libtool: bump to 2.4.6" This breaks the package builds using the SDK. The targets all build fine, but the package builder fails on many packages. The package builder uses the OpenWrt SDK. This reverts commit c377d874bededfad971530aeb7d7e1b43cd3e61a. Signed-off-by: Hauke Mehrtens --- tools/libtool/Makefile | 11 +- tools/libtool/patches/000-relocatable.patch | 114 +++++++-- tools/libtool/patches/100-libdir-fixes.patch | 97 +++++--- ...10-dont-use-target-dir-for-relinking.patch | 51 ++-- .../120-strip-unsafe-dirs-for-relinking.patch | 36 ++- ...140-don-t-quote-SHELL-in-Makefile.am.patch | 72 ------ ...itigate-the-sed_quote_subst-slowdown.patch | 224 ------------------ ...ingslash.patch => 150-trailingslash.patch} | 33 ++- .../libtool/patches/160-passthrough-ssp.patch | 12 + .../patches/200-openwrt-branding.patch | 134 +++++++++-- 10 files changed, 337 insertions(+), 447 deletions(-) delete mode 100644 tools/libtool/patches/140-don-t-quote-SHELL-in-Makefile.am.patch delete mode 100644 tools/libtool/patches/150-libtool-mitigate-the-sed_quote_subst-slowdown.patch rename tools/libtool/patches/{130-trailingslash.patch => 150-trailingslash.patch} (57%) create mode 100644 tools/libtool/patches/160-passthrough-ssp.patch diff --git a/tools/libtool/Makefile b/tools/libtool/Makefile index b237884b64..2bc9db7d0d 100644 --- a/tools/libtool/Makefile +++ b/tools/libtool/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libtool PKG_CPE_ID:=cpe:/a:gnu:libtool -PKG_VERSION:=2.4.6 +PKG_VERSION:=2.4.2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/$(PKG_NAME) -PKG_HASH:=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f +PKG_HASH:=1d7b6862c1ed162e327f083a6f78f40eae29218f0db8c38393d61dab764c4407 HOST_BUILD_PARALLEL:=1 @@ -24,12 +24,7 @@ HOST_CONFIGURE_VARS += \ define Host/Prepare $(call Host/Prepare/Default) (cd $(STAGING_DIR_HOST)/share/aclocal/ && rm -f libtool.m4 ltdl.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4) - $(if $(QUILT),,(cd $(HOST_BUILD_DIR); touch README-release; $(AM_TOOL_PATHS) ./bootstrap --skip-git --skip-po --force)) -endef - -define Host/Configure - $(if $(QUILT),(cd $(HOST_BUILD_DIR); touch README-release; $(AM_TOOL_PATHS) ./bootstrap --skip-git --skip-po --force)) - $(call Host/Configure/Default) + (cd $(HOST_BUILD_DIR); $(AM_TOOL_PATHS) ./bootstrap) endef define Host/Install diff --git a/tools/libtool/patches/000-relocatable.patch b/tools/libtool/patches/000-relocatable.patch index 88d1eaed02..6d1651be31 100644 --- a/tools/libtool/patches/000-relocatable.patch +++ b/tools/libtool/patches/000-relocatable.patch @@ -1,24 +1,17 @@ -From ca10caa502f971f90d8c041aa2476de54ef0ce2b Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Tue, 20 Jul 2021 16:41:11 -0300 -Subject: openwrt: make relocatable, search resources relative to STAGING_DIR - -This was originally commited to openwrt by Jo-Philipp Wich -. - -(adjusted to v2.4.6) -Signed-off-by: Eneas U de Queiroz - ---- a/libtoolize.in -+++ b/libtoolize.in -@@ -40,11 +40,18 @@ - - : ${AUTOCONF="autoconf"} - : ${AUTOMAKE="automake"} +--- a/libltdl/config/general.m4sh ++++ b/libltdl/config/general.m4sh +@@ -45,15 +45,22 @@ progpath="$0" + M4SH_VERBATIM([[ + : ${CP="cp -f"} + test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} -: ${EGREP="@EGREP@"} -: ${FGREP="@FGREP@"} -: ${GREP="@GREP@"} : ${LN_S="@LN_S@"} + : ${MAKE="make"} + : ${MKDIR="mkdir"} + : ${MV="mv -f"} + : ${RM="rm -f"} -: ${SED="@SED@"} +if test -n "$STAGING_DIR"; then + : ${EGREP="$STAGING_DIR/../host/bin/grep -E"} @@ -31,12 +24,87 @@ Signed-off-by: Eneas U de Queiroz + : ${GREP="@GREP@"} + : ${SED="@SED@"} +fi + : ${SHELL="${CONFIG_SHELL-/bin/sh}"} + : ${Xsed="$SED -e 1s/^X//"} +--- a/libtoolize.in ++++ b/libtoolize.in +@@ -334,15 +334,22 @@ as_unset=as_fn_unset - ## -------------------------- ## ---- a/m4/libtool.m4 -+++ b/m4/libtool.m4 -@@ -929,9 +929,8 @@ dnl AC_DEFUN([AC_LIBTOOL_RC], []) + : ${CP="cp -f"} + test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +-: ${EGREP="@EGREP@"} +-: ${FGREP="@FGREP@"} +-: ${GREP="@GREP@"} + : ${LN_S="@LN_S@"} + : ${MAKE="make"} + : ${MKDIR="mkdir"} + : ${MV="mv -f"} + : ${RM="rm -f"} +-: ${SED="@SED@"} ++if test -n "$STAGING_DIR"; then ++ : ${EGREP="$STAGING_DIR/../host/bin/grep -E"} ++ : ${FGREP="$STAGING_DIR/../host/bin/grep -F"} ++ : ${GREP="$STAGING_DIR/../host/bin/grep"} ++ : ${SED="$STAGING_DIR/../host/bin/sed"} ++else ++ : ${EGREP="@EGREP@"} ++ : ${FGREP="@FGREP@"} ++ : ${GREP="@GREP@"} ++ : ${SED="@SED@"} ++fi + : ${SHELL="${CONFIG_SHELL-/bin/sh}"} + : ${Xsed="$SED -e 1s/^X//"} + +@@ -2487,10 +2494,17 @@ func_check_macros () + + # Locations for important files: + prefix=@prefix@ +- datadir=@datadir@ +- pkgdatadir=@pkgdatadir@ +- pkgltdldir=@pkgdatadir@ +- aclocaldir=@aclocaldir@ ++ if test -n "$STAGING_DIR"; then ++ datadir="$STAGING_DIR/../host/share" ++ pkgdatadir="$STAGING_DIR/../host/share/libtool" ++ pkgltdldir="$STAGING_DIR/../host/share/libtool" ++ aclocaldir="$STAGING_DIR/../host/share/aclocal" ++ else ++ datadir=@datadir@ ++ pkgdatadir=@pkgdatadir@ ++ pkgltdldir=@pkgdatadir@ ++ aclocaldir=@aclocaldir@ ++ fi + auxdir= + macrodir= + configure_ac=configure.in +--- a/libtoolize.m4sh ++++ b/libtoolize.m4sh +@@ -1453,10 +1453,17 @@ func_check_macros () + + # Locations for important files: + prefix=@prefix@ +- datadir=@datadir@ +- pkgdatadir=@pkgdatadir@ +- pkgltdldir=@pkgdatadir@ +- aclocaldir=@aclocaldir@ ++ if test -n "$STAGING_DIR"; then ++ datadir="$STAGING_DIR/../host/share" ++ pkgdatadir="$STAGING_DIR/../host/share/libtool" ++ pkgltdldir="$STAGING_DIR/../host/share/libtool" ++ aclocaldir="$STAGING_DIR/../host/share/aclocal" ++ else ++ datadir=@datadir@ ++ pkgdatadir=@pkgdatadir@ ++ pkgltdldir=@pkgdatadir@ ++ aclocaldir=@aclocaldir@ ++ fi + auxdir= + macrodir= + configure_ac=configure.in +--- a/libltdl/m4/libtool.m4 ++++ b/libltdl/m4/libtool.m4 +@@ -907,9 +907,8 @@ dnl AC_DEFUN([AC_LIBTOOL_RC], []) # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl @@ -47,7 +115,7 @@ Signed-off-by: Eneas U de Queiroz _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl -@@ -8160,9 +8159,9 @@ m4_defun([_LT_DECL_EGREP], +@@ -7660,9 +7659,9 @@ m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep @@ -60,7 +128,7 @@ Signed-off-by: Eneas U de Queiroz dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) -@@ -8195,9 +8194,8 @@ AC_SUBST([DLLTOOL]) +@@ -7695,9 +7694,8 @@ AC_SUBST([DLLTOOL]) # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED diff --git a/tools/libtool/patches/100-libdir-fixes.patch b/tools/libtool/patches/100-libdir-fixes.patch index dd17dd97e5..3df2b14b60 100644 --- a/tools/libtool/patches/100-libdir-fixes.patch +++ b/tools/libtool/patches/100-libdir-fixes.patch @@ -1,56 +1,83 @@ -From 67ffe8e8582a7ba1f1d1307a419098e6dd88bdaf Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Tue, 20 Jul 2021 16:41:11 -0300 -Subject: openwrt: cross-compilation path adjustments - -Comments from the patch: - -Adding 'libdir' from the .la file to our library search paths -breaks crosscompilation horribly. We cheat here and don't add -it, instead adding the path where we found the .la. -CL - -OE sets installed=no in staging. We need to look in $objdir and $absdir, -preferring $objdir. RP 31/04/2008 - -This was originally commited to openwrt by Jo-Philipp Wich -. - -(adjusted to v2.4.6) -Signed-off-by: Eneas U de Queiroz - ---- a/build-aux/ltmain.in -+++ b/build-aux/ltmain.in -@@ -6049,8 +6049,14 @@ func_mode_link () - absdir=$abs_ladir - libdir=$abs_ladir +--- a/libltdl/config/ltmain.m4sh ++++ b/libltdl/config/ltmain.m4sh +@@ -5731,8 +5731,14 @@ func_mode_link () + absdir="$abs_ladir" + libdir="$abs_ladir" else -- dir=$lt_sysroot$libdir -- absdir=$lt_sysroot$libdir +- dir="$lt_sysroot$libdir" +- absdir="$lt_sysroot$libdir" + # Adding 'libdir' from the .la file to our library search paths + # breaks crosscompilation horribly. We cheat here and don't add + # it, instead adding the path where we found the .la. -CL + dir="$lt_sysroot$abs_ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" -+ #dir=$lt_sysroot$libdir -+ #absdir=$lt_sysroot$libdir ++ #dir="$libdir" ++ #absdir="$lt_sysroot$libdir" fi - test yes = "$hardcode_automatic" && avoidtemprpath=yes + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else -@@ -6448,8 +6454,6 @@ func_mode_link () - add=$libdir/$linklib +@@ -6130,8 +6136,6 @@ func_mode_link () + add="$libdir/$linklib" fi else - # We cannot seem to hardcode it, guess we'll fake it. -- add_dir=-L$libdir +- add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in -@@ -6604,7 +6608,17 @@ func_mode_link () +@@ -6286,7 +6290,17 @@ func_mode_link () fi ;; *) -- path=-L$absdir/$objdir +- path="-L$absdir/$objdir" ++ # OE sets installed=no in staging. We need to look in $objdir and $absdir, ++ # preferring $objdir. RP 31/04/2008 ++ if test -f "$absdir/$objdir/$depdepl" ; then ++ depdepl="$absdir/$objdir/$depdepl" ++ path="-L$absdir/$objdir" ++ elif test -f "$absdir/$depdepl" ; then ++ depdepl="$absdir/$depdepl" ++ path="-L$absdir" ++ else ++ path="-L$absdir/$objdir" ++ fi + ;; + esac + else +--- a/libltdl/config/ltmain.sh ++++ b/libltdl/config/ltmain.sh +@@ -6518,8 +6518,14 @@ func_mode_link () + absdir="$abs_ladir" + libdir="$abs_ladir" + else +- dir="$lt_sysroot$libdir" +- absdir="$lt_sysroot$libdir" ++ # Adding 'libdir' from the .la file to our library search paths ++ # breaks crosscompilation horribly. We cheat here and don't add ++ # it, instead adding the path where we found the .la. -CL ++ dir="$lt_sysroot$abs_ladir" ++ absdir="$abs_ladir" ++ libdir="$abs_ladir" ++ #dir="$libdir" ++ #absdir="$lt_sysroot$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else +@@ -6917,8 +6923,6 @@ func_mode_link () + add="$libdir/$linklib" + fi + else +- # We cannot seem to hardcode it, guess we'll fake it. +- add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in +@@ -7073,7 +7077,17 @@ func_mode_link () + fi + ;; + *) +- path="-L$absdir/$objdir" + # OE sets installed=no in staging. We need to look in $objdir and $absdir, + # preferring $objdir. RP 31/04/2008 + if test -f "$absdir/$objdir/$depdepl" ; then diff --git a/tools/libtool/patches/110-dont-use-target-dir-for-relinking.patch b/tools/libtool/patches/110-dont-use-target-dir-for-relinking.patch index d613440167..bbfd125003 100644 --- a/tools/libtool/patches/110-dont-use-target-dir-for-relinking.patch +++ b/tools/libtool/patches/110-dont-use-target-dir-for-relinking.patch @@ -1,33 +1,20 @@ -From 375833af93999f8b0a747c8a1dfa3ec8d347743d Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Tue, 20 Jul 2021 16:52:37 -0300 -Subject: openwrt: don't use target dir for relinking - -This was originally commited to openwrt by Jo-Philipp Wich -. - -(adjusted to v2.4.6) -Signed-off-by: Eneas U de Queiroz - ---- a/build-aux/ltmain.in -+++ b/build-aux/ltmain.in -@@ -6434,13 +6434,13 @@ func_mode_link () - add_dir= - add= - # Finalize command for both is simple: just hardcode it. -- if test yes = "$hardcode_direct" && -- test no = "$hardcode_direct_absolute"; then -- add=$libdir/$linklib -- elif test yes = "$hardcode_minus_L"; then -+ if test "$hardcode_direct" = yes && -+ test "$hardcode_direct_absolute" = no; then -+ add="$libdir/$linklib" -+ elif test "$hardcode_minus_L" = yes; then - add_dir=-L$libdir -- add=-l$name -- elif test yes = "$hardcode_shlibpath_var"; then -+ add="-l$name" -+ elif test "$hardcode_shlibpath_var" = yes; then +--- a/libltdl/config/ltmain.m4sh ++++ b/libltdl/config/ltmain.m4sh +@@ -6120,7 +6120,6 @@ func_mode_link () + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then +- add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in +--- a/libltdl/config/ltmain.sh ++++ b/libltdl/config/ltmain.sh +@@ -6907,7 +6907,6 @@ func_mode_link () + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then +- add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; diff --git a/tools/libtool/patches/120-strip-unsafe-dirs-for-relinking.patch b/tools/libtool/patches/120-strip-unsafe-dirs-for-relinking.patch index 715c254999..8840ee0569 100644 --- a/tools/libtool/patches/120-strip-unsafe-dirs-for-relinking.patch +++ b/tools/libtool/patches/120-strip-unsafe-dirs-for-relinking.patch @@ -1,26 +1,24 @@ -From 7f2b8a1ab4fa1475eeeddfb84eb5b92594bfce43 Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Tue, 20 Jul 2021 16:54:12 -0300 -Subject: openwrt: strip unsave directories from relink command - -strip unsave directories from relink command, nuke every -L that looks -like /usr/lib or /lib - -This was originally commited to openwrt by Jo-Philipp Wich -. - -(adjusted to v2.4.6) -Signed-off-by: Eneas U de Queiroz - ---- a/build-aux/ltmain.in -+++ b/build-aux/ltmain.in -@@ -2382,6 +2382,9 @@ func_mode_install () +--- a/libltdl/config/ltmain.m4sh ++++ b/libltdl/config/ltmain.m4sh +@@ -2183,6 +2183,9 @@ func_mode_install () relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi + relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/lib[^[:space:]]*%%"` + relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/usr/lib[^[:space:]]*%%"` + - func_warning "relinking '$file'" + func_warning "relinking \`$file'" func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' +--- a/libltdl/config/ltmain.sh ++++ b/libltdl/config/ltmain.sh +@@ -2973,6 +2973,9 @@ func_mode_install () + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + ++ relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/lib[^[:space:]]*%%"` ++ relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/usr/lib[^[:space:]]*%%"` ++ + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' diff --git a/tools/libtool/patches/140-don-t-quote-SHELL-in-Makefile.am.patch b/tools/libtool/patches/140-don-t-quote-SHELL-in-Makefile.am.patch deleted file mode 100644 index 513b521834..0000000000 --- a/tools/libtool/patches/140-don-t-quote-SHELL-in-Makefile.am.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 879578d3f4dc9bc42aa433b1fb6b584564f83617 Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Wed, 21 Jul 2021 13:38:24 -0300 -Subject: openwrt: don't quote $(SHELL) in Makefile.am - -This allows to use SHELL="env bash" to get a controlled enviroment. - -Signed-off-by: Eneas U de Queiroz - ---- a/Makefile.am -+++ b/Makefile.am -@@ -46,7 +46,7 @@ EXTRA_LTLIBRARIES = - # Using 'cd' in backquotes may print the directory name, use this instead: - lt__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd - --git_version_gen = '$(SHELL)' '$(aux_dir)/git-version-gen' '--fallback' '$(VERSION)' '.tarball-version' -+git_version_gen = $(SHELL) '$(aux_dir)/git-version-gen' '--fallback' '$(VERSION)' '.tarball-version' - rebuild = rebuild=:; revision=`$(lt__cd) $(srcdir) && $(git_version_gen) | $(SED) 's|-.*$$||'` - - -@@ -301,7 +301,7 @@ libtool: $(ltmain_sh) $(config_status) $ - if test 0 = '$(AM_DEFAULT_VERBOSITY)' && test 1 != '$(V)'; \ - then echo " GEN " $@; \ - else echo '$(SHELL) $(top_builddir)/config.status "$@"'; fi; \ -- cd '$(top_builddir)' && '$(SHELL)' ./config.status '$@'; \ -+ cd '$(top_builddir)' && $(SHELL) ./config.status '$@'; \ - fi - - -@@ -788,13 +788,13 @@ testsuite_deps_uninstalled = $(testsuite - # Hook the test suite into the check rule - check-local: $(testsuite_deps_uninstalled) - $(AM_V_at)$(CD_TESTDIR); \ -- CONFIG_SHELL='$(SHELL)' '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" \ -+ CONFIG_SHELL=$(SHELL) $(SHELL) "$$abs_srcdir/$(TESTSUITE)" \ - $(TESTS_ENVIRONMENT) $(BUILDCHECK_ENVIRONMENT) $(TESTSUITEFLAGS) - - # Run the test suite on the *installed* tree. - installcheck-local: $(testsuite_deps) - $(AM_V_at)$(CD_TESTDIR); \ -- CONFIG_SHELL='$(SHELL)' '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" \ -+ CONFIG_SHELL=$(SHELL) $(SHELL) "$$abs_srcdir/$(TESTSUITE)" \ - $(TESTS_ENVIRONMENT) $(INSTALLCHECK_ENVIRONMENT) $(TESTSUITEFLAGS) \ - AUTOTEST_PATH='$(exec_prefix)/bin' - -@@ -806,7 +806,7 @@ check-noninteractive-old: - .PHONY: check-noninteractive-new - check-noninteractive-new: $(testsuite_deps_uninstalled) - $(AM_V_at)$(CD_TESTDIR); \ -- CONFIG_SHELL='$(SHELL)' '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" \ -+ CONFIG_SHELL=$(SHELL) $(SHELL) "$$abs_srcdir/$(TESTSUITE)" \ - $(TESTS_ENVIRONMENT) $(BUILDCHECK_ENVIRONMENT) \ - -k '!interactive' INNER_TESTSUITEFLAGS=',!interactive' \ - $(TESTSUITEFLAGS) -@@ -815,7 +815,7 @@ check-noninteractive-new: $(testsuite_de - .PHONY: check-interactive - check-interactive: $(testsuite_deps_uninstalled) - $(AM_V_at)$(CD_TESTDIR); \ -- CONFIG_SHELL='$(SHELL)' '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" \ -+ CONFIG_SHELL=$(SHELL) $(SHELL) "$$abs_srcdir/$(TESTSUITE)" \ - $(TESTS_ENVIRONMENT) $(BUILDCHECK_ENVIRONMENT) \ - -k interactive -k recursive INNER_TESTSUITEFLAGS=',interactive' \ - $(TESTSUITEFLAGS) -@@ -827,7 +827,7 @@ check-noninteractive: check-noninteracti - clean-local: - -$(CD_TESTDIR); \ - test -f "$$abs_srcdir/$(TESTSUITE)" && \ -- '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" --clean -+ $(SHELL) "$$abs_srcdir/$(TESTSUITE)" --clean - - ## An empty target to depend on when a rule needs to always run - ## whenever it is visited. diff --git a/tools/libtool/patches/150-libtool-mitigate-the-sed_quote_subst-slowdown.patch b/tools/libtool/patches/150-libtool-mitigate-the-sed_quote_subst-slowdown.patch deleted file mode 100644 index 27ea6a1d53..0000000000 --- a/tools/libtool/patches/150-libtool-mitigate-the-sed_quote_subst-slowdown.patch +++ /dev/null @@ -1,224 +0,0 @@ -From 3adadb568fbf15d952bd25a005b6a9afb7e59dc7 Mon Sep 17 00:00:00 2001 -From: Pavel Raiskup -Date: Sun, 4 Oct 2015 21:55:03 +0200 -Subject: libtool: mitigate the $sed_quote_subst slowdown - -When it is reasonably possible, use shell implementation for -quoting. - -References: -http://lists.gnu.org/archive/html/libtool/2015-03/msg00005.html -http://lists.gnu.org/archive/html/libtool/2015-02/msg00000.html -https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20006 - -* gl/build-aux/funclib.sh (func_quote): New function that can be -used as substitution for '$SED $sed_quote_subst' call. -* build-aux/ltmain.in (func_emit_wrapper): Use func_quote instead -of '$SED $sed_quote_subst'. -(func_mode_link): Likewise. -* NEWS: Document. -* bootstrap: Sync with funclib.sh. - -(cherry picked from commit 32f0df9835ac15ac17e04be57c368172c3ad1d19) -(skipping NEWS change) -Signed-off-by: Eneas U de Queiroz - ---- a/bootstrap -+++ b/bootstrap -@@ -230,7 +230,7 @@ vc_ignore= - - # Source required external libraries: - # Set a version string for this script. --scriptversion=2015-01-20.17; # UTC -+scriptversion=2015-10-04.22; # UTC - - # General shell script boiler plate, and helper functions. - # Written by Gary V. Vaughan, 2004 -@@ -1257,6 +1257,57 @@ func_relative_path () - } - - -+# func_quote ARG -+# -------------- -+# Aesthetically quote one ARG, store the result into $func_quote_result. Note -+# that we keep attention to performance here (so far O(N) complexity as long as -+# func_append is O(1)). -+func_quote () -+{ -+ $debug_cmd -+ -+ func_quote_result=$1 -+ -+ case $func_quote_result in -+ *[\\\`\"\$]*) -+ case $func_quote_result in -+ *'*'*|*'['*) -+ func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"` -+ return 0 -+ ;; -+ esac -+ -+ func_quote_old_IFS=$IFS -+ for _G_char in '\' '`' '"' '$' -+ do -+ # STATE($1) PREV($2) SEPARATOR($3) -+ set start "" "" -+ func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy -+ IFS=$_G_char -+ for _G_part in $func_quote_result -+ do -+ case $1 in -+ quote) -+ func_append func_quote_result "$3$2" -+ set quote "$_G_part" "\\$_G_char" -+ ;; -+ start) -+ set first "" "" -+ func_quote_result= -+ ;; -+ first) -+ set quote "$_G_part" "" -+ ;; -+ esac -+ done -+ IFS=$func_quote_old_IFS -+ done -+ ;; -+ *) ;; -+ esac -+} -+ -+ - # func_quote_for_eval ARG... - # -------------------------- - # Aesthetically quote ARGs to be evaled later. -@@ -1273,12 +1324,8 @@ func_quote_for_eval () - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do -- case $1 in -- *[\\\`\"\$]*) -- _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; -- *) -- _G_unquoted_arg=$1 ;; -- esac -+ func_quote "$1" -+ _G_unquoted_arg=$func_quote_result - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else ---- a/build-aux/ltmain.in -+++ b/build-aux/ltmain.in -@@ -3356,7 +3356,8 @@ else - if test \"\$libtool_execute_magic\" != \"$magic\"; then - file=\"\$0\"" - -- qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` -+ func_quote "$ECHO" -+ qECHO=$func_quote_result - $ECHO "\ - - # A function that is used when there is no print builtin or printf. -@@ -8618,8 +8619,8 @@ EOF - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done -- relink_command="(cd `pwd`; $relink_command)" -- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` -+ func_quote "(cd `pwd`; $relink_command)" -+ relink_command=$func_quote_result - fi - - # Only actually do things if not in dry run mode. -@@ -8865,7 +8866,8 @@ EOF - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" -- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` -+ func_quote "$relink_command" -+ relink_command=$func_quote_result - if test yes = "$hardcode_automatic"; then - relink_command= - fi ---- a/build-aux/funclib.sh -+++ b/build-aux/funclib.sh -@@ -1,5 +1,5 @@ - # Set a version string for this script. --scriptversion=2015-01-20.17; # UTC -+scriptversion=2015-10-04.22; # UTC - - # General shell script boiler plate, and helper functions. - # Written by Gary V. Vaughan, 2004 -@@ -1026,6 +1026,57 @@ func_relative_path () - } - - -+# func_quote ARG -+# -------------- -+# Aesthetically quote one ARG, store the result into $func_quote_result. Note -+# that we keep attention to performance here (so far O(N) complexity as long as -+# func_append is O(1)). -+func_quote () -+{ -+ $debug_cmd -+ -+ func_quote_result=$1 -+ -+ case $func_quote_result in -+ *[\\\`\"\$]*) -+ case $func_quote_result in -+ *[\[\*\?]*) -+ func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"` -+ return 0 -+ ;; -+ esac -+ -+ func_quote_old_IFS=$IFS -+ for _G_char in '\' '`' '"' '$' -+ do -+ # STATE($1) PREV($2) SEPARATOR($3) -+ set start "" "" -+ func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy -+ IFS=$_G_char -+ for _G_part in $func_quote_result -+ do -+ case $1 in -+ quote) -+ func_append func_quote_result "$3$2" -+ set quote "$_G_part" "\\$_G_char" -+ ;; -+ start) -+ set first "" "" -+ func_quote_result= -+ ;; -+ first) -+ set quote "$_G_part" "" -+ ;; -+ esac -+ done -+ IFS=$func_quote_old_IFS -+ done -+ ;; -+ *) ;; -+ esac -+} -+ -+ - # func_quote_for_eval ARG... - # -------------------------- - # Aesthetically quote ARGs to be evaled later. -@@ -1042,12 +1093,8 @@ func_quote_for_eval () - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do -- case $1 in -- *[\\\`\"\$]*) -- _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; -- *) -- _G_unquoted_arg=$1 ;; -- esac -+ func_quote "$1" -+ _G_unquoted_arg=$func_quote_result - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else diff --git a/tools/libtool/patches/130-trailingslash.patch b/tools/libtool/patches/150-trailingslash.patch similarity index 57% rename from tools/libtool/patches/130-trailingslash.patch rename to tools/libtool/patches/150-trailingslash.patch index fc28027a05..423911cf4b 100644 --- a/tools/libtool/patches/130-trailingslash.patch +++ b/tools/libtool/patches/150-trailingslash.patch @@ -1,8 +1,3 @@ -From 1b45c3c0d6682be7f4876b620780ee246a5acbaa Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Tue, 20 Jul 2021 16:56:16 -0300 -Subject: openwrt: remove trailing slash in install destdir - A command like /bin/sh ../../i586-poky-linux-libtool --mode=install /usr/bin/install -c gck-roots-store-standalone.la '/media/data1/builds/poky1/tmp/work/core2-poky-linux/gnome-keyring-2.26.1-r1/image/usr/lib/gnome-keyring/standalone/' fails (e.g. gnome-keyring or pulseaudio) This is because libdir has a trailing slash which breaks the comparision. @@ -14,12 +9,28 @@ Merged a patch received from Gary Thomas Date: 2010/07/12 Nitin A Kamble -(adjusted to v2.4.6) -Signed-off-by: Eneas U de Queiroz - ---- a/build-aux/ltmain.in -+++ b/build-aux/ltmain.in -@@ -2363,8 +2363,15 @@ func_mode_install () +--- a/libltdl/config/ltmain.m4sh ++++ b/libltdl/config/ltmain.m4sh +@@ -2167,8 +2167,15 @@ func_mode_install () + func_append dir "$objdir" + + if test -n "$relink_command"; then ++ # Strip any trailing slash from the destination. ++ func_stripname '' '/' "$libdir" ++ destlibdir=$func_stripname_result ++ ++ func_stripname '' '/' "$destdir" ++ s_destdir=$func_stripname_result ++ + # Determine the prefix the user has applied to our future dir. +- inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` ++ inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that +--- a/libltdl/config/ltmain.sh ++++ b/libltdl/config/ltmain.sh +@@ -2954,8 +2954,15 @@ func_mode_install () func_append dir "$objdir" if test -n "$relink_command"; then diff --git a/tools/libtool/patches/160-passthrough-ssp.patch b/tools/libtool/patches/160-passthrough-ssp.patch new file mode 100644 index 0000000000..da44c614e3 --- /dev/null +++ b/tools/libtool/patches/160-passthrough-ssp.patch @@ -0,0 +1,12 @@ +diff -ur libtool-2.4.orig/libltdl/config/ltmain.m4sh libtool-2.4/libltdl/config/ltmain.m4sh +--- libtool-2.4.orig/libltdl/config/ltmain.m4sh 2015-06-18 10:46:15.499996979 +0200 ++++ libtool-2.4/libltdl/config/ltmain.m4sh 2015-06-18 10:48:24.686882213 +0200 +@@ -5076,7 +5076,7 @@ + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ +- -O*|-flto*|-fwhopr*|-fuse-linker-plugin) ++ -O*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" diff --git a/tools/libtool/patches/200-openwrt-branding.patch b/tools/libtool/patches/200-openwrt-branding.patch index 95fa8c0f37..3fc0afb866 100644 --- a/tools/libtool/patches/200-openwrt-branding.patch +++ b/tools/libtool/patches/200-openwrt-branding.patch @@ -1,24 +1,112 @@ -From 90707200efadc8e230635c7c204c9c272cbc8631 Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Tue, 20 Jul 2021 17:01:03 -0300 -Subject: openwrt: add openwrt branding - -This prepends program name with "OpenWrt-". - -This was originally commited to openwrt by Jo-Philipp Wich -. - -(adjusted to v2.4.6) -Signed-off-by: Eneas U de Queiroz - ---- a/build-aux/ltmain.in -+++ b/build-aux/ltmain.in -@@ -82,7 +82,7 @@ func_echo () - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_IFS -- $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" -+ $ECHO "OpenWrt-$progname${opt_mode+: $opt_mode}: $_G_line" - done - IFS=$func_echo_IFS +--- a/libltdl/config/general.m4sh ++++ b/libltdl/config/general.m4sh +@@ -359,7 +359,7 @@ opt_warning=: + # name if it has been set yet. + func_echo () + { +- $ECHO "$progname: ${opt_mode+$opt_mode: }$*" ++ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }$*" } + + # func_verbose arg... +@@ -385,14 +385,14 @@ func_echo_all () + # Echo program name prefixed message to standard error. + func_error () + { +- $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 ++ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 + } + + # func_warning arg... + # Echo program name prefixed warning message to standard error. + func_warning () + { +- $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 ++ $opt_warning && $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +--- a/libltdl/config/ltmain.sh ++++ b/libltdl/config/ltmain.sh +@@ -439,7 +439,7 @@ opt_warning=: + # name if it has been set yet. + func_echo () + { +- $ECHO "$progname: ${opt_mode+$opt_mode: }$*" ++ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }$*" + } + + # func_verbose arg... +@@ -465,14 +465,14 @@ func_echo_all () + # Echo program name prefixed message to standard error. + func_error () + { +- $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 ++ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 + } + + # func_warning arg... + # Echo program name prefixed warning message to standard error. + func_warning () + { +- $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 ++ $opt_warning && $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +--- a/libtoolize.in ++++ b/libtoolize.in +@@ -648,7 +648,7 @@ opt_warning=: + # name if it has been set yet. + func_echo () + { +- $ECHO "$progname: ${opt_mode+$opt_mode: }$*" ++ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }$*" + } + + # func_verbose arg... +@@ -674,14 +674,14 @@ func_echo_all () + # Echo program name prefixed message to standard error. + func_error () + { +- $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 ++ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 + } + + # func_warning arg... + # Echo program name prefixed warning message to standard error. + func_warning () + { +- $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 ++ $opt_warning && $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +--- a/tests/defs.in ++++ b/tests/defs.in +@@ -596,7 +596,7 @@ opt_warning=: + # name if it has been set yet. + func_echo () + { +- $ECHO "$progname: ${opt_mode+$opt_mode: }$*" ++ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }$*" + } + + # func_verbose arg... +@@ -622,14 +622,14 @@ func_echo_all () + # Echo program name prefixed message to standard error. + func_error () + { +- $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 ++ $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 + } + + # func_warning arg... + # Echo program name prefixed warning message to standard error. + func_warning () + { +- $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 ++ $opt_warning && $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : From 9eea506ce9aada0862129426a9eac7bb4fc812dc Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 2 Dec 2020 22:06:34 +0100 Subject: [PATCH 04/33] toolchain: musl: refresh patches Refresh the musl patches Signed-off-by: Hauke Mehrtens --- ...00-nftw-support-common-gnu-extension.patch | 19 ++++++------------- .../700-wcsnrtombs-cve-2020-28928.diff | 2 -- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/toolchain/musl/patches/600-nftw-support-common-gnu-extension.patch b/toolchain/musl/patches/600-nftw-support-common-gnu-extension.patch index 13914efcba..81c96ad76c 100644 --- a/toolchain/musl/patches/600-nftw-support-common-gnu-extension.patch +++ b/toolchain/musl/patches/600-nftw-support-common-gnu-extension.patch @@ -9,8 +9,6 @@ Signed-off-by: Tony Ambardar src/misc/nftw.c | 35 ++++++++++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 5 deletions(-) -diff --git a/include/ftw.h b/include/ftw.h -index b15c062a..ce85deac 100644 --- a/include/ftw.h +++ b/include/ftw.h @@ -21,6 +21,14 @@ extern "C" { @@ -28,17 +26,15 @@ index b15c062a..ce85deac 100644 struct FTW { int base; int level; -diff --git a/src/misc/nftw.c b/src/misc/nftw.c -index 8dcff7fe..0bb7b601 100644 --- a/src/misc/nftw.c +++ b/src/misc/nftw.c @@ -1,3 +1,4 @@ +#define _GNU_SOURCE #include #include - #include -@@ -72,8 +73,20 @@ static int do_nftw(char *path, int (*fn)(const char *, const struct stat *, int, - if (!fd_limit) close(dfd); + #include +@@ -63,8 +64,20 @@ static int do_nftw(char *path, int (*fn) + lev.base = k; } - if (!(flags & FTW_DEPTH) && (r=fn(path, &st, type, &lev))) @@ -60,7 +56,7 @@ index 8dcff7fe..0bb7b601 100644 for (; h; h = h->chain) if (h->dev == st.st_dev && h->ino == st.st_ino) -@@ -101,7 +114,10 @@ static int do_nftw(char *path, int (*fn)(const char *, const struct stat *, int, +@@ -88,7 +101,10 @@ static int do_nftw(char *path, int (*fn) strcpy(path+j+1, de->d_name); if ((r=do_nftw(path, fn, fd_limit-1, flags, &new))) { closedir(d); @@ -72,7 +68,7 @@ index 8dcff7fe..0bb7b601 100644 } } closedir(d); -@@ -112,8 +128,16 @@ static int do_nftw(char *path, int (*fn)(const char *, const struct stat *, int, +@@ -98,8 +114,16 @@ static int do_nftw(char *path, int (*fn) } path[l] = 0; @@ -91,12 +87,9 @@ index 8dcff7fe..0bb7b601 100644 return 0; } -@@ -139,4 +163,5 @@ int nftw(const char *path, int (*fn)(const char *, const struct stat *, int, str +@@ -125,4 +149,5 @@ int nftw(const char *path, int (*fn)(con return r; } +#undef nftw64 weak_alias(nftw, nftw64); --- -2.17.1 - diff --git a/toolchain/musl/patches/700-wcsnrtombs-cve-2020-28928.diff b/toolchain/musl/patches/700-wcsnrtombs-cve-2020-28928.diff index 8465f9422a..5840dc1aac 100644 --- a/toolchain/musl/patches/700-wcsnrtombs-cve-2020-28928.diff +++ b/toolchain/musl/patches/700-wcsnrtombs-cve-2020-28928.diff @@ -1,5 +1,3 @@ -diff --git a/src/multibyte/wcsnrtombs.c b/src/multibyte/wcsnrtombs.c -index 676932b5..95e25e70 100644 --- a/src/multibyte/wcsnrtombs.c +++ b/src/multibyte/wcsnrtombs.c @@ -1,41 +1,33 @@ From 93a955b8a6711e72ffdbdeeabac38d6826f6f569 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 19 Mar 2020 18:31:17 -0700 Subject: [PATCH 05/33] toolchain/musl: update to 1.2.2 This release introduces 64-bit time_t, which is needed to avoid the year 2038 problem. Remove upstream patches. Refreshed others. Rebased features.h file based on latest musl. Signed-off-by: Rosen Penev --- toolchain/musl/common.mk | 6 +- toolchain/musl/include/features.h | 10 ++- .../patches/110-read_timezone_from_fs.patch | 4 +- .../patches/200-add_libssp_nonshared.patch | 8 +- toolchain/musl/patches/300-relative.patch | 2 +- ...ist-unlink-in-pthread_exit-after-all.patch | 51 ----------- ...hreads_minus_1-as-relaxed-atomic-for.patch | 69 -------------- ...own-size-of-some-libc-struct-members.patch | 25 ------ ...pping-for-processes-that-return-to-s.patch | 90 ------------------- ...00-nftw-support-common-gnu-extension.patch | 12 +-- .../700-wcsnrtombs-cve-2020-28928.diff | 63 ------------- .../musl/patches/901-crypt_size_hack.patch | 2 +- 12 files changed, 26 insertions(+), 316 deletions(-) delete mode 100644 toolchain/musl/patches/500-0001-reorder-thread-list-unlink-in-pthread_exit-after-all.patch delete mode 100644 toolchain/musl/patches/500-0002-don-t-use-libc.threads_minus_1-as-relaxed-atomic-for.patch delete mode 100644 toolchain/musl/patches/500-0003-cut-down-size-of-some-libc-struct-members.patch delete mode 100644 toolchain/musl/patches/500-0004-restore-lock-skipping-for-processes-that-return-to-s.patch delete mode 100644 toolchain/musl/patches/700-wcsnrtombs-cve-2020-28928.diff diff --git a/toolchain/musl/common.mk b/toolchain/musl/common.mk index 68098f5c6a..0f42a9eb60 100644 --- a/toolchain/musl/common.mk +++ b/toolchain/musl/common.mk @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk PKG_NAME:=musl -PKG_VERSION:=1.1.24 -PKG_RELEASE:=3 +PKG_VERSION:=1.2.2 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://musl.libc.org/releases/ -PKG_HASH:=1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3 +PKG_HASH:=9b969322012d796dc23dda27a35866034fa67d8fb67e0e2c45c913c3d43219dd LIBC_SO_VERSION:=$(PKG_VERSION) PATCH_DIR:=$(PATH_PREFIX)/patches diff --git a/toolchain/musl/include/features.h b/toolchain/musl/include/features.h index edb8cc72d4..e801e2299a 100644 --- a/toolchain/musl/include/features.h +++ b/toolchain/musl/include/features.h @@ -1,10 +1,14 @@ #ifndef _FEATURES_H #define _FEATURES_H -#ifdef _ALL_SOURCE +#if defined(_ALL_SOURCE) && !defined(_GNU_SOURCE) #define _GNU_SOURCE 1 #endif +#if defined(_DEFAULT_SOURCE) && !defined(_BSD_SOURCE) +#define _BSD_SOURCE 1 +#endif + #if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \ && !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \ && !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__) @@ -20,6 +24,8 @@ #if __STDC_VERSION__ >= 199901L || defined(__cplusplus) #define __inline inline +#elif !defined(__GNUC__) +#define __inline #endif #if __STDC_VERSION__ >= 201112L @@ -29,6 +35,8 @@ #define _Noreturn #endif +#define __REDIR(x,y) __typeof__(x) x __asm__(#y) + /* Convenience macros to test the versions of glibc and gcc. Use them like this: #if __GNUC_PREREQ (2,8) diff --git a/toolchain/musl/patches/110-read_timezone_from_fs.patch b/toolchain/musl/patches/110-read_timezone_from_fs.patch index f92781f7ed..a1f54db551 100644 --- a/toolchain/musl/patches/110-read_timezone_from_fs.patch +++ b/toolchain/musl/patches/110-read_timezone_from_fs.patch @@ -1,6 +1,6 @@ --- a/src/time/__tz.c +++ b/src/time/__tz.c -@@ -25,6 +25,9 @@ static int r0[5], r1[5]; +@@ -31,6 +31,9 @@ static int r0[5], r1[5]; static const unsigned char *zi, *trans, *index, *types, *abbrevs, *abbrevs_end; static size_t map_size; @@ -10,7 +10,7 @@ static char old_tz_buf[32]; static char *old_tz = old_tz_buf; static size_t old_tz_size = sizeof old_tz_buf; -@@ -125,6 +128,15 @@ static void do_tzset() +@@ -132,6 +135,15 @@ static void do_tzset() "/usr/share/zoneinfo/\0/share/zoneinfo/\0/etc/zoneinfo/\0"; s = getenv("TZ"); diff --git a/toolchain/musl/patches/200-add_libssp_nonshared.patch b/toolchain/musl/patches/200-add_libssp_nonshared.patch index 05bd2fe54a..26a9bfebea 100644 --- a/toolchain/musl/patches/200-add_libssp_nonshared.patch +++ b/toolchain/musl/patches/200-add_libssp_nonshared.patch @@ -7,7 +7,7 @@ Signed-off-by: Steven Barth --- a/Makefile +++ b/Makefile -@@ -66,7 +66,7 @@ CRT_LIBS = $(addprefix lib/,$(notdir $(C +@@ -67,7 +67,7 @@ CRT_LIBS = $(addprefix lib/,$(notdir $(C STATIC_LIBS = lib/libc.a SHARED_LIBS = lib/libc.so TOOL_LIBS = lib/musl-gcc.specs @@ -16,7 +16,7 @@ Signed-off-by: Steven Barth ALL_TOOLS = obj/musl-gcc WRAPCC_GCC = gcc -@@ -86,7 +86,7 @@ else +@@ -88,7 +88,7 @@ else all: $(ALL_LIBS) $(ALL_TOOLS) @@ -25,7 +25,7 @@ Signed-off-by: Steven Barth $(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(ALL_OBJS:%.o=%.lo) $(GENH) $(GENH_INT): | $(OBJ_DIRS) -@@ -113,6 +113,8 @@ obj/crt/rcrt1.o: $(srcdir)/ldso/dlstart. +@@ -115,6 +115,8 @@ obj/crt/rcrt1.o: $(srcdir)/ldso/dlstart. obj/crt/Scrt1.o obj/crt/rcrt1.o: CFLAGS_ALL += -fPIC @@ -34,7 +34,7 @@ Signed-off-by: Steven Barth OPTIMIZE_SRCS = $(wildcard $(OPTIMIZE_GLOBS:%=$(srcdir)/src/%)) $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.o) $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.lo): CFLAGS += -O3 -@@ -165,6 +167,11 @@ lib/libc.a: $(AOBJS) +@@ -167,6 +169,11 @@ lib/libc.a: $(AOBJS) $(AR) rc $@ $(AOBJS) $(RANLIB) $@ diff --git a/toolchain/musl/patches/300-relative.patch b/toolchain/musl/patches/300-relative.patch index e34e60a09d..7e1eb7d6bc 100644 --- a/toolchain/musl/patches/300-relative.patch +++ b/toolchain/musl/patches/300-relative.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -215,7 +215,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/inc +@@ -217,7 +217,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/inc $(INSTALL) -D -m 644 $< $@ $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so diff --git a/toolchain/musl/patches/500-0001-reorder-thread-list-unlink-in-pthread_exit-after-all.patch b/toolchain/musl/patches/500-0001-reorder-thread-list-unlink-in-pthread_exit-after-all.patch deleted file mode 100644 index d47f2f4108..0000000000 --- a/toolchain/musl/patches/500-0001-reorder-thread-list-unlink-in-pthread_exit-after-all.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 4d5aa20a94a2d3fae3e69289dc23ecafbd0c16c4 Mon Sep 17 00:00:00 2001 -From: Rich Felker -Date: Fri, 22 May 2020 17:35:14 -0400 -Subject: [PATCH 1/4] reorder thread list unlink in pthread_exit after all - locks - -since the backend for LOCK() skips locking if single-threaded, it's -unsafe to make the process appear single-threaded before the last use -of lock. - -this fixes potential unsynchronized access to a linked list via -__dl_thread_cleanup. ---- - src/thread/pthread_create.c | 19 +++++++++++-------- - 1 file changed, 11 insertions(+), 8 deletions(-) - ---- a/src/thread/pthread_create.c -+++ b/src/thread/pthread_create.c -@@ -90,14 +90,7 @@ _Noreturn void __pthread_exit(void *resu - exit(0); - } - -- /* At this point we are committed to thread termination. Unlink -- * the thread from the list. This change will not be visible -- * until the lock is released, which only happens after SYS_exit -- * has been called, via the exit futex address pointing at the lock. */ -- libc.threads_minus_1--; -- self->next->prev = self->prev; -- self->prev->next = self->next; -- self->prev = self->next = self; -+ /* At this point we are committed to thread termination. */ - - /* Process robust list in userspace to handle non-pshared mutexes - * and the detached thread case where the robust list head will -@@ -121,6 +114,16 @@ _Noreturn void __pthread_exit(void *resu - __do_orphaned_stdio_locks(); - __dl_thread_cleanup(); - -+ /* Last, unlink thread from the list. This change will not be visible -+ * until the lock is released, which only happens after SYS_exit -+ * has been called, via the exit futex address pointing at the lock. -+ * This needs to happen after any possible calls to LOCK() that might -+ * skip locking if libc.threads_minus_1 is zero. */ -+ libc.threads_minus_1--; -+ self->next->prev = self->prev; -+ self->prev->next = self->next; -+ self->prev = self->next = self; -+ - /* This atomic potentially competes with a concurrent pthread_detach - * call; the loser is responsible for freeing thread resources. */ - int state = a_cas(&self->detach_state, DT_JOINABLE, DT_EXITING); diff --git a/toolchain/musl/patches/500-0002-don-t-use-libc.threads_minus_1-as-relaxed-atomic-for.patch b/toolchain/musl/patches/500-0002-don-t-use-libc.threads_minus_1-as-relaxed-atomic-for.patch deleted file mode 100644 index 4ca51b0be0..0000000000 --- a/toolchain/musl/patches/500-0002-don-t-use-libc.threads_minus_1-as-relaxed-atomic-for.patch +++ /dev/null @@ -1,69 +0,0 @@ -From e01b5939b38aea5ecbe41670643199825874b26c Mon Sep 17 00:00:00 2001 -From: Rich Felker -Date: Thu, 21 May 2020 23:32:45 -0400 -Subject: [PATCH 2/4] don't use libc.threads_minus_1 as relaxed atomic for - skipping locks - -after all but the last thread exits, the next thread to observe -libc.threads_minus_1==0 and conclude that it can skip locking fails to -synchronize with any changes to memory that were made by the -last-exiting thread. this can produce data races. - -on some archs, at least x86, memory synchronization is unlikely to be -a problem; however, with the inline locks in malloc, skipping the lock -also eliminated the compiler barrier, and caused code that needed to -re-check chunk in-use bits after obtaining the lock to reuse a stale -value, possibly from before the process became single-threaded. this -in turn produced corruption of the heap state. - -some uses of libc.threads_minus_1 remain, especially for allocation of -new TLS in the dynamic linker; otherwise, it could be removed -entirely. it's made non-volatile to reflect that the remaining -accesses are only made under lock on the thread list. - -instead of libc.threads_minus_1, libc.threaded is now used for -skipping locks. the difference is that libc.threaded is permanently -true once an additional thread has been created. this will produce -some performance regression in processes that are mostly -single-threaded but occasionally creating threads. in the future it -may be possible to bring back the full lock-skipping, but more care -needs to be taken to produce a safe design. ---- - src/internal/libc.h | 2 +- - src/malloc/malloc.c | 2 +- - src/thread/__lock.c | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - ---- a/src/internal/libc.h -+++ b/src/internal/libc.h -@@ -21,7 +21,7 @@ struct __libc { - int can_do_threads; - int threaded; - int secure; -- volatile int threads_minus_1; -+ int threads_minus_1; - size_t *auxv; - struct tls_module *tls_head; - size_t tls_size, tls_align, tls_cnt; ---- a/src/malloc/malloc.c -+++ b/src/malloc/malloc.c -@@ -26,7 +26,7 @@ int __malloc_replaced; - - static inline void lock(volatile int *lk) - { -- if (libc.threads_minus_1) -+ if (libc.threaded) - while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1); - } - ---- a/src/thread/__lock.c -+++ b/src/thread/__lock.c -@@ -18,7 +18,7 @@ - - void __lock(volatile int *l) - { -- if (!libc.threads_minus_1) return; -+ if (!libc.threaded) return; - /* fast path: INT_MIN for the lock, +1 for the congestion */ - int current = a_cas(l, 0, INT_MIN + 1); - if (!current) return; diff --git a/toolchain/musl/patches/500-0003-cut-down-size-of-some-libc-struct-members.patch b/toolchain/musl/patches/500-0003-cut-down-size-of-some-libc-struct-members.patch deleted file mode 100644 index 6650434397..0000000000 --- a/toolchain/musl/patches/500-0003-cut-down-size-of-some-libc-struct-members.patch +++ /dev/null @@ -1,25 +0,0 @@ -From f12888e9eb9eed60cc266b899dcafecb4752964a Mon Sep 17 00:00:00 2001 -From: Rich Felker -Date: Fri, 22 May 2020 17:25:38 -0400 -Subject: [PATCH 3/4] cut down size of some libc struct members - -these are all flags that can be single-byte values. ---- - src/internal/libc.h | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/src/internal/libc.h -+++ b/src/internal/libc.h -@@ -18,9 +18,9 @@ struct tls_module { - }; - - struct __libc { -- int can_do_threads; -- int threaded; -- int secure; -+ char can_do_threads; -+ char threaded; -+ char secure; - int threads_minus_1; - size_t *auxv; - struct tls_module *tls_head; diff --git a/toolchain/musl/patches/500-0004-restore-lock-skipping-for-processes-that-return-to-s.patch b/toolchain/musl/patches/500-0004-restore-lock-skipping-for-processes-that-return-to-s.patch deleted file mode 100644 index 83a6d0247a..0000000000 --- a/toolchain/musl/patches/500-0004-restore-lock-skipping-for-processes-that-return-to-s.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 8d81ba8c0bc6fe31136cb15c9c82ef4c24965040 Mon Sep 17 00:00:00 2001 -From: Rich Felker -Date: Fri, 22 May 2020 17:45:47 -0400 -Subject: [PATCH 4/4] restore lock-skipping for processes that return to - single-threaded state - -the design used here relies on the barrier provided by the first lock -operation after the process returns to single-threaded state to -synchronize with actions by the last thread that exited. by storing -the intent to change modes in the same object used to detect whether -locking is needed, it's possible to avoid an extra (possibly costly) -memory load after the lock is taken. ---- - src/internal/libc.h | 1 + - src/malloc/malloc.c | 5 ++++- - src/thread/__lock.c | 4 +++- - src/thread/pthread_create.c | 8 ++++---- - 4 files changed, 12 insertions(+), 6 deletions(-) - ---- a/src/internal/libc.h -+++ b/src/internal/libc.h -@@ -21,6 +21,7 @@ struct __libc { - char can_do_threads; - char threaded; - char secure; -+ volatile signed char need_locks; - int threads_minus_1; - size_t *auxv; - struct tls_module *tls_head; ---- a/src/malloc/malloc.c -+++ b/src/malloc/malloc.c -@@ -26,8 +26,11 @@ int __malloc_replaced; - - static inline void lock(volatile int *lk) - { -- if (libc.threaded) -+ int need_locks = libc.need_locks; -+ if (need_locks) { - while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1); -+ if (need_locks < 0) libc.need_locks = 0; -+ } - } - - static inline void unlock(volatile int *lk) ---- a/src/thread/__lock.c -+++ b/src/thread/__lock.c -@@ -18,9 +18,11 @@ - - void __lock(volatile int *l) - { -- if (!libc.threaded) return; -+ int need_locks = libc.need_locks; -+ if (!need_locks) return; - /* fast path: INT_MIN for the lock, +1 for the congestion */ - int current = a_cas(l, 0, INT_MIN + 1); -+ if (need_locks < 0) libc.need_locks = 0; - if (!current) return; - /* A first spin loop, for medium congestion. */ - for (unsigned i = 0; i < 10; ++i) { ---- a/src/thread/pthread_create.c -+++ b/src/thread/pthread_create.c -@@ -118,8 +118,8 @@ _Noreturn void __pthread_exit(void *resu - * until the lock is released, which only happens after SYS_exit - * has been called, via the exit futex address pointing at the lock. - * This needs to happen after any possible calls to LOCK() that might -- * skip locking if libc.threads_minus_1 is zero. */ -- libc.threads_minus_1--; -+ * skip locking if process appears single-threaded. */ -+ if (!--libc.threads_minus_1) libc.need_locks = -1; - self->next->prev = self->prev; - self->prev->next = self->next; - self->prev = self->next = self; -@@ -339,7 +339,7 @@ int __pthread_create(pthread_t *restrict - ~(1UL<<((SIGCANCEL-1)%(8*sizeof(long)))); - - __tl_lock(); -- libc.threads_minus_1++; -+ if (!libc.threads_minus_1++) libc.need_locks = 1; - ret = __clone((c11 ? start_c11 : start), stack, flags, args, &new->tid, TP_ADJ(new), &__thread_list_lock); - - /* All clone failures translate to EAGAIN. If explicit scheduling -@@ -363,7 +363,7 @@ int __pthread_create(pthread_t *restrict - new->next->prev = new; - new->prev->next = new; - } else { -- libc.threads_minus_1--; -+ if (!--libc.threads_minus_1) libc.need_locks = 0; - } - __tl_unlock(); - __restore_sigs(&set); diff --git a/toolchain/musl/patches/600-nftw-support-common-gnu-extension.patch b/toolchain/musl/patches/600-nftw-support-common-gnu-extension.patch index 81c96ad76c..2a7436cf84 100644 --- a/toolchain/musl/patches/600-nftw-support-common-gnu-extension.patch +++ b/toolchain/musl/patches/600-nftw-support-common-gnu-extension.patch @@ -32,9 +32,9 @@ Signed-off-by: Tony Ambardar +#define _GNU_SOURCE #include #include - #include -@@ -63,8 +64,20 @@ static int do_nftw(char *path, int (*fn) - lev.base = k; + #include +@@ -72,8 +73,20 @@ static int do_nftw(char *path, int (*fn) + if (!fd_limit) close(dfd); } - if (!(flags & FTW_DEPTH) && (r=fn(path, &st, type, &lev))) @@ -56,7 +56,7 @@ Signed-off-by: Tony Ambardar for (; h; h = h->chain) if (h->dev == st.st_dev && h->ino == st.st_ino) -@@ -88,7 +101,10 @@ static int do_nftw(char *path, int (*fn) +@@ -101,7 +114,10 @@ static int do_nftw(char *path, int (*fn) strcpy(path+j+1, de->d_name); if ((r=do_nftw(path, fn, fd_limit-1, flags, &new))) { closedir(d); @@ -68,7 +68,7 @@ Signed-off-by: Tony Ambardar } } closedir(d); -@@ -98,8 +114,16 @@ static int do_nftw(char *path, int (*fn) +@@ -112,8 +128,16 @@ static int do_nftw(char *path, int (*fn) } path[l] = 0; @@ -87,7 +87,7 @@ Signed-off-by: Tony Ambardar return 0; } -@@ -125,4 +149,5 @@ int nftw(const char *path, int (*fn)(con +@@ -139,4 +163,5 @@ int nftw(const char *path, int (*fn)(con return r; } diff --git a/toolchain/musl/patches/700-wcsnrtombs-cve-2020-28928.diff b/toolchain/musl/patches/700-wcsnrtombs-cve-2020-28928.diff deleted file mode 100644 index 5840dc1aac..0000000000 --- a/toolchain/musl/patches/700-wcsnrtombs-cve-2020-28928.diff +++ /dev/null @@ -1,63 +0,0 @@ ---- a/src/multibyte/wcsnrtombs.c -+++ b/src/multibyte/wcsnrtombs.c -@@ -1,41 +1,33 @@ - #include -+#include -+#include - - size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, size_t n, mbstate_t *restrict st) - { -- size_t l, cnt=0, n2; -- char *s, buf[256]; - const wchar_t *ws = *wcs; -- const wchar_t *tmp_ws; -- -- if (!dst) s = buf, n = sizeof buf; -- else s = dst; -- -- while ( ws && n && ( (n2=wn)>=n || n2>32 ) ) { -- if (n2>=n) n2=n; -- tmp_ws = ws; -- l = wcsrtombs(s, &ws, n2, 0); -- if (!(l+1)) { -- cnt = l; -- n = 0; -+ size_t cnt = 0; -+ if (!dst) n=0; -+ while (ws && wn) { -+ char tmp[MB_LEN_MAX]; -+ size_t l = wcrtomb(nn) break; -+ memcpy(dst, tmp, l); -+ } -+ dst += l; - n -= l; - } -- wn = ws ? wn - (ws - tmp_ws) : 0; -- cnt += l; -- } -- if (ws) while (n && wn) { -- l = wcrtomb(s, *ws, 0); -- if ((l+1)<=1) { -- if (!l) ws = 0; -- else cnt = l; -+ if (!*ws) { -+ ws = 0; - break; - } -- ws++; wn--; -- /* safe - this loop runs fewer than sizeof(buf) times */ -- s+=l; n-=l; -+ ws++; -+ wn--; - cnt += l; - } - if (dst) *wcs = ws; diff --git a/toolchain/musl/patches/901-crypt_size_hack.patch b/toolchain/musl/patches/901-crypt_size_hack.patch index 75f196abca..667894a24f 100644 --- a/toolchain/musl/patches/901-crypt_size_hack.patch +++ b/toolchain/musl/patches/901-crypt_size_hack.patch @@ -43,7 +43,7 @@ typedef uint32_t BF_word; typedef int32_t BF_word_signed; -@@ -796,3 +807,4 @@ char *__crypt_blowfish(const char *key, +@@ -804,3 +815,4 @@ char *__crypt_blowfish(const char *key, return "*"; } From c710efe18064e8e33f1f1348d19dd89e25c5bf0c Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 19 Mar 2020 18:31:17 -0700 Subject: [PATCH 06/33] toolchain/musl: remove several GNU headers Remove GLOB_ONLYDIR patch. Only fstools relies on it. fstools has been fixed separately. Remove woresize.h file. It seems to be for an old version of GCC. Remove features.h and glibc-types files. Same as above. Remove sys/cdefs.h. This is a deprecated header. Patches to fix packages that use it have already been patched. Tested with all packages in the base tree. They all compile. Signed-off-by: Rosen Penev --- toolchain/musl/include/bits/wordsize.h | 1 - toolchain/musl/include/features.h | 56 --- toolchain/musl/include/sgidefs.h | 73 ---- toolchain/musl/include/sys/cdefs.h | 378 ------------------ toolchain/musl/include/sys/glibc-types.h | 35 -- .../musl/patches/100-add_glob_onlydir.patch | 11 - 6 files changed, 554 deletions(-) delete mode 100644 toolchain/musl/include/bits/wordsize.h delete mode 100644 toolchain/musl/include/features.h delete mode 100644 toolchain/musl/include/sgidefs.h delete mode 100644 toolchain/musl/include/sys/cdefs.h delete mode 100644 toolchain/musl/include/sys/glibc-types.h delete mode 100644 toolchain/musl/patches/100-add_glob_onlydir.patch diff --git a/toolchain/musl/include/bits/wordsize.h b/toolchain/musl/include/bits/wordsize.h deleted file mode 100644 index 2d4cbe8317..0000000000 --- a/toolchain/musl/include/bits/wordsize.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/toolchain/musl/include/features.h b/toolchain/musl/include/features.h deleted file mode 100644 index e801e2299a..0000000000 --- a/toolchain/musl/include/features.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef _FEATURES_H -#define _FEATURES_H - -#if defined(_ALL_SOURCE) && !defined(_GNU_SOURCE) -#define _GNU_SOURCE 1 -#endif - -#if defined(_DEFAULT_SOURCE) && !defined(_BSD_SOURCE) -#define _BSD_SOURCE 1 -#endif - -#if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \ - && !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \ - && !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__) -#define _BSD_SOURCE 1 -#define _XOPEN_SOURCE 700 -#endif - -#if __STDC_VERSION__ >= 199901L -#define __restrict restrict -#elif !defined(__GNUC__) -#define __restrict -#endif - -#if __STDC_VERSION__ >= 199901L || defined(__cplusplus) -#define __inline inline -#elif !defined(__GNUC__) -#define __inline -#endif - -#if __STDC_VERSION__ >= 201112L -#elif defined(__GNUC__) -#define _Noreturn __attribute__((__noreturn__)) -#else -#define _Noreturn -#endif - -#define __REDIR(x,y) __typeof__(x) x __asm__(#y) - -/* Convenience macros to test the versions of glibc and gcc. - Use them like this: - #if __GNUC_PREREQ (2,8) - ... code requiring gcc 2.8 or later ... - #endif - Note - they won't work for gcc1 or glibc1, since the _MINOR macros - were not defined then. */ -#if defined __GNUC__ && defined __GNUC_MINOR__ -# define __GNUC_PREREQ(maj, min) \ - ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) -#else -# define __GNUC_PREREQ(maj, min) 0 -#endif - -#include - -#endif diff --git a/toolchain/musl/include/sgidefs.h b/toolchain/musl/include/sgidefs.h deleted file mode 100644 index 74509fdbd0..0000000000 --- a/toolchain/musl/include/sgidefs.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (C) 1996, 1997, 1998, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ralf Baechle . - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SGIDEFS_H -#define _SGIDEFS_H 1 - -/* - * A crude hack to stop - */ -#undef __ASM_SGIDEFS_H -#define __ASM_SGIDEFS_H - -/* - * And remove any damage it might have already done - */ -#undef _MIPS_ISA_MIPS1 -#undef _MIPS_ISA_MIPS2 -#undef _MIPS_ISA_MIPS3 -#undef _MIPS_ISA_MIPS4 -#undef _MIPS_ISA_MIPS5 -#undef _MIPS_ISA_MIPS32 -#undef _MIPS_ISA_MIPS64 - -#undef _MIPS_SIM_ABI32 -#undef _MIPS_SIM_NABI32 -#undef _MIPS_SIM_ABI64 - -/* - * Definitions for the ISA level - */ -#define _MIPS_ISA_MIPS1 1 -#define _MIPS_ISA_MIPS2 2 -#define _MIPS_ISA_MIPS3 3 -#define _MIPS_ISA_MIPS4 4 -#define _MIPS_ISA_MIPS5 5 -#define _MIPS_ISA_MIPS32 6 -#define _MIPS_ISA_MIPS64 7 - -/* - * Subprogram calling convention - */ -#ifndef _ABIO32 -# define _ABIO32 1 -#endif -#define _MIPS_SIM_ABI32 _ABIO32 - -#ifndef _ABIN32 -# define _ABIN32 2 -#endif -#define _MIPS_SIM_NABI32 _ABIN32 - -#ifndef _ABI64 -# define _ABI64 3 -#endif -#define _MIPS_SIM_ABI64 _ABI64 - -#endif /* sgidefs.h */ diff --git a/toolchain/musl/include/sys/cdefs.h b/toolchain/musl/include/sys/cdefs.h deleted file mode 100644 index e9866700d0..0000000000 --- a/toolchain/musl/include/sys/cdefs.h +++ /dev/null @@ -1,378 +0,0 @@ -/* Copyright (C) 1992-2002, 2004, 2005, 2006, 2007, 2009, 2011, 2012 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_CDEFS_H -#define _SYS_CDEFS_H 1 - -/* We are almost always included from features.h. */ -#ifndef _FEATURES_H -# include -#endif - -/* The GNU libc does not support any K&R compilers or the traditional mode - of ISO C compilers anymore. Check for some of the combinations not - anymore supported. */ -#if defined __GNUC__ && !defined __STDC__ -# error "You need a ISO C conforming compiler to use the glibc headers" -#endif - -/* Some user header file might have defined this before. */ -#undef __P -#undef __PMT - -#ifdef __GNUC__ - -/* All functions, except those with callbacks or those that - synchronize memory, are leaf functions. */ -# if __GNUC_PREREQ (4, 6) && !defined _LIBC -# define __LEAF , __leaf__ -# define __LEAF_ATTR __attribute__ ((__leaf__)) -# else -# define __LEAF -# define __LEAF_ATTR -# endif - -/* GCC can always grok prototypes. For C++ programs we add throw() - to help it optimize the function calls. But this works only with - gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions - as non-throwing using a function attribute since programs can use - the -fexceptions options for C code as well. */ -# if !defined __cplusplus && __GNUC_PREREQ (3, 3) -# define __THROW __attribute__ ((__nothrow__ __LEAF)) -# define __THROWNL __attribute__ ((__nothrow__)) -# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct -# else -# if defined __cplusplus && __GNUC_PREREQ (2,8) -# define __THROW throw () -# define __THROWNL throw () -# define __NTH(fct) __LEAF_ATTR fct throw () -# else -# define __THROW -# define __THROWNL -# define __NTH(fct) fct -# endif -# endif - -#else /* Not GCC. */ - -# define __inline /* No inline functions. */ - -# define __THROW -# define __THROWNL -# define __NTH(fct) fct - -#endif /* GCC. */ - -/* These two macros are not used in glibc anymore. They are kept here - only because some other projects expect the macros to be defined. */ -#define __P(args) args -#define __PMT(args) args - -/* For these things, GCC behaves the ANSI way normally, - and the non-ANSI way under -traditional. */ - -#define __CONCAT(x,y) x ## y -#define __STRING(x) #x - -/* This is not a typedef so `const __ptr_t' does the right thing. */ -#define __ptr_t void * -#define __long_double_t long double - - -/* C++ needs to know that types and declarations are C, not C++. */ -#ifdef __cplusplus -# define __BEGIN_DECLS extern "C" { -# define __END_DECLS } -#else -# define __BEGIN_DECLS -# define __END_DECLS -#endif - - -/* The standard library needs the functions from the ISO C90 standard - in the std namespace. At the same time we want to be safe for - future changes and we include the ISO C99 code in the non-standard - namespace __c99. The C++ wrapper header take case of adding the - definitions to the global namespace. */ -#if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES -# define __BEGIN_NAMESPACE_STD namespace std { -# define __END_NAMESPACE_STD } -# define __USING_NAMESPACE_STD(name) using std::name; -# define __BEGIN_NAMESPACE_C99 namespace __c99 { -# define __END_NAMESPACE_C99 } -# define __USING_NAMESPACE_C99(name) using __c99::name; -#else -/* For compatibility we do not add the declarations into any - namespace. They will end up in the global namespace which is what - old code expects. */ -# define __BEGIN_NAMESPACE_STD -# define __END_NAMESPACE_STD -# define __USING_NAMESPACE_STD(name) -# define __BEGIN_NAMESPACE_C99 -# define __END_NAMESPACE_C99 -# define __USING_NAMESPACE_C99(name) -#endif - - -/* Support for bounded pointers. */ -#ifndef __BOUNDED_POINTERS__ -# define __bounded /* nothing */ -# define __unbounded /* nothing */ -# define __ptrvalue /* nothing */ -#endif - - -/* Fortify support. */ -#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) -#define __bos0(ptr) __builtin_object_size (ptr, 0) -#define __fortify_function __extern_always_inline __attribute_artificial__ - -#if __GNUC_PREREQ (4,3) -# define __warndecl(name, msg) \ - extern void name (void) __attribute__((__warning__ (msg))) -# define __warnattr(msg) __attribute__((__warning__ (msg))) -# define __errordecl(name, msg) \ - extern void name (void) __attribute__((__error__ (msg))) -#else -# define __warndecl(name, msg) extern void name (void) -# define __warnattr(msg) -# define __errordecl(name, msg) extern void name (void) -#endif - -/* Support for flexible arrays. */ -#if __GNUC_PREREQ (2,97) -/* GCC 2.97 supports C99 flexible array members. */ -# define __flexarr [] -#else -# ifdef __GNUC__ -# define __flexarr [0] -# else -# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L -# define __flexarr [] -# else -/* Some other non-C99 compiler. Approximate with [1]. */ -# define __flexarr [1] -# endif -# endif -#endif - - -/* __asm__ ("xyz") is used throughout the headers to rename functions - at the assembly language level. This is wrapped by the __REDIRECT - macro, in order to support compilers that can do this some other - way. When compilers don't support asm-names at all, we have to do - preprocessor tricks instead (which don't have exactly the right - semantics, but it's the best we can do). - - Example: - int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ - -#if defined __GNUC__ && __GNUC__ >= 2 - -# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) -# ifdef __cplusplus -# define __REDIRECT_NTH(name, proto, alias) \ - name proto __THROW __asm__ (__ASMNAME (#alias)) -# define __REDIRECT_NTHNL(name, proto, alias) \ - name proto __THROWNL __asm__ (__ASMNAME (#alias)) -# else -# define __REDIRECT_NTH(name, proto, alias) \ - name proto __asm__ (__ASMNAME (#alias)) __THROW -# define __REDIRECT_NTHNL(name, proto, alias) \ - name proto __asm__ (__ASMNAME (#alias)) __THROWNL -# endif -# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) -# define __ASMNAME2(prefix, cname) __STRING (prefix) cname - -/* -#elif __SOME_OTHER_COMPILER__ - -# define __REDIRECT(name, proto, alias) name proto; \ - _Pragma("let " #name " = " #alias) -*/ -#endif - -/* GCC has various useful declarations that can be made with the - `__attribute__' syntax. All of the ways we use this do fine if - they are omitted for compilers that don't understand it. */ -#if !defined __GNUC__ || __GNUC__ < 2 -# define __attribute__(xyz) /* Ignore */ -#endif - -/* At some point during the gcc 2.96 development the `malloc' attribute - for functions was introduced. We don't want to use it unconditionally - (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (2,96) -# define __attribute_malloc__ __attribute__ ((__malloc__)) -#else -# define __attribute_malloc__ /* Ignore */ -#endif - -/* At some point during the gcc 2.96 development the `pure' attribute - for functions was introduced. We don't want to use it unconditionally - (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (2,96) -# define __attribute_pure__ __attribute__ ((__pure__)) -#else -# define __attribute_pure__ /* Ignore */ -#endif - -/* This declaration tells the compiler that the value is constant. */ -#if __GNUC_PREREQ (2,5) -# define __attribute_const__ __attribute__ ((__const__)) -#else -# define __attribute_const__ /* Ignore */ -#endif - -/* At some point during the gcc 3.1 development the `used' attribute - for functions was introduced. We don't want to use it unconditionally - (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (3,1) -# define __attribute_used__ __attribute__ ((__used__)) -# define __attribute_noinline__ __attribute__ ((__noinline__)) -#else -# define __attribute_used__ __attribute__ ((__unused__)) -# define __attribute_noinline__ /* Ignore */ -#endif - -/* gcc allows marking deprecated functions. */ -#if __GNUC_PREREQ (3,2) -# define __attribute_deprecated__ __attribute__ ((__deprecated__)) -#else -# define __attribute_deprecated__ /* Ignore */ -#endif - -/* At some point during the gcc 2.8 development the `format_arg' attribute - for functions was introduced. We don't want to use it unconditionally - (although this would be possible) since it generates warnings. - If several `format_arg' attributes are given for the same function, in - gcc-3.0 and older, all but the last one are ignored. In newer gccs, - all designated arguments are considered. */ -#if __GNUC_PREREQ (2,8) -# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) -#else -# define __attribute_format_arg__(x) /* Ignore */ -#endif - -/* At some point during the gcc 2.97 development the `strfmon' format - attribute for functions was introduced. We don't want to use it - unconditionally (although this would be possible) since it - generates warnings. */ -#if __GNUC_PREREQ (2,97) -# define __attribute_format_strfmon__(a,b) \ - __attribute__ ((__format__ (__strfmon__, a, b))) -#else -# define __attribute_format_strfmon__(a,b) /* Ignore */ -#endif - -/* The nonull function attribute allows to mark pointer parameters which - must not be NULL. */ -#if __GNUC_PREREQ (3,3) -# define __nonnull(params) __attribute__ ((__nonnull__ params)) -#else -# define __nonnull(params) -#endif - -/* If fortification mode, we warn about unused results of certain - function calls which can lead to problems. */ -#if __GNUC_PREREQ (3,4) -# define __attribute_warn_unused_result__ \ - __attribute__ ((__warn_unused_result__)) -# if __USE_FORTIFY_LEVEL > 0 -# define __wur __attribute_warn_unused_result__ -# endif -#else -# define __attribute_warn_unused_result__ /* empty */ -#endif -#ifndef __wur -# define __wur /* Ignore */ -#endif - -/* Forces a function to be always inlined. */ -#if __GNUC_PREREQ (3,2) -# define __always_inline __inline __attribute__ ((__always_inline__)) -#else -# define __always_inline __inline -#endif - -/* Associate error messages with the source location of the call site rather - than with the source location inside the function. */ -#if __GNUC_PREREQ (4,3) -# define __attribute_artificial__ __attribute__ ((__artificial__)) -#else -# define __attribute_artificial__ /* Ignore */ -#endif - -/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 - inline semantics, unless -fgnu89-inline is used. */ -#if !defined __cplusplus || __GNUC_PREREQ (4,3) -# if defined __GNUC_STDC_INLINE__ || defined __cplusplus -# define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) -# define __extern_always_inline \ - extern __always_inline __attribute__ ((__gnu_inline__)) -# else -# define __extern_inline extern __inline -# define __extern_always_inline extern __always_inline -# endif -#endif - -/* GCC 4.3 and above allow passing all anonymous arguments of an - __extern_always_inline function to some other vararg function. */ -#if __GNUC_PREREQ (4,3) -# define __va_arg_pack() __builtin_va_arg_pack () -# define __va_arg_pack_len() __builtin_va_arg_pack_len () -#endif - -/* It is possible to compile containing GCC extensions even if GCC is - run in pedantic mode if the uses are carefully marked using the - `__extension__' keyword. But this is not generally available before - version 2.8. */ -#if !__GNUC_PREREQ (2,8) -# define __extension__ /* Ignore */ -#endif - -/* __restrict is known in EGCS 1.2 and above. */ -#if !__GNUC_PREREQ (2,92) -# define __restrict /* Ignore */ -#endif - -/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is - array_name[restrict] - GCC 3.1 supports this. */ -#if __GNUC_PREREQ (3,1) && !defined __GNUG__ -# define __restrict_arr __restrict -#else -# ifdef __GNUC__ -# define __restrict_arr /* Not supported in old GCC. */ -# else -# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L -# define __restrict_arr restrict -# else -/* Some other non-C99 compiler. */ -# define __restrict_arr /* Not supported. */ -# endif -# endif -#endif - -#if __GNUC__ >= 3 -# define __glibc_unlikely(cond) __builtin_expect((cond), 0) -#else -# define __glibc_unlikely(cond) (cond) -#endif - -#endif /* sys/cdefs.h */ diff --git a/toolchain/musl/include/sys/glibc-types.h b/toolchain/musl/include/sys/glibc-types.h deleted file mode 100644 index fa0684ced2..0000000000 --- a/toolchain/musl/include/sys/glibc-types.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __MUSL_GLIBC_TYPES_H -#define __MUSL_GLIBC_TYPES_H - -#include - -/* Convenience types. */ -typedef unsigned char __u_char; -typedef unsigned short int __u_short; -typedef unsigned int __u_int; -typedef unsigned long int __u_long; - -/* Fixed-size types, underlying types depend on word size and compiler. */ -typedef signed char __int8_t; -typedef unsigned char __uint8_t; -typedef signed short int __int16_t; -typedef unsigned short int __uint16_t; -typedef signed int __int32_t; -typedef unsigned int __uint32_t; -#if __WORDSIZE == 64 -typedef signed long int __int64_t; -typedef unsigned long int __uint64_t; -#else -__extension__ typedef signed long long int __int64_t; -__extension__ typedef unsigned long long int __uint64_t; -#endif - -#define __off64_t off_t -#define __loff_t off_t -typedef char *__caddr_t; -#define __locale_t locale_t - -#define __gid_t gid_t -#define __uid_t uid_t - -#endif diff --git a/toolchain/musl/patches/100-add_glob_onlydir.patch b/toolchain/musl/patches/100-add_glob_onlydir.patch deleted file mode 100644 index a784e770df..0000000000 --- a/toolchain/musl/patches/100-add_glob_onlydir.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/include/glob.h -+++ b/include/glob.h -@@ -34,6 +34,8 @@ void globfree(glob_t *); - #define GLOB_TILDE 0x1000 - #define GLOB_TILDE_CHECK 0x4000 - -+#define GLOB_ONLYDIR 0x100 -+ - #define GLOB_NOSPACE 1 - #define GLOB_ABORTED 2 - #define GLOB_NOMATCH 3 From 845a03fbef82408e173882450797da04af421d74 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 24 Nov 2020 17:32:34 -0800 Subject: [PATCH 07/33] bpftools: fix compilation with musl 1.2.x A definition for __maybe_inline is needed. Refreshed patches. Signed-off-by: Rosen Penev --- .../utils/bpftools/patches/006-musl-120.patch | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 package/network/utils/bpftools/patches/006-musl-120.patch diff --git a/package/network/utils/bpftools/patches/006-musl-120.patch b/package/network/utils/bpftools/patches/006-musl-120.patch new file mode 100644 index 0000000000..53be466f0b --- /dev/null +++ b/package/network/utils/bpftools/patches/006-musl-120.patch @@ -0,0 +1,20 @@ +--- a/tools/bpf/bpftool/btf_dumper.c ++++ b/tools/bpf/bpftool/btf_dumper.c +@@ -5,6 +5,7 @@ + #include /* for (FILE *) used by json_writer */ + #include + #include ++#include + #include + #include + #include +--- a/tools/bpf/bpftool/map_perf_ring.c ++++ b/tools/bpf/bpftool/map_perf_ring.c +@@ -16,6 +16,7 @@ + #include + #include + #include ++#include + #include + #include + #include From c6bce01efebabc4f5481a1cf5cfb6175555831c7 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 9 Sep 2021 20:36:51 +0200 Subject: [PATCH 08/33] toolchain/musl: Remove extra format attribute patch This patch never went upstream so remove it. GCC should already add such a check to the common functions. Signed-off-by: Hauke Mehrtens --- ...ribute-to-some-function-declarations.patch | 197 ------------------ 1 file changed, 197 deletions(-) delete mode 100644 toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch diff --git a/toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch b/toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch deleted file mode 100644 index 06aeb34ced..0000000000 --- a/toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch +++ /dev/null @@ -1,197 +0,0 @@ -From e6683d001a95d7c3d4d992496f00f77e01fcd268 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Sun, 22 Nov 2015 15:04:23 +0100 -Subject: [PATCH v2] Add format attribute to some function declarations - -GCC and Clang are able to check the format arguments given to a -function and warn the user if there is a error in the format arguments -or if there is a potential uncontrolled format string security problem -in the code. GCC does this automatically for some functions like -printf(), but it is also possible to annotate other functions in a way -that it will check them too. This feature is used by glibc for many -functions. This patch adds the attribute to the some functions of musl -expect for these functions where gcc automatically adds it. - -GCC automatically adds checks for these functions: printf, fprintf, -sprintf, scanf, fscanf, sscanf, strftime, vprintf, vfprintf and -vsprintf. - -The documentation from gcc is here: -https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html - -The documentation from Clang is here: -http://clang.llvm.org/docs/AttributeReference.html#format-gnu-format - -Signed-off-by: Hauke Mehrtens ---- - include/err.h | 26 +++++++++++++++++--------- - include/monetary.h | 12 ++++++++++-- - include/stdio.h | 29 ++++++++++++++++++++--------- - include/syslog.h | 12 ++++++++++-- - 4 files changed, 57 insertions(+), 22 deletions(-) - ---- a/include/err.h -+++ b/include/err.h -@@ -8,15 +8,23 @@ - extern "C" { - #endif - --void warn(const char *, ...); --void vwarn(const char *, va_list); --void warnx(const char *, ...); --void vwarnx(const char *, va_list); -+#if __GNUC__ >= 3 -+#define __fp(x, y) __attribute__ ((__format__ (__printf__, x, y))) -+#else -+#define __fp(x, y) -+#endif -+ -+void warn(const char *, ...) __fp(1, 2); -+void vwarn(const char *, va_list) __fp(1, 0); -+void warnx(const char *, ...) __fp(1, 2); -+void vwarnx(const char *, va_list) __fp(1, 0); -+ -+_Noreturn void err(int, const char *, ...) __fp(2, 3); -+_Noreturn void verr(int, const char *, va_list) __fp(2, 0); -+_Noreturn void errx(int, const char *, ...) __fp(2, 3); -+_Noreturn void verrx(int, const char *, va_list) __fp(2, 0); - --_Noreturn void err(int, const char *, ...); --_Noreturn void verr(int, const char *, va_list); --_Noreturn void errx(int, const char *, ...); --_Noreturn void verrx(int, const char *, va_list); -+#undef __fp - - #ifdef __cplusplus - } ---- a/include/monetary.h -+++ b/include/monetary.h -@@ -13,8 +13,16 @@ extern "C" { - - #include - --ssize_t strfmon(char *__restrict, size_t, const char *__restrict, ...); --ssize_t strfmon_l(char *__restrict, size_t, locale_t, const char *__restrict, ...); -+#if __GNUC__ >= 3 -+#define __fsfm(x, y) __attribute__ ((__format__ (__strfmon__, x, y))) -+#else -+#define __fsfm(x, y) -+#endif -+ -+ssize_t strfmon(char *__restrict, size_t, const char *__restrict, ...) __fsfm(3, 4); -+ssize_t strfmon_l(char *__restrict, size_t, locale_t, const char *__restrict, ...) __fsfm(4, 5); -+ -+#undef __fsfm - - #ifdef __cplusplus - } ---- a/include/stdio.h -+++ b/include/stdio.h -@@ -25,6 +25,14 @@ extern "C" { - - #include - -+#if __GNUC__ >= 3 -+#define __fp(x, y) __attribute__ ((__format__ (__printf__, x, y))) -+#define __fs(x, y) __attribute__ ((__format__ (__scanf__, x, y))) -+#else -+#define __fp(x, y) -+#define __fs(x, y) -+#endif -+ - #ifdef __cplusplus - #define NULL 0L - #else -@@ -107,19 +115,19 @@ int puts(const char *); - int printf(const char *__restrict, ...); - int fprintf(FILE *__restrict, const char *__restrict, ...); - int sprintf(char *__restrict, const char *__restrict, ...); --int snprintf(char *__restrict, size_t, const char *__restrict, ...); -+int snprintf(char *__restrict, size_t, const char *__restrict, ...) __fp(3, 4); - - int vprintf(const char *__restrict, __isoc_va_list); - int vfprintf(FILE *__restrict, const char *__restrict, __isoc_va_list); - int vsprintf(char *__restrict, const char *__restrict, __isoc_va_list); --int vsnprintf(char *__restrict, size_t, const char *__restrict, __isoc_va_list); -+int vsnprintf(char *__restrict, size_t, const char *__restrict, __isoc_va_list) __fp(3, 0); - - int scanf(const char *__restrict, ...); - int fscanf(FILE *__restrict, const char *__restrict, ...); - int sscanf(const char *__restrict, const char *__restrict, ...); --int vscanf(const char *__restrict, __isoc_va_list); --int vfscanf(FILE *__restrict, const char *__restrict, __isoc_va_list); --int vsscanf(const char *__restrict, const char *__restrict, __isoc_va_list); -+int vscanf(const char *__restrict, __isoc_va_list) __fs(1, 0); -+int vfscanf(FILE *__restrict, const char *__restrict, __isoc_va_list) __fs(2, 0); -+int vsscanf(const char *__restrict, const char *__restrict, __isoc_va_list) __fs(2, 0); - - void perror(const char *); - -@@ -140,8 +148,8 @@ int pclose(FILE *); - int fileno(FILE *); - int fseeko(FILE *, off_t, int); - off_t ftello(FILE *); --int dprintf(int, const char *__restrict, ...); --int vdprintf(int, const char *__restrict, __isoc_va_list); -+int dprintf(int, const char *__restrict, ...) __fp(2, 3); -+int vdprintf(int, const char *__restrict, __isoc_va_list) __fp(2, 0); - void flockfile(FILE *); - int ftrylockfile(FILE *); - void funlockfile(FILE *); -@@ -180,8 +188,8 @@ int fileno_unlocked(FILE *); - int getw(FILE *); - int putw(int, FILE *); - char *fgetln(FILE *, size_t *); --int asprintf(char **, const char *, ...); --int vasprintf(char **, const char *, __isoc_va_list); -+int asprintf(char **, const char *, ...) __fp(2, 3); -+int vasprintf(char **, const char *, __isoc_va_list) __fp(2, 0); - #endif - - #ifdef _GNU_SOURCE -@@ -203,6 +211,9 @@ typedef struct _IO_cookie_io_functions_t - FILE *fopencookie(void *, const char *, cookie_io_functions_t); - #endif - -+#undef __fp -+#undef __fs -+ - #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) - #define tmpfile64 tmpfile - #define fopen64 fopen ---- a/include/syslog.h -+++ b/include/syslog.h -@@ -56,16 +56,22 @@ extern "C" { - #define LOG_NOWAIT 0x10 - #define LOG_PERROR 0x20 - -+#if __GNUC__ >= 3 -+#define __fp(x, y) __attribute__ ((__format__ (__printf__, x, y))) -+#else -+#define __fp(x, y) -+#endif -+ - void closelog (void); - void openlog (const char *, int, int); - int setlogmask (int); --void syslog (int, const char *, ...); -+void syslog (int, const char *, ...) __fp(2, 3); - - #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) - #define _PATH_LOG "/dev/log" - #define __NEED_va_list - #include --void vsyslog (int, const char *, va_list); -+void vsyslog (int, const char *, va_list) __fp(2, 0); - #if defined(SYSLOG_NAMES) - #define INTERNAL_NOPRI 0x10 - #define INTERNAL_MARK (LOG_NFACILITIES<<3) -@@ -93,6 +99,8 @@ typedef struct { - #endif - #endif - -+#undef __fp -+ - #ifdef __cplusplus - } - #endif From ab7fcb3a8c4a905892c0f3aaf4398d53c00f2797 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Tue, 14 Sep 2021 23:44:19 +0200 Subject: [PATCH 09/33] mac80211: Update to backports-4.19.207-1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refresh all patches. This contains fixes for CVE-2020-3702 1. These patches (ath, ath9k, mac80211) were included in kernel versions since 4.14.245 and 4.19.205. They fix security vulnerability CVE-2020-3702 [1] similar to KrØØk, which was found by ESET [2]. Thank you Josef Schlehofer for reporting this problem. [1] https://nvd.nist.gov/vuln/detail/CVE-2020-3702 [2] https://www.welivesecurity.com/2020/08/06/beyond-kr00k-even-more-wifi-chips-vulnerable-eavesdropping/ Signed-off-by: Hauke Mehrtens --- package/kernel/mac80211/Makefile | 6 +- ...erpret-requested-txpower-in-EIRP-dom.patch | 4 +- ...power-reduction-for-US-regulatory-do.patch | 2 +- .../patches/ath/400-ath_move_debug_code.patch | 2 +- .../patches/ath/542-ath9k_debugfs_diag.patch | 8 +- ...544-ath9k-ar933x-usb-hang-workaround.patch | 4 +- .../ath/551-ath9k_ubnt_uap_plus_hsr.patch | 4 +- .../ath/930-ath10k_add_tpt_led_trigger.patch | 4 +- ...75-ath10k-use-tpt-trigger-by-default.patch | 2 +- ...rt-for-configuring-management-packet.patch | 4 +- ...ble-out-of-bound-access-of-ath10k_ra.patch | 2 +- ...rect-multicast-broadcast-rate-settin.patch | 4 +- ...frameburst-mode-in-default-firmware-.patch | 2 +- ...phy_err-and-use-it-in-the-cfg80211.c.patch | 210 +++++++-------- ...-code-handling-bandwidth-of-firmware.patch | 2 +- ...-firmware-reporting-160-MHz-channels.patch | 2 +- ...bphy_err-to-take-struct-brcmf_pub-ar.patch | 248 +++++++++--------- ...DFS_OFFLOAD-extended-feature-if-supp.patch | 2 +- ...d-firmware-commands-when-bus-is-down.patch | 2 +- ...set-but-not-used-variable-dtim_perio.patch | 6 +- ...-brcmfmac-replace-strncpy-by-strscpy.patch | 2 +- ...rcmfmac-use-ph-to-print-small-buffer.patch | 6 +- ...g80211_ops-pointer-to-another-struct.patch | 2 +- ...rors-when-setting-roaming-parameters.patch | 2 +- ...B-condition-when-setting-interface-c.patch | 10 +- ...-mbss-in-vif-if-firmware-does-not-su.patch | 4 +- ...lify-building-interface-combinations.patch | 6 +- ...add-initial-support-for-monitor-mode.patch | 8 +- ...62-brcmfmac-Disable-power-management.patch | 2 +- .../subsys/140-tweak-TSQ-setting.patch | 2 +- ...d-stop-start-logic-for-software-TXQs.patch | 4 +- .../320-mac80211-Add-TXQ-scheduling-API.patch | 8 +- ...-Add-airtime-statistics-and-settings.patch | 6 +- ...time-accounting-and-scheduling-to-TX.patch | 20 +- ...pose-ieee80211_schedule_txq-function.patch | 2 +- ...0211-add-hdrlen-to-ieee80211_tx_data.patch | 12 +- ...1-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch | 24 +- ...locking-for-txq-scheduling-airtime-f.patch | 10 +- ...te-hash-for-fq-without-holding-fq-lo.patch | 12 +- ...e-dequeue-late-tx-handlers-without-h.patch | 8 +- ...ee80211_schedule_txq-schedule-empty-.patch | 6 +- ...ing-iTXQ-select-the-queue-in-ieee802.patch | 4 +- ...al-BSS-receive-time-to-survey-inform.patch | 2 +- 43 files changed, 341 insertions(+), 341 deletions(-) diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 577ec2ee87..ff75b4167e 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=4.19.193-1 +PKG_VERSION:=4.19.207-1 PKG_RELEASE:=1 -PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.193/ -PKG_HASH:=560c0ce9e4079fd26d046e188453e008a5e766e5409d950c4749a23da53d6d0a +PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.207/ +PKG_HASH:=e119fd57c868e22c0481171ff561902f8c1565f896d97a2163c0d138808cc5f7 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION) diff --git a/package/kernel/mac80211/patches/ath/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch b/package/kernel/mac80211/patches/ath/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch index 1a91265f1b..4e664fca20 100644 --- a/package/kernel/mac80211/patches/ath/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch +++ b/package/kernel/mac80211/patches/ath/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch @@ -8,7 +8,7 @@ This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411. --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -2976,7 +2976,8 @@ void ath9k_hw_apply_txpower(struct ath_h +@@ -2978,7 +2978,8 @@ void ath9k_hw_apply_txpower(struct ath_h { struct ath_regulatory *reg = ath9k_hw_regulatory(ah); struct ieee80211_channel *channel; @@ -18,7 +18,7 @@ This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411. u16 ctl = NO_CTL; if (!chan) -@@ -2988,9 +2989,14 @@ void ath9k_hw_apply_txpower(struct ath_h +@@ -2990,9 +2991,14 @@ void ath9k_hw_apply_txpower(struct ath_h channel = chan->chan; chan_pwr = min_t(int, channel->max_power * 2, MAX_RATE_POWER); new_pwr = min_t(int, chan_pwr, reg->power_limit); diff --git a/package/kernel/mac80211/patches/ath/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch b/package/kernel/mac80211/patches/ath/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch index 288d4e478c..6d3ef5f042 100644 --- a/package/kernel/mac80211/patches/ath/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch +++ b/package/kernel/mac80211/patches/ath/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -2995,6 +2995,10 @@ void ath9k_hw_apply_txpower(struct ath_h +@@ -2997,6 +2997,10 @@ void ath9k_hw_apply_txpower(struct ath_h if (ant_gain > max_gain) ant_reduction = ant_gain - max_gain; diff --git a/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch b/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch index e7df0e14be..0d4ebfe0aa 100644 --- a/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch +++ b/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch @@ -14,7 +14,7 @@ CFLAGS_trace.o := -I$(src) --- a/drivers/net/wireless/ath/ath.h +++ b/drivers/net/wireless/ath/ath.h -@@ -316,14 +316,7 @@ void _ath_dbg(struct ath_common *common, +@@ -317,14 +317,7 @@ void _ath_dbg(struct ath_common *common, #endif /* CPTCFG_ATH_DEBUG */ /** Returns string describing opmode, or NULL if unknown mode. */ diff --git a/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch b/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch index d7e82c9a66..19bbee09a9 100644 --- a/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch +++ b/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch @@ -84,7 +84,7 @@ bool reset_power_on; bool htc_reset_init; -@@ -1073,6 +1081,7 @@ void ath9k_hw_check_nav(struct ath_hw *a +@@ -1074,6 +1082,7 @@ void ath9k_hw_check_nav(struct ath_hw *a bool ath9k_hw_check_alive(struct ath_hw *ah); bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode); @@ -94,7 +94,7 @@ struct ath_gen_timer *ath_gen_timer_alloc(struct ath_hw *ah, --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1883,6 +1883,20 @@ u32 ath9k_hw_get_tsf_offset(struct times +@@ -1882,6 +1882,20 @@ u32 ath9k_hw_get_tsf_offset(struct times } EXPORT_SYMBOL(ath9k_hw_get_tsf_offset); @@ -115,7 +115,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, struct ath9k_hw_cal_data *caldata, bool fastcc) { -@@ -2091,6 +2105,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st +@@ -2090,6 +2104,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st ar9003_hw_disable_phy_restart(ah); ath9k_hw_apply_gpio_override(ah); @@ -125,7 +125,7 @@ REG_SET_BIT(ah, AR_BTCOEX_WL_LNADIV, AR_BTCOEX_WL_LNADIV_FORCE_ON); --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -528,6 +528,11 @@ irqreturn_t ath_isr(int irq, void *dev) +@@ -533,6 +533,11 @@ irqreturn_t ath_isr(int irq, void *dev) if (test_bit(ATH_OP_HW_RESET, &common->op_flags)) return IRQ_HANDLED; diff --git a/package/kernel/mac80211/patches/ath/544-ath9k-ar933x-usb-hang-workaround.patch b/package/kernel/mac80211/patches/ath/544-ath9k-ar933x-usb-hang-workaround.patch index 93eee34b64..2d2b837072 100644 --- a/package/kernel/mac80211/patches/ath/544-ath9k-ar933x-usb-hang-workaround.patch +++ b/package/kernel/mac80211/patches/ath/544-ath9k-ar933x-usb-hang-workaround.patch @@ -40,7 +40,7 @@ return true; } -@@ -1861,8 +1880,14 @@ static int ath9k_hw_do_fastcc(struct ath +@@ -1860,8 +1879,14 @@ static int ath9k_hw_do_fastcc(struct ath if (AR_SREV_9271(ah)) ar9002_hw_load_ani_reg(ah, chan); @@ -55,7 +55,7 @@ return -EINVAL; } -@@ -2116,6 +2141,9 @@ int ath9k_hw_reset(struct ath_hw *ah, st +@@ -2115,6 +2140,9 @@ int ath9k_hw_reset(struct ath_hw *ah, st ath9k_hw_set_radar_params(ah); } diff --git a/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch b/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch index 30eba27137..08b92d4a86 100644 --- a/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch +++ b/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch @@ -343,7 +343,7 @@ u8 ath9k_parse_mpdudensity(u8 mpdudensity) { -@@ -649,6 +651,7 @@ void ath_reset_work(struct work_struct * +@@ -654,6 +656,7 @@ void ath_reset_work(struct work_struct * static int ath9k_start(struct ieee80211_hw *hw) { struct ath_softc *sc = hw->priv; @@ -351,7 +351,7 @@ struct ath_hw *ah = sc->sc_ah; struct ath_common *common = ath9k_hw_common(ah); struct ieee80211_channel *curchan = sc->cur_chan->chandef.chan; -@@ -727,6 +730,11 @@ static int ath9k_start(struct ieee80211_ +@@ -732,6 +735,11 @@ static int ath9k_start(struct ieee80211_ AR_GPIO_OUTPUT_MUX_AS_OUTPUT); } diff --git a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch index 61ea3c1a73..dd94439d01 100644 --- a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch +++ b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -8293,6 +8293,21 @@ static int ath10k_mac_init_rd(struct ath +@@ -8294,6 +8294,21 @@ static int ath10k_mac_init_rd(struct ath return 0; } @@ -22,7 +22,7 @@ int ath10k_mac_register(struct ath10k *ar) { static const u32 cipher_suites[] = { -@@ -8577,6 +8592,12 @@ int ath10k_mac_register(struct ath10k *a +@@ -8578,6 +8593,12 @@ int ath10k_mac_register(struct ath10k *a wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST); diff --git a/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch index 70350540b1..47ec4c4be5 100644 --- a/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch @@ -42,7 +42,7 @@ Signed-off-by: Mathias Kresin if (ret) --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -8609,7 +8609,7 @@ int ath10k_mac_register(struct ath10k *a +@@ -8610,7 +8610,7 @@ int ath10k_mac_register(struct ath10k *a wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST); #ifdef CPTCFG_MAC80211_LEDS diff --git a/package/kernel/mac80211/patches/ath/977-ath10k-add-support-for-configuring-management-packet.patch b/package/kernel/mac80211/patches/ath/977-ath10k-add-support-for-configuring-management-packet.patch index ee4f4a760d..5f9e36e2de 100644 --- a/package/kernel/mac80211/patches/ath/977-ath10k-add-support-for-configuring-management-packet.patch +++ b/package/kernel/mac80211/patches/ath/977-ath10k-add-support-for-configuring-management-packet.patch @@ -43,7 +43,7 @@ Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux static int ath10k_mac_get_max_vht_mcs_map(u16 mcs_map, int nss) { switch ((mcs_map >> (2 * nss)) & 0x3) { -@@ -5478,9 +5494,10 @@ static void ath10k_bss_info_changed(stru +@@ -5479,9 +5495,10 @@ static void ath10k_bss_info_changed(stru struct cfg80211_chan_def def; u32 vdev_param, pdev_param, slottime, preamble; u16 bitrate, hw_value; @@ -56,7 +56,7 @@ Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux mutex_lock(&ar->conf_mutex); -@@ -5686,6 +5703,30 @@ static void ath10k_bss_info_changed(stru +@@ -5687,6 +5704,30 @@ static void ath10k_bss_info_changed(stru arvif->vdev_id, ret); } diff --git a/package/kernel/mac80211/patches/ath/978-ath10k-fix-possible-out-of-bound-access-of-ath10k_ra.patch b/package/kernel/mac80211/patches/ath/978-ath10k-fix-possible-out-of-bound-access-of-ath10k_ra.patch index d4f177f1bc..743171a8ac 100644 --- a/package/kernel/mac80211/patches/ath/978-ath10k-fix-possible-out-of-bound-access-of-ath10k_ra.patch +++ b/package/kernel/mac80211/patches/ath/978-ath10k-fix-possible-out-of-bound-access-of-ath10k_ra.patch @@ -26,7 +26,7 @@ Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux if (ath10k_rates[i].bitrate == bitrate) return hw_value_prefix | ath10k_rates[i].hw_value; } -@@ -5709,22 +5709,22 @@ static void ath10k_bss_info_changed(stru +@@ -5710,22 +5710,22 @@ static void ath10k_bss_info_changed(stru return; } diff --git a/package/kernel/mac80211/patches/ath/979-ath10k-fix-incorrect-multicast-broadcast-rate-settin.patch b/package/kernel/mac80211/patches/ath/979-ath10k-fix-incorrect-multicast-broadcast-rate-settin.patch index f30b0f3658..c35c88556a 100644 --- a/package/kernel/mac80211/patches/ath/979-ath10k-fix-incorrect-multicast-broadcast-rate-settin.patch +++ b/package/kernel/mac80211/patches/ath/979-ath10k-fix-incorrect-multicast-broadcast-rate-settin.patch @@ -17,7 +17,7 @@ Origin: other, https://patchwork.kernel.org/patch/10723033/ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -5494,8 +5494,8 @@ static void ath10k_bss_info_changed(stru +@@ -5495,8 +5495,8 @@ static void ath10k_bss_info_changed(stru struct cfg80211_chan_def def; u32 vdev_param, pdev_param, slottime, preamble; u16 bitrate, hw_value; @@ -28,7 +28,7 @@ Origin: other, https://patchwork.kernel.org/patch/10723033/ enum nl80211_band band; const struct ieee80211_supported_band *sband; -@@ -5668,7 +5668,11 @@ static void ath10k_bss_info_changed(stru +@@ -5669,7 +5669,11 @@ static void ath10k_bss_info_changed(stru if (changed & BSS_CHANGED_MCAST_RATE && !ath10k_mac_vif_chan(arvif->vif, &def)) { band = def.chan->band; diff --git a/package/kernel/mac80211/patches/brcm/328-v5.0-0002-brcmfmac-enable-frameburst-mode-in-default-firmware-.patch b/package/kernel/mac80211/patches/brcm/328-v5.0-0002-brcmfmac-enable-frameburst-mode-in-default-firmware-.patch index 9bc6d453c3..2dc486236d 100644 --- a/package/kernel/mac80211/patches/brcm/328-v5.0-0002-brcmfmac-enable-frameburst-mode-in-default-firmware-.patch +++ b/package/kernel/mac80211/patches/brcm/328-v5.0-0002-brcmfmac-enable-frameburst-mode-in-default-firmware-.patch @@ -17,7 +17,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -6657,6 +6657,12 @@ static s32 brcmf_config_dongle(struct br +@@ -6660,6 +6660,12 @@ static s32 brcmf_config_dongle(struct br brcmf_configure_arp_nd_offload(ifp, true); diff --git a/package/kernel/mac80211/patches/brcm/346-v5.1-brcmfmac-add-bphy_err-and-use-it-in-the-cfg80211.c.patch b/package/kernel/mac80211/patches/brcm/346-v5.1-brcmfmac-add-bphy_err-and-use-it-in-the-cfg80211.c.patch index 7ae551619b..6af2710387 100644 --- a/package/kernel/mac80211/patches/brcm/346-v5.1-brcmfmac-add-bphy_err-and-use-it-in-the-cfg80211.c.patch +++ b/package/kernel/mac80211/patches/brcm/346-v5.1-brcmfmac-add-bphy_err-and-use-it-in-the-cfg80211.c.patch @@ -836,7 +836,7 @@ Signed-off-by: Kalle Valo return err; } sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_PACKETS) | -@@ -2566,7 +2592,7 @@ brcmf_cfg80211_get_station(struct wiphy +@@ -2567,7 +2593,7 @@ brcmf_cfg80211_get_station(struct wiphy &sta_info_le, sizeof(sta_info_le)); if (err < 0) { @@ -845,7 +845,7 @@ Signed-off-by: Kalle Valo goto done; } } -@@ -2635,7 +2661,8 @@ brcmf_cfg80211_get_station(struct wiphy +@@ -2638,7 +2664,8 @@ brcmf_cfg80211_get_station(struct wiphy err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI, &scb_val, sizeof(scb_val)); if (err) { @@ -855,7 +855,7 @@ Signed-off-by: Kalle Valo goto done; } else { rssi = le32_to_cpu(scb_val.val); -@@ -2666,8 +2693,8 @@ brcmf_cfg80211_dump_station(struct wiphy +@@ -2669,8 +2696,8 @@ brcmf_cfg80211_dump_station(struct wiphy &cfg->assoclist, sizeof(cfg->assoclist)); if (err) { @@ -866,7 +866,7 @@ Signed-off-by: Kalle Valo cfg->assoclist.count = 0; return -EOPNOTSUPP; } -@@ -2715,9 +2742,9 @@ brcmf_cfg80211_set_power_mgmt(struct wip +@@ -2718,9 +2745,9 @@ brcmf_cfg80211_set_power_mgmt(struct wip err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, pm); if (err) { if (err == -ENODEV) @@ -878,7 +878,7 @@ Signed-off-by: Kalle Valo } done: brcmf_dbg(TRACE, "Exit\n"); -@@ -2740,7 +2767,7 @@ static s32 brcmf_inform_single_bss(struc +@@ -2743,7 +2770,7 @@ static s32 brcmf_inform_single_bss(struc struct cfg80211_inform_bss bss_data = {}; if (le32_to_cpu(bi->length) > WL_BSS_INFO_MAX) { @@ -887,7 +887,7 @@ Signed-off-by: Kalle Valo return 0; } -@@ -2799,6 +2826,7 @@ next_bss_le(struct brcmf_scan_results *l +@@ -2802,6 +2829,7 @@ next_bss_le(struct brcmf_scan_results *l static s32 brcmf_inform_bss(struct brcmf_cfg80211_info *cfg) { @@ -895,7 +895,7 @@ Signed-off-by: Kalle Valo struct brcmf_scan_results *bss_list; struct brcmf_bss_info_le *bi = NULL; /* must be initialized */ s32 err = 0; -@@ -2807,8 +2835,8 @@ static s32 brcmf_inform_bss(struct brcmf +@@ -2810,8 +2838,8 @@ static s32 brcmf_inform_bss(struct brcmf bss_list = (struct brcmf_scan_results *)cfg->escan_info.escan_buf; if (bss_list->count != 0 && bss_list->version != BRCMF_BSS_INFO_VERSION) { @@ -906,7 +906,7 @@ Signed-off-by: Kalle Valo return -EOPNOTSUPP; } brcmf_dbg(SCAN, "scanned AP count (%d)\n", bss_list->count); -@@ -2852,7 +2880,7 @@ static s32 brcmf_inform_ibss(struct brcm +@@ -2855,7 +2883,7 @@ static s32 brcmf_inform_ibss(struct brcm err = brcmf_fil_cmd_data_get(netdev_priv(ndev), BRCMF_C_GET_BSS_INFO, buf, WL_BSS_INFO_MAX); if (err) { @@ -915,7 +915,7 @@ Signed-off-by: Kalle Valo goto CleanUp; } -@@ -2906,6 +2934,7 @@ CleanUp: +@@ -2909,6 +2937,7 @@ CleanUp: static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp) { @@ -923,7 +923,7 @@ Signed-off-by: Kalle Valo struct brcmf_bss_info_le *bi; const struct brcmf_tlv *tim; u16 beacon_interval; -@@ -2922,7 +2951,7 @@ static s32 brcmf_update_bss_info(struct +@@ -2925,7 +2954,7 @@ static s32 brcmf_update_bss_info(struct err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, cfg->extra_buf, WL_EXTRA_BUF_MAX); if (err) { @@ -932,7 +932,7 @@ Signed-off-by: Kalle Valo goto update_bss_info_out; } -@@ -2947,7 +2976,7 @@ static s32 brcmf_update_bss_info(struct +@@ -2950,7 +2979,7 @@ static s32 brcmf_update_bss_info(struct u32 var; err = brcmf_fil_iovar_int_get(ifp, "dtim_assoc", &var); if (err) { @@ -941,7 +941,7 @@ Signed-off-by: Kalle Valo goto update_bss_info_out; } dtim_period = (u8)var; -@@ -2985,9 +3014,10 @@ static void brcmf_escan_timeout(struct t +@@ -2988,9 +3017,10 @@ static void brcmf_escan_timeout(struct t { struct brcmf_cfg80211_info *cfg = from_timer(cfg, t, escan_timeout); @@ -953,7 +953,7 @@ Signed-off-by: Kalle Valo schedule_work(&cfg->escan_timeout_work); } } -@@ -3036,6 +3066,7 @@ brcmf_cfg80211_escan_handler(struct brcm +@@ -3039,6 +3069,7 @@ brcmf_cfg80211_escan_handler(struct brcm const struct brcmf_event_msg *e, void *data) { struct brcmf_cfg80211_info *cfg = ifp->drvr->config; @@ -961,7 +961,7 @@ Signed-off-by: Kalle Valo s32 status; struct brcmf_escan_result_le *escan_result_le; u32 escan_buflen; -@@ -3052,32 +3083,33 @@ brcmf_cfg80211_escan_handler(struct brcm +@@ -3055,32 +3086,33 @@ brcmf_cfg80211_escan_handler(struct brcm goto exit; if (!test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) { @@ -1002,7 +1002,7 @@ Signed-off-by: Kalle Valo goto exit; } bss_info_le = &escan_result_le->bss_info_le; -@@ -3092,8 +3124,8 @@ brcmf_cfg80211_escan_handler(struct brcm +@@ -3095,8 +3127,8 @@ brcmf_cfg80211_escan_handler(struct brcm bi_length = le32_to_cpu(bss_info_le->length); if (bi_length != escan_buflen - WL_ESCAN_RESULTS_FIXED_SIZE) { @@ -1013,7 +1013,7 @@ Signed-off-by: Kalle Valo goto exit; } -@@ -3101,7 +3133,7 @@ brcmf_cfg80211_escan_handler(struct brcm +@@ -3104,7 +3136,7 @@ brcmf_cfg80211_escan_handler(struct brcm BIT(NL80211_IFTYPE_ADHOC))) { if (le16_to_cpu(bss_info_le->capability) & WLAN_CAPABILITY_IBSS) { @@ -1022,7 +1022,7 @@ Signed-off-by: Kalle Valo goto exit; } } -@@ -3109,7 +3141,7 @@ brcmf_cfg80211_escan_handler(struct brcm +@@ -3112,7 +3144,7 @@ brcmf_cfg80211_escan_handler(struct brcm list = (struct brcmf_scan_results *) cfg->escan_info.escan_buf; if (bi_length > BRCMF_ESCAN_BUF_SIZE - list->buflen) { @@ -1031,7 +1031,7 @@ Signed-off-by: Kalle Valo goto exit; } -@@ -3301,14 +3333,14 @@ brcmf_notify_sched_scan_results(struct b +@@ -3304,14 +3336,14 @@ brcmf_notify_sched_scan_results(struct b WARN_ON(status != BRCMF_PNO_SCAN_COMPLETE); brcmf_dbg(SCAN, "PFN NET FOUND event. count: %d\n", result_count); if (!result_count) { @@ -1048,7 +1048,7 @@ Signed-off-by: Kalle Valo goto out_err; } -@@ -3362,8 +3394,8 @@ brcmf_cfg80211_sched_scan_start(struct w +@@ -3365,8 +3397,8 @@ brcmf_cfg80211_sched_scan_start(struct w req->n_match_sets, req->n_ssids); if (test_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status)) { @@ -1059,7 +1059,7 @@ Signed-off-by: Kalle Valo return -EAGAIN; } -@@ -3442,6 +3474,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i +@@ -3445,6 +3477,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i void *data) { struct brcmf_cfg80211_info *cfg = ifp->drvr->config; @@ -1067,7 +1067,7 @@ Signed-off-by: Kalle Valo struct brcmf_pno_scanresults_le *pfn_result; struct brcmf_pno_net_info_le *netinfo; -@@ -3460,8 +3493,8 @@ brcmf_wowl_nd_results(struct brcmf_if *i +@@ -3463,8 +3496,8 @@ brcmf_wowl_nd_results(struct brcmf_if *i } if (le32_to_cpu(pfn_result->count) < 1) { @@ -1078,7 +1078,7 @@ Signed-off-by: Kalle Valo return -EINVAL; } -@@ -3500,7 +3533,7 @@ static void brcmf_report_wowl_wakeind(st +@@ -3503,7 +3536,7 @@ static void brcmf_report_wowl_wakeind(st err = brcmf_fil_iovar_data_get(ifp, "wowl_wakeind", &wake_ind_le, sizeof(wake_ind_le)); if (err) { @@ -1087,7 +1087,7 @@ Signed-off-by: Kalle Valo return; } -@@ -3541,7 +3574,7 @@ static void brcmf_report_wowl_wakeind(st +@@ -3544,7 +3577,7 @@ static void brcmf_report_wowl_wakeind(st cfg->wowl.nd_data_completed, BRCMF_ND_INFO_TIMEOUT); if (!timeout) @@ -1096,7 +1096,7 @@ Signed-off-by: Kalle Valo else wakeup_data.net_detect = cfg->wowl.nd_info; } -@@ -3749,7 +3782,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w +@@ -3752,7 +3785,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w cfg->pmk_list.npmk = cpu_to_le32(npmk); } } else { @@ -1105,7 +1105,7 @@ Signed-off-by: Kalle Valo return -EINVAL; } -@@ -3795,7 +3828,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w +@@ -3798,7 +3831,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w memset(&pmk[i], 0, sizeof(*pmk)); cfg->pmk_list.npmk = cpu_to_le32(npmk - 1); } else { @@ -1114,7 +1114,7 @@ Signed-off-by: Kalle Valo return -EINVAL; } -@@ -3827,19 +3860,20 @@ brcmf_cfg80211_flush_pmksa(struct wiphy +@@ -3830,19 +3863,20 @@ brcmf_cfg80211_flush_pmksa(struct wiphy static s32 brcmf_configure_opensecurity(struct brcmf_if *ifp) { @@ -1137,7 +1137,7 @@ Signed-off-by: Kalle Valo return err; } /* set upper-layer auth */ -@@ -3849,7 +3883,7 @@ static s32 brcmf_configure_opensecurity( +@@ -3852,7 +3886,7 @@ static s32 brcmf_configure_opensecurity( wpa_val = WPA_AUTH_DISABLED; err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_val); if (err < 0) { @@ -1146,7 +1146,7 @@ Signed-off-by: Kalle Valo return err; } -@@ -3869,6 +3903,7 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -3872,6 +3906,7 @@ brcmf_configure_wpaie(struct brcmf_if *i const struct brcmf_vs_tlv *wpa_ie, bool is_rsn_ie) { @@ -1154,7 +1154,7 @@ Signed-off-by: Kalle Valo u32 auth = 0; /* d11 open authentication */ u16 count; s32 err = 0; -@@ -3899,13 +3934,13 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -3902,13 +3937,13 @@ brcmf_configure_wpaie(struct brcmf_if *i /* check for multicast cipher suite */ if (offset + WPA_IE_MIN_OUI_LEN > len) { err = -EINVAL; @@ -1170,7 +1170,7 @@ Signed-off-by: Kalle Valo goto exit; } offset += TLV_OUI_LEN; -@@ -3927,7 +3962,7 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -3930,7 +3965,7 @@ brcmf_configure_wpaie(struct brcmf_if *i break; default: err = -EINVAL; @@ -1179,7 +1179,7 @@ Signed-off-by: Kalle Valo goto exit; } -@@ -3938,13 +3973,13 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -3941,13 +3976,13 @@ brcmf_configure_wpaie(struct brcmf_if *i /* Check for unicast suite(s) */ if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) { err = -EINVAL; @@ -1195,7 +1195,7 @@ Signed-off-by: Kalle Valo goto exit; } offset += TLV_OUI_LEN; -@@ -3962,7 +3997,7 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -3965,7 +4000,7 @@ brcmf_configure_wpaie(struct brcmf_if *i pval |= AES_ENABLED; break; default: @@ -1204,7 +1204,7 @@ Signed-off-by: Kalle Valo } offset++; } -@@ -3972,13 +4007,13 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -3975,13 +4010,13 @@ brcmf_configure_wpaie(struct brcmf_if *i /* Check for auth key management suite(s) */ if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) { err = -EINVAL; @@ -1220,7 +1220,7 @@ Signed-off-by: Kalle Valo goto exit; } offset += TLV_OUI_LEN; -@@ -4006,7 +4041,7 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -4009,7 +4044,7 @@ brcmf_configure_wpaie(struct brcmf_if *i wpa_auth |= WPA2_AUTH_1X_SHA256; break; default: @@ -1229,7 +1229,7 @@ Signed-off-by: Kalle Valo } offset++; } -@@ -4048,7 +4083,7 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -4051,7 +4086,7 @@ brcmf_configure_wpaie(struct brcmf_if *i err = brcmf_fil_bsscfg_int_set(ifp, "wme_bss_disable", wme_bss_disable); if (err < 0) { @@ -1238,7 +1238,7 @@ Signed-off-by: Kalle Valo goto exit; } -@@ -4062,7 +4097,7 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -4065,7 +4100,7 @@ brcmf_configure_wpaie(struct brcmf_if *i &data[offset], WPA_IE_MIN_OUI_LEN); if (err < 0) { @@ -1247,7 +1247,7 @@ Signed-off-by: Kalle Valo goto exit; } } -@@ -4073,13 +4108,13 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -4076,13 +4111,13 @@ brcmf_configure_wpaie(struct brcmf_if *i /* set auth */ err = brcmf_fil_bsscfg_int_set(ifp, "auth", auth); if (err < 0) { @@ -1263,7 +1263,7 @@ Signed-off-by: Kalle Valo goto exit; } /* Configure MFP, this needs to go after wsec otherwise the wsec command -@@ -4088,14 +4123,14 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -4091,14 +4126,14 @@ brcmf_configure_wpaie(struct brcmf_if *i if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP)) { err = brcmf_fil_bsscfg_int_set(ifp, "mfp", mfp); if (err < 0) { @@ -1280,7 +1280,7 @@ Signed-off-by: Kalle Valo goto exit; } -@@ -4182,6 +4217,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c +@@ -4185,6 +4220,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c const u8 *vndr_ie_buf, u32 vndr_ie_len) { struct brcmf_if *ifp; @@ -1288,7 +1288,7 @@ Signed-off-by: Kalle Valo struct vif_saved_ie *saved_ie; s32 err = 0; u8 *iovar_ie_buf; -@@ -4202,6 +4238,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c +@@ -4205,6 +4241,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c if (!vif) return -ENODEV; ifp = vif->ifp; @@ -1296,7 +1296,7 @@ Signed-off-by: Kalle Valo saved_ie = &vif->saved_ie; brcmf_dbg(TRACE, "bsscfgidx %d, pktflag : 0x%02X\n", ifp->bsscfgidx, -@@ -4233,13 +4270,13 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c +@@ -4236,13 +4273,13 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c break; default: err = -EPERM; @@ -1312,7 +1312,7 @@ Signed-off-by: Kalle Valo goto exit; } -@@ -4300,8 +4337,8 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c +@@ -4303,8 +4340,8 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c /* verify remained buf size before copy data */ if (remained_buf_len < (vndrie_info->vndrie.len + VNDR_IE_VSIE_OFFSET)) { @@ -1323,7 +1323,7 @@ Signed-off-by: Kalle Valo break; } remained_buf_len -= (vndrie_info->ie_len + -@@ -4332,7 +4369,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c +@@ -4335,7 +4372,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c err = brcmf_fil_bsscfg_data_set(ifp, "vndr_ie", iovar_ie_buf, total_ie_buf_len); if (err) @@ -1332,7 +1332,7 @@ Signed-off-by: Kalle Valo } exit: -@@ -4360,13 +4397,14 @@ static s32 +@@ -4363,13 +4400,14 @@ static s32 brcmf_config_ap_mgmt_ie(struct brcmf_cfg80211_vif *vif, struct cfg80211_beacon_data *beacon) { @@ -1348,7 +1348,7 @@ Signed-off-by: Kalle Valo return err; } brcmf_dbg(TRACE, "Applied Vndr IEs for Beacon\n"); -@@ -4376,7 +4414,7 @@ brcmf_config_ap_mgmt_ie(struct brcmf_cfg +@@ -4379,7 +4417,7 @@ brcmf_config_ap_mgmt_ie(struct brcmf_cfg beacon->proberesp_ies, beacon->proberesp_ies_len); if (err) @@ -1357,7 +1357,7 @@ Signed-off-by: Kalle Valo else brcmf_dbg(TRACE, "Applied Vndr IEs for Probe Resp\n"); -@@ -4485,7 +4523,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4488,7 +4526,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, is_11d); if (err < 0) { @@ -1367,7 +1367,7 @@ Signed-off-by: Kalle Valo goto exit; } } -@@ -4493,8 +4532,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4496,8 +4535,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD, settings->beacon_interval); if (err < 0) { @@ -1378,7 +1378,7 @@ Signed-off-by: Kalle Valo goto exit; } } -@@ -4502,7 +4541,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4505,7 +4544,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_DTIMPRD, settings->dtim_period); if (err < 0) { @@ -1388,7 +1388,7 @@ Signed-off-by: Kalle Valo goto exit; } } -@@ -4512,7 +4552,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4515,7 +4555,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi !brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB))) { err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1); if (err < 0) { @@ -1398,7 +1398,7 @@ Signed-off-by: Kalle Valo goto exit; } brcmf_fil_iovar_int_set(ifp, "apsta", 0); -@@ -4520,7 +4561,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4523,7 +4564,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 1); if (err < 0) { @@ -1407,7 +1407,7 @@ Signed-off-by: Kalle Valo goto exit; } } else if (WARN_ON(supports_11d && (is_11d != ifp->vif->is_11d))) { -@@ -4536,7 +4577,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4539,7 +4580,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 1); if (err < 0) { @@ -1417,7 +1417,7 @@ Signed-off-by: Kalle Valo goto exit; } if (!mbss) { -@@ -4545,14 +4587,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4548,14 +4590,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi */ err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec); if (err < 0) { @@ -1435,7 +1435,7 @@ Signed-off-by: Kalle Valo goto exit; } /* On DOWN the firmware removes the WEP keys, reconfigure -@@ -4567,14 +4609,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4570,14 +4612,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID, &join_params, sizeof(join_params)); if (err < 0) { @@ -1452,7 +1452,7 @@ Signed-off-by: Kalle Valo goto exit; } } -@@ -4583,14 +4625,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4586,14 +4628,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi } else if (dev_role == NL80211_IFTYPE_P2P_GO) { err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec); if (err < 0) { @@ -1470,7 +1470,7 @@ Signed-off-by: Kalle Valo goto exit; } bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx); -@@ -4598,7 +4640,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4601,7 +4643,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable, sizeof(bss_enable)); if (err < 0) { @@ -1479,7 +1479,7 @@ Signed-off-by: Kalle Valo goto exit; } -@@ -4646,13 +4688,13 @@ static int brcmf_cfg80211_stop_ap(struct +@@ -4649,13 +4691,13 @@ static int brcmf_cfg80211_stop_ap(struct err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID, &join_params, sizeof(join_params)); if (err < 0) @@ -1496,7 +1496,7 @@ Signed-off-by: Kalle Valo if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) brcmf_fil_iovar_int_set(ifp, "mbss", 0); brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, -@@ -4660,7 +4702,7 @@ static int brcmf_cfg80211_stop_ap(struct +@@ -4663,7 +4705,7 @@ static int brcmf_cfg80211_stop_ap(struct /* Bring device back up so it can be used again */ err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1); if (err < 0) @@ -1505,7 +1505,7 @@ Signed-off-by: Kalle Valo brcmf_vif_clear_mgmt_ies(ifp->vif); } else { -@@ -4669,7 +4711,7 @@ static int brcmf_cfg80211_stop_ap(struct +@@ -4672,7 +4714,7 @@ static int brcmf_cfg80211_stop_ap(struct err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable, sizeof(bss_enable)); if (err < 0) @@ -1514,7 +1514,7 @@ Signed-off-by: Kalle Valo } brcmf_set_mpc(ifp, 1); brcmf_configure_arp_nd_offload(ifp, true); -@@ -4717,7 +4759,8 @@ brcmf_cfg80211_del_station(struct wiphy +@@ -4720,7 +4762,8 @@ brcmf_cfg80211_del_station(struct wiphy err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON, &scbval, sizeof(scbval)); if (err) @@ -1524,7 +1524,7 @@ Signed-off-by: Kalle Valo brcmf_dbg(TRACE, "Exit\n"); return err; -@@ -4747,7 +4790,7 @@ brcmf_cfg80211_change_station(struct wip +@@ -4750,7 +4793,7 @@ brcmf_cfg80211_change_station(struct wip err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SCB_DEAUTHORIZE, (void *)mac, ETH_ALEN); if (err < 0) @@ -1533,7 +1533,7 @@ Signed-off-by: Kalle Valo return err; } -@@ -4797,7 +4840,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip +@@ -4800,7 +4843,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip mgmt = (const struct ieee80211_mgmt *)buf; if (!ieee80211_is_mgmt(mgmt->frame_control)) { @@ -1542,7 +1542,7 @@ Signed-off-by: Kalle Valo return -EPERM; } -@@ -4828,13 +4871,13 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip +@@ -4831,13 +4874,13 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip GFP_KERNEL); } else if (ieee80211_is_action(mgmt->frame_control)) { if (len > BRCMF_FIL_ACTION_FRAME_SIZE + DOT11_MGMT_HDR_LEN) { @@ -1558,7 +1558,7 @@ Signed-off-by: Kalle Valo err = -ENOMEM; goto exit; } -@@ -4892,7 +4935,7 @@ brcmf_cfg80211_cancel_remain_on_channel( +@@ -4895,7 +4938,7 @@ brcmf_cfg80211_cancel_remain_on_channel( vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif; if (vif == NULL) { @@ -1567,7 +1567,7 @@ Signed-off-by: Kalle Valo err = -ENODEV; goto exit; } -@@ -4920,7 +4963,7 @@ static int brcmf_cfg80211_get_channel(st +@@ -4923,7 +4966,7 @@ static int brcmf_cfg80211_get_channel(st err = brcmf_fil_iovar_int_get(ifp, "chanspec", &chanspec); if (err) { @@ -1576,7 +1576,7 @@ Signed-off-by: Kalle Valo return err; } -@@ -5059,7 +5102,7 @@ static int brcmf_cfg80211_tdls_oper(stru +@@ -5062,7 +5105,7 @@ static int brcmf_cfg80211_tdls_oper(stru ret = brcmf_fil_iovar_data_set(ifp, "tdls_endpoint", &info, sizeof(info)); if (ret < 0) @@ -1585,7 +1585,7 @@ Signed-off-by: Kalle Valo return ret; } -@@ -5080,7 +5123,7 @@ brcmf_cfg80211_update_conn_params(struct +@@ -5083,7 +5126,7 @@ brcmf_cfg80211_update_conn_params(struct err = brcmf_vif_set_mgmt_ie(ifp->vif, BRCMF_VNDR_IE_ASSOCREQ_FLAG, sme->ie, sme->ie_len); if (err) @@ -1594,7 +1594,7 @@ Signed-off-by: Kalle Valo else brcmf_dbg(TRACE, "Applied Vndr IEs for Assoc request\n"); -@@ -5106,7 +5149,7 @@ brcmf_cfg80211_set_rekey_data(struct wip +@@ -5109,7 +5152,7 @@ brcmf_cfg80211_set_rekey_data(struct wip ret = brcmf_fil_iovar_data_set(ifp, "gtk_key_info", >k_le, sizeof(gtk_le)); if (ret < 0) @@ -1603,7 +1603,7 @@ Signed-off-by: Kalle Valo return ret; } -@@ -5341,6 +5384,7 @@ static void brcmf_clear_assoc_ies(struct +@@ -5344,6 +5387,7 @@ static void brcmf_clear_assoc_ies(struct static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp) { @@ -1611,7 +1611,7 @@ Signed-off-by: Kalle Valo struct brcmf_cfg80211_assoc_ielen_le *assoc_info; struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg); u32 req_len; -@@ -5352,7 +5396,7 @@ static s32 brcmf_get_assoc_ies(struct br +@@ -5355,7 +5399,7 @@ static s32 brcmf_get_assoc_ies(struct br err = brcmf_fil_iovar_data_get(ifp, "assoc_info", cfg->extra_buf, WL_ASSOC_INFO_MAX); if (err) { @@ -1620,7 +1620,7 @@ Signed-off-by: Kalle Valo return err; } assoc_info = -@@ -5364,7 +5408,7 @@ static s32 brcmf_get_assoc_ies(struct br +@@ -5367,7 +5411,7 @@ static s32 brcmf_get_assoc_ies(struct br cfg->extra_buf, WL_ASSOC_INFO_MAX); if (err) { @@ -1629,7 +1629,7 @@ Signed-off-by: Kalle Valo return err; } conn_info->req_ie_len = req_len; -@@ -5382,7 +5426,7 @@ static s32 brcmf_get_assoc_ies(struct br +@@ -5385,7 +5429,7 @@ static s32 brcmf_get_assoc_ies(struct br cfg->extra_buf, WL_ASSOC_INFO_MAX); if (err) { @@ -1638,7 +1638,7 @@ Signed-off-by: Kalle Valo return err; } conn_info->resp_ie_len = resp_len; -@@ -5511,6 +5555,7 @@ brcmf_notify_connect_status_ap(struct br +@@ -5514,6 +5558,7 @@ brcmf_notify_connect_status_ap(struct br struct net_device *ndev, const struct brcmf_event_msg *e, void *data) { @@ -1646,7 +1646,7 @@ Signed-off-by: Kalle Valo static int generation; u32 event = e->event_code; u32 reason = e->reason; -@@ -5528,7 +5573,7 @@ brcmf_notify_connect_status_ap(struct br +@@ -5531,7 +5576,7 @@ brcmf_notify_connect_status_ap(struct br if (((event == BRCMF_E_ASSOC_IND) || (event == BRCMF_E_REASSOC_IND)) && (reason == BRCMF_E_STATUS_SUCCESS)) { if (!data) { @@ -1655,7 +1655,7 @@ Signed-off-by: Kalle Valo return -EINVAL; } -@@ -5820,6 +5865,7 @@ static void init_vif_event(struct brcmf_ +@@ -5823,6 +5868,7 @@ static void init_vif_event(struct brcmf_ static s32 brcmf_dongle_roam(struct brcmf_if *ifp) { @@ -1663,7 +1663,7 @@ Signed-off-by: Kalle Valo s32 err; u32 bcn_timeout; __le32 roamtrigger[2]; -@@ -5832,7 +5878,7 @@ static s32 brcmf_dongle_roam(struct brcm +@@ -5835,7 +5881,7 @@ static s32 brcmf_dongle_roam(struct brcm bcn_timeout = BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_ON; err = brcmf_fil_iovar_int_set(ifp, "bcn_timeout", bcn_timeout); if (err) { @@ -1672,7 +1672,7 @@ Signed-off-by: Kalle Valo goto roam_setup_done; } -@@ -5844,7 +5890,7 @@ static s32 brcmf_dongle_roam(struct brcm +@@ -5847,7 +5893,7 @@ static s32 brcmf_dongle_roam(struct brcm err = brcmf_fil_iovar_int_set(ifp, "roam_off", ifp->drvr->settings->roamoff); if (err) { @@ -1681,7 +1681,7 @@ Signed-off-by: Kalle Valo goto roam_setup_done; } -@@ -5853,7 +5899,7 @@ static s32 brcmf_dongle_roam(struct brcm +@@ -5856,7 +5902,7 @@ static s32 brcmf_dongle_roam(struct brcm err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER, (void *)roamtrigger, sizeof(roamtrigger)); if (err) { @@ -1690,7 +1690,7 @@ Signed-off-by: Kalle Valo goto roam_setup_done; } -@@ -5862,7 +5908,7 @@ static s32 brcmf_dongle_roam(struct brcm +@@ -5865,7 +5911,7 @@ static s32 brcmf_dongle_roam(struct brcm err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_DELTA, (void *)roam_delta, sizeof(roam_delta)); if (err) { @@ -1699,7 +1699,7 @@ Signed-off-by: Kalle Valo goto roam_setup_done; } -@@ -5873,25 +5919,26 @@ roam_setup_done: +@@ -5876,25 +5922,26 @@ roam_setup_done: static s32 brcmf_dongle_scantime(struct brcmf_if *ifp) { @@ -1729,7 +1729,7 @@ Signed-off-by: Kalle Valo goto dongle_scantime_out; } -@@ -5923,10 +5970,10 @@ static void brcmf_update_bw40_channel_fl +@@ -5926,10 +5973,10 @@ static void brcmf_update_bw40_channel_fl static int brcmf_construct_chaninfo(struct brcmf_cfg80211_info *cfg, u32 bw_cap[]) { @@ -1741,7 +1741,7 @@ Signed-off-by: Kalle Valo struct brcmf_chanspec_list *list; struct brcmu_chan ch; int err; -@@ -5945,11 +5992,10 @@ static int brcmf_construct_chaninfo(stru +@@ -5948,11 +5995,10 @@ static int brcmf_construct_chaninfo(stru err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf, BRCMF_DCMD_MEDLEN); if (err) { @@ -1754,7 +1754,7 @@ Signed-off-by: Kalle Valo band = wiphy->bands[NL80211_BAND_2GHZ]; if (band) for (i = 0; i < band->n_channels; i++) -@@ -5969,7 +6015,8 @@ static int brcmf_construct_chaninfo(stru +@@ -5972,7 +6018,8 @@ static int brcmf_construct_chaninfo(stru } else if (ch.band == BRCMU_CHAN_BAND_5G) { band = wiphy->bands[NL80211_BAND_5GHZ]; } else { @@ -1764,7 +1764,7 @@ Signed-off-by: Kalle Valo continue; } if (!band) -@@ -5992,8 +6039,8 @@ static int brcmf_construct_chaninfo(stru +@@ -5995,8 +6042,8 @@ static int brcmf_construct_chaninfo(stru /* It seems firmware supports some channel we never * considered. Something new in IEEE standard? */ @@ -1775,7 +1775,7 @@ Signed-off-by: Kalle Valo continue; } -@@ -6039,6 +6086,7 @@ fail_pbuf: +@@ -6042,6 +6089,7 @@ fail_pbuf: static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg) { @@ -1783,7 +1783,7 @@ Signed-off-by: Kalle Valo struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0); struct ieee80211_supported_band *band; struct brcmf_fil_bwcap_le band_bwcap; -@@ -6085,7 +6133,7 @@ static int brcmf_enable_bw40_2g(struct b +@@ -6088,7 +6136,7 @@ static int brcmf_enable_bw40_2g(struct b err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf, BRCMF_DCMD_MEDLEN); if (err) { @@ -1792,7 +1792,7 @@ Signed-off-by: Kalle Valo kfree(pbuf); return err; } -@@ -6116,6 +6164,7 @@ static int brcmf_enable_bw40_2g(struct b +@@ -6119,6 +6167,7 @@ static int brcmf_enable_bw40_2g(struct b static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[]) { @@ -1800,7 +1800,7 @@ Signed-off-by: Kalle Valo u32 band, mimo_bwcap; int err; -@@ -6151,7 +6200,7 @@ static void brcmf_get_bwcap(struct brcmf +@@ -6154,7 +6203,7 @@ static void brcmf_get_bwcap(struct brcmf bw_cap[NL80211_BAND_5GHZ] |= WLC_BW_20MHZ_BIT; break; default: @@ -1809,7 +1809,7 @@ Signed-off-by: Kalle Valo } } -@@ -6227,7 +6276,7 @@ static void brcmf_update_vht_cap(struct +@@ -6230,7 +6279,7 @@ static void brcmf_update_vht_cap(struct static int brcmf_setup_wiphybands(struct brcmf_cfg80211_info *cfg) { struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0); @@ -1818,7 +1818,7 @@ Signed-off-by: Kalle Valo u32 nmode = 0; u32 vhtmode = 0; u32 bw_cap[2] = { WLC_BW_20MHZ_BIT, WLC_BW_20MHZ_BIT }; -@@ -6243,7 +6292,7 @@ static int brcmf_setup_wiphybands(struct +@@ -6246,7 +6295,7 @@ static int brcmf_setup_wiphybands(struct (void)brcmf_fil_iovar_int_get(ifp, "vhtmode", &vhtmode); err = brcmf_fil_iovar_int_get(ifp, "nmode", &nmode); if (err) { @@ -1827,7 +1827,7 @@ Signed-off-by: Kalle Valo } else { brcmf_get_bwcap(ifp, bw_cap); } -@@ -6253,7 +6302,7 @@ static int brcmf_setup_wiphybands(struct +@@ -6256,7 +6305,7 @@ static int brcmf_setup_wiphybands(struct err = brcmf_fil_iovar_int_get(ifp, "rxchain", &rxchain); if (err) { @@ -1836,7 +1836,7 @@ Signed-off-by: Kalle Valo nchain = 1; } else { for (nchain = 0; rxchain; nchain++) -@@ -6263,7 +6312,7 @@ static int brcmf_setup_wiphybands(struct +@@ -6266,7 +6315,7 @@ static int brcmf_setup_wiphybands(struct err = brcmf_construct_chaninfo(cfg, bw_cap); if (err) { @@ -1845,7 +1845,7 @@ Signed-off-by: Kalle Valo return err; } -@@ -6275,7 +6324,6 @@ static int brcmf_setup_wiphybands(struct +@@ -6278,7 +6327,6 @@ static int brcmf_setup_wiphybands(struct &txbf_bfr_cap); } @@ -1853,7 +1853,7 @@ Signed-off-by: Kalle Valo for (i = 0; i < ARRAY_SIZE(wiphy->bands); i++) { band = wiphy->bands[i]; if (band == NULL) -@@ -6476,7 +6524,7 @@ static void brcmf_wiphy_wowl_params(stru +@@ -6479,7 +6527,7 @@ static void brcmf_wiphy_wowl_params(stru wowl = kmemdup(&brcmf_wowlan_support, sizeof(brcmf_wowlan_support), GFP_KERNEL); if (!wowl) { @@ -1862,7 +1862,7 @@ Signed-off-by: Kalle Valo wiphy->wowlan = &brcmf_wowlan_support; return; } -@@ -6573,7 +6621,7 @@ static int brcmf_setup_wiphy(struct wiph +@@ -6576,7 +6624,7 @@ static int brcmf_setup_wiphy(struct wiph err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BANDLIST, &bandlist, sizeof(bandlist)); if (err) { @@ -1871,7 +1871,7 @@ Signed-off-by: Kalle Valo return err; } /* first entry in bandlist is number of bands */ -@@ -6622,6 +6670,7 @@ static int brcmf_setup_wiphy(struct wiph +@@ -6625,6 +6673,7 @@ static int brcmf_setup_wiphy(struct wiph static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg) { @@ -1879,7 +1879,7 @@ Signed-off-by: Kalle Valo struct net_device *ndev; struct wireless_dev *wdev; struct brcmf_if *ifp; -@@ -6659,7 +6708,7 @@ static s32 brcmf_config_dongle(struct br +@@ -6662,7 +6711,7 @@ static s32 brcmf_config_dongle(struct br err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_FAKEFRAG, 1); if (err) { @@ -1888,7 +1888,7 @@ Signed-off-by: Kalle Valo goto default_conf_out; } -@@ -6851,8 +6900,8 @@ static void brcmf_cfg80211_reg_notifier( +@@ -6854,8 +6903,8 @@ static void brcmf_cfg80211_reg_notifier( /* ignore non-ISO3166 country codes */ for (i = 0; i < 2; i++) if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') { @@ -1899,7 +1899,7 @@ Signed-off-by: Kalle Valo return; } -@@ -6861,7 +6910,7 @@ static void brcmf_cfg80211_reg_notifier( +@@ -6864,7 +6913,7 @@ static void brcmf_cfg80211_reg_notifier( err = brcmf_fil_iovar_data_get(ifp, "country", &ccreq, sizeof(ccreq)); if (err) { @@ -1908,7 +1908,7 @@ Signed-off-by: Kalle Valo return; } -@@ -6871,7 +6920,7 @@ static void brcmf_cfg80211_reg_notifier( +@@ -6874,7 +6923,7 @@ static void brcmf_cfg80211_reg_notifier( err = brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq)); if (err) { @@ -1917,7 +1917,7 @@ Signed-off-by: Kalle Valo return; } brcmf_setup_wiphybands(cfg); -@@ -6917,13 +6966,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +@@ -6920,13 +6969,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802 u16 *cap = NULL; if (!ndev) { @@ -1933,7 +1933,7 @@ Signed-off-by: Kalle Valo return NULL; } -@@ -6944,7 +6993,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +@@ -6947,7 +6996,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 err = wl_init_priv(cfg); if (err) { @@ -1942,7 +1942,7 @@ Signed-off-by: Kalle Valo brcmf_free_vif(vif); goto wiphy_out; } -@@ -6953,7 +7002,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +@@ -6956,7 +7005,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 /* determine d11 io type before wiphy setup */ err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_VERSION, &io_type); if (err) { @@ -1951,7 +1951,7 @@ Signed-off-by: Kalle Valo goto priv_out; } cfg->d11inf.io_type = (u8)io_type; -@@ -6987,13 +7036,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +@@ -6990,13 +7039,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802 #endif err = wiphy_register(wiphy); if (err < 0) { @@ -1967,7 +1967,7 @@ Signed-off-by: Kalle Valo goto wiphy_unreg_out; } -@@ -7011,24 +7060,24 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +@@ -7014,24 +7063,24 @@ struct brcmf_cfg80211_info *brcmf_cfg802 err = brcmf_fweh_activate_events(ifp); if (err) { @@ -1996,7 +1996,7 @@ Signed-off-by: Kalle Valo brcmf_btcoex_detach(cfg); brcmf_p2p_detach(&cfg->p2p); goto wiphy_unreg_out; -@@ -7048,7 +7097,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +@@ -7051,7 +7100,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 /* (re-) activate FWEH event handling */ err = brcmf_fweh_activate_events(ifp); if (err) { diff --git a/package/kernel/mac80211/patches/brcm/351-v5.1-0001-brcmfmac-improve-code-handling-bandwidth-of-firmware.patch b/package/kernel/mac80211/patches/brcm/351-v5.1-0001-brcmfmac-improve-code-handling-bandwidth-of-firmware.patch index 4433313b60..6219e24dc4 100644 --- a/package/kernel/mac80211/patches/brcm/351-v5.1-0001-brcmfmac-improve-code-handling-bandwidth-of-firmware.patch +++ b/package/kernel/mac80211/patches/brcm/351-v5.1-0001-brcmfmac-improve-code-handling-bandwidth-of-firmware.patch @@ -18,7 +18,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -6050,11 +6050,18 @@ static int brcmf_construct_chaninfo(stru +@@ -6053,11 +6053,18 @@ static int brcmf_construct_chaninfo(stru /* assuming the chanspecs order is HT20, * HT40 upper, HT40 lower, and VHT80. */ diff --git a/package/kernel/mac80211/patches/brcm/351-v5.1-0002-brcmfmac-support-firmware-reporting-160-MHz-channels.patch b/package/kernel/mac80211/patches/brcm/351-v5.1-0002-brcmfmac-support-firmware-reporting-160-MHz-channels.patch index 20ff9b8b47..f2af11910c 100644 --- a/package/kernel/mac80211/patches/brcm/351-v5.1-0002-brcmfmac-support-firmware-reporting-160-MHz-channels.patch +++ b/package/kernel/mac80211/patches/brcm/351-v5.1-0002-brcmfmac-support-firmware-reporting-160-MHz-channels.patch @@ -18,7 +18,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -6051,6 +6051,9 @@ static int brcmf_construct_chaninfo(stru +@@ -6054,6 +6054,9 @@ static int brcmf_construct_chaninfo(stru * HT40 upper, HT40 lower, and VHT80. */ switch (ch.bw) { diff --git a/package/kernel/mac80211/patches/brcm/352-v5.1-brcmfmac-rework-bphy_err-to-take-struct-brcmf_pub-ar.patch b/package/kernel/mac80211/patches/brcm/352-v5.1-brcmfmac-rework-bphy_err-to-take-struct-brcmf_pub-ar.patch index 79266778d3..3ff0f74ede 100644 --- a/package/kernel/mac80211/patches/brcm/352-v5.1-brcmfmac-rework-bphy_err-to-take-struct-brcmf_pub-ar.patch +++ b/package/kernel/mac80211/patches/brcm/352-v5.1-brcmfmac-rework-bphy_err-to-take-struct-brcmf_pub-ar.patch @@ -946,7 +946,7 @@ Signed-off-by: Kalle Valo struct brcmf_scb_val_le scb_val; s32 err = 0; struct brcmf_sta_info_le sta_info_le; -@@ -2592,7 +2612,7 @@ brcmf_cfg80211_get_station(struct wiphy +@@ -2593,7 +2613,7 @@ brcmf_cfg80211_get_station(struct wiphy &sta_info_le, sizeof(sta_info_le)); if (err < 0) { @@ -955,7 +955,7 @@ Signed-off-by: Kalle Valo goto done; } } -@@ -2661,7 +2681,7 @@ brcmf_cfg80211_get_station(struct wiphy +@@ -2664,7 +2684,7 @@ brcmf_cfg80211_get_station(struct wiphy err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_RSSI, &scb_val, sizeof(scb_val)); if (err) { @@ -964,7 +964,7 @@ Signed-off-by: Kalle Valo err); goto done; } else { -@@ -2683,6 +2703,7 @@ brcmf_cfg80211_dump_station(struct wiphy +@@ -2686,6 +2706,7 @@ brcmf_cfg80211_dump_station(struct wiphy { struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct brcmf_if *ifp = netdev_priv(ndev); @@ -972,7 +972,7 @@ Signed-off-by: Kalle Valo s32 err; brcmf_dbg(TRACE, "Enter, idx %d\n", idx); -@@ -2693,7 +2714,7 @@ brcmf_cfg80211_dump_station(struct wiphy +@@ -2696,7 +2717,7 @@ brcmf_cfg80211_dump_station(struct wiphy &cfg->assoclist, sizeof(cfg->assoclist)); if (err) { @@ -981,7 +981,7 @@ Signed-off-by: Kalle Valo err); cfg->assoclist.count = 0; return -EOPNOTSUPP; -@@ -2714,6 +2735,7 @@ brcmf_cfg80211_set_power_mgmt(struct wip +@@ -2717,6 +2738,7 @@ brcmf_cfg80211_set_power_mgmt(struct wip s32 err = 0; struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct brcmf_if *ifp = netdev_priv(ndev); @@ -989,7 +989,7 @@ Signed-off-by: Kalle Valo brcmf_dbg(TRACE, "Enter\n"); -@@ -2742,9 +2764,9 @@ brcmf_cfg80211_set_power_mgmt(struct wip +@@ -2745,9 +2767,9 @@ brcmf_cfg80211_set_power_mgmt(struct wip err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, pm); if (err) { if (err == -ENODEV) @@ -1001,7 +1001,7 @@ Signed-off-by: Kalle Valo } done: brcmf_dbg(TRACE, "Exit\n"); -@@ -2755,6 +2777,7 @@ static s32 brcmf_inform_single_bss(struc +@@ -2758,6 +2780,7 @@ static s32 brcmf_inform_single_bss(struc struct brcmf_bss_info_le *bi) { struct wiphy *wiphy = cfg_to_wiphy(cfg); @@ -1009,7 +1009,7 @@ Signed-off-by: Kalle Valo struct cfg80211_bss *bss; enum nl80211_band band; struct brcmu_chan ch; -@@ -2767,7 +2790,7 @@ static s32 brcmf_inform_single_bss(struc +@@ -2770,7 +2793,7 @@ static s32 brcmf_inform_single_bss(struc struct cfg80211_inform_bss bss_data = {}; if (le32_to_cpu(bi->length) > WL_BSS_INFO_MAX) { @@ -1018,7 +1018,7 @@ Signed-off-by: Kalle Valo return 0; } -@@ -2826,7 +2849,7 @@ next_bss_le(struct brcmf_scan_results *l +@@ -2829,7 +2852,7 @@ next_bss_le(struct brcmf_scan_results *l static s32 brcmf_inform_bss(struct brcmf_cfg80211_info *cfg) { @@ -1027,7 +1027,7 @@ Signed-off-by: Kalle Valo struct brcmf_scan_results *bss_list; struct brcmf_bss_info_le *bi = NULL; /* must be initialized */ s32 err = 0; -@@ -2835,7 +2858,7 @@ static s32 brcmf_inform_bss(struct brcmf +@@ -2838,7 +2861,7 @@ static s32 brcmf_inform_bss(struct brcmf bss_list = (struct brcmf_scan_results *)cfg->escan_info.escan_buf; if (bss_list->count != 0 && bss_list->version != BRCMF_BSS_INFO_VERSION) { @@ -1036,7 +1036,7 @@ Signed-off-by: Kalle Valo bss_list->version); return -EOPNOTSUPP; } -@@ -2853,6 +2876,7 @@ static s32 brcmf_inform_ibss(struct brcm +@@ -2856,6 +2879,7 @@ static s32 brcmf_inform_ibss(struct brcm struct net_device *ndev, const u8 *bssid) { struct wiphy *wiphy = cfg_to_wiphy(cfg); @@ -1044,7 +1044,7 @@ Signed-off-by: Kalle Valo struct ieee80211_channel *notify_channel; struct brcmf_bss_info_le *bi = NULL; struct ieee80211_supported_band *band; -@@ -2880,7 +2904,7 @@ static s32 brcmf_inform_ibss(struct brcm +@@ -2883,7 +2907,7 @@ static s32 brcmf_inform_ibss(struct brcm err = brcmf_fil_cmd_data_get(netdev_priv(ndev), BRCMF_C_GET_BSS_INFO, buf, WL_BSS_INFO_MAX); if (err) { @@ -1053,7 +1053,7 @@ Signed-off-by: Kalle Valo goto CleanUp; } -@@ -2934,7 +2958,7 @@ CleanUp: +@@ -2937,7 +2961,7 @@ CleanUp: static s32 brcmf_update_bss_info(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp) { @@ -1062,7 +1062,7 @@ Signed-off-by: Kalle Valo struct brcmf_bss_info_le *bi; const struct brcmf_tlv *tim; u16 beacon_interval; -@@ -2951,7 +2975,7 @@ static s32 brcmf_update_bss_info(struct +@@ -2954,7 +2978,7 @@ static s32 brcmf_update_bss_info(struct err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, cfg->extra_buf, WL_EXTRA_BUF_MAX); if (err) { @@ -1071,7 +1071,7 @@ Signed-off-by: Kalle Valo goto update_bss_info_out; } -@@ -2976,7 +3000,7 @@ static s32 brcmf_update_bss_info(struct +@@ -2979,7 +3003,7 @@ static s32 brcmf_update_bss_info(struct u32 var; err = brcmf_fil_iovar_int_get(ifp, "dtim_assoc", &var); if (err) { @@ -1080,7 +1080,7 @@ Signed-off-by: Kalle Valo goto update_bss_info_out; } dtim_period = (u8)var; -@@ -3014,10 +3038,10 @@ static void brcmf_escan_timeout(struct t +@@ -3017,10 +3041,10 @@ static void brcmf_escan_timeout(struct t { struct brcmf_cfg80211_info *cfg = from_timer(cfg, t, escan_timeout); @@ -1093,7 +1093,7 @@ Signed-off-by: Kalle Valo schedule_work(&cfg->escan_timeout_work); } } -@@ -3065,8 +3089,8 @@ static s32 +@@ -3068,8 +3092,8 @@ static s32 brcmf_cfg80211_escan_handler(struct brcmf_if *ifp, const struct brcmf_event_msg *e, void *data) { @@ -1104,7 +1104,7 @@ Signed-off-by: Kalle Valo s32 status; struct brcmf_escan_result_le *escan_result_le; u32 escan_buflen; -@@ -3083,7 +3107,7 @@ brcmf_cfg80211_escan_handler(struct brcm +@@ -3086,7 +3110,7 @@ brcmf_cfg80211_escan_handler(struct brcm goto exit; if (!test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) { @@ -1113,7 +1113,7 @@ Signed-off-by: Kalle Valo ifp->bsscfgidx); return -EPERM; } -@@ -3091,24 +3115,24 @@ brcmf_cfg80211_escan_handler(struct brcm +@@ -3094,24 +3118,24 @@ brcmf_cfg80211_escan_handler(struct brcm if (status == BRCMF_E_STATUS_PARTIAL) { brcmf_dbg(SCAN, "ESCAN Partial result\n"); if (e->datalen < sizeof(*escan_result_le)) { @@ -1142,7 +1142,7 @@ Signed-off-by: Kalle Valo escan_result_le->bss_count); goto exit; } -@@ -3124,7 +3148,7 @@ brcmf_cfg80211_escan_handler(struct brcm +@@ -3127,7 +3151,7 @@ brcmf_cfg80211_escan_handler(struct brcm bi_length = le32_to_cpu(bss_info_le->length); if (bi_length != escan_buflen - WL_ESCAN_RESULTS_FIXED_SIZE) { @@ -1151,7 +1151,7 @@ Signed-off-by: Kalle Valo bi_length); goto exit; } -@@ -3133,7 +3157,7 @@ brcmf_cfg80211_escan_handler(struct brcm +@@ -3136,7 +3160,7 @@ brcmf_cfg80211_escan_handler(struct brcm BIT(NL80211_IFTYPE_ADHOC))) { if (le16_to_cpu(bss_info_le->capability) & WLAN_CAPABILITY_IBSS) { @@ -1160,7 +1160,7 @@ Signed-off-by: Kalle Valo goto exit; } } -@@ -3141,7 +3165,7 @@ brcmf_cfg80211_escan_handler(struct brcm +@@ -3144,7 +3168,7 @@ brcmf_cfg80211_escan_handler(struct brcm list = (struct brcmf_scan_results *) cfg->escan_info.escan_buf; if (bi_length > BRCMF_ESCAN_BUF_SIZE - list->buflen) { @@ -1169,7 +1169,7 @@ Signed-off-by: Kalle Valo goto exit; } -@@ -3300,7 +3324,8 @@ static s32 +@@ -3303,7 +3327,8 @@ static s32 brcmf_notify_sched_scan_results(struct brcmf_if *ifp, const struct brcmf_event_msg *e, void *data) { @@ -1179,7 +1179,7 @@ Signed-off-by: Kalle Valo struct brcmf_pno_net_info_le *netinfo, *netinfo_start; struct cfg80211_scan_request *request = NULL; struct wiphy *wiphy = cfg_to_wiphy(cfg); -@@ -3333,14 +3358,14 @@ brcmf_notify_sched_scan_results(struct b +@@ -3336,14 +3361,14 @@ brcmf_notify_sched_scan_results(struct b WARN_ON(status != BRCMF_PNO_SCAN_COMPLETE); brcmf_dbg(SCAN, "PFN NET FOUND event. count: %d\n", result_count); if (!result_count) { @@ -1196,7 +1196,7 @@ Signed-off-by: Kalle Valo goto out_err; } -@@ -3387,14 +3412,15 @@ brcmf_cfg80211_sched_scan_start(struct w +@@ -3390,14 +3415,15 @@ brcmf_cfg80211_sched_scan_start(struct w struct net_device *ndev, struct cfg80211_sched_scan_request *req) { @@ -1214,7 +1214,7 @@ Signed-off-by: Kalle Valo cfg->scan_status); return -EAGAIN; } -@@ -3473,8 +3499,8 @@ static s32 +@@ -3476,8 +3502,8 @@ static s32 brcmf_wowl_nd_results(struct brcmf_if *ifp, const struct brcmf_event_msg *e, void *data) { @@ -1225,7 +1225,7 @@ Signed-off-by: Kalle Valo struct brcmf_pno_scanresults_le *pfn_result; struct brcmf_pno_net_info_le *netinfo; -@@ -3493,7 +3519,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i +@@ -3496,7 +3522,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i } if (le32_to_cpu(pfn_result->count) < 1) { @@ -1234,7 +1234,7 @@ Signed-off-by: Kalle Valo le32_to_cpu(pfn_result->count)); return -EINVAL; } -@@ -3523,6 +3549,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i +@@ -3526,6 +3552,7 @@ brcmf_wowl_nd_results(struct brcmf_if *i static void brcmf_report_wowl_wakeind(struct wiphy *wiphy, struct brcmf_if *ifp) { struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); @@ -1242,7 +1242,7 @@ Signed-off-by: Kalle Valo struct brcmf_wowl_wakeind_le wake_ind_le; struct cfg80211_wowlan_wakeup wakeup_data; struct cfg80211_wowlan_wakeup *wakeup; -@@ -3533,7 +3560,7 @@ static void brcmf_report_wowl_wakeind(st +@@ -3536,7 +3563,7 @@ static void brcmf_report_wowl_wakeind(st err = brcmf_fil_iovar_data_get(ifp, "wowl_wakeind", &wake_ind_le, sizeof(wake_ind_le)); if (err) { @@ -1251,7 +1251,7 @@ Signed-off-by: Kalle Valo return; } -@@ -3574,7 +3601,7 @@ static void brcmf_report_wowl_wakeind(st +@@ -3577,7 +3604,7 @@ static void brcmf_report_wowl_wakeind(st cfg->wowl.nd_data_completed, BRCMF_ND_INFO_TIMEOUT); if (!timeout) @@ -1260,7 +1260,7 @@ Signed-off-by: Kalle Valo else wakeup_data.net_detect = cfg->wowl.nd_info; } -@@ -3763,6 +3790,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w +@@ -3766,6 +3793,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct brcmf_if *ifp = netdev_priv(ndev); struct brcmf_pmksa *pmk = &cfg->pmk_list.pmk[0]; @@ -1268,7 +1268,7 @@ Signed-off-by: Kalle Valo s32 err; u32 npmk, i; -@@ -3782,7 +3810,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w +@@ -3785,7 +3813,7 @@ brcmf_cfg80211_set_pmksa(struct wiphy *w cfg->pmk_list.npmk = cpu_to_le32(npmk); } } else { @@ -1277,7 +1277,7 @@ Signed-off-by: Kalle Valo return -EINVAL; } -@@ -3805,6 +3833,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w +@@ -3808,6 +3836,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct brcmf_if *ifp = netdev_priv(ndev); struct brcmf_pmksa *pmk = &cfg->pmk_list.pmk[0]; @@ -1285,7 +1285,7 @@ Signed-off-by: Kalle Valo s32 err; u32 npmk, i; -@@ -3828,7 +3857,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w +@@ -3831,7 +3860,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w memset(&pmk[i], 0, sizeof(*pmk)); cfg->pmk_list.npmk = cpu_to_le32(npmk - 1); } else { @@ -1294,7 +1294,7 @@ Signed-off-by: Kalle Valo return -EINVAL; } -@@ -3860,20 +3889,20 @@ brcmf_cfg80211_flush_pmksa(struct wiphy +@@ -3863,20 +3892,20 @@ brcmf_cfg80211_flush_pmksa(struct wiphy static s32 brcmf_configure_opensecurity(struct brcmf_if *ifp) { @@ -1318,7 +1318,7 @@ Signed-off-by: Kalle Valo return err; } /* set upper-layer auth */ -@@ -3883,7 +3912,7 @@ static s32 brcmf_configure_opensecurity( +@@ -3886,7 +3915,7 @@ static s32 brcmf_configure_opensecurity( wpa_val = WPA_AUTH_DISABLED; err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_val); if (err < 0) { @@ -1327,7 +1327,7 @@ Signed-off-by: Kalle Valo return err; } -@@ -3903,7 +3932,7 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -3906,7 +3935,7 @@ brcmf_configure_wpaie(struct brcmf_if *i const struct brcmf_vs_tlv *wpa_ie, bool is_rsn_ie) { @@ -1336,7 +1336,7 @@ Signed-off-by: Kalle Valo u32 auth = 0; /* d11 open authentication */ u16 count; s32 err = 0; -@@ -3934,13 +3963,13 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -3937,13 +3966,13 @@ brcmf_configure_wpaie(struct brcmf_if *i /* check for multicast cipher suite */ if (offset + WPA_IE_MIN_OUI_LEN > len) { err = -EINVAL; @@ -1352,7 +1352,7 @@ Signed-off-by: Kalle Valo goto exit; } offset += TLV_OUI_LEN; -@@ -3962,7 +3991,7 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -3965,7 +3994,7 @@ brcmf_configure_wpaie(struct brcmf_if *i break; default: err = -EINVAL; @@ -1361,7 +1361,7 @@ Signed-off-by: Kalle Valo goto exit; } -@@ -3973,13 +4002,13 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -3976,13 +4005,13 @@ brcmf_configure_wpaie(struct brcmf_if *i /* Check for unicast suite(s) */ if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) { err = -EINVAL; @@ -1377,7 +1377,7 @@ Signed-off-by: Kalle Valo goto exit; } offset += TLV_OUI_LEN; -@@ -3997,7 +4026,7 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -4000,7 +4029,7 @@ brcmf_configure_wpaie(struct brcmf_if *i pval |= AES_ENABLED; break; default: @@ -1386,7 +1386,7 @@ Signed-off-by: Kalle Valo } offset++; } -@@ -4007,13 +4036,13 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -4010,13 +4039,13 @@ brcmf_configure_wpaie(struct brcmf_if *i /* Check for auth key management suite(s) */ if (offset + (WPA_IE_MIN_OUI_LEN * count) > len) { err = -EINVAL; @@ -1402,7 +1402,7 @@ Signed-off-by: Kalle Valo goto exit; } offset += TLV_OUI_LEN; -@@ -4041,7 +4070,7 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -4044,7 +4073,7 @@ brcmf_configure_wpaie(struct brcmf_if *i wpa_auth |= WPA2_AUTH_1X_SHA256; break; default: @@ -1411,7 +1411,7 @@ Signed-off-by: Kalle Valo } offset++; } -@@ -4083,7 +4112,7 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -4086,7 +4115,7 @@ brcmf_configure_wpaie(struct brcmf_if *i err = brcmf_fil_bsscfg_int_set(ifp, "wme_bss_disable", wme_bss_disable); if (err < 0) { @@ -1420,7 +1420,7 @@ Signed-off-by: Kalle Valo goto exit; } -@@ -4097,7 +4126,7 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -4100,7 +4129,7 @@ brcmf_configure_wpaie(struct brcmf_if *i &data[offset], WPA_IE_MIN_OUI_LEN); if (err < 0) { @@ -1429,7 +1429,7 @@ Signed-off-by: Kalle Valo goto exit; } } -@@ -4108,13 +4137,13 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -4111,13 +4140,13 @@ brcmf_configure_wpaie(struct brcmf_if *i /* set auth */ err = brcmf_fil_bsscfg_int_set(ifp, "auth", auth); if (err < 0) { @@ -1445,7 +1445,7 @@ Signed-off-by: Kalle Valo goto exit; } /* Configure MFP, this needs to go after wsec otherwise the wsec command -@@ -4123,14 +4152,14 @@ brcmf_configure_wpaie(struct brcmf_if *i +@@ -4126,14 +4155,14 @@ brcmf_configure_wpaie(struct brcmf_if *i if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP)) { err = brcmf_fil_bsscfg_int_set(ifp, "mfp", mfp); if (err < 0) { @@ -1462,7 +1462,7 @@ Signed-off-by: Kalle Valo goto exit; } -@@ -4216,8 +4245,8 @@ brcmf_vndr_ie(u8 *iebuf, s32 pktflag, u8 +@@ -4219,8 +4248,8 @@ brcmf_vndr_ie(u8 *iebuf, s32 pktflag, u8 s32 brcmf_vif_set_mgmt_ie(struct brcmf_cfg80211_vif *vif, s32 pktflag, const u8 *vndr_ie_buf, u32 vndr_ie_len) { @@ -1472,7 +1472,7 @@ Signed-off-by: Kalle Valo struct vif_saved_ie *saved_ie; s32 err = 0; u8 *iovar_ie_buf; -@@ -4238,7 +4267,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c +@@ -4241,7 +4270,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c if (!vif) return -ENODEV; ifp = vif->ifp; @@ -1481,7 +1481,7 @@ Signed-off-by: Kalle Valo saved_ie = &vif->saved_ie; brcmf_dbg(TRACE, "bsscfgidx %d, pktflag : 0x%02X\n", ifp->bsscfgidx, -@@ -4270,13 +4299,13 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c +@@ -4273,13 +4302,13 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c break; default: err = -EPERM; @@ -1497,7 +1497,7 @@ Signed-off-by: Kalle Valo goto exit; } -@@ -4337,7 +4366,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c +@@ -4340,7 +4369,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c /* verify remained buf size before copy data */ if (remained_buf_len < (vndrie_info->vndrie.len + VNDR_IE_VSIE_OFFSET)) { @@ -1506,7 +1506,7 @@ Signed-off-by: Kalle Valo remained_buf_len); break; } -@@ -4369,7 +4398,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c +@@ -4372,7 +4401,7 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c err = brcmf_fil_bsscfg_data_set(ifp, "vndr_ie", iovar_ie_buf, total_ie_buf_len); if (err) @@ -1515,7 +1515,7 @@ Signed-off-by: Kalle Valo } exit: -@@ -4397,14 +4426,14 @@ static s32 +@@ -4400,14 +4429,14 @@ static s32 brcmf_config_ap_mgmt_ie(struct brcmf_cfg80211_vif *vif, struct cfg80211_beacon_data *beacon) { @@ -1532,7 +1532,7 @@ Signed-off-by: Kalle Valo return err; } brcmf_dbg(TRACE, "Applied Vndr IEs for Beacon\n"); -@@ -4414,7 +4443,7 @@ brcmf_config_ap_mgmt_ie(struct brcmf_cfg +@@ -4417,7 +4446,7 @@ brcmf_config_ap_mgmt_ie(struct brcmf_cfg beacon->proberesp_ies, beacon->proberesp_ies_len); if (err) @@ -1541,7 +1541,7 @@ Signed-off-by: Kalle Valo else brcmf_dbg(TRACE, "Applied Vndr IEs for Probe Resp\n"); -@@ -4428,6 +4457,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4431,6 +4460,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi s32 ie_offset; struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct brcmf_if *ifp = netdev_priv(ndev); @@ -1549,7 +1549,7 @@ Signed-off-by: Kalle Valo const struct brcmf_tlv *ssid_ie; const struct brcmf_tlv *country_ie; struct brcmf_ssid_le ssid_le; -@@ -4523,7 +4553,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4526,7 +4556,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, is_11d); if (err < 0) { @@ -1558,7 +1558,7 @@ Signed-off-by: Kalle Valo err); goto exit; } -@@ -4532,7 +4562,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4535,7 +4565,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD, settings->beacon_interval); if (err < 0) { @@ -1567,7 +1567,7 @@ Signed-off-by: Kalle Valo err); goto exit; } -@@ -4541,7 +4571,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4544,7 +4574,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_DTIMPRD, settings->dtim_period); if (err < 0) { @@ -1576,7 +1576,7 @@ Signed-off-by: Kalle Valo err); goto exit; } -@@ -4552,7 +4582,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4555,7 +4585,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi !brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB))) { err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1); if (err < 0) { @@ -1585,7 +1585,7 @@ Signed-off-by: Kalle Valo err); goto exit; } -@@ -4561,7 +4591,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4564,7 +4594,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 1); if (err < 0) { @@ -1594,7 +1594,7 @@ Signed-off-by: Kalle Valo goto exit; } } else if (WARN_ON(supports_11d && (is_11d != ifp->vif->is_11d))) { -@@ -4577,7 +4607,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4580,7 +4610,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 1); if (err < 0) { @@ -1603,7 +1603,7 @@ Signed-off-by: Kalle Valo err); goto exit; } -@@ -4587,14 +4617,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4590,14 +4620,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi */ err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec); if (err < 0) { @@ -1620,7 +1620,7 @@ Signed-off-by: Kalle Valo goto exit; } /* On DOWN the firmware removes the WEP keys, reconfigure -@@ -4609,14 +4639,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4612,14 +4642,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID, &join_params, sizeof(join_params)); if (err < 0) { @@ -1637,7 +1637,7 @@ Signed-off-by: Kalle Valo goto exit; } } -@@ -4625,14 +4655,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4628,14 +4658,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wi } else if (dev_role == NL80211_IFTYPE_P2P_GO) { err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec); if (err < 0) { @@ -1654,7 +1654,7 @@ Signed-off-by: Kalle Valo goto exit; } bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx); -@@ -4640,7 +4670,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +@@ -4643,7 +4673,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable, sizeof(bss_enable)); if (err < 0) { @@ -1663,7 +1663,7 @@ Signed-off-by: Kalle Valo goto exit; } -@@ -4663,7 +4693,9 @@ exit: +@@ -4666,7 +4696,9 @@ exit: static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) { @@ -1673,7 +1673,7 @@ Signed-off-by: Kalle Valo s32 err; struct brcmf_fil_bss_enable_le bss_enable; struct brcmf_join_params join_params; -@@ -4688,13 +4720,13 @@ static int brcmf_cfg80211_stop_ap(struct +@@ -4691,13 +4723,13 @@ static int brcmf_cfg80211_stop_ap(struct err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID, &join_params, sizeof(join_params)); if (err < 0) @@ -1690,7 +1690,7 @@ Signed-off-by: Kalle Valo if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) brcmf_fil_iovar_int_set(ifp, "mbss", 0); brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, -@@ -4702,7 +4734,7 @@ static int brcmf_cfg80211_stop_ap(struct +@@ -4705,7 +4737,7 @@ static int brcmf_cfg80211_stop_ap(struct /* Bring device back up so it can be used again */ err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1); if (err < 0) @@ -1699,7 +1699,7 @@ Signed-off-by: Kalle Valo brcmf_vif_clear_mgmt_ies(ifp->vif); } else { -@@ -4711,7 +4743,7 @@ static int brcmf_cfg80211_stop_ap(struct +@@ -4714,7 +4746,7 @@ static int brcmf_cfg80211_stop_ap(struct err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable, sizeof(bss_enable)); if (err < 0) @@ -1708,7 +1708,7 @@ Signed-off-by: Kalle Valo } brcmf_set_mpc(ifp, 1); brcmf_configure_arp_nd_offload(ifp, true); -@@ -4740,6 +4772,7 @@ brcmf_cfg80211_del_station(struct wiphy +@@ -4743,6 +4775,7 @@ brcmf_cfg80211_del_station(struct wiphy struct station_del_parameters *params) { struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); @@ -1716,7 +1716,7 @@ Signed-off-by: Kalle Valo struct brcmf_scb_val_le scbval; struct brcmf_if *ifp = netdev_priv(ndev); s32 err; -@@ -4759,7 +4792,7 @@ brcmf_cfg80211_del_station(struct wiphy +@@ -4762,7 +4795,7 @@ brcmf_cfg80211_del_station(struct wiphy err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON, &scbval, sizeof(scbval)); if (err) @@ -1725,7 +1725,7 @@ Signed-off-by: Kalle Valo err); brcmf_dbg(TRACE, "Exit\n"); -@@ -4770,6 +4803,8 @@ static int +@@ -4773,6 +4806,8 @@ static int brcmf_cfg80211_change_station(struct wiphy *wiphy, struct net_device *ndev, const u8 *mac, struct station_parameters *params) { @@ -1734,7 +1734,7 @@ Signed-off-by: Kalle Valo struct brcmf_if *ifp = netdev_priv(ndev); s32 err; -@@ -4790,7 +4825,7 @@ brcmf_cfg80211_change_station(struct wip +@@ -4793,7 +4828,7 @@ brcmf_cfg80211_change_station(struct wip err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SCB_DEAUTHORIZE, (void *)mac, ETH_ALEN); if (err < 0) @@ -1743,7 +1743,7 @@ Signed-off-by: Kalle Valo return err; } -@@ -4820,6 +4855,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip +@@ -4823,6 +4858,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip { struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct ieee80211_channel *chan = params->chan; @@ -1751,7 +1751,7 @@ Signed-off-by: Kalle Valo const u8 *buf = params->buf; size_t len = params->len; const struct ieee80211_mgmt *mgmt; -@@ -4840,7 +4876,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip +@@ -4843,7 +4879,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip mgmt = (const struct ieee80211_mgmt *)buf; if (!ieee80211_is_mgmt(mgmt->frame_control)) { @@ -1760,7 +1760,7 @@ Signed-off-by: Kalle Valo return -EPERM; } -@@ -4871,13 +4907,13 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip +@@ -4874,13 +4910,13 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wip GFP_KERNEL); } else if (ieee80211_is_action(mgmt->frame_control)) { if (len > BRCMF_FIL_ACTION_FRAME_SIZE + DOT11_MGMT_HDR_LEN) { @@ -1776,7 +1776,7 @@ Signed-off-by: Kalle Valo err = -ENOMEM; goto exit; } -@@ -4928,6 +4964,7 @@ brcmf_cfg80211_cancel_remain_on_channel( +@@ -4931,6 +4967,7 @@ brcmf_cfg80211_cancel_remain_on_channel( u64 cookie) { struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); @@ -1784,7 +1784,7 @@ Signed-off-by: Kalle Valo struct brcmf_cfg80211_vif *vif; int err = 0; -@@ -4935,7 +4972,7 @@ brcmf_cfg80211_cancel_remain_on_channel( +@@ -4938,7 +4975,7 @@ brcmf_cfg80211_cancel_remain_on_channel( vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif; if (vif == NULL) { @@ -1793,7 +1793,7 @@ Signed-off-by: Kalle Valo err = -ENODEV; goto exit; } -@@ -4950,6 +4987,7 @@ static int brcmf_cfg80211_get_channel(st +@@ -4953,6 +4990,7 @@ static int brcmf_cfg80211_get_channel(st { struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct net_device *ndev = wdev->netdev; @@ -1801,7 +1801,7 @@ Signed-off-by: Kalle Valo struct brcmf_if *ifp; struct brcmu_chan ch; enum nl80211_band band = 0; -@@ -4963,7 +5001,7 @@ static int brcmf_cfg80211_get_channel(st +@@ -4966,7 +5004,7 @@ static int brcmf_cfg80211_get_channel(st err = brcmf_fil_iovar_int_get(ifp, "chanspec", &chanspec); if (err) { @@ -1810,7 +1810,7 @@ Signed-off-by: Kalle Valo return err; } -@@ -5085,6 +5123,8 @@ static int brcmf_cfg80211_tdls_oper(stru +@@ -5088,6 +5126,8 @@ static int brcmf_cfg80211_tdls_oper(stru struct net_device *ndev, const u8 *peer, enum nl80211_tdls_operation oper) { @@ -1819,7 +1819,7 @@ Signed-off-by: Kalle Valo struct brcmf_if *ifp; struct brcmf_tdls_iovar_le info; int ret = 0; -@@ -5102,7 +5142,7 @@ static int brcmf_cfg80211_tdls_oper(stru +@@ -5105,7 +5145,7 @@ static int brcmf_cfg80211_tdls_oper(stru ret = brcmf_fil_iovar_data_set(ifp, "tdls_endpoint", &info, sizeof(info)); if (ret < 0) @@ -1828,7 +1828,7 @@ Signed-off-by: Kalle Valo return ret; } -@@ -5113,6 +5153,8 @@ brcmf_cfg80211_update_conn_params(struct +@@ -5116,6 +5156,8 @@ brcmf_cfg80211_update_conn_params(struct struct cfg80211_connect_params *sme, u32 changed) { @@ -1837,7 +1837,7 @@ Signed-off-by: Kalle Valo struct brcmf_if *ifp; int err; -@@ -5123,7 +5165,7 @@ brcmf_cfg80211_update_conn_params(struct +@@ -5126,7 +5168,7 @@ brcmf_cfg80211_update_conn_params(struct err = brcmf_vif_set_mgmt_ie(ifp->vif, BRCMF_VNDR_IE_ASSOCREQ_FLAG, sme->ie, sme->ie_len); if (err) @@ -1846,7 +1846,7 @@ Signed-off-by: Kalle Valo else brcmf_dbg(TRACE, "Applied Vndr IEs for Assoc request\n"); -@@ -5135,6 +5177,8 @@ static int +@@ -5138,6 +5180,8 @@ static int brcmf_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *ndev, struct cfg80211_gtk_rekey_data *gtk) { @@ -1855,7 +1855,7 @@ Signed-off-by: Kalle Valo struct brcmf_if *ifp = netdev_priv(ndev); struct brcmf_gtk_keyinfo_le gtk_le; int ret; -@@ -5149,7 +5193,7 @@ brcmf_cfg80211_set_rekey_data(struct wip +@@ -5152,7 +5196,7 @@ brcmf_cfg80211_set_rekey_data(struct wip ret = brcmf_fil_iovar_data_set(ifp, "gtk_key_info", >k_le, sizeof(gtk_le)); if (ret < 0) @@ -1864,7 +1864,7 @@ Signed-off-by: Kalle Valo return ret; } -@@ -5384,7 +5428,7 @@ static void brcmf_clear_assoc_ies(struct +@@ -5387,7 +5431,7 @@ static void brcmf_clear_assoc_ies(struct static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp) { @@ -1873,7 +1873,7 @@ Signed-off-by: Kalle Valo struct brcmf_cfg80211_assoc_ielen_le *assoc_info; struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg); u32 req_len; -@@ -5396,7 +5440,7 @@ static s32 brcmf_get_assoc_ies(struct br +@@ -5399,7 +5443,7 @@ static s32 brcmf_get_assoc_ies(struct br err = brcmf_fil_iovar_data_get(ifp, "assoc_info", cfg->extra_buf, WL_ASSOC_INFO_MAX); if (err) { @@ -1882,7 +1882,7 @@ Signed-off-by: Kalle Valo return err; } assoc_info = -@@ -5408,7 +5452,7 @@ static s32 brcmf_get_assoc_ies(struct br +@@ -5411,7 +5455,7 @@ static s32 brcmf_get_assoc_ies(struct br cfg->extra_buf, WL_ASSOC_INFO_MAX); if (err) { @@ -1891,7 +1891,7 @@ Signed-off-by: Kalle Valo return err; } conn_info->req_ie_len = req_len; -@@ -5426,7 +5470,7 @@ static s32 brcmf_get_assoc_ies(struct br +@@ -5429,7 +5473,7 @@ static s32 brcmf_get_assoc_ies(struct br cfg->extra_buf, WL_ASSOC_INFO_MAX); if (err) { @@ -1900,7 +1900,7 @@ Signed-off-by: Kalle Valo return err; } conn_info->resp_ie_len = resp_len; -@@ -5555,7 +5599,7 @@ brcmf_notify_connect_status_ap(struct br +@@ -5558,7 +5602,7 @@ brcmf_notify_connect_status_ap(struct br struct net_device *ndev, const struct brcmf_event_msg *e, void *data) { @@ -1909,7 +1909,7 @@ Signed-off-by: Kalle Valo static int generation; u32 event = e->event_code; u32 reason = e->reason; -@@ -5573,7 +5617,7 @@ brcmf_notify_connect_status_ap(struct br +@@ -5576,7 +5620,7 @@ brcmf_notify_connect_status_ap(struct br if (((event == BRCMF_E_ASSOC_IND) || (event == BRCMF_E_REASSOC_IND)) && (reason == BRCMF_E_STATUS_SUCCESS)) { if (!data) { @@ -1918,7 +1918,7 @@ Signed-off-by: Kalle Valo return -EINVAL; } -@@ -5865,7 +5909,7 @@ static void init_vif_event(struct brcmf_ +@@ -5868,7 +5912,7 @@ static void init_vif_event(struct brcmf_ static s32 brcmf_dongle_roam(struct brcmf_if *ifp) { @@ -1927,7 +1927,7 @@ Signed-off-by: Kalle Valo s32 err; u32 bcn_timeout; __le32 roamtrigger[2]; -@@ -5878,7 +5922,7 @@ static s32 brcmf_dongle_roam(struct brcm +@@ -5881,7 +5925,7 @@ static s32 brcmf_dongle_roam(struct brcm bcn_timeout = BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_ON; err = brcmf_fil_iovar_int_set(ifp, "bcn_timeout", bcn_timeout); if (err) { @@ -1936,7 +1936,7 @@ Signed-off-by: Kalle Valo goto roam_setup_done; } -@@ -5890,7 +5934,7 @@ static s32 brcmf_dongle_roam(struct brcm +@@ -5893,7 +5937,7 @@ static s32 brcmf_dongle_roam(struct brcm err = brcmf_fil_iovar_int_set(ifp, "roam_off", ifp->drvr->settings->roamoff); if (err) { @@ -1945,7 +1945,7 @@ Signed-off-by: Kalle Valo goto roam_setup_done; } -@@ -5899,7 +5943,7 @@ static s32 brcmf_dongle_roam(struct brcm +@@ -5902,7 +5946,7 @@ static s32 brcmf_dongle_roam(struct brcm err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER, (void *)roamtrigger, sizeof(roamtrigger)); if (err) { @@ -1954,7 +1954,7 @@ Signed-off-by: Kalle Valo goto roam_setup_done; } -@@ -5908,7 +5952,7 @@ static s32 brcmf_dongle_roam(struct brcm +@@ -5911,7 +5955,7 @@ static s32 brcmf_dongle_roam(struct brcm err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_DELTA, (void *)roam_delta, sizeof(roam_delta)); if (err) { @@ -1963,7 +1963,7 @@ Signed-off-by: Kalle Valo goto roam_setup_done; } -@@ -5919,26 +5963,26 @@ roam_setup_done: +@@ -5922,26 +5966,26 @@ roam_setup_done: static s32 brcmf_dongle_scantime(struct brcmf_if *ifp) { @@ -1994,7 +1994,7 @@ Signed-off-by: Kalle Valo goto dongle_scantime_out; } -@@ -5971,7 +6015,8 @@ static int brcmf_construct_chaninfo(stru +@@ -5974,7 +6018,8 @@ static int brcmf_construct_chaninfo(stru u32 bw_cap[]) { struct wiphy *wiphy = cfg_to_wiphy(cfg); @@ -2004,7 +2004,7 @@ Signed-off-by: Kalle Valo struct ieee80211_supported_band *band; struct ieee80211_channel *channel; struct brcmf_chanspec_list *list; -@@ -5992,7 +6037,7 @@ static int brcmf_construct_chaninfo(stru +@@ -5995,7 +6040,7 @@ static int brcmf_construct_chaninfo(stru err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf, BRCMF_DCMD_MEDLEN); if (err) { @@ -2013,7 +2013,7 @@ Signed-off-by: Kalle Valo goto fail_pbuf; } -@@ -6015,7 +6060,7 @@ static int brcmf_construct_chaninfo(stru +@@ -6018,7 +6063,7 @@ static int brcmf_construct_chaninfo(stru } else if (ch.band == BRCMU_CHAN_BAND_5G) { band = wiphy->bands[NL80211_BAND_5GHZ]; } else { @@ -2022,7 +2022,7 @@ Signed-off-by: Kalle Valo ch.chspec); continue; } -@@ -6039,7 +6084,7 @@ static int brcmf_construct_chaninfo(stru +@@ -6042,7 +6087,7 @@ static int brcmf_construct_chaninfo(stru /* It seems firmware supports some channel we never * considered. Something new in IEEE standard? */ @@ -2031,7 +2031,7 @@ Signed-off-by: Kalle Valo ch.control_ch_num); continue; } -@@ -6096,8 +6141,8 @@ fail_pbuf: +@@ -6099,8 +6144,8 @@ fail_pbuf: static int brcmf_enable_bw40_2g(struct brcmf_cfg80211_info *cfg) { @@ -2042,7 +2042,7 @@ Signed-off-by: Kalle Valo struct ieee80211_supported_band *band; struct brcmf_fil_bwcap_le band_bwcap; struct brcmf_chanspec_list *list; -@@ -6143,7 +6188,7 @@ static int brcmf_enable_bw40_2g(struct b +@@ -6146,7 +6191,7 @@ static int brcmf_enable_bw40_2g(struct b err = brcmf_fil_iovar_data_get(ifp, "chanspecs", pbuf, BRCMF_DCMD_MEDLEN); if (err) { @@ -2051,7 +2051,7 @@ Signed-off-by: Kalle Valo kfree(pbuf); return err; } -@@ -6174,7 +6219,7 @@ static int brcmf_enable_bw40_2g(struct b +@@ -6177,7 +6222,7 @@ static int brcmf_enable_bw40_2g(struct b static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[]) { @@ -2060,7 +2060,7 @@ Signed-off-by: Kalle Valo u32 band, mimo_bwcap; int err; -@@ -6210,7 +6255,7 @@ static void brcmf_get_bwcap(struct brcmf +@@ -6213,7 +6258,7 @@ static void brcmf_get_bwcap(struct brcmf bw_cap[NL80211_BAND_5GHZ] |= WLC_BW_20MHZ_BIT; break; default: @@ -2069,7 +2069,7 @@ Signed-off-by: Kalle Valo } } -@@ -6285,7 +6330,8 @@ static void brcmf_update_vht_cap(struct +@@ -6288,7 +6333,8 @@ static void brcmf_update_vht_cap(struct static int brcmf_setup_wiphybands(struct brcmf_cfg80211_info *cfg) { @@ -2079,7 +2079,7 @@ Signed-off-by: Kalle Valo struct wiphy *wiphy = cfg_to_wiphy(cfg); u32 nmode = 0; u32 vhtmode = 0; -@@ -6302,7 +6348,7 @@ static int brcmf_setup_wiphybands(struct +@@ -6305,7 +6351,7 @@ static int brcmf_setup_wiphybands(struct (void)brcmf_fil_iovar_int_get(ifp, "vhtmode", &vhtmode); err = brcmf_fil_iovar_int_get(ifp, "nmode", &nmode); if (err) { @@ -2088,7 +2088,7 @@ Signed-off-by: Kalle Valo } else { brcmf_get_bwcap(ifp, bw_cap); } -@@ -6312,7 +6358,7 @@ static int brcmf_setup_wiphybands(struct +@@ -6315,7 +6361,7 @@ static int brcmf_setup_wiphybands(struct err = brcmf_fil_iovar_int_get(ifp, "rxchain", &rxchain); if (err) { @@ -2097,7 +2097,7 @@ Signed-off-by: Kalle Valo nchain = 1; } else { for (nchain = 0; rxchain; nchain++) -@@ -6322,7 +6368,7 @@ static int brcmf_setup_wiphybands(struct +@@ -6325,7 +6371,7 @@ static int brcmf_setup_wiphybands(struct err = brcmf_construct_chaninfo(cfg, bw_cap); if (err) { @@ -2106,7 +2106,7 @@ Signed-off-by: Kalle Valo return err; } -@@ -6529,12 +6575,13 @@ static void brcmf_wiphy_wowl_params(stru +@@ -6532,12 +6578,13 @@ static void brcmf_wiphy_wowl_params(stru { #ifdef CONFIG_PM struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); @@ -2121,7 +2121,7 @@ Signed-off-by: Kalle Valo wiphy->wowlan = &brcmf_wowlan_support; return; } -@@ -6631,7 +6678,7 @@ static int brcmf_setup_wiphy(struct wiph +@@ -6634,7 +6681,7 @@ static int brcmf_setup_wiphy(struct wiph err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BANDLIST, &bandlist, sizeof(bandlist)); if (err) { @@ -2130,7 +2130,7 @@ Signed-off-by: Kalle Valo return err; } /* first entry in bandlist is number of bands */ -@@ -6680,7 +6727,7 @@ static int brcmf_setup_wiphy(struct wiph +@@ -6683,7 +6730,7 @@ static int brcmf_setup_wiphy(struct wiph static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg) { @@ -2139,7 +2139,7 @@ Signed-off-by: Kalle Valo struct net_device *ndev; struct wireless_dev *wdev; struct brcmf_if *ifp; -@@ -6718,7 +6765,7 @@ static s32 brcmf_config_dongle(struct br +@@ -6721,7 +6768,7 @@ static s32 brcmf_config_dongle(struct br err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_FAKEFRAG, 1); if (err) { @@ -2148,7 +2148,7 @@ Signed-off-by: Kalle Valo goto default_conf_out; } -@@ -6899,6 +6946,7 @@ static void brcmf_cfg80211_reg_notifier( +@@ -6902,6 +6949,7 @@ static void brcmf_cfg80211_reg_notifier( { struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0); @@ -2156,7 +2156,7 @@ Signed-off-by: Kalle Valo struct brcmf_fil_country_le ccreq; s32 err; int i; -@@ -6910,7 +6958,7 @@ static void brcmf_cfg80211_reg_notifier( +@@ -6913,7 +6961,7 @@ static void brcmf_cfg80211_reg_notifier( /* ignore non-ISO3166 country codes */ for (i = 0; i < 2; i++) if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') { @@ -2165,7 +2165,7 @@ Signed-off-by: Kalle Valo req->alpha2[0], req->alpha2[1]); return; } -@@ -6920,7 +6968,7 @@ static void brcmf_cfg80211_reg_notifier( +@@ -6923,7 +6971,7 @@ static void brcmf_cfg80211_reg_notifier( err = brcmf_fil_iovar_data_get(ifp, "country", &ccreq, sizeof(ccreq)); if (err) { @@ -2174,7 +2174,7 @@ Signed-off-by: Kalle Valo return; } -@@ -6930,7 +6978,7 @@ static void brcmf_cfg80211_reg_notifier( +@@ -6933,7 +6981,7 @@ static void brcmf_cfg80211_reg_notifier( err = brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq)); if (err) { @@ -2183,7 +2183,7 @@ Signed-off-by: Kalle Valo return; } brcmf_setup_wiphybands(cfg); -@@ -6976,13 +7024,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +@@ -6979,13 +7027,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802 u16 *cap = NULL; if (!ndev) { @@ -2199,7 +2199,7 @@ Signed-off-by: Kalle Valo return NULL; } -@@ -7003,7 +7051,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +@@ -7006,7 +7054,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 err = wl_init_priv(cfg); if (err) { @@ -2208,7 +2208,7 @@ Signed-off-by: Kalle Valo brcmf_free_vif(vif); goto wiphy_out; } -@@ -7012,7 +7060,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +@@ -7015,7 +7063,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 /* determine d11 io type before wiphy setup */ err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_VERSION, &io_type); if (err) { @@ -2217,7 +2217,7 @@ Signed-off-by: Kalle Valo goto priv_out; } cfg->d11inf.io_type = (u8)io_type; -@@ -7046,13 +7094,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +@@ -7049,13 +7097,13 @@ struct brcmf_cfg80211_info *brcmf_cfg802 #endif err = wiphy_register(wiphy); if (err < 0) { @@ -2233,7 +2233,7 @@ Signed-off-by: Kalle Valo goto wiphy_unreg_out; } -@@ -7070,24 +7118,24 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +@@ -7073,24 +7121,24 @@ struct brcmf_cfg80211_info *brcmf_cfg802 err = brcmf_fweh_activate_events(ifp); if (err) { @@ -2262,7 +2262,7 @@ Signed-off-by: Kalle Valo brcmf_btcoex_detach(cfg); brcmf_p2p_detach(&cfg->p2p); goto wiphy_unreg_out; -@@ -7107,7 +7155,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +@@ -7110,7 +7158,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 /* (re-) activate FWEH event handling */ err = brcmf_fweh_activate_events(ifp); if (err) { diff --git a/package/kernel/mac80211/patches/brcm/383-v5.4-0002-brcmfmac-enable-DFS_OFFLOAD-extended-feature-if-supp.patch b/package/kernel/mac80211/patches/brcm/383-v5.4-0002-brcmfmac-enable-DFS_OFFLOAD-extended-feature-if-supp.patch index a631af62e2..d87a84ecfa 100644 --- a/package/kernel/mac80211/patches/brcm/383-v5.4-0002-brcmfmac-enable-DFS_OFFLOAD-extended-feature-if-supp.patch +++ b/package/kernel/mac80211/patches/brcm/383-v5.4-0002-brcmfmac-enable-DFS_OFFLOAD-extended-feature-if-supp.patch @@ -19,7 +19,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -6728,6 +6728,11 @@ static int brcmf_setup_wiphy(struct wiph +@@ -6731,6 +6731,11 @@ static int brcmf_setup_wiphy(struct wiph } } diff --git a/package/kernel/mac80211/patches/brcm/384-v5.4-0005-brcmfmac-avoid-firmware-commands-when-bus-is-down.patch b/package/kernel/mac80211/patches/brcm/384-v5.4-0005-brcmfmac-avoid-firmware-commands-when-bus-is-down.patch index f366bf8675..585cc6e893 100644 --- a/package/kernel/mac80211/patches/brcm/384-v5.4-0005-brcmfmac-avoid-firmware-commands-when-bus-is-down.patch +++ b/package/kernel/mac80211/patches/brcm/384-v5.4-0005-brcmfmac-avoid-firmware-commands-when-bus-is-down.patch @@ -56,7 +56,7 @@ Signed-off-by: Kalle Valo vif->profile.use_fwsup = BRCMF_PROFILE_FWSUP_NONE; } brcmf_dbg(TRACE, "Exit\n"); -@@ -4996,18 +5001,16 @@ static int brcmf_cfg80211_get_channel(st +@@ -4999,18 +5004,16 @@ static int brcmf_cfg80211_get_channel(st struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct net_device *ndev = wdev->netdev; struct brcmf_pub *drvr = cfg->pub; diff --git a/package/kernel/mac80211/patches/brcm/386-v5.4-brcmfmac-remove-set-but-not-used-variable-dtim_perio.patch b/package/kernel/mac80211/patches/brcm/386-v5.4-brcmfmac-remove-set-but-not-used-variable-dtim_perio.patch index 4ba87ed093..0a750749c0 100644 --- a/package/kernel/mac80211/patches/brcm/386-v5.4-brcmfmac-remove-set-but-not-used-variable-dtim_perio.patch +++ b/package/kernel/mac80211/patches/brcm/386-v5.4-brcmfmac-remove-set-but-not-used-variable-dtim_perio.patch @@ -21,7 +21,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -2974,8 +2974,6 @@ static s32 brcmf_update_bss_info(struct +@@ -2977,8 +2977,6 @@ static s32 brcmf_update_bss_info(struct struct brcmf_pub *drvr = cfg->pub; struct brcmf_bss_info_le *bi; const struct brcmf_tlv *tim; @@ -30,7 +30,7 @@ Signed-off-by: Kalle Valo size_t ie_len; u8 *ie; s32 err = 0; -@@ -2999,12 +2997,9 @@ static s32 brcmf_update_bss_info(struct +@@ -3002,12 +3000,9 @@ static s32 brcmf_update_bss_info(struct ie = ((u8 *)bi) + le16_to_cpu(bi->ie_offset); ie_len = le32_to_cpu(bi->ie_length); @@ -44,7 +44,7 @@ Signed-off-by: Kalle Valo /* * active scan was done so we could not get dtim * information out of probe response. -@@ -3016,7 +3011,6 @@ static s32 brcmf_update_bss_info(struct +@@ -3019,7 +3014,6 @@ static s32 brcmf_update_bss_info(struct bphy_err(drvr, "wl dtim_assoc failed (%d)\n", err); goto update_bss_info_out; } diff --git a/package/kernel/mac80211/patches/brcm/388-v5.4-brcmfmac-replace-strncpy-by-strscpy.patch b/package/kernel/mac80211/patches/brcm/388-v5.4-brcmfmac-replace-strncpy-by-strscpy.patch index aad5c428fb..0f273578bd 100644 --- a/package/kernel/mac80211/patches/brcm/388-v5.4-brcmfmac-replace-strncpy-by-strscpy.patch +++ b/package/kernel/mac80211/patches/brcm/388-v5.4-brcmfmac-replace-strncpy-by-strscpy.patch @@ -23,7 +23,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -4236,9 +4236,7 @@ next: +@@ -4239,9 +4239,7 @@ next: static u32 brcmf_vndr_ie(u8 *iebuf, s32 pktflag, u8 *ie_ptr, u32 ie_len, s8 *add_del_cmd) { diff --git a/package/kernel/mac80211/patches/brcm/391-v5.4-brcmfmac-use-ph-to-print-small-buffer.patch b/package/kernel/mac80211/patches/brcm/391-v5.4-brcmfmac-use-ph-to-print-small-buffer.patch index b42e119126..acc38f103f 100644 --- a/package/kernel/mac80211/patches/brcm/391-v5.4-brcmfmac-use-ph-to-print-small-buffer.patch +++ b/package/kernel/mac80211/patches/brcm/391-v5.4-brcmfmac-use-ph-to-print-small-buffer.patch @@ -13,7 +13,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -4214,10 +4214,8 @@ brcmf_parse_vndr_ies(const u8 *vndr_ie_b +@@ -4217,10 +4217,8 @@ brcmf_parse_vndr_ies(const u8 *vndr_ie_b vndr_ies->count++; @@ -26,7 +26,7 @@ Signed-off-by: Kalle Valo parsed_info->vndrie.oui_type); if (vndr_ies->count >= VNDR_IE_PARSE_LIMIT) -@@ -4341,12 +4339,10 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c +@@ -4344,12 +4342,10 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c for (i = 0; i < old_vndr_ies.count; i++) { vndrie_info = &old_vndr_ies.ie_info[i]; @@ -41,7 +41,7 @@ Signed-off-by: Kalle Valo del_add_ie_buf_len = brcmf_vndr_ie(curr_ie_buf, pktflag, vndrie_info->ie_ptr, -@@ -4378,12 +4374,10 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c +@@ -4381,12 +4377,10 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c remained_buf_len -= (vndrie_info->ie_len + VNDR_IE_VSIE_OFFSET); diff --git a/package/kernel/mac80211/patches/brcm/392-v5.4-0001-brcmfmac-move-cfg80211_ops-pointer-to-another-struct.patch b/package/kernel/mac80211/patches/brcm/392-v5.4-0001-brcmfmac-move-cfg80211_ops-pointer-to-another-struct.patch index 29936a0df7..69f369103d 100644 --- a/package/kernel/mac80211/patches/brcm/392-v5.4-0001-brcmfmac-move-cfg80211_ops-pointer-to-another-struct.patch +++ b/package/kernel/mac80211/patches/brcm/392-v5.4-0001-brcmfmac-move-cfg80211_ops-pointer-to-another-struct.patch @@ -24,7 +24,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -7197,7 +7197,6 @@ void brcmf_cfg80211_detach(struct brcmf_ +@@ -7200,7 +7200,6 @@ void brcmf_cfg80211_detach(struct brcmf_ brcmf_pno_detach(cfg); brcmf_btcoex_detach(cfg); wiphy_unregister(cfg->wiphy); diff --git a/package/kernel/mac80211/patches/brcm/414-v5.6-0004-brcmfmac-make-errors-when-setting-roaming-parameters.patch b/package/kernel/mac80211/patches/brcm/414-v5.6-0004-brcmfmac-make-errors-when-setting-roaming-parameters.patch index bdc5ab9ee3..1ecc178911 100644 --- a/package/kernel/mac80211/patches/brcm/414-v5.6-0004-brcmfmac-make-errors-when-setting-roaming-parameters.patch +++ b/package/kernel/mac80211/patches/brcm/414-v5.6-0004-brcmfmac-make-errors-when-setting-roaming-parameters.patch @@ -16,7 +16,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -5939,19 +5939,17 @@ static s32 brcmf_dongle_roam(struct brcm +@@ -5942,19 +5942,17 @@ static s32 brcmf_dongle_roam(struct brcm roamtrigger[1] = cpu_to_le32(BRCM_BAND_ALL); err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER, (void *)roamtrigger, sizeof(roamtrigger)); diff --git a/package/kernel/mac80211/patches/brcm/414-v5.6-0006-brcmfmac-add-RSDB-condition-when-setting-interface-c.patch b/package/kernel/mac80211/patches/brcm/414-v5.6-0006-brcmfmac-add-RSDB-condition-when-setting-interface-c.patch index a62ac68f2e..ff50ec39ee 100644 --- a/package/kernel/mac80211/patches/brcm/414-v5.6-0006-brcmfmac-add-RSDB-condition-when-setting-interface-c.patch +++ b/package/kernel/mac80211/patches/brcm/414-v5.6-0006-brcmfmac-add-RSDB-condition-when-setting-interface-c.patch @@ -20,7 +20,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -6447,6 +6447,9 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = +@@ -6450,6 +6450,9 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = * #STA <= 1, #AP <= 1, channels = 1, 2 total * #AP <= 4, matching BI, channels = 1, 4 total * @@ -30,7 +30,7 @@ Signed-off-by: Kalle Valo * p2p, no mchan, and mbss: * * #STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 1, 3 total -@@ -6458,6 +6461,10 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = +@@ -6461,6 +6464,10 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = * #STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 2, 3 total * #STA <= 1, #P2P-DEV <= 1, #AP <= 1, #P2P-CL <= 1, channels = 1, 4 total * #AP <= 4, matching BI, channels = 1, 4 total @@ -41,7 +41,7 @@ Signed-off-by: Kalle Valo */ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) { -@@ -6465,13 +6472,14 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6468,13 +6475,14 @@ static int brcmf_setup_ifmodes(struct wi struct ieee80211_iface_limit *c0_limits = NULL; struct ieee80211_iface_limit *p2p_limits = NULL; struct ieee80211_iface_limit *mbss_limits = NULL; @@ -58,7 +58,7 @@ Signed-off-by: Kalle Valo combo = kcalloc(n_combos, sizeof(*combo), GFP_KERNEL); if (!combo) goto err; -@@ -6482,16 +6490,36 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6485,16 +6493,36 @@ static int brcmf_setup_ifmodes(struct wi c = 0; i = 0; @@ -99,7 +99,7 @@ Signed-off-by: Kalle Valo wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO) | BIT(NL80211_IFTYPE_P2P_DEVICE); -@@ -6500,16 +6528,26 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6503,16 +6531,26 @@ static int brcmf_setup_ifmodes(struct wi c0_limits[i].max = 1; c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO); diff --git a/package/kernel/mac80211/patches/brcm/414-v5.6-0007-brcmfmac-not-set-mbss-in-vif-if-firmware-does-not-su.patch b/package/kernel/mac80211/patches/brcm/414-v5.6-0007-brcmfmac-not-set-mbss-in-vif-if-firmware-does-not-su.patch index 96df09dfab..992457321a 100644 --- a/package/kernel/mac80211/patches/brcm/414-v5.6-0007-brcmfmac-not-set-mbss-in-vif-if-firmware-does-not-su.patch +++ b/package/kernel/mac80211/patches/brcm/414-v5.6-0007-brcmfmac-not-set-mbss-in-vif-if-firmware-does-not-su.patch @@ -18,7 +18,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -5293,6 +5293,7 @@ struct brcmf_cfg80211_vif *brcmf_alloc_v +@@ -5296,6 +5296,7 @@ struct brcmf_cfg80211_vif *brcmf_alloc_v struct brcmf_cfg80211_vif *vif_walk; struct brcmf_cfg80211_vif *vif; bool mbss; @@ -26,7 +26,7 @@ Signed-off-by: Kalle Valo brcmf_dbg(TRACE, "allocating virtual interface (size=%zu)\n", sizeof(*vif)); -@@ -5305,7 +5306,8 @@ struct brcmf_cfg80211_vif *brcmf_alloc_v +@@ -5308,7 +5309,8 @@ struct brcmf_cfg80211_vif *brcmf_alloc_v brcmf_init_prof(&vif->profile); diff --git a/package/kernel/mac80211/patches/brcm/419-v5.6-0001-brcmfmac-simplify-building-interface-combinations.patch b/package/kernel/mac80211/patches/brcm/419-v5.6-0001-brcmfmac-simplify-building-interface-combinations.patch index 1623d483d7..173ab33132 100644 --- a/package/kernel/mac80211/patches/brcm/419-v5.6-0001-brcmfmac-simplify-building-interface-combinations.patch +++ b/package/kernel/mac80211/patches/brcm/419-v5.6-0001-brcmfmac-simplify-building-interface-combinations.patch @@ -18,7 +18,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -6474,12 +6474,13 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6477,12 +6477,13 @@ static int brcmf_setup_ifmodes(struct wi struct ieee80211_iface_limit *c0_limits = NULL; struct ieee80211_iface_limit *p2p_limits = NULL; struct ieee80211_iface_limit *mbss_limits = NULL; @@ -33,7 +33,7 @@ Signed-off-by: Kalle Valo n_combos = 1 + !!(p2p && !rsdb) + !!mbss; combo = kcalloc(n_combos, sizeof(*combo), GFP_KERNEL); -@@ -6489,6 +6490,10 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6492,6 +6493,10 @@ static int brcmf_setup_ifmodes(struct wi wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_AP); @@ -44,7 +44,7 @@ Signed-off-by: Kalle Valo c = 0; i = 0; -@@ -6500,48 +6505,28 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6503,48 +6508,28 @@ static int brcmf_setup_ifmodes(struct wi c0_limits = kcalloc(2, sizeof(*c0_limits), GFP_KERNEL); if (!c0_limits) goto err; diff --git a/package/kernel/mac80211/patches/brcm/419-v5.6-0002-brcmfmac-add-initial-support-for-monitor-mode.patch b/package/kernel/mac80211/patches/brcm/419-v5.6-0002-brcmfmac-add-initial-support-for-monitor-mode.patch index 7cc93fb224..070002292b 100644 --- a/package/kernel/mac80211/patches/brcm/419-v5.6-0002-brcmfmac-add-initial-support-for-monitor-mode.patch +++ b/package/kernel/mac80211/patches/brcm/419-v5.6-0002-brcmfmac-add-initial-support-for-monitor-mode.patch @@ -139,7 +139,7 @@ Signed-off-by: Kalle Valo case NL80211_IFTYPE_AP: return brcmf_cfg80211_del_ap_iface(wiphy, wdev); case NL80211_IFTYPE_P2P_CLIENT: -@@ -6474,9 +6553,10 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6477,9 +6556,10 @@ static int brcmf_setup_ifmodes(struct wi struct ieee80211_iface_limit *c0_limits = NULL; struct ieee80211_iface_limit *p2p_limits = NULL; struct ieee80211_iface_limit *mbss_limits = NULL; @@ -152,7 +152,7 @@ Signed-off-by: Kalle Valo mbss = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS); p2p = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_P2P); rsdb = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB); -@@ -6490,6 +6570,8 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6493,6 +6573,8 @@ static int brcmf_setup_ifmodes(struct wi wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_AP); @@ -161,7 +161,7 @@ Signed-off-by: Kalle Valo if (p2p) wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO) | -@@ -6497,18 +6579,18 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6500,18 +6582,18 @@ static int brcmf_setup_ifmodes(struct wi c = 0; i = 0; @@ -186,7 +186,7 @@ Signed-off-by: Kalle Valo if (p2p) { c0_limits[i].max = 1; c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_DEVICE); -@@ -6557,14 +6639,20 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6560,14 +6642,20 @@ static int brcmf_setup_ifmodes(struct wi if (mbss) { c++; i = 0; diff --git a/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch b/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch index afbd2cc740..8ecb729aa9 100644 --- a/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch +++ b/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch @@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -2866,6 +2866,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip +@@ -2869,6 +2869,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip * preference in cfg struct to apply this to * FW later while initializing the dongle */ diff --git a/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch b/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch index 26c55560e3..5b822126e4 100644 --- a/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch +++ b/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -3833,6 +3833,12 @@ out: +@@ -3841,6 +3841,12 @@ out: netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, struct net_device *dev) { diff --git a/package/kernel/mac80211/patches/subsys/300-mac80211-add-stop-start-logic-for-software-TXQs.patch b/package/kernel/mac80211/patches/subsys/300-mac80211-add-stop-start-logic-for-software-TXQs.patch index d925fcd514..29b3184fba 100644 --- a/package/kernel/mac80211/patches/subsys/300-mac80211-add-stop-start-logic-for-software-TXQs.patch +++ b/package/kernel/mac80211/patches/subsys/300-mac80211-add-stop-start-logic-for-software-TXQs.patch @@ -100,7 +100,7 @@ Signed-off-by: Johannes Berg (unsigned long) local); --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -3498,13 +3498,19 @@ struct sk_buff *ieee80211_tx_dequeue(str +@@ -3506,13 +3506,19 @@ struct sk_buff *ieee80211_tx_dequeue(str struct ieee80211_tx_info *info; struct ieee80211_tx_data tx; ieee80211_tx_result r; @@ -122,7 +122,7 @@ Signed-off-by: Johannes Berg /* Make sure fragments stay together. */ skb = __skb_dequeue(&txqi->frags); if (skb) -@@ -3617,6 +3623,7 @@ begin: +@@ -3625,6 +3631,7 @@ begin: } IEEE80211_SKB_CB(skb)->control.vif = vif; diff --git a/package/kernel/mac80211/patches/subsys/320-mac80211-Add-TXQ-scheduling-API.patch b/package/kernel/mac80211/patches/subsys/320-mac80211-Add-TXQ-scheduling-API.patch index 7e646f2766..796222c527 100644 --- a/package/kernel/mac80211/patches/subsys/320-mac80211-Add-TXQ-scheduling-API.patch +++ b/package/kernel/mac80211/patches/subsys/320-mac80211-Add-TXQ-scheduling-API.patch @@ -202,7 +202,7 @@ Signed-off-by: Johannes Berg --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -1441,6 +1441,7 @@ void ieee80211_txq_init(struct ieee80211 +@@ -1447,6 +1447,7 @@ void ieee80211_txq_init(struct ieee80211 codel_vars_init(&txqi->def_cvars); codel_stats_init(&txqi->cstats); __skb_queue_head_init(&txqi->frags); @@ -210,7 +210,7 @@ Signed-off-by: Johannes Berg txqi->txq.vif = &sdata->vif; -@@ -1464,6 +1465,9 @@ void ieee80211_txq_purge(struct ieee8021 +@@ -1470,6 +1471,9 @@ void ieee80211_txq_purge(struct ieee8021 fq_tin_reset(fq, tin, fq_skb_free_func); ieee80211_purge_tx_queue(&local->hw, &txqi->frags); @@ -220,7 +220,7 @@ Signed-off-by: Johannes Berg } void ieee80211_txq_set_params(struct ieee80211_local *local) -@@ -1580,7 +1584,7 @@ static bool ieee80211_queue_skb(struct i +@@ -1586,7 +1590,7 @@ static bool ieee80211_queue_skb(struct i ieee80211_txq_enqueue(local, txqi, skb); spin_unlock_bh(&fq->lock); @@ -229,7 +229,7 @@ Signed-off-by: Johannes Berg return true; } -@@ -3631,6 +3635,60 @@ out: +@@ -3639,6 +3643,60 @@ out: } EXPORT_SYMBOL(ieee80211_tx_dequeue); diff --git a/package/kernel/mac80211/patches/subsys/321-cfg80211-Add-airtime-statistics-and-settings.patch b/package/kernel/mac80211/patches/subsys/321-cfg80211-Add-airtime-statistics-and-settings.patch index e1a3fe38e1..1e03ee280c 100644 --- a/package/kernel/mac80211/patches/subsys/321-cfg80211-Add-airtime-statistics-and-settings.patch +++ b/package/kernel/mac80211/patches/subsys/321-cfg80211-Add-airtime-statistics-and-settings.patch @@ -156,7 +156,7 @@ Signed-off-by: Johannes Berg }; /* policy for the key attributes */ -@@ -4715,6 +4716,11 @@ static int nl80211_send_station(struct s +@@ -4716,6 +4717,11 @@ static int nl80211_send_station(struct s PUT_SINFO(PLID, plid, u16); PUT_SINFO(PLINK_STATE, plink_state, u8); PUT_SINFO_U64(RX_DURATION, rx_duration); @@ -168,7 +168,7 @@ Signed-off-by: Johannes Berg switch (rdev->wiphy.signal_type) { case CFG80211_SIGNAL_TYPE_MBM: -@@ -5351,6 +5357,15 @@ static int nl80211_set_station(struct sk +@@ -5352,6 +5358,15 @@ static int nl80211_set_station(struct sk nla_get_u8(info->attrs[NL80211_ATTR_OPMODE_NOTIF]); } @@ -184,7 +184,7 @@ Signed-off-by: Johannes Berg /* Include parameters for TDLS peer (will check later) */ err = nl80211_set_station_tdls(info, ¶ms); if (err) -@@ -5489,6 +5504,15 @@ static int nl80211_new_station(struct sk +@@ -5490,6 +5505,15 @@ static int nl80211_new_station(struct sk return -EINVAL; } diff --git a/package/kernel/mac80211/patches/subsys/322-mac80211-Add-airtime-accounting-and-scheduling-to-TX.patch b/package/kernel/mac80211/patches/subsys/322-mac80211-Add-airtime-accounting-and-scheduling-to-TX.patch index aac28977f1..3821152805 100644 --- a/package/kernel/mac80211/patches/subsys/322-mac80211-Add-airtime-accounting-and-scheduling-to-TX.patch +++ b/package/kernel/mac80211/patches/subsys/322-mac80211-Add-airtime-accounting-and-scheduling-to-TX.patch @@ -149,7 +149,7 @@ Signed-off-by: Johannes Berg /* if the dir failed, don't put all the other things into the root! */ --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c -@@ -178,9 +178,9 @@ static ssize_t sta_aqm_read(struct file +@@ -179,9 +179,9 @@ static ssize_t sta_aqm_read(struct file txqi->tin.tx_bytes, txqi->tin.tx_packets, txqi->flags, @@ -162,7 +162,7 @@ Signed-off-by: Johannes Berg } rcu_read_unlock(); -@@ -192,6 +192,64 @@ static ssize_t sta_aqm_read(struct file +@@ -193,6 +193,64 @@ static ssize_t sta_aqm_read(struct file } STA_OPS(aqm); @@ -227,7 +227,7 @@ Signed-off-by: Johannes Berg static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { -@@ -546,6 +604,10 @@ void ieee80211_sta_debugfs_add(struct st +@@ -547,6 +605,10 @@ void ieee80211_sta_debugfs_add(struct st if (local->ops->wake_tx_queue) DEBUGFS_ADD(aqm); @@ -302,7 +302,7 @@ Signed-off-by: Johannes Berg } for (i = 0; i < IEEE80211_NUM_TIDS; i++) -@@ -1842,6 +1842,27 @@ void ieee80211_sta_set_buffered(struct i +@@ -1837,6 +1837,27 @@ void ieee80211_sta_set_buffered(struct i } EXPORT_SYMBOL(ieee80211_sta_set_buffered); @@ -330,7 +330,7 @@ Signed-off-by: Johannes Berg int sta_info_move_state(struct sta_info *sta, enum ieee80211_sta_state new_state) { -@@ -2212,6 +2233,23 @@ void sta_set_sinfo(struct sta_info *sta, +@@ -2207,6 +2228,23 @@ void sta_set_sinfo(struct sta_info *sta, sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_FAILED); } @@ -356,7 +356,7 @@ Signed-off-by: Johannes Berg for_each_possible_cpu(cpu) { --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h -@@ -128,6 +128,16 @@ enum ieee80211_agg_stop_reason { +@@ -129,6 +129,16 @@ enum ieee80211_agg_stop_reason { AGG_STOP_DESTROY_STA, }; @@ -373,7 +373,7 @@ Signed-off-by: Johannes Berg struct sta_info; /** -@@ -593,6 +603,9 @@ struct sta_info { +@@ -594,6 +604,9 @@ struct sta_info { } tx_stats; u16 tid_seq[IEEE80211_QOS_CTL_TID_MASK + 1]; @@ -400,7 +400,7 @@ Signed-off-by: Johannes Berg if (sta->status_stats.lost_packets) --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -1463,8 +1463,11 @@ void ieee80211_txq_purge(struct ieee8021 +@@ -1469,8 +1469,11 @@ void ieee80211_txq_purge(struct ieee8021 struct fq *fq = &local->fq; struct fq_tin *tin = &txqi->tin; @@ -412,7 +412,7 @@ Signed-off-by: Johannes Berg spin_lock_bh(&local->active_txq_lock[txqi->txq.ac]); list_del_init(&txqi->schedule_order); spin_unlock_bh(&local->active_txq_lock[txqi->txq.ac]); -@@ -3642,11 +3645,28 @@ struct ieee80211_txq *ieee80211_next_txq +@@ -3650,11 +3653,28 @@ struct ieee80211_txq *ieee80211_next_txq lockdep_assert_held(&local->active_txq_lock[ac]); @@ -442,7 +442,7 @@ Signed-off-by: Johannes Berg return NULL; list_del_init(&txqi->schedule_order); -@@ -3664,12 +3684,74 @@ void ieee80211_return_txq(struct ieee802 +@@ -3672,12 +3692,74 @@ void ieee80211_return_txq(struct ieee802 lockdep_assert_held(&local->active_txq_lock[txq->ac]); if (list_empty(&txqi->schedule_order) && diff --git a/package/kernel/mac80211/patches/subsys/323-mac80211-Expose-ieee80211_schedule_txq-function.patch b/package/kernel/mac80211/patches/subsys/323-mac80211-Expose-ieee80211_schedule_txq-function.patch index ca70f6a8fa..86988f7934 100644 --- a/package/kernel/mac80211/patches/subsys/323-mac80211-Expose-ieee80211_schedule_txq-function.patch +++ b/package/kernel/mac80211/patches/subsys/323-mac80211-Expose-ieee80211_schedule_txq-function.patch @@ -51,7 +51,7 @@ Signed-off-by: Johannes Berg --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -3704,6 +3704,19 @@ void ieee80211_return_txq(struct ieee802 +@@ -3712,6 +3712,19 @@ void ieee80211_return_txq(struct ieee802 } EXPORT_SYMBOL(ieee80211_return_txq); diff --git a/package/kernel/mac80211/patches/subsys/350-mac80211-add-hdrlen-to-ieee80211_tx_data.patch b/package/kernel/mac80211/patches/subsys/350-mac80211-add-hdrlen-to-ieee80211_tx_data.patch index 48d4db609f..65b284f874 100644 --- a/package/kernel/mac80211/patches/subsys/350-mac80211-add-hdrlen-to-ieee80211_tx_data.patch +++ b/package/kernel/mac80211/patches/subsys/350-mac80211-add-hdrlen-to-ieee80211_tx_data.patch @@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -925,7 +925,7 @@ ieee80211_tx_h_fragment(struct ieee80211 +@@ -931,7 +931,7 @@ ieee80211_tx_h_fragment(struct ieee80211 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_hdr *hdr = (void *)skb->data; int frag_threshold = tx->local->hw.wiphy->frag_threshold; @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau int fragnum; /* no matter what happens, tx->skb moves to tx->skbs */ -@@ -946,8 +946,6 @@ ieee80211_tx_h_fragment(struct ieee80211 +@@ -952,8 +952,6 @@ ieee80211_tx_h_fragment(struct ieee80211 if (WARN_ON(info->flags & IEEE80211_TX_CTL_AMPDU)) return TX_DROP; @@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau /* internal error, why isn't DONTFRAG set? */ if (WARN_ON(skb->len + FCS_LEN <= frag_threshold)) return TX_DROP; -@@ -1178,6 +1176,8 @@ ieee80211_tx_prepare(struct ieee80211_su +@@ -1184,6 +1182,8 @@ ieee80211_tx_prepare(struct ieee80211_su hdr = (struct ieee80211_hdr *) skb->data; @@ -48,7 +48,7 @@ Signed-off-by: Felix Fietkau if (likely(sta)) { if (!IS_ERR(sta)) tx->sta = sta; -@@ -3536,6 +3536,7 @@ begin: +@@ -3544,6 +3544,7 @@ begin: tx.local = local; tx.skb = skb; tx.sdata = vif_to_sdata(info->control.vif); @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau if (txq->sta) { tx.sta = container_of(txq->sta, struct sta_info, sta); -@@ -3580,7 +3581,7 @@ begin: +@@ -3588,7 +3589,7 @@ begin: if (tx.key && (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) @@ -65,7 +65,7 @@ Signed-off-by: Felix Fietkau ieee80211_xmit_fast_finish(sta->sdata, sta, pn_offs, tx.key, skb); -@@ -4039,6 +4040,7 @@ ieee80211_build_data_template(struct iee +@@ -4047,6 +4048,7 @@ ieee80211_build_data_template(struct iee hdr = (void *)skb->data; tx.sta = sta_info_get(sdata, hdr->addr1); tx.skb = skb; diff --git a/package/kernel/mac80211/patches/subsys/351-mac80211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch b/package/kernel/mac80211/patches/subsys/351-mac80211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch index 68d34519f7..971ef9727f 100644 --- a/package/kernel/mac80211/patches/subsys/351-mac80211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch +++ b/package/kernel/mac80211/patches/subsys/351-mac80211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch @@ -113,7 +113,7 @@ Signed-off-by: Felix Fietkau if (!(mshdr->flags & MESH_FLAGS_AE)) { --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c -@@ -2705,7 +2705,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 +@@ -2702,7 +2702,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 struct ieee80211_local *local = rx->local; struct ieee80211_sub_if_data *sdata = rx->sdata; struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; @@ -122,7 +122,7 @@ Signed-off-by: Felix Fietkau int tailroom = 0; hdr = (struct ieee80211_hdr *) skb->data; -@@ -2798,7 +2798,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 +@@ -2795,7 +2795,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 if (sdata->crypto_tx_tailroom_needed_cnt) tailroom = IEEE80211_ENCRYPT_TAILROOM; @@ -133,7 +133,7 @@ Signed-off-by: Felix Fietkau sdata->encrypt_headroom, tailroom, GFP_ATOMIC); if (!fwd_skb) -@@ -2830,6 +2832,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 +@@ -2827,6 +2829,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 return RX_DROP_MONITOR; } @@ -148,7 +148,7 @@ Signed-off-by: Felix Fietkau out: --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h -@@ -312,7 +312,7 @@ struct ieee80211_fast_tx { +@@ -313,7 +313,7 @@ struct ieee80211_fast_tx { u8 hdr_len; u8 sa_offs, da_offs, pn_offs; u8 band; @@ -217,7 +217,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -1175,8 +1175,7 @@ ieee80211_tx_prepare(struct ieee80211_su +@@ -1181,8 +1181,7 @@ ieee80211_tx_prepare(struct ieee80211_su info->flags &= ~IEEE80211_TX_INTFL_NEED_TXPROCESSING; hdr = (struct ieee80211_hdr *) skb->data; @@ -227,7 +227,7 @@ Signed-off-by: Felix Fietkau if (likely(sta)) { if (!IS_ERR(sta)) -@@ -2233,7 +2232,7 @@ netdev_tx_t ieee80211_monitor_start_xmit +@@ -2239,7 +2238,7 @@ netdev_tx_t ieee80211_monitor_start_xmit goto fail; hdr = (struct ieee80211_hdr *)(skb->data + len_rthdr); @@ -236,7 +236,7 @@ Signed-off-by: Felix Fietkau if (skb->len < len_rthdr + hdrlen) goto fail; -@@ -2452,7 +2451,7 @@ static struct sk_buff *ieee80211_build_h +@@ -2458,7 +2457,7 @@ static struct sk_buff *ieee80211_build_h struct ieee80211_chanctx_conf *chanctx_conf; struct ieee80211_sub_if_data *ap_sdata; enum nl80211_band band; @@ -245,7 +245,7 @@ Signed-off-by: Felix Fietkau if (IS_ERR(sta)) sta = NULL; -@@ -2751,7 +2750,9 @@ static struct sk_buff *ieee80211_build_h +@@ -2757,7 +2756,9 @@ static struct sk_buff *ieee80211_build_h } skb_pull(skb, skip_header_bytes); @@ -255,7 +255,7 @@ Signed-off-by: Felix Fietkau /* * So we need to modify the skb header and hence need a copy of -@@ -2784,6 +2785,9 @@ static struct sk_buff *ieee80211_build_h +@@ -2790,6 +2791,9 @@ static struct sk_buff *ieee80211_build_h memcpy(skb_push(skb, meshhdrlen), &mesh_hdr, meshhdrlen); #endif @@ -265,7 +265,7 @@ Signed-off-by: Felix Fietkau if (ieee80211_is_data_qos(fc)) { __le16 *qos_control; -@@ -2960,6 +2964,8 @@ void ieee80211_check_fast_xmit(struct st +@@ -2966,6 +2970,8 @@ void ieee80211_check_fast_xmit(struct st fc |= cpu_to_le16(IEEE80211_STYPE_QOS_DATA); } @@ -274,7 +274,7 @@ Signed-off-by: Felix Fietkau /* We store the key here so there's no point in using rcu_dereference() * but that's fine because the code that changes the pointers will call * this function after doing so. For a single CPU that would be enough, -@@ -3536,7 +3542,7 @@ begin: +@@ -3544,7 +3550,7 @@ begin: tx.local = local; tx.skb = skb; tx.sdata = vif_to_sdata(info->control.vif); @@ -283,7 +283,7 @@ Signed-off-by: Felix Fietkau if (txq->sta) { tx.sta = container_of(txq->sta, struct sta_info, sta); -@@ -4040,7 +4046,7 @@ ieee80211_build_data_template(struct iee +@@ -4048,7 +4054,7 @@ ieee80211_build_data_template(struct iee hdr = (void *)skb->data; tx.sta = sta_info_get(sdata, hdr->addr1); tx.skb = skb; diff --git a/package/kernel/mac80211/patches/subsys/352-mac80211-rework-locking-for-txq-scheduling-airtime-f.patch b/package/kernel/mac80211/patches/subsys/352-mac80211-rework-locking-for-txq-scheduling-airtime-f.patch index 11fe01ec21..6784c065d0 100644 --- a/package/kernel/mac80211/patches/subsys/352-mac80211-rework-locking-for-txq-scheduling-airtime-f.patch +++ b/package/kernel/mac80211/patches/subsys/352-mac80211-rework-locking-for-txq-scheduling-airtime-f.patch @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau * ieee80211_txq_may_transmit - check whether TXQ is allowed to transmit --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -3648,16 +3648,17 @@ EXPORT_SYMBOL(ieee80211_tx_dequeue); +@@ -3656,16 +3656,17 @@ EXPORT_SYMBOL(ieee80211_tx_dequeue); struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw, u8 ac) { struct ieee80211_local *local = hw_to_local(hw); @@ -115,7 +115,7 @@ Signed-off-by: Felix Fietkau if (txqi->txq.sta) { struct sta_info *sta = container_of(txqi->txq.sta, -@@ -3674,21 +3675,25 @@ struct ieee80211_txq *ieee80211_next_txq +@@ -3682,21 +3683,25 @@ struct ieee80211_txq *ieee80211_next_txq if (txqi->schedule_round == local->schedule_round[ac]) @@ -146,7 +146,7 @@ Signed-off-by: Felix Fietkau if (list_empty(&txqi->schedule_order) && (!skb_queue_empty(&txqi->frags) || txqi->tin.backlog_packets)) { -@@ -3708,18 +3713,7 @@ void ieee80211_return_txq(struct ieee802 +@@ -3716,18 +3721,7 @@ void ieee80211_return_txq(struct ieee802 list_add_tail(&txqi->schedule_order, &local->active_txqs[txq->ac]); } @@ -165,7 +165,7 @@ Signed-off-by: Felix Fietkau spin_unlock_bh(&local->active_txq_lock[txq->ac]); } EXPORT_SYMBOL(ieee80211_schedule_txq); -@@ -3732,7 +3726,7 @@ bool ieee80211_txq_may_transmit(struct i +@@ -3740,7 +3734,7 @@ bool ieee80211_txq_may_transmit(struct i struct sta_info *sta; u8 ac = txq->ac; @@ -174,7 +174,7 @@ Signed-off-by: Felix Fietkau if (!txqi->txq.sta) goto out; -@@ -3762,34 +3756,27 @@ bool ieee80211_txq_may_transmit(struct i +@@ -3770,34 +3764,27 @@ bool ieee80211_txq_may_transmit(struct i sta->airtime[ac].deficit += sta->airtime_weight; list_move_tail(&txqi->schedule_order, &local->active_txqs[ac]); diff --git a/package/kernel/mac80211/patches/subsys/354-mac80211-calculate-hash-for-fq-without-holding-fq-lo.patch b/package/kernel/mac80211/patches/subsys/354-mac80211-calculate-hash-for-fq-without-holding-fq-lo.patch index 4607361395..d1cc04262d 100644 --- a/package/kernel/mac80211/patches/subsys/354-mac80211-calculate-hash-for-fq-without-holding-fq-lo.patch +++ b/package/kernel/mac80211/patches/subsys/354-mac80211-calculate-hash-for-fq-without-holding-fq-lo.patch @@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau flow->backlog += skb->len; --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -1390,11 +1390,15 @@ static void ieee80211_txq_enqueue(struct +@@ -1396,11 +1396,15 @@ static void ieee80211_txq_enqueue(struct { struct fq *fq = &local->fq; struct fq_tin *tin = &txqi->tin; @@ -93,7 +93,7 @@ Signed-off-by: Felix Fietkau } static bool fq_vlan_filter_func(struct fq *fq, struct fq_tin *tin, -@@ -1564,7 +1568,6 @@ static bool ieee80211_queue_skb(struct i +@@ -1570,7 +1574,6 @@ static bool ieee80211_queue_skb(struct i struct sta_info *sta, struct sk_buff *skb) { @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau struct ieee80211_vif *vif; struct txq_info *txqi; -@@ -1582,9 +1585,7 @@ static bool ieee80211_queue_skb(struct i +@@ -1588,9 +1591,7 @@ static bool ieee80211_queue_skb(struct i if (!txqi) return false; @@ -111,7 +111,7 @@ Signed-off-by: Felix Fietkau schedule_and_wake_txq(local, txqi); -@@ -3211,6 +3212,7 @@ static bool ieee80211_amsdu_aggregate(st +@@ -3219,6 +3220,7 @@ static bool ieee80211_amsdu_aggregate(st u8 max_subframes = sta->sta.max_amsdu_subframes; int max_frags = local->hw.max_tx_fragments; int max_amsdu_len = sta->sta.max_amsdu_len; @@ -119,7 +119,7 @@ Signed-off-by: Felix Fietkau int orig_truesize; __be16 len; void *data; -@@ -3233,6 +3235,8 @@ static bool ieee80211_amsdu_aggregate(st +@@ -3241,6 +3243,8 @@ static bool ieee80211_amsdu_aggregate(st max_amsdu_len = min_t(int, max_amsdu_len, sta->sta.max_rc_amsdu_len); @@ -128,7 +128,7 @@ Signed-off-by: Felix Fietkau spin_lock_bh(&fq->lock); /* TODO: Ideally aggregation should be done on dequeue to remain -@@ -3240,7 +3244,8 @@ static bool ieee80211_amsdu_aggregate(st +@@ -3248,7 +3252,8 @@ static bool ieee80211_amsdu_aggregate(st */ tin = &txqi->tin; diff --git a/package/kernel/mac80211/patches/subsys/355-mac80211-run-late-dequeue-late-tx-handlers-without-h.patch b/package/kernel/mac80211/patches/subsys/355-mac80211-run-late-dequeue-late-tx-handlers-without-h.patch index 3109826ed8..ceeb6e41c2 100644 --- a/package/kernel/mac80211/patches/subsys/355-mac80211-run-late-dequeue-late-tx-handlers-without-h.patch +++ b/package/kernel/mac80211/patches/subsys/355-mac80211-run-late-dequeue-late-tx-handlers-without-h.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -3518,6 +3518,7 @@ struct sk_buff *ieee80211_tx_dequeue(str +@@ -3526,6 +3526,7 @@ struct sk_buff *ieee80211_tx_dequeue(str ieee80211_tx_result r; struct ieee80211_vif *vif = txq->vif; @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau spin_lock_bh(&fq->lock); if (test_bit(IEEE80211_TXQ_STOP, &txqi->flags) || -@@ -3534,11 +3535,12 @@ struct sk_buff *ieee80211_tx_dequeue(str +@@ -3542,11 +3543,12 @@ struct sk_buff *ieee80211_tx_dequeue(str if (skb) goto out; @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau hdr = (struct ieee80211_hdr *)skb->data; info = IEEE80211_SKB_CB(skb); -@@ -3602,8 +3604,11 @@ begin: +@@ -3610,8 +3612,11 @@ begin: skb = __skb_dequeue(&tx.skbs); @@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau } if (skb && skb_has_frag_list(skb) && -@@ -3642,6 +3647,7 @@ begin: +@@ -3650,6 +3655,7 @@ begin: } IEEE80211_SKB_CB(skb)->control.vif = vif; diff --git a/package/kernel/mac80211/patches/subsys/358-mac80211-make-ieee80211_schedule_txq-schedule-empty-.patch b/package/kernel/mac80211/patches/subsys/358-mac80211-make-ieee80211_schedule_txq-schedule-empty-.patch index 9c6a7e4f74..d7b3a71236 100644 --- a/package/kernel/mac80211/patches/subsys/358-mac80211-make-ieee80211_schedule_txq-schedule-empty-.patch +++ b/package/kernel/mac80211/patches/subsys/358-mac80211-make-ieee80211_schedule_txq-schedule-empty-.patch @@ -72,7 +72,7 @@ Signed-off-by: Felix Fietkau /** --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -3698,8 +3698,9 @@ out: +@@ -3706,8 +3706,9 @@ out: } EXPORT_SYMBOL(ieee80211_next_txq); @@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau { struct ieee80211_local *local = hw_to_local(hw); struct txq_info *txqi = to_txq_info(txq); -@@ -3707,7 +3708,8 @@ void ieee80211_schedule_txq(struct ieee8 +@@ -3715,7 +3716,8 @@ void ieee80211_schedule_txq(struct ieee8 spin_lock_bh(&local->active_txq_lock[txq->ac]); if (list_empty(&txqi->schedule_order) && @@ -94,7 +94,7 @@ Signed-off-by: Felix Fietkau /* If airtime accounting is active, always enqueue STAs at the * head of the list to ensure that they only get moved to the * back by the airtime DRR scheduler once they have a negative -@@ -3727,7 +3729,7 @@ void ieee80211_schedule_txq(struct ieee8 +@@ -3735,7 +3737,7 @@ void ieee80211_schedule_txq(struct ieee8 spin_unlock_bh(&local->active_txq_lock[txq->ac]); } diff --git a/package/kernel/mac80211/patches/subsys/360-mac80211-when-using-iTXQ-select-the-queue-in-ieee802.patch b/package/kernel/mac80211/patches/subsys/360-mac80211-when-using-iTXQ-select-the-queue-in-ieee802.patch index 6e8cff46ac..1abe82ea6d 100644 --- a/package/kernel/mac80211/patches/subsys/360-mac80211-when-using-iTXQ-select-the-queue-in-ieee802.patch +++ b/package/kernel/mac80211/patches/subsys/360-mac80211-when-using-iTXQ-select-the-queue-in-ieee802.patch @@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -3797,6 +3797,7 @@ void __ieee80211_subif_start_xmit(struct +@@ -3805,6 +3805,7 @@ void __ieee80211_subif_start_xmit(struct u32 ctrl_flags) { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); @@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau struct sta_info *sta; struct sk_buff *next; -@@ -3810,7 +3811,15 @@ void __ieee80211_subif_start_xmit(struct +@@ -3818,7 +3819,15 @@ void __ieee80211_subif_start_xmit(struct if (ieee80211_lookup_ra_sta(sdata, skb, &sta)) goto out_free; diff --git a/package/kernel/mac80211/patches/subsys/368-cfg80211-add-local-BSS-receive-time-to-survey-inform.patch b/package/kernel/mac80211/patches/subsys/368-cfg80211-add-local-BSS-receive-time-to-survey-inform.patch index 651b117c83..aa49e89308 100644 --- a/package/kernel/mac80211/patches/subsys/368-cfg80211-add-local-BSS-receive-time-to-survey-inform.patch +++ b/package/kernel/mac80211/patches/subsys/368-cfg80211-add-local-BSS-receive-time-to-survey-inform.patch @@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau __NL80211_SURVEY_INFO_AFTER_LAST, --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -8379,6 +8379,10 @@ static int nl80211_send_survey(struct sk +@@ -8380,6 +8380,10 @@ static int nl80211_send_survey(struct sk nla_put_u64_64bit(msg, NL80211_SURVEY_INFO_TIME_SCAN, survey->time_scan, NL80211_SURVEY_INFO_PAD)) goto nla_put_failure; From 0d57f8b297aac5daf5a45e06792118663e0cd09f Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 24 Sep 2021 18:38:24 +0200 Subject: [PATCH 10/33] tools/fakeroot: fix build error on macOS Signed-off-by: Felix Fietkau --- tools/fakeroot/patches/100-macos_compile_fix.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tools/fakeroot/patches/100-macos_compile_fix.patch diff --git a/tools/fakeroot/patches/100-macos_compile_fix.patch b/tools/fakeroot/patches/100-macos_compile_fix.patch new file mode 100644 index 0000000000..64c0b472c6 --- /dev/null +++ b/tools/fakeroot/patches/100-macos_compile_fix.patch @@ -0,0 +1,11 @@ +--- a/libfakeroot_inode64.c ++++ b/libfakeroot_inode64.c +@@ -36,6 +36,8 @@ + #include + #endif /* HAVE_FTS_H */ + ++void load_library_symbols(void); ++ + #include "wrapped.h" + #include "wraptmpf.h" + #include "wrapdef.h" From 9b44af1050df6248bddc123e567fab3958eb5d86 Mon Sep 17 00:00:00 2001 From: John Audia Date: Thu, 16 Sep 2021 21:45:35 -0400 Subject: [PATCH 11/33] wireguard-tools: bump to 20210914 Build system: x86_64 Build-tested: bcm2711/RPi4B Run-tested: bcm2711/RPi4B Signed-off-by: John Audia --- package/network/utils/wireguard-tools/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/utils/wireguard-tools/Makefile b/package/network/utils/wireguard-tools/Makefile index 11372f2331..0e460e7afb 100644 --- a/package/network/utils/wireguard-tools/Makefile +++ b/package/network/utils/wireguard-tools/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard-tools -PKG_VERSION:=1.0.20210424 +PKG_VERSION:=1.0.20210914 PKG_RELEASE:=1 PKG_SOURCE:=wireguard-tools-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/wireguard-tools/snapshot/ -PKG_HASH:=b288b0c43871d919629d7e77846ef0b47f8eeaa9ebc9cedeee8233fc6cc376ad +PKG_HASH:=97ff31489217bb265b7ae850d3d0f335ab07d2652ba1feec88b734bc96bd05ac PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING From de598920312deddbfef92113a6a85fbe7e873c88 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Wed, 29 Sep 2021 13:48:04 +0800 Subject: [PATCH 12/33] Revert "build: enable ccache by default" It can cause some magic errors with multiple-threads complation. This reverts commit 9606209e4ab07ae5e400c31c2b341f10f39bb70f. Signed-off-by: Tianling Shen (cherry picked from commit 5fc7782dd41f45f53996d841ff09ac4ca96f2575) --- config/Config-devel.in | 2 +- target/sdk/files/Config.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/Config-devel.in b/config/Config-devel.in index 57031d42f6..a8ea68916f 100644 --- a/config/Config-devel.in +++ b/config/Config-devel.in @@ -63,7 +63,7 @@ menuconfig DEVEL config CCACHE bool "Use ccache" if DEVEL - default y + default n help Compiler cache; see https://ccache.samba.org/ diff --git a/target/sdk/files/Config.in b/target/sdk/files/Config.in index abf5b70fae..f687992497 100644 --- a/target/sdk/files/Config.in +++ b/target/sdk/files/Config.in @@ -102,7 +102,7 @@ menu "Advanced configuration options (for developers)" config CCACHE bool "Use ccache" - default y + default n help Compiler cache; see https://ccache.samba.org/ From 22290dc38d232d7940acfbf78f80b2e42ddd2540 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Tue, 28 Sep 2021 15:03:24 +0200 Subject: [PATCH 13/33] prereq-build: recognize Python 3.10 Fedora 35 contains Python 3.10 as default version. Make use of it. Signed-off-by: Marcin Juszkiewicz [fix commit subject] Signed-off-by: Paul Spooren --- include/prereq-build.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 922e7c544b..9242407b18 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -157,6 +157,7 @@ $(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \ $(eval $(call CleanupPython2)) $(eval $(call SetupHostCommand,python,Please install Python >= 3.6, \ + python3.10 -V 2>&1 | grep 'Python 3', \ python3.9 -V 2>&1 | grep 'Python 3', \ python3.8 -V 2>&1 | grep 'Python 3', \ python3.7 -V 2>&1 | grep 'Python 3', \ @@ -164,6 +165,7 @@ $(eval $(call SetupHostCommand,python,Please install Python >= 3.6, \ python3 -V 2>&1 | grep -E 'Python 3\.[6-9]\.?')) $(eval $(call SetupHostCommand,python3,Please install Python >= 3.6, \ + python3.10 -V 2>&1 | grep 'Python 3', \ python3.9 -V 2>&1 | grep 'Python 3', \ python3.8 -V 2>&1 | grep 'Python 3', \ python3.7 -V 2>&1 | grep 'Python 3', \ From 94ecc7dfdaedc70d718487c83a21387b14f329dd Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Thu, 30 Sep 2021 05:05:38 +0800 Subject: [PATCH 14/33] treewide: disable 4M devices build Signed-off-by: Tianling Shen --- target/linux/ath25/image/Makefile | 1 + target/linux/ath79/image/tiny.mk | 1 + 2 files changed, 2 insertions(+) diff --git a/target/linux/ath25/image/Makefile b/target/linux/ath25/image/Makefile index 8fd3b554e1..f273467db0 100644 --- a/target/linux/ath25/image/Makefile +++ b/target/linux/ath25/image/Makefile @@ -81,6 +81,7 @@ TARGET_DEVICES += ubnt2-pico2 define Device/ubnt2 DEVICE_TITLE := Ubiquiti XS2 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkfwimage XS2 -v XS2.ar2316 + DEFAULT := n endef TARGET_DEVICES += ubnt2 diff --git a/target/linux/ath79/image/tiny.mk b/target/linux/ath79/image/tiny.mk index 41f1eb4305..9f4f89bd9a 100644 --- a/target/linux/ath79/image/tiny.mk +++ b/target/linux/ath79/image/tiny.mk @@ -12,6 +12,7 @@ define Device/buffalo_whr-g301n buffalo-tag WHR-G301N 3 IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header SUPPORTED_DEVICES += whr-g301n + DEFAULT := n endef TARGET_DEVICES += buffalo_whr-g301n From dc1e2d5ebe6a2f83c3eb7a51236428a6a71eb03c Mon Sep 17 00:00:00 2001 From: Biwen Li Date: Mon, 14 Oct 2019 12:42:32 +0800 Subject: [PATCH 15/33] kernel: layerscape: fix compilation error This fixes a compilation error as follows: drivers/staging/fsl_qbman/qman_config.c:815:29: error: bitwise comparison always evaluates to false [-Werror=tautological-compare] if ((qman_ip_rev & 0xFF00) == QMAN_REV31) { Signed-off-by: Biwen Li (cherry picked from commit 53b73131e9b38bcae556555de53203d52321794c) --- ...-Fix-error-in-IP-revision-comparison.patch | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 target/linux/layerscape/patches-4.14/713-sdk_qbman-Fix-error-in-IP-revision-comparison.patch diff --git a/target/linux/layerscape/patches-4.14/713-sdk_qbman-Fix-error-in-IP-revision-comparison.patch b/target/linux/layerscape/patches-4.14/713-sdk_qbman-Fix-error-in-IP-revision-comparison.patch new file mode 100644 index 0000000000..b310e26855 --- /dev/null +++ b/target/linux/layerscape/patches-4.14/713-sdk_qbman-Fix-error-in-IP-revision-comparison.patch @@ -0,0 +1,28 @@ +From b43b4fdd5caa4f66fd712c77589c167c952ec659 Mon Sep 17 00:00:00 2001 +From: Roy Pledge +Date: Mon, 6 May 2019 11:18:57 -0400 +Subject: [PATCH] sdk_qbman: Fix error in IP revision comparison + +The comparison for QMAN_REV31 was incorrect as it +would always fail due to the wrong mask. + +This fixes the following error in newer GCC versions: +"error: bitwise comparison always evaluates to false + [-Werror=tautological-compare]" + +Signed-off-by: Roy Pledge +--- + drivers/staging/fsl_qbman/qman_config.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/fsl_qbman/qman_config.c ++++ b/drivers/staging/fsl_qbman/qman_config.c +@@ -812,7 +812,7 @@ int qman_set_sdest(u16 channel, unsigned + + if (!qman_have_ccsr()) + return -ENODEV; +- if ((qman_ip_rev & 0xFF00) == QMAN_REV31) { ++ if ((qman_ip_rev & 0xFFFF) == QMAN_REV31) { + /* LS1043A - only one L2 cache */ + cpu_idx = 0; + } From 0d849b3340b53876cb44e17de5980fc1baf08830 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Wed, 12 Jun 2019 14:11:32 +0800 Subject: [PATCH 16/33] layerscape: drop pause frame support for aquantia phy An aquantia phy patch which dropped pause frame support was missing when integrated LSDK-19.03 kernel patches into OpenWrt. Without this patch, LS1043A 10G port would not work. So apply it. Patch link https://source.codeaurora.org/external/qoriq/qoriq-components/ linux/commit/?h=linux-4.14&id=66346b115818365cfaf99d292871b19f0a1d2850 Signed-off-by: Yangbo Lu (cherry picked from commit 94a1999b4feed6cfc57513252407ea85fc8e91fb) --- .../709-mdio-phy-support-layerscape.patch | 62 +++---------------- 1 file changed, 10 insertions(+), 52 deletions(-) diff --git a/target/linux/layerscape/patches-4.14/709-mdio-phy-support-layerscape.patch b/target/linux/layerscape/patches-4.14/709-mdio-phy-support-layerscape.patch index 9ef6f985ed..9eadf2bfda 100644 --- a/target/linux/layerscape/patches-4.14/709-mdio-phy-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/709-mdio-phy-support-layerscape.patch @@ -1,4 +1,4 @@ -From 83fe1ecb8ac6e0544ae74bf5a63806dcac768201 Mon Sep 17 00:00:00 2001 +From c24cbb648c5bde8312dbd5498a4b8c12b2692205 Mon Sep 17 00:00:00 2001 From: Biwen Li Date: Wed, 17 Apr 2019 18:58:45 +0800 Subject: [PATCH] mdio-phy: support layerscape @@ -22,17 +22,17 @@ Signed-off-by: Vladimir Oltean --- drivers/net/phy/Kconfig | 33 + drivers/net/phy/Makefile | 5 + - drivers/net/phy/aquantia.c | 328 +++- + drivers/net/phy/aquantia.c | 286 ++++- drivers/net/phy/at803x.c | 21 + - drivers/net/phy/fsl_backplane.c | 1780 ++++++++++++++++++++ + drivers/net/phy/fsl_backplane.c | 1780 ++++++++++++++++++++++++++++ drivers/net/phy/fsl_backplane.h | 41 + - drivers/net/phy/fsl_backplane_serdes_10g.c | 281 +++ - drivers/net/phy/fsl_backplane_serdes_28g.c | 336 ++++ - drivers/net/phy/inphi.c | 594 +++++++ + drivers/net/phy/fsl_backplane_serdes_10g.c | 281 +++++ + drivers/net/phy/fsl_backplane_serdes_28g.c | 336 ++++++ + drivers/net/phy/inphi.c | 594 ++++++++++ drivers/net/phy/mdio-mux-multiplexer.c | 122 ++ drivers/net/phy/swphy.c | 1 + include/linux/phy.h | 3 + - 12 files changed, 3526 insertions(+), 19 deletions(-) + 12 files changed, 3484 insertions(+), 19 deletions(-) create mode 100644 drivers/net/phy/fsl_backplane.c create mode 100644 drivers/net/phy/fsl_backplane.h create mode 100644 drivers/net/phy/fsl_backplane_serdes_10g.c @@ -131,14 +131,12 @@ Signed-off-by: Vladimir Oltean * * This file is licensed under the terms of the GNU General Public License * version 2. This program is licensed "as is" without any warranty of any -@@ -27,15 +28,200 @@ +@@ -27,15 +28,174 @@ #define PHY_AQUANTIA_FEATURES (SUPPORTED_10000baseT_Full | \ SUPPORTED_1000baseT_Full | \ + SUPPORTED_2500baseX_Full | \ SUPPORTED_100baseT_Full | \ -+ SUPPORTED_Pause | \ -+ SUPPORTED_Asym_Pause | \ PHY_DEFAULT_FEATURES) +#define MDIO_PMA_CTRL1_AQ_SPEED10 0 @@ -151,11 +149,6 @@ Signed-off-by: Vladimir Oltean +#define MDIO_AN_VENDOR_PROV_CTRL 0xc400 +#define MDIO_AN_RECV_LP_STATUS 0xe820 + -+#define MDIO_AN_LPA_PAUSE 0x20 -+#define MDIO_AN_LPA_ASYM_PAUSE 0x10 -+#define MDIO_AN_ADV_PAUSE 0x20 -+#define MDIO_AN_ADV_ASYM_PAUSE 0x10 -+ +static int aquantia_write_reg(struct phy_device *phydev, int devad, + u32 regnum, u16 val) +{ @@ -291,25 +284,6 @@ Signed-off-by: Vladimir Oltean + changed = 1; + } + -+ /* advertise flow control */ -+ oldadv = aquantia_read_reg(phydev, MDIO_MMD_AN, MDIO_AN_ADVERTISE); -+ if (oldadv < 0) -+ return oldadv; -+ -+ adv = oldadv & ~(MDIO_AN_ADV_PAUSE | MDIO_AN_ADV_ASYM_PAUSE); -+ if (advertise & ADVERTISED_Pause) -+ adv |= MDIO_AN_ADV_PAUSE; -+ if (advertise & ADVERTISED_Asym_Pause) -+ adv |= MDIO_AN_ADV_ASYM_PAUSE; -+ -+ if (adv != oldadv) { -+ err = aquantia_write_reg(phydev, MDIO_MMD_AN, -+ MDIO_AN_ADVERTISE, adv); -+ if (err < 0) -+ return err; -+ changed = 1; -+ } -+ + return changed; +} + @@ -334,7 +308,7 @@ Signed-off-by: Vladimir Oltean } static int aquantia_aneg_done(struct phy_device *phydev) -@@ -51,25 +237,26 @@ static int aquantia_config_intr(struct p +@@ -51,25 +211,26 @@ static int aquantia_config_intr(struct p int err; if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { @@ -367,7 +341,7 @@ Signed-off-by: Vladimir Oltean } return err; -@@ -79,42 +266,145 @@ static int aquantia_ack_interrupt(struct +@@ -79,42 +240,129 @@ static int aquantia_ack_interrupt(struct { int reg; @@ -403,18 +377,6 @@ Signed-off-by: Vladimir Oltean + phydev->advertising |= ADVERTISED_2500baseX_Full; + else + phydev->advertising &= ~ADVERTISED_2500baseX_Full; -+ -+ /* flow control advertisement */ -+ adv = aquantia_read_reg(phydev, MDIO_MMD_AN, MDIO_AN_ADVERTISE); -+ if (adv & MDIO_AN_ADV_PAUSE) -+ phydev->advertising |= ADVERTISED_Pause; -+ else -+ phydev->advertising &= ~ADVERTISED_Pause; -+ if (adv & MDIO_AN_ADV_ASYM_PAUSE) -+ phydev->advertising |= ADVERTISED_Asym_Pause; -+ else -+ phydev->advertising &= ~ADVERTISED_Asym_Pause; -+ + return 0; +} + @@ -514,10 +476,6 @@ Signed-off-by: Vladimir Oltean + phydev->duplex = DUPLEX_FULL; -+ reg = aquantia_read_reg(phydev, MDIO_MMD_AN, MDIO_AN_LPA); -+ phydev->pause = reg & MDIO_AN_LPA_PAUSE ? 1 : 0; -+ phydev->asym_pause = reg & MDIO_AN_LPA_ASYM_PAUSE ? 1 : 0; -+ + aquantia_read_advert(phydev); + aquantia_read_lp_advert(phydev); + From e55f67150eb57b8c9c258fa57a13fe6d6609e16c Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Thu, 30 Sep 2021 05:17:53 +0800 Subject: [PATCH 17/33] layerscape: drop redudant patches Signed-off-by: Tianling Shen --- .../patches-4.14/818-qspi-support-layerscape.patch | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/target/linux/layerscape/patches-4.14/818-qspi-support-layerscape.patch b/target/linux/layerscape/patches-4.14/818-qspi-support-layerscape.patch index c5559f28b2..b41fd95b07 100644 --- a/target/linux/layerscape/patches-4.14/818-qspi-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/818-qspi-support-layerscape.patch @@ -730,14 +730,3 @@ Signed-off-by: Yogesh Gaur { "w25x32", INFO(0xef3016, 0, 64 * 1024, 64, SECT_4K) }, { "w25q20cl", INFO(0xef4012, 0, 64 * 1024, 4, SECT_4K) }, { "w25q20bw", INFO(0xef5012, 0, 64 * 1024, 4, SECT_4K) }, ---- a/drivers/spi/spi-fsl-dspi.c -+++ b/drivers/spi/spi-fsl-dspi.c -@@ -1033,7 +1033,7 @@ static int dspi_probe(struct platform_de - goto out_clk_put; - } - -- ret = request_threaded_irq(dspi->irq, dspi_interrupt, NULL, -+ ret = devm_request_irq(&pdev->dev, dspi->irq, dspi_interrupt, - IRQF_SHARED, pdev->name, dspi); - if (ret < 0) { - dev_err(&pdev->dev, "Unable to attach DSPI interrupt\n"); From 85c98e59204dcec4f6dc03268e6eaf162c84d5dd Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Thu, 30 Sep 2021 05:22:40 +0800 Subject: [PATCH 18/33] omap: fix name of uboot file Signed-off-by: Tianling Shen --- target/linux/omap/image/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/omap/image/Makefile b/target/linux/omap/image/Makefile index 5d024e1146..4d2edf1c20 100644 --- a/target/linux/omap/image/Makefile +++ b/target/linux/omap/image/Makefile @@ -19,7 +19,7 @@ define Build/omap-sdcard mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)/MLO ::MLO mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)/u-boot.img ::u-boot.img - mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)/uEnv.txt ::uEnv.txt + mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)/boot.scr ::boot.scr mmd -i $@.boot ::/dtbs mcopy -i $@.boot $(DTS_DIR)/$(DEVICE_DTS).dtb ::/dtbs/$(DEVICE_DTS).dtb mcopy -i $@.boot $(IMAGE_KERNEL) ::/zImage From 04de9d5b378f055aba30827cd709663757dac2a5 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Mon, 27 Sep 2021 23:09:20 +0800 Subject: [PATCH 19/33] exfat: fix build on kernel 4.9 and 4.14 Fixes: #477 --- .../patches/001-fix-build-on-kernel-4.x.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 package/kernel/exfat/patches/001-fix-build-on-kernel-4.x.patch diff --git a/package/kernel/exfat/patches/001-fix-build-on-kernel-4.x.patch b/package/kernel/exfat/patches/001-fix-build-on-kernel-4.x.patch new file mode 100644 index 0000000000..391d27355e --- /dev/null +++ b/package/kernel/exfat/patches/001-fix-build-on-kernel-4.x.patch @@ -0,0 +1,14 @@ +--- a/balloc.c ++++ b/balloc.c +@@ -7,8 +7,10 @@ + #include + #include + #include +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) + #include ++#else ++#include + #endif + + #include "exfat_raw.h" From dd4890c9a45a5c9c06dbc1928acabf6f7610f8a2 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Sat, 18 Sep 2021 23:10:40 +0800 Subject: [PATCH 20/33] ramips: add support for JCG JHR-AC945M Hardware specs: SoC: MediaTek MT7621AT Flash: SPI NOR 16MB RAM: DDR3 256MB 2.4GHz: MT7615N bgn 4x4 5GHz: MT7615N nac 4x4 Ethernet: 1 x WAN and 4 x LAN USB: 1 x 3.0 Button: Reset, WPS Unsupported chips: ATMEGA328P-AU HCLTEK HT1621B Flash instructions: Upload factory.bin in stock firmware's upgrade page. Signed-off-by: AmadeusGhost --- .../ramips/dts/mt7621_jcg_jhr-ac945m.dts | 106 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 15 ++- .../mt7621/base-files/etc/board.d/02_network | 2 + 3 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/mt7621_jcg_jhr-ac945m.dts diff --git a/target/linux/ramips/dts/mt7621_jcg_jhr-ac945m.dts b/target/linux/ramips/dts/mt7621_jcg_jhr-ac945m.dts new file mode 100644 index 0000000000..7a70ed9166 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_jcg_jhr-ac945m.dts @@ -0,0 +1,106 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "jcg,jhr-ac945m", "mediatek,mt7621-soc"; + model = "JCG JHR-AC945M"; + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <80000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0xe000>; +}; + +&state_default { + gpio { + ralink,group = "jtag", "wdt"; + ralink,function = "gpio"; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 45b6fb1a2f..baceba5bd9 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -445,6 +445,18 @@ define Device/jcg_jhr-ac876m endef TARGET_DEVICES += jcg_jhr-ac876m +define Device/jcg_jhr-ac945m + IMAGE_SIZE := 16064k + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ + jcg-header 91.1 + JCG_MAXSIZE := 16064k + DEVICE_VENDOR := JCG + DEVICE_MODEL := JHR-AC945M + DEVICE_PACKAGES := kmod-mt7615e kmod-usb3 wpad-openssl +endef +TARGET_DEVICES += jcg_jhr-ac945m + define Device/jcg_y2 IMAGE_SIZE := 16064k IMAGES += factory.bin @@ -461,7 +473,8 @@ define Device/jdcloud_re-sp-01b IMAGE_SIZE := 27328k DEVICE_VENDOR := JDCloud DEVICE_MODEL := RE-SP-01B - DEVICE_PACKAGES := kmod-fs-ext4 kmod-mt7603 kmod-mt7615e kmod-sdhci-mt7620 kmod-usb3 wpad-openssl + DEVICE_PACKAGES := kmod-fs-ext4 kmod-mt7603 kmod-mt7615e kmod-sdhci-mt7620 \ + kmod-usb3 wpad-openssl endef TARGET_DEVICES += jdcloud_re-sp-01b diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index de8a1e544d..4da6ad5904 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -14,6 +14,7 @@ ramips_setup_interfaces() d-team,pbr-m1|\ firefly,firewrt|\ jcg,jhr-ac876m|\ + jcg,jhr-ac945m|\ mediatek,ap-mt7621a-v60|\ mediatek,mt7621-eval-board|\ mqmaker,witi|\ @@ -272,6 +273,7 @@ ramips_setup_macs() label_mac=$(mtd_get_mac_binary factory 0x4) wan_mac=$label_mac ;; + jcg,jhr-ac945m|\ jcg,y2|\ zbtlink,zbt-we1326) wan_mac=$(mtd_get_mac_binary factory 0xe006) From b00e8177c7178eadf94939945154cb6bc6a18148 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 2 Oct 2021 11:06:42 +0800 Subject: [PATCH 21/33] autocore: drop project link Drop this stupid design. Signed-off-by: Tianling Shen --- package/emortal/autocore/files/arm/index.htm | 3 --- package/emortal/autocore/files/x86/index.htm | 3 --- 2 files changed, 6 deletions(-) diff --git a/package/emortal/autocore/files/arm/index.htm b/package/emortal/autocore/files/arm/index.htm index b7da0f75e9..755793ac61 100644 --- a/package/emortal/autocore/files/arm/index.htm +++ b/package/emortal/autocore/files/arm/index.htm @@ -710,9 +710,6 @@ <%:Uptime%>- <%:Load Average%>- <%:CPU usage (%)%>- - <%:Source Code%> - Project ImmortalWrt / ImmortalWrt Core - diff --git a/package/emortal/autocore/files/x86/index.htm b/package/emortal/autocore/files/x86/index.htm index 6506f87bf3..7e0edfb27a 100644 --- a/package/emortal/autocore/files/x86/index.htm +++ b/package/emortal/autocore/files/x86/index.htm @@ -724,9 +724,6 @@ <%:Uptime%>- <%:Load Average%>- <%:CPU usage (%)%>- - <%:Source Code%> - Project ImmortalWrt / ImmortalWrt Core - From 8af77773f4768fdd4e34686ba97676c60c69f19b Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Fri, 1 Oct 2021 15:56:27 -1000 Subject: [PATCH 22/33] build: fix `which` detection on Fedora & MacOS Fix Fedora 34/35 issue where 'which' detection of 'which' wasn't working because Fedora use alias and proc Fixup of fca5ad55d2 prereq-build: fix `which` detection on Fedora Reported-by: Jani Partanen Suggest-by: Etienne Champetier Tested-by: Georgi Valkov Signed-off-by: Paul Spooren --- include/prereq-build.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 9242407b18..e1993444f7 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -186,7 +186,9 @@ $(eval $(call SetupHostCommand,rsync,Please install 'rsync', \ rsync --version Date: Thu, 30 Sep 2021 23:03:18 +0800 Subject: [PATCH 23/33] fstools: backport changes to fix build error Backport: "fstoools: add define for GLOB_ONLYDIR" Fixes: #478 --- .../0020-add-define-for-GLOB_ONLYDIR.patch | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 package/system/fstools/patches/0020-add-define-for-GLOB_ONLYDIR.patch diff --git a/package/system/fstools/patches/0020-add-define-for-GLOB_ONLYDIR.patch b/package/system/fstools/patches/0020-add-define-for-GLOB_ONLYDIR.patch new file mode 100644 index 0000000000..2208f1dff1 --- /dev/null +++ b/package/system/fstools/patches/0020-add-define-for-GLOB_ONLYDIR.patch @@ -0,0 +1,32 @@ +From 5345343828df944ae247d91cc77182f87559bc9a Mon Sep 17 00:00:00 2001 +From: Rosen Penev +Date: Wed, 25 Mar 2020 16:27:47 -0700 +Subject: [PATCH] fstoools: add define for GLOB_ONLYDIR + +This was originally a patch for musl. It is not present in musl as it is a +GNU extension. + +Place it here where it belongs. + +Signed-off-by: Rosen Penev +--- + libfstools/overlay.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/libfstools/overlay.c b/libfstools/overlay.c +index 14214a3..39215d5 100644 +--- a/libfstools/overlay.c ++++ b/libfstools/overlay.c +@@ -30,6 +30,10 @@ + #include "libfstools.h" + #include "volume.h" + ++#ifndef GLOB_ONLYDIR ++#define GLOB_ONLYDIR 0x100 ++#endif ++ + #define SWITCH_JFFS2 "/tmp/.switch_jffs2" + + static bool keep_sysupgrade; +-- +2.20.1 From 28a3a745d26fba60d9cb31eb2a2d11a81d78f6e1 Mon Sep 17 00:00:00 2001 From: Paul Fertser Date: Sat, 25 Sep 2021 14:00:23 +0300 Subject: [PATCH 24/33] dnsmasq: add explicit "set:" for client-matching options Bring the usage in line with the dnsmasq man page and the other options where set: is mandatory. No functional change. Signed-off-by: Paul Fertser --- package/network/services/dnsmasq/files/dnsmasq.init | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 8b6cf00a5d..47fb5e7d56 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -241,7 +241,7 @@ dhcp_subscrid_add() { config_get subscriberid "$cfg" subscriberid [ -n "$subscriberid" ] || return 0 - xappend "--dhcp-subscrid=$networkid,$subscriberid" + xappend "--dhcp-subscrid=set:$networkid,$subscriberid" config_get_bool force "$cfg" force 0 @@ -257,7 +257,7 @@ dhcp_remoteid_add() { config_get remoteid "$cfg" remoteid [ -n "$remoteid" ] || return 0 - xappend "--dhcp-remoteid=$networkid,$remoteid" + xappend "--dhcp-remoteid=set:$networkid,$remoteid" config_get_bool force "$cfg" force 0 @@ -274,7 +274,7 @@ dhcp_circuitid_add() { config_get circuitid "$cfg" circuitid [ -n "$circuitid" ] || return 0 - xappend "--dhcp-circuitid=$networkid,$circuitid" + xappend "--dhcp-circuitid=set:$networkid,$circuitid" config_get_bool force "$cfg" force 0 @@ -290,7 +290,7 @@ dhcp_userclass_add() { config_get userclass "$cfg" userclass [ -n "$userclass" ] || return 0 - xappend "--dhcp-userclass=$networkid,$userclass" + xappend "--dhcp-userclass=set:$networkid,$userclass" config_get_bool force "$cfg" force 0 @@ -307,7 +307,7 @@ dhcp_vendorclass_add() { config_get vendorclass "$cfg" vendorclass [ -n "$vendorclass" ] || return 0 - xappend "--dhcp-vendorclass=$networkid,$vendorclass" + xappend "--dhcp-vendorclass=set:$networkid,$vendorclass" config_get_bool force "$cfg" force 0 @@ -323,7 +323,7 @@ dhcp_match_add() { config_get match "$cfg" match [ -n "$match" ] || return 0 - xappend "--dhcp-match=$networkid,$match" + xappend "--dhcp-match=set:$networkid,$match" config_get_bool force "$cfg" force 0 From 8b13396ce6b9d9c48784ebe9fd6ed23b53adbfcb Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Sun, 3 Oct 2021 21:23:04 +0300 Subject: [PATCH 25/33] busybox: update to 1.34.1 Update busybox to version 1.34.1, which is a minor maintenance release. It contains just the two post-1.34.0 upstream patches that we earlier backported plus a few fixes to awk. * Remove the two backported upstream patches that are now unnecessary. Signed-off-by: Hannu Nyman --- package/utils/busybox/Makefile | 4 +- ...-backport-fix-build-breakage-on-mips.patch | 37 --------- ...02-backport-ash-process-substitution.patch | 77 ------------------- 3 files changed, 2 insertions(+), 116 deletions(-) delete mode 100644 package/utils/busybox/patches/001-backport-fix-build-breakage-on-mips.patch delete mode 100644 package/utils/busybox/patches/002-backport-ash-process-substitution.patch diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 936aea5b71..5d34abfc24 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -5,14 +5,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox -PKG_VERSION:=1.34.0 +PKG_VERSION:=1.34.1 PKG_RELEASE:=$(AUTORELEASE) PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://www.busybox.net/downloads \ http://sources.buildroot.net -PKG_HASH:=ec8d1615edb045b83b81966604759c4d4ac921434ab4011da604f629c06074ce +PKG_HASH:=415fbd89e5344c96acf449d94a6f956dbed62e18e835fc83e064db33a34bd549 PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_PAM:libpam PKG_BUILD_PARALLEL:=1 diff --git a/package/utils/busybox/patches/001-backport-fix-build-breakage-on-mips.patch b/package/utils/busybox/patches/001-backport-fix-build-breakage-on-mips.patch deleted file mode 100644 index 354e3e511a..0000000000 --- a/package/utils/busybox/patches/001-backport-fix-build-breakage-on-mips.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 00adcdb64a5487f0ea6b400d912dcf7c58637696 Mon Sep 17 00:00:00 2001 -From: Denys Vlasenko -Date: Fri, 20 Aug 2021 13:33:50 +0200 -Subject: udhcp: fix build breakage on MIPS - -Signed-off-by: Denys Vlasenko ---- - networking/udhcp/common.h | 12 ------------ - 1 file changed, 12 deletions(-) - -diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h -index 8c678dd32..ca778dab8 100644 ---- a/networking/udhcp/common.h -+++ b/networking/udhcp/common.h -@@ -304,18 +304,6 @@ void udhcp_dump_packet(struct dhcp_packet *packet) FAST_FUNC; - # define log3s(msg) ((void)0) - #endif - --#if defined(__mips__) --/* -- * The 'simple' message functions have a negative impact on the size of the -- * DHCP code when compiled for MIPS, so don't use them in this case. -- */ --#define bb_simple_info_msg bb_info_msg --#define bb_simple_error_msg bb_error_msg --#define bb_simple_perror_msg_and_die bb_perror_msg_and_die --#undef log1s --#define log1s log1 --#endif -- - /*** Other shared functions ***/ - - /* 2nd param is "uint32_t*" */ --- -cgit v1.2.3 - - diff --git a/package/utils/busybox/patches/002-backport-ash-process-substitution.patch b/package/utils/busybox/patches/002-backport-ash-process-substitution.patch deleted file mode 100644 index 5b348ea26b..0000000000 --- a/package/utils/busybox/patches/002-backport-ash-process-substitution.patch +++ /dev/null @@ -1,77 +0,0 @@ -Stacy Harper reports that this script: - - test() { . /tmp/bb_test; } - echo "export TEST=foo" >/tmp/bb_test - test 2>/dev/null - echo "$TEST" - -correctly prints 'foo' in BusyBox 1.33 but hangs in 1.34. - -Bisection suggested the problem was caused by commit a1b0d3856 (ash: add -process substitution in bash-compatibility mode). Removing the call to -unwindredir() in cmdloop() introduced in that commit makes the script -work again. - -Additionally, these examples of process substitution: - - while true; do cat <(echo hi); done - f() { while true; do cat <(echo hi); done } - f - -result in running out of file descriptors. This is a regression from -v5 of the process substitution patch caused by changes to evalcommand() -not being transferred to v6. - -function old new delta -static.pushredir - 99 +99 -evalcommand 1729 1750 +21 -exitreset 69 86 +17 -cmdloop 372 365 -7 -unwindredir 28 - -28 -pushredir 112 - -112 ------------------------------------------------------------------------------- -(add/remove: 1/2 grow/shrink: 2/1 up/down: 137/-147) Total: -10 bytes - -Signed-off-by: Ron Yorston ---- - shell/ash.c | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) - -diff --git a/shell/ash.c b/shell/ash.c -index b5947147a..53c140930 100644 ---- a/shell/ash.c -+++ b/shell/ash.c -@@ -10278,6 +10278,9 @@ evalcommand(union node *cmd, int flags) - - /* First expand the arguments. */ - TRACE(("evalcommand(0x%lx, %d) called\n", (long)cmd, flags)); -+#if BASH_PROCESS_SUBST -+ redir_stop = redirlist; -+#endif - file_stop = g_parsefile; - back_exitstatus = 0; - -@@ -10356,7 +10359,11 @@ evalcommand(union node *cmd, int flags) - lastarg = nargv[-1]; - - expredir(cmd->ncmd.redirect); -+#if !BASH_PROCESS_SUBST - redir_stop = pushredir(cmd->ncmd.redirect); -+#else -+ pushredir(cmd->ncmd.redirect); -+#endif - preverrout_fd = 2; - if (BASH_XTRACEFD && xflag) { - /* NB: bash closes fd == $BASH_XTRACEFD when it is changed. -@@ -13476,9 +13483,6 @@ cmdloop(int top) - #if JOBS - if (doing_jobctl) - showjobs(SHOW_CHANGED|SHOW_STDERR); --#endif --#if BASH_PROCESS_SUBST -- unwindredir(NULL); - #endif - inter = 0; - if (iflag && top) { --- -2.31.1 From 3f3da66abed01cb4505c78aeb9823de29115367d Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 4 Oct 2021 18:30:12 -0700 Subject: [PATCH 26/33] tools/bison: update to 3.8.2 Signed-off-by: Rosen Penev --- tools/bison/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/bison/Makefile b/tools/bison/Makefile index ba3dd946ec..5f96463ae0 100644 --- a/tools/bison/Makefile +++ b/tools/bison/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bison -PKG_VERSION:=3.8.1 +PKG_VERSION:=3.8.2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/$(PKG_NAME) -PKG_HASH:=31fc602488aad6bdecf0ccc556e0fc72fc57cdc595cf92398f020e0cf4980f15 +PKG_HASH:=9bba0214ccf7f1079c5d59210045227bcf619519840ebfa80cd3849cff5a5bf2 HOST_BUILD_PARALLEL:=1 From 0b24cf0aef66f6bcf9c36fc92d26bf55d943a18a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 4 Oct 2021 18:30:33 -0700 Subject: [PATCH 27/33] tools/cmake: update to 3.21.3 Signed-off-by: Rosen Penev --- tools/cmake/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile index 49dc61ee34..df61c83158 100644 --- a/tools/cmake/Makefile +++ b/tools/cmake/Makefile @@ -7,14 +7,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cmake -PKG_VERSION:=3.21.2 +PKG_VERSION:=3.21.3 PKG_RELEASE:=1 PKG_CPE_ID:=cpe:/a:kitware:cmake PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/Kitware/CMake/releases/download/v$(PKG_VERSION)/ \ https://cmake.org/files/v3.19/ -PKG_HASH:=94275e0b61c84bb42710f5320a23c6dcb2c6ee032ae7d2a616f53f68b3d21659 +PKG_HASH:=d14d06df4265134ee42c4d50f5a60cb8b471b7b6a47da8e5d914d49dd783794f HOST_BUILD_PARALLEL:=1 HOST_CONFIGURE_PARALLEL:=1 From f515495d6ab6ac3012019e13e17636f5998316bc Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Thu, 7 Oct 2021 09:18:04 +0800 Subject: [PATCH 28/33] r8125: Update to 9.006.04 Signed-off-by: Tianling Shen (cherry picked from commit 47e884d6a3bc3f782b177b2a266a41057dcfd759) --- package/kernel/r8125/src/Makefile | 8 + package/kernel/r8125/src/r8125.h | 251 ++++- package/kernel/r8125/src/r8125_n.c | 1408 +++++++++++++++----------- package/kernel/r8125/src/r8125_rss.c | 3 - package/kernel/r8125/src/r8125_rss.h | 3 + package/kernel/r8125/src/rtltool.c | 39 - 6 files changed, 1073 insertions(+), 639 deletions(-) diff --git a/package/kernel/r8125/src/Makefile b/package/kernel/r8125/src/Makefile index 3c57e3b0bd..514c0acdda 100644 --- a/package/kernel/r8125/src/Makefile +++ b/package/kernel/r8125/src/Makefile @@ -47,6 +47,8 @@ ENABLE_PTP_MASTER_MODE = n ENABLE_RSS_SUPPORT = y ENABLE_LIB_SUPPORT = n ENABLE_USE_FIRMWARE_FILE = n +DISABLE_PM_SUPPORT = n +DISABLE_MULTI_MSIX_VECTOR = n ifneq ($(KERNELRELEASE),) obj-m := r8125.o @@ -111,6 +113,12 @@ ifneq ($(KERNELRELEASE),) r8125-objs += r8125_firmware.o EXTRA_CFLAGS += -DENABLE_USE_FIRMWARE_FILE endif + ifeq ($(DISABLE_PM_SUPPORT), y) + EXTRA_CFLAGS += -DDISABLE_PM_SUPPORT + endif + ifeq ($(DISABLE_MULTI_MSIX_VECTOR), y) + EXTRA_CFLAGS += -DDISABLE_MULTI_MSIX_VECTOR + endif else BASEDIR := /lib/modules/$(shell uname -r) KERNELDIR ?= $(BASEDIR)/build diff --git a/package/kernel/r8125/src/r8125.h b/package/kernel/r8125/src/r8125.h index d05d6883a4..6dd541d4ab 100644 --- a/package/kernel/r8125/src/r8125.h +++ b/package/kernel/r8125/src/r8125.h @@ -363,7 +363,7 @@ do { \ #define RSS_SUFFIX "" #endif -#define RTL8125_VERSION "9.005.06" NAPI_SUFFIX DASH_SUFFIX REALWOW_SUFFIX PTP_SUFFIX RSS_SUFFIX +#define RTL8125_VERSION "9.006.04" NAPI_SUFFIX DASH_SUFFIX REALWOW_SUFFIX PTP_SUFFIX RSS_SUFFIX #define MODULENAME "r8125" #define PFX MODULENAME ": " @@ -469,7 +469,7 @@ This is free software, and you are welcome to redistribute it under certain cond #define OCP_STD_PHY_BASE 0xa400 #ifdef ENABLE_LIB_SUPPORT -#define R8125_MULTI_RX_Q(tp) 1 +#define R8125_MULTI_RX_Q(tp) 0 #else #define R8125_MULTI_RX_Q(tp) (tp->num_rx_rings > 1) #endif @@ -542,6 +542,8 @@ This is free software, and you are welcome to redistribute it under certain cond #define RTK_ADVERTISE_2500FULL 0x80 #define RTK_LPA_ADVERTISE_2500FULL 0x20 +#define RTK_LPA_ADVERTISE_5000FULL 0x40 +#define RTK_LPA_ADVERTISE_10000FULL 0x800 /* Tx NO CLOSE */ #define MAX_TX_NO_CLOSE_DESC_PTR_V2 0x10000 @@ -1201,16 +1203,24 @@ enum RTL8125_registers { TIMER_INT3_8125 = 0x00F4, INT_MITI_V2_0_RX = 0x0A00, INT_MITI_V2_0_TX = 0x0A02, + INT_MITI_V2_1_RX = 0x0A08, INT_MITI_V2_1_TX = 0x0A0A, IMR_V2_CLEAR_REG_8125 = 0x0D00, ISR_V2_8125 = 0x0D04, IMR_V2_SET_REG_8125 = 0x0D0C, + TDU_STA_8125 = 0x0D08, + RDU_STA_8125 = 0x0D0A, + TX_NEW_CTRL = 0x203E, TNPDS_Q1_LOW_8125 = 0x2100, + PLA_TXQ0_IDLE_CREDIT = 0x2500, + PLA_TXQ1_IDLE_CREDIT = 0x2504, SW_TAIL_PTR0_8125 = 0x2800, HW_CLO_PTR0_8125 = 0x2802, RDSAR_Q1_LOW_8125 = 0x4000, RSS_CTRL_8125 = 0x4500, Q_NUM_CTRL_8125 = 0x4800, + RSS_KEY_8125 = 0x4600, + RSS_INDIRECTION_TBL_8125_V2 = 0x4700, EEE_TXIDLE_TIMER_8125 = 0x6048, PTP_CTRL_8125 = 0x6800, PTP_STATUS_8125 = 0x6802, @@ -1720,6 +1730,14 @@ struct pci_resource { u32 pci_sn_h; }; +enum r8125_flag { + R8125_FLAG_DOWN = 0, + R8125_FLAG_TASK_RESET_PENDING, + R8125_FLAG_TASK_ESD_CHECK_PENDING, + R8125_FLAG_TASK_LINKCHG_CHECK_PENDING, + R8125_FLAG_MAX +}; + struct rtl8125_tx_ring { void* priv; u32 index; @@ -1768,6 +1786,210 @@ struct r8125_irq { char name[IFNAMSIZ + 10]; }; +#pragma pack(1) +struct rtl8125_regs { + //00 + u8 mac_id[6]; + u16 reg_06; + u8 mar[8]; + //10 + u64 dtccr; + u16 ledsel0; + u16 legreg; + u32 tctr3; + //20 + u32 txq0_dsc_st_addr_0; + u32 txq0_dsc_st_addr_2; + u64 reg_28; + //30 + u16 rit; + u16 ritc; + u16 reg_34; + u8 reg_36; + u8 command; + u32 imr0; + u32 isr0; + //40 + u32 tcr; + u32 rcr; + u32 tctr0; + u32 tctr1; + //50 + u8 cr93c46; + u8 config0; + u8 config1; + u8 config2; + u8 config3; + u8 config4; + u8 config5; + u8 tdfnr; + u32 timer_int0; + u32 timer_int1; + //60 + u32 gphy_mdcmdio; + u32 csidr; + u32 csiar; + u16 phy_status; + u8 config6; + u8 pmch; + //70 + u32 eridr; + u32 eriar; + u16 config7; + u16 reg_7a; + u32 ephy_rxerr_cnt; + //80 + u32 ephy_mdcmdio; + u16 ledsel2; + u16 ledsel1; + u32 tctr2; + u32 timer_int2; + //90 + u8 tppoll0; + u8 reg_91; + u16 reg_92; + u16 led_feature; + u16 ledsel3; + u16 eee_led_config; + u16 reg_9a; + u32 reg_9c; + //a0 + u32 reg_a0; + u32 reg_a4; + u32 reg_a8; + u32 reg_ac; + //b0 + u32 patch_dbg; + u32 reg_b4; + u32 gphy_ocp; + u32 reg_bc; + //c0 + u32 reg_c0; + u32 reg_c4; + u32 reg_c8; + u16 otp_cmd; + u16 otp_pg_config; + //d0 + u16 phy_pwr; + u8 twsi_ctrl; + u8 oob_ctrl; + u16 mac_dbgo; + u16 mac_dbg; + u16 reg_d8; + u16 rms; + u32 efuse_data; + //e0 + u16 cplus_cmd; + u16 reg_e2; + u32 rxq0_dsc_st_addr_0; + u32 rxq0_dsc_st_addr_2; + u16 reg_ec; + u16 tx10midle_cnt; + //f0 + u16 misc0; + u16 misc1; + u32 timer_int3; + u32 cmac_ib; + u16 reg_fc; + u16 sw_rst; +}; +#pragma pack() + +struct rtl8125_regs_save { + union { + u8 mac_io[R8125_MAC_REGS_SIZE]; + + struct rtl8125_regs mac_reg; + }; + u16 pcie_phy[R8125_EPHY_REGS_SIZE/2]; + u16 eth_phy[R8125_PHY_REGS_SIZE/2]; + u32 eri_reg[R8125_ERI_REGS_SIZE/4]; + u32 pci_reg[R8125_PCI_REGS_SIZE/4]; + u16 sw_tail_ptr_reg[R8125_MAX_TX_QUEUES]; + u16 hw_clo_ptr_reg[R8125_MAX_TX_QUEUES]; + + //ktime_t begin_ktime; + //ktime_t end_ktime; + //u64 duration_ns; + + u16 sw0_tail_ptr; + u16 next_hwq0_clo_ptr; + u16 sw1_tail_ptr; + u16 next_hwq1_clo_ptr; + + u16 int_miti_rxq0; + u16 int_miti_txq0; + u16 int_miti_rxq1; + u16 int_miti_txq1; + u8 int_config; + u32 imr_new; + u32 isr_new; + + u8 tdu_status; + u16 rdu_status; + + u16 tc_mode; + + u32 txq1_dsc_st_addr_0; + u32 txq1_dsc_st_addr_2; + + u32 pla_tx_q0_idle_credit; + u32 pla_tx_q1_idle_credit; + + u32 rxq1_dsc_st_addr_0; + u32 rxq1_dsc_st_addr_2; + + u32 rss_ctrl; + u8 rss_key[RTL8125_RSS_KEY_SIZE]; + u8 rss_i_table[RTL8125_MAX_INDIRECTION_TABLE_ENTRIES]; + u16 rss_queue_num_sel_r; +}; + +struct rtl8125_counters { + /* legacy */ + u64 tx_packets; + u64 rx_packets; + u64 tx_errors; + u32 rx_errors; + u16 rx_missed; + u16 align_errors; + u32 tx_one_collision; + u32 tx_multi_collision; + u64 rx_unicast; + u64 rx_broadcast; + u32 rx_multicast; + u16 tx_aborted; + u16 tx_underrun; + + /* extended */ + u64 tx_octets; + u64 rx_octets; + u64 rx_multicast64; + u64 tx_unicast64; + u64 tx_broadcast64; + u64 tx_multicast64; + u32 tx_pause_on; + u32 tx_pause_off; + u32 tx_pause_all; + u32 tx_deferred; + u32 tx_late_collision; + u32 tx_all_collision; + u32 tx_aborted32; + u32 align_errors32; + u32 rx_frame_too_long; + u32 rx_runt; + u32 rx_pause_on; + u32 rx_pause_off; + u32 rx_pause_all; + u32 rx_unknown_opcode; + u32 rx_mac_error; + u32 tx_underrun32; + u32 rx_mac_missed; + u32 rx_tcam_dropped; + u32 tdu; + u32 rdu; +}; + /* Flow Control Settings */ enum rtl8125_fc_mode { rtl8125_fc_none = 0, @@ -1788,7 +2010,6 @@ struct rtl8125_private { unsigned int min_irq_nvecs; //struct msix_entry msix_entries[R8125_MAX_MSIX_VEC]; struct net_device_stats stats; /* statistics of net device */ - spinlock_t lock; /* spin lock flag */ u32 msg_enable; u32 tx_tcp_csum_cmd; u32 tx_udp_csum_cmd; @@ -1819,8 +2040,8 @@ struct rtl8125_private { struct rtl8125_ring lib_tx_ring[R8125_MAX_TX_QUEUES]; struct rtl8125_ring lib_rx_ring[R8125_MAX_RX_QUEUES]; #endif - struct timer_list esd_timer; - struct timer_list link_timer; + //struct timer_list esd_timer; + //struct timer_list link_timer; struct pci_resource pci_cfg_space; unsigned int esd_flag; unsigned int pci_cfg_is_read; @@ -1863,10 +2084,15 @@ struct rtl8125_private { unsigned int (*phy_reset_pending)(struct net_device *); unsigned int (*link_ok)(struct net_device *); #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) - struct work_struct task; + struct work_struct reset_task; + struct work_struct esd_task; + struct work_struct linkchg_task; #else - struct delayed_work task; + struct delayed_work reset_task; + struct delayed_work esd_task; + struct delayed_work linkchg_task; #endif + DECLARE_BITMAP(task_flags, R8125_FLAG_MAX); unsigned features; u8 org_pci_offset_99; @@ -1921,6 +2147,11 @@ struct rtl8125_private { u8 random_mac; + u16 phy_reg_aner; + u16 phy_reg_anlpar; + u16 phy_reg_gbsr; + u16 phy_reg_status_2500; + u32 HwPcieSNOffset; u8 HwSuppTxNoCloseVer; @@ -1931,6 +2162,8 @@ struct rtl8125_private { u8 HwSuppIntMitiVer; + u8 HwSuppExtendTallyCounterVer; + u8 check_keep_link_speed; u8 resume_not_chg_speed; @@ -2063,9 +2296,7 @@ struct rtl8125_private { #ifdef ENABLE_RSS_SUPPORT u32 rss_flags; /* Receive Side Scaling settings */ -#define RTL8125_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */ u8 rss_key[RTL8125_RSS_KEY_SIZE]; -#define RTL8125_MAX_INDIRECTION_TABLE_ENTRIES 128 u8 rss_indir_tbl[RTL8125_MAX_INDIRECTION_TABLE_ENTRIES]; u32 rss_options; #endif @@ -2248,7 +2479,6 @@ void rtl8125_hw_config(struct net_device *dev); void rtl8125_hw_set_timer_int_8125(struct rtl8125_private *tp, u32 message_id, u8 timer_intmiti_val); void rtl8125_set_rx_q_num(struct rtl8125_private *tp, unsigned int num_rx_queues); void rtl8125_set_tx_q_num(struct rtl8125_private *tp, unsigned int num_tx_queues); -int rtl8125_set_real_num_queue(struct rtl8125_private *tp); void rtl8125_hw_start(struct net_device *dev); void rtl8125_hw_reset(struct net_device *dev); void rtl8125_tx_clear(struct rtl8125_private *tp); @@ -2256,6 +2486,7 @@ void rtl8125_rx_clear(struct rtl8125_private *tp); int rtl8125_init_ring(struct net_device *dev); void rtl8125_hw_set_rx_packet_filter(struct net_device *dev); void rtl8125_enable_hw_linkchg_interrupt(struct rtl8125_private *tp); +int rtl8125_dump_tally_counter(struct rtl8125_private *tp, dma_addr_t paddr); #ifndef ENABLE_LIB_SUPPORT static inline void rtl8125_lib_reset_prepare(struct rtl8125_private *tp) { } diff --git a/package/kernel/r8125/src/r8125_n.c b/package/kernel/r8125/src/r8125_n.c index e0f3c4c870..fd96e8f8e4 100644 --- a/package/kernel/r8125/src/r8125_n.c +++ b/package/kernel/r8125/src/r8125_n.c @@ -223,6 +223,11 @@ static int enable_ptp_master_mode = 1; #else static int enable_ptp_master_mode = 0; #endif +#ifdef DISABLE_PM_SUPPORT +static int disable_pm_support = 1; +#else +static int disable_pm_support = 0; +#endif MODULE_AUTHOR("Realtek and the Linux r8125 crew "); MODULE_DESCRIPTION("Realtek RTL8125 2.5Gigabit Ethernet driver"); @@ -272,6 +277,9 @@ MODULE_PARM_DESC(tx_no_close_enable, "Enable TX No Close."); module_param(enable_ptp_master_mode, int, 0); MODULE_PARM_DESC(enable_ptp_master_mode, "Enable PTP Master Mode."); +module_param(disable_pm_support, int, 0); +MODULE_PARM_DESC(disable_pm_support, "Disable PM support."); + #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) module_param_named(debug, debug.msg_enable, int, 0); MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., 16=all)"); @@ -285,11 +293,13 @@ MODULE_FIRMWARE(FIRMWARE_8125B_2); MODULE_VERSION(RTL8125_VERSION); +/* #if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0) static void rtl8125_esd_timer(unsigned long __opaque); #else static void rtl8125_esd_timer(struct timer_list *t); #endif +*/ /* #if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0) static void rtl8125_link_timer(unsigned long __opaque); @@ -342,9 +352,18 @@ static int rtl8125_poll(napi_ptr napi, napi_budget budget); #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void rtl8125_reset_task(void *_data); +static void rtl8125_esd_task(void *_data); +static void rtl8125_linkchg_task(void *_data); #else static void rtl8125_reset_task(struct work_struct *work); +static void rtl8125_esd_task(struct work_struct *work); +static void rtl8125_linkchg_task(struct work_struct *work); #endif +static void rtl8125_schedule_reset_work(struct rtl8125_private *tp); +static void rtl8125_schedule_esd_work(struct rtl8125_private *tp); +static void rtl8125_schedule_linkchg_work(struct rtl8125_private *tp); +static void rtl8125_init_all_schedule_work(struct rtl8125_private *tp); +static void rtl8125_cancel_all_schedule_work(struct rtl8125_private *tp); static inline struct device *tp_to_dev(struct rtl8125_private *tp) { @@ -620,22 +639,6 @@ static inline struct mii_ioctl_data *if_mii(struct ifreq *rq) } #endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7) -struct rtl8125_counters { - u64 tx_packets; - u64 rx_packets; - u64 tx_errors; - u32 rx_errors; - u16 rx_missed; - u16 align_errors; - u32 tx_one_collision; - u32 tx_multi_collision; - u64 rx_unicast; - u64 rx_broadcast; - u32 rx_multicast; - u16 tx_aborted; - u16 tx_underun; -}; - static u32 rtl8125_read_thermal_sensor(struct rtl8125_private *tp) { u16 ts_digout; @@ -654,6 +657,32 @@ static u32 rtl8125_read_thermal_sensor(struct rtl8125_private *tp) return ts_digout; } +int rtl8125_dump_tally_counter(struct rtl8125_private *tp, dma_addr_t paddr) +{ + u32 cmd; + u32 WaitCnt; + int retval = -1; + + RTL_W32(tp, CounterAddrHigh, (u64)paddr >> 32); + cmd = (u64)paddr & DMA_BIT_MASK(32); + RTL_W32(tp, CounterAddrLow, cmd); + RTL_W32(tp, CounterAddrLow, cmd | CounterDump); + + WaitCnt = 0; + while (RTL_R32(tp, CounterAddrLow) & CounterDump) { + udelay(10); + + WaitCnt++; + if (WaitCnt > 20) + break; + } + + if (WaitCnt <= 20) + retval = 0; + + return retval; +} + #ifdef ENABLE_R8125_PROCFS /**************************************************************************** * -----------------------------PROCFS STUFF------------------------- @@ -668,11 +697,11 @@ static int proc_get_driver_variable(struct seq_file *m, void *v) { struct net_device *dev = m->private; struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; seq_puts(m, "\nDump Driver Variable\n"); - spin_lock_irqsave(&tp->lock, flags); + rtnl_lock(); + seq_puts(m, "Variable\tValue\n----------\t-----\n"); seq_printf(m, "MODULENAME\t%s\n", MODULENAME); seq_printf(m, "driver version\t%s\n", RTL8125_VERSION); @@ -789,7 +818,8 @@ static int proc_get_driver_variable(struct seq_file *m, void *v) seq_printf(m, "perm_addr\t%pM\n", dev->perm_addr); #endif seq_printf(m, "dev_addr\t%pM\n", dev->dev_addr); - spin_unlock_irqrestore(&tp->lock, flags); + + rtnl_unlock(); seq_putc(m, '\n'); return 0; @@ -801,52 +831,67 @@ static int proc_get_tally_counter(struct seq_file *m, void *v) struct rtl8125_private *tp = netdev_priv(dev); struct rtl8125_counters *counters; dma_addr_t paddr; - u32 cmd; - u32 WaitCnt; - unsigned long flags; seq_puts(m, "\nDump Tally Counter\n"); - //ASSERT_RTNL(); + rtnl_lock(); counters = tp->tally_vaddr; paddr = tp->tally_paddr; if (!counters) { seq_puts(m, "\nDump Tally Counter Fail\n"); - return 0; + goto out_unlock; } - spin_lock_irqsave(&tp->lock, flags); - RTL_W32(tp, CounterAddrHigh, (u64)paddr >> 32); - cmd = (u64)paddr & DMA_BIT_MASK(32); - RTL_W32(tp, CounterAddrLow, cmd); - RTL_W32(tp, CounterAddrLow, cmd | CounterDump); - - WaitCnt = 0; - while (RTL_R32(tp, CounterAddrLow) & CounterDump) { - udelay(10); - - WaitCnt++; - if (WaitCnt > 20) - break; - } - spin_unlock_irqrestore(&tp->lock, flags); + rtl8125_dump_tally_counter(tp, paddr); seq_puts(m, "Statistics\tValue\n----------\t-----\n"); seq_printf(m, "tx_packets\t%lld\n", le64_to_cpu(counters->tx_packets)); seq_printf(m, "rx_packets\t%lld\n", le64_to_cpu(counters->rx_packets)); seq_printf(m, "tx_errors\t%lld\n", le64_to_cpu(counters->tx_errors)); - seq_printf(m, "rx_missed\t%lld\n", le64_to_cpu(counters->rx_missed)); - seq_printf(m, "align_errors\t%lld\n", le64_to_cpu(counters->align_errors)); - seq_printf(m, "tx_one_collision\t%lld\n", le64_to_cpu(counters->tx_one_collision)); - seq_printf(m, "tx_multi_collision\t%lld\n", le64_to_cpu(counters->tx_multi_collision)); + seq_printf(m, "rx_errors\t%d\n", le32_to_cpu(counters->rx_errors)); + seq_printf(m, "rx_missed\t%d\n", le16_to_cpu(counters->rx_missed)); + seq_printf(m, "align_errors\t%d\n", le16_to_cpu(counters->align_errors)); + seq_printf(m, "tx_one_collision\t%d\n", le32_to_cpu(counters->tx_one_collision)); + seq_printf(m, "tx_multi_collision\t%d\n", le32_to_cpu(counters->tx_multi_collision)); seq_printf(m, "rx_unicast\t%lld\n", le64_to_cpu(counters->rx_unicast)); seq_printf(m, "rx_broadcast\t%lld\n", le64_to_cpu(counters->rx_broadcast)); - seq_printf(m, "rx_multicast\t%lld\n", le64_to_cpu(counters->rx_multicast)); - seq_printf(m, "tx_aborted\t%lld\n", le64_to_cpu(counters->tx_aborted)); - seq_printf(m, "tx_underun\t%lld\n", le64_to_cpu(counters->tx_underun)); + seq_printf(m, "rx_multicast\t%d\n", le32_to_cpu(counters->rx_multicast)); + seq_printf(m, "tx_aborted\t%d\n", le16_to_cpu(counters->tx_aborted)); + seq_printf(m, "tx_underrun\t%d\n", le16_to_cpu(counters->tx_underrun)); + + seq_printf(m, "tx_octets\t%lld\n", le64_to_cpu(counters->tx_octets)); + seq_printf(m, "rx_octets\t%lld\n", le64_to_cpu(counters->rx_octets)); + seq_printf(m, "rx_multicast64\t%lld\n", le64_to_cpu(counters->rx_multicast64)); + seq_printf(m, "tx_unicast64\t%lld\n", le64_to_cpu(counters->tx_unicast64)); + seq_printf(m, "tx_broadcast64\t%lld\n", le64_to_cpu(counters->tx_broadcast64)); + seq_printf(m, "tx_multicast64\t%lld\n", le64_to_cpu(counters->tx_multicast64)); + seq_printf(m, "tx_pause_on\t%d\n", le32_to_cpu(counters->tx_pause_on)); + seq_printf(m, "tx_pause_off\t%d\n", le32_to_cpu(counters->tx_pause_off)); + seq_printf(m, "tx_pause_all\t%d\n", le32_to_cpu(counters->tx_pause_all)); + seq_printf(m, "tx_deferred\t%d\n", le32_to_cpu(counters->tx_deferred)); + seq_printf(m, "tx_late_collision\t%d\n", le32_to_cpu(counters->tx_late_collision)); + seq_printf(m, "tx_all_collision\t%d\n", le32_to_cpu(counters->tx_all_collision)); + seq_printf(m, "tx_aborted32\t%d\n", le32_to_cpu(counters->tx_aborted32)); + seq_printf(m, "align_errors32\t%d\n", le32_to_cpu(counters->align_errors32)); + seq_printf(m, "rx_frame_too_long\t%d\n", le32_to_cpu(counters->rx_frame_too_long)); + seq_printf(m, "rx_runt\t%d\n", le32_to_cpu(counters->rx_runt)); + seq_printf(m, "rx_pause_on\t%d\n", le32_to_cpu(counters->rx_pause_on)); + seq_printf(m, "rx_pause_off\t%d\n", le32_to_cpu(counters->rx_pause_off)); + seq_printf(m, "rx_pause_all\t%d\n", le32_to_cpu(counters->rx_pause_all)); + seq_printf(m, "rx_unknown_opcode\t%d\n", le32_to_cpu(counters->rx_unknown_opcode)); + seq_printf(m, "rx_mac_error\t%d\n", le32_to_cpu(counters->rx_mac_error)); + seq_printf(m, "tx_underrun32\t%d\n", le32_to_cpu(counters->tx_underrun32)); + seq_printf(m, "rx_mac_missed\t%d\n", le32_to_cpu(counters->rx_mac_missed)); + seq_printf(m, "rx_tcam_dropped\t%d\n", le32_to_cpu(counters->rx_tcam_dropped)); + seq_printf(m, "tdu\t%d\n", le32_to_cpu(counters->tdu)); + seq_printf(m, "rdu\t%d\n", le32_to_cpu(counters->rdu)); seq_putc(m, '\n'); + +out_unlock: + rtnl_unlock(); + return 0; } @@ -857,12 +902,12 @@ static int proc_get_registers(struct seq_file *m, void *v) u8 byte_rd; struct rtl8125_private *tp = netdev_priv(dev); void __iomem *ioaddr = tp->mmio_addr; - unsigned long flags; seq_puts(m, "\nDump MAC Registers\n"); seq_puts(m, "Offset\tValue\n------\t-----\n"); - spin_lock_irqsave(&tp->lock, flags); + rtnl_lock(); + for (n = 0; n < max;) { seq_printf(m, "\n0x%02x:\t", n); @@ -871,7 +916,8 @@ static int proc_get_registers(struct seq_file *m, void *v) seq_printf(m, "%02x ", byte_rd); } } - spin_unlock_irqrestore(&tp->lock, flags); + + rtnl_unlock(); seq_putc(m, '\n'); return 0; @@ -883,12 +929,12 @@ static int proc_get_pcie_phy(struct seq_file *m, void *v) int i, n, max = R8125_EPHY_REGS_SIZE/2; u16 word_rd; struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; seq_puts(m, "\nDump PCIE PHY\n"); seq_puts(m, "\nOffset\tValue\n------\t-----\n "); - spin_lock_irqsave(&tp->lock, flags); + rtnl_lock(); + for (n = 0; n < max;) { seq_printf(m, "\n0x%02x:\t", n); @@ -897,7 +943,8 @@ static int proc_get_pcie_phy(struct seq_file *m, void *v) seq_printf(m, "%04x ", word_rd); } } - spin_unlock_irqrestore(&tp->lock, flags); + + rtnl_unlock(); seq_putc(m, '\n'); return 0; @@ -909,12 +956,12 @@ static int proc_get_eth_phy(struct seq_file *m, void *v) int i, n, max = R8125_PHY_REGS_SIZE/2; u16 word_rd; struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; seq_puts(m, "\nDump Ethernet PHY\n"); seq_puts(m, "\nOffset\tValue\n------\t-----\n "); - spin_lock_irqsave(&tp->lock, flags); + rtnl_lock(); + seq_puts(m, "\n####################page 0##################\n "); rtl8125_mdio_write(tp, 0x1f, 0x0000); for (n = 0; n < max;) { @@ -925,7 +972,8 @@ static int proc_get_eth_phy(struct seq_file *m, void *v) seq_printf(m, "%04x ", word_rd); } } - spin_unlock_irqrestore(&tp->lock, flags); + + rtnl_unlock(); seq_putc(m, '\n'); return 0; @@ -937,12 +985,12 @@ static int proc_get_extended_registers(struct seq_file *m, void *v) int i, n, max = R8125_ERI_REGS_SIZE; u32 dword_rd; struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; seq_puts(m, "\nDump Extended Registers\n"); seq_puts(m, "\nOffset\tValue\n------\t-----\n "); - spin_lock_irqsave(&tp->lock, flags); + rtnl_lock(); + for (n = 0; n < max;) { seq_printf(m, "\n0x%02x:\t", n); @@ -951,7 +999,8 @@ static int proc_get_extended_registers(struct seq_file *m, void *v) seq_printf(m, "%08x ", dword_rd); } } - spin_unlock_irqrestore(&tp->lock, flags); + + rtnl_unlock(); seq_putc(m, '\n'); return 0; @@ -963,12 +1012,12 @@ static int proc_get_pci_registers(struct seq_file *m, void *v) int i, n, max = R8125_PCI_REGS_SIZE; u32 dword_rd; struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; seq_puts(m, "\nDump PCI Registers\n"); seq_puts(m, "\nOffset\tValue\n------\t-----\n "); - spin_lock_irqsave(&tp->lock, flags); + rtnl_lock(); + for (n = 0; n < max;) { seq_printf(m, "\n0x%03x:\t", n); @@ -985,7 +1034,7 @@ static int proc_get_pci_registers(struct seq_file *m, void *v) pci_read_config_dword(tp->pci_dev, n, &dword_rd); seq_printf(m, "\n0x%03x:\t%08x ", n, dword_rd); - spin_unlock_irqrestore(&tp->lock, flags); + rtnl_unlock(); seq_putc(m, '\n'); return 0; @@ -996,7 +1045,6 @@ static int proc_get_temperature(struct seq_file *m, void *v) struct net_device *dev = m->private; struct rtl8125_private *tp = netdev_priv(dev); u16 ts_digout, tj, fah; - unsigned long flags; switch (tp->mcfg) { case CFG_METHOD_4: @@ -1008,9 +1056,9 @@ static int proc_get_temperature(struct seq_file *m, void *v) break; } - spin_lock_irqsave(&tp->lock, flags); + rtnl_lock(); ts_digout = rtl8125_read_thermal_sensor(tp); - spin_unlock_irqrestore(&tp->lock, flags); + rtnl_unlock(); tj = ts_digout / 2; if (ts_digout <= 512) { @@ -1036,13 +1084,13 @@ static int proc_get_driver_variable(char *page, char **start, { struct net_device *dev = data; struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; int len = 0; len += snprintf(page + len, count - len, "\nDump Driver Driver\n"); - spin_lock_irqsave(&tp->lock, flags); + rtnl_lock(); + len += snprintf(page + len, count - len, "Variable\tValue\n----------\t-----\n"); @@ -1278,7 +1326,8 @@ static int proc_get_driver_variable(char *page, char **start, #endif dev->dev_addr ); - spin_unlock_irqrestore(&tp->lock, flags); + + rtnl_unlock(); len += snprintf(page + len, count - len, "\n"); @@ -1294,39 +1343,22 @@ static int proc_get_tally_counter(char *page, char **start, struct rtl8125_private *tp = netdev_priv(dev); struct rtl8125_counters *counters; dma_addr_t paddr; - u32 cmd; - u32 WaitCnt; - unsigned long flags; int len = 0; len += snprintf(page + len, count - len, "\nDump Tally Counter\n"); - //ASSERT_RTNL(); + rtnl_lock(); counters = tp->tally_vaddr; paddr = tp->tally_paddr; if (!counters) { len += snprintf(page + len, count - len, "\nDump Tally Counter Fail\n"); - goto out; + goto out_unlock; } - spin_lock_irqsave(&tp->lock, flags); - RTL_W32(tp, CounterAddrHigh, (u64)paddr >> 32); - cmd = (u64)paddr & DMA_BIT_MASK(32); - RTL_W32(tp, CounterAddrLow, cmd); - RTL_W32(tp, CounterAddrLow, cmd | CounterDump); - - WaitCnt = 0; - while (RTL_R32(tp, CounterAddrLow) & CounterDump) { - udelay(10); - - WaitCnt++; - if (WaitCnt > 20) - break; - } - spin_unlock_irqrestore(&tp->lock, flags); + rtl8125_dump_tally_counter(tp, paddr); len += snprintf(page + len, count - len, "Statistics\tValue\n----------\t-----\n"); @@ -1335,31 +1367,89 @@ static int proc_get_tally_counter(char *page, char **start, "tx_packets\t%lld\n" "rx_packets\t%lld\n" "tx_errors\t%lld\n" - "rx_missed\t%lld\n" - "align_errors\t%lld\n" - "tx_one_collision\t%lld\n" - "tx_multi_collision\t%lld\n" + "rx_errors\t%d\n" + "rx_missed\t%d\n" + "align_errors\t%d\n" + "tx_one_collision\t%d\n" + "tx_multi_collision\t%d\n" "rx_unicast\t%lld\n" "rx_broadcast\t%lld\n" - "rx_multicast\t%lld\n" - "tx_aborted\t%lld\n" - "tx_underun\t%lld\n", + "rx_multicast\t%d\n" + "tx_aborted\t%d\n" + "tx_underrun\t%d\n", + + "tx_octets\t%lld\n", + "rx_octets\t%lld\n", + "rx_multicast64\t%lld\n", + "tx_unicast64\t%lld\n", + "tx_broadcast64\t%lld\n", + "tx_multicast64\t%lld\n", + "tx_pause_on\t%d\n", + "tx_pause_off\t%d\n", + "tx_pause_all\t%d\n", + "tx_deferred\t%d\n", + "tx_late_collision\t%d\n", + "tx_all_collision\t%d\n", + "tx_aborted32\t%d\n", + "align_errors32\t%d\n", + "rx_frame_too_long\t%d\n", + "rx_runt\t%d\n", + "rx_pause_on\t%d\n", + "rx_pause_off\t%d\n", + "rx_pause_all\t%d\n", + "rx_unknown_opcode\t%d\n", + "rx_mac_error\t%d\n", + "tx_underrun32\t%d\n", + "rx_mac_missed\t%d\n", + "rx_tcam_dropped\t%d\n", + "tdu\t%d\n", + "rdu\t%d\n", le64_to_cpu(counters->tx_packets), le64_to_cpu(counters->rx_packets), le64_to_cpu(counters->tx_errors), - le64_to_cpu(counters->rx_missed), - le64_to_cpu(counters->align_errors), - le64_to_cpu(counters->tx_one_collision), - le64_to_cpu(counters->tx_multi_collision), + le32_to_cpu(counters->rx_errors), + le16_to_cpu(counters->rx_missed), + le16_to_cpu(counters->align_errors), + le32_to_cpu(counters->tx_one_collision), + le32_to_cpu(counters->tx_multi_collision), le64_to_cpu(counters->rx_unicast), le64_to_cpu(counters->rx_broadcast), - le64_to_cpu(counters->rx_multicast), - le64_to_cpu(counters->tx_aborted), - le64_to_cpu(counters->tx_underun) + le32_to_cpu(counters->rx_multicast), + le16_to_cpu(counters->tx_aborted), + le16_to_cpu(counters->tx_underrun), + + le64_to_cpu(counters->tx_octets), + le64_to_cpu(counters->rx_octets), + le64_to_cpu(counters->rx_multicast64), + le64_to_cpu(counters->tx_unicast64), + le64_to_cpu(counters->tx_broadcast64), + le64_to_cpu(counters->tx_multicast64), + le32_to_cpu(counters->tx_pause_on), + le32_to_cpu(counters->tx_pause_off), + le32_to_cpu(counters->tx_pause_all), + le32_to_cpu(counters->tx_deferred), + le32_to_cpu(counters->tx_late_collision), + le32_to_cpu(counters->tx_all_collision), + le32_to_cpu(counters->tx_aborted32), + le32_to_cpu(counters->align_errors32), + le32_to_cpu(counters->rx_frame_too_long), + le32_to_cpu(counters->rx_runt), + le32_to_cpu(counters->rx_pause_on), + le32_to_cpu(counters->rx_pause_off), + le32_to_cpu(counters->rx_pause_all), + le32_to_cpu(counters->rx_unknown_opcode), + le32_to_cpu(counters->rx_mac_error), + le32_to_cpu(counters->tx_underrun32), + le32_to_cpu(counters->rx_mac_missed), + le32_to_cpu(counters->rx_tcam_dropped), + le32_to_cpu(counters->tdu), + le32_to_cpu(counters->rdu), ); len += snprintf(page + len, count - len, "\n"); -out: +out_unlock: + rtnl_unlock(); + *eof = 1; return len; } @@ -1373,14 +1463,14 @@ static int proc_get_registers(char *page, char **start, u8 byte_rd; struct rtl8125_private *tp = netdev_priv(dev); void __iomem *ioaddr = tp->mmio_addr; - unsigned long flags; int len = 0; len += snprintf(page + len, count - len, "\nDump MAC Registers\n" "Offset\tValue\n------\t-----\n"); - spin_lock_irqsave(&tp->lock, flags); + rtnl_lock(); + for (n = 0; n < max;) { len += snprintf(page + len, count - len, "\n0x%02x:\t", @@ -1393,7 +1483,8 @@ static int proc_get_registers(char *page, char **start, byte_rd); } } - spin_unlock_irqrestore(&tp->lock, flags); + + rtnl_unlock(); len += snprintf(page + len, count - len, "\n"); @@ -1409,14 +1500,14 @@ static int proc_get_pcie_phy(char *page, char **start, int i, n, max = R8125_EPHY_REGS_SIZE/2; u16 word_rd; struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; int len = 0; len += snprintf(page + len, count - len, "\nDump PCIE PHY\n" "Offset\tValue\n------\t-----\n"); - spin_lock_irqsave(&tp->lock, flags); + rtnl_lock(); + for (n = 0; n < max;) { len += snprintf(page + len, count - len, "\n0x%02x:\t", @@ -1429,7 +1520,8 @@ static int proc_get_pcie_phy(char *page, char **start, word_rd); } } - spin_unlock_irqrestore(&tp->lock, flags); + + rtnl_unlock(); len += snprintf(page + len, count - len, "\n"); @@ -1445,14 +1537,14 @@ static int proc_get_eth_phy(char *page, char **start, int i, n, max = R8125_PHY_REGS_SIZE/2; u16 word_rd; struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; int len = 0; len += snprintf(page + len, count - len, "\nDump Ethernet PHY\n" "Offset\tValue\n------\t-----\n"); - spin_lock_irqsave(&tp->lock, flags); + rtnl_lock(); + len += snprintf(page + len, count - len, "\n####################page 0##################\n"); rtl8125_mdio_write(tp, 0x1f, 0x0000); @@ -1468,7 +1560,8 @@ static int proc_get_eth_phy(char *page, char **start, word_rd); } } - spin_unlock_irqrestore(&tp->lock, flags); + + rtnl_unlock(); len += snprintf(page + len, count - len, "\n"); @@ -1484,14 +1577,14 @@ static int proc_get_extended_registers(char *page, char **start, int i, n, max = R8125_ERI_REGS_SIZE; u32 dword_rd; struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; int len = 0; len += snprintf(page + len, count - len, "\nDump Extended Registers\n" "Offset\tValue\n------\t-----\n"); - spin_lock_irqsave(&tp->lock, flags); + rtnl_lock(); + for (n = 0; n < max;) { len += snprintf(page + len, count - len, "\n0x%02x:\t", @@ -1504,10 +1597,11 @@ static int proc_get_extended_registers(char *page, char **start, dword_rd); } } - spin_unlock_irqrestore(&tp->lock, flags); + + rtnl_unlock(); len += snprintf(page + len, count - len, "\n"); -out: + *eof = 1; return len; } @@ -1520,14 +1614,14 @@ static int proc_get_pci_registers(char *page, char **start, int i, n, max = R8125_PCI_REGS_SIZE; u32 dword_rd; struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; int len = 0; len += snprintf(page + len, count - len, "\nDump PCI Registers\n" "Offset\tValue\n------\t-----\n"); - spin_lock_irqsave(&tp->lock, flags); + rtnl_lock(); + for (n = 0; n < max;) { len += snprintf(page + len, count - len, "\n0x%03x:\t", @@ -1553,7 +1647,8 @@ static int proc_get_pci_registers(char *page, char **start, "\n0x%03x:\t%08x ", n, dword_rd); - spin_unlock_irqrestore(&tp->lock, flags); + + rtnl_unlock(); len += snprintf(page + len, count - len, "\n"); @@ -1568,7 +1663,6 @@ static int proc_get_temperature(char *page, char **start, struct net_device *dev = data; struct rtl8125_private *tp = netdev_priv(dev); u16 ts_digout, tj, fah; - unsigned long flags; int len = 0; switch (tp->mcfg) { @@ -1583,9 +1677,9 @@ static int proc_get_temperature(char *page, char **start, break; } - spin_lock_irqsave(&tp->lock, flags); + rtnl_lock(); ts_digout = rtl8125_read_thermal_sensor(tp); - spin_unlock_irqrestore(&tp->lock, flags); + rtnl_unlock(); tj = ts_digout / 2; if (ts_digout <= 512) { @@ -2774,12 +2868,43 @@ rtl8125_is_in_phy_disable_mode(struct net_device *dev) return in_phy_disable_mode; } +static bool +rtl8125_stop_all_request(struct net_device *dev) +{ + struct rtl8125_private *tp = netdev_priv(dev); + int i; + + RTL_W8(tp, ChipCmd, RTL_R8(tp, ChipCmd) | StopReq); + + switch (tp->mcfg) { + case CFG_METHOD_2: + case CFG_METHOD_3: + for (i = 0; i < 20; i++) { + udelay(10); + if (!(RTL_R8(tp, ChipCmd) & StopReq)) break; + } + + if (i == 20) + return 0; + break; + } + + return 1; +} + void rtl8125_wait_txrx_fifo_empty(struct net_device *dev) { struct rtl8125_private *tp = netdev_priv(dev); int i; + switch (tp->mcfg) { + case CFG_METHOD_4: + case CFG_METHOD_5: + rtl8125_stop_all_request(dev); + break; + } + switch (tp->mcfg) { case CFG_METHOD_2: case CFG_METHOD_3: @@ -2789,7 +2914,6 @@ rtl8125_wait_txrx_fifo_empty(struct net_device *dev) udelay(50); if ((RTL_R8(tp, MCUCmd_reg) & (Txfifo_empty | Rxfifo_empty)) == (Txfifo_empty | Rxfifo_empty)) break; - } break; } @@ -2801,7 +2925,6 @@ rtl8125_wait_txrx_fifo_empty(struct net_device *dev) udelay(50); if ((RTL_R16(tp, IntrMitigate) & (BIT_0 | BIT_1 | BIT_8)) == (BIT_0 | BIT_1 | BIT_8)) break; - } break; } @@ -2838,7 +2961,7 @@ rtl8125_enable_hw_linkchg_interrupt(struct rtl8125_private *tp) RTL_W32(tp, IMR_V2_SET_REG_8125, ISRIMR_V2_LINKCHG); break; case 1: - RTL_W32(tp, tp->imr_reg[0], LinkChg); + RTL_W32(tp, tp->imr_reg[0], LinkChg | RTL_R32(tp, tp->imr_reg[0])); break; } @@ -2966,17 +3089,11 @@ rtl8125_nic_reset(struct net_device *dev) rtl8125_enable_rxdvgate(dev); + rtl8125_stop_all_request(dev); + rtl8125_wait_txrx_fifo_empty(dev); - switch (tp->mcfg) { - case CFG_METHOD_2: - case CFG_METHOD_3: - case CFG_METHOD_4: - case CFG_METHOD_5: - default: - mdelay(2); - break; - } + mdelay(2); /* Soft reset the chip. */ RTL_W8(tp, ChipCmd, CmdReset); @@ -3148,7 +3265,7 @@ rtl8125_init_ring_indexes(struct rtl8125_private *tp) { int i; - for (i = 0; i < tp->num_tx_rings; i++) { + for (i = 0; i < tp->HwSuppNumTxQueues; i++) { struct rtl8125_tx_ring *ring = &tp->tx_ring[i]; ring->dirty_tx = ring->cur_tx = 0; ring->NextHwDesCloPtr = 0; @@ -3157,7 +3274,7 @@ rtl8125_init_ring_indexes(struct rtl8125_private *tp) ring->priv = tp; } - for (i = 0; i < tp->num_rx_rings; i++) { + for (i = 0; i < tp->HwSuppNumRxQueues; i++) { struct rtl8125_rx_ring *ring = &tp->rx_ring[i]; ring->dirty_rx = ring->cur_rx = 0; ring->index = i; @@ -3254,26 +3371,6 @@ static int rtl8125_disable_eee_plus(struct rtl8125_private *tp) return ret; } -static void -rtl8125_wakeup_all_tx_queue(struct net_device *dev) -{ - struct rtl8125_private *tp = netdev_priv(dev); - int i; - - for (i=0; inum_tx_rings; i++) - netif_start_subqueue(dev, i); -} - -static void -rtl8125_stop_all_tx_queue(struct net_device *dev) -{ - struct rtl8125_private *tp = netdev_priv(dev); - int i; - - for (i=0; inum_tx_rings; i++) - netif_stop_subqueue(dev, i); -} - static void rtl8125_link_on_patch(struct net_device *dev) { @@ -3300,7 +3397,12 @@ rtl8125_link_on_patch(struct net_device *dev) netif_carrier_on(dev); - rtl8125_wakeup_all_tx_queue(dev); + netif_tx_wake_all_queues(dev); + + tp->phy_reg_aner = rtl8125_mdio_read(tp, MII_EXPANSION); + tp->phy_reg_anlpar = rtl8125_mdio_read(tp, MII_LPA); + tp->phy_reg_gbsr = rtl8125_mdio_read(tp, MII_STAT1000); + tp->phy_reg_status_2500 = mdio_direct_read_phy_ocp(tp, 0xA5D6); } static void @@ -3308,13 +3410,18 @@ rtl8125_link_down_patch(struct net_device *dev) { struct rtl8125_private *tp = netdev_priv(dev); + tp->phy_reg_aner = 0; + tp->phy_reg_anlpar = 0; + tp->phy_reg_gbsr = 0; + tp->phy_reg_status_2500 = 0; + if (tp->mcfg == CFG_METHOD_2 || tp->mcfg == CFG_METHOD_3 || tp->mcfg == CFG_METHOD_4 || tp->mcfg == CFG_METHOD_5) rtl8125_disable_eee_plus(tp); - rtl8125_stop_all_tx_queue(dev); + netif_tx_stop_all_queues(dev); netif_carrier_off(dev); @@ -3496,9 +3603,9 @@ rtl8125_enable_pci_offset_99(struct rtl8125_private *tp) case CFG_METHOD_5: csi_tmp = rtl8125_mac_ocp_read(tp, 0xE032); csi_tmp &= ~(BIT_0 | BIT_1); - if (!(tp->org_pci_offset_99 & (BIT_5 | BIT_6))) + if (tp->org_pci_offset_99 & (BIT_5 | BIT_6)) csi_tmp |= BIT_1; - if (!(tp->org_pci_offset_99 & BIT_2)) + if (tp->org_pci_offset_99 & BIT_2) csi_tmp |= BIT_0; rtl8125_mac_ocp_write(tp, 0xE032, csi_tmp); break; @@ -3656,6 +3763,26 @@ rtl8125_disable_exit_l1_mask(struct rtl8125_private *tp) ClearMcuAccessRegBit(tp, 0xC0AC, (BIT_7 | BIT_8 | BIT_9 | BIT_10 | BIT_11 | BIT_12)); } +static void +rtl8125_enable_extend_tally_couter(struct rtl8125_private *tp) +{ + switch (tp->HwSuppExtendTallyCounterVer) { + case 1: + SetMcuAccessRegBit(tp, 0xEA84, (BIT_1 | BIT_0)); + break; + } +} + +static void +rtl8125_disable_extend_tally_couter(struct rtl8125_private *tp) +{ + switch (tp->HwSuppExtendTallyCounterVer) { + case 1: + ClearMcuAccessRegBit(tp, 0xEA84, (BIT_1 | BIT_0)); + break; + } +} + static void rtl8125_hw_d3_para(struct net_device *dev) { @@ -3701,6 +3828,8 @@ rtl8125_hw_d3_para(struct net_device *dev) rtl8125_disable_ocp_phy_power_saving(dev); rtl8125_disable_rxdvgate(dev); + + rtl8125_disable_extend_tally_couter(tp); } static void @@ -3761,6 +3890,9 @@ rtl8125_get_hw_wol(struct rtl8125_private *tp) u32 csi_tmp; u32 wol_opts = 0; + if (disable_pm_support) + goto out; + options = RTL_R8(tp, Config1); if (!(options & PMEnable)) goto out; @@ -3942,12 +4074,10 @@ rtl8125_set_wol_link_speed(struct net_device *dev) u16 status_2500; u16 aner; - if (!tp->link_ok(dev) || tp->autoneg != AUTONEG_ENABLE) + if (tp->autoneg != AUTONEG_ENABLE) goto exit; rtl8125_mdio_write(tp, 0x1F, 0x0000); - aner = rtl8125_mdio_read(tp, MII_EXPANSION); - if (!(aner & EXPANSION_NWAY)) goto exit; auto_nego = rtl8125_mdio_read(tp, MII_ADVERTISE); auto_nego &= ~(ADVERTISE_10HALF | ADVERTISE_10FULL @@ -3959,9 +4089,39 @@ rtl8125_set_wol_link_speed(struct net_device *dev) ctrl_2500 = mdio_direct_read_phy_ocp(tp, 0xA5D4); ctrl_2500 &= ~(RTK_ADVERTISE_2500FULL); - anlpar = rtl8125_mdio_read(tp, MII_LPA); - gbsr = rtl8125_mdio_read(tp, MII_STAT1000); - status_2500 = mdio_direct_read_phy_ocp(tp, 0xA5D6); + aner = anlpar = gbsr = status_2500 = 0; + if (tp->link_ok(dev)) { + aner = rtl8125_mdio_read(tp, MII_EXPANSION); + anlpar = rtl8125_mdio_read(tp, MII_LPA); + gbsr = rtl8125_mdio_read(tp, MII_STAT1000); + status_2500 = mdio_direct_read_phy_ocp(tp, 0xA5D6); + } else { + if (netif_running(dev)) { + aner = tp->phy_reg_aner; + anlpar = tp->phy_reg_anlpar; + gbsr = tp->phy_reg_gbsr; + status_2500 = tp->phy_reg_status_2500; + } + } + + if ((aner | anlpar | gbsr | status_2500) == 0) { + int auto_nego_tmp = 0; + adv = tp->advertising; + if ((adv & ADVERTISED_10baseT_Half) && (anlpar & LPA_10HALF)) + auto_nego_tmp |= ADVERTISE_10HALF; + if ((adv & ADVERTISED_10baseT_Full) && (anlpar & LPA_10FULL)) + auto_nego_tmp |= ADVERTISE_10FULL; + if ((adv & ADVERTISED_100baseT_Half) && (anlpar & LPA_100HALF)) + auto_nego_tmp |= ADVERTISE_100HALF; + if ((adv & ADVERTISED_100baseT_Full) && (anlpar & LPA_100FULL)) + auto_nego_tmp |= ADVERTISE_100FULL; + + if (auto_nego_tmp == 0) goto exit; + + auto_nego |= auto_nego_tmp; + goto skip_check_lpa; + } + if (!(aner & EXPANSION_NWAY)) goto exit; adv = tp->advertising; if ((adv & ADVERTISED_10baseT_Half) && (anlpar & LPA_10HALF)) @@ -3981,6 +4141,7 @@ rtl8125_set_wol_link_speed(struct net_device *dev) else goto exit; +skip_check_lpa: if (tp->DASH) auto_nego |= (ADVERTISE_100FULL | ADVERTISE_100HALF | ADVERTISE_10HALF | ADVERTISE_10FULL); @@ -4098,27 +4259,21 @@ rtl8125_get_wol(struct net_device *dev, { struct rtl8125_private *tp = netdev_priv(dev); u8 options; - unsigned long flags; wol->wolopts = 0; - if (tp->mcfg == CFG_METHOD_DEFAULT) { + if (tp->mcfg == CFG_METHOD_DEFAULT || disable_pm_support) { wol->supported = 0; return; } else { wol->supported = WAKE_ANY; } - spin_lock_irqsave(&tp->lock, flags); - options = RTL_R8(tp, Config1); if (!(options & PMEnable)) - goto out_unlock; + return; wol->wolopts = tp->wol_opts; - -out_unlock: - spin_unlock_irqrestore(&tp->lock, flags); } static int @@ -4126,19 +4281,14 @@ rtl8125_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) { struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; - if (tp->mcfg == CFG_METHOD_DEFAULT) + if (tp->mcfg == CFG_METHOD_DEFAULT || disable_pm_support) return -EOPNOTSUPP; - spin_lock_irqsave(&tp->lock, flags); - tp->wol_opts = wol->wolopts; tp->wol_enabled = (tp->wol_opts) ? WOL_ENABLED : WOL_DISABLED; - spin_unlock_irqrestore(&tp->lock, flags); - device_set_wakeup_enable(tp_to_dev(tp), wol->wolopts); return 0; @@ -4297,9 +4447,7 @@ rtl8125_set_settings(struct net_device *dev, #endif ) { - struct rtl8125_private *tp = netdev_priv(dev); int ret; - unsigned long flags; u8 autoneg; u32 speed; u8 duplex; @@ -4320,13 +4468,17 @@ rtl8125_set_settings(struct net_device *dev, cmd->link_modes.supported); ethtool_convert_link_mode_to_legacy_u32(&advertising, cmd->link_modes.advertising); + if (test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, + cmd->link_modes.supported)) + supported |= ADVERTISED_2500baseX_Full; + if (test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, + cmd->link_modes.advertising)) + advertising |= ADVERTISED_2500baseX_Full; #endif if (advertising & ~supported) return -EINVAL; - spin_lock_irqsave(&tp->lock, flags); ret = rtl8125_set_speed(dev, autoneg, speed, duplex, advertising); - spin_unlock_irqrestore(&tp->lock, flags); return ret; } @@ -4337,15 +4489,12 @@ rtl8125_get_tx_csum(struct net_device *dev) { struct rtl8125_private *tp = netdev_priv(dev); u32 ret; - unsigned long flags; - spin_lock_irqsave(&tp->lock, flags); #if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0) ret = ((dev->features & NETIF_F_IP_CSUM) != 0); #else ret = ((dev->features & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)) != 0); #endif //LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0) - spin_unlock_irqrestore(&tp->lock, flags); return ret; } @@ -4355,11 +4504,8 @@ rtl8125_get_rx_csum(struct net_device *dev) { struct rtl8125_private *tp = netdev_priv(dev); u32 ret; - unsigned long flags; - spin_lock_irqsave(&tp->lock, flags); ret = tp->cp_cmd & RxChkSum; - spin_unlock_irqrestore(&tp->lock, flags); return ret; } @@ -4369,13 +4515,10 @@ rtl8125_set_tx_csum(struct net_device *dev, u32 data) { struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; if (tp->mcfg == CFG_METHOD_DEFAULT) return -EOPNOTSUPP; - spin_lock_irqsave(&tp->lock, flags); - #if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0) if (data) dev->features |= NETIF_F_IP_CSUM; @@ -4388,8 +4531,6 @@ rtl8125_set_tx_csum(struct net_device *dev, dev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM); #endif //LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0) - spin_unlock_irqrestore(&tp->lock, flags); - return 0; } @@ -4398,13 +4539,10 @@ rtl8125_set_rx_csum(struct net_device *dev, u32 data) { struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; if (tp->mcfg == CFG_METHOD_DEFAULT) return -EOPNOTSUPP; - spin_lock_irqsave(&tp->lock, flags); - if (data) tp->cp_cmd |= RxChkSum; else @@ -4412,8 +4550,6 @@ rtl8125_set_rx_csum(struct net_device *dev, RTL_W16(tp, CPlusCmd, tp->cp_cmd); - spin_unlock_irqrestore(&tp->lock, flags); - return 0; } #endif //LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) @@ -4476,9 +4612,7 @@ rtl8125_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) { struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; - spin_lock_irqsave(&tp->lock, flags); tp->vlgrp = grp; if (tp->mcfg == CFG_METHOD_2 || tp->mcfg == CFG_METHOD_3 || @@ -4492,7 +4626,6 @@ rtl8125_vlan_rx_register(struct net_device *dev, RTL_W32(tp, RxConfig, RTL_R32(tp, RxConfig) & ~(EnableInnerVlan | EnableOuterVlan)) } } - spin_unlock_irqrestore(&tp->lock, flags); } #endif @@ -4503,16 +4636,13 @@ rtl8125_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) { struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; - spin_lock_irqsave(&tp->lock, flags); #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21) if (tp->vlgrp) tp->vlgrp->vlan_devices[vid] = NULL; #else vlan_group_set_device(tp->vlgrp, vid, NULL); #endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21) - spin_unlock_irqrestore(&tp->lock, flags); } #endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) @@ -4566,10 +4696,6 @@ rtl8125_rx_vlan_skb(struct rtl8125_private *tp, static netdev_features_t rtl8125_fix_features(struct net_device *dev, netdev_features_t features) { - struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; - - spin_lock_irqsave(&tp->lock, flags); if (dev->mtu > MSS_MAX) features &= ~NETIF_F_ALL_TSO; if (dev->mtu > ETH_DATA_LEN) { @@ -4579,7 +4705,6 @@ static netdev_features_t rtl8125_fix_features(struct net_device *dev, #ifndef CONFIG_R8125_VLAN features &= ~NETIF_F_ALL_CSUM; #endif - spin_unlock_irqrestore(&tp->lock, flags); return features; } @@ -4591,15 +4716,21 @@ static int rtl8125_hw_set_features(struct net_device *dev, u32 rx_config; rx_config = RTL_R32(tp, RxConfig); - if (features & NETIF_F_RXALL) + if (features & NETIF_F_RXALL) { + tp->rtl8125_rx_config |= (AcceptErr | AcceptRunt); rx_config |= (AcceptErr | AcceptRunt); - else + } else { + tp->rtl8125_rx_config &= ~(AcceptErr | AcceptRunt); rx_config &= ~(AcceptErr | AcceptRunt); + } - if (features & NETIF_F_HW_VLAN_RX) + if (features & NETIF_F_HW_VLAN_RX) { + tp->rtl8125_rx_config |= (EnableInnerVlan | EnableOuterVlan); rx_config |= (EnableInnerVlan | EnableOuterVlan); - else + } else { + tp->rtl8125_rx_config &= ~(EnableInnerVlan | EnableOuterVlan); rx_config &= ~(EnableInnerVlan | EnableOuterVlan); + } RTL_W32(tp, RxConfig, rx_config); @@ -4617,15 +4748,9 @@ static int rtl8125_hw_set_features(struct net_device *dev, static int rtl8125_set_features(struct net_device *dev, netdev_features_t features) { - struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; - features &= NETIF_F_RXALL | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_RX; - spin_lock_irqsave(&tp->lock, flags); - if (features ^ dev->features) - rtl8125_hw_set_features(dev, features); - spin_unlock_irqrestore(&tp->lock, flags); + rtl8125_hw_set_features(dev, features); return 0; } @@ -4641,12 +4766,17 @@ static void rtl8125_gset_xmii(struct net_device *dev, ) { struct rtl8125_private *tp = netdev_priv(dev); + u16 aner = tp->phy_reg_aner; + u16 anlpar = tp->phy_reg_anlpar; + u16 gbsr = tp->phy_reg_gbsr; + u16 status_2500 = tp->phy_reg_status_2500; + u32 lpa_adv = 0; u16 status; u8 autoneg, duplex; u32 speed = 0; u16 bmcr; u32 supported, advertising; - unsigned long flags; + u8 report_lpa = 0; supported = SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | @@ -4661,10 +4791,8 @@ static void rtl8125_gset_xmii(struct net_device *dev, advertising = ADVERTISED_TP; - spin_lock_irqsave(&tp->lock, flags); rtl8125_mdio_write(tp, 0x1F, 0x0000); bmcr = rtl8125_mdio_read(tp, MII_BMCR); - spin_unlock_irqrestore(&tp->lock, flags); if (bmcr & BMCR_ANENABLE) { advertising |= ADVERTISED_Autoneg; @@ -4687,8 +4815,10 @@ static void rtl8125_gset_xmii(struct net_device *dev, } status = RTL_R16(tp, PHYstatus); + if (netif_running(dev) && (status & LinkStatus)) + report_lpa = 1; - if (status & LinkStatus) { + if (report_lpa) { /*link on*/ if (status & _2500bpsF) speed = SPEED_2500; @@ -4707,10 +4837,33 @@ static void rtl8125_gset_xmii(struct net_device *dev, duplex = ((status & (_1000bpsF | _2500bpsF)) || (status & FullDup)) ? DUPLEX_FULL : DUPLEX_HALF; + + /*link partner*/ + if (aner & EXPANSION_NWAY) + lpa_adv |= ADVERTISED_Autoneg; + if (anlpar & LPA_10HALF) + lpa_adv |= ADVERTISED_10baseT_Half; + if (anlpar & LPA_10FULL) + lpa_adv |= ADVERTISED_10baseT_Full; + if (anlpar & LPA_100HALF) + lpa_adv |= ADVERTISED_100baseT_Half; + if (anlpar & LPA_100FULL) + lpa_adv |= ADVERTISED_100baseT_Full; + if (anlpar & LPA_PAUSE_CAP) + lpa_adv |= ADVERTISED_Pause; + if (anlpar & LPA_PAUSE_ASYM) + lpa_adv |= ADVERTISED_Asym_Pause; + if (gbsr & LPA_1000HALF) + lpa_adv |= ADVERTISED_1000baseT_Half; + if (gbsr & LPA_1000FULL) + lpa_adv |= ADVERTISED_1000baseT_Full; + if (status_2500 & RTK_LPA_ADVERTISE_2500FULL) + lpa_adv |= ADVERTISED_2500baseX_Full; } else { /*link down*/ speed = SPEED_UNKNOWN; duplex = DUPLEX_UNKNOWN; + lpa_adv = 0; } #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) @@ -4720,11 +4873,42 @@ static void rtl8125_gset_xmii(struct net_device *dev, cmd->speed = speed; cmd->duplex = duplex; cmd->port = PORT_TP; + cmd->lp_advertising = lpa_adv; #else ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported, supported); ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising, advertising); + ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.lp_advertising, + lpa_adv); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) + if (supported & SUPPORTED_2500baseX_Full) { + linkmode_mod_bit(ETHTOOL_LINK_MODE_2500baseX_Full_BIT, + cmd->link_modes.supported, 0); + linkmode_mod_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, + cmd->link_modes.supported, 1); + } + if (advertising & ADVERTISED_2500baseX_Full) { + linkmode_mod_bit(ETHTOOL_LINK_MODE_2500baseX_Full_BIT, + cmd->link_modes.advertising, 0); + linkmode_mod_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, + cmd->link_modes.advertising, 1); + } + if (report_lpa) { + if (lpa_adv & ADVERTISED_2500baseX_Full) { + linkmode_mod_bit(ETHTOOL_LINK_MODE_2500baseX_Full_BIT, + cmd->link_modes.lp_advertising, 0); + linkmode_mod_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, + cmd->link_modes.lp_advertising, 1); + } + if (status_2500 & RTK_LPA_ADVERTISE_5000FULL) + linkmode_mod_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT, + cmd->link_modes.lp_advertising, 1); + if (status_2500 & RTK_LPA_ADVERTISE_10000FULL) + linkmode_mod_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT, + cmd->link_modes.lp_advertising, 1); + } +#endif cmd->base.autoneg = autoneg; cmd->base.speed = speed; cmd->base.duplex = duplex; @@ -4756,14 +4940,12 @@ static void rtl8125_get_regs(struct net_device *dev, struct ethtool_regs *regs, void __iomem *ioaddr = tp->mmio_addr; unsigned int i; u8 *data = p; - unsigned long flags; if (regs->len < R8125_REGS_DUMP_SIZE) return /* -EINVAL */; memset(p, 0, regs->len); - spin_lock_irqsave(&tp->lock, flags); for (i = 0; i < R8125_MAC_REGS_SIZE; i++) *data++ = readb(ioaddr + i); data = (u8*)p + 256; @@ -4793,16 +4975,12 @@ static void rtl8125_get_regs(struct net_device *dev, struct ethtool_regs *regs, } break; } - spin_unlock_irqrestore(&tp->lock, flags); } static void rtl8125_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause) { struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; - - spin_lock_irqsave(&tp->lock, flags); pause->autoneg = (tp->autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE); if (tp->fcpause == rtl8125_fc_rx_pause) @@ -4813,8 +4991,6 @@ static void rtl8125_get_pauseparam(struct net_device *dev, pause->rx_pause = 1; pause->tx_pause = 1; } - - spin_unlock_irqrestore(&tp->lock, flags); } static int rtl8125_set_pauseparam(struct net_device *dev, @@ -4822,23 +4998,18 @@ static int rtl8125_set_pauseparam(struct net_device *dev, { struct rtl8125_private *tp = netdev_priv(dev); enum rtl8125_fc_mode newfc; - unsigned long flags; if (pause->tx_pause || pause->rx_pause) newfc = rtl8125_fc_full; else newfc = rtl8125_fc_none; - spin_lock_irqsave(&tp->lock, flags); - if (tp->fcpause != newfc) { tp->fcpause = newfc; rtl8125_set_speed(dev, tp->autoneg, tp->speed, tp->duplex, tp->advertising); } - spin_unlock_irqrestore(&tp->lock, flags); - return 0; } @@ -4861,6 +5032,7 @@ rtl8125_set_msglevel(struct net_device *dev, } static const char rtl8125_gstrings[][ETH_GSTRING_LEN] = { + /* legacy */ "tx_packets", "rx_packets", "tx_errors", @@ -4874,6 +5046,34 @@ static const char rtl8125_gstrings[][ETH_GSTRING_LEN] = { "multicast", "tx_aborted", "tx_underrun", + + /* extended */ + "tx_octets", + "rx_octets", + "rx_multicast64", + "tx_unicast64", + "tx_broadcast64", + "tx_multicast64", + "tx_pause_on", + "tx_pause_off", + "tx_pause_all", + "tx_deferred", + "tx_late_collision", + "tx_all_collision", + "tx_aborted32", + "align_errors32", + "rx_frame_too_long", + "rx_runt", + "rx_pause_on", + "rx_pause_off", + "rx_pause_all", + "rx_unknown_opcode", + "rx_mac_error", + "tx_underrun32", + "rx_mac_missed", + "rx_tcam_dropped", + "tdu", + "rdu", }; #endif //#LINUX_VERSION_CODE > KERNEL_VERSION(2,4,22) @@ -4905,9 +5105,6 @@ rtl8125_get_ethtool_stats(struct net_device *dev, struct rtl8125_private *tp = netdev_priv(dev); struct rtl8125_counters *counters; dma_addr_t paddr; - u32 cmd; - u32 WaitCnt; - unsigned long flags; ASSERT_RTNL(); @@ -4916,21 +5113,7 @@ rtl8125_get_ethtool_stats(struct net_device *dev, if (!counters) return; - spin_lock_irqsave(&tp->lock, flags); - RTL_W32(tp, CounterAddrHigh, (u64)paddr >> 32); - cmd = (u64)paddr & DMA_BIT_MASK(32); - RTL_W32(tp, CounterAddrLow, cmd); - RTL_W32(tp, CounterAddrLow, cmd | CounterDump); - - WaitCnt = 0; - while (RTL_R32(tp, CounterAddrLow) & CounterDump) { - udelay(10); - - WaitCnt++; - if (WaitCnt > 20) - break; - } - spin_unlock_irqrestore(&tp->lock, flags); + rtl8125_dump_tally_counter(tp, paddr); data[0] = le64_to_cpu(counters->tx_packets); data[1] = le64_to_cpu(counters->rx_packets); @@ -4944,7 +5127,34 @@ rtl8125_get_ethtool_stats(struct net_device *dev, data[9] = le64_to_cpu(counters->rx_broadcast); data[10] = le32_to_cpu(counters->rx_multicast); data[11] = le16_to_cpu(counters->tx_aborted); - data[12] = le16_to_cpu(counters->tx_underun); + data[12] = le16_to_cpu(counters->tx_underrun); + + data[13] = le64_to_cpu(counters->tx_octets); + data[14] = le64_to_cpu(counters->rx_octets); + data[15] = le64_to_cpu(counters->rx_multicast64); + data[16] = le64_to_cpu(counters->tx_unicast64); + data[17] = le64_to_cpu(counters->tx_broadcast64); + data[18] = le64_to_cpu(counters->tx_multicast64); + data[19] = le32_to_cpu(counters->tx_pause_on); + data[20] = le32_to_cpu(counters->tx_pause_off); + data[21] = le32_to_cpu(counters->tx_pause_all); + data[22] = le32_to_cpu(counters->tx_deferred); + data[23] = le32_to_cpu(counters->tx_late_collision); + data[24] = le32_to_cpu(counters->tx_all_collision); + data[25] = le32_to_cpu(counters->tx_aborted32); + data[26] = le32_to_cpu(counters->align_errors32); + data[27] = le32_to_cpu(counters->rx_frame_too_long); + data[28] = le32_to_cpu(counters->rx_runt); + data[29] = le32_to_cpu(counters->rx_pause_on); + data[30] = le32_to_cpu(counters->rx_pause_off); + data[31] = le32_to_cpu(counters->rx_pause_all); + data[32] = le32_to_cpu(counters->rx_unknown_opcode); + data[33] = le32_to_cpu(counters->rx_mac_error); + data[34] = le32_to_cpu(counters->tx_underrun32); + data[35] = le32_to_cpu(counters->rx_mac_missed); + data[36] = le32_to_cpu(counters->rx_tcam_dropped); + data[37] = le32_to_cpu(counters->tdu); + data[38] = le32_to_cpu(counters->rdu); } static void @@ -5188,15 +5398,10 @@ static int rtl8125_disable_eee(struct rtl8125_private *tp) static int rtl_nway_reset(struct net_device *dev) { struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; int ret, bmcr; - spin_lock_irqsave(&tp->lock, flags); - - if (unlikely(tp->rtk_enable_diag)) { - spin_unlock_irqrestore(&tp->lock, flags); + if (unlikely(tp->rtk_enable_diag)) return -EBUSY; - } /* if autoneg is off, it's an error */ rtl8125_mdio_write(tp, 0x1F, 0x0000); @@ -5210,8 +5415,6 @@ static int rtl_nway_reset(struct net_device *dev) ret = -EINVAL; } - spin_unlock_irqrestore(&tp->lock, flags); - return ret; } @@ -5247,15 +5450,10 @@ rtl_ethtool_get_eee(struct net_device *net, struct ethtool_eee *edata) struct rtl8125_private *tp = netdev_priv(net); struct ethtool_eee *eee = &tp->eee; u32 lp, adv, tx_lpi_timer, supported = 0; - unsigned long flags; u16 val; - spin_lock_irqsave(&tp->lock, flags); - - if (unlikely(tp->rtk_enable_diag)) { - spin_unlock_irqrestore(&tp->lock, flags); + if (unlikely(tp->rtk_enable_diag)) return -EBUSY; - } /* Get Supported EEE */ //val = mdio_direct_read_phy_ocp(tp, 0xA5C4); @@ -5276,8 +5474,6 @@ rtl_ethtool_get_eee(struct net_device *net, struct ethtool_eee *edata) val = rtl8125_mac_ocp_read(tp, 0xE040); val &= BIT_1 | BIT_0; - spin_unlock_irqrestore(&tp->lock, flags); - edata->eee_enabled = !!val; edata->eee_active = !!(supported & adv & lp); edata->supported = supported; @@ -5295,25 +5491,22 @@ rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *edata) struct rtl8125_private *tp = netdev_priv(net); struct ethtool_eee *eee = &tp->eee; u32 advertising; - unsigned long flags; int rc = 0; if (!HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp) || tp->DASH) return -EOPNOTSUPP; - spin_lock_irqsave(&tp->lock, flags); - if (unlikely(tp->rtk_enable_diag)) { dev_printk(KERN_WARNING, tp_to_dev(tp), "Diag Enabled\n"); rc = -EBUSY; - goto exit_unlock; + goto out; } if (tp->autoneg != AUTONEG_ENABLE) { dev_printk(KERN_WARNING, tp_to_dev(tp), "EEE requires autoneg\n"); rc = -EINVAL; - goto exit_unlock; + goto out; } if (edata->tx_lpi_enabled) { @@ -5322,7 +5515,7 @@ rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *edata) dev_printk(KERN_WARNING, tp_to_dev(tp), "Valid LPI timer range is %d to %d. \n", ETH_MIN_MTU, tp->max_jumbo_frame_size); rc = -EINVAL; - goto exit_unlock; + goto out; } } @@ -5333,14 +5526,14 @@ rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *edata) dev_printk(KERN_WARNING, tp_to_dev(tp), "EEE advertised %x must be a subset of autoneg advertised speeds %x\n", edata->advertised, advertising); rc = -EINVAL; - goto exit_unlock; + goto out; } if (edata->advertised & ~eee->supported) { dev_printk(KERN_WARNING, tp_to_dev(tp), "EEE advertised %x must be a subset of support %x\n", edata->advertised, eee->supported); rc = -EINVAL; - goto exit_unlock; + goto out; } //tp->eee.eee_enabled = edata->eee_enabled; @@ -5359,15 +5552,11 @@ rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *edata) else rtl8125_disable_eee(tp); - spin_unlock_irqrestore(&tp->lock, flags); - rtl_nway_reset(net); return rc; -exit_unlock: - - spin_unlock_irqrestore(&tp->lock, flags); +out: return rc; } @@ -5449,7 +5638,6 @@ static const struct ethtool_ops rtl8125_ethtool_ops = { static int rtl8125_enable_green_feature(struct rtl8125_private *tp) { u16 gphy_val; - unsigned long flags; switch (tp->mcfg) { case CFG_METHOD_2: @@ -5471,7 +5659,6 @@ static int rtl8125_enable_green_feature(struct rtl8125_private *tp) static int rtl8125_disable_green_feature(struct rtl8125_private *tp) { u16 gphy_val; - unsigned long flags; switch (tp->mcfg) { case CFG_METHOD_2: @@ -5838,17 +6025,21 @@ rtl8125_set_mac_mcu_8125b_2(struct net_device *dev) struct rtl8125_private *tp = netdev_priv(dev); u16 i; static const u16 mcu_patch_code_8125b_2[] = { - 0xE008, 0xE013, 0xE01E, 0xE02F, 0xE035, 0xE04F, 0xE053, 0xE055, 0x740A, - 0x4846, 0x4847, 0x9C0A, 0xC607, 0x74C0, 0x48C6, 0x9CC0, 0xC602, 0xBE00, - 0x13F0, 0xE054, 0x72CA, 0x4826, 0x4827, 0x9ACA, 0xC607, 0x72C0, 0x48A6, - 0x9AC0, 0xC602, 0xBE00, 0x081C, 0xE054, 0xC60F, 0x74C4, 0x49CC, 0xF109, - 0xC60C, 0x74CA, 0x48C7, 0x9CCA, 0xC609, 0x74C0, 0x4846, 0x9CC0, 0xC602, - 0xBE00, 0x2494, 0xE092, 0xE0C0, 0xE054, 0x7420, 0x48C0, 0x9C20, 0x7444, - 0xC602, 0xBE00, 0x12DC, 0x733A, 0x21B5, 0x25BC, 0x1304, 0xF111, 0x1B12, - 0x1D2A, 0x3168, 0x3ADA, 0x31AB, 0x1A00, 0x9AC0, 0x1300, 0xF1FB, 0x7620, - 0x236E, 0x276F, 0x1A3C, 0x22A1, 0x41B5, 0x9EE2, 0x76E4, 0x486F, 0x9EE4, - 0xC602, 0xBE00, 0x4A26, 0x733A, 0x49BB, 0xC602, 0xBE00, 0x47A2, 0xC602, - 0xBE00, 0x0000, 0xC602, 0xBE00, 0x0000 + 0xE010, 0xE01B, 0xE026, 0xE037, 0xE03D, 0xE057, 0xE05B, 0xE05F, 0xE061, + 0xE063, 0xE065, 0xE067, 0xE069, 0xE06B, 0xE06D, 0xE06F, 0x740A, 0x4846, + 0x4847, 0x9C0A, 0xC607, 0x74C0, 0x48C6, 0x9CC0, 0xC602, 0xBE00, 0x13F0, + 0xE054, 0x72CA, 0x4826, 0x4827, 0x9ACA, 0xC607, 0x72C0, 0x48A6, 0x9AC0, + 0xC602, 0xBE00, 0x081C, 0xE054, 0xC60F, 0x74C4, 0x49CC, 0xF109, 0xC60C, + 0x74CA, 0x48C7, 0x9CCA, 0xC609, 0x74C0, 0x4846, 0x9CC0, 0xC602, 0xBE00, + 0x2494, 0xE092, 0xE0C0, 0xE054, 0x7420, 0x48C0, 0x9C20, 0x7444, 0xC602, + 0xBE00, 0x12DC, 0x733A, 0x21B5, 0x25BC, 0x1304, 0xF111, 0x1B12, 0x1D2A, + 0x3168, 0x3ADA, 0x31AB, 0x1A00, 0x9AC0, 0x1300, 0xF1FB, 0x7620, 0x236E, + 0x276F, 0x1A3C, 0x22A1, 0x41B5, 0x9EE2, 0x76E4, 0x486F, 0x9EE4, 0xC602, + 0xBE00, 0x4A26, 0x733A, 0x49BB, 0xC602, 0xBE00, 0x47A2, 0x48C1, 0x48C2, + 0xC5C3, 0xBD00, 0x0A52, 0xC602, 0xBE00, 0x0000, 0xC602, 0xBE00, 0x0000, + 0xC602, 0xBE00, 0x0000, 0xC602, 0xBE00, 0x0000, 0xC602, 0xBE00, 0x0000, + 0xC602, 0xBE00, 0x0000, 0xC602, 0xBE00, 0x0000, 0xC602, 0xBE00, 0x0000, + 0xC602, 0xBE00, 0x0000 }; rtl8125_hw_disable_mac_mcu_bps(dev); @@ -5865,8 +6056,9 @@ rtl8125_set_mac_mcu_8125b_2(struct net_device *dev) rtl8125_mac_ocp_write(tp, 0xFC2E, 0x12DA); rtl8125_mac_ocp_write(tp, 0xFC30, 0x4A20); rtl8125_mac_ocp_write(tp, 0xFC32, 0x47A0); + rtl8125_mac_ocp_write(tp, 0xFC34, 0x0A46); - rtl8125_mac_ocp_write(tp, 0xFC48, 0x003F); + rtl8125_mac_ocp_write(tp, 0xFC48, 0x007F); } static void @@ -6133,43 +6325,52 @@ rtl8125_check_hw_phy_mcu_code_ver(struct net_device *dev) return ram_code_ver_match; } -static bool -rtl8125_wait_phy_mcu_patch_request_ready(struct rtl8125_private *tp) +bool +rtl8125_set_phy_mcu_patch_request(struct rtl8125_private *tp) { u16 gphy_val; u16 WaitCount; bool bSuccess = TRUE; + SetEthPhyOcpBit(tp, 0xB820, BIT_4); + WaitCount = 0; do { gphy_val = mdio_direct_read_phy_ocp(tp, 0xB800); - gphy_val &= BIT_6; udelay(100); WaitCount++; - } while(gphy_val != BIT_6 && WaitCount < 1000); + } while (!(gphy_val & BIT_6) && (WaitCount < 1000)); - if (gphy_val != BIT_6 && WaitCount == 1000) bSuccess = FALSE; + if (!(gphy_val & BIT_6) && (WaitCount == 1000)) bSuccess = FALSE; if (!bSuccess) - dprintk("rtl8125_wait_phy_mcu_patch_request_ready fail.\n"); + dprintk("rtl8125_set_phy_mcu_patch_request fail.\n"); return bSuccess; } -bool -rtl8125_set_phy_mcu_patch_request(struct rtl8125_private *tp) -{ - SetEthPhyOcpBit(tp, 0xB820, BIT_4); - - return rtl8125_wait_phy_mcu_patch_request_ready(tp); -} - bool rtl8125_clear_phy_mcu_patch_request(struct rtl8125_private *tp) { + u16 gphy_val; + u16 WaitCount; + bool bSuccess = TRUE; + ClearEthPhyOcpBit(tp, 0xB820, BIT_4); - return rtl8125_wait_phy_mcu_patch_request_ready(tp); + WaitCount = 0; + do { + gphy_val = mdio_direct_read_phy_ocp(tp, 0xB800); + udelay(100); + WaitCount++; + } while ((gphy_val & BIT_6) && (WaitCount < 1000)); + + if ((gphy_val & BIT_6) && (WaitCount == 1000)) bSuccess = FALSE; + + if (!bSuccess) + dprintk("rtl8125_clear_phy_mcu_patch_request fail.\n"); + + return bSuccess; } #ifndef ENABLE_USE_FIRMWARE_FILE @@ -9660,6 +9861,7 @@ rtl8125_up(struct net_device *dev) rtl8125_hw_config(dev); } +/* static inline void rtl8125_delete_esd_timer(struct net_device *dev, struct timer_list *timer) { del_timer_sync(timer); @@ -9676,6 +9878,7 @@ static inline void rtl8125_request_esd_timer(struct net_device *dev) #endif mod_timer(timer, jiffies + RTL8125_ESD_TIMEOUT); } +*/ /* static inline void rtl8125_delete_link_timer(struct net_device *dev, struct timer_list *timer) @@ -9765,28 +9968,28 @@ rtl8125_setup_mqs_reg(struct rtl8125_private *tp) //tx tp->tx_ring[0].tdsar_reg = TxDescStartAddrLow; for (i = 1; i < R8125_MAX_TX_QUEUES; i++) { - tp->tx_ring[i].tdsar_reg = (u16)(TNPDS_Q1_LOW_8125 + (i - 1) * 8); + tp->tx_ring[i].tdsar_reg = (u16)(TNPDS_Q1_LOW_8125 + (i - 1) * 8); } for (i = 0; i < R8125_MAX_TX_QUEUES; i++) { - tp->tx_ring[i].hw_clo_ptr_reg = (u16)(HW_CLO_PTR0_8125 + i * 4); - tp->tx_ring[i].sw_tail_ptr_reg = (u16)(SW_TAIL_PTR0_8125 + i * 4); + tp->tx_ring[i].hw_clo_ptr_reg = (u16)(HW_CLO_PTR0_8125 + i * 4); + tp->tx_ring[i].sw_tail_ptr_reg = (u16)(SW_TAIL_PTR0_8125 + i * 4); } //rx tp->rx_ring[0].rdsar_reg = RxDescAddrLow; for (i = 1; i < R8125_MAX_RX_QUEUES; i++) { - tp->rx_ring[i].rdsar_reg = (u16)(RDSAR_Q1_LOW_8125 + (i - 1) * 8); + tp->rx_ring[i].rdsar_reg = (u16)(RDSAR_Q1_LOW_8125 + (i - 1) * 8); } tp->isr_reg[0] = ISR0_8125; for (i = 1; i < R8125_MAX_QUEUES; i++) { - tp->isr_reg[i] = (u16)(ISR1_8125 + (i - 1) * 4); + tp->isr_reg[i] = (u16)(ISR1_8125 + (i - 1) * 4); } tp->imr_reg[0] = IMR0_8125; for (i = 1; i < R8125_MAX_QUEUES; i++) { - tp->imr_reg[i] = (u16)(IMR1_8125 + (i - 1) * 4); + tp->imr_reg[i] = (u16)(IMR1_8125 + (i - 1) * 4); } } @@ -10103,8 +10306,11 @@ rtl8125_init_software_variable(struct net_device *dev) } tp->HwCurrIsrVer = tp->HwSuppIsrVer; - if (tp->HwSuppIsrVer == 2 && !(tp->features & RTL_FEATURE_MSIX)) - tp->HwCurrIsrVer = 1; + if (tp->HwSuppIsrVer == 2) { + if (!(tp->features & RTL_FEATURE_MSIX) || + tp->irq_nvecs < R8125_MIN_MSIX_VEC_8125B) + tp->HwCurrIsrVer = 1; + } if (tp->HwCurrIsrVer < 2 || tp->irq_nvecs < 19) tp->num_tx_rings = 1; @@ -10143,6 +10349,15 @@ rtl8125_init_software_variable(struct net_device *dev) break; } + switch (tp->mcfg) { + case CFG_METHOD_2: + case CFG_METHOD_3: + case CFG_METHOD_4: + case CFG_METHOD_5: + tp->HwSuppExtendTallyCounterVer = 1; + break; + } + timer_count_v2 = (timer_count / 0x100); tp->NicCustLedValue = RTL_R16(tp, CustomLED); @@ -10268,19 +10483,14 @@ rtl8125_set_mac_address(struct net_device *dev, { struct rtl8125_private *tp = netdev_priv(dev); struct sockaddr *addr = p; - unsigned long flags; if (!is_valid_ether_addr(addr->sa_data)) return -EADDRNOTAVAIL; - spin_lock_irqsave(&tp->lock, flags); - memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); rtl8125_rar_set(tp, dev->dev_addr); - spin_unlock_irqrestore(&tp->lock, flags); - return 0; } @@ -10980,7 +11190,6 @@ rtl8125_do_ioctl(struct net_device *dev, struct rtl8125_private *tp = netdev_priv(dev); struct mii_ioctl_data *data = if_mii(ifr); int ret; - unsigned long flags; ret = 0; switch (cmd) { @@ -10989,19 +11198,15 @@ rtl8125_do_ioctl(struct net_device *dev, break; case SIOCGMIIREG: - spin_lock_irqsave(&tp->lock, flags); rtl8125_mdio_write(tp, 0x1F, 0x0000); data->val_out = rtl8125_mdio_read(tp, data->reg_num); - spin_unlock_irqrestore(&tp->lock, flags); break; case SIOCSMIIREG: if (!capable(CAP_NET_ADMIN)) return -EPERM; - spin_lock_irqsave(&tp->lock, flags); rtl8125_mdio_write(tp, 0x1F, 0x0000); rtl8125_mdio_write(tp, data->reg_num, data->val_in); - spin_unlock_irqrestore(&tp->lock, flags); break; #ifdef ETHTOOL_OPS_COMPAT @@ -11257,24 +11462,10 @@ err_out: } static void -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0) -rtl8125_esd_timer(unsigned long __opaque) -#else -rtl8125_esd_timer(struct timer_list *t) -#endif +rtl8125_esd_checker(struct rtl8125_private *tp) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0) - struct net_device *dev = (struct net_device *)__opaque; - struct rtl8125_private *tp = netdev_priv(dev); - struct timer_list *timer = &tp->esd_timer; -#else - struct rtl8125_private *tp = from_timer(tp, t, esd_timer); struct net_device *dev = tp->dev; - struct timer_list *timer = t; -#endif struct pci_dev *pdev = tp->pci_dev; - unsigned long timeout = RTL8125_ESD_TIMEOUT; - unsigned long flags; u8 cmd; u16 io_base_l; u16 mem_base_l; @@ -11291,8 +11482,6 @@ rtl8125_esd_timer(struct timer_list *t) u32 pci_sn_l; u32 pci_sn_h; - spin_lock_irqsave(&tp->lock, flags); - tp->esd_flag = 0; pci_read_config_byte(pdev, PCI_COMMAND, &cmd); @@ -11404,7 +11593,7 @@ rtl8125_esd_timer(struct timer_list *t) if (tp->esd_flag != 0) { printk(KERN_ERR "%s: esd_flag = 0x%04x\n.\n", dev->name, tp->esd_flag); - rtl8125_stop_all_tx_queue(dev); + netif_tx_stop_all_queues(dev); netif_carrier_off(dev); rtl8125_hw_reset(dev); rtl8125_tx_clear(tp); @@ -11415,10 +11604,29 @@ rtl8125_esd_timer(struct timer_list *t) rtl8125_set_speed(dev, tp->autoneg, tp->speed, tp->duplex, tp->advertising); tp->esd_flag = 0; } - spin_unlock_irqrestore(&tp->lock, flags); +} +/* +static void +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0) +rtl8125_esd_timer(unsigned long __opaque) +#else +rtl8125_esd_timer(struct timer_list *t) +#endif +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0) + struct net_device *dev = (struct net_device *)__opaque; + struct rtl8125_private *tp = netdev_priv(dev); + struct timer_list *timer = &tp->esd_timer; +#else + struct rtl8125_private *tp = from_timer(tp, t, esd_timer); + //struct net_device *dev = tp->dev; + struct timer_list *timer = t; +#endif + rtl8125_esd_checker(tp); mod_timer(timer, jiffies + timeout); } +*/ /* static void @@ -11437,11 +11645,7 @@ rtl8125_link_timer(struct timer_list *t) struct net_device *dev = tp->dev; struct timer_list *timer = t; #endif - unsigned long flags; - - spin_lock_irqsave(&tp->lock, flags); rtl8125_check_link_status(dev); - spin_unlock_irqrestore(&tp->lock, flags); mod_timer(timer, jiffies + RTL8125_LINK_TIMEOUT); } @@ -11503,17 +11707,17 @@ static int rtl8125_try_msi(struct rtl8125_private *tp) unsigned msi = 0; int nvecs = 1; + tp->max_irq_nvecs = 1; + tp->min_irq_nvecs = 1; +#ifndef DISABLE_MULTI_MSIX_VECTOR switch (tp->mcfg) { case CFG_METHOD_4: case CFG_METHOD_5: tp->max_irq_nvecs = R8125_MAX_MSIX_VEC_8125B; tp->min_irq_nvecs = R8125_MIN_MSIX_VEC_8125B; break; - default: - tp->max_irq_nvecs = 1; - tp->min_irq_nvecs = 1; - break; } +#endif #if defined(RTL_USE_NEW_INTR_API) if ((nvecs = pci_alloc_irq_vectors(pdev, tp->min_irq_nvecs, tp->max_irq_nvecs, PCI_IRQ_MSIX)) > 0) @@ -11602,28 +11806,20 @@ static int rtl8125_poll(napi_ptr napi, napi_budget budget) RTL_GET_NETDEV(tp) unsigned int work_to_do = RTL_NAPI_QUOTA(budget, dev); unsigned int work_done = 0; - //unsigned long flags; int i; for (i = 0; i < tp->num_rx_rings; i++) work_done += rtl8125_rx_interrupt(dev, tp, &tp->rx_ring[i], budget); - //spin_lock_irqsave(&tp->lock, flags); for (i = 0; i < tp->num_tx_rings; i++) rtl8125_tx_interrupt(&tp->tx_ring[i], budget); - //spin_unlock_irqrestore(&tp->lock, flags); RTL_NAPI_QUOTA_UPDATE(dev, work_done, budget); if (work_done < work_to_do) { #ifdef ENABLE_DASH_SUPPORT - if (tp->DASH) { - struct net_device *dev = tp->dev; - - spin_lock_irqsave(&tp->lock, flags); - HandleDashInterrupt(dev); - spin_unlock_irqrestore(&tp->lock, flags); - } + if (tp->DASH) + HandleDashInterrupt(tp->dev); #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0) @@ -11653,26 +11849,18 @@ static int rtl8125_poll_msix_ring(napi_ptr napi, napi_budget budget) RTL_GET_NETDEV(tp) unsigned int work_to_do = RTL_NAPI_QUOTA(budget, dev); unsigned int work_done = 0; - unsigned long flags; const int message_id = r8125napi->index; work_done += rtl8125_rx_interrupt(dev, tp, &tp->rx_ring[message_id], budget); - //spin_lock_irqsave(&tp->lock, flags); rtl8125_tx_interrupt_with_vector(tp, message_id, budget); - //spin_unlock_irqrestore(&tp->lock, flags); RTL_NAPI_QUOTA_UPDATE(dev, work_done, budget); if (work_done < work_to_do) { #ifdef ENABLE_DASH_SUPPORT - if (tp->DASH && message_id == 0) { - struct net_device *dev = tp->dev; - - spin_lock_irqsave(&tp->lock, flags); - HandleDashInterrupt(dev); - spin_unlock_irqrestore(&tp->lock, flags); - } + if (tp->DASH && message_id == 0) + HandleDashInterrupt(tp->dev); #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0) @@ -11702,15 +11890,12 @@ static int rtl8125_poll_msix_tx(napi_ptr napi, napi_budget budget) RTL_GET_NETDEV(tp) unsigned int work_to_do = RTL_NAPI_QUOTA(budget, dev); unsigned int work_done = 0; - //unsigned long flags; const int message_id = r8125napi->index; //suppress unused variable (void)(dev); - //spin_lock_irqsave(&tp->lock, flags); rtl8125_tx_interrupt_with_vector(tp, message_id, budget); - //spin_unlock_irqrestore(&tp->lock, flags); RTL_NAPI_QUOTA_UPDATE(dev, work_done, budget); @@ -11849,6 +12034,23 @@ static void rtl8125_init_napi(struct rtl8125_private *tp) } } +static int +rtl8125_set_real_num_queue(struct rtl8125_private *tp) +{ + int retval = 0; + + retval = netif_set_real_num_tx_queues(tp->dev, tp->num_tx_rings); + if (retval < 0) + goto exit; + + retval = netif_set_real_num_rx_queues(tp->dev, tp->num_rx_rings); + if (retval < 0) + goto exit; + +exit: + return retval; +} + static int __devinit rtl8125_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) @@ -11888,8 +12090,6 @@ rtl8125_init_one(struct pci_dev *pdev, goto err_out_1; } - spin_lock_init(&tp->lock); - rtl8125_init_software_variable(dev); RTL_NET_DEVICE_OPS(rtl8125_netdev_ops); @@ -11964,6 +12164,11 @@ rtl8125_init_one(struct pci_dev *pdev, #ifdef ENABLE_LIB_SUPPORT ATOMIC_INIT_NOTIFIER_HEAD(&tp->lib_nh); #endif + rtl8125_init_all_schedule_work(tp); + + rc = rtl8125_set_real_num_queue(tp); + if (rc < 0) + goto err_out; rtl8125_exit_oob(dev); @@ -12038,6 +12243,10 @@ rtl8125_remove_one(struct pci_dev *pdev) assert(dev != NULL); assert(tp != NULL); + set_bit(R8125_FLAG_DOWN, tp->task_flags); + + rtl8125_cancel_all_schedule_work(tp); + #ifdef CONFIG_R8125_NAPI rtl8125_del_napi(tp); #endif @@ -12233,22 +12442,6 @@ static void rtl8125_free_alloc_resources(struct rtl8125_private *tp) rtl8125_free_tx_desc(tp); } -int rtl8125_set_real_num_queue(struct rtl8125_private *tp) -{ - int retval = 0; - - retval = netif_set_real_num_tx_queues(tp->dev, tp->num_tx_rings); - if (retval < 0) - goto exit; - - retval = netif_set_real_num_rx_queues(tp->dev, tp->num_rx_rings); - if (retval < 0) - goto exit; - -exit: - return retval; -} - #ifdef ENABLE_USE_FIRMWARE_FILE static void rtl8125_request_firmware(struct rtl8125_private *tp) { @@ -12279,7 +12472,6 @@ static void rtl8125_request_firmware(struct rtl8125_private *tp) int rtl8125_open(struct net_device *dev) { struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; int retval; retval = -ENOMEM; @@ -12299,10 +12491,6 @@ int rtl8125_open(struct net_device *dev) if (retval < 0) goto err_free_all_allocated_mem; - retval = rtl8125_set_real_num_queue(tp); - if (retval < 0) - goto err_free_all_allocated_mem; - retval = rtl8125_alloc_irq(tp); if (retval < 0) goto err_free_all_allocated_mem; @@ -12321,21 +12509,12 @@ int rtl8125_open(struct net_device *dev) #ifdef ENABLE_USE_FIRMWARE_FILE rtl8125_request_firmware(tp); #endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) - INIT_WORK(&tp->task, rtl8125_reset_task, dev); -#else - INIT_DELAYED_WORK(&tp->task, rtl8125_reset_task); -#endif - pci_set_master(tp->pci_dev); #ifdef CONFIG_R8125_NAPI rtl8125_enable_napi(tp); #endif - spin_lock_irqsave(&tp->lock, flags); - rtl8125_exit_oob(dev); rtl8125_up(dev); @@ -12344,16 +12523,18 @@ int rtl8125_open(struct net_device *dev) if (tp->EnablePtp) rtl8125_ptp_init(tp); #endif + clear_bit(R8125_FLAG_DOWN, tp->task_flags); if (tp->resume_not_chg_speed) rtl8125_check_link_status(dev); else rtl8125_set_speed(dev, tp->autoneg, tp->speed, tp->duplex, tp->advertising); - spin_unlock_irqrestore(&tp->lock, flags); + if (tp->esd_flag == 0) { + //rtl8125_request_esd_timer(dev); - if (tp->esd_flag == 0) - rtl8125_request_esd_timer(dev); + rtl8125_schedule_esd_work(tp); + } //rtl8125_request_link_timer(dev); @@ -12464,14 +12645,7 @@ rtl8125_hw_set_rx_packet_filter(struct net_device *dev) static void rtl8125_set_rx_mode(struct net_device *dev) { - struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; - - spin_lock_irqsave(&tp->lock, flags); - rtl8125_hw_set_rx_packet_filter(dev); - - spin_unlock_irqrestore(&tp->lock, flags); } void @@ -12561,6 +12735,8 @@ rtl8125_hw_config(struct net_device *dev) rtl8125_tally_counter_addr_fill(tp); + rtl8125_enable_extend_tally_couter(tp); + rtl8125_desc_addr_fill(tp); /* Set DMA burst size and Interframe Gap Time */ @@ -12671,7 +12847,7 @@ rtl8125_hw_config(struct net_device *dev) RTL_W8(tp, 0xD0, (RTL_R8(tp, 0xD0) & ~BIT_6) | BIT_7); if (tp->mcfg == CFG_METHOD_2 || tp->mcfg == CFG_METHOD_3) - RTL_W8(tp, 0xD3, RTL_R8(tp, 0xD3) | BIT_0); + RTL_W8(tp, MCUCmd_reg, RTL_R8(tp, MCUCmd_reg) | BIT_0); rtl8125_disable_eee_plus(tp); @@ -12839,7 +13015,6 @@ rtl8125_change_mtu(struct net_device *dev, { struct rtl8125_private *tp = netdev_priv(dev); int ret = 0; - unsigned long flags; #if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0) if (new_mtu < ETH_MIN_MTU) @@ -12848,40 +13023,32 @@ rtl8125_change_mtu(struct net_device *dev, new_mtu = tp->max_jumbo_frame_size; #endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0) - spin_lock_irqsave(&tp->lock, flags); dev->mtu = new_mtu; - spin_unlock_irqrestore(&tp->lock, flags); if (!netif_running(dev)) goto out; rtl8125_down(dev); - spin_lock_irqsave(&tp->lock, flags); - rtl8125_set_rxbufsize(tp, dev); ret = rtl8125_init_ring(dev); - if (ret < 0) { - spin_unlock_irqrestore(&tp->lock, flags); + if (ret < 0) goto err_out; - } #ifdef CONFIG_R8125_NAPI rtl8125_enable_napi(tp); #endif//CONFIG_R8125_NAPI - //rtl8125_stop_all_tx_queue(dev); + //netif_tx_stop_all_queues(dev); //netif_carrier_off(dev); rtl8125_hw_config(dev); rtl8125_enable_hw_linkchg_interrupt(tp); rtl8125_set_speed(dev, tp->autoneg, tp->speed, tp->duplex, tp->advertising); - spin_unlock_irqrestore(&tp->lock, flags); - - mod_timer(&tp->esd_timer, jiffies + RTL8125_ESD_TIMEOUT); + //mod_timer(&tp->esd_timer, jiffies + RTL8125_ESD_TIMEOUT); //mod_timer(&tp->link_timer, jiffies + RTL8125_LINK_TIMEOUT); out: #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) @@ -13197,38 +13364,101 @@ rtl8125_tx_clear(struct rtl8125_private *tp) } #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) -static void rtl8125_schedule_work(struct net_device *dev, void (*task)(void *)) +static void rtl8125_schedule_reset_work(struct rtl8125_private *tp) { #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) - struct rtl8125_private *tp = netdev_priv(dev); - - INIT_WORK(&tp->task, task, dev); - schedule_delayed_work(&tp->task, 4); + set_bit(R8125_FLAG_TASK_RESET_PENDING, tp->task_flags); + schedule_delayed_work(&tp->reset_task, 4); #endif //LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) } -#define rtl8125_cancel_schedule_work(a) - -#else -static void rtl8125_schedule_work(struct net_device *dev, work_func_t task) +static void rtl8125_schedule_esd_work(struct rtl8125_private *tp) { - struct rtl8125_private *tp = netdev_priv(dev); - - INIT_DELAYED_WORK(&tp->task, task); - schedule_delayed_work(&tp->task, 4); +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) + set_bit(R8125_FLAG_TASK_ESD_CHECK_PENDING, tp->task_flags); + schedule_delayed_work(&tp->esd_task, RTL8125_ESD_TIMEOUT); +#endif //LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) } -static void rtl8125_cancel_schedule_work(struct net_device *dev) +static void rtl8125_schedule_linkchg_work(struct rtl8125_private *tp) { - struct rtl8125_private *tp = netdev_priv(dev); - struct work_struct *work = &tp->task.work; +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) + set_bit(R8125_FLAG_TASK_LINKCHG_CHECK_PENDING, tp->task_flags); + schedule_delayed_work(&tp->linkchg_task, 4); +#endif //LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) +} + +#define rtl8125_cancel_schedule_reset_work(a) +#define rtl8125_cancel_schedule_esd_work(a) +#define rtl8125_cancel_schedule_linkchg_work(a) + +#else +static void rtl8125_schedule_reset_work(struct rtl8125_private *tp) +{ + set_bit(R8125_FLAG_TASK_RESET_PENDING, tp->task_flags); + schedule_delayed_work(&tp->reset_task, 4); +} + +static void rtl8125_cancel_schedule_reset_work(struct rtl8125_private *tp) +{ + struct work_struct *work = &tp->reset_task.work; if (!work->func) return; - cancel_delayed_work_sync(&tp->task); + cancel_delayed_work_sync(&tp->reset_task); +} + +static void rtl8125_schedule_esd_work(struct rtl8125_private *tp) +{ + set_bit(R8125_FLAG_TASK_ESD_CHECK_PENDING, tp->task_flags); + schedule_delayed_work(&tp->esd_task, RTL8125_ESD_TIMEOUT); +} + +static void rtl8125_cancel_schedule_esd_work(struct rtl8125_private *tp) +{ + struct work_struct *work = &tp->esd_task.work; + + if (!work->func) return; + + cancel_delayed_work_sync(&tp->esd_task); +} + +static void rtl8125_schedule_linkchg_work(struct rtl8125_private *tp) +{ + set_bit(R8125_FLAG_TASK_LINKCHG_CHECK_PENDING, tp->task_flags); + schedule_delayed_work(&tp->linkchg_task, RTL8125_ESD_TIMEOUT); +} + +static void rtl8125_cancel_schedule_linkchg_work(struct rtl8125_private *tp) +{ + struct work_struct *work = &tp->linkchg_task.work; + + if (!work->func) return; + + cancel_delayed_work_sync(&tp->linkchg_task); } #endif +static void rtl8125_init_all_schedule_work(struct rtl8125_private *tp) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) + INIT_WORK(&tp->reset_task, rtl8125_reset_task, dev); + INIT_WORK(&tp->esd_task, rtl8125_esd_task, dev); + INIT_WORK(&tp->linkchg_task, rtl8125_linkchg_task, dev); +#else + INIT_DELAYED_WORK(&tp->reset_task, rtl8125_reset_task); + INIT_DELAYED_WORK(&tp->esd_task, rtl8125_esd_task); + INIT_DELAYED_WORK(&tp->linkchg_task, rtl8125_linkchg_task); +#endif +} + +static void rtl8125_cancel_all_schedule_work(struct rtl8125_private *tp) +{ + rtl8125_cancel_schedule_reset_work(tp); + rtl8125_cancel_schedule_esd_work(tp); + rtl8125_cancel_schedule_linkchg_work(tp); +} + static void rtl8125_wait_for_irq_complete(struct rtl8125_private *tp) { @@ -13245,7 +13475,6 @@ static void _rtl8125_wait_for_quiescence(struct net_device *dev) { struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; /* Wait for any pending NAPI task to complete */ #ifdef CONFIG_R8125_NAPI @@ -13256,12 +13485,9 @@ _rtl8125_wait_for_quiescence(struct net_device *dev) /* Give a racing hard_start_xmit a few cycles to complete. */ synchronize_net(); #endif - spin_lock_irqsave(&tp->lock, flags); rtl8125_irq_mask_and_ack(tp); - spin_unlock_irqrestore(&tp->lock, flags); - rtl8125_wait_for_irq_complete(tp); } @@ -13280,43 +13506,6 @@ rtl8125_wait_for_quiescence(struct net_device *dev) #endif//CONFIG_R8125_NAPI } -#if 0 -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) -static void rtl8125_reinit_task(void *_data) -#else -static void rtl8125_reinit_task(struct work_struct *work) -#endif -{ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) - struct net_device *dev = _data; -#else - struct rtl8125_private *tp = - container_of(work, struct rtl8125_private, task.work); - struct net_device *dev = tp->dev; -#endif - int ret; - - if (netif_running(dev)) { - rtl8125_wait_for_quiescence(dev); - rtl8125_close(dev); - } - - ret = rtl8125_open(dev); - if (unlikely(ret < 0)) { - if (unlikely(net_ratelimit())) { - struct rtl8125_private *tp = netdev_priv(dev); - - if (netif_msg_drv(tp)) { - printk(PFX KERN_ERR - "%s: reinit failure (status = %d)." - " Rescheduling.\n", dev->name, ret); - } - } - rtl8125_schedule_work(dev, rtl8125_reinit_task); - } -} -#endif - static int rtl8125_rx_nostuck(struct rtl8125_private *tp) { int i, ret = 1; @@ -13334,15 +13523,18 @@ static void rtl8125_reset_task(void *_data) static void rtl8125_reset_task(struct work_struct *work) { struct rtl8125_private *tp = - container_of(work, struct rtl8125_private, task.work); + container_of(work, struct rtl8125_private, reset_task.work); struct net_device *dev = tp->dev; #endif u32 budget = ~(u32)0; - unsigned long flags; int i; - if (!netif_running(dev)) - return; + rtnl_lock(); + + if (!netif_running(dev) || + test_bit(R8125_FLAG_DOWN, tp->task_flags) || + !test_and_clear_bit(R8125_FLAG_TASK_RESET_PENDING, tp->task_flags)) + goto out_unlock; rtl8125_wait_for_quiescence(dev); @@ -13354,7 +13546,9 @@ static void rtl8125_reset_task(struct work_struct *work) #endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) } - spin_lock_irqsave(&tp->lock, flags); + netif_tx_stop_all_queues(dev); + netif_carrier_off(dev); + rtl8125_hw_reset(dev); rtl8125_tx_clear(tp); @@ -13364,12 +13558,16 @@ static void rtl8125_reset_task(struct work_struct *work) #ifdef ENABLE_PTP_SUPPORT rtl8125_ptp_reset(tp); #endif - rtl8125_enable_hw_linkchg_interrupt(tp); + if (tp->resume_not_chg_speed) { + _rtl8125_check_link_status(dev); - rtl8125_set_speed(dev, tp->autoneg, tp->speed, tp->duplex, tp->advertising); - spin_unlock_irqrestore(&tp->lock, flags); + tp->resume_not_chg_speed = 0; + } else { + rtl8125_enable_hw_linkchg_interrupt(tp); + + rtl8125_set_speed(dev, tp->autoneg, tp->speed, tp->duplex, tp->advertising); + } } else { - spin_unlock_irqrestore(&tp->lock, flags); if (unlikely(net_ratelimit())) { struct rtl8125_private *tp = netdev_priv(dev); @@ -13378,9 +13576,65 @@ static void rtl8125_reset_task(struct work_struct *work) "%s: Rx buffers shortage\n", dev->name); } } - rtl8125_schedule_work(dev, rtl8125_reset_task); + rtl8125_schedule_reset_work(tp); } + +out_unlock: + rtnl_unlock(); } + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) +static void rtl8125_esd_task(void *_data) +{ + struct net_device *dev = _data; + struct rtl8125_private *tp = netdev_priv(dev); +#else +static void rtl8125_esd_task(struct work_struct *work) +{ + struct rtl8125_private *tp = + container_of(work, struct rtl8125_private, esd_task.work); + struct net_device *dev = tp->dev; +#endif + rtnl_lock(); + + if (!netif_running(dev) || + test_bit(R8125_FLAG_DOWN, tp->task_flags) || + !test_and_clear_bit(R8125_FLAG_TASK_ESD_CHECK_PENDING, tp->task_flags)) + goto out_unlock; + + rtl8125_esd_checker(tp); + + rtl8125_schedule_esd_work(tp); + +out_unlock: + rtnl_unlock(); +} + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) +static void rtl8125_linkchg_task(void *_data) +{ + struct net_device *dev = _data; + //struct rtl8125_private *tp = netdev_priv(dev); +#else +static void rtl8125_linkchg_task(struct work_struct *work) +{ + struct rtl8125_private *tp = + container_of(work, struct rtl8125_private, linkchg_task.work); + struct net_device *dev = tp->dev; +#endif + rtnl_lock(); + + if (!netif_running(dev) || + test_bit(R8125_FLAG_DOWN, tp->task_flags) || + !test_and_clear_bit(R8125_FLAG_TASK_LINKCHG_CHECK_PENDING, tp->task_flags)) + goto out_unlock; + + rtl8125_check_link_status(dev); + +out_unlock: + rtnl_unlock(); +} + #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) static void rtl8125_tx_timeout(struct net_device *dev, unsigned int txqueue) @@ -13390,16 +13644,9 @@ rtl8125_tx_timeout(struct net_device *dev) #endif { struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; - - spin_lock_irqsave(&tp->lock, flags); - rtl8125_stop_all_tx_queue(dev); - netif_carrier_off(dev); - rtl8125_hw_reset(dev); - spin_unlock_irqrestore(&tp->lock, flags); /* Let's wait a bit while any (async) irq lands on */ - rtl8125_schedule_work(dev, rtl8125_reset_task); + rtl8125_schedule_reset_work(tp); } static u32 @@ -13821,7 +14068,6 @@ rtl8125_start_xmit(struct sk_buff *skb, u32 len; u32 opts[2]; netdev_tx_t ret = NETDEV_TX_OK; - //unsigned long flags; int frags; u8 EnableTxNoClose = tp->EnableTxNoClose; const u16 queue_mapping = skb_get_queue_mapping(skb); @@ -13832,8 +14078,6 @@ rtl8125_start_xmit(struct sk_buff *skb, ring = &tp->tx_ring[queue_mapping]; - //spin_lock_irqsave(&tp->lock, flags); - if (unlikely(!rtl8125_tx_slots_avail(tp, ring))) { if (netif_msg_drv(tp)) { printk(KERN_ERR @@ -13943,8 +14187,6 @@ rtl8125_start_xmit(struct sk_buff *skb, if (rtl8125_tx_slots_avail(tp, ring)) netif_start_subqueue(dev, queue_mapping); } - - //spin_unlock_irqrestore(&tp->lock, flags); out: return ret; err_dma_1: @@ -13952,7 +14194,6 @@ err_dma_1: rtl8125_tx_clear_range(tp, ring, ring->cur_tx + 1, frags); err_dma_0: RTLDEV->stats.tx_dropped++; - //spin_unlock_irqrestore(&tp->lock, flags); dev_kfree_skb_any(skb); ret = NETDEV_TX_OK; goto out; @@ -13960,8 +14201,6 @@ err_stop: netif_stop_subqueue(dev, queue_mapping); ret = NETDEV_TX_BUSY; RTLDEV->stats.tx_dropped++; - - //spin_unlock_irqrestore(&tp->lock, flags); goto out; } @@ -13981,15 +14220,16 @@ rtl8125_tx_interrupt(struct rtl8125_tx_ring *ring, int budget) u8 EnableTxNoClose = tp->EnableTxNoClose; dirty_tx = ring->dirty_tx; + smp_rmb(); + tx_left = READ_ONCE(ring->cur_tx) - dirty_tx; if (EnableTxNoClose) { + unsigned int tx_desc_closed; u32 NextHwDesCloPtr = RTL_R16(tp, ring->hw_clo_ptr_reg); ring->NextHwDesCloPtr = NextHwDesCloPtr; smp_rmb(); - tx_left = rtl8125_fast_mod(NextHwDesCloPtr - ring->BeginHwDesCloPtr, MAX_TX_NO_CLOSE_DESC_PTR_V2); + tx_desc_closed = rtl8125_fast_mod(NextHwDesCloPtr - ring->BeginHwDesCloPtr, MAX_TX_NO_CLOSE_DESC_PTR_V2); + if(tx_left > tx_desc_closed) tx_left = tx_desc_closed; ring->BeginHwDesCloPtr = NextHwDesCloPtr; - } else { - smp_rmb(); - tx_left = READ_ONCE(ring->cur_tx) - dirty_tx; } while (tx_left > 0) { @@ -14038,10 +14278,13 @@ rtl8125_tx_interrupt_with_vector(struct rtl8125_private *tp, int budget) { int count = 0; + if (message_id == 16) count += rtl8125_tx_interrupt(&tp->tx_ring[0], budget); +#ifdef ENABLE_MULTIPLE_TX_QUEUE else if (message_id == 18) count += rtl8125_tx_interrupt(&tp->tx_ring[1], budget); +#endif return count; } @@ -14291,7 +14534,7 @@ process_pkt: else WARN_ON(1); - rx_buf_phy_addr = le64_to_cpu(ring->RxDescPhyAddr[entry_next]); + rx_buf_phy_addr = ring->RxDescPhyAddr[entry_next]; dma_unmap_single(tp_to_dev(tp), rx_buf_phy_addr, tp->rx_buf_sz, DMA_FROM_DEVICE); skb_next = ring->Rx_skbuff[entry_next]; @@ -14301,7 +14544,7 @@ process_pkt: WARN_ON(desc_type != RXDESC_TYPE_NORMAL); } #endif - rx_buf_phy_addr = le64_to_cpu(ring->RxDescPhyAddr[entry]); + rx_buf_phy_addr = ring->RxDescPhyAddr[entry]; dma_sync_single_for_cpu(tp_to_dev(tp), rx_buf_phy_addr, tp->rx_buf_sz, DMA_FROM_DEVICE); @@ -14421,7 +14664,7 @@ static irqreturn_t rtl8125_interrupt(int irq, void *dev_instance) RTL_W32(tp, tp->isr_reg[0], status&~RxFIFOOver); if (rtl8125_linkchg_interrupt(tp, status)) - rtl8125_check_link_status(dev); + rtl8125_schedule_linkchg_work(tp); #ifdef ENABLE_DASH_SUPPORT if (tp->DASH) { @@ -14521,7 +14764,7 @@ static irqreturn_t rtl8125_interrupt_msix(int irq, void *dev_instance) //link change if (message_id == 21) { - rtl8125_check_link_status(dev); + rtl8125_schedule_linkchg_work(tp); break; } @@ -14540,9 +14783,7 @@ static irqreturn_t rtl8125_interrupt_msix(int irq, void *dev_instance) #endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) } - //spin_lock_irqsave(&tp->lock, flags); rtl8125_tx_interrupt_with_vector(tp, message_id, ~(u32)0); - //spin_unlock_irqrestore(&tp->lock, flags); rtl8125_enable_hw_interrupt_v2(tp, message_id); #endif @@ -14555,18 +14796,15 @@ static irqreturn_t rtl8125_interrupt_msix(int irq, void *dev_instance) static void rtl8125_down(struct net_device *dev) { struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; - rtl8125_delete_esd_timer(dev, &tp->esd_timer); + //rtl8125_delete_esd_timer(dev, &tp->esd_timer); //rtl8125_delete_link_timer(dev, &tp->link_timer); - rtl8125_stop_all_tx_queue(dev); + netif_tx_disable(dev); _rtl8125_wait_for_quiescence(dev); - spin_lock_irqsave(&tp->lock, flags); - netif_carrier_off(dev); rtl8125_hw_reset(dev); @@ -14574,8 +14812,6 @@ static void rtl8125_down(struct net_device *dev) rtl8125_tx_clear(tp); rtl8125_rx_clear(tp); - - spin_unlock_irqrestore(&tp->lock, flags); } static int rtl8125_resource_freed(struct rtl8125_private *tp) @@ -14594,16 +14830,14 @@ static int rtl8125_resource_freed(struct rtl8125_private *tp) int rtl8125_close(struct net_device *dev) { struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; if (!rtl8125_resource_freed(tp)) { - rtl8125_cancel_schedule_work(dev); + set_bit(R8125_FLAG_DOWN, tp->task_flags); rtl8125_down(dev); pci_clear_master(tp->pci_dev); - spin_lock_irqsave(&tp->lock, flags); #ifdef ENABLE_PTP_SUPPORT rtl8125_ptp_stop(tp); #endif @@ -14611,19 +14845,13 @@ int rtl8125_close(struct net_device *dev) rtl8125_powerdown_pll(dev, 0); - spin_unlock_irqrestore(&tp->lock, flags); - rtl8125_free_irq(tp); rtl8125_free_alloc_resources(tp); } else { - spin_lock_irqsave(&tp->lock, flags); - rtl8125_hw_d3_para(dev); rtl8125_powerdown_pll(dev, 0); - - spin_unlock_irqrestore(&tp->lock, flags); } return 0; @@ -14635,6 +14863,8 @@ static void rtl8125_shutdown(struct pci_dev *pdev) struct net_device *dev = pci_get_drvdata(pdev); struct rtl8125_private *tp = netdev_priv(dev); + rtnl_lock(); + if (tp->DASH) rtl8125_driver_stop(tp); @@ -14648,6 +14878,8 @@ static void rtl8125_shutdown(struct pci_dev *pdev) rtl8125_close(dev); rtl8125_disable_msi(pdev, tp); + rtnl_unlock(); + if (system_state == SYSTEM_POWER_OFF) { pci_clear_master(tp->pci_dev); pci_wake_from_d3(pdev, tp->wol_enabled); @@ -14668,11 +14900,6 @@ net_device_stats *rtl8125_get_stats(struct net_device *dev) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) struct rtl8125_private *tp = netdev_priv(dev); #endif - if (netif_running(dev)) { -// spin_lock_irqsave(&tp->lock, flags); -// spin_unlock_irqrestore(&tp->lock, flags); - } - return &RTLDEV->stats; } @@ -14699,25 +14926,25 @@ rtl8125_suspend(struct pci_dev *pdev, pm_message_t state) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) u32 pci_pm_state = pci_choose_state(pdev, state); #endif - unsigned long flags; - if (!netif_running(dev)) goto out; - rtl8125_cancel_schedule_work(dev); + //rtl8125_cancel_all_schedule_work(tp); - rtl8125_delete_esd_timer(dev, &tp->esd_timer); + //rtl8125_delete_esd_timer(dev, &tp->esd_timer); //rtl8125_delete_link_timer(dev, &tp->link_timer); - rtl8125_stop_all_tx_queue(dev); + rtnl_lock(); + + set_bit(R8125_FLAG_DOWN, tp->task_flags); + + netif_tx_disable(dev); netif_carrier_off(dev); netif_device_detach(dev); - spin_lock_irqsave(&tp->lock, flags); - #ifdef ENABLE_PTP_SUPPORT rtl8125_ptp_suspend(tp); #endif @@ -14729,10 +14956,10 @@ rtl8125_suspend(struct pci_dev *pdev, pm_message_t state) rtl8125_powerdown_pll(dev, 1); - spin_unlock_irqrestore(&tp->lock, flags); - if (tp->DASH) rtl8125_driver_stop(tp); + + rtnl_unlock(); out: pci_disable_device(pdev); @@ -14757,6 +14984,21 @@ rtl8125_hw_d3_not_power_off(struct net_device *dev) return rtl8125_check_hw_phy_mcu_code_ver(dev); } +static int rtl8125_wait_phy_nway_complete_sleep(struct rtl8125_private *tp) +{ + int i, val; + + for (i = 0; i < 30; i++) { + val = rtl8125_mdio_read(tp, MII_BMSR) & BMSR_ANEGCOMPLETE; + if (val) + return 0; + + msleep(100); + } + + return -1; +} + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) static int rtl8125_resume(struct pci_dev *pdev) @@ -14772,16 +15014,17 @@ rtl8125_resume(struct device *device) struct net_device *dev = pci_get_drvdata(pdev); #endif struct rtl8125_private *tp = netdev_priv(dev); - unsigned long flags; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) u32 pci_pm_state = PCI_D0; #endif u32 err; + rtnl_lock(); + err = pci_enable_device(pdev); if (err) { dev_err(&pdev->dev, "Cannot enable PCI device from suspend\n"); - return err; + goto out_unlock; } #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) pci_restore_state(pdev, &pci_pm_state); @@ -14790,48 +15033,39 @@ rtl8125_resume(struct device *device) #endif pci_enable_wake(pdev, PCI_D0, 0); - spin_lock_irqsave(&tp->lock, flags); - /* restore last modified mac address */ rtl8125_rar_set(tp, dev->dev_addr); + tp->resume_not_chg_speed = 0; if (tp->check_keep_link_speed && //tp->link_ok(dev) && - rtl8125_hw_d3_not_power_off(dev)) + rtl8125_hw_d3_not_power_off(dev) && + rtl8125_wait_phy_nway_complete_sleep(tp) == 0) tp->resume_not_chg_speed = 1; - else - tp->resume_not_chg_speed = 0; - - spin_unlock_irqrestore(&tp->lock, flags); if (!netif_running(dev)) - goto out; + goto out_unlock; pci_set_master(pdev); - spin_lock_irqsave(&tp->lock, flags); - rtl8125_exit_oob(dev); rtl8125_up(dev); - spin_unlock_irqrestore(&tp->lock, flags); + clear_bit(R8125_FLAG_DOWN, tp->task_flags); + rtl8125_schedule_reset_work(tp); + + rtl8125_schedule_esd_work(tp); + + //mod_timer(&tp->esd_timer, jiffies + RTL8125_ESD_TIMEOUT); + //mod_timer(&tp->link_timer, jiffies + RTL8125_LINK_TIMEOUT); +out_unlock: netif_device_attach(dev); - if (tp->resume_not_chg_speed) { - spin_lock_irqsave(&tp->lock, flags); + rtnl_unlock(); - _rtl8125_check_link_status(dev); - - spin_unlock_irqrestore(&tp->lock, flags); - } else - rtl8125_schedule_work(dev, rtl8125_reset_task); - - mod_timer(&tp->esd_timer, jiffies + RTL8125_ESD_TIMEOUT); - //mod_timer(&tp->link_timer, jiffies + RTL8125_LINK_TIMEOUT); -out: - return 0; + return err; } #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29) diff --git a/package/kernel/r8125/src/r8125_rss.c b/package/kernel/r8125/src/r8125_rss.c index a77917a938..78e53f5148 100644 --- a/package/kernel/r8125/src/r8125_rss.c +++ b/package/kernel/r8125/src/r8125_rss.c @@ -336,9 +336,6 @@ int rtl8125_get_rxfh(struct net_device *dev, u32 *indir, u8 *key, return 0; } -#define RSS_KEY_8125 0x4600 -#define RSS_INDIRECTION_TBL_8125_V2 0x4700 - static u32 rtl8125_rss_key_reg(struct rtl8125_private *tp) { return RSS_KEY_8125; diff --git a/package/kernel/r8125/src/r8125_rss.h b/package/kernel/r8125/src/r8125_rss.h index d77752816b..90e2809027 100644 --- a/package/kernel/r8125/src/r8125_rss.h +++ b/package/kernel/r8125/src/r8125_rss.h @@ -38,6 +38,9 @@ #include #include +#define RTL8125_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */ +#define RTL8125_MAX_INDIRECTION_TABLE_ENTRIES 128 + enum rtl8125_rss_flag { RTL_8125_RSS_FLAG_HASH_UDP_IPV4 = (1 << 0), RTL_8125_RSS_FLAG_HASH_UDP_IPV6 = (1 << 1), diff --git a/package/kernel/r8125/src/rtltool.c b/package/kernel/r8125/src/rtltool.c index a9c46ea74f..ace717bde3 100644 --- a/package/kernel/r8125/src/rtltool.c +++ b/package/kernel/r8125/src/rtltool.c @@ -47,7 +47,6 @@ int rtl8125_tool_ioctl(struct rtl8125_private *tp, struct ifreq *ifr) { struct rtltool_cmd my_cmd; - unsigned long flags; int ret; if (copy_from_user(&my_cmd, ifr->ifr_data, sizeof(my_cmd))) @@ -97,10 +96,7 @@ int rtl8125_tool_ioctl(struct rtl8125_private *tp, struct ifreq *ifr) if (!capable(CAP_NET_ADMIN)) return -EPERM; - spin_lock_irqsave(&tp->lock, flags); my_cmd.data = rtl8125_mdio_prot_read(tp, my_cmd.offset); - spin_unlock_irqrestore(&tp->lock, flags); - if (copy_to_user(ifr->ifr_data, &my_cmd, sizeof(my_cmd))) { ret = -EFAULT; break; @@ -112,19 +108,14 @@ int rtl8125_tool_ioctl(struct rtl8125_private *tp, struct ifreq *ifr) if (!capable(CAP_NET_ADMIN)) return -EPERM; - spin_lock_irqsave(&tp->lock, flags); rtl8125_mdio_prot_write(tp, my_cmd.offset, my_cmd.data); - spin_unlock_irqrestore(&tp->lock, flags); break; case RTLTOOL_READ_EPHY: if (!capable(CAP_NET_ADMIN)) return -EPERM; - spin_lock_irqsave(&tp->lock, flags); my_cmd.data = rtl8125_ephy_read(tp, my_cmd.offset); - spin_unlock_irqrestore(&tp->lock, flags); - if (copy_to_user(ifr->ifr_data, &my_cmd, sizeof(my_cmd))) { ret = -EFAULT; break; @@ -136,17 +127,13 @@ int rtl8125_tool_ioctl(struct rtl8125_private *tp, struct ifreq *ifr) if (!capable(CAP_NET_ADMIN)) return -EPERM; - spin_lock_irqsave(&tp->lock, flags); rtl8125_ephy_write(tp, my_cmd.offset, my_cmd.data); - spin_unlock_irqrestore(&tp->lock, flags); break; case RTLTOOL_READ_ERI: my_cmd.data = 0; if (my_cmd.len==1 || my_cmd.len==2 || my_cmd.len==4) { - spin_lock_irqsave(&tp->lock, flags); my_cmd.data = rtl8125_eri_read(tp, my_cmd.offset, my_cmd.len, ERIAR_ExGMAC); - spin_unlock_irqrestore(&tp->lock, flags); } else { ret = -EOPNOTSUPP; break; @@ -167,9 +154,7 @@ int rtl8125_tool_ioctl(struct rtl8125_private *tp, struct ifreq *ifr) return -EPERM; if (my_cmd.len==1 || my_cmd.len==2 || my_cmd.len==4) { - spin_lock_irqsave(&tp->lock, flags); rtl8125_eri_write(tp, my_cmd.offset, my_cmd.len, my_cmd.data, ERIAR_ExGMAC); - spin_unlock_irqrestore(&tp->lock, flags); } else { ret = -EOPNOTSUPP; break; @@ -225,10 +210,7 @@ int rtl8125_tool_ioctl(struct rtl8125_private *tp, struct ifreq *ifr) if (!capable(CAP_NET_ADMIN)) return -EPERM; - spin_lock_irqsave(&tp->lock, flags); my_cmd.data = rtl8125_eeprom_read_sc(tp, my_cmd.offset); - spin_unlock_irqrestore(&tp->lock, flags); - if (copy_to_user(ifr->ifr_data, &my_cmd, sizeof(my_cmd))) { ret = -EFAULT; break; @@ -240,21 +222,16 @@ int rtl8125_tool_ioctl(struct rtl8125_private *tp, struct ifreq *ifr) if (!capable(CAP_NET_ADMIN)) return -EPERM; - spin_lock_irqsave(&tp->lock, flags); rtl8125_eeprom_write_sc(tp, my_cmd.offset, my_cmd.data); - spin_unlock_irqrestore(&tp->lock, flags); break; case RTL_READ_OOB_MAC: if (!capable(CAP_NET_ADMIN)) return -EPERM; - spin_lock_irqsave(&tp->lock, flags); rtl8125_oob_mutex_lock(tp); my_cmd.data = rtl8125_ocp_read(tp, my_cmd.offset, 4); rtl8125_oob_mutex_unlock(tp); - spin_unlock_irqrestore(&tp->lock, flags); - if (copy_to_user(ifr->ifr_data, &my_cmd, sizeof(my_cmd))) { ret = -EFAULT; break; @@ -268,20 +245,16 @@ int rtl8125_tool_ioctl(struct rtl8125_private *tp, struct ifreq *ifr) if (my_cmd.len == 0 || my_cmd.len > 4) return -EOPNOTSUPP; - spin_lock_irqsave(&tp->lock, flags); rtl8125_oob_mutex_lock(tp); rtl8125_ocp_write(tp, my_cmd.offset, my_cmd.len, my_cmd.data); rtl8125_oob_mutex_unlock(tp); - spin_unlock_irqrestore(&tp->lock, flags); break; case RTL_ENABLE_PCI_DIAG: if (!capable(CAP_NET_ADMIN)) return -EPERM; - spin_lock_irqsave(&tp->lock, flags); tp->rtk_enable_diag = 1; - spin_unlock_irqrestore(&tp->lock, flags); dprintk("enable rtk diag\n"); break; @@ -290,9 +263,7 @@ int rtl8125_tool_ioctl(struct rtl8125_private *tp, struct ifreq *ifr) if (!capable(CAP_NET_ADMIN)) return -EPERM; - spin_lock_irqsave(&tp->lock, flags); tp->rtk_enable_diag = 0; - spin_unlock_irqrestore(&tp->lock, flags); dprintk("disable rtk diag\n"); break; @@ -304,10 +275,7 @@ int rtl8125_tool_ioctl(struct rtl8125_private *tp, struct ifreq *ifr) if (my_cmd.offset % 2) return -EOPNOTSUPP; - spin_lock_irqsave(&tp->lock, flags); my_cmd.data = rtl8125_mac_ocp_read(tp, my_cmd.offset); - spin_unlock_irqrestore(&tp->lock, flags); - if (copy_to_user(ifr->ifr_data, &my_cmd, sizeof(my_cmd))) { ret = -EFAULT; break; @@ -321,19 +289,14 @@ int rtl8125_tool_ioctl(struct rtl8125_private *tp, struct ifreq *ifr) if ((my_cmd.offset % 2) || (my_cmd.len != 2)) return -EOPNOTSUPP; - spin_lock_irqsave(&tp->lock, flags); rtl8125_mac_ocp_write(tp, my_cmd.offset, (u16)my_cmd.data); - spin_unlock_irqrestore(&tp->lock, flags); break; case RTL_DIRECT_READ_PHY_OCP: if (!capable(CAP_NET_ADMIN)) return -EPERM; - spin_lock_irqsave(&tp->lock, flags); my_cmd.data = rtl8125_mdio_prot_direct_read_phy_ocp(tp, my_cmd.offset); - spin_unlock_irqrestore(&tp->lock, flags); - if (copy_to_user(ifr->ifr_data, &my_cmd, sizeof(my_cmd))) { ret = -EFAULT; break; @@ -345,9 +308,7 @@ int rtl8125_tool_ioctl(struct rtl8125_private *tp, struct ifreq *ifr) if (!capable(CAP_NET_ADMIN)) return -EPERM; - spin_lock_irqsave(&tp->lock, flags); rtl8125_mdio_prot_direct_write_phy_ocp(tp, my_cmd.offset, my_cmd.data); - spin_unlock_irqrestore(&tp->lock, flags); break; default: From 929ec35350878a2182e8cedb05236cc735eda2da Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Thu, 7 Oct 2021 11:18:11 +0800 Subject: [PATCH 29/33] r8125: Update to 9.006.04 version Signed-off-by: Tianling Shen (cherry picked from commit 52229a5153148cf7a0a8f0fe325fa52ed4481764) --- package/kernel/r8125/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/kernel/r8125/Makefile b/package/kernel/r8125/Makefile index ef0499824a..be28bc5b2c 100644 --- a/package/kernel/r8125/Makefile +++ b/package/kernel/r8125/Makefile @@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=r8125 -PKG_VERSION:=9.005.06 -PKG_RELEASE:=1 +PKG_VERSION:=9.006.04 +PKG_RELEASE:=$(AUTORELEASE) PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) From 10a0ee06ee68088909be50bfd4b97b0dcdcadd23 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Thu, 7 Oct 2021 14:56:30 +0800 Subject: [PATCH 30/33] kernel: bump to 4.9.285, 4.14.249, 4.19.209 Manually rebased: - generic/pending-4.19/800-bcma-get-SoC-device-struct-copy-its-DMA-params-to-th.patch Refreshed all patches. Signed-off-by: Tianling Shen --- include/kernel-version.mk | 12 ++++++------ .../patches-4.19/910-unaligned_access_hacks.patch | 2 +- .../950-0043-MMC-added-alternative-MMC-driver.patch | 6 +++--- .../950-0058-fbdev-add-FBIOCOPYAREA-ioctl.patch | 8 ++++---- ...0028-usb-host-fotg2-add-device-tree-probing.patch | 4 ++-- ...9-usb-host-fotg2-add-silicon-clock-handling.patch | 6 +++--- ...usb-host-fotg2-add-Gemini-specific-handling.patch | 4 ++-- ...3-usb-host-fotg2-add-silicon-clock-handling.patch | 6 +++--- ...0015-usb-host-fotg2-add-device-tree-probing.patch | 2 +- ...usb-host-fotg2-add-Gemini-specific-handling.patch | 4 ++-- .../025-tcp-allow-drivers-to-tweak-TSQ-logic.patch | 2 +- ...erial-option-fix-dwm-158-3g-modem-interface.patch | 2 +- ...-keep-a-direct-pointer-to-the-struct-device.patch | 4 ++-- ..._dissector-Parse-batman-adv-unicast-headers.patch | 2 +- ...-keep-a-direct-pointer-to-the-struct-device.patch | 4 ++-- ...-Permit-use-of-connmarks-as-tin-classifiers.patch | 2 +- ...d-macro-for-controlling-warnings-to-linux-c.patch | 2 +- .../generic/backport-4.9/070-bcma-from-4.11.patch | 2 +- .../generic/backport-4.9/072-bcma-from-4.12.patch | 2 +- target/linux/generic/hack-4.14/220-gc_sections.patch | 2 +- .../generic/hack-4.14/901-debloat_sock_diag.patch | 2 +- .../linux/generic/hack-4.14/902-debloat_proc.patch | 2 +- target/linux/generic/hack-4.19/220-gc_sections.patch | 2 +- .../generic/hack-4.19/660-fq_codel_defaults.patch | 2 +- .../hack-4.19/661-use_fq_codel_by_default.patch | 4 ++-- .../generic/hack-4.19/901-debloat_sock_diag.patch | 2 +- .../linux/generic/hack-4.19/902-debloat_proc.patch | 2 +- target/linux/generic/hack-4.9/220-gc_sections.patch | 2 +- .../pending-4.14/810-pci_disable_common_quirks.patch | 6 +++--- .../generic/pending-4.14/834-ledtrig-libata.patch | 8 ++++---- ...SoC-device-struct-copy-its-DMA-params-to-th.patch | 3 ++- .../pending-4.19/810-pci_disable_common_quirks.patch | 6 +++--- .../generic/pending-4.19/834-ledtrig-libata.patch | 8 ++++---- .../pending-4.9/810-pci_disable_common_quirks.patch | 6 +++--- .../generic/pending-4.9/834-ledtrig-libata.patch | 8 ++++---- .../patches-4.14/998-ignore-stats-debug-info.patch | 6 +++--- .../ixp4xx/patches-4.9/160-delayed_uart_io.patch | 10 +++++----- .../patches-4.14/807-usb-support-layerscape.patch | 2 +- .../patches-4.14/808-vfio-support-layerscape.patch | 2 +- .../patches-4.14/816-pcie-support-layerscape.patch | 6 +++--- .../patches-4.14/820-sec-support-layerscape.patch | 2 +- .../0012-clk-dont-disable-unused-clocks.patch | 2 +- .../patches-4.19/0900-bt-mtk-serial-fix.patch | 4 ++-- ...ost-and-device-to-the-same-MAX-payload-size.patch | 6 +++--- ...I-aardvark-allow-to-specify-link-capability.patch | 4 ++-- ...-PCI-aardvark-Convert-to-use-pci_host_probe.patch | 4 ++-- ...ost-and-device-to-the-same-MAX-payload-size.patch | 6 +++--- ...I-aardvark-allow-to-specify-link-capability.patch | 4 ++-- .../110-crypto-mxsdcp-provide-importexport.patch | 6 +++--- .../linux/oxnas/patches-4.14/999-libata-hacks.patch | 4 ++-- .../x86/patches-4.14/200-pcengines-apu2-reboot.patch | 2 +- .../x86/patches-4.19/200-pcengines-apu2-reboot.patch | 2 +- .../x86/patches-4.9/200-pcengines-apu2-reboot.patch | 2 +- 53 files changed, 108 insertions(+), 107 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index dd48b5eab0..77999a21f4 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,13 +6,13 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-4.9 = .282 -LINUX_VERSION-4.14 = .246 -LINUX_VERSION-4.19 = .206 +LINUX_VERSION-4.9 = .285 +LINUX_VERSION-4.14 = .249 +LINUX_VERSION-4.19 = .209 -LINUX_KERNEL_HASH-4.9.282 = 67727389771a858406f773b4db62d7d3248209e26120df47507ea4a8898d2e15 -LINUX_KERNEL_HASH-4.14.246 = 9c5612ef428441b7c85cf211a455c06ce695b81a9a40c064d0ea424dd08bef3a -LINUX_KERNEL_HASH-4.19.206 = b7eb776f408b3ea71c97dde4888cc4549edf925a18cd158e7c9681d6ffa684c0 +LINUX_KERNEL_HASH-4.9.285 = 4b2a22d43d066984352c0a19d4b8bd481ae732100b7c8639cc16970c2b9973c2 +LINUX_KERNEL_HASH-4.14.249 = 320f96eb2bea421ebcc894319fea54a77bbff26d50c86d27528347ea12f7c472 +LINUX_KERNEL_HASH-4.19.209 = 7327d5b92e60b0134488c9bec463ef3d252ea49ac718117b37e80a8e5f87e913 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/ath79/patches-4.19/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-4.19/910-unaligned_access_hacks.patch index 46d781eda6..57e8a5f209 100644 --- a/target/linux/ath79/patches-4.19/910-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-4.19/910-unaligned_access_hacks.patch @@ -728,7 +728,7 @@ EXPORT_SYMBOL(xfrm_parse_spi); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -3910,14 +3910,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -3914,14 +3914,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/bcm27xx/patches-4.19/950-0043-MMC-added-alternative-MMC-driver.patch b/target/linux/bcm27xx/patches-4.19/950-0043-MMC-added-alternative-MMC-driver.patch index 061930af1c..7dada6cd58 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0043-MMC-added-alternative-MMC-driver.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0043-MMC-added-alternative-MMC-driver.patch @@ -125,7 +125,7 @@ Signed-off-by: Phil Elwell static inline int mmc_blk_part_switch(struct mmc_card *card, unsigned int part_type); -@@ -2901,6 +2908,7 @@ static int mmc_blk_probe(struct mmc_card +@@ -2900,6 +2907,7 @@ static int mmc_blk_probe(struct mmc_card { struct mmc_blk_data *md, *part_md; char cap_str[10]; @@ -133,7 +133,7 @@ Signed-off-by: Phil Elwell /* * Check that the card supports the command class(es) we need. -@@ -2908,7 +2916,16 @@ static int mmc_blk_probe(struct mmc_card +@@ -2907,7 +2915,16 @@ static int mmc_blk_probe(struct mmc_card if (!(card->csd.cmdclass & CCC_BLOCK_READ)) return -ENODEV; @@ -151,7 +151,7 @@ Signed-off-by: Phil Elwell card->complete_wq = alloc_workqueue("mmc_complete", WQ_MEM_RECLAIM | WQ_HIGHPRI, 0); -@@ -2923,9 +2940,14 @@ static int mmc_blk_probe(struct mmc_card +@@ -2922,9 +2939,14 @@ static int mmc_blk_probe(struct mmc_card string_get_size((u64)get_capacity(md->disk), 512, STRING_UNITS_2, cap_str, sizeof(cap_str)); diff --git a/target/linux/bcm27xx/patches-4.19/950-0058-fbdev-add-FBIOCOPYAREA-ioctl.patch b/target/linux/bcm27xx/patches-4.19/950-0058-fbdev-add-FBIOCOPYAREA-ioctl.patch index b7043cc214..d816d12f36 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0058-fbdev-add-FBIOCOPYAREA-ioctl.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0058-fbdev-add-FBIOCOPYAREA-ioctl.patch @@ -171,7 +171,7 @@ bcm2708_fb: Add ioctl for reading gpu memory through dma return -ENOTTY; --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c -@@ -1085,6 +1085,31 @@ fb_blank(struct fb_info *info, int blank +@@ -1091,6 +1091,31 @@ fb_blank(struct fb_info *info, int blank } EXPORT_SYMBOL(fb_blank); @@ -203,7 +203,7 @@ bcm2708_fb: Add ioctl for reading gpu memory through dma static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) { -@@ -1095,6 +1120,7 @@ static long do_fb_ioctl(struct fb_info * +@@ -1101,6 +1126,7 @@ static long do_fb_ioctl(struct fb_info * struct fb_cmap cmap_from; struct fb_cmap_user cmap; struct fb_event event; @@ -211,7 +211,7 @@ bcm2708_fb: Add ioctl for reading gpu memory through dma void __user *argp = (void __user *)arg; long ret = 0; -@@ -1212,6 +1238,15 @@ static long do_fb_ioctl(struct fb_info * +@@ -1218,6 +1244,15 @@ static long do_fb_ioctl(struct fb_info * unlock_fb_info(info); console_unlock(); break; @@ -227,7 +227,7 @@ bcm2708_fb: Add ioctl for reading gpu memory through dma default: if (!lock_fb_info(info)) return -ENODEV; -@@ -1357,6 +1392,7 @@ static long fb_compat_ioctl(struct file +@@ -1363,6 +1398,7 @@ static long fb_compat_ioctl(struct file case FBIOPAN_DISPLAY: case FBIOGET_CON2FBMAP: case FBIOPUT_CON2FBMAP: diff --git a/target/linux/gemini/patches-4.14/0028-usb-host-fotg2-add-device-tree-probing.patch b/target/linux/gemini/patches-4.14/0028-usb-host-fotg2-add-device-tree-probing.patch index 01a704830f..98a6488a24 100644 --- a/target/linux/gemini/patches-4.14/0028-usb-host-fotg2-add-device-tree-probing.patch +++ b/target/linux/gemini/patches-4.14/0028-usb-host-fotg2-add-device-tree-probing.patch @@ -24,7 +24,7 @@ ChangeLog v2->v3: #include #include #include -@@ -5604,6 +5605,15 @@ static int fotg210_hcd_probe(struct plat +@@ -5601,6 +5602,15 @@ static int fotg210_hcd_probe(struct plat if (usb_disabled()) return -ENODEV; @@ -40,7 +40,7 @@ ChangeLog v2->v3: pdev->dev.power.power_state = PMSG_ON; res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); -@@ -5680,9 +5690,18 @@ static int fotg210_hcd_remove(struct pla +@@ -5677,9 +5687,18 @@ static int fotg210_hcd_remove(struct pla return 0; } diff --git a/target/linux/gemini/patches-4.14/0029-usb-host-fotg2-add-silicon-clock-handling.patch b/target/linux/gemini/patches-4.14/0029-usb-host-fotg2-add-silicon-clock-handling.patch index 5ecd9297e5..6a45ace14b 100644 --- a/target/linux/gemini/patches-4.14/0029-usb-host-fotg2-add-silicon-clock-handling.patch +++ b/target/linux/gemini/patches-4.14/0029-usb-host-fotg2-add-silicon-clock-handling.patch @@ -26,7 +26,7 @@ Signed-off-by: Linus Walleij #include #include -@@ -5639,7 +5640,7 @@ static int fotg210_hcd_probe(struct plat +@@ -5636,7 +5637,7 @@ static int fotg210_hcd_probe(struct plat hcd->regs = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(hcd->regs)) { retval = PTR_ERR(hcd->regs); @@ -35,7 +35,7 @@ Signed-off-by: Linus Walleij } hcd->rsrc_start = res->start; -@@ -5649,22 +5650,35 @@ static int fotg210_hcd_probe(struct plat +@@ -5646,22 +5647,35 @@ static int fotg210_hcd_probe(struct plat fotg210->caps = hcd->regs; @@ -74,7 +74,7 @@ Signed-off-by: Linus Walleij usb_put_hcd(hcd); fail_create_hcd: dev_err(dev, "init %s fail, %d\n", dev_name(dev), retval); -@@ -5680,6 +5694,10 @@ static int fotg210_hcd_remove(struct pla +@@ -5677,6 +5691,10 @@ static int fotg210_hcd_remove(struct pla { struct device *dev = &pdev->dev; struct usb_hcd *hcd = dev_get_drvdata(dev); diff --git a/target/linux/gemini/patches-4.14/0030-usb-host-fotg2-add-Gemini-specific-handling.patch b/target/linux/gemini/patches-4.14/0030-usb-host-fotg2-add-Gemini-specific-handling.patch index 0125e816d6..4b01536722 100644 --- a/target/linux/gemini/patches-4.14/0030-usb-host-fotg2-add-Gemini-specific-handling.patch +++ b/target/linux/gemini/patches-4.14/0030-usb-host-fotg2-add-Gemini-specific-handling.patch @@ -43,7 +43,7 @@ Signed-off-by: Linus Walleij #include #include -@@ -5587,6 +5591,72 @@ static void fotg210_init(struct fotg210_ +@@ -5584,6 +5588,72 @@ static void fotg210_init(struct fotg210_ iowrite32(value, &fotg210->regs->otgcsr); } @@ -116,7 +116,7 @@ Signed-off-by: Linus Walleij /** * fotg210_hcd_probe - initialize faraday FOTG210 HCDs * -@@ -5666,6 +5736,12 @@ static int fotg210_hcd_probe(struct plat +@@ -5663,6 +5733,12 @@ static int fotg210_hcd_probe(struct plat fotg210_init(fotg210); diff --git a/target/linux/gemini/patches-4.19/0013-usb-host-fotg2-add-silicon-clock-handling.patch b/target/linux/gemini/patches-4.19/0013-usb-host-fotg2-add-silicon-clock-handling.patch index 207a58d857..ae4ad2e2e9 100644 --- a/target/linux/gemini/patches-4.19/0013-usb-host-fotg2-add-silicon-clock-handling.patch +++ b/target/linux/gemini/patches-4.19/0013-usb-host-fotg2-add-silicon-clock-handling.patch @@ -36,7 +36,7 @@ ChangeLog v1->v2: #include #include -@@ -5600,7 +5601,7 @@ static int fotg210_hcd_probe(struct plat +@@ -5597,7 +5598,7 @@ static int fotg210_hcd_probe(struct plat hcd->regs = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(hcd->regs)) { retval = PTR_ERR(hcd->regs); @@ -45,7 +45,7 @@ ChangeLog v1->v2: } hcd->rsrc_start = res->start; -@@ -5610,22 +5611,42 @@ static int fotg210_hcd_probe(struct plat +@@ -5607,22 +5608,42 @@ static int fotg210_hcd_probe(struct plat fotg210->caps = hcd->regs; @@ -91,7 +91,7 @@ ChangeLog v1->v2: usb_put_hcd(hcd); fail_create_hcd: dev_err(dev, "init %s fail, %d\n", dev_name(dev), retval); -@@ -5641,6 +5662,10 @@ static int fotg210_hcd_remove(struct pla +@@ -5638,6 +5659,10 @@ static int fotg210_hcd_remove(struct pla { struct device *dev = &pdev->dev; struct usb_hcd *hcd = dev_get_drvdata(dev); diff --git a/target/linux/gemini/patches-4.19/0015-usb-host-fotg2-add-device-tree-probing.patch b/target/linux/gemini/patches-4.19/0015-usb-host-fotg2-add-device-tree-probing.patch index 7a4a3fe77e..825bb0152d 100644 --- a/target/linux/gemini/patches-4.19/0015-usb-host-fotg2-add-device-tree-probing.patch +++ b/target/linux/gemini/patches-4.19/0015-usb-host-fotg2-add-device-tree-probing.patch @@ -22,7 +22,7 @@ Signed-off-by: Linus Walleij #include #include #include -@@ -5676,9 +5677,18 @@ static int fotg210_hcd_remove(struct pla +@@ -5673,9 +5674,18 @@ static int fotg210_hcd_remove(struct pla return 0; } diff --git a/target/linux/gemini/patches-4.19/0016-usb-host-fotg2-add-Gemini-specific-handling.patch b/target/linux/gemini/patches-4.19/0016-usb-host-fotg2-add-Gemini-specific-handling.patch index f30ee7991e..6c7099900b 100644 --- a/target/linux/gemini/patches-4.19/0016-usb-host-fotg2-add-Gemini-specific-handling.patch +++ b/target/linux/gemini/patches-4.19/0016-usb-host-fotg2-add-Gemini-specific-handling.patch @@ -43,7 +43,7 @@ Signed-off-by: Linus Walleij #include #include -@@ -5558,6 +5562,72 @@ static void fotg210_init(struct fotg210_ +@@ -5555,6 +5559,72 @@ static void fotg210_init(struct fotg210_ iowrite32(value, &fotg210->regs->otgcsr); } @@ -116,7 +116,7 @@ Signed-off-by: Linus Walleij /** * fotg210_hcd_probe - initialize faraday FOTG210 HCDs * -@@ -5635,6 +5705,12 @@ static int fotg210_hcd_probe(struct plat +@@ -5632,6 +5702,12 @@ static int fotg210_hcd_probe(struct plat fotg210_init(fotg210); diff --git a/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch b/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch index 6f018b9e4a..1bb30ab6ca 100644 --- a/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch +++ b/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch @@ -55,7 +55,7 @@ Cc: Kir Kolyshkin rwlock_t sk_callback_lock; --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -2771,6 +2771,7 @@ void sock_init_data(struct socket *sock, +@@ -2791,6 +2791,7 @@ void sock_init_data(struct socket *sock, sk->sk_max_pacing_rate = ~0U; sk->sk_pacing_rate = ~0U; diff --git a/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch b/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch index 7fc129bb9a..92590f3914 100644 --- a/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch +++ b/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch @@ -30,7 +30,7 @@ Signed-off-by: Johan Hovold --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c -@@ -2033,7 +2033,8 @@ static const struct usb_device_id option +@@ -2040,7 +2040,8 @@ static const struct usb_device_id option { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d01, 0xff) }, /* D-Link DWM-156 (variant) */ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d02, 0xff) }, { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d03, 0xff) }, diff --git a/target/linux/generic/backport-4.14/080-v5.1-0001-bcma-keep-a-direct-pointer-to-the-struct-device.patch b/target/linux/generic/backport-4.14/080-v5.1-0001-bcma-keep-a-direct-pointer-to-the-struct-device.patch index cc32aee17b..377b525061 100644 --- a/target/linux/generic/backport-4.14/080-v5.1-0001-bcma-keep-a-direct-pointer-to-the-struct-device.patch +++ b/target/linux/generic/backport-4.14/080-v5.1-0001-bcma-keep-a-direct-pointer-to-the-struct-device.patch @@ -95,7 +95,7 @@ Signed-off-by: Kalle Valo return 0; case BCMA_HOSTTYPE_SDIO: return 0; -@@ -239,18 +239,18 @@ void bcma_prepare_core(struct bcma_bus * +@@ -240,18 +240,18 @@ void bcma_prepare_core(struct bcma_bus * core->dev.release = bcma_release_core_dev; core->dev.bus = &bcma_bus_type; dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index); @@ -120,7 +120,7 @@ Signed-off-by: Kalle Valo } else { core->dev.dma_mask = &core->dev.coherent_dma_mask; core->dma_dev = &core->dev; -@@ -261,28 +261,6 @@ void bcma_prepare_core(struct bcma_bus * +@@ -262,28 +262,6 @@ void bcma_prepare_core(struct bcma_bus * } } diff --git a/target/linux/generic/backport-4.14/274-flow_dissector-Parse-batman-adv-unicast-headers.patch b/target/linux/generic/backport-4.14/274-flow_dissector-Parse-batman-adv-unicast-headers.patch index a9b2fc40a3..693e64c8a8 100644 --- a/target/linux/generic/backport-4.14/274-flow_dissector-Parse-batman-adv-unicast-headers.patch +++ b/target/linux/generic/backport-4.14/274-flow_dissector-Parse-batman-adv-unicast-headers.patch @@ -94,7 +94,7 @@ Signed-off-by: David S. Miller static void __skb_flow_dissect_tcp(const struct sk_buff *skb, struct flow_dissector *flow_dissector, -@@ -718,6 +770,11 @@ proto_again: +@@ -722,6 +774,11 @@ proto_again: nhoff, hlen); break; diff --git a/target/linux/generic/backport-4.19/080-v5.1-0001-bcma-keep-a-direct-pointer-to-the-struct-device.patch b/target/linux/generic/backport-4.19/080-v5.1-0001-bcma-keep-a-direct-pointer-to-the-struct-device.patch index cc32aee17b..377b525061 100644 --- a/target/linux/generic/backport-4.19/080-v5.1-0001-bcma-keep-a-direct-pointer-to-the-struct-device.patch +++ b/target/linux/generic/backport-4.19/080-v5.1-0001-bcma-keep-a-direct-pointer-to-the-struct-device.patch @@ -95,7 +95,7 @@ Signed-off-by: Kalle Valo return 0; case BCMA_HOSTTYPE_SDIO: return 0; -@@ -239,18 +239,18 @@ void bcma_prepare_core(struct bcma_bus * +@@ -240,18 +240,18 @@ void bcma_prepare_core(struct bcma_bus * core->dev.release = bcma_release_core_dev; core->dev.bus = &bcma_bus_type; dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index); @@ -120,7 +120,7 @@ Signed-off-by: Kalle Valo } else { core->dev.dma_mask = &core->dev.coherent_dma_mask; core->dma_dev = &core->dev; -@@ -261,28 +261,6 @@ void bcma_prepare_core(struct bcma_bus * +@@ -262,28 +262,6 @@ void bcma_prepare_core(struct bcma_bus * } } diff --git a/target/linux/generic/backport-4.19/391-v5.1-sch_cake-Permit-use-of-connmarks-as-tin-classifiers.patch b/target/linux/generic/backport-4.19/391-v5.1-sch_cake-Permit-use-of-connmarks-as-tin-classifiers.patch index f7a668714e..9cb01355e7 100644 --- a/target/linux/generic/backport-4.19/391-v5.1-sch_cake-Permit-use-of-connmarks-as-tin-classifiers.patch +++ b/target/linux/generic/backport-4.19/391-v5.1-sch_cake-Permit-use-of-connmarks-as-tin-classifiers.patch @@ -71,7 +71,7 @@ Signed-off-by: David S. Miller --- a/include/uapi/linux/pkt_sched.h +++ b/include/uapi/linux/pkt_sched.h -@@ -991,6 +991,7 @@ enum { +@@ -993,6 +993,7 @@ enum { TCA_CAKE_INGRESS, TCA_CAKE_ACK_FILTER, TCA_CAKE_SPLIT_GSO, diff --git a/target/linux/generic/backport-4.9/012-kbuild-add-macro-for-controlling-warnings-to-linux-c.patch b/target/linux/generic/backport-4.9/012-kbuild-add-macro-for-controlling-warnings-to-linux-c.patch index b93dadf633..b95cea2929 100644 --- a/target/linux/generic/backport-4.9/012-kbuild-add-macro-for-controlling-warnings-to-linux-c.patch +++ b/target/linux/generic/backport-4.9/012-kbuild-add-macro-for-controlling-warnings-to-linux-c.patch @@ -117,7 +117,7 @@ Signed-off-by: Masahiro Yamada + --- a/include/linux/compiler.h +++ b/include/linux/compiler.h -@@ -612,4 +612,22 @@ unsigned long read_word_at_a_time(const +@@ -614,4 +614,22 @@ unsigned long read_word_at_a_time(const */ #define prevent_tail_call_optimization() mb() diff --git a/target/linux/generic/backport-4.9/070-bcma-from-4.11.patch b/target/linux/generic/backport-4.9/070-bcma-from-4.11.patch index a3b0321986..7a3d32f2dd 100644 --- a/target/linux/generic/backport-4.9/070-bcma-from-4.11.patch +++ b/target/linux/generic/backport-4.9/070-bcma-from-4.11.patch @@ -73,7 +73,7 @@ return 0; case BCMA_HOSTTYPE_SDIO: return 0; -@@ -253,7 +253,8 @@ void bcma_prepare_core(struct bcma_bus * +@@ -254,7 +254,8 @@ void bcma_prepare_core(struct bcma_bus * if (IS_ENABLED(CONFIG_OF) && bus->host_pdev) { core->dma_dev = &bus->host_pdev->dev; core->dev.parent = &bus->host_pdev->dev; diff --git a/target/linux/generic/backport-4.9/072-bcma-from-4.12.patch b/target/linux/generic/backport-4.9/072-bcma-from-4.12.patch index 23f2656ab5..4cf5460d28 100644 --- a/target/linux/generic/backport-4.9/072-bcma-from-4.12.patch +++ b/target/linux/generic/backport-4.9/072-bcma-from-4.12.patch @@ -22,7 +22,7 @@ node = bcma_of_find_child_device(parent, core); if (node) core->dev.of_node = node; -@@ -242,19 +239,18 @@ void bcma_prepare_core(struct bcma_bus * +@@ -243,19 +240,18 @@ void bcma_prepare_core(struct bcma_bus * core->dev.release = bcma_release_core_dev; core->dev.bus = &bcma_bus_type; dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index); diff --git a/target/linux/generic/hack-4.14/220-gc_sections.patch b/target/linux/generic/hack-4.14/220-gc_sections.patch index db6564ed7a..0095b79834 100644 --- a/target/linux/generic/hack-4.14/220-gc_sections.patch +++ b/target/linux/generic/hack-4.14/220-gc_sections.patch @@ -57,7 +57,7 @@ Signed-off-by: Gabor Juhos select OF_EARLY_FLATTREE if OF --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile -@@ -103,6 +103,7 @@ ifeq ($(CONFIG_FUNCTION_TRACER),y) +@@ -105,6 +105,7 @@ ifeq ($(CONFIG_FUNCTION_TRACER),y) ORIG_CFLAGS := $(KBUILD_CFLAGS) KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) endif diff --git a/target/linux/generic/hack-4.14/901-debloat_sock_diag.patch b/target/linux/generic/hack-4.14/901-debloat_sock_diag.patch index e6b098344c..978cf4cde1 100644 --- a/target/linux/generic/hack-4.14/901-debloat_sock_diag.patch +++ b/target/linux/generic/hack-4.14/901-debloat_sock_diag.patch @@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie) { struct dst_entry *dst = __sk_dst_get(sk); -@@ -1599,9 +1611,11 @@ void sk_destruct(struct sock *sk) +@@ -1617,9 +1629,11 @@ void sk_destruct(struct sock *sk) static void __sk_free(struct sock *sk) { diff --git a/target/linux/generic/hack-4.14/902-debloat_proc.patch b/target/linux/generic/hack-4.14/902-debloat_proc.patch index 8d02402498..4c1018867d 100644 --- a/target/linux/generic/hack-4.14/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.14/902-debloat_proc.patch @@ -327,7 +327,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -3410,6 +3410,8 @@ static __net_initdata struct pernet_oper +@@ -3430,6 +3430,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/target/linux/generic/hack-4.19/220-gc_sections.patch b/target/linux/generic/hack-4.19/220-gc_sections.patch index ef057ef5f7..f32d0b2134 100644 --- a/target/linux/generic/hack-4.19/220-gc_sections.patch +++ b/target/linux/generic/hack-4.19/220-gc_sections.patch @@ -57,7 +57,7 @@ Signed-off-by: Gabor Juhos select NO_BOOTMEM --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile -@@ -106,6 +106,7 @@ ifeq ($(CONFIG_FUNCTION_TRACER),y) +@@ -108,6 +108,7 @@ ifeq ($(CONFIG_FUNCTION_TRACER),y) ORIG_CFLAGS := $(KBUILD_CFLAGS) KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) endif diff --git a/target/linux/generic/hack-4.19/660-fq_codel_defaults.patch b/target/linux/generic/hack-4.19/660-fq_codel_defaults.patch index 42698c6451..b35a24c487 100644 --- a/target/linux/generic/hack-4.19/660-fq_codel_defaults.patch +++ b/target/linux/generic/hack-4.19/660-fq_codel_defaults.patch @@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c -@@ -474,7 +474,11 @@ static int fq_codel_init(struct Qdisc *s +@@ -482,7 +482,11 @@ static int fq_codel_init(struct Qdisc *s sch->limit = 10*1024; q->flows_cnt = 1024; diff --git a/target/linux/generic/hack-4.19/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-4.19/661-use_fq_codel_by_default.patch index a5d78a3dd3..d6d852c9ef 100644 --- a/target/linux/generic/hack-4.19/661-use_fq_codel_by_default.patch +++ b/target/linux/generic/hack-4.19/661-use_fq_codel_by_default.patch @@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau register_qdisc(&pfifo_head_drop_qdisc_ops); --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c -@@ -714,7 +714,7 @@ static const struct Qdisc_class_ops fq_c +@@ -722,7 +722,7 @@ static const struct Qdisc_class_ops fq_c .walk = fq_codel_walk, }; @@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau .cl_ops = &fq_codel_class_ops, .id = "fq_codel", .priv_size = sizeof(struct fq_codel_sched_data), -@@ -729,6 +729,7 @@ static struct Qdisc_ops fq_codel_qdisc_o +@@ -737,6 +737,7 @@ static struct Qdisc_ops fq_codel_qdisc_o .dump_stats = fq_codel_dump_stats, .owner = THIS_MODULE, }; diff --git a/target/linux/generic/hack-4.19/901-debloat_sock_diag.patch b/target/linux/generic/hack-4.19/901-debloat_sock_diag.patch index e55f45478a..c9f97643c6 100644 --- a/target/linux/generic/hack-4.19/901-debloat_sock_diag.patch +++ b/target/linux/generic/hack-4.19/901-debloat_sock_diag.patch @@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie) { struct dst_entry *dst = __sk_dst_get(sk); -@@ -1604,9 +1616,11 @@ static void __sk_free(struct sock *sk) +@@ -1622,9 +1634,11 @@ static void __sk_free(struct sock *sk) if (likely(sk->sk_net_refcnt)) sock_inuse_add(sock_net(sk), -1); diff --git a/target/linux/generic/hack-4.19/902-debloat_proc.patch b/target/linux/generic/hack-4.19/902-debloat_proc.patch index 0c37303d04..6005d68665 100644 --- a/target/linux/generic/hack-4.19/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.19/902-debloat_proc.patch @@ -327,7 +327,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -3512,6 +3512,8 @@ static __net_initdata struct pernet_oper +@@ -3532,6 +3532,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/target/linux/generic/hack-4.9/220-gc_sections.patch b/target/linux/generic/hack-4.9/220-gc_sections.patch index 75cc9422f8..8fcdd752d3 100644 --- a/target/linux/generic/hack-4.9/220-gc_sections.patch +++ b/target/linux/generic/hack-4.9/220-gc_sections.patch @@ -57,7 +57,7 @@ Signed-off-by: Gabor Juhos select OF_EARLY_FLATTREE if OF --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile -@@ -102,6 +102,7 @@ ifeq ($(CONFIG_FUNCTION_TRACER),y) +@@ -104,6 +104,7 @@ ifeq ($(CONFIG_FUNCTION_TRACER),y) ORIG_CFLAGS := $(KBUILD_CFLAGS) KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) endif diff --git a/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch b/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch index 1d10af647f..c844e2d46e 100644 --- a/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch +++ b/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch @@ -32,7 +32,7 @@ Signed-off-by: Gabor Juhos /* The Mellanox Tavor device gives false positive parity errors * Mark this device with a broken_parity_status, to allow * PCI scanning code to "skip" this now blacklisted device. -@@ -3108,6 +3109,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I +@@ -3109,6 +3110,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata); @@ -40,7 +40,7 @@ Signed-off-by: Gabor Juhos /* * Ivytown NTB BAR sizes are misreported by the hardware due to an erratum. To -@@ -3164,6 +3166,8 @@ static void fixup_debug_report(struct pc +@@ -3165,6 +3167,8 @@ static void fixup_debug_report(struct pc } } @@ -49,7 +49,7 @@ Signed-off-by: Gabor Juhos /* * Some BIOS implementations leave the Intel GPU interrupts enabled, * even though no one is handling them (f.e. i915 driver is never loaded). -@@ -3202,6 +3206,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN +@@ -3203,6 +3207,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq); diff --git a/target/linux/generic/pending-4.14/834-ledtrig-libata.patch b/target/linux/generic/pending-4.14/834-ledtrig-libata.patch index e3fd88f6b0..b025785ae1 100644 --- a/target/linux/generic/pending-4.14/834-ledtrig-libata.patch +++ b/target/linux/generic/pending-4.14/834-ledtrig-libata.patch @@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle /** * ata_build_rw_tf - Build ATA taskfile for given read/write request * @tf: Target ATA taskfile -@@ -5125,6 +5138,9 @@ struct ata_queued_cmd *ata_qc_new_init(s +@@ -5129,6 +5142,9 @@ struct ata_queued_cmd *ata_qc_new_init(s if (tag < 0) return NULL; } @@ -75,7 +75,7 @@ Signed-off-by: Daniel Golle qc = __ata_qc_from_tag(ap, tag); qc->tag = tag; -@@ -6028,6 +6044,9 @@ struct ata_port *ata_port_alloc(struct a +@@ -6032,6 +6048,9 @@ struct ata_port *ata_port_alloc(struct a ap->stats.unhandled_irq = 1; ap->stats.idle_irq = 1; #endif @@ -85,7 +85,7 @@ Signed-off-by: Daniel Golle ata_sff_port_init(ap); return ap; -@@ -6049,6 +6068,12 @@ static void ata_host_release(struct devi +@@ -6053,6 +6072,12 @@ static void ata_host_release(struct devi kfree(ap->pmp_link); kfree(ap->slave_link); @@ -98,7 +98,7 @@ Signed-off-by: Daniel Golle kfree(ap); host->ports[i] = NULL; } -@@ -6495,7 +6520,23 @@ int ata_host_register(struct ata_host *h +@@ -6499,7 +6524,23 @@ int ata_host_register(struct ata_host *h host->ports[i]->print_id = atomic_inc_return(&ata_print_id); host->ports[i]->local_port_no = i + 1; } diff --git a/target/linux/generic/pending-4.19/800-bcma-get-SoC-device-struct-copy-its-DMA-params-to-th.patch b/target/linux/generic/pending-4.19/800-bcma-get-SoC-device-struct-copy-its-DMA-params-to-th.patch index cb02c71829..8ea307ea36 100644 --- a/target/linux/generic/pending-4.19/800-bcma-get-SoC-device-struct-copy-its-DMA-params-to-th.patch +++ b/target/linux/generic/pending-4.19/800-bcma-get-SoC-device-struct-copy-its-DMA-params-to-th.patch @@ -50,12 +50,13 @@ Signed-off-by: Rafał Miłecki if (err) --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c -@@ -236,12 +236,16 @@ EXPORT_SYMBOL(bcma_core_irq); +@@ -236,13 +236,17 @@ EXPORT_SYMBOL(bcma_core_irq); void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core) { + struct device *dev = &core->dev; + + device_initialize(&core->dev); core->dev.release = bcma_release_core_dev; core->dev.bus = &bcma_bus_type; dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index); diff --git a/target/linux/generic/pending-4.19/810-pci_disable_common_quirks.patch b/target/linux/generic/pending-4.19/810-pci_disable_common_quirks.patch index 761305ef20..88c287be08 100644 --- a/target/linux/generic/pending-4.19/810-pci_disable_common_quirks.patch +++ b/target/linux/generic/pending-4.19/810-pci_disable_common_quirks.patch @@ -33,7 +33,7 @@ Signed-off-by: Gabor Juhos /* * The Mellanox Tavor device gives false positive parity errors. Mark this * device with a broken_parity_status to allow PCI scanning code to "skip" -@@ -3228,6 +3229,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I +@@ -3229,6 +3230,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata); @@ -42,7 +42,7 @@ Signed-off-by: Gabor Juhos /* * Ivytown NTB BAR sizes are misreported by the hardware due to an erratum. * To work around this, query the size it should be configured to by the -@@ -3253,6 +3256,8 @@ static void quirk_intel_ntb(struct pci_d +@@ -3254,6 +3257,8 @@ static void quirk_intel_ntb(struct pci_d DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e08, quirk_intel_ntb); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e0d, quirk_intel_ntb); @@ -51,7 +51,7 @@ Signed-off-by: Gabor Juhos /* * Some BIOS implementations leave the Intel GPU interrupts enabled, even * though no one is handling them (e.g., if the i915 driver is never -@@ -3291,6 +3296,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN +@@ -3292,6 +3297,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq); diff --git a/target/linux/generic/pending-4.19/834-ledtrig-libata.patch b/target/linux/generic/pending-4.19/834-ledtrig-libata.patch index d20e5bcec1..0eaecc85d1 100644 --- a/target/linux/generic/pending-4.19/834-ledtrig-libata.patch +++ b/target/linux/generic/pending-4.19/834-ledtrig-libata.patch @@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle /** * ata_build_rw_tf - Build ATA taskfile for given read/write request * @tf: Target ATA taskfile -@@ -5135,6 +5148,9 @@ struct ata_queued_cmd *ata_qc_new_init(s +@@ -5139,6 +5152,9 @@ struct ata_queued_cmd *ata_qc_new_init(s if (tag < 0) return NULL; } @@ -75,7 +75,7 @@ Signed-off-by: Daniel Golle qc = __ata_qc_from_tag(ap, tag); qc->tag = qc->hw_tag = tag; -@@ -6071,6 +6087,9 @@ struct ata_port *ata_port_alloc(struct a +@@ -6075,6 +6091,9 @@ struct ata_port *ata_port_alloc(struct a ap->stats.unhandled_irq = 1; ap->stats.idle_irq = 1; #endif @@ -85,7 +85,7 @@ Signed-off-by: Daniel Golle ata_sff_port_init(ap); return ap; -@@ -6106,6 +6125,12 @@ static void ata_host_release(struct kref +@@ -6110,6 +6129,12 @@ static void ata_host_release(struct kref kfree(ap->pmp_link); kfree(ap->slave_link); @@ -98,7 +98,7 @@ Signed-off-by: Daniel Golle kfree(ap); host->ports[i] = NULL; } -@@ -6569,7 +6594,23 @@ int ata_host_register(struct ata_host *h +@@ -6573,7 +6598,23 @@ int ata_host_register(struct ata_host *h host->ports[i]->print_id = atomic_inc_return(&ata_print_id); host->ports[i]->local_port_no = i + 1; } diff --git a/target/linux/generic/pending-4.9/810-pci_disable_common_quirks.patch b/target/linux/generic/pending-4.9/810-pci_disable_common_quirks.patch index 39c80e45e8..a2d7073ec6 100644 --- a/target/linux/generic/pending-4.9/810-pci_disable_common_quirks.patch +++ b/target/linux/generic/pending-4.9/810-pci_disable_common_quirks.patch @@ -32,7 +32,7 @@ Signed-off-by: Gabor Juhos /* The Mellanox Tavor device gives false positive parity errors * Mark this device with a broken_parity_status, to allow * PCI scanning code to "skip" this now blacklisted device. -@@ -3068,6 +3069,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I +@@ -3069,6 +3070,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata); @@ -40,7 +40,7 @@ Signed-off-by: Gabor Juhos /* * Ivytown NTB BAR sizes are misreported by the hardware due to an erratum. To -@@ -3124,6 +3126,8 @@ static void fixup_debug_report(struct pc +@@ -3125,6 +3127,8 @@ static void fixup_debug_report(struct pc } } @@ -49,7 +49,7 @@ Signed-off-by: Gabor Juhos /* * Some BIOS implementations leave the Intel GPU interrupts enabled, * even though no one is handling them (f.e. i915 driver is never loaded). -@@ -3162,6 +3166,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN +@@ -3163,6 +3167,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq); diff --git a/target/linux/generic/pending-4.9/834-ledtrig-libata.patch b/target/linux/generic/pending-4.9/834-ledtrig-libata.patch index cde478f3bb..253c816a7e 100644 --- a/target/linux/generic/pending-4.9/834-ledtrig-libata.patch +++ b/target/linux/generic/pending-4.9/834-ledtrig-libata.patch @@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle /** * ata_build_rw_tf - Build ATA taskfile for given read/write request * @tf: Target ATA taskfile -@@ -4999,6 +5012,9 @@ struct ata_queued_cmd *ata_qc_new_init(s +@@ -5003,6 +5016,9 @@ struct ata_queued_cmd *ata_qc_new_init(s if (tag < 0) return NULL; } @@ -75,7 +75,7 @@ Signed-off-by: Daniel Golle qc = __ata_qc_from_tag(ap, tag); qc->tag = tag; -@@ -5902,6 +5918,9 @@ struct ata_port *ata_port_alloc(struct a +@@ -5906,6 +5922,9 @@ struct ata_port *ata_port_alloc(struct a ap->stats.unhandled_irq = 1; ap->stats.idle_irq = 1; #endif @@ -85,7 +85,7 @@ Signed-off-by: Daniel Golle ata_sff_port_init(ap); return ap; -@@ -5923,6 +5942,12 @@ static void ata_host_release(struct devi +@@ -5927,6 +5946,12 @@ static void ata_host_release(struct devi kfree(ap->pmp_link); kfree(ap->slave_link); @@ -98,7 +98,7 @@ Signed-off-by: Daniel Golle kfree(ap); host->ports[i] = NULL; } -@@ -6369,7 +6394,23 @@ int ata_host_register(struct ata_host *h +@@ -6373,7 +6398,23 @@ int ata_host_register(struct ata_host *h host->ports[i]->print_id = atomic_inc_return(&ata_print_id); host->ports[i]->local_port_no = i + 1; } diff --git a/target/linux/ipq40xx/patches-4.14/998-ignore-stats-debug-info.patch b/target/linux/ipq40xx/patches-4.14/998-ignore-stats-debug-info.patch index 87421ba13b..bc8f5308f2 100644 --- a/target/linux/ipq40xx/patches-4.14/998-ignore-stats-debug-info.patch +++ b/target/linux/ipq40xx/patches-4.14/998-ignore-stats-debug-info.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c -@@ -2396,7 +2396,7 @@ ath10k_update_per_peer_tx_stats(struct a +@@ -2402,7 +2402,7 @@ ath10k_update_per_peer_tx_stats(struct a sgi = ATH10K_HW_GI(peer_stats->flags); if (txrate.flags == WMI_RATE_PREAMBLE_VHT && txrate.mcs > 9) { @@ -9,7 +9,7 @@ return; } -@@ -2454,7 +2454,7 @@ static void ath10k_htt_fetch_peer_stats( +@@ -2460,7 +2460,7 @@ static void ath10k_htt_fetch_peer_stats( ppdu_len = resp->peer_tx_stats.ppdu_len * sizeof(__le32); if (skb->len < sizeof(struct htt_resp_hdr) + num_ppdu * ppdu_len) { @@ -18,7 +18,7 @@ return; } -@@ -2466,8 +2466,8 @@ static void ath10k_htt_fetch_peer_stats( +@@ -2472,8 +2472,8 @@ static void ath10k_htt_fetch_peer_stats( spin_lock_bh(&ar->data_lock); peer = ath10k_peer_find_by_id(ar, peer_id); if (!peer) { diff --git a/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch index 5c5e2cff86..6812a2394b 100644 --- a/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch +++ b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch @@ -64,7 +64,7 @@ unsigned int custom_divisor; --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c -@@ -387,6 +387,20 @@ static unsigned int mem16_serial_in(stru +@@ -388,6 +388,20 @@ static unsigned int mem16_serial_in(stru return readw(p->membase + offset); } @@ -85,7 +85,7 @@ static void mem32_serial_out(struct uart_port *p, int offset, int value) { offset = offset << p->regshift; -@@ -459,6 +473,11 @@ static void set_io_from_upio(struct uart +@@ -460,6 +474,11 @@ static void set_io_from_upio(struct uart p->serial_out = mem32be_serial_out; break; @@ -97,7 +97,7 @@ #ifdef CONFIG_SERIAL_8250_RT288X case UPIO_AU: p->serial_in = au_serial_in; -@@ -486,6 +505,7 @@ serial_port_out_sync(struct uart_port *p +@@ -487,6 +506,7 @@ serial_port_out_sync(struct uart_port *p case UPIO_MEM16: case UPIO_MEM32: case UPIO_MEM32BE: @@ -105,7 +105,7 @@ case UPIO_AU: p->serial_out(p, offset, value); p->serial_in(p, UART_LCR); /* safe, no side-effects */ -@@ -2786,6 +2806,7 @@ static int serial8250_request_std_resour +@@ -2787,6 +2807,7 @@ static int serial8250_request_std_resour case UPIO_MEM32BE: case UPIO_MEM16: case UPIO_MEM: @@ -113,7 +113,7 @@ if (!port->mapbase) break; -@@ -2824,6 +2845,7 @@ static void serial8250_release_std_resou +@@ -2825,6 +2846,7 @@ static void serial8250_release_std_resou case UPIO_MEM32BE: case UPIO_MEM16: case UPIO_MEM: diff --git a/target/linux/layerscape/patches-4.14/807-usb-support-layerscape.patch b/target/linux/layerscape/patches-4.14/807-usb-support-layerscape.patch index 873024ecfb..6c9cdc3d6b 100644 --- a/target/linux/layerscape/patches-4.14/807-usb-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/807-usb-support-layerscape.patch @@ -1515,7 +1515,7 @@ Signed-off-by: Zhao Chenhui return IRQ_HANDLED; } } -@@ -920,12 +929,32 @@ int usb_otg_start(struct platform_device +@@ -922,12 +931,32 @@ int usb_otg_start(struct platform_device temp &= ~(PORTSC_PHY_TYPE_SEL | PORTSC_PTW); switch (pdata->phy_mode) { case FSL_USB2_PHY_ULPI: diff --git a/target/linux/layerscape/patches-4.14/808-vfio-support-layerscape.patch b/target/linux/layerscape/patches-4.14/808-vfio-support-layerscape.patch index c2424a41f0..51e2fc5a5a 100644 --- a/target/linux/layerscape/patches-4.14/808-vfio-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/808-vfio-support-layerscape.patch @@ -27,7 +27,7 @@ Signed-off-by: Yangbo Lu --- a/drivers/vfio/Kconfig +++ b/drivers/vfio/Kconfig -@@ -47,4 +47,5 @@ menuconfig VFIO_NOIOMMU +@@ -47,4 +47,5 @@ config VFIO_NOIOMMU source "drivers/vfio/pci/Kconfig" source "drivers/vfio/platform/Kconfig" source "drivers/vfio/mdev/Kconfig" diff --git a/target/linux/layerscape/patches-4.14/816-pcie-support-layerscape.patch b/target/linux/layerscape/patches-4.14/816-pcie-support-layerscape.patch index 38a308e9d4..d7878e83a0 100644 --- a/target/linux/layerscape/patches-4.14/816-pcie-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/816-pcie-support-layerscape.patch @@ -3128,7 +3128,7 @@ Signed-off-by: Yangbo Lu /* Parse and map our Configuration Space windows */ --- a/drivers/pci/host/pcie-xilinx-nwl.c +++ b/drivers/pci/host/pcie-xilinx-nwl.c -@@ -778,16 +778,7 @@ static int nwl_pcie_parse_dt(struct nwl_ +@@ -780,16 +780,7 @@ static int nwl_pcie_parse_dt(struct nwl_ struct platform_device *pdev) { struct device *dev = pcie->dev; @@ -5604,7 +5604,7 @@ Signed-off-by: Yangbo Lu * them, we have to fall back to INTx or other interrupts, e.g., a --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c -@@ -3430,6 +3430,13 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_A +@@ -3431,6 +3431,13 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_A */ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, 0xb005, quirk_no_bus_reset); @@ -5808,7 +5808,7 @@ Signed-off-by: Yangbo Lu struct pci_epc *epc; --- a/include/linux/pci.h +++ b/include/linux/pci.h -@@ -1946,6 +1946,7 @@ void pcibios_release_device(struct pci_d +@@ -1947,6 +1947,7 @@ void pcibios_release_device(struct pci_d void pcibios_penalize_isa_irq(int irq, int active); int pcibios_alloc_irq(struct pci_dev *dev); void pcibios_free_irq(struct pci_dev *dev); diff --git a/target/linux/layerscape/patches-4.14/820-sec-support-layerscape.patch b/target/linux/layerscape/patches-4.14/820-sec-support-layerscape.patch index 63f6540be0..5c75068749 100644 --- a/target/linux/layerscape/patches-4.14/820-sec-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/820-sec-support-layerscape.patch @@ -15267,7 +15267,7 @@ Signed-off-by: Zhao Qiang #endif /* __SG_SW_QM_H */ --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c -@@ -1250,6 +1250,14 @@ static int ipsec_esp(struct talitos_edes +@@ -1254,6 +1254,14 @@ static int ipsec_esp(struct talitos_edes ret = talitos_sg_map_ext(dev, areq->src, cryptlen, edesc, &desc->ptr[4], sg_count, areq->assoclen, tbl_off, elen); diff --git a/target/linux/mediatek/patches-4.14/0012-clk-dont-disable-unused-clocks.patch b/target/linux/mediatek/patches-4.14/0012-clk-dont-disable-unused-clocks.patch index a3fd3138cc..c5048c8e6f 100644 --- a/target/linux/mediatek/patches-4.14/0012-clk-dont-disable-unused-clocks.patch +++ b/target/linux/mediatek/patches-4.14/0012-clk-dont-disable-unused-clocks.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -808,7 +808,7 @@ unlock_out: +@@ -803,7 +803,7 @@ unlock_out: clk_core_disable_unprepare(core->parent); } diff --git a/target/linux/mediatek/patches-4.19/0900-bt-mtk-serial-fix.patch b/target/linux/mediatek/patches-4.19/0900-bt-mtk-serial-fix.patch index a4918fa9f5..ba78262574 100644 --- a/target/linux/mediatek/patches-4.19/0900-bt-mtk-serial-fix.patch +++ b/target/linux/mediatek/patches-4.19/0900-bt-mtk-serial-fix.patch @@ -10,7 +10,7 @@ #define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */ --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c -@@ -297,7 +297,7 @@ static const struct serial8250_config ua +@@ -298,7 +298,7 @@ static const struct serial8250_config ua .tx_loadsz = 16, .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT, @@ -19,7 +19,7 @@ }, [PORT_NPCM] = { .name = "Nuvoton 16550", -@@ -2686,6 +2686,11 @@ serial8250_do_set_termios(struct uart_po +@@ -2687,6 +2687,11 @@ serial8250_do_set_termios(struct uart_po unsigned long flags; unsigned int baud, quot, frac = 0; diff --git a/target/linux/mvebu/patches-4.14/524-PCI-aardvark-set-host-and-device-to-the-same-MAX-payload-size.patch b/target/linux/mvebu/patches-4.14/524-PCI-aardvark-set-host-and-device-to-the-same-MAX-payload-size.patch index aa5bfe7d06..ab643b776f 100644 --- a/target/linux/mvebu/patches-4.14/524-PCI-aardvark-set-host-and-device-to-the-same-MAX-payload-size.patch +++ b/target/linux/mvebu/patches-4.14/524-PCI-aardvark-set-host-and-device-to-the-same-MAX-payload-size.patch @@ -57,7 +57,7 @@ Signed-off-by: Thomas Petazzoni #define PCIE_CORE_LINK_CTRL_STAT_REG 0xd0 #define PCIE_CORE_LINK_L0S_ENTRY BIT(0) #define PCIE_CORE_LINK_TRAINING BIT(5) -@@ -298,7 +300,8 @@ static void advk_pcie_setup_hw(struct ad +@@ -300,7 +302,8 @@ static void advk_pcie_setup_hw(struct ad /* Set PCIe Device Control and Status 1 PF0 register */ reg = PCIE_CORE_DEV_CTRL_STATS_RELAX_ORDER_DISABLE | @@ -67,7 +67,7 @@ Signed-off-by: Thomas Petazzoni PCIE_CORE_DEV_CTRL_STATS_SNOOP_DISABLE | (PCIE_CORE_DEV_CTRL_STATS_MAX_RD_REQ_SZ << PCIE_CORE_DEV_CTRL_STATS_MAX_RD_REQ_SIZE_SHIFT); -@@ -913,6 +916,58 @@ out_release_res: +@@ -968,6 +971,58 @@ out_release_res: return err; } @@ -126,7 +126,7 @@ Signed-off-by: Thomas Petazzoni static int advk_pcie_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; -@@ -987,6 +1042,9 @@ static int advk_pcie_probe(struct platfo +@@ -1042,6 +1097,9 @@ static int advk_pcie_probe(struct platfo list_for_each_entry(child, &bus->children, node) pcie_bus_configure_settings(child); diff --git a/target/linux/mvebu/patches-4.14/527-PCI-aardvark-allow-to-specify-link-capability.patch b/target/linux/mvebu/patches-4.14/527-PCI-aardvark-allow-to-specify-link-capability.patch index d9ebf2e498..3360123775 100644 --- a/target/linux/mvebu/patches-4.14/527-PCI-aardvark-allow-to-specify-link-capability.patch +++ b/target/linux/mvebu/patches-4.14/527-PCI-aardvark-allow-to-specify-link-capability.patch @@ -14,7 +14,7 @@ Signed-off-by: Tomasz Maciej Nowak --- a/drivers/pci/host/pci-aardvark.c +++ b/drivers/pci/host/pci-aardvark.c -@@ -273,6 +273,8 @@ static void advk_pcie_set_ob_win(struct +@@ -275,6 +275,8 @@ static void advk_pcie_set_ob_win(struct static void advk_pcie_setup_hw(struct advk_pcie *pcie) { @@ -23,7 +23,7 @@ Signed-off-by: Tomasz Maciej Nowak u32 reg; int i; -@@ -312,10 +314,15 @@ static void advk_pcie_setup_hw(struct ad +@@ -314,10 +316,15 @@ static void advk_pcie_setup_hw(struct ad PCIE_CORE_CTRL2_TD_ENABLE; advk_writel(pcie, reg, PCIE_CORE_CTRL2_REG); diff --git a/target/linux/mvebu/patches-4.19/523-Revert-PCI-aardvark-Convert-to-use-pci_host_probe.patch b/target/linux/mvebu/patches-4.19/523-Revert-PCI-aardvark-Convert-to-use-pci_host_probe.patch index 60bd76d296..9125243bd0 100644 --- a/target/linux/mvebu/patches-4.19/523-Revert-PCI-aardvark-Convert-to-use-pci_host_probe.patch +++ b/target/linux/mvebu/patches-4.19/523-Revert-PCI-aardvark-Convert-to-use-pci_host_probe.patch @@ -10,7 +10,7 @@ This reverts commit c8e144f8ab00e6c4a070a932ef9c57db09aa41cf. --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c -@@ -870,6 +870,7 @@ static int advk_pcie_probe(struct platfo +@@ -925,6 +925,7 @@ static int advk_pcie_probe(struct platfo struct device *dev = &pdev->dev; struct advk_pcie *pcie; struct resource *res; @@ -18,7 +18,7 @@ This reverts commit c8e144f8ab00e6c4a070a932ef9c57db09aa41cf. struct pci_host_bridge *bridge; int ret, irq; -@@ -923,13 +924,22 @@ static int advk_pcie_probe(struct platfo +@@ -978,13 +979,22 @@ static int advk_pcie_probe(struct platfo bridge->map_irq = of_irq_parse_and_map_pci; bridge->swizzle_irq = pci_common_swizzle; diff --git a/target/linux/mvebu/patches-4.19/524-PCI-aardvark-set-host-and-device-to-the-same-MAX-payload-size.patch b/target/linux/mvebu/patches-4.19/524-PCI-aardvark-set-host-and-device-to-the-same-MAX-payload-size.patch index 8056a284e6..03a5b329f0 100644 --- a/target/linux/mvebu/patches-4.19/524-PCI-aardvark-set-host-and-device-to-the-same-MAX-payload-size.patch +++ b/target/linux/mvebu/patches-4.19/524-PCI-aardvark-set-host-and-device-to-the-same-MAX-payload-size.patch @@ -57,7 +57,7 @@ Signed-off-by: Thomas Petazzoni #define PCIE_CORE_LINK_CTRL_STAT_REG 0xd0 #define PCIE_CORE_LINK_L0S_ENTRY BIT(0) #define PCIE_CORE_LINK_TRAINING BIT(5) -@@ -254,7 +256,8 @@ static void advk_pcie_setup_hw(struct ad +@@ -256,7 +258,8 @@ static void advk_pcie_setup_hw(struct ad /* Set PCIe Device Control and Status 1 PF0 register */ reg = PCIE_CORE_DEV_CTRL_STATS_RELAX_ORDER_DISABLE | @@ -67,7 +67,7 @@ Signed-off-by: Thomas Petazzoni PCIE_CORE_DEV_CTRL_STATS_SNOOP_DISABLE | (PCIE_CORE_DEV_CTRL_STATS_MAX_RD_REQ_SZ << PCIE_CORE_DEV_CTRL_STATS_MAX_RD_REQ_SIZE_SHIFT); -@@ -865,6 +868,58 @@ out_release_res: +@@ -920,6 +923,58 @@ out_release_res: return err; } @@ -126,7 +126,7 @@ Signed-off-by: Thomas Petazzoni static int advk_pcie_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; -@@ -939,6 +994,9 @@ static int advk_pcie_probe(struct platfo +@@ -994,6 +1049,9 @@ static int advk_pcie_probe(struct platfo list_for_each_entry(child, &bus->children, node) pcie_bus_configure_settings(child); diff --git a/target/linux/mvebu/patches-4.19/527-PCI-aardvark-allow-to-specify-link-capability.patch b/target/linux/mvebu/patches-4.19/527-PCI-aardvark-allow-to-specify-link-capability.patch index aba142881b..044d357a40 100644 --- a/target/linux/mvebu/patches-4.19/527-PCI-aardvark-allow-to-specify-link-capability.patch +++ b/target/linux/mvebu/patches-4.19/527-PCI-aardvark-allow-to-specify-link-capability.patch @@ -14,7 +14,7 @@ Signed-off-by: Tomasz Maciej Nowak --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c -@@ -234,6 +234,8 @@ static int advk_pcie_wait_for_link(struc +@@ -236,6 +236,8 @@ static int advk_pcie_wait_for_link(struc static void advk_pcie_setup_hw(struct advk_pcie *pcie) { @@ -23,7 +23,7 @@ Signed-off-by: Tomasz Maciej Nowak u32 reg; /* Set to Direct mode */ -@@ -268,10 +270,15 @@ static void advk_pcie_setup_hw(struct ad +@@ -270,10 +272,15 @@ static void advk_pcie_setup_hw(struct ad PCIE_CORE_CTRL2_TD_ENABLE; advk_writel(pcie, reg, PCIE_CORE_CTRL2_REG); diff --git a/target/linux/mxs/patches-4.14/110-crypto-mxsdcp-provide-importexport.patch b/target/linux/mxs/patches-4.14/110-crypto-mxsdcp-provide-importexport.patch index 49e96d1e95..18ef42f30a 100644 --- a/target/linux/mxs/patches-4.14/110-crypto-mxsdcp-provide-importexport.patch +++ b/target/linux/mxs/patches-4.14/110-crypto-mxsdcp-provide-importexport.patch @@ -1,6 +1,6 @@ --- a/drivers/crypto/mxs-dcp.c +++ b/drivers/crypto/mxs-dcp.c -@@ -831,6 +831,24 @@ static void dcp_sha_cra_exit(struct cryp +@@ -838,6 +838,24 @@ static void dcp_sha_cra_exit(struct cryp { } @@ -25,7 +25,7 @@ /* AES 128 ECB and AES 128 CBC */ static struct crypto_alg dcp_aes_algs[] = { { -@@ -890,8 +908,11 @@ static struct ahash_alg dcp_sha1_alg = { +@@ -897,8 +915,11 @@ static struct ahash_alg dcp_sha1_alg = { .final = dcp_sha_final, .finup = dcp_sha_finup, .digest = dcp_sha_digest, @@ -37,7 +37,7 @@ .base = { .cra_name = "sha1", .cra_driver_name = "sha1-dcp", -@@ -914,8 +935,11 @@ static struct ahash_alg dcp_sha256_alg = +@@ -921,8 +942,11 @@ static struct ahash_alg dcp_sha256_alg = .final = dcp_sha_final, .finup = dcp_sha_finup, .digest = dcp_sha_digest, diff --git a/target/linux/oxnas/patches-4.14/999-libata-hacks.patch b/target/linux/oxnas/patches-4.14/999-libata-hacks.patch index d5c425b877..a8b0f967f0 100644 --- a/target/linux/oxnas/patches-4.14/999-libata-hacks.patch +++ b/target/linux/oxnas/patches-4.14/999-libata-hacks.patch @@ -15,7 +15,7 @@ /* initialize internal qc */ /* XXX: Tag 0 is used for drivers with legacy EH as some -@@ -5132,6 +5140,9 @@ struct ata_queued_cmd *ata_qc_new_init(s +@@ -5136,6 +5144,9 @@ struct ata_queued_cmd *ata_qc_new_init(s if (unlikely(ap->pflags & ATA_PFLAG_FROZEN)) return NULL; @@ -25,7 +25,7 @@ /* libsas case */ if (ap->flags & ATA_FLAG_SAS_HOST) { tag = ata_sas_allocate_tag(ap); -@@ -5177,6 +5188,8 @@ void ata_qc_free(struct ata_queued_cmd * +@@ -5181,6 +5192,8 @@ void ata_qc_free(struct ata_queued_cmd * qc->tag = ATA_TAG_POISON; if (ap->flags & ATA_FLAG_SAS_HOST) ata_sas_free_tag(tag, ap); diff --git a/target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch b/target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch index 742b6d6ad5..d6f11ac935 100644 --- a/target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch +++ b/target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch @@ -1,6 +1,6 @@ --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c -@@ -486,6 +486,16 @@ static const struct dmi_system_id reboot +@@ -487,6 +487,16 @@ static const struct dmi_system_id reboot }, }, diff --git a/target/linux/x86/patches-4.19/200-pcengines-apu2-reboot.patch b/target/linux/x86/patches-4.19/200-pcengines-apu2-reboot.patch index 742b6d6ad5..d6f11ac935 100644 --- a/target/linux/x86/patches-4.19/200-pcengines-apu2-reboot.patch +++ b/target/linux/x86/patches-4.19/200-pcengines-apu2-reboot.patch @@ -1,6 +1,6 @@ --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c -@@ -486,6 +486,16 @@ static const struct dmi_system_id reboot +@@ -487,6 +487,16 @@ static const struct dmi_system_id reboot }, }, diff --git a/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch b/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch index 9ea3cd0955..70ce7012bf 100644 --- a/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch +++ b/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch @@ -1,6 +1,6 @@ --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c -@@ -487,6 +487,16 @@ static struct dmi_system_id __initdata r +@@ -488,6 +488,16 @@ static struct dmi_system_id __initdata r }, }, From c60ddab89604273905cb3615aee04eb4760c5a5d Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Fri, 1 Oct 2021 05:02:24 +0300 Subject: [PATCH 31/33] kernel: drop kmod-gpio-dev The GPIO_DEVICE symbol belonged to a custom driver that was removed from OpenWrt in 2012. The symbol never existed in the upstream kernel. Signed-off-by: Stijn Tintel --- package/kernel/linux/modules/other.mk | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 32313da263..ed8db79627 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -200,22 +200,6 @@ endef $(eval $(call KernelPackage,eeprom-at25)) -define KernelPackage/gpio-dev - SUBMENU:=$(OTHER_MENU) - TITLE:=Generic GPIO char device support - DEPENDS:=@GPIO_SUPPORT - KCONFIG:=CONFIG_GPIO_DEVICE - FILES:=$(LINUX_DIR)/drivers/char/gpio_dev.ko - AUTOLOAD:=$(call AutoLoad,40,gpio_dev) -endef - -define KernelPackage/gpio-dev/description - Kernel module to allows control of GPIO pins using a character device. -endef - -$(eval $(call KernelPackage,gpio-dev)) - - define KernelPackage/gpio-mcp23s08 SUBMENU:=$(OTHER_MENU) TITLE:=Microchip MCP23xxx I/O expander From b082f04ae3836afc7aca6aa138f37e36d2cb8f99 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 4 Oct 2021 18:48:30 -0700 Subject: [PATCH 32/33] tools/meson: update to 0.59.2 Update install procedure based on upstream feedback. Normally, meson is to be installed with pip. But as pip is not mandated by the build system, it cannot be used. Upstream provides a nice script to pack meson automatically. Moved src/ to files/. No need to copy to BUILD_DIR. Signed-off-by: Rosen Penev --- include/meson.mk | 3 +-- tools/meson/Makefile | 9 ++++++--- tools/meson/{src => files}/openwrt-cross.txt.in | 0 tools/meson/{src => files}/openwrt-native.txt.in | 0 4 files changed, 7 insertions(+), 5 deletions(-) rename tools/meson/{src => files}/openwrt-cross.txt.in (100%) rename tools/meson/{src => files}/openwrt-native.txt.in (100%) diff --git a/include/meson.mk b/include/meson.mk index 01d0ce0280..9862f0e662 100644 --- a/include/meson.mk +++ b/include/meson.mk @@ -19,7 +19,6 @@ # # Host packages are built in the same fashion, just use these vars instead: # -# HOST_BUILD_DEPENDS:=meson/host # MESON_HOST_ARGS+=-Dfoo -Dbar=baz # MESON_HOST_VARS+=FOO=bar @@ -57,7 +56,7 @@ MESON_CPU:="$(CPU_TYPE)$(if $(CPU_SUBTYPE),+$(CPU_SUBTYPE))" endif define Meson - $(2) $(STAGING_DIR_HOST)/bin/$(PYTHON) $(MESON_DIR)/meson.py $(1) + $(2) $(STAGING_DIR_HOST)/bin/meson $(1) endef define Meson/CreateNativeFile diff --git a/tools/meson/Makefile b/tools/meson/Makefile index bae89654a5..0cf0efba47 100644 --- a/tools/meson/Makefile +++ b/tools/meson/Makefile @@ -1,11 +1,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=meson -PKG_VERSION:=0.59.1 +PKG_VERSION:=0.59.2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/mesonbuild/meson/releases/download/$(PKG_VERSION) -PKG_HASH:=db586a451650d46bbe10984a87b79d9bcdc1caebf38d8e189f8848f8d502356d +PKG_HASH:=13dee549a7ba758b7e33ce7719f28d1d337a98d10d378a4779ccc996f5a2fc49 PKG_MAINTAINER:=Andre Heider PKG_LICENSE:=Apache-2.0 @@ -20,8 +20,11 @@ define Host/Compile endef define Host/Install + $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin + $(HOST_BUILD_DIR)/packaging/create_zipapp.py $(HOST_BUILD_DIR) --interpreter $(STAGING_DIR_HOST)/bin/$(PYTHON) --outfile $(STAGING_DIR_HOST)/bin/meson $(INSTALL_DIR) $(STAGING_DIR_HOST)/lib/meson - $(CP) $(HOST_BUILD_DIR)/* $(STAGING_DIR_HOST)/lib/meson/ + $(INSTALL_CONF) files/openwrt-cross.txt.in $(STAGING_DIR_HOST)/lib/meson/ + $(INSTALL_CONF) files/openwrt-native.txt.in $(STAGING_DIR_HOST)/lib/meson/ endef define Host/Clean diff --git a/tools/meson/src/openwrt-cross.txt.in b/tools/meson/files/openwrt-cross.txt.in similarity index 100% rename from tools/meson/src/openwrt-cross.txt.in rename to tools/meson/files/openwrt-cross.txt.in diff --git a/tools/meson/src/openwrt-native.txt.in b/tools/meson/files/openwrt-native.txt.in similarity index 100% rename from tools/meson/src/openwrt-native.txt.in rename to tools/meson/files/openwrt-native.txt.in From cc506708b5223b402aba71294cf181dc86bf5a18 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 9 Oct 2021 11:09:14 +0800 Subject: [PATCH 33/33] r8168: Update to 8.049.02 Signed-off-by: Tianling Shen (cherry picked from commit eddae41f4ce39d54c40034e3b3a2131847d8dbb3) --- package/kernel/r8168/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package/kernel/r8168/Makefile b/package/kernel/r8168/Makefile index 3a3162651d..fd5977a5ba 100644 --- a/package/kernel/r8168/Makefile +++ b/package/kernel/r8168/Makefile @@ -7,13 +7,14 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=r8168 -PKG_VERSION:=8.049.01 -PKG_RELEASE:=1 +PKG_VERSION:=8.049.02 +PKG_RELEASE:=$(AUTORELEAE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/BROBIRD/openwrt-r8168.git -PKG_SOURCE_VERSION:=66fdc44a1f69c4fda18e6f922a234cbaa933ede6 -PKG_MIRROR_HASH:=a480cf9c70bbc3ee5d9b967e5006ff4fc9bba2bf38638fb2b7567f10b6f41bf3 +PKG_SOURCE_DATE:=2021-10-08 +PKG_SOURCE_VERSION:=2b969c15afe403a685fc7ee069620782241e3ad6 +PKG_MIRROR_HASH:=e4632c10d460f005eff76da8a183d7ff0c8819b0d099872589b7b06a9b8d9952 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)