wlan-ap-Telecominfraproject/feeds/ipq95xx/qca-nss-dp/files/qca-nss-dp.init
John Crispin b9b03a6e38 ipq95xx: add Qualcomm wifi-7 support
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-10 14:25:48 +02:00

53 lines
1.5 KiB
Bash

#!/bin/sh /etc/rc.common
#
# Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
START=70
enable_rps() {
i=1
irq_rps=`grep edma_rxdesc /proc/interrupts | cut -d ':' -f 1 | tr -d ' '`
for entry in $irq_rps
do
echo $i > /proc/irq/$entry/smp_affinity
i=$(expr $i \* 2)
if [ $i -gt 8 ];then
i=1
fi
done
i=1
irq_rps=`grep edma_txcmpl /proc/interrupts | cut -d ':' -f 1 | tr -d ' '`
for entry in $irq_rps
do
echo $i > /proc/irq/$entry/smp_affinity
i=$(expr $i \* 2)
if [ $i -gt 8 ];then
i=1
fi
done
#Enable RPS to use only 3 cores by default
echo 3 > /proc/sys/net/edma/rps_num_cores
}
start() {
local rps_enabled="$(uci_get qca_nss_dp @general[0] enable_rps)"
if [ "$rps_enabled" -eq 1 ]; then
enable_rps
fi
}