From 0910019a90937bc6c7eed03913bb054d14f4e8a9 Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Fri, 4 Oct 2024 17:27:42 -0400 Subject: [PATCH] ath11k_nss: Possible workaround to 0 wifi stats Signed-off-by: Sean Khan (cherry picked from commit 0056ba46ffe980c88ab4d250eb4799cb0a632de7) --- package/kernel/mac80211/files/qca-nss-pbuf.init | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) mode change 100755 => 100644 package/kernel/mac80211/files/qca-nss-pbuf.init diff --git a/package/kernel/mac80211/files/qca-nss-pbuf.init b/package/kernel/mac80211/files/qca-nss-pbuf.init old mode 100755 new mode 100644 index 44176f74223..bca42e943b3 --- a/package/kernel/mac80211/files/qca-nss-pbuf.init +++ b/package/kernel/mac80211/files/qca-nss-pbuf.init @@ -14,12 +14,20 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # -START=71 +START=95 NAME=qca-nss-pbuf +reload_wifi() { + if [ -r /sys/module/ath11k/parameters/nss_offload ]; then + nss_offload=$(cat /sys/module/ath11k/parameters/nss_offload 2> /dev/null) + [ "$nss_offload" -eq 1 ] && wifi up + fi +} + get_num_cpus() { - local num_cpus=$(awk -F': ' '/^processor/ {count++} END {print count}' /proc/cpuinfo) - echo ${num_cpus:-1} + local num_cpus + num_cpus=$(awk -F': ' '/^processor/ {count++} END {print count}' /proc/cpuinfo) + echo "${num_cpus:-1}" } apply_sysctl() { @@ -169,5 +177,6 @@ start() { num_cpus=$(get_num_cpus) hash_bitmap="$(((1 << num_cpus) - 1))" sysctl -w dev.nss.rps.hash_bitmap=$hash_bitmap > /dev/null 2>&1 + reload_wifi }