Merge Mainline

This commit is contained in:
CN_SZTL 2020-05-01 10:38:39 +08:00
commit 920cf867f4
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
168 changed files with 3729 additions and 4098 deletions

View File

@ -7,13 +7,13 @@ ifdef CONFIG_TESTING_KERNEL
endif
LINUX_VERSION-4.9 = .220
LINUX_VERSION-4.14 = .177
LINUX_VERSION-4.19 = .118
LINUX_VERSION-4.14 = .176
LINUX_VERSION-4.19 = .119
LINUX_VERSION-5.4 = .36
LINUX_KERNEL_HASH-4.9.220 = dad9c760787f9694173308c29f8e357b2c447b87a7965565ae4bb7f5979f0b2e
LINUX_KERNEL_HASH-4.14.177 = 33a73c88344a78b75751a5d42fff8b3ee1e2e006b30b2913605ebc6a40041812
LINUX_KERNEL_HASH-4.19.118 = 89749365f9dafa6c62cc5e920a7e532ed4aad9ab766fb436423b153ffbc08c96
LINUX_KERNEL_HASH-4.14.176 = bcae0956baaeb55dab5bad0401873fbc5baaa7fbe957ea6d27a5ab241cec5ca2
LINUX_KERNEL_HASH-4.19.119 = 2ba4b94a71bed9957d4d44b08de5552a30576ef2ceaa90f517af598dfe6f9bce
LINUX_KERNEL_HASH-5.4.36 = b9faea98122e8316af8fb428c942e81797b5d28a8fc59a24a4e47959e3765b8d
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))

View File

@ -14,8 +14,8 @@ PKG_NAME:=Build dependency
# Required for the toolchain
$(eval $(call TestHostCommand,working-make, \
Please install GNU make v3.81 or later. (This version has bugs), \
$(MAKE) -v | grep -E 'Make (3\.8[1-9]|3\.9[0-9]|[4-9]\.)'))
Please install GNU make v3.82 or later. (This version has bugs), \
$(MAKE) -v | grep -E 'Make (3\.8[2-9]|3\.9[0-9]|[4-9]\.)'))
$(eval $(call TestHostCommand,case-sensitive-fs, \
OpenWrt can only be built on a case-sensitive filesystem, \

View File

@ -3,7 +3,8 @@ PKG_NAME ?= u-boot
ifndef PKG_SOURCE_PROTO
PKG_SOURCE = $(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL = \
https://sources.openwrt.org \
https://mirror.cyberbits.eu/u-boot \
https://ftp.denx.de/pub/u-boot \
ftp://ftp.denx.de/pub/u-boot
endif

View File

@ -9,16 +9,17 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=uboot-envtools
PKG_DISTNAME:=u-boot
PKG_VERSION:=2019.07
PKG_RELEASE:=2
PKG_VERSION:=2020.04
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:= \
https://ftp.denx.de/pub/u-boot \
https://mirror.cyberbits.eu/u-boot \
ftp://ftp.denx.de/pub/u-boot
PKG_HASH:=fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372
PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_DISTNAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://git.denx.de/u-boot.git
PKG_SOURCE_VERSION:=e5aee22e4be75e75a854ab64503fc80598bc2004
PKG_MIRROR_HASH:=58c1ecaf901b6bf65c5e872b5449b642694ae5acebf61f91f0d4bc20b4c654b7
PKG_BUILD_DEPENDS:=fstools

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-openclash
PKG_VERSION:=0.37.4
PKG_VERSION:=0.37.5
PKG_RELEASE:=beta
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>

View File

@ -23,7 +23,7 @@ config openclash 'config'
option log_level 'silent'
option proxy_mode 'Rule'
option intranet_allowed '0'
option enable_udp_proxy '0'
option enable_udp_proxy '1'
option lan_ac_mode '0'
option operation_mode 'redir-host'
option enable_rule_proxy '0'

View File

@ -4,6 +4,7 @@
START=99
STOP=15
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
CLASH="/etc/openclash/clash"
CLASH_CONFIG="/etc/openclash"
CRON_FILE="/etc/crontabs/root"
@ -110,8 +111,8 @@ yml_check()
sed -i "s/- \{2,\}/- /g" "$3" 2>/dev/null
#检查关键字避免后续操作出错
/usr/share/openclash/yml_field_name_ch.sh "$3"
/usr/share/openclash/yml_field_name_ch.sh "$3" 2>/dev/null
#dns
[ -z "$(grep "^dns:" "$3")" ] && {
sed -i "s/^ \{1,\}dns:/dns:/g" "$3" 2>/dev/null
@ -131,7 +132,7 @@ yml_check()
group_len=$(sed -n '/^Proxy Group:/=' "$3" 2>/dev/null)
dns_len=$(sed -n '/^dns:/=' "$3" 2>/dev/null)
rule_len=$(sed -n '/^Rule:/=' "$3" 2>/dev/null)
if [ "$dns_len" -ge "$proxy_len" ] || [ "$dns_len" -ge "$rule_len" ] || [ "$dns_len" -ge "$group_len" ]; then
echo "错误: 不支持的配置文件, General 设置部分应位于开头,请根据模板修改后重试!" > $START_LOG
echo "${LOGTIME} Unsupported Config, Please Check The General Setting's location And Try-again!" >> $LOG_FILE
@ -192,7 +193,6 @@ yml_check()
fi 2>/dev/null
fi
if [ ! -z "$provider_len" ]; then
proxy_provider_mode=1
fi
@ -208,10 +208,10 @@ yml_check()
sed -i '/^ \{0,\}nameserver:/,/^Custom DNS End$/d' "$3" 2>/dev/null
sed -i '/##Custom DNS##/r/tmp/bakdns.config' "$3" 2>/dev/null
rm -rf /tmp/backdns.config 2>/dev/null
fi
fi 2>/dev/null
yml_dns_check
if [ ! -z "$(grep "^ \{1,\}port:" "$3")" ] || [ ! -z "$(grep "^ \{1,\}mode:" "$3")" ] || [ ! -z "$(grep "^ \{1,\}log-level:" "$3")" ]; then
cp "$3" /tmp/config.check 2>/dev/null
sed -i '/^dns:/,$d' /tmp/config.check 2>/dev/null
@ -240,7 +240,7 @@ yml_dns_check()
sed -i '/^Proxy:/i\dns:' "$CONFIG_FILE" 2>/dev/null
fi
fi
if [ -z "$(grep '^ \{0,\}nameserver:' "$CONFIG_FILE")" ]; then
if [ "$proxy_provider_mode" -eq 1 ]; then
sed -i '/^proxy-provider:/i\ nameserver:' "$CONFIG_FILE" 2>/dev/null
@ -256,21 +256,21 @@ yml_dns_check()
if [ -z "$dns_port" ] || [ "$dns_port" -eq 53 ]; then
dns_port=7874
fi
if [ ! -z "$(grep "^ \{0,\}listen:" "$CONFIG_FILE")" ]; then
if [ "$ipv6_enable" -ne 1 ]; then
if [ "$ipv6_enable" != "1" ]; then
sed -i "/^ \{0,\}listen:/c\ listen: 127.0.0.1:${dns_port}" "$CONFIG_FILE" 2>/dev/null
else
sed -i "/^ \{0,\}listen:/c\ listen: 0.0.0.0:${dns_port}" "$CONFIG_FILE" 2>/dev/null
fi
else
if [ "$ipv6_enable" -ne 1 ]; then
if [ "$ipv6_enable" != "1" ]; then
sed -i "/^dns:/a\ listen: 127.0.0.1:${dns_port}" "$CONFIG_FILE" 2>/dev/null
else
sed -i "/^dns:/a\ listen: 0.0.0.0:${dns_port}" "$CONFIG_FILE" 2>/dev/null
fi
fi
fi 2>/dev/null
uci set openclash.config.dns_port="$dns_port" && uci commit openclash
}
@ -290,7 +290,7 @@ yml_provider_path()
sed -i "s#${provider_path}#./proxy_provider/${provider_name}#" "$1" 2>/dev/null
fi
done
fi
fi 2>/dev/null
}
#检查代理集文件防止启动失败
@ -630,11 +630,11 @@ fi
lan_ac()
{
if [ -z "$1" ]; then
if [ -z "$1" ]; then
return
fi
fi
ipset add "$2" "$1" 2>/dev/null
ipset add "$2" "$1" 2>/dev/null
}
@ -662,7 +662,7 @@ else
if [ ! -f "$CONFIG_FILE" ] && [ -f "$BACKUP_FILE" ]; then
cp "$BACKUP_FILE" "$CONFIG_FILE"
fi
fi
fi 2>/dev/null
CONFIG_NAME=$(echo "$CONFIG_FILE" |awk -F '/' '{print $5}' 2>/dev/null)
}
@ -715,6 +715,272 @@ do_run_mode()
[ ! -x "/etc/openclash/core/clash" ] && chmod 4755 /etc/openclash/core/clash 2>/dev/null
}
set_firewall()
{
if [ "$(iptables -t nat -nL PREROUTING --line-number |grep "udp dpt:53" |grep "0.0.0.0/0 \{0,\}0.0.0.0/0" |wc -l)" -gt 1 ] && [ "$enable_redirect_dns" -eq "1" ]; then
echo "发现53端口被劫持清理防火墙规则..." >$START_LOG
pre_lines=$(iptables -nvL PREROUTING -t nat |sed 1,2d |sed -n '/0.0.0.0\/0 \{0,\}0.0.0.0\/0 \{0,\}udp dpt:53/=' 2>/dev/null |sort -rn)
for pre_line in $pre_lines; do
iptables -t nat -D PREROUTING "$pre_line" >/dev/null 2>&1
done
iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53 >/dev/null 2>&1
sleep 2
fi
if [ -z "$(uci get firewall.openclash 2>/dev/null)" ] || [ -z "$(uci get ucitrack.@openclash[-1].init 2>/dev/null)" ]; then
uci delete ucitrack.@openclash[-1] >/dev/null 2>&1
uci add ucitrack openclash >/dev/null 2>&1
uci set ucitrack.@openclash[-1].init=openclash >/dev/null 2>&1
uci commit ucitrack >/dev/null 2>&1
uci delete firewall.openclash >/dev/null 2>&1
uci set firewall.openclash=include >/dev/null 2>&1
uci set firewall.openclash.type=script >/dev/null 2>&1
uci set firewall.openclash.path=/var/etc/openclash.include >/dev/null 2>&1
uci set firewall.openclash.reload=1 >/dev/null 2>&1
fi
if [ "$(uci get firewall.@defaults[0].forward)" != "ACCEPT" ]; then
uci set firewall.@defaults[0].forward=ACCEPT >/dev/null 2>&1
uci commit firewall >/dev/null 2>&1
/etc/init.d/firewall reload >/dev/null 2>&1
fi
mkdir -p /var/etc
cat > "/var/etc/openclash.include" <<-EOF
/etc/init.d/openclash reload >/dev/null 2>&1
EOF
#lan_ac
if [ "$operation_mode" = "redir-host" ] && [ "$en_mode" = "redir-host" ]; then
if [ "$lan_ac_mode" = "0" ] && [ ! -z "$(uci get openclash.config.lan_ac_black_ips 2>/dev/null)" ]; then
ipset create lan_ac_black_ips hash:net
config_load "openclash"
config_list_foreach "config" "lan_ac_black_ips" lan_ac "lan_ac_black_ips"
elif [ "$lan_ac_mode" = "1" ] && [ ! -z "$(uci get openclash.config.lan_ac_white_ips 2>/dev/null)" ]; then
ipset create lan_ac_white_ips hash:net
config_load "openclash"
config_list_foreach "config" "lan_ac_white_ips" lan_ac "lan_ac_white_ips"
fi
fi
if [ -z "$en_mode_tun" ]; then
#tcp
iptables -t nat -N openclash
iptables -t nat -A openclash -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1
iptables -t nat -A openclash -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1
iptables -t nat -A openclash -d 0.0.0.0/8 -j RETURN
iptables -t nat -A openclash -d 10.0.0.0/8 -j RETURN
iptables -t nat -A openclash -d 127.0.0.0/8 -j RETURN
iptables -t nat -A openclash -d 169.254.0.0/16 -j RETURN
iptables -t nat -A openclash -d 172.16.0.0/12 -j RETURN
iptables -t nat -A openclash -d 192.168.0.0/16 -j RETURN
iptables -t nat -A openclash -d 224.0.0.0/4 -j RETURN
iptables -t nat -A openclash -d 240.0.0.0/4 -j RETURN
if [ ! -z "$wan_ip4" ]; then
for wan_ip4s in $wan_ip4; do
iptables -t nat -A openclash -d "$wan_ip4s" -j RETURN 2>/dev/null
done
fi
iptables -t nat -A openclash -p tcp -j REDIRECT --to-ports "$proxy_port"
#iptables -t nat -I PREROUTING -p tcp -d 8.8.8.8 -j REDIRECT --to-ports "$proxy_port"
#iptables -t nat -I PREROUTING -p tcp -d 8.8.4.4 -j REDIRECT --to-ports "$proxy_port"
iptables -t nat -A PREROUTING -p tcp -j openclash
#udp
if [ "$enable_udp_proxy" -eq 1 ]; then
ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" pref 789
ip route add local default dev lo table "$PROXY_ROUTE_TABLE"
iptables -t mangle -N openclash
iptables -t mangle -A openclash -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1
iptables -t mangle -A openclash -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1
iptables -t mangle -A openclash -d 0.0.0.0/8 -j RETURN
iptables -t mangle -A openclash -d 10.0.0.0/8 -j RETURN
iptables -t mangle -A openclash -d 127.0.0.0/8 -j RETURN
iptables -t mangle -A openclash -d 169.254.0.0/16 -j RETURN
iptables -t mangle -A openclash -d 172.16.0.0/12 -j RETURN
iptables -t mangle -A openclash -d 192.168.0.0/16 -j RETURN
iptables -t mangle -A openclash -d 224.0.0.0/4 -j RETURN
iptables -t mangle -A openclash -d 240.0.0.0/4 -j RETURN
if [ ! -z "$wan_ip4" ]; then
for wan_ip4s in $wan_ip4; do
iptables -t mangle -A openclash -d "$wan_ip4s" -j RETURN 2>/dev/null
done
fi
iptables -t mangle -A openclash -p udp -j TPROXY --on-port "$proxy_port" --tproxy-mark "$PROXY_FWMARK"
iptables -t mangle -A PREROUTING -p udp -j openclash
fi
if [ "$en_mode" = "fake-ip" ]; then
iptables -t nat -A OUTPUT -p tcp -d 198.18.0.0/16 -j REDIRECT --to-ports "$proxy_port"
if [ "$enable_udp_proxy" -eq 1 ]; then
iptables -t mangle -A OUTPUT -p udp -d 198.18.0.0/16 -j MARK --set-mark "$PROXY_FWMARK"
fi
fi
if [ "$ipv6_enable" -eq 1 ]; then
#tcp
ip6tables -t nat -N openclash
if [ ! -z "$lan_ip6" ]; then
for lan_ip6s in $lan_ip6; do
ip6tables -t nat -A openclash -d "$lan_ip6s" -j RETURN 2>/dev/null
done
fi
ip6tables -t nat -A openclash -p tcp -j REDIRECT --to-ports "$proxy_port"
ip6tables -t nat -A PREROUTING -p tcp -j openclash
#udp
if [ "$enable_udp_proxy" -eq 1 ]; then
ip6tables -t mangle -N openclash
if [ ! -z "$lan_ip6" ]; then
for lan_ip6s in $lan_ip6; do
if [ "$enable_udp_proxy" -eq 1 ]; then
ip6tables -t mangle -A openclash -d "$lan_ip6s" -j RETURN 2>/dev/null
fi
done
fi
ip6tables -t mangle -A openclash -p udp -j TPROXY --on-port "$proxy_port" --tproxy-mark "$PROXY_FWMARK"
ip6tables -t mangle -A PREROUTING -p udp -j openclash
fi
fi
else
#TUN模式
ipset create localnetwork hash:net
ipset add localnetwork 127.0.0.0/8
ipset add localnetwork 10.0.0.0/8
ipset add localnetwork 169.254.0.0/16
ipset add localnetwork 192.168.0.0/16
ipset add localnetwork 224.0.0.0/4
ipset add localnetwork 240.0.0.0/4
ipset add localnetwork 172.16.0.0/12
if [ ! -z "$wan_ip4" ]; then
for wan_ip4s in $wan_ip4; do
ipset add localnetwork "$wan_ip4s" 2>/dev/null
done
fi
#启动TUN
if [ "$en_mode_tun" = "2" ]; then
ip tuntap add user root mode tun clash0
ip link set clash0 up
ip route replace default dev clash0 table "$PROXY_ROUTE_TABLE"
elif [ "$en_mode_tun" = "1" ]; then
TUN_WAIT=0
while ( [ ! -z "$(pidof clash)" ] && [ -z "$(ip route list |grep utun)" ] && [ "$TUN_WAIT" -le 3 ] )
do
TUN_WAIT=$(expr "$TUN_WAIT" + 1)
sleep 2
done
ip route replace default dev utun table "$PROXY_ROUTE_TABLE"
fi
ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" pref 789
#设置防火墙
iptables -t mangle -N openclash
iptables -t mangle -F openclash
iptables -t mangle -A openclash -m set --match-set localnetwork dst -j RETURN
if [ "$en_mode" = "fake-ip" ]; then
iptables -t mangle -A openclash -d 198.18.0.0/16 -j MARK --set-mark "$PROXY_FWMARK"
fi
iptables -t mangle -I OUTPUT -j openclash
iptables -t mangle -I PREROUTING -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1
iptables -t mangle -I PREROUTING -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1
iptables -t mangle -I PREROUTING -m set ! --match-set localnetwork dst -j MARK --set-mark "$PROXY_FWMARK"
iptables -t nat -I PREROUTING -p tcp --dport 53 -j ACCEPT
#ipv6
# if [ "$ipv6_enable" -eq 1 ]; then
# ip6tables -t mangle -I PREROUTING -j MARK --set-mark "$PROXY_FWMARK"
# fi
fi
}
revert_firewall()
{
rm -rf /var/etc/openclash.include 2>/dev/null
#ipv4
ip rule del fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" pref 789 >/dev/null 2>&1
ip route del local default dev lo table "$PROXY_ROUTE_TABLE" >/dev/null 2>&1
iptables -t nat -D PREROUTING -p tcp --dport 53 -j ACCEPT >/dev/null 2>&1
iptables -t mangle -F openclash >/dev/null 2>&1
iptables -t mangle -D PREROUTING -p udp -j openclash >/dev/null 2>&1
iptables -t mangle -X openclash >/dev/null 2>&1
iptables -t nat -F openclash >/dev/null 2>&1
iptables -t nat -D PREROUTING -p tcp -j openclash >/dev/null 2>&1
iptables -t nat -X openclash >/dev/null 2>&1
out_lines=$(iptables -nvL OUTPUT -t mangle |sed 1,2d |sed -n '/198.18.0.0\/16/=' 2>/dev/null |sort -rn)
for out_line in $out_lines; do
iptables -t mangle -D OUTPUT "$out_line" >/dev/null 2>&1
done
out_lines=$(iptables -nvL OUTPUT -t nat |sed 1,2d |sed -n '/198.18.0.0\/16/=' 2>/dev/null |sort -rn)
for out_line in $out_lines; do
iptables -t nat -D OUTPUT "$out_line" >/dev/null 2>&1
done
#pre_lines=$(iptables -nvL PREROUTING -t nat |sed 1,2d |sed -n '/8\.8\./=' 2>/dev/null |sort -rn)
#for pre_line in $pre_lines; do
# iptables -t nat -D PREROUTING "$pre_line" >/dev/null 2>&1
#done
#ipv6
ip6tables -t mangle -F openclash >/dev/null 2>&1
ip6tables -t mangle -D PREROUTING -p udp -j openclash >/dev/null 2>&1
ip6tables -t mangle -X openclash >/dev/null 2>&1
ip6tables -t nat -F openclash >/dev/null 2>&1
ip6tables -t nat -D PREROUTING -p tcp -j openclash >/dev/null 2>&1
ip6tables -t nat -X openclash >/dev/null 2>&1
#TUN
ip route del default dev clash0 table "$PROXY_ROUTE_TABLE" >/dev/null 2>&1
ip route del default dev utun table "$PROXY_ROUTE_TABLE" >/dev/null 2>&1
ip rule del fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" pref 789 >/dev/null 2>&1
ip link set dev clash0 down >/dev/null 2>&1
ip tuntap del clash0 mode tun >/dev/null 2>&1
iptables -t mangle -D OUTPUT -j openclash >/dev/null 2>&1
iptables -t mangle -D PREROUTING -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1
iptables -t mangle -D PREROUTING -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1
iptables -t mangle -D PREROUTING -m set ! --match-set localnetwork dst -j MARK --set-mark "$PROXY_FWMARK" >/dev/null 2>&1
ip6tables -t mangle -D PREROUTING -j MARK --set-mark "$PROXY_FWMARK" >/dev/null 2>&1
iptables -t mangle -F openclash >/dev/null 2>&1
iptables -t mangle -X openclash >/dev/null 2>&1
ipset destroy localnetwork >/dev/null 2>&1
ipset destroy lan_ac_white_ips >/dev/null 2>&1
ipset destroy lan_ac_black_ips >/dev/null 2>&1
}
get_config()
{
enable_custom_dns=$(uci get openclash.config.enable_custom_dns 2>/dev/null)
rule_source=$(uci get openclash.config.rule_source 2>/dev/null)
enable_custom_clash_rules=$(uci get openclash.config.enable_custom_clash_rules 2>/dev/null)
da_password=$(uci get openclash.config.dashboard_password 2>/dev/null)
cn_port=$(uci get openclash.config.cn_port 2>/dev/null)
proxy_port=$(uci get openclash.config.proxy_port 2>/dev/null)
ipv6_enable=$(uci get openclash.config.ipv6_enable 2>/dev/null)
http_port=$(uci get openclash.config.http_port 2>/dev/null)
socks_port=$(uci get openclash.config.socks_port 2>/dev/null)
enable_redirect_dns=$(uci get openclash.config.enable_redirect_dns 2>/dev/null)
lan_ip=$(uci get network.lan.ipaddr 2>/dev/null |awk -F '/' '{print $1}' 2>/dev/null)
wan_ip4=$(ifconfig | grep 'inet addr' | awk '{print $2}' | cut -d: -f2 2>/dev/null)
lan_ip6=$(ifconfig | grep 'inet6 addr' | awk '{print $3}' 2>/dev/null)
direct_dns=$(uci get openclash.config.direct_dns 2>/dev/null)
disable_masq_cache=$(uci get openclash.config.disable_masq_cache 2>/dev/null)
log_level=$(uci get openclash.config.log_level 2>/dev/null)
proxy_mode=$(uci get openclash.config.proxy_mode 2>/dev/null)
intranet_allowed=$(uci get openclash.config.intranet_allowed 2>/dev/null)
enable_udp_proxy=$(uci get openclash.config.enable_udp_proxy 2>/dev/null)
operation_mode=$(uci get openclash.config.operation_mode 2>/dev/null)
lan_ac_mode=$(uci get openclash.config.lan_ac_mode 2>/dev/null)
enable_rule_proxy=$(uci get openclash.config.enable_rule_proxy 2>/dev/null)
}
start()
{
#禁止多个实例
@ -724,7 +990,7 @@ status=$(ps|grep -c /etc/init.d/openclash)
config_choose
enable=$(uci get openclash.config.enable 2>/dev/null)
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
if [ "$enable" -eq 1 ] && [ -f "$CONFIG_FILE" ]; then
#检查是否存在核心文件
do_run_mode
@ -735,29 +1001,7 @@ if [ "$enable" -eq 1 ] && [ -f "$CONFIG_FILE" ]; then
}
echo "OpenClash 开始启动..." >$START_LOG
echo "第一步: 获取配置..." >$START_LOG
enable_custom_dns=$(uci get openclash.config.enable_custom_dns 2>/dev/null)
rule_source=$(uci get openclash.config.rule_source 2>/dev/null)
enable_custom_clash_rules=$(uci get openclash.config.enable_custom_clash_rules 2>/dev/null)
da_password=$(uci get openclash.config.dashboard_password 2>/dev/null)
cn_port=$(uci get openclash.config.cn_port 2>/dev/null)
proxy_port=$(uci get openclash.config.proxy_port 2>/dev/null)
ipv6_enable=$(uci get openclash.config.ipv6_enable 2>/dev/null)
http_port=$(uci get openclash.config.http_port 2>/dev/null)
socks_port=$(uci get openclash.config.socks_port 2>/dev/null)
enable_redirect_dns=$(uci get openclash.config.enable_redirect_dns 2>/dev/null)
lan_ip=$(uci get network.lan.ipaddr 2>/dev/null |awk -F '/' '{print $1}' 2>/dev/null)
wan_ip4=$(ifconfig | grep 'inet addr' | awk '{print $2}' | cut -d: -f2 2>/dev/null)
lan_ip6=$(ifconfig | grep 'inet6 addr' | awk '{print $3}' 2>/dev/null)
direct_dns=$(uci get openclash.config.direct_dns 2>/dev/null)
disable_masq_cache=$(uci get openclash.config.disable_masq_cache 2>/dev/null)
log_level=$(uci get openclash.config.log_level 2>/dev/null)
proxy_mode=$(uci get openclash.config.proxy_mode 2>/dev/null)
intranet_allowed=$(uci get openclash.config.intranet_allowed 2>/dev/null)
enable_udp_proxy=$(uci get openclash.config.enable_udp_proxy 2>/dev/null)
operation_mode=$(uci get openclash.config.operation_mode 2>/dev/null)
lan_ac_mode=$(uci get openclash.config.lan_ac_mode 2>/dev/null)
enable_rule_proxy=$(uci get openclash.config.enable_rule_proxy 2>/dev/null)
get_config
echo "第二步: 配置文件检查..." >$START_LOG
yml_check "$en_mode" "$enable_custom_dns" "$CONFIG_FILE" "$BACKUP_FILE" "$START_BACKUP"
grep "^ \{0,\}Proxy Group:" "$CONFIG_FILE" >/dev/null 2>&1 && grep "^ \{0,\}Rule:" "$CONFIG_FILE" >/dev/null 2>&1
@ -791,7 +1035,15 @@ if [ "$enable" -eq 1 ] && [ -f "$CONFIG_FILE" ]; then
echo "" >$START_LOG
else
echo "第五步: 启动主程序..." >$START_LOG
nohup "$CLASH" -d "$CLASH_CONFIG" -f "$CONFIG_FILE" >> $LOG_FILE 2>&1 &
config_reload=$(uci get openclash.config.config_reload 2>/dev/null)
if [ -n "$(pidof clash)" ] && [ "$en_mode_tun" != "1" ] && [ "$config_reload" != "0" ]; then
curl -s --connect-timeout 5 -m 5 -H 'Content-Type: application/json' -H "Authorization: Bearer ${da_password}" -XPUT http://"$lan_ip":"$cn_port"/configs -d "{\"path\": \"$CONFIG_FILE\"}" 2>/dev/null
else
kill -9 "$(pidof clash|sed 's/$//g')" 2>/dev/null
nohup "$CLASH" -d "$CLASH_CONFIG" -f "$CONFIG_FILE" >> $LOG_FILE 2>&1 &
fi
uci set openclash.config.config_reload=1
uci commit openclash
#检测proxy_provider配置文件状态
echo "第六步: 等待主程序下载代理集..." >$START_LOG
@ -801,179 +1053,7 @@ if [ "$enable" -eq 1 ] && [ -f "$CONFIG_FILE" ]; then
ln -s /usr/share/openclash/yacd /www/luci-static/openclash 2>/dev/null
echo "第八步: 设置防火墙规则..." >$START_LOG
if [ "$(iptables -t nat -nL PREROUTING --line-number |grep "udp dpt:53" |grep "0.0.0.0/0 \{0,\}0.0.0.0/0" |wc -l)" -gt 1 ] && [ "$enable_redirect_dns" -eq "1" ]; then
echo "发现53端口被劫持清理防火墙规则..." >$START_LOG
pre_lines=$(iptables -nvL PREROUTING -t nat |sed 1,2d |sed -n '/0.0.0.0\/0 \{0,\}0.0.0.0\/0 \{0,\}udp dpt:53/=' 2>/dev/null |sort -rn)
for pre_line in $pre_lines; do
iptables -t nat -D PREROUTING "$pre_line" >/dev/null 2>&1
done
iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53 >/dev/null 2>&1
sleep 2
fi
if [ -z "$(uci get firewall.openclash 2>/dev/null)" ] || [ -z "$(uci get ucitrack.@openclash[-1].init 2>/dev/null)" ]; then
uci delete ucitrack.@openclash[-1] >/dev/null 2>&1
uci add ucitrack openclash >/dev/null 2>&1
uci set ucitrack.@openclash[-1].init=openclash >/dev/null 2>&1
uci commit ucitrack >/dev/null 2>&1
uci delete firewall.openclash >/dev/null 2>&1
uci set firewall.openclash=include >/dev/null 2>&1
uci set firewall.openclash.type=script >/dev/null 2>&1
uci set firewall.openclash.path=/var/etc/openclash.include >/dev/null 2>&1
uci set firewall.openclash.reload=1 >/dev/null 2>&1
fi
if [ "$(uci get firewall.@defaults[0].forward)" != "ACCEPT" ]; then
uci set firewall.@defaults[0].forward=ACCEPT >/dev/null 2>&1
uci commit firewall >/dev/null 2>&1
/etc/init.d/firewall reload >/dev/null 2>&1
fi
mkdir -p /var/etc
cat > "/var/etc/openclash.include" <<-EOF
/etc/init.d/openclash restart
EOF
#lan_ac
if [ "$operation_mode" = "redir-host" ] && [ "$en_mode" = "redir-host" ]; then
if [ "$lan_ac_mode" = "0" ] && [ ! -z "$(uci get openclash.config.lan_ac_black_ips 2>/dev/null)" ]; then
ipset create lan_ac_black_ips hash:net
config_load "openclash"
config_list_foreach "config" "lan_ac_black_ips" lan_ac "lan_ac_black_ips"
elif [ "$lan_ac_mode" = "1" ] && [ ! -z "$(uci get openclash.config.lan_ac_white_ips 2>/dev/null)" ]; then
ipset create lan_ac_white_ips hash:net
config_load "openclash"
config_list_foreach "config" "lan_ac_white_ips" lan_ac "lan_ac_white_ips"
fi
fi
if [ -z "$en_mode_tun" ]; then
#tcp
iptables -t nat -N openclash
iptables -t nat -A openclash -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1
iptables -t nat -A openclash -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1
iptables -t nat -A openclash -d 0.0.0.0/8 -j RETURN
iptables -t nat -A openclash -d 10.0.0.0/8 -j RETURN
iptables -t nat -A openclash -d 127.0.0.0/8 -j RETURN
iptables -t nat -A openclash -d 169.254.0.0/16 -j RETURN
iptables -t nat -A openclash -d 172.16.0.0/12 -j RETURN
iptables -t nat -A openclash -d 192.168.0.0/16 -j RETURN
iptables -t nat -A openclash -d 224.0.0.0/4 -j RETURN
iptables -t nat -A openclash -d 240.0.0.0/4 -j RETURN
if [ ! -z "$wan_ip4" ]; then
for wan_ip4s in $wan_ip4; do
iptables -t nat -A openclash -d "$wan_ip4s" -j RETURN 2>/dev/null
done
fi
iptables -t nat -A openclash -p tcp -j REDIRECT --to-ports "$proxy_port"
iptables -t nat -I PREROUTING -p tcp -d 8.8.8.8 -j REDIRECT --to-ports "$proxy_port"
iptables -t nat -I PREROUTING -p tcp -d 8.8.4.4 -j REDIRECT --to-ports "$proxy_port"
iptables -t nat -A PREROUTING -p tcp -j openclash
#udp
if [ "$enable_udp_proxy" -eq 1 ]; then
ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" pref 789
ip route add local default dev lo table "$PROXY_ROUTE_TABLE"
iptables -t mangle -N openclash
iptables -t mangle -A openclash -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1
iptables -t mangle -A openclash -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1
iptables -t mangle -A openclash -d 0.0.0.0/8 -j RETURN
iptables -t mangle -A openclash -d 10.0.0.0/8 -j RETURN
iptables -t mangle -A openclash -d 127.0.0.0/8 -j RETURN
iptables -t mangle -A openclash -d 169.254.0.0/16 -j RETURN
iptables -t mangle -A openclash -d 172.16.0.0/12 -j RETURN
iptables -t mangle -A openclash -d 192.168.0.0/16 -j RETURN
iptables -t mangle -A openclash -d 224.0.0.0/4 -j RETURN
iptables -t mangle -A openclash -d 240.0.0.0/4 -j RETURN
if [ ! -z "$wan_ip4" ]; then
for wan_ip4s in $wan_ip4; do
iptables -t mangle -A openclash -d "$wan_ip4s" -j RETURN 2>/dev/null
done
fi
iptables -t mangle -A openclash -p udp -j TPROXY --on-port "$proxy_port" --tproxy-mark "$PROXY_FWMARK"
iptables -t mangle -A PREROUTING -p udp -j openclash
fi
if [ "$en_mode" = "fake-ip" ]; then
iptables -t nat -A OUTPUT -p tcp -d 198.18.0.0/16 -j REDIRECT --to-ports "$proxy_port"
if [ "$enable_udp_proxy" -eq 1 ]; then
iptables -t mangle -A OUTPUT -p udp -d 198.18.0.0/16 -j MARK --set-mark "$PROXY_FWMARK"
fi
fi
if [ "$ipv6_enable" -eq 1 ]; then
#tcp
ip6tables -t nat -N openclash
if [ ! -z "$lan_ip6" ]; then
for lan_ip6s in $lan_ip6; do
ip6tables -t nat -A openclash -d "$lan_ip6s" -j RETURN 2>/dev/null
done
fi
ip6tables -t nat -A openclash -p tcp -j REDIRECT --to-ports "$proxy_port"
ip6tables -t nat -A PREROUTING -p tcp -j openclash
#udp
if [ "$enable_udp_proxy" -eq 1 ]; then
ip6tables -t mangle -N openclash
if [ ! -z "$lan_ip6" ]; then
for lan_ip6s in $lan_ip6; do
if [ "$enable_udp_proxy" -eq 1 ]; then
ip6tables -t mangle -A openclash -d "$lan_ip6s" -j RETURN 2>/dev/null
fi
done
fi
ip6tables -t mangle -A openclash -p udp -j TPROXY --on-port "$proxy_port" --tproxy-mark "$PROXY_FWMARK"
ip6tables -t mangle -A PREROUTING -p udp -j openclash
fi
fi
else
#TUN模式
ipset create localnetwork hash:net
ipset add localnetwork 127.0.0.0/8
ipset add localnetwork 10.0.0.0/8
ipset add localnetwork 169.254.0.0/16
ipset add localnetwork 192.168.0.0/16
ipset add localnetwork 224.0.0.0/4
ipset add localnetwork 240.0.0.0/4
ipset add localnetwork 172.16.0.0/12
if [ ! -z "$wan_ip4" ]; then
for wan_ip4s in $wan_ip4; do
ipset add localnetwork "$wan_ip4s" 2>/dev/null
done
fi
#启动TUN
if [ "$en_mode_tun" = "2" ]; then
ip tuntap add user root mode tun clash0
ip link set clash0 up
ip route replace default dev clash0 table "$PROXY_ROUTE_TABLE"
elif [ "$en_mode_tun" = "1" ]; then
TUN_WAIT=0
while ( [ ! -z "$(pidof clash)" ] && [ -z "$(ip route list |grep utun)" ] && [ "$TUN_WAIT" -le 3 ] )
do
TUN_WAIT=$(expr "$TUN_WAIT" + 1)
sleep 2
done
ip route replace default dev utun table "$PROXY_ROUTE_TABLE"
fi
ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" pref 789
#设置防火墙
iptables -t mangle -N openclash
iptables -t mangle -F openclash
iptables -t mangle -A openclash -m set --match-set localnetwork dst -j RETURN
if [ "$en_mode" = "fake-ip" ]; then
iptables -t mangle -A openclash -d 198.18.0.0/16 -j MARK --set-mark "$PROXY_FWMARK"
fi
iptables -t mangle -I OUTPUT -j openclash
iptables -t mangle -I PREROUTING -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1
iptables -t mangle -I PREROUTING -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1
iptables -t mangle -I PREROUTING -m set ! --match-set localnetwork dst -j MARK --set-mark "$PROXY_FWMARK"
iptables -t nat -I PREROUTING -p tcp --dport 53 -j ACCEPT
#ipv6
# if [ "$ipv6_enable" -eq 1 ]; then
# ip6tables -t mangle -I PREROUTING -j MARK --set-mark "$PROXY_FWMARK"
# fi
fi
set_firewall
echo "第九步: 重启 Dnsmasq 程序..." >$START_LOG
change_dns "$enable_redirect_dns" "$disable_masq_cache"
@ -1067,108 +1147,70 @@ fi
stop()
{
echo "OpenClash 开始关闭..." >$START_LOG
echo "第一步: 备份当前节点状态..." >$START_LOG
/usr/share/openclash/openclash_history_get.sh &
wait
echo "第二步: 删除 OpenClash 防火墙规则..." >$START_LOG
rm -rf /var/etc/openclash.include 2>/dev/null
#ipv4
#禁止多个实例
status=$(ps|grep -c /etc/init.d/openclash)
[ "$status" -gt "3" ] && exit 0
enable=$(uci get openclash.config.enable 2>/dev/null)
ip rule del fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" pref 789 >/dev/null 2>&1
ip route del local default dev lo table "$PROXY_ROUTE_TABLE" >/dev/null 2>&1
echo "OpenClash 开始关闭..." >$START_LOG
echo "第一步: 备份当前节点状态..." >$START_LOG
/usr/share/openclash/openclash_history_get.sh &
wait
iptables -t nat -D PREROUTING -p tcp --dport 53 -j ACCEPT >/dev/null 2>&1
echo "第二步: 删除 OpenClash 防火墙规则..." >$START_LOG
revert_firewall
iptables -t mangle -F openclash >/dev/null 2>&1
iptables -t mangle -D PREROUTING -p udp -j openclash >/dev/null 2>&1
iptables -t mangle -X openclash >/dev/null 2>&1
iptables -t nat -F openclash >/dev/null 2>&1
iptables -t nat -D PREROUTING -p tcp -j openclash >/dev/null 2>&1
iptables -t nat -X openclash >/dev/null 2>&1
ipset destroy lan_ac_white_ips >/dev/null 2>&1
ipset destroy lan_ac_black_ips >/dev/null 2>&1
out_lines=$(iptables -nvL OUTPUT -t mangle |sed 1,2d |sed -n '/198.18.0.0\/16/=' 2>/dev/null |sort -rn)
for out_line in $out_lines; do
iptables -t mangle -D OUTPUT "$out_line" >/dev/null 2>&1
done
out_lines=$(iptables -nvL OUTPUT -t nat |sed 1,2d |sed -n '/198.18.0.0\/16/=' 2>/dev/null |sort -rn)
for out_line in $out_lines; do
iptables -t nat -D OUTPUT "$out_line" >/dev/null 2>&1
done
pre_lines=$(iptables -nvL PREROUTING -t nat |sed 1,2d |sed -n '/8.8./=' 2>/dev/null |sort -rn)
for pre_line in $pre_lines; do
iptables -t nat -D PREROUTING "$pre_line" >/dev/null 2>&1
done
#ipv6
ip6tables -t mangle -F openclash >/dev/null 2>&1
ip6tables -t mangle -D PREROUTING -p udp -j openclash >/dev/null 2>&1
ip6tables -t mangle -X openclash >/dev/null 2>&1
ip6tables -t nat -F openclash >/dev/null 2>&1
ip6tables -t nat -D PREROUTING -p tcp -j openclash >/dev/null 2>&1
ip6tables -t nat -X openclash >/dev/null 2>&1
#TUN
ip link set dev clash0 down >/dev/null 2>&1
ip tuntap del clash0 mode tun >/dev/null 2>&1
ip route del default dev clash0 table "$PROXY_ROUTE_TABLE" >/dev/null 2>&1
ip route del default dev utun table "$PROXY_ROUTE_TABLE" >/dev/null 2>&1
ip rule del fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" pref 789 >/dev/null 2>&1
echo "第三步: 关闭 OpenClash 守护程序..." >$START_LOG
watchdog_pids=$(ps |grep openclash_watchdog.sh |grep -v grep |awk '{print $1}' 2>/dev/null)
for watchdog_pid in $watchdog_pids; do
kill -9 "$watchdog_pid" >/dev/null 2>&1
done
iptables -t mangle -D OUTPUT -j openclash >/dev/null 2>&1
iptables -t mangle -D PREROUTING -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1
iptables -t mangle -D PREROUTING -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1
iptables -t mangle -D PREROUTING -m set ! --match-set localnetwork dst -j MARK --set-mark "$PROXY_FWMARK" >/dev/null 2>&1
ip6tables -t mangle -D PREROUTING -j MARK --set-mark "$PROXY_FWMARK" >/dev/null 2>&1
iptables -t mangle -F openclash >/dev/null 2>&1
iptables -t mangle -X openclash >/dev/null 2>&1
ipset destroy localnetwork >/dev/null 2>&1
echo "第四步: 关闭 Clash 主程序..." >$START_LOG
if [ "$enable" -eq 0 ]; then
kill -9 "$(pidof clash|sed 's/$//g')" 2>/dev/null
fi
echo "第三步: 关闭 OpenClash 守护程序..." >$START_LOG
watchdog_pids=$(ps |grep openclash_watchdog.sh |grep -v grep |awk '{print $1}' 2>/dev/null)
for watchdog_pid in $watchdog_pids; do
kill -9 "$watchdog_pid" >/dev/null 2>&1
done
echo "第五步: 重启 Dnsmasq 程序..." >$START_LOG
dns_port=$(uci get openclash.config.dns_port 2>/dev/null)
redirect_dns=$(uci get openclash.config.redirect_dns 2>/dev/null)
masq_cache=$(uci get openclash.config.masq_cache 2>/dev/null)
revert_dns "$redirect_dns" "$masq_cache" "$dns_port"
/etc/init.d/dnsmasq restart >/dev/null 2>&1
echo "第四步: 关闭 Clash 主程序..." >$START_LOG
kill -9 "$(pidof clash|sed 's/$//g')" 2>/dev/null
echo "第六步:删除 OpenClash 残留文件..." >$START_LOG
if [ "$enable" -eq 0 ]; then
rm -rf $LOG_FILE 2>/dev/null
rm -rf /tmp/openclash_debug.log 2>/dev/null
rm -rf /www/luci-static/openclash 2>/dev/null
rm -rf /tmp/openclash_last_version 2>/dev/null
rm -rf /tmp/clash_last_version 2>/dev/null
rm -rf /tmp/Proxy_Group 2>/dev/null
rm -rf /tmp/rules_name 2>/dev/null
echo "OpenClash 关闭成功!" >$START_LOG
sleep 5
fi
echo "第五步: 重启 Dnsmasq 程序..." >$START_LOG
dns_port=$(uci get openclash.config.dns_port 2>/dev/null)
redirect_dns=$(uci get openclash.config.redirect_dns 2>/dev/null)
masq_cache=$(uci get openclash.config.masq_cache 2>/dev/null)
revert_dns "$redirect_dns" "$masq_cache" "$dns_port"
/etc/init.d/dnsmasq restart >/dev/null 2>&1
echo "第六步:删除 OpenClash 残留文件..." >$START_LOG
enable=$(uci get openclash.config.enable 2>/dev/null)
if [ "$enable" -eq 0 ]; then
rm -rf $LOG_FILE 2>/dev/null
rm -rf /www/luci-static/openclash 2>/dev/null
rm -rf /tmp/openclash_last_version 2>/dev/null
rm -rf /tmp/clash_last_version 2>/dev/null
rm -rf /tmp/Proxy_Group 2>/dev/null
rm -rf /tmp/rules_name 2>/dev/null
echo "OpenClash 关闭成功!" >$START_LOG
sleep 5
fi
rm -rf $START_LOG 2>/dev/null
del_cron
echo "OpenClash Already Stop"
rm -rf $START_LOG 2>/dev/null
del_cron
echo "OpenClash Already Stop"
}
restart()
{
stop
start
stop
start
}
reload()
{
revert_firewall 2>/dev/null
config_choose 2>/dev/null
do_run_mode 2>/dev/null
get_config 2>/dev/null
set_firewall 2>/dev/null
/usr/share/openclash/openclash_history_set.sh
echo "${LOGTIME} OpenClash Reload After Firewall Restart" >> $LOG_FILE
}

