This commit is contained in:
aooom 2017-10-21 20:02:16 +08:00
commit f69756f16f
51 changed files with 546 additions and 398 deletions

View File

@ -114,7 +114,7 @@ menu "Target Images"
config TARGET_ROOTFS_ISO
bool "iso"
default n
depends on TARGET_x86_generic
depends on TARGET_x86
help
Create a bootable ISO image.

View File

@ -21,12 +21,12 @@ define Package/iwl4965-firmware/install
endef
$(eval $(call BuildPackage,iwl4965-firmware))
Package/iwlwifi-firmware-iwl1000 = $(call Package/firmware-default,Intel Centrino Wireless-N 100 firmware)
define Package/iwlwifi-firmware-iwl1000/install
Package/iwlwifi-firmware-iwl100 = $(call Package/firmware-default,Intel Centrino Wireless-N 100 firmware)
define Package/iwlwifi-firmware-iwl100/install
$(INSTALL_DIR) $(1)/lib/firmware
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-100-5.ucode $(1)/lib/firmware
endef
$(eval $(call BuildPackage,iwlwifi-firmware-iwl1000))
$(eval $(call BuildPackage,iwlwifi-firmware-iwl100))
Package/iwlwifi-firmware-iwl1000 = $(call Package/firmware-default,Intel Centrino Wireless-N 1000 firmware)
define Package/iwlwifi-firmware-iwl1000/install

View File

