Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2024-01-05 11:09:54 +08:00
commit dbdd239436
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
14 changed files with 688 additions and 39 deletions

View File

@ -103,7 +103,8 @@ livinet,zr-3020-ubootmod|\
qihoo,360t7-ubootmod)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" "1"
;;
mercusys,mr90x-v1)
mercusys,mr90x-v1|\
routerich,ax3000)
local envdev=/dev/mtd$(find_mtd_index "u-boot-env")
ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1"
;;

View File

@ -43,6 +43,7 @@ beeline,smartbox-giga|\
beeline,smartbox-turbo|\
beeline,smartbox-turbo-plus|\
etisalat,s3|\
rostelecom,rt-fe-1a|\
rostelecom,rt-sf-1)
ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000"
;;

View File

@ -0,0 +1,34 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Wed, 3 Jan 2024 15:10:18 +0100
Subject: [PATCH] wifi: mac80211: fix race condition on enabling fast-xmit
fast-xmit must only be enabled after the sta has been uploaded to the driver,
otherwise it could end up passing the not-yet-uploaded sta via drv_tx calls
to the driver, leading to potential crashes because of uninitialized drv_priv
data.
Add a missing sta->uploaded check and re-check fast xmit after inserting a sta.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -886,6 +886,7 @@ static int sta_info_insert_finish(struct
if (ieee80211_vif_is_mesh(&sdata->vif))
mesh_accept_plinks_update(sdata);
+ ieee80211_check_fast_xmit(sta);
return 0;
out_remove:
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3041,7 +3041,7 @@ void ieee80211_check_fast_xmit(struct st
sdata->vif.type == NL80211_IFTYPE_STATION)
goto out;
- if (!test_sta_flag(sta, WLAN_STA_AUTHORIZED))
+ if (!test_sta_flag(sta, WLAN_STA_AUTHORIZED) || !sta->uploaded)
goto out;
if (test_sta_flag(sta, WLAN_STA_PS_STA) ||

View File

@ -1,13 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=netifd
PKG_RELEASE:=1.1
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
PKG_SOURCE_DATE:=2023-11-10
PKG_SOURCE_VERSION:=35facc8306f590a7330789ab6d5785c0d43073ef
PKG_MIRROR_HASH:=4f73591ae1873e18df235349e478f2196ca0d3123c313a04149dc9d5e2bfb403
PKG_SOURCE_DATE:=2024-01-04
PKG_SOURCE_VERSION:=c18cc79d50002ab8529c21184aceb016c61ac61c
PKG_MIRROR_HASH:=0a1080ade51dc4a55249c8899d4d384f665e0d21075adab24ea23a2808165e05
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=GPL-2.0

View File

@ -1,32 +0,0 @@
From 8587c074f1eb2064c42adb0a6aa5073f695ab89d Mon Sep 17 00:00:00 2001
From: Jo-Philipp Wich <jo@mein.io>
Date: Tue, 14 Nov 2023 14:01:44 +0100
Subject: [PATCH] interface-ip: fix IPv4 route target masking
A previous commit supposed to mask out excess host bits in route targets
failed to correctly calculate the mask value, causing it to produce
improper results for certain mask lengths.
Fixes: #17
Fixes: 76eb342 ("interface-ip: mask out host bits in IPv4 route targets")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
---
interface-ip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/interface-ip.c b/interface-ip.c
index d2fe385..28e7106 100644
--- a/interface-ip.c
+++ b/interface-ip.c
@@ -448,7 +448,7 @@ interface_ip_add_route(struct interface *iface, struct blob_attr *attr, bool v6)
/* Mask out IPv4 host bits to avoid "Invalid prefix for given prefix length" */
if (af == AF_INET && route->mask < 32)
- route->addr.in.s_addr &= ((1u << route->mask) - 1);
+ clear_if_addr(&route->addr, route->mask);
}
if ((cur = tb[ROUTE_GATEWAY]) != NULL) {
--
2.39.1

View File

@ -155,6 +155,12 @@ dropbear_instance()
PIDCOUNT="$(( ${PIDCOUNT} + 1))"
local pid_file="/var/run/${NAME}.${PIDCOUNT}.pid"
# Increase default receive window size to increase
# throughput on high latency links
if [ "${RecvWindowSize}" -eq "0" ]; then
RecvWindowSize="262144"
fi
procd_open_instance
procd_set_param command "$PROG" -F -P "$pid_file"
[ "${PasswordAuth}" -eq 0 ] && procd_append_param command -s

View File

@ -0,0 +1,337 @@
// SPDX-License-Identifier: GPL-2.0-only OR MIT
/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
#include "mt7981.dtsi"
/ {
model = "Routerich AX3000";
compatible = "routerich,ax3000", "mediatek,mt7981";
aliases {
label-mac-device = &wan;
led-boot = &led_power_blue;
led-failsafe = &led_power_blue;
led-running = &led_power_blue;
led-upgrade = &led_power_blue;
serial0 = &uart0;
};
chosen {
stdout-path = "serial0:115200n8";
};
gpio-keys {
compatible = "gpio-keys";
button-0 {
label = "mesh";
linux,input-type = <EV_SW>;
linux,code = <BTN_0>;
gpios = <&pio 0 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
button-1 {
label = "reset";
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
debounce-interval = <60>;
};
};
leds {
compatible = "gpio-leds";
led-0 {
color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_WLAN;
function-enumerator = <50>;
gpios = <&pio 5 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
led-1 {
color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_WAN;
gpios = <&pio 6 GPIO_ACTIVE_HIGH>;
};
led_power_blue: led-2 {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_POWER;
gpios = <&pio 7 GPIO_ACTIVE_LOW>;
};
led-3 {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_LAN;
function-enumerator = <1>;
gpios = <&pio 9 GPIO_ACTIVE_LOW>;
};
led-4 {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_LAN;
function-enumerator = <2>;
gpios = <&pio 10 GPIO_ACTIVE_LOW>;
};
led-5 {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_LAN;
function-enumerator = <3>;
gpios = <&pio 11 GPIO_ACTIVE_LOW>;
};
led-6 {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_WAN;
gpios = <&pio 12 GPIO_ACTIVE_LOW>;
};
led-7 {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_WLAN;
function-enumerator = <24>;
gpios = <&pio 34 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
led-8 {
color = <LED_COLOR_ID_BLUE>;
/* LED_FUNCTION_MESH isn't implemented yet */
function = "mesh";
gpios = <&pio 35 GPIO_ACTIVE_LOW>;
};
};
memory {
reg = <0 0x40000000 0 0x10000000>;
};
};
&eth {
status = "okay";
gmac0: mac@0 {
compatible = "mediatek,eth-mac";
reg = <0>;
phy-mode = "2500base-x";
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_factory_4 (-1)>;
fixed-link {
speed = <2500>;
full-duplex;
pause;
};
};
};
&mdio_bus {
switch: switch@1f {
compatible = "mediatek,mt7531";
reg = <0x1f>;
reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&pio>;
interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
};
};
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_flash_pins>;
status = "okay";
/* ESMT F50L1G41LB (128M) */
spi_nand@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "spi-nand";
reg = <0>;
spi-max-frequency = <52000000>;
spi-tx-buswidth = <4>;
spi-rx-buswidth = <4>;
spi-cal-enable;
spi-cal-mode = "read-data";
spi-cal-datalen = <7>;
spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4e 0x41 0x4e 0x44>;
spi-cal-addrlen = <5>;
spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>;
mediatek,nmbm;
mediatek,bmt-max-ratio = <1>;
mediatek,bmt-max-reserved-blocks = <64>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0_all {
label = "spi0.0";
reg = <0x0 0x8000000>;
read-only;
};
partition@0 {
label = "BL2";
reg = <0x0 0x100000>;
read-only;
};
partition@100000 {
label = "u-boot-env";
reg = <0x100000 0x80000>;
};
partition@180000 {
label = "Factory";
reg = <0x180000 0x200000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
eeprom_factory_0: eeprom@0 {
reg = <0x0 0x1000>;
};
macaddr_factory_4: macaddr@4 {
compatible = "mac-base";
reg = <0x4 0x6>;
#nvmem-cell-cells = <1>;
};
};
};
partition@380000 {
label = "FIP";
reg = <0x380000 0x200000>;
read-only;
};
partition@580000 {
label = "ubi";
reg = <0x580000 0x4000000>;
};
partition@4580000 {
label = "firmware_backup";
reg = <0x4580000 0x2000000>;
read-only;
};
partition@6580000 {
label = "zrsave";
reg = <0x6580000 0x100000>;
read-only;
};
partition@6680000 {
label = "config2";
reg = <0x6680000 0x100000>;
read-only;
};
};
};
};
&switch {
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
label = "lan1";
};
port@2 {
reg = <2>;
label = "lan2";
};
port@3 {
reg = <3>;
label = "lan3";
};
wan: port@4 {
reg = <4>;
label = "wan";
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_factory_4 (-2)>;
};
port@6 {
reg = <6>;
ethernet = <&gmac0>;
phy-mode = "2500base-x";
fixed-link {
speed = <2500>;
full-duplex;
pause;
};
};
};
};
&pio {
spi0_flash_pins: spi0-pins {
mux {
function = "spi";
groups = "spi0", "spi0_wp_hold";
};
conf-pu {
pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
};
conf-pd {
pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
};
};
};
&uart0 {
status = "okay";
};
&usb_phy {
status = "okay";
};
&watchdog {
status = "okay";
};
&wifi {
status = "okay";
nvmem-cell-names = "eeprom";
nvmem-cells = <&eeprom_factory_0>;
};
&xhci {
status = "okay";
mediatek,u3p-dis-msk = <0x1>;
};