View File

@ -17,6 +17,10 @@ ina.ntp.org.cn
1.openwrt.pool.ntp.org
2.openwrt.pool.ntp.org
3.openwrt.pool.ntp.org
time1.cloud.tencent.com
time.ustc.edu.cn
pool.ntp.org
ntp.ubuntu.com
ntp.aliyun.com
ntp1.aliyun.com
ntp2.aliyun.com

View File

@ -4052,7 +4052,6 @@ Rule:
- DOMAIN-SUFFIX,iflyad.bj.openstorage.cn,AdBlock
- DOMAIN-SUFFIX,iframe.travel.yahoo.com,AdBlock
- DOMAIN-SUFFIX,ig.nukefans.net,AdBlock
- DOMAIN-SUFFIX,igexin.com,AdBlock
- DOMAIN-SUFFIX,igj5y.yongchanghengyuan.com,AdBlock
- DOMAIN-SUFFIX,ih.adscale.de,AdBlock
- DOMAIN-SUFFIX,ihualun.com,AdBlock
@ -6143,7 +6142,6 @@ Rule:
- DOMAIN-SUFFIX,pv.focus.cn,AdBlock
- DOMAIN-SUFFIX,pv.ra.icast.cn,AdBlock
- DOMAIN-SUFFIX,pv.sogou.com,AdBlock
- DOMAIN-SUFFIX,pv.sohu.com,AdBlock
- DOMAIN-SUFFIX,pv.xcar.com.cn,AdBlock
- DOMAIN-SUFFIX,pv.zdnet.com.cn,AdBlock
- DOMAIN-SUFFIX,pv.zol.com.cn,AdBlock
@ -8507,15 +8505,16 @@ Rule:
# > BBC iPlayer
# - USER-AGENT,BBCiPlayer*,GlobalTV
- DOMAIN-KEYWORD,bbcfmt,GlobalTV
- DOMAIN-SUFFIX,bbc.com,GlobalTV
- DOMAIN-SUFFIX,bbc.co,GlobalTV
- DOMAIN-SUFFIX,bbc.co.uk,GlobalTV
- DOMAIN-SUFFIX,bbci.co,GlobalTV
- DOMAIN-SUFFIX,bbci.co.uk,GlobalTV
- DOMAIN,aod-dash-uk-live.akamaized.net,GlobalTV
- DOMAIN,aod-hls-uk-live.akamaized.net,GlobalTV
- DOMAIN,vod-dash-uk-live.akamaized.net,GlobalTV
- DOMAIN,vod-thumb-uk-live.akamaized.net,GlobalTV
- DOMAIN,vod-dash-uk-live.bbcfmt.hs.llnwd.net,GlobalTV
- DOMAIN,vod-thumb-uk-live.bbcfmt.hs.llnwd.net,GlobalTV
- DOMAIN-SUFFIX,bbc.co,GlobalTV
- DOMAIN-SUFFIX,bbc.co.uk,GlobalTV
- DOMAIN-SUFFIX,bbc.com,GlobalTV
- DOMAIN-SUFFIX,bbcfmt.hs.llnwd.net,GlobalTV
- DOMAIN-SUFFIX,bbci.co,GlobalTV
- DOMAIN-SUFFIX,bbci.co.uk,GlobalTV
# > DAZN
- DOMAIN-SUFFIX,d151l6v8er5bdm.cloudfront.net,GlobalTV
@ -9590,16 +9589,51 @@ Rule:
- DOMAIN-SUFFIX,telegra.ph,Telegram
- DOMAIN-SUFFIX,telegram.me,Telegram
- DOMAIN-SUFFIX,telegram.org,Telegram
- IP-CIDR,91.108.4.0/22,Telegram
- IP-CIDR,91.108.56.0/22,Telegram
- IP-CIDR,109.239.140.0/24,Telegram
- IP-CIDR,149.154.167.99/32,Telegram
- IP-CIDR,149.154.175.10/32,Telegram
- IP-CIDR,149.154.167.40/32,Telegram
- IP-CIDR,149.154.167.42/32,Telegram
- IP-CIDR,149.154.175.117/32,Telegram
- IP-CIDR,149.154.175.50/32,Telegram
- IP-CIDR,149.154.167.50/32,Telegram
- IP-CIDR,149.154.167.51/32,Telegram
- IP-CIDR,149.154.175.100/32,Telegram
- IP-CIDR,149.154.167.91/32,Telegram
- IP-CIDR,149.154.167.90/32,Telegram
- IP-CIDR,149.154.165.120/32,Telegram
- IP-CIDR,149.154.166.120/32,Telegram
- IP-CIDR,149.154.164.250/32,Telegram
- IP-CIDR,149.154.167.117/32,Telegram
- IP-CIDR,149.154.167.118/32,Telegram
- IP-CIDR,149.154.167.192/27,Telegram
- IP-CIDR,149.154.164.8/29 ,Telegram
- IP-CIDR,91.108.8.0/27,Telegram
- IP-CIDR,91.108.12.0/27,Telegram
- IP-CIDR,91.108.16.0/27,Telegram
- IP-CIDR,91.108.56.0/24,Telegram
- IP-CIDR,91.108.4.0/24,Telegram
- IP-CIDR,149.154.160.0/22,Telegram
- IP-CIDR,149.154.164.0/22,Telegram
- IP-CIDR,149.154.168.0/22,Telegram
- IP-CIDR,149.154.172.0/22,Telegram
- IP-CIDR6,2001:67c:4e8::/48,Telegram
- IP-CIDR,91.108.56.0/22,Telegram
- IP-CIDR,91.108.4.0/22,Telegram
- IP-CIDR,91.108.8.0/22,Telegram
- IP-CIDR,91.108.16.0/22,Telegram
- IP-CIDR,91.108.12.0/22,Telegram
- IP-CIDR,149.154.160.0/20,Telegram
- IP-CIDR6,2001:b28:f23d:f001::e/128,Telegram
- IP-CIDR6,2001:67c:4e8:f002::e/128,Telegram
- IP-CIDR6,2001:b28:f23d:f003::e/128,Telegram
- IP-CIDR6,2001:b28:f23d:f001::a/128,Telegram
- IP-CIDR6,2001:67c:4e8:f002::a/128,Telegram
- IP-CIDR6,2001:b28:f23d:f003::a/128,Telegram
- IP-CIDR6,2001:67c:4e8:f004::a/128,Telegram
- IP-CIDR6,2001:b28:f23f:f005::a/128,Telegram
- IP-CIDR6,2001:67c:4e8:fa60::/64,Telegram
- IP-CIDR6,2001:b28:f23d::/48,Telegram
- IP-CIDR6,2001:b28:f23f::/48,Telegram
- IP-CIDR6,2001:67c:4e8::/48,Telegram

File diff suppressed because one or more lines are too long

View File

@ -32,7 +32,7 @@ function index()
entry({"admin", "services", "openclash", "groups-config"},cbi("openclash/groups-config"), nil).leaf = true
entry({"admin", "services", "openclash", "proxy-provider-config"},cbi("openclash/proxy-provider-config"), nil).leaf = true
entry({"admin", "services", "openclash", "config"},form("openclash/config"),_("Config Manage"), 70).leaf = true
entry({"admin", "services", "openclash", "log"},form("openclash/log"),_("Logs"), 80).leaf = true
entry({"admin", "services", "openclash", "log"},form("openclash/log"),_("Server Logs"), 80).leaf = true
end
local fs = require "luci.openclash"
@ -81,6 +81,13 @@ local function daip()
return daip
end
local function uh_port()
local uh_port = luci.sys.exec("uci get uhttpd.main.listen_http |awk -F ':' '{print $NF}'")
if uh_port ~= "80" then
return ":" .. uh_port
end
end
local function dase()
return luci.sys.exec("uci get openclash.config.dashboard_password 2>/dev/null")
end
@ -99,7 +106,7 @@ local function startlog()
end
local function coremodel()
local coremodel = luci.sys.exec("cat /proc/cpuinfo |grep 'cpu model' 2>/dev/null |awk -F ': ' '{print $2}' 2>/dev/null")
local coremodel = luci.sys.exec("cat /usr/lib/os-release 2>/dev/null |grep OPENWRT_ARCH 2>/dev/null |awk -F '\"' '{print $2}' 2>/dev/null")
local coremodel2 = luci.sys.exec("opkg status libc 2>/dev/null |grep 'Architecture' |awk -F ': ' '{print $2}' 2>/dev/null")
if not coremodel or coremodel == "" then
return coremodel2 .. "," .. coremodel2
@ -212,6 +219,7 @@ function action_status()
watchdog = is_watchdog(),
daip = daip(),
dase = dase(),
uh_port = uh_port(),
web = is_web(),
cn_port = cn_port(),
mode = mode();

View File

@ -2,11 +2,8 @@
local NXFS = require "nixio.fs"
local SYS = require "luci.sys"
local HTTP = require "luci.http"
local DISP = require "luci.dispatcher"
local UTIL = require "luci.util"
m = Map("openclash", translate("Server logs"))
m = Map("openclash", translate("Server Logs"))
s = m:section(TypedSection, "openclash")
m.pageaction = false
s.anonymous = true

View File

@ -34,6 +34,7 @@ s:tab("dashboard", translate("Dashboard Settings"))
s:tab("rules_update", translate("Rules Update"))
s:tab("geo_update", translate("GEOIP Update"))
s:tab("version_update", translate("Version Update"))
s:tab("debug", translate("Debug Logs"))
---- Operation Mode
o = s:taboption("op_mode", ListValue, "operation_mode", font_red..bold_on..translate("Select Operation Mode")..bold_off..font_off)
@ -62,7 +63,7 @@ o:depends("en_mode", "redir-host")
o:depends("en_mode", "fake-ip")
o:value("0", translate("Disable"))
o:value("1", translate("Enable"))
o.default = "0"
o.default = "1"
o = s:taboption("op_mode", ListValue, "proxy_mode", font_red..bold_on..translate("Proxy Mode")..bold_off..font_off)
o.description = translate("Select Proxy Mode")
@ -450,6 +451,24 @@ o.description = translate("Set Dashboard Secret")
core_update = s:taboption("version_update", DummyValue, "", nil)
core_update.template = "openclash/update"
---- debug
debug_log = s:taboption("debug", Value, "debug_log")
debug_log.template = "cbi/tvalue"
debug_log.readonly=true
debug_log.rows = 30
debug_log.wrap = "off"
function debug_log.cfgvalue(self, section)
return NXFS.readfile("/tmp/openclash_debug.log") or ""
end
o = s:taboption("debug", Button, translate("Generate Logs"))
o.title = translate("Generate Logs")
o.inputtitle = translate("Click to Generate")
o.inputstyle = "reload"
o.write = function()
SYS.call("/usr/share/openclash/openclash_debug.sh")
end
-- [[ Edit Server ]] --
s = m:section(TypedSection, "dns_servers", translate("Add Custom DNS Servers")..translate("(Take Effect After Choose Above)"))
s.anonymous = true

View File

@ -44,41 +44,7 @@
var dase = document.getElementById('_dase');
var dapo = document.getElementById('_dapo');
var clashversion = document.getElementById('_clashversion');
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "status")%>', null, function(x, status) {
if ( x && x.status == 200 ) {
clash.innerHTML = status.clash ? '<b><font color=green><%:RUNNING%></font></b>' : '<b><font color=red><%:NOT RUNNING%></font></b>';
if ( status.mode == "fake-ip\n" )
{
mode.innerHTML = status.clash ? "<b><font color=green><%: Fake-IP增强模式 %></font></b>" : '<b><font color=red><%:NOT RUNNING%></font></b>';
}
else if ( status.mode == "redir-host\n" )
{
mode.innerHTML = status.clash ? "<b><font color=green><%: Redir-Host兼容模式 %></font></b>" : '<b><font color=red><%:NOT RUNNING%></font></b>';
}
else if ( status.mode == "redir-host-tun\n" )
{
mode.innerHTML = status.clash ? "<b><font color=green><%: Redir-HostTUN模式 %></font></b>" : '<b><font color=red><%:NOT RUNNING%></font></b>';
}
else if ( status.mode == "fake-ip-tun\n" )
{
mode.innerHTML = status.clash ? "<b><font color=green><%: Fake-IPTUN模式 %></font></b>" : '<b><font color=red><%:NOT RUNNING%></font></b>';
}
else if ( status.mode == "redir-host-vpn\n" )
{
mode.innerHTML = status.clash ? "<b><font color=green><%: Redir-Host游戏模式 %></font></b>" : '<b><font color=red><%:NOT RUNNING%></font></b>';
}
else if ( status.mode == "fake-ip-vpn\n" )
{
mode.innerHTML = status.clash ? "<b><font color=green><%: Fake-IP游戏模式 %></font></b>" : '<b><font color=red><%:NOT RUNNING%></font></b>';
}
watchdog.innerHTML = status.watchdog ? '<b><font color=green><%:RUNNING%></font> </b>' : '<b><font color=red><%:NOT RUNNING%></font></b>';
daip.innerHTML = status.daip ? "<b><font color=green>"+status.daip+"</font></b>" : "<b><font color=red>"+"<%:Not Set%>"+"</font></b>";
dase.innerHTML = status.dase ? "<b><font color=green>"+status.dase+"</font></b>" : "<b><font color=red>"+"<%:Not Set%>"+"</font></b>";
dapo.innerHTML = status.cn_port ? "<b><font color=green>"+status.cn_port+"</font></b>" : "<b><font color=red>"+"<%:Not Set%>"+"</font></b>";
web.innerHTML = status.web ? '<input type="button" class="cbi-button cbi-button-reload" value="<%:打开控制面板%>" onclick="return ycad_dashboard(this)"/>' : '<b><font color=red><%:NOT RUNNING%></font></b>';
webo.innerHTML = status.web ? '<input type="button" class="cbi-button cbi-button-reload" value="<%:打开控制面板%>" onclick="return net_dashboard(this)"/>' : '<b><font color=red><%:NOT RUNNING%></font></b>';
}
});
XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "status")%>', null, function(x, status) {
if ( x && x.status == 200 ) {
clash.innerHTML = status.clash ? '<b><font color=green><%:RUNNING%></font></b>' : '<b><font color=red><%:NOT RUNNING%></font></b>';
@ -115,13 +81,21 @@
}
});
function winOpen(url)
{
var winOpen = window.open(url);
if(winOpen == null || typeof(winOpen) == 'undefined'){
window.location.href=url;
}
}
function ycad_dashboard(btn)
{
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "status")%>', status.cn_port, function(x, status) {
btn.disabled = true;
btn.value = '<%:打开控制面板%>';
url1='<%="http://'+window.location.hostname+'/luci-static/openclash?hostname='+ status.daip + '&port=' + status.cn_port + '&secret=' + status.dase +'"%>';
window.open(url1);
url1='<%="http://'+window.location.hostname+status.uh_port+'/luci-static/openclash?hostname='+ status.daip + '&port=' + status.cn_port + '&secret=' + status.dase +'"%>';
winOpen(url1);
return false;
});
}
@ -131,7 +105,7 @@
btn.disabled = true;
btn.value = '<%:打开控制面板%>';
url2='http://'+window.location.hostname+':'+status.cn_port+'/ui';
window.open(url2);
winOpen(url2);
return false;
});
}
@ -139,25 +113,25 @@
function homepage()
{
url3='https://github.com/vernesong/OpenClash';
window.open(url3);
winOpen(url3);
}
function wikipage()
{
url5='https://github.com/vernesong/OpenClash/wiki';
window.open(url5);
winOpen(url5);
}
function telegrampage()
{
url6='https://t.me/joinchat/D4mVX0n-n5mOK6YO_W3_Og';
window.open(url6);
winOpen(url6);
}
function sponsorpage()
{
url7='https://ko-fi.com/vernesong';
window.open(url7);
winOpen(url7);
}
@ -197,7 +171,7 @@
function go_update()
{
url4='https://github.com/vernesong/OpenClash/releases';
window.open(url4);
winOpen(url4);
}
var startlog = document.getElementById('_clashstart');

View File