@ -7,6 +7,16 @@ define Package/ar3k-firmware/install
endef
$(eval $(call BuildPackage,ar3k-firmware))
Package/ath6k-firmware = $(call Package/firmware-default,AR600X firmware)
define Package/ath6k-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/ath6k
$(CP) \
$(PKG_BUILD_DIR)/ath6k/* \
$(1)/lib/firmware/ath6k
endef
$(eval $(call BuildPackage,ath6k-firmware))
Package/ath9k-htc-firmware = $(call Package/firmware-default,AR9271/AR7010 firmware)
define Package/ath9k-htc-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/ath9k_htc

View File

@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=default-settings
PKG_VERSION:=1.0
PKG_RELEASE:=23
PKG_RELEASE:=25
PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=LICENSE

View File

@ -21,8 +21,6 @@ include $(INCLUDE_DIR)/package.mk
define Package/he-6in4
SECTION:=ipv6
CATEGORY:=Gmod
SUBMENU:=Network
TITLE:=Dynamic Update he.net of ip
PKGARCH:=all
DEPENDS:=+luci-proto-ipv6 +6in4 +curl

View File

@ -0,0 +1,51 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-haproxy-tcp
PKG_VERSION=1.4
PKG_RELEASE:=1
PKG_MAINTAINER:=Alex Zhuo <1886090@gmail.com>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
CATEGORY:=Utilities
SUBMENU:=Luci
TITLE:=luci for haproxy and shadowsocks
PKGARCH:=all
DEPENDS:=+haproxy
endef
define Package/$(PKG_NAME)/description
A luci app for haproxy with shadowsocks
endef
define Package/$(PKG_NAME)/postinst
#!/bin/sh
rm -rf /tmp/luci*
echo stopping haproxy
/etc/init.d/haproxy stop
/etc/init.d/haproxy disable
echo haproxy disabled
endef
define Build/Prepare
$(foreach po,$(wildcard ${CURDIR}/i18n/zh-cn/*.po), \
po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.*.lmo $(1)/usr/lib/lua/luci/i18n/
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -0,0 +1,54 @@
# luci-app-haproxy-tcp
OpenWrt HAProxy的Luci配置页面已在[该固件][A]中使用
简介
---
本软件包为OpenWRT HAPrxoy的 LuCI 控制界面,用于Shadowsocks在多服务器条件下实现负载均衡和高可用
可以设置多个主服务器或多个备用服务器. 默认监听端口127.0.0.1:2222 后台监控页面端口0.0.0.0:1111,后台监控页面地址192.168.1.1:1111/haproxy
多主服务器是将所有TCP流量分流并可以设置每个服务器的分流比例;多备用服务器是在检测到主服务器A宕机之后切换至备用服务器BB宕机之后切换到服务器C...依次类推,可以防止因为单个服务器或者线路故障导致的断网问题。
使用效果和更多使用方法请[点击这里][A]
依赖
---
显式依赖 `haproxy`, 安装完毕该luci包后会stop并disable当前op的haproxy点击“保存&应用”后会修改HAProxy默认配置文件/etc/haproxy.cfg并自动重启支持开机自启.
配置
---
如果有需要,可以修改/etc/haproxy_init.sh ,不要直接修改/etc/haproxy.cfg否则会被覆盖
编译
---
从 OpenWrt 的 [SDK][openwrt-sdk] 编译
```bash
# 解压下载好的 SDK
tar xjf OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2.tar.bz2
cd OpenWrt-SDK-ar71xx-*
# Clone 项目
git clone https://github.com/AlexZhuo/luci-app-haproxy-tcp package/luci-app-haproxy-tcp
# 编译 po2lmo (如果有po2lmo可跳过)
pushd package/luci-app-haproxy-tcp/tools/po2lmo
make && sudo make install
popd
# 选择要编译的包 Utilities -> LuCI -> luci-app-haproxy-tcp
make menuconfig
# 开始编译
make package/luci-app-haproxy-tcp/compile V=99
```
截图
---
![](https://github.com/AlexZhuo/BreakwallOpenWrt/raw/master/screenshots/haproxy.png)
[A]: http://www.right.com.cn/forum/thread-198649-1-1.html
[openwrt-sdk]: http://wiki.openwrt.org/doc/howto/obtain.firmware.sdk

View File

@ -0,0 +1,29 @@
config arguments
option enabled '0'
config main_server
option server_weight '10'
option server_ip '1.2.3.4'
option server_port '443'
option server_name 'JP1'
option validate '1'
config backup_server
option server_name 'JP2'
option server_ip '2.2.2.2'
option server_port '8038'
option validate '1'
config backup_server
option server_name 'JP3'
option server_ip '3.3.3.3'
option server_port '443'
option validate '1'
config backup_server
option server_name 'JP4'
option server_ip '4.4.4.4'
option server_port '443'
option validate '1'

View File

@ -0,0 +1,129 @@
#!/bin/sh /etc/rc.common
CFG_FILE=/etc/haproxy.cfg
stop(){
logger -t alex stopping haproxy
echo "stopping haproxy"
/etc/init.d/haproxy disable
/etc/init.d/haproxy stop
[ -f /etc/haproxy_backup ] && {
cp /etc/haproxy_backup /etc/init.d/haproxy
}
iptables -t nat -D OUTPUT -j HAPROXY &> /dev/null
iptables -t nat -F HAPROXY &> /dev/null
sleep 1
iptables -t nat -X HAPROXY &> /dev/null
}
start(){
echo "starting haproxy"
logger -t alex restarting haproxy
echo global > $CFG_FILE
cat >> $CFG_FILE <<EOF
log 127.0.0.1 local0 #[日志输出配置所有日志都记录在本机通过local0输出]
log 127.0.0.1 local1 notice #定义haproxy 日志级别[error warringinfo debug]
daemon #以后台形式运行harpoxy
nbproc 1 #设置进程数量
pidfile /var/run/haproxy.pid
ulimit-n 1024 #ulimit 的数量限制
maxconn 1024 #默认最大连接数,需考虑ulimit-n限制
#chroot /usr/local/haproxy
defaults
log global
mode tcp #默认的模式mode { tcp|http|health }tcp是4层http是7层health只会返回OK
retries 3 #两次连接失败就认为是服务器不可用,也可以通过后面设置
option abortonclose #当服务器负载很高的时候,自动结束掉当前队列处理比较久的链接
option redispatch
maxconn 1024 #默认的最大连接数
timeout connect 5000ms #连接超时
timeout client 30000ms #客户端超时
timeout server 30000ms #服务器超时
balance roundrobin #设置默认负载均衡方式,轮询方式
#balance source #设置默认负载均衡方式类似于nginx的ip_hash
#balnace leastconn #设置默认负载均衡方式,最小连接数
listen admin_stats
bind 0.0.0.0:1111 #节点统计页面的访问端口
mode http #http的7层模式
option httplog #采用http日志格式
maxconn 10 #节点统计页面默认的最大连接数
stats refresh 30s #节点统计页面自动刷新时间
stats uri /haproxy #节点统计页面url
stats realm Haproxy #统计页面密码框上提示文本
stats auth admin:root #设置监控页面的用户和密码:admin,可以设置多个用户名
stats admin if TRUE #设置手工启动/禁用,后端服务器(haproxy-1.4.9以后版本)
frontend ss-in
bind 127.0.0.1:2222
default_backend ss-out
backend ss-out
mode tcp
balance roundrobin
option tcplog
EOF
local COUNTER=0
#添加主服务器
iptables -t nat -X HAPROXY
iptables -t nat -N HAPROXY
iptables -t nat -F HAPROXY
while true
do
local server_ip=`uci get haproxy.@main_server[$COUNTER].server_ip 2>/dev/null`
local server_name=`uci get haproxy.@main_server[$COUNTER].server_name 2>/dev/null`
local server_port=`uci get haproxy.@main_server[$COUNTER].server_port 2>/dev/null`
local server_weight=`uci get haproxy.@main_server[$COUNTER].server_weight 2>/dev/null`
local validate=`uci get haproxy.@main_server[$COUNTER].validate 2>/dev/null`
if [ -z "$server_ip" ] || [ -z "$server_name" ] || [ -z "$server_port" ] || [ -z "$server_weight" ]; then
echo break
break
fi
echo the main server $COUNTER $server_ip $server_name $server_port $server_weight
[ "$validate" = 1 ] && {
echo server $server_name $server_ip:$server_port weight $server_weight maxconn 1024 check inter 1500 rise 3 fall 3 >> $CFG_FILE
}
iptables -t nat -A HAPROXY -p tcp -d $server_ip -j ACCEPT
COUNTER=$(($COUNTER+1))
done
COUNTER=0
#添加备用服务器
while true
do
local server_ip=`uci get haproxy.@backup_server[$COUNTER].server_ip 2>/dev/null`
local server_name=`uci get haproxy.@backup_server[$COUNTER].server_name 2>/dev/null`
local server_port=`uci get haproxy.@backup_server[$COUNTER].server_port 2>/dev/null`
local validate=`uci get haproxy.@backup_server[$COUNTER].validate 2>/dev/null`
if [ -z "$server_ip" ] || [ -z "$server_name" ] || [ -z "$server_port" ]; then
echo break
break
fi
echo the backup server $COUNTER $server_ip $server_name $server_port
[ "$validate" = 1 ] && {
echo server $server_name $server_ip:$server_port weight 10 check backup inter 1500 rise 3 fall 3 >> $CFG_FILE
}
iptables -t nat -A HAPROXY -p tcp -d $server_ip -j ACCEPT
COUNTER=$(($COUNTER+1))
done
iptables -t nat -I OUTPUT -j HAPROXY
/etc/init.d/haproxy enable
/etc/init.d/haproxy restart
cp /etc/init.d/haproxy /etc/haproxy_backup
cp /etc/haproxy_start /etc/init.d/haproxy
}
restart(){
echo luci for haproxy
sleep 1s
local vt_enabled=`uci get haproxy.@arguments[0].enabled 2>/dev/null`
logger -t alex !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!haproxy is initializing enabled is $vt_enabled
echo $vt_enabled
if [ "$vt_enabled" = 1 ]; then
[ -f /etc/haproxy_backup ] && {
cp /etc/haproxy_backup /etc/init.d/haproxy
}
iptables -t nat -D OUTPUT -j HAPROXY &> /dev/null
iptables -t nat -F HAPROXY &> /dev/null
sleep 1
iptables -t nat -X HAPROXY &> /dev/null
start;
else
stop;
fi
}

View File

@ -0,0 +1,73 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2009-2010 OpenWrt.org
START=99
STOP=80
SERVICE_USE_PID=1
HAPROXY_BIN="/usr/sbin/haproxy"
HAPROXY_CONFIG="/etc/haproxy.cfg"
HAPROXY_PID="/var/run/haproxy.pid"
start() {
service_start $HAPROXY_BIN -q -D -f "$HAPROXY_CONFIG" -p "$HAPROXY_PID"
local COUNTER=0
#添加主服务器
iptables -t nat -D OUTPUT -j HAPROXY &> /dev/null
iptables -t nat -X HAPROXY
iptables -t nat -N HAPROXY
iptables -t nat -F HAPROXY
while true
do
local server_ip=`uci get haproxy.@main_server[$COUNTER].server_ip 2>/dev/null`
local server_name=`uci get haproxy.@main_server[$COUNTER].server_name 2>/dev/null`
local server_port=`uci get haproxy.@main_server[$COUNTER].server_port 2>/dev/null`
local server_weight=`uci get haproxy.@main_server[$COUNTER].server_weight 2>/dev/null`
local validate=`uci get haproxy.@main_server[$COUNTER].validate 2>/dev/null`
if [ -z "$server_ip" ] || [ -z "$server_name" ] || [ -z "$server_port" ] || [ -z "$server_weight" ]; then
echo break
break
fi
echo the main2 server $COUNTER $server_ip $server_name $server_port $server_weight
[ "$validate" = 1 ] && {
iptables -t nat -A HAPROXY -p tcp -d $server_ip -j ACCEPT
}
COUNTER=$(($COUNTER+1))
done
COUNTER=0
#添加备用服务器
while true
do
local server_ip=`uci get haproxy.@backup_server[$COUNTER].server_ip 2>/dev/null`
local server_name=`uci get haproxy.@backup_server[$COUNTER].server_name 2>/dev/null`
local server_port=`uci get haproxy.@backup_server[$COUNTER].server_port 2>/dev/null`
local validate=`uci get haproxy.@backup_server[$COUNTER].validate 2>/dev/null`
if [ -z "$server_ip" ] || [ -z "$server_name" ] || [ -z "$server_port" ]; then
echo break
break
fi
echo the backup2 server $COUNTER $server_ip $server_name $server_port
[ "$validate" = 1 ] && {
iptables -t nat -A HAPROXY -p tcp -d $server_ip -j ACCEPT
}
COUNTER=$(($COUNTER+1))
done
iptables -t nat -I OUTPUT -j HAPROXY
}
stop() {
kill -9 $(cat $HAPROXY_PID | tr "\n" " ")
service_stop $HAPROXY_BIN
iptables -t nat -D OUTPUT -j HAPROXY &> /dev/null
iptables -t nat -F HAPROXY &> /dev/null
sleep 1
iptables -t nat -X HAPROXY &> /dev/null
}
reload() {
$HAPROXY_BIN -D -q -f $HAPROXY_CONFIG -p $HAPROXY_PID -sf $(cat $HAPROXY_PID | tr "\n" " ")
#$HAPROXY_BIN -D -q -f $HAPROXY_CONFIG -p $HAPROXY_PID -sf $(cat $HAPROXY_PID)
}

View File

@ -0,0 +1,7 @@
module("luci.controller.haproxy", package.seeall)
function index()
if not nixio.fs.access("/etc/config/haproxy") then
return
end
entry({"admin", "services", "haproxy"}, cbi("haproxy"), _("HAProxy")).dependent = true
end

View File

@ -0,0 +1,67 @@
--Alex<1886090@gmail.com>
local fs = require "nixio.fs"
function sync_value_to_file(value, file) --用来写入文件的函数,目前这种方式已经弃用
value = value:gsub("\r\n?", "\n")
local old_value = nixio.fs.readfile(file)
if value ~= old_value then
nixio.fs.writefile(file, value)
end
end
local state_msg = ""
local haproxy_on = (luci.sys.call("pidof haproxy > /dev/null") == 0)
local router_ip = luci.sys.exec("uci get network.lan.ipaddr")
if haproxy_on then
state_msg = "<b><font color=\"green\">" .. translate("Running") .. "</font></b>"
else
state_msg = "<b><font color=\"red\">" .. translate("Not running") .. "</font></b>"
end
m=Map("haproxy",translate("HAProxy"),translate("HAProxy能够检测Shadowsocks服务器的连通情况从而实现负载均衡和高可用的功能支持主备用服务器宕机自动切换并且可以设置多个主服务器用于分流规定每个分流节点的流量比例等。前提条件是你的所有Shadowsocks服务器的【加密方式】和【密码】一致。<br><br>使用方法配置好你的Shadowsocks服务器ip地址和端口然后开启Shadowsocks服务将服务器地址填写为【127.0.0.1】端口【2222】其他参数和之前一样即可你可以通过访问【路由器的IP:1111/haproxy】输入用户名admin密码root来观察各节点健康状况红色为宕机绿色正常,使用说明请<a href='http://www.right.com.cn/forum/thread-198649-1-1.html'>点击这里</a>") .. "<br><br>后台监控页面:<a href='http://" .. router_ip .. ":1111/haproxy'>" .. router_ip .. ":1111/haproxy</a> 用户名admin密码root" .. "<br><br>状态 - " .. state_msg)
s=m:section(TypedSection,"arguments","")
s.addremove=false
s.anonymous=true
view_enable = s:option(Flag,"enabled",translate("Enable"))
--通过读写配置文件控制HAProxy这种方式已经弃用
--view_cfg = s:option(TextValue, "1", nil)
--view_cfg.rmempty = false
--view_cfg.rows = 43
--function view_cfg.cfgvalue()
-- return nixio.fs.readfile("/etc/haproxy.cfg") or ""
--end
--function view_cfg.write(self, section, value)
-- sync_value_to_file(value, "/etc/haproxy.cfg")
--end
s=m:section(TypedSection,"main_server","<b>" .. translate("Main Server List") .. "<b>")
s.anonymous=true
s.addremove=true
o=s:option(Value,"server_name",translate("Display Name"),translate("Only English Characters,No spaces"))
o.rmempty = false
o=s:option(Flag,"validate",translate("validate"))
o=s:option(Value,"server_ip",translate("Proxy Server IP"))
o.datatype="ip4addr"
o=s:option(Value,"server_port",translate("Proxy Server Port"))
o.datatype="uinteger"
o=s:option(Value,"server_weight",translate("Weight"))
o.datatype="uinteger"
s=m:section(TypedSection,"backup_server","<b>" .. translate("Backup Server List") .. "<b>")
s.anonymous=true
s.addremove=true
o=s:option(Value,"server_name",translate("Display Name"),translate("Only English Characters,No spaces"))
o.rmempty = false
o=s:option(Flag,"validate",translate("validate"))
o=s:option(Value,"server_ip",translate("Proxy Server IP"))
o.datatype="ip4addr"
o=s:option(Value,"server_port",translate("Proxy Server Port"))
o.datatype="uinteger"
-- ---------------------------------------------------
local apply = luci.http.formvalue("cbi.apply")
if apply then
os.execute("/etc/haproxy_init.sh restart >/dev/null 2>&1 &")
end
return m

View File

@ -0,0 +1,34 @@
msgid "Running"
msgstr "运行中"
msgid "Not running"
msgstr "未运行"
msgid "Main Server List"
msgstr "主服务器列表"
msgid "Display Name"
msgstr "服务器名称"
msgid "Only English Characters,No spaces"
msgstr "仅限英文字母,不要有空格"
msgid "Proxy Server IP"
msgstr "代理服务器IP"
msgid "Proxy Server Port"
msgstr "代理服务器端口"
msgid "Weight"
msgstr "分流权重"
msgid "Backup Server List"
msgstr "备用服务器列表"
msgid "validate"
msgstr "生效"

Binary file not shown.

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2017 chenhw2
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,86 +0,0 @@
#
# Copyright (C) 2016 chenhw2 <chenhw2@github.com>
#
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-haproxy-tcp
PKG_VERSION:=0.1.4
PKG_RELEASE:=2
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=chenhw2 <chenhw2@github.com>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/luci-app-haproxy-tcp
SECTION:=luci
CATEGORY:=LuCI
SUBMENU:=3. Applications
TITLE:=LuCI Support for HAProxy-TCP
PKGARCH:=all
DEPENDS:=+haproxy-nossl
endef
define Package/luci-app-haproxy-tcp/description
LuCI Support for HAProxy-TCP.
endef
define Build/Prepare
$(foreach po,$(wildcard ${CURDIR}/files/luci/i18n/*.po), \
po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/luci-app-haproxy-tcp/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
if [ -f /etc/uci-defaults/luci-haproxy-tcp ]; then
( . /etc/uci-defaults/luci-haproxy-tcp ) && \
rm -f /etc/uci-defaults/luci-haproxy-tcp
fi
rm -rf /tmp/luci-indexcache /tmp/luci-modulecache
fi
exit 0
endef
define Package/luci-app-haproxy-tcp/prerm
#!/bin/sh
/etc/init.d/haproxy-tcp disable
/etc/init.d/haproxy-tcp stop
rm -f /usr/sbin/haproxy-tcp
exit 0
endef
define Package/luci-app-haproxy-tcp/conffiles
/etc/config/haproxy-tcp
endef
define Package/luci-app-haproxy-tcp/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
$(INSTALL_DATA) $(PKG_BUILD_DIR)/haproxy-tcp.*.lmo $(1)/usr/lib/lua/luci/i18n/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller
$(INSTALL_DATA) ./files/luci/controller/*.lua $(1)/usr/lib/lua/luci/controller/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi
$(INSTALL_DATA) ./files/luci/model/cbi/*.lua $(1)/usr/lib/lua/luci/model/cbi/
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/root/etc/config/haproxy-tcp $(1)/etc/config/haproxy-tcp
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/root/etc/init.d/haproxy-tcp $(1)/etc/init.d/haproxy-tcp
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/root/etc/uci-defaults/luci-haproxy-tcp $(1)/etc/uci-defaults/luci-haproxy-tcp
$(INSTALL_DIR) $(1)/usr/sbin
$(LN) haproxy $(1)/usr/sbin/haproxy-tcp
endef
$(eval $(call BuildPackage,luci-app-haproxy-tcp))

View File

@ -1,7 +0,0 @@
module("luci.controller.haproxy-tcp", package.seeall)
function index()
entry(
{"admin", "services", "haproxy-tcp"},
cbi("haproxy-tcp"), _("HAProxy-TCP"), 55)
end

View File

@ -1,35 +0,0 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8\n"
msgid "%u seconds"
msgstr "%u 秒"
msgid "Enable"
msgstr "启用"
msgid "General Setting"
msgstr "基本设置"
msgid "HAProxy-TCP"
msgstr "负载均衡-TCP"
msgid "Listen Address:Port"
msgstr "服务地址"
msgid "Retries"
msgstr "重试次数"
msgid "Status Admin"
msgstr "状态管理"
msgid "Startup Delay"
msgstr "自启动延时"
msgid "Port"
msgstr "端口"
msgid "Timeout Connect (ms)"
msgstr "连接超时 (毫秒)"
msgid "UpStream Server"
msgstr "上游服务器"

View File

@ -1,57 +0,0 @@
local m, s, o
if luci.sys.call("pgrep haproxy-tcp >/dev/null") == 0 then
m = Map("haproxy-tcp", translate("HAProxy-TCP"), "%s - %s" %{translate("HAProxy-TCP"), translate("RUNNING")})
else
m = Map("haproxy-tcp", translate("HAProxy-TCP"), "%s - %s" %{translate("HAProxy-TCP"), translate("NOT RUNNING")})
end
s = m:section(TypedSection, "general", translate("General Setting"),
"<a target=\"_blank\" href=\"http://%s:%s\">%s</a>" %{
luci.sys.exec("uci get network.lan.ipaddr | tr -d '\r\n'"),
luci.sys.exec("uci get haproxy-tcp.general.admin_stats | tr -d '\r\n'"),
translate("Status Admin")
})
s.anonymous = true
o = s:option(Flag, "enable", translate("Enable"))
o.rmempty = false
o = s:option(Value, "startup_delay", translate("Startup Delay"))
o:value(0, translate("Not enabled"))
for _, v in ipairs({5, 10, 15, 25, 40}) do
o:value(v, translate("%u seconds") %{v})
end
o.datatype = "uinteger"
o.default = 0
o.rmempty = false
o = s:option(Value, "admin_stats", "%s%s" %{translate("Status Admin"), translate("Port")})
o.placeholder = "7777"
o.default = "7777"
o.datatype = "port"
o.rmempty = false
o = s:option(Value, "listen", translate("Listen Address:Port"))
o.placeholder = "0.0.0.0:6666"
o.default = "0.0.0.0:6666"
o.rmempty = false
o = s:option(Value, "timeout", translate("Timeout Connect (ms)"))
o.placeholder = "666"
o.default = "666"
o.datatype = "range(33, 10000)"
o.rmempty = false
o = s:option(Value, "retries", translate("Retries"))
o.placeholder = "1"
o.default = "1"
o.datatype = "range(1, 10)"
o.rmempty = false
o = s:option(DynamicList, "upstreams", translate("UpStream Server"), translate("e.g. [8.8.8.8:53 weight 100]"))
o.placeholder = "8.8.8.8:53"
o.rmempty = false
return m

View File

@ -1,9 +0,0 @@
config general 'general'
option enable '0'
option retries '1'
option timeout '1000'
option listen '0.0.0.0:6666'
option admin_stats '7777'
option startup_delay '5'
list upstreams '1.2.3.4:8388'

View File

@ -1,74 +0,0 @@
#!/bin/sh /etc/rc.common
START=85
NAME=haproxy-tcp
genline_srv(){
line="$1"
hash="$(echo -n $line | md5sum | cut -c1-6)"
hash="$(echo -n $line | tr -d '\t ' | cut -c1-8)__$hash"
echo " server $hash $line" | tr -d "\'"
}
boot() {
local delay=$(uci -q get $NAME.general.startup_delay)
(sleep ${delay:-0} && start >/dev/null 2>&1) &
return 0
}
start() {
enable=$(uci -q get $NAME.general.enable)
[ "$enable" = 1 ] || return 0
listen=$(uci -q get $NAME.general.listen)
admin_stats=$(uci -q get $NAME.general.admin_stats)
retries=$(uci -q get $NAME.general.retries)
timeout=$(uci -q get $NAME.general.timeout)
upstreams=$(uci -q get $NAME.general.upstreams)
mkdir -p /var/etc
cat <<-EOF > /var/etc/$NAME.cfg
global
nbproc 2
defaults
mode tcp
retries ${retries:-2}
timeout connect ${timeout:-1000}
listen admin_stats
bind 0.0.0.0:${admin_stats:-7777}
mode http
stats uri /
stats refresh 10s
frontend tcp-in
bind ${listen:-0.0.0.0:6666}
default_backend tcp-out
backend tcp-out
$( if [ 0 -lt $(grep -c weight /etc/config/$NAME) ]; then
echo " balance static-rr"
sed -n 's/.*upstreams[\t ]*//p' /etc/config/$NAME |
while read upstream; do
genline_srv "$upstream"
done
else
for upstream in $upstreams; do
genline_srv "$upstream"
done
fi
)
EOF
/usr/sbin/$NAME -q -D -f /var/etc/$NAME.cfg -p /var/run/$NAME.pid
}
kill_all() {
kill -9 $(pgrep -f $@) >/dev/null 2>&1
}
stop() {
kill_all "$NAME.pid"
rm -rf /var/etc/$NAME.cfg
}