View File

@ -46,6 +46,13 @@ netgear,wax220)
ucidef_set_led_netdev "wlan2g" "WLAN2G" "blue:wlan2g" "phy0-ap0"
ucidef_set_led_netdev "wlan5g" "WLAN5G" "blue:wlan5g" "phy1-ap0"
;;
routerich,ax3000)
ucidef_set_led_netdev "lan-1" "lan-1" "blue:lan-1" "lan1" "link tx rx"
ucidef_set_led_netdev "lan-2" "lan-2" "blue:lan-2" "lan2" "link tx rx"
ucidef_set_led_netdev "lan-3" "lan-3" "blue:lan-3" "lan3" "link tx rx"
ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" "link tx rx"
ucidef_set_led_netdev "wan-off" "wan-off" "red:wan" "wan" "link"
;;
xiaomi,mi-router-wr30u-112m-nmbm|\
xiaomi,mi-router-wr30u-stock|\
xiaomi,mi-router-wr30u-ubootmod)

View File

@ -50,7 +50,8 @@ mediatek_setup_interfaces()
livinet,zr-3020|\
livinet,zr-3020-ubootmod|\
qihoo,360t7|\
qihoo,360t7-ubootmod)
qihoo,360t7-ubootmod|\
routerich,ax3000)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
;;
glinet,gl-mt2500|\