@ -7,7 +7,7 @@
</p>
</td></tr>
<tr><td width="25%"> 已选择编译版本 </td><td width="25%" align="left" id="CORE_VERSION"><%:Collecting data...%></td><td width="25%"> 上次检查更新时间 </td><td width="25%" align="left" id="CHECKTIME"><%:Collecting data...%></td></tr>
<tr><td width="25%"> 处理器架构(PROC </td><td width="25%" align="left" id="CPU_MODEL"><%:Collecting data...%></td><td width="25%"> 处理器架构OPKG </td><td width="25%" align="left" id="CPU_MODEL2"><%:Collecting data...%></td></tr>
<tr><td width="25%"> 处理器架构(OS </td><td width="25%" align="left" id="CPU_MODEL"><%:Collecting data...%></td><td width="25%"> 处理器架构OPKG </td><td width="25%" align="left" id="CPU_MODEL2"><%:Collecting data...%></td></tr>
<tr><td width="100%" colspan="4">
<p align="center">
<b> 内核路径:/etc/openclash/core/clash </b>
@ -43,7 +43,7 @@
</table>
</fieldset>
<fieldset class="cbi-section">
<table>
<table width="100%">
<tr><td width="100%" colspan="4" align="center" id="restore"><%:Collecting data...%></td></tr>
</table>
</fieldset>
@ -71,99 +71,6 @@
var ma_core_game_up = document.getElementById('ma_core_game_up');
var ma_op_up = document.getElementById('ma_op_up');
var restore = document.getElementById('restore');
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update")%>', null, function(x, status) {
if ( x && x.status == 200 ) {
var cpu_models = status.coremodel;
var arr_model = cpu_models.split(",");
var cpu_model1 = arr_model[0];
var cpu_model22 = arr_model[1];
cpu_model.innerHTML = cpu_model1 ? "<b><font color=green>"+cpu_model1+"</font></b>" : "<b><font color=red><%:Model Not Found%></font></b>";
cpu_model2.innerHTML = cpu_model22 ? "<b><font color=green>"+cpu_model22+"</font></b>" : "<b><font color=red><%:Model Not Found%></font></b>";
if ( status.corever != "0\n" && status.corever != "" ) {
core_version.innerHTML = "<b><font color=green>"+status.corever+"</font></b>";
}
else {
core_version.innerHTML = "<b><font color=red><%:未选择编译版本,请到常规设置标签中配置%></font></b>";
}
if ( status.upchecktime != "1" ) {
checktime.innerHTML = "<b><font color=green>"+status.upchecktime+"</font></b>";
}
else {
checktime.innerHTML = "<b><font color=red><%:查询更新失败%></font></b>";
}
if ( status.corecv == "0" ) {
core_cv.innerHTML = "<b><font color=red><%:File Not Exist%></font></b>";
}
else if (status.corecv != "") {
core_cv.innerHTML = "<b><font color=green>"+status.corecv+"</font></b>";
}
else {
core_cv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
}
if ( status.coretuncv == "0" ) {
core_tun_cv.innerHTML = "<b><font color=red><%:File Not Exist%></font></b>";
}
else if (status.coretuncv != "") {
core_tun_cv.innerHTML = "<b><font color=green>"+status.coretuncv+"</font></b>";
}
else {
core_tun_cv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
}
if ( status.coregamecv == "0" ) {
core_game_cv.innerHTML = "<b><font color=red><%:File Not Exist%></font></b>";
}
else if (status.coregamecv != "") {
core_game_cv.innerHTML = "<b><font color=green>"+status.coregamecv+"</font></b>";
}
else {
core_game_cv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
}
var corelv = status.corelv;
var arr_core = corelv.split(",");
var corelvis = arr_core[0];
var coretunlvis = arr_core[1];
var coregamelvis = arr_core[2];
var new_ch = arr_core[3];
if ( new_ch == "2" || new_ch == "4" ) {
core_lv.innerHTML = "<b><font color=green>"+corelvis+"<%:<New>%></font></b>";
}
else if (corelvis != "" && corelvis != "\n" ) {
core_lv.innerHTML = "<b><font color=green>"+corelvis+"</font></b>";
}
else {
core_lv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
}
if ( new_ch == "3" || new_ch == "4" ) {
core_tun_lv.innerHTML = "<b><font color=green>"+coretunlvis+"<%:<New>%></font></b>";
}
else if (coretunlvis != "" && coretunlvis != "\n" ) {
core_tun_lv.innerHTML = "<b><font color=green>"+coretunlvis+"</font></b>";
}
else {
core_tun_lv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
}
if (coregamelvis != "" && coregamelvis != "\n" ) {
core_game_lv.innerHTML = "<b><font color=green>"+coregamelvis+"</font></b>";
}
else {
core_game_lv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
}
var oplv = status.oplv;
var arr_op = oplv.split(",");
var oplvis = arr_op[0];
var new_op = arr_op[1];
op_cv.innerHTML = status.opcv ? "<b><font color=green>"+status.opcv+"</font></b>" : "<b><font color=red><%:Unknown%></font></b>";
if ( new_op == "2" ) {
op_lv.innerHTML = "<b><font color=green>"+oplvis+"<%:<New>%></font></b>";
}
else if (oplvis != "" && oplvis != "\n") {
op_lv.innerHTML = "<b><font color=green>"+oplvis+"</font></b>";
}
else {
op_lv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
}
}
});
XHR.poll(6, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "update")%>', null, function(x, status) {
if ( x && x.status == 200 ) {
@ -269,6 +176,14 @@
ma_op_up.innerHTML = '<input type="button" class="cbi-button cbi-button-reload" value="<%:下载到本地%>" onclick="return ma_op_update(this)"/>';
restore.innerHTML = '<input type="button" class="cbi-button cbi-button-reset" value="<%:还原默认配置%>" onclick="return restore_config(this)"/>';
function winOpen(url)
{
var winOpen = window.open(url);
if(winOpen == null || typeof(winOpen) == 'undefined'){
window.location.href=url;
}
}
function core_update(btn)
{
@ -320,7 +235,7 @@
if ( x && x.status == 200 ) {
if ( status.corever != "0\n" ) {
url1='https://github.com/vernesong/OpenClash/releases/download/Clash/clash-'+status.corever+'.tar.gz';
window.open(url1);
winOpen(url1);
}
else {
alert('未选择编译版本,请到常规设置标签中配置!')
@ -341,7 +256,7 @@
var coretunlvis = arr_core[1];
if ( status.corever != "0\n" && coretunlvis != "\n" && coretunlvis != "" ) {
url3='https://github.com/Dreamacro/clash/releases/download/TUN/clash-'+status.corever+'-'+coretunlvis+'.gz';
window.open(url3);
winOpen(url3);
}
else if ( status.corever == "0\n" ) {
alert('未选择编译版本,请到常规设置标签中配置!')
@ -362,7 +277,7 @@
if ( x && x.status == 200 ) {
if ( status.corever != "0\n" ) {
url4='https://github.com/vernesong/OpenClash/releases/download/TUN/clash-'+status.corever+'.tar.gz';
window.open(url4);
winOpen(url4);
}
else {
alert('未选择编译版本,请到常规设置标签中配置!')
@ -382,7 +297,7 @@
var oplvis = oplv.substring(oplv.indexOf("v") + 1,oplv.indexOf(","));
if ( oplvis != "" && oplvis != "\n" ) {
url2='https://github.com/vernesong/OpenClash/releases/download/v'+oplvis+'/luci-app-openclash_'+oplvis+'_all.ipk';
window.open(url2);
winOpen(url2);
}
else {
alert('最新版本获取失败,请稍后再试!')

View File

@ -1 +1 @@
<!doctype html><html lang="en" dir="ltr"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><link rel="icon" type="image/x-icon" href="https://cdn.jsdelivr.net/gh/Dreamacro/clash/docs/logo.png"/><title>Clash</title><link href="main.587bc7edc5f3d06c94f4.css" rel="stylesheet"></head><body><div id="root"></div><script src="js/1.bundle.587bc7edc5f3d06c94f4.min.js"></script><script src="js/bundle.587bc7edc5f3d06c94f4.min.js"></script></body></html>
<!doctype html><html lang="en" dir="ltr"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><link rel="icon" type="image/x-icon" href="https://cdn.jsdelivr.net/gh/Dreamacro/clash/docs/logo.png"/><title>Clash</title><link href="main.ccbf66abd21c384a0bf9.css" rel="stylesheet"></head><body><div id="root"></div><script src="js/1.bundle.ccbf66abd21c384a0bf9.min.js"></script><script src="js/bundle.ccbf66abd21c384a0bf9.min.js"></script></body></html>

View File

@ -199,9 +199,9 @@ sub_info_get()
if [ "$?" -eq "0" ] && [ -s "$CFG_FILE" ]; then
config_encode
grep "^ \{0,\}Proxy Group:" "$CFG_FILE" >/dev/null 2>&1 && grep "^ \{0,\}Rule:" "$CFG_FILE" >/dev/null 2>&1
if [ "$?" -eq "0" ]; then
if [ "$?" -eq 0 ]; then
grep "^ \{0,\}Proxy:" "$CFG_FILE" >/dev/null 2>&1 || grep "^ \{0,\}proxy-provider:" "$CFG_FILE" >/dev/null 2>&1
if [ "$?" -eq "0" ]; then
if [ "$?" -eq 0 ]; then
config_su_check
else
config_download_direct

View File

@ -98,7 +98,7 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then
rm -rf /tmp/clash.tar.gz >/dev/null 2>&1
rm -rf /tmp/clash.gz >/dev/null 2>&1
mkdir -p /etc/openclash/core
[ "$if_restart" -eq 1 ] && /etc/init.d/openclash stop
[ "$if_restart" -eq 1 ] && kill -9 "$(pidof clash|sed 's/$//g')" 2>/dev/null && /etc/init.d/openclash stop
echo "【"$CORE_TYPE"】版本内核下载成功,开始更新..." >$START_LOG
case $CORE_TYPE in
"Tun")

View File

@ -0,0 +1,315 @@
#!/bin/bash
. /lib/functions.sh
status=$(ps|grep -c /usr/share/openclash/openclash_debug.sh)
[ "$status" -gt "3" ] && exit 0
DEBUG_LOG="/tmp/openclash_debug.log"
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
enable_custom_dns=$(uci get openclash.config.enable_custom_dns 2>/dev/null)
rule_source=$(uci get openclash.config.rule_source 2>/dev/null)
enable_custom_clash_rules=$(uci get openclash.config.enable_custom_clash_rules 2>/dev/null)
ipv6_enable=$(uci get openclash.config.ipv6_enable 2>/dev/null)
enable_redirect_dns=$(uci get openclash.config.enable_redirect_dns 2>/dev/null)
direct_dns=$(uci get openclash.config.direct_dns 2>/dev/null)
disable_masq_cache=$(uci get openclash.config.disable_masq_cache 2>/dev/null)
proxy_mode=$(uci get openclash.config.proxy_mode 2>/dev/null)
intranet_allowed=$(uci get openclash.config.intranet_allowed 2>/dev/null)
enable_udp_proxy=$(uci get openclash.config.enable_udp_proxy 2>/dev/null)
enable_rule_proxy=$(uci get openclash.config.enable_rule_proxy 2>/dev/null)
en_mode=$(uci get openclash.config.en_mode 2>/dev/null)
CONFIG_FILE=$(uci get openclash.config.config_path 2>/dev/null)
core_type=$(uci get openclash.config.core_version 2>/dev/null)
cpu_model=$(opkg status libc 2>/dev/null |grep 'Architecture' |awk -F ': ' '{print $2}' 2>/dev/null)
core_version=$(/etc/openclash/core/clash -v 2>/dev/null |awk -F ' ' '{print $2}' 2>/dev/null)
core_tun_version=$(/etc/openclash/core/clash_tun -v 2>/dev/null |awk -F ' ' '{print $2}' 2>/dev/null)
core_game_version=$(/etc/openclash/core/clash_game -v 2>/dev/null |awk -F ' ' '{print $2}' 2>/dev/null)
servers_update=$(uci get openclash.config.servers_update 2>/dev/null)
op_version=$(sed -n 1p /etc/openclash/openclash_version 2>/dev/null)
if [ -z "$CONFIG_FILE" ] || [ ! -f "$CONFIG_FILE" ]; then
CONFIG_NAME=$(ls -lt /etc/openclash/config/ | grep -E '.yaml|.yml' | head -n 1 |awk '{print $9}')
if [ ! -z "$CONFIG_NAME" ]; then
CONFIG_FILE="/etc/openclash/config/$CONFIG_NAME"
fi
fi
ts_cf()
{
if [ "$1" != 1 ]; then
echo "停用"
else
echo "启用"
fi
}
ts_re()
{
if [ -z "$1" ]; then
echo "未安装"
else
echo "已安装"
fi
}
echo "OpenClash 调试日志" > "$DEBUG_LOG"
cat >> "$DEBUG_LOG" <<-EOF
生成时间: $LOGTIME
插件版本: $op_version
EOF
cat >> "$DEBUG_LOG" <<-EOF
#===================== 系统信息 =====================#
主机型号: $(cat /tmp/sysinfo/model 2>/dev/null)
固件版本: $(cat /usr/lib/os-release 2>/dev/null |grep OPENWRT_RELEASE 2>/dev/null |awk -F '"' '{print $2}' 2>/dev/null)
LuCI版本: $(opkg status luci 2>/dev/null |grep 'Version' |awk -F ': ' '{print $2}' 2>/dev/null)
内核版本: $(uname -r 2>/dev/null)
处理器架构: $cpu_model
#此项在使用Tun模式时应为ACCEPT
防火墙转发: $(uci get firewall.@defaults[0].forward 2>/dev/null)
#此项有值时建议到网络-接口-lan的设置中禁用IPV6的DHCP
IPV6-DHCP: $(uci get dhcp.lan.dhcpv6 2>/dev/null)
#此项结果应仅有配置文件的DNS监听地址
Dnsmasq转发设置: $(uci get dhcp.@dnsmasq[0].server 2>/dev/null)
EOF
cat >> "$DEBUG_LOG" <<-EOF
#===================== 依赖检查 =====================#
dnsmasq-full: $(ts_re "$(opkg status dnsmasq-full 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
coreutils: $(ts_re "$(opkg status coreutils 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
coreutils-nohup: $(ts_re "$(opkg status coreutils-nohup 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
bash: $(ts_re "$(opkg status bash 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
curl: $(ts_re "$(opkg status curl 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
jsonfilter: $(ts_re "$(opkg status jsonfilter 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
ca-certificates: $(ts_re "$(opkg status ca-certificates 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
ipset: $(ts_re "$(opkg status ipset 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
ip-full: $(ts_re "$(opkg status ip-full 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
iptables-mod-tproxy: $(ts_re "$(opkg status iptables-mod-tproxy 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
kmod-tun(TUN模式): $(ts_re "$(opkg status kmod-tun 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
luci-compat(Luci-19.07): $(ts_re "$(opkg status luci-compat 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)")
EOF
#core
cat >> "$DEBUG_LOG" <<-EOF
#===================== 内核检查 =====================#
EOF
if pidof clash >/dev/null; then
cat >> "$DEBUG_LOG" <<-EOF
运行状态: 运行中
EOF
else
cat >> "$DEBUG_LOG" <<-EOF
运行状态: 未运行
EOF
fi
cat >> "$DEBUG_LOG" <<-EOF
已选择的架构: $core_type
#下方无法显示内核版本号时请确认您的内核版本是否正确或者有无权限
EOF
cat >> "$DEBUG_LOG" <<-EOF
Tun内核版本: $core_tun_version
EOF
if [ ! -f "/etc/openclash/core/clash_tun" ]; then
cat >> "$DEBUG_LOG" <<-EOF
Tun内核文件: 不存在
EOF
else
cat >> "$DEBUG_LOG" <<-EOF
Tun内核文件: 存在
EOF
fi
if [ ! -x "/etc/openclash/core/clash_tun" ]; then
cat >> "$DEBUG_LOG" <<-EOF
Tun内核运行权限: 否
EOF
else
cat >> "$DEBUG_LOG" <<-EOF
Tun内核运行权限: 正常
EOF
fi
cat >> "$DEBUG_LOG" <<-EOF
Game内核版本: $core_game_version
EOF
if [ ! -f "/etc/openclash/core/clash_game" ]; then
cat >> "$DEBUG_LOG" <<-EOF
Game内核文件: 不存在
EOF
else
cat >> "$DEBUG_LOG" <<-EOF
Game内核文件: 存在
EOF
fi
if [ ! -x "/etc/openclash/core/clash_game" ]; then
cat >> "$DEBUG_LOG" <<-EOF
Game内核运行权限: 否
EOF
else
cat >> "$DEBUG_LOG" <<-EOF
Game内核运行权限: 正常
EOF
fi
cat >> "$DEBUG_LOG" <<-EOF
Dev内核版本: $core_version
EOF
if [ ! -f "/etc/openclash/core/clash" ]; then
cat >> "$DEBUG_LOG" <<-EOF
Dev内核文件: 不存在
EOF
else
cat >> "$DEBUG_LOG" <<-EOF
Dev内核文件: 存在
EOF
fi
if [ ! -x "/etc/openclash/core/clash" ]; then
cat >> "$DEBUG_LOG" <<-EOF
Dev内核运行权限: 否
EOF
else
cat >> "$DEBUG_LOG" <<-EOF
Dev内核运行权限: 正常
EOF
fi
cat >> "$DEBUG_LOG" <<-EOF
#===================== 插件设置 =====================#
当前配置文件: $CONFIG_FILE
运行模式: $en_mode
默认代理模式: $proxy_mode
UDP流量转发: $(ts_cf "$enable_udp_proxy")
DNS劫持: $(ts_cf "$enable_redirect_dns")
自定义DNS: $(ts_cf "$enable_custom_dns")
IPV6-DNS解析: $(ts_cf "$ipv6_enable")
Real-IP-DNS地址: $direct_dns
禁用Dnsmasq缓存: $(ts_cf "$disable_masq_cache")
自定义规则: $(ts_cf "$enable_custom_clash_rules")
仅允许内网: $(ts_cf "$intranet_allowed")
仅代理命中规则流量: $(ts_cf "$enable_rule_proxy")
#启动异常时建议关闭此项后重试
保留配置: $(ts_cf "$servers_update")
EOF
if [ "$rule_source" != "0" ]; then
cat >> "$DEBUG_LOG" <<-EOF
#启动异常时建议关闭此项后重试
第三方规则: $rule_source
EOF
else
cat >> "$DEBUG_LOG" <<-EOF
第三方规则: 停用
EOF
fi
cat >> "$DEBUG_LOG" <<-EOF
#===================== 配置文件 =====================#
EOF
if [ -n "$(grep OpenClash-General-Settings "$CONFIG_FILE")" ]; then
sed '/OpenClash-General-Settings/,$d' "$CONFIG_FILE" >> "$DEBUG_LOG" 2>/dev/null
else
/usr/share/openclash/yml_field_name_ch.sh "$CONFIG_FILE" 2>/dev/null
proxy_len=$(sed -n '/^Proxy:/=' "$CONFIG_FILE" 2>/dev/null)
provider_len=$(sed -n '/^proxy-provider:/=' "$CONFIG_FILE" 2>/dev/null)
group_len=$(sed -n '/^Proxy Group:/=' "$CONFIG_FILE" 2>/dev/null)
dns_len=$(sed -n '/^dns:/=' "$CONFIG_FILE" 2>/dev/null)
rule_len=$(sed -n '/^Rule:/=' "$CONFIG_FILE" 2>/dev/null)
if [ "$dns_len" -ge "$proxy_len" ] || [ "$dns_len" -ge "$rule_len" ] || [ "$dns_len" -ge "$group_len" ]; then
echo "错误: 不支持的配置文件, General 设置部分应位于开头,请根据模板修改后重试!" >> "$DEBUG_LOG"
fi 2>/dev/null
if [ "$proxy_len" -ge "$rule_len" ] || [ "$provider_len" -ge "$rule_len" ]; then
echo "错误: 不支持的配置文件,服务器节点设置部分应位于规则之前,请根据模板修改后重试!" >> "$DEBUG_LOG"
fi 2>/dev/null
if [ "$group_len" -ge "$rule_len" ] || [ "$proxy_len" -ge "$group_len" ]; then
echo "错误: 不支持的配置文件,策略组设置部分应位于规则之前、节点之后,请根据模板修改后重试!" >> "$DEBUG_LOG"
fi 2>/dev/null
if [ "$proxy_len" -le "$provider_len" ]; then
sed '/^ \{0,\}Proxy:/,$d' "$CONFIG_FILE" >> "$DEBUG_LOG" 2>/dev/null
elif [ "$proxy_len" -ge "$provider_len" ]; then
sed '/^ \{0,\}proxy-provider:/,$d' "$CONFIG_FILE" >> "$DEBUG_LOG" 2>/dev/null
elif [ -n "$proxy_len" ] && [ -z "$provider_len" ]; then
sed '/^ \{0,\}Proxy:/,$d' "$CONFIG_FILE" >> "$DEBUG_LOG" 2>/dev/null
elif [ -z "$proxy_len" ] && [ -n "$provider_len" ]; then
sed '/^ \{0,\}proxy-provider:/,$d' "$CONFIG_FILE" >> "$DEBUG_LOG" 2>/dev/null
fi 2>/dev/null
fi
#firewall
cat >> "$DEBUG_LOG" <<-EOF
#===================== 防火墙设置 =====================#
#NAT chain
EOF
iptables -t nat -nL PREROUTING --line-number >> "$DEBUG_LOG"
iptables -t nat -nL OUTPUT --line-number >> "$DEBUG_LOG"
cat >> "$DEBUG_LOG" <<-EOF
#Mangle chain
EOF
iptables -t mangle -nL PREROUTING --line-number >> "$DEBUG_LOG"
iptables -t mangle -nL OUTPUT --line-number >> "$DEBUG_LOG"
cat >> "$DEBUG_LOG" <<-EOF
#===================== 路由表状态 =====================#
EOF
echo "#route -n" >> "$DEBUG_LOG"
route -n >> "$DEBUG_LOG" 2>/dev/null
echo "#ip route list" >> "$DEBUG_LOG"
ip route list >> "$DEBUG_LOG" 2>/dev/null
echo "#ip rule show" >> "$DEBUG_LOG"
ip rule show >> "$DEBUG_LOG" 2>/dev/null
if [ "$en_mode" != "fake-ip" ] && [ "$en_mode" != "redir-host" ]; then
cat >> "$DEBUG_LOG" <<-EOF
#===================== Tun设备状态 =====================#
EOF
ip tuntap list >> "$DEBUG_LOG" 2>/dev/null
fi
cat >> "$DEBUG_LOG" <<-EOF
#===================== 端口监听状态 =====================#
EOF
netstat -nlp |grep clash >> "$DEBUG_LOG" 2>/dev/null
cat >> "$DEBUG_LOG" <<-EOF
#===================== 测试本机网络连接 =====================#
EOF
curl -I -m 5 www.baidu.com >> "$DEBUG_LOG" 2>/dev/null
cat >> "$DEBUG_LOG" <<-EOF
#===================== 测试本机DNS查询 =====================#
EOF
nslookup www.baidu.com >> "$DEBUG_LOG" 2>/dev/null
cat >> "$DEBUG_LOG" <<-EOF
#===================== 最近运行日志 =====================#
EOF
tail -n 20 "/tmp/openclash.log" >> "$DEBUG_LOG" 2>/dev/null

View File

@ -8,8 +8,8 @@ SECRET=$(uci get openclash.config.dashboard_password 2>/dev/null)
LAN_IP=$(uci get network.lan.ipaddr 2>/dev/null |awk -F '/' '{print $1}' 2>/dev/null)
PORT=$(uci get openclash.config.cn_port 2>/dev/null)
curl --connect-timeout 5 --retry 2 -w %{http_code}"\n" -H "Authorization: Bearer ${SECRET}" -H "Content-Type:application/json" -X GET http://"$LAN_IP":"$PORT"/proxies > "$CURL_CACHE" 2>/dev/null
if [ "$(sed -n '$p' "$CURL_CACHE")" -eq "200" ]; then
curl -m 5 --retry 2 -w %{http_code}"\n" -H "Authorization: Bearer ${SECRET}" -H "Content-Type:application/json" -X GET http://"$LAN_IP":"$PORT"/proxies > "$CURL_CACHE" 2>/dev/null
if [ "$(sed -n '$p' "$CURL_CACHE" 2>/dev/null)" = "200" ]; then
cat "$CURL_CACHE" |jsonfilter -e '@["proxies"][@.type="Selector"]["name"]' > "$CURL_GROUP_CACHE" 2>/dev/null
cat "$CURL_CACHE" |jsonfilter -e '@["proxies"][@.type="Selector"]["now"]' > "$CURL_NOW_CACHE" 2>/dev/null
awk 'NR==FNR{a[i]=$0;i++}NR>FNR{print a[j]"#*#"$0;j++}' "$CURL_GROUP_CACHE" "$CURL_NOW_CACHE" > "$HISTORY_PATH" 2>/dev/null

View File

@ -15,17 +15,28 @@ urlencode() {
fi
}
GROUP_STATE() {
echo "$(curl -m 5 -w %{http_code}"\n" -H "Authorization: Bearer ${SECRET}" -H "Content-Type:application/json" -X GET http://"$LAN_IP":"$PORT"/proxies/"$1" 2>/dev/null |sed -n '$p' 2>/dev/null)"
}
if [ -s "$HISTORY_PATH" ]; then
cat $HISTORY_PATH |while read line
do
if [ -z "$(echo $line |grep "#*#")" ]; then
GROUP_NAME=$(echo $line |awk -F '#*#' '{print $1}')
if [ -z "$(echo $line |grep "#*#")" ] || [ -z "$(grep "^$GROUP_NAME$" /tmp/Proxy_Group)" ]; then
continue
else
GROUP_NAME=$(urlencode "$(echo $line |awk -F '#*#' '{print $1}')")
GROUP_NAME=$(urlencode "$GROUP_NAME")
NOW_NAME=$(echo $line |awk -F '#*#' '{print $3}')
[ ! -z "$GROUP_NAME" ] && {
curl -m 5 --retry 2 -H "Authorization: Bearer ${SECRET}" -H "Content-Type:application/json" -X PUT -d '{"name":"'"$NOW_NAME"'"}' http://"$LAN_IP":"$PORT"/proxies/"$GROUP_NAME" >/dev/null 2>&1
}
GROUP_STATE=$(GROUP_STATE "$GROUP_NAME")
GROUP_STATE_NUM=0
while ( [ ! -z "$(pidof clash)" ] && [ "$GROUP_STATE" != "200" ] && [ "$GROUP_STATE_NUM" -le 1 ] )
do
sleep 3
GROUP_STATE_NUM=$(expr "$GROUP_STATE_NUM" + 1)
GROUP_STATE=$(GROUP_STATE "$GROUP_NAME")
done
curl -m 5 --retry 2 -H "Authorization: Bearer ${SECRET}" -H "Content-Type:application/json" -X PUT -d '{"name":"'"$NOW_NAME"'"}' http://"$LAN_IP":"$PORT"/proxies/"$GROUP_NAME" >/dev/null 2>&1
fi
done >/dev/null 2>&1
fi

View File

@ -43,7 +43,7 @@
mv /tmp/rules.yaml /etc/openclash/"$RUlE_SOURCE".yaml >/dev/null 2>&1
sed -i '/^Rule:/a\##updated' /etc/openclash/"$RUlE_SOURCE".yaml >/dev/null 2>&1
echo "替换成功,重新加载 OpenClash 应用新规则..." >$START_LOG
/etc/init.d/openclash reload 2>/dev/null
/etc/init.d/openclash restart 2>/dev/null
echo "${LOGTIME} Other Rules 【$RUlE_SOURCE】 Update Successful" >>$LOG_FILE
else
echo "检测到下载的规则文件没有更新,停止继续操作..." >$START_LOG

View File

@ -31,6 +31,8 @@ LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
START_LOG="/tmp/openclash_start.log"
LOG_FILE="/tmp/openclash.log"
echo "正在卸载旧版本,更新过程请不要刷新页面和进行其他操作 ..." >$START_LOG
uci set openclash.config.enable=0
uci commit openclash
opkg remove luci-app-openclash
echo "正在安装新版本,更新过程请不要刷新页面和进行其他操作 ..." >$START_LOG
opkg install /tmp/openclash.ipk

View File

@ -64,7 +64,7 @@ fi
## 端口转发重启
last_line=$(iptables -t nat -nL PREROUTING --line-number |awk '{print $1}' 2>/dev/null |awk 'END {print}' |sed -n '$p')
op_line=$(iptables -t nat -nL PREROUTING --line-number |grep "openclash" 2>/dev/null |awk '{print $1}' 2>/dev/null |head -1)
if [ "$last_line" -ne "$op_line" ]; then
if [ "$last_line" != "$op_line" ] && [ -z "$core_type" ]; then
iptables -t nat -D PREROUTING -p tcp -j openclash
iptables -t nat -A PREROUTING -p tcp -j openclash
echo "$LOGTIME Watchdog: Reset Firewall For Enabling Redirect." >>$LOG_FILE

View File

@ -90,16 +90,29 @@
else
sed -i "/^dns:/i\external-controller: ${controller_address}:${5}" "$7"
fi
uci set openclash.config.config_reload=0
fi
if [ -z "$(grep '^secret: $4' "$7")" ]; then
if [ -z "$(grep '^secret: \"$4\"' "$7")" ]; then
if [ ! -z "$(grep "^ \{0,\}secret:" "$7")" ]; then
sed -i "/^ \{0,\}secret:/c\secret: \"${4}\"" "$7"
else
sed -i "/^dns:/i\secret: \"${4}\"" "$7"
fi
uci set openclash.config.config_reload=0
fi
if [ -z "$(grep "^ \{0,\}device-url:" "$7")" ] && [ "$15" -eq 2 ]; then
uci set openclash.config.config_reload=0
elif [ -z "$(grep "^ \{0,\}tun:" "$7")" ] && [ -n "$15" ]; then
uci set openclash.config.config_reload=0
elif [ -n "$(grep "^ \{0,\}tun:" "$7")" ] && [ -z "$15" ]; then
uci set openclash.config.config_reload=0
elif [ -n "$(grep "^ \{0,\}device-url:" "$7")" ] && [ "$15" -eq 1 ]; then
uci set openclash.config.config_reload=0
fi
uci commit openclash
sed -i '/^ \{0,\}tun:/,/^ \{0,\}enable:/d' "$7" 2>/dev/null
sed -i '/^ \{0,\}device-url:/d' "$7" 2>/dev/null
sed -i '/^ \{0,\}dns-listen:/d' "$7" 2>/dev/null

View File

@ -191,12 +191,14 @@ yml_servers_set()
echo "正在写入【$type】-【$name】节点到配置文件【$CONFIG_NAME】..." >$START_LOG
if [ "$obfs" != "none" ]; then
if [ "$obfs" != "none" ] && [ -n "$obfs" ]; then
if [ "$obfs" = "websocket" ]; then
obfss="plugin: v2ray-plugin"
else
obfss="plugin: obfs"
fi
else
obfss=""
fi
if [ "$obfs_vmess" = "websocket" ]; then

View File

@ -65,11 +65,17 @@ msgstr "文件不存在"
msgid "Not Set"
msgstr "未设置"
msgid "Server logs"
msgid "Server Logs"
msgstr "运行日志"
msgid "Logs"
msgstr "运行日志"
msgid "Debug Logs"
msgstr "调试日志"
msgid "Generate Logs"
msgstr "生成日志"
msgid "Click to Generate"
msgstr "点击生成"
msgid "Enable Clash"
msgstr "启动 OpenClash"

View File

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=v2ray-plugin
PKG_VERSION:=1.3.0
PKG_RELEASE:=2
PKG_BUILD_DIR:=$(BUILD_DIR)/v2ray-plugin-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/shadowsocks/v2ray-plugin/tar.gz/v$(PKG_VERSION)?
@ -26,19 +26,34 @@ PKG_USE_MIPS16:=0
GO_PKG:=github.com/shadowsocks/v2ray-plugin
GO_PKG_LDFLAGS:=-s -w
PKG_CONFIG_DEPENDS := CONFIG_$(PKG_NAME)_INCLUDE_GOPROXY
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/v2ray-plugin
define Package/$(PKG_NAME)/config
config $(PKG_NAME)_INCLUDE_GOPROXY
bool "Compiling with GOPROXY proxy"
default n
endef
ifeq ($(CONFIG_$(PKG_NAME)_INCLUDE_GOPROXY),y)
export GO111MODULE=on
export GOPROXY=https://goproxy.io
#export GOPROXY=https://mirrors.aliyun.com/goproxy/
endif
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
SUBMENU:=Project V
TITLE:=SIP003 plugin for shadowsocks, based on v2ray
URL:=https://github.com/shadowsocks/v2ray-plugin
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-certificates
endef
define Package/v2ray-plugin/description
define Package/$(PKG_NAME)/description
Yet another SIP003 plugin for shadowsocks, based on v2ray
endef
@ -51,9 +66,9 @@ define Build/Compile
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/v2ray-plugin
endef
define Package/v2ray-plugin/install
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/v2ray-plugin $(1)/usr/bin/v2ray-plugin
endef
$(eval $(call GoBinPackage,v2ray-plugin))
$(eval $(call BuildPackage,v2ray-plugin))
$(eval $(call GoBinPackage,$(PKG_NAME)))
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -44,6 +44,7 @@ endef
define Package/gdbserver
$(call Package/gdb/Default)
TITLE:=Remote server for GNU Debugger
DEPENDS=@!arc
endef
define Package/gdbserver/description

View File

@ -26,7 +26,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/perf
SECTION:=devel
CATEGORY:=Development
DEPENDS:= +libcap +libelf +libdw +PACKAGE_libunwind:libunwind +libpthread +librt +objdump @!IN_SDK @!TARGET_arc770 @KERNEL_PERF_EVENTS
DEPENDS:= +libelf +libdw +PACKAGE_libunwind:libunwind +libpthread +librt +objdump @!IN_SDK @!TARGET_arc770 @KERNEL_PERF_EVENTS
TITLE:=Linux performance monitoring tool
VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
URL:=http://www.kernel.org
@ -48,6 +48,7 @@ MAKE_FLAGS = \
NO_LIBAUDIT=1 \
NO_LIBCRYPTO=1 \
NO_LIBUNWIND=1 \
NO_LIBCAP=1 \
CROSS_COMPILE="$(TARGET_CROSS)" \
CC="$(TARGET_CC)" \
LD="$(TARGET_CROSS)ld" \

View File

@ -0,0 +1,677 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ath10k-ct-firmware
PKG_VERSION:=2020-04-24
PKG_RELEASE:=2
include $(INCLUDE_DIR)/package.mk
ATH10K_FIRMWARE_REV:=d622d160e9f552ead68d9ae81b715422892dc2ef
ATH10K_FIRMWARE_URL:=@GITHUB/kvalo/ath10k-firmware/$(ATH10K_FIRMWARE_REV)
QCA9887_BOARD_FILE:=ath10k-firmware-$(ATH10K_FIRMWARE_REV)-qca9887-board.bin
define Download/qca9887-board
FILE:=$(QCA9887_BOARD_FILE)
URL:=$(ATH10K_FIRMWARE_URL)/QCA9887/hw1.0
URL_FILE:=board.bin
HASH:=cf4df099f6ee05c181f55ce17297a1d32c61d725eb96246fd315ad5587c42426
endef
$(eval $(call Download,qca9887-board))
QCA988X_BOARD_FILE:=ath10k-firmware-$(ATH10K_FIRMWARE_REV)-qca988x-board.bin
define Download/qca988x-board
FILE:=$(QCA988X_BOARD_FILE)
URL:=$(ATH10K_FIRMWARE_URL)/QCA988X/hw2.0
URL_FILE:=board.bin
HASH:=5b5b380333c2dd3b6ce67f30e2f7008f4020bf594970d3b464fd8d4a80fcd880
endef
$(eval $(call Download,qca988x-board))
QCA99X0_BOARD_FILE:=ath10k-firmware-$(ATH10K_FIRMWARE_REV)-qca99x0-board.bin
define Download/qca99x0-board
FILE:=$(QCA99X0_BOARD_FILE)
URL:=$(ATH10K_FIRMWARE_URL)/QCA99X0/hw2.0
URL_FILE:=boardData_AR900B_CUS239_5G_v2_001.bin
HASH:=3bf7561ee373b369025dcd366d276d038a97d3397ccae41ce841d98a58b30aff
endef
$(eval $(call Download,qca99x0-board))
QCA99X0_BOARD2_REV:=ddcec9efd245da9365c474f513a855a55f3ac7fe
QCA99X0_BOARD2_FILE:=ath10k-firmware-$(QCA99X0_BOARD2_REV)-qca99x0-board-2.bin
define Download/qca99x0-board2
FILE:=$(QCA99X0_BOARD2_FILE)
URL:=https://source.codeaurora.org/quic/qsdk/oss/firmware/ath10k-firmware/plain/ath10k/QCA99X0/hw2.0
URL_FILE:=board-2.bin?id=$(QCA99X0_BOARD2_REV)
HASH:=03711ac21e60ef59d3815e235eb721c0c22851b5410299411085aa6f2af45401
endef
$(eval $(call Download,qca99x0-board2))
QCA9984_BOARD2_FILE:=ath10k-firmware-$(ATH10K_FIRMWARE_REV)-qca9984-board-2.bin
define Download/qca9984-board2
FILE:=$(QCA9984_BOARD2_FILE)
URL:=$(ATH10K_FIRMWARE_URL)/QCA9984/hw1.0
URL_FILE:=board-2.bin
HASH:=0d6d46cf0467185e3959ce3cb69e2415be6e48ab8a4bee3eb400edbe48cb9c25
endef
$(eval $(call Download,qca9984-board2))
QCA4019_BOARD2_FILE:=ath10k-firmware-$(ATH10K_FIRMWARE_REV)-qca4019-board-2.bin
define Download/qca4019-board2
FILE:=$(QCA4019_BOARD2_FILE)
URL:=$(ATH10K_FIRMWARE_URL)/QCA4019/hw1.0
URL_FILE:=board-2.bin
HASH:=94b66aa4ddbed5110a96364d3c7b4ebcb320e3ac4e8697660b277e76077bc338
endef
$(eval $(call Download,qca4019-board2))
QCA9888_BOARD2_FILE:=ath10k-firmware-$(ATH10K_FIRMWARE_REV)-qca9888-board-2.bin
define Download/qca9888-board2
FILE:=$(QCA9888_BOARD2_FILE)
URL:=$(ATH10K_FIRMWARE_URL)/QCA9888/hw2.0
URL_FILE:=board-2.bin
HASH:=5b871bb567f64525ca45adb88063211de472015d09e0f9aa3fa61ab71c8fdfd3
endef
$(eval $(call Download,qca9888-board2))
CT_FIRMWARE_FILE = $(1)-$($(1)_FIRMWARE_FILE_CT)
CT_FIRMWARE_FILE_FULL_HTT = $(1)-$($(1)_FIRMWARE_FILE_CT_FULL_HTT)
CT_FIRMWARE_FILE_HTT = $(1)-$($(1)_FIRMWARE_FILE_CT_HTT)
define Download/ct-firmware
URL:=https://www.candelatech.com/downloads/$(2)
FILE:=$(call CT_FIRMWARE_FILE,$(1))
URL_FILE:=$($(1)_FIRMWARE_FILE_CT)
endef
define Download/ct-firmware-full-htt
URL:=https://www.candelatech.com/downloads/$(2)
FILE:=$(call CT_FIRMWARE_FILE_FULL_HTT,$(1))
URL_FILE:=$($(1)_FIRMWARE_FILE_CT_FULL_HTT)
endef
define Download/ct-firmware-htt
URL:=https://www.candelatech.com/downloads/$(2)
FILE:=$(call CT_FIRMWARE_FILE_HTT,$(1))
URL_FILE:=$($(1)_FIRMWARE_FILE_CT_HTT)
endef
QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.018
define Download/ath10k-firmware-qca988x-ct
$(call Download/ct-firmware,QCA988X,)
HASH:=8b4c99253aa309d35f2e060c190091b8db1b84dbda06a6a15c83ac0f9a938126
endef
$(eval $(call Download,ath10k-firmware-qca988x-ct))
QCA988X_FIRMWARE_FILE_CT_FULL_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.018
define Download/ath10k-firmware-qca988x-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA988X,)
HASH:=a7168916d6aa5e4d7858f8b620c0c980c76d03f390929db6f4077685ce2051e7
endef
$(eval $(call Download,ath10k-firmware-qca988x-ct-full-htt))
QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.018
define Download/ath10k-firmware-qca9887-ct
$(call Download/ct-firmware,QCA9887,ath10k-9887)
HASH:=459692deb186a63ab8eeddb7ad5d54779266e68ca686e7c46062554db6dca12b
endef
$(eval $(call Download,ath10k-firmware-qca9887-ct))
QCA9887_FIRMWARE_FILE_CT_FULL_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.018
define Download/ath10k-firmware-qca9887-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA9887,ath10k-9887)
HASH:=fd126a457d0927d0c8ea10d66ef5b67d5e1e0741f8692bb3016bb602d0af3098
endef
$(eval $(call Download,ath10k-firmware-qca9887-ct-full-htt))
QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.018
define Download/ath10k-firmware-qca99x0-ct
$(call Download/ct-firmware,QCA99X0,ath10k-10-4b)
HASH:=cf26eb37524de54af51fe9b2efffc85e0e70ab849e8607ef63ce5a8ecffeaa42
endef
$(eval $(call Download,ath10k-firmware-qca99x0-ct))
QCA99X0_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.018
define Download/ath10k-firmware-qca99x0-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA99X0,ath10k-10-4b)
HASH:=e9737538d7379e13ad4e4c8c519a63659b5e34a35455ed9ac4399ae8097caabc
endef
$(eval $(call Download,ath10k-firmware-qca99x0-ct-full-htt))
QCA99X0_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.018
define Download/ath10k-firmware-qca99x0-ct-htt
$(call Download/ct-firmware-htt,QCA99X0,ath10k-10-4b)
HASH:=4d4f74afca487d452f244cd48304cf9710d8941eb97a6346a949ed6b6877d657
endef
$(eval $(call Download,ath10k-firmware-qca99x0-ct-htt))
QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.018
define Download/ath10k-firmware-qca9984-ct
$(call Download/ct-firmware,QCA9984,ath10k-9984-10-4b)
HASH:=a6b3d66efe640a430a837f238e91eddcd423eed6b887d3ae19716d87a71fd0b1
endef
$(eval $(call Download,ath10k-firmware-qca9984-ct))
QCA9984_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.018
define Download/ath10k-firmware-qca9984-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA9984,ath10k-9984-10-4b)
HASH:=96060227e372b3b210badccbe6b0bd75d9a35335a7a0f2966964e9e89f66b00f
endef
$(eval $(call Download,ath10k-firmware-qca9984-ct-full-htt))
QCA9984_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.018
define Download/ath10k-firmware-qca9984-ct-htt
$(call Download/ct-firmware-htt,QCA9984,ath10k-9984-10-4b)
HASH:=ee593fb5724d75c372de02ac7894e1630ee9f909fcb2e2bbf17aadef67cb9d43
endef
$(eval $(call Download,ath10k-firmware-qca9984-ct-htt))
QCA4019_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.018
define Download/ath10k-firmware-qca4019-ct
$(call Download/ct-firmware,QCA4019,ath10k-4019-10-4b)
HASH:=46d8f8f1e780813299dc8780eedcfceda103c6b4d8908589ad1adbef921714c0
endef
$(eval $(call Download,ath10k-firmware-qca4019-ct))
QCA4019_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.018
define Download/ath10k-firmware-qca4019-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA4019,ath10k-4019-10-4b)
HASH:=d884624fc34f4b5de7a3ec0534627c46cea25fca45657f3a2f6bb85f6c5893d7
endef
$(eval $(call Download,ath10k-firmware-qca4019-ct-full-htt))
QCA4019_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.018
define Download/ath10k-firmware-qca4019-ct-htt
$(call Download/ct-firmware-htt,QCA4019,ath10k-4019-10-4b)
HASH:=51fe06f66365771647d16039cca8b541de3d642c45271977a4cfd433c2c5d45b
endef
$(eval $(call Download,ath10k-firmware-qca4019-ct-htt))
QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.018
define Download/ath10k-firmware-qca9888-ct
$(call Download/ct-firmware,QCA9888,ath10k-9888-10-4b)
HASH:=d01f1429aaf0bfac07eee3547e5821d19136840b2f983e75e76979a5ac19b6f0
endef
$(eval $(call Download,ath10k-firmware-qca9888-ct))
QCA9888_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.018
define Download/ath10k-firmware-qca9888-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA9888,ath10k-9888-10-4b)
HASH:=68c42f8e0dcf77f18d4813ac93174bf06ff5cf5aa4f69befe7f35f9fae1de1e3
endef
$(eval $(call Download,ath10k-firmware-qca9888-ct-full-htt))
QCA9888_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.018
define Download/ath10k-firmware-qca9888-ct-htt
$(call Download/ct-firmware-htt,QCA9888,ath10k-9888-10-4b)
HASH:=6c692141155f5bb74c0117553d5d48ff2aaba73bd4d5e90a5044a5e2ec0faab0
endef
$(eval $(call Download,ath10k-firmware-qca9888-ct-htt))
define Package/ath10k-ct-firmware-default
SECTION:=firmware
CATEGORY:=Firmware
URL:=https://www.candelatech.com/ath10k.php
DEPENDS:=
endef
define Package/ath10k-firmware-qca988x-ct
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.1 firmware for QCA988x devices
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca988x
endef
define Package/ath10k-firmware-qca988x-ct-full-htt
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.1 full-htt-mgt fw for QCA988x
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca988x
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9887-ct
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.1 firmware for QCA9887 devices
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9887
endef
define Package/ath10k-firmware-qca9887-ct-full-htt
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.1 full-htt-mgt fw for QCA9887
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9887
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca99x0-ct
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.4 firmware for QCA99x0 devices
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca99x0
endef
define Package/ath10k-firmware-qca99x0-ct-full-htt
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.4 full-htt-mgt fw for QCA99x0
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca99x0
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca99x0-ct-htt
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.4 htt-mgt fw for QCA99x0
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca99x0
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9984-ct
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.4 firmware for QCA9984 devices
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9984
endef
define Package/ath10k-firmware-qca9984-ct-full-htt
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.4 full-htt-mgt fw for QCA9984
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9984
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9984-ct-htt
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.4 htt-mgt fw for QCA9984
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9984
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca4019-ct
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.4 firmware for QCA4018/9
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca4019
endef
define Package/ath10k-firmware-qca4019-ct-full-htt
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.4 full-htt-mgt for QCA4018/9
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca4019
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca4019-ct-htt
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.4 htt-mgt for QCA4018/9
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca4019
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9888-ct
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.4 fw for QCA9886/8 devices
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9888
endef
define Package/ath10k-firmware-qca9888-ct-full-htt
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.4 full-htt-mgt fw for QCA9886/8
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9888
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9888-ct-htt
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.4 htt-mgt fw for QCA9886/8
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9888
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9887-ct/description
Alternative ath10k firmware for QCA9887 from Candela Technologies.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.1.php
This firmware conflicts with the standard 9887 firmware, so select only
one.
endef
define Package/ath10k-firmware-qca9887-ct-full-htt/description
Alternative ath10k firmware for QCA9887 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and fixes .11r authentication.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.1.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca988x-ct/description
Alternative ath10k firmware for QCA988X from Candela Technologies.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.1.php
This firmware will NOT be used unless the standard ath10k-firmware-qca988x
is un-selected since the driver will try to load firmware-5.bin before
firmware-2.bin
endef
define Package/ath10k-firmware-qca988x-ct-full-htt/description
Alternative ath10k firmware for QCA988X from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and fixes .11r authentication.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.1.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca99x0-ct/description
Alternative ath10k firmware for QCA99x0 from Candela Technologies.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware conflicts with the standard 99x0 firmware, so select only
one.
endef
define Package/ath10k-firmware-qca99x0-ct-full-htt/description
Alternative ath10k firmware for QCA99x0 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca99x0-ct-htt/description
Alternative ath10k firmware for QCA99x0 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
This firmware lacks a lot of features that ath10k does not use, saving
a lot of resources.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca9984-ct/description
Alternative ath10k firmware for QCA9984 from Candela Technologies.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware conflicts with the standard 9984 firmware, so select only
one.
endef
define Package/ath10k-firmware-qca9984-ct-full-htt/description
Alternative ath10k firmware for QCA9984 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca9984-ct-htt/description
Alternative ath10k firmware for QCA9984 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
This firmware lacks a lot of features that ath10k does not use, saving
a lot of resources.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca4019-ct/description
Alternative ath10k firmware for IPQ4019 radio from Candela Technologies.
Enables IBSS and other features. Works with standard or ath10k-ct driver.
See: http://www.candelatech.com/ath10k-10.4.php
endef
define Package/ath10k-firmware-qca4019-ct-full-htt/description
Alternative ath10k firmware for IPQ4019 radio from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
Enables IBSS and other features.
See: http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca4019-ct-htt/description
Alternative ath10k firmware for IPQ4019 radio from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
This firmware lacks a lot of features that ath10k does not use, saving
a lot of resources.
Enables IBSS and other features.
See: http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca9888-ct/description
Alternative ath10k firmware for QCA9886 and QCA9888 from Candela Technologies.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware conflicts with the standard 9886 and 9888 firmware, so select only
one.
endef
define Package/ath10k-firmware-qca9888-ct-full-htt/description
Alternative ath10k firmware for QCA9886 and QCA9888 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca9888-ct-htt/description
Alternative ath10k firmware for QCA9886 and QCA9888 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
This firmware lacks a lot of features that ath10k does not use, saving
a lot of resources.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Build/Compile
endef
define Package/ath10k-firmware-qca9887-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9887/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA9887) \
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/firmware-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA9887_BOARD_FILE) \
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/board.bin
endef
define Package/ath10k-firmware-qca9887-ct-full-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9887/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_FULL_HTT,QCA9887) \
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/ct-firmware-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA9887_BOARD_FILE) \
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/board.bin
endef
define Package/ath10k-firmware-qca988x-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA988X_BOARD_FILE) \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA988X) \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
endef
define Package/ath10k-firmware-qca988x-ct-full-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA988X_BOARD_FILE) \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_FULL_HTT,QCA988X) \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/ct-firmware-2.bin
endef
define Package/ath10k-firmware-qca99x0-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA99X0/hw2.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA99X0_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA99X0_BOARD_FILE) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA99X0) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/firmware-5.bin
endef
define Package/ath10k-firmware-qca99x0-ct-full-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA99X0/hw2.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA99X0_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA99X0_BOARD_FILE) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_FULL_HTT,QCA99X0) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/ct-firmware-5.bin
endef
define Package/ath10k-firmware-qca99x0-ct-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA99X0/hw2.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA99X0_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA99X0_BOARD_FILE) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_HTT,QCA99X0) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/ct-firmware-5.bin
endef
define Package/ath10k-firmware-qca9984-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9984/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA9984_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA9984) \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/firmware-5.bin
endef
define Package/ath10k-firmware-qca9984-ct-full-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9984/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA9984_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_FULL_HTT,QCA9984) \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/ct-firmware-5.bin
endef
define Package/ath10k-firmware-qca9984-ct-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9984/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA9984_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_HTT,QCA9984) \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/ct-firmware-5.bin
endef
define Package/ath10k-firmware-qca4019-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA4019_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA4019) \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/firmware-5.bin
endef
define Package/ath10k-firmware-qca4019-ct-full-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA4019_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_FULL_HTT,QCA4019) \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/ct-firmware-5.bin
endef
define Package/ath10k-firmware-qca4019-ct-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA4019_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_HTT,QCA4019) \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/ct-firmware-5.bin
endef
define Package/ath10k-firmware-qca9888-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9888/hw2.0
ln -s \
../../cal-pci-0000:01:00.0.bin \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA9888_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA9888) \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/firmware-5.bin
endef
define Package/ath10k-firmware-qca9888-ct-full-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9888/hw2.0
ln -s \
../../cal-pci-0000:01:00.0.bin \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA9888_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_FULL_HTT,QCA9888) \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/ct-firmware-5.bin
endef
define Package/ath10k-firmware-qca9888-ct-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9888/hw2.0
ln -s \
../../cal-pci-0000:01:00.0.bin \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA9888_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_HTT,QCA9888) \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/ct-firmware-5.bin
endef
$(eval $(call BuildPackage,ath10k-firmware-qca9887-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca9887-ct-full-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca988x-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca988x-ct-full-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca99x0-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca99x0-ct-full-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca99x0-ct-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca9984-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca9984-ct-full-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca9984-ct-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct-full-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca9888-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca9888-ct-full-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca9888-ct-htt))