View File

@ -1,15 +0,0 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@haproxy-tcp[-1]
add ucitrack haproxy-tcp
set ucitrack.@haproxy-tcp[-1].init=haproxy-tcp
commit ucitrack
EOF
/etc/init.d/haproxy stop
/etc/init.d/haproxy disable
/etc/init.d/haproxy-tcp enable
exit 0

View File

@ -285,64 +285,64 @@ msgid ""
msgstr "更新 LuCI 之后你可能需要手动刷新当前页面。注意:翻译不会被更新"
msgid "acknodelay"
msgstr ""
msgstr "立即响应"
msgid "autoexpire"
msgstr ""
msgstr "过期时间"
msgid "conn"
msgstr ""
msgstr "连接数"
msgid "crypt"
msgstr ""
msgstr "加密方式"
msgid "datashard"
msgstr ""
msgstr "数据块"
msgid "dscp"
msgstr ""
msgstr "数据包优先级"
msgid "interval"
msgstr ""
msgstr "间隔时间"
msgid "keepalive"
msgstr ""
msgstr "保持连接时间"
msgid "mode"
msgstr ""
msgstr "模式"
msgid "mtu"
msgstr ""
msgstr "MTU大小"
msgid "nc"
msgstr ""
msgstr "关闭流控"
msgid "nocomp"
msgstr ""
msgstr "禁用压缩"
msgid "nodelay"
msgstr ""
msgstr "Nodelay模式"
msgid "optional"
msgstr "可选"
msgid "parityshard"
msgstr ""
msgstr "校验块"
msgid "rcvwnd"
msgstr ""
msgstr "接收窗口大小"
msgid "resend"
msgstr ""
msgstr "快速重传"
msgid "scavengettl"
msgstr ""
msgstr "清除TTL"
msgid "sndwnd"
msgstr ""
msgstr "发送窗口大小"
msgid "snmpperiod"
msgstr ""
msgstr "SNMP周期"
msgid "sockbuf"
msgstr ""
msgstr "Socket缓冲区大小"