View File

@ -133,6 +133,7 @@ case "$board" in
[ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
;;
routerich,ax3000|\
zbtlink,zbt-z8102ax|\
zyxel,ex5601-t0|\
zyxel,ex5601-t0-ubootmod)

View File

@ -423,7 +423,7 @@ define Device/confiabits_mt7981
IMAGE_SIZE := 65536k
KERNEL_IN_UBI := 1
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
DEVICE_PACKAGES := kmod-usb3 kmod-mt7981-firmware
DEVICE_PACKAGES := kmod-usb3 kmod-mt7981-firmware mt7981-wo-firmware
endef
TARGET_DEVICES += confiabits_mt7981
@ -921,6 +921,17 @@ define Device/qihoo_360t7-ubootmod
endef
TARGET_DEVICES += qihoo_360t7-ubootmod
define Device/routerich_ax3000
DEVICE_VENDOR := Routerich
DEVICE_MODEL := AX3000
DEVICE_DTS := mt7981b-routerich-ax3000
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-rfb
endef
TARGET_DEVICES += routerich_ax3000
define Device/tplink_tl-xdr-common
DEVICE_VENDOR := TP-Link
DEVICE_DTS_DIR := ../dts

View File

@ -0,0 +1,266 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7621.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
/ {
compatible = "rostelecom,rt-fe-1a", "mediatek,mt7621-soc";
model = "Rostelecom RT-FE-1A";
aliases {
label-mac-device = &gmac0;
led-boot = &led_status_green;
led-failsafe = &led_status_green;
led-running = &led_status_green;
led-upgrade = &led_status_green;
};
leds {
compatible = "gpio-leds";
led-0 {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_WLAN;
function-enumerator = <50>;
gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "phy1tpt";
};
led-1 {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_WLAN;
function-enumerator = <24>;
gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "phy0tpt";
};
led_status_green: led-2 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_STATUS;
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys";
button-0 {
label = "wps";
gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_WPS_BUTTON>;
};
button-1 {
label = "reset";
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
ubi-concat {
compatible = "mtd-concat";
devices = <&ubiconcat0 &ubiconcat1 &ubiconcat2 \
&ubiconcat3>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "ubi";
reg = <0x0 0x5420000>;
};
};
};
};
&nand {
status = "okay";
partitions {
compatible = "sercomm,sc-partitions", "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x100000>;
sercomm,scpart-id = <0>;
read-only;
};
partition@100000 {
label = "dynamic partition map";
reg = <0x100000 0x100000>;
sercomm,scpart-id = <1>;
read-only;
};
partition@200000 {
label = "Factory";
reg = <0x200000 0x100000>;
sercomm,scpart-id = <2>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
eeprom_2g: eeprom@0 {
reg = <0x0 0x400>;
};
eeprom_5g: eeprom@8000 {
reg = <0x8000 0x4da8>;
};
macaddr_label: macaddr@21000 {
compatible = "mac-base";
reg = <0x21000 0x6>;
#nvmem-cell-cells = <1>;
};
};
};
partition@300000 {
label = "Boot Flag";
reg = <0x300000 0x100000>;
sercomm,scpart-id = <3>;
};
partition@400000 {
label = "kernel";
reg = <0x400000 0x600000>;
sercomm,scpart-id = <4>;
};
partition@a00000 {
label = "Kernel 2";
reg = <0xa00000 0x600000>;
sercomm,scpart-id = <5>;
read-only;
};
ubiconcat0: partition@1000000 {
label = "File System 1";
reg = <0x1000000 0x1800000>;
sercomm,scpart-id = <6>;
};
partition@2800000 {
label = "File System 2";
reg = <0x2800000 0x1800000>;
sercomm,scpart-id = <7>;
read-only;
};
ubiconcat1: partition@4000000 {
label = "Configuration/log";
reg = <0x4000000 0x800000>;
sercomm,scpart-id = <8>;
};
ubiconcat2: partition@4800000 {
label = "application tmp buffer (Ftool)";
reg = <0x4800000 0xc00000>;
sercomm,scpart-id = <9>;
};
ubiconcat3: partition@5400000 {
label = "free space (in stock firmware)";
reg = <0x5400000 0x2820000>;
sercomm,scpart-id = <10>;
};
};
};
&pcie {
status = "okay";
};
&pcie0 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
ieee80211-freq-limit = <5000000 6000000>;
nvmem-cells = <&eeprom_5g>, <&macaddr_label 3>;
nvmem-cell-names = "eeprom", "mac-address";
led {
led-active-low;
};
};
};
&pcie1 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
ieee80211-freq-limit = <2400000 2500000>;
nvmem-cells = <&eeprom_2g>, <&macaddr_label 2>;
nvmem-cell-names = "eeprom", "mac-address";
led {
led-active-low;
};
};
};
&gmac0 {
nvmem-cells = <&macaddr_label 0>;
nvmem-cell-names = "mac-address";
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
nvmem-cells = <&macaddr_label 11>;
nvmem-cell-names = "mac-address";
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@1 {
status = "okay";
label = "lan1";
};
port@2 {
status = "okay";
label = "lan2";
};
port@3 {
status = "okay";
label = "lan3";
};
port@4 {
status = "okay";
label = "lan4";
};
};
};
&state_default {
gpio {
groups = "jtag", "uart2", "uart3", "wdt";
function = "gpio";
};
};