View File

@ -37,11 +37,6 @@ $(Package/ath10k-firmware-default)
TITLE:=ath10k firmware for QCA9888 devices
endef
define Package/ath10k-firmware-qca9887-ct
$(Package/ath10k-firmware-default)
TITLE:=ath10k-CT firmware for QCA9887 devices
endef
define Package/ath10k-firmware-qca988x
$(Package/ath10k-firmware-default)
TITLE:=ath10k firmware for QCA988x devices
@ -49,111 +44,6 @@ $(Package/ath10k-firmware-default)
CATEGORY:=Firmware
endef
CT_FIRMWARE_FILE = $(1)-$($(1)_FIRMWARE_FILE_CT)
CT_FIRMWARE_FILE_HTT = $(1)-$($(1)_FIRMWARE_FILE_CT_HTT)
define Download/ct-firmware
URL:=https://www.candelatech.com/downloads/$(2)
FILE:=$(call CT_FIRMWARE_FILE,$(1))
URL_FILE:=$($(1)_FIRMWARE_FILE_CT)
endef
define Download/ct-firmware-htt
URL:=https://www.candelatech.com/downloads/$(2)
FILE:=$(call CT_FIRMWARE_FILE_HTT,$(1))
URL_FILE:=$($(1)_FIRMWARE_FILE_CT_HTT)
endef
QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.017
define Download/ath10k-firmware-qca988x-ct
$(call Download/ct-firmware,QCA988X,)
HASH:=2f0bf766e400a4c5726e77b128eb8c141ebaa778526fe2c7c5083f3b17659dbf
endef
$(eval $(call Download,ath10k-firmware-qca988x-ct))
QCA988X_FIRMWARE_FILE_CT_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.017
define Download/ath10k-firmware-qca988x-ct-htt
$(call Download/ct-firmware-htt,QCA988X,)
HASH:=5e4285d5c6eee159a25ca14c6ce26022c32380bd7bafaedfc0c5de1510119007
endef
$(eval $(call Download,ath10k-firmware-qca988x-ct-htt))
QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.017
define Download/ath10k-firmware-qca9887-ct
$(call Download/ct-firmware,QCA9887,ath10k-9887)
HASH:=4fa30e0e1972ca3b06225a731df0f93a1b73ac67fea5bf54bb55dea3bbc0da6a
endef
$(eval $(call Download,ath10k-firmware-qca9887-ct))
QCA9887_FIRMWARE_FILE_CT_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.017
define Download/ath10k-firmware-qca9887-ct-htt
$(call Download/ct-firmware-htt,QCA9887,ath10k-9887)
HASH:=dc681b6b1e45956e7c2e418ab05eee5c943d13e775209196d9bd931ff6493935
endef
$(eval $(call Download,ath10k-firmware-qca9887-ct-htt))
QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.017
define Download/ath10k-firmware-qca99x0-ct
$(call Download/ct-firmware,QCA99X0,ath10k-10-4b)
HASH:=289ea845d4bbae6f36b3af2a13a5eaa07097f52d10f7b7306cfc9e2dd394f889
endef
$(eval $(call Download,ath10k-firmware-qca99x0-ct))
QCA99X0_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.017
define Download/ath10k-firmware-qca99x0-ct-htt
$(call Download/ct-firmware-htt,QCA99X0,ath10k-10-4b)
HASH:=adedcd3d379a910bc3a5257d75f8970e11319f4cd9c1b34440d35821602a8b9c
endef
$(eval $(call Download,ath10k-firmware-qca99x0-ct-htt))
QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.017
define Download/ath10k-firmware-qca9984-ct
$(call Download/ct-firmware,QCA9984,ath10k-9984-10-4b)
HASH:=8175be5b3946bddc042be018ff7713e67b41b59374ef4cdd183185b59274c91a
endef
$(eval $(call Download,ath10k-firmware-qca9984-ct))
QCA9984_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.017
define Download/ath10k-firmware-qca9984-ct-htt
$(call Download/ct-firmware-htt,QCA9984,ath10k-9984-10-4b)
HASH:=eb8b894cfe0d1aaa87f130bb7fd1815ef07b951c14df8a2ceaeb780df8f640e0
endef
$(eval $(call Download,ath10k-firmware-qca9984-ct-htt))
QCA4019_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.017
define Download/ath10k-firmware-qca4019-ct
$(call Download/ct-firmware,QCA4019,ath10k-4019-10-4b)
HASH:=29e9f662c4cd287213877abfbb90fbabb5e32dd3710d3ade82aa94a0921972ae
endef
$(eval $(call Download,ath10k-firmware-qca4019-ct))
QCA4019_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.017
define Download/ath10k-firmware-qca4019-ct-htt
$(call Download/ct-firmware-htt,QCA4019,ath10k-4019-10-4b)
HASH:=559c911f23856b1d3d864ce714d1bef7262bf6638e93e057ecf8d5dba48ca1e6
endef
$(eval $(call Download,ath10k-firmware-qca4019-ct-htt))
QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.017
define Download/ath10k-firmware-qca9888-ct
$(call Download/ct-firmware,QCA9888,ath10k-9888-10-4b)
HASH:=b295880a8b08ec2680d85daaf5f20232a0e73d9cc579bf3efd7ffae24ea340d7
endef
$(eval $(call Download,ath10k-firmware-qca9888-ct))
QCA9888_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.017
define Download/ath10k-firmware-qca9888-ct-htt
$(call Download/ct-firmware-htt,QCA9888,ath10k-9888-10-4b)
HASH:=26fe7c00df10e93373a0f9f105e85d02bb8b1cdd629183ce22a5147138336aec
endef
$(eval $(call Download,ath10k-firmware-qca9888-ct-htt))
define Package/ath10k-firmware-qca99x0
$(Package/ath10k-firmware-default)
TITLE:=ath10k firmware for QCA99x0 devices
@ -161,206 +51,12 @@ $(Package/ath10k-firmware-default)
CATEGORY:=Firmware
endef
define Package/ath10k-firmware-qca988x-ct
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.1 firmware for QCA988x devices
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca988x
endef
define Package/ath10k-firmware-qca988x-ct-htt
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.1 htt-mgt fw for QCA988x
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca988x
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9887-ct
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.1 firmware for QCA9887 devices
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9887
endef
define Package/ath10k-firmware-qca9887-ct-htt
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.1 htt-mgt fw for QCA9887
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9887
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca988x-ct/description
Alternative ath10k firmware for QCA988X from Candela Technologies.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.1.php
This firmware will NOT be used unless the standard ath10k-firmware-qca988x
is un-selected since the driver will try to load firmware-5.bin before
firmware-2.bin
endef
define Package/ath10k-firmware-qca988x-ct-htt/description
Alternative ath10k firmware for QCA988X from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and fixes .11r authentication.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.1.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca9887-ct/description
Alternative ath10k firmware for QCA9887 from Candela Technologies.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.1.php
This firmware conflicts with the standard 9887 firmware, so select only
one.
endef
define Package/ath10k-firmware-qca9887-ct-htt/description
Alternative ath10k firmware for QCA9887 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and fixes .11r authentication.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.1.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca99x0-ct/description
Alternative ath10k firmware for QCA99x0 from Candela Technologies.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware conflicts with the standard 99x0 firmware, so select only
one.
endef
define Package/ath10k-firmware-qca99x0-ct-htt/description
Alternative ath10k firmware for QCA99x0 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca9984-ct/description
Alternative ath10k firmware for QCA9984 from Candela Technologies.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware conflicts with the standard 9984 firmware, so select only
one.
endef
define Package/ath10k-firmware-qca9984-ct-htt/description
Alternative ath10k firmware for QCA9984 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca4019-ct/description
Alternative ath10k firmware for IPQ4019 radio from Candela Technologies.
Enables IBSS and other features. Works with standard or ath10k-ct driver.
See: http://www.candelatech.com/ath10k-10.4.php
endef
define Package/ath10k-firmware-qca4019-ct-htt/description
Alternative ath10k firmware for IPQ4019 radio from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
Enables IBSS and other features.
See: http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca9888-ct/description
Alternative ath10k firmware for QCA9886 and QCA9888 from Candela Technologies.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware conflicts with the standard 9886 and 9888 firmware, so select only
one.
endef
define Package/ath10k-firmware-qca9888-ct-htt/description
Alternative ath10k firmware for QCA9886 and QCA9888 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca99x0/description
Standard ath10k firmware for QCA99x0 from QCA
This firmware conflicts with the CT 99x0 firmware, so select only
one.
endef
define Package/ath10k-firmware-qca99x0-ct
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.4 firmware for QCA99x0 devices
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca99x0
endef
define Package/ath10k-firmware-qca99x0-ct-htt
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.4 htt-mgt fw for QCA99x0
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca99x0
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9984-ct
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.4 firmware for QCA9984 devices
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9984
endef
define Package/ath10k-firmware-qca9984-ct-htt
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.4 htt-mgt fw for QCA9984
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9984
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca4019-ct
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.4 firmware for QCA4018/9
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca4019
endef
define Package/ath10k-firmware-qca4019-ct-htt
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.4 htt-mgt for QCA4018/9
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca4019
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9888-ct
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.4 fw for QCA9886/8 devices
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9888
endef
define Package/ath10k-firmware-qca9888-ct-htt
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.4 htt-mgt fw for QCA9886/8
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9888
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9984
$(Package/ath10k-firmware-default)
TITLE:=ath10k firmware for QCA9984 devices
@ -477,152 +173,10 @@ define Package/ath10k-firmware-qca9984/install
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/firmware-5.bin
endef
# CT related firmware
define Package/ath10k-firmware-qca9887-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9887/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA9887) \
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/firmware-2.bin
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA9887/hw1.0/board.bin \
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/board.bin
endef
define Package/ath10k-firmware-qca9887-ct-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9887/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_HTT,QCA9887) \
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/ct-firmware-2.bin
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA9887/hw1.0/board.bin \
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/board.bin
endef
define Package/ath10k-firmware-qca988x-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA988X/hw2.0/board.bin \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA988X) \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
endef
define Package/ath10k-firmware-qca988x-ct-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA988X/hw2.0/board.bin \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_HTT,QCA988X) \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/ct-firmware-2.bin
endef
define Package/ath10k-firmware-qca99x0-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA99X0/hw2.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA99X0_BOARD_FILE) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA99X0/hw2.0/boardData_AR900B_CUS239_5G_v2_001.bin \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA99X0) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/firmware-5.bin
endef
define Package/ath10k-firmware-qca99x0-ct-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA99X0/hw2.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA99X0_BOARD_FILE) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA99X0/hw2.0/boardData_AR900B_CUS239_5G_v2_001.bin \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_HTT,QCA99X0) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/ct-firmware-5.bin
endef
define Package/ath10k-firmware-qca9984-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9984/hw1.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA9984/hw1.0/board-2.bin \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA9984) \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/firmware-5.bin
endef
define Package/ath10k-firmware-qca9984-ct-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9984/hw1.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA9984/hw1.0/board-2.bin \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_HTT,QCA9984) \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/ct-firmware-5.bin
endef
define Package/ath10k-firmware-qca4019-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA4019/hw1.0/board-2.bin \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA4019) \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/firmware-5.bin
endef
define Package/ath10k-firmware-qca4019-ct-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA4019/hw1.0/board-2.bin \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_HTT,QCA4019) \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/ct-firmware-5.bin
endef
define Package/ath10k-firmware-qca9888-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9888/hw2.0
ln -s \
../../cal-pci-0000:01:00.0.bin \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA9888/hw2.0/board-2.bin \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA9888) \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/firmware-5.bin
endef
define Package/ath10k-firmware-qca9888-ct-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9888/hw2.0
ln -s \
../../cal-pci-0000:01:00.0.bin \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA9888/hw2.0/board-2.bin \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_HTT,QCA9888) \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/ct-firmware-5.bin
endef
$(eval $(call BuildPackage,ath10k-firmware-qca9887))
#$(eval $(call BuildPackage,ath10k-firmware-qca9888))
$(eval $(call BuildPackage,ath10k-firmware-qca988x))
#$(eval $(call BuildPackage,ath10k-firmware-qca99x0))
#$(eval $(call BuildPackage,ath10k-firmware-qca6174))
#$(eval $(call BuildPackage,ath10k-firmware-qca9984))
$(eval $(call BuildPackage,ath10k-firmware-qca4019))
$(eval $(call BuildPackage,ath10k-firmware-qca9887-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca9887-ct-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca988x-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca988x-ct-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca99x0-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca99x0-ct-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca9984-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca9984-ct-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca9888-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca9888-ct-htt))
#$(eval $(call BuildPackage,ath10k-firmware-qca4019))