View File

@ -125,6 +125,10 @@ protocol:value("auth_chain_d")
protocol:value("auth_chain_e")
protocol:value("auth_chain_f")
protoparam = s:taboption("main",Value, "protoparam", translate("Protocol Param"))
protoparam.optional = true
protoparam.rmempty = true
obfs = s:taboption("main",ListValue, "obfs", translate("Obfs Param"))
obfs:value("plain")
obfs:value("http_simple")
@ -142,7 +146,6 @@ plugin_param:depends("obfs", "tls1.2_ticket_fastauth")
obfs_param = s:taboption("main",Value, "obfs_param", translate("Confusing plug-in parameters"))
obfs_param.rmempty = true
obfs_param.datatype = "host"
obfs_param:depends("plugin_param", "1")
s:tab("list", translate("User-defined GFW-List"))

View File

@ -58,6 +58,9 @@ msgstr "加密"
msgid "Protocol"
msgstr "协议"
msgid "Protocol Param"
msgstr "协议参数"
msgid "Obfs Param"
msgstr "混淆"

View File

@ -43,6 +43,7 @@ start()
local vt_password=`uci get shadowsocksr.@shadowsocksr[0].password 2>/dev/null`
local vt_method=`uci get shadowsocksr.@shadowsocksr[0].method`
local vt_protocol=`uci get shadowsocksr.@shadowsocksr[0].protocol`
local vt_protoparam=`uci get shadowsocksr.@shadowsocksr[0].protoparam 2>/dev/null`
local vt_obfs=`uci get shadowsocksr.@shadowsocksr[0].obfs`
local vt_timeout=`uci get shadowsocksr.@shadowsocksr[0].timeout 2>/dev/null`
local vt_safe_dns=`uci get shadowsocksr.@shadowsocksr[0].safe_dns 2>/dev/null`
@ -89,7 +90,7 @@ start()
"local_port": $SS_REDIR_PORT,
"timeout": $vt_timeout,
"protocol": "$vt_protocol",
"protocol_param": "",
"protocol_param": "$vt_protoparam",
"obfs": "$vt_obfs",
"obfs_param": "$obfs_param",
"fast_open": false

