mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 17:42:41 +00:00
Fix Rate set bug by deviding the given value by 10, since the value is given in multiples of 10 by the cloud. Increase wait time to 20 seconds for the FW to settle before applying the rate Signed-off-by: Chaitanya Godavarthi <chaitanya.kiran@netexperience.com> ath10k-ct: Fix mcast/bcast/mgt/beacon rate overrides. Somewhere around 5.7 kernel, mac80211 started setting mcast/bcast, and ath10k started auto-calculating the mgt ratecodes. This was overriding anything a user set through debugfs. Instead, have debugfs take precedence in case a user sets a rate there. Signed-off-by: Ben Greear <greearb@candelatech.com>
39 lines
1.3 KiB
Bash
39 lines
1.3 KiB
Bash
#!/bin/sh
|
|
|
|
[ "${ACTION}" = "add" ] || exit 0
|
|
|
|
phy=$(cat /sys/class/net/${DEVICENAME}/phy80211/name)
|
|
radio=$(uci get wireless.${DEVICENAME}.device)
|
|
hwmode=$(uci get wireless.${radio}.hwmode)
|
|
|
|
[ -z "$phy" -o -z "$radio" -o -z "$hwmode" ] && exit 0
|
|
|
|
[ "${hwmode}" = "11a" ] && band=5 || band=2
|
|
|
|
bcn_rate=$(($(uci get wireless.${DEVICENAME}.bcn_rate)/10))
|
|
mcast_rate=$(uci get wireless.${DEVICENAME}.mcast_rate)
|
|
|
|
# ath10k rate-codes: 0x43 1M, 0x42 2M, 0x41 5.5M, 0x40 11M, 0x3 6M, 0x7 9M, 0x2 12M, 0x6 18M, 0x1 24M, 0x5 36M, 0x0 48M, 0x4 54M, 0xFF default
|
|
rate_codes="1:0x43 2:0x42 5:0x41 11:0x40 6:0x3 9:0x7 12:0x2 18:0x6 24:0x1 36:0x5 48:0x0 54:0x4"
|
|
|
|
# Default codes
|
|
beacon_code=0xFF
|
|
mcast_code=0xFF
|
|
|
|
for rate_code in $rate_codes ; do
|
|
rate="${rate_code%%:*}"
|
|
code="${rate_code##*:}"
|
|
if [ "${rate_code%%:*}" == "$bcn_rate" ] ; then
|
|
beacon_code="${rate_code##*:}"
|
|
fi
|
|
if [ "${rate_code%%:*}" == "$mcast_rate" ] ; then
|
|
mcast_code="${rate_code##*:}"
|
|
fi
|
|
done
|
|
|
|
# set rates
|
|
logger -t hotplug "Set Tx rates for device ${DEVICENAME}"
|
|
sleep 20
|
|
echo "${DEVICENAME} beacon ${band} ${beacon_code}" > /sys/kernel/debug/ieee80211/${phy}/ath10k/set_rates
|
|
echo "${DEVICENAME} mcast ${band} ${mcast_code}" > /sys/kernel/debug/ieee80211/${phy}/ath10k/set_rates
|