View File

@ -28,6 +28,11 @@ define Package/layerscape-rcw/Config
endef
endef
define Package/layerscape-rcw/ls1012afrdm
TITLE:=NXP LS1012AFRDM RCW binary
CONFIG:=ls1012afrdm/N_SSNP_3305/rcw_800.bin
endef
define Package/layerscape-rcw/ls1012ardb
TITLE:=NXP LS1012ARDB RCW binary
CONFIG:=ls1012ardb/R_SPNH_3508/rcw_1000_default.bin
@ -86,6 +91,7 @@ define Package/layerscape-rcw/Install
endef
RCWS := \
ls1012afrdm \
ls1012ardb \
ls1012afrwy \
ls1043ardb \

View File

@ -0,0 +1,44 @@
From ef78dc0683a7f5ae80b27878a8a2f91d504e3290 Mon Sep 17 00:00:00 2001
From: Yangbo Lu <yangbo.lu@nxp.com>
Date: Wed, 19 Jun 2019 10:50:29 +0800
Subject: [PATCH 1/2] Disable byte swapping
Because TF-A had already handled rcw byte swapping, the
byte swapping in rcw could be dropped.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
Makefile | 4 ----
Makefile.inc | 1 -
2 files changed, 5 deletions(-)
diff --git a/Makefile b/Makefile
index f697241..837b69e 100644
--- a/Makefile
+++ b/Makefile
@@ -14,10 +14,6 @@ TCLSH := $(shell command -v tclsh 2> /dev/null)
VER = $(shell git describe --tags)
all install clean:
-ifndef TCLSH
- $(error "tclsh is not available. please install it.")
- exit 1
-endif
@for board in $(BOARDS); do \
$(MAKE) -C $$board $@ DESTDIR=$(DESTDIR)/$$board; \
done
diff --git a/Makefile.inc b/Makefile.inc
index 87639bc..7d9a3d3 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -17,7 +17,6 @@ targets = $(txt_sources:.txt=.bin) $(rcw_sources:.rcw=.bin) $(swap_sources)
$(RCW) -i $< -o $@
all: $(targets)
- $(QSPI_SWAP_SCRIPT) $(QSPI_SWAP_LIST)
install: $(targets)
$(INSTALL) -d $(DESTDIR)
--
2.7.4

View File

@ -1,82 +0,0 @@
From c87a500c45f36ad248b1298d63e590d1d7e74f12 Mon Sep 17 00:00:00 2001
From: Yangbo Lu <yangbo.lu@nxp.com>
Date: Tue, 3 Jul 2018 11:06:47 +0800
Subject: [PATCH] rcw: support byte swapping without tclsh tool
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
Makefile | 4 ----
byte_swap.py | 32 ++++++++++++++++++++++++++++++++
qspi_swap.sh | 2 +-
3 files changed, 33 insertions(+), 5 deletions(-)
create mode 100755 byte_swap.py
diff --git a/Makefile b/Makefile
index 9f0587e..393bb2c 100644
--- a/Makefile
+++ b/Makefile
@@ -13,10 +13,6 @@ TCLSH := $(shell command -v tclsh 2> /dev/null)
VER = $(shell git describe --tags)
all install clean:
-ifndef TCLSH
- $(error "tclsh is not available. please install it.")
- exit 1
-endif
@for board in $(BOARDS); do \
$(MAKE) -C $$board $@ DESTDIR=$(DESTDIR)/$$board; \
done
diff --git a/byte_swap.py b/byte_swap.py
new file mode 100755
index 0000000..386310e
--- /dev/null
+++ b/byte_swap.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+"""
+Swap the 4/8 bytes endian except for PBI CRC
+2016-10-9: Initial version
+
+Usage:
+ ./byte_swap.py <file_name> <byte>
+"""
+import sys
+
+try:
+ file_name = sys.argv[1]
+ byte = int(sys.argv[2])
+except:
+ print("Usage: ./byte_swap.py <file_name> <byte>")
+ print("E.g.: ./byte_swap.py rcw_1600.bin 8\n")
+ exit
+
+with open(file_name,'rb') as file:
+ tmp = file.read()
+file.close()
+
+with open(file_name + '.swapped','wb') as file:
+ for i in range(0, len(tmp) - 1, byte):
+ if(tmp[i:i+4].encode('hex')) == "08610040":
+ #print("PBI CRC command")
+ file.write(tmp[i:i+8])
+ break
+ file.write(tmp[i:i+byte][::-1])
+file.close()
+
+print("Swapped file: " + file_name + '.swapped')
diff --git a/qspi_swap.sh b/qspi_swap.sh
index 0b58e44..d23fd8b 100755
--- a/qspi_swap.sh
+++ b/qspi_swap.sh
@@ -9,7 +9,7 @@ do
if [ "$board_name" = "$current_dir" ]; then
if [ -e $filename ]; then
swapped_file="$filename.swapped"
- tclsh ../tools/byte_swap.tcl $filename $swapped_file 8
+ ../byte_swap.py $filename 8
fi
fi
done < $1
--
1.7.1

View File