View File

@ -7,9 +7,9 @@
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI Support for Xware downloading app.
LUCI_DEPENDS:=+wget
LUCI_DEPENDS:=@arm +wget
PKG_VERSION:=1.0
PKG_RELEASE:=1
PKG_RELEASE:=2
include $(TOPDIR)/feeds/luci/luci.mk

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -13,7 +13,7 @@ FEATURES:=usbgadget
CPU_TYPE:=24kc
SUBTARGETS:=generic nand mikrotik
KERNEL_PATCHVER:=4.9
KERNEL_PATCHVER:=4.4
include $(INCLUDE_DIR)/target.mk

View File

@ -34,8 +34,8 @@ define Device/domywifi-dw33d
DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x
BOARDNAME := DW33D
IMAGE_SIZE := 16000k
MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,13952k(rootfs),2048k(kernel),64k(art)ro,16000k@0x50000(firmware);ar934x-nfc:96m(rootfs_data),32m(backup)ro
IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 13952k | append-kernel | check-size $$$$(IMAGE_SIZE)
MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware);ar934x-nfc:96m(rootfs_data),32m(backup)ro
IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 14528k | append-kernel | check-size $$$$(IMAGE_SIZE)
endef
TARGET_DEVICES += domywifi-dw33d

View File

@ -11,6 +11,9 @@ board_config_update
board=$(board_name)
case "$board" in
armada-385-db-ap)
ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2"
;;
armada-385-linksys-caiman|\
armada-385-linksys-cobra|\
armada-385-linksys-rango|\
@ -20,12 +23,6 @@ armada-xp-linksys-mamba)
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0" "4:wan" "6@eth1"
;;
armada-385-db-ap)
ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2"
;;
armada-xp-gp)
ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
;;
armada-388-clearfog-*)
# eth0 is standalone ethernet
# eth1 is switch (-pro) or standalone ethernet (-base)
@ -38,6 +35,9 @@ armada-388-clearfog-*)
ucidef_add_switch "switch0" \
"0:lan:5" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5u@eth1" "6:lan:6"
;;
armada-xp-gp)
ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
;;
*)
ucidef_set_interface_lan "eth0"
;;