View File

@ -1966,6 +1966,20 @@ define Device/renkforce_ws-wn530hp3-a
endef
TARGET_DEVICES += renkforce_ws-wn530hp3-a
define Device/rostelecom_rt-fe-1a
$(Device/sercomm_dxx)
IMAGE_SIZE := 24576k
SERCOMM_HWID := CX4
SERCOMM_HWVER := 11300
SERCOMM_SWVER := 2010
DEVICE_VENDOR := Rostelecom
DEVICE_MODEL := RT-FE-1A
DEVICE_ALT0_VENDOR := Sercomm
DEVICE_ALT0_MODEL := RT-FE-1A
DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware
endef
TARGET_DEVICES += rostelecom_rt-fe-1a
define Device/rostelecom_rt-sf-1
$(Device/sercomm_dxx)
IMAGE_SIZE := 32768k
@ -1992,6 +2006,7 @@ TARGET_DEVICES += samknows_whitebox-v8
define Device/sercomm_na502
$(Device/nand)
$(Device/uimage-lzma-loader)
IMAGE_SIZE := 20480k
DEVICE_VENDOR := SERCOMM
DEVICE_MODEL := NA502

View File

@ -103,6 +103,7 @@ platform_do_upgrade() {
netgear,wax202|\
netis,wf2881|\
raisecom,msg1500-x-00|\
rostelecom,rt-fe-1a|\
rostelecom,rt-sf-1|\
sercomm,na502|\
sercomm,na502s|\