@ -0,0 +1,504 @@
From 7bd43eb9e5cdf2035793d50a31bf13052eb9812a Mon Sep 17 00:00:00 2001
From: Yangbo Lu <yangbo.lu@nxp.com>
Date: Wed, 19 Jun 2019 10:25:41 +0800
Subject: [PATCH 2/2] Convert to python3
Python 2.7 will not be maintained past 2020. Let's convert
to python3 for rcw. Below were the changes of this patch.
- Adapted print usage
- Didn't use tab anymore
- Handled str and bytes type separately
- Other minor changes
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
Makefile.inc | 2 +-
rcw.py | 144 +++++++++++++++++++++++++++++------------------------------
2 files changed, 73 insertions(+), 73 deletions(-)
diff --git a/Makefile.inc b/Makefile.inc
index 7d9a3d3..8bee2be 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -1,6 +1,6 @@
DESTDIR = $(shell basename $(CURDIR))
INSTALL = install
-PYTHON ?= python2
+PYTHON ?= python3
RCW = $(PYTHON) ../rcw.py
QSPI_SWAP_LIST = $(shell pwd)/../qspi_swap_list.txt
QSPI_SWAP_SCRIPT=$(shell pwd)/../qspi_swap.sh
diff --git a/rcw.py b/rcw.py
index e5cd28b..619770a 100755
--- a/rcw.py
+++ b/rcw.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
# rcw.py -- compiles an RCW source file into an PBL/RCW binary
@@ -95,7 +95,7 @@ from optparse import OptionParser, OptionGroup
class ordered_dict(dict):
def __init__(self, *args, **kwargs):
dict.__init__(self, *args, **kwargs)
- self._order = self.keys()
+ self._order = list(self.keys())
def __setitem__(self, key, value):
dict.__setitem__(self, key, value)
@@ -132,7 +132,7 @@ def crc32(data):
crc = 0xffffffff
for i in data:
- crc = (crc << 8) ^ table[(crc >> 24) ^ ord(i)]
+ crc = (crc << 8) ^ table[(crc >> 24) ^ int(i)]
crc = crc & 0xffffffff
return crc
@@ -187,7 +187,7 @@ def command_line():
options.output = '/dev/stdout'
if options.reverse and not options.rcwi:
- print "Error: -r option requires --rcw"
+ print("Error: -r option requires --rcw")
sys.exit(1)
# Checks if the bits for the given field overlap those of another field that
@@ -196,27 +196,27 @@ def check_for_overlap(name, begin, end):
global symbols
if name in symbols:
- print 'Error: Duplicate bitfield definition for', name
+ print('Error: Duplicate bitfield definition for', name)
return
# Iterate over the list of symbols that have already been defined
- for n, [b, e] in symbols.iteritems():
+ for n, [b, e] in symbols.items():
# check if either 'begin' or 'end' is inside an bitfield range
if (b <= begin <= e) or (b <= end <= e):
- print 'Error: Bitfield', name, 'overlaps with', n
+ print('Error: Bitfield', name, 'overlaps with', n)
#
# Build a u-boot PBI section for SPI/SD/NAND boot
-# refer: Chapter 10, u-boot of QorIQ_SDK_Infocenter.pdf
+# refer: Chapter 10, u-boot of QorIQ_SDK_Infocenter.pdf
#
# pre-cond 1: u-boot.xxd should be created
# how to create u-boot.xxd
-# xxd u-boot.bin > u-boot.xxd1 && cut -d " " -f1-10 u-boot.xxd1 > u-boot.xxd && rm -f u-boot.xxd1
+# xxd u-boot.bin > u-boot.xxd1 && cut -d " " -f1-10 u-boot.xxd1 > u-boot.xxd && rm -f u-boot.xxd1
#
# rcw file should include spi_boot.rcw as well
#
def build_pbi_uboot(lines):
- subsection = ''
+ subsection = b''
cnt = 1
l_tmp = []
@@ -224,55 +224,55 @@ def build_pbi_uboot(lines):
for l in lines:
# prepare 0x40 per lines except the last one
# add flush at the end
- lstr = l.split()
- addr = int(lstr[0][:-1], 16)
+ lstr = l.split()
+ addr = int(lstr[0][:-1], 16)
# print l
#
# last two lines take 0x20 numbers
#
- if ((cnt % 2 == 0) and (cnt > len(lines) -4)):
+ if ((cnt % 2 == 0) and (cnt > len(lines) -4)):
l_tmp.append(l)
b = []
- for t in l_tmp:
+ for t in l_tmp:
lstr = t.split()
- for i in range(1, len(lstr)):
+ for i in range(1, len(lstr)):
b.append(int(lstr[i], 16))
subsection += struct.pack('>LHHHHHHHHHHHHHHHH',\
- 0x0C1F80000 + (addr - 0x10),\
- b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7],\
- b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15])
+ 0x0C1F80000 + (addr - 0x10),\
+ b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7],\
+ b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15])
l_tmp = []
#
# the rest of lines take 0x40 numbers
elif (cnt % 4 == 0):
l_tmp.append(l)
- b = []
- for t in l_tmp:
+ b = []
+ for t in l_tmp:
lstr = t.split()
- for i in range(1, len(lstr)):
+ for i in range(1, len(lstr)):
b.append(int(lstr[i], 16))
subsection += struct.pack('>LHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH',\
- 0x081F80000 + (addr - 0x30),\
- b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7],\
- b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15],\
- b[16], b[17], b[18], b[19], b[20], b[21], b[22], b[23], \
- b[24], b[25], b[26], b[27], b[28], b[29], b[30], b[31])
+ 0x081F80000 + (addr - 0x30),\
+ b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7],\
+ b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15],\
+ b[16], b[17], b[18], b[19], b[20], b[21], b[22], b[23], \
+ b[24], b[25], b[26], b[27], b[28], b[29], b[30], b[31])
l_tmp = []
else:
l_tmp.append(l)
- cnt = cnt + 1
+ cnt = cnt + 1
return subsection
# Build a PBI section
def build_pbi(lines):
- subsection = ''
+ subsection = b''
global vars
if 'pbiformat' in vars:
@@ -286,9 +286,9 @@ def build_pbi(lines):
for l in lines:
# Check for an instruction without 0-2 parameters
# The + ' ' is a hack to make the regex work for just 'flush'
- m = re.match(r'\s*([a-z]+)(|\.b1|\.b2|\.b4|\.short|\.long)\s*(?<=\s)([^,]*),?([^,]*),?([^,]*),?([^,]*)', l + ' ')
+ m = re.match(r'\s*([a-z]+)(|\.b1|\.b2|\.b4|\.short|\.long)\s*(?<=\s)([^,]*),?([^,]*),?([^,]*),?([^,]*)', l.decode("ascii") + ' ')
if not m:
- print 'Unknown PBI subsection command "%s"' % l
+ print('Unknown PBI subsection command "%s"' % l)
return ''
op = m.group(1)
opsize = m.group(2)
@@ -306,7 +306,7 @@ def build_pbi(lines):
p4 = eval(p4, {"__builtins__":None}, {}) if len(p4) else None
if op == 'wait':
if p1 == None:
- print 'Error: "wait" instruction requires one parameter'
+ print('Error: "wait" instruction requires one parameter')
return ''
if pbiformat == 2:
v1 = struct.pack(endianess + 'L', 0x80820000 | p1)
@@ -318,7 +318,7 @@ def build_pbi(lines):
subsection += v2
elif op == 'write':
if p1 == None or p2 == None:
- print 'Error: "write" instruction requires two parameters'
+ print('Error: "write" instruction requires two parameters')
return ''
if pbiformat == 2:
v1 = struct.pack(endianess + 'L', (opsizebytes << 28) | p1)
@@ -329,7 +329,7 @@ def build_pbi(lines):
subsection += v2
elif op == 'awrite':
if p1 == None or p2 == None:
- print 'Error: "awrite" instruction requires two parameters'
+ print('Error: "awrite" instruction requires two parameters')
return ''
if pbiformat == 2:
v1 = struct.pack(endianess + 'L', 0x80000000 + (opsizebytes << 26) + p1)
@@ -340,10 +340,10 @@ def build_pbi(lines):
subsection += v2
elif op == 'poll':
if pbiformat != 2:
- print 'Error: "poll" not support for old PBI format'
+ print('Error: "poll" not support for old PBI format')
return ''
if p1 == None or p2 == None or p3 == None:
- print 'Error: "poll" instruction requires three parameters'
+ print('Error: "poll" instruction requires three parameters')
return ''
if opsize == '.long':
cmd = 0x81
@@ -357,19 +357,19 @@ def build_pbi(lines):
subsection += v3
elif op == 'loadacwindow':
if pbiformat != 2:
- print 'Error: "loadacwindow" not supported for old PBI format'
+ print('Error: "loadacwindow" not supported for old PBI format')
return ''
if p1 == None:
- print 'Error: "loadacwindow" instruction requires one parameter'
+ print('Error: "loadacwindow" instruction requires one parameter')
return ''
v1 = struct.pack(endianess + 'L', 0x80120000 + p1)
subsection += v1
elif op == 'blockcopy':
if pbiformat != 2:
- print 'Error: "blockcopy" not supported for old PBI format'
+ print('Error: "blockcopy" not supported for old PBI format')
return ''
if p1 == None or p2 == None or p3 == None or p4 == None:
- print 'Error: "blockcopy" instruction requires four parameters'
+ print('Error: "blockcopy" instruction requires four parameters')
return ''
v1 = struct.pack(endianess + 'L', 0x80000000 + (p1 & 0xff))
v2 = struct.pack(endianess + 'L', p2)
@@ -382,7 +382,7 @@ def build_pbi(lines):
elif op == 'flush':
subsection += struct.pack('>LL', 0x09000000 | (int(vars['pbladdr'], 16) & 0x00ffff00), 0)
else:
- print 'Unknown PBI subsection command "%s"' % l
+ print('Unknown PBI subsection command "%s"' % l)
return ''
return subsection
@@ -394,7 +394,7 @@ def parse_subsection(header, lines):
elif header == "uboot":
return build_pbi_uboot(lines)
- print 'Error: unknown subsection "%s"' % header
+ print('Error: unknown subsection "%s"' % header)
return ''
# Parse the .rcw file, one line at a time
@@ -408,10 +408,10 @@ def parse_source_file(source):
symbols = ordered_dict()
in_subsection = False # True == we're in a subsection
- pbi = ''
+ pbi = b''
for l2 in source:
- l = re.sub(r'\s+', '', l2) # Remove all whitespace
+ l = re.sub(r'\s+', '', l2.decode("ascii")) # Remove all whitespace
if not len(l): # Skip blank or comment-only lines
continue
@@ -466,14 +466,14 @@ def parse_source_file(source):
(name, value) = m.groups()
value = int(value, 0)
if not name in symbols:
- print 'Error: Unknown bitfield', name
+ print('Error: Unknown bitfield', name)
else:
if options.warnings and (name in assignments):
- print 'Warning: Duplicate assignment for bitfield', name
+ print('Warning: Duplicate assignment for bitfield', name)
assignments[name] = value
continue
- print 'Error: unknown command', ' '.join(l2)
+ print('Error: unknown command', ' '.join(l2))
# Parse the -D command line parameter for additional bitfield assignments
def parse_cmdline_bitfields():
@@ -484,12 +484,12 @@ def parse_cmdline_bitfields():
# This is the same regex as used in parse_source_file()
m = re.search(r'([A-Z0-9_]+)=([0-9a-zA-Z]+)', l)
if not m:
- print 'Unrecognized command-line bitfield:', l
+ print('Unrecognized command-line bitfield:', l)
else:
(name, value) = m.groups()
value = int(value, 0)
if not name in symbols:
- print 'Error: Unknown bitfield', name
+ print('Error: Unknown bitfield', name)
else:
# Don't bother printing a warning, since the command-line will
# normally be used to overwrite values in the .rcw file
@@ -510,7 +510,7 @@ def read_source_file(filename):
global options
if not find_program('gcc'):
- print 'Could not find gcc in PATH'
+ print('Could not find gcc in PATH')
return None
i = ['-I', '.'] # Always look in the current directory
@@ -521,7 +521,7 @@ def read_source_file(filename):
shell=False, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
ret = p.communicate()
if p.returncode != 0:
- print ret[1],
+ print(ret[1],)
return None
return ret[0].splitlines()
@@ -532,13 +532,13 @@ def check_vars():
global options
if not 'size' in vars:
- print 'Error: "%size" variable must be specified'
+ print('Error: "%size" variable must be specified')
sys.exit(1)
if options.pbl:
if 'pbiformat' in vars and int(vars['pbiformat'], 0) == 2:
if 'sysaddr' in vars:
- print 'Error: PBL format does not use %sysaddr'
+ print('Error: PBL format does not use %sysaddr')
sys.exit(1)
#if 'pbladdr' in vars:
# print 'Error: PBL format does not use %pbladdr'
@@ -546,7 +546,7 @@ def check_vars():
else:
# If we want the PBL header/footer, the vars for those must be defined
if not 'sysaddr' in vars:
- print 'Error: PBL format requires %sysaddr to be defined'
+ print('Error: PBL format requires %sysaddr to be defined')
sys.exit(1)
# Create a .bin file
@@ -581,7 +581,7 @@ def create_binary():
dont64bswapcrc = 0
if 'dont64bswapcrc' in vars and int(vars['dont64bswapcrc'], 0):
dont64bswapcrc = 1
- bits = 0L
+ bits = 0
# Magic hack. If a pbi is specified and we didn't set the size,
# set it for the new format!
@@ -593,7 +593,7 @@ def create_binary():
pbilen += 2
assignments['PBI_LENGTH'] = pbilen
- for n, v in assignments.iteritems():
+ for n, v in assignments.items():
# n = name of symbol
# v = value to assign
bb, ee = symbols[n] # First bit and last bit
@@ -603,13 +603,13 @@ def create_binary():
# Make sure it's not too large
if v >= (1 << s):
- print 'Error: Value', v, 'is too large for field', n
+ print('Error: Value', v, 'is too large for field', n)
continue
# If we treat the bitfield as "classic" numbered, reverse
# the value before adding it!
if b != bb:
- v = int(bin(v)[2:].zfill(s)[::-1], 2)
+ v = int(bin(int(v))[2:].zfill(s)[::-1], 2)
# Set the bits. We assume that bits [b:e] are already zero. They can be
# non-zero only if we have overlapping bitfield definitions, which we
@@ -617,7 +617,7 @@ def create_binary():
bits += v << ((size - 1) - e)
# Generate the binary. First, apply the preamble, if requested
- binary = ''
+ binary = b''
if options.pbl:
# Starting with LS2, we have a larger field and a different
# format.
@@ -626,7 +626,7 @@ def create_binary():
# Load RCW command
binary += struct.pack(endianess + 'L', 0x80100000)
else:
- length_byte = (((size / 8) & 63) << 1) | 1
+ length_byte = (((size // 8) & 63) << 1) | 1
binary += struct.pack(endianess + 'L', (length_byte << 24) | (int(vars['sysaddr'], 16) & 0x00ffffff))
# Then convert 'bits' into an array of bytes
@@ -634,7 +634,7 @@ def create_binary():
byte = bits >> i & 0xff
if classicbitnumbers:
byte = int(bin(byte)[2:].zfill(8)[::-1], 2)
- binary += chr(byte)
+ binary += bytes([byte])
if options.pbl:
if pbiformat == 2:
@@ -672,11 +672,11 @@ def create_binary():
# Precise bit any byte ordering of the CRC calculation is
# not clearly specified. This is empirical.
if classicbitnumbers:
- newcrcbinary = ''
+ newcrcbinary = b''
for c in crcbinary:
- byte = ord(c)
+ byte = int(c)
byte = int(bin(byte)[2:].zfill(8)[::-1], 2)
- newcrcbinary += chr(byte)
+ newcrcbinary += bytes([byte])
crcbinary = newcrcbinary
# Calculate and add the CRC
@@ -693,7 +693,7 @@ def create_binary():
l = len(binary)
if dont64bswapcrc and options.pbl:
l -= 8
- newbinary = ''
+ newbinary = b''
for i in range(0, l, 8):
x64 = struct.unpack('>Q', binary[i:i + 8])[0]
newbinary += struct.pack('<Q', x64)
@@ -771,7 +771,7 @@ def create_source():
# We skip the checksum field
pbi = binary[8 + (size / 8) + 4:]
else:
- print 'Weird binary RCW format!'
+ print('Weird binary RCW format!')
bitbytes = ''
else:
if binary[0:4] == preambletst:
@@ -780,7 +780,7 @@ def create_source():
bitbytes = rcw
pbi = binary[8 + (size / 8):]
else:
- print 'Weird binary RCW format!'
+ print('Weird binary RCW format!')
bitbytes = ''
else:
bitbytes = binary
@@ -827,16 +827,16 @@ def create_source():
bits &= ~(mask << shift)
if bits:
- print 'Unknown bits in positions:',
+ print('Unknown bits in positions:',)
mask = 1
n = 0
while bits:
if (bits & mask):
- print n,
+ print(n,)
n += 1
bits &= ~mask
mask <<= 1
- print
+ print()
if len(pbi) > 0:
l = len(pbi)
@@ -953,7 +953,7 @@ def create_source():
if cnt == 0:
cnt = 64
if i + cnt >= l:
- print 'Error in write 0x%08x at offset %d within PBI\n' % (word, i)
+ print('Error in write 0x%08x at offset %d within PBI\n' % (word, i))
if (addr & 0x00ffff00 == pbladdr):
arg1 = struct.unpack(endianess + 'L', pbi[i:i+4])[0]
i += 4
@@ -986,8 +986,8 @@ def create_source():
return source
-if (sys.version_info < (2,6)) or (sys.version_info >= (3,0)):
- print 'Only Python versions 2.6 or 2.7 are supported.'
+if (sys.version_info < (3,0)):
+ print('Only Python versions 3.0+ are supported.')
sys.exit(1)
# Make all 'print' statements output to stderr instead of stdout
--
2.7.4

View File

@ -19,7 +19,7 @@ define Package/ath10k-firmware-qca4019/install
$(PKG_BUILD_DIR)/ath10k/QCA4019/hw1.0/firmware-5.bin \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/firmware-5.bin
endef
# $(eval $(call BuildPackage,ath10k-firmware-qca4019))
$(eval $(call BuildPackage,ath10k-firmware-qca4019))
Package/ath10k-firmware-qca9887 = $(call Package/firmware-default,ath10k qca9887 firmware)
define Package/ath10k-firmware-qca9887/install

View File

@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2020-03-25
PKG_SOURCE_VERSION:=3d173a471d3e583f2885ce68190c4387424cecc5
PKG_MIRROR_HASH:=496279322f3cd26b262d4999cb5a8c1ea022e92a7bb0d43d008bce235abb9a65
PKG_SOURCE_DATE:=2020-04-29
PKG_SOURCE_VERSION:=3637be6f6baf99e85a7f0b27f80a99a2f2a5f78d
PKG_MIRROR_HASH:=97cf22a4a57381c7eb7a9b8a8b1e347e9711ce51c89db971b4ab9a35af476ece
# Build the 5.4 ath10k-ct driver version. Other option is "-4.19".
# Probably this should match as closely as

View File

@ -1,89 +0,0 @@
From: Sriram R <srirrama@codeaurora.org>
Date: Mon, 10 Sep 2018 11:09:40 +0530
Subject: [PATCH] ath10k: add support for configuring management packet rate
By default the firmware uses 1Mbps and 6Mbps rate for management packets
in 2G and 5G bands respectively. But when the user selects different
basic rates from the userspace, we need to send the management
packets at the lowest basic rate selected by the user.
This change makes use of WMI_VDEV_PARAM_MGMT_RATE param for configuring the
management packets rate to the firmware.
Chipsets Tested : QCA988X, QCA9887, QCA9984
FW Tested : 10.2.4-1.0-41, 10.4-3.6.104
Signed-off-by: Sriram R <srirrama@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f279294e9ee22a8f306fdc8e4181cf555e6f0f70
---
--- a/ath10k-4.19/mac.c
+++ b/ath10k-4.19/mac.c
@@ -157,6 +157,22 @@ u8 ath10k_mac_bitrate_to_idx(const struc
return 0;
}
+static int ath10k_mac_get_rate_hw_value(int bitrate)
+{
+ int i;
+ u8 hw_value_prefix = 0;
+
+ if (ath10k_mac_bitrate_is_cck(bitrate))
+ hw_value_prefix = WMI_RATE_PREAMBLE_CCK << 6;
+
+ for (i = 0; i < sizeof(ath10k_rates); i++) {
+ if (ath10k_rates[i].bitrate == bitrate)
+ return hw_value_prefix | ath10k_rates[i].hw_value;
+ }
+
+ return -EINVAL;
+}
+
static int ath10k_mac_get_max_vht_mcs_map(u16 mcs_map, int nss)
{
switch ((mcs_map >> (2 * nss)) & 0x3) {
@@ -6413,9 +6429,10 @@ static void ath10k_bss_info_changed(stru
struct cfg80211_chan_def def;
u32 vdev_param, pdev_param, slottime, preamble;
u16 bitrate, hw_value;
- u8 rate;
- int rateidx, ret = 0;
+ u8 rate, basic_rate_idx;
+ int rateidx, ret = 0, hw_rate_code;
enum nl80211_band band;
+ const struct ieee80211_supported_band *sband;
mutex_lock(&ar->conf_mutex);
@@ -6621,6 +6638,30 @@ static void ath10k_bss_info_changed(stru
arvif->vdev_id, ret);
}
+ if (changed & BSS_CHANGED_BASIC_RATES) {
+ if (WARN_ON(ath10k_mac_vif_chan(vif, &def))) {
+ mutex_unlock(&ar->conf_mutex);
+ return;
+ }
+
+ sband = ar->hw->wiphy->bands[def.chan->band];
+ basic_rate_idx = ffs(vif->bss_conf.basic_rates) - 1;
+ bitrate = sband->bitrates[basic_rate_idx].bitrate;
+
+ hw_rate_code = ath10k_mac_get_rate_hw_value(bitrate);
+ if (hw_rate_code < 0) {
+ ath10k_warn(ar, "bitrate not supported %d\n", bitrate);
+ mutex_unlock(&ar->conf_mutex);
+ return;
+ }
+
+ vdev_param = ar->wmi.vdev_param->mgmt_rate;
+ ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
+ hw_rate_code);
+ if (ret)
+ ath10k_warn(ar, "failed to set mgmt tx rate %d\n", ret);
+ }
+
mutex_unlock(&ar->conf_mutex);
}

View File

@ -1,66 +0,0 @@
From: Sriram R <srirrama@codeaurora.org>
Date: Wed, 3 Oct 2018 08:43:50 +0530
Subject: [PATCH] ath10k: fix possible out of bound access of ath10k_rates array
While using 'ath10k_mac_get_rate_hw_value()' to obtain the hw value
from the passed bitrate, there is a chance of out of bound array access
when wrong bitrate is passed. This is fixed by comparing the bitrates
within the correct size of the ath10k_rates array.
Fixes commit f279294e9ee2 ("ath10k: add support for configuring management
packet rate"). Also correction made to some indents used in the above commit.
Signed-off-by: Sriram R <srirrama@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e141eea7dd8525dd1ef7a925459e455b4d307f
---
--- a/ath10k-4.19/mac.c
+++ b/ath10k-4.19/mac.c
@@ -165,7 +165,7 @@ static int ath10k_mac_get_rate_hw_value(
if (ath10k_mac_bitrate_is_cck(bitrate))
hw_value_prefix = WMI_RATE_PREAMBLE_CCK << 6;
- for (i = 0; i < sizeof(ath10k_rates); i++) {
+ for (i = 0; i < ARRAY_SIZE(ath10k_rates); i++) {
if (ath10k_rates[i].bitrate == bitrate)
return hw_value_prefix | ath10k_rates[i].hw_value;
}
@@ -6644,22 +6644,22 @@ static void ath10k_bss_info_changed(stru
return;
}
- sband = ar->hw->wiphy->bands[def.chan->band];
- basic_rate_idx = ffs(vif->bss_conf.basic_rates) - 1;
- bitrate = sband->bitrates[basic_rate_idx].bitrate;
-
- hw_rate_code = ath10k_mac_get_rate_hw_value(bitrate);
- if (hw_rate_code < 0) {
- ath10k_warn(ar, "bitrate not supported %d\n", bitrate);
- mutex_unlock(&ar->conf_mutex);
- return;
- }
+ sband = ar->hw->wiphy->bands[def.chan->band];
+ basic_rate_idx = ffs(vif->bss_conf.basic_rates) - 1;
+ bitrate = sband->bitrates[basic_rate_idx].bitrate;
+
+ hw_rate_code = ath10k_mac_get_rate_hw_value(bitrate);
+ if (hw_rate_code < 0) {
+ ath10k_warn(ar, "bitrate not supported %d\n", bitrate);
+ mutex_unlock(&ar->conf_mutex);
+ return;
+ }
- vdev_param = ar->wmi.vdev_param->mgmt_rate;
- ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
- hw_rate_code);
- if (ret)
- ath10k_warn(ar, "failed to set mgmt tx rate %d\n", ret);
+ vdev_param = ar->wmi.vdev_param->mgmt_rate;
+ ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
+ hw_rate_code);
+ if (ret)
+ ath10k_warn(ar, "failed to set mgmt tx rate %d\n", ret);
}
mutex_unlock(&ar->conf_mutex);

View File

@ -1,43 +0,0 @@
From: Pradeep kumar Chitrapu <pradeepc@codeaurora.org>
Date: Mon, 10 Dec 2018 20:56:11 -0800
Subject: ath10k: fix incorrect multicast/broadcast rate setting
Invalid rate code is sent to firmware when multicast rate value of 0 is
sent to driver indicating disabled case, causing broken mesh path.
so fix that.
Tested on QCA9984 with firmware 10.4-3.6.1-00827
Fixes: cd93b83ad92 ("ath10k: support for multicast rate control")
Co-developed-by: Zhi Chen <zhichen@codeaurora.org>
Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Origin: other, https://patchwork.kernel.org/patch/10723033/
--- a/ath10k-4.19/mac.c
+++ b/ath10k-4.19/mac.c
@@ -6429,8 +6429,8 @@ static void ath10k_bss_info_changed(stru
struct cfg80211_chan_def def;
u32 vdev_param, pdev_param, slottime, preamble;
u16 bitrate, hw_value;
- u8 rate, basic_rate_idx;
- int rateidx, ret = 0, hw_rate_code;
+ u8 rate, basic_rate_idx, rateidx;
+ int ret = 0, hw_rate_code, mcast_rate;
enum nl80211_band band;
const struct ieee80211_supported_band *sband;
@@ -6603,7 +6603,11 @@ static void ath10k_bss_info_changed(stru
if (changed & BSS_CHANGED_MCAST_RATE &&
!WARN_ON(ath10k_mac_vif_chan(arvif->vif, &def))) {
band = def.chan->band;
- rateidx = vif->bss_conf.mcast_rate[band] - 1;
+ mcast_rate = vif->bss_conf.mcast_rate[band];
+ if (mcast_rate > 0)
+ rateidx = mcast_rate - 1;
+ else
+ rateidx = ffs(vif->bss_conf.basic_rates) - 1;
if (ar->phy_capability & WHAL_WLAN_11A_CAPABILITY)
rateidx += ATH10K_MAC_FIRST_OFDM_RATE_IDX;

View File

@ -9,58 +9,6 @@ mcast_rate set for a wifi-iface.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
--- a/ath10k-4.19/mac.c
+++ b/ath10k-4.19/mac.c
@@ -6625,6 +6625,7 @@ static void ath10k_bss_info_changed(stru
"mac vdev %d mcast_rate %x\n",
arvif->vdev_id, rate);
+ arvif->mcast_rate[band] = rate;
vdev_param = ar->wmi.vdev_param->mcast_data_rate;
ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
vdev_param, rate);
@@ -6633,6 +6634,7 @@ static void ath10k_bss_info_changed(stru
"failed to set mcast rate on vdev %i: %d\n",
arvif->vdev_id, ret);
+ arvif->bcast_rate[band] = rate;
vdev_param = ar->wmi.vdev_param->bcast_data_rate;
ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
vdev_param, rate);
@@ -6659,6 +6661,7 @@ static void ath10k_bss_info_changed(stru
return;
}
+ arvif->mgt_rate[def.chan->band] = hw_rate_code;
vdev_param = ar->wmi.vdev_param->mgmt_rate;
ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
hw_rate_code);
--- a/ath10k-5.2/mac.c
+++ b/ath10k-5.2/mac.c
@@ -6742,6 +6742,7 @@ static void ath10k_bss_info_changed(stru
"mac vdev %d mcast_rate %x\n",
arvif->vdev_id, rate);
+ arvif->mcast_rate[band] = rate;
vdev_param = ar->wmi.vdev_param->mcast_data_rate;
ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
vdev_param, rate);
@@ -6750,6 +6751,7 @@ static void ath10k_bss_info_changed(stru
"failed to set mcast rate on vdev %i: %d\n",
arvif->vdev_id, ret);
+ arvif->bcast_rate[band] = rate;
vdev_param = ar->wmi.vdev_param->bcast_data_rate;
ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
vdev_param, rate);
@@ -6776,6 +6778,7 @@ static void ath10k_bss_info_changed(stru
return;
}
+ arvif->mgt_rate[def.chan->band] = hw_rate_code;
vdev_param = ar->wmi.vdev_param->mgmt_rate;
ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
hw_rate_code);
--- a/ath10k-5.4/mac.c
+++ b/ath10k-5.4/mac.c
@@ -6793,6 +6793,7 @@ static void ath10k_bss_info_changed(stru

View File

@ -1,41 +0,0 @@
From 5db4c4b9559f8cddd5f7f74e58c7b8f172120e6d Mon Sep 17 00:00:00 2001
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date: Tue, 23 Jul 2019 21:00:01 +0300
Subject: [PATCH] mac80211: pass the vif to cancel_remain_on_channel
This low level driver can find it useful to get the vif
when a remain on channel session is cancelled.
iwlwifi will need this soon.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://lore.kernel.org/r/20190723180001.5828-1-emmanuel.grumbach@intel.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
drivers/net/wireless/ath/ath10k/mac.c | 3 ++-
10 files changed, 4 insertions(+), 2 deletions(-)
--- a/ath10k-4.19/mac.c
+++ b/ath10k-4.19/mac.c
@@ -7783,7 +7783,8 @@ exit:
return ret;
}
-static int ath10k_cancel_remain_on_channel(struct ieee80211_hw *hw)
+static int ath10k_cancel_remain_on_channel(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif)
{
struct ath10k *ar = hw->priv;
--- a/ath10k-5.2/mac.c
+++ b/ath10k-5.2/mac.c
@@ -7893,7 +7893,8 @@ exit:
return ret;
}
-static int ath10k_cancel_remain_on_channel(struct ieee80211_hw *hw)
+static int ath10k_cancel_remain_on_channel(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif)
{
struct ath10k *ar = hw->priv;

View File

@ -0,0 +1,598 @@
From: Sebastian Gottschall <s.gottschall@newmedia-net.de>
Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 based
chipsets with on chipset connected led's using WMI Firmware API. The LED
device will get available named as "ath10k-phyX" at sysfs and can be controlled
with various triggers. adds also debugfs interface for gpio control.
This patch is specific for OpenWRt base, as is use old backported package
with old wireless source. Support for QCA9984 is removed.
Reworked to use ath10k-ct custom source
Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
Reviewed-by: Steve deRosier <derosier@cal-sierra.com>
[kvalo: major reorg and cleanup]
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
v13:
* only compile tested!
* fix all checkpatch warnings
* fix commit log
* sizeof(struct ath10k_gpiocontrol) -> sizeof(*gpio)
* unsigned -> unsigned int
* remove GPIOLIB code, that should be added in a separate patch
* rename gpio.c to leds.c
* add leds.h
* rename some functions:
ath10k_attach_led() -> ath10k_leds_register()
ath10k_unregister_led() -> ath10k_leds_unregister()
ath10k_reset_led_pin() -> ath10k_leds_start()
* call ath10k_leds_unregister() before ath10k_thermal_unregister() to preserve ordering
* call ath10k_leds_start() only from ath10k_core_start() and not from mac.c
* rename struct ath10k_gpiocontrol as anonymous function under struct
ath10k::leds, no need for memory allocation
* merge ath10k_add_led() to ath10k_attach_led(), which is it's only caller
* remove #if IS_ENABLED() checks from most of places, memory savings from those were not worth it
* Kconfig help text improvement and move it lower in the menu, also don't enable it by default
* switch to set_brightness_blocking() so that the callback can sleep,
then no need to use ath10k_wmi_cmd_send_nowait() and can take mutex
to access ar->state
* don't touch ath10k_wmi_pdev_get_temperature()
* as QCA6174/QCA9377 are not (yet) supported don't add the command to WMI-TLV interface
* remove debugfs interface, that should be added in another patch
* cleanup includes
ath10k-5.4/Kconfig | 10 +++
ath10k-5.4/Makefile | 1 +
ath10k-5.4/core.c | 22 +++++++
ath10k-5.4/core.h | 9 ++-
ath10k-5.4/hw.h | 1 +
ath10k-5.4/leds.c | 103 ++++++++++++++++++++++++++++++
ath10k-5.4/leds.h | 45 +++++++++++++
ath10k-5.4/mac.c | 1 +
ath10k-5.4/wmi-ops.h | 32 ++++++++++
ath10k-5.4/wmi-tlv.c | 2 +
ath10k-5.4/wmi.c | 54 ++++++++++++++++
ath10k-5.4/wmi.h | 35 ++++++++++
12 files changed, 314 insertions(+), 1 deletion(-)
create mode 100644 ath10k-5.4/leds.c
create mode 100644 ath10k-5.4/leds.h
--- a/ath10k-5.4/Kconfig
+++ b/ath10k-5.4/Kconfig
@@ -66,6 +66,16 @@ config ATH10K_DEBUGFS
If unsure, say Y to make it easier to debug problems.
+config ATH10K_LEDS
+ bool "Atheros ath10k LED support"
+ depends on ATH10K
+ select MAC80211_LEDS
+ select LEDS_CLASS
+ select NEW_LEDS
+ default y
+ ---help---
+ This option is necessary, if you want LED support for chipset connected led pins. If unsure, say N.
+
config ATH10K_SPECTRAL
bool "Atheros ath10k spectral scan support"
depends on ATH10K_DEBUGFS
--- a/ath10k-5.4/Makefile
+++ b/ath10k-5.4/Makefile
@@ -19,6 +19,7 @@ ath10k_core-$(CONFIG_ATH10K_SPECTRAL) +=
ath10k_core-$(CONFIG_NL80211_TESTMODE) += testmode.o
ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o
ath10k_core-$(CONFIG_THERMAL) += thermal.o
+ath10k_core-$(CONFIG_ATH10K_LEDS) += leds.o
ath10k_core-$(CONFIG_MAC80211_DEBUGFS) += debugfs_sta.o
ath10k_core-$(CONFIG_PM) += wow.o
ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o
--- a/ath10k-5.4/core.c
+++ b/ath10k-5.4/core.c
@@ -25,6 +25,7 @@
#include "testmode.h"
#include "wmi-ops.h"
#include "coredump.h"
+#include "leds.h"
/* Disable ath10k-ct DBGLOG output by default */
unsigned int ath10k_debug_mask = ATH10K_DBG_NO_DBGLOG;
@@ -67,6 +68,7 @@ static const struct ath10k_hw_params ath
.dev_id = QCA988X_2_0_DEVICE_ID,
.bus = ATH10K_BUS_PCI,
.name = "qca988x hw2.0",
+ .led_pin = 1,
.patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
@@ -137,6 +139,7 @@ static const struct ath10k_hw_params ath
.dev_id = QCA9887_1_0_DEVICE_ID,
.bus = ATH10K_BUS_PCI,
.name = "qca9887 hw1.0",
+ .led_pin = 1,
.patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
@@ -344,6 +347,7 @@ static const struct ath10k_hw_params ath
.dev_id = QCA99X0_2_0_DEVICE_ID,
.bus = ATH10K_BUS_PCI,
.name = "qca99x0 hw2.0",
+ .led_pin = 17,
.patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.otp_exe_param = 0x00000700,
@@ -385,6 +389,7 @@ static const struct ath10k_hw_params ath
.dev_id = QCA9984_1_0_DEVICE_ID,
.bus = ATH10K_BUS_PCI,
.name = "qca9984/qca9994 hw1.0",
+ .led_pin = 17,
.patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
@@ -433,6 +438,7 @@ static const struct ath10k_hw_params ath
.dev_id = QCA9888_2_0_DEVICE_ID,
.bus = ATH10K_BUS_PCI,
.name = "qca9888 hw2.0",
+ .led_pin = 17,
.patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
@@ -3573,6 +3579,10 @@ int ath10k_core_start(struct ath10k *ar,
ath10k_wmi_check_apply_board_power_ctl_table(ar);
}
+ status = ath10k_leds_start(ar);
+ if (status)
+ goto err_hif_stop;
+
return 0;
err_hif_stop:
@@ -3829,9 +3839,18 @@ static void ath10k_core_register_work(st
goto err_spectral_destroy;
}
+ status = ath10k_leds_register(ar);
+ if (status) {
+ ath10k_err(ar, "could not register leds: %d\n",
+ status);
+ goto err_thermal_unregister;
+ }
+
set_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags);
return;
+err_thermal_unregister:
+ ath10k_thermal_unregister(ar);
err_spectral_destroy:
ath10k_spectral_destroy(ar);
err_debug_destroy:
@@ -3891,6 +3910,8 @@ void ath10k_core_unregister(struct ath10
if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
return;
+ ath10k_leds_unregister(ar);
+
ath10k_thermal_unregister(ar);
/* Stop spectral before unregistering from mac80211 to remove the
* relayfs debugfs file cleanly. Otherwise the parent debugfs tree
--- a/ath10k-5.4/core.h
+++ b/ath10k-5.4/core.h
@@ -14,6 +14,7 @@
#include <linux/pci.h>
#include <linux/uuid.h>
#include <linux/time.h>
+#include <linux/leds.h>
#include "htt.h"
#include "htc.h"
@@ -1469,6 +1470,13 @@ struct ath10k {
} testmode;
struct {
+ struct gpio_led wifi_led;
+ struct led_classdev cdev;
+ char label[48];
+ u32 gpio_state_pin;
+ } leds;
+
+ struct {
/* protected by data_lock */
u32 fw_crash_counter;
u32 fw_warm_reset_counter;
--- a/ath10k-5.4/hw.h
+++ b/ath10k-5.4/hw.h
@@ -518,6 +518,7 @@ struct ath10k_hw_params {
const char *name;
u32 patch_load_addr;
int uart_pin;
+ int led_pin;
u32 otp_exe_param;
/* Type of hw cycle counter wraparound logic, for more info
--- /dev/null
+++ b/ath10k-5.4/leds.c
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2005-2011 Atheros Communications Inc.
+ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
+ * Copyright (c) 2018 Sebastian Gottschall <s.gottschall@dd-wrt.com>
+ * Copyright (c) 2018, The Linux Foundation. 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.
+ */
+
+#include <linux/leds.h>
+
+#include "core.h"
+#include "wmi.h"
+#include "wmi-ops.h"
+
+#include "leds.h"
+
+static int ath10k_leds_set_brightness_blocking(struct led_classdev *led_cdev,
+ enum led_brightness brightness)
+{
+ struct ath10k *ar = container_of(led_cdev, struct ath10k,
+ leds.cdev);
+ struct gpio_led *led = &ar->leds.wifi_led;
+
+ mutex_lock(&ar->conf_mutex);
+
+ if (ar->state != ATH10K_STATE_ON)
+ goto out;
+
+ ar->leds.gpio_state_pin = (brightness != LED_OFF) ^ led->active_low;
+ ath10k_wmi_gpio_output(ar, led->gpio, ar->leds.gpio_state_pin);
+
+out:
+ mutex_unlock(&ar->conf_mutex);
+
+ return 0;
+}
+
+int ath10k_leds_start(struct ath10k *ar)
+{
+ if (ar->hw_params.led_pin == 0)
+ /* leds not supported */
+ return 0;
+
+ /* under some circumstances, the gpio pin gets reconfigured
+ * to default state by the firmware, so we need to
+ * reconfigure it this behaviour has only ben seen on
+ * QCA9984 and QCA99XX devices so far
+ */
+ ath10k_wmi_gpio_config(ar, ar->hw_params.led_pin, 0,
+ WMI_GPIO_PULL_NONE, WMI_GPIO_INTTYPE_DISABLE);
+ ath10k_wmi_gpio_output(ar, ar->hw_params.led_pin, 1);
+
+ return 0;
+}
+
+int ath10k_leds_register(struct ath10k *ar)
+{
+ int ret;
+
+ if (ar->hw_params.led_pin == 0)
+ /* leds not supported */
+ return 0;
+
+ snprintf(ar->leds.label, sizeof(ar->leds.label), "ath10k-%s",
+ wiphy_name(ar->hw->wiphy));
+ ar->leds.wifi_led.active_low = 1;
+ ar->leds.wifi_led.gpio = ar->hw_params.led_pin;
+ ar->leds.wifi_led.name = ar->leds.label;
+ ar->leds.wifi_led.default_state = LEDS_GPIO_DEFSTATE_KEEP;
+
+ ar->leds.cdev.name = ar->leds.label;
+ ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
+
+ /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
+ ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
+
+ ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
+void ath10k_leds_unregister(struct ath10k *ar)
+{
+ if (ar->hw_params.led_pin == 0)
+ /* leds not supported */
+ return;
+
+ led_classdev_unregister(&ar->leds.cdev);
+}
+
--- /dev/null
+++ b/ath10k-5.4/leds.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2018, The Linux Foundation. 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.
+ */
+#ifndef _LEDS_H_
+#define _LEDS_H_
+
+#include "core.h"
+
+#ifdef CONFIG_ATH10K_LEDS
+void ath10k_leds_unregister(struct ath10k *ar);
+int ath10k_leds_start(struct ath10k *ar);
+int ath10k_leds_register(struct ath10k *ar);
+#else
+static inline void ath10k_leds_unregister(struct ath10k *ar)
+{
+}
+
+static inline int ath10k_leds_start(struct ath10k *ar)
+{
+ return 0;
+}
+
+static inline int ath10k_leds_register(struct ath10k *ar)
+{
+ return 0;
+}
+
+#endif
+#endif /* _LEDS_H_ */
--- a/ath10k-5.4/mac.c
+++ b/ath10k-5.4/mac.c
@@ -24,6 +24,7 @@
#include "wmi-tlv.h"
#include "wmi-ops.h"
#include "wow.h"
+#include "leds.h"
/*********/
/* Rates */
--- a/ath10k-5.4/wmi-ops.h
+++ b/ath10k-5.4/wmi-ops.h
@@ -218,7 +218,10 @@ struct wmi_ops {
struct sk_buff *(*gen_bb_timing)
(struct ath10k *ar,
const struct wmi_bb_timing_cfg_arg *arg);
+ struct sk_buff *(*gen_gpio_config)(struct ath10k *ar, u32 gpio_num,
+ u32 input, u32 pull_type, u32 intr_mode);
+ struct sk_buff *(*gen_gpio_output)(struct ath10k *ar, u32 gpio_num, u32 set);
};
int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
@@ -1105,6 +1108,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *
return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid);
}
+static inline int ath10k_wmi_gpio_config(struct ath10k *ar, u32 gpio_num,
+ u32 input, u32 pull_type, u32 intr_mode)
+{
+ struct sk_buff *skb;
+
+ if (!ar->wmi.ops->gen_gpio_config)
+ return -EOPNOTSUPP;
+
+ skb = ar->wmi.ops->gen_gpio_config(ar, gpio_num, input, pull_type, intr_mode);
+ if (IS_ERR(skb))
+ return PTR_ERR(skb);
+
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_config_cmdid);
+}
+
+static inline int ath10k_wmi_gpio_output(struct ath10k *ar, u32 gpio_num, u32 set)
+{
+ struct sk_buff *skb;
+
+ if (!ar->wmi.ops->gen_gpio_config)
+ return -EOPNOTSUPP;
+
+ skb = ar->wmi.ops->gen_gpio_output(ar, gpio_num, set);
+ if (IS_ERR(skb))
+ return PTR_ERR(skb);
+
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_output_cmdid);
+}
+
static inline int
ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level)
{
--- a/ath10k-5.4/wmi-tlv.c
+++ b/ath10k-5.4/wmi-tlv.c
@@ -4364,6 +4364,8 @@ static const struct wmi_ops wmi_tlv_ops
.gen_echo = ath10k_wmi_tlv_op_gen_echo,
.gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf,
.gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable,
+ /* .gen_gpio_config not implemented */
+ /* .gen_gpio_output not implemented */
};
static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = {
--- a/ath10k-5.4/wmi.c
+++ b/ath10k-5.4/wmi.c
@@ -8295,6 +8295,49 @@ ath10k_wmi_op_gen_peer_set_param(struct
return skb;
}
+static struct sk_buff *ath10k_wmi_op_gen_gpio_config(struct ath10k *ar,
+ u32 gpio_num, u32 input,
+ u32 pull_type, u32 intr_mode)
+{
+ struct wmi_gpio_config_cmd *cmd;
+ struct sk_buff *skb;
+
+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
+ if (!skb)
+ return ERR_PTR(-ENOMEM);
+
+ cmd = (struct wmi_gpio_config_cmd *)skb->data;
+ cmd->pull_type = __cpu_to_le32(pull_type);
+ cmd->gpio_num = __cpu_to_le32(gpio_num);
+ cmd->input = __cpu_to_le32(input);
+ cmd->intr_mode = __cpu_to_le32(intr_mode);
+
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_config gpio_num 0x%08x input 0x%08x pull_type 0x%08x intr_mode 0x%08x\n",
+ gpio_num, input, pull_type, intr_mode);
+
+ return skb;
+}
+
+static struct sk_buff *ath10k_wmi_op_gen_gpio_output(struct ath10k *ar,
+ u32 gpio_num, u32 set)
+{
+ struct wmi_gpio_output_cmd *cmd;
+ struct sk_buff *skb;
+
+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
+ if (!skb)
+ return ERR_PTR(-ENOMEM);
+
+ cmd = (struct wmi_gpio_output_cmd *)skb->data;
+ cmd->gpio_num = __cpu_to_le32(gpio_num);
+ cmd->set = __cpu_to_le32(set);
+
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_output gpio_num 0x%08x set 0x%08x\n",
+ gpio_num, set);
+
+ return skb;
+}
+
static struct sk_buff *
ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id,
enum wmi_sta_ps_mode psmode)
@@ -10094,6 +10137,9 @@ static const struct wmi_ops wmi_ops = {
.fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill,
.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
.gen_echo = ath10k_wmi_op_gen_echo,
+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
+
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
@@ -10164,6 +10210,8 @@ static const struct wmi_ops wmi_10_1_ops
.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
.gen_echo = ath10k_wmi_op_gen_echo,
+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
@@ -10243,6 +10291,8 @@ static const struct wmi_ops wmi_10_2_ops
.gen_delba_send = ath10k_wmi_op_gen_delba_send,
.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
/* .gen_pdev_enable_adaptive_cca not implemented */
};
@@ -10314,6 +10364,8 @@ static const struct wmi_ops wmi_10_2_4_o
ath10k_wmi_op_gen_pdev_enable_adaptive_cca,
.get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype,
.gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing,
+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
@@ -10395,6 +10447,8 @@ static const struct wmi_ops wmi_10_4_ops
.gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info,
.gen_echo = ath10k_wmi_op_gen_echo,
.gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config,
+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
};
int ath10k_wmi_attach(struct ath10k *ar)
--- a/ath10k-5.4/wmi.h
+++ b/ath10k-5.4/wmi.h
@@ -3110,6 +3110,41 @@ enum wmi_10_4_feature_mask {
};
+/* WMI_GPIO_CONFIG_CMDID */
+enum {
+ WMI_GPIO_PULL_NONE,
+ WMI_GPIO_PULL_UP,
+ WMI_GPIO_PULL_DOWN,
+};
+
+enum {
+ WMI_GPIO_INTTYPE_DISABLE,
+ WMI_GPIO_INTTYPE_RISING_EDGE,
+ WMI_GPIO_INTTYPE_FALLING_EDGE,
+ WMI_GPIO_INTTYPE_BOTH_EDGE,
+ WMI_GPIO_INTTYPE_LEVEL_LOW,
+ WMI_GPIO_INTTYPE_LEVEL_HIGH
+};
+
+/* WMI_GPIO_CONFIG_CMDID */
+struct wmi_gpio_config_cmd {
+ __le32 gpio_num; /* GPIO number to be setup */
+ __le32 input; /* 0 - Output/ 1 - Input */
+ __le32 pull_type; /* Pull type defined above */
+ __le32 intr_mode; /* Interrupt mode defined above (Input) */
+} __packed;
+
+/* WMI_GPIO_OUTPUT_CMDID */
+struct wmi_gpio_output_cmd {
+ __le32 gpio_num; /* GPIO number to be setup */
+ __le32 set; /* Set the GPIO pin*/
+} __packed;
+
+/* WMI_GPIO_INPUT_EVENTID */
+struct wmi_gpio_input_event {
+ __le32 gpio_num; /* GPIO number which changed state */
+} __packed;
+
struct wmi_ext_resource_config_10_4_cmd {
/* contains enum wmi_host_platform_type */
__le32 host_platform_config;

View File

@ -1,127 +0,0 @@
From 79c9d7aabae1d1da9eea97d83b61e1517a8a2221 Mon Sep 17 00:00:00 2001
From: Mathias Kresin <dev@kresin.me>
Date: Fri, 22 Jun 2018 18:59:44 +0200
Subject: [PATCH] ath10k: use tpt LED trigger by default
Use the tpt LED trigger for each created phy led. Ths way LEDs attached
to the ath10k GPIO pins are indicating the phy status and blink on
traffic.
Signed-off-by: Mathias Kresin <dev@kresin.me>
---
ath10k-4.16/core.h | 4 ++++
ath10k-4.16/leds.c | 4 +---
ath10k-4.16/mac.c | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
--- a/ath10k-4.19/core.h
+++ b/ath10k-4.19/core.h
@@ -1491,6 +1491,10 @@ struct ath10k {
u8 csi_data[4096];
u16 csi_data_len;
+#ifdef CPTCFG_MAC80211_LEDS
+ const char *led_default_trigger;
+#endif
+
/* must be last */
u8 drv_priv[0] __aligned(sizeof(void *));
};
--- a/ath10k-4.19/leds.c
+++ b/ath10k-4.19/leds.c
@@ -81,9 +81,7 @@ int ath10k_leds_register(struct ath10k *
ar->leds.cdev.name = ar->leds.label;
ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
-
- /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
- ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
+ ar->leds.cdev.default_trigger = ar->led_default_trigger;
ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
if (ret)
--- a/ath10k-4.19/mac.c
+++ b/ath10k-4.19/mac.c
@@ -9987,7 +9987,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
- ieee80211_create_tpt_led_trigger(ar->hw,
+ ar->led_default_trigger = ieee80211_create_tpt_led_trigger(ar->hw,
IEEE80211_TPT_LEDTRIG_FL_RADIO, ath10k_tpt_blink,
ARRAY_SIZE(ath10k_tpt_blink));
#endif
--- a/ath10k-5.2/core.h
+++ b/ath10k-5.2/core.h
@@ -1552,6 +1552,10 @@ struct ath10k {
u8 csi_data[4096];
u16 csi_data_len;
+#ifdef CPTCFG_MAC80211_LEDS
+ const char *led_default_trigger;
+#endif
+
/* must be last */
u8 drv_priv[0] __aligned(sizeof(void *));
};
--- a/ath10k-5.2/leds.c
+++ b/ath10k-5.2/leds.c
@@ -81,9 +81,7 @@ int ath10k_leds_register(struct ath10k *
ar->leds.cdev.name = ar->leds.label;
ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
-
- /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
- ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
+ ar->leds.cdev.default_trigger = ar->led_default_trigger;
ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
if (ret)
--- a/ath10k-5.2/mac.c
+++ b/ath10k-5.2/mac.c
@@ -10187,7 +10187,7 @@ int ath10k_mac_register(struct ath10k *a
ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
#ifdef CPTCFG_MAC80211_LEDS
- ieee80211_create_tpt_led_trigger(ar->hw,
+ ar->led_default_trigger = ieee80211_create_tpt_led_trigger(ar->hw,
IEEE80211_TPT_LEDTRIG_FL_RADIO, ath10k_tpt_blink,
ARRAY_SIZE(ath10k_tpt_blink));
#endif
--- a/ath10k-5.4/core.h
+++ b/ath10k-5.4/core.h
@@ -1573,6 +1573,10 @@ struct ath10k {
u8 csi_data[4096];
u16 csi_data_len;
+#ifdef CPTCFG_MAC80211_LEDS
+ const char *led_default_trigger;
+#endif
+
/* must be last */
u8 drv_priv[0] __aligned(sizeof(void *));
};
--- a/ath10k-5.4/leds.c
+++ b/ath10k-5.4/leds.c
@@ -81,9 +81,7 @@ int ath10k_leds_register(struct ath10k *
ar->leds.cdev.name = ar->leds.label;
ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
-
- /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
- ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
+ ar->leds.cdev.default_trigger = ar->led_default_trigger;
ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
if (ret)
--- a/ath10k-5.4/mac.c
+++ b/ath10k-5.4/mac.c
@@ -10367,7 +10367,7 @@ int ath10k_mac_register(struct ath10k *a
ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
#ifdef CPTCFG_MAC80211_LEDS
- ieee80211_create_tpt_led_trigger(ar->hw,
+ ar->led_default_trigger = ieee80211_create_tpt_led_trigger(ar->hw,
IEEE80211_TPT_LEDTRIG_FL_RADIO, ath10k_tpt_blink,
ARRAY_SIZE(ath10k_tpt_blink));
#endif

View File

@ -0,0 +1,53 @@
From 79c9d7aabae1d1da9eea97d83b61e1517a8a2221 Mon Sep 17 00:00:00 2001
From: Mathias Kresin <dev@kresin.me>
Date: Fri, 22 Jun 2018 18:59:44 +0200
Subject: [PATCH] ath10k: use tpt LED trigger by default
Use the tpt LED trigger for each created phy led. Ths way LEDs attached
to the ath10k GPIO pins are indicating the phy status and blink on
traffic.
Signed-off-by: Mathias Kresin <dev@kresin.me>
---
ath10k-5.4/core.h | 4 ++++
ath10k-5.4/leds.c | 4 +---
ath10k-5.4/mac.c | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
--- a/ath10k-5.4/core.h
+++ b/ath10k-5.4/core.h
@@ -1573,6 +1573,10 @@ struct ath10k {
u8 csi_data[4096];
u16 csi_data_len;
+#ifdef CPTCFG_MAC80211_LEDS
+ const char *led_default_trigger;
+#endif
+
/* must be last */
u8 drv_priv[0] __aligned(sizeof(void *));
};
--- a/ath10k-5.4/leds.c
+++ b/ath10k-5.4/leds.c
@@ -81,9 +81,7 @@ int ath10k_leds_register(struct ath10k *
ar->leds.cdev.name = ar->leds.label;
ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
-
- /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
- ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
+ ar->leds.cdev.default_trigger = ar->led_default_trigger;
ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
if (ret)
--- a/ath10k-5.4/mac.c
+++ b/ath10k-5.4/mac.c
@@ -10367,7 +10367,7 @@ int ath10k_mac_register(struct ath10k *a
ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
#ifdef CPTCFG_MAC80211_LEDS
- ieee80211_create_tpt_led_trigger(ar->hw,
+ ar->led_default_trigger = ieee80211_create_tpt_led_trigger(ar->hw,
IEEE80211_TPT_LEDTRIG_FL_RADIO, ath10k_tpt_blink,
ARRAY_SIZE(ath10k_tpt_blink));
#endif

View File

@ -1,39 +0,0 @@
From bbf0a8af2261bc7ae39b227ff6a1e9f45a008c27 Mon Sep 17 00:00:00 2001
From: Sven Eckelmann <sven.eckelmann@openmesh.com>
Date: Mon, 30 Jul 2018 17:31:41 +0200
Subject: [PATCH] ath10k: Limit available channels via DT ieee80211-freq-limit
Tri-band devices (1x 2.4GHz + 2x 5GHz) often incorporate special filters in
the RX and TX path. These filtered channel can in theory still be used by
the hardware but the signal strength is reduced so much that it makes no
sense.
There is already a DT property to limit the available channels but ath10k
has to manually call this functionality to limit the currrently set wiphy
channels further.
Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Forwarded: https://patchwork.kernel.org/patch/10549245/
---
drivers/net/wireless/ath/ath10k/mac.c | 2 ++
1 file changed, 2 insertions(+)
--- a/ath10k-4.19/mac.c
+++ b/ath10k-4.19/mac.c
@@ -18,6 +18,7 @@
#include "mac.h"
+#include <net/cfg80211.h>
#include <net/mac80211.h>
#include <linux/etherdevice.h>
#include <linux/acpi.h>
@@ -9711,6 +9712,7 @@ int ath10k_mac_register(struct ath10k *a
ar->hw->wiphy->bands[NL80211_BAND_5GHZ] = band;
}
+ wiphy_read_of_freq_limits(ar->hw->wiphy);
ath10k_mac_setup_ht_vht_cap(ar);
ar->hw->wiphy->interface_modes =

View File

@ -1,31 +1,3 @@
--- a/ath10k-4.19/htt.h
+++ b/ath10k-4.19/htt.h
@@ -237,7 +237,11 @@ enum htt_rx_ring_flags {
};
#define HTT_RX_RING_SIZE_MIN 128
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
#define HTT_RX_RING_SIZE_MAX 2048
+#else
+#define HTT_RX_RING_SIZE_MAX 512
+#endif
#define HTT_RX_RING_SIZE HTT_RX_RING_SIZE_MAX
#define HTT_RX_RING_FILL_LEVEL (((HTT_RX_RING_SIZE) / 2) - 1)
#define HTT_RX_RING_FILL_LEVEL_DUAL_MAC (HTT_RX_RING_SIZE - 1)
--- a/ath10k-5.2/htt.h
+++ b/ath10k-5.2/htt.h
@@ -225,7 +225,11 @@ enum htt_rx_ring_flags {
};
#define HTT_RX_RING_SIZE_MIN 128
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
#define HTT_RX_RING_SIZE_MAX 2048
+#else
+#define HTT_RX_RING_SIZE_MAX 512
+#endif
#define HTT_RX_RING_SIZE HTT_RX_RING_SIZE_MAX
#define HTT_RX_RING_FILL_LEVEL (((HTT_RX_RING_SIZE) / 2) - 1)
#define HTT_RX_RING_FILL_LEVEL_DUAL_MAC (HTT_RX_RING_SIZE - 1)
--- a/ath10k-5.4/htt.h
+++ b/ath10k-5.4/htt.h
@@ -225,7 +225,11 @@ enum htt_rx_ring_flags {

View File

@ -1,103 +1,3 @@
--- a/ath10k-4.19/pci.c
+++ b/ath10k-4.19/pci.c
@@ -142,7 +142,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 512,
+#else
+ .dest_nentries = 128,
+#endif
.recv_cb = ath10k_pci_htt_htc_rx_cb,
},
@@ -151,7 +155,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 128,
+#else
+ .dest_nentries = 64,
+#endif
.recv_cb = ath10k_pci_htc_rx_cb,
},
@@ -178,7 +186,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 512,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 512,
+#else
+ .dest_nentries = 128,
+#endif
.recv_cb = ath10k_pci_htt_rx_cb,
},
@@ -203,7 +215,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 128,
+#else
+ .dest_nentries = 96,
+#endif
.recv_cb = ath10k_pci_pktlog_rx_cb,
},
--- a/ath10k-5.2/pci.c
+++ b/ath10k-5.2/pci.c
@@ -131,7 +131,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 512,
+#else
+ .dest_nentries = 128,
+#endif
.recv_cb = ath10k_pci_htt_htc_rx_cb,
},
@@ -140,7 +144,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 128,
+#else
+ .dest_nentries = 64,
+#endif
.recv_cb = ath10k_pci_htc_rx_cb,
},
@@ -167,7 +175,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 512,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 512,
+#else
+ .dest_nentries = 128,
+#endif
.recv_cb = ath10k_pci_htt_rx_cb,
},
@@ -192,7 +204,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 128,
+#else
+ .dest_nentries = 96,
+#endif
.recv_cb = ath10k_pci_pktlog_rx_cb,
},
--- a/ath10k-5.4/pci.c
+++ b/ath10k-5.4/pci.c
@@ -131,7 +131,11 @@ static struct ce_attr host_ce_config_wla

View File

@ -1,81 +0,0 @@
From cc8ec75f5ad4acf9babe5e26a10c9bca10624593 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sun, 18 Aug 2019 15:33:51 +0200
Subject: [PATCH] ath10k: Check if station exists before forwarding tx airtime
report
It looks like the FW on QCA9984 already reports the tx airtimes before
the station is added to the peer entry. The peer entry is created in
ath10k_peer_map_event() just with the vdev_id and the ethaddr, but
not with a station entry, this is added later in ath10k_peer_create() in
callbacks from mac80211.
When there is no sta added to the peer entry, this function fails
because it calls ieee80211_sta_register_airtime() with NULL.
This was reported in OpenWrt some time ago:
https://bugs.openwrt.org/index.php?do=details&task_id=2414
This commit should fix this crash:
[ 75.991714] Unable to handle kernel paging request at virtual address fffff9e8
[ 75.991756] pgd = c0204000
[ 75.997955] [fffff9e8] *pgd=5fdfd861, *pte=00000000, *ppte=00000000
[ 76.000537] Internal error: Oops: 37 [#1] SMP ARM
[ 76.006686] Modules linked in: pppoe ppp_async ath10k_pci ath10k_core ath pptp pppox ppp_mppe ppp_generic mac80211 iptable_nat ipt_REJECT ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_tcpmss xt_statistic xt_state xt_recent xt_nat xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_helper xt_esp xt_ecn xt_dscp xt_conntrack xt_connmark xt_connlimit xt_connbytes xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_HL xt_FLOWOFFLOAD xt_DSCP xt_CT xt_CLASSIFY usbserial slhc nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack_netlink iptable_raw iptable_mangle iptable_filter ipt_ah ipt_ECN ip_tables crc_ccitt compat chaoskey fuse sch_cake sch_tbf sch_ingress sch_htb sch_hfsc em_u32 cls_u32
[ 76.059974] cls_tcindex cls_route cls_matchall cls_fw cls_flow cls_basic act_skbedit act_mirred ledtrig_usbport xt_set ip_set_list_set ip_set_hash_netportnet ip_set_hash_netport ip_set_hash_netnet ip_set_hash_netiface ip_set_hash_net ip_set_hash_mac ip_set_hash_ipportnet ip_set_hash_ipportip ip_set_hash_ipport ip_set_hash_ipmark ip_set_hash_ip ip_set_bitmap_port ip_set_bitmap_ipmac ip_set_bitmap_ip ip_set nfnetlink ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6t_NPT ip6t_MASQUERADE nf_nat_masquerade_ipv6 nf_nat nf_conntrack nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 msdos ip_gre gre ifb sit tunnel4 ip_tunnel tun vfat fat hfsplus cifs nls_utf8 nls_iso8859_15 nls_iso8859_1 nls_cp850 nls_cp437 nls_cp1250 sha1_generic md5 md4
[ 76.130634] usb_storage leds_gpio xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_of_simple ohci_platform ohci_hcd phy_qcom_dwc3 ahci ehci_platform sd_mod ahci_platform libahci_platform libahci libata scsi_mod ehci_hcd gpio_button_hotplug ext4 mbcache jbd2 exfat crc32c_generic
[ 76.154772] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.14.132 #0
[ 76.177001] Hardware name: Generic DT based system
[ 76.182990] task: c0b06d80 task.stack: c0b00000
[ 76.187832] PC is at ieee80211_sta_register_airtime+0x24/0x148 [mac80211]
[ 76.192211] LR is at ath10k_htt_t2h_msg_handler+0x678/0x10f4 [ath10k_core]
[ 76.199052] pc : [<bf75bfac>] lr : [<bf83e8b0>] psr: a0000113
[ 76.205820] sp : c0b01d54 ip : 00000002 fp : bf869c0c
[ 76.211981] r10: 0000003c r9 : dbdca138 r8 : 00060002
[ 76.217192] r7 : 00000000 r6 : dabe1150 r5 : 00000000 r4 : dbdc95c0
[ 76.222401] r3 : 00000000 r2 : 00060002 r1 : 00000000 r0 : 00000000
[ 76.229003] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 76.235509] Control: 10c5787d Table: 5c94006a DAC: 00000051
[ 76.242716] Process swapper/0 (pid: 0, stack limit = 0xc0b00210)
[ 76.248446] Stack: (0xc0b01d54 to 0xc0b02000)
[ 76.254532] 1d40: dbdc95c0 00000000 dabe1150
[ 76.258808] 1d60: 00000001 dabe1150 dbdca138 0000003c bf869c0c bf83e8b0 00000002 c0314b10
[ 76.266969] 1d80: dbdc9c70 00000001 00000001 dabe114c 00010000 00000000 dbdcd724 bf88f3d8
[ 76.275126] 1da0: c0310d28 db393c00 dbdc95c0 00000000 c0b01dd0 c07fb4c4 dbdcd724 00000001
[ 76.283286] 1dc0: 00000022 bf88b09c db393c00 00000022 c0b01dd0 c0b01dd0 00000000 dbdcc5c0
[ 76.291445] 1de0: bf88f04c dbdcd654 dbdcd71c dbdc95c0 00000014 dbdcd724 dbdcc5c0 00000005
[ 76.299605] 1e00: 0004b400 bf85c360 00000000 bf87101c c0b01e24 00000006 00000000 dbdc95c0
[ 76.307764] 1e20: 00000001 00000040 0000012c c0b01e80 1cf51000 bf85c448 dbdcd440 dbdc95c0
[ 76.315925] 1e40: dbdca440 ffffa880 00000040 bf88cb68 dbdcd440 00000001 00000040 ffffa880
[ 76.324084] 1e60: c0b02d00 c06d72e0 dd990080 c0a3f080 c0b255dc c0b047e4 c090afac c090e80c
[ 76.332244] 1e80: c0b01e80 c0b01e80 c0b01e88 c0b01e88 dd4cc200 00000000 00000003 c0b0208c
[ 76.340405] 1ea0: c0b02080 40000003 ffffe000 00000100 c0b02080 c03015c8 00000000 00000001
[ 76.348564] 1ec0: dd408000 c0a38210 c0b2c7c0 0000000a ffffa880 c0b02d00 c07fb764 00200102
[ 76.356723] 1ee0: dd4cc268 c0a3e414 00000000 00000000 00000001 dd408000 de803000 00000000
[ 76.364883] 1f00: 00000000 c03247cc c0a3e414 c0368f1c c0b03f60 c0b153cc de80200c de802000
[ 76.373042] 1f20: c0b01f48 c0301488 c0308630 60000013 ffffffff c0b01f7c 00000000 c0b00000
[ 76.381204] 1f40: 00000000 c030c08c 00000001 00000000 00000000 c0315180 ffffe000 c0b03cc0
[ 76.389363] 1f60: c0b03c70 00000000 00000000 c0a2da28 00000000 00000000 c0b01f90 c0b01f98
[ 76.397522] 1f80: c030862c c0308630 60000013 ffffffff 00000051 00000000 ffffe000 c035dd18
[ 76.405681] 1fa0: 000000bf c0b03c40 00000000 c0b2c000 dddfce80 c035e060 c0b2c040 c0a00cf4
[ 76.413842] 1fc0: ffffffff ffffffff 00000000 c0a0067c c0a2da28 00000000 00000000 c0b2c1d4
[ 76.422001] 1fe0: c0b03c5c c0a2da24 c0b07ee0 4220406a 512f04d0 4220807c 00000000 00000000
[ 76.430335] [<bf75bfac>] (ieee80211_sta_register_airtime [mac80211]) from [<00000002>] (0x2)
[ 76.438314] Code: e1cd81f0 e1a08002 e1cda1f8 e58de020 (e5102618)
[ 76.446965] ---[ end trace 227a38ade964d642 ]---
Fixes: bb31b7cb106c ("ath10k: report tx airtime provided by fw")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
--- a/ath10k-5.2/htt_rx.c
+++ b/ath10k-5.2/htt_rx.c
@@ -2568,7 +2568,7 @@ do_generic:
spin_lock_bh(&ar->data_lock);
peer = ath10k_peer_find_by_id(ar, peer_id);
- if (!peer) {
+ if (!peer || !peer->sta) {
spin_unlock_bh(&ar->data_lock);
rcu_read_unlock();
continue;

View File

@ -13,7 +13,7 @@ PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/ltq-dsl-fw-$(PKG_VERSION)
PKG_SOURCE:=ltq-dsl-fw-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
PKG_SOURCE_URL:=https://sources.openwrt.org/
PKG_HASH:=28676d41c4b76e5bf7a2c5eae106a61fb96b93eabc0cb71120575fff9997269f
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
@ -45,8 +45,8 @@ endef
define Package/kmod-ltq-adsl-$(BUILD_VARIANT)/install
$(INSTALL_DIR) $(1)/lib/firmware/
$(CP) $(PKG_BUILD_DIR)/$(FW_NAME)/ltq-dsl-fw-$(ANNEX)-$(SOC).bin $(1)/lib/firmware/
ln -s /lib/firmware/$(FW_NAME)/ltq-dsl-fw-$(ANNEX)-$(SOC).bin $(1)/lib/firmware/adsl.bin
$(CP) $(PKG_BUILD_DIR)/ltq-dsl-fw-$(ANNEX)-$(SOC).bin $(1)/lib/firmware/
ln -s /lib/firmware/ltq-dsl-fw-$(ANNEX)-$(SOC).bin $(1)/lib/firmware/adsl.bin
endef
$(eval $(call BuildPackage,kmod-ltq-adsl-danube-fw-a))

View File

@ -8,7 +8,6 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ltq-adsl-mei
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-adsl-mei-$(BUILD_VARIANT)/
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_CHECK_FORMAT_SECURITY:=0

View File

@ -1,5 +1,5 @@
config LANTIQ_DSL_DEBUG
config LANTIQ_ADSL_DEBUG
bool "verbose debugging"
depends on PACKAGE_kmod-ltq-dsl
depends on PACKAGE_kmod-ltq-adsl
help
Say Y, if you need ltq-dsl to display debug messages.
Say Y, if you need ltq-adsl to display debug messages.

View File

@ -10,15 +10,14 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ltq-adsl
PKG_VERSION:=3.24.4.4
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE:=drv_dsl_cpe_api_danube-$(PKG_VERSION).tar.gz
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-dsl-$(BUILD_VARIANT)/drv_dsl_cpe_api-$(PKG_VERSION)
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
PKG_SOURCE_URL:=https://mirror2.openwrt.org/sources/
PKG_HASH:=eb2ed59715d3bf4e8a1460bbbe2f1660039e0a9f9d72afb1b2b16590094eb33c
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_CHECK_FORMAT_SECURITY:=0
PKG_ASLR_PIE:=0
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/package.mk
@ -39,7 +38,7 @@ KernelPackage/ltq-adsl-danube=$(call KernelPackage/ltq-adsl-template,danube,(TAR
KernelPackage/ltq-adsl-ar9=$(call KernelPackage/ltq-adsl-template,ar9,TARGET_lantiq_xway)
KernelPackage/ltq-adsl-ase=$(call KernelPackage/ltq-adsl-template,ase,TARGET_lantiq_ase)
define KernelPackage/ltq-dsl/config
define KernelPackage/ltq-adsl/config
source "$(SOURCE)/Config.in"
endef
@ -76,7 +75,7 @@ CONFIGURE_ARGS += --enable-add-drv-cflags="-DMODULE -DCONFIG_$(CONFIG_TAG_$(BUIL
CONFIGURE_ARGS += --enable-danube
ifeq ($(CONFIG_LANTIQ_DSL_DEBUG),y)
ifeq ($(CONFIG_LANTIQ_ADSL_DEBUG),y)
CONFIGURE_ARGS += \
--enable-debug=yes \
--enable-debug-prints=yes

View File

@ -82,7 +82,28 @@
if ( (_IOC_TYPE(nCommand) == DSL_IOC_MAGIC_CPE_API) ||
(_IOC_TYPE(nCommand) == DSL_IOC_MAGIC_CPE_API_G997) ||
(_IOC_TYPE(nCommand) == DSL_IOC_MAGIC_CPE_API_PM) ||
@@ -1058,6 +1065,7 @@ static void DSL_DRV_DebugInit(void)
@@ -828,12 +835,19 @@ DSL_int32_t DSL_DRV_ThreadShutdown(
DSL_uint32_t DSL_DRV_SysTimeGet(DSL_uint32_t nOffset)
{
- struct timeval tv;
DSL_uint32_t nTime = 0;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0))
+ struct timeval tv;
memset(&tv, 0, sizeof(tv));
do_gettimeofday(&tv);
nTime = (DSL_uint32_t)tv.tv_sec;
+#else
+ struct timespec64 now;
+
+ ktime_get_real_ts64(&now);
+ nTime = (DSL_uint32_t)now.tv_sec;
+#endif
if ( (nOffset == 0) || (nOffset > nTime) )
{
@@ -1058,6 +1072,7 @@ static void DSL_DRV_DebugInit(void)
/* Entry point of driver */
int __init DSL_ModuleInit(void)
{
@ -90,7 +111,7 @@
DSL_int_t i;
printk(DSL_DRV_CRLF DSL_DRV_CRLF "Infineon CPE API Driver version: %s" DSL_DRV_CRLF,
@@ -1104,7 +1112,8 @@ int __init DSL_ModuleInit(void)
@@ -1104,7 +1119,8 @@ int __init DSL_ModuleInit(void)
}
DSL_DRV_DevNodeInit();
@ -137,7 +158,7 @@
#ifdef INCLUDE_DSL_CPE_API_IFXOS_SUPPORT
/** IFXOS includes*/
--- /dev/null
+++ b/src/ifxmips_mei_interface.h
+++ b/src/include/ifxmips_mei_interface.h
@@ -0,0 +1,702 @@
+/******************************************************************************
+

View File

@ -1,14 +1,15 @@
--- a/src/common/drv_dsl_cpe_os_linux.c
+++ b/src/common/drv_dsl_cpe_os_linux.c
@@ -12,6 +12,7 @@
@@ -11,7 +11,7 @@
#ifdef __LINUX__
#define DSL_INTERN
#include <linux/device.h>
+#include <linux/platform_device.h>
-#include <linux/device.h>
+#include <linux/of_platform.h>
#include "drv_dsl_cpe_api.h"
#include "drv_dsl_cpe_api_ioctl.h"
@@ -1063,7 +1064,7 @@ static void DSL_DRV_DebugInit(void)
@@ -1070,7 +1070,7 @@ static void DSL_DRV_DebugInit(void)
#endif
/* Entry point of driver */
@ -17,7 +18,7 @@
{
struct class *dsl_class;
DSL_int_t i;
@@ -1117,7 +1118,7 @@ int __init DSL_ModuleInit(void)
@@ -1124,7 +1124,7 @@ int __init DSL_ModuleInit(void)
return 0;
}
@ -26,7 +27,7 @@
{
printk("Module will be unloaded"DSL_DRV_CRLF);
@@ -1132,7 +1133,7 @@ void __exit DSL_ModuleCleanup(void)
@@ -1139,7 +1139,7 @@ void __exit DSL_ModuleCleanup(void)
(DSL_uint8_t**)&g_BndFpgaBase);
#endif /* defined(INCLUDE_DSL_CPE_API_VINAX) && defined(INCLUDE_DSL_BONDING)*/
@ -35,7 +36,7 @@
}
#ifndef _lint
@@ -1148,8 +1149,30 @@ module_param(debug_level, byte, 0);
@@ -1155,8 +1155,30 @@ module_param(debug_level, byte, 0);
MODULE_PARM_DESC(debug_level, "set to get more (1) or fewer (4) debug outputs");
#endif /* #ifndef DSL_DEBUG_DISABLE*/

View File

@ -5,10 +5,10 @@
#define DSL_INTERN
+#include <linux/kthread.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/of_platform.h>
@@ -40,7 +41,7 @@ static DSL_ssize_t DSL_DRV_Write(DSL_DRV
#include "drv_dsl_cpe_api.h"
@@ -39,7 +40,7 @@ static DSL_ssize_t DSL_DRV_Write(DSL_DRV
static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_inode_t * pINode, DSL_DRV_file_t * pFile,
DSL_uint_t nCommand, unsigned long nArg);
#else
@ -17,7 +17,7 @@
DSL_uint_t nCommand, unsigned long nArg);
#endif
static int DSL_DRV_Open(DSL_DRV_inode_t * ino, DSL_DRV_file_t * fil);
@@ -184,7 +185,7 @@ static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_
@@ -183,7 +184,7 @@ static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_
DSL_uint_t nCommand,
unsigned long nArg)
#else
@ -26,7 +26,7 @@
DSL_DRV_file_t * pFile,
DSL_uint_t nCommand,
unsigned long nArg)
@@ -521,9 +522,9 @@ DSL_void_t* DSL_IoctlMemCpyTo(
@@ -520,9 +521,9 @@ DSL_void_t* DSL_IoctlMemCpyTo(
- IFX_SUCCESS on success
- IFX_ERROR on error
*/
@ -38,7 +38,7 @@
DSL_int32_t retVal = -1;
#ifndef _lint
@@ -546,30 +547,6 @@ DSL_DRV_STATIC DSL_int32_t DSL_DRV_Kerne
@@ -545,30 +546,6 @@ DSL_DRV_STATIC DSL_int32_t DSL_DRV_Kerne
(DSL_NULL, "ENTER - Kernel Thread Startup <%s>" DSL_DRV_CRLF,
pThrCntrl->thrParams.pName));
@ -69,7 +69,7 @@
/*DSL_DRV_ThreadPriorityModify(pThrCntrl->nPriority);*/
pThrCntrl->thrParams.bRunning = 1;
@@ -639,9 +616,7 @@ DSL_int32_t DSL_DRV_ThreadInit(
@@ -638,9 +615,7 @@ DSL_int32_t DSL_DRV_ThreadInit(
init_completion(&pThrCntrl->thrCompletion);
/* start kernel thread via the wrapper function */
@ -80,7 +80,7 @@
pThrCntrl->bValid = DSL_TRUE;
@@ -1064,12 +1039,12 @@ static void DSL_DRV_DebugInit(void)
@@ -1070,12 +1045,12 @@ static void DSL_DRV_DebugInit(void)
#endif
/* Entry point of driver */
@ -95,7 +95,7 @@
&(dsl_cpe_api_version[4]));
DSL_DRV_MemSet( ifxDevices, 0, sizeof(DSL_devCtx_t) * DSL_DRV_MAX_DEVICE_NUMBER );
@@ -1118,7 +1093,7 @@ static int __devinit ltq_adsl_probe(stru
@@ -1124,7 +1099,7 @@ static int __devinit ltq_adsl_probe(stru
return 0;
}
@ -104,7 +104,7 @@
{
printk("Module will be unloaded"DSL_DRV_CRLF);
@@ -1163,7 +1138,7 @@ MODULE_DEVICE_TABLE(of, ltq_adsl_match);
@@ -1169,7 +1144,7 @@ MODULE_DEVICE_TABLE(of, ltq_adsl_match);
static struct platform_driver ltq_adsl_driver = {
.probe = ltq_adsl_probe,

View File

@ -8,7 +8,6 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ltq-atm
PKG_RELEASE:=2
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-atm-$(BUILD_VARIANT)
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_LICENSE:=GPL-2.0+

View File

@ -40,6 +40,7 @@
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <linux/ioctl.h>
#include <linux/platform_device.h>
#include <asm/delay.h>
/*
@ -80,7 +81,7 @@
*/
static inline void init_pmu(void);
static inline void uninit_pmu(void);
static inline void reset_ppe(void);
static inline void reset_ppe(struct platform_device *pdev);
static inline void init_ema(void);
static inline void init_mailbox(void);
static inline void init_atm_tc(void);
@ -136,7 +137,7 @@ static inline void uninit_pmu(void)
//PPE_TOP_PMU_SETUP(IFX_PMU_DISABLE);*/
}
static inline void reset_ppe(void)
static inline void reset_ppe(struct platform_device *pdev)
{
#if 0 //MODULE
unsigned int etop_cfg;
@ -262,11 +263,11 @@ extern void ase_fw_ver(unsigned int *major, unsigned int *minor)
*minor = FW_VER_ID->minor;
}
void ase_init(void)
void ase_init(struct platform_device *pdev)
{
init_pmu();
reset_ppe();
reset_ppe(pdev);
init_ema();

View File

@ -40,6 +40,7 @@
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <linux/ioctl.h>
#include <linux/platform_device.h>
#include <asm/delay.h>
/*
@ -83,7 +84,7 @@
*/
static inline void init_pmu(void);
static inline void uninit_pmu(void);
static inline void reset_ppe(void);
static inline void reset_ppe(struct platform_device *pdev);
static inline void init_ema(void);
static inline void init_mailbox(void);
static inline void clear_share_buffer(void);
@ -125,7 +126,7 @@ static inline void uninit_pmu(void)
{
}
static inline void reset_ppe(void)
static inline void reset_ppe(struct platform_device *pdev)
{
#ifdef MODULE
// reset PPE
@ -193,10 +194,10 @@ void ar9_fw_ver(unsigned int *major, unsigned int *minor)
*minor = FW_VER_ID->minor;
}
void ar9_init(void)
void ar9_init(struct platform_device *pdev)
{
init_pmu();
reset_ppe();
reset_ppe(pdev);
init_ema();
init_mailbox();
clear_share_buffer();

View File

@ -34,7 +34,7 @@
#define SET_BITS(x, msb, lsb, value) (((x) & ~(((1 << ((msb) + 1)) - 1) ^ ((1 << (lsb)) - 1))) | (((value) & ((1 << (1 + (msb) - (lsb))) - 1)) << (lsb)))
struct ltq_atm_ops {
void (*init)(void);
void (*init)(struct platform_device *pdev);
void (*shutdown)(void);
int (*start)(int pp32);

View File

@ -40,6 +40,7 @@
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <linux/ioctl.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
/*
@ -61,7 +62,7 @@
#define EMA_WRITE_BURST 0x2
#define EMA_READ_BURST 0x2
static inline void reset_ppe(void);
static inline void reset_ppe(struct platform_device *pdev);
#define IFX_PMU_MODULE_PPE_SLL01 BIT(19)
#define IFX_PMU_MODULE_PPE_TC BIT(21)
@ -70,7 +71,7 @@ static inline void reset_ppe(void);
#define IFX_PMU_MODULE_TPE BIT(13)
#define IFX_PMU_MODULE_DSL_DFE BIT(9)
static inline void reset_ppe(void)
static inline void reset_ppe(struct platform_device *pdev)
{
/*#ifdef MODULE
unsigned int etop_cfg;
@ -140,7 +141,7 @@ static void danube_fw_ver(unsigned int *major, unsigned int *minor)
*minor = FW_VER_ID->minor;
}
static void danube_init(void)
static void danube_init(struct platform_device *pdev)
{
volatile u32 *p = SB_RAM0_ADDR(0);
unsigned int i;
@ -152,7 +153,7 @@ static void danube_init(void)
IFX_PMU_MODULE_TPE |
IFX_PMU_MODULE_DSL_DFE);
reset_ppe();
reset_ppe(pdev);
/* init ema */
IFX_REG_W32((EMA_CMD_BUF_LEN << 16) | (EMA_CMD_BASE_ADDR >> 2), EMA_CMDCFG);

View File

@ -40,6 +40,8 @@
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <linux/ioctl.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
#include <asm/delay.h>
#include "ifxmips_atm_core.h"
@ -56,21 +58,46 @@
#define IFX_PMU_MODULE_AHBS BIT(13)
#define IFX_PMU_MODULE_DSL_DFE BIT(9)
static inline void vr9_reset_ppe(void)
static inline void vr9_reset_ppe(struct platform_device *pdev)
{
/*#ifdef MODULE
// reset PPE
ifx_rcu_rst(IFX_RCU_DOMAIN_DSLDFE, IFX_RCU_MODULE_ATM);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
struct device *dev = &pdev->dev;
struct reset_control *dsp;
struct reset_control *dfe;
struct reset_control *tc;
dsp = devm_reset_control_get(dev, "dsp");
if (IS_ERR(dsp)) {
if (PTR_ERR(dsp) != -EPROBE_DEFER)
dev_err(dev, "Failed to lookup dsp reset\n");
// return PTR_ERR(dsp);
}
dfe = devm_reset_control_get(dev, "dfe");
if (IS_ERR(dfe)) {
if (PTR_ERR(dfe) != -EPROBE_DEFER)
dev_err(dev, "Failed to lookup dfe reset\n");
// return PTR_ERR(dfe);
}
tc = devm_reset_control_get(dev, "tc");
if (IS_ERR(tc)) {
if (PTR_ERR(tc) != -EPROBE_DEFER)
dev_err(dev, "Failed to lookup tc reset\n");
// return PTR_ERR(tc);
}
reset_control_assert(dsp);
udelay(1000);
ifx_rcu_rst(IFX_RCU_DOMAIN_DSLTC, IFX_RCU_MODULE_ATM);
reset_control_assert(dfe);
udelay(1000);
ifx_rcu_rst(IFX_RCU_DOMAIN_PPE, IFX_RCU_MODULE_ATM);
reset_control_assert(tc);
udelay(1000);
*PP32_SRST &= ~0x000303CF;
udelay(1000);
*PP32_SRST |= 0x000303CF;
udelay(1000);
#endif*/
#endif
}
static inline int vr9_pp32_download_code(int pp32, u32 *code_src, unsigned int code_dword_len, u32 *data_src, unsigned int data_dword_len)
@ -107,7 +134,7 @@ static void vr9_fw_ver(unsigned int *major, unsigned int *minor)
*minor = FW_VER_ID->minor;
}
static void vr9_init(void)
static void vr9_init(struct platform_device *pdev)
{
volatile u32 *p;
unsigned int i;
@ -120,7 +147,7 @@ static void vr9_init(void)
IFX_PMU_MODULE_AHBS |
IFX_PMU_MODULE_DSL_DFE);
vr9_reset_ppe();
vr9_reset_ppe(pdev);
/* pdma init */
IFX_REG_W32(0x08, PDMA_CFG);

View File

@ -1785,7 +1785,7 @@ static int ltq_atm_probe(struct platform_device *pdev)
goto INIT_PRIV_DATA_FAIL;
}
ops->init();
ops->init(pdev);
init_rx_tables();
init_tx_tables();

View File

@ -8,7 +8,6 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ltq-deu
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-deu-$(BUILD_VARIANT)
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_LICENSE:=GPL-2.0+

View File

@ -17,7 +17,6 @@ PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_LICENSE:=GPL-2.0 BSD-2-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_ASLR_PIE:=0
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/package.mk

View File

@ -32,7 +32,7 @@ Compiling against glibc can fail with the following errors
^
Makefile:1945: recipe for target 'libifxos_a-ifxos_linux_device_access_appl.o' failed
Ref: https://bugs.lede-project.org/index.php?do=details&task_id=1196
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=1196
---
src/Makefile.am | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

View File

@ -8,8 +8,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ltq-ptm
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-ptm-$(BUILD_VARIANT)
PKG_RELEASE:=2
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_LICENSE:=GPL-2.0+

View File

@ -44,6 +44,8 @@
#include <linux/etherdevice.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/platform_device.h>
#include <linux/of_device.h>
#include <asm/io.h>
/*
@ -1448,6 +1450,19 @@ static int ptm_showtime_exit(void)
}
static const struct of_device_id ltq_ptm_match[] = {
#ifdef CONFIG_DANUBE
{ .compatible = "lantiq,ppe-danube", .data = NULL },
#elif defined CONFIG_AMAZON_SE
{ .compatible = "lantiq,ppe-ase", .data = NULL },
#elif defined CONFIG_AR9
{ .compatible = "lantiq,ppe-arx100", .data = NULL },
#elif defined CONFIG_VR9
{ .compatible = "lantiq,ppe-xrx200", .data = NULL },
#endif
{},
};
MODULE_DEVICE_TABLE(of, ltq_ptm_match);
/*
* ####################################
@ -1465,7 +1480,7 @@ static int ptm_showtime_exit(void)
* 0 --- successful
* else --- failure, usually it is negative value of error code
*/
static int ifx_ptm_init(void)
static int ltq_ptm_probe(struct platform_device *pdev)
{
int ret;
struct port_cell_info port_cell = {0};
@ -1481,7 +1496,7 @@ static int ifx_ptm_init(void)
goto INIT_PRIV_DATA_FAIL;
}
ifx_ptm_init_chip();
ifx_ptm_init_chip(pdev);
init_tables();
for ( i = 0; i < ARRAY_SIZE(g_net_dev); i++ ) {
@ -1570,7 +1585,7 @@ INIT_PRIV_DATA_FAIL:
* Output:
* none
*/
static void __exit ifx_ptm_exit(void)
static int ltq_ptm_remove(struct platform_device *pdev)
{
int i;
@ -1595,7 +1610,20 @@ static void __exit ifx_ptm_exit(void)
ifx_ptm_uninit_chip();
clear_priv_data();
return 0;
}
module_init(ifx_ptm_init);
module_exit(ifx_ptm_exit);
static struct platform_driver ltq_ptm_driver = {
.probe = ltq_ptm_probe,
.remove = ltq_ptm_remove,
.driver = {
.name = "ptm",
.owner = THIS_MODULE,
.of_match_table = ltq_ptm_match,
},
};
module_platform_driver(ltq_ptm_driver);
MODULE_LICENSE("GPL");

View File

@ -122,7 +122,7 @@ extern unsigned int ifx_ptm_dbg_enable;
extern void ifx_ptm_get_fw_ver(unsigned int *major, unsigned int *minor);
extern void ifx_ptm_init_chip(void);
extern void ifx_ptm_init_chip(struct platform_device *pdev);
extern void ifx_ptm_uninit_chip(void);
extern int ifx_pp32_start(int pp32);

View File

@ -40,6 +40,8 @@
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <linux/ioctl.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
#include <asm/delay.h>
/*
@ -84,7 +86,7 @@
*/
static inline void init_pmu(void);
static inline void uninit_pmu(void);
static inline void reset_ppe(void);
static inline void reset_ppe(struct platform_device *pdev);
static inline void init_ema(void);
static inline void init_mailbox(void);
static inline void init_atm_tc(void);
@ -129,7 +131,7 @@ static inline void uninit_pmu(void)
//PPE_TOP_PMU_SETUP(IFX_PMU_DISABLE);
}
static inline void reset_ppe(void)
static inline void reset_ppe(struct platform_device *pdev)
{
#ifdef MODULE
unsigned int etop_cfg;
@ -260,11 +262,11 @@ extern void ifx_ptm_get_fw_ver(unsigned int *major, unsigned int *minor)
*minor = FW_VER_ID->minor;
}
void ifx_ptm_init_chip(void)
void ifx_ptm_init_chip(struct platform_device *pdev)
{
init_pmu();
reset_ppe();
reset_ppe(pdev);
init_ema();

View File

@ -40,6 +40,8 @@
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <linux/ioctl.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
#include <asm/delay.h>
/*
@ -80,7 +82,7 @@
*/
static inline void init_pmu(void);
static inline void uninit_pmu(void);
static inline void reset_ppe(void);
static inline void reset_ppe(struct platform_device *pdev);
static inline void init_ema(void);
static inline void init_mailbox(void);
static inline void init_atm_tc(void);
@ -130,7 +132,7 @@ static inline void uninit_pmu(void)
}
static inline void reset_ppe(void)
static inline void reset_ppe(struct platform_device *pdev)
{
#ifdef MODULE
// reset PPE
@ -283,11 +285,11 @@ void ifx_ptm_get_fw_ver(unsigned int *major, unsigned int *minor)
*minor = FW_VER_ID->minor;
}
void ifx_ptm_init_chip(void)
void ifx_ptm_init_chip(struct platform_device *pdev)
{
init_pmu();
reset_ppe();
reset_ppe(pdev);
init_ema();

View File

@ -40,6 +40,8 @@
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <linux/ioctl.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
#include <linux/delay.h>
/*
@ -79,7 +81,7 @@
*/
static inline void init_pmu(void);
static inline void uninit_pmu(void);
static inline void reset_ppe(void);
static inline void reset_ppe(struct platform_device *pdev);
static inline void init_ema(void);
static inline void init_mailbox(void);
static inline void init_atm_tc(void);
@ -125,7 +127,7 @@ static inline void uninit_pmu(void)
IFX_PMU_MODULE_DSL_DFE);
}
static inline void reset_ppe(void)
static inline void reset_ppe(struct platform_device *pdev)
{
#ifdef MODULE
/*unsigned int etop_cfg;
@ -255,11 +257,11 @@ extern void ifx_ptm_get_fw_ver(unsigned int *major, unsigned int *minor)
*minor = FW_VER_ID->minor;
}
void ifx_ptm_init_chip(void)
void ifx_ptm_init_chip(struct platform_device *pdev)
{
init_pmu();
reset_ppe();
reset_ppe(pdev);
init_ema();

View File

@ -33,6 +33,8 @@
#include <linux/etherdevice.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/platform_device.h>
#include <linux/of_device.h>
#include "ifxmips_ptm_vdsl.h"
#include <lantiq_soc.h>
@ -334,6 +336,9 @@ static int ptm_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
dma_cache_wback((unsigned long)skb->data, skb->len);
}
/* make the skb unowned */
skb_orphan(skb);
*(struct sk_buff **)((unsigned int)skb->data - byteoff - sizeof(struct sk_buff *)) = skb;
/* write back to physical memory */
dma_cache_wback((unsigned long)skb->data - byteoff - sizeof(struct sk_buff *), skb->len + byteoff + sizeof(struct sk_buff *));
@ -971,9 +976,21 @@ static int ptm_showtime_exit(void)
return 0;
}
static const struct of_device_id ltq_ptm_match[] = {
#ifdef CONFIG_DANUBE
{ .compatible = "lantiq,ppe-danube", .data = NULL },
#elif defined CONFIG_AMAZON_SE
{ .compatible = "lantiq,ppe-ase", .data = NULL },
#elif defined CONFIG_AR9
{ .compatible = "lantiq,ppe-arx100", .data = NULL },
#elif defined CONFIG_VR9
{ .compatible = "lantiq,ppe-xrx200", .data = NULL },
#endif
{},
};
MODULE_DEVICE_TABLE(of, ltq_ptm_match);
static int ifx_ptm_init(void)
static int ltq_ptm_probe(struct platform_device *pdev)
{
int ret;
int i;
@ -986,7 +1003,7 @@ static int ifx_ptm_init(void)
goto INIT_PRIV_DATA_FAIL;
}
ifx_ptm_init_chip();
ifx_ptm_init_chip(pdev);
ret = init_tables();
if ( ret != 0 ) {
err("INIT_TABLES_FAIL");
@ -1068,7 +1085,7 @@ INIT_PRIV_DATA_FAIL:
return ret;
}
static void __exit ifx_ptm_exit(void)
static int ltq_ptm_remove(struct platform_device *pdev)
{
int i;
ifx_mei_atm_showtime_enter = NULL;
@ -1092,6 +1109,8 @@ static void __exit ifx_ptm_exit(void)
ifx_ptm_uninit_chip();
clear_priv_data();
return 0;
}
#ifndef MODULE
@ -1120,8 +1139,17 @@ static int __init queue_gamma_map_setup(char *line)
return 0;
}
#endif
module_init(ifx_ptm_init);
module_exit(ifx_ptm_exit);
static struct platform_driver ltq_ptm_driver = {
.probe = ltq_ptm_probe,
.remove = ltq_ptm_remove,
.driver = {
.name = "ptm",
.owner = THIS_MODULE,
.of_match_table = ltq_ptm_match,
},
};
module_platform_driver(ltq_ptm_driver);
#ifndef MODULE
__setup("wanqos_en=", wanqos_en_setup);
__setup("queue_gamma_map=", queue_gamma_map_setup);

View File

@ -113,7 +113,7 @@ extern unsigned int ifx_ptm_dbg_enable;
extern void ifx_ptm_get_fw_ver(unsigned int *major, unsigned int *minor);
extern void ifx_ptm_init_chip(void);
extern void ifx_ptm_init_chip(struct platform_device *pdev);
extern void ifx_ptm_uninit_chip(void);
extern int ifx_pp32_start(int pp32);

View File

@ -40,6 +40,8 @@
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <linux/ioctl.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
#include <asm/delay.h>
/*
@ -52,7 +54,7 @@
static inline void init_pmu(void);
static inline void uninit_pmu(void);
static inline void reset_ppe(void);
static inline void reset_ppe(struct platform_device *pdev);
static inline void init_pdma(void);
static inline void init_mailbox(void);
static inline void init_atm_tc(void);
@ -80,21 +82,46 @@ static inline void uninit_pmu(void)
{
}
static inline void reset_ppe(void)
static inline void reset_ppe(struct platform_device *pdev)
{
/*#ifdef MODULE
// reset PPE
ifx_rcu_rst(IFX_RCU_DOMAIN_DSLDFE, IFX_RCU_MODULE_PTM);
udelay(1000);
ifx_rcu_rst(IFX_RCU_DOMAIN_DSLTC, IFX_RCU_MODULE_PTM);
udelay(1000);
ifx_rcu_rst(IFX_RCU_DOMAIN_PPE, IFX_RCU_MODULE_PTM);
udelay(1000);
*PP32_SRST &= ~0x000303CF;
udelay(1000);
*PP32_SRST |= 0x000303CF;
udelay(1000);
#endif*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
struct device *dev = &pdev->dev;
struct reset_control *dsp;
struct reset_control *dfe;
struct reset_control *tc;
dsp = devm_reset_control_get(dev, "dsp");
if (IS_ERR(dsp)) {
if (PTR_ERR(dsp) != -EPROBE_DEFER)
dev_err(dev, "Failed to lookup dsp reset\n");
// return PTR_ERR(dsp);
}
dfe = devm_reset_control_get(dev, "dfe");
if (IS_ERR(dfe)) {
if (PTR_ERR(dfe) != -EPROBE_DEFER)
dev_err(dev, "Failed to lookup dfe reset\n");
// return PTR_ERR(dfe);
}
tc = devm_reset_control_get(dev, "tc");
if (IS_ERR(tc)) {
if (PTR_ERR(tc) != -EPROBE_DEFER)
dev_err(dev, "Failed to lookup tc reset\n");
// return PTR_ERR(tc);
}
reset_control_assert(dsp);
udelay(1000);
reset_control_assert(dfe);
udelay(1000);
reset_control_assert(tc);
udelay(1000);
*PP32_SRST &= ~0x000303CF;
udelay(1000);
*PP32_SRST |= 0x000303CF;
udelay(1000);
#endif
}
static inline void init_pdma(void)
@ -230,11 +257,11 @@ extern void ifx_ptm_get_fw_ver(unsigned int *major, unsigned int *minor)
*minor = FW_VER_ID->minor;
}
void ifx_ptm_init_chip(void)
void ifx_ptm_init_chip(struct platform_device *pdev)
{
init_pmu();
reset_ppe();
reset_ppe(pdev);
init_pdma();

View File

@ -17,7 +17,6 @@ PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
PKG_HASH:=109374d52872716570fca3fef3b93c9a93159a804dfd42484b19152b825af5c0
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_ASLR_PIE:=0
PKG_CHECK_FORMAT_SECURITY:=0
PKG_FIXUP:=autoreconf

View File

@ -6,7 +6,7 @@
#include <linux/sched.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
+ #include <linux/sched/signal.h>
+ #include <linux/sched/types.h>
+ #include <uapi/linux/sched/types.h>
+#endif
#undef CONFIG_DEVFS_FS
#ifndef UTS_RELEASE

View File

@ -0,0 +1,48 @@
--- a/src/drv_tapi_linux.c
+++ b/src/drv_tapi_linux.c
@@ -119,7 +119,11 @@ struct _TAPI_FD_PRIV_DATA
/* ============================= */
/* Local Functions */
/* ============================= */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
static IFX_void_t TAPI_timer_call_back (IFX_ulong_t arg);
+#else
+static IFX_void_t TAPI_timer_call_back (struct timer_list *t);
+#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
static IFX_void_t TAPI_tqueue (IFX_void_t *pWork);
#else /* for Kernel newer or equal 2.6.20 */
@@ -3384,11 +3388,15 @@ Timer_ID TAPI_Create_Timer(TIMER_ENTRY p
pTimerData->nArgument = nArgument;
pTimerData->bStopped = IFX_FALSE;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0))
init_timer(&(pTimerData->Timer_List));
/* set timer call back function */
pTimerData->Timer_List.function = TAPI_timer_call_back;
pTimerData->Timer_List.data = (IFX_ulong_t) pTimerData;
+#else
+ timer_setup(&(pTimerData->Timer_List), TAPI_timer_call_back, 0);
+#endif
/* Initialize Timer Task */
#ifdef LINUX_2_6
@@ -3529,9 +3537,17 @@ static IFX_void_t TAPI_tqueue (struct wo
\param arg Pointer to corresponding timer ID.
*/
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
static IFX_void_t TAPI_timer_call_back (IFX_ulong_t arg)
+#else
+static IFX_void_t TAPI_timer_call_back (struct timer_list *t)
+#endif
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
Timer_ID Timer = (Timer_ID) arg;
+#else
+ Timer_ID Timer = from_timer(Timer, t, Timer_List);
+#endif
/* do the operation in process context,
not in interrupt context */
#ifdef LINUX_2_6

View File

@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ltq-vdsl-fw
PKG_VERSION:=6.8.6
PKG_RELEASE:=1
PKG_RELEASE:=3
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>

View File

@ -1,9 +1,9 @@
#!/bin/sh
FW="/tmp/firmware-speedport-w921v-1.44.000.bin"
URL="https://www.telekom.de/hilfe/downloads/firmware-speedport-w921v-1.44.000.bin"
FW="/tmp/firmware-speedport-w921v-1.46.000.bin"
URL="https://www.telekom.de/hilfe/downloads/firmware-speedport-w921v-1.46.000.bin"
FW_TAPI="vr9_tapi_fw.bin"
FW_DSL="vr9_dsl_fw_annex_b.bin"
MD5_FW="cefbeb7073e02e0fa4ddb6b31ecb3d1e"
MD5_FW="188734c0773b225f8c130984b279621a"
MD5_TAPI="57f2d07f59e11250ce1219bad99c1eda"
MD5_DSL="655442e31deaa42c9c68944869361ec0"

View File

@ -26,7 +26,7 @@
#include "LzmaWrapper.h"
#define FW_NAME "/tmp/firmware-speedport-w921v-1.44.000.bin"
#define FW_NAME "/tmp/firmware-speedport-w921v-1.46.000.bin"
#define MAGIC 0x50
#define MAGIC_SZ 0x3FFC00
@ -78,7 +78,7 @@ int main(int argc, char **argv)
if (stat(FW_NAME, &s) != 0) {
printf("Failed to find %s\n", FW_NAME);
printf("Ask Google or try https://www.telekom.de/hilfe/downloads/firmware-speedport-w921v-1.44.000.bin\n");
printf("Ask Google or try https://www.telekom.de/hilfe/downloads/firmware-speedport-w921v-1.45.000.bin\n");
return -1;
}

View File

@ -22,8 +22,6 @@ PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_LICENSE:=GPL-2.0 BSD-2-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_ASLR_PIE:=0
include $(INCLUDE_DIR)/package.mk
define KernelPackage/ltq-vdsl-vr9-mei
@ -40,7 +38,7 @@ define KernelPackage/ltq-vdsl-vr9-mei/description
endef
define Package/ltq-vdsl-mei_test
define Package/ltq-vdsl-mei-test
SECTION:=net
CATEGORY:=Network
TITLE:=Lantiq mei driver test tool
@ -48,7 +46,7 @@ define Package/ltq-vdsl-mei_test
DEPENDS:=@TARGET_lantiq_xrx200
endef
define Package/ltq-vdsl-mei_test/description
define Package/ltq-vdsl-mei-test/description
Userland tool to directly control the mei driver, this is only needed
for test and development purposes.
endef
@ -82,9 +80,9 @@ endef
$(eval $(call KernelPackage,ltq-vdsl-vr9-mei))
define Package/ltq-vdsl-mei_test/install
define Package/ltq-vdsl-mei-test/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mei_cpe_drv_test $(1)/bin
endef
$(eval $(call BuildPackage,ltq-vdsl-mei_test))
$(eval $(call BuildPackage,ltq-vdsl-mei-test))

View File

@ -19,7 +19,6 @@ PKG_HASH:=b4966a60653acc49254b168c6cc9c49eb36c54548e763617788aa4f252a29f21
PKG_LICENSE:=GPL-2.0 BSD-2-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_ASLR_PIE:=0
PKG_FIXUP:=autoreconf
PKG_MAINTAINER:=John Crispin <john@phrozen.org>

View File

@ -35,7 +35,28 @@
#endif
if (pINode == DSL_NULL)
@@ -1203,6 +1197,9 @@ static void DSL_DRV_NlSendMsg(DSL_char_t
@@ -917,12 +911,19 @@ DSL_int32_t DSL_DRV_ThreadShutdown(
DSL_uint32_t DSL_DRV_SysTimeGet(DSL_uint32_t nOffset)
{
- struct timeval tv;
DSL_uint32_t nTime = 0;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0))
+ struct timeval tv;
memset(&tv, 0, sizeof(tv));
do_gettimeofday(&tv);
nTime = (DSL_uint32_t)tv.tv_sec;
+#else
+ struct timespec64 now;
+
+ ktime_get_real_ts64(&now);
+ nTime = (DSL_uint32_t)now.tv_sec;
+#endif
if ( (nOffset == 0) || (nOffset > nTime) )
{
@@ -1203,6 +1204,9 @@ static void DSL_DRV_NlSendMsg(DSL_char_t
}
#endif
@ -45,7 +66,7 @@
/* Entry point of driver */
int __init DSL_ModuleInit(void)
{
@@ -1241,6 +1238,10 @@ int __init DSL_ModuleInit(void)
@@ -1241,6 +1245,10 @@ int __init DSL_ModuleInit(void)
DSL_DRV_DevNodeInit();
@ -56,7 +77,7 @@
return 0;
}
@@ -1248,6 +1249,11 @@ void __exit DSL_ModuleCleanup(void)
@@ -1248,6 +1256,11 @@ void __exit DSL_ModuleCleanup(void)
{
printk("Module will be unloaded"DSL_DRV_CRLF);

View File

@ -17,7 +17,6 @@ PKG_HASH:=707f515eb727c032418c4da67d7e86884bb56cdc2a606e8f6ded6057d8767e57
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_ASLR_PIE:=0
PKG_CHECK_FORMAT_SECURITY:=0
PKG_FIXUP:=autoreconf

View File

@ -0,0 +1,37 @@
From: Linus Lüssing <ll@simonwunderlich.de>
Date: Wed, 5 Feb 2020 20:10:43 +0100
Subject: ath10k: increase rx buffer size to 2048
Before, only frames with a maximum size of 1528 bytes could be
transmitted between two 802.11s nodes.
For batman-adv for instance, which adds its own header to each frame,
we typically need an MTU of at least 1532 bytes to be able to transmit
without fragmentation.
This patch now increases the maxmimum frame size from 1528 to 1656
bytes.
Tested with two ath10k devices in 802.11s mode, as well as with
batman-adv on top of 802.11s with forwarding disabled.
Fix originally found and developed by Ben Greear.
Link: https://github.com/greearb/ath10k-ct/issues/89
Link: https://github.com/greearb/ath10k-ct/commit/9e5ab25027e0971fa24ccf93373324c08c4e992d
Cc: Ben Greear <greearb@candelatech.com>
Signed-off-by: Linus Lüssing <ll@simonwunderlich.de>
Forwarded: https://patchwork.kernel.org/patch/11367055/
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -2219,7 +2219,7 @@ struct htt_rx_chan_info {
* Should be: sizeof(struct htt_host_rx_desc) + max rx MSDU size,
* rounded up to a cache line size.
*/
-#define HTT_RX_BUF_SIZE 1920
+#define HTT_RX_BUF_SIZE 2048
#define HTT_RX_MSDU_SIZE (HTT_RX_BUF_SIZE - (int)sizeof(struct htt_rx_desc))
/* Refill a bunch of RX buffers for each refill round so that FW/HW can handle

View File

@ -59,7 +59,7 @@ Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
if (id < 0) {
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2452,7 +2452,7 @@ static int ieee80211_store_ack_skb(struc
@@ -2458,7 +2458,7 @@ static int ieee80211_store_ack_skb(struc
spin_lock_irqsave(&local->ack_status_lock, flags);
id = idr_alloc(&local->ack_status_frames, ack_skb,

View File

@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
PKG_SOURCE_URL:=https://github.com/openwrt/mt76
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2020-04-23
PKG_SOURCE_VERSION:=cde3716aa47e8f8446b18a0f6873f53c95c9f202
PKG_MIRROR_HASH:=a97a23f828cf054220b5f9a083c94323d9591b631ad7190a903c0ab67ba69997
PKG_SOURCE_DATE:=2020-04-27
PKG_SOURCE_VERSION:=5f3ccc7226272198c21ec934d9072a56b0953f47
PKG_MIRROR_HASH:=6f1a7b7d7b9f4db79d72405baeafa318769eeab270fea4479756f91ac5a2494d
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_BUILD_PARALLEL:=1
@ -23,9 +23,7 @@ PKG_CONFIG_DEPENDS += \
CONFIG_PACKAGE_kmod-mt76x2-common \
CONFIG_PACKAGE_kmod-mt76x2 \
CONFIG_PACKAGE_kmod-mt76x2u \
CONFIG_PACKAGE_kmod-mt7603 \
CONFIG_PACKAGE_kmod-mt7615-common \
CONFIG_PACKAGE_kmod-mt7615e
CONFIG_PACKAGE_kmod-mt7603
STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
@ -140,19 +138,12 @@ define KernelPackage/mt7603
AUTOLOAD:=$(call AutoProbe,mt7603e)
endef
define KernelPackage/mt7615-common
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7615 wireless driver common code
DEPENDS+=+kmod-mt76-core
HIDDEN:=1
FILES:=$(PKG_BUILD_DIR)/mt7615/mt7615-common.ko
endef
define KernelPackage/mt7615e
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7615 wireless driver
DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common
DEPENDS+=@PCI_SUPPORT +kmod-mt76-core
FILES:=\
$(PKG_BUILD_DIR)/mt7615/mt7615-common.ko \
$(PKG_BUILD_DIR)/mt7615/mt7615e.ko
AUTOLOAD:=$(call AutoProbe,mt7615e)
endef
@ -200,10 +191,8 @@ endif
ifdef CONFIG_PACKAGE_kmod-mt7603
PKG_MAKE_FLAGS += CONFIG_MT7603E=m
endif
ifdef CONFIG_PACKAGE_kmod-mt7615-common
PKG_MAKE_FLAGS += CONFIG_MT7615_COMMON=m
endif
ifdef CONFIG_PACKAGE_kmod-mt7615e
PKG_MAKE_FLAGS += CONFIG_MT7615_COMMON=m
PKG_MAKE_FLAGS += CONFIG_MT7615E=m
ifdef CONFIG_TARGET_mediatek_mt7622
PKG_MAKE_FLAGS += CONFIG_MT7622_WMAC=y
@ -285,6 +274,5 @@ $(eval $(call KernelPackage,mt76x2-common))
$(eval $(call KernelPackage,mt76x2u))
$(eval $(call KernelPackage,mt76x2))
$(eval $(call KernelPackage,mt7603))
$(eval $(call KernelPackage,mt7615-common))
$(eval $(call KernelPackage,mt7615e))
$(eval $(call KernelPackage,mt76))

View File

@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=UnblockNeteaseMusic
PKG_VERSION:=0.24.1
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_LICENSE:=MIT
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/nondanee/UnblockNeteaseMusic.git
PKG_SOURCE_VERSION:=91e631db87920c67f92161a724a2d96472ad33cd
PKG_SOURCE_VERSION:=9c9582401e999e1876c4baa204d35284a3d32bec
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(PKG_VERSION).tar.gz

View File

@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for IPSec VPN Server (IKEv1 with PSK and Xauth)
LUCI_DEPENDS:=+strongswan-minimal +strongswan-mod-xauth-generic
LUCI_PKGARCH:=all
PKG_VERSION:=1.0
PKG_RELEASE:=7
PKG_RELEASE:=8
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -2,10 +2,12 @@ iptables -D FORWARD -m policy --dir in --pol ipsec --proto esp -j ACCEPT 2>/dev
iptables -D FORWARD -m policy --dir out --pol ipsec --proto esp -j ACCEPT 2>/dev/null
iptables -D INPUT -m policy --dir in --pol ipsec --proto esp -j ACCEPT 2>/dev/null
iptables -D OUTPUT -m policy --dir out --pol ipsec --proto esp -j ACCEPT 2>/dev/null
iptables -D FORWARD -p tcp --syn -i ppp+ -j TCPMSS --set-mss 1356 2>/dev/null
iptables -I FORWARD -m policy --dir in --pol ipsec --proto esp -j ACCEPT
iptables -I FORWARD -m policy --dir out --pol ipsec --proto esp -j ACCEPT
iptables -I INPUT -m policy --dir in --pol ipsec --proto esp -j ACCEPT
iptables -I OUTPUT -m policy --dir out --pol ipsec --proto esp -j ACCEPT
iptables -I FORWARD -p tcp --syn -i ppp+ -j TCPMSS --set-mss 1356
echo 1 > /proc/sys/net/ipv4/conf/br-lan/proxy_arp

View File

@ -37,11 +37,6 @@ bbr.default = 0
bbr.rmempty = false
bbr.description = translate("Bottleneck Bandwidth and Round-trip propagation time (BBR)")
aaaa = s:option(Flag, "filter_aaaa", translate("Filter AAAA"))
aaaa.default = 1
aaaa.rmempty = false
aaaa.description = translate("Dnsmasq rejects IPv6 parsing and optimizes domestic complex dual-stack network")
dns = s:option(Flag, "dns", translate("DNS Acceleration"))
dns.default = 0
dns.rmempty = false

View File

@ -79,8 +79,3 @@ msgstr "支持dnsforwarder解析多个上游IPV6 DNS服务器用','分隔(
msgid "AdGuardHome's login username/passwd: AdGuardHome, web console addr: IP:3001"
msgstr "AdGuardHome 网页控制台地址IP:3001 登录账号/密码AdGuardHome"
msgid "Filter AAAA"
msgstr "忽略域名的IPv6地址"
msgid "Dnsmasq rejects IPv6 parsing and optimizes domestic complex dual-stack network"
msgstr "dnsmasq不返回ipv6解析结果,优化国内复杂双栈网络"

Some files were not shown because too many files have changed in this diff Show More