View File

@ -16,10 +16,7 @@ platform_do_upgrade() {
armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba)
platform_do_upgrade_linksys "$ARGV"
;;
armada-388-clearfog-pro)
platform_do_upgrade_clearfog "$ARGV"
;;
armada-388-clearfog-base)
armada-388-clearfog-base|armada-388-clearfog-pro)
platform_do_upgrade_clearfog "$ARGV"
;;
*)
@ -32,7 +29,7 @@ platform_copy_config() {
armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba)
platform_copy_config_linksys
;;
armada-388-clearfog)
armada-388-clearfog-base|armada-388-clearfog-pro)
platform_copy_config_clearfog "$ARGV"
;;
esac

View File

@ -119,7 +119,7 @@ define Device/linksys-wrt3200acm
$(call Device/linksys,WRT3200ACM (Rango))
$(Device/armada-385-linksys)
DEVICE_DTS := armada-385-linksys-rango
DEVICE_PACKAGES += kmod-mwifiex-sdio
DEVICE_PACKAGES += kmod-btmrvl kmod-mwifiex-sdio
endef
TARGET_DEVICES += linksys-wrt3200acm
@ -192,13 +192,9 @@ define Device/armada-388-clearfog-base
KERNEL_INSTALL := 1
KERNEL := kernel-bin
DEVICE_TITLE := SolidRun ClearFog Base
DEVICE_PACKAGES := \
kmod-nls-cp437 kmod-nls-iso8859-1 \
mkf2fs e2fsprogs kmod-fs-vfat kmod-fuse kmod-fs-f2fs \
kmod-ata-core kmod-ata-ahci kmod-ata-marvell-sata kmod-scsi-core kmod-scsi-generic \
kmod-button-hotplug kmod-gpio-button-hotplug
DEVICE_PACKAGES := mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1
IMAGES := sdcard.img.gz
IMAGE/sdcard.img.gz := boot-scr-cfbase | boot-img | sdcard-img | gzip
IMAGE/sdcard.img.gz := boot-scr-cfbase | boot-img | sdcard-img | gzip | append-metadata
IMAGE_NAME = $$(IMAGE_PREFIX)-$$(2)
DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base
endef

View File

@ -63,7 +63,7 @@
/* reset txq */
txq->count = 0;
@@ -2882,6 +2894,8 @@ static int mvneta_txq_init(struct mvneta
@@ -2880,6 +2892,8 @@ static int mvneta_txq_init(struct mvneta
static void mvneta_txq_deinit(struct mvneta_port *pp,
struct mvneta_tx_queue *txq)
{
@ -72,7 +72,7 @@
kfree(txq->tx_skb);
if (txq->tso_hdrs)
@@ -2893,6 +2907,8 @@ static void mvneta_txq_deinit(struct mvn
@@ -2891,6 +2905,8 @@ static void mvneta_txq_deinit(struct mvn
txq->size * MVNETA_DESC_ALIGNED_SIZE,
txq->descs, txq->descs_phys);

View File

@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3835,6 +3835,16 @@ static int mvneta_ethtool_get_rxfh(struc
@@ -3833,6 +3833,16 @@ static int mvneta_ethtool_get_rxfh(struc
return 0;
}
@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static const struct net_device_ops mvneta_netdev_ops = {
.ndo_open = mvneta_open,
.ndo_stop = mvneta_stop,
@@ -3845,6 +3855,7 @@ static const struct net_device_ops mvnet
@@ -3843,6 +3853,7 @@ static const struct net_device_ops mvnet
.ndo_fix_features = mvneta_fix_features,
.ndo_get_stats64 = mvneta_get_stats64,
.ndo_do_ioctl = mvneta_ioctl,

View File

@ -182,7 +182,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* Release Tx descriptors */
@@ -2982,7 +2929,6 @@ static int mvneta_setup_txqs(struct mvne
@@ -2980,7 +2927,6 @@ static int mvneta_setup_txqs(struct mvne
static void mvneta_start_dev(struct mvneta_port *pp)
{
int cpu;
@ -190,7 +190,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
mvneta_max_rx_size_set(pp, pp->pkt_size);
mvneta_txq_max_tx_size_set(pp, pp->pkt_size);
@@ -3005,16 +2951,15 @@ static void mvneta_start_dev(struct mvne
@@ -3003,16 +2949,15 @@ static void mvneta_start_dev(struct mvne
MVNETA_CAUSE_LINK_CHANGE |
MVNETA_CAUSE_PSC_SYNC_CHANGE);
@ -209,7 +209,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
for_each_online_cpu(cpu) {
struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
@@ -3184,99 +3129,210 @@ static int mvneta_set_mac_addr(struct ne
@@ -3182,99 +3127,210 @@ static int mvneta_set_mac_addr(struct ne
return 0;
}
@ -490,7 +490,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* Electing a CPU must be done in an atomic way: it should be done
@@ -3534,10 +3590,9 @@ static int mvneta_stop(struct net_device
@@ -3532,10 +3588,9 @@ static int mvneta_stop(struct net_device
static int mvneta_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
@ -503,7 +503,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* Ethtool methods */
@@ -3548,44 +3603,18 @@ mvneta_ethtool_set_link_ksettings(struct
@@ -3546,44 +3601,18 @@ mvneta_ethtool_set_link_ksettings(struct
const struct ethtool_link_ksettings *cmd)
{
struct mvneta_port *pp = netdev_priv(ndev);
@ -557,7 +557,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* Set interrupt coalescing for ethtools */
@@ -3693,26 +3722,28 @@ static void mvneta_ethtool_update_stats(
@@ -3691,26 +3720,28 @@ static void mvneta_ethtool_update_stats(
{
const struct mvneta_statistic *s;
void __iomem *base = pp->base;
@ -591,7 +591,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
}
@@ -3872,7 +3903,7 @@ const struct ethtool_ops mvneta_eth_tool
@@ -3870,7 +3901,7 @@ const struct ethtool_ops mvneta_eth_tool
.get_rxnfc = mvneta_ethtool_get_rxnfc,
.get_rxfh = mvneta_ethtool_get_rxfh,
.set_rxfh = mvneta_ethtool_set_rxfh,
@ -600,7 +600,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
.set_link_ksettings = mvneta_ethtool_set_link_ksettings,
};
@@ -3999,14 +4030,13 @@ static int mvneta_probe(struct platform_
@@ -3997,14 +4028,13 @@ static int mvneta_probe(struct platform_
const struct mbus_dram_target_info *dram_target_info;
struct resource *res;
struct device_node *dn = pdev->dev.of_node;
@ -616,7 +616,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
int tx_csum_limit;
int phy_mode;
int err;
@@ -4022,31 +4052,11 @@ static int mvneta_probe(struct platform_
@@ -4020,31 +4050,11 @@ static int mvneta_probe(struct platform_
goto err_free_netdev;
}
@ -649,7 +649,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
dev->tx_queue_len = MVNETA_MAX_TXD;
@@ -4057,12 +4067,7 @@ static int mvneta_probe(struct platform_
@@ -4055,12 +4065,7 @@ static int mvneta_probe(struct platform_
pp = netdev_priv(dev);
spin_lock_init(&pp->lock);
@ -663,7 +663,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
pp->rxq_def = rxq_def;
@@ -4073,7 +4078,7 @@ static int mvneta_probe(struct platform_
@@ -4071,7 +4076,7 @@ static int mvneta_probe(struct platform_
pp->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(pp->clk)) {
err = PTR_ERR(pp->clk);
@ -672,7 +672,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
clk_prepare_enable(pp->clk);
@@ -4181,6 +4186,14 @@ static int mvneta_probe(struct platform_
@@ -4179,6 +4184,14 @@ static int mvneta_probe(struct platform_
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
dev->gso_max_segs = MVNETA_MAX_TSO_SEGS;
@ -687,7 +687,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
err = register_netdev(dev);
if (err < 0) {
dev_err(&pdev->dev, "failed to register\n");
@@ -4192,14 +4205,6 @@ static int mvneta_probe(struct platform_
@@ -4190,14 +4203,6 @@ static int mvneta_probe(struct platform_
platform_set_drvdata(pdev, pp->dev);
@ -702,7 +702,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
return 0;
err_netdev:
@@ -4210,16 +4215,14 @@ err_netdev:
@@ -4208,16 +4213,14 @@ err_netdev:
1 << pp->id);
}
err_free_stats:
@ -721,7 +721,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
err_free_irq:
irq_dispose_mapping(dev->irq);
err_free_netdev:
@@ -4231,7 +4234,6 @@ err_free_netdev:
@@ -4229,7 +4232,6 @@ err_free_netdev:
static int mvneta_remove(struct platform_device *pdev)
{
struct net_device *dev = platform_get_drvdata(pdev);
@ -729,7 +729,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
struct mvneta_port *pp = netdev_priv(dev);
unregister_netdev(dev);
@@ -4239,10 +4241,8 @@ static int mvneta_remove(struct platform
@@ -4237,10 +4239,8 @@ static int mvneta_remove(struct platform
clk_disable_unprepare(pp->clk);
free_percpu(pp->ports);
free_percpu(pp->stats);

View File

@ -26,7 +26,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
}
/* Release Tx descriptors */
@@ -2948,8 +2950,7 @@ static void mvneta_start_dev(struct mvne
@@ -2946,8 +2948,7 @@ static void mvneta_start_dev(struct mvne
mvreg_write(pp, MVNETA_INTR_MISC_MASK,
MVNETA_CAUSE_PHY_STATUS_CHANGE |
@ -36,7 +36,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
phylink_start(pp->phylink);
netif_tx_start_all_queues(pp->dev);
@@ -3440,8 +3441,7 @@ static int mvneta_cpu_online(unsigned in
@@ -3438,8 +3439,7 @@ static int mvneta_cpu_online(unsigned in
on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
mvreg_write(pp, MVNETA_INTR_MISC_MASK,
MVNETA_CAUSE_PHY_STATUS_CHANGE |
@ -46,7 +46,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
netif_tx_start_all_queues(pp->dev);
spin_unlock(&pp->lock);
return 0;
@@ -3482,8 +3482,7 @@ static int mvneta_cpu_dead(unsigned int
@@ -3480,8 +3480,7 @@ static int mvneta_cpu_dead(unsigned int
on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
mvreg_write(pp, MVNETA_INTR_MISC_MASK,
MVNETA_CAUSE_PHY_STATUS_CHANGE |

View File

@ -11,7 +11,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3616,6 +3616,13 @@ mvneta_ethtool_get_link_ksettings(struct
@@ -3614,6 +3614,13 @@ mvneta_ethtool_get_link_ksettings(struct
return phylink_ethtool_ksettings_get(pp->phylink, cmd);
}
@ -25,7 +25,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
/* Set interrupt coalescing for ethtools */
static int mvneta_ethtool_set_coalesce(struct net_device *dev,
struct ethtool_coalesce *c)
@@ -3889,6 +3896,7 @@ static const struct net_device_ops mvnet
@@ -3887,6 +3894,7 @@ static const struct net_device_ops mvnet
};
const struct ethtool_ops mvneta_eth_tool_ops = {

View File

@ -11,7 +11,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3180,6 +3180,12 @@ static int mvneta_mac_link_state(struct
@@ -3178,6 +3178,12 @@ static int mvneta_mac_link_state(struct
state->link = !!(gmac_stat & MVNETA_GMAC_LINK_UP);
state->duplex = !!(gmac_stat & MVNETA_GMAC_FULL_DUPLEX);
@ -24,7 +24,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
return 1;
}
@@ -3222,6 +3228,8 @@ static void mvneta_mac_config(struct net
@@ -3220,6 +3226,8 @@ static void mvneta_mac_config(struct net
if (phylink_test(state->advertising, Pause))
new_an |= MVNETA_GMAC_ADVERT_SYM_FLOW_CTRL;
@ -33,7 +33,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
switch (mode) {
case MLO_AN_SGMII:
@@ -3246,7 +3254,7 @@ static void mvneta_mac_config(struct net
@@ -3244,7 +3252,7 @@ static void mvneta_mac_config(struct net
/* The MAC only supports FD mode */
MVNETA_GMAC_CONFIG_FULL_DUPLEX;
@ -42,7 +42,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
new_an |= MVNETA_GMAC_AN_FLOW_CTRL_EN;
break;
@@ -3712,6 +3720,22 @@ static int mvneta_ethtool_set_ringparam(
@@ -3710,6 +3718,22 @@ static int mvneta_ethtool_set_ringparam(
return 0;
}
@ -65,7 +65,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset,
u8 *data)
{
@@ -3903,6 +3927,8 @@ const struct ethtool_ops mvneta_eth_tool
@@ -3901,6 +3925,8 @@ const struct ethtool_ops mvneta_eth_tool
.get_drvinfo = mvneta_ethtool_get_drvinfo,
.get_ringparam = mvneta_ethtool_get_ringparam,
.set_ringparam = mvneta_ethtool_set_ringparam,

View File

@ -12,7 +12,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3154,10 +3154,11 @@ static void mvneta_validate_support(stru
@@ -3152,10 +3152,11 @@ static void mvneta_validate_support(stru
phylink_set(mask, 10baseT_Full);
phylink_set(mask, 100baseT_Half);
phylink_set(mask, 100baseT_Full);

View File

@ -11,7 +11,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3144,6 +3144,8 @@ static void mvneta_validate_support(stru
@@ -3142,6 +3142,8 @@ static void mvneta_validate_support(stru
phylink_set(mask, BNC);
phylink_set(mask, Backplane);
@ -20,7 +20,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
/* Half-duplex at speeds higher than 100Mbit is unsupported */
phylink_set(mask, 1000baseT_Full);
phylink_set(mask, 1000baseX_Full);
@@ -3156,9 +3158,6 @@ static void mvneta_validate_support(stru
@@ -3154,9 +3156,6 @@ static void mvneta_validate_support(stru
phylink_set(mask, 100baseT_Full);
}

View File

@ -10,7 +10,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3306,7 +3306,8 @@ static void mvneta_mac_link_down(struct
@@ -3304,7 +3304,8 @@ static void mvneta_mac_link_down(struct
}
}

View File

@ -65,7 +65,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
u64 ethtool_stats[ARRAY_SIZE(mvneta_statistics)];
u32 indir[MVNETA_RSS_LU_TABLE_SIZE];
@@ -3291,6 +3308,18 @@ static void mvneta_mac_config(struct net
@@ -3289,6 +3306,18 @@ static void mvneta_mac_config(struct net
mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, new_an);
}
@ -84,7 +84,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
static void mvneta_mac_link_down(struct net_device *ndev, unsigned int mode)
{
struct mvneta_port *pp = netdev_priv(ndev);
@@ -3304,6 +3333,9 @@ static void mvneta_mac_link_down(struct
@@ -3302,6 +3331,9 @@ static void mvneta_mac_link_down(struct
val |= MVNETA_GMAC_FORCE_LINK_DOWN;
mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
}
@ -94,7 +94,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
static void mvneta_mac_link_up(struct net_device *ndev, unsigned int mode,
@@ -3320,6 +3352,11 @@ static void mvneta_mac_link_up(struct ne
@@ -3318,6 +3350,11 @@ static void mvneta_mac_link_up(struct ne
}
mvneta_port_up(pp);
@ -106,7 +106,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
static const struct phylink_mac_ops mvneta_phylink_ops = {
@@ -3772,6 +3809,13 @@ static void mvneta_ethtool_update_stats(
@@ -3770,6 +3807,13 @@ static void mvneta_ethtool_update_stats(
high = readl_relaxed(base + s->offset + 4);
val = (u64)high << 32 | low;
break;
@ -120,7 +120,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
pp->ethtool_stats[i] += val;
@@ -3907,6 +3951,47 @@ static u16 mvneta_select_queue(struct ne
@@ -3905,6 +3949,47 @@ static u16 mvneta_select_queue(struct ne
}
@ -168,7 +168,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
static const struct net_device_ops mvneta_netdev_ops = {
.ndo_open = mvneta_open,
.ndo_stop = mvneta_stop,
@@ -3939,6 +4024,8 @@ const struct ethtool_ops mvneta_eth_tool
@@ -3937,6 +4022,8 @@ const struct ethtool_ops mvneta_eth_tool
.set_rxfh = mvneta_ethtool_set_rxfh,
.get_link_ksettings = mvneta_ethtool_get_link_ksettings,
.set_link_ksettings = mvneta_ethtool_set_link_ksettings,

View File

@ -7,7 +7,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3951,6 +3951,22 @@ static u16 mvneta_select_queue(struct ne
@@ -3949,6 +3949,22 @@ static u16 mvneta_select_queue(struct ne
}
@ -30,7 +30,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
static int mvneta_ethtool_get_eee(struct net_device *dev,
struct ethtool_eee *eee)
{
@@ -4024,6 +4040,8 @@ const struct ethtool_ops mvneta_eth_tool
@@ -4022,6 +4038,8 @@ const struct ethtool_ops mvneta_eth_tool
.set_rxfh = mvneta_ethtool_set_rxfh,
.get_link_ksettings = mvneta_ethtool_get_link_ksettings,
.set_link_ksettings = mvneta_ethtool_set_link_ksettings,