527 Commits

Author SHA1 Message Date
38ab5ba459 重新提交 2025-04-27 00:17:28 +08:00
41aa99cd16 编译脚本权限 2025-04-27 00:12:41 +08:00
9fe1849578 mtk支持 2025-04-27 00:01:32 +08:00
Tianling Shen
ecb9798dc1 mediatek: add stock layout for CMCC A10
This board is also as known as SuperElectron ZN-M5 and ZN-M8. However,
for ZN-M5 and ZN-M8, there's another version uses ZX279128 as CPU
chip, which is unsupported.
You can check it in "高级设置" > "系统日志" > "内核日志" page from webUI.

Stock layout flash instructions:
Login into webUI and upload sysupgrade firmware in "系统管理" > "升级固件" page.
Remember to unselect "保留配置" ("Keep configurations") first before doing that.

OpenWrt U-Boot layout flash instructions:
1. Flash stock layout firmware first.
2. Connect to the device via SSH, and backup everything,
   especially 'Factory' partition.
3. Unlock MTD partitions:
   opkg update && opkg install kmod-mtd-rw
   insmod mtd-rw i_want_a_brick=1
4. Write new BL2 and FIP:
   mtd write immortalwrt-mediatek-filogic-cmcc_a10-preloader.bin bl2
   mtd write immortalwrt-mediatek-filogic-cmcc_a10-bl31-uboot.fip fip
5. Set static IP on your PC:
   IP 192.168.1.254/24, GW 192.168.1.1
6. Serve ImmortalWrt initramfs image using TFTP server.
7. Cut off the power and re-engage, wait for TFTP recovery to complete.
8. After ImmortalWrt has booted, perform sysupgrade.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 4e9240e733)
2025-02-26 22:40:54 +08:00
Tianling Shen
25885c7eff Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2025-02-23 17:51:35 +08:00
Tianling Shen
eb56db3e26 mediatek: fix sysupgrade for cudy tr3000 v1 ubootmod
Fixes: https://github.com/immortalwrt/immortalwrt/issues/1732
Fixes: 51272fcd00 ("mediatek: add ubootmod layout for cudy tr3000 v1")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit e6e4c03868)
2025-02-22 14:48:31 +08:00
Tianling Shen
b93e3444a9 odhcpd: fix setting default ra mode
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 76c4deb991)
2025-02-15 17:35:15 +08:00
Tianling Shen
4e872dd981 ipq806x: fix boot issue for Xiaomi Mi Router HD
Replace removed qcom,boot_pages_size prop with qcom,boot-partitions.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2025-02-10 17:12:27 +08:00
Álvaro Fernández Rojas
4e41f2385d kernel: r8168: update to v8.055.00
Changelog: https://github.com/openwrt/rtl8168/compare/8.054.00...8.055.00

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit 5dd763680e)
2025-02-05 15:19:31 +01:00
Tianling Shen
c190d8113c Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2025-02-02 20:00:29 +08:00
Daniel Golle
d62241cf5a mediatek: mt7622: fix SATA on BPi-R64
A commit which made their way into Linux stable down to 5.15 broke the
SATA support on the BPi-R64.

Fix this by importing a (still pending) patch re-adding the 'syscon'
compatible to the pciesys clock-controller which also contains phy-mode
bits referenced by the ahci_mtk driver expecting to access them using
syscon_regmap_lookup_by_phandle().

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 69890e16b3)
2025-02-01 05:19:18 +00:00
Álvaro Fernández Rojas
1292a493a6 bmips: shg2500: add missing led controller cells
Fixes the following DT warnings:
../dts/bcm63168-sercomm-shg2500.dts:76.4-14: Warning (reg_format): /ubus/spi@10001000/led-controller@1/led@1:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
../dts/bcm63168-sercomm-shg2500.dts:75.9-78.5: Warning (avoid_default_addr_size): /ubus/spi@10001000/led-controller@1/led@1: Relying on default #address-cells value
../dts/bcm63168-sercomm-shg2500.dts:75.9-78.5: Warning (avoid_default_addr_size): /ubus/spi@10001000/led-controller@1/led@1: Relying on default #size-cells value

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit fbe0bd5f64)
2025-01-28 08:36:43 +01:00
Sander Vanheule
4f2c6dbc39 realtek: Fix old compatible for HPE 1920-8G PoE
Supported devices are listed in the metadata as the first part of the
DTS compatible. This normally follows the format "vendor,device".

When updating the device name of the 180W 1920-8G PoE an underscore was
used, instead of a comma, to join the vendor and device name. This will
lead to warnings for users wanting to sysupgrade a device with an older
compatible, as the device's info does not match the one the metadata.

Fixes: 987c96e889 ("realtek: rename hpe,1920-8g-poe to match hardware")
Signed-off-by: Sander Vanheule <sander@svanheule.net>
(cherry picked from commit 6a7fa68569)
2025-01-24 17:17:19 +01:00
Álvaro Fernández Rojas
b5ad709554 generic: backport pending gpio-regmap ops patch
This patch has been accepted for linux v6.14 so we can move it from pending
to backport.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit 2f2e21a52b)
2025-01-22 21:01:01 +01:00
Kien Truong
4094d3b571 rockchip: disable kernel preemption
This setting is more suitable for device running OpenWRT.
Most OpenWRT targets are already default to this configuration,
and it has shown better performance in VPN (wireguard).

Signed-off-by: Kien Truong <duckientruong@gmail.com>
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 1c178f3644)
2025-01-15 18:47:17 +08:00
Tianling Shen
724098bd9b mediatek: add missing network setup for cudy tr3000-v1 ubootmod
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 272391c84f)
2025-01-15 13:08:56 +08:00
Tianling Shen
ddff3d3d50 mediatek: add ubootmod layout for cudy tr3000 v1
This allows us to use the full size of nand, which increases ubi size
from 64M to 122.25M.

If you are at factory firmware, please refer commit 63b8d98dd0 ("mediatek: add support for Cudy TR3000 v1")
to boot into OpenWrt initramfs (stock layout version).

Flash instructions:
1. Login into the device and backup everything, especially 'Factory' part.
1. Unlock mtd partitions:
   apk update && apk add kmod-mtd-rw
   insmod mtd-rw i_want_a_brick=1
3. Write new BL2 and FIP
   mtd write openwrt-mediatek-filogic-cudy_tr3000-v1-ubootmod-preloader.bin BL2
   mtd write openwrt-mediatek-filogic-cudy_tr3000-v1-ubootmod-bl31-uboot.fip FIP
4. Set static IP on your PC:
   IP 192.168.1.254/24, GW 192.168.1.1
5. Serve OpenWrt initramfs image using TFTP server.
6. Cut off the power and re-engage, wait for TFTP recovery to complete.
7. After OpenWrt has booted, perform sysupgrade.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 51272fcd00)
2025-01-14 17:23:22 +08:00
coolsnowwolf
cad6d5bbe1 mediatek: filogic: add support for Huasifei WH3000
The Huasifei WH3000 eMMC model (aka Fudy MT3000) is a Wi-Fi 6 5G
cellular router based on MediaTek MT7981A SoC.

Specifications:
SoC: Filogic 820 MT7981A (1.3GHz)
RAM: DDR4 1GB
Flash: eMMC 8G
WiFi: 2.4GHz and 5GHz with 3 antennas
Ethernet:
1x WAN (10/100/1000M)
1x LAN (10/100/1000/2500M)
USB: 1x USB 3.0 port
UART: 3.3V, TX, RX, GND / 115200 8N1

Installation via U-Boot rescue:
Connect to the GbE eth port, then press and hold reset button while
booting the device. Wait for the Internet led to blink 5 times,
release reset button. The rescue page is accessible via http://192.168.1.1
Select the OpenWrt sysupgrade image and start upgrade.
Wait for the router to flash new firmware and reboot.

(cherry picked from commit f310b8c74e)
2025-01-13 20:44:36 +08:00
Tianling Shen
f0cf42d5fb rockchip: limit rk3328 cpu frequency to 1.5 GHz
Overclocking to 1.6 GHz is very unstable now and causes kernel panic
at boot time.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit de55e7750d)
2025-01-12 15:38:33 +08:00
Álvaro Fernández Rojas
55af6e1af0 generic: add gpio-regmap request/free ops patch
This patch is needed on bmips since it fixes issues with GPIOs not being
properly configured due to gpio_request_enable not being called on bcm63xx
devices. Therefore we can now drop the bcm63268 gpio function patch.

Backported from f5b1d340be with the exception of
the realtek and bmips patches removal.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit f5b1d340be)
2025-01-08 19:59:28 +01:00
Tianling Shen
b9caa4fe56 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-30 15:34:14 +08:00
David Lutz
125a2e1311 ath79: Add support for Sophos AP15C
The Sophos AP15C uses the same hardware as the AP15, but has a reset button.

Based on:
commit 6f1efb2898 ("ath79: add support for Sophos AP100/AP55 family")
author    Andrew Powers-Holmes <andrew@omnom.net>
          Fri, 3 Sep 2021 15:53:57 +0200 (23:53 +1000)
committer Hauke Mehrtens <hauke@hauke-m.de>
          Sat, 16 Apr 2022 16:59:29 +0200 (16:59 +0200)

Unique to AP15C:
 - Reset button
 - External RJ45 serial console port

Flashing instructions:

This firmware can be flashed either via a compatible Sophos SG or XG
firewall appliance, which does not require disassembling the device, or via
the U-Boot console available on the internal UART header.

To flash via XG appliance:
 - Register on Sophos' website for a no-cost Home Use XG firewall license
 - Download and install the XG software on a compatible PC or virtual
   machine, complete initial appliance setup, and enable SSH console access
 - Connect the target AP device to the XG appliance's LAN interface
 - Approve the AP from the XG Web UI and wait until it shows as Active
   (this can take 3-5 minutes)
 - Connect to the XG appliance over SSH and access the Advanced Console
   (Menu option 5, then menu option 3)
 - Run `sudo awetool` and select the menu option to connect to an AP via
   SSH. When prompted to enable SSH on the target AP, select Yes.
 - Wait 2-3 minutes, then select the AP from the awetool menu again. This
   will connect you to a root shell on the target AP.
 - Copy the firmware to /tmp/openwrt.bin on the target AP via SCP/TFTP/etc
 - Run `mtd -r write /tmp/openwrt.bin astaro_image`
 - When complete, the access point will reboot to OpenWRT.

To flash via U-Boot serial console:
 - Configure a TFTP server on your PC, and set IP address 192.168.99.8 with
   netmask 255.255.255.0
 - Copy the firmware .bin to the TFTP server and rename to 'uImage_AP15C'
 - Open the target AP's enclosure and locate the 4-pin 3.3V UART header [4]
 - Connect the AP ethernet to your PC's ethernet port
 - Connect a terminal to the UART at 115200 8/N/1 as usual
 - Power on the AP and press a key to cancel autoboot when prompted
 - Run the following commands at the U-Boot console:
    - `tftpboot`
    - `cp.b $fileaddr 0x9f070000 $filesize`
    - `boot`
 - The access point will boot to OpenWRT.

Signed-off-by: David Lutz <kpanic@hirnduenger.de>
2024-12-27 13:18:24 +01:00
Tianling Shen
d8ac050a8f rockchip: add MMBOX ANAS3035 support
Hardware
--------
RockChip RK3568 ARM64 (4 cores)
4GB LPDDR4X RAM
2x 2500 Base-T (PCIe, rtl8125b)
4x LEDs (POWER / SATA1 / SATA2 / SATA3)
32GB eMMC on-board
Micro-SD Slot
HDMI OUT
2x USB 2.0 Port
3x SATA Slot
DC Jack 12V

Installation
------------
Uncompress the ImmortalWrt sysupgrade and write it to a micro SD card or
internal eMMC using dd.

Signed-off-by: Tianling Shen <i@cnsztl.eu.org>
(cherry picked from commit 934bf398be)
2024-12-26 16:27:24 +08:00
Kyle Hendry
515ffb40cb bmips: dts: fix pinctrl error
The kernel logs the error "bcm6368_nand 10000200.nand: there is not valid
maps for state default" on boot and all nand pins show as UNCLAIMED in
sysfs pinmux-pins.

bcm6362.dtsi, bcm6368.dtsi and bcm63268.dtsi use the undocumented property
group which the driver doesn't understand. This has been documented upstream
in commit caf963efd4b0b9ff42ca12e52b8efe277264d35b.

Replacing group with pins allows the nand pins to be properly configured.

Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
[add bcm636/bcm6368 and fix commit title]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit d1e9c50d06)
2024-12-24 11:26:42 +01:00
Tianling Shen
d6dd35642e Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-21 15:16:02 +08:00
Chris Jones
b551214c9d ipq40xx: make GL.iNet A1300 switch functional
Set the physical switch to KEY_RFKILL, since its previous value
(KEY_SETUP) is unsupported. This should also make the KEY_RESET button
functional, by allowing the gpio-button-hotplug kmod to load.

Signed-off-by: Chris Jones <cmsj@tenshu.net>
Link: https://github.com/openwrt/openwrt/pull/16564
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
(cherry picked from commit 83a04cd2b8)
Link: https://github.com/openwrt/openwrt/pull/17228
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-12-11 17:03:26 +01:00
Christian Marangi
239cdcd90c build: Unconditionally append kmod feed for BuildBot
Recent changes to BuildBot config moved the kmods to a dedicated
directory and dropped them from the packages dir. This was needed as
both OPKG and APK gets confused if both entry are present.

To fix this, unconditionally append the kmod feed line if
CONFIG_BUILDBOT is enabled.

Fixes: #17146
Link: https://github.com/openwrt/openwrt/pull/17151
(cherry picked from commit 53ee2e8c03)
[ fix conflict error for missing APK support ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-12-03 12:42:34 +01:00
Tianling Shen
4180094133 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-12-03 14:26:52 +08:00
Eric Fahlgren
db554fd450 build: profiles.json: add kernel version information
Currently downstream tools like ASU lack information about kernel
version to find out the relevant kmod build folder on downloads server.

So lets fix it by providing a new `linux_kernel` JSON array which would
for the start provide Linux kernel version, revision and vermagic
information.

  "linux_kernel": {
     "release": "1",
     "vermagic": "b57450c07d3a786158c3601fc5cee57d",
     "version": "6.6.61"
   },

Fixes: openwrt/openwrt#17036
Fixes: efahl/owut#9
Co-developed-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17042
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit c857145e03)
2024-11-29 21:45:01 +01:00
Michael Pratt
6d5c434b14 build: ensure silent Make behavior for json scripts
Run the invocation of Make with verbosity in order to
prevent the printing of Makefile level and subtarget status.
e.g.  make[3] -C target/linux val.DEFAULT_PACKAGES val.ARCH_PACKAGES

Remove piping of stderr, which is only useful when using
the "communicate" method over the "run" method,
and this script would not be written to handle a captured error anyway.

For error testing, stdout and stderr can be set to a file object
with the open() function like this:

out = open('json_out', 'w')
err = open('json_err', 'w')

...
...
stdout=out,
stderr=err,

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit fd3376c5ee)
2024-11-29 21:44:54 +01:00
Tianling Shen
39d5464013 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-25 17:51:03 +08:00
Hauke Mehrtens
a281c02288 wifi-scripts: Fix parsing of Capabilities
Fixup capabilities parsing in iw output.

In addition to the normal capabilities iw now also outputs HE MAC, HE
PHY and EHT MAC and EHT PHY capabilities. Exclude them in the parsing.

The grep returns this with mac80211-hwsim:
```
root@OpenWrt:~# iw phy phy0 info | grep 'Capabilities:'
		Capabilities: 0x107e
			HE PHY Capabilities: (0x02bfce0000000000000000):
			EHT PHY Capabilities: (0x7c0000feffff7f01):
			HE PHY Capabilities: (0x02bfce0000000000000000):
			EHT PHY Capabilities: (0x7c0000feffff7f01):
			HE PHY Capabilities: (0x02bf000000000000000000):
		Capabilities: 0x107e
			HE PHY Capabilities: (0x1cbfce0000000000000000):
			EHT PHY Capabilities: (0xfc1f3ffeffff7f37):
			HE PHY Capabilities: (0x1cbfce0000000000000000):
			EHT PHY Capabilities: (0xfc1f3ffeffff7f37):
			HE PHY Capabilities: (0x1cbf000000000000000000):
			HE PHY Capabilities: (0x1cbfce0000000000000000):
			EHT PHY Capabilities: (0xfefffffeffffff7f):
			HE PHY Capabilities: (0x1cbfce0000000000000000):
			EHT PHY Capabilities: (0xfefffffeffffff7f):
			HE PHY Capabilities: (0x1cbf000000000000000000):
		Capabilities: 0x107e
```

With busybox 1.36.1 the ht_cap_mask variable will be set to
-72057598332895361. With busybox 1.37.0 it will be set to -1.
Both values are wrong, after this change it will be set to 4222
(0x107E).

Link: https://github.com/openwrt/openwrt/pull/17043
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit adf958c919)
2024-11-23 23:49:37 +01:00
Shiji Yang
d557e23932 ath79: lzma-loader: fix syntax error
C compiler can't parse '#else if'.

Fixes: f84a9f7dc0 ("ath79: add support for Huawei AP6010DN")
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16989
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 98f26346cb)
2024-11-23 23:23:23 +01:00
Marco von Rosenberg
769253775c ath79: add support for Huawei AP6010DN
Huawei AP6010DN is a dual-band, dual-radio 802.11a/b/g/n 2x2 MIMO
enterprise access point with one Gigabit Ethernet port and PoE
support.

Hardware highlights:
- CPU: AR9344 SoC at 480MHz
- RAM: 128MB DDR2
- Flash: 32MB SPI-NOR
- Wi-Fi 2.4GHz: AR9344-internal radio
- Wi-Fi 5GHz: AR9580 PCIe WLAN SoC
- Ethernet: 10/100/1000 Mbps Ethernet through Atheros AR8035 PHY
- PoE: yes
- Standalone 12V/2A power input
- Serial console externally available through RJ45 port
- External watchdog: CAT706SVI (1.6s timeout)

Serial console:
  9600n8 (9600 baud, no stop bits, no parity, 8 data bits)

MAC addresses:
  Each device has 32 consecutive MAC addresses allocated by
  the vendor, which don't overlap between devices.
  This was confirmed with multiple devices with consecutive
  serial numbers.
  The MAC address range starts with the address on the label.
  To be able to distinguish between the interfaces,
  the following MAC address scheme is used:
    - eth0 = label MAC
    - radio0 (Wi-Fi 2.4GHz) = label MAC + 1
    - radio1 (Wi-Fi 5GHz) = label MAC + 2

Installation:
0. Connect some sort of RJ45-to-USB adapter to "Console" port of the AP

1. Power up the AP

2. At prompt "Press f or F  to stop Auto-Boot in 3 seconds",
   do what they say.
   Log in with default admin password "admin@huawei.com".

3. Boot the OpenWrt initramfs from TFTP using the hidden script "run ramboot".
   Replace IP address as needed:

   > setenv serverip 192.168.1.10
   > setenv ipaddr 192.168.1.1
   > setenv rambootfile openwrt-ath79-generic-huawei_ap6010dn-initramfs-kernel.bin
   > saveenv
   > run ramboot

4. Optional but recommended as the factory firmware cannot be downloaded publicly:
   Back up contents of "firmware" partition using the web interface or ssh:

   $ ssh root@192.168.1.1 cat /dev/mtd11 > huawei_ap6010dn_fw_backup.bin

5. Run sysupgrade using sysupgrade image. OpenWrt
   shall boot from flash afterwards.

Return to factory firmware (using firmware upgrade package downloaded from non-public Huawei website):
1. Start a TFTP server in the directory where
   the firmware upgrade package is located

2. Boot to u-boot as described above

3. Install firmware upgrade package and format the config partitions:

   > update system FatAP6X10XN_SOMEVERSION.bin
   > format_fs

Return to factory firmware (from previously created backup):
1. Copy over the firmware partition backup to /tmp,
   for example using scp

2. Use sysupgrade with force to restore the backup:
   sysupgrade -F huawei_ap6010dn_fw_backup.bin

3. Boot AP to U-Boot as described above

Quirks and known issues:
- The stock firmware has a semi dual boot concept where the primary
kernel uses a squashfs as root partition and the secondary kernel uses
an initramfs. This dual boot concept is circumvented on purpose to gain
more flash space and since the stock firmware's flash layout isn't
compatible with mtdsplit.
- The external watchdog's timeout of 1.6s is very hard to satisfy
during bootup. This is why the GPIO15 pin connected to the watchdog input
is configured directly in the LZMA loader to output the AHB_CLK/2 signal
which keeps the watchdog happy until the wdt-gpio kernel driver takes
over. Because it would also take too long to read the whole kernel image
from flash, the uImage header only includes the loader which then reads
the kernel image from flash after GPIO15 is configured.

Signed-off-by: Marco von Rosenberg <marcovr@selfnet.de>
(cherry picked from commit f84a9f7dc0)
Link: https://github.com/openwrt/openwrt/pull/16978
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-23 23:22:27 +01:00
Hauke Mehrtens
cafbecf853 kernel: bump 5.15 to 5.15.173
Removed because they are upstream:
   generic/backport-5.15/430-v6.3-udf-Allocate-name-buffer-in-directory-iterator-on-he.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=5ea4b73e268bf9e1d26271943f2f7c4517253395

   generic/backport-5.15/431-v6.3-udf-Avoid-directory-type-conversion-failure-due-to-E.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=8b1d55e43cee631e142d46ee94c91ccd894341e9

Link: https://github.com/openwrt/openwrt/pull/16999
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-23 23:20:16 +01:00
Hauke Mehrtens
265d9112b3 kernel: bump 5.15 to 5.15.172
No manual changes needed.

Link: https://github.com/openwrt/openwrt/pull/16999
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-23 23:20:16 +01:00
Tianling Shen
74010911d3 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-17 16:10:46 +08:00
Tianling Shen
3e38875493 ipq806x: fix typo error for xiaomi r3d device packages
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 2c7c8d1619)
2024-11-16 17:21:06 +08:00
Hauke Mehrtens
cd9998ef1b kernel: bump 5.15 to 5.15.171
No manual changes needed.

Link: https://github.com/openwrt/openwrt/pull/16882
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-16 00:03:52 +01:00
Mieczyslaw Nalewaj
0edb5d4fc0 mac80211: compatibility with kernel 6.6.59
Fix genlmsg_multicast_allns() build error on kernel 6.6.59.
Based on kernel patch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit?h=v6.6.59&id=e0f83d268974dab0361d11904dfc9acec53f96a6

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/16835
(cherry picked from commit 31f1dabb4b)
Link: https://github.com/openwrt/openwrt/pull/16882
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-16 00:03:52 +01:00
Hauke Mehrtens
25f85d4293 kernel: bump 5.15 to 5.15.170
Removed because they are upstream:
   generic/backport-5.15/777-netfilter-xtables-fix-typo-causing-some-targets-to-not-load-on-IPv6.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=90baa455aa7e099152898cfa5eb3928d6152da12

Link: https://github.com/openwrt/openwrt/pull/16882
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-16 00:03:52 +01:00
Hauke Mehrtens
e3b120f682 kernel: bump 5.15 to 5.15.169
Added patch:
   generic/backport-5.15/430-v6.3-udf-Allocate-name-buffer-in-directory-iterator-on-he.patch
   This patch fixes the following compile warning:
```
  CC [M]  fs/udf/namei.o
fs/udf/namei.c: In function 'udf_rename':
fs/udf/namei.c:878:1: error: the frame size of 1144 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
  878 | }
      | ^
cc1: all warnings being treated as errors
make[7]: *** [scripts/Makefile.build:289: fs/udf/namei.o] Error 1
```

Link: https://github.com/openwrt/openwrt/pull/16882
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-16 00:03:52 +01:00
Hauke Mehrtens
b389c3d66f kernel: bump 5.15 to 5.15.168
Manually adapted:
   bcm27xx/patches-5.15/950-0166-xhci-Use-more-event-ring-segment-table-entries.patch
     I replaced it with the version from main branch which applies more easily
   bcm27xx/patches-5.15/950-0600-xhci-quirks-add-link-TRB-quirk-for-VL805.patch
   bcm27xx/patches-5.15/950-0605-xhci-refactor-out-TRBS_PER_SEGMENT-define-in-runtime.patch
   bcm27xx/patches-5.15/950-0606-usb-xhci-add-VLI_TRB_CACHE_BUG-quirk.patch
   bcm27xx/patches-5.15/950-0717-usb-xhci-add-a-quirk-for-Superspeed-bulk-OUT-transfe.patch
   bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch
   generic/hack-5.15/645-netfilter-connmark-introduce-set-dscpmark.patch

Added patch:
   generic/backport-5.15/777-netfilter-xtables-fix-typo-causing-some-targets-to-not-load-on-IPv6.patch
      This fixes a bug intoduced in this version.

Adapt kernel configuration for newly added option
CONFIG_PROC_MEM_ALWAYS_FORCE.

Link: https://github.com/openwrt/openwrt/pull/16882
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-16 00:03:52 +01:00
Tianling Shen
fab063ec39 ramips: fix read mac for jdcloud re-sp-01b again
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 7ec8108be5)
2024-11-14 13:43:34 +08:00
Tianling Shen
c42795731d ramips: fix mac for jdcloud re-sp-01b 128g emmc version
The MAC address offset in 128G version is 0x442a (+1 compared to 64g
version). As the mac stored in config partition is plain text format
so simply call mtd_get_mac_ascii to work on both version.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit c0c480daa7)
(cherry picked from commit a24c3500f3)
2024-11-14 13:43:29 +08:00
Tianling Shen
57416e4714 automount: fix dependencies
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 2546d5098f)
2024-11-14 12:05:42 +08:00
Tianling Shen
273a55ff55 r8152: Update to 2.19.2
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 778e34c00f)
2024-11-09 20:30:48 +08:00
Tianling Shen
66932c6cef Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-09 20:29:11 +08:00
Álvaro Fernández Rojas
33b45c0a0e kernel: r8125: update to v9.014.01
Changelog: https://github.com/openwrt/rtl8125/compare/9.013.02...9.014.01

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry-picked from commit e29bc67f9d)
2024-11-06 11:43:07 +01:00
Álvaro Fernández Rojas
e70669e690 kernel: r8168: refresh patch
Patches weren't refreshed when r8168 was updated to v8.054.00 in a85e18b53f.

Fixes: a85e18b53f ("kernel: r8168: update to v8.054.00")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit 6490c88c75)
2024-11-05 14:12:10 +01:00
Álvaro Fernández Rojas
182af4caea kernel: r8126: update to v10.014.01
Changelog: https://github.com/openwrt/rtl8126/compare/10.013.00...10.014.01

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit 562b2c22ff)
2024-11-05 14:11:40 +01:00
Álvaro Fernández Rojas
28d4b213bc kernel: r8168: update to v8.054.00
Changelog: https://github.com/openwrt/rtl8168/compare/8.053.00...8.054.00

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit a85e18b53f)
2024-11-05 14:11:07 +01:00
Robert Marko
1a75174b9b nu801: Mark as nonshared to build in step 1
Mark the package as nonshared to build it in the target specific build
step 1 of the build bots instead of the architecture generic build step 2.

In the build step 2 it may be left out if we build it using a different
target.

Fixes: #16857
Link: https://github.com/openwrt/openwrt/pull/16859
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-11-05 10:59:04 +01:00
Rafal Boni
cb8b632f1a ipq806x: Fix default MAC addresses on MR42 by moving to nvmem-layout
Partial, single-target update extracted from https://github.com/openwrt/openwrt/commit/d264d3a6

The previous `mac-address-increment` is deprecated, and in particular on
this target means that the kernel is unable to read the MAC address,
causing the system to boot with a new random MAC address each time.

Fixes: https://github.com/openwrt/openwrt/issues/13992

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[rafal.boni@gmail.com: single-target-specific backport from larger change]
Signed-off-by: Rafal Boni <rafal.boni@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16858
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-11-04 17:27:52 +01:00
Leon M. Busch-George
0d428857d5 mediatek: YunCore AX835: fix voltage regulator
Specifying GPIO_ACTIVE_HIGH on the GPIO for the voltage regulator doesn't
suffice. The regulator itself requires enable-active-high to be set.

Fixes: #16292
Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
Link: https://github.com/openwrt/openwrt/pull/16839
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-11-04 10:36:50 +01:00
Lech Perczak
4f0e281775 ath79: Really fix 5GHz on QCA9886 variant of ZTE MF286
Fix in commit 25eead21c5 ("ath79: fix 5GHz on QCA9886 variant of ZTE MF286")
was incomplete. A user of such variant popped up, and in the boot log
after installation, we discovered that QCA9886 expects different
pre-calibration data size, than the older QCA9880 variant:

ath10k_pci 0000:00:00.0: qca9888 hw2.0 target 0x01000000 chip_id 0x00000000 sub 0000:0000
ath10k_pci 0000:00:00.0: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
ath10k_pci 0000:00:00.0: firmware ver 10.4b-ct-9888-fW-13-5ae337bb1 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 59e741e7
ath10k_pci 0000:00:00.0: invalid calibration data length in nvmem-cell 'pre-calibration': 2116 != 12064
ath10k_pci 0000:00:00.0: Loading BDF type 0
ath10k_pci 0000:00:00.0: failed to fetch board data for bus=pci,vendor=168c,device=0056,subsystem-vendor=0000,subsystem-device=0000 from ath10k/QCA9888/hw2.0/board-2.bin
ath10k_pci 0000:00:00.0: failed to fetch board-2.bin or board.bin from ath10k/QCA9888/hw2.0
ath10k_pci 0000:00:00.0: failed to fetch board file: -12
ath10k_pci 0000:00:00.0: could not probe fw (-12)

Explicitly define a pre-calibration nvmem-cell for this variant, and use
it instead of the calibration one, which is shorter.

Fixes: 25eead21c5 ("ath79: fix 5GHz on QCA9886 variant of ZTE MF286")
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit fc236f3b3c)
Link: https://github.com/openwrt/openwrt/pull/16810
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-31 19:02:30 +01:00
Rafal Boni
607091d4fe ipq806x: Fix default MAC addresses on MR52 by moving to nvmem-layout
Partial, single-target update extracted from https://github.com/openwrt/openwrt/commit/d264d3a6

The previous `mac-address-increment` is deprecated, and in particular on
this target means that the kernel is unable to read the MAC address,
causing the system to boot with a new random MAC address each time.

Fixes: https://github.com/openwrt/openwrt/issues/15238

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[rafal.boni@gmail.com: single-target-specific backport from larger change]
Signed-off-by: Rafal Boni <rafal.boni@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16774
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-31 10:59:34 +01:00
Rafal Boni
92c2a4cf93 ipq806x: Revert "ipq806x: swap lan leds for Meraki MR52"
This reverts commit ec8f647d16, as with the
current kernel version, the change actually causes the same bug it once
may have fixed -- that is, the leds are now again reversed.

I suspect this was due to a switch to a newer kernel version between when
the patch was submitted and now reversing the order of the interfaces, so
that eth0 / the LAN interface is also the interface used for PoE, and eth1
/ the WAN interface is the non-PoE interface.

Signed-off-by: Rafal Boni <rafal.boni@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16779
(cherry picked from commit b5e1544f4d)
Signed-off-by: Rafal Boni <rafal.boni@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16822
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-31 10:49:16 +01:00
Rosen Penev
9bc6a18ede ramips: m4r v4: fix typo
It should be debounce-interval, as with the others.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16802
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-31 10:45:52 +01:00
Tianling Shen
a8d3d10f4c Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-10-31 16:39:22 +08:00
Roger Pueyo Centelles
c46b689149 ath79: add support for MikroTik RouterBOARD 750 r2 (hEX lite)
This patch adds support for the MikroTik RouterBOARD 750 r2, marketed as
hEX lite, a small indoor router with 5x 10/100 Mbps Ethernet ports, one
with PoE in. The device was already supported by the ar71xx target.

Specifications:
 - SoC: Qualcomm Atheros QCA9533
 - Flash: 16 MB SPI NOR
 - RAM: 64 MB
 - Ethernet: 4x 10/100 Mbps LAN, 1x 10/100 Mbps WAN (PoE in)
 - LEDs: 5x Ethernet port activity (green), 1x user (green)
 - Buttons: 1x reset

 See https://mikrotik.com/product/RB750r2 for more details.

Not working:
 - Serial port (already not working in ar71xx)

Flashing:
 TFTP boot initramfs image and then perform sysupgrade. Only the
 "Internet" port will ask for an initramfs image. Follow common
 MikroTik procedure as in https://openwrt.org/toh/mikrotik/common.

(cherry picked from commit 8486c677b8)
Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Link: https://github.com/openwrt/openwrt/pull/13477
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-29 21:36:11 +01:00
Tianling Shen
e26539efaa rockchip: disable sd-card uhs speed for ariaboard photonicat
Signed-off-by: Tianling Shen <i@cnsztl.eu.org>
(cherry picked from commit 7fb8ec006a)
2024-10-26 15:38:45 +08:00
Tianling Shen
bf1aaeac7b rockchip: enable OTP NVMEM and RTC HYM8563 support
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 4f4e8820bd)
2024-10-25 19:39:38 +08:00
Tianling Shen
6c66564933 rockchip: enable uhs sdr50 support for sdmmc
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 2f4a422673)
2024-10-25 16:36:33 +08:00
Tianling Shen
9302f07aab rockchip: fix syntax error for ariaboard photonicat
Fix unexpected syntax error cuased by sed replacement.

Fixes: a3403720e3 ("rockchip: fix usb power for ariaboard photonicat")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit fe693f3429)
2024-10-25 16:35:09 +08:00
Mieczyslaw Nalewaj
c626c8c70c generic: mtd: spinand: winbond: more serial NAND flash types
Add support for W25N01JW, W25N02JWZEIF, W25N512GW, W25N02KWZEIR and W25N01GWZEIG.
Add support for W25N04KV.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 13aa1fad5d)
2024-10-25 15:22:45 +08:00
Tianling Shen
da964faf7f Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-10-25 15:17:49 +08:00
Tianling Shen
a3403720e3 rockchip: fix usb power for ariaboard photonicat
Fixes: #1534
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 76fc121e8f)
2024-10-25 14:45:17 +08:00
Rodrigo B. de Sousa Martins
088bb1e12e iptables: backport "nft: track each register individually" from 1.9
From the upstream repo:

Instead of assuming only one register is used, track all 16 regs
individually.

This avoids need for the 'PREV_PAYLOAD' hack and also avoids the need to
clear out old flags:

When we see that register 'x' will be written to, that register state is
reset automatically.

Existing dissector decodes
ip saddr 1.2.3.4 meta l4proto tcp
... as
-s 6.0.0.0 -p tcp

iptables-nft -s 1.2.3.4 -p tcp is decoded correctly because the expressions
are ordered like:

meta l4proto tcp ip saddr 1.2.3.4
                                                                                                                                                                                                                   |
... and 'meta l4proto' did clear the PAYLOAD flag.

The simpler fix is:
		ctx->flags &= ~NFT_XT_CTX_PAYLOAD;

in nft_parse_cmp(), but that breaks dissection of '1-42', because
the second compare ('cmp lte 42') will not find the
payload expression anymore.

This commit fixes #11169 and openwrt/packages#22727, and potentially anyone that uses iptables-nft legacy support.

Signed-off-by: Rodrigo B. de Sousa Martins <rodrigo.sousa.577@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16504
[Added patch header]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 44b1993f76)
2024-10-24 00:51:01 +02:00
Tianling Shen
f213890acd README: update build dependencies
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 9875ea26be)
2024-10-22 20:54:26 +08:00
Robert Marko
e0e022e612 generic: 5.15: add Winbond W25N01KV support
It seems that some Xiaomi AX3000T boards changed to using Winbond W25N01KV
SPI-NAND which is not supported in OpenWrt 23.05 but only in main.

So, backport the support for Winbond W25N01KV from Linux 6.12 to 23.05
as well.

Link: https://github.com/openwrt/openwrt/pull/16669
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-20 18:29:15 +02:00
Itay Shoshani
676e2f7192 wireless-regdb: Update to version 2024.10.07
b66b9a1 wireless-regdb: update regulatory database based on preceding changes
5097b4a wireless-regdb: Update regulatory info for Tanzania (TZ) for 2024
29633a6 wireless-regdb: Update regulatory info for Pakistan (PK) for 2024
b44edb2 wireless-regdb: Update regulatory info for Serbia (RS) for 2024
dbfae47 Revert "wireless-regdb: Update regulatory info for Serbia (SR) for 2024"
8e3d27c wireless-regdb: Correct regulatory rules of 6GHz frequency for Türkiye (TR)
8760bc3 wireless-regdb: Update regulatory info for Honduras (HN) for 2023
3ba2c53 wireless-regdb: Update regulatory info for Israel (IL) for 2021
83c175c wireless-regdb: Update regulatory info for Kuwait (KW) for 2022
388c80c wireless-regdb: Update regulatory info for Serbia (SR) for 2024
bf55ed4 wireless-regdb: Add .b4-config
3afe172 wireless-regdb: Update .gitignore
3b34761 wireless-regdb: Correct regulatory rules for China (CN)
003c282 wireless-regdb: Update regulatory info for Philippines (PH) on 6GHz
21fcb86 wireless-regdb: Update regulatory info for Guatemala (GT) for 2020
158f105 wireless-regdb: Update regulatory info for Bahrain (BH) for 2024
218d146 wireless-regdb: Add regulatory info for Namibia (NA) for 2023
aad0c26 wireless-regdb: Update regulatory info for Togo (TG) for 2022
983f551 wireless-regdb: Update regulatory info for El Salvador (SV) on 6GHz
58575b4 wireless-regdb: Update regulatory info for Peru (PE) on 6GHz
bad3985 wireless-regdb: Update regulatory info for New Zealand (NZ) for 2022
c7d1083 wireless-regdb: Update regulatory info for Qatar (QA) on 6GHz

Signed-off-by: Itay Shoshani <itai.sho@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16678
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit a6de2d7784)
2024-10-19 17:42:47 +02:00
Rosen Penev
0f30b8d2d2 mpc85xx: p1010: fix NAND devices
Upstream commit 9ba0cae3cac07c21c583f9ff194f74043f90d29c made FSL_IFC
visible and selectable, which means that in order for MTD_NAND_FSL_IFC
to work, it needs these two extra CONFIG options.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16717
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-17 11:00:40 +02:00
Tianling Shen
951f50c05c sdk: bundle libraries for llvm toolchain
This allows the llvm toolchain to be executed on different host.
Also add it to strip list.

Fixes: 0ac0840088 ("sdk: ship llvm toolchain")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 9bd9e0a19a)
2024-10-15 19:30:29 +08:00
Tianling Shen
cc8175de16 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-10-13 13:57:33 +08:00
Shiji Yang
1efcdb2446 ramips: use OKLI loader for TP-Link RE200 v1 and RE210 v1
Using OKLI image to fix the booting stuck issue.

Tested with u-boot extracted from TP-Link stock images
"RE200(EU)_V1_171206.zip" and "RE210(US_CA)_V1_171205.zip".

Fixes: https://github.com/openwrt/openwrt/issues/16296
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16473
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit b62e6f5beb)
2024-10-08 22:20:23 +02:00
Shiji Yang
fb44dd7314 ramips: introduce TP-Link v1 header OKLI image recipe
It can be used to workaround the booting stuck issue caused by the
u-boot LZMA decompression error.

The new kernel image structure:
+------+------------------+------------------+---------------+-----------------+
| name | tplink-v1 header | OKLI lzma-loader | uImage header | lzma kernel+dtb |
+------+------------------+------------------+---------------+-----------------+
| size |      0x200       |       0xe00      |     0x40      |     dynamic     |
+------+------------------+------------------+---------------+-----------------+

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16473
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 08eecec355)
2024-10-08 22:20:20 +02:00
Mikhail Zhilkin
1ec1aa9cc7 ramips: add support for netis N6
This commit adds support for netis N6 WiFi 6 router.

Specification
-------------
- SoC       : MediaTek MT7621AT, MIPS, 880 MHz
- RAM       : 256 MiB
- Flash     : NAND 128 MiB (ESMT PSU1GA30DT)
- WLAN      : MT7905DAN + MT7975DN
  - 2.4 GHz : b/g/n/ax, 574 Mbps, MIMO 2x2
  - 5 GHz   : a/n/ac/ax, 1201 Mbps, MIMO 2x2
- Ethernet  : 10/100/1000 Mbps x5 (1x WAN, 4x LAN)
- USB       : 1x 3.0
- UART      : 3.3V, 115200n8
- Buttons   : 1x Reset
              1x WPS
- LEDs      : 1x Power (green)
              1x System (green)
              1x WAN (green)
              1x WiFi 2.4 GHz (green), controlled by phy
              1x WiFi 5 GHz (green), controlled by phy
              1x WPS (green)
              1x USB (green)
              5x ethernet leds (green), controlled by switch
- Power     : 12 VDC, 1.5 A

Installation
------------
1. Update the router using stock firmware web interface and OpenWrt
   factory.bin image.

Recovery and return to stock
----------------------------
1. Assign your PC a static IP 192.168.1.2 and connect to the router using
   the ethernet cable;
2. Power off the router;
3. Press Reset button, power on the router and wait until ethernet led
   start blinking;
4. Release the button;
5. Open http://192.168.1.1/ (N6 System Recovery Mode) in your browser;
6. Upload OpenWrt factory.bin (or stock firmware *.bin) image and proceed
   with upgrade.

MAC addresses
-------------
+---------+-------------------+
|         | MAC example       |
+---------+-------------------+
| LAN     | dc:xx:xx:49:xx:04 |
| WAN     | dc:xx:xx:49:xx:05 |
| WLAN 2g | dc:xx:xx:19:xx:06 |
| WLAN 5g | dc:xx:xx:79:xx:06 |
+---------+-------------------+
The WLAN MAC prototype was found in 'Factory', 0x4
The LAN MAC was found in 'Factory', 0x7ef20
The WAN MAC was found in 'Factory', 0x7ef26

Known issue
-----------
2.4 GHz WLAN doesn't start with mt76 driver.

Probable reason:
   Original Netis N6 EEPROM contains wrong MT_EE_WIFI_CONF value (0xd2).
   Other routers with the same WLAN hardware (e.g., Routerich AX1800)
   have MT_EE_WIFI_CONF = 0x92.

Workaround (already included in this commit):
   Extract EEPROM to a file at the first time boot and change
   MT_EE_WIFI_CONF (offset 0x190) value from 0xd2 to 0x92. See
   /etc/hotplug.d/firmware/11-mt76-caldata for details.

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16322
(cherry picked from commit f368e2d5ec)
[ Fix merging onflicts in mt7621.mk, 10_fix_wifi_mac, platform.sh ]
[ Change &ethphy4 -> &mdio in dts file ]
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16436
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-08 22:16:44 +02:00
Tianling Shen
3b4705e359 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-10-08 14:06:45 +08:00
Tianling Shen
f1d3abeb04 target: drop ipv6helper from default packages
all options has been updated in odhcpd.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-10-08 00:01:29 +08:00
Tianling Shen
90be2a76dd odhcpd: update default config
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 293cea41ef)
2024-10-07 20:35:56 +08:00
Lech Perczak
4d89918a98 ipq40xx: fix MAC address on Meraki MR33 and MR74 after nvmem-layout
...conversion.
Commit 20736013e9 ("kernel: backport nvmem v6.6 fixes and v6.7 changes")
has caused dthe device to no longer correctly read MAC address from its
onboard 24c64 EEPROM, because "at24" driver doesn't support legacy
nvmem-cell bindings [1] - and there was an explicit config option added
to mandate that behaviour in the following patch:

820-v6.7-0002-nvmem-add-explicit-config-option-to-read-old-syntax-.patch

But some of the devices, MR33 and MR74 included, weren't converted with
that as well.
Convert the definition to use proper fixed-layout binding to fix it.

The offending change was introduced between v23.05.0 and v23.05.1, and
found by bisection:
git bisect start
# status: waiting for both good and bad commits
# good: [bd4f415efa] OpenWrt v23.05.0: adjust config defaults
git bisect good bd4f415efa
# status: waiting for bad commit, 1 good commit known
# bad: [a58a86693f] OpenWrt v23.05.1: adjust config defaults
git bisect bad a58a86693f
# good: [3d0a78add2] qualcommax: only build initramfs if CONFIG_TARGET_ROOTFS_INITRAMFS is set
git bisect good 3d0a78add2
# bad: [21e5db97c4] build: add CycloneDX SBOM JSON support
git bisect bad 21e5db97c4
# good: [89184b15cf] mediatek: add build for MT7981 RFB
git bisect good 89184b15cf
# bad: [41f27bbb6d] bcm53xx: add the latest fix version of brcm_nvram
git bisect bad 41f27bbb6d
# good: [b649b0bf71] kernel: nvmem: fix "fixed-layout" & support "mac-base"
git bisect good b649b0bf71
# bad: [20736013e9] kernel: backport nvmem v6.6 fixes and v6.7 changes
git bisect bad 20736013e9
# good: [066971615f] kernel: backport v6.6 nvmem changes
git bisect good 066971615f
# first bad commit: [20736013e9] kernel: backport nvmem v6.6 fixes and v6.7 changes

Link: [1] https://github.com/openwrt/openwrt/issues/15393#issuecomment-2212300849
Fixes: 20736013e9 ("kernel: backport nvmem v6.6 fixes and v6.7 changes")
Fixes: https://github.com/openwrt/openwrt/issues/15393
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit ccbffad1ad0ce444bc2497098a1d3d3a086a5f44)
[replace mac-address-increment with #nvmem-cell-cells]
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16624
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-07 10:36:12 +02:00
Chuanhong Guo
9afd809fc2 mediatek: add support for TP-Link TL-XDR3230 v1
Specifications:
- SoC: Mediatek MT7622B
- RAM: 256M
- Flash: EN25QH128 16M
- Ethernet: RTL8367S 4xGE
- WiFi: MT7622 2.4G 4x4 + MT7905 5G 4x4
- UART: 3.3v, 115200n8
  --------------------------
  |         Layout         |
  |               ∇        |
  |  -----------------     |
  |  | VCC GND RX TX | JP1 |
  |  -----------------     |
  --------------------------

Flash instruction:
TP-Link locks down their firmware and serial console, so the firmware
must be flashed with mtk_uartboot.

1. Download mtk_uartboot:
   https://github.com/981213/mtk_uartboot/releases
2. Download bootloaders:
   RAM loader for mtk_uartboot: https://drive.wrt.moe/uboot/mediatek/mt7622-bl2-ram-1ddr3.bin
   BL2: https://drive.wrt.moe/uboot/mediatek/mt7622-tplink_tl-xdr3230-v1-bl2.bin
   FIP: https://drive.wrt.moe/uboot/mediatek/mt7622-tplink_tl-xdr3230-v1-fip.bin
3. Open the case, and attach to the UART.
4. Start mtk_uartboot:
   ./mtk_uartboot -a -s /dev/ttyUSB0 -p mt7622-bl2-ram-1ddr3.bin -f \
     mt7622-tplink_tl-xdr3230-v1-fip.bin --brom-load-baudrate 115200 \
     --bl2-load-baudrate 115200
5. Cut off the power and re-engage, wait for UART download to complete.
6. Connect to the UART, write new BL2/FIP/Firmware with TFTP.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
[fixup wifi eeprom and macs, add network configuration, minor fixes]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 9f73519e62)
2024-10-07 16:08:29 +08:00
Tianling Shen
1e0cd890c1 autocore: fix read mt7622 wifi temp
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 1d978085ee)
2024-10-07 16:07:56 +08:00
Tianling Shen
e1d143ce7e kernel: make 'no port node found' output a debug message
There are cases where an unavailable port is not an error, making
this error message a false-positive. The kernel log is flooded with
the messages like:
  OF: graph: no port node found in /soc@0/bus@42000000/i2c@42530000/usb-typec@50

Silence this message by making it a debug message.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 17ea41eabb)
2024-09-29 12:17:17 +08:00
Tianling Shen
5637dd20a4 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-29 12:11:27 +08:00
Jakob Haufe
fa0a7e00e8 octeon: ubnt-edgerouter: fix sysupgrade config backup/restore
er is missing from platform_copy_config() and octeon_move_config(), so
config is lost on every sysupgrade.

(cherry-picked from commit 77037b09f3)
Signed-off-by: Jakob Haufe <sur5r@sur5r.net>
Link: https://github.com/openwrt/openwrt/pull/16518
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-28 18:33:21 +02:00
Robert Marko
87477c756e tools: bzip2: use static lib and tools
Currently, bzip2 is built with a dynamically linked library on which all
of the bzip2 tools depend on.

However, when trying to use the staging dir bzip2 during building on
Fedora 40 the following error appers:
staging_dir/host/bin/bzip2: error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or directory

Looking into it, the binary is dynamically linked:
$ ldd staging_dir/host/bin/bzip2
linux-vdso.so.1 (0x00007f5ebd9ff000)
libbz2.so.1.0 => not found
libc.so.6 => /lib64/libc.so.6 (0x00007f5ebd7f5000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5ebda01000)

libbz2.so.1.0 is installed into staging_dir/lib but that directory is not
evaluated for the required libraries and Fedora only ships:
/usr/lib64/libbz2.so.1
/usr/lib64/libbz2.so.1.0.8

Thus it cannot find the libbz2 that bzip2 is linked against and thus
trying to use bzip2 will fail and stop compilation as it is used for
bzip2 compressed tarballs.

So, to avoid OpenWrt compiled bzip2 to even attempt to load a required
library from the host we can just static compile libbz2 and bzip2.

Link: https://github.com/openwrt/openwrt/pull/16520
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-28 12:05:48 +02:00
Tianling Shen
3a878a0602 ramips: disable build for linksys e1700 and zyxel keenetic-lite-iii-a by default
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-28 14:55:12 +08:00
David Bauer
5332351821 ipq40xx: fix AP-303H PSE GPIO pin
The GPIO chip is at a different start index compared to OpenWrt master.

Signed-off-by: David Bauer <mail@david-bauer.net>
2024-09-27 19:10:40 +02:00
Tianling Shen
2b0f15e3a9 ImmortalWrt v23.05.4: revert to branch defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-27 19:08:11 +08:00
Tianling Shen
bae54687c7 ImmortalWrt v23.05.4: adjust config defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-27 19:08:09 +08:00
Tianling Shen
399f9a1db3 rockchip: enable rfkill gpio driver
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit bc41ac2d2d)
2024-09-27 15:23:35 +08:00
Tianling Shen
df030ed6f3 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-25 15:18:00 +08:00
Chukun Pan
6e561fe0a1 kernel: r8126: add CONFLICT to rss variant
The rss variant should conflict with the default.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/16460
(cherry picked from b83c7448d3)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-09-24 09:15:48 +02:00
Chukun Pan
1d9f6d389e kernel: r8125: add CONFLICT to rss variant
The rss variant should conflict with the default.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/16460
(cherry picked from d39078c785)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-09-24 09:15:06 +02:00
Hauke Mehrtens
dced292d68 OpenWrt v23.05.5: revert to branch defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-24 00:53:40 +02:00
Hauke Mehrtens
28cf53e6bd OpenWrt v23.05.5: adjust config defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-24 00:53:33 +02:00
Paul Spooren
10cc5fcd00 build: align SOURCE path for build system and SDK
Building a package in the build system or the SDK results in different
values for the `SOURCE` property, it's either `packages/<package name>`
or `feeds/base/<package name>`. The reason is that the SDK handles
`openwrt.git` as an external feed called while the build system contains
the *base* packages directly.

Since packages created with either method are (ideally) the same (bit
for bit), align the content of SOURCE. To do so this commit creates a
symlink from `feeds/base` to `$(TOPDIR)/package` and adopts the SOURCE
when building from inside the build system.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-09-23 14:34:46 +02:00
Fabian Bläse
87fbb5085d ipq40xx: re-add label MAC address for FritzBox 4040
The MAC address of the GMAC is contained inside the CWMP-Account
number on the label.

The label MAC address alias was defined previously, but it has been
removed with the switch to IPQESS / DSA.

Restore the label MAC address alias.

Fixes: 27b441cbaf ("ipq40xx: drop ESSEDMA + AR40xx DTS nodes")
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit b22d382ae4)
Signed-off-by: Tom Herbers <mail@tomherbers.de>
Link: https://github.com/openwrt/openwrt/pull/16459
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-23 10:25:05 +02:00
Sander Vanheule
a2a67804fc firmware-utils: bump to latest openwrt-23.05
This version bump contains one patch improving compatibility with recent
vendor firmware versions:
  - commit f3b636d0ee47 ("tplink-safeloader: bump EAP610-V3 compat_level")

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2024-09-22 16:47:19 +02:00
Markus Stockhausen
ace013101c realtek: 5.15: backport VLAN fix
With commit a22d359fa5 VLAN handling was fixed for kernel 6.6.
This restored network connectivity of the devices. For easy testing
backport the fix for 5.15 too.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/16391
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 35e13244aa)
Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
2024-09-22 16:26:25 +02:00
Ryan Salsbury
8e75eed617 ath79: fix I2C pins on GL-AR750
Change I2C pin flags to GPIO_ACTIVE_HIGH and change SDA to GPIO1.

On my late production GL-AR750 (purchased 2024):
SCL = GPIO16
SDA = GPIO1

Bug report:
I2C bus doesn't work in GL-AR750
https://github.com/openwrt/openwrt/issues/16319

Signed-off-by: Ryan Salsbury <ryanrs@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16406
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 2e626ae2d2)
Signed-off-by: Ryan Salsbury <ryanrs@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16446
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-22 16:07:46 +02:00
Hauke Mehrtens
4d4d260f5b ramips: tp-link er605-v2: Remove sysupgrade-tar image
The sysupgrade-tar image build is not defined for this target, do not
add a build instruction for it. The build system will use the definition
from the dna_valokuitu-plus-ex400 board and the build will fail.

This fixes the build of the ramips target.

Fixes: 665c2154ef ("ramips: add basic support for tp-link er605-v2")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 746e894877)
2024-09-22 15:33:11 +02:00
Tianling Shen
5fedd23972 rockchip: backport standard system-power-controller property support
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-21 20:45:14 +08:00
Tianling Shen
bc8745a607 uboot-rockchip: align shared recipes with master branch
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-21 20:40:02 +08:00
Tianling Shen
22db6381b2 rockchip: fix pmic binding for lyt t68m
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-21 19:39:14 +08:00
Tianling Shen
0895ba3696 rockchip: add LYT T68M support
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 42e37572ab)
2024-09-21 19:29:49 +08:00
Tianling Shen
56c3f7c22c rockchip: fix armsom sige3 i2s1 clks
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 9fefa4f77a)
2024-09-21 17:03:43 +08:00
Tianling Shen
c8f8074d29 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-21 14:20:59 +08:00
Felix Fietkau
66055df3e0 ucode: another fix for host installation
The previous host installation fix accidentally moved the rpath settings
out of CMAKE_HOST_OPTIONS and into CMAKE_OPTIONS.

Fixes: ae42ecaad4 ("ucode: fix host installation")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 2ee1392e09)
2024-09-20 22:21:03 +02:00
David Bauer
dd4b05ee8a ipq40xx: add PoE passthrough GPIO
Add the GPIO pin of the PoE passthrough switch on the Aruba AP-303H.
Power is activated when the pin is low. It enables a PSE chip, so power
is only supplied to downstream devices when they are 802.3af/at
compliant devices.

Ensure you use a sufficient power supply when chaining a consuming
device after the AP.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit b40cc46cc8)
2024-09-20 19:52:46 +02:00
Felix Fietkau
984e3705d3 ucode: another fix for host installation
The previous host installation fix accidentally moved the rpath settings
out of CMAKE_HOST_OPTIONS and into CMAKE_OPTIONS.

Fixes: ae42ecaad4 ("ucode: fix host installation")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 2ee1392e09)
2024-09-20 22:58:31 +08:00
Tianling Shen
d8de9f4a6f Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-19 14:07:23 +08:00
Andreas Böhler
4d7ad37891 ramips: mt7621: use lzma-loader for Sercomm NA502s
This fixes a well-known "LZMA ERROR 1" error on Sercomm NA502s, reported
on the OpneWrt forum [0].

[0] https://forum.openwrt.org/t/206640

Signed-off-by: Andreas Böhler <dev@aboehler.at>
(cherry picked from commit 6d89aa2987)
Link: https://github.com/openwrt/openwrt/pull/16412
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-18 23:04:37 +02:00
Paul Donald
e3bb35811e lldpd: fix reload bug: advertisements shall default to on
Because these capability advertisements default to on in lldpd, they
became absent at reload, and not restart, due to how the reload logic
works ( keep daemon running, send unconfigured and then the new config
via socket ), and it was not evident unless you happened to be looking
for it (e.g. via pcap or tcpdump). It was also not evident from the
manpage ( have now sent patches upstream ).

At reload time, the unconfigure logic disabled them unless they were
explicitly enabled (compare with other settings where 'unconfigure' just
resets them). Now they default to on/enabled at init time, and are
explicitly 'unconfigure'd at startup if the user disables them via:

lldp_mgmt_addr_advertisements=0
lldp_capability_advertisements=0

In other words: explicit is necessary to disable the advertisements.

The same applies to 'configure system capabilities enabled'. Technically
'unconfigure'd is the default but now it is explicit at reload.

Tested on: 23.05.3

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
(cherry picked from commit 708101c141)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
0b48b832a9 lldpd: extended interface(s) parsing to handle patterns
For interface type parameters, the man page documents patterns:
```
*,!eth*,!!eth1

uses all interfaces, except interfaces starting with "eth",
but including "eth1".
```

* Renamed `_ifname` to `_l2dev`.
* get the l2dev via network_get_physdev (and not l3dev)
* Glob pattern `*` is also valid - use noglob for this

The net result is that now interface 'names' including globs '*' and '!'
inversions are included in the generated lldpd configs.

Temporarily `set -o noglob` and then `set +o noglob` to disable & enable
globbing respectively, because when we pass `*` as an interface choice,
other file and pathnames get sucked in from where the init script runs,
and the `*` never makes it to lldpd.

Tested extensively on: 22.03.6, 23.05.3

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
[ squash with commit bumping release version ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 4a81d868db)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
7ee813b3ef lldpd: make management address advertisement controllable
Defaults to off.

Available from >= 0.7.15

These are sent in TLV

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
(cherry picked from commit 50021d3222)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
af6a852ced lldpd: make capabilities advertisement controllable
Defaults to off.

Only available from >= 1.0.15

These capabilities are sent in TLV.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
(cherry picked from commit 4d8f56bd59)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
cec02193d5 lldpd: note about capabilities
only available from >= 1.0.15

Comments are useful. Apparently this config parameter was committed when
openwrt used an older version of lldpd which did not yet support it.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
(cherry picked from commit b476917502)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
ca0c2363c2 lldpd: fix restart
Redirection broke in 5364fe0f01 ("lldpd: shellcheck fixes")

redirects to /dev/null shall be handled correctly (i.e. last).

This fixes these errors on `/etc/init.d/lldpd reload`:

2024-03-16T20:39:00 [WARN/lldpctl] unknown command from argument 1: `/dev/null`
2024-03-16T20:39:00 [WARN/lldpctl] unknown command from argument 1: `/dev/null`
2024-03-16T20:39:00 [WARN/lldpctl] unknown command from argument 1: `/dev/null`
2024-03-16T20:39:00 [WARN/lldpctl] unknown command from argument 1: `/dev/null`

Tested-on: 22.03.6
Fixes: 5364fe0f01 ("lldpd: shellcheck fixes")
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
[ improve commit description, add fixes tag ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 8cf1dce428)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
3d3dad61b2 lldpd: update URL
update Makefile URL

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit f753d3152f)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
d7765c488c lldpd: shellcheck fixes
No functionality/behaviour changes; code is synonymous

Tested on: 22.03.6

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 5364fe0f01)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
601bbdda6a lldpd: implement lldp_policy parameter
For certain lldp_class scenarios (2 & 3) a policy must be set also.
Class 4 is default, although it's good to handle the policy eventuality.

Here, set a default lldp_policy for all lldp_class scenarios. Any
lldp_policy can now be set.

Depends on PR #14584 (which introduced an `if` block)

Tested on 22.03.5, 22.03.6

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 497fafb8ae)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
56675166e8 lldpd: Implement location parameter
Previously only partially implemented. After commit
5007f488bb lldp_location was never removed

Now, add the value of lldp_location to the generated config.

The location param has a few syntaxes, so the config acquires the first
usage from the man page: 'address country EU'

Supplementary fix for PR #14193 (this param was included in the original
PR #13018 but the lldp_location fixes were absent from PR #14193).

Tested on 22.03.5, 22.03.6

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 53252eeb3b)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
7542e7927b lldpd: fix error "sh: XXXms: bad number"
from commit 3ce909914a

The lldpd man page says that "configure lldp tx-interval" can
specify an interval value in milliseconds by appending a "ms" suffix to
the figure. Thus mandating string handling, and not integer comparison.

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 79ee4cb039)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
b886948692 lldpd: refactor out ifaces derivation; reuse function
from commit 909f063066

Now pass two params to get_config_cid_ifaces() for:

cid_interface
interface

Each of which is a CSV of interfaces.

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 228d4e7f1b)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
74581b02b2 lldpd: remove unneeded quotes
from commit a5f715da71

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 4dcece46a7)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
8766fed5cd lldpd: remove unneeded quotes and variable quoting
from commit ac771313eb

portidsubtype takes 1 of 2 possible keywords which do not need quoting:

         configure lldp portidsubtype ifname | macaddress

The third keyword 'local' is used in the syntax when individual ports
are being defined:

         configure [ports ethX [,…]] lldp portidsubtype local value

When this syntax is used, quoting is useful (see test cases for lldpd).
In the init file, the 'local' syntax is unused.

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit bd1b17d589)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
64b38f3bd5 lldpd: remove unneeded quotes and variable quoting
from commit c98ee4dbb3

agent-type takes 1 of 3 possible keywords which do not require quoting:

         configure lldp agent-type nearest-bridge | nearest-non-tpmr-bridge
         | nearest-customer-bridge

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 24a4da527f)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
89759ee4bb lldpd: remove unneeded quotes and variable quoting
from commit 3ce909914a

'capabilities enabled x' where x is a string of CSV

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit b039641071)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
50135a03a6 lldpd: remove unneeded quotes
from commit 3ce909914a

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 82ec853284)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
4446346fdd lldpd: remove unneeded quotes and variable quoting
from commit 24176a6bdd

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 20a4dddeb0)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
b1ddf0a859 lldpd: fix a paste error
from commit 1be2088a52

The original PR #13018 did not exhibit this.

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 4fb8fea6de)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
c0217ef8f8 lldpd: spell fixes
Supplementary fix for PR #14193

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 1909b6f883)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Paul Donald
1d14e0abfc lldpd: fix -k 'lldp_no_version' row
Supplementary fix for PR #14193 and commit
b67182008f

Tested on 22.03.5

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 97eb3bf76c)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Stephen Howell
4ebd60b083 lldpd: add option to force EDP
allow EDP support if compiled and add force EDP option

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit d274867c21)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Stephen Howell
13193cb070 lldpd: only use snmp options when compiled in
prevent SNMP options being passed unless lldpd supports them

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 8b2d02e48c)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:03 +02:00
Stephen Howell
02e3845890 lldpd: Update Makefile package release
increment Makefile package release to reflect changes to init script

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 1b36d44323)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
a7f749ded4 lldpd: add option for tx delay and tx hold
add option to set LLDP transmit delay, hold timers to set update frequency

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit a5f715da71)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
b2008404ab lldpd: add option to set system platform
add option to override system platform instead of using kernel name

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 4159acceeb)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
18fc86a0f5 lldpd: add option to force SONMP enabled
add option to force SONMP to be enabled even when no peer detected

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 4ac134aa78)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
1201a69664 lldpd: add option to force FDP on
add option to force FDP when no peers detected

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 1be2088a52)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
d6da0952ab lldpd: set CDP version and allow forcing CDP on
add option to specify CDPv1 or CDPv2 and separately enable or force each

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit b67182008f)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
7f58fc14d8 lldpd: allow disabling LLDP protcol
add option to allow LLDP disabling while using other supported protocols

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 61dbe756d8)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
ed3f182d63 lldpd: add portidsubtype option
add option portidsubtype to correct port identifiers and descriptions

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit ac771313eb)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
6cbc100762 lldpd: add agent-type option
add option to set agent-type to control propogation

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit c98ee4dbb3)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
be4824977b lldpd: add LLDP MED options
add option to enable LLDP MED fast-start and set fast-start timer

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 24176a6bdd)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
15e6259231 lldpd: option to disable LLDP-MED inventory TLV
add option to disable LLDP-MED inventory TLV transmission

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 1753498b01)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
59ad77faba lldpd: Init adds no-version option
add option to disable advertising kernel version

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 058f284b1a)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
1d83e4c5ed lldpd: Allow neighbour filtering
add filter option to init script.

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit ac3ed75309)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
f79ab96312 lldpd: LLDPD binds to only specified interfaces
Bind to the configured system interfaces only. Switchport interfaces
are no longer ignored and uci interface values for LLDPD are honored.

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit 064b4999ad)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Stephen Howell
b0f991d03c lldpd: Init config read on reload
Init script reload with trigger to detect config file update.
Reload command added to attempt non-impactful lldpd reload where
lldpcli can be used to update config without process restart.
Config hash function used to track whether process restart is needed.

Signed-off-by: Stephen Howell <howels@allthatwemight.be>
(cherry picked from commit e483c247dc)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Sebastian Pflieger
8f714af40b lldpd: add lldp_syscapabilities config option
allow to overwrite the detected system capabilities e.g. if devices
does not operate as bridge.

Signed-off-by: Sebastian Pflieger <sebastian@pflieger.email>
(cherry picked from commit 3ce909914a)
Link: https://github.com/openwrt/openwrt/pull/15299
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-17 12:36:02 +02:00
Tianling Shen
7a79b154af mediatek: add Imou LC-HX3001 fit layout support
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-16 20:32:11 +08:00
Tianling Shen
d19a3c70de mediatek: add CMCC A10 fit layout support
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-16 17:56:18 +08:00
Tianling Shen
21ce07e56a rockchip: remove upstreamed patch
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-15 17:02:06 +08:00
Tianling Shen
42668c51f5 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-15 11:24:36 +08:00
David Bauer
3b85719b62 ucode: fix missing backslash
Fixes: ae42ecaad4 ("ucode: fix host installation")

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 9d663c7435)
2024-09-15 03:32:18 +02:00
Hauke Mehrtens
461102d99c ncurses: Fix path in ncursesw.pc
The file contains the the /usr/lib path from the toolchain directory and
not from the target directory. The /usr/lib directory for the toolchain
is empty and the shared library is not in the specified paths. On RISCV
the linker of util-linux was finding the libncursesw.so in my host
system, tried to link against it and failed. Fix the .pc file.

Fixes: #15942
Co-authored-by: Thomas Weißschuh <thomas@t-8ch.de>
Link: https://github.com/openwrt/openwrt/pull/16018
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 91573ac145)
Link: https://github.com/openwrt/openwrt/pull/16390
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-15 02:03:25 +02:00
Philip Prindeville
b1858ffbf3 build: autoconf: set ac_cv_func_setresuid=true
MUSL and eglibc provide these symbols.

Bind needs setresuid() to build properly in recent versions.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Link: https://github.com/openwrt/openwrt/pull/15952
(cherry picked from commit 0bd129a5d3)
Link: https://github.com/openwrt/openwrt/pull/16390
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-15 02:03:25 +02:00
Yan Cangang
912acb6c09 filogic: add missing 2.5G PHY LEDs configuration for Zyxel EX5700
configure 2.5G PHY LEDs to:

2500/1000: green with blink on TX/RX
100/10: green+yellow with blink on TX/RX

which is similar to other 1G PHY LEDs, which are:

1000: green with blink on TX/RX
100/10: green+yellow with blink on TX/RX

Fixes: 6cc14bf66a ("filogic: support Telenor branded ZyXEL EX5700")

Signed-off-by: Yan Cangang <nalanzeyu@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16082
(cherry picked from commit 3de653a0af)
Link: https://github.com/openwrt/openwrt/pull/16390
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-15 02:03:25 +02:00
Hauke Mehrtens
7e42fdcafe mac80211: Update to version 6.1.110-1
This updates mac80211 to version 6.1.110-1. This code is based on Linux
6.1.110 and contains all fixes included in the upstream wireless
subsystem from that kernel version. This includes many bugfixes and also
some security fixes.

The removed patches are already integrated in upstream Linux 6.1.110.

The following patches were integrated in upstream Linux:
   subsys/311-v6.2-wifi-mac80211-fix-and-simplify-unencrypted-drop-chec.patch
   subsys/312-v6.3-wifi-cfg80211-move-A-MSDU-check-in-ieee80211_data_to.patch
   subsys/313-v6.3-wifi-cfg80211-factor-out-bridge-tunnel-RFC1042-heade.patch
   subsys/314-v6.3-wifi-mac80211-remove-mesh-forwarding-congestion-chec.patch
   subsys/315-v6.3-wifi-mac80211-fix-receiving-A-MSDU-frames-on-mesh-in.patch
   subsys/316-v6.3-wifi-mac80211-add-a-workaround-for-receiving-non-sta.patch
   subsys/321-mac80211-fix-mesh-forwarding.patch
   subsys/322-wifi-mac80211-fix-mesh-path-discovery-based-on-unica.patch
   subsys/329-wifi-mac80211-fix-receiving-mesh-packets-in-forwardi.patch
   subsys/339-wifi-cfg80211-fix-receving-mesh-packets-without-RFC1.patch
   subsys/350-v6.3-wifi-mac80211-Allow-NSS-change-only-up-to-capability.patch
   subsys/351-v6.9-wifi-mac80211-track-capability-opmode-NSS-separately.patch

Link: https://github.com/openwrt/openwrt/pull/16368
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-15 01:59:41 +02:00
Ivan Pavlov
4fa16c1e24 openssl: update to 3.0.15
OpenSSL 3.0.15 is a security patch release. The most severe CVE fixed in this release is Moderate.

This release incorporates the following bug fixes and mitigations:

  * Fixed possible denial of service in X.509 name checks (CVE-2024-6119)

  * Fixed possible buffer overread in SSL_select_next_proto() (CVE-2024-5535)

Added github releases url as source mirror

Signed-off-by: Ivan Pavlov <AuthorReflex@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16332
(cherry picked from commit 62d3773bf1)
Link: https://github.com/openwrt/openwrt/pull/16346
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-14 17:04:20 +02:00
Hauke Mehrtens
a0ebff651d mbedtls: Update to 2.28.9
This contains a fix for:
CVE-2024-45157:
Unlike previously documented, enabling MBEDTLS_PSA_HMAC_DRBG_MD_TYPE does
not cause the PSA subsystem to use HMAC_DRBG: it uses HMAC_DRBG only when
MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG and MBEDTLS_CTR_DRBG_C are disabled.

Link: https://github.com/openwrt/openwrt/pull/16367
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-14 17:02:22 +02:00
Hauke Mehrtens
8e5e62416f kernel: bump 5.15 to 5.15.167
Manually adapted:
   generic/backport-5.15/020-v6.1-05-mm-multi-gen-LRU-groundwork.patch
   ramips/patches-5.15/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch

Link: https://github.com/openwrt/openwrt/pull/16366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-14 16:51:13 +02:00
Hauke Mehrtens
fd6e077ddf kernel: bump 5.15 to 5.15.166
Manually adapted:
   bcm27xx/patches-5.15/950-0030-Revert-Bluetooth-Always-request-for-user-confirmatio.patch

Link: https://github.com/openwrt/openwrt/pull/16366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-14 16:51:13 +02:00
Hauke Mehrtens
bad01d4806 kernel: bump 5.15 to 5.15.165
Removed because they are upstream:
   generic/pending-5.15/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=bff165a3993683daddf3f00563960e7675966f91

   ipq807x/patches-5.15/0004-v5.16-arm64-dts-qcom-msm8996-Move-clock-cells-to-QMP-PHY-c.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=32f0e52f16d45d743b473659329f93d4a27c68bf

Manually adapted:
   bcm27xx/patches-5.15/950-0040-spi-spidev-Completely-disable-the-spidev-warning.patch
   bcm27xx/patches-5.15/950-0578-spi-spidev-Restore-loading-from-Device-Tree.patch
   generic/pending-5.15/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch

Adapt kernel configuration for newly added option
CONFIG_ARM64_ERRATUM_3194386.

The leddev_list_lock attribute changed from rwlock_t to spinlock_t in:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=590304b798a3b89e716b6b564f8ad14bc9373d93

Link: https://github.com/openwrt/openwrt/pull/16366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-14 16:51:13 +02:00
Tianling Shen
190a5ca7a9 rockchip: add Radxa ROCK Pi E v3.0 support
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-13 17:19:30 +08:00
Tianling Shen
ed23a0d285 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-13 12:49:28 +08:00
David Bauer
cc938b18a8 ucode: fix host installation
The path for linking libucode.so was not specified for the ucode binary.
This breaks execution of ucode in the host context.

Signed-off-by: David Bauer <david.bauer@uniberg.com>
(cherry picked from commit ae42ecaad4)
2024-09-13 03:16:31 +02:00
Rafał Miłecki
ee3efefc5e treewide: fixup models names for UniFi U6 series
Ubiquiti has a set of UniFi 802.11ax (Wi-Fi 6) AP devices. All models
include "U6" in their names and also have code names with no special
characters (including spaces).

Examples:
1. U6 Lite (codename U6-Lite)
2. U6 Long-Range (codename U6-LR)
3. U6+ (codename U6-PLUS)
4. U6 Pro (codename U6-Pro)
5. U6 Mesh (codename U6-Mesh)
6. U6 Mesh Pro (codename U6-Mesh-Pro)
7. U6 Enterprise (codename U6-Enterprise)

Use proper full names for those devices. Names in OpenWrt/DTS code may
need updating too but it can be handled later.

Cc: Elbert Mai <code@elbertmai.com>
Cc: Daniel Golle <daniel@makrotopia.org>
Cc: Henrik Riomar <henrik.riomar@gmail.com>
Cc: David Bauer <mail@david-bauer.net>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 74879140a1)
2024-09-12 14:37:59 +02:00
David Bauer
7447eeac91 ipq40xx: define config-names for Aruba boards
Aruba boards now ship with multiple DTS and image-configurations per
image. Newer apboot revs expect a configuration for their hardware to be
present.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit c7ba5574f5)
2024-09-11 17:47:11 +02:00
Tianling Shen
b6a3289948 mediatek: add Konka KOMI A31 support
Hardware specification:
  SoC: MediaTek MT7981B 2x A53
  Flash: 128 MB SPI-NAND
  RAM: 256MB
  Ethernet: 4x 10/100/1000 Mbps
  Switch: MediaTek MT7531AE
  WiFi: MediaTek MT7976C
  Button: Reset, Mesh
  Power: DC 12V 1A

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit db71ac643d)
2024-09-09 16:07:33 +08:00
Tianling Shen
53e4ddfa7c x86: include intel dmc firmware by default
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-08-31 20:46:45 +08:00
Johannes Truschnigg
9588844df8 linux-firmware: add Intel CPU-integrated GPU (iGPU) firmware
On latest Intel x86 CPUs, DMC firmware is required for the iGPU to reach
its lowest power states. If the driver cannot load it, it will print a
warning and unnecessarily make the iGPU draw a bit more power when idle.

GUC firmware (various "offload" mechanisms that deal with scheduling GPU
workloads) and HUC firmware (required for accelerated media codec
operations for HEVC/H.265) are probably more niche, but could also
provde useful for some - for example, when building an
Intel/OpenWrt-based security camera.

Signed-off-by: Johannes Truschnigg <johannes@truschnigg.info>
Link: https://github.com/openwrt/openwrt/pull/16069
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit b6ac37110f)
2024-08-31 20:46:15 +08:00
Tianling Shen
96fcadbba8 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-08-30 23:21:03 +08:00
Tianling Shen
b8e54164ce rockchip: add ArmSom Sige3 support
Hardware
--------
RockChip RK3568 ARM64 (4 cores)
2/4/8GB LPDDR4x RAM
1000 Base-T
2500 Base-T
AP6275S Wi-Fi 6 / Bluetooth 5.3
2 LEDs (RED / GREEN)
8/16/32/64GB eMMC on-board
Micro-SD Slot
HDMI Port
USB 2.0 Port
USB 3.0 Port
USB Type-C 3.0 Port
M.2 M-Key
40-Pin Header
USB PD 2.0 9/12/15V Power

Installation
------------
Uncompress the ImmortalWrt sysupgrade and write it to a micro SD card or
internal eMMC using dd.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit a609a18fb9)
2024-08-30 23:14:56 +08:00
Tianling Shen
4e7be5f8b0 uboot-rockchip: add ArmSom Sige3 support
Add support for the ArmSom Sige3 board.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 3af9becde7)
2024-08-30 23:14:55 +08:00
Tianling Shen
c98848dfa4 rockchip: backport support for RK860X regulator
Used by ArmSom Sige3.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-08-30 23:14:51 +08:00
Matthias Schiffer
5773538c90 base-files: fix merge of passwd/shadow/group lines with trailing colons
Empty trailing fields get lost when the lines are split and merged again
at colons, resulting in unparsable entries. Only use the split fields for
matching against the other file, but emit the original line unchanged
to fix the issue.

Fixes: de7ca7dafa ("base-files: merge /etc/passwd et al at sysupgrade config restore")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 9bbaa6f2c0)
2024-08-29 21:07:48 +02:00
Matthias Schiffer
c4c43c64aa tools: libtool: do not symlink files in bootstrap
Another instance of files in build_dir symlinking to staging_dir. While
the symlinks do not currently cause any bugs in the libtool package,
such symlinks were found to make the build more fragile, as writing to
the symlink may accidentally modify the shared file in staging_dir. Pass
--copy to bootstrap to disable the symlinking.

Link: https://github.com/openwrt/openwrt/pull/15825
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit d6e5459319)
2024-08-29 20:06:03 +02:00
Matthias Schiffer
d811a09524 include: autotools: do not symlink files in autoreconf
In Gluon's Github Actions CI, we were occasionally seeing bizarre build
errors that looked like a config.sub file had been corrupted, or changed
while it was being executed.

The cause turned out to be an interaction of the symlinks created by
autoreconf (pointing from individual tools' build dirs into
`staging_dir/host/share/automake-1.16`) and OpenWrt's host-build.mk,
which replaced config.guess and config.sub *after* autoreconf. The
result was that the replacement of these files ended up following the
symlinks and writing the files in `staging_dir/host/share/automake-1.16`
instead of a package's build dir. This could cause other packages' builds
to fail if they were currently executing the scripts while they were
being written.

To fix this, disable autoreconf's symlinking feature, so that modifying
these files in a package's build directory can't accidentally affect the
staged versions.

Link: https://github.com/openwrt/openwrt/pull/15825
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit c364cb8e46)
2024-08-29 20:06:02 +02:00
Sarah Maedel
5a8588e360 hostapd: fix anqp_3gpp_cell_net list delimiter
This patch fixes the list delimiter between 3GPP networks
passed to hostapd.

> list iw_anqp_3gpp_cell_net '262,001'
> list iw_anqp_3gpp_cell_net '262,002'

When passing a list of "iw_anqp_3gpp_cell_net" parameters via UCI,
hostapd would crash at startup:
> daemon.err hostapd: Line 73: Invalid anqp_3gpp_cell_net: 262,001:262,002

Using a semicolon as a delimiter, hostapd will start as expected.

Signed-off-by: Sarah Maedel <git@tbspace.de>
(cherry picked from commit 8de185a176)
2024-08-28 12:00:23 +02:00
Tianling Shen
06571d1ba3 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-08-27 18:22:33 +08:00
Tianling Shen
f4954e319e armbian-firmware: pack bcm43752 pcie firmware
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit ad9fbe2f0a)
2024-08-24 13:45:46 +08:00
Jakob Haufe
a07a531329 octeon: ubnt-edgerouter: Disable PCIe
Some devices lock up on PCIe initialization:

[   64.309697] PCIe: Port 0 in endpoint mode, skipping.
[   64.320496] PCIe: Initializing port 1
[   64.325257] PCIe: BIST FAILED for port 1 (0xffffffffffffffff)
(system hangs here)

Given the ER contains no PCIe peripherals, has no way to attach any
and the stock kernel doesn't have PCIe support either, just disable it.

(cherry picked from commit 308630aea6)
Signed-off-by: Jakob Haufe <sur5r@sur5r.net>
Link: https://github.com/openwrt/openwrt/pull/16223
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-08-22 11:41:22 +02:00
Tianling Shen
bf5a49d6f9 armbian-firmware: pack bt firmware for bcm43456
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit b0e86550ae)
2024-08-22 16:05:55 +08:00
Tianling Shen
e860b75a5c armbian-firmware: fix typo error
Fixes: 3c11b8bb63 ("armbian-firmware: update nvram files")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit cf5592795c)
2024-08-22 15:52:45 +08:00
Tianling Shen
3c11b8bb63 armbian-firmware: update nvram files
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 2cfadcf343)
2024-08-22 15:48:55 +08:00
Tianling Shen
cbac782014 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-08-22 15:27:01 +08:00
Álvaro Fernández Rojas
bd79a16674 kernel: r8126: print link status when link up
Like other Ethernet drivers, print link speed and duplex mode
when the interface is up. Formatting output at the same time.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from 5d2a008670)
2024-08-19 12:46:30 +02:00
Álvaro Fernández Rojas
4d33716f96 kernel: r8125: print link status when link up
Like other Ethernet drivers, print link speed and duplex mode
when the interface is up. Formatting output at the same time.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from a57a3e5cc5)
2024-08-19 12:46:14 +02:00
Álvaro Fernández Rojas
561d534adb kernel: r8168: print link status when link up
Like other Ethernet drivers, print link speed and duplex mode
when the interface is up. Formatting output at the same time.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from 2f846a3315)
2024-08-19 12:45:59 +02:00
Álvaro Fernández Rojas
fe8c1fdd24 kernel: r8101: print link status when link up
Like other Ethernet drivers, print link speed and duplex mode
when the interface is up. Formatting output at the same time.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from fe0240f27e)
2024-08-19 12:45:41 +02:00
Tianling Shen
9b5d38187e Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-08-18 22:15:03 +08:00
Álvaro Fernández Rojas
403af43fd4 kernel: r8126: ignore the rss rxnfc log
This log is noisy and useless, just ignore it.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from 8d9893ff34)
2024-08-18 12:21:15 +02:00
Chukun Pan
6a877053dd kernel: r8125: ignore the rss rxnfc log
This log is noisy and useless, just ignore it.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from 2fd0102cc3)
2024-08-18 12:20:55 +02:00
Álvaro Fernández Rojas
c615bcf438 kernel: r8126: add RSS variant
Instead of enabling RSS support, let's introduce a variant and let users
choose between both variants since it can cause network issues.

Signed-off-by: Milinda Brantini <C_A_T_T_E_R_Y@outlook.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from bfeef9b3d7)
2024-08-17 12:40:26 +02:00
Álvaro Fernández Rojas
a79157f257 package: add kmod-r8126 ethernet driver
r8126 is an out of tree driver provided by Realtek for RTL8126 devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from 54623c6a1d)
2024-08-17 12:40:22 +02:00
Álvaro Fernández Rojas
4d0dc5e15e kernel: r8125: add RSS variant
Instead of enabling RSS support, let's introduce a variant and let users
choose between both variants since it can cause network issues.

Signed-off-by: Milinda Brantini <C_A_T_T_E_R_Y@outlook.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from f063f4620c)
2024-08-17 12:35:09 +02:00
Álvaro Fernández Rojas
68d5ed7526 package: add kmod-r8125 ethernet driver
r8125 is an out of tree driver provided by Realtek for RTL8125 devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from ddb4070c96)
2024-08-17 12:34:50 +02:00
Álvaro Fernández Rojas
7d6366dcd7 package: add kmod-r8168 ethernet driver
r8168 is an out of tree driver provided by Realtek for RTL8168 devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
((cherry picked from commit 1565eeda4e)
2024-08-17 08:06:25 +02:00
Álvaro Fernández Rojas
d1de7d3c92 package: add kmod-r8101 ethernet driver
r8101 is an out of tree driver provided by Realtek for RTL8101 devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit b72c4b5386)
2024-08-17 08:03:48 +02:00
Tianling Shen
ee233aab6a Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-08-13 16:53:05 +08:00
Tianling Shen
cce5b49de4 mediatek: fix lan/wan macaddr for cmcc rax3000m
The MAC address assigned to lan/wan was reversed on eMMC boards.

Fixes: d3c193525e ("mediatek: add CMCC RAX3000M support")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/15077
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-11 19:18:39 +02:00
Tianling Shen
a591f9cd14 mediatek: enable rootwait for cmcc rax3000m emmc version
Sometimes the mmc deivce may come up later than kernel attempts to
mount rootfs, resulting kernel panic. Enable rootwait to fix it.

Reported-by: Yangyu Chen <cyy@cyyself.name>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/15077
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-11 19:18:39 +02:00
Tianling Shen
868b12b200 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-08-09 14:40:29 +08:00
Tianling Shen
6fadcee50b mediatek: increase phy assert time for jdcloud re-cp-03
According to RTL8221B's datasheet, the PHY requires at least 10ms
for assert and 68ms (recommended) for de-assert. So increase the
assert/de-assert time to 15ms and 68ms respectively.

Fixes: c0c3234e17 ("mediatek: add support for JDCloud RE-CP-03")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/16106
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit d1954aa535)
2024-08-08 22:07:08 +02:00
Tianling Shen
aff4e6c356 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-08-08 02:52:38 +08:00
Bjørn Mork
c241885687 kernel: ubootenv-nvram: driver for RAM backed environments
The vendor U-Boot implementaion on Telenor branded ZyXEL EX5700
devices does not store its environment on flash. It is instead
kept in a memory region.  This is persistent over reboots, but
not over power cycling.

The dual partition failsafe system used by the vendor U-Boot
requires the OS to modify a variable in this memory environment.
This driver allows the ordinary uboot-envtools to access a
memory region like it was a partition on NOR flash.

The specific vendor U-Boot adds a "no-map" /reserved-memory
section and a top level /ubootenv node pointing to the memory
environment.  The driver uses this device specific fact to
locate the region.  The matching and probing code will likely
have to be adjusted for any other devices to be supported.

Example partial device tree:

 / {
    ..
    ubootenv {
        memory-region = <&uenv>;
        compatible = "ubootenv";
    };
    ..
    reserved-memory {
        ..
        uenv: ubootenv@7ffe8000 {
            no-map;
            reg = <0 0x7ffe8000 0 0x4000>;
        };

Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit b2e810f495)
2024-08-07 12:12:30 +02:00
Tianling Shen
5e7fc895f2 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-08-05 18:10:40 +08:00
Rany Hany
e4625c37c4 hostapd: fix SAE H2E security vulnerability
This patch backports fixes for a security vulnerability impacting the
hostapd implementation of SAE H2E.

As upgrading hostapd would require more testing, the second mitigation
step which involves backporting several patches was adopted as outlined
in the official advisory[1].

An explanation of the impact of the vulnerability is provided from the
advisory[1]:

This vulnerability allows the attacker to downgrade the negotiated group
to another enabled group if both the AP and STA have enabled SAE H2E and
multiple groups. It should be noted that the H2E option is not enabled
by default and the attack is not applicable to the default option, i.e.,
hunting-and-pecking, since it does not have any downgrade protection for
group negotiation. In addition, the default configuration for enabled
SAE groups in hostapd is to enable only a single group, so the
vulnerability is not applicable unless hostapd has been explicitly
configured to enable more groups for SAE.

[1]: https://w1.fi/security/2024-2/sae-h2h-and-incomplete-downgrade-protection-for-group-negotiation.txt

Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/16043
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit db7f70fe61)
2024-08-02 23:18:03 +02:00
Tianling Shen
621ae59865 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-08-02 22:34:25 +08:00
Hauke Mehrtens
07cb7cb885 kernel: bump 5.15 to 5.15.164
No manual changes needed.

Link: https://github.com/openwrt/openwrt/pull/16027
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-29 23:11:33 +02:00
Hauke Mehrtens
f99dffcaca mac80211: Update to version 6.1.102-1
Upstream removed SSB and BCMA, the drivers are now compiled against the
in kernel versions. No need to patch this for OpenWrt.

Link: https://github.com/openwrt/openwrt/pull/15983
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-29 23:09:51 +02:00
Tianling Shen
5c8519b3ab Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-29 12:51:22 +08:00
Hauke Mehrtens
6edde2b502 ath25: eth: Fix PHY access over ar2313 driver
.ndo_do_ioctl is not called any more. For PHY MII ioctl handling, the
kernel calls .ndo_eth_ioctl now.

See upstream Linux kernel commit:
https://git.kernel.org/linus/a76053707dbf0dc020a73b4d90cd952409ef3691

Link: https://github.com/openwrt/openwrt/pull/16023
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 23:56:36 +02:00
Hauke Mehrtens
2e064182bf ipq40xx: eth: Fix PHY access over ipqess driver
.ndo_do_ioctl is not called any more. For PHY MII ioctl handling, the
kernel calls .ndo_eth_ioctl now.

See upstream Linux kernel commit:
https://git.kernel.org/linus/a76053707dbf0dc020a73b4d90cd952409ef3691

Link: https://github.com/openwrt/openwrt/pull/16005
(cherry picked from commit f0bb25aba2)
Link: https://github.com/openwrt/openwrt/pull/16023
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 23:56:36 +02:00
Hauke Mehrtens
c4dc5dbd33 ramips: eth: Fix PHY access over mtk_eth_soc driver
.ndo_do_ioctl is not called any more. For PHY MII ioctl handling, the
kernel calls .ndo_eth_ioctl now.

See upstream Linux kernel commit:
https://git.kernel.org/linus/a76053707dbf0dc020a73b4d90cd952409ef3691

Link: https://github.com/openwrt/openwrt/pull/16005
(cherry picked from commit dbccc9cf91)
Link: https://github.com/openwrt/openwrt/pull/16023
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 23:56:36 +02:00
Hauke Mehrtens
e5233fa70e ath79: Fix PHY access over ag71xx driver
.ndo_do_ioctl is not called any more. For PHY MII ioctl handling, the
kernel calls .ndo_eth_ioctl now.

The SIOCSIFHWADDR and SIOCGIFHWADDR operation are handled in the generic
code in the same way just with more input validation.

See upstream Linux kernel commit:
https://git.kernel.org/linus/a76053707dbf0dc020a73b4d90cd952409ef3691

Reported-by: Cthulhu88 in https://forum.openwrt.org/t/ethernet-leds-control-for-tp-link-tl-wr1043nd-v2-v3/202378
Link: https://github.com/openwrt/openwrt/pull/16005
(cherry picked from commit f86273e742)
Link: https://github.com/openwrt/openwrt/pull/16023
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 23:56:36 +02:00
Hauke Mehrtens
1478f641bd ltq-ptm: Fix netdev ioctls with kernel > 5.15
.ndo_do_ioctl is not called for SIOCDEVPRIVATE any more, the kernel
calls .ndo_siocdevprivate now.

The function gets the data pointer from the callback directly, make use
of it.

See upstream Linux kernel commit:
https://git.kernel.org/linus/b9067f5dc4a07c8e24e01a1b277c6722d91be39e

Link: https://github.com/openwrt/openwrt/pull/16005
(cherry picked from commit e33ebdd00e)
Link: https://github.com/openwrt/openwrt/pull/16023
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 23:56:35 +02:00
Tianling Shen
1fd6c9b67f rockchip: backport upstream fastrhino r66s/r68s fixes
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-27 18:21:21 +08:00
Hauke Mehrtens
f791ec1f6d kernel: bump 5.15 to 5.15.163
Manually adapted:
   lantiq/patches-5.15/0028-NET-lantiq-various-etop-fixes.patch

Link: https://github.com/openwrt/openwrt/pull/15982
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-27 00:40:25 +02:00
Hauke Mehrtens
56a84b3c47 mac80211: Fix wifi throughput
Backport 2 patches from upstream Linux to fix a Wifi throughput
problem.

Fixes: 323e249ce8 ("mac80211: Update to version 6.1.97-1")
Link: https://github.com/openwrt/openwrt/pull/16007
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-27 00:38:46 +02:00
Tianling Shen
ae9981f794 kernel: fix typo error in bpf_loop patch
Fixes: 53942ba877 ("kernel: backport more attrs for bpf_loop")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-26 22:43:29 +08:00
Tianling Shen
e5e667eac8 rockchip: fix syntax error in station p2 wifi patch
Fixes: 0fc833f310 ("rockchip: enable wifi and bt for firefly station p2")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit c352e9438d)
2024-07-26 22:25:54 +08:00
Tianling Shen
0fc833f310 rockchip: enable wifi and bt for firefly station p2
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit dee8b8f2e2)
2024-07-26 21:43:44 +08:00
Sven Huang
eea6071d07 ramips: add support for OpenFi 5Pro Travel Router
OpenFi 5Pro is a DualBand Travel Router, based on MT7621A.

Specification:
- Type             : Travel Wi-Fi Router(built-in Type-C Power Cable)
- Size             : 63 x 93 x 24mm
- Power            : Internal Type-C Cable PD/DC 5V@2A
- SoC              : MediaTek MT7621A
- RAM              : DDR3 512 MB
- Flash            : SPI-NOR 64MB (W25Q512)
- WLAN             : 2.4/5GHz 2T2R (MediaTek MT7603e/MT7613)
- Ethernet         : 2x 10/100/1000Mbps
- USB              : 1 x USB 2.0
- SDHCI            : 1 x TF Slot (Max 512GB)
- LEDs             : 3 x LEDs  (GPIO#16 gpio#17 gpio#14)
- Button           : 1 x Reset (GPIO#18),  1 x WPS (GPIO#13)
- UART             : 1 x UART for Debug, 115200 8N1 (Pinout: GND TX RX 3.3V)
- UART 2           : 1xUART2  (Pinout: GND TX2 RX2 3.3V )

How to upgrade image in uboot

1. press reset button when boot for 5sec.
2. access 192.168.21.1 in web ui.
3. select image and upload

Signed-off-by: Sven Huang <1036456939@qq.com>
(cherry picked from commit 5560791bbd)
2024-07-25 14:09:10 +08:00
Tianling Shen
53942ba877 kernel: backport more attrs for bpf_loop
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-21 21:35:52 +08:00
Tianling Shen
17cdd89ae2 x86: include r8126 driver by default
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 14a311399c)
2024-07-21 13:30:43 +08:00
Tianling Shen
79f506ba62 kernel: backport missing patch for bpf_loop
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-21 13:26:40 +08:00
Tianling Shen
7c31d7dd83 kernel: backport bpf_loop helper for dae
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-20 19:22:19 +08:00
Tianling Shen
79e9020dbe r8126: add Realtek 5GbE PCIe Network Adapter support
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit c582674b44)
2024-07-20 18:26:22 +08:00
Tianling Shen
1e6d2fcc57 ImmortalWrt v23.05.3: revert to branch defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-18 16:38:25 +08:00
Tianling Shen
f6bd6b3132 ImmortalWrt v23.05.3: adjust config defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-18 16:38:25 +08:00
Tianling Shen
81a1f98d5b uboot-envtools: add abt asr3000 support
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-18 14:35:54 +08:00
Tianling Shen
a0528c71e2 mediatek: update model name for abt asr3000
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-17 16:32:40 +08:00
Tianling Shen
8b02028d63 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-17 16:30:06 +08:00
Tianling Shen
e961589a38 r8125/r8168: fix enable rss support
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 555d16f6a3)
2024-07-17 15:44:03 +08:00
Tianling Shen
45c3885977 r8168: enable rss support
Enable parallel build while at it.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit e7f6a79233)
2024-07-17 15:36:09 +08:00
Beginner-Go
50d00ae438 r8168: update to 8.053.00
Signed-off-by: Beginner-Go <70857188+Beginner-Go@users.noreply.github.com>
(cherry picked from commit 8c9561fc7c)
2024-07-17 15:36:06 +08:00
Tianling Shen
eda88db59f r8125: set config via MAKE_FLAGS
Enable parallel build while at it.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 48d19e645a)
2024-07-17 15:35:43 +08:00
Tianling Shen
bb061d428c r8101: Update to 1.039.00
Removed upstreamed patches.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 5a505f8c83)
2024-07-17 12:33:09 +08:00
Hauke Mehrtens
76a0c2932c OpenWrt v23.05.4: revert to branch defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-16 23:51:26 +02:00
Hauke Mehrtens
b9510660ce OpenWrt v23.05.4: adjust config defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-16 23:51:19 +02:00
Paul Spooren
d8dd03c46f build: include tests/Makefile if available
Testing OpenWrt is important, and there is a test suite in the making.
For maximum convenience and minimal CI over-usage, make it simple to run
tests locally. The main Makefile now attempts to include
`tests/Makefile` and silently fails if it doesn't.

While the test suite[1] is still young, it provides good examples of how
to test things around OpenWrt: starting with shell scripts using
`bats`[2], followed by QEMU tests, and finally real device tests using
LabGrid[3]. This could lead to the creation of the best OpenWrt version
yet.

Please consult the `openwrt-tests.git` README.md for details on the
setup. Once installed you may run commands like the following:

* make tests/shell  # run shell tests
* make tests/x86-64 # run  and test x86/64 in QEMU

[1]: http://github.com/aparcar/openwrt-tests/
[2]: https://bats-core.readthedocs.io
[3]: https://labgrid.readthedocs.io

Signed-off-by: Paul Spooren <mail@aparcar.org>
Link: https://github.com/openwrt/openwrt/pull/15647
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit a8ff0c1b7e)
2024-07-16 00:14:18 +02:00
Hauke Mehrtens
84b000e5d0 wolfssl: Update to version 5.7.2
This fixes multiple security problems:
 * [Medium] CVE-2024-1544
   Potential ECDSA nonce side channel attack in versions of wolfSSL before 5.6.6 with wc_ecc_sign_hash calls.

 * [Medium] CVE-2024-5288
   A private key blinding operation, enabled by defining the macro WOLFSSL_BLIND_PRIVATE_KEY, was added to mitigate a potential row hammer attack on ECC operations.

 * [Low] When parsing a provided maliciously crafted certificate directly using wolfSSL API, outside of a TLS connection, a certificate with an excessively large number of extensions could lead to a potential DoS.

 * [Low] CVE-2024-5991
   In the function MatchDomainName(), input param str is treated as a NULL terminated string despite being user provided and unchecked.

 * [Medium] CVE-2024-5814
   A malicious TLS1.2 server can force a TLS1.3 client with downgrade capability to use a ciphersuite that it did not agree to and achieve a successful connection.

 * [Medium] OCSP stapling version 2 response verification bypass issue when a crafted response of length 0 is received.

 * [Medium] OCSP stapling version 2 revocation bypass with a retry of a TLS connection attempt.

Unset DISABLE_NLS to prevent setting the unsupported configuration
option --disable-nls which breaks the build now.

Link: https://github.com/openwrt/openwrt/pull/15948
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 3a0232ffd3)
2024-07-16 00:05:18 +02:00
Leon M. Busch-George
d3552ccb17 mediatek: filogic: prevent faulty mac address assignment
The vendor U-Boot on the Cudy M3000 and the Yuncore AX835 assign random
mac addresses on boot and set the 'local-mac-address' property which
prevents Openwrt from assigning the correct address from evmem.

This patch removes the alias for ethernet0 so that U-Boot doesn't add the
property, removes the workaround from 02_network, and adds back the nvmem
definition for the M3000.

Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
(cherry picked from commit a55ab9e134)
2024-07-15 16:13:59 +02:00
Leon M. Busch-George
74df6ce9db mediatek: filogic: add support for Cudy M3000 v1
Hardware:
  SoC:     MT7981b
  RAM:     256 MB
  Flash:   128 MB SPI NAND
  Ethernet:
    1x 2.5Gbps (rtl8221b)
    1x 1Gbps (integrated phy)
  WiFi:    2x2 MT7981
  Buttons: Reset, WPS
  LED:     1x multicolor

Solder on UART:
  - remove rubber ring on the bottom
  - remove screws
  - pull up the cylinder, maybe help by push on an ethernet socket with a screwdriver
  - remove the (3) screws holding the board in the frame
  - remove the board from the frame to get to the screws for the silver, flat heat shield
  - remove the (3) screws holding the heat shield
  - solder UART pins to the back of the board
    - make sure to have the pins point out on side with the black, finned heat spread
    - the markings for the pins are going to be below the silver heat shield
    - Vcc is not needed

If you don't intend on using the UART outside of the installation process, you might not
want to solder:

  - carefully scrape off the thin layer of epoxy on the holes (not the copper)
  - place your pin header with the UART attached in the holes
  - the pins, starting with the one closest to the socket:
    - Vcc (not required)
    - GND
    - RX
    - TX
  - either wedge the header or hold it with your fingers so that the pins stay in contact with the board

Installation (UART):
  - attach an Ethernet cable to the 1Gbps port (black) on the router
  - hold the reset button while powering the router
  - press CTRL-C or wait for the timeout to get to the U-Boot prompt
  - prepare a TFTP server on the network to supply ..-initramfs-kernel.bin
  - use 'tftpboot' in the U-Boot shell to pull the image
  - boot the image using 'bootm'
  - push the ..-sysupgrade to the router using your preferred method
  - perform the upgrade with 'sysupgrade -n'

There is a recovery mechanism that involves fetching a file called 'recovery.bin' but that is not understood yet.

Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
(cherry picked from commit 20e4a18feb)
2024-07-15 16:12:33 +02:00
Tianling Shen
a0645675d4 uboot-mediatek: enable rootwait for jdcloud re-cp-03
Sometimes the mmc deivce may come up later than kernel attempts to
mount rootfs, resulting kernel panic. Enable rootwait to fix it.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-15 16:10:16 +02:00
Daniel Golle
9f739daf05 uboot-mediatek: fix patch order
Make sure patch sequence number is unique by moving patch
440-add-jdcloud_re-cp-03.patch -> 441-add-jdcloud_re-cp-03.patch

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 2302a7c5ad)
2024-07-15 16:10:06 +02:00
Tianling Shen
84ecd7c939 mediatek: fix lan/wan macaddr for jdcloud re-cp-03
The MAC address assigned to lan/wan was reversed.

Fixes: 6e51ff88b0 ("mediatek: add support for JDCloud RE-CP-03")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-15 16:07:15 +02:00
Tianling Shen
d5b4471b85 ramips: convert EEPROM to NVMEM format for JDC RE-SP-01b
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 3b652ead1e)
2024-07-15 16:16:55 +08:00
Tianling Shen
f2e7ca567c ramips: use fixed layout cell "mac-base" for jdcloud re-sp-01b
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 210dbcf6a3)
2024-07-15 16:16:45 +08:00
Tianling Shen
5819783ce3 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-15 16:07:40 +08:00
Rafał Miłecki
9276bb1cf5 ath79: replace "mac-address-ascii" with "mac-base"
With upstream accepted "mac-base" binding there is no need for a
downstream "mac-address-ascii" workaround anymore.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit daaa0c1b25)
Link: https://github.com/openwrt/openwrt/pull/15917
2024-07-15 09:59:31 +02:00
Jo-Philipp Wich
553a7a3265 ucode: update to Git 1a8a0bcf725520820802ad433db22d8f64fbed6c (2024-07-11)
96f74b5be829 ubus: make ubus_context first in uc_ubus_connection_t
7e5830edfb38 nl80211: fix datatype of NL80211_BAND_IFTYPE_ATTR_HE_CAP_{MAC,PHY} attrs
5c8fd34bac42 nl80211: fix parsing of NL80211_BAND_ATTR_VHT_MCS_SET attribute
e8d4e4fe967d nl80211: fix decoding of NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET attribute
30a3f7ad0433 rtnl: store callback in listener registry only on success
9cbe8294909f rtnl: optimize reception of rtnl events
534417132e18 rtnl: increase event socket rx buffer size limit to 1 MiB
3f9811d2f7b7 compiler: close upvalues on loop control statements
ee4af9b55cb4 vm: rework object iteration
a275399dd8e2 uci: refactor uci.changes() to match documentation
1220992631d5 ubus: automatically clear error information
d6fd94014eea uci: automatically clear error information
99837f280b61 uloop: automatically clear error information
ba3855ae3775 lib: fix documentation typo for `pop()` function
be767ae197ba vm: rework `in` operator semantics
4ade84e8fb81 ubus: add explicit support for deferring incoming requests
cfe137be068a uci: remove incorrectly documentated reorder() parameter
e8d78a26da0c lib: introduce socket library
a0ad1d127ae6 build: fix symbol and library detection
674f65ee551d jsdoc: disable default module titles
a33d16a86493 socket: rework error handling
e2b81d869222 uloop: add documentation
953f36c96e8a socket: make socket.send() accept non-string data
f211d5ac666f ubus: fix uc_ubus_have_uloop for eloop+uloop combination
0662de64bd1f socket: add AF_PACKET socket type support
b594ff8a2841 socket: remove leftover debug code
0d823e702bfe socket: fix addrinfo() with omitted service argument
8cf816d615fd socket: fix potential memory leak in connect()
8f5f231d66cd socket: optimize poll() argument handling
36f106056069 socket: remove wrong documentation fragment
525fca224012 socket: uv_to_sockaddr(): fix length calculation for AF_UNIX addresses
3938645ad9e3 socket: support IPv6 addresses in struct conversion routines
3a586dc7ddbe socket: improve uc_socket_connect() behavior
7b269f1cd3d2 socket: improve uc_socket_listen() behavior
fc6f2b89febf socket: handle further socket option value types
d6f25797dad1 socket: add IPv6 socket options
7611487b9a05 socket: implement recvmsg(), sendmsg() and cmsg support
d2e44bfa8b54 core-lib: improved documentation
e0bab40c8578 fs: add truncate() file method
5d305cfb2ab7 fs: add lock() file method
8b0318f7fabe lib: introduce zlib library
73644a036f5a nl80211: move access to tb array out of uc_nl_convert_attr and below
6e3cf83a77a7 nl80211: add support for multi-attribute arrays
6ff24d5488a9 nl80211: update nl80211.h to latest wireless-next
abc2aef28641 nl80211: add wiphy multi-radio support

Fixes: https://github.com/jow-/ucode/issues/186
Fixes: https://github.com/jow-/ucode/issues/187
Fixes: https://github.com/jow-/ucode/issues/188
Fixes: https://github.com/jow-/ucode/issues/193
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2024-07-14 01:27:28 +02:00
Tianling Shen
d2016073be ramips: disable build for dlink dir-806a-b1 by default
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-13 11:51:11 +08:00
Daniel Golle
1ea54fe647 uboot-mediatek: fix patch order
Make sure patch sequence number is unique by moving patch
440-add-jdcloud_re-cp-03.patch -> 441-add-jdcloud_re-cp-03.patch

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 2302a7c5ad)
2024-07-12 19:39:49 +08:00
Tianling Shen
aeae666418 uboot-mediatek: fix merge conflict
Fixes: fab49a1289 ("Merge Official Source")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-12 19:39:33 +08:00
Tony Ambardar
48bdcaa2d6 build: add option KERNEL_DEBUG_INFO_BTF_MODULES
The recent kernel v6.6.31 update broke BTF-enabled builds since upstream
Linux added a prompt for config option DEBUG_INFO_BTF_MODULES in commit
2166cb2e21 ("bpf, kconfig: Fix DEBUG_INFO_BTF_MODULES Kconfig definition").

Fix by updating Config-kernel.in to add the option, cleaning up a related
dependency and whitespace also.

Fixes: 10d77b9bc3 ("kernel: bump 6.6 to 6.6.31")
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
(cherry picked from commit ab9bb79d8e)
2024-07-12 14:11:04 +08:00
Tianling Shen
c79ffb6839 mac80211: refresh patches
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-12 13:07:27 +08:00
Tianling Shen
fab49a1289 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-12 11:33:56 +08:00
Hauke Mehrtens
0cdbbd8868 wireless-regdb: Update to version 2024.07.04
Changes:
  2a768c4 wireless-regdb: Update regulatory rules for Mongolia (MN) on 6GHz
  04875d9 wireless-regdb: Update regulatory rules for Saudi Arabia (SA) on 6GHz
  b7bced8 wireless-regdb: Update regulatory rules for South Africa (ZA) on 6GHz
  7bc8615 wireless-regdb: Update regulatory info for Thailand (TH) on 6GHz
  f901fa9 wireless-regdb: Update regulatory info for Malaysia (MY) for 2022
  d72d288 wireless-regdb: Update regulatory info for Morocco (MA) on 6GHz
  414face wireless-regdb: Update regulatory info for Chile (CL) on 6GHz
  1156a08 wireless-regdb: Update regulatory info for Mexico (MX) on 6GHz
  cc6cf7c wireless-regdb: Update regulatory info for Iceland (IS) on 6GHz
  ce03cc0 wireless-regdb: Update regulatory info for Mauritius(MU) on 6GHz
  7e37778 wireless-regdb: Update regulatory info for Argentina (AR) on 6GHz
  56f3a43 wireless-regdb: Update regulatory info for United Arab Emirates (AE) on 6GHz
  3cb8b91 wireless-regdb: Update regulatory info for Colombia (CO) on 6GHz
  3682ce5 wireless-regdb: Update regulatory info for Costa Rica (CR) for 2021
  dd4ffe7 wireless-regdb: Update regulatory info for Dominican Republic (DO) on 6GHz
  f8ef7da wireless-regdb: Update regulatory info for Liechtenstein (LI) on 6GHz
  a9ecabe wireless-regdb: Update regulatory info for Jordan (JO) for 2022
  5a9fdad wireless-regdb: Update regulatory info for Kenya (KE) for 2022
  19326c3 wireless-regdb: Update regulatory info for Macao (MO) for 2024
  4838054 wireless-regdb: update regulatory database based on preceding changes

Link: https://github.com/openwrt/openwrt/pull/15921
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 0a24fd9155)
2024-07-11 00:23:36 +02:00
Shiji Yang
78858e5d6c ramips: limit max spi clock frequency to 50 MHz
In the past few years, we have received several reports about SPI
Flash not working properly. This is caused by excessively fast
clock frequency. It's really annoying to fix them one by one. Let's
reduce these aggressive frequencies to 50 MHz. This is a safe and
suggested value in the vendor SDK.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
(cherry picked from commit 73eeac49be)
Link: https://github.com/openwrt/openwrt/pull/15919
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-10 23:41:15 +02:00
Felix Fietkau
2b1ed7b33d mac80211: fix mesh id corruption on 32 bit systems
increase size of ifmsh->mbss_changed

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 20bd3502d3)
Link: https://github.com/openwrt/openwrt/pull/15836
[Moved the patch to the end of the patch queue]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-10 23:36:36 +02:00
Florian Eckert
130aa67675 linux-firmware: add missing LICENSE_FILES info
Where it is clear which lincense the firmware package has, the missing
information are added.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [backport]
(cherry picked from commit 535d487c41)
Link: https://github.com/openwrt/openwrt/pull/15918
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-10 23:07:36 +02:00
Florian Eckert
437d1988b1 linux-firmware: add LICENSE_FILES and LICENSE file handling
The firmware blobs have all different licenses from the different
manufacturers of the binary blobs. This information is contained in the
upstream 'linux-firmware' repositroy.

This commit extends the package handling so that this information can be
added as an additional argument during packages generation.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 5c14de1d7e)
Link: https://github.com/openwrt/openwrt/pull/15918
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-10 23:07:36 +02:00
Florian Eckert
6f72d62a53 kernel: update deprecated license information
Update the deprecated license information from GPL-2.0 to GPL-2.0-only
as written in the COPYING file of the linux source tree.

Also add the 'COPYING' file to the PKG_LICENSE_FILES variable.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 879826154f)
Link: https://github.com/openwrt/openwrt/pull/15918
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-10 23:07:36 +02:00
Florian Eckert
f5d64e36fb mac80211: add missing license information
The lincense information for the packages mac80211 are missing.
This commit adds the missing information.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [backport]
(cherry picked from commit 3128157ec7)
Link: https://github.com/openwrt/openwrt/pull/15918
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-10 23:07:36 +02:00
Florian Eckert
9b12d41476 ca-certificates: add missing license information
The package has no licence information. So let's fix it.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 0da116f25b)
Link: https://github.com/openwrt/openwrt/pull/15918
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-10 23:07:36 +02:00
Florian Eckert
42dada5713 wireless-regdb: add missing license information
Add the missing license information PKG_LICENSE and PKG_LICENSE_FILES.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 7a3deadf91)
Link: https://github.com/openwrt/openwrt/pull/15918
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-10 23:07:36 +02:00
Hauke Mehrtens
5c21ab2f8a ramips: Refresh kernel patches
The last patches broke this patch, refresh it again.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-10 23:03:33 +02:00
Felix Fietkau
738294315e mediatek: fix WED + wifi reset
The WLAN + WED reset sequence relies on being able to receive interrupts from
the card, in order to synchronize individual steps with the firmware.
When WED is stopped, leave interrupts running and rely on the driver turning
off unwanted ones.
WED DMA also needs to be disabled before resetting.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 2c5b3bee38)
2024-07-10 17:31:17 +02:00
Daniel Golle
97e6cc4387 generic: 6.6: mtk_eth_soc: add support for flow-control settings
Add patch implementing operations to get and set flow-control link
parameters of mtk_eth_soc via ethtool.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 4a2f712f85)
2024-07-10 14:57:37 +02:00
Daniel Golle
8c46dd1295 generic: 5.15: mtk_eth_soc: import accepted patches
Import patch accepted upstream.

Initial import:
 - net: ethernet: mtk_ppe: Change PPE entries number to 16K

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 27b6838afa)
2024-07-10 14:39:03 +02:00
Daniel Golle
93ce299d67 generic: 6.6: backport upstream commits for mtk_eth_soc
Backport commit for mtk_eth_soc:
 * net: ethernet: mtk_eth_soc: handle dma buffer size soc specific
   (torvalds/linux@c57e558194)

Refresh pending patches which require that.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 98ddfbc56a)
2024-07-10 14:09:19 +02:00
Rafał Miłecki
e4d4715929 kernel: backport mtd_wed/mtk_eth_soc patch for devices with more than 4GB of dram
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-07-10 13:31:53 +02:00
Daniel Golle
ca9b71c469 generic: move accepted patches for mtk_eth_soc to backport-5.15
In preparation to update mtk_eth_soc move accepted patches from mediatek
target to backport folder, so other patches on top can be applied more
easily.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 8730f9e536)
2024-07-10 13:31:49 +02:00
Christian Marangi
d53f1caeb0 image: exclude initramfs-images dependency with IB
Exclude initramfs-images dependency with IB as the target is not defined
in such context.

Fixes: cc6a0abcab ("image: make images and artifacts dependent of initramfs")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit e5d23b5aa5)
2024-07-09 04:50:08 +02:00
Christian Marangi
a812b70bf2 image: make images and artifacts dependent of initramfs
There is currently a BIG bug in how the images dependency is handled and
recent Per Device Rootfs made this more clear and less statistical.

There is currently no dependency between images/artifacts build with
initramfs build. This cause whatever additional image that depends on an
initramfs image to fail as it might happen that image and initramfs
build are called at the same time and the additional image is called
before initramfs build has finished.

Each image-command assume the source image to be taken from the /bin
directory but that is only copied from the /tmp directory only at the
end of the process.

Artifacts currently depends on image with the use of the
BOARD-NAME-images Makefile target, but this is not the case for
initramfs that also define a -images Makefile target but that is not
accounted in images (that might depend on some initramfs images)

To actually fix this, introduce a new Makefile target, -initramfs-images
and make image and artifacts build to depend on this. Since initramfs
images are optional, this dependency is actived only when initramfs
image are built.

With this change we correctly enforce the build order:
- Initramfs Images (optional)
- Images
- Artifacts

(cherry picked from commit cc6a0abcab)
[ rebased on openwrt-23.05 ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-07-09 04:49:11 +02:00
Stefan Weil
07742a7243 ramips: add Edimax BR-6208AC V2 support
Specifications:
- Device: Edimax BR-6208AC V2
- SoC: MT7620A
- Flash: 16 MiB
- RAM: 64 MiB
- Switch: 1 WAN, 3 LAN (10/100 Mbps)
- WiFi: MT7620 2.4 GHz + MT7610E 5 GHz
- LEDs: 1x POWER (green, not configurable)
        1x Firmware (green, configurable)
        1x Internet (green, configurable)
        1x VPN (green, configurable)
        1x 2.4G (green, not configurable)
        1x 5G (green, not configurable)

Normal installation:
- Upload the sysupgrade image via the default web interface

Installation with U-Boot and TFTP:
- Requires a TFTP server which provides the sysupgrade image
- Requires a connection to the serial port of the device, rate 57600

Signed-off-by: Stefan Weil <sw@weilnetz.de>
(cherry picked from commit 8d06bc1751)
2024-07-09 09:33:46 +02:00
Wenli Looi
29280638e8 ramips: add support for Netgear EAX12 series
Netgear EAX12, EAX11v2, EAX15v2 are wall-plug 802.11ax (Wi-Fi 6)
extenders that share the SoC, WiFi chip, and image format with the
WAX202.

Specifications:
* MT7621, 256 MiB RAM, 128 MiB NAND
* MT7915: 2.4/5 GHz 2x2 802.11ax (DBDC)
* Ethernet: 1 port 10/100/1000
* UART: 115200 baud (labeled on board)

All LEDs and buttons appear to work without state_default.

Installation:
* Flash the factory image through the stock web interface, or TFTP to
  the bootloader. NMRP can be used to TFTP without opening the case.

Revert to stock firmware:
* Flash the stock firmware to the bootloader using TFTP/NMRP.

References in GPL source:
https://www.downloads.netgear.com/files/GPL/EAX12_EAX11v2_EAX15v2_GPL_V1.0.3.34_src.tar.gz

* target/linux/ramips/dts/mt7621-rfb-ax-nand.dts
  DTS file for this device.

Signed-off-by: Wenli Looi <wlooi@ucalgary.ca>
(cherry picked from commit 32ea8a9a7e)
2024-07-09 09:33:37 +02:00
Arınç ÜNAL
b20da12eca ramips: add wan2 support for MQmaker WiTi
The PHY of the wan2 port on MQmaker WiTi is wired to the second MAC of the
SoC. Rename the wan interface to wan1 and define it under the switch node,
effectively disabling the PHY muxing of the MT7530 switch's phy4.

Define the PHY of the wan2 port and adjust the gmac1 node accordingly. Now
that the PHY muxing feature is not being used anymore, the wan2 port can be
used to achieve 2 Gbps total bandwidth to the CPU.

Tested-by: Demetris Ierokipides <ierokipides.dem@gmail.com>
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
(cherry picked from commit 8bf9a8a5e6)
2024-07-09 09:13:54 +02:00
Alexey Bartenev
e573b6b557 ramips: add support for D-Link DIR-806A B1 router
General specification:
SoC Type: MediaTek MT7620A (580MHz)
ROM: 8 MB SPI-NOR (MX25L6406E)
RAM: 64 MB DDR (W9751G6KB-25)
Switch: MediaTek MT7530
Ethernet: 5 ports - 5×100MbE (WAN, LAN1-4)
Wireless: 2.4 GHz (MediaTek RT5390): b/g/n
Wireless: 5 GHz (MediaTek MT7610EN): ac/n
Buttons: 2 button (POWER, WPS/RESET)
Bootloader: U-Boot 1.1.3
Power: 12 VDC, 0.5 A

MACs:
| LAN	| [Factory + 0x04] - 2		|
| WLAN 2.4g	| [Factory + 0x04] - 1		|
| WLAN 5g	| [Factory + 0x8004] - 3	|
| WAN	| [Factory + 0x04] - 2		|

OEM easy installation:

1. Use a PC to browse to http://192.168.0.1.
2. Go to the System section and open the Firmware Update section.
3. Under the Local Update at the right, click on the CHOOSE FILE...
4. When a modal window appears, choose the firmware file and click on
 the Open.
5. Next click on the UPDATE FIRMWARE button and upload the firmware image.
Wait for the router to flash and reboot.

OEM installation using the TFTP method (need level converter):

1. Download the latest firmware image.
2. Set up a Tftp server on a PC (e.g. Tftpd32) and place the firmware
 image to the root directory of the server.
3. Power off the router and use a twisted pair cable to connect the PC
 to any of the router's LAN ports.
4. Configure the network adapter of the PC to use IP address 192.168.0.180
 and subnet mask 255.255.255.0.
5. Connect serial port (57600 8N1) and turn on the router.
6. Then interrupt "U-Boot Boot Menu" by hitting 2 key (select "2: Load
 system code then write to Flash via TFTP.").
7. Press Y key when show "Warning!! Erase Linux in Flash then burn new
 one. Are you sure? (Y/N)"
Input device IP (192.168.0.1) ==:192.168.0.1
Input server IP (192.168.0.180) ==:192.168.0.180
Input Linux Kernel filename () ==:firmware_name
The router should download the firmware via TFTP and complete flashing in
 a few minutes.
After flashing is complete, use the PC to browse to http://192.168.1.1 or
 ssh to proceed with the configuration.

Signed-off-by: Alexey Bartenev <41exey@proton.me>
(cherry picked from commit ce998cb6e1)
2024-07-09 08:54:41 +02:00
Roland Reinl
6e51ff88b0 filogic: Add support for D-Link AQUILA PRO AI M30
Specification:
 - MT7981 CPU using 2.4GHz and 5GHz WiFi (both AX)
 - MT7531 switch
 - 512MB RAM
 - 128MB NAND flash with two UBI partitions with identical size
 - 1 multi color LED (red, green, blue, white) connected via GCA230718
 - 3 buttons (WPS, reset, LED on/off)
 - 1 1Gbit WAN port
 - 4 1Gbit LAN ports

Disassembly:
 - There are four screws at the bottom: 2 under the rubber feets, 2 under the label.
 - After removing the screws, the white plastic part can be shifted out of the blue part.
 - Be careful because the antennas are mounted on the side and the top of the white part.

Serial Interface
 - The serial interface can be connected to the 4 pin holes on the side of the board.
 - Pins (from front to rear):
   - 3.3V
   - RX
   - TX
   - GND
 - Settings: 115200, 8N1

MAC addresses:
 - WAN MAC is stored in partition "Odm" at offset 0x81
 - LAN (as printed on the device) is WAN MAC + 1
 - WLAN MAC (2.4 GHz) is WAN MAC + 2
 - WLAN MAC (5GHz) is WAN MAC + 3

Flashing via Recovery Web Interface:
 - The recovery web interface always flashes to the currently active partition.
 - If OpenWrt is flahsed to the second partition, it will not boot.
 - Ensure that you have an OEM image available (encrypted and decrypted version). Decryption is described in the end.
 - Set your IP address to 192.168.200.10, subnetmask 255.255.255.0
 - Press the reset button while powering on the device
 - Keep the reset button pressed until the LED blinks red
 - Open a Chromium based and goto http://192.168.200.1 (recovery web interface)
 - Download openwrt-mediatek-filogic-dlink_aquila-pro-ai-m30-a1-squashfs-recovery.bin
 - The recovery web interface always reports successful flashing, even if it fails
 - After flashing, the recovery web interface will try to forward the browser to 192.168.0.1 (can be ignored)
 - If OpenWrt was flashed to the first partition, OpenWrt will boot (The status LED will start blinking white and stay white in the end). In this case you're done and can use OpenWrt.
 - If OpenWrt was flashed to the second partition, OpenWrt won't boot (The status LED will stay red forever). In this case, the following steps are reuqired:
   - Start the web recovery interface again and flash the **decrypted OEM image**. This will be flashed to the second partition as well. The OEM firmware web interface is afterwards accessible via http://192.168.200.1.
   - Now flash the **encrypted OEM image** via OEM firmware web interface. In this case, the new firmware is flashed to the first partition. After flashing and the following reboot, the OEM firmware web interface should still be accessible via http://192.168.200.1.
   - Start the web recovery interface again and flash the OpenWrt recovery image. Now it will be flashed to the first partition, OpenWrt will boot correctly afterwards and is accessible via 192.168.1.1.

Flashing via U-Boot:
 - Open the case, connect to the UART console
 - Set your IP address to 192.168.200.2, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router
 - Run a tftp server which provides openwrt-mediatek-filogic-dlink_aquila-pro-ai-m30-a1-initramfs-kernel.bin.
 - Power on the device and select "7. Load image" in the U-Boot menu
 - Enter image file, tftp server IP and device IP (if they differ from the default).
 - TFTP download to RAM will start. After a few seconds OpenWrt initramfs should start
 - The initramfs is accessible via 192.168.1.1, change your IP address accordingly (or use multiple IP addresses on your interface)
 - Perform a sysupgrade using openwrt-mediatek-filogic-dlink_aquila-pro-ai-m30-a1-squashfs-sysupgrade.bin
 - Reboot the device. OpenWrt should start from flash now

Revert back to stock using the Recovery Web Interface:
 - Set your IP address to 192.168.200.2, subnetmask 255.255.255.0
 - Press the reset button while powering on the device
 - Keep the reset button pressed until the LED blinks red
 - Open a Chromium based and goto http://192.168.200.1 (recovery web interface)
 - Flash a decrypted firmware image from D-Link. Decrypting an firmware image is described below.

Decrypting a D-Link firmware image:
 - Download https://github.com/RolandoMagico/firmware-utils/blob/M32/src/m32-firmware-util.c
 - Compile a binary from the downloaded file, e.g. gcc m32-firmware-util.c -lcrypto -o m32-firmware-util
 - Run ./m32-firmware-util M30 --DecryptFactoryImage <OriginalFirmware> <OutputFile>
 - Example for firmware M30A1_FW101B05: ./m32-firmware-util M30 --DecryptFactoryImage M30A1_FW101B05\(0725091522\).bin M30A1_FW101B05\(0725091522\)_decrypted.bin

Flashing via OEM web interface is not possible, as it will change the active partition and OpenWrt is only running on the first UBI partition.

Controlling the LEDs:
 - The LEDs are controlled by a chip called "GCA230718" which is connected to the main CPU via I2C (address 0x40)
 - I didn't find any documentation or driver for it, so the information below is purely based on my investigations
 - If there is already I driver for it, please tell me. Maybe I didn't search enough
 - I implemented a kernel module (leds-gca230718) to access the LEDs via DTS
 - The LED controller supports PWM for brightness control and ramp control for smooth blinking. This is not implemented in the driver
 - The LED controller supports toggling (on -> off -> on -> off) where the brightness of the LEDs can be set individually for each on cycle
 - Until now, only simple active/inactive control is implemented (like when the LEDs would have been connected via GPIO)
 - Controlling the LEDs requires three sequences sent to the chip. Each sequence consists of
   - A reset command (0x81 0xE4) written to register 0x00
   - A control command (for example 0x0C 0x02 0x01 0x00 0x00 0x00 0xFF 0x01 0x00 0x00 0x00 0xFF 0x87 written to register 0x03)
 - The reset command is always the same
 - In the control command
   - byte 0 is always the same
   - byte 1 (0x02 in the example above) must be changed in every sequence: 0x02 -> 0x01 -> 0x03)
   - byte 2 is set to 0x01 which disables toggling. 0x02 would be LED toggling without ramp control, 0x03 would be toggling with ramp control
   - byte 3 to 6 define the brightness values for the LEDs (R,G,B,W) for the first on cycle when toggling
   - byte 7 defines the toggling frequency (if toggling enabled)
   - byte 8 to 11 define the brightness values for the LEDs (R,G,B,W) for the second on cycle when toggling
   - byte 12 is constant 0x87

Comparison to M32/R32:
 - The algorithms for decrypting the OEM firmware are the same for M30/M32/R32, only the keys differ
 - The keys are available in the GPL sources for the M32
 - The M32/R32 contained raw data in the firmware images (kernel, rootfs), the R30 uses a sysupgrade tar instead
 - Creation of the recovery image is quite similar, only the header start string changes. So mostly takeover from M32/R32 for that.
 - Turned out that the bytes at offset 0x0E and 0x0F in the recovery image header are the checksum over the data area
 - This checksum was not checked in the recovery web interface of M32/R32 devices, but is now active in R30
 - I adapted the recovery image creation to also calculate the checksum over the data area
 - The recovery image header for M30 contains addresses which don't match the memory layout in the DTS. The same addresses are also present in the OEM images
 - The recovery web interface either calculates the correct addresses from it or has it's own logic to determine where which information must be written

Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
(cherry picked from commit 29cca6cfee)
2024-07-08 23:06:38 +02:00
Roland Reinl
08f95e83e4 mediatek: Moved recovery image creation to include/image-commands.mk
The recovery image is reqired for D-Link M30 as well. So I moved it to include/image-commands.mk to be able to use it for MT7622 and filogic devices.

Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
(cherry picked from commit 0e2b7e3bd6)
2024-07-08 22:51:11 +02:00
Roland Reinl
c439003497 filogic: Add LED driver for GCA230718
Add basic support for the LED driver for GCA230718.

 - I didn't find any documentation or driver for it, so the information below is purely based on my investigations
 - If there is already I driver for it, please tell me. Maybe I didn't search enough
 - I implemented a kernel module (leds-gca230718) to access the LEDs via DTS
 - The LED controller supports PWM for brightness control and ramp control for smooth blinking. This is not implemented in the driver
 - The LED controller supports toggling (on -> off -> on -> off) where the brightness of the LEDs can be set individually for each on cycle
 - Until now, only simple active/inactive control is implemented (like when the LEDs would have been connected via GPIO)
 - Controlling the LEDs requires three sequences sent to the chip. Each sequence consists of
   - A reset command (0x81 0xE4) written to register 0x00
   - A control command (for example 0x0C 0x02 0x01 0x00 0x00 0x00 0xFF 0x01 0x00 0x00 0x00 0xFF 0x87 written to register 0x03)
 - The reset command is always the same
 - In the control command
   - byte 0 is always the same
   - byte 1 (0x02 in the example above) must be changed in every sequence: 0x02 -> 0x01 -> 0x03)
   - byte 2 is set to 0x01 which disables toggling. 0x02 would be LED toggling without ramp control, 0x03 would be toggling with ramp control
   - byte 3 to 6 define the brightness values for the LEDs (R,G,B,W) for the first on cycle when toggling
   - byte 7 defines the toggling frequency (if toggling enabled)
   - byte 8 to 11 define the brightness values for the LEDs (R,G,B,W) for the second on cycle when toggling
   - byte 12 is constant 0x87

Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
(cherry picked from commit 0682974aa8)
2024-07-08 22:51:11 +02:00
Daniel Golle
cb2cda24e7 mediatek: filogic: avoid sub-shell invovation in netdev rename loop
Rename network devices to their label set in DT without invocation of
a sub-shell.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 983222605c)
2024-07-08 22:49:34 +02:00
Bjørn Mork
1dd9f26183 mediatek: filogic: set wan label in preinit
Implement the functionality of
target/linux/ramips/patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch
in userspace, since the driver patch has been rejected as a generic solution:
https://github.com/openwrt/openwrt/pull/11435

Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit 1dd1ac2c35)
2024-07-08 22:49:34 +02:00
Hauke Mehrtens
7764d482d9 kernel: bump 5.15 to 5.15.162
Removed because they are upstream:
   mediatek/patches-5.15/702-v5.17-net-mdio-add-helpers-to-extract-clause-45-regad-and-.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=a03c3a34692f8400a85ec1cc2b058c6880bb7e7b

   realtek/patches-5.15/020-v5.17-net-mdio-add-helpers-to-extract-clause-45-regad-and-.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=a03c3a34692f8400a85ec1cc2b058c6880bb7e7b

Link: https://github.com/openwrt/openwrt/pull/15901
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:26:43 +02:00
Petr Štetiar
242f193f34 linux-firmware: package Intel AX201 firmware
Alexander reported following:

 iwlwifi 0000:00:14.3: Detected crf-id 0x3617, cnv-id 0x20000302 wfpm id 0x80000000
 iwlwifi 0000:00:14.3: PCI dev a0f0/0074, rev=0x351, rfid=0x10a100
 iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-QuZ-a0-hr-b0-77.ucode failed with error -2

It seems, that as of the current date, the highest firmware API version
supported by Linux 6.8-rc7 is still 77.

Closes: #14771
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 8db83d4cc0)
[Reduce to API version 72 for older mac80211]
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:27 +02:00
Jordan Woyak
7448f7a2d5 config: Enable ext4 journaling by default.
Not having a journal by default is a major "gotcha".

Because openwrt does not fsck on boot, a power loss without journaling
can result in a dirty filesystem that openwrt will mount as read-only
which requires intervention to restore the router to working order.

Signed-off-by: Jordan Woyak <jordan.woyak@gmail.com>
(cherry picked from commit f9f2426e39)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:27 +02:00
Felix Fietkau
7d135dc038 libxml2: add host build dependency on libiconv-full
Fixes build on macOS

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 4ef13c4a49)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:26 +02:00
Felix Fietkau
d0c7b19db8 hostapd: fix a crash corner case
On some setup failures, iface->bss can be NULL

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 1ee5b7e506)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:26 +02:00
Hauke Mehrtens
dee4309bdf mbedtls: Update to 2.28.8
This contains a fix for:
CVE-2024-28960: An issue was discovered in Mbed TLS 2.18.0 through 2.28.x
before 2.28.8 and 3.x before 3.6.0, and Mbed Crypto. The PSA Crypto
API mishandles shared memory.

(cherry picked from commit 360ac07eb9)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:26 +02:00
Hauke Mehrtens
3941633dd7 uencrypt: Fix compile warnings
keylen and ivlen are of type long and not size_t.

(cherry picked from commit 0fd9acb471)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:26 +02:00
Thomas Winkler
ccac75a37f base-files: fix uid/gid auto-enumeration to avoid 16-bit limit
uid/gid range should be limited to 16bit unsigned integer range to
avoid "wraparound" issues with permissions where jffs2
is employed for storage and chown 65536 (first auto-created user)
becomes equivalent to chown 0

Fixes: #13927

Signed-off-by: Thomas Winkler <tewinkler86@gmail.com>
(cherry picked from commit 140b48a9e9)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:26 +02:00
Rui Salvaterra
add63dd508 linux-firmware: realtek: update rtl8821ae firmware
A newer version, rtl8821aefw_29.bin, has been available for over 7 years [1].
Let's use it.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=f70e4df2b384d21e36a7c30a591639592692e0ec

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
(cherry picked from commit 2b8e875a85)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:26 +02:00
Sahil Dhiman
4df592f7a3 scripts: Add GNU ftp mirror redirector for GNU and Savannah
Add GNU's redirector which automatically redirect user to nearby online
mirror.

Signed-off-by: Sahil Dhiman <sahil@hopbox.in>
Link: https://github.com/openwrt/openwrt/pull/15557
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 6510eb3b5d)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:26 +02:00
Hauke Mehrtens
5a4231814b tegra: Activate CONFIG_SND_DRIVERS
The option CONFIG_SND_DRIVERS is activated by default in the generic
configuration, do not deactivate it for tegra. This fixes the build of
the kmod-sound-dummy package on tegra.

(cherry picked from commit 21213c8156)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:26 +02:00
Qingfang Deng
04b0f1e7f1 config: kernel: remove KASAN_EXTRA
The option has been removed from the kernel since 5.1.

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
(cherry picked from commit 60ea3d6d46)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:26 +02:00
Daniel Golle
9f3f5cff30 mt76: mt7996: select required kernel and hostap options
Select DRIVER_11AX_SUPPORT and KERNEL_RELAY also for kmod-mt7996 to
prevent build failure if only this driver is selected during build and
end up with (most) required hostap features (IEEE 802.11be rates are not
yet supported).

Reported-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 83311b7470)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:26 +02:00
Christian Lamparter
0fb2ee44f9 firmware: intel-microcode: update to 20240531
Debian changelog:

intel-microcode (3.20240531.1) unstable; urgency=medium

  * New upstream microcode datafile 20240531
    * Fix unspecified functional issues on Pentium Silver N/J5xxx,
      Celeron N/J4xxx
    * Updated Microcodes:
      sig 0x000706a1, pf_mask 0x01, 2024-04-19, rev 0x0042, size 76800
  * source: update symlinks to reflect id of the latest release, 20240531

 -- Henrique de Moraes Holschuh <hmh@debian.org>  Sat, 01 Jun 2024 11:49:47 -0300

intel-microcode (3.20240514.1) unstable; urgency=medium

  * New upstream microcode datafile 20240514
    * Mitigations for INTEL-SA-01051 (CVE-2023-45733)
      Hardware logic contains race conditions in some Intel Processors may
      allow an authenticated user to potentially enable partial information
      disclosure via local access.
    * Mitigations for INTEL-SA-01052 (CVE-2023-46103)
      Sequence of processor instructions leads to unexpected behavior in
      Intel Core Ultra Processors may allow an authenticated user to
      potentially enable denial of service via local access.
    * Mitigations for INTEL-SA-01036 (CVE-2023-45745,  CVE-2023-47855)
      Improper input validation in some Intel TDX module software before
      version 1.5.05.46.698 may allow a privileged user to potentially enable
      escalation of privilege via local access.
    * Fix for unspecified functional issues on 4th gen and 5th gen Xeon
      Scalable, 12th, 13th and 14th gen Intel Core processors, as well as for
      Core i3 N-series processors.
    * Updated microcodes:
      sig 0x000806f8, pf_mask 0x87, 2024-02-05, rev 0x2b0005c0, size 581632
      sig 0x000806f7, pf_mask 0x87, 2024-02-05, rev 0x2b0005c0
      sig 0x000806f6, pf_mask 0x87, 2024-02-05, rev 0x2b0005c0
      sig 0x000806f5, pf_mask 0x87, 2024-02-05, rev 0x2b0005c0
      sig 0x000806f4, pf_mask 0x87, 2024-02-05, rev 0x2b0005c0
      sig 0x000806f8, pf_mask 0x10, 2024-02-05, rev 0x2c000390, size 614400
      sig 0x000806f6, pf_mask 0x10, 2024-02-05, rev 0x2c000390
      sig 0x000806f5, pf_mask 0x10, 2024-02-05, rev 0x2c000390
      sig 0x000806f4, pf_mask 0x10, 2024-02-05, rev 0x2c000390
      sig 0x00090672, pf_mask 0x07, 2023-12-05, rev 0x0035, size 224256
      sig 0x00090675, pf_mask 0x07, 2023-12-05, rev 0x0035
      sig 0x000b06f2, pf_mask 0x07, 2023-12-05, rev 0x0035
      sig 0x000b06f5, pf_mask 0x07, 2023-12-05, rev 0x0035
      sig 0x000906a3, pf_mask 0x80, 2023-12-05, rev 0x0433, size 222208
      sig 0x000906a4, pf_mask 0x80, 2023-12-05, rev 0x0433
      sig 0x000906a4, pf_mask 0x40, 2023-12-07, rev 0x0007, size 119808
      sig 0x000b0671, pf_mask 0x32, 2024-01-25, rev 0x0123, size 215040
      sig 0x000b06e0, pf_mask 0x11, 2023-12-07, rev 0x0017, size 138240
      sig 0x000c06f2, pf_mask 0x87, 2024-02-05, rev 0x21000230, size 552960
      sig 0x000c06f1, pf_mask 0x87, 2024-02-05, rev 0x21000230
  * source: update symlinks to reflect id of the latest release, 20240514

 -- Henrique de Moraes Holschuh <hmh@debian.org>  Thu, 16 May 2024 21:40:52 -0300

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit 7d9b9762c9)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:25 +02:00
Rosen Penev
6928faa350 tools/sparse: fix compilation with GCC14
Upstream backport.

Get rid of PKG_RELEASE as it's irrelevant to tools.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 253d777c96)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:25 +02:00
Christian Marangi
f8690ca0db scripts/ext-toolchain: add missing libc library specs
Add missing libc library spec that weren't added to the ext-toolchain
script when the library were introduced in the packages libs toolchain
Makefile.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 8cad52a267)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:25 +02:00
Felix Fietkau
287e2565e2 hostapd: fix crash on interface setup failure
Add a missing NULL pointer check when deleting beacons

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 3984fb0582)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:25 +02:00
Felix Fietkau
80a36594f9 hostapd: use strdup on string passed to hostapd_add_iface
The data is modified within hostapd_add_iface

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 032d3fcf7a)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:25 +02:00
Nathaniel Wesley Filardo
aa27bd7087 kernel: crypto: remove FCRYPT from miscellany
It has its own dedicated knob

Signed-off-by: Nathaniel Wesley Filardo <nwfilardo@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15761
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 7d71c03ab1)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:25 +02:00
Hauke Mehrtens
ffe97a61fc kernel: Add kmod-mfd
Package the mfd-core.ko kernel module. It is selected by the
kmod-hwmon-gsc already.

Link: https://github.com/openwrt/openwrt/pull/15833
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 8b4fd1c0de)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:25 +02:00
Hauke Mehrtens
9bf10898ba kernel: Add kmod-crypto-xxhash
kxxhash_generic.ko is a soft dependency of kmod-fs-btrfs, but we did not
package it. Extract the kmod-lib-xxhash and then package
xxhash_generic.ko.

Link: https://github.com/openwrt/openwrt/pull/15833
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 2ebeda0294)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:25 +02:00
Hauke Mehrtens
03299b3b52 kernel: Add kmod-crypto-blake2b
The kmod-fs-btrfs package has a soft dependency to kmod-crypto-blake2b

The CONFIG_BTRFS_FS kernel build option selects CONFIG_CRYPTO_BLAKE2B,
but we did not package it before.

Link: https://github.com/openwrt/openwrt/pull/15833
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit f89091bba6)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:25 +02:00
Hauke Mehrtens
7f833b8180 kernel: Fix kmod-lib-lz4 packaging
The kernel provides two variants of the lz4 compression a normal version
and a high compression mode version. The old kmod-lib-lz4 package
contained the normal version plus one part of the lz4hc version. There
was already code which selected the kmod-lib-lz4hc package which did
not exists.

I split this into 3 packages. kmod-lib-lz4 and kmod-lib-lz4hc for the
normal the and high compression algorithm which contain the specific
code and the kmod-lib-lz4-decompress which contains the common
decompressor.

New we are also packaging lz4hc.ko

Link: https://github.com/openwrt/openwrt/pull/15833
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit fac507606d)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:24 +02:00
Hauke Mehrtens
1f701c9b04 kernel: Extract kmod-nf-dup-inet
The nf_dup_ipv4.ko and nf_dup_ipv6.ko kernel module were packaged by
kmod-ipt-tee and kmod-nft-dup-inet at the same time. Extract them into a
separate package used by both.

Link: https://github.com/openwrt/openwrt/pull/15833
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit b0953c4fbf)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:24 +02:00
Paweł Owoc
e82759fd67 mac80211: add missing config for third 160MHz width for 5GHz radio
Without this configuration it is not possible to run the radio using HE160 on channels 149-177.

Fixes: #14906
Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
(cherry picked from commit a91b79fd04)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:24 +02:00
Felix Fietkau
c145f0f8f6 mac80211: add fix for receiving STP frames on mesh
Fix length in ethernet header

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 8f7be2a2ba)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:24 +02:00
Oldřich Jedlička
bed2272605 mac80211: fix flush during station removal
This fixes WARN_ONs when using AP_VLANs after station removal. The flush
call passed AP_VLAN vif to driver, but because these vifs are virtual and
not registered with drivers, we need to translate to the correct AP vif
first.

Fixes: openwrt#12420
Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
[Rename to 360-wifi-mac80211-do-not-pass-ap_vlan-vif-pointer-to-dri.patch]
(cherry picked from commit 3e738781a9)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:24 +02:00
David Bauer
feb5b072ef mediatek: add missing SPDX header
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 36f7ececc2)
2024-07-08 12:33:11 +02:00
Chukun Pan
5632227f44 mediatek: filogic: add Netcore N60 support
Hardware specification:
  SoC: MediaTek MT7986A 4x A53
  Flash: ESMT F50L1G41LB 128MB
  RAM: W632GU6NB DDR3 256MB
  Ethernet: 1x 2.5G + 4x 1G
  WiFi1: MT7975N 2.4GHz 4T4R
  WiFi2: MT7975PN 5GHz 4T4R
  Button: Reset, WPS
  Power: DC 12V 2A

Flash instructions:
  1. Connect to the router using ssh or telnet,
     username: useradmin, password is the web
     login password of the router.
  2. Use scp to upload bl31-uboot.fip and flash:
     "mtd write xxx-preloader.bin spi0.0"
     "mtd write xxx-bl31-uboot.fip FIP"
     "mtd erase ubi"
  3. Connect to the router via the Lan port,
     set a static ip of your PC.
     (ip 192.168.1.254, gateway 192.168.1.1)
  4. Download initramfs image, reboot router,
     waiting for tftp recovery to complete.
  5. After openwrt boots up, perform sysupgrade.

Note:
  1. Back up all mtd partitions before flashing.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from commit 4ae474afbd)
2024-07-08 12:00:39 +02:00
Chukun Pan
7bfdc4ea3a uboot-mediatek: add Netcore N60 support
The vendor uboot requires special fit verification.
So add a custom uboot build for this device.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from commit 0170666d89)
2024-07-08 12:00:39 +02:00
Tianling Shen
2a25de25fa mediatek: add support for JDCloud RE-CP-03
Hardware specification:
  SoC: MediaTek MT7986A 4x A53
  Flash: 128GB eMMC
  RAM: 1GB DDR4
  Ethernet: 4x 1GbE, 1x 2.5GbE (RTL8221B)
  Switch: MediaTek MT7531AE
  WiFi: MediaTek MT7976C
  Button: Reset, Joylink
  Power: DC 12V 2A

Flash instructions:
1. Download and flash the vendor migration firmware via webUI:
   https://firmware.download.immortalwrt.eu.org/cnsztl/mediatek/filogic/openwrt-mediatek-mt7986-jdcloud_re-cp-03-vendor-migration.bin
   (Default address is 192.168.68.1, user root, no password)
2. After device has booted up, write new GPT table:
   dd if=openwrt-mediatek-filogic-jdcloud_re-cp-03-gpt.bin of=/dev/mmcblk0 bs=512 seek=0 count=34 conv=fsync
3. Erase and write new BL2:
   echo 0 > /sys/block/mmcblk0boot0/force_ro
   dd if=/dev/zero of=/dev/mmcblk0boot0 bs=512 count=8192 conv=fsync
   dd if=openwrt-mediatek-filogic-jdcloud_re-cp-03-preloader.bin of=/dev/mmcblk0boot0 bs=512 conv=fsync
4. Erase and write new FIP:
   dd if=/dev/zero of=/dev/mmcblk0 bs=512 seek=13312 count=8192 conv=fsync
   dd if=openwrt-mediatek-filogic-jdcloud_re-cp-03-bl31-uboot.fip of=/dev/mmcblk0 bs=512 seek=13312 conv=fsync
5. Set static IP on your PC:
   IP 192.168.1.254/24, GW 192.168.1.1
6. Serve OpenWrt initramfs image using TFTP server.
7. Cut off the power and re-engage, wait for TFTP recovery to complete.
8. After OpenWrt has booted, perform sysupgrade.
9. Additionally, if you want to have eMMC recovery boot feature:
     (Don't worry! You will always have TFTP recovery boot feature.)
   dd if=openwrt-mediatek-filogic-jdcloud_re-cp-03-initramfs-recovery.itb of=/dev/mmcblk0p4 bs=512 conv=fsync

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit c0c3234e17)
2024-07-08 09:08:48 +02:00
Tianling Shen
b67b3a6ce6 uboot-mediatek: add support for JDCloud RE-CP-03
The vendor U-Boot has enabled signature verification, so add
a custom U-Boot build for OpenWrt.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 6fa4fbbc52)
2024-07-08 09:08:15 +02:00
Luis Mita
3fcf619e76 ramips: mt76x8: sync Cudy TR1200 v1 naming
Cudy assigns hardware versions to its devices on its website, and
the Cudy TR1200 router is now Cudy TR1200 v1.
OpenWrt currently uses both variants, and this commit removes
inconsistencies using only the new name.

Signed-off-by: Luis Mita <luis@luismita.com>
(cherry picked from commit d780d530dd)
Link: https://github.com/openwrt/openwrt/pull/15875
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-07 23:53:30 +02:00
Luis Mita
7be58ccacc ramips: mt76x8: add support for Cudy TR1200 v1
Hardware:
 - SoC: MediaTek MT7628AN (MIPS 580MHz)
 - Flash: 16 MiB XMC 25QH128CH10
 - RAM: 128 MiB ESMT M14D1G1664A
 - WLAN: 2.4 GHz (MT7628), 5 GHz (MT7613BEN 802.11ac)
 - Ethernet: 1x 10/100 Mbps WAN, 1x 10/100 LAN (MT7628)
 - USB 2.0 port
 - Buttons: 1 Reset button, 1 slider button
 - LEDs: 1x Red, 1x White
 - Serial console: unpopulated header, 115200 8n1
 - Power: 5 VDC, 2 A

MAC addresses:
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| WAN     | 80:af:ca:xx:xx:x0 | label     |
| LAN     | 80:af:ca:xx:xx:x0 | label     |
| WLAN 2g | 80:af:ca:xx:xx:x0 | label     |
| WLAN 5g | 80:af:ca:xx:xx:x2 | label+2   |
+---------+-------------------+-----------+

Installation:
The installation must be done via TFTP by disassembling the router.
On other occasions Cudy has distributed intermediate firmware to make
installation easier, and so I recommend checking the Wiki for this
device if there is a more convenient solution than the one below.

To install using TFTP:
1. Upgrade to a beta firmware (signed by Cudy) that can be downloaded
from the wiki. This is required in order to use an unlocked u-boot.
2. Connect to UART.
3. While the router is turning on, press 1.
4. Connect to LAN and set your IP to 192.168.1.88/24. Configure a TFTP
server and an OpenWrt initramfs-kernel.bin firmware file as recovery.bin.
5. Press Enter three times. Verify the filename.
6. If you can reach LuCI or SSH now, just use the sysupgrade image with
the 'Keep settings' option turned off.

If you don't want to use the beta firmware nor the unlocked u-boot, you
can install the firmware writing the sysupgrade image on the firmware
partition of the SPI flash.

Signed-off-by: Luis Mita <luis@luismita.com>
(cherry picked from commit f1091ef7ac)
Link: https://github.com/openwrt/openwrt/pull/15875
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-07 23:53:30 +02:00
Hauke Mehrtens
e1eac53f74 mt76: Fix PKG_MIRROR_HASH
The PKG_MIRROR_HASH was updated to a wrong version.

Fixes: f64576f367 ("mt76: update to Git HEAD (2024-04-03)")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-07 21:56:12 +02:00
Hauke Mehrtens
323e249ce8 mac80211: Update to version 6.1.97-1
This updates mac80211 to version 6.1.97-1. This code is based on Linux
6.1.97 and contains all fixes included in the upstream wireless
subsystem from that kernel version. This includes many bugfixes and also
some security fixes.

The removed patches are already integrated in upstream Linux 6.1.97 or
in backports.

The following patches were integrated in upstream Linux:
   ath11k/0013-wifi-ath11k-synchronize-ath11k_mac_he_gi_to_nl80211_.patch
   ath11k/0035-wifi-ath11k-Use-platform_get_irq-to-get-the-interrup.patch
   ath11k/0036-wifi-ath11k-fix-SAC-bug-on-peer-addition-with-sta-ba.patch
   ath11k/0047-wifi-ath11k-fix-deinitialization-of-firmware-resourc.patch
   ath11k/0053-wifi-ath11k-fix-writing-to-unintended-memory-region.patch
   ath11k/0060-wifi-ath11k-Ignore-frags-from-uninitialized-peer-in-.patch
   ath11k/0065-wifi-ath11k-fix-tx-status-reporting-in-encap-offload.patch
   ath11k/0067-wifi-ath11k-Fix-SKB-corruption-in-REO-destination-ri.patch
   ath11k/0069-wifi-ath11k-fix-registration-of-6Ghz-only-phy-withou.patch
   ath11k/0080-wifi-ath11k-add-support-default-regdb-while-searchin.patch
   ath11k/0085-wifi-ath11k-fix-memory-leak-in-WMI-firmware-stats.patch
   ath11k/0086-wifi-ath11k-Add-missing-check-for-ioremap.patch
   ath11k/0096-wifi-ath11k-fix-boot-failure-with-one-MSI-vector.patch
   subsys/337-wifi-mac80211-fix-race-condition-on-enabling-fast-xm.patch

The following patches were integrated in upstream backports:
   ath11k/901-wifi-ath11k-pci-fix-compilation-in-5.16-and-older.patch
   build/080-resv_start_op.patch
   build/110-backport_napi_build_skb.patch

The following files are missing in backports, we do not have to remove
them any more. Some were already missing before some were removed in
this update:
   include/linux/cordic.h
   include/linux/crc8.h
   include/linux/eeprom_93cx6.h
   include/linux/wl12xx.h
   include/net/ieee80211.h
   backport-include/linux/bcm47xx_nvram.h
   include/linux/ath9k_platform.h
   include/net/bluetooth/

backports ships a dummy Mediatek wed header for older kernel versions.
We backported the feature in our kernel, remove the dummy header:
   backport-include/linux/soc/mediatek/mtk_wed.h

Remove header files for subsystems used form the mainline kernel:
   include/trace/events/qrtr.h
   include/net/rsi_91x.h
   backport-include/linux/platform_data/brcmnand.h

Link: https://github.com/openwrt/openwrt/pull/15827
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-07 18:30:37 +02:00
Hauke Mehrtens
e0837a1257 iw: sync nl80211.h
Update the nl80211.h file in iw with the version from backports.

The files were out of sync already before the mac80211 update. If iw set
the NL80211_ATTR_WIPHY_ANTENNA_GAIN attribute the kernel assumed it set
the NL80211_ATTR_PUNCT_BITMAP attribute because the id was the same.

Link: https://github.com/openwrt/openwrt/pull/15827
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-07 18:30:37 +02:00
Tianling Shen
472770b5cb Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-07 20:04:25 +08:00
Lu jicong
4c03fe22b7 target.mk: fix arm architecture level detection
Now kernel configs of armv6k CPUs don't include CONFIG_CPU_V6.
So armv6k CPUs cannot be detected as arm_v6.
Fix this by adding detection for CONFIG_CPU_V6K.

Signed-off-by: Lu jicong <jiconglu58@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15855
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit d55083fbca)
2024-07-07 13:56:14 +02:00
Mathew McBride
2a099d36a7 armsr: add realtek and smsc ethernet phy drivers to the default image
This adds two more common PHY brands to the image.
Realtek is used on the Google Coral "Phanbell" board (i.MX8MQ).
SMSC has been used on various Raspberry Pi boards.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit bcbdde00c3)
Link: https://github.com/openwrt/openwrt/pull/15808
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:37:39 +02:00
Mathew McBride
7a4f468d07 armsr: enable framebuffer emulation for virtio-gpu/drm displays
This was discovered when trying to run OpenWrt on Hetzner Cloud's
Arm-based instances.

Hetzner uses QEMU/KVM with virtio-gpu as the main display device,
together with an ACPI firmware. This was not displaying a console
previously.

This setup can be emulated by qemu using options below:
qemu-system-aarch64 \
    -machine virt \
    -bios QEMU_EFI.fd \
    -device virtio-gpu \
    -usb \
    -device qemu-xhci,id=xhci \
    -device usb-tablet,bus=xhci.0 \
    -device usb-kbd,bus=xhci.0 \
    -vnc :0

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit ea7383e721)
Link: https://github.com/openwrt/openwrt/pull/15808
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:37:39 +02:00
John Vincent
299893c9c9 kernel: armsr: Renesas: RZ: Ethernet module and ttySC0
Ethernet module enable for Renesas RZ platform
inittab fix for ttySC0

Fixes: #15284
Signed-off-by: John Vincent <john.vincent.xa@bp.renesas.com>
(cherry picked from commit 531b3f667c)
Link: https://github.com/openwrt/openwrt/pull/15808
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:37:39 +02:00
Mathew McBride
be4d0d0cd6 armsr: armv8: enable serial console for Renesas platforms
Support for Renesas Arm families was added in commit 1ff4f4df23
("armsr: armv8: enable CONFIG_ARCH_RENESAS"), but this did not
enable the console/tty hardware for these SoCs, which is derived
from the SuperH family (CONFIG_SERIAL_SH_SCI).

Link: https://github.com/openwrt/openwrt/issues/15284
Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 683355d0a6)
Link: https://github.com/openwrt/openwrt/pull/15808
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:37:39 +02:00
Roland Reinl
d0744c1f66 mediatek: Add support for D-Link EAGLE PRO AI R32
R32 is like the M32 part of the EAGLE PRO AI series from D-Link.

Specification:
 - MT7622BV SoC with 2.4GHz wifi
 - MT7975AN + MT7915AN for 5GHz
 - MT7531BE Switch
 - 512MB RAM
 - 128 MB flash
 - 2 LEDs (Status and Internet, both can be either orange or white)
 - 2 buttons (WPS and Reset)

Compared to M32, the R32 has the following differences:
 - 4 LAN ports instead of 2
 - The recory image starts with DLK6E6015001 instaed of DLK6E6010001
 - Individual LEDs for power and internet
 - MAC address is stored at another offset in the ODM partition

MAC addresses:
 - WAN MAC is stored in partition "Odm" at offset 0x81
 - LAN (as printed on the device) is WAN MAC + 1
 - WLAN MAC (2.4 GHz) is WAN MAC + 2
 - WLAN MAC (5GHz) is WAN MAC + 3

Flashing via Recovery Web Interface:
 - Set your IP address to 192.168.0.10, subnetmask 255.255.255.0
 - Press the reset button while powering on the deivce
 - Keep the reset button pressed until the internet LED blinks fast
 - Open a Chromium based and goto http://192.168.0.1
 - Download openwrt-mediatek-mt7622-dlink_eagle-pro-ai-r32-a1-squashfs-recovery.bin

Flashing via uBoot:
 - Open the case, connect to the UART console
 - Set your IP address to 10.10.10.3, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router
 - Run a tftp server which provides openwrt-mediatek-mt7622-dlink_eagle-pro-ai-r32-initramfs-kernel.bin.
 - You can rename the file to iverson_uImage (no extension), then you don't have to enter the whole file name in uboot later.
 - Power on the device and select "1. System Load Linux to SDRAM via TFTP." in the boot menu
 - Enter image file, tftp server IP and device IP (if they differ from the default).
 - TFTP download to RAM will start. After a few seconds OpenWrt initramfs should start
 - The initramfs is accessible via 192.168.1.1, change your IP address accordingly (or use multiple IP addresses on your interface)
 - Create a backup of the Kernel1 partition, this file is required if a revert to stock should be done later
 - Perform a sysupgrade using openwrt-mediatek-mt7622-dlink_eagle-pro-ai-r32-squashfs-sysupgrade.bin
 - Reboot the device. OpenWrt should start from flash now

Revert back to stock using the Recovery Web Interface:
 - Set your IP address to 192.168.0.10, subnetmask 255.255.255.0
 - Press the reset button while powering on the deivce
 - Keep the reset button pressed until the internet LED blinks fast
 - Open a Chromium based and goto http://192.168.0.1
 - Flash a decrypted firmware image from D-Link. Decrypting an firmware image is described below.

Decrypting a D-Link firmware image:
 - Download https://github.com/RolandoMagico/firmware-utils/blob/M32/src/m32-firmware-util.c
 - Compile a binary from the downloaded file, e.g. gcc m32-firmware-util.c -lcrypto -o m32-firmware-util
 - Run ./m32-firmware-util R32 --DecryptFactoryImage <OriginalFirmware> <OutputFile>
 - Example for firmware R32A1_FW103B01: ./m32-firmware-util R32 --DecryptFactoryImage R32A1_FW103B01.bin R32A1_FW103B01.decrypted.bin

Revert back to stock using uBoot:
 - Open the case, connect to the UART console
 - Set your IP address to 10.10.10.3, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router
 - Run a tftp server which provides the previously created backup of the Kernel1 partition.
 - You can rename the file to iverson_uImage (no extension), then you don't have to enter the whole file name in uboot later.
 - Power on the device and select "2. System Load Linux Kernel then write to Flash via TFTP." in the boot menu
 - Enter image file, tftp server IP and device IP (if they differ from the default).
 - TFTP download to FLASH will start. After a few seconds the stock firmware should start again

There is also an image openwrt-mediatek-mt7622-dlink_eagle-pro-ai-r32-a1-squashfs-tftp.bin which can directly be flashed via U-Boot and TFTP.
It can be used if no backup of the Kernel1 partition is reuqired.

Flahsing via OEM web interface is currently not possible, the OEM images are encrypted. Creating images is only possible manually at the moment.
The support for the M32/R32 already includes support for flashing from the OEM web interface:
 - The device tree contains both partitions (Kernel1 and Kernel2) with conditions to select the correct one based on the kernel command line
 - The U-Boot variable "boot_part" is set accordingly during startup to finish the partition swap after flashing from the OEM web interface
 - OpenWrt sysupgrade flashing always uses the partition where it was initially flashed to (no partition swap)

Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
(cherry picked from commit fdb87a91b4)
Link: https://github.com/openwrt/openwrt/pull/15776
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:32:57 +02:00
Fabrice Fontaine
95fac7d0e4 package/utils/secilc: drop PKG_CPE_ID
cpe:/a:selinuxproject:secilc is not a correct CPE ID for secilc:
https://nvd.nist.gov/products/cpe/search/results?keyword=cpe:2.3:a:selinuxproject:secilc

Fixes: 9ee7c1ec60 (secilc: adds new package)

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15298
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 58a5877846)
Link: https://github.com/openwrt/openwrt/pull/15881
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:31:14 +02:00
Fabrice Fontaine
16601bbd42 package/network/utils/iptables: fix PKG_CPE_ID
cpe:/a:netfilter:iptables is the correct CPE ID for iptables:
https://nvd.nist.gov/products/cpe/search/results?keyword=cpe:2.3:a:netfilter:iptables

Fixes: c61a239514 (add PKG_CPE_ID ids to package and tools)

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15297
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 6e5edec159)
Link: https://github.com/openwrt/openwrt/pull/15881
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:31:14 +02:00
Fabrice Fontaine
8c20083c1d package/libs/libjson-c: fix PKG_CPE_ID
cpe:/a:json-c:json-c is the correct CPE ID for libjson-c:
https://nvd.nist.gov/products/cpe/search/results?keyword=cpe:2.3:a:json-c:json-c

Fixes: c61a239514 (add PKG_CPE_ID ids to package and tools)

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15292
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit a4f723e04e)
Link: https://github.com/openwrt/openwrt/pull/15881
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:31:14 +02:00
Fabrice Fontaine
6ea9cf3203 package/network/services/dropbear: fix PKG_CPE_ID
cpe:/a:dropbear_ssh_project:dropbear_ssh is the correct CPE ID for dropbear:
https://nvd.nist.gov/products/cpe/search/results?keyword=cpe:2.3:a:dropbear_ssh_project:dropbear_ssh

Fixes: c61a239514 (add PKG_CPE_ID ids to package and tools)

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15290
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 289f811abb)
Link: https://github.com/openwrt/openwrt/pull/15881
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:31:14 +02:00
Fabrice Fontaine
6b39170c90 toolchain/nasm: fix PKG_CPE_ID
cpe:/a:nasm:netwide_assembler is the correct CPE ID for nasm:
https://nvd.nist.gov/products/cpe/search/results?keyword=cpe:2.3:a:nasm:netwide_assembler

Fixes: bcf02c5d31 (toolchain: assign PKG_CPE_ID)

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
(cherry picked from commit e1ca08518e)
Link: https://github.com/openwrt/openwrt/pull/15881
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:31:14 +02:00
Fabrice Fontaine
11b8b62fd8 tools/flex: fix PKG_CPE_ID
cpe:/a:westes:flex is the correct CPE ID for flex:
https://nvd.nist.gov/products/cpe/search/results?keyword=cpe:2.3:a:westes:flex

Fixes: c61a239514 (add PKG_CPE_ID ids to package and tools)

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
(cherry picked from commit 832460b452)
Link: https://github.com/openwrt/openwrt/pull/15881
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:31:14 +02:00
Fabrice Fontaine
c587573710 tools/zlib: fix PKG_CPE_ID
cpe:/a:zlib:zlib is the correct CPE ID for zlib:
https://nvd.nist.gov/products/cpe/search/results?keyword=cpe:2.3:a:zlib:zlib

Fixes: c61a239514 (add PKG_CPE_ID ids to package and tools)

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
(cherry picked from commit e9ecaade6f)
Link: https://github.com/openwrt/openwrt/pull/15881
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:31:14 +02:00
Fabrice Fontaine
b110c337d3 package/libs/pcre2: fix PKG_CPE_ID
cpe:/a:pcre:pcre2 is the correct CPE ID for pcre2:
https://nvd.nist.gov/products/cpe/search/results?keyword=cpe:2.3:a:pcre:pcre2

Fixes: c39b0646f3 (pcre2: import pcre2 from packages feed)

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
(cherry picked from commit 27d1ebb46a)
Link: https://github.com/openwrt/openwrt/pull/15881
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:31:14 +02:00
Sean Khan
318db3bde4 openssl: conditionally disable engine section
Currently, the build option to enable/disable engine support isn't
reflected in the final '/etc/ssl/openssl.cnf' config. It assumes `engines`
is always enabled, producing an error whenever running any
commands in openssl util or programs that explicitly use settings
from '/etc/ssl/openssl.cnf'.

```
➤ openssl version
FATAL: Startup failure (dev note: apps_startup()) for openssl
307D1EA97F000000:error:12800067:lib(37):dlfcn_load:reason(103):crypto/dso/dso_dlfcn.c:118:filename(libengines.so):
Error loading shared library libengines.so: No such file or directory
307D1EA97F000000:error:12800067:lib(37):DSO_load:reason(103):crypto/dso/dso_lib.c:152:
307D1EA97F000000:error:0700006E:lib(14):module_load_dso:reason(110):crypto/conf/conf_mod.c:321:module=engines, path=engines
307D1EA97F000000:error:07000071:lib(14):module_run:reason(113):crypto/conf/conf_mod.c:266:module=engines
```

Build should check for the `CONFIG_OPENSSL_ENGINE` option, and comment out `engines`
if not explicitly enabled.

Example:
```
[openssl_init]
providers = provider_sect
```

After this change, openssl util works correctly.

```
➤ openssl version
OpenSSL 3.0.14 4 Jun 2024 (Library: OpenSSL 3.0.14 4 Jun 2024)
```

Signed-off-by: Sean Khan <datapronix@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/15661
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 31ec4515c3)
Link: https://github.com/openwrt/openwrt/pull/15873
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:29:23 +02:00
John Audia
4aabbd6746 openssl: update to 3.0.14
Major changes between OpenSSL 3.0.13 and OpenSSL 3.0.14 [04-Jun-2024]

* Fixed potential use after free after SSL_free_buffers() is called.
  [CVE-2024-4741]
* Fixed checking excessively long DSA keys or parameters may be very slow.
  [CVE-2024-4603]
* Fixed an issue where some non-default TLS server configurations can cause
  unbounded memory growth when processing TLSv1.3 sessions. An attacker may
  exploit certain server configurations to trigger unbounded memory growth that
  would lead to a Denial of Service.  [CVE-2024-2511]
* New atexit configuration switch, which controls whether the OPENSSL_cleanup
  is registered when libcrypto is unloaded. This can be used on platforms
  where using atexit() from shared libraries causes crashes on exit

Signed-off-by: John Audia <therealgraysky@proton.me>

Build system: x86/64
Build-tested: x86/64/AMD Cezanne

(cherry picked from commit bac2f1bed6)
Link: https://github.com/openwrt/openwrt/pull/15873
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:29:23 +02:00
Hauke Mehrtens
2410b4c07b wolfssl: Update to 5.7.0
This fixes multiple security problems:
 * [High] CVE-2024-0901 Potential denial of service and out of bounds
   read. Affects TLS 1.3 on the server side when accepting a connection
   from a malicious TLS 1.3 client. If using TLS 1.3 on the server side
   it is recommended to update the version of wolfSSL used.

 * [Med] CVE-2024-1545 Fault Injection vulnerability in
   RsaPrivateDecryption function that potentially allows an attacker
   that has access to the same system with a victims process to perform
   a Rowhammer fault injection. Thanks to Junkai Liang, Zhi Zhang, Xin
   Zhang, Qingni Shen for the report (Peking University, The University
   of Western Australia)."

 * [Med] Fault injection attack with EdDSA signature operations. This
   affects ed25519 sign operations where the system could be susceptible
   to Rowhammer attacks. Thanks to Junkai Liang, Zhi Zhang, Xin Zhang,
   Qingni Shen for the report (Peking University, The University of
   Western Australia).

Size increased a little:
wolfssl 5.6.6:
516880 bin/packages/mips_24kc/base/libwolfssl5.6.6.e624513f_5.6.6-stable-r1_mips_24kc.ipk
wolfssl: 5.7.0:
519429 bin/packages/mips_24kc/base/libwolfssl5.7.0.e624513f_5.7.0-stable-r1_mips_24kc.ipk

(cherry picked from commit f475a44c03)
Link: https://github.com/openwrt/openwrt/pull/15872
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:27:20 +02:00
Nick Hainke
97c588e1ba wolfssl: update to 5.6.6
Release Notes:
https://github.com/wolfSSL/wolfssl/releases/tag/v5.6.6-stable

Refresh patches:
- 100-disable-hardening-check.patch

Fixes: CVE-2023-6935 CVE-2023-6936 CVE-2023-6937
Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 511578c128)
Link: https://github.com/openwrt/openwrt/pull/15872
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-06 18:27:20 +02:00
Tianling Shen
07cdb2e9a0 mediatek: migrate ABT ASR3000 to fit format
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 660babe825)
2024-07-06 18:07:45 +08:00
Tianling Shen
344a254c4f r8152: Update to 2.18.1.20240701
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 24781cce43)
2024-07-06 17:20:30 +08:00
Tianling Shen
c7f4b77279 mediatek: bug fixes for abt asr3000 ubootmod
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-06 15:46:09 +08:00
David Bentham
9ac1523062 mediatek: add Comfast CF-E393AX support
Comfast CF-E393AX is a dual-band Wi-Fi 6 POE ceiling mount access point.

Oem firmware is a custom openwrt 21.02 snapshot version.

We can gain access via ssh once we remove the root password.

Hardware specification:
  SoC: MediaTek MT7981A 2x A53
  Flash: 128 MB SPI-NAND
  RAM: 256MB DDR3
  Ethernet: 1x 10/100/1000 Mbps built-in PHY (WAN)
            1x 10/100/1000/2500 Mbps MaxLinear GPY211C (LAN)
  Switch: MediaTek MT7531AE
  WiFi: MediaTek MT7976D
  LEDS: 1x (Red, Blue and Green)
  Button: Reset
  UART: 3.3v, 115200n8
  --------------------------
  | Layout |
  | ----------------- |
  | 4 | VCC GND TX RX | <= |
  | ----------------- |
  --------------------------

Gain SSH access:
1. Login into web interface (http://apipaddress/computer/login.html),
   and download the
   configuration(http://apipaddress/computer/config.html).

2. Rename downloaded backup config - 'backup.file to backup.tar.gz',
   Enter 'fakeroot' command then decompress the configuration:
   tar -zxf backup.tar.gz

3. Edit 'etc/shadow', update (remove) root password:
   With password =
   'root:$1$xf7D0Hfg$5gkjmvgQe4qJbe1fi/VLy1:19362:0:99999:7:::'
   'root:$1$xf7D0Hfg$5gkjmvgQe4qJbe1fi/VLy1:19362:0:99999:7:::'
   to
   Without password =
   'root::0:99999:7:::'
   'root::0:99999:7:::'

4. Repack 'etc' directory back to a new backup file:
   tar -zcf backup-ssh.tar.gz etc/
5. Rename new config tar.gz file to 'backup-ssh.file'
   Exit fakeroot - 'exit'

6. Upload new configuration via web interface, now you
   can SSH with the following:

   'ssh -vv -o HostKeyAlgorithms=+ssh-rsa \
   -o PubkeyAcceptedAlgorithms=+ssh-rsa root@192.168.10.1'.

   Backup the mtd partitions
   - https://openwrt.org/docs/guide-user/installation/generic.backup

7. Copy openwrt factory firmware to the tmp folder to install via ssh:

   'scp -o HostKeyAlgorithms=+ssh-rsa \
   -o PubkeyAcceptedAlgorithms=+ssh-rsa \
   *-mediatek-filogic-comfast_cf-e393ax-squashfs-factory.bin \
   root@192.168.10.1:/tmp/'

   'sysupgrade -n -F \
   /tmp/*--mediatek-filogic-comfast_cf-e393ax-squashfs-factory.bin'

8. Once led has stopped flashing - Connect via ssh with the
   default openwrt ip address - 'ssh root@192.168.1.1'

9. SSH copy the openwrt sysupgrade firmware and upgrade
   as per the default instructions.

Signed-off-by: David Bentham <db260179@gmail.com>
(cherry picked from commit d8f4453bf2)
2024-07-04 15:54:27 +02:00
Leon M. Busch-George
f377e7fade mediatek: add support for YunCore AX835
Hardware specification:
  SoC: MediaTek MT7981B 2x A53
  Flash: 16MB NOR
  RAM: 256MB
  Ethernet: 2x 10/100/1000 Mbps
  Switch: MediaTek MT7531AE
  WiFi: MediaTek MT7976C
  Button: Reset
  Power: DC 12V 1A, PoE 802.3af 48V

Flash instructions:

Option #1 - SSH

  I was able to SSH into the stock firmware of my device.

  1. Attach the router to the network
  2. Use scp (-O) to copy the sysupgrade image
  3. Connect using SSH and run `sysupgrade -n`

Option #2 - U-Boot

  One way to use the bootloader for flashing is using TFTP:

  1. Connect to the router using an ethernet cable
  2  Spin up a TFTP server serving the sysupgrade file
  3. Open the case and attach a UART
  4. Attach power to the router and interrupt the countdown by pressing
     any key
  5. Select option #2 (Upgrade firmware)
  6. Enter IP address information and image name
  7. Wait patiently

Co-Authored-By: Enrique Rodríguez Valencia <enrique.rodriguez@galgus.net>
Co-Authored-By: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
(cherry picked from commit b4086f44cd)
2024-07-04 15:39:47 +02:00
Daniel Golle
387e143c68 mediatek: add support for Adtran SmartRG Bonanza Peak series
The Bonanza Peak series are a couple of MT7986-powered 2.5 GBit/s
Wi-Fi 6 residential gateway, access point and mesh router products.

All of them come with an eMMC to boot from, are powered via USB-C and
got a USB 3.0 type-A port. All of them got a Dialog (Renesas) DA14531
Bluetooth module connected via UART. If the device was previously
running stock firmware, the BT chip's internal flash has been loaded
with firmware and it can be attached using hciattach when using
OpenWrt.

SOC: MediaTek MT7986A
RAM: 2 GiB DDR4
eMMC: 8 GiB
Bluetooth: BLE5 (DA14531)
Serial: 3.3V level, 115200 8n1 on 4-pin connector

 * SDG-8612 - Dual-band RJ-45 gateway
   2x 2.5G MaxLinear PHY for WAN port
   3x 1GE LAN ports via MT7531 switch

 * SDG-8614 - Dual-band SFP gateway
   1x SFP cage with up to 2.5G speed
   1x 2.5G MaxLinear PHY for LAN port
   3x 1GE LAN ports via MT7531 switch

 * SDG-8622 - Tri-band mesh router
   2x 2.5G MaxLinear PHY
   The MT7986 2G and 5G are used as 2G and 5G high band.
   There’s a MT7915 PCIe card for 5G low band.

 * SDG-8632 - Tri-band mesh router with 6 GHz
   2x 2.5G MaxLinear PHY
   The MT7986 serves the 2G and 6G bands.
   There’s a MT7915 PCIe card for 5G.

Installation via U-Boot serial console:
0. setup TFTP server with IP 192.168.1.10/24, place initramfs image
renamed to openwrt.XXX where XXX is the internal product number:
 SDG-8612: XXX = 412
 SDG-8614: XXX = 414
 SDG-8622: XXX = 422
 SDG-8632: XXX = 432

1. connect to the serial console and power on the device.
   Interrupt the bootloader by pressing 'st'
2. setenv boot_mode openwrt ; saveenv
3. run boot1
   Load firmware via TFTP and write to flash
4. run boot2
   Now OpenWrt initramfs should boot
5. upload sysupgrade.bin via scp to /tmp
6. sysupgrade

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 3aa686f8d4)
2024-07-04 15:39:47 +02:00
Chukun Pan
e4015c446b uboot-envtools: filogic: reorder alphabetically
Reorder scripts to keep alphabetical order.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from commit 4825defe44)
2024-07-04 15:39:22 +02:00
Tianling Shen
1311befc45 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-04 18:17:07 +08:00
Tianling Shen
a85dfd17dd rockchip: fix reset pcie
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit a3ac91322e)
2024-07-04 18:13:06 +08:00
Rafał Miłecki
355bc644a9 kernel: backport some useful LED_FUNCTION_* defines for DT
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 081cd769fc)
2024-07-03 14:39:10 +02:00
Shiji Yang
85f3603047 generic: add more DT LED color and function definitions
Openwrt supports hundreds of devices. These newly added LED colors
and functions can help developers better describe LED indicators.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
(cherry picked from commit 6c41c585e3)
2024-07-03 14:38:29 +02:00
Felix Fietkau
f64576f367 mt76: update to Git HEAD (2024-04-03)
605624a4e17b mt76: fix path to page_pool helper include
e4de3592c4e3 wifi: mt76: mt7603: fix tx queue of loopback packets
446f652c967c wifi: mt76: mt7603: add wpdma tx eof flag for PSE client reset
669aba47a145 wifi: mt76: mt7915: fix HE PHY capability regression
5914ea57a31f wifi: mt76: mt7915: workaround dubious x | !y warning
e8b5991f7dac wifi: mt76: mt7915: workaround too long expansion sparse warnings
e507b4e32ead wifi: mt76: mt7921: fix fw used for offload check for mt7922
725f531c1459 wifi: mt76: connac: check for null before dereferencing
b108dda7e201 wifi: mt76: mt7996: fix size of txpower MCU command
5b7616491f07 wifi: mt76: mt7921: introduce mt7920 PCIe support
0436995feca9 wifi: mt76: mt7921s: fix potential hung tasks during chip recovery
75759dca73d5 wifi: mt76: mt7925: ensure 4-byte alignment for suspend & wow command
b96ab5e62010 wifi: mt76: mt7996: fix uninitialized variable in mt7996_irq_tasklet()
7ff11c7259a3 wifi: mt76: sdio: move mcu queue size check inside critical section
02846a5d0f0f wifi: mt76: mt7915: Remove unused of_gpio.h
cb8df32e0475 wifi: mt76: mt7996: disable rx header translation for BMC entry
a4c4b550512e wifi: mt76: connac: use peer address for station BMC entry
260c5b7c3ba0 wifi: mt76: mt7996: set RCPI value in rate control command
0b7e645db9c2 wifi: mt76: connac: enable HW CSO module for mt7996
f19035fe0b4d wifi: mt76: mt7996: fix non-main BSS no beacon issue for MBSS scenario
424e9df466ce wifi: mt76: mt7996: fix potential memory leakage when reading chip temperature
f70cb4f0508e wifi: mt76: connac: enable critical packet mode support for mt7992
5f1bf8865247 wifi: mt76: mt7996: add sanity checks for background radar trigger
1e336a8582dc wifi: mt76: connac: use muar idx 0xe for non-mt799x as well

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit a10a6fbac7)
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-07-03 09:59:49 +02:00
Ian Oderon
77354213b7 mediatek: add support for Zbtlink ZBT-Z8103AX
Specifications:
SoC: MediaTek MT7981B
RAM: 256MiB
Flash: SPI-NAND 128 MiB
Switch: 1 WAN, 3 LAN (Gigabit)
Buttons: Reset, Mesh
Power: DC 12V 1A
WiFi: MT7976CN
UART: 115200n8
UART Layout:
VCC-RX-TX-GND

No. of Antennas: 6
Note: Upon opening the router, only 5 antennas were connected
to the mainboard.

Led Layout:
Power-Mesh-5gwifi-WAN-LAN3-LAN2-LAN1-2gWiFi

Buttons:
Reset-Mesh

Installation:
A. Through OpenWrt Dashboard:
If your router comes with OpenWrt preinstalled (modified by the seller),
you can easily upgrade by going to the dashboard (192.168.1.1) and then
navigate to System -> Backup/Flash firmware, then flash the firmware

B. Through TFTP
Standard installation via UART:

1. Connect USB Serial Adapter to the UART, (NOTE: Don't connect the VCC pin).
2. Power on the router. Make sure that you can access your router via UART.
3. Restart the router then repeatedly press ctrl + c to skip default boot.
4. Type > bootmenu
5. Press '2' to select upgrade firmware
6. Press 'Y' on 'Run image after upgrading?'
7. Press '0' and hit 'enter' to select TFTP client (default)
8. Fill the U-Boot's IP address and TFTP server's IP address.
9. Finally, enter the 'firmware' filename.

Signed-off-by: Ian Oderon <ianoderon@gmail.com>
(cherry picked from commit 4300bc6688)
2024-07-03 09:19:41 +02:00
Rodrigo Balerdi
9988f8adf8 base-files: minor fix to mmc_get_mac_ascii function
This is mostly a cosmetic cleanup. The absence of
the return statement was not causing any problems.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
(cherry picked from commit 8cf4ac5195)
2024-07-02 09:05:52 +02:00
Daniel Golle
4058d0e990 base-files: add mmc_get_mac_ascii function
Similar to the *_get_mac_binary function, also split the common parts
off mtd_get_mac_ascii into new get_mac_ascii function and introduce
mmc_get_mac_ascii which uses it.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 45c85c1827)
2024-07-02 09:05:52 +02:00
Daniel Golle
46aa8c7732 mediatek: add kmod-usb3 to default package set of the ZBT-Z8102AX
Include XHCI USB drivers on the ZBT-Z8102AX router, the drivers are
required to be able to use the USB-connected M.2 slots for 4G/5G modems.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 507ad4f078)
2024-07-02 07:34:08 +02:00
Hauke Mehrtens
866b1bb2b3 kernel: bump 5.15 to 5.15.161
No manual changes needed.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 19305aff72)
2024-07-01 22:32:52 +02:00
Hauke Mehrtens
1589572576 kernel: bump 5.15 to 5.15.160
No manual changes needed.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit c569b7d21a)
2024-07-01 22:32:51 +02:00
Hauke Mehrtens
cd2fdaf717 kernel: bump 5.15 to 5.15.159
Removed because they are upstream:
   generic/pending-5.15/778-net-l2tp-drop-flow-hash-on-forward.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=e97e0051056b6dbcc43ae1862dcfcb05d06517c3

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 6cfa186544)
2024-07-01 22:32:51 +02:00
Ryan Castellucci
a0d2ddac30 ipq40xx: eap1300: add eap1300ext as alt model
The EnGenius EAP1300 and EAP1300EXT use identical boards and firmware
(as flashed) from the vendor.

As with the EAP1300, the EAP1300EXT requires a specific firmware version
to flash OpenWRT. Unfortunately, the required firmware is truncated on
the vendor's website.

A working file can be created as follows:

```
curl \
https://www.engeniustech.com/wp_firmware/eap1300-all-v3.5.3.5_c1.9.04.bin \
| perl -pe 's/\x09EAP1300_A/\x0cEAP1300EXT_A/' \
> eap1300ext-all-v3.5.3.5_c1.9.04.bin
```

The file should have sha256:
`58a1197a426139a12b03fd432334e677124cbe3384349bd7337f2ee71f1dcfd4`.

Please see commit 2b4ac79 for further
details.

The vendor firmware must be decrypted before it can be flashed from
OpenWRT. A tool able to do that is available from:

https://github.com/ryancdotorg/enfringement/blob/main/decrypt.py

Signed-off-by: Ryan Castellucci <code@ryanc.org>
(cherry picked from commit 85f6f88223)
2024-07-01 07:14:18 +02:00
David Bauer
ef4fc5cc1d hostapd: bump PKG_RELEASE
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 89d7051485)
2024-06-30 22:31:51 +02:00
David Bauer
85ff47c6be hostapd: don't ignore probe-requests with invalid DSSS params
Don't ignore probe requests which contain an invalid DS parameter for the
current operating channel.

As the comment outlines, the drop shall only apply if
dot11RadioMeasurementActivated is set to 1.

However, it was observed Linux clients (Debian 12 / NixOS 23.11)
with an Intel 8265 NIC may generate a probe request frame with
dot11RadioMeasurementActivated set to false and an invalid DSSS
parameter.

These were also dropped even though they should not have been. They
however should not have contained this parameter in the first place.

Don't drop Probe Requests which contain such an invalid field. This may
lead to more probe responses being sent, however it does fix very
frequent connection issues for these clients on 2.4 GHz.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 68e4cc9be5)
2024-06-30 22:31:51 +02:00
Chukun Pan
b30993ac97 mediatek: filogic: add Netcore N60 support
Hardware specification:
  SoC: MediaTek MT7986A 4x A53
  Flash: ESMT F50L1G41LB 128MB
  RAM: W632GU6NB DDR3 256MB
  Ethernet: 1x 2.5G + 4x 1G
  WiFi1: MT7975N 2.4GHz 4T4R
  WiFi2: MT7975PN 5GHz 4T4R
  Button: Reset, WPS
  Power: DC 12V 2A

Flash instructions:
  1. Connect to the router using ssh or telnet,
     username: useradmin, password is the web
     login password of the router.
  2. Use scp to upload bl31-uboot.fip and flash:
     "mtd write xxx-preloader.bin spi0.0"
     "mtd write xxx-bl31-uboot.fip FIP"
     "mtd erase ubi"
  3. Connect to the router via the Lan port,
     set a static ip of your PC.
     (ip 192.168.1.254, gateway 192.168.1.1)
  4. Download initramfs image, reboot router,
     waiting for tftp recovery to complete.
  5. After openwrt boots up, perform sysupgrade.

Note:
  1. Back up all mtd partitions before flashing.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from commit 4ae474afbd)
2024-06-28 17:03:01 +08:00
Chukun Pan
f67a697727 uboot-mediatek: add Netcore N60 support
The vendor uboot requires special fit verification.
So add a custom uboot build for this device.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from commit 0170666d89)
2024-06-28 17:01:35 +08:00
Tianling Shen
de8276d78f sunxi: limit h5 cpufreq to 1.3 GHz
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-06-27 20:46:07 +08:00
Daniel Golle
f12cf43029 ramips: yuncore_g720: fix buttons
Turns out the device got two buttons, while the currently listed on is
actually WPS, and the other (will hidden) button is intended as RESET.
Update DT accordingly.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 646ebbd32c)
2024-06-26 02:47:57 +01:00
Tianling Shen
0b1d7a7c1d README: update project description
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 45b1e4c3e5)
2024-06-26 02:36:33 +08:00
Tianling Shen
565f2a0367 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-06-26 02:25:18 +08:00
Tianling Shen
5e1e1650d2 README: update preferred buildsystem
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 3ed155f48c)
2024-06-26 02:23:17 +08:00
Roman Azarenko
cc0527b362 build: add explicit timezone in CycloneDX SBOM
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
Per the CycloneDX 1.4 spec, the `metadata.timestamp` field contains
the date/time when the BOM was created [1].

Before the change, the value generated by the package-metadata.pl
script would look like this:

	2024-06-03T15:51:10

CycloneDX 1.4 relies on the JSON Schema specification version draft-07,
which defines the `date-time` format [2] as derived from RFC 3339,
section 5.6 [3]. In this format, the `time-offset` component is required,
however in the original version of package-metadata.pl it is omitted.

This is causing problems with OWASP Dependency-Track version 4.11.0 or
newer, where it now validates submitted SBOMs against the JSON schema
by default [4]. SBOMs with incorrect timestamp values are rejected with
the following error:

	{
	    "detail": "Schema validation failed",
	    "errors": [
	        "$.metadata.timestamp: 2024-06-03T15:51:10 is an invalid date-time"
	    ],
	    "status": 400,
	    "title": "The uploaded BOM is invalid"
	}

Add explicit `Z` (UTC) timezone offset in the `timestamp` field
to satisfy the CycloneDX schema.

[1]: https://github.com/CycloneDX/specification/blob/1.4/schema/bom-1.4.schema.json#L116-L121
[2]: https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.7.3.1
[3]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6
[4]: https://github.com/DependencyTrack/dependency-track/pull/3522

Signed-off-by: Roman Azarenko <roman.azarenko@iopsys.eu>
(cherry picked from commit 2ded629864)
Link: https://github.com/openwrt/openwrt/pull/15693
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-06-20 14:58:17 +02:00
Tianling Shen
15700306e5 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-06-19 23:01:24 +08:00
Felix Fietkau
50148a40d2 mt76: update to Git HEAD (2024-03-18)
a903d3169193 wifi: mt76: mt7921: fix a potential association failure upon resuming
eb0d0ce344f3 wifi: mt76: mt7921: fix suspend issue on MediaTek COB platform
841bf82e9958 wifi: mt76: fix the issue of missing txpwr settings from ch153 to ch177
ce7ccc540168 wifi: mt76: Remove redundant assignment to variable tidno
a238df940d6f wifi: mt76: mt7915: initialize rssi on adding stations
46c7d1849dbd wifi: mt76: replace skb_put with skb_put_zero
b5640b3153c7 wifi: mt76: fix tx packet loss when scanning on DBDC
7b054e5cb3af wifi: mt76: mt7915: fix mcu command format for mt7915 tx stats
3f27a64a8010 wifi: mt76: mt7915: fix bogus Tx/Rx airtime duration values
4f681a8fbc91 wifi: mt76: mt7915: fix HE PHY capabilities IE for station mode
8ede229eb8b5 wifi: mt76: mt7915: only set MT76_MCU_RESET for the main phy
2330781b8c5f wifi: mt76: mt7996: only set MT76_MCU_RESET for the main phy
e5fb6995e7eb wifi: mt76: mt7915: add support for disabling in-band discovery
b4a917417c85 wifi: mt76: mt7915: add mt7986, mt7916 and mt7981 pre-calibration
2135e201e7a9 mt76: mt7915: add fallback in case of missing precal data

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 85ad6b9569)
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-06-18 15:19:51 +02:00
Tianling Shen
a5f3f0de07 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-06-17 16:56:57 +08:00
David Bauer
e367ba9ec4 mpc85xx: fix label-mac-address for Enterasys WS-AP3710i
The WS-AP3710i does not correctly expose its label-mac on eth0 anymore
since the change to simpleLoader.

Fix this by obtaining the label-mac from the U-Boot environment.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit e321e70ddc)
2024-06-16 14:03:03 +02:00
Tianling Shen
f1b4ec1b36 mediatek: add TP-Link TL-XTR8488 support
The TP-Link TL-XTR8488 is silimiar to TL-XDR6088 with following changes:
* 1GB DDR4 RAM
* Addtional MT7915AN for 5.8 GHz wireless

For flash instructions, see the commit for TP-Link TL-XDR6088.

Based on An Yun's work.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 616be733d0)
2024-06-15 22:21:39 +08:00
David Bauer
d8415fa270 mpc85xx: fix Enterasys WS-AP3710i eth mac-address
With the introduction of the simpleImage loader, the MAC address is not
set by the bootloader anymore.

Fix this by reading the MAC address from the U-Boot environment
partition.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 22f92cce22)
2024-06-14 23:33:57 +02:00
p-w-p
9b36106c4d rockchip: Add cache information to the SoC dtsi for RK356x
Signed-off-by: Milinda Brantini <C_A_T_T_E_R_Y@outlook.com>
2024-06-10 22:16:08 +08:00
David Bauer
3001d3c5d4 mpc85xx: fix WS-AP3710i boot
On master, the bootwrapper link-address for all simpleImage targets was
relocated to 0x15000000 due to growing kernel size.

This was not done on OpenWrt 23.05, as the decompressed kernel still
fits. However, with the wrapper for the WS-AP3710i, the bootloader
attempts execute in-place with the uImage load-address of 0x1000000. As
the image is compiled without the uImage header in mind, this naturally
fails.

In order to fix this, link the WS-AP3715i simpleImage at 0x15000000 as
done in master. This will force the bootloader to relocate the code to
the proper address and skip XIP.

Signed-off-by: David Bauer <mail@david-bauer.net>
2024-06-10 03:37:03 +02:00
Tianling Shen
d5edb94da3 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-06-09 22:18:17 +08:00
David Bauer
d0620706f0 ipq40xx: fix broken image generation for EX6150v2
All NETGEAR EX6150v2 validate the rootfs for which OpenWrt places a
fakeheader at the position, where the bootloader expects it.

Some EX6150v2 bootloaders do however make a broken assumption about
where the rootfs starts. This is due to them calculating the rootfs
start not based upon the kernel-length but the string-offset of the
FIT-image.

We have to be compatible with both this broken as well as the valid
calculation. So we do relocate the FDT string section to a
block-boundary and enlarge the FIT image to end at this boundary +
BLOCKSIZE / 2. This way, both the broken as well as correct calculations
do expect the rootfs-header at the same position.

It is worth noting, that this is a rare edge-case in which only happens
if the image-length as well as the start of the string-section are not
placed in the same erase-block. This is an edge-case which happens very
rarely (thus it was not spotted prior).

Affected:
 - U-Boot 2012.07 (Jun 16 2016 - 11:59:37)

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit de59fc4540)
2024-06-08 17:30:58 +02:00
Tianling Shen
82ee4b1580 mediatek: fix wps button for nokia ea0326gmp
The gpio is actually low active, fix it.

Fixes: 40e7fab9e4 ("mediatek: add Nokia EA0326GMP support")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/15651
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 4edde98768)
2024-06-07 20:52:13 +08:00
Mieczyslaw Nalewaj
3287d82fcf ramips: samknows whitebox v8: set wifi frequency
Set the 2.4GHz frequency for WiFi.

Fixes: #15391
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
(cherry picked from commit 1a2fc49b71)
2024-06-06 22:09:52 +02:00
Tianling Shen
1f45d299aa mediatek: fix lan/wan macaddr for jdcloud re-cp-03
The MAC address assigned to lan/wan was reversed.

Fixes: f236c1c4f5 ("mediatek: add support for JDCloud RE-CP-03")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-06-06 17:08:48 +08:00
Tianling Shen
93c05158ee Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-06-06 17:02:19 +08:00
Tianling Shen
c84c9e435b mediatek: fix lan/wan macaddr for cmcc rax3000m
The MAC address assigned to lan/wan was reversed on eMMC boards.

Fixes: d3c193525e ("mediatek: add CMCC RAX3000M support")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-06-06 17:02:09 +08:00
David Bauer
6698e6e76a mpc85xx: add label-mac for HP MSM460
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit dbc9596c7e)
2024-06-05 01:38:33 +02:00
David Bauer
530d4db067 mpc85xx: add support for Hewlett Packard MSM460
Hardware
--------
CPU:  Freescale P1020 2xe500 PPC
RAM:  256M DDR3 (Micron MT41J64M16JT-15E:G "D9MNJ")
NAND: 128M (Micron 2CA1)
BTN:  1x Reset
LED:  Power - ETH - Radio1 - Radio2
UART: RJ-45 Cisco Pinout - 115200 8N1

Installation
------------
NOTE: You can find a repo with up-to-date instructions as well as
the required files here:

https://github.com/blocktrron/msm460-flashing

Required files
==============
You need a command-files as well as a U-Boot image.

The command-file has the following content (padded to 131072 bytes).

If you copy paste these, remove the newlines!

```
U-BOOT setenv ethaddr 02:03:04:05:06:07; setenv ipaddr 192.168.1.1;
setenv serverip 192.168.1.66; tftpboot 0x3000000 msm460-uboot.bin;
nand device; nand erase 0 0xC0000; nand write 0x3000000 0x0 0xC0000; reset
```

You can download the required U-Boot from this repository:

https://github.com/blocktrron/u-boot-msm/releases

Preparation
===========
Prepare a TFTP server serving two files:

 - U-Boot NAND image as `msm460-uboot.bin`.
 - OpenWrt factory image as `msm460-factory.bin`
 - Command-file names `commands.tftp`

You can start a TFTP server in the current directory using dnsmasq:

```bash
sudo dnsmasq --no-daemon --listen-address=0.0.0.0 \
    --port=0 --enable-tftp=enxd0 --tftp-root="$(pwd)" \
    --user=root --group=root
```
Replace `enxd0` with the name of your network interface.

Procedure
=========
1. Assign yourself the IP-Address 192.168.1.66/24.
3. Connect the Router to the PC while keeping the reset button
   pressed.
4. The LEDs will eventually begin to flash.
   They will start to flash faster after around 15 seconds.
5. Release the reset button.
6. Start a new shell
7. Make sure you are currently in the directory where the tftp server
   is located.
8. Run the following command:

```bash
tftp 192.168.1.1 -m binary -c put commands.tftp nflashd.cccc9999
```

You get the message "Transfer timed out."
To find out if you have been successful, please check the
blinking LED Pattern.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit af329ec389)
Signed-off-by: David Bauer <mail@david-bauer.net>
2024-06-05 01:38:33 +02:00
Yanase Yuki
a691e7d8ad gettext-full: link libiconv when building host pkg
On Fedora 40 system, some compile error happens when
building iconv-ostream.c. Linking to libiconv-full
fixes this.

Signed-off-by: Yanase Yuki <dev@zpc.st>
(cherry picked from commit 63dd14b906)
Link: https://github.com/openwrt/openwrt/pull/15627
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-04 14:27:35 +02:00
Tianling Shen
818cf5d946 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-05-24 22:44:28 +08:00
Rodrigo Balerdi
08becaf62f ipq806x: rt4230w-rev6: fix status reporting via the LEDs
There is a custom LED controller between the 3 SoC GPIO outputs and
the red and blue LEDs of the device. It implements a strange mapping
that includes fixed, flashing, and breathing modes.

The current DTS configuration causes OpenWrt to flash the LEDs over
the controller's own flashing, resulting in chaotic output in boot,
failsafe, and upgrade modes.

This change fixes the LEDs in the best way possible as long as each
OpenWrt running state is limited to be signaled by a single led.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15440
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 0868268c9f)
2024-05-23 22:15:33 +02:00
Nick Hainke
968d9430c6 libxml2: update to 2.12.5
Release Notes:
https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.12.5

Fixes: CVE-2024-25062
Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit c47b7571f0)
2024-05-23 22:09:05 +02:00
Nick Hainke
ced6809554 libxml2: update to 2.12.4
Release Notes:
- https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.12.4

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit d82930c7c7)
2024-05-23 22:09:05 +02:00
Nick Hainke
6ea90db857 libxml2: update to 2.12.3
Release Notes:
- https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.12.2
- https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.12.3

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 08ad3c9633)
2024-05-23 22:09:05 +02:00
Nick Hainke
a8a8fbcaff libxml2: update to 2.12.1
Release Notes:
- https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.12.0
- https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.12.1

Remove patch:
- 010-iconv.patch

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 2963e1687b)
2024-05-23 22:09:05 +02:00
Nick Hainke
6d6384fb45 libxml2: update to 2.11.6
Release Notes:
- https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.11.5
- https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.11.6

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 62277c485e)
2024-05-23 22:09:05 +02:00
Luis Mita
ed3a80d088 mediatek: add support for Cudy TR3000 v1
Hardware:
 - SoC: MediaTek MT7981B
 - CPU: 2x 1.3 GHz Cortex-A53
 - Flash: 128 MiB SPI NAND
 - RAM: 512 MiB
 - WLAN: 2.4 GHz, 5 GHz (MediaTek MT7976CN, 802.11ax)
 - Ethernet: 1x 10/100/1000/2500 Mbps RTL8221B WAN, 1x10/100/1000 Mbps MT7981 LAN
 - USB 3.0 port
 - Buttons: 1 Reset button, 1 slider button
 - LEDs: 1x Red, 1x White
 - Serial console: internal test points, 115200 8n1
 - Power: 5 VDC, 3 A

MAC addresses:
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| WAN     | 80:af:ca:xx:xx:x1 | label+1   |
| LAN     | 80:af:ca:xx:xx:x0 | label     |
| WLAN 2g | 80:af:ca:xx:xx:x0 | label     |
| WLAN 5g | 82:af:ca:xx:xx:x0 |           |
+---------+-------------------+-----------+

Installation:
The installation must be done via TFTP by disassembling the router. On other occasions Cudy has distributed intermediate firmware to make installation easier, and so I recommend checking the Wiki for this device if there is a more convenient solution than the one below.

To install using TFTP:
1. Connect to UART.
2. With the router off, press the RESET button. While the router is turning on, the button should continue to be pressed for at least 5 seconds.
3. A u-boot shell will automatically open.
4. Connect to LAN and set your IP to 192.168.1.88/24. Configure a TFTP server and an OpenWrt initramfs-kernel.bin firmware file.
5. Run these steps in u-boot using the name of your file.

setenv bootfile initramfs-kernel.bin
tftpboot
bootm

6. If you can reach LuCI or SSH now, just use the sysupgrade image with the 'Keep settings' option turned off.

Signed-off-by: Luis Mita <luis@luismita.com>
(cherry picked from commit 63b8d98dd0)
2024-05-23 22:01:52 +02:00
Hank Moretti
9f9b600cd6 mediatek: fix sysupgrade error for WR30U
The NMBM-Enabled layout did not use fit image,
it just need default process. So it was been removed in platform.sh.

It will fix sysupgrade error for xiaomi,mi-router-wr30u-112m-nmbm.

Signed-off-by: Hank Moretti <mchank9999@gmail.com>
(cherry picked from commit 02214ab8dc)
2024-05-23 21:50:00 +02:00
Chuanhong Guo
51822a907e mediatek: drop NMBM layout for Xiaomi WR30U
This reverts commit dcdcfc1511.

This is a firmware for third-party u-boot mod, which should not
be carried here by us.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
(cherry picked from commit 1b7e62b20b)
2024-05-23 21:50:00 +02:00
Dim Fish
f11e6e221e mediatek: filogic: add support for Xiaomi AX3000T
**SoC**: MediaTek MT7981B 2x A53
  **Flash**: ESMT F50L1G41LB 128MB
  **RAM**: NT52B128M16JR-FL 256MB
  **Ethernet**: 4x 10/100/1000 Mbps
  **Switch**: MediaTek MT7531AE
  **WiFi**: MediaTek MT7976C
  **Buttons**: Reset, Mesh
  **Power**: DC 12V 1A

1. Get ssh access. Supported stock firmware **1.0.47**
   ```
   curl -X POST "http://192.168.31.1/cgi-bin/luci/;stok=*******/api/misystem/arn_switch" -d "open=1&model=1&level=%0Anvram%20set%20ssh_en%3D1%0A"
   curl -X POST "http://192.168.31.1/cgi-bin/luci/;stok=*******/api/misystem/arn_switch" -d "open=1&model=1&level=%0Anvram%20commit%0A"
   curl -X POST "http://192.168.31.1/cgi-bin/luci/;stok=*******/api/misystem/arn_switch" -d "open=1&model=1&level=%0Ased%20-i%20's%2Fchannel%3D.*%2Fchannel%3D%22debug%22%2Fg'%20%2Fetc%2Finit.d%2Fdropbear%0A"
   curl -X POST "http://192.168.31.1/cgi-bin/luci/;stok=*******/api/misystem/arn_switch" -d "open=1&model=1&level=%0A%2Fetc%2Finit.d%2Fdropbear%20start%0A"
   curl -X POST "http://192.168.31.1/cgi-bin/luci/;stok=********/api/misystem/arn_switch" -d "open=1&model=1&level=%0Apasswd%20-d%20root%0A
   ```

2. Backup stock partitions
   ```
   nanddump -f /tmp/BL2.bin /dev/mtd1
   nanddump -f /tmp/Nvram.bin /dev/mtd2
   nanddump -f /tmp/Bdata.bin /dev/mtd3
   nanddump -f /tmp/Factory.bin /dev/mtd4
   nanddump -f /tmp/FIP.bin /dev/mtd5
   nanddump -f /tmp/ubi.bin /dev/mtd8
   nanddump -f /tmp/KF.bin /dev/mtd12
   ```
   Then transfer them to your computer in a safe place.

3. Get firmware information `cat /proc/cmdline`

4. Copy openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi to **/tmp** and flash
   If **firmware=0**
   ```
   ubiformat /dev/mtd9 -y -f /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi
   nvram set boot_wait=on
   nvram set uart_en=1
   nvram set flag_boot_rootfs=1
   nvram set flag_last_success=1
   nvram set flag_boot_success=1
   nvram set flag_try_sys1_failed=0
   nvram set flag_try_sys2_failed=0
   nvram commit
   reboot
   ```
   If **firmware=1**
   ```
   ubiformat /dev/mtd8 -y -f /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi
   nvram set boot_wait=on
   nvram set uart_en=1
   nvram set flag_boot_rootfs=0
   nvram set flag_last_success=0
   nvram set flag_boot_success=1
   nvram set flag_try_sys1_failed=0
   nvram set flag_try_sys2_failed=0
   nvram commit
   reboot
   ```

   Then reboot your router, it should boot to the OpenWrt initramfs system now.

5. Flash openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-squashfs-sysupgrade.bin
   `sysupgrade -n /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-squashfs-sysupgrade.bin`

1. Flash openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb
   `ubiformat /dev/mtd8 -y -f /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb`

   `reboot`

2. Install kmod-mtd-rw
   `opkg update && opkg install kmod-mtd-rw`

   `insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1`

3. Format ubi and create new ubootenv volume
   ```
   ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8
   ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
   ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB
   ```

4. *(Optional **-10Mb** free space) Add recovery boot feature.*
   ```
   ubimkvol /dev/ubi0 -n 2 -N recovery -s 10MiB
   ubiupdatevol /dev/ubi0_2 /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb
   ```

5. Flash Openwrt U-Boot
   ```
   mtd write /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-preloader.bin BL2
   mtd write /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-bl31-uboot.fip FIP
   ```

6. Flash openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-squashfs-sysupgrade.itb
   `sysupgrade -n /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-squashfs-sysupgrade.itb`

1. Force flash openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb
   `sysupgrade -F -n /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb`

2. Format ubi and Nvram
   ```
   ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8
   mtd erase Nvram
   ```

3. Install kmod-mtd-rw
   `opkg update && opkg install kmod-mtd-rw`

   `insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1`

4. Flash stock images from backup
   ```
   mtd write /tmp/BL2.bin BL2
   mtd write /tmp/FIP.bin FIP
   mtd write /tmp/ubi.bin ubi
   ```
   Then reboot your router, waiting it finished rollback in minutes.

   `ubiformat /dev/mtd7 -y -f /tmp/ubi.bin`
   Then reboot your router, waiting it finished rollback in minutes.

Signed-off-by: Dim Fish <dimfish@gmail.com>
(cherry picked from commit 7dbcc1215a)
2024-05-23 21:50:00 +02:00
Paul Geraedts
c82c1178c1 mediatek: filogic: fix failsafe mode on devices with no lan1
Default to lan4 port, instead of (missing) lan1 port,
to fix failsafe mode on Xiaomi AX3000T, WR30U, AX6000

Build system: x86/64
Build-tested: mediatek/filogic/xiaomi_mi-router-ax3000t-ubootmod
Run-tested: mediatek/filogic/xiaomi_mi-router-ax3000t-ubootmod

Signed-off-by: Paul Geraedts <p.f.j.geraedts@gmail.com>
(cherry picked from commit 8256d06933)
2024-05-23 21:50:00 +02:00
Alexandru Gagniuc
a6bb1df40b wifi-scripts: fix creation of IBSS in legacy (non-HT) mode
When an IBBS interface is configured for IBSS legacy mode, wdev.htmode
is empty. This is empty string results in an empty positional argument
to the "ibbs join" command, for example:

    iw dev phy0-ibss0 ibss join crymesh 2412 '' fixed-freq beacon-interval 100

This empty argument is interpreted as an invalid HT mode by 'iw',
causing the entire command to fail and print a "usage" message:

    daemon.notice netifd: radio0 (4527): Usage:    iw [options] \
        dev <devname> ibss join <SSID> <freq in MHz> ...

Although nobody will ever need more than 640K of IBSS, explicitly use
"NOHT" if an HT mode is not given. This fixes the problem.

Fixes: e56c5f7b27 ("hostapd: add ucode support, use ucode for the main ubus object")
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name> [extend to cover more cases]
(cherry picked from commit cee9fcdb73)
2024-05-23 21:35:53 +02:00
Rany Hany
0f1b249eac mediatek: fix broken PCIe caused by update to 5.15.158
The patch "710-pci-pcie-mediatek-add-support-for-coherent-DMA.patch"
makes use of "syscon_regmap_lookup_by_phandle" which requires that
"syscon" be in the compatible list.

Without this patch, PCIe probe will fail with the following error:

[    1.287467] mtk-pcie 1a143000.pcie: host bridge /pcie@1a143000 ranges:
[    1.294019] mtk-pcie 1a143000.pcie: Parsing ranges property...
[    1.299901] mtk-pcie 1a143000.pcie:      MEM 0x0020000000..0x0027ffffff -> 0x0020000000
[    1.307954] mtk-pcie 1a143000.pcie: missing hifsys node
[    1.313185] mtk-pcie: probe of 1a143000.pcie failed with error -22

Fixes: 01c58a0d2a ("kernel: bump 5.15 to 5.15.158")
Signed-off-by: Rany Hany <rany_hany@riseup.net>
(cherry picked from commit 8607372b41)
2024-05-23 19:37:56 +03:00
Christian Marangi
28bf0137b4 tools: refresh all patches
Refresh all tools patches now that tools/refresh correctly works.

CI now checks for them and actively complain if tools have unrefreshed
patches.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-05-22 12:41:10 +02:00
Christian Marangi
349c3c1605 quilt.mk: don't error on refresh/update if patches doesn't exist
The current code fails if we have package or host tools with no patches
to apply. The error printend is the following: (taking ubus as an
example)

make[2]: Entering directory '/home/ansuel/openwrt-ansuel/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/home/ansuel/openwrt-ansuel/openwrt/scripts/config'
make[1]: Entering directory '/home/ansuel/openwrt-ansuel/openwrt'
make[2]: Entering directory '/home/ansuel/openwrt-ansuel/openwrt/package/system/ubus'
The source directory contains no quilt patches.
make[2]: *** [Makefile:81: quilt-check] Error 1
make[2]: Leaving directory '/home/ansuel/openwrt-ansuel/openwrt/package/system/ubus'
time: package/system/ubus/refresh#0.06#0.00#0.07
    ERROR: package/system/ubus failed to build.
make[1]: *** [package/Makefile:120: package/system/ubus/refresh] Error 1
make[1]: Leaving directory '/home/ansuel/openwrt-ansuel/openwrt'
make: *** [/home/ansuel/openwrt-ansuel/openwrt/include/toplevel.mk:232: package/ubus/refresh] Error 2

We exit 1 after saying that there are no patches because later in the
function quilt pop fails to execute.

Having no patches for a package and calling refresh should not be
a critical error and the function should just do nothing.

To handle this improve quilt.mk with the following addition.
- If we don't have any patch for the package, we print a warning and we
  create an empty series. This is useful to trick quilt and make it do
  nothing.
  We also create a status file .quilt_no_patch to detect in the other
  function that we don't have patches to handle.
- In refresh makefile target, we check if .quilt_no_patch exist and
  we skip quilt cleanup if this exist.
- In RefreshDir function we change the logic and now we delete the
  patches directory and not only the content. This is done as a cleanup
  to clean case with empty patches directory.
- In RefreshDir we check if .quilt_no_patch exist and we skip creating
  the patches directory and copying the refreshed patches.
- In RefreshDir we delete at the end any trace of .quilt_no_patch if
  present.

This is needed to support run like package/refresh that will run the
refresh process on any package present in the buildroot.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 9536446965)
2024-05-22 12:24:53 +02:00
Christian Marangi
61c50bd2ce quilt.mk: use CURDIR instead of ./ for PATCH_DIR and FILES_DIR
To better reference them for diagnostic use, reference the PATCH_DIR and
FILES_DIR with the absolute path instead of using ./ and reference by
the relative location.

No behaviour change intended.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit bb1bfb4602)
2024-05-22 12:24:41 +02:00
Christian Marangi
aa77c796fe tools/padjffs2: use Host/Prepare/Default instead of raw commands
Now that Host/Prepare/Default is always defined, we can use that instead
of using raw commands to move files from the src directory to
HOST_BUILD_DIR.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 01048c7456)
2024-05-22 12:00:40 +02:00
Christian Marangi
9897724ada tools/missing-macros: install files from HOST_BUILD_DIR instead of src
Install files from HOST_BUILD_DIR instead of src. These files are now
correctly copied to HOST_BUILD_DIR and can be referenced from there.

(cherry picked from commit 46bcbe4223)
[ rebased on top of openwrt-23.05 ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-05-22 11:59:59 +02:00
Christian Marangi
d1fc2ea8c7 host-build: always define Host/Prepare/Default
We currently skip defining Host/Prepare/Default if HOST_UNPACK is not
defined.

This is mostly the case for Host packages that just provide files with
the src directory and don't need to be downloaded/extracted.

This was probably done lots of times ago due to quilt causing error as
the patches directory wasn't present.
This has changed now and quilt can correctly detect if no patches needs
to be applied (instead of terminating with error)

Always define Host/Prepare/Default to make tools/refresh correctly works
as HOST_QUILT is hardcoded enabled for this make target and will
complain for tool not prepared for quilt patches.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 725389b7c7)
2024-05-22 11:59:23 +02:00
Yuu Toriyama
09a8f75077 wireless-regdb: update to 2024.05.08
Changes:
  73529a8 Revert "wireless-regdb: Update and disable 5470-5730MHz band according to TPC requirement for Singapore (SG)"
  87941e4 wireless-regdb: Update regulatory rules for Taiwan (TW) on 6GHz
  33797ae wireless-regdb: update regulatory database based on preceding changes

Signed-off-by: Yuu Toriyama <PascalCoffeeLake@gmail.com>
(cherry picked from commit 65c1f0d433)
2024-05-19 16:20:43 +03:00
Tianling Shen
3565db988c Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-05-19 16:47:36 +08:00
Rafał Miłecki
a9e117e03f mt76: fix mt7603 compilation
This fixes:
mt7603/dma.c: In function 'mt7603_rx_loopback_skb':
mt7603/dma.c:60:17: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]

Fixes: 2568b30285 ("mt76: backport mt7603 fixes important for its stability")
Fixes: https://github.com/openwrt/openwrt/issues/15510
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-05-18 14:58:39 +02:00
Tianling Shen
720c4e2102 rockchip: configure ETH LED for NanoPi R5C/R5S
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit e7fbc901f1)
2024-05-18 14:12:43 +08:00
Tianling Shen
cf66ecffef rockchip: fix eth index name for FastRhino R68S
Fixes: #1298
Fixes: 9744bf7093 ("rockchip: configure ETH LED for FastRhino R66S/R68S")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 72ccbed99c)
2024-05-18 13:07:58 +08:00
Tianling Shen
863a97a93d rockchip: refresh patches
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-05-17 18:00:55 +08:00
Robert Marko
e61f06c51d ipq806x: mr42/mr52: fix PCIe ports
All three PCIe ports are reported non working on Meraki MR42/MR52 boards
since kernel 6.1 with the issue of PCIe PHY link never coming up thus
no WLAN cards are available on the boards.

After debugging it seems that PCIe worked on 5.15 and older purely by
accident as device DTS was using /delete-property/ perst-gpios; in each
of the 3 PCIe nodes but there was no "perst-gpios" property in the SoC DTSI
as it was still using the older "perst-gpio" property so it was not getting
removed from the device DTS.

However, in kernel 6.1 commit ("ARM: dts: qcom-*: replace deprecated
perst-gpio with perst-gpios") updated all Qualcomm DTS-es to use the newer
"perst-gpios" and thus once ipq806x moved to 6.1 PCIe stopped working as
now that property was being dropped from the device DTS.

So, since the removal of PERST pins seems to have been wrong from the start
lets drop the property removal from MR42/MR52.

Fixes: #15408
Link: https://github.com/openwrt/openwrt/pull/15509
Link: https://github.com/openwrt/openwrt/pull/15512
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-05-17 11:51:14 +02:00
Tianling Shen
eba64d8261 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-05-17 17:44:27 +08:00
Tianling Shen
3a4cd4fbf0 rockchip: refresh patches
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-05-17 17:43:53 +08:00
Tianling Shen
9744bf7093 rockchip: configure ETH LED for FastRhino R66S/R68S
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 8d4ca61288)
2024-05-17 17:43:49 +08:00
Tianling Shen
7e9f94d632 rockchip: remove LED configuration hack for r8169
Upstream now uses standard ETH LED bindings to configure LED registers.
However, we don't use the r8169 driver for rockchip, so simply remove
this outdated hack.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit cda5cfb9d5)
2024-05-17 17:42:03 +08:00
Tianling Shen
23f27b3aec r8125: rewrite devname configuration patch
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit d7c3fc67aa)
2024-05-17 17:05:08 +08:00
Tianling Shen
a15e69ee35 r8125: fixup LED configuration
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 7b507b6869)
2024-05-17 17:04:34 +08:00
Beginner-Go
a59201c4d5 r8125: update to 9.013.02-2
Signed-off-by: Beginner-Go <70857188+Beginner-Go@users.noreply.github.com>
(cherry picked from commit 9bf0099bcc)
2024-05-17 17:04:28 +08:00
Tianling Shen
812347d4d4 r81xx: use standard versioning
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 8cc992c45f)
2024-05-17 17:04:16 +08:00
ZiMing Mo
e29741709c r8125: bump to 9.012.04
Signed-off-by: ZiMing Mo <msylgj@immortalwrt.org>
(cherry picked from commit 0cdf710384)
2024-05-17 17:04:12 +08:00
Rafał Miłecki
2568b30285 mt76: backport mt7603 fixes important for its stability
Those are required for stable MT7603E & on-SoC MT7628/MT7688 wireless
support. After mt76 receiving more testing we may just update codebase
and drop those backports.

Fixes: https://github.com/openwrt/mt76/issues/865
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-05-16 14:44:27 +02:00
Felix Fietkau
ffd0074694 mt76: update to Git HEAD (2024-02-03)
a9693e1979c2 linux-firmware: add firmware for MT7996
0258dc90e3a1 wifi: mt76: mt7603: fix reading target power from eeprom
3e81173d9e2b wifi: mt76: mt7603: initialize chainmask
786a339bac36 wifi: mt76: mt7996: fix fortify warning
bc37a7ebc267 wifi: mt76: mt7996: fix fw loading timeout
027bab6a88a3 wifi: mt76: usb: create a dedicated queue for psd traffic
e8909c610c3b wifi: mt76: usb: store usb endpoint in mt76_queue
8b3d96fa4ead wifi: mt76: mt792xu: enable dmashdl support
7864d7ad0ed0 wifi: mt76: mt76x2u: add netgear wdna3100v3 to device table
27c81f7c1480 wifi: mt76: mt7925: fix connect to 80211b mode fail in 2Ghz band
b7443c63069a wifi: mt76: mt7925: fix SAP no beacon issue in 5Ghz and 6Ghz band
bab721a65f5a wifi: mt76: mt7925: fix mcu query command fail
1f0f71ed81e8 wifi: mt76: mt7925: fix wmm queue mapping
bcfe2ad966f3 wifi: mt76: mt7925: fix fw download fail
f982c3d67a29 wifi: mt76: mt7925: fix WoW failed in encrypted mode
6a72716ec213 wifi: mt76: mt7925: fix the wrong header translation config
50928b7e1359 wifi: mt76: mt7925: add flow to avoid chip bt function fail
762ab4530e8f wifi: mt76: mt7925: add support to set ifs time by mcu command
87deaf82efa4 wifi: mt76: mt7925: update PCIe DMA settings
c190c1576522 wifi: mt76: mt7925: support temperature sensor
025d5734caba wifi: mt76: mt7996: check txs format before getting skb by pid
4768bfa2baca wifi: mt76: mt7996: fix TWT issues
a65e3eced907 wifi: mt76: mt7996: disable AMSDU for non-data frames
d71716d93aee wifi: mt76: mt7996: fix incorrect interpretation of EHT MCS caps
f21728f3f4bd wifi: mt76: mt7996: ensure 4-byte alignment for beacon commands
68dad7dacd2a wifi: mt76: mt7996: fix HE beamformer phy cap for station vif
66a28f340cdc wifi: mt76: mt7996: mark GCMP IGTK unsupported
b47ad8a7764e wifi: mt76: mt7996: fix efuse reading issue
c2fc7dae7b72 wifi: mt76: mt7996: remove TXS queue setting
e0f1ed168ed5 wifi: mt76: mt7996: add locking for accessing mapped registers
d0cc92c1fd08 wifi: mt76: connac: set correct muar_idx for mt799x chipsets
ae0c62279adc wifi: mt76: mt7996: fix HIF_TXD_V2_1 value
ecc14276af54 wifi: mt76: mt792x: fix ethtool warning
9827df56b241 wifi: mt76: move wed common utilities in wed.c
dccbd2598505 wifi: mt76: mt7925: fix the wrong data type for scan command
9907f4f20261 wifi: mt76: mt792x: add the illegal value check for mtcl table of acpi
1b088a7ac06d wifi: mt76: mt7921e: fix use-after-free in free_irq()
f3c5b4820d7f wifi: mt76: mt7925e: fix use-after-free in free_irq()
d75eac9f5531 wifi: mt76: mt7921: fix incorrect type conversion for CLC command
7bd5401f5bb1 wifi: mt76: mt792x: fix a potential loading failure of the 6Ghz channel config from ACPI
ea55196bc4a0 wifi: mt76: mt792x: update the country list of EU for ACPI SAR
6124ea9135ed wifi: mt76: mt7921: fix the unfinished command of regd_notifier before suspend

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 114190d8ae)
[rmilecki: add patches/fixes for regressions from this commit]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-05-16 14:44:27 +02:00
Felix Fietkau
a39e47e0c9 mt76: update to Git HEAD (2024-01-18)
83e3947e2c52 linux-firmware: update firmware for MT7922 WiFi device
ddaa8cb6e81a linux-firmware: update firmware for MT7921 WiFi device
f83b1601cc10 linux-firmware: update firmware for MT7922 WiFi device
61d334ab0f33 linux-firmware: add firmware for MT7925
a7836e4c8a60 wifi: mt76: disable HW AMSDU when using fixed rate
a8571ebbcd95 wifi: mt76: check txs format before getting skb by pid
3d5890e2cab3 wifi: mt76: mt7915: fix error recovery with WED enabled
703c26d01197 wifi: mt76: mt7915: add locking for accessing mapped registers
f77188160441 wifi: mt76: mt7915: update mt798x_wmac_adie_patch_7976

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit a28cedbdab)
2024-05-16 14:06:06 +02:00
Tianling Shen
ce2b2bccbc Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-05-14 17:03:00 +08:00
Hauke Mehrtens
01c58a0d2a kernel: bump 5.15 to 5.15.158
Removed because they are upstream:
   generic/backport-5.15/702-v5.19-01-arm64-dts-mediatek-mt7622-add-support-for-coherent-D.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=506ac5538498717fce699feaddb2ed97ae1c3ca7

   generic/backport-5.15/702-v5.19-04-arm64-dts-mediatek-mt7622-introduce-nodes-for-Wirele.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=2f83d3d2cc3c0df89f833cd8c09989187f0c3ce1

Manually adapted:
   generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 1fae75ebd9)
2024-05-13 18:38:23 +03:00
Hauke Mehrtens
438e593f22 kernel: bump 5.15 to 5.15.157
Removed because they are upstream:
   generic/backport-5.15/741-v6.9-01-netfilter-flowtable-validate-pppoe-header.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=d06977b9a4109f8738bb276125eb6a0b772bc433

Removed because they are upstream:
   generic/backport-5.15/741-v6.9-02-netfilter-flowtable-incorrect-pppoe-tuple.patch
   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=e719b52d0c56989b0f3475a03a6d64f182c85b56

Manual adapted the following patches:
   generic/pending-5.15/700-netfilter-nft_flow_offload-handle-netdevice-events-f.patch
   generic/pending-5.15/723-net-mt7531-ensure-all-MACs-are-powered-down-before-r.patch
   generic/hack-5.15/650-netfilter-add-xt_FLOWOFFLOAD-target.patch

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 84d0b0b925)
2024-05-13 14:01:51 +02:00
Hauke Mehrtens
fd42798fea kernel: bump 5.15 to 5.15.156
No manual changes needed.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 1fbe41f489)
2024-05-13 14:01:51 +02:00
Corey Minyard
7a0d5a5c8b ipq40xx: Enable the Engenius EAP1300
Now that DSA is enabled and the MAC addresses are set properly, we can
use it.

Signed-off-by: Corey Minyard <minyard@acm.org>
Link: https://github.com/openwrt/openwrt/pull/15358
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15402
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-05-12 18:59:28 +02:00
Corey Minyard
66952b9ff4 ipq40xx: Properly set MAC addresses for the EAP1300
The code that was there was just taking whatever was left in the
registers, which was just wrong.  Set the addresses using the value from
the u-boot environment, the same way the OEM firmware does.

Signed-off-by: Corey Minyard <minyard@acm.org>
Link: https://github.com/openwrt/openwrt/pull/15358
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15402
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-05-12 18:59:28 +02:00
Corey Minyard
89088ba638 ipq40xx: convert Engenius EAP1300 to DSA
This commit converts the EAP1300 to DSA setup.

Signed-off-by: Corey Minyard <minyard@acm.org>
Link: https://github.com/openwrt/openwrt/pull/15358
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15402
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-05-12 18:59:28 +02:00
Corey Minyard
11b00344d1 ipq40xx: Enable NVMEM_U_BOOT_ENV config
It's needed to get the MAC addresses for the Engenius EAP1300.

Signed-off-by: Corey Minyard <minyard@acm.org>
Link: https://github.com/openwrt/openwrt/pull/15358
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15402
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-05-12 18:59:28 +02:00
Tianling Shen
43d537b6a7 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-05-12 13:05:27 +08:00
David Bauer
447eef2063 mpc85xx: convert WS-AP3710i to simpleImage wrapper
Convert the Enterasys WS-AP3710i access point to use the simpleImage
wrapper.

This is necessary, as the bootlaoder does not align the DTB correctly
(and does not support altering the FDT loadaddress). Booting images with
kernels 5.15 and later can break depending on the alignment on the DTB
within the FIT image.

Compared with the patch applied to master, this compiles the loader at
the changed offset used in OpenWrt master. This is required, as U-Boot
loads the uImage at the offset the loader is currently compiled for.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit eec18118d0)
2024-05-10 19:21:49 +02:00
Kevin Jilissen
5b7240c070 realtek: Trap LLDP packets to the CPU
We should setup the registers for trapping LLDP packets to the CPU.
Currently, these packets are forwarded to all ports which is not desired
behaviour.

Signed-off-by: Kevin Jilissen <info@kevinjilissen.nl>
(cherry picked from commit 5a5c52085a)
2024-05-10 16:08:34 +02:00
Kevin Jilissen
c5ed115104 realtek: Change LLTP register to LLDP
These registers control the handling of Link Layer Discovery Protocol
(LLDP) packets. This seems to be a typo in the naming.

Signed-off-by: Kevin Jilissen <info@kevinjilissen.nl>
(cherry picked from commit 81ab9ef2d1)
2024-05-10 16:08:34 +02:00
Tianling Shen
0761bea043 mediatek: Update Airoha EN8811H 2.5G PHY driver to v1.2.5
Change Log:
[2024/03/08] v1.2.5
1. Added surge 5R API.
2. Add CL22 and CL45 command
* MD32 8811_24030702 updated:
1. Fix the issue of external loopback
2. Fix the issue of down-shift
3. Add surge protection to support 0R and 5R mode
4. Enhance cable diag accuracy of cable length
5. Improved IoT performance and stability

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-05-10 20:45:26 +08:00
Tianling Shen
4619da9658 rockchip: refresh kernel patches
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-05-10 20:04:18 +08:00
Tianling Shen
f125ef8cdb rockchip: fix OF devname configuration for r8169
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 07900bc830)
2024-05-10 20:03:39 +08:00
Felix Fietkau
4be4d20662 mt76: update to Git HEAD (2023-12-18)
bebd9cffc2ae wifi: mt76: mt7921: fix 6GHz disabled by the missing default CLC config

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 1a57d758f2)
[rmilecki: it's a no-change for 23.05 as we had that fix backported]
2024-05-10 11:45:43 +02:00
Felix Fietkau
e32782b2df mt76: update to Git HEAD (2023-12-11)
f63f87cd5b45 wifi: mt76: mt7996: fix shift overflow warning on 32 bit systems

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit da7b0351fc)
[rmilecki: it's a no-change for 23.05 as we had that fix backported]
2024-05-10 11:45:43 +02:00
Rodrigo Balerdi
567af392b6 ipq40xx: whw03v2: change LED color for 'running' state to blue
Change the RGB indicator LED color for the running state from green to
blue. There are various reasons for this change:

- In stock firmware, green means internet connection is up, red means it
  is down, and blue means indeterminate. To track stock behavior as
  closely as possible, OpenWrt should indicate blue by default.

- In the current 23.x OpenWrt releases for this router, the led glows
  blue all the time -not green- because the bootloader sets it blue
  and there is an OpenWrt bug that makes it unable to control the LED.
  The bug is fixed in master, so without this commit there would be an
  unexpected change of behavior for this device in the next release.

- The ports other closely related Linksys devices (such as EA8300 and
  MR8300) get this right and use blue for the running state.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
(cherry picked from commit c2f52e42b1)
Link: https://github.com/openwrt/openwrt/pull/15438
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-05-10 10:56:13 +02:00
Rodrigo Balerdi
3704eb3c3f ipq40xx: whw03v2: fix handling of RGB LED
The RGB LED should glow green in the 'running' state, but it
was glowing cyan because the blue component defaulted to 'on'.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
(cherry picked from commit fc62d66c20)
Link: https://github.com/openwrt/openwrt/pull/15438
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-05-10 10:56:13 +02:00
Tianling Shen
4b1b79e846 Revert "default-settings: set dnsmasq logfacility via uci config"
This reverts commit b0865c8221.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit b3b46ba4f3)
2024-05-09 02:49:30 +08:00
Tianling Shen
d4d3a20d7c default-settings: set dnsmasq logfacility via uci config
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit b0865c8221)
2024-05-08 21:52:30 +08:00
Felix Fietkau
06be957f86 mt76: update to Git HEAD (2023-12-08)
890ae4d717f1 wifi: mt76: mt76x02: fix MT76x0 external LNA gain handling
fcc2f3d82bc9 wifi: mt76: fix lock dependency problem for wed_lock
77cc14596202 wifi: mt76: mt792x: move mt7921_skb_add_usb_sdio_hdr in mt792x module
bc85355885d1 wifi: mt76: mt792x: move some common usb code in mt792x module
c27f01c4c834 wifi: mt76: mt7996: get tx_retries and tx_failed from txfree
30aba4c18307 wifi: mt76: mt7996: Add mcu commands for getting sta tx statistic
119bebff244b wifi: mt76: mt7996: enable PPDU-TxS to host
a4005e0e83e7 wifi: mt76: mt7996: remove periodic MPDU TXS request
d6cc20bf5913 wifi: mt76: reduce spin_lock_bh held up in mt76_dma_rx_cleanup
5d94251d641c wifi: mt76: mt7921: move connac nic capability handling to mt7921
266341b5019d wifi: mt76: mt7921: enable set txpower for UNII-4
581449ac5274 wifi: mt76: mt7921: add 6GHz power type support for clc
9bfd669e9477 wifi: mt76: mt7921: get regulatory information from the clc event
4a0f839da0f1 wifi: mt76: mt7921: update the channel usage when the regd domain changed
f4df423d3d56 wifi: mt76: add ability to explicitly forbid LED registration with DT
54d369e79972 wifi: mt76: mt7921: support 5.9/6GHz channel config in acpi
b39b6cba220f wifi: mt76: mt7996: fix uninitialized variable in parsing txfree
77194e652885 wifi: mt76: fix typo in mt76_get_of_eeprom_from_nvmem function
c37738fc9097 wifi: mt76: limit support of precal loading for mt7915 to MTD only
d6e8aa634a19 wifi: mt76: make mt76_get_of_eeprom static again
d1c671a90eba wifi: mt76: permit to use alternative cell name to eeprom NVMEM load
5539001fe4e3 wifi: mt76: permit to load precal from NVMEM cell for mt7915
48d413380685 wifi: mt76: Remove unnecessary (void*) conversions
ea2814289147 wifi: mt76: mmio: move mt76_mmio_wed_{init,release}_rx_buf in common code
9fb0277d7ee8 wifi: mt76: move mt76_mmio_wed_offload_{enable,disable} in common code
4b47145ecf44 wifi: mt76: move mt76_net_setup_tc in common code
d798d5d6f770 wifi: mt76: introduce mt76_queue_is_wed_tx_free utility routine
48b0cedbf83f wifi: mt76: introduce wed pointer in mt76_queue
c550204e347d wifi: mt76: increase MT_QFLAG_WED_TYPE size
2e7f30f22cfd wifi: mt76: mt7996: add wed tx support
ec8765a02fc8 wifi: mt76: dma: introduce __mt76_dma_queue_reset utility routine
a469aaac9784 wifi: mt76: mt7996: use u16 for val field in mt7996_mcu_set_rro signature
abca260a15c4 wifi: mt76: mt7996: add wed rx support
be2e74c0c495 wifi: mt76: move wed reset common code in mt76 module
7f17e164fbb4 wifi: mt76: mt7996: add wed reset support
0f89bf58efda wifi: mt76: mt7996: add wed rro delete session garbage collector
a58b75f863ca wifi: mt76: mt7915: fallback to non-wed mode if platform_get_resource fails in mt7915_mmio_wed_init()
36d2ddd94eeb wifi: mt76: mt7996: add support for variants with auxiliary RX path
cec7720c9341 wifi: mt76: mt7996: add TX statistics for EHT mode in debugfs
9852093062e8 wifi: mt76: connac: add thermal protection support for mt7996
955540a4df74 wifi: mt76: mt7996: add thermal sensor device support
af41374a3b8e wifi: mt76: connac: add beacon duplicate TX mode support for mt7996
3c98d7b7fa23 wifi: mt76: mt7996: fix the size of struct bss_rate_tlv
ee2169c00539 wifi: mt76: mt7996: adjust WFDMA settings to improve performance
0aead5de68a7 wifi: mt76: connac: set fixed_bw bit in TX descriptor for fixed rate frames
ab5580ff5a4f wifi: mt76: mt7996: handle IEEE80211_RC_SMPS_CHANGED
eed234afed7e wifi: mt76: mt7996: align the format of fixed rate command
d9a855285b95 wifi: mt76: mt7996: fix rate usage of inband discovery frames
47799aefe263 wifi: mt76: change txpower init to per-phy
264e1ecfe1b4 wifi: mt76: mt7996: add txpower setting support
c7b243b127eb wifi: mt76: use chainmask for power delta calculation
05f433900a02 wifi: mt76: mt7996: switch to mcu command for TX GI report
ae963198e605 wifi: mt76: mt7996: fix alignment of sta info event
d0d2e03591d6 wifi: mt76: mt7996: rework ampdu params setting
e87f4efc7638 wifi: mt76: connac: add beacon protection support for mt7996
0dfcc53a8e5d wifi: mt76: connac: fix EHT phy mode check
30c54a53bf8b wifi: mt76: mt7915: fix EEPROM offset of TSSI flag on MT7981
17297c97b737 wifi: mt76: mt7915: also MT7981 is 3T3R but nss2 on 5 GHz band
eeb48c081034 wifi: mt76: mt7996: fix mt7996_mcu_all_sta_info_event struct packing
b74ad922659c wifi: mt76: mt7996: introduce mt7996_band_valid()
51cb541c1e53 wifi: mt76: connac: add firmware support for mt7992
c0eda4d96ec8 wifi: mt76: mt7996: add DMA support for mt7992
f12471968a53 wifi: mt76: mt7996: rework register offsets for mt7992
8d11dae73eb8 wifi: mt76: mt7996: support mt7992 eeprom loading
6c2b2c37abd7 wifi: mt76: mt7996: adjust interface num and wtbl size for mt7992
df1d3b3c67e5 wifi: mt76: connac: add new definition of tx descriptor
f997e759cea5 wifi: mt76: mt7996: add PCI IDs for mt7992
94e3632e4e93 wifi: mt76: mt7925: remove iftype from mt7925_init_eht_caps signature
9c7b98c03173 net: ethernet: mtk_wed: rename mtk_rxbm_desc in mtk_wed_bm_desc
4423b4eb69fb wifi: mt76: mt7996: fix endianness in mt7996_mcu_wed_rro_event
b97d899a7907 wifi: mt76: mt7921: fix kernel panic by accessing invalid 6GHz channel info
9ef06028d4fe wifi: mt76: mt7921s: fix workqueue problem causes STA association fail
95c14207d2a9 wifi: mt76: mt7996: set DMA mask to 36 bits for boards with more than 4GB of RAM
dbea5151412b wifi: mt76: mt7921: reduce the size of MCU firmware download Rx queue
a84a355d2e0a wifi: mt76: mt7921: fix country count limitation for CLC
c498f27ad075 wifi: mt76: mt7921: fix CLC command timeout when suspend/resume
3098d968abe4 wifi: mt76: mt7921: fix wrong 6Ghz power type
7730fc91dd15 wifi: mt76: fix shift overflow warnings on 32 bit systems
f559adf1849c wifi: mt76: fix crash with WED rx support enabled

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 8f782ed07d)
[rmilecki: add patches/fixes for regressions from this commit]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-05-08 15:17:51 +02:00
Felix Fietkau
5c4c9ae059 mt76: update to the latest version
b5d13611d35e mt76: mt7915: fix monitor mode issues
bbbac7deee3d wifi: mt76: rename mt76_packet_id_init/flush to mt76_wcid_init/cleanup
f1e1e67d97d1 wifi: mt76: fix race condition related to checking tx queue fill status
b3f739a64e6b wifi: mt76: mt7996: add eht rx rate support
ca4917062f17 wifi: mt76: mt76x0: remove dead code in mt76x0_phy_get_target_power
325a0c493199 wifi: mt76: mt7996: fill txd by host driver
cd371fcc98d4 mt76: mt7996: sync with upstream
d71f8d1b172b wifi: mt76: use atomic iface iteration for pre-TBTT work
8d5ea32d4895 wifi: mt76: remove unused error path in mt76_connac_tx_complete_skb
01860c02c505 wifi: mt76: add DMA mapping error check in mt76_alloc_txwi()
62ddb6d46a97 wifi: mt76: connac: introduce helper for mt7925 chipset
0837f37e998b wifi: mt76: mt792x: support mt7925 chip init
899ff378082b wifi: mt76: connac: export functions for mt7925
c3858b5bf347 wifi: mt76: connac: add eht support for phy mode config
5df6b26a9fc5 wifi: mt76: connac: add eht support for tx power
a8081345c636 wifi: mt76: connac: add data field in struct tlv
9b38aebecf78 wifi: mt76: connac: add more unified command IDs
84984e6dc87d wifi: mt76: connac: add more unified event IDs
6fe92398c9ce wifi: mt76: mt7996: set correct wcid in txp
2cfe2fb0bb80 wifi: mt76: mt7996: fix beamform mcu cmd configuration
e512241bb5bb wifi: mt76: mt7996: fix beamformee ss subfield in EHT PHY cap
719a98f832c7 wifi: mt76: mt7996: fix wmm queue mapping
9723562f2a5b wifi: mt76: mt7996: fix rx rate report for CBW320-2
1bb5a6a54943 wifi: mt76: mt7996: fix TWT command format
751b054891f6 wifi: mt76: mt7996: only set vif teardown cmds at remove interface
fea1e10c7741 wifi: mt76: mt7996: support more options for mt7996_set_bitrate_mask()
d497ee8aa2f5 wifi: mt76: mt7996: support per-band LED control
8ccc84111141 wifi: mt76: Use PTR_ERR_OR_ZERO() to simplify code
161f70217edf wifi: mt76: mt7921e: Support MT7992 IP in Xiaomi Redmibook 15 Pro (2023)
7d25bfc3f0cc wifi: mt76: fix clang-specific fortify warnings
5971aa968401 wifi: mt76: connac: add MBSSID support for mt7996
5a47dd323be1 wifi: mt76: update beacon size limitation
d5b4b81dcc9e wifi: mt76: check sta rx control frame to multibss capability
af0e1f6dafb5 wifi: mt76: fix potential memory leak of beacon commands
65d91a833b01 wifi: mt76: get rid of false alamrs of tx emission issues
29411e52059f wifi: mt76: fix per-band IEEE80211_CONF_MONITOR flag comparison
4da62774038a wifi: mt76: check vif type before reporting cca and csa
4a85678fe089 wifi: mt76: mt7915: update mpdu density capability
791a45cffadf wifi: mt76: mt7915: fix beamforming availability check
08e1e6cb7d41 wifi: mt76: Drop unnecessary error check for debugfs_create_dir()
d1881b1b2bf6 wifi: mt76: move struct ieee80211_chanctx_conf up to struct mt76_vif
66d5694e1898 wifi: mt76: mt7921: fix the wrong rate pickup for the chanctx driver
9fc37b0ac546 wifi: mt76: mt7921: fix the wrong rate selected in fw for the chanctx driver
2afc7285f75d wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit ef8e2f66f5)
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-05-08 13:39:34 +02:00
Mieczyslaw Nalewaj
ec8f647d16 ipq806x: swap lan leds for Meraki MR52
LAN Leds on Meraki MR52 are wrong and needs to be swapped to actually
reflect real ports (lan1<->lan2).

Fixes: #15388
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/15410
[ wrap commit to 80 columns and improve commit title ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit bd6852185b)
2024-05-07 13:38:17 +02:00
Tianling Shen
55741c4cf2 ramips: rename vendor JD-Cloud to JDCloud
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 2614bc4cef)
2024-05-05 21:54:49 +08:00
Tianling Shen
e540dc745a Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-05-03 22:16:03 +08:00
Christian Marangi
eda76b336b gengetopt: backport patch fixing support for c++17
Backport patch fixing support for c++17 that got merged upstream in
gengetopt.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit a8bfdf2ed4)
2024-05-01 15:46:52 +02:00
Rosen Penev
507f9439e7 lua: fix CVE-2014-5461
Patch taken from Debian.

Refresh patches

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 78b0106f7d)
2024-04-30 23:46:11 +02:00
Hauke Mehrtens
451b51f0dc kernel: bump 5.15 to 5.15.155
Manual adapted the following patches:
   generic/hack-5.15/221-module_exports.patch
   bcm27xx/patches-5.15/950-0008-drm-vc4-hdmi-Use-a-mutex-to-prevent-concurrent-frame.patch
   octeontx/patches-5.15/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 9693ed6a9e)
2024-04-30 23:38:26 +02:00
Josef Schlehofer
ed12436ee9 toolchain/gdb: backport patch for macOS to fix invalid range
With the recent macOS update to Ventura, it looks like gdb could not be
compiled with clang16 and newer version, because it fails with:
./../gdbsupport/enum-flags.h:95:52: error: integer value -1 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion]
    integer_for_size<sizeof (T), static_cast<bool>(T (-1) < T (0))>::type
                                                   ^
./../gdbsupport/enum-flags.h:95:52: error: integer value -1 is outside the valid range of values [0, 1] for this enumeration type [-Wenum-constexpr-conversion]
./../gdbsupport/enum-flags.h:95:52: error: integer value -1 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion]
./../gdbsupport/enum-flags.h:95:52: error: integer value -1 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion]
4 errors generated.

- Upstream bug:
https://sourceware.org/bugzilla/show_bug.cgi?id=30423

- Backported upstream commit:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ae61525fcf456ab395d55c45492a106d1275873a

Fixes: https://github.com/openwrt/openwrt/issues/15314

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15315
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-04-30 12:36:19 +02:00
Tianling Shen
6e84d40642 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-04-30 15:09:29 +08:00
Christian Marangi
2541ff391f procd: make mDNS TXT record parsing more solid
mDNS broadcast can't accept empty TXT record and would fail
registration.

Current procd_add_mdns_service checks only if the first passed arg is
empty but don't make any verification on the other args permittins
insertion of empty values in TXT record.

Example:

	procd_add_mdns "blah" \
				"tcp" "50" \
				"1" \
				"" \
				"3"

Produce:

{ "blah_50": { "service": "_blah._tcp.local", "port": 50, "txt": [ "1", "", "3" ] } }

The middle empty TXT record should never be included as it's empty.

This can happen with scripts that make fragile parsing and include
variables even if they are empty.

Prevent this and make the TXT record more solid by checking every
provided TXT record and include only the non-empty ones.

The fixed JSON is the following:

{ "blah_50": { "service": "_blah._tcp.local", "port": 50, "txt": [ "1", "3" ] } }

Fixes: b0d9dcf84d ("procd: update to latest git HEAD")
Reported-by: Paul Donald <newtwen@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15331
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 4b04304713)
2024-04-29 23:30:04 +02:00
Petr Štetiar
8695bc3442 Revert "uboot-mediatek: fix build on Mac OS X"
This reverts commit 997ff740dc.
78cbd5apick as it should be fixed in commit 78cbd5a57e11 ("tools: macOS:
types.h: fix missing unsigned types").

References: #13833
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit f691830307)
2024-04-27 06:53:23 +00:00
Petr Štetiar
c19f5076a5 Revert "uboot-sunxi: add missing type __u64"
This reverts commit 3cc57ba462 as it
should be fixed in commit 78cbd5a57e11 ("tools: macOS: types.h: fix
missing unsigned types").

References: #13833
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit bc47613cf0)
2024-04-27 06:53:22 +00:00
Petr Štetiar
3d037b8c5f tools: macOS: types.h: fix missing unsigned types
For some reason unsigned types were not added in commit 0a06fcf608
("build: fix kernel 5.4 on macos"), which led to bunch of hacks, like
commit 3cc57ba462 ("uboot-sunxi: add missing type __u64") or
commit 997ff740dc ("uboot-mediatek: fix build on Mac OS X").

So lets add the missing unsigned types to workaround it in a bit more
maintainable way.

Fixes: #13833
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 4a8961f1df)
2024-04-27 06:53:21 +00:00
Petr Štetiar
7c7cc28485 toolchain: kernel-headers: remove debugging env dump
Remove debugging `env` dump left over as build environments might
contain some sensitive information, which then might leak into the build
logs.

Fixes: 2105acbe28 ("kernel-headers: fix compile error caused by wrong host include path when the toolchain is already built")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit def41cf2ba)
2024-04-27 06:52:38 +00:00
Petr Štetiar
c3372266ba toolchain: kernel-headers: fix check target for external Git trees
Executing following command currently fails:

 $ make toolchain/kernel-headers/{download,check} V=sc FIXUP=1
 ...
 include/kernel-version.mk:11: *** Missing kernel version/hash file for . Please create include/kernel-.  Stop.

So lets fix it by adding the necessary missing KERNEL_PATCHVER variable.

That additional kernel-build.mk include is needed to add another set of
missing variables:

 $ make toolchain/kernel-headers/{download,check} V=sc FIXUP=1
 ...
 Makefile:115: *** ERROR: Unknown pack format for file tmp/dl/.  Stop.

Fixes: 0765466a42 ("kernel: split kernel version to dedicated files")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 6b7f1ffbad)
2024-04-27 06:52:34 +00:00
Rafał Miłecki
c69482a912 mac80211: backport ieee80211_set_sband_iftype_data()
It's needed by some drivers, e.g. mt7925, see:
mt7925/main.c:264:9: error: implicit declaration of function '_ieee80211_set_sband_iftype_data' [-Werror=implicit-function-declaration]

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-04-26 11:37:07 +02:00
Rafał Miłecki
17501f822f mac80211: backport ieee80211_vif_is_mld()
It's needed by some drivers, e.g. mt7925, see:
mt7925/mcu.c:2181:23: error: implicit declaration of function 'ieee80211_vif_is_mld' [-Werror=implicit-function-declaration]

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-04-26 11:37:07 +02:00
Tianling Shen
87c33072d8 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-04-25 17:09:33 +08:00
Robert Marko
a48786ef40 tools: b43-tools: fix compilation with GCC14
GCC14 no longer treats integer types and pointer types as equivalent in
assignments (including implied assignments of function arguments and return
values), and instead fails the compilation with a type error.

So, as a workaround lets disable the newly introduced error
-Werror=int-conversion and just make it print a warning to enable compiling
with GCC14 as Fedora 40 now defaults to it.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-04-23 12:36:22 +02:00
Nick Hainke
82ba1d2635 tools/cpio: update to 2.15
Release Notes:
https://lists.gnu.org/archive/html/info-gnu/2024-01/msg00006.html

Fixes: #15228
Signed-off-by: Nick Hainke <vincent@systemli.org>
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-04-22 15:28:12 +02:00
Tianling Shen
2e15fadb5e Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-04-22 15:06:21 +08:00
Zoltan HERPAI
675d9a2d41 sunxi: fix network bringup on Olinuxino Micro boards
It's the A13-based Olinuxino Micro which has only wireless interfaces. The
A20-based board is a fully-fledged one which has an ethernet interface.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2024-04-21 23:26:53 +02:00
Georgi Valkov
2b6b6e2f3c kernel: backport ipeth CDC NCM support
Fixes no communication with tethered iOS devices in CDC NCM mode.
Freshly booted iOS devices start in legacy mode, but are put into
NCM mode by the official Apple driver.

[1] a2d274c62e

Fixes: #12566
Tested-by: Georgi Valkov <gvalkov@gmail.com>
Signed-off-by: Foster Snowhill <forst@pen.gy>
Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
[ better reference fixed issue ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 680f8738d0)
2024-04-21 22:55:37 +02:00
Tianling Shen
a0c4e698e4 rtl88x2bu: remove outdated package
Use upstream kmod-rtw88-8822bu driver instead.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit a6f0ac13f5)
2024-04-19 22:40:26 +08:00
Tianling Shen
8c1af35e87 rtl8821cu: remove package
rtw8821cu support has been merged into mac80211, so remove this old crap.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit a821a4df37)
2024-04-19 22:39:19 +08:00
Tianling Shen
4e4cc39969 rtl8812au-ac: fix build for kernel 5.15
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit e48cf401d9)
2024-04-19 22:38:02 +08:00
Tianling Shen
424161b608 rtl8812au-ac: bump to latest git HEAD
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 9121456421)
2024-04-19 22:37:59 +08:00
Tianling Shen
ee63f5c980 rtl8192eu: fix build for kernel 5.15
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 46bc04b3b4)
2024-04-19 22:36:22 +08:00
Tianling Shen
e2e129134b rtl8192eu: bump to latest git HEAD
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 4688a4913e)
2024-04-19 22:36:19 +08:00
Tianling Shen
409a27a2dd rtl8189es: bump to latest git HEAD
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit b62af9176e)
2024-04-19 22:30:44 +08:00
Tianling Shen
bccd8a59cf rtl8188eu: fix build with mac80211 6.5
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit f28e232554)
2024-04-19 22:28:39 +08:00
Tianling Shen
2ba068cb8f rtl8188eu: bump to latest git HEAD
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 8431ba4193)
2024-04-19 22:26:43 +08:00
Tianling Shen
68ccc7e8a7 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-04-19 16:32:19 +08:00
Christian Marangi
9b33b74ef7 bcm27xx: refresh kernel patches
Refresh kernel patches with make target/linux/refresh.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-04-18 14:14:42 +02:00
Christian Marangi
afb5fdd79a netifd: packet-steering: silence error on applying queue mask
Some queues can't be tweaked and return -ENOENT if it's not multiqueue.

Silence any error from echo to produce a more clean bootlog.

Fixes: #12095
Suggested-by: Andris PE <neandris@gmail.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-04-18 12:43:06 +02:00
Robert Marko
e8cc17e147 config: fix CONFIG_GDB appearing in main menuconfig menu
I noticed that CONFIG_GDB was suddenly appearing in the main menuconfig
menu despite the fact that it should be visible only when TOOLCHAINOPTS
is selected and under a dedicated menu.

After some trial and error, it seems that this was caused by the recent
addition of GCC_USE_DEFAULT_VERSION, and after even more trial and error
it gets fixed as soon GCC_USE_DEFAULT_VERSION is placed after GCC_VERSION.

So, lets simply put GCC_USE_DEFAULT_VERSION after GCC_VERSION.

Fixes: 501ef81040 ("config: select KERNEL_WERROR if building with default GCC version")
Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [rebased]
(cherry picked from commit 12b2cb2ec3)
2024-04-18 11:52:56 +02:00
Daniel Golle
915dfbdbb1 config: select KERNEL_WERROR if building with default GCC version
[ during cherry-pick GCC version was changed to default GCC 12 version ]

At the moment we have to manually follow the default GCC version
also in config/Config-kernel.in. This tends to be forgotten at GCC
version bumps (just happened when switching from version 12 to 13).
Instead, introduce a hidden Kconfig symbol which implies KERNEL_WERROR
in toolchain/gcc/Config.in where it is visible for developers changing
the default version.

Also remove the explicit default on BUILDBOT to avoid a circular
dependency and also because buildbots anyway implicitly always select
the default GCC version.

Reference: https://github.com/openwrt/openwrt/pull/15064
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [GCC 12 default]
(cherry picked from commit 501ef81040)
2024-04-18 11:52:56 +02:00
Petr Štetiar
33612fdb92 kernel: introduce KERNEL_WERROR config option
In commit b2d1eb717b ("generic: 5.15: enable Werror by default for
kernel compile") CONFIG_WERROR=y was enabled and all warnings/errors
reported with GCC 12 were fixed.

Keeping this in sync with past/future GCC versions is going to be uphill
battle, so lets introduce new KERNEL_WERROR config option, enable it by
default only for tested/known working combinations and on buildbots.

References: #12687
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit ce8c639a6c)
2024-04-18 11:52:22 +02:00
Rodrigo Balerdi
677ecd09d2 ipq40xx: whw03v2: enable additional 5 GHz channels
This device supports channel ranges 36-64 and 100-165, just like
others based on the same reference design, but its current DTS is
unnecessarily restricting these ranges to 36-48 and 149-165.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
(cherry picked from commit 1c32cee348)
2024-04-17 13:42:45 +02:00
CheWei Chien
26e882f06f ipq807x: prpl-haze: enable LED driver on device tree
Enable LED driver LP5562 on HAZE device tree and include its kernel
module package on default package for HAZE.

Signed-off-by: CheWei Chien <chewei.chien@wnc.com.tw>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [commit facelift]
(cherry picked from commit fb45194305)
2024-04-17 10:44:57 +00:00
CheWei Chien
726d4be297 kernel: add kmod-leds-lp5562 and kmod-leds-lp55xx-common
Add kernel module for lp5562 LED driver.
The kmod-leds-lp5562 depends on kmod-leds-lp55xx-common.

Signed-off-by: CheWei Chien <chewei.chien@wnc.com.tw>
(cherry picked from commit b33fa6ac90)
2024-04-17 10:43:54 +00:00
Florian Eckert
f2366d75cf .gitignore: ignore link if target is included from feed
If an out of tree target is included via a feed, then there is a link with
the name 'feed' in the target directory. Do not show this link in git.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 13e7a2d19f)
2024-04-17 05:04:46 +00:00
Cedric DOURLENT
340e3dc453 build: fix kernel component in CycloneDX SBOM
As stated in the cycloneDX documentation, the field "type" is mandatory for all components.

More details here (https://cyclonedx.org/docs/1.5/json/#components_items_type)

Signed-off-by: Cedric DOURLENT <cedric.dourlent@softathome.com>
(cherry picked from commit 84331215e5)
2024-04-17 04:34:36 +00:00
Tianling Shen
a30af4c371 kernel: backport fixes for mtk t7xx modules
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-04-15 23:30:29 +08:00
Tianling Shen
c55df0b3eb Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-04-12 11:45:16 +08:00
Daniel Golle
5cae98c25d mvebu: puzzle-m90x: wipe rootfs_data on sysupgrade
The sysupgrade formware of the Puzzle series is a slightly strange
dual-boot approach while remaining compatible with Marvell's SDK
firmware upgrade binary format -- which happens to be a full-disk
image with GPT partition table. Hence that /lib/upgrade/emmc-puzzle.sh
script is like an exotic disease which results from those decisions,
and as we also want to somehow stay compatible with the IEI-World
stock firmware we got to use it in that same way (we are not
compatible with the QNAP-branded identical hardware device anyway).

Currently, on sysupgrade the result is that one ends up with the old
content of rootfs_data (a GPT partition on those devices) as nothing
ever wipes or in any way re-creates the filesystem there. As a simple
work-around, let's kill the filesystem on rootfs_data so fstools
re-formats it on the next boot.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit d4e8653e1e)
2024-04-12 01:51:51 +01:00
Tianling Shen
5796e52ee5 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-04-10 17:07:39 +08:00
Tianling Shen
7e249607f2 include/target: remove 'luci-lib-fs' from 'tweak' set
luci-app-filetransfer seems to be the only user of it, which got removed
earlier. Remove this package too.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 5c56de05dd)
2024-04-09 23:30:47 +08:00
Robert Marko
817a1cb2bf sdk: include lib/crtsavres.o for powerpc
Trying to link certain kernel modules like dahdi-linux when building with
the OpenWrt SDK will fail with:
openwrt-sdk-apm821xx-sata_gcc-13.2.0_musl.Linux-x86_64/staging_dir/toolchain-powerpc_464fp_gcc-13.2.0_musl/bin/powerpc-openwrt-linux-musl-ld: cannot find arch/powerpc/lib/crtsavres.o: No such file or directory

Previously this worked with the PowerPC SDK since we carried a hack that
was passing --save-restore-funcs to module LDFLAGS so the linker provided
the required functions automatically as without --save-restore-funcs it
doesnt do so automatically on relocatable links and as a sideffect did not
require the kernel provided crtsaves.o to link against.

Now that hack has been removed as upstream kernel now compiles crtsaves.o
by default so it can be linked against but its not included in the SDK.

So, lets include lib/crtsavres.o when SDK is generated for PowerPC.

Fixes: 1c28058710 ("kernel: bump 5.15 to 5.15.148")
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-04-09 11:25:41 +02:00
Felix Fietkau
11d88dee1c kernel: backport upstream mediatek WED changes
Reorder and update existing patches

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 6407ef8d2b)
[rmilecki: rebase & fix mt76 compilation]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-04-09 08:48:08 +02:00
Rafał Miłecki
afe2ddf827 mac80211: backport some upstream EHT patches
Those changes are needed by Wi-Fi 7 drivers.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-04-09 08:48:08 +02:00
Tianling Shen
b277d0f345 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-04-08 13:00:33 +08:00
Richard Kunze
77b7c10884 realtek: support common GPIOs on D-Link DGS-1210-16
D-Link DGS-1210-16 hangs when rebooting and has no support for the reset
button.

Fix both by enabling the same GPIOs for reboot and the reset button as
already used for D-Link DGS-1210-20 and D-Link DGS-1210-28.

Signed-off-by: Richard Kunze <kunze@tivano.de>
(cherry picked from commit 92c21b2e18)
2024-04-03 21:32:55 +02:00
Tianling Shen
028b8fe31b README: update domain of build-scripts
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 42903f7971)
2024-04-03 20:40:25 +08:00
Marco von Rosenberg
f314debd4f ath79: add support for Huawei AP5030DN
Huawei AP5030DN is a dual-band, dual-radio 802.11ac Wave 1 3x3 MIMO
enterprise access point with two Gigabit Ethernet ports and PoE
support.

Hardware highlights:
- CPU: QCA9550 SoC at 720MHz
- RAM: 256MB DDR2
- Flash: 32MB SPI-NOR
- Wi-Fi 2.4GHz: QCA9550-internal radio
- Wi-Fi 5GHz: QCA9880 PCIe WLAN SoC
- Ethernet 1: 10/100/1000 Mbps Ethernet through Broadcom B50612E PHY
- Ethernet 2: 10/100/1000 Mbps Ethernet through Marvell 88E1510 PHY
- PoE: input through Ethernet 1 port
- Standalone 12V/2A power input
- Serial console externally available through RJ45 port
- External watchdog: SGM706 (1.6s timeout)

Serial console:
  9600n8 (9600 baud, no stop bits, no parity, 8 data bits)

MAC addresses:
  Each device has 32 consecutive MAC addresses allocated by
  the vendor, which don't overlap between devices.
  This was confirmed with multiple devices with consecutive
  serial numbers.
  The MAC address range starts with the address on the label.
  To be able to distinguish between the interfaces,
  the following MAC address scheme is used:
    - eth0 = label MAC
    - eth1 = label MAC + 1
    - radio0 (Wi-Fi 5GHz) = label MAC + 2
    - radio1 (Wi-Fi 2.4GHz) = label MAC + 3

Installation:
0. Connect some sort of RJ45-to-USB adapter to "Console" port of the AP

1. Power up the AP

2. At prompt "Press f or F  to stop Auto-Boot in 3 seconds",
   do what they say.
   Log in with default admin password "admin@huawei.com".

3. Boot the OpenWrt initramfs from TFTP using the hidden script
   "run ramboot". Replace IP address as needed:

   > setenv serverip 192.168.1.10
   > setenv ipaddr 192.168.1.1
   > setenv rambootfile
     openwrt-ath79-generic-huawei_ap5030dn-initramfs-kernel.bin
   > saveenv
   > run ramboot

4. Optional but recommended as the factory firmware cannot
   be downloaded publicly:
   Back up contents of "firmware" partition using the web interface or ssh:

   $ ssh root@192.168.1.1 cat /dev/mtd11 > huawei_ap5030dn_fw_backup.bin

5. Run sysupgrade using sysupgrade image. OpenWrt
   shall boot from flash afterwards.

Return to factory firmware (using firmware upgrade package downloaded from
non-public Huawei website):
1. Start a TFTP server in the directory where
   the firmware upgrade package is located

2. Boot to u-boot as described above

3. Install firmware upgrade package and format the config partitions:

   > update system FatAP5X30XN_SOMEVERSION.bin
   > format_fs

Return to factory firmware (from previously created backup):
1. Copy over the firmware partition backup to /tmp,
   for example using scp

2. Use sysupgrade with force to restore the backup:
   sysupgrade -F huawei_ap5030dn_fw_backup.bin

3. Boot AP to U-Boot as described above

Quirks and known issues
-----------------------

- On initial power-up, the Huawei-modified bootloader suspends both
ethernet PHYs (it sets the "Power Down" bit in the MII control
register). Unfortunately, at the time of the initial port, the kernel
driver for the B50612E/BCM54612E PHY behind eth0 doesn't have a resume
callback defined which would clear this bit. This makes the PHY unusable
since it remains suspended forever. This is why the backported kernel
patches in this commit are required which add this callback and for
completeness also a suspend callback.

- The stock firmware has a semi dual boot concept where the primary
kernel uses a squashfs as root partition and the secondary kernel uses
an initramfs. This dual boot concept is circumvented on purpose to gain
more flash space and since the stock firmware's flash layout isn't
compatible with mtdsplit.

- The external watchdog's timeout of 1.6s is very hard to satisfy
during bootup. This is why the GPIO15 pin connected to the watchdog input
is configured directly in the LZMA loader to output the CPU_CLK/4 signal
which keeps the watchdog happy until the wdt-gpio kernel driver takes
over. Because it would also take too long to read the whole kernel image
from flash, the uImage header only includes the loader which then reads
the kernel image from flash after GPIO15 is configured.

Signed-off-by: Marco von Rosenberg <marcovr@selfnet.de>
[fixed 6.6 backport patch naming]
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 06cdc07f8c)
2024-04-03 02:56:56 +02:00
Tianling Shen
78032ddfeb Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-04-02 20:20:25 +08:00
Tianling Shen
22ac8e3734 mediatek: enable rootwait for jdcloud re-cp-03
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-04-02 19:49:42 +08:00
Tianling Shen
1444c9da8e mediatek: add Nokia EA0326GMP support
Hardware specification:
  SoC: MediaTek MT7981B 2x A53
  Flash: 128 MB SPI-NAND
  RAM: 256MB
  Ethernet: 4x 10/100/1000 Mbps
  Switch: MediaTek MT7531AE
  WiFi: MediaTek MT7976C
  Button: Reset, WPS/Mesh
  Power: DC 12V 1A

Gain SSH access:
1. Login into web interface, and download the configuration.
2. Download the configration utilities:
   https://firmware.download.immortalwrt.eu.org/cnsztl/mediatek/filogic/openwrt-mediatek-mt7981-nokia-ea0326gmp-config-utils.tar.gz
     These binaries are extraced from the factory firmware, which are
     dynamically linked with aarch64 musl 1.1.24. To use them, you
     must run them under the same runtime environment, otherwise the
     binaries will not work properly!
3. Upload the configuration and utilities to a suitable environment.
4. Uncompress the utilities, move them to '/bin' and give them executable permisison:
   tar -zxf openwrt-mediatek-mt7981-nokia-ea0326gmp-config-utils.tar.gz
   mv mkconfig seama /bin
   chmod +x /bin/mkconfig
   chmod +x /bin/seama
5. Decrypt and uncompress the configuration:
     Enter fakeroot if you are not login as root.
   mkconfig -a de-enca -m EA0326GMP_3FE79221BAAA -i EA0326GMP_3FE79221BAAA-xxxxxxxx-backup.tar.gz -o backup.tar.gz
   tar -zxf backup.tar.gz
6. Edit 'etc/config/dropbear', set 'enable' to '1'.
7. Edit `etc/passwd`, remove root password: 'root::1:0:99999:7:::'.
8. Repack the configuration:
   tar -zcf backup.tar.gz etc/
   mkconfig -a enca -m EA0326GMP_3FE79221BAAA -i backup.tar.gz -o EA0326GMP_3FE79221BAAA-xxxxxxxx-backup.tar.gz
9. Upload new configuration via web interface, now you can SSH to EA0326GMP.

A minimum configuration which enabled SSH access is also provided to simplify the process:
https://firmware.download.immortalwrt.eu.org/cnsztl/mediatek/filogic/openwrt-mediatek-mt7981-nokia-ea0326gmp-enable-ssh.tar.gz

Flash instructions:
1. SSH to EA0326GMP, backup everything, especially 'Factory' part.
2. Write new BL2:
   mtd write immortalwrt-mediatek-filogic-nokia_ea0326gmp-preloader.bin BL2
3. Write new FIP:
   mtd write immortalwrt-mediatek-filogic-nokia_ea0326gmp-bl31-uboot.fip FIP
4. Set static IP on your PC:
   IP 192.168.1.254/24, GW 192.168.1.1
5. Serve ImmortalWrt initramfs image using TFTP server.
6. Cut off the power and re-engage, wait for TFTP recovery to complete.
7. Run 'fw_setenv bootargs' if comes with SNAPSHOT u-boot.
8. After ImmortalWrt has booted, perform sysupgrade.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 767c4681fd)
[updated flash instructions for 23.05 branch]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-04-02 19:41:38 +08:00
Hauke Mehrtens
8f8d5decc9 kernel: bump 5.15 to 5.15.153
Removed because they are upstream:
generic/backport-5.15/704-15-v5.19-net-mtk_eth_soc-move-MAC_MCR-setting-to-mac_finish.patch
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=c5c0760adc260d55265c086b9efb350ea6dda38b

generic/pending-5.15/735-net-mediatek-mtk_eth_soc-release-MAC_MCR_FORCE_LINK-.patch
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=448cc8b5f743985f6d1d98aa4efb386fef4c3bf2

generic/pending-5.15/736-net-ethernet-mtk_eth_soc-fix-PPE-hanging-issue.patch
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=9fcadd125044007351905d40c405fadc2d3bb6d6

Add new configuration symbols for tegra target.

Tested-by: Stijn Segers <foss@volatilesystems.org>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit fb2c6e9d4d)
2024-04-01 02:33:05 +02:00
Allen Zhao
e2f3aefea5 mediatek: filogic: add Unielec U7981-01 support
Hardware specification:
  SoC: MediaTek MT7981B 2x A53
  Flash: 8GB eMMC or 128 MB SPI-NAND
  RAM: 256MB
  Ethernet: 5x 10/100/1000 Mbps
  Switch: MediaTek MT7531AE
  WiFi: MediaTek MT7976C
  Button: Reset
  USB: M.2(B-key) for 4G/5G Module
  Power: DC 12V 1A
  UART: 3.3v, 115200n8
  --------------------------
  |         Layout         |
  |   -----------------    |
  | 4 | VCC RX TX GND | <= |
  |   -----------------    |
  --------------------------

The U-boot menu will automatically appear at startup, and then select
the required options through UP/DOWN Key.

NAND Flash and eMMC Flash instructions:
1. Set your computers IP adress to 192.168.1.2.
2. Run a TFTP server providing the sysupgrade.bin image.
3. Power on the router, into the U-Boot menu.
4. Select "2. Upgrade firmware"
5. Update sysupgrade.bin file name, input server IP and input device
   IP (if they deviate from the defaults)
6. Wait for automatic startup after burning

Signed-off-by: Allen Zhao <allenzhao@unielecinc.com>
(cherry picked from commit 640b0b79ff)
2024-03-31 20:45:20 +02:00
Tianling Shen
705954a51a rockchip: remove redundant 'console' parameter from boot script
ttyS2 is the default console used for all rockchip boards.
The redundant 'console=tty1' parameter now breaks the console due to
recent procd update.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 163c3d0bde)
2024-03-31 20:39:57 +02:00
Tianling Shen
f90b1d9778 rockchip: remove 'swiotlb' parameter from boot script
We have hardware IOMMU support and this is totally unnecessary.
The given value is also unreasonable, it's too small and causes
kernel panic in some cases:

[ 5706.856473] sdhci-dwcmshc fe310000.mmc: swiotlb buffer is full (sz: 28672 bytes), total 512 (slots), used 498 (slots)
[ 5706.864451] sdhci-dwcmshc fe310000.mmc: swiotlb buffer is full (sz: 65536 bytes), total 512 (slots), used 464 (slots)

This parameter seems to be added by mistake, so remove it.

Fixes: e35c7ab51f ("rockchip: merge bootscript")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 50e6c8ae8d)
2024-03-31 20:39:57 +02:00
Felix Fietkau
26548c4254 unetd: update to Git HEAD (2024-03-31)
52144f723bec pex: after receiving data update req, notify peer of local address/port
29aacb9386e0 pex: track indirect hosts (reachable via gateway) as peers without adding them to wg
48049524d4fc pex: do not send peer notifications for hosts with a gateway
12ac684ee22a pex: do not query for hosts with a gateway
203c88857354 pex: fix endian issues on config transfer
a29d45c71bca network: fix endian issue in converting port to network id
cbbe9d337a17 unet-cli: emit id by default
806457664ab6 unet-cli: strip initial newline in usage message

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit a112ed4126)
2024-03-31 19:57:22 +02:00
Tianling Shen
01188f473d scripts/download.pl: remove deprecated onedrive mirror
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 7b72cd5093)
2024-03-30 21:15:20 +08:00
Hauke Mehrtens
ecf390c8ff kernel: bump 5.15 to 5.15.152
Removed because it is upstream:
generic/backport-5.15/081-v5.17-regmap-allow-to-define-reg_update_bits-for-no-bus.patch
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=fbddd48f1456db32b675fad95a902de38345902a

Manual changes needed:
bcm27xx/patches-5.15/950-0470-sound-usb-add-device-quirks-for-A4Tech-FHD-1080p-web.patch

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 2ec025d554)
2024-03-29 14:06:15 +01:00
Hauke Mehrtens
6734cbd9f7 kernel: bump 5.15 to 5.15.151
No manual changes needed.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 0307571124)
2024-03-29 14:05:51 +01:00
Tianling Shen
c9b9f83544 ramips: disable build for tl-wr850n-v2 by default
The flash size is too small to generate complete firmware.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-03-27 17:06:51 +08:00
Tianling Shen
3aa574a966 pcat-manager: adjust stop priority
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 832a56f97c)
2024-03-27 16:16:24 +08:00
Tianling Shen
a7ddb6792e ramips: disable for several tplink devices
The flash size is too small to generate complete firmware.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-03-27 15:26:07 +08:00
Tianling Shen
cfc0d3b5fd ImmortalWrt v23.05.2: revert to branch defaults
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-03-26 13:55:13 +08:00
Sander van Deijck
0a2047cf77 kirkwood: add ix4-200d support to uboot-envtools
This adds support for the Iomega ix4-200d device in uboot-envtools.

Signed-off-by: Sander van Deijck <sander@vandeijck.com>
(cherry picked from commit 2cfe86d383)
2024-03-23 14:58:33 +01:00
2716 changed files with 2075370 additions and 15154 deletions

1
.gitignore vendored
View File

@@ -14,6 +14,7 @@
/feeds
/feeds.conf
/files
/target/linux/feeds
/overlay
/package/feeds
/package/openwrt-packages

View File

@@ -40,6 +40,9 @@ else
include tools/Makefile
include toolchain/Makefile
# Include the test suite Makefile if it exists
-include tests/Makefile
$(toolchain/stamp-compile): $(tools/stamp-compile) $(if $(CONFIG_BUILDBOT),toolchain_rebuild_check)
$(target/stamp-compile): $(toolchain/stamp-compile) $(tools/stamp-compile) $(BUILD_DIR)/.prepared
$(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup)

View File

@@ -2,8 +2,8 @@
# Project ImmortalWrt
ImmortalWrt is a fork of [OpenWrt](https://openwrt.org), with more packages ported, more devices supported, better performance, and special optimizations for mainland China users.<br/>
Compared the official one, we allow to use hacks or non-upstreamable patches / modifications to achieve our purpose. Source from anywhere.
ImmortalWrt is a fork of [OpenWrt](https://openwrt.org), with more packages ported, more devices supported, default optimized profiles and localization modifications for mainland China users.<br/>
Compared to upstream, we allow to use (non-upstreamable) modifications/hacks to provide better feature/performance/support.
Default login address: http://192.168.1.1 or http://immortalwrt.lan, username: __root__, password: _none_.
@@ -18,11 +18,11 @@ If your device is supported, please follow the **Info** link to see install inst
To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sensitive filesystem required). Cygwin is unsupported because of the lack of a case sensitive file system.<br/>
### Requirements
To build with this project, Ubuntu 20.04 LTS is preferred. And you need use the CPU based on AMD64 architecture, with at least 4GB RAM and 25 GB available disk space. Make sure the __Internet__ is accessible.
To build with this project, Debian 11 is preferred. And you need use the CPU based on AMD64 architecture, with at least 4GB RAM and 25 GB available disk space. Make sure the __Internet__ is accessible.
The following tools are needed to compile ImmortalWrt, the package names vary between distributions.
- Here is an example for Ubuntu users:<br/>
- Here is an example for Debian/Ubuntu users:<br/>
- Method 1:
<details>
<summary>Setup dependencies via APT</summary>
@@ -33,16 +33,16 @@ To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sens
sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
bzip2 ccache clang cmake cpio curl device-tree-compiler ecj fastjar flex gawk gettext gcc-multilib \
g++-multilib git gnutls-dev gperf haveged help2man intltool lib32gcc-s1 libc6-dev-i386 libelf-dev \
libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5 \
libncursesw5-dev libpython3-dev libreadline-dev libssl-dev libtool lld llvm lrzsz mkisofs msmtp \
nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pip python3-ply \
python3-docutils python3-pyelftools qemu-utils re2c rsync scons squashfs-tools subversion swig \
texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev
libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses-dev libpython3-dev \
libreadline-dev libssl-dev libtool libyaml-dev libz-dev lld llvm lrzsz mkisofs msmtp nano \
ninja-build p7zip p7zip-full patch pkgconf python3 python3-pip python3-ply python3-docutils \
python3-pyelftools qemu-utils re2c rsync scons squashfs-tools subversion swig texinfo uglifyjs \
upx-ucl unzip vim wget xmlto xxd zlib1g-dev
```
</details>
- Method 2:
```bash
sudo bash -c 'bash <(curl -s https://build-scripts.immortalwrt.eu.org/init_build_environment.sh)'
sudo bash -c 'bash <(curl -s https://build-scripts.immortalwrt.org/init_build_environment.sh)'
```
Note:

749
build_openwrt.sh Executable file
View File

@@ -0,0 +1,749 @@
#!/usr/bin/env bash
#====================================================
# OpenWrt 构建管理脚本
# 功能:提供交互式菜单,可选择执行特定操作
# 更新2025-04-05
#====================================================
#---------------基础配置---------------#
# 日志目录设置
LOGS_ROOT="openwrt_logs"
SESSION_DIR="${LOGS_ROOT}/$(date +%Y%m%d_%H%M%S)"
LOG_FILE="${SESSION_DIR}/main_build_script.log" # 主脚本日志文件名更改,更清晰
#---------------清理配置---------------#
# 需要移除的目录列表 (示例,根据你的需要添加)
declare -a REMOVE_DIRS=(
# "feeds/packages/net/v2ray-geodata" # 示例
)
# 需要移除的包列表 (示例,根据你的需要添加)
declare -a REMOVE_PACKAGES=(
# "package/feeds/luci/luci-app-example" # 示例
)
#---------------自定义包配置---------------#
# 定义自定义包配置,格式:[包名]=[目标目录]=[仓库URL]=[分支]=[是否使用--depth 1]
declare -A CUSTOM_PACKAGES=(
["partexp"]="package/luci-app-partexp=https://github.com/sirpdboy/luci-app-partexp=main=false"
["openclash"]="package/openclash=https://github.com/vernesong/OpenClash=dev=true"
["zerotier"]="package/luci-app-zerotier=https://github.com/Firsgith/luci-app-zerotier.git=main=false"
["5gsupport"]="package/5G-Modem-Support=https://nanako.site/gitea/Nanako/openwrt-app-actions.git=main=false"
["pcat"]="package/pcat-manager=https://github.com/photonicat/rockchip_rk3568_pcat_manager.git=master=true"
)
#---------------日志系统---------------#
# 保存原始的标准输出和错误输出文件描述符
exec {STDOUT_ORIG}>&1
exec {STDERR_ORIG}>&2
# 全局变量标记日志是否启用
LOGGING_ENABLED=false # 初始为 false由 init_logger 启用
# 初始化日志系统
init_logger() {
# 创建日志目录结构
mkdir -p "$SESSION_DIR" || {
echo "错误: 无法创建日志目录: $SESSION_DIR" >&2
exit 1
}
LOGGING_ENABLED=true
echo "日志将保存在: $SESSION_DIR"
echo "主脚本日志: $LOG_FILE"
# 重定向主脚本的 stdout 和 stderr 到 tee同时输出到控制台和主日志文件
# 使用 process substitution 和 tee
exec > >(tee -a "$LOG_FILE")
exec 2> >(tee -a "$LOG_FILE" >&2)
# 记录初始信息到日志
echo "[$(date "+%Y-%m-%d %H:%M:%S")] [INFO]: 日志系统初始化完成。主日志文件: $LOG_FILE"
}
# 创建新的特定构建阶段的日志文件
create_build_log() {
local build_type=$1
local timestamp=$(date +%Y%m%d_%H%M%S)
# 使用更明确的文件名
BUILD_LOG_FILE="${SESSION_DIR}/${build_type}_build_${timestamp}.log"
# 确保文件被创建,即使命令没有输出
touch "$BUILD_LOG_FILE" || {
log "ERROR" "无法创建构建日志文件: $BUILD_LOG_FILE"
return 1
}
# 返回创建的日志文件名
echo "$BUILD_LOG_FILE"
return 0
}
# 禁用日志重定向 (用于 menuconfig 等交互场景)
disable_logging() {
if [ "$LOGGING_ENABLED" = true ]; then
log "DEBUG" "禁用日志重定向,恢复原始标准输出/错误。"
exec >&$STDOUT_ORIG
exec 2>&$STDERR_ORIG
LOGGING_ENABLED=false # 标记为禁用
fi
}
# 启用日志重定向 (恢复)
enable_logging() {
# 仅在之前被禁用的情况下才重新启用
if [ "$LOGGING_ENABLED" = false ]; then
# 重新应用重定向到主日志
exec > >(tee -a "$LOG_FILE")
exec 2> >(tee -a "$LOG_FILE" >&2)
LOGGING_ENABLED=true # 标记为启用
log "DEBUG" "重新启用日志重定向到主日志。"
fi
}
# 设置终端颜色
setup_colors() {
if [[ -t 1 ]]; then # 检查标准输出是否连接到终端
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
else
RED='' GREEN='' YELLOW='' BLUE='' NC=''
fi
}
# 记录日志函数 - 使用此函数来明确日志级别
# 注意:此函数输出会经过 init_logger 设置的全局重定向
log() {
local level=$1
local message=$2
local timestamp
timestamp=$(date "+%Y-%m-%d %H:%M:%S")
local color="" level_str=""
case $level in
"INFO") color="$GREEN"; level_str="INFO " ;; # 加空格对齐
"WARN") color="$YELLOW"; level_str="WARN " ;;
"ERROR") color="$RED"; level_str="ERROR" ;;
"DEBUG") color="$BLUE"; level_str="DEBUG" ;;
*) color=""; level_str="LOG " ;; # 默认级别
esac
# 使用 printf 保证原子写入,减少并发问题
printf "[%s] %b[%s]%b: %s\n" "$timestamp" "$color" "$level_str" "$NC" "$message"
}
# 同时记录消息到主日志和特定的构建日志
log_to_both() {
local level=$1
local message=$2
local build_log_file=$3 # 明确参数名
# 1. 输出到主日志(通过全局重定向和 log 函数)
log "$level" "$message"
# 2. 追加到指定的构建日志文件
local timestamp
timestamp=$(date "+%Y-%m-%d %H:%M:%S")
# 直接追加,不需要颜色代码
printf "[%s] [%s]: %s\n" "$timestamp" "$level" "$message" >> "$build_log_file"
}
#---------------自定义包管理函数---------------#
# 更新单个自定义包
update_single_package() {
local pkg_name=$1
local config=$2
# 解析配置 (保持 cut 的方式,假设路径/URL/分支名不含 '=')
# 如果遇到问题,可以切换到 IFS/read
local target_dir repo_url branch use_depth
target_dir=$(echo "$config" | cut -d= -f1)
repo_url=$(echo "$config" | cut -d= -f2)
branch=$(echo "$config" | cut -d= -f3)
use_depth=$(echo "$config" | cut -d= -f4)
# 基础验证
if [ -z "$target_dir" ] || [ -z "$repo_url" ]; then
log "ERROR" "包 '$pkg_name' 的配置无效: $config"
return 1
fi
log "INFO" "更新自定义包: $pkg_name..."
# 检查目标目录的父目录是否存在
local parent_dir
parent_dir=$(dirname "$target_dir")
if [ ! -d "$parent_dir" ]; then
log "INFO" "创建父目录: $parent_dir"
mkdir -p "$parent_dir" || {
log "ERROR" "无法创建父目录: $parent_dir"
return 1
}
fi
# 移除现有目录
if [ -d "$target_dir" ]; then
log "INFO" "移除现有目录: $target_dir"
rm -rf "$target_dir" || {
log "ERROR" "无法删除目录: $target_dir"
return 1
}
fi
# 准备 git clone 命令参数数组 (移除 eval)
local git_options=("--progress") # 总是显示进度
# 处理分支
if [ -n "$branch" ] && [ "$branch" != "master" ]; then
git_options+=("-b" "$branch")
fi
# 处理 depth
if [ "$use_depth" = "true" ]; then
git_options+=("--depth" "1")
fi
# 执行克隆
log "INFO" "执行: git clone ${git_options[*]} $repo_url $target_dir"
if git clone "${git_options[@]}" "$repo_url" "$target_dir"; then
log "INFO" "包 '$pkg_name' 更新成功"
return 0
else
log "ERROR" "克隆包 '$pkg_name' 失败 (仓库: $repo_url)"
# 尝试给出更具体的错误提示
log "ERROR" "请检查网络连接、仓库 URL、分支名称以及目标目录权限。"
# 保留可能存在的空目录或部分克隆,让用户检查
# rm -rf "$target_dir" # 不再自动删除失败的克隆
return 1
fi
}
# 更新所有自定义包的主函数
update_custom_package() {
local failed_packages=()
local success_count=0
local total_packages=${#CUSTOM_PACKAGES[@]}
if [ "$total_packages" -eq 0 ]; then
log "INFO" "没有配置自定义包,跳过更新。"
return 0
fi
log "INFO" "开始更新 $total_packages 个自定义包..."
for pkg_name in "${!CUSTOM_PACKAGES[@]}"; do
# 使用 subshell 执行,避免污染当前环境的变量,但这里影响不大
if update_single_package "$pkg_name" "${CUSTOM_PACKAGES[$pkg_name]}"; then
((success_count++))
else
failed_packages+=("$pkg_name")
fi
done
# 显示更新结果
if [ ${#failed_packages[@]} -eq 0 ]; then
log "INFO" "所有自定义包更新成功 ($success_count/$total_packages)"
return 0
else
log "WARN" "部分自定义包更新失败 (成功: $success_count/$total_packages)"
log "ERROR" "更新失败的包: ${failed_packages[*]}"
return 1 # 返回失败状态码
fi
}
# 更新特定自定义包
update_specific_package() {
local pkg_name=$1
if [ -z "$pkg_name" ]; then
log "ERROR" "未指定包名"
return 1
fi
if [ -z "${CUSTOM_PACKAGES[$pkg_name]}" ]; then
log "ERROR" "未找到包配置:'$pkg_name'"
log "INFO" "可用的包名: ${!CUSTOM_PACKAGES[*]}"
return 1
fi
update_single_package "$pkg_name" "${CUSTOM_PACKAGES[$pkg_name]}"
}
#---------------基础功能函数---------------#
# 清理工作区 (make clean 的替代方案,更彻底)
clean_workspace() {
log "INFO" "开始彻底清理工作区..."
# 清理 feeds (可选,如果 feeds 内容经常变动或出问题可以启用)
# log "INFO" "执行 ./scripts/feeds clean ..."
# ./scripts/feeds clean || log "WARN" "./scripts/feeds clean 执行时遇到问题。"
# 清理编译产物和临时文件
log "INFO" "执行 rm -rf ./tmp ./logs ./staging_dir ./build_dir ./bin ..."
# 注意:这里移除了 logs 目录,但我们的脚本日志在 openwrt_logs 下,不会被删
# 如果 OpenWrt 自身有 logs 目录且需要保留,则从下面移除 ./logs
rm -rf ./tmp ./logs ./staging_dir ./build_dir ./bin || {
log "ERROR" "删除部分工作区目录失败,请检查权限或文件占用。"
return 1
}
log "INFO" "工作区清理完成。"
return 0
}
# 清理编译临时文件 (make clean 的快速版)
clean_build_temp() {
log "INFO" "开始清理编译临时文件..."
log "INFO" "执行 rm -rf ./tmp ./staging_dir ./build_dir ..."
rm -rf ./tmp ./staging_dir ./build_dir || {
log "ERROR" "删除部分编译临时目录失败。"
return 1
}
log "INFO" "编译临时文件清理完成。"
return 0
}
# 更新源码
update_source() {
log "INFO" "开始更新 OpenWrt 源码 (git pull)..."
if git pull --rebase; then # 使用 rebase 避免不必要的 merge commit
log "INFO" "源码更新完成"
return 0
else
log "ERROR" "源码更新失败 (git pull --rebase)"
log "WARN" "请检查本地是否有未提交的修改,或尝试手动解决 Git 冲突。"
return 1
fi
}
# 更新并安装 feeds
update_feeds() {
log "INFO" "开始更新 Feeds (update -a)..."
if ./scripts/feeds update -a; then
log "INFO" "Feeds 更新成功,开始安装 (install -a)..."
if ./scripts/feeds install -a; then
log "INFO" "Feeds 安装成功"
return 0
else
log "ERROR" "Feeds 安装失败 (install -a)"
return 1
fi
else
log "ERROR" "Feeds 更新失败 (update -a)"
return 1
fi
}
# 执行构建相关命令,并将 stdout 重定向到日志stderr 同时输出到控制台和日志
run_build_command() {
local cmd=$1 # 要执行的命令字符串
local log_file=$2 # 目标日志文件
local description=$3 # 操作描述
log_to_both "INFO" "开始执行: $description" "$log_file"
log "DEBUG" "命令详情: $cmd" # 只记录到主日志
# 执行命令
# stdout (>>) 追加到日志文件
# stderr (2>) 通过管道给 tee
# tee -a "$log_file" 将 stderr 追加到日志文件
# tee 默认将其标准输入复制到标准输出,这里即脚本的 stderr因此会显示在控制台
local start_time end_time duration
start_time=$(date +%s)
if eval "$cmd" >> "$log_file" 2> >(tee -a "$log_file" >&2); then
end_time=$(date +%s)
duration=$((end_time - start_time))
log_to_both "INFO" "$description 完成 (耗时: ${duration}s)" "$log_file"
return 0 # 成功返回 0
else
end_time=$(date +%s)
duration=$((end_time - start_time))
local exit_code=$? # 获取命令的退出码
# 错误信息已经通过 stderr 的 tee 输出到控制台了
log_to_both "ERROR" "$description 失败 (退出码: $exit_code, 耗时: ${duration}s)" "$log_file"
log "ERROR" "详细错误请查看控制台输出以及日志文件: $log_file"
return $exit_code # 失败返回命令的退出码
fi
}
# 编译固件
build_firmware() {
# 创建新的固件编译日志文件
local current_log
current_log=$(create_build_log "firmware") || return 1 # 创建失败则退出
log "INFO" "开始编译固件..."
log "INFO" "详细编译日志将保存在: $current_log"
# 1. 下载依赖包
local download_cmd="make download -j$(nproc) V=s"
run_build_command "$download_cmd" "$current_log" "下载依赖包" || {
log "ERROR" "依赖包下载失败,编译中止。"
# 即使下载失败,日志文件也已包含错误信息
return 1
}
# 2. 多线程编译
local cpu_cores
cpu_cores=$(nproc)
log "INFO" "检测到 $cpu_cores 个 CPU 核心,开始多线程编译..."
local build_cmd="make -j${cpu_cores} V=s"
if run_build_command "$build_cmd" "$current_log" "固件编译 (多线程)"; then
log "INFO" "${GREEN}固件编译成功完成!${NC}"
log "INFO" "固件输出目录: ./bin/targets/"
return 0 # 编译成功
else
# 多线程编译失败,询问用户是否重试
log "WARN" "多线程编译失败。"
local retry_choice
# -r: raw input, -p: prompt, -n 1: read only one char (optional but nice), -t 15: timeout (optional)
# Default to No
read -rp "$(echo -e ${YELLOW}"是否尝试使用单线程重新编译? (y/N): "${NC})" -n 1 -t 30 retry_choice
echo # Add a newline after read -n
if [[ "$retry_choice" =~ ^[Yy]$ ]]; then
log "INFO" "用户选择使用单线程重试编译..."
# 3. 单线程编译重试
local build_cmd_single="make -j1 V=s"
if run_build_command "$build_cmd_single" "$current_log" "固件编译 (单线程重试)"; then
log "INFO" "${GREEN}单线程编译成功完成!${NC}"
log "INFO" "固件输出目录: ./bin/targets/"
return 0 # 单线程编译成功
else
log "ERROR" "${RED}单线程编译也失败了。${NC}"
log "ERROR" "请仔细检查控制台错误输出以及日志文件: $current_log"
return 1 # 最终编译失败
fi
else
log "INFO" "用户选择不进行单线程重试编译。"
log "ERROR" "${RED}编译失败,未进行单线程重试。${NC}"
log "ERROR" "请仔细检查控制台错误输出以及日志文件: $current_log"
return 1 # 用户取消重试,编译失败
fi
fi
}
# 清理配置文件中指定的旧包/目录
clean_packages() {
log "INFO" "开始清理配置文件中指定的旧包和目录..."
local removed_count=0
local failed_count=0
local total_to_remove=$((${#REMOVE_DIRS[@]} + ${#REMOVE_PACKAGES[@]}))
if [ "$total_to_remove" -eq 0 ]; then
log "INFO" "配置文件中未指定需要移除的包或目录。"
return 0
fi
# 清理目录
for dir in "${REMOVE_DIRS[@]}"; do
if [ -e "$dir" ]; then # 使用 -e 检查文件或目录是否存在
log "INFO" "正在删除目录: $dir"
if rm -rf "$dir"; then
log "INFO" "已删除: $dir"
((removed_count++))
else
log "ERROR" "删除失败: $dir (请检查权限或是否被占用)"
((failed_count++))
fi
else
log "WARN" "指定的目录不存在,跳过: $dir"
fi
done
# 清理包 (通常包也是目录)
for pkg in "${REMOVE_PACKAGES[@]}"; do
if [ -e "$pkg" ]; then
log "INFO" "正在删除包/目录: $pkg"
if rm -rf "$pkg"; then
log "INFO" "已删除: $pkg"
((removed_count++))
else
log "ERROR" "删除失败: $pkg (请检查权限或是否被占用)"
((failed_count++))
fi
else
log "WARN" "指定的包/目录不存在,跳过: $pkg"
fi
done
if [ $failed_count -eq 0 ]; then
log "INFO" "旧包/目录清理完成,共处理 $removed_count 个项目。"
return 0
else
log "WARN" "旧包/目录清理部分完成 (成功: $removed_count, 失败: $failed_count)"
return 1 # 返回失败状态码
fi
}
# 更新所有组件 (源码 -> 清理旧包 -> 自定义包 -> feeds)
update_all_components() {
log "INFO" "开始更新所有组件..."
local success=true # 假设成功
# 1. 更新源码
log "INFO" "[1/4] 更新 OpenWrt 源码..."
update_source || success=false
# 2. 清理旧包 (即使上一步失败也尝试清理)
log "INFO" "[2/4] 清理配置文件指定的旧包/目录..."
clean_packages || log "WARN" "清理旧包/目录时遇到问题,继续执行..." # 清理失败通常不阻止后续
# 3. 更新自定义包 (只有在源码更新成功时才执行较好)
if [ "$success" = true ]; then
log "INFO" "[3/4] 更新自定义包..."
update_custom_package || success=false
else
log "WARN" "[3/4] 跳过更新自定义包,因为源码更新失败。"
fi
# 4. 更新 Feeds (只有在源码和自定义包都成功时执行较好)
if [ "$success" = true ]; then
log "INFO" "[4/4] 更新 Feeds..."
update_feeds || success=false
else
log "WARN" "[4/4] 跳过更新 Feeds因为之前的步骤失败。"
fi
# 总结
if [ "$success" = true ]; then
log "INFO" "所有组件更新完成!"
return 0
else
log "ERROR" "部分或全部组件更新失败,请检查上面的日志。"
return 1
fi
}
# 菜单配置 (make menuconfig)
menuconfig() {
log "INFO" "准备进入菜单配置 (make menuconfig)..."
log "INFO" "注意:日志重定向将暂时禁用以进行交互。"
# 禁用日志重定向,否则 menuconfig 界面可能显示不正常
disable_logging
# 执行 menuconfig
if make menuconfig; then
# 配置成功后重新启用日志
enable_logging
log "INFO" "菜单配置完成。新配置已保存到 .config"
# 询问是否保存 defconfig (可选)
# read -p "是否将当前配置保存为 defconfig? (y/N): " save_defconfig
# if [[ "$save_defconfig" =~ ^[Yy]$ ]]; then
# ./scripts/diffconfig.sh > my_defconfig
# log "INFO" "当前配置已保存到 my_defconfig"
# fi
return 0
else
# 配置失败或被取消,也要恢复日志
enable_logging
log "WARN" "菜单配置未完成或被取消。"
return 1 # 返回失败状态码
fi
}
#---------------组合功能函数---------------#
# 完整构建流程
full_build() {
log "INFO" "启动完整构建流程..."
local step=1
local total_steps=6 # 预估步骤数
# 1. 清理工作区
log "INFO" "[${step}/${total_steps}] 清理工作区..."
clean_workspace || { log "WARN" "工作区清理可能不完整,尝试继续..."; } # 清理失败通常不致命
((step++))
# 2. 更新源码
log "INFO" "[${step}/${total_steps}] 更新源码..."
update_source || { log "ERROR" "源码更新失败,终止构建流程。"; return 1; }
((step++))
# 3. 清理旧包
log "INFO" "[${step}/${total_steps}] 清理配置文件指定的旧包..."
clean_packages || log "WARN" "清理旧包时遇到问题,继续执行..."
((step++))
# 4. 更新自定义包
log "INFO" "[${step}/${total_steps}] 更新自定义包..."
update_custom_package || { log "ERROR" "自定义包更新失败,终止构建流程。"; return 1; }
((step++))
# 5. 更新 Feeds
log "INFO" "[${step}/${total_steps}] 更新 Feeds..."
update_feeds || { log "ERROR" "Feeds 更新失败,终止构建流程。"; return 1; }
((step++))
# 6. 菜单配置
log "INFO" "[${step}/${total_steps}] 进入菜单配置 (make menuconfig)..."
menuconfig || { log "WARN" "菜单配置未完成或取消,但继续尝试编译..."; } # 允许使用现有配置编译
((step++)) # 无论成功与否,都算一步
# 7. 编译固件 (独立步骤,不计入前面的 total_steps)
log "INFO" "所有准备工作完成,开始编译固件..."
if build_firmware; then
log "INFO" "${GREEN}完整构建流程成功完成!${NC}"
return 0
else
log "ERROR" "${RED}完整构建流程失败于编译阶段。${NC}"
return 1
fi
}
#---------------菜单函数---------------#
# 打印主菜单
print_menu() {
echo -e "\n${BLUE}======= OpenWrt 构建管理菜单 =======${NC}"
echo -e " ${YELLOW}会话日志目录: ${SESSION_DIR}${NC}"
echo -e "${GREEN} 1.${NC} ${BOLD}完整构建流程${NC} (清理 > 更新源码/包/feeds > 配置 > 编译)"
echo -e "${GREEN} 2.${NC} 清理工作区 (删除 tmp, bin, build_dir 等)"
echo -e "${GREEN} 3.${NC} 更新所有组件 (源码 + 旧包清理 + 自定义包 + feeds)"
echo -e "${GREEN} 4.${NC} 清理配置文件指定的旧包/目录"
echo -e "${GREEN} 5.${NC} ${BOLD}编译固件${NC} (make V=s)"
echo -e "${GREEN} 6.${NC} 调整配置 (make menuconfig)"
echo -e "${GREEN} 7.${NC} 更新所有自定义包"
echo -e "${GREEN} 8.${NC} 更新特定的自定义包"
echo -e "${GREEN} 9.${NC} 更新 OpenWrt 源码 (git pull)"
echo -e "${GREEN}10.${NC} 更新并安装 Feeds"
echo -e "-------------------------------------"
echo -e "${GREEN} 0.${NC} 退出脚本"
echo -e "${BLUE}====================================${NC}"
# 使用 read -p 提供提示
read -rp "请输入选项 [0-10]: " choice
}
# 打印并选择特定自定义包进行更新
select_specific_package() {
local pkg_names=("${!CUSTOM_PACKAGES[@]}") # 获取所有包名
local num_packages=${#pkg_names[@]}
if [ "$num_packages" -eq 0 ]; then
log "WARN" "没有配置任何自定义包。"
return 1
fi
echo -e "\n${BLUE}--- 选择要更新的自定义包 ---${NC}"
local i=1
# 使用 sort 命令让包名按字母排序显示
local sorted_pkg_names=($(printf "%s\n" "${pkg_names[@]}" | sort))
for pkg_name in "${sorted_pkg_names[@]}"; do
echo -e " ${GREEN}$i.${NC} $pkg_name"
((i++))
done
echo -e " ${GREEN}0.${NC} 返回主菜单"
echo -e "${BLUE}----------------------------${NC}"
local choice_pkg
read -rp "请输入包的序号 [0-$num_packages]: " choice_pkg
# 验证选择
if [[ ! "$choice_pkg" =~ ^[0-9]+$ ]]; then
log "ERROR" "无效输入,请输入数字。"
return 1
fi
if [ "$choice_pkg" -eq 0 ]; then
log "INFO" "返回主菜单。"
return 0 # 返回成功,表示正常退出选择
elif [ "$choice_pkg" -ge 1 ] && [ "$choice_pkg" -le "$num_packages" ]; then
local selected_pkg=${sorted_pkg_names[$((choice_pkg-1))]}
log "INFO" "选择更新包: $selected_pkg"
update_specific_package "$selected_pkg" # 调用更新函数
return $? # 返回更新函数的执行结果
else
log "ERROR" "无效的选择序号: $choice_pkg"
return 1
fi
}
#---------------主函数---------------#
main() {
# 0. 设置颜色变量
setup_colors
# 1. 初始化日志系统 (会进行第一次输出重定向)
init_logger || exit 1 # 初始化失败则退出
# 2. 检查运行环境和依赖
log "INFO" "检查运行环境..."
local dep_missing=false
if [ ! -f "Makefile" ] || [ ! -d "scripts" ] || [ ! -d ".git" ]; then
log "ERROR" "脚本必须在 OpenWrt 源码的根目录下运行 (需要存在 Makefile, scripts, .git)。"
dep_missing=true
fi
for cmd in git make nproc tee cut dirname mkdir rm git date printf sort read; do
if ! command -v "$cmd" &> /dev/null; then
log "ERROR" "缺少必要的系统命令: $cmd"
dep_missing=true
fi
done
if [ "$dep_missing" = true ]; then
log "ERROR" "环境或依赖检查失败,请修正后重试。"
# 恢复原始输出,避免后续可能的错误信息无法显示
exec >&$STDOUT_ORIG
exec 2>&$STDERR_ORIG
exit 1
fi
log "INFO" "环境检查通过。"
# 记录脚本启动信息
log "INFO" "${BOLD}OpenWrt 构建管理脚本已启动${NC}"
log "INFO" "PID: $$"
log "INFO" "会话日志目录: $SESSION_DIR"
# 3. 主菜单循环
local choice # 提前声明 choice
while true; do
print_menu # 显示菜单并获取输入到 choice 变量
log "DEBUG" "用户选择了: $choice" # 记录用户选择
# 根据选择执行操作
case $choice in
1) full_build ;;
2) clean_workspace ;;
3) update_all_components ;;
4) clean_packages ;;
5) build_firmware ;;
6) menuconfig ;;
7) update_custom_package ;;
8) select_specific_package ;;
9) update_source ;;
10) update_feeds ;;
0)
log "INFO" "收到退出命令,正在退出脚本..."
# 恢复原始输出流 (好习惯)
exec >&$STDOUT_ORIG
exec 2>&$STDERR_ORIG
echo -e "${GREEN}脚本已退出。${NC}"
exit 0
;;
*)
log "WARN" "无效的选项: '$choice',请输入 0 到 10 之间的数字。"
;;
esac
local last_exit_code=$? # 获取上一个命令的退出状态码
# 操作完成后暂停,给用户查看结果的时间
if [[ $choice != 0 ]]; then
if [ $last_exit_code -eq 0 ]; then
echo -e "\n${GREEN}操作 '$choice' 执行完成。${NC}"
else
echo -e "\n${RED}操作 '$choice' 执行时遇到错误 (退出码: $last_exit_code)。${NC}"
fi
echo -e "${YELLOW}按 Enter 键返回主菜单...${NC}"
read -r # 等待用户按回车
fi
done
}
#---------------脚本入口---------------#
# 将所有主逻辑放入 main 函数,并在最后调用它
# "$@" 将所有命令行参数传递给 main 函数 (虽然本脚本目前未使用)
main "$@"

View File

@@ -157,16 +157,6 @@ config KERNEL_KASAN
Currently CONFIG_KASAN doesn't work with CONFIG_DEBUG_SLAB
(the resulting kernel does not boot).
config KERNEL_KASAN_EXTRA
bool "KAsan: extra checks"
depends on KERNEL_KASAN && KERNEL_DEBUG_KERNEL
help
This enables further checks in the kernel address sanitizer, for now
it only includes the address-use-after-scope check that can lead
to excessive kernel stack usage, frame size warnings and longer
compile time.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 has more
config KERNEL_KASAN_VMALLOC
bool "Back mappings in vmalloc space with real shadow memory"
depends on KERNEL_KASAN
@@ -362,7 +352,6 @@ config KERNEL_DEBUG_INFO
This will compile your kernel and modules with debug information.
config KERNEL_DEBUG_INFO_BTF
bool "Enable additional BTF type information"
default y if (TARGET_armsr || TARGET_bcm27xx || TARGET_ipq806x_chromium || TARGET_ipq807x || TARGET_mediatek_filogic || TARGET_mvebu_cortexa53 || TARGET_mvebu_cortexa72 || TARGET_rockchip || TARGET_sunxi || TARGET_x86_64) && BUILDBOT
depends on !HOST_OS_MACOS
@@ -375,9 +364,13 @@ config KERNEL_DEBUG_INFO_BTF
Required to run BPF CO-RE applications.
config KERNEL_DEBUG_INFO_BTF_MODULES
def_bool y
depends on KERNEL_DEBUG_INFO_BTF
config KERNEL_MODULE_ALLOW_BTF_MISMATCH
bool "Allow loading modules with non-matching BTF type info"
depends on KERNEL_DEBUG_INFO_BTF
depends on KERNEL_DEBUG_INFO_BTF_MODULES
default y
help
For modules whose split BTF does not match vmlinux, load without
@@ -1364,3 +1357,17 @@ config KERNEL_UBIFS_FS_SECURITY
config KERNEL_JFFS2_FS_SECURITY
bool "JFFS2 Security Labels"
config KERNEL_WERROR
bool "Compile the kernel with warnings as errors"
help
A kernel build should not cause any compiler warnings, and this
enables the '-Werror' (for C) and '-Dwarnings' (for Rust) flags
to enforce that rule by default. Certain warnings from other tools
such as the linker may be upgraded to errors with this option as
well.
However, if you have a new (or very old) compiler or linker with odd
and unusual warnings, or you have some architecture with problems,
you may need to disable this config option in order to
successfully build the kernel.

View File

@@ -1,4 +1,4 @@
src-git packages https://github.com/immortalwrt/packages.git^fc5c6d19bc1e63affa36dc2d9107873469f96311
src-git luci https://github.com/immortalwrt/luci.git^7ce5799365f2ba329825a169b507718359303191
src-git routing https://github.com/openwrt/routing.git^0617824a44f037f68dfa80be25693bf5bc6f4ce5
src-git telephony https://github.com/openwrt/telephony.git^86af194d03592121f5321474ec9918dd109d3057
src-git packages https://github.com/immortalwrt/packages.git;openwrt-23.05
src-git luci https://github.com/immortalwrt/luci.git;openwrt-23.05
src-git routing https://github.com/openwrt/routing.git;openwrt-23.05
src-git telephony https://github.com/openwrt/telephony.git;openwrt-23.05

View File

@@ -44,7 +44,7 @@ define autoreconf
touch NEWS AUTHORS COPYING ABOUT-NLS ChangeLog; \
$(AM_TOOL_PATHS) \
LIBTOOLIZE='$(STAGING_DIR_HOST)/bin/libtoolize --install' \
$(STAGING_DIR_HOST)/bin/autoreconf -v -f -i -s \
$(STAGING_DIR_HOST)/bin/autoreconf -v -f -i \
$(if $(word 2,$(3)),--no-recursive) \
-B $(STAGING_DIR_HOST)/share/aclocal \
$(patsubst %,-I %,$(5)) \

View File

@@ -33,7 +33,7 @@ define FeedSourcesAppend
echo 'src/gz %d_core %U/targets/%S/packages'; \
$(strip $(if $(CONFIG_PER_FEED_REPO), \
echo 'src/gz %d_base %U/packages/%A/base'; \
$(if $(filter %SNAPSHOT-y,$(VERSION_NUMBER)-$(CONFIG_BUILDBOT)), \
$(if $(CONFIG_BUILDBOT), \
echo 'src/gz %d_kmods %U/targets/%S/kmods/$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC)';) \
$(foreach feed,$(FEEDS_AVAILABLE), \
$(if $(CONFIG_FEED_$(feed)), \

View File

@@ -35,13 +35,11 @@ include $(INCLUDE_DIR)/autotools.mk
_host_target:=$(if $(HOST_QUILT),,.)
Host/Patch:=$(Host/Patch/Default)
ifneq ($(strip $(HOST_UNPACK)),)
define Host/Prepare/Default
$(HOST_UNPACK)
define Host/Prepare/Default
$(if $(strip $(HOST_UNPACK)),$(HOST_UNPACK))
[ ! -d ./src/ ] || $(CP) ./src/* $(HOST_BUILD_DIR)
$(Host/Patch)
endef
endif
endef
define Host/Prepare
$(call Host/Prepare/Default)

View File

@@ -226,6 +226,43 @@ define Build/copy-file
cat "$(1)" > "$@"
endef
# Create a header for a D-Link AI series recovery image and add it at the beginning of the image
# Currently supported: AQUILA M30, EAGLE M32 and R32
# Arguments:
# 1: Start string of the header
# 2: Firmware version
# 3: Block start address
# 4: Block length
# 5: Device FMID
define Build/dlink-ai-recovery-header
$(eval header_start=$(word 1,$(1)))
$(eval firmware_version=$(word 2,$(1)))
$(eval block_start=$(word 3,$(1)))
$(eval block_length=$(word 4,$(1)))
$(eval device_fmid=$(word 5,$(1)))
# create $@.header without the checksum
echo -en "$(header_start)\x00\x00" > "$@.header"
# Calculate checksum over data area ($@) and append it to the header.
# The checksum is the 2byte-sum over the whole data area.
# Every overflow during the checksum calculation must increment the current checksum value by 1.
od -v -w2 -tu2 -An --endian little "$@" | awk '{ s+=$$1; } END { s%=65535; printf "%c%c",s%256,s/256; }' >> "$@.header"
echo -en "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00" >> "$@.header"
echo -en "$(firmware_version)" >> "$@.header"
# Only one block supported: Erase start/length is identical to data start/length
echo -en "$(block_start)$(block_length)$(block_start)$(block_length)" >> "$@.header"
# Only zeros
echo -en "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" >> "$@.header"
# Last 16 bytes, but without checksum
echo -en "\x42\x48\x02\x00\x00\x00\x08\x00\x00\x00\x00\x00" >> "$@.header"
echo -en "$(device_fmid)" >> "$@.header"
# Calculate and append checksum: The checksum must be set so that the 2byte-sum of the whole header is 0.
# Every overflow during the checksum calculation must increment the current checksum value by 1.
od -v -w2 -tu2 -An --endian little "$@.header" | awk '{s+=65535-$$1;}END{s%=65535;printf "%c%c",s%256,s/256;}' >> "$@.header"
cat "$@.header" "$@" > "$@.new"
mv "$@.new" "$@"
rm "$@.header"
endef
define Build/dlink-sge-image
$(STAGING_DIR_HOST)/bin/dlink-sge-image $(1) $@ $@.enc
mv $@.enc $@

View File

@@ -511,7 +511,7 @@ define Device/Build/initramfs
$$(if $$(CONFIG_JSON_OVERVIEW_IMAGE_INFO), $(BUILD_DIR)/json_info_files/$$(KERNEL_INITRAMFS_IMAGE).json,))
$(KDIR)/$$(KERNEL_INITRAMFS_NAME):: image_prepare
$(1)-images: $$(if $$(KERNEL_INITRAMFS),$(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE))
$(1)-initramfs-images: $$(if $$(KERNEL_INITRAMFS),$(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE))
$(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE)
cp $$^ $$@
@@ -639,7 +639,7 @@ define Device/Build/image
ifndef IB
$$(ROOTFS/$(1)/$(3)): $(if $(TARGET_PER_DEVICE_ROOTFS),target-dir-$$(ROOTFS_ID/$(3)))
endif
$(KDIR)/tmp/$(call DEVICE_IMG_NAME,$(1),$(2)): $$(KDIR_KERNEL_IMAGE) $$(ROOTFS/$(1)/$(3))
$(KDIR)/tmp/$(call DEVICE_IMG_NAME,$(1),$(2)): $$(KDIR_KERNEL_IMAGE) $$(ROOTFS/$(1)/$(3)) $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(if $(IB),,$(3)-initramfs-images))
@rm -f $$@
[ -f $$(word 1,$$^) -a -f $$(word 2,$$^) ]
$$(call concat_cmd,$(if $(IMAGE/$(2)/$(1)),$(IMAGE/$(2)/$(1)),$(IMAGE/$(2))))
@@ -695,7 +695,7 @@ define Device/Build/artifact
$(BUILD_DIR)/json_info_files/$(DEVICE_IMG_PREFIX)-$(1).json, \
$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1))
$(eval $(call Device/Export,$(KDIR)/tmp/$(DEVICE_IMG_PREFIX)-$(1)))
$(KDIR)/tmp/$(DEVICE_IMG_PREFIX)-$(1): $$(KDIR_KERNEL_IMAGE) $(2)-images
$(KDIR)/tmp/$(DEVICE_IMG_PREFIX)-$(1): $$(KDIR_KERNEL_IMAGE) $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(if $(IB),,$(2)-initramfs-images)) $(2)-images
@rm -f $$@
$$(call concat_cmd,$(ARTIFACT/$(1)))

View File

@@ -1,2 +1,2 @@
LINUX_VERSION-5.15 = .150
LINUX_KERNEL_HASH-5.15.150 = ee05592b458e7fcdc515b43605883a10cc2f65f2e2b58d60af8a72b93467e4d4
LINUX_VERSION-5.15 = .173
LINUX_KERNEL_HASH-5.15.173 = 8a4b2a47ccc9b208b2b6ed9a216ea1a5eb12852c723bec1a04de9e671a1d7da8

View File

@@ -253,8 +253,6 @@ $(eval $(call nf_add,IPT_LED,CONFIG_NETFILTER_XT_TARGET_LED, $(P_XT)xt_LED))
# tee
$(eval $(call nf_add,IPT_TEE,CONFIG_NETFILTER_XT_TARGET_TEE, $(P_XT)xt_TEE))
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_TEE,CONFIG_NF_DUP_IPV4, $(P_V4)nf_dup_ipv4),))
$(eval $(if $(NF_KMOD),$(call nf_add,IPT_TEE,CONFIG_NF_DUP_IPV6, $(P_V6)nf_dup_ipv6),))
# u32

View File

@@ -20,7 +20,7 @@ define Package/Default
PROVIDES:=
EXTRA_DEPENDS:=
MAINTAINER:=$(PKG_MAINTAINER)
SOURCE:=$(patsubst $(TOPDIR)/%,%,$(CURDIR))
SOURCE:=$(patsubst $(TOPDIR)/%,%,$(patsubst $(TOPDIR)/package/%,feeds/base/%,$(CURDIR)))
ifneq ($(PKG_VERSION),)
ifneq ($(PKG_RELEASE),)
VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)

View File

@@ -34,8 +34,8 @@ endif
ifneq ($(if $(DUMP),1,$(__quilt_inc)),1)
__quilt_inc:=1
PATCH_DIR?=./patches
FILES_DIR?=./files
PATCH_DIR?=$(CURDIR)/patches
FILES_DIR?=$(CURDIR)/files
HOST_PATCH_DIR?=$(PATCH_DIR)
HOST_FILES_DIR?=$(FILES_DIR)
@@ -106,13 +106,14 @@ define Kernel/Patch/Default
endef
define Quilt/RefreshDir
mkdir -p $(2)
-rm -f $(2)/* 2>/dev/null >/dev/null
@( \
-rm -rf $(2) 2>/dev/null >/dev/null
[ -f $(1)/.quilt_no_patch ] || mkdir -p $(2)
@[ -f $(1)/.quilt_no_patch ] || { \
for patch in $$$$($(if $(3),grep "^$(3)",cat) $(1)/patches/series | awk '{print $$$$1}'); do \
$(CP) -v "$(1)/patches/$$$$patch" $(2); \
done; \
)
}
@-rm -f $(1)/.quilt_no_patch 2>/dev/null >/dev/null;
endef
define Quilt/Refresh/Host
@@ -156,7 +157,7 @@ define Quilt/Template
}
@[ -f "$(1)/patches/series" ] || { \
echo "The source directory contains no quilt patches."; \
false; \
touch $(1)/patches/series $(1)/.quilt_no_patch; \
}
@[ -n "$$$$(ls $(1)/patches/series)" -o \
"$$$$(cat $(1)/patches/series | $(MKHASH) md5)" = "$$(sort $(1)/patches/series | $(MKHASH) md5)" ] || { \
@@ -165,10 +166,12 @@ define Quilt/Template
}
$(3)refresh: $(3)quilt-check
@cd "$(1)"; $(QUILT_CMD) pop -a -f >/dev/null 2>/dev/null
@cd "$(1)"; while $(QUILT_CMD) next 2>/dev/null >/dev/null && $(QUILT_CMD) push; do \
QUILT_DIFF_OPTS="-p" $(QUILT_CMD) refresh -p ab --no-index --no-timestamps; \
done; ! $(QUILT_CMD) next 2>/dev/null >/dev/null
@[ -f $(1)/.quilt_no_patch ] || { \
cd "$(1)"; $(QUILT_CMD) pop -a -f >/dev/null 2>/dev/null; \
while $(QUILT_CMD) next 2>/dev/null >/dev/null && $(QUILT_CMD) push; do \
QUILT_DIFF_OPTS="-p" $(QUILT_CMD) refresh -p ab --no-index --no-timestamps; \
done; ! $(QUILT_CMD) next 2>/dev/null >/dev/null; \
}
$(Quilt/Refresh/$(4))
$(3)update: $(3)quilt-check

View File

@@ -37,7 +37,7 @@ ac_cv_func_rindex=yes
ac_cv_func_setlocale=yes
ac_cv_func_setgrent_void=yes
ac_cv_func_setpgrp_void=yes
ac_cv_func_setresuid=no
ac_cv_func_setresuid=yes
ac_cv_func_setvbuf_reversed=no
ac_cv_func_stat_empty_string_bug=no
ac_cv_func_stat_ignores_trailing_slash=no

View File

@@ -57,7 +57,8 @@ DEFAULT_PACKAGES.router:=\
firewall4 \
nftables \
kmod-nft-offload \
ipv6helper \
odhcp6c \
odhcpd-ipv6only \
ppp \
ppp-mod-pppoe
# For easy usage
@@ -69,7 +70,6 @@ DEFAULT_PACKAGES.tweak:=\
luci \
luci-compat \
luci-lib-base \
luci-lib-fs \
luci-lib-ipkg \
luci-app-opkg
@@ -330,7 +330,15 @@ ifeq ($(DUMP),1)
ifneq ($(CONFIG_CPU_MIPS32_R2),)
FEATURES += mips16
endif
FEATURES += $(foreach v,6 7,$(if $(CONFIG_CPU_V$(v)),arm_v$(v)))
ifneq ($(CONFIG_CPU_V6),)
FEATURES += arm_v6
endif
ifneq ($(CONFIG_CPU_V6K),)
FEATURES += arm_v6
endif
ifneq ($(CONFIG_CPU_V7),)
FEATURES += arm_v7
endif
# remove duplicates
FEATURES:=$(sort $(FEATURES))

View File

@@ -77,7 +77,8 @@ _ignore = $(foreach p,$(IGNORE_PACKAGES),--ignore $(p))
prepare-tmpinfo: FORCE
@+$(MAKE) -r -s $(STAGING_DIR_HOST)/.prereq-build $(PREP_MK)
mkdir -p tmp/info
mkdir -p tmp/info feeds
[ -e $(TOPDIR)/feeds/base ] || ln -sf $(TOPDIR)/package $(TOPDIR)/feeds/base
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPTH=5 SCAN_EXTRA=""
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPTH=3 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
for type in package target; do \

View File

@@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),23.05.2)
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),23.05-SNAPSHOT)
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r27625-416c8c5c91)
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.immortalwrt.org/releases/23.05.2)
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.immortalwrt.org/releases/23.05-SNAPSHOT)
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),ImmortalWrt)

View File

@@ -0,0 +1,92 @@
#
# Copyright (C) 2019
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=datconf
PKG_REVISION:=6bb733f7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_REVISION).tar.bz2
PKG_RELEASE:=1
PKG_USE_NINJA:=0
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_MAINTAINER:=Weijie Gao <weijie.gao@mediatek.com>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
include $(INCLUDE_DIR)/kernel.mk
define Package/libkvcutil
SECTION:=libs
CATEGORY:=Libraries
TITLE:=C library for Key-value based config files
endef
define Package/kvcedit
SECTION:=util
CATEGORY:=Utilities
DEPENDS:=+libkvcutil
TITLE:=Utility for editing key-value based config files
endef
define Package/datconf
SECTION:=MTK Properties
CATEGORY:=MTK Properties
SUBMENU:=Applications
DEPENDS:=+kvcedit
TITLE:=Utility for editing dat files used by MediaTek Wi-Fi drivers
endef
define Package/datconf-lua
SECTION:=MTK Properties
CATEGORY:=MTK Properties
SUBMENU:=Applications
DEPENDS:=+datconf +liblua
TITLE:=Lua plugin for datconf
endef
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib
CMAKE_OPTIONS = \
-DLUAPATH=/usr/lib/lua
define Package/libkvcutil/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/kvcutil/libkvcutil.so* $(1)/lib/
endef
define Package/kvcedit/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/kvcutil/kvcedit $(1)/usr/bin/
endef
define Package/datconf/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/datconf/datconf $(1)/usr/bin/
endef
define Package/datconf-lua/install
$(INSTALL_DIR) $(1)/usr/lib/lua
$(CP) $(PKG_BUILD_DIR)/datconf/lua/datconf.so $(1)/usr/lib/lua/
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_BUILD_DIR)/kvcutil/libkvcutil.h $(1)/usr/include
$(CP) $(PKG_BUILD_DIR)/datconf/libdatconf.h $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/kvcutil/libkvcutil.so* $(1)/usr/lib
-$(CP) $(PKG_BUILD_DIR)/datconf/libdatconf.a $(1)/usr/lib
endef
$(eval $(call BuildPackage,libkvcutil))
$(eval $(call BuildPackage,kvcedit))
$(eval $(call BuildPackage,datconf))
$(eval $(call BuildPackage,datconf-lua))

View File

@@ -0,0 +1,11 @@
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for Easy QoS
LUCI_DEPENDS:=+wget-ssl +tc +kmod-sched-core +kmod-ifb +ebtables-legacy-utils +ebtables-legacy @!PACKAGE_luci-app-eqos
PKG_MAINTAINER:=Jianhui Zhao <jianhuizhao329@gmail.com>
PKG_NAME:=luci-app-eqos-mtk
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@@ -0,0 +1,96 @@
'use strict';
'require form';
'require network';
'require uci';
'require view';
return view.extend({
load: function() {
return Promise.all([
uci.load('eqos'),
network.getHostHints()
]);
},
render: function(data) {
var m, s, o;
m = new form.Map('eqos', _('EQoS'),
_('Network speed control service.(Compatiable with Mediatek HNAT)'));
s = m.section(form.NamedSection, 'config', 'eqos');
o = s.option(form.Flag, 'enabled', _('Enable'));
o.default = o.disabled;
o.rmempty = false;
o = s.option(form.Value, 'interface', _('Load balance'),
_('Please set a different gateway hop for each network interface before filling in the network interface name. Fill in PPPOE-WAN for dialing and eth1 for DHCP. Leaving it blank to disable it.Please use commas as interface name separators. Example: pppoe-wan,eth1'));
o.rmempty = true;
o = s.option(form.Flag, 'ipv6enabled', _('IPV6Enable'));
o.default = o.disabled;
o.rmempty = false;
o = s.option(form.Flag, 'smarthqos', _('SMART_HWQOS'),
_('Enabling fair queue will automatically perform hardware offloading for every local host'));
o.default = o.disabled;
o.rmempty = false;
o = s.option(form.Value, 'download', _('Download speed (Mbit/s)'),
_('Total download bandwidth.'));
o.datatype = 'and(uinteger,min(1))';
o.rmempty = false;
o = s.option(form.Value, 'upload', _('Upload speed (Mbit/s)'),
_('Total upload bandwidth.'));
o.datatype = 'and(uinteger,min(1))';
o.rmempty = false;
s = m.section(form.TableSection, 'device', _('Speed limit and route choose based on IP address(Auto use hardware QOS)'));
s.addremove = true;
s.anonymous = true;
s.sortable = true;
o = s.option(form.Flag, 'enabled', _('Enable'));
o.default = o.enabled;
o = s.option(form.Value, 'ip', _('IPV4 address'));
o.datatype = 'ip4addr';
for (var i of Object.entries(data[1]?.hosts))
for (var v in i[1].ipaddrs)
if (i[1].ipaddrs[v]) {
var ip_addr = i[1].ipaddrs[v], ip_host = i[1].name;
o.value(ip_addr, ip_host ? String.format('%s (%s)', ip_host, ip_addr) : ip_addr)
}
o.rmempty = true;
var hosts = data[1]?.hosts;
o = s.option(form.Value, 'mac', _('IPV6 host'));
o.datatype = 'macaddr';
Object.keys(hosts).forEach(function(mac) {
var hint = hosts[mac].name || L.toArray(hosts[mac].ipaddrs || hosts[mac].ipv4)[0];
o.value(mac, hint ? '%s (%s)'.format(mac, hint) : mac);
});
o.rmempty = true;
o = s.option(form.Value, 'download', _('Download speed (kbit/s)'));
o.datatype = 'and(uinteger,min(0))';
o.rmempty = false;
o = s.option(form.Value, 'upload', _('Upload speed (kbit/s)'));
o.datatype = 'and(uinteger,min(0))';
o.rmempty = false;
o = s.option(form.Value, 'comment', _('Comment'));
o.rmempty = true;
o = s.option(form.Value, 'interfacename', _('InterfaceName(start from 0)'));
o.datatype = 'and(uinteger,min(0))';
o.rmempty = true;
return m.render();
}
});

View File

@@ -0,0 +1,92 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:87
msgid "Comment"
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:40
msgid "Download speed (Mbit/s)"
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:79
msgid "Download speed (kbit/s)"
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:18
#: package/mtk/applications/luci-app-eqos-mtk/root/usr/share/luci/menu.d/luci-app-eqos.json:3
msgid "EQoS"
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:23
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:57
msgid "Enable"
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:36
msgid ""
"Enabling fair queue will automatically perform hardware offloading "
"forwarding for every local host "
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/root/usr/share/rpcd/acl.d/luci-app-eqos.json:3
msgid "Grant UCI access for luci-app-eqos"
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:60
msgid "IPV4 address"
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:71
msgid "IPV6 host"
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:31
msgid "IPV6Enable"
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:91
msgid "InterfaceName(start from 0)"
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:27
msgid "Load balance"
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:19
msgid "Network speed control service.(Compatiable with Mediatek HNAT)"
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:28
msgid ""
"Please set a different gateway hop for each network interface before filling "
"in the network interface name. Fill in PPPOE-WAN for dialing and eth1 for "
"DHCP. Leaving it blank to disable it.Please use commas as interface name "
"separators. Example: pppoe-wan,eth1"
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:35
msgid "SMART_HWQOS"
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:52
msgid ""
"Speed limit and route choose based on IP address(using unique comment less "
"than 32 will enable hardware QOS)"
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:41
msgid "Total download bandwidth."
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:46
msgid "Total upload bandwidth."
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:45
msgid "Upload speed (Mbit/s)"
msgstr ""
#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:83
msgid "Upload speed (kbit/s)"
msgstr ""

View File

@@ -0,0 +1,91 @@
msgid ""
msgstr ""
"Project-Id-Version: LuCi Chinese Translation\n"
"Report-Msgid-Bugs-To: \n"
"Language: zh_Hans\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Pootle 2.0.6\n"
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:64
msgid "Comment"
msgstr "编号"
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:28
msgid "Download speed (Mbit/s)"
msgstr "下载速度 (Mbit/s)"
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:18
#: applications/luci-app-eqos/root/usr/share/luci/menu.d/luci-app-eqos.json:3
msgid "EQoS"
msgstr "网速控制"
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:24
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:43
msgid "Enable"
msgstr "启用"
msgid "SMART_HWQOS"
msgstr "智能硬件QOS"
msgid "Enabling fair queue will automatically perform hardware offloading for every local host"
msgstr "启用硬件公平队列,局域网的每台设备将拥有相同的转发优先级,保证设备最低网速(仅对dhcp获得ip地址的设备生效,不兼容固定限速)"
msgid "IPV6Enable"
msgstr "同时作用IPV6"
msgid "Load balance"
msgstr "负载均衡"
msgid "Please set a different gateway hop for each network interface before filling in the network interface name. Fill in PPPOE-WAN for dialing and eth1 for DHCP. Leaving it blank to disable it.Please use commas as interface name separators. Example: pppoe-wan,eth1"
msgstr "请先为每个网络接口设置不同的网关跃点后再填写网络接口名。拨号填写pppoe-wanDHCP则填写eth1。留空则不启用.请使用逗号作为接口名分隔符.例子pppoe-wan, eth1"
#: applications/luci-app-eqos/root/usr/share/rpcd/acl.d/luci-app-eqos.json:3
msgid "Grant UCI access for luci-app-eqos"
msgstr "授予 luci-app-eqos 访问 UCI 配置的权限"
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:46
msgid "IPV4 address"
msgstr "IPV4 地址"
msgid "IPV6 host"
msgstr "IPV6 主机"
msgid "Total download bandwidth."
msgstr "总下载带宽。"
msgid "InterfaceName(start from 0)"
msgstr "分流接口序号(从0开始,留空则负载均衡)"
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:19
msgid "Network speed control service.(Compatiable with Mediatek HNAT)"
msgstr "网速控制服务(未设置限速主机可正常使用硬件加速)。"
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:38
msgid "Speed limit and route choose based on IP address(Auto use hardware QOS)"
msgstr "基于 IP 分流限速(自动启用硬件QOS.速度设置为0则取消限速)"
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:29
msgid "Total download bandwidth."
msgstr "总下载带宽。"
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:34
msgid "Total upload bandwidth."
msgstr "总上传带宽。"
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:33
msgid "Upload speed (Mbit/s)"
msgstr "上传速度 (Mbit/s)"
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:56
msgid "Download speed (kbit/s)"
msgstr "下载速度 (kbit/s)"
#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:60
msgid "Upload speed (kbit/s)"
msgstr "上传速度 (kbit/s)"

View File

@@ -0,0 +1,12 @@
# The bandwidth unit is Mbit/s
config eqos 'config'
option enabled 0
option download 100
option upload 20
# Limiting the bandwidth of a single Device
#config device
# option ip "192.168.1.100"
# option download 10
# option upload 5
# option comment 1

View File

@@ -0,0 +1,3 @@
#!/bin/sh
/etc/init.d/eqos start

View File

@@ -0,0 +1,103 @@
#!/bin/sh
ACTION=$2
MARK_FILE="/tmp/dhcp_mac_mark_mapping" # 存储MAC和MARK映射关系的文件
LEASE_FILE="/tmp/dhcp.leases" # DHCP leases 文件
MAX_MARK=31 # 限制mark值在1到31之间
# 定义哈希函数将MAC地址转化为一个数值限制在1到31之间
hash_mac() {
MAC=$1
# 将MAC地址中的冒号去掉转化为十六进制数值取模限制在1到31之间
MAC_HEX=$(echo "$MAC" | sed 's/://g')
echo $(( 0x$MAC_HEX % MAX_MARK + 1 ))
}
# 从文件中加载当前的MAC-MARK映射
load_mapping() {
if [ ! -f "$MARK_FILE" ]; then
touch "$MARK_FILE"
fi
cat "$MARK_FILE"
}
# 检查mark是否被占用
is_mark_in_use() {
MARK=$1
grep -q " $MARK$" "$MARK_FILE"
return $?
}
# 分配一个可用的mark
allocate_mark() {
MAC=$1
MARK=$(hash_mac $MAC)
retries=0 # 记录重试次数
max_retries=$((MAX_MARK - 1)) # 允许的最大重试次数
# 循环检查mark是否被占用直到找到可用的mark
while is_mark_in_use $MARK; do
MARK=$((MARK + 1))
retries=$((retries + 1))
if [ "$MARK" -gt $MAX_MARK ]; then
MARK=1
fi
# 如果重试次数达到最大值退出循环表示无法找到可用的MARK
if [ "$retries" -ge "$max_retries" ]; then
MARK=1
break
fi
done
# 返回可用的MARK
echo $MARK
}
# 保存MAC和MARK的映射
save_mapping() {
MAC=$1
MARK=$2
echo "$MAC $MARK" >> "$MARK_FILE"
}
# 删除MAC对应的MARK映射
delete_mapping() {
MAC=$1
sed -i "/^$MAC /d" "$MARK_FILE"
}
# 处理现有的DHCP记录确保已有设备保留其MARK
process_existing_leases() {
while read -r line; do
IP=$(echo "$line" | awk '{print $3}')
MAC=$(echo "$line" | awk '{print $2}')
EXISTING_MARK=$(grep "^$MAC " "$MARK_FILE" | awk '{print $2}')
if [ -z "$EXISTING_MARK" ]; then
# 如果没有记录分配新的MARK
MARK_VALUE=$(allocate_mark $MAC)
save_mapping $MAC $MARK_VALUE
else
# 使用现有的MARK
MARK_VALUE=$EXISTING_MARK
fi
idpair=$((MARK_VALUE+32))
# 添加iptables规则基于MAC和IP地址给这个设备打上MARK
iptables -t mangle -D eqos -s $IP -j DSCP --set-dscp ${MARK_VALUE}
iptables -t mangle -D eqos -d $IP -j DSCP --set-dscp ${idpair}
ip6tables -t mangle -D eqos -m mac --mac-source $MAC -j MARK --set-mark ${MARK_VALUE}
ebtables -t nat -D eqos -p ipv6 -d $MAC -j mark --mark-set ${idpair}
iptables -t mangle -A eqos -s $IP -j DSCP --set-dscp ${MARK_VALUE}
iptables -t mangle -A eqos -d $IP -j DSCP --set-dscp ${idpair}
ip6tables -t mangle -A eqos -m mac --mac-source $MAC -j MARK --set-mark ${MARK_VALUE}
ebtables -t nat -A eqos -A ipv6 -d $MAC -j mark --mark-set ${idpair}
done < "$LEASE_FILE"
}
if [ "$ACTION" = "init" ]; then
rm /tmp/dhcp_mac_mark_mapping
load_mapping
iptables -t mangle -F eqos
ip6tables -t mangle -F eqos
ebtables -t nat -F eqos
process_existing_leases
fi

View File

@@ -0,0 +1,102 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50
USE_PROCD=1
parse_device() {
local cfg="$1"
local enabled
config_get_bool enabled "$cfg" "enabled" "1"
[ "$enabled" -eq "1" ] || return 1
local ip download upload comment mac interfacename
config_get ip "$cfg" ip
config_get download "$cfg" "download"
config_get upload "$cfg" "upload"
config_get comment "$cfg" "comment"
config_get mac "$cfg" "mac"
config_get interfacename "$cfg" "interfacename"
eqos add "$ip" "$download" "$upload" "$comment" "$mac" "$interfacename"
}
start_service() {
config_load "eqos"
local enabled
config_get_bool enabled "config" "enabled" "0"
[ "$enabled" -eq "1" ] || return 1
local download upload comment
config_get download "config" "download"
config_get upload "config" "upload"
config_get comment "config" "comment"
config_get smarthqos "config" "smarthqos"
config_get interface "config" "interface"
eqos start "$download" "$upload" "$comment"
local ipv6enabled
config_get_bool ipv6enabled "config" "ipv6enabled" "0"
ip6tables -t mangle -N eqos
ip6tables -t mangle -F eqos
ebtables -t nat -N eqos
ebtables -t nat -F eqos
if [ "$ipv6enabled" -eq "1" ]; then
ebtables -t nat -D POSTROUTING -j eqos -p ipv6
ebtables -t nat -A POSTROUTING -j eqos -p ipv6
ip6tables -t mangle -D FORWARD -j eqos
ip6tables -t mangle -A FORWARD -j eqos
fi
if [ "$smarthqos" -eq "1" ]; then
for i in $(seq 1 31); do
if [ "$upload" -ne "0" ]; then
echo 2 1 $(($upload*225)) 1 $(($upload*1000)) 4 1 > /sys/kernel/debug/hnat/qdma_txq$i
fi
done
for i in $(seq 33 63); do
if [ "$download" -ne "0" ]; then
echo 3 1 $(($download*200)) 1 $(($download*1000)) 4 1 > /sys/kernel/debug/hnat/qdma_txq$i
fi
done
fi
iptables -t mangle -F PREROUTING
if [ $interface ]; then
bash /usr/sbin/loadbalance "$interface"
fi
config_foreach parse_device "device"
if [ "$smarthqos" -eq "1" ]; then
rm /etc/hotplug.d/dhcp/99-eqos
cat << 'EOF' > /etc/hotplug.d/dhcp/99-eqos
#!/bin/sh
# 只有在新增 DHCP 租约时才执行操作
if [ "$ACTION" = "add" ]; then
# 执行指定的命令
/etc/init.d/dhcp_mark.sh eqos init
fi
EOF
chmod +x /etc/hotplug.d/dhcp/99-eqos
/etc/init.d/dnsmasq restart
/etc/init.d/dhcp_mark.sh eqos init
fi
}
stop_service() {
eqos stop
iptables -t mangle -F PREROUTING
rm /etc/hotplug.d/dhcp/99-eqos
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger "eqos"
}

View File

@@ -0,0 +1,9 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@eqos[-1]
add ucitrack eqos
EOF
rm -f /tmp/luci-indexcache
exit 0

View File

@@ -0,0 +1,187 @@
#!/bin/sh
dev=br-lan
hash_file="/tmp/hash_records.txt"
generate_index() {
local input="$1"
local hash_value=$(echo -n "$input" | md5sum | cut -d' ' -f1)
local decimal_value=$((0x${hash_value:0:8}))
local index=$((decimal_value % 31 + 1))
echo $index
}
find_available_index() {
local base_index=$(generate_index "$1")
local index=$base_index
while true; do
if grep -q "^$index$" "$hash_file"; then
index=$((index % 31 + 1))
if [[ $index -eq $base_index ]]; then
echo "All slots are full. Returning 0."
return 0
fi
else
echo $index >> "$hash_file"
echo $index
return 0
fi
done
}
stop_qos() {
tc qdisc del dev $dev root 2>/dev/null
tc qdisc del dev $dev ingress 2>/dev/null
tc qdisc del dev ${dev}-ifb root 2>/dev/null
ip link del dev ${dev}-ifb 2>/dev/null
}
start_qos() {
local dl=$1
local up=$2
rm /tmp/hash_records.txt
touch "$hash_file"
tc qdisc add dev $dev root handle 1: htb
tc class add dev $dev parent 1: classid 1:1 htb rate ${dl}mbit
ip link add dev ${dev}-ifb name ${dev}-ifb type ifb
ip link set dev ${dev}-ifb up
tc qdisc add dev ${dev}-ifb root handle 1: htb
tc class add dev ${dev}-ifb parent 1: classid 1:1 htb rate ${up}mbit
tc qdisc add dev $dev ingress
tc filter add dev $dev parent ffff: protocol ip u32 match u32 0 0 flowid 1:1 action mirred egress redirect dev ${dev}-ifb
}
iptables_stop() {
iptables -t mangle -D FORWARD -j eqos
ip6tables -t mangle -D FORWARD -j eqos
ebtables -t nat -D POSTROUTING -j eqos -p ipv6
echo 0 > /sys/kernel/debug/hnat/qos_toggle
sed -i '/\/etc\/init.d\/eqos start/d' /etc/firewall.user
iptables -t mangle -D FORWARD -i br-lan -j DSCP --set-dscp 0
iptables -t mangle -D FORWARD -o br-lan -j DSCP --set-dscp 0
ip6tables -t mangle -D FORWARD -i br-lan -j DSCP --set-dscp 0
ip6tables -t mangle -D FORWARD -o br-lan -j DSCP --set-dscp 0
echo "10 0" > /sys/kernel/debug/hnat/hnat_setting
echo "11 30" >/sys/kernel/debug/hnat/hnat_setting
for i in $(seq 0 31); do
echo 0 0 0 0 0 4 4 > /sys/kernel/debug/hnat/qdma_txq$i
done
for i in $(seq 32 63); do
echo 1 0 0 0 0 4 4 > /sys/kernel/debug/hnat/qdma_txq$i
done
echo 0 wrr 25000000 > /sys/kernel/debug/hnat/qdma_sch0
echo 0 wrr 25000000 > /sys/kernel/debug/hnat/qdma_sch1
echo 0 wrr 25000000 > /sys/kernel/debug/hnat/qdma_sch2
echo 0 wrr 25000000 > /sys/kernel/debug/hnat/qdma_sch3
}
iptables_start_prepare() {
iptables -t mangle -D FORWARD -i br-lan -j DSCP --set-dscp 0
iptables -t mangle -D FORWARD -o br-lan -j DSCP --set-dscp 0
iptables -t mangle -A FORWARD -i br-lan -j DSCP --set-dscp 0
iptables -t mangle -A FORWARD -o br-lan -j DSCP --set-dscp 0
ip6tables -t mangle -D FORWARD -i br-lan -j DSCP --set-dscp 0
ip6tables -t mangle -D FORWARD -o br-lan -j DSCP --set-dscp 0
ip6tables -t mangle -A FORWARD -i br-lan -j DSCP --set-dscp 0
ip6tables -t mangle -A FORWARD -o br-lan -j DSCP --set-dscp 0
}
iptables_start_inital() {
iptables -t mangle -N eqos
iptables -t mangle -F eqos
iptables -t mangle -D FORWARD -j eqos
iptables -t mangle -A FORWARD -j eqos
echo 1 > /sys/kernel/debug/hnat/qos_toggle
echo 0 wrr 25000000 > /sys/kernel/debug/hnat/qdma_sch0
echo 0 wrr 25000000 > /sys/kernel/debug/hnat/qdma_sch1
echo 0 0 0 0 0 0 0 > /sys/kernel/debug/hnat/qdma_txq0
echo 1 0 0 0 0 0 0 > /sys/kernel/debug/hnat/qdma_txq32
echo "11 5" >/sys/kernel/debug/hnat/hnat_setting
uci -q set "turboacc.config.fastpath_mh_eth_hnat_bind_rate"="5"
uci -q commit "turboacc"
sed -i '/\/etc\/init.d\/eqos start/d' /etc/firewall.user
echo "/etc/init.d/eqos start" >> /etc/firewall.user
echo "10 1" > /sys/kernel/debug/hnat/hnat_setting
}
case "$1" in
"stop")
stop_qos
iptables_stop
;;
"start")
stop_qos
iptables_start_prepare
start_qos $2 $3
iptables_start_inital
echo 1 wrr $(($3*1000)) > /sys/kernel/debug/hnat/qdma_sch2
echo 1 wrr $(($2*1000)) > /sys/kernel/debug/hnat/qdma_sch3
;;
"add")
ip="$2"
dl="$3"
up="$4"
macaddr="$6"
cnt=$(tc class show dev $dev | wc -l)
interface="$7"
if [ -n "$ip" ]; then
id="$(find_available_index "$ip")"
elif [ -n "$macaddr" ]; then
id="$(find_available_index "$macaddr")"
fi
idpair=$((id+32))
if [ $id -lt 32 ]; then
iptables -t mangle -D eqos -s $ip -j DSCP --set-dscp ${id}
iptables -t mangle -D eqos -d $ip -j DSCP --set-dscp ${idpair}
ip6tables -t mangle -D eqos -m mac --mac-source $macaddr -j MARK --set-mark ${id}
ebtables -t nat -D eqos -p ipv6 -d $macaddr -j mark --mark-set ${idpair}
if [ $up -ne 0 ]; then
echo 2 0 0 1 ${up} 4 1 > /sys/kernel/debug/hnat/qdma_txq${id}
iptables -t mangle -A eqos -s $ip -j DSCP --set-dscp ${id}
ip6tables -t mangle -A eqos -m mac --mac-source $macaddr -j MARK --set-mark ${id}
fi
if [ $dl -ne 0 ]; then
echo 3 0 0 1 ${dl} 4 1 > /sys/kernel/debug/hnat/qdma_txq${idpair}
iptables -t mangle -A eqos -d $ip -j DSCP --set-dscp ${idpair}
ebtables -t nat -A eqos -p ipv6 -d $macaddr -j mark --mark-set ${idpair}
fi
else
iptables -t mangle -D eqos -s $ip -j MARK --set-mark 0x99
iptables -t mangle -D eqos -d $ip -j MARK --set-mark 0x99
if [ $up -ne 0 ]; then
iptables -t mangle -A eqos -s $ip -j MARK --set-mark 0x99
fi
if [ $dl -ne 0 ]; then
iptables -t mangle -A eqos -d $ip -j MARK --set-mark 0x99
fi
fi
if [ $id -gt 31 ]; then
tc class add dev $dev parent 1:1 classid 1:1$cnt htb rate ${dl}kbit ceil ${dl}kbit
tc filter add dev $dev parent 1:0 protocol ip u32 match ip dst $ip flowid 1:1$cnt
tc class add dev ${dev}-ifb parent 1:1 classid 1:1$cnt htb rate ${up}kbit ceil ${up}kbit
tc filter add dev ${dev}-ifb parent 1:0 protocol ip u32 match ip src $ip flowid 1:1$cnt
fi
if [ $interface ]; then
iptables -t mangle -D PREROUTING -s $ip -m conntrack --ctstate NEW -j MARK --set-mark 2"$interface"
iptables -t mangle -A PREROUTING -s $ip -m conntrack --ctstate NEW -j MARK --set-mark 2"$interface"
iptables -t mangle -D PREROUTING -i br-lan -m conntrack --ctstate ESTABLISHED,RELATED -j CONNMARK --restore-mark
iptables -t mangle -A PREROUTING -i br-lan -m conntrack --ctstate ESTABLISHED,RELATED -j CONNMARK --restore-mark
fi
;;
*)
echo "Usage: $0 <command> [options]"
echo "Commands:"
echo " start dl_rate up_rate #Total bandwidth (Mbit/s)"
echo " stop"
echo " add ip dl_rate up_rate #Limiting the bandwidth of a single IP (kbit/s)"
echo "Example:"
echo " $0 start 30 20 # Total bandwidth: down 30Mbit/s up 20Mbit/s"
echo " $0 add 192.168.22.12 10 2 # down 10kbit/s up 2kbit/s"
;;
esac

View File

@@ -0,0 +1,45 @@
interface=$1
array=(${interface//,/ })
PPP_NUM=0
for var in ${array[@]}
do
let PPP_NUM=PPP_NUM+1
done
i=0
for var in ${array[@]}
do
ipaddr=$(ip route show |grep default | grep $var | awk '{print $3 }')
iptables -t mangle -D PREROUTING -i br-lan -m conntrack --ctstate NEW -m statistic --mode nth --every $PPP_NUM --packet $i -j CONNMARK --set-mark 2"$i"
iptables -t mangle -D PREROUTING -i br-lan -m connmark --mark 2"$i" -j MARK --set-mark 2"$i"
iptables -t mangle -A PREROUTING -i br-lan -m conntrack --ctstate NEW -m statistic --mode nth --every $PPP_NUM --packet $i -j CONNMARK --set-mark 2"$i"
iptables -t mangle -A PREROUTING -i br-lan -m connmark --mark 2"$i" -j MARK --set-mark 2"$i"
ip rule del table 2"$i"0
ip rule add fwmark 2"$i" table 2"$i"0
ip route del default table 2"$i"0
ip route add default via $ipaddr dev $var table 2"$i"0
let i=i+1
done
i=0
for var in ${array[@]}
do
ipaddr=$(ip route show |grep default | grep $var | awk '{print $3 }')
iptables -t mangle -D PREROUTING -m conntrack --ctstate NEW -d $ipaddr/24 -j MARK --set-mark 2"$i"
iptables -t mangle -A PREROUTING -m conntrack --ctstate NEW -d $ipaddr/24 -j MARK --set-mark 2"$i"
let i=i+1
done
iptables -t mangle -D PREROUTING -p tcp --dport 443 -m conntrack --ctstate NEW -j MARK --set-mark 20
iptables -t mangle -A PREROUTING -p tcp --dport 443 -m conntrack --ctstate NEW -j MARK --set-mark 20
iptables -t mangle -D PREROUTING -p udp --dport 443 -m conntrack --ctstate NEW -j MARK --set-mark 20
iptables -t mangle -A PREROUTING -p udp --dport 443 -m conntrack --ctstate NEW -j MARK --set-mark 20
iptables -t mangle -D POSTROUTING -m conntrack --ctstate NEW -j CONNMARK --save-mark
iptables -t mangle -A POSTROUTING -m conntrack --ctstate NEW -j CONNMARK --save-mark
iptables -t mangle -D PREROUTING -i br-lan -m conntrack --ctstate ESTABLISHED,RELATED -j CONNMARK --restore-mark
iptables -t mangle -A PREROUTING -i br-lan -m conntrack --ctstate ESTABLISHED,RELATED -j CONNMARK --restore-mark
ip route flush cache

View File

@@ -0,0 +1,13 @@
{
"admin/network/eqos": {
"title": "EQoS",
"action": {
"type": "view",
"path": "eqos"
},
"depends": {
"acl": [ "luci-app-eqos" ],
"uci": { "eqos": true }
}
}
}

View File

@@ -0,0 +1,11 @@
{
"luci-app-eqos": {
"description": "Grant UCI access for luci-app-eqos",
"read": {
"uci": [ "eqos" ]
},
"write": {
"uci": [ "eqos" ]
}
}
}

View File

@@ -0,0 +1,15 @@
#
# Copyright (C) Hua Shao <nossiac@163.com>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=MediaTek Proprietary Configuration.
LUCI_DEPENDS:=+datconf-lua
LUCI_PKGARCH:=all
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@@ -0,0 +1,198 @@
Copyright (C) 2016 Gion Kunz
The MIT License
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.
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,67 @@
<%#
File name : mtk_wifi_apply_reboot.htm
This file is used in WebUI based on LuCI to handle the reboot event.
%>
<%+header%>
<h2><a>Reboot Device</a><h2>
<div id="div_reboot_warn">
<p class="alert-message">
As the driver does not support addition or deletion of interfaces on the fly,
the settings which were changed during addition or deletion of interfaces have not been applied yet!
<br /><br />
<strong>
The changed settings will be applied only after reboot of the device.
Please click on the Reboot button.
</strong>
<br /><br />
<strong>Tip:</strong><br />
Add or delete as many interfaces as required before reboot so that you do not have to reboot the device again.<br />
Please follow below instructions to add or delete an interface;</em><br />
1. Go to <a href='<%=luci.dispatcher.build_url("admin", "network", "wifi")%>'>Wireless Overview</a> web-page.<br />
2. Click on Add button to add a new interface or click on Remove button to delete an existing interface.<br />
3. If you are are adding a new interface, then, click on <em>Save</em> button after filling out all the required fields such as SSID etc.<br />
4. Once you are done with addition/deletion of interfaces, then please click on <em>Reload</em> button or
<em>Save and Apply</em> button on any web-page which will redirect to this web-page to perform the reboot of the device.</br>
</p>
<input class="cbi-button cbi-button-apply" type="button" value="Reboot" onclick="init_reboot()" />
</div>
<h4 id="msg_on_reboot" class="alert-message warning" style="display:none">
<img src="<%=resource%>/icons/loading.gif" alt="" style="vertical-align:middle" />
Please wait while the reboot of the device is on progress.
</h4>
<h4 id="unreach_msg" class="alert-message error" style="display:none">Device has not come on-line yet!</h4>
<script type="text/javascript">
function online()
{
location = '<%=controller%>';
}
function ping(numPings)
{
var loadingImg = document.createElement('IMG');
loadingImg.onload = online;
loadingImg.src = '<%=resource%>/icons/loading.gif?' + Math.random();
numPings -= 1;
if(numPings <= 0){
document.getElementById("msg_on_reboot").style.display = 'none';
document.getElementById("unreach_msg").style.display = '';
}
else{
window.setTimeout(ping, 10000, numPings);
}
}
function init_reboot_cb()
{
window.setTimeout(ping, 10000, 18);
}
function init_reboot()
{
document.getElementById('div_reboot_warn').style.display = 'none';
document.getElementById('msg_on_reboot').style.display = '';
(new XHR()).post('<%=controller%>/admin/mtk/wifi/reboot', { token: '<%=token%>' }, init_reboot_cb);
}
</script>
<%+footer%>

View File

@@ -0,0 +1,233 @@
<%+header%>
<!--
This module is a demo to configure MTK' proprietary WiFi driver.
Basic idea is to bypass uci and edit wireless profile (mt76xx.dat) directly.
LuCI's WiFi configuration is more logical and elegent, but it's quite tricky to
translate uci into MTK's WiFi profile (like we did in "uci2dat").
Hua Shao <nossiac@163.com>
-->
<%
local disp = require "luci.dispatcher"
-- local request = disp.context.path
local request = disp.context.request
local mtkwifi = require("mtkwifi")
local devname = request[5]
local devs = mtkwifi.get_all_devs()
local dev = {}
for _,v in ipairs(devs) do
if v.devname == devname then
dev = v
end
end
local cfgs = mtkwifi.load_profile(dev.profile)
%>
<script type="text/javascript" src="<%=resource%>/cbi.js?v=git-17.250.41546-90ac861"></script>
<script type="text/javascript">
</script>
<form method="post" name="cbi" action="<%=luci.dispatcher.build_url("admin", "network", "wifi", "chip_cfg", devname)%>" enctype="multipart/form-data" onreset="return cbi_validate_reset(this)" onsubmit="return cbi_validate_form(this, '<%:Some fields are invalid, cannot save values!%>') && ValidateAllSettings()" autocomplete="off">
<fieldset class="cbi-section">
<h2><%:Chip Configurations%> - <%=string.split(devname,".")[1]%>
<%local diff = mtkwifi.diff_profile(dev.profile)%>
<%if next(diff) ~= nil then%>
<span style="color:red;">( <a href="javascript:location.href='<%=luci.dispatcher.build_url("admin", "network", "wifi", "reload", dev.devname)%>'"><%:Click here%></a> <%:to apply changes%>)</span>
<%end%>
</h2>
<table id="dev-cfg-basic" class="cbi-section-table">
<tr>
<td><%:Decline BA Request%></td>
<td>
<select style="width:auto" name="HT_BADecline">
<option value="1" <% if cfgs.HT_BADecline == "1" then %> selected="selected"<% end%>><%:Enable%></option>
<option value="0" <% if cfgs.HT_BADecline == "0" then %> selected="selected"<% end%>><%:Disable%></option>
</select>
</td>
</tr>
<tr>
<td><%:Reverse Direction Grant (RDG)%></td>
<td>
<select style="width:auto" name="HT_RDG">
<option value="1" <% if cfgs.HT_RDG == "1" then %> selected="selected"<% end%>><%:Enable%></option>
<option value="0" <% if cfgs.HT_RDG == "0" then %> selected="selected"<% end%>><%:Disable%></option>
</select>
</td>
</tr>
<tr>
<td><%:BA Win size%> <% if string.split(cfgs.WirelessMode,";")[1] == "16" or string.split(cfgs.WirelessMode,";")[1] == "17" or string.split(cfgs.WirelessMode,";")[1] == "18" then %>(1-256)<% else %>(1-64)<% end %></td>
<td>
<input name="HT_BAWinSize" id="HT_BAWinSize" value="<%=cfgs.HT_BAWinSize%>"/>
</td>
</tr>
<tr>
<td><%:HT Disallow TKIP%></td>
<td>
<select style="width:auto" name="HT_DisallowTKIP">
<option value="1" <% if cfgs.HT_DisallowTKIP == "1" then %> selected="selected"<% end%>><%:Enable%></option>
<option value="0" <% if cfgs.HT_DisallowTKIP == "0" then %> selected="selected"<% end%>><%:Disable%></option>
</select>
</td>
</tr>
<tr>
<td><%:Wi-Fi HWNAT%></td>
<td>
<select style="width:auto" name="WHNAT">
<option value="1" <% if cfgs.WHNAT == "1" then %> selected="selected"<% end%>><%:Enable%></option>
<option value="0" <% if cfgs.WHNAT ~= "1" then %> selected="selected"<% end%>><%:Disable%></option>
</select>
</td>
</tr>
<tr>
<td><%:E2pAccessMode%></td>
<td>
<select style="width:auto" name="E2pAccessMode">
<option value="1" <% if cfgs.E2pAccessMode == "1" then %> selected="selected"<% end%>>EFUSE</option>
<option value="2" <% if cfgs.E2pAccessMode == "2" then %> selected="selected"<% end%>>FLASH</option>
</select>
</td>
</tr>
<tr>
<td><%:Beacon Interval%> (20-999)</td>
<td>
<input name="BeaconPeriod" id="BeaconPeriod" value="<%=cfgs.BeaconPeriod%>" />
</td>
</tr>
<tr>
<td><%:Data Beacon Rate (DTIM)%> (1-255)</td>
<td>
<input name="DtimPeriod" id="DtimPeriod" value="<%=cfgs.DtimPeriod%>" />
</td>
</tr>
<tr>
<td><%:BG Protection Mode%></td>
<td>
<select name="BGProtection" style="width:auto">
<option value="0" <% if cfgs.BGProtection == "0" then %>selected="selected"<% end %>><%:Auto%></option>
<option value="1" <% if cfgs.BGProtection == "1" then %>selected="selected"<% end %>><%:Always On%></option>
<option value="2" <% if cfgs.BGProtection == "2" then %>selected="selected"<% end %>><%:Always Off%></option>
</select>
</td>
</tr>
<tr>
<td><%:Short Preamble%></td>
<td>
<select style="width:auto" name="TxPreamble">
<option value="1" <% if cfgs.TxPreamble == "1" then %> selected="selected"<% end%>><%:Enable%></option>
<option value="0" <% if cfgs.TxPreamble == "0" then %> selected="selected"<% end%>><%:Disable%></option>
</select>
</td>
</tr>
<tr>
<td><%:TX Burst%></td>
<td>
<select style="width:auto" name="TxBurst">
<option value="1" <% if cfgs.TxBurst == "1" then %> selected="selected"<% end%>><%:Enable%></option>
<option value="0" <% if cfgs.TxBurst == "0" then %> selected="selected"<% end%>><%:Disable%></option>
</select>
</td>
</tr>
<tr>
<td><%:Short Slot%></td>
<td>
<select style="width:auto" name="ShortSlot">
<option value="1" <% if cfgs.ShortSlot == "1" then %> selected="selected"<% end%>><%:Enable%></option>
<option value="0" <% if cfgs.ShortSlot == "0" then %> selected="selected"<% end%>><%:Disable%></option>
</select>
</td>
</tr>
</table>
<div class="cbi-page-actions">
<input class="cbi-button cbi-button-apply" name="__apply" value="<%:Save & Apply%>" type="submit">
<input class="cbi-button cbi-button-apply" value="<%:Save%>" type="submit">
<input class="cbi-button cbi-button-reset" value="<%:Reset%>" type="reset">
</div>
</form>
<script type="text/javascript">
function ValidateAdvancedSettings()
{
var tmpVal = document.getElementById("HT_BAWinSize").value;
<% if string.split(cfgs.WirelessMode,";")[1] == "16" or string.split(cfgs.WirelessMode,";")[1] == "17" or string.split(cfgs.WirelessMode,";")[1] == "18" then %>
if(isNaN(tmpVal) || !/^\d{1,3}$/.test(tmpVal) || parseInt(tmpVal) < 1 || parseInt(tmpVal) > 256){
alert("BA Win SIze is incorrect!\nPlease enter an integer number between 1 to 256 inclusive.");
document.getElementById("HT_BAWinSize").focus();
document.getElementById("HT_BAWinSize").select();
return false;
}
<% else %>
if(isNaN(tmpVal) || !/^\d{1,2}$/.test(tmpVal) || parseInt(tmpVal) < 1 || parseInt(tmpVal) > 64){
alert("BA Win Size is incorrect!\nPlease enter an integer number between 1 to 64 inclusive.");
document.getElementById("HT_BAWinSize").focus();
document.getElementById("HT_BAWinSize").select();
return false;
}
<% end %>
tmpVal = document.getElementById("BeaconPeriod").value;
if(isNaN(tmpVal) || !/^\d{2,3}$/.test(tmpVal) || parseInt(tmpVal) < 20 || parseInt(tmpVal) > 999){
alert("Beacon Interval is incorrect!\nPlease enter an integer number between 20 to 999 inclusive.");
document.getElementById("BeaconPeriod").focus();
document.getElementById("BeaconPeriod").select();
return false;
}
tmpVal = document.getElementById("DtimPeriod").value;
if(isNaN(tmpVal) || !/^\d{1,3}$/.test(tmpVal) || parseInt(tmpVal) < 1 || parseInt(tmpVal) > 255){
alert("Data Beacon Rate (DTIM) is incorrect!\nPlease enter an integer number between 1 to 255 inclusive.");
document.getElementById("DtimPeriod").focus();
document.getElementById("DtimPeriod").select();
return false;
}
return true;
}
function ValidateAllSettings(){
if( !ValidateAdvancedSettings() ){
return false;
}
return true;
}
function get_apply_status_cb(rsp)
{
try{
var r = JSON.parse(rsp);
}
catch(e){
return;
}
if(r.status == "ON_PROGRESS"){
var u = confirm("Device is applying the saved settings now!\n" +
"It is recommended to wait until all the saved settings are applied.\n" +
"Please click on 'OK' button to wait for the device.\n" +
"or click on 'Cancel' button to configure the settings available in current web-page.");
if (u == true) {
location = '<%=luci.dispatcher.build_url("admin", "network", "wifi", "loading")%>' + window.location.pathname;
}
}
}
function get_apply_status()
{
XHR.get('<%=luci.dispatcher.build_url("admin", "network", "wifi", "get_apply_status")%>', null,
function(x)
{
console.log(x);
get_apply_status_cb(x.response);
}
);
}
window.onload = function() {
get_apply_status();
}
</script>
<%+footer%>

View File

@@ -0,0 +1,769 @@
<%+header%>
<!--
This module is a demo to configure MTK' proprietary WiFi driver.
Basic idea is to bypass uci and edit wireless profile (mt76xx.dat) directly.
LuCI's WiFi configuration is more logical and elegent, but it's quite tricky to
translate uci into MTK's WiFi profile (like we did in "uci2dat").
Hua Shao <nossiac@163.com>
-->
<%
local disp = require "luci.dispatcher"
-- local request = disp.context.path
local request = disp.context.request
local mtkwifi = require("mtkwifi")
local devname = request[5]
local devs = mtkwifi.get_all_devs()
local dev = {}
for _,v in ipairs(devs) do
if v.devname == devname then
dev = v
end
end
local cfgs = mtkwifi.load_profile(dev.profile)
local bands = mtkwifi.detect_triband()
%>
<script type="text/javascript" src="<%=resource%>/cbi.js?v=git-17.250.41546-90ac861"></script>
<script type="text/javascript">
</script>
<form method="post" name="cbi" action="<%=luci.dispatcher.build_url("admin", "network", "wifi", "dev_cfg", devname)%>" enctype="multipart/form-data" onreset="return cbi_validate_reset(this)" onsubmit="return cbi_validate_form(this, '<%:Some fields are invalid, cannot save values!%>') && ValidateAllSettings()" autocomplete="off">
<fieldset class="cbi-section">
<h2><%:Device Configuration%> - <%=devname%>
<%local diff = mtkwifi.diff_profile(dev.profile)%>
<%if next(diff) ~= nil then%>
<span style="color:red;"> (<a href="javascript:location.href='<%=luci.dispatcher.build_url("admin", "network", "wifi", "reload", dev.devname)%>'"><%:Click here%></a> <%:to apply changes%>)</span>
<%end%>
</h2>
<table id="dev-cfg-basic" class="cbi-section-table">
<tr>
<td><%:Enable wireless device%></td>
<td>
<input type="radio" name="DevEnable" value="1" <% if cfgs.DevEnable == "1" then %> checked="checked"<% end %>/><%:Enable%>
<input type="radio" name="DevEnable" value="0" <% if cfgs.DevEnable == "0" then %> checked="checked"<% end %>/><%:Disable%>
</td>
</tr>
<tr>
<td><%:Channel%></td>
<td>
<select style="width:auto; min-width:180px;" name="Channel" id="Channel" onchange="Channel_onchange(this.value)" <% if cfgs.ApCliEnable == "1" then %> disabled="disabled" <% end %>>
</select>
</td>
<td><% if cfgs.ApCliEnable == "1" then %><%:APClient/Repeater Mode.%><% end %></td>
</tr>
<tr id="HT_EXTCHA_TR" style="display:none">
<td><%:40MHz HT Ext Channel%></td>
<td>
<select style="width:auto; min-width:180px;" name="HT_EXTCHA" id="HT_EXTCHA" <% if cfgs.ApCliEnable == "1" or dev.__bw ~= "40" or dev.__bw ~= "60" then %> disabled="disabled" <% end %>>
</select>
</td>
<td><% if cfgs.ApCliEnable == "1" then %><%:APClient/Repeater Mode.%><% end %></td>
</tr>
<tr id="VHT_Sec80_Channel_TR" style="display:none">
<td><%:80MHz Second VHT Channel%></td>
<td>
<select style="width:auto; min-width:180px; " name="VHT_Sec80_Channel" id="VHT_Sec80_Channel" <% if cfgs.ApCliEnable == "1" or dev.__bw ~= "161" then %> disabled="disabled" <% end %>>
</select>
</td>
<td><% if cfgs.ApCliEnable == "1" then %><%:APClient/Repeater Mode.%><% end %></td>
</tr>
<% if string.split(cfgs.WirelessMode,";")[1] == "16" or string.split(cfgs.WirelessMode,";")[1] == "17" or string.split(cfgs.WirelessMode,";")[1] == "18" then %>
<tr>
<td><%:BSS color%></td>
<td>
<input name="BssColor" id="BssColor" value="<%=cfgs.BSSColorValue%>"/>
</td>
</tr>
<tr>
<td><%:TWT Support%></td>
<td>
<select name="TWTSupport" style="width:auto">
<option value="0" <% if cfgs.TWTSupport == "0" then %> selected="selected" <% end %>><%:Disable%></option>
<option value="1" <% if cfgs.TWTSupport == "1" then %> selected="selected" <% end %>><%:Enable%></option>
<option value="2" <% if cfgs.TWTSupport == "2" then %> selected="selected" <% end %>><%:Mandatory%></option>
</select>
</td>
</tr>
<% end %>
<input type="hidden" id="WirelessMode" value="<%=string.split(cfgs.WirelessMode,";")[1]%>">
<tr>
<td><%:Country Code%></td>
<td>
<select name="CountryCode" style="width:auto" id="CountryCode" onchange="CountryCode_onchange()">
<option value="US" id="advCountryCodeUS" <% if cfgs.CountryCode == "US" then %> selected="selected"<% end %>><%:US%></option>
<option value="JP" id="advCountryCodeJP" <% if cfgs.CountryCode == "JP" then %> selected="selected"<% end %>><%:JP%></option>
<option value="FR" id="advCountryCodeFR" <% if cfgs.CountryCode == "FR" then %> selected="selected"<% end %>><%:FR%></option>
<option value="IE" id="advCountryCodeIE" <% if cfgs.CountryCode == "IE" then %> selected="selected"<% end %>><%:IE%></option>
<option value="CN" id="advCountryCodeCN" <% if cfgs.CountryCode == "CN" then %> selected="selected"<% end %>><%:CN%></option>
<option value="NONE" id="advCountryCodeNONE"<% if cfgs.CountryCode == "NONE" then %> selected="selected"<% end %>><%:NONE%></option>
</select>
</td>
</tr>
<tr>
<td><%:Country Region%></td>
<td>
<select style="width:auto; min-width:180px;" name="__cr" id="__cr" onchange="CountryRegion_onchange(this.value)">
</select>
</td>
</tr>
<tr>
<td><%:Channel BandWidth%></td>
<td>
<select style="width:auto" name="__bw" id="__bw" onchange="Bw_onchange(this.options[this.options.selectedIndex].value)">
<option value="20" <% if dev.__bw == "20" then %> selected="selected"<% end%>>20 MHz</option>
<option value="40" <% if dev.__bw == "40" then %> selected="selected"<% end%>>40 MHz</option>
<option value="60" <% if dev.__bw == "60" then %> selected="selected"<% end%>>20/40 MHz</option>
<option value="80" <% if dev.__bw == "80" then %> selected="selected"<% end%>>80 MHz</option>
<option value="160" <% if dev.__bw == "160" then %> selected="selected"<% end%>>160 MHz</option>
<option value="161" <% if dev.__bw == "161" then %> selected="selected"<% end%>>80+80 MHz</option>
</select>
</td>
</tr>
<tr>
<td><%:TX Stream%></td>
<td>
<select name="HT_TxStream" style="width:auto">
<% if dev.maxTxStream then %>
<% for txStreamVal=1,dev.maxTxStream do%>
<option value="<%=txStreamVal%>" <% if tonumber(cfgs.HT_TxStream) == txStreamVal then %>selected="selected"<% end %>><%=txStreamVal%></option>
<% end %>
<% else %>
<option value="1" <% if cfgs.HT_TxStream == "1" then %>selected="selected"<% end %>>1</option>
<option value="2" <% if cfgs.HT_TxStream == "2" then %>selected="selected"<% end %>>2</option>
<option value="3" <% if cfgs.HT_TxStream == "3" then %>selected="selected"<% end %>>3</option>
<option value="4" <% if cfgs.HT_TxStream == "4" then %>selected="selected"<% end %>>4</option>
<% end %>
</select>
</td>
</tr>
<tr>
<td><%:RX Stream%></td>
<td>
<select name="HT_RxStream" style="width:auto">
<% if dev.maxRxStream then %>
<% for rxStreamVal=1,dev.maxRxStream do%>
<option value="<%=rxStreamVal%>" <% if tonumber(cfgs.HT_RxStream) == rxStreamVal then %>selected="selected"<% end %>><%=rxStreamVal%></option>
<% end %>
<% else %>
<option value="1" <% if cfgs.HT_RxStream == "1" then %>selected="selected"<% end %>>1</option>
<option value="2" <% if cfgs.HT_RxStream == "2" then %>selected="selected"<% end %>>2</option>
<option value="3" <% if cfgs.HT_RxStream == "3" then %>selected="selected"<% end %>>3</option>
<option value="4" <% if cfgs.HT_RxStream == "4" then %>selected="selected"<% end %>>4</option>
<% end %>
</select>
</td>
</tr>
<tr>
<td><%:TX Power%> (1-100)</td>
<td>
<input name="TxPower" id="TxPower" value="<%=cfgs.TxPower%>" />
</td>
</tr>
<% if mtkwifi.band(string.split(cfgs.WirelessMode,";")[1]) == "5G" then %>
<tr>
<td>802.11H</td>
<td>
<input type="radio" name="IEEE80211H" value="1" <% if cfgs.IEEE80211H == "1" then %> checked="checked"<% end %>/><%:Enable%>
<input type="radio" name="IEEE80211H" value="0" <% if cfgs.IEEE80211H == "0" then %> checked="checked"<% end %>/><%:Disable%>
</td>
</tr>
<tr>
<td><%:DFS%></td>
<td>
<input type="radio" name="DfsEnable" value="1" <% if cfgs.DfsEnable == "1" then %> checked="checked"<% end %>/><%:Enable%>
<input type="radio" name="DfsEnable" value="0" <% if cfgs.DfsEnable == "0" then %> checked="checked"<% end %>/><%:Disable%>
</td>
</tr>
<% end %>
<% if cfgs.MUTxRxEnable then %>
<tr>
<td><%:Beam Forming and MIMO Setting%></td>
<td>
<select name="__mimo" autocomplete="off" >
<option value="0"<% if tonumber(dev.__mimo) == 0 then %> selected="selected"<% end %>> ETxBF + SU-MIMO </option>
<option value="1"<% if tonumber(dev.__mimo) == 1 then %> selected="selected"<% end %>> ITxBF + SU-MIMO </option>
<option value="2"<% if tonumber(dev.__mimo) == 2 then %> selected="selected"<% end %>> ITxBF + ETxBF + SU-MIMO </option>
<% if not dev.mimoBand or dev.mimoBand == dev.dbdcBandName then %>
<option value="3"<% if tonumber(dev.__mimo) == 3 then %> selected="selected"<% end %>> ETxBF + MU-MIMO </option>
<option value="4"<% if tonumber(dev.__mimo) == 4 then %> selected="selected"<% end %>> ITxBF + ETxBF + MU-MIMO </option>
<% end %>
<option value="5"<% if tonumber(dev.__mimo) == 5 then %> selected="selected"<% end %>> <%:Disable%> TxBF </option>
</select>
</td>
</tr>
<% end %>
<% if string.split(cfgs.WirelessMode,";")[1] == "16" or string.split(cfgs.WirelessMode,";")[1] == "17" or string.split(cfgs.WirelessMode,";")[1] == "18" then %>
<tr>
<td><%:Spatial Reuse%></td>
<td>
<input type="radio" name="SREnable" value="1" <% if cfgs.SREnable == "1" then %> checked="checked"<% end %>/><%:Enable%>
<input type="radio" name="SREnable" value="0" <% if cfgs.SREnable == "0" then %> checked="checked"<% end %>/><%:Disable%>
</td>
</tr>
<% end %>
</table>
</fieldset>
<div class="cbi-page-actions">
<input class="cbi-button cbi-button-apply" name="__apply" value="<%:Save & Apply%>" type="submit">
<input class="cbi-button cbi-button-apply" value="<%:Save%>" type="submit">
<input class="cbi-button cbi-button-reset" value="<%:Reset%>" type="reset">
</div>
</form>
<script type="text/javascript">
function CountryCode_onchange(){
var wMode = document.getElementById('WirelessMode').value;
getCountryRegionList(wMode);
}
function CountryRegion_onchange(country_region) {
var wmode_o = document.getElementById('WirelessMode');
var wmode;
if (wmode_o)
wmode = wmode_o.value;
if (wmode == "")
wmode = "<%=cfgs.WirelessMode%>";
getChannelList(wmode, country_region);
}
function Channel_onchange (ch) {
getBw(null, ch);
}
function Bw_onchange(bw, ch) {
var ch_val;
if (!ch){
var ch_o = document.getElementById('Channel');
if (ch_o)
ch_val = ch_o.value;
if (ch_val == "")
ch_val = "<%=cfgs.Channel%>";
} else {
ch_val = ch
}
get5G2nd80MhzChannelList(bw, ch_val);
getHTExtChannel(bw, ch_val);
}
function disableCountryRegionAsPerCountryCode(){
var wModeSelect = document.getElementById('WirelessMode');
var wMode = wModeSelect.value;
var cCode = document.getElementById('CountryCode').value;
var cRegionSelect = document.getElementById('__cr');
var invalidCR_2G = {
US:[1,3,4,5,7,31,32,33],
JP:[],
FR:[4,5,31,33],
IE:[4,5,31,33],
CN:[4,5,31,33],
NONE:[]
};
var invalidCR_5G = {
US:[1,7,11,15,19,20,21,22,30,31,32,33,36,37],
JP:[0,3,4,5,7,9,10,11,13,14,15,16,17,19,20,21,30,31,32,34,36,37],
FR:[0,3,4,5,7,9,10,11,12,13,14,15,16,17,19,20,21,30,31,32,34,36,37],
IE:[0,3,4,5,7,9,10,11,12,13,14,15,16,17,19,20,21,30,31,32,34,36,37],
CN:[1,7,9,11,12,13,14,15,18,19,20,21,22,30,31,32,33,36,37],
NONE:[]
};
if (is_mode_gband(wMode)){
// Channel 14 should be disabled for all the Countries except JAPAN(JP) and NONE Country Code.
// If WireleeMode is not in 'B only' mode, then Channel 14 should be disabled for Japan and NONE Country Code too.
if(wMode != "1"){
if(cCode == "JP"){
invalidCR_2G["JP"]=[4,5,31,33];
}
else if(cCode == "NONE"){
invalidCR_2G["NONE"]=[4,5,31,33];
}
}
if((cCode == "JP" && invalidCR_2G["JP"].length > 0) ||
(cCode == "NONE" && invalidCR_2G["NONE"].length > 0) ||
((cCode != "JP") && (cCode != "NONE"))){
for(var idx=0; idx < cRegionSelect.length; idx++){
if(invalidCR_2G[cCode] && invalidCR_2G[cCode].indexOf(cRegionSelect.options[idx].value * 1) != -1){
cRegionSelect.options[idx].disabled = true;
cRegionSelect.options[idx].selected = false;
}
}
}
}
else if (is_mode_aband(wMode) && cCode != "NONE"){
for(var idx=0; idx < cRegionSelect.length; idx++){
if(invalidCR_5G[cCode] && invalidCR_5G[cCode].indexOf(cRegionSelect.options[idx].value * 1) != -1){
cRegionSelect.options[idx].disabled = true;
cRegionSelect.options[idx].selected = false;
}
}
}
return cRegionSelect.value;
}
function initCountryRegionList(list, mode){
var select = document.getElementById('__cr');
var cr = {};
if (is_mode_gband(mode))
cr = "<%=cfgs.CountryRegion%>";
else if (is_mode_aband(mode))
cr = "<%=cfgs.CountryRegionABand%>";
var new_cr = initList(select, list, cr, "region");
new_cr = disableCountryRegionAsPerCountryCode();
CountryRegion_onchange(new_cr);
}
function getCountryRegionList(mode) {
XHR.get('<%=luci.dispatcher.build_url("admin", "network", "wifi", "get_country_region_list")%>', {mode:mode},
function(x)
{
//console.log(x);
//console.log(x.response);
var json = eval(x.response);
initCountryRegionList(json, mode);
}
);
}
function initChannelList(list) {
/* choose auto select when no matching item in the lis */
var select = document.getElementById('Channel');
var ch = {};
var new_ch = null;
ch.cval = select.value;
ch.oval = "<%=cfgs.Channel%>";
var new_ch = initList(select, list, ch, "channel");
Channel_onchange(new_ch);
}
function getChannelList(mode, country_region) {
XHR.get('<%=luci.dispatcher.build_url("admin", "network", "wifi", "get_channel_list")%>', {mode:mode, country_region:country_region},
function(x)
{
//console.log(x);
//console.log(x.response);
var json = eval(x.response);
initChannelList(json);
}
);
}
function GetCountryRegion(mode) {
var cr_o = document.getElementById('__cr');
var cr = "";
if (cr_o) {
cr = cr_o.value;
}
if (cr == "") {
if (is_mode_gband(mode)) {
cr = "<%=cfgs.CountryRegion%>";
} else if (is_mode_aband(mode)) {
cr = "<%=cfgs.CountryRegionABand%>";
} else {
alert("Cannot get valid CountryRegion from invalid WireleeMode");
}
}
return cr;
}
function getBw(mode, ch) {
/* choose bw as wide as possible if modification is needed */
var bw_sel = document.getElementById('__bw');
var wModeSelect,wmode;
wModeSelect = document.getElementById('WirelessMode');
if (!mode) {
wmode = wModeSelect.value*1;
} else {
wmode = mode*1;
}
if( <%=string.split(cfgs.WirelessMode,";")[1]%> != 18 ){
if (is_mode_legacy_only(wmode) || parseInt(ch) >= 165) {
for (var idx=0; idx < bw_sel.length; idx++) {
bw_sel.options[idx].disabled = false;
if (bw_sel.options[idx].value == 20)
bw_sel.options[idx].selected = true;
if (bw_sel.options[idx].value > 20)
bw_sel.options[idx].disabled = true;
}
} else if (is_ch_gband(ch)) {
for (var idx=0; idx < bw_sel.length; idx++) {
bw_sel.options[idx].disabled = false;
if ((bw_sel.options[idx].value == 60) && (bw_sel.selectedIndex > idx))
bw_sel.options[idx].selected = true;
if (bw_sel.options[idx].value > 60)
bw_sel.options[idx].disabled = true;
}
} else if (is_ch_aband(ch)) {
var chosen60 = false;
var bw160 = "<%=cfgs.VHT_BW%>"*1;
if (bw_sel.value == 60)
chosen60 = 1;
for (var idx=0; idx < bw_sel.length; idx++) {
bw_sel.options[idx].disabled = false;
if (bw_sel.options[idx].value == 40 && chosen60 && bw160 == 0) {
bw_sel.options[idx].selected = true;
} else if (bw_sel.options[idx].value == 60) {
bw_sel.options[idx].disabled = true;
bw_sel.options[idx].selected = false;
} else if (wmode == 8 && bw_sel.options[idx].value == 80) {
bw_sel.options[idx].disabled = true;
bw_sel.options[idx].selected = false;
} else if (bw_sel.options[idx].value == 160 && chosen60 && bw160 == 1) {
bw_sel.options[idx].selected = true;
}
}
}
}
var invalidChBwList = '<%=(dev.invalidChBwList and table.concat(dev.invalidChBwList,";"))%>'.split(";");
if(invalidChBwList.length > 0){
for (var idx=0; idx < bw_sel.length; idx++) {
if(invalidChBwList.indexOf(bw_sel.options[idx].value) != -1){
bw_sel.options[idx].disabled = true;
bw_sel.options[idx].selected = false;
}
}
}
if(wmode == 18 ) {
for (var idx=0; idx < bw_sel.length; idx++) {
bw_sel.options[idx].disabled = false;
if(bw_sel.options[idx].value == 40 && ch>229){
bw_sel.options[idx].disabled = true;
bw_sel.options[idx].selected = false;
}
if(bw_sel.options[idx].value == 80 && ch>221){
bw_sel.options[idx].disabled = true;
bw_sel.options[idx].selected = false;
}
if(bw_sel.options[idx].value == 160 && ch>221){
bw_sel.options[idx].disabled = true;
bw_sel.options[idx].selected = false;
}
if(bw_sel.options[idx].value == 161 || bw_sel.options[idx].value == 60){
bw_sel.options[idx].disabled = true;
bw_sel.options[idx].selected = false;
}
}
}
Bw_onchange(bw_sel.value, ch);
}
function init5G2nd80MhzChannelList(list,ch,cr) {
var select = document.getElementById('VHT_Sec80_Channel');
var ch2 = {};
var new_ch2 = null;
ch2.cval = select.value;
ch2.oval = "<%=cfgs.VHT_Sec80_Channel%>";
initList(select, list, ch2, "channel");
if (select.length > 0) {
document.getElementById("VHT_Sec80_Channel_TR").style.display = "";
select.disabled = false;
}
}
function get5G2nd80MhzChannelList(bw, ch) {
document.getElementById("VHT_Sec80_Channel_TR").style.display = "none";
var ch_5g_2nd = document.getElementById('VHT_Sec80_Channel');
ch_5g_2nd.disabled = true;
if (ch == "0")
return;
if (bw != "161" || ch == "0")
return;
var mode = document.getElementById('WirelessMode');
mode = mode.value*1;
var cr = GetCountryRegion(mode);
XHR.get('<%=luci.dispatcher.build_url("admin", "network", "wifi", "get_5G_2nd_80Mhz_channel_list")%>', {ch_cur:ch, country_region:cr},
function(x)
{
//console.log(x);
//console.log(x.response);
var json = eval(x.response);
init5G2nd80MhzChannelList(json,ch,cr);
}
);
}
function initHTExtChannelList(list,ch,cr) {
var select = document.getElementById('HT_EXTCHA');
var ch2 = {};
var new_ch2 = null;
ch2.cval = select.value;
ch2.oval = "<%=cfgs.HT_EXTCHA%>";
initList(select, list, ch2, "val");
if (select.length > 0) {
document.getElementById("HT_EXTCHA_TR").style.display = "";
select.disabled = false;
}
}
function getHTExtChannel(bw, ch) {
document.getElementById("HT_EXTCHA_TR").style.display = "none";
var ch_2g_ext = document.getElementById('HT_EXTCHA');
ch_2g_ext.disabled = true;
if (bw != "40" && bw != "60")
return;
var mode = document.getElementById('WirelessMode');
mode = mode.value*1;
// skip auto channel
if(mode==18){
if (ch == "0" || parseInt(ch) > 229)
return;
}
else{
if (ch == "0" || parseInt(ch) >= 165)
return;
}
var cr = GetCountryRegion(mode);
XHR.get('<%=luci.dispatcher.build_url("admin", "network", "wifi", "get_HT_ext_channel_list")%>', {mode:mode, ch_cur:ch, country_region:cr},
function(x)
{
//console.log(x);
//console.log(x.response);
var json = eval(x.response);
initHTExtChannelList(json,ch,cr);
}
);
}
function is_mode_legacy_only(mode) {
var imode = mode*1;
return ((imode >= 0) && (imode <= 4));
}
function is_mode_gband(mode) {
var imode = mode*1;
var gband_mode_list = [0,1,4,6,7,9,16];
var i;
for (i = 0; i < gband_mode_list.length; i++){
if( gband_mode_list[i] == imode )
return true;
}
return false;
}
function is_mode_aband(mode) {
var imode = mode*1;
var aband_mode_list = [2,8,11,14,15,17,18];
var i;
for (i = 0; i < aband_mode_list.length; i++){
if( aband_mode_list[i] == imode )
return true;
}
return false;
}
function is_ch_gband(ch) {
ch = ch*1;
if (ch == 0) {
var wmode = document.getElementById('WirelessMode');
return is_mode_gband(wmode.value);
}
return ((ch > 0) && (ch <= 14));
}
function is_ch_aband(ch) {
ch = ch*1;
if (ch == 0) {
var wmode = document.getElementById('WirelessMode');
return is_mode_aband(wmode.value);
}
return ((ch >= 36 ) && (ch <= 165));
}
function initList(selobj, list, selvals, value, text){
var sel = {};
var id = selobj.id;
var noChannelGrp = false;
var only2G = false;
if (typeof(selvals) != "object")
sel[0] = selvals;
else
sel = selvals;
selobj.innerHTML = "";
for (var i in list) {
if (value != "region") {
<% if bands == 3 and mtkwifi.band(string.split(cfgs.WirelessMode,";")[1]) == "5G" then %>
<% if cfgs.ChannelGrp == "0:0:1:1" then %>
if (list[i].channel == 0 || list[i].channel >= 100){
<% elseif cfgs.ChannelGrp == "1:1:0:0" then %>
if (list[i].channel <= 64){
<% else %>
noChannelGrp = true;
if (noChannelGrp){
<% end %>
var opt = document.createElement('option');
if(value)
opt.value = list[i][value];
else
opt.value = list[i].value;
if(text)
opt.text = list[i][text];
else
opt.text = list[i].text;
selobj.appendChild(opt);
}
<% else %>
only2G = true;
<% end %>
}
if (only2G || value == "region"){
var opt = document.createElement('option');
if(value)
opt.value = list[i][value];
else
opt.value = list[i].value;
if(text)
opt.text = list[i][text];
else
opt.text = list[i].text;
selobj.appendChild(opt);
}
}
var selv = null;
for (var k in sel) {
//console.log("[initList][" + id + "] sel[" + k + "]=" + sel[k]);
for (var i=0; i < selobj.length; i++){
if (selobj.options[i].value == sel[k]){
selobj.options[i].selected = true;
selv = sel[k];
//console.log("[initList][" + id + "] found selv=" + selv);
break;
}
}
if (selv) break;
}
if (!selv) {
selv = selobj.value;
//console.log("[initList][" + id + "] !selv, selv=" + selv);
}
return selv;
}
function ValidateAdvancedSettings()
{
var tmpVal = document.getElementById("TxPower").value;
if(isNaN(tmpVal) || !/^\d{1,3}$/.test(tmpVal) || parseInt(tmpVal) < 1 || parseInt(tmpVal) > 100){
alert("TX Power is incorrect!\nPlease enter an integer number between 1 to 100 inclusive.");
document.getElementById("TxPower").focus();
document.getElementById("TxPower").select();
return false;
}
return true;
}
function ValidateAllSettings(){
if( !ValidateAdvancedSettings() ){
return false;
}
return true;
}
function get_apply_status_cb(rsp)
{
try{
var r = JSON.parse(rsp);
}
catch(e){
return;
}
if(r.status == "ON_PROGRESS"){
var u = confirm("Device is applying the saved settings now!\n" +
"It is recommended to wait until all the saved settings are applied.\n" +
"Please click on 'OK' button to wait for the device.\n" +
"or click on 'Cancel' button to configure the settings available in current web-page.");
if (u == true) {
location = '<%=luci.dispatcher.build_url("admin", "network", "wifi", "loading")%>' + window.location.pathname;
}
}
}
function get_apply_status()
{
XHR.get('<%=luci.dispatcher.build_url("admin", "network", "wifi", "get_apply_status")%>', null,
function(x)
{
console.log(x);
get_apply_status_cb(x.response);
}
);
}
window.onload = function() {
var mode = '<%=string.split(cfgs.WirelessMode,";")[1]%>'
var cr = GetCountryRegion(mode);
getCountryRegionList(mode, cr);
get_apply_status();
}
</script>
<%+footer%>

View File

@@ -0,0 +1,90 @@
<%#
File name : mtk_wifi_loading.htm
This file is used in WebUI based on LuCI to handle the loading event.
%>
<%+header%>
<%
local disp = require "luci.dispatcher"
local request = disp.context.request
local url = "/"..table.concat(request,'/',5)
%>
<h2><%:Wireless%></h2>
<div class="alert-message" id="BusyMsg">
<img src="<%=resource%>/icons/loading.gif" alt="" style="vertical-align:middle" />
<big><strong><%:Please wait while the settings are being applied.%></strong></big>
</div>
<div class="alert-message error" id="TimeoutMsgDiv" style="display:none">
<big><strong id="TimeoutMsg">Device is taking too much time to apply the settings!</strong></big>
</div>
<script type="text/javascript">
function visit_url(url)
{
window.onbeforeunload = function() {};
if(url && url.indexOf('<%=controller%>') != -1){
location = url;
}
else{
location = '<%=luci.dispatcher.build_url("admin", "network", "wifi")%>';
}
}
function get_apply_status_cb(rsp, remNumTries)
{
try{
var r = JSON.parse(rsp);
if(r.status == "DONE"){
visit_url('<%=url%>');
return;
}
else if(r.status == "REBOOT"){
visit_url('<%=luci.dispatcher.build_url("admin", "network", "wifi", "apply_reboot")%>');
return;
}
}
catch(e){}
finally{
remNumTries -= 1;
if(remNumTries > 0){
window.setTimeout(get_apply_status, 5000, remNumTries);
}
else{
show_header();
document.getElementById("TimeoutMsgDiv").style.display = '';
document.getElementById("BusyMsg").style.display = 'none';
}
}
}
function get_apply_status(remNumTries)
{
XHR.get('<%=luci.dispatcher.build_url("admin", "network", "wifi", "get_apply_status")%>', null,
function(x)
{
console.log(x);
get_apply_status_cb(x.response, remNumTries);
}
);
}
function show_header()
{
document.getElementsByTagName("HEADER")[0].style.display = "block";
}
function hide_header()
{
document.getElementsByTagName("HEADER")[0].style.display = "none";
}
window.onload = function(){
hide_header();
window.setTimeout(get_apply_status, 5000, 180);
}
window.onbeforeunload = function(evt) {
evt.returnValue = "Saved data have not been applied yet! Are you sure?";
return evt.returnValue;
}
</script>
<%+footer%>

View File

@@ -0,0 +1,557 @@
<%+header%>
<!--
This module is a demo to configure MTK' proprietary WiFi driver.
Basic idea is to bypass uci and edit wireless profile (mt76xx.dat) directly.
LuCI's WiFi configuration is more logical and elegent, but it's quite tricky to
translate uci into MTK's WiFi profile (like we did in "uci2dat").
Hua Shao <nossiac@163.com>
-->
<%
local mtkwifi = require("mtkwifi")
local devs = mtkwifi.get_all_devs()
local l1dat, l1 = mtkwifi.__get_l1dat()
local dridx = l1.DEV_RINDEX
local main_ifname
local chipname
%>
<style>
table,td,th
{
border-top:1px solid ;
border-spacing: 0;
border-color:#E0E0E0;
}
</style>
<h2><%:Wireless%></h2>
<% if #devs == 0 then %>
<div class="alert-message">
<big><strong><%:No wireless device found!%></strong></big>
</div>
<% else %>
<fieldset class="cbi-section">
<table class="cbi-section-table" style="empty-cells:hide">
<% for _,dev in ipairs(devs) do %>
<% main_ifname = l1dat and l1dat[dridx][dev.devname].main_ifname or dbdc_prefix[mainidx][subidx].."0" %>
<% if mtkwifi.exists("/sys/class/net/"..main_ifname) then %>
<!-- physical device -->
<tbody>
<% if chipname ~= string.split(dev.devname,".")[1].."."..(dev.mainidx) then %>
<% chipname = string.split(dev.devname,".")[1].."."..(dev.mainidx) %>
<tr style="height:45px">
<td style="padding:15px;">
<img src="/luci-static/resources/icons/wifi_big.png">
</td>
<td colspan="2" style="text-align:left">
<big><strong title="<%=dev.profile%>"> <%=string.split(dev.devname,".")[1]%></strong></big>
<%if not dev.vifs then%>
<span style="color:red;">* <%:FATAL ERROR: Incorrect Profile Settings%></span>
<%end%>
<br>
<%if dev.version then%>
<span> <%:Driver version%>: <%=dev.version%> <br/></span>
<%end%>
</td>
<td style="width:310px;text-align:right">
<div id="ActionBtns_<%=string.split(dev.devname,".")[1]%>">
<button class="cbi-button cbi-button-edit" onclick="visit_url('<%=string.split(dev.devname,".")[1]%>',
'<%=luci.dispatcher.build_url("admin", "network", "wifi", "chip_cfg_view", dev.devname)%>')"><%:CONFIG%></button>
</div>
<div id="BusyText_<%=string.split(dev.devname,".")[1]%>" style="display:none">
<big><strong><%:Processing request.%></strong></big>
</div>
</td>
</tr>
<% end %>
<tr>
<td style="width:56px"></td>
<td colspan="2" style="text-align:left;padding-left:25px;">
<big><strong title="<%=dev.profile%>"><%=dev.devname%></strong></big>
<%local diff = mtkwifi.diff_profile(dev.profile)%>
<%if next(diff) ~= nil then%>
<span style="color:red;">* <%:need reload to apply changes%></span>
<%end%>
<br>
<%local cfgs = mtkwifi.load_profile(dev.profile)%>
<span> <%:Current Band%>: <%=mtkwifi.band(string.split(cfgs.WirelessMode,";")[1])%> <br/> </span>
<% if dev.Enable == "0" then%>
<span style="color:red;"> <%:Wireless device is disabled%> </span>
<%else%>
<span> <%:Work mode%>: <% if dev.ApCliEnable == "1" then %> APCli <% else %> AP <% end %> <br/> </span>
<%local temp = mtkwifi.get_temp(dev.devname)%>
<%if temp then%>
<span> <%:Tempature%>: <%=temp%>&#176;C <br/> </span>
<%end%>
<%local txpwr = mtkwifi.get_txpwr(dev.devname)%>
<%if txpwr then%>
<span> <%:Tx Power%>: <%=txpwr%> dbm <br/> </span>
<%end%>
<%end%>
</td>
<td style="width:310px;text-align:right">
<div id="ActionBtns_<%=dev.devname%>">
<%if not dev.vifs then%>
<button class="cbi-button cbi-button-apply" id="reset" onclick="visit_url('<%=dev.devname%>',
'<%=luci.dispatcher.build_url("admin", "network", "wifi", "reset_to_defaults", dev.devname)%>')"><%:Restore Profile to Factory Settings%></button>
<%else%>
<button class="cbi-button cbi-button-reset" onclick="visit_url_confirm('<%:Are you sure to RELOAD%> <%=dev.devname%>?',
'<%=dev.devname%>','<%=luci.dispatcher.build_url("admin", "network", "wifi", "reload", dev.devname)%>')"><%:RELOAD%></button>
<button class="cbi-button cbi-button-edit" onclick="visit_url('<%=dev.devname%>',
'<%=luci.dispatcher.build_url("admin", "network", "wifi", "dev_cfg_view", dev.devname)%>')"><%:CONFIG%></button>
<button class="cbi-button cbi-button-add" onclick='add_vif("<%=dev.devname%>","<%=dev.vifs.__prefix%>","<%=dev.maxVif%>")'><%:ADD%></button>
<%end%>
</div>
<div id="BusyText_<%=dev.devname%>" style="display:none">
<big><strong><%:Processing request.%></strong></big>
</div>
</td>
</tr>
<!-- /physical device -->
<% if dev.vifs and dev.Enable == "1" then%>
<!-- network list -->
<% for _,vif in ipairs(dev.vifs) do %>
<tr class="cbi-section-table-row cbi-rowstyle-1">
<td></td>
<td class="cbi-value-field" style="width:16px; padding:3px;padding-left:40px;">
<% if vif.state == "up" then %>
<img src="/luci-static/resources/icons/signal-75-100.png">
<% else %>
<img src="/luci-static/resources/icons/signal-none.png">
<% end %>
</td>
<td class="cbi-value-field" style="vertical-align:middle; text-align:left; padding:3px">
<strong><%:Interface%>:</strong> <%=vif.vifname%> |
<strong><%:Type%>:</strong> AP |
<strong>SSID:</strong>
<span id="SSID_<%=vif.vifname%>">
<% if vif.__ssid == "" then %>
<span style="color:red;"><%:Error: value not present in dat file%></span>
<% else %>
<span> <%=vif.__ssid and vif.__ssid:gsub(" ","&nbsp;") or nil%> <% end %> </span>
</span> |
<strong><%:Channel%>:</strong>
<span id="CHANNEL_<%=vif.vifname%>"><%=vif.__channel or dev.Channel%></span>
<br>
<% if vif.state == "up" then %>
<strong>BSSID:</strong> <span id="BSSID_<%=vif.vifname%>"><%=vif.__bssid%></span> | <strong><%:Wireless Mode%>:</strong> <span><%=dev.WirelessModeList[tonumber(vif.__wirelessmode)]%></span>
<% else %>
<%:Wireless is disabled or not associated%>
<% end %>
</td>
<td class="cbi-value-field" style="text-align:right">
<div id="ActionBtns_<%=vif.vifname%>">
<% if not vif.state then %>
<button class="cbi-button cbi-button-apply" onclick="alert('Please click on Reload button of ' + '<%=dev.devname%>' + ' device to enable this interface.')"><%:ENABLE%></button>
<% elseif vif.state == "up" then %>
<button class="cbi-button cbi-button-reset" onclick="visit_url_confirm('<%:Are you sure to DISABLE%> <%=vif.vifname%>?',
'<%=vif.vifname%>','<%=luci.dispatcher.build_url("admin", "network", "wifi", "vif_disable", vif.vifname)%>')"><%:DISABLE%></button>
<% else %>
<button class="cbi-button cbi-button-apply" onclick="visit_url('<%=vif.vifname%>',
'<%=luci.dispatcher.build_url("admin", "network", "wifi", "vif_enable", vif.vifname)%>')"><%:ENABLE%></button>
<% end %>
<button class="cbi-button cbi-button-edit" onclick="visit_url('<%=vif.vifname%>',
'<%=luci.dispatcher.build_url("admin", "network", "wifi", "vif_cfg_view", dev.devname, vif.vifname)%>')"><%:CONFIG%></button>
<button class="cbi-button cbi-button-remove" onclick="visit_url_confirm('<%:Are you sure to REMOVE%> <%=vif.vifname%>?',
'<%=vif.vifname%>','<%=luci.dispatcher.build_url("admin", "network", "wifi", "vif_del", dev.devname, vif.vifname)%>')"><%:REMOVE%></button>
</div>
<div id="BusyText_<%=vif.vifname%>" style="display:none">
<big><strong><%:Processing request.%></strong></big>
</div>
</td>
</tr>
<% end %>
<!-- /network list -->
<!-- apcli list -->
<% if dev.apcli then %>
<tr>
<td></td>
<td class="cbi-value-field" style="width:16px; padding:3px;padding-left:40px;">
<% if dev.apcli.state == "up" then %>
<img src="/luci-static/resources/icons/signal-75-100.png">
<% else %>
<img src="/luci-static/resources/icons/signal-none.png">
<% end %>
</td>
<td class="cbi-value-field" style="vertical-align:middle; text-align:left; padding:3px"><strong><%:Interface%>:</strong> <%=dev.apcli.devname%> | <strong><%:Type%>:</strong> STA | <strong><%:Status%>:</strong> <span id="ConnStatus_<%=dev.apcli.devname%>"><% if dev.ApCliEnable ~= "1" then %> <%:Disconnected%> <% end %></span>
<br>
<div id="LoadingBar_<%=dev.apcli.devname%>" <% if dev.ApCliEnable ~= "1" then %> style="display:none" <% end %>>
<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="width:20px;height:20px;vertical-align:middle;"/> <cite>&nbsp;<%:Loading connection information of%> <%=dev.apcli.devname%></cite>
</div>
<div id="ConnInfo_<%=dev.apcli.devname%>" style="display:none">
<strong>BSSID:</strong> <span id="ApCliBssid_<%=dev.apcli.devname%>"></span> |
<strong>SSID:</strong> <span id="ApCliSsid_<%=dev.apcli.devname%>"></span>
</div>
<span id="DisConnMsg_<%=dev.apcli.devname%>" <% if dev.ApCliEnable == "1" then %> style="display:none" <% end %>><%:Wireless is disabled or not associated%></span>
</td>
<td style="text-align:right">
<div id="ActionBtns_<%=dev.apcli.devname%>">
<% if dev.ApCliEnable ~= "1" then %>
<% if dev.apcli.state == "up" then %>
<button class="cbi-button cbi-button-reset" onclick="visit_url_confirm('<%:Are you sure to DISABLE%> <%=dev.apcli.devname%>?',
'<%=dev.apcli.devname%>','<%=luci.dispatcher.build_url("admin", "network", "wifi", "vif_disable", dev.apcli.vifname)%>')"><%:DISABLE%></button>
<button class="cbi-button cbi-button-reload" onclick="visit_url_confirm('<%:Are you sure to RECONNECT%> <%=dev.apcli.devname%>?',
'<%=dev.apcli.devname%>','<%=luci.dispatcher.build_url("admin", "network", "wifi", "apcli_connect", dev.devname, dev.apcli.vifname)%>')"><%:RECONNECT%></button>
<% end %>
<button class="cbi-button cbi-button-edit" onclick="visit_url('<%=dev.apcli.devname%>',
'<%=luci.dispatcher.build_url("admin", "network", "wifi", "apcli_cfg_view", dev.devname, dev.apcli.vifname)%>')"><%:CONFIG%></button>
<% else %>
<button class="cbi-button cbi-button-reset" style="display:none" id="ApCliDownBtn_<%=dev.apcli.devname%>" onclick="visit_url_confirm('<%:Are you sure to DISABLE%> <%=dev.apcli.devname%>?',
'<%=dev.apcli.devname%>','<%=luci.dispatcher.build_url("admin", "network", "wifi", "vif_disable", dev.apcli.vifname)%>')"><%:DISABLE%></button>
<button class="cbi-button cbi-button-apply" style="display:none" id="ApCliUpBtn_<%=dev.apcli.devname%>" onclick="visit_url('<%=dev.apcli.devname%>',
'<%=luci.dispatcher.build_url("admin", "network", "wifi", "vif_enable", dev.apcli.vifname)%>')"><%:ENABLE%></button>
<button class="cbi-button cbi-button-remove" style="display:none" id="ApCliDisConnBtn_<%=dev.apcli.devname%>" onclick="visit_url_confirm('<%:Are you sure to DISCONNECT%> <%=dev.apcli.devname%>?',
'<%=dev.apcli.devname%>','<%=luci.dispatcher.build_url("admin", "network", "wifi", "apcli_disconnect", dev.devname, dev.apcli.vifname)%>')"><%:DISCONNECT%></button>
<button class="cbi-button cbi-button-reload" style="display:none" id="ApCliConnBtn_<%=dev.apcli.devname%>" onclick="visit_url_confirm('<%:Are you sure to RECONNECT%> <%=dev.apcli.devname%>?',
'<%=dev.apcli.devname%>','<%=luci.dispatcher.build_url("admin", "network", "wifi", "apcli_connect", dev.devname, dev.apcli.vifname)%>')"><%:RECONNECT%></button>
<button class="cbi-button cbi-button-edit" style="display:none" id="ApCliCfgBtn_<%=dev.apcli.devname%>" onclick="visit_url('<%=dev.apcli.devname%>',
'<%=luci.dispatcher.build_url("admin", "network", "wifi", "apcli_cfg_view", dev.devname, dev.apcli.vifname)%>')"><%:CONFIG%></button>
<% end %>
</div>
<div id="BusyText_<%=dev.apcli.devname%>" style="display:none">
<big><strong><%:Processing request.%></strong></big>
</div>
</td>
</tr>
<% end %>
<!-- /apcli list -->
<% end %>
</tbody>
<% end %>
<% end %>
</table>
</fieldset>
<fieldset class="cbi-section">
<h2><%:Station List%></h2>
<table class="cbi-section-table" style="margin: auto" id="iw-assoclist">
<tr class="cbi-section-table-titles">
<th class="cbi-section-table-cell"><%:Interface%></th>
<th class="cbi-section-table-cell">SSID</th>
<th class="cbi-section-table-cell"><%:MAC-Address%></th>
<th class="cbi-section-table-cell"><%:Hostname%></th>
<th class="cbi-section-table-cell"><%:Security%></th>
<th class="cbi-section-table-cell"><%:Signal%> (dBm)</th>
<th class="cbi-section-table-cell"><%:TX Rate%></th>
<th class="cbi-section-table-cell"><%:RX Rate%></th>
<th class="cbi-section-table-cell"><%:Connected Time%></th>
</tr>
<tr class="cbi-section-table-row cbi-rowstyle-2">
<td class="cbi-value-field" colspan="9">
<em><%:Collecting data...%></em>
</td>
</tr>
</table>
</fieldset>
<% end %>
<script>
function clean_stalist_table()
{
var table = document.getElementById('iw-assoclist');
//console.log("clean_aplist_table.aplist len=" + table.rows.length);
while(table.rows.length > 1)
table.deleteRow(-1);
}
function is_rssi_valid(rssi)
{
if (rssi == "-109" || rssi == "-127")
return false;
return true;
}
function insert_stalist_table(ifname, ssid, sta_list)
{
var i, tr_row, td_cell;
var rssi_str, host_str;
var tableid = document.getElementById('iw-assoclist');
for (i = 0; sta_list[i] ; i++){
//console.log(sta_list[i]);
tr_row = tableid.insertRow(-1);
tr_row.align = "center";
td_cell = tr_row.insertCell(-1);
td_cell.innerHTML = ifname;
td_cell = tr_row.insertCell(-1);
td_cell.innerHTML = ssid;
td_cell = tr_row.insertCell(-1);
td_cell.innerHTML = sta_list[i].MacAddr;
host_str = sta_list[i].hostname
if (sta_list[i].ipv4 != "")
host_str = host_str + ", " + sta_list[i].ipv4
if (sta_list[i].ipv6 != "")
host_str = host_str + "<br>" + sta_list[i].ipv6
td_cell = tr_row.insertCell(-1);
td_cell.innerHTML = host_str;
td_cell = tr_row.insertCell(-1);
td_cell.innerHTML = sta_list[i].security;
rssi_str = sta_list[i].AvgRssi0;
if (is_rssi_valid(sta_list[i].AvgRssi1))
rssi_str = rssi_str + ", " + sta_list[i].AvgRssi1;
if (is_rssi_valid(sta_list[i].AvgRssi2))
rssi_str = rssi_str + ", " + sta_list[i].AvgRssi2;
if (is_rssi_valid(sta_list[i].AvgRssi3))
rssi_str = rssi_str + ", " + sta_list[i].AvgRssi3;
td_cell = tr_row.insertCell(-1);
td_cell.innerHTML = rssi_str;
//TxRate
td_cell = tr_row.insertCell(-1);
td_cell.innerHTML = sta_list[i].TxRate + "Mbps," + sta_list[i].Bw+ "MHz" + "<br>" + sta_list[i].PhyMode + ", " + sta_list[i].Mcs + ", " + sta_list[i].Gi;
//RxRate
td_cell = tr_row.insertCell(-1);
td_cell.innerHTML = sta_list[i].RxRate + "Mbps," + sta_list[i].LastBw + "MHz" + "<br>" + sta_list[i].LastPhyMode + ", " + sta_list[i].LastMcs + ", " + sta_list[i].LastGi;
td_cell = tr_row.insertCell(-1);
td_cell.innerHTML = sta_list[i].Hr + ":" + sta_list[i].Min + ":" + sta_list[i].Sec;
}
}
function disable_all_buttons()
{
var inp = document.getElementsByTagName("BUTTON");
for(var idx=0; idx < inp.length; idx++){
inp[idx].disabled = true;
}
}
function enable_all_buttons()
{
var inp = document.getElementsByTagName("BUTTON");
for(var idx=0; idx < inp.length; idx++){
inp[idx].disabled = false;
}
}
function visit_url(idSuffix,to)
{
//disable_all_buttons();
//document.getElementById("ActionBtns_"+idSuffix).style.display = "none";
//document.getElementById("BusyText_"+idSuffix).style.display = "";
location.href = to;
}
function visit_url_confirm(msg, idSuffix, to) {
var i = confirm(msg);
if (i)
visit_url(idSuffix,to);
}
function add_vif(devName, vifPrefix, maxVif)
{
if (!confirm('<%:Are you sure to ADD wireless interface?%>'))
return;
disable_all_buttons();
document.getElementById("ActionBtns_"+devName).style.display = "none";
document.getElementById("BusyText_"+devName).style.display = "";
if(isNaN(maxVif) || !/^\d{1,}$/.test(maxVif)){
alert("Failed to add a new interface!\nERROR: Incorrect maximum supported VIF setting!\nmaxVif = " + maxVif);
location.reload(true);
return;
}
XHR.get('<%=luci.dispatcher.build_url("admin", "network", "wifi", "get_bssid_num")%>/' + devName, null,
function(x)
{
try{
var resp = JSON.parse(x.response);
if(resp["status"] == "SUCCESS"){
if(isNaN(resp["bssidNum"]) || !/^\d{1,}$/.test(resp["bssidNum"]) || parseInt(resp["bssidNum"]) > parseInt(maxVif)){
alert("Failed to add a new interface!\nERROR: Device settings have been corrupted!\nBssidNum in Response is: " + resp["bssidNum"]);
location.reload(true);
}
else if(parseInt(resp["bssidNum"]) == parseInt(maxVif)){
alert("As the Device " + devName + " supports maximum " + maxVif + " virtual interfaces, no more virtual interfaces can be added!");
}
else{
location.href = '<%=luci.dispatcher.build_url("admin", "network", "wifi", "vif_add_view")%>/' + devName + '/' + vifPrefix;
}
}
else{
alert("Failed to add a new interface!\nERROR: " + resp["status"]);
}
}
catch(e){
alert("Failed to add a new interface!\nERROR: Incorrect response received!");
console.log("Failed to add a new interface!\nERROR: [" + e.name + "] " + e.message);
}
finally{
enable_all_buttons();
document.getElementById("ActionBtns_"+devName).style.display = "";
document.getElementById("BusyText_"+devName).style.display = "none";
}
}
);
}
var stainfo = [];
var stainfo_inited = 0;
function staInfoHandler()
{
for (var i=0; stainfo[i]; i++) {
//console.log(stainfo[i].ifname);
XHR.poll(3, "<%=luci.dispatcher.build_url("admin", "network", "wifi", "sta_info")%>/" + stainfo[i].ifname, null,
function(x)
{
try{
stainfo_inited = 1;
//console.log(x.responseText);
var response = JSON.parse(x.responseText);
for (var j=0; stainfo[j]; j++) {
if (response[0].ifname == stainfo[j].ifname) {
response.shift(); //delete first item
stainfo[j].sta = response;
}
}
}
catch(e){}
}
);
}
}
function printstainfo()
{
if (stainfo.length == 0) {
clean_stalist_table();
return;
}
if (stainfo_inited) {
//console.log(stainfo);
clean_stalist_table();
var stabuf = stainfo;
for (var i=0; stabuf[i]; i++) {
insert_stalist_table(stabuf[i].ifname, stabuf[i].ssid, stabuf[i].sta);
}
}
setTimeout(printstainfo, 2000);
}
function apcliInfoTimerHandler(vifNameList,idx,remSec)
{
XHR.get('<%=luci.dispatcher.build_url("admin", "network", "wifi", "get_apcli_conn_info")%>/' + vifNameList[idx], null,
function(x)
{
try{
updateApCliInfoCb(vifNameList,idx,remSec,JSON.parse(x.response));
}
catch(e){
var y={conn_state:"Disconnected"};
updateApCliInfoCb(vifNameList,idx,0,y);
}
}
);
}
function updateApCliInfoCb(vifNameList,idx,remSec,connInfo)
{
var vifName = vifNameList[idx];
if(connInfo.hasOwnProperty("conn_state") && connInfo["conn_state"] == "Connected"){
document.getElementById("ConnStatus_"+vifName).innerHTML = "<%:Connected%>";
document.getElementById("ApCliBssid_"+vifName).innerHTML = (connInfo.hasOwnProperty("bssid")) ? connInfo["bssid"] : "?";
document.getElementById("ApCliSsid_"+vifName).innerHTML = (connInfo.hasOwnProperty("ssid")) ? connInfo["ssid"].replace(/ /g,"&nbsp;") : "";
document.getElementById("LoadingBar_"+vifName).style.display = "none";
document.getElementById("ApCliDownBtn_"+vifName).style.display = "";
document.getElementById("ApCliDisConnBtn_"+vifName).style.display = "";
document.getElementById("ApCliCfgBtn_"+vifName).style.display = "";
document.getElementById("ConnInfo_"+vifName).style.display = "";
if(idx < vifNameList.length - 1){
setTimeout(apcliInfoTimerHandler,1000,vifNameList,idx+1,5);
}
}
else{
if(remSec > 1){
setTimeout(apcliInfoTimerHandler,1000,vifNameList,idx,remSec - 1);
}
else{
if (connInfo.hasOwnProperty("conn_state") && (connInfo["conn_state"] == "Connected")) {
document.getElementById("ConnStatus_"+vifName).innerHTML = "<%:Connected%>";
} else {
document.getElementById("ConnStatus_"+vifName).innerHTML = "<%:Disconnected%>";
}
document.getElementById("LoadingBar_"+vifName).style.display = "none";
document.getElementById("DisConnMsg_"+vifName).style.display = "";
if (connInfo.hasOwnProperty("infc_state") && connInfo["infc_state"] == "up"){
document.getElementById("ApCliDownBtn_"+vifName).style.display = "";
}
else{
document.getElementById("ApCliUpBtn_"+vifName).style.display = "";
}
document.getElementById("ApCliConnBtn_"+vifName).style.display = "";
document.getElementById("ApCliCfgBtn_"+vifName).style.display = "";
if(idx < vifNameList.length - 1){
setTimeout(apcliInfoTimerHandler,1000,vifNameList,idx+1,5);
}
}
}
}
function updateApCliInfo()
{
var apCliInfcList=[];
<% for _,dev in ipairs(devs) do %>
<% if dev.apcli and dev.ApCliEnable == "1" then %>
apCliInfcList.push("<%=dev.apcli.devname%>");
<% end %>
<% end %>
if (apCliInfcList.length >= 1 ){
setTimeout(apcliInfoTimerHandler,1000,apCliInfcList,0,3);
}
}
function get_apply_status_cb(rsp)
{
try{
var r = JSON.parse(rsp);
}
catch(e){
return;
}
if(r.status == "ON_PROGRESS"){
var u = confirm("Device is applying the saved settings now!\n" +
"It is recommended to wait until all the saved settings are applied.\n" +
"Please click on 'OK' button to wait for the device.\n" +
"or click on 'Cancel' button to configure the settings available in current web-page.");
if (u == true) {
location = '<%=luci.dispatcher.build_url("admin", "network", "wifi", "loading")%>' + window.location.pathname;
}
}
}
function get_apply_status()
{
XHR.get('<%=luci.dispatcher.build_url("admin", "network", "wifi", "get_apply_status")%>', null,
function(x)
{
console.log(x);
get_apply_status_cb(x.response);
}
);
}
window.onload = function(){
get_apply_status();
updateApCliInfo();
<% for _,dev in ipairs(devs) do %>
<% if dev.vifs then%>
<% for _,vif in ipairs(dev.vifs) do %>
<% if vif.state == "up" then %>
stainfo.push({"ifname": "<%=vif.vifname%>", "ssid": "<%=vif.__ssid%>", "sta": ""});
<% end %>
<% end %>
<% end %>
<% end %>
staInfoHandler(stainfo);
printstainfo();
}
</script>
<%+footer%>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,515 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8\n"
msgid "Auto"
msgstr "自动"
msgid "Disable"
msgstr "禁用"
msgid "US"
msgstr "US (美国)"
msgid "JP"
msgstr "JP (日本)"
msgid "FR"
msgstr "FR (法国)"
msgid "IE"
msgstr "IE (爱尔兰)"
msgid "CN"
msgstr "CN (中国)"
msgid "NONE"
msgstr "无"
msgid "Short"
msgstr "Short (短)"
msgid "long"
msgstr "Long (长)"
msgid "Enable"
msgstr "启用"
msgid "Mandatory"
msgstr "强制"
msgid "Always On"
msgstr "始终开启"
msgid "Always Off"
msgstr "始终关闭"
msgid "Tempature"
msgstr "温度"
msgid "Tx Power"
msgstr "发射功率"
msgid "Driver version"
msgstr "驱动版本"
msgid "Current Band"
msgstr "当前频段"
msgid "Work mode"
msgstr "工作模式"
msgid "CONFIG"
msgstr "配置"
msgid "RELOAD"
msgstr "重载"
msgid "ADD"
msgstr "添加"
msgid "RECONNECT"
msgstr "重连"
msgid "DISABLE"
msgstr "禁用"
msgid "ENABLE"
msgstr "启用"
msgid "REMOVE"
msgstr "移除"
msgid "Station List"
msgstr "已连接站点"
msgid "Interface"
msgstr "接口"
msgid "MAC-Address"
msgstr "MAC地址"
msgid "Signal"
msgstr "信号强度"
msgid "TX Rate"
msgstr "发射速率"
msgid "Rx Rate"
msgstr "接收速率"
msgid "Connected Time"
msgstr "已连接时间"
msgid "Channel"
msgstr "信道"
msgid "Security Mode"
msgstr "加密方式"
msgid "Action"
msgstr "动作"
msgid "Choose This"
msgstr "选择"
msgid "40MHz HT Ext Channel"
msgstr "HT 40MHz 扩展信道"
msgid "80MHz Second VHT Channel"
msgstr "VHT 80MHz 第二信道"
msgid "Type"
msgstr "接口类型"
msgid "Status"
msgstr "状态"
msgid "DISCONNECT"
msgstr "断开"
msgid "Connected"
msgstr "已连接"
msgid "Disconnected"
msgstr "未连接"
msgid "FATAL ERROR: Incorrect Profile Settings"
msgstr "严重错误: 配置文件设置不正确"
msgid "Error: value not present in dat file"
msgstr "错误dat文件中未指定SSID值"
msgid "Wireless is disabled or not associated"
msgstr "无线已禁用或未关联"
msgid "Processing request."
msgstr "正在处理请求..."
msgid "need reload to apply changes"
msgstr "请重启无线以应用设置"
msgid "Click here"
msgstr "点击此处"
msgid "to apply changes"
msgstr "以应用设置"
msgid "Wireless Mode"
msgstr "无线模式"
msgid "Chip Configurations"
msgstr "无线芯片设置"
msgid "Device Configuration"
msgstr "无线设备设置"
msgid "Interface Configurations"
msgstr "无线接口设置"
msgid "ApCli Configurations"
msgstr "ApCli设置"
msgid "Loading connection information of"
msgstr "正在加载连接信息"
msgid "ApCli Available Wireless Networks"
msgstr "ApCli可用无线网络列表"
msgid "ApCli Connection Configurations"
msgstr "ApCli连接设置"
msgid "Decline BA Request"
msgstr "拒绝BlockAck请求"
msgid "Reverse Direction Grant (RDG)"
msgstr "HT反向授权(RDG)"
msgid "BA Win size"
msgstr "Block Ack窗口大小"
msgid "HT Disallow TKIP"
msgstr "不允许HT TKIP"
msgid "Wi-Fi HWNAT"
msgstr "启用Wi-Fi硬件加速"
msgid "E2pAccessMode"
msgstr "EEPROM访问方式"
msgid "Beacon Interval"
msgstr "Beacon间隔"
msgid "Data Beacon Rate (DTIM)"
msgstr "DTIM周期"
msgid "BG Protection Mode"
msgstr "BG保护模式"
msgid "Short Preamble"
msgstr "启用短前导码"
msgid "TX Burst"
msgstr "启用突发传输"
msgid "Short Slot"
msgstr "启用短时槽"
msgid "Channel Auto"
msgstr "自动信道"
msgid "BSS color"
msgstr "BSS颜色代码"
msgid "TWT Support"
msgstr "TWT节能机制"
msgid "Country Code"
msgstr "国家代码"
msgid "Country Region"
msgstr "国家区域"
msgid "Channel BandWidth"
msgstr "信道宽度"
msgid "TX Stream"
msgstr "发射空间流"
msgid "RX Stream"
msgstr "接收空间流"
msgid "TX Power"
msgstr "发射功率"
msgid "DFS"
msgstr "动态频率选择(DFS)"
msgid "Beam Forming and MIMO Setting"
msgstr "波束成形与MU-MIMO设置"
msgid "Spatial Reuse"
msgstr "空间复用"
msgid "Auth Mode"
msgstr "认证模式"
msgid "Encryption"
msgstr "加密方式"
msgid "Key Renewal Interval"
msgstr "组密钥更新周期"
msgid "Key"
msgstr "密码"
msgid "MFPC"
msgstr "兼容保护管理帧(MFPC)"
msgid "MFPR"
msgstr "强制保护管理帧(MFPR)"
msgid "Hidden SSID"
msgstr "隐藏SSID"
msgid "AP Isolation"
msgstr "启用AP隔离"
msgid "WMM Capable"
msgstr "启用WMM"
msgid "Fixed TX Rate"
msgstr "固定发射速率"
msgid "HT STBC"
msgstr "启用HT STBC"
msgid "HT LDPC"
msgstr "启用HT LDPC"
msgid "VHT STBC"
msgstr "启用VHT STBC"
msgid "VHT LDPC"
msgstr "启用VHT LDPC"
msgid "DLS Capable"
msgstr "启用终端直通(DLS)"
msgid "802.11k RRM"
msgstr "启用 802.11k"
msgid "802.11r FT"
msgstr "启用 802.11r"
msgid "APSD Capable"
msgstr "启用节能模式(APSD)"
msgid "Fragment Threshold"
msgstr "分片阈值"
msgid "RTS Threshold"
msgstr "RTS阈值"
msgid "VHT Short GI"
msgstr "VHT保护间隔(GI)"
msgid "VHT BW Signaling"
msgstr "VHT动态频宽信令"
msgid "Dynamic"
msgstr "动态"
msgid "HT Protection"
msgstr "HT保护模式"
msgid "HT Guard Interval"
msgstr "HT保护间隔(GI)"
msgid "HT Operating Mode"
msgstr "HT操作模式"
msgid "HT Mixed Mode"
msgstr "HT混合模式(Mixed)"
msgid "HT Green Field"
msgstr "HT绿野模式(Green Field)"
msgid "Auto Block ACK"
msgstr "自动块确认(BlockAck)"
msgid "Access Control"
msgstr "访问控制"
msgid "Access Policy"
msgstr "访问控制策略"
msgid "Access control MAC address list"
msgstr "访问控制MAC地址列表"
msgid "White List"
msgstr "白名单模式"
msgid "Black List"
msgstr "黑名单模式"
msgid "Basic Settings"
msgstr "基本设置"
msgid "HE Settings"
msgstr "HE设置"
msgid "DL OFDMA"
msgstr "下行OFDMA"
msgid "UL OFDMA"
msgstr "上行OFDMA"
msgid "DL MU-MIMO"
msgstr "下行MU-MIMO"
msgid "UL MU-MIMO"
msgstr "上行MU-MIMO"
msgid "Scan Wireless Network"
msgstr "扫描无线网络"
msgid "ApClient Mode"
msgstr "AP客户端模式"
msgid "APClient/Repeater Mode."
msgstr "AP客户端中继模式。"
msgid "MAC Repeater Mode"
msgstr "启用MAC中继模式"
msgid "Root AP SSID"
msgstr "上级AP SSID"
msgid "Root AP Channel"
msgstr "上级AP信道"
msgid "Root AP Authentication Mode"
msgstr "上级AP认证方式"
msgid "Root AP Encryption"
msgstr "上级AP加密方式"
msgid "Root AP WPA Key"
msgstr "上级AP WPA密钥"
msgid "ApCli MFPC"
msgstr "ApCli兼容保护管理帧(MFPC)"
msgid "ApCli MFPR"
msgstr "ApCli强制保护管理帧(MFPR)"
msgid "ApCli MFPSHA256"
msgstr "ApCli启用SHA256保护管理帧"
msgid "WEP Default Key"
msgstr "WEP默认密钥ID"
msgid "Root AP WEP Key"
msgstr "上级AP WEP密钥"
msgid "Length"
msgstr "长度"
msgid "WEP Key"
msgstr "WEP密钥"
msgid "WEP Key Type"
msgstr "WEP密钥类型"
msgid "PMK Cache Period"
msgstr "PMK缓存周期"
msgid "WEP for 8021X"
msgstr "启用8021X WEP"
msgid "Pre-Authentication"
msgstr "启用预认证"
msgid "Radius Server IP"
msgstr "Radius认证服务器IP"
msgid "Radius Server Port"
msgstr "Radius认证服务器端口"
msgid "Radius Key"
msgstr "Radius密钥"
msgid "Radius Session Timeout"
msgstr "Radius会话超时时间"
msgid "Radius Idle Timeout"
msgstr "Radius空闲超时时间"
msgid "MFPSHA256"
msgstr "启用SHA256保护管理帧"
msgid "Please wait while the settings are being applied."
msgstr "正在应用设置,请稍候。"
msgid "Please wait while the request is being processed."
msgstr "正在处理请求,请稍候。"
msgid "No wireless device found!"
msgstr "未找到无线设备!"
msgid "Please input a valid radius server port number."
msgstr "请输入有效的Radius服务器端口号。"
msgid "The radius shared secret contains invalid characters."
msgstr "Radius密钥包含无效字符。"
msgid "Please input a valid session timeout number or u may have left it empty."
msgstr "请输入有效的Radius会话超时时间。"
msgid "Radius session time out is empty."
msgstr "Radius会话超时时间为空。"
msgid "Please input a valid idle timeout number or u may have left it empty."
msgstr "请输入有效的Radius空闲超时时间。"
msgid "Radius idle time out is empty."
msgstr "Radius空闲超时时间为空。"
msgid "IGMP Snooping"
msgstr "IGMP 侦听"
msgid "Security"
msgstr "安全性"
msgid "Restore Profile to Factory Settings"
msgstr "恢复无线配置文件为出厂设置"
msgid "Are you sure to RELOAD"
msgstr "你确认要重载"
msgid "Are you sure to DISABLE"
msgstr "你确认要禁用"
msgid "Are you sure to REMOVE"
msgstr "你确认要移除"
msgid "Are you sure to RECONNECT"
msgstr "你确认要重新连接"
msgid "Are you sure to DISCONNECT"
msgstr "你确认要断开"
msgid "Are you sure to ADD wireless interface?"
msgstr "你确认要新增无线接口?"
msgid "Enable wireless device"
msgstr "启用此无线设备"
msgid "Wireless device is disabled"
msgstr "无线设备已禁用"
msgid "Kick STA Threshold"
msgstr "弱信号剔除阈值"
msgid "STA Assoc Threshold"
msgstr "弱信号接入阈值"

View File

@@ -0,0 +1,177 @@
#!/usr/bin/lua
-- Constant Definition
local FW_PATH = "/lib/firmware/"
local MTD_PATH = "/dev/"
local MTD_TABLE = "/proc/mtd"
local E2P_PART_NAME = "Factory"
local E2P_FILE_NAME = "e2p"
function show_usage()
print("Usage: l1dat genconfig | dbg | idx2if idx | if2zone ifname | if2dat ifname | zone2if zone | if2dbdcidx ifname")
end
function print_err(msg)
io.stderr:write("[ERR][l1dat] "..msg)
end
if not pcall(require, "l1dat_parser") then
if arg[1] == "dbg" then
print_err("Load l1dat_parser module failed\n")
end
return
end
local l1parser = require("l1dat_parser")
local l1dat = l1parser.load_l1_profile(l1parser.L1_DAT_PATH)
if not l1dat then
if arg[1] == "dbg" then
print_err("l1profile.dat is ivalid\n")
end
return
end
function read_pipe(pipe)
local fp = io.popen(pipe)
local txt = fp:read("*a")
fp:close()
return txt
end
function eeprom_extract(part, offset, size, bin_name)
local part_name = part or E2P_PART_NAME
local dump_name = bin_name or E2P_FILE_NAME
if not offset or not size or tonumber(offset) < 0 or tonumber(size) < 0 then
print_err("Invalid offset or size value")
return
end
local offset_decimal = string.format("%d", offset)
local size_decimal = string.format("%d", size)
local cmd = "cat "..MTD_TABLE.." | grep "..part_name
local mtd = read_pipe(cmd)
if not mtd or mtd == "" then
print_err("mtd partition "..part_name.." not found")
return
end
cmd = "[ -e "..FW_PATH.." ] || mkdir "..FW_PATH
os.execute(cmd)
local mtd_node = "/dev/"..string.match(mtd, "(mtd[%d]+)")
cmd = "dd if="..mtd_node.." of="..FW_PATH..dump_name.." bs=1 skip="..offset_decimal.." count="..size_decimal.." seek="..offset_decimal.." conv=notrunc 2>/dev/null"
os.execute(cmd)
end
local action0 = {
["dbg"] = function()
show_usage()
end,
["genconfig"] = function()
local seen = {}
local dridx = l1parser.DEV_RINDEX
local cmd = ""
local dir = ""
for name, dev in pairs(l1dat[dridx]) do
if not seen[dev] then
seen[dev] = true
dir = string.match(dev["profile_path"], "^(.+)/")
--print("mkdir -p "..dir)
os.execute("mkdir -p "..dir)
cmd = "ralink_init gen "..dev["nvram_zone"].." "..dev["profile_path"]
--print(cmd)
os.execute(cmd)
eeprom_extract(E2P_PART_NAME, dev.EEPROM_offset, dev.EEPROM_size, dev.EEPROM_name)
end
end
end,
["if2zone"] = function(ifname)
if not ifname then return end
local zone = l1parser.l1_ifname_to_zone(ifname) or ""
print(zone);
end,
["if2dat"] = function(ifname)
if not ifname then return end
local dat_path = l1parser.l1_ifname_to_datpath(ifname) or ""
print(dat_path)
end,
["zone2if"] = function(zone)
if not zone then return end
local main_if, ext_if, apcli, wds, mesh = l1parser.l1_zone_to_ifname(zone)
if main_if then
print(main_if.." "..ext_if.." "..apcli.." "..wds.." "..mesh)
end
end,
["idx2if"] = function(idx)
if not idx then return end
idx = tonumber(idx)
local band_num = l1parser.MAX_NUM_DBDC_BAND
local dbdc_if
local count = 0
for k, v in pairs(l1dat) do
-- check if last dbdc exists
dbdc_if = l1parser.token_get(v.main_ifname, band_num, nil)
if dbdc_if then
count = count + band_num;
else
count = count + 1
end
if not dbdc_if and count == idx then
print(v.main_ifname)
break
end
if count >= idx then -- dbdc case
local token_num = band_num - ( count - idx )
print(l1parser.token_get(v.main_ifname, token_num, nil))
break
end
end
end,
["if2dbdcidx"] = function(ifname)
if not ifname then return end
local ridx = l1parser.IF_RINDEX
if not l1dat[ridx][ifname] then return end
print(l1dat[ridx][ifname]["subidx"] or "0")
end
}
if #arg == 0 then
show_usage()
return
end
if action0[arg[1]] then
if #arg == 1 then
--print("#arg == 1", arg[1])
action0[arg[1]]()
elseif #arg == 2 then
--print("#arg == 1", arg[1], arg[2])
action0[arg[1]](arg[2])
end
else
print_err("invalid arg \""..arg[1].."\"\n");
end

View File

@@ -0,0 +1,337 @@
local _tl_compat; if (tonumber((_VERSION or ''):match('[%d.]*$')) or 0) < 5.3 then local p, m = pcall(require, 'compat53.module'); if p then _tl_compat = m end end; local math = _tl_compat and _tl_compat.math or math; local string = _tl_compat and _tl_compat.string or string; local table = _tl_compat and _tl_compat.table or table
local inspect = {Options = {}, }
inspect._VERSION = 'inspect.lua 3.1.0'
inspect._URL = 'http://github.com/kikito/inspect.lua'
inspect._DESCRIPTION = 'human-readable representations of tables'
inspect._LICENSE = [[
MIT LICENSE
Copyright (c) 2022 Enrique García Cota
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.
]]
inspect.KEY = setmetatable({}, { __tostring = function() return 'inspect.KEY' end })
inspect.METATABLE = setmetatable({}, { __tostring = function() return 'inspect.METATABLE' end })
local tostring = tostring
local rep = string.rep
local match = string.match
local char = string.char
local gsub = string.gsub
local fmt = string.format
local function rawpairs(t)
return next, t, nil
end
local function smartQuote(str)
if match(str, '"') and not match(str, "'") then
return "'" .. str .. "'"
end
return '"' .. gsub(str, '"', '\\"') .. '"'
end
local shortControlCharEscapes = {
["\a"] = "\\a", ["\b"] = "\\b", ["\f"] = "\\f", ["\n"] = "\\n",
["\r"] = "\\r", ["\t"] = "\\t", ["\v"] = "\\v", ["\127"] = "\\127",
}
local longControlCharEscapes = { ["\127"] = "\127" }
for i = 0, 31 do
local ch = char(i)
if not shortControlCharEscapes[ch] then
shortControlCharEscapes[ch] = "\\" .. i
longControlCharEscapes[ch] = fmt("\\%03d", i)
end
end
local function escape(str)
return (gsub(gsub(gsub(str, "\\", "\\\\"),
"(%c)%f[0-9]", longControlCharEscapes),
"%c", shortControlCharEscapes))
end
local function isIdentifier(str)
return type(str) == "string" and not not str:match("^[_%a][_%a%d]*$")
end
local flr = math.floor
local function isSequenceKey(k, sequenceLength)
return type(k) == "number" and
flr(k) == k and
1 <= (k) and
k <= sequenceLength
end
local defaultTypeOrders = {
['number'] = 1, ['boolean'] = 2, ['string'] = 3, ['table'] = 4,
['function'] = 5, ['userdata'] = 6, ['thread'] = 7,
}
local function sortKeys(a, b)
local ta, tb = type(a), type(b)
if ta == tb and (ta == 'string' or ta == 'number') then
return (a) < (b)
end
local dta = defaultTypeOrders[ta] or 100
local dtb = defaultTypeOrders[tb] or 100
return dta == dtb and ta < tb or dta < dtb
end
local function getKeys(t)
local seqLen = 1
while rawget(t, seqLen) ~= nil do
seqLen = seqLen + 1
end
seqLen = seqLen - 1
local keys, keysLen = {}, 0
for k in rawpairs(t) do
if not isSequenceKey(k, seqLen) then
keysLen = keysLen + 1
keys[keysLen] = k
end
end
table.sort(keys, sortKeys)
return keys, keysLen, seqLen
end
local function countCycles(x, cycles)
if type(x) == "table" then
if cycles[x] then
cycles[x] = cycles[x] + 1
else
cycles[x] = 1
for k, v in rawpairs(x) do
countCycles(k, cycles)
countCycles(v, cycles)
end
countCycles(getmetatable(x), cycles)
end
end
end
local function makePath(path, a, b)
local newPath = {}
local len = #path
for i = 1, len do newPath[i] = path[i] end
newPath[len + 1] = a
newPath[len + 2] = b
return newPath
end
local function processRecursive(process,
item,
path,
visited)
if item == nil then return nil end
if visited[item] then return visited[item] end
local processed = process(item, path)
if type(processed) == "table" then
local processedCopy = {}
visited[item] = processedCopy
local processedKey
for k, v in rawpairs(processed) do
processedKey = processRecursive(process, k, makePath(path, k, inspect.KEY), visited)
if processedKey ~= nil then
processedCopy[processedKey] = processRecursive(process, v, makePath(path, processedKey), visited)
end
end
local mt = processRecursive(process, getmetatable(processed), makePath(path, inspect.METATABLE), visited)
if type(mt) ~= 'table' then mt = nil end
setmetatable(processedCopy, mt)
processed = processedCopy
end
return processed
end
local function puts(buf, str)
buf.n = buf.n + 1
buf[buf.n] = str
end
local Inspector = {}
local Inspector_mt = { __index = Inspector }
local function tabify(inspector)
puts(inspector.buf, inspector.newline .. rep(inspector.indent, inspector.level))
end
function Inspector:getId(v)
local id = self.ids[v]
local ids = self.ids
if not id then
local tv = type(v)
id = (ids[tv] or 0) + 1
ids[v], ids[tv] = id, id
end
return tostring(id)
end
function Inspector:putValue(v)
local buf = self.buf
local tv = type(v)
if tv == 'string' then
puts(buf, smartQuote(escape(v)))
elseif tv == 'number' or tv == 'boolean' or tv == 'nil' or
tv == 'cdata' or tv == 'ctype' then
puts(buf, tostring(v))
elseif tv == 'table' and not self.ids[v] then
local t = v
if t == inspect.KEY or t == inspect.METATABLE then
puts(buf, tostring(t))
elseif self.level >= self.depth then
puts(buf, '{...}')
else
if self.cycles[t] > 1 then puts(buf, fmt('<%d>', self:getId(t))) end
local keys, keysLen, seqLen = getKeys(t)
puts(buf, '{')
self.level = self.level + 1
for i = 1, seqLen + keysLen do
if i > 1 then puts(buf, ',') end
if i <= seqLen then
puts(buf, ' ')
self:putValue(t[i])
else
local k = keys[i - seqLen]
tabify(self)
if isIdentifier(k) then
puts(buf, k)
else
puts(buf, "[")
self:putValue(k)
puts(buf, "]")
end
puts(buf, ' = ')
self:putValue(t[k])
end
end
local mt = getmetatable(t)
if type(mt) == 'table' then
if seqLen + keysLen > 0 then puts(buf, ',') end
tabify(self)
puts(buf, '<metatable> = ')
self:putValue(mt)
end
self.level = self.level - 1
if keysLen > 0 or type(mt) == 'table' then
tabify(self)
elseif seqLen > 0 then
puts(buf, ' ')
end
puts(buf, '}')
end
else
puts(buf, fmt('<%s %d>', tv, self:getId(v)))
end
end
function inspect.inspect(root, options)
options = options or {}
local depth = options.depth or (math.huge)
local newline = options.newline or '\n'
local indent = options.indent or ' '
local process = options.process
if process then
root = processRecursive(process, root, {}, {})
end
local cycles = {}
countCycles(root, cycles)
local inspector = setmetatable({
buf = { n = 0 },
ids = {},
cycles = cycles,
depth = depth,
level = 0,
newline = newline,
indent = indent,
}, Inspector_mt)
inspector:putValue(root)
return table.concat(inspector.buf)
end
setmetatable(inspect, {
__call = function(_, root, options)
return inspect.inspect(root, options)
end,
})
return inspect

View File

@@ -0,0 +1,349 @@
#!/usr/bin/env lua
--[[
* A lua library to manipulate mtk's wifi driver. used in luci-app-mtk.
*
* Copyright (C) 2016 MTK <support@mediatek.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
]]
local l1dat_parser = {
L1_DAT_PATH = "/etc/wireless/l1profile.dat",
IF_RINDEX = "ifname_ridx",
DEV_RINDEX = "devname_ridx",
MAX_NUM_APCLI = 1,
MAX_NUM_WDS = 4,
MAX_NUM_MESH = 1,
MAX_NUM_EXTIF = 16,
MAX_NUM_DBDC_BAND = 2,
}
local l1cfg_options = {
ext_ifname="",
apcli_ifname="apcli",
wds_ifname="wds",
mesh_ifname="mesh"
}
function l1dat_parser.__trim(s)
if s then return (s:gsub("^%s*(.-)%s*$", "%1")) end
end
function l1dat_parser.__cfg2list(str)
-- delimeter == ";"
local i = 1
local list = {}
for k in string.gmatch(str, "([^;]+)") do
list[i] = k
i = i + 1
end
return list
end
function l1dat_parser.token_get(str, n, v)
-- n starts from 1
-- v is the backup in case token n is nil
if not str then return v end
local tmp = l1dat_parser.__cfg2list(str)
return tmp[tonumber(n)] or v
end
function l1dat_parser.add_default_value(l1cfg)
for k, v in ipairs(l1cfg) do
for opt, default in pairs(l1cfg_options) do
if ( opt == "ext_ifname" ) then
v[opt] = v[opt] or v["main_ifname"].."_"
else
v[opt] = v[opt] or default..k.."_"
end
end
end
return l1cfg
end
function l1dat_parser.get_value_by_idx(devidx, mainidx, subidx, key)
--print("Enter l1dat_parser.get_value_by_idx("..devidx..","..mainidx..", "..subidx..", "..key..")<br>")
if not devidx or not mainidx or not key then return end
local devs = l1dat_parser.load_l1_profile(l1dat_parser.L1_DAT_PATH)
if not devs then return end
local dev_ridx = l1dat_parser.DEV_RINDEX
local sidx = subidx or 1
local devname1 = devidx.."."..mainidx
local devname2 = devidx.."."..mainidx.."."..sidx
--print("devnam1=", devname1, "devname2=", devname2, "<br>")
return devs[dev_ridx][devname2] and devs[dev_ridx][devname2][key]
or devs[dev_ridx][devname1] and devs[dev_ridx][devname1][key]
end
-- path to zone is 1 to 1 mapping
function l1dat_parser.l1_path_to_zone(path)
--print("Enter l1dat_parser.l1_path_to_zone("..path..")<br>")
if not path then return end
local devs = l1dat_parser.load_l1_profile(l1dat_parser.L1_DAT_PATH)
if not devs then return end
for _, dev in pairs(devs[l1dat_parser.IF_RINDEX]) do
if dev.profile_path == path then
return dev.nvram_zone
end
end
return
end
-- zone to path is 1 to n mapping
function l1dat_parser.l1_zone_to_path(zone)
if not zone then return end
local devs = l1dat_parser.load_l1_profile(l1dat_parser.L1_DAT_PATH)
if not devs then return end
local plist = {}
for _, dev in pairs(devs[l1dat_parser.IF_RINDEX]) do
if dev.nvram_zone == zone then
if not next(plist) then
table.insert(plist,dev.profile_path)
else
local plist_str = table.concat(plist)
if not plist_str:match(dev.profile_path) then
table.insert(plist,dev.profile_path)
end
end
end
end
return next(plist) and plist or nil
end
function l1dat_parser.l1_ifname_to_datpath(ifname)
if not ifname then return end
local devs = l1dat_parser.load_l1_profile(l1dat_parser.L1_DAT_PATH)
if not devs then return end
local ridx = l1dat_parser.IF_RINDEX
return devs[ridx][ifname] and devs[ridx][ifname].profile_path
end
function l1dat_parser.l1_ifname_to_zone(ifname)
if not ifname then return end
local devs = l1dat_parser.load_l1_profile(l1dat_parser.L1_DAT_PATH)
if not devs then return end
local ridx = l1dat_parser.IF_RINDEX
return devs[ridx][ifname] and devs[ridx][ifname].nvram_zone
end
function l1dat_parser.l1_zone_to_ifname(zone)
if not zone then return end
local devs = l1dat_parser.load_l1_profile(l1dat_parser.L1_DAT_PATH)
if not devs then return end
local zone_dev
for _, dev in pairs(devs[l1dat_parser.DEV_RINDEX]) do
if dev.nvram_zone == zone then
zone_dev = dev
end
end
if not zone_dev then
return nil
else
return zone_dev.main_ifname, zone_dev.ext_ifname, zone_dev.apcli_ifname, zone_dev.wds_ifname, zone_dev.mesh_ifname
end
end
-- input: L1 profile path.
-- output A table, devs, contains
-- 1. devs[%d] = table of each INDEX# in the L1 profile
-- 2. devs.ifname_ridx[ifname]
-- = table of each ifname and point to relevant contain in dev[$d]
-- 3. devs.devname_ridx[devname] similar to devs.ifnameridx, but use devname.
-- devname = INDEX#_value.mainidx(.subidx)
-- Using *_ridx do not need to handle name=k1;k2 case of DBDC card.
function l1dat_parser.load_l1_profile(path)
local devs = setmetatable({}, {__index=
function(tbl, key)
local util = require("luci.util")
--print("metatable function:", util.serialize_data(tbl), key)
--print("-----------------------------------------------")
if ( string.match(key, "^%d+")) then
tbl[key] = {}
return tbl[key]
end
end
})
local nixio = require("nixio")
local chipset_num = {}
local dir = io.popen("ls /etc/wireless/")
if not dir then return end
local fd = io.open(path, "r")
if not fd then return end
-- convert l1 profile into lua table
for line in fd:lines() do
line = l1dat_parser.__trim(line)
if string.byte(line) ~= string.byte("#") then
local i = string.find(line, "=")
if i then
local k, v, k1, k2
k = l1dat_parser.__trim( string.sub(line, 1, i-1) )
v = l1dat_parser.__trim( string.sub(line, i+1) )
k1, k2 = string.match(k, "INDEX(%d+)_(.+)")
if k1 then
k1 = tonumber(k1) + 1
if devs[k1][k2] then
nixio.syslog("warning", "skip repeated key"..line)
end
devs[k1][k2] = v or ""
else
k1 = string.match(k, "INDEX(%d+)")
k1 = tonumber(k1) + 1
devs[k1]["INDEX"] = v
chipset_num[v] = (not chipset_num[v] and 1) or chipset_num[v] + 1
devs[k1]["mainidx"] = chipset_num[v]
end
--else
-- nixio.syslog("warning", "skip line without '=' "..line)
end
--else
-- nixio.syslog("warning", "skip comment line "..line)
end
end
l1dat_parser.add_default_value(devs)
--local util = require("luci.util")
--local seen2 = {}
-- print("Before setup ridx", util.serialize_data(devs, seen2))
-- Force to setup reverse indice for quick search.
-- Benifit:
-- 1. O(1) search with ifname, devname
-- 2. Seperate DBDC name=k1;k2 format in the L1 profile into each
-- ifname, devname.
local dbdc_if = {}
local ridx = l1dat_parser.IF_RINDEX
local dridx = l1dat_parser.DEV_RINDEX
local band_num = l1dat_parser.MAX_NUM_DBDC_BAND
local k, v, dev, i , j, last
local devname
devs[ridx] = {}
devs[dridx] = {}
for _, dev in ipairs(devs) do
dbdc_if[band_num] = l1dat_parser.token_get(dev.main_ifname, band_num, nil)
if dbdc_if[band_num] then
for i = 1, band_num - 1 do
dbdc_if[i] = l1dat_parser.token_get(dev.main_ifname, i, nil)
end
for i = 1, band_num do
devs[ridx][dbdc_if[i]] = {}
devs[ridx][dbdc_if[i]]["subidx"] = i
for k, v in pairs(dev) do
if k == "INDEX" or k == "EEPROM_offset" or k == "EEPROM_size"
or k == "mainidx" then
devs[ridx][dbdc_if[i]][k] = v
else
devs[ridx][dbdc_if[i]][k] = l1dat_parser.token_get(v, i, "")
end
end
devname = dev.INDEX.."."..dev.mainidx.."."..devs[ridx][dbdc_if[i]]["subidx"]
devs[dridx][devname] = devs[ridx][dbdc_if[i]]
end
local apcli_if, wds_if, ext_if, mesh_if = {}, {}, {}, {}
for i = 1, band_num do
ext_if[i] = l1dat_parser.token_get(dev.ext_ifname, i, nil)
apcli_if[i] = l1dat_parser.token_get(dev.apcli_ifname, i, nil)
wds_if[i] = l1dat_parser.token_get(dev.wds_ifname, i, nil)
mesh_if[i] = l1dat_parser.token_get(dev.mesh_ifname, i, nil)
end
for i = 1, l1dat_parser.MAX_NUM_EXTIF - 1 do -- ifname idx is from 0
for j = 1, band_num do
devs[ridx][ext_if[j]..i] = devs[ridx][dbdc_if[j]]
end
end
for i = 0, l1dat_parser.MAX_NUM_APCLI - 1 do
for j = 1, band_num do
devs[ridx][apcli_if[j]..i] = devs[ridx][dbdc_if[j]]
end
end
for i = 0, l1dat_parser.MAX_NUM_WDS - 1 do
for j = 1, band_num do
devs[ridx][wds_if[j]..i] = devs[ridx][dbdc_if[j]]
end
end
for i = 0, l1dat_parser.MAX_NUM_MESH - 1 do
for j = 1, band_num do
if mesh_if[j] then
devs[ridx][mesh_if[j]..i] = devs[ridx][dbdc_if[j]]
end
end
end
else
devs[ridx][dev.main_ifname] = dev
devname = dev.INDEX.."."..dev.mainidx
devs[dridx][devname] = dev
for i = 1, l1dat_parser.MAX_NUM_EXTIF - 1 do -- ifname idx is from 0
devs[ridx][dev.ext_ifname..i] = dev
end
for i = 0, l1dat_parser.MAX_NUM_APCLI - 1 do -- ifname idx is from 0
devs[ridx][dev.apcli_ifname..i] = dev
end
for i = 0, l1dat_parser.MAX_NUM_WDS - 1 do -- ifname idx is from 0
devs[ridx][dev.wds_ifname..i] = dev
end
for i = 0, l1dat_parser.MAX_NUM_MESH - 1 do -- ifname idx is from 0
devs[ridx][dev.mesh_ifname..i] = dev
end
end
end
fd:close()
return devs
end
function l1dat_parser.creat_link_for_nvram( )
local devs = l1dat_parser.load_l1_profile(l1dat_parser.L1_DAT_PATH)
for devname, dev in pairs(devs.devname_ridx) do
local dev = devs.devname_ridx[devname]
profile = dev.profile_path
os.execute("mkdir -p /tmp/mtk/wifi/")
if dev.nvram_zone == "dev1" then
os.execute("ln -sf " ..profile.." /tmp/mtk/wifi/2860")
elseif dev.nvram_zone == "dev2" then
os.execute("ln -sf " ..profile.." /tmp/mtk/wifi/rtdev")
elseif dev.nvram_zone == "dev3" then
os.execute("ln -sf " ..profile.." /tmp/mtk/wifi/wifi3")
end
end
end
return l1dat_parser

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,130 @@
#!/usr/bin/env lua
--[[
* A pure lua library to translate between:
* lua table <--> uci config
*
* For UCI: http://wiki.openwrt.org/doc/techref/uci
* http://wiki.openwrt.org/doc/uci
*
* Copyright (C) 2015 Hua Shao <nossiac@163.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
]]
local shuci = {}
function shuci.decode(path)
function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
local function linebreaker(str)
local i,_ = string.find(str, "([^%s])")
if not i then return nil end
if string.find(str, "config%s+%w+") then
local i,j,k,v = string.find(str, "config%s+([%w-_]+)%s*['\"]*([^%s\'\"]*)")
return "section", k, v
elseif string.find(str, "option%s+%w+") then
local i,j,k,v = string.find(str, "option%s+([%w-_]+)%s*['\"]([^'\"]+)['\"]")
if not k or not v then
i,j,k,v = string.find(str, "option%s+([%w-_]+)%s*['\"]*([^%s\'\"]*)")
end
return "option", k, v
elseif string.find(str, "list%s+%w+") then
local i,j,k,v = string.find(str, "list%s+([%w-_]+)%s*['\"]([^'\"]+)['\"]")
if not k or not v then
i,j,k,v = string.find(str, "list%s+([%w-_]+)%s*['\"]*([^%s\'\"]*)")
end
return "list", k, v
end
end
if not file_exists(path) then
return
end
local _sect_ = nil
local t = {}
for line in io.lines(path) do
local _type, _name, _value = linebreaker(line)
if _type == "section" then
if not t[_name] then
t[_name] = {}
end
t[_name][#t[_name]+1] = {}
_sect_ = t[_name][#t[_name]]
if _value then
_sect_[".name"] = _value
end
end
if _type == "option" then
if _name and _value then
_sect_[_name] = _value
end
end
if _type == "list" and _name and _value then
local idx
if not _sect_[_name] then
_sect_[_name] = {}
_sect_[_name][1] = _value
else
idx = #_sect_[_name]
_sect_[_name][idx+1] = _value
end
end
end
return t
end
function shuci.encode(t, path)
local dump = io.write
if path then
local fp = io.open(path, "w")
dump = function(str) fp:write(str) end
end
for stype,ss in pairs(t) do
if #ss > 0 then
for _,s in ipairs(ss) do
dump(string.format("config\t%s\t'%s'\n", stype, s[".name"] or ""))
for k,v in pairs(s) do
if type(v) == "table" then
for _,vv in ipairs(v) do
dump(string.format("\tlist\t%s\t'%s'\n",k,vv))
end
elseif type(v) == "string" and k ~= ".name" then
dump(string.format("\toption\t%s\t'%s'\n",k,v))
elseif type(v) == "number" and k ~= ".name" then
dump(string.format("\toption\t%s\t'%s'\n",k,tonumber(v)))
end
end
dump("\n")
end
else
dump(string.format("config\t%s\t'%s'\n", stype, ss[".name"] or ""))
for k,v in pairs(ss) do
if type(v) == "table" then
for _,vv in ipairs(v) do
dump(string.format("\tlist\t%s\t'%s'\n",k,vv))
end
elseif type(v) == "string" and k ~= ".name" then
dump(string.format("\toption\t%s\t'%s'\n",k,v))
elseif type(v) == "number" and k ~= ".name" then
dump(string.format("\toption\t%s\t'%s'\n",k,tonumber(v)))
end
end
end
end
end
return shuci

View File

@@ -0,0 +1,24 @@
OBJ_IOCTL = ioctl_helper.o rate_calc.o security.o
CFLAGS += -I.
CFLAGS += -I$(ROOTDIR)/user/luci/lua-5.1.5/src
CFLAGS += -Wall -shared -fPIC
LUCI_APP_MTK_TARGET = ioctl_helper
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
all: $(LUCI_APP_MTK_TARGET)
ioctl_helper: $(OBJ_IOCTL)
$(CC) -o $@.so $^ $(CFLAGS)
compile: $(LUCI_APP_MTK_TARGET)
install: compile
mkdir -p $(DESTDIR)/usr/lib/lua
cp -pR ioctl_helper.so $(DESTDIR)/usr/lib/lua/
clean:
rm -f *.o *.so
romfs:

View File

@@ -0,0 +1,629 @@
#include <arpa/inet.h>
#include <ctype.h>
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <unistd.h>
#include <linux/wireless.h>
#include "mtwifi.h"
int luaopen_ioctl_helper(lua_State *L)
{
lua_register(L,"c_get_macaddr",get_macaddr);
lua_register(L,"c_convert_string_display",convert_string_display);
lua_register(L,"c_StaInfo",StaInfo);
lua_register(L,"c_getWMode",getWMOde);
lua_register(L,"c_getTempature",getTempature);
lua_register(L,"c_scanResult",scanResult);
lua_register(L,"c_getTxPower",getTxPower);
lua_register(L,"c_getChannel",getChannel);
return 0;
}
int scanResult(lua_State *L)
{
int socket_id;
const char *interface = luaL_checkstring(L, 1);
const char *tmp_idx = luaL_checkstring(L, 2);
struct iwreq wrq;
char *data = NULL;
unsigned int data_len = 5000;
if((data = (char *)malloc(data_len)) == NULL){
fprintf(stderr, "%s: malloc failed\n", __func__);
return -1;
}
memset(data, 0, data_len);
socket_id = socket(AF_INET, SOCK_DGRAM, 0);
if (socket_id < 0) {
perror("socket() failed");
free(data);
return socket_id;
}
snprintf(wrq.ifr_name, sizeof(wrq.ifr_name), "%s", interface);
snprintf(data, data_len, "%s", tmp_idx);
wrq.u.data.length = data_len;
wrq.u.data.pointer = data;
wrq.u.data.flags = 0;
if (ioctl(socket_id, RTPRIV_IOCTL_GSITESURVEY, &wrq) < 0) {
fprintf(stderr, "ioctl -> RTPRIV_IOCTL_GSITESURVEY Fail !");
close(socket_id);
free(data);
return -1;
}
lua_newtable(L);
lua_pushstring(L, "scanresult"); /* push key */
lua_pushstring(L, data); /* push value */
lua_settable(L, -3);
close(socket_id);
free(data);
return 1;
}
static unsigned int get_temp(const char *interface)
{
int socket_id;
struct iwreq wrq;
unsigned int tempature = 0;
socket_id = socket(AF_INET, SOCK_DGRAM, 0);
if (socket_id < 0) {
perror("socket() failed");
return socket_id;
}
snprintf(wrq.ifr_name, sizeof(wrq.ifr_name), "%s", interface);
wrq.u.data.length = sizeof(tempature);
wrq.u.data.pointer = &tempature;
wrq.u.data.flags = OID_GET_CPU_TEMPERATURE;
if( ioctl(socket_id, RT_PRIV_IOCTL, &wrq) == -1)
fprintf(stderr, "%s: ioctl fail\n", __func__);
close(socket_id);
return tempature;
}
int getTempature(lua_State *L)
{
char tempstr[5] = {0};
const char *interface = luaL_checkstring(L, 1);
snprintf(tempstr, sizeof(tempstr), "%d", get_temp(interface));
lua_newtable(L);
lua_pushstring(L, "tempature"); /* push key */
lua_pushstring(L, tempstr); /* push value */
lua_settable(L, -3);
/* Returning one table which is already on top of Lua stack. */
return 1;
}
static unsigned int get_txpower(const char *interface)
{
int socket_id;
struct iwreq wrq;
int txpower = 0;
socket_id = socket(AF_INET, SOCK_DGRAM, 0);
if (socket_id < 0) {
perror("socket() failed");
return socket_id;
}
snprintf(wrq.ifr_name, sizeof(wrq.ifr_name), "%s", interface);
wrq.u.txpower.flags = 0;
if(ioctl(socket_id, SIOCGIWTXPOW, &wrq) >= 0) {
txpower = wrq.u.txpower.value;
} else {
fprintf(stderr, "%s: ioctl fail\n", __func__);
}
close(socket_id);
return txpower;
}
int getTxPower(lua_State *L)
{
char tempstr[5] = {0};
const char *interface = luaL_checkstring(L, 1);
snprintf(tempstr, sizeof(tempstr), "%d", get_txpower(interface));
lua_newtable(L);
lua_pushstring(L, "txpower"); /* push key */
lua_pushstring(L, tempstr); /* push value */
lua_settable(L, -3);
/* Returning one table which is already on top of Lua stack. */
return 1;
}
static unsigned int get_w_mode(const char *interface)
{
int socket_id;
struct iwreq wrq;
unsigned char data = 0;
socket_id = socket(AF_INET, SOCK_DGRAM, 0);
if (socket_id < 0) {
perror("socket() failed");
return socket_id;
}
snprintf(wrq.ifr_name, sizeof(wrq.ifr_name), "%s", interface);
wrq.u.data.length = sizeof(data);
wrq.u.data.pointer = &data;
wrq.u.data.flags = OID_GET_WMODE;
if( ioctl(socket_id, RT_PRIV_IOCTL, &wrq) == -1)
fprintf(stderr, "%s: ioctl fail\n", __func__);
close(socket_id);
return data;
}
int get_macaddr(lua_State *L)
{
const char *ifname = luaL_checkstring(L, 1);
struct ifreq ifr;
char *ptr;
int skfd;
static char if_hw[18] = {0};
if((skfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
//printf(stderr, "%s: open socket error\n", __func__);
return skfd;
}
snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", ifname);
if(ioctl(skfd, SIOCGIFHWADDR, &ifr) < 0) {
close(skfd);
fprintf(stderr, "%s: ioctl fail\n", __func__);
return -1;
}
ptr = (char *)&ifr.ifr_addr.sa_data;
sprintf(if_hw, "%02X:%02X:%02X:%02X:%02X:%02X",
(ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377),
(ptr[3] & 0377), (ptr[4] & 0377), (ptr[5] & 0377));
close(skfd);
lua_newtable(L);
lua_pushstring(L, "macaddr"); /* push key */
lua_pushstring(L, if_hw); /* push value */
lua_settable(L, -3);
/* Returning one table which is already on top of Lua stack. */
return 1;
}
static int get_channel(const char *interface)
{
int socket_id;
struct iwreq wrq;
int channel = -1;
socket_id = socket(AF_INET, SOCK_DGRAM, 0);
if (socket_id < 0) {
perror("socket() failed");
return socket_id;
}
snprintf(wrq.ifr_name, sizeof(wrq.ifr_name), "%s", interface);
if(ioctl(socket_id, SIOCGIWFREQ, &wrq) >= 0) {
channel = wrq.u.freq.m;
} else {
fprintf(stderr, "%s: ioctl fail\n", __func__);
}
close(socket_id);
return channel;
}
int getChannel(lua_State *L)
{
char tempstr[5] = {0};
const char *interface = luaL_checkstring(L, 1);
snprintf(tempstr, sizeof(tempstr), "%d", get_channel(interface));
lua_newtable(L);
lua_pushstring(L, "channel"); /* push key */
lua_pushstring(L, tempstr); /* push value */
lua_settable(L, -3);
/* Returning one table which is already on top of Lua stack. */
return 1;
}
int getWMOde(lua_State *L)
{
char w_mode[5];
const char *interface = luaL_checkstring(L, 1);
snprintf(w_mode, sizeof(w_mode), "%d", get_w_mode(interface));
lua_newtable(L);
lua_pushstring(L, "getwmode"); /* push key */
lua_pushstring(L, w_mode); /* push value */
lua_settable(L, -3);
/* Returning one table which is already on top of Lua stack. */
return 1;
}
int convert_string_display(lua_State *L)
{
#define BUF_SIZE 256
int len, i;
char buffer[BUF_SIZE]; // 33(characters in SSID) * 6(maximum length of a HTML entity) = 198 + 1(null character) = 199
char *pOut,*pBufLimit;
const char *str = luaL_checkstring(L, 1);
memset(buffer,0,BUF_SIZE);
len = strlen(str);
pOut = &buffer[0];
pBufLimit = &buffer[BUF_SIZE - 1];
for (i = 0; i < len && (pBufLimit - pOut) >=7; i++) { // 6(maximum length of a HTML entity) + 1(null character) = 7
switch (str[i]) {
case 38:
sprintf(pOut, "&amp;"); // '&'
pOut += 5;
break;
case 60:
sprintf(pOut, "&lt;"); // '<'
pOut += 4;
break;
case 62:
sprintf(pOut, "&gt;"); // '>'
pOut += 4;
break;
case 34:
sprintf(pOut, "&#34;"); // '"'
pOut += 5;
break;
case 39:
sprintf(pOut, "&#39;"); // '''
pOut += 5;
break;
case 32:
sprintf(pOut, "&nbsp;"); // ' '
pOut += 6;
break;
default:
if ((str[i]>=0) && (str[i]<=31)) {
//Device Control Characters
sprintf(pOut, "&#%02d;", str[i]);
pOut += 5;
} else if ((str[i]==39) || (str[i]==47) || (str[i]==59) || (str[i]==92)) {
// ' / ; (backslash)
sprintf(pOut, "&#%02d;", str[i]);
pOut += 5;
} else if (str[i]>=127) {
//Device Control Characters
sprintf(pOut, "&#%03d;", str[i]);
pOut += 6;
} else {
*pOut = str[i];
pOut++;
}
break;
}
}
*pOut = '\0';
lua_newtable(L);
lua_pushstring(L, "output"); /* push key */
lua_pushstring(L, buffer); /* push value */
lua_settable(L, -3);
return 1;
}
int StaInfo(lua_State *L)
{
int i, s;
struct iwreq iwr;
RT_802_11_MAC_TABLE_FIX *table;
char tmpBuff[128] = {0};
char *phyMode[12] = {"CCK", "OFDM", "MM", "GF", "VHT", "HE",
"HE5G", "HE2G", "HE_SU", "HE_EXT_SU", "HE_TRIG", "HE_MU"};
const char *interface = luaL_checkstring(L, 1);
table = (RT_802_11_MAC_TABLE_FIX *)malloc(sizeof(RT_802_11_MAC_TABLE_FIX));
if (!table)
return -ENOMEM;
memset(table, 0, sizeof(RT_802_11_MAC_TABLE_FIX));
s = socket(AF_INET, SOCK_DGRAM, 0);
snprintf(iwr.ifr_name, IFNAMSIZ, "%s", interface);
iwr.u.data.pointer = table;
if (s < 0) {
free(table);
return 0;
}
if (ioctl(s, RTPRIV_IOCTL_GET_MAC_TABLE_STRUCT, &iwr) < 0) {
free(table);
close(s);
return 0;
}
close(s);
/* Creates parent table of size table.Num array elements: */
lua_createtable(L, table->Num, 0);
for (i = 0; i < table->Num; i++) {
lua_pushnumber(L, i);
RT_802_11_MAC_ENTRY_FIX *pe = &(table->Entry[i]);
HTTRANSMIT_SETTING_FIX RxRate;
HTTRANSMIT_SETTING_FIX TxRate;
RxRate.word = pe->LastRxRate.word;
TxRate.word = pe->TxRate.word;
unsigned int mcs = TxRate.field.MCS;
unsigned int nss = 0;
unsigned long DataRate = 0;
unsigned int mcs_r = RxRate.field.MCS;
unsigned int nss_r = 0;
unsigned long DataRate_r = 0;
int hr, min, sec;
hr = pe->ConnectedTime/3600;
min = (pe->ConnectedTime % 3600)/60;
sec = pe->ConnectedTime - hr*3600 - min*60;
/* Creates first child table of size 34 non-array elements: */
lua_createtable(L, 0, 34);
// MAC Address
snprintf(tmpBuff, sizeof(tmpBuff), "%02X:%02X:%02X:%02X:%02X:%02X", pe->Addr[0], pe->Addr[1], pe->Addr[2], pe->Addr[3],
pe->Addr[4], pe->Addr[5]);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "MacAddr");
// AID, Power Save mode, MIMO Power Save
snprintf(tmpBuff, sizeof(tmpBuff), "%d", pe->Aid);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "Aid");
snprintf(tmpBuff, sizeof(tmpBuff), "%d", pe->Psm);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "Psm");
snprintf(tmpBuff, sizeof(tmpBuff), "%d", pe->MimoPs);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "MimoPs");
// TX Rate NSS-MCS
if (TxRate.field.MODE >= MODE_VHT) {
nss = ((mcs & (0x3 << 4)) >> 4) + 1;
mcs = mcs & 0xF;
snprintf(tmpBuff, sizeof(tmpBuff), "%dSS-MCS%d", nss, mcs);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "Mcs");
} else {
mcs = mcs & 0x3f;
snprintf(tmpBuff, sizeof(tmpBuff), "MCS%d", mcs);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "Mcs");
}
// TX BW
if (TxRate.field.BW == BW_20) {
snprintf(tmpBuff, sizeof(tmpBuff), "%d", 20);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "Bw");
} else if (TxRate.field.BW == BW_40) {
snprintf(tmpBuff, sizeof(tmpBuff), "%d", 40);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "Bw");
} else if (TxRate.field.BW == BW_80) {
snprintf(tmpBuff, sizeof(tmpBuff), "%d", 80);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "Bw");
} else if (TxRate.field.BW == BW_160) {
snprintf(tmpBuff, sizeof(tmpBuff), "%d", 160);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "Bw");
}
//TX SGI
if (TxRate.field.MODE < MODE_HTMIX) {
snprintf(tmpBuff, sizeof(tmpBuff), "%s", "LGI");
} else if (TxRate.field.MODE >= MODE_HE) {
if (TxRate.field.ShortGI == 0)
snprintf(tmpBuff, sizeof(tmpBuff), "%s", "SGI");
else if (TxRate.field.ShortGI == 1)
snprintf(tmpBuff, sizeof(tmpBuff), "%s", "MGI");
else if (TxRate.field.ShortGI == 2)
snprintf(tmpBuff, sizeof(tmpBuff), "%s", "LGI");
} else {
snprintf(tmpBuff, sizeof(tmpBuff), "%s", TxRate.field.ShortGI ? "SGI" : "LGI");
}
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "Gi");
//TX phy mode
snprintf(tmpBuff, sizeof(tmpBuff), "%s", phyMode[TxRate.field.MODE]);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "PhyMode");
//TX STBC
snprintf(tmpBuff, sizeof(tmpBuff), "%s", TxRate.field.STBC? "STBC": " ");
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "Stbc");
// TxBF configuration
snprintf(tmpBuff, sizeof(tmpBuff), "%c", TxRate.field.iTxBF ? 'I': '-');
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "iTxBF");
snprintf(tmpBuff, sizeof(tmpBuff), "%c", TxRate.field.eTxBF ? 'E': '-');
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "eTxBF");
// RSSI
snprintf(tmpBuff, sizeof(tmpBuff), "%d", (int)(pe->AvgRssi0));
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "AvgRssi0");
snprintf(tmpBuff, sizeof(tmpBuff), "%d", (int)(pe->AvgRssi1));
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "AvgRssi1");
snprintf(tmpBuff, sizeof(tmpBuff), "%d", (int)(pe->AvgRssi2));
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "AvgRssi2");
snprintf(tmpBuff, sizeof(tmpBuff), "%d", (int)(pe->AvgRssi3));
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "AvgRssi3");
// Per Stream SNR
snprintf(tmpBuff, sizeof(tmpBuff), "%0.1f", pe->StreamSnr[0]*0.25);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "StreamSnr0");
snprintf(tmpBuff, sizeof(tmpBuff), "%0.1f", pe->StreamSnr[1]*0.25); //mcs>7? pe->StreamSnr[1]*0.25: 0.0);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "StreamSnr1");
snprintf(tmpBuff, sizeof(tmpBuff), "%0.1f", pe->StreamSnr[2]*0.25); //mcs>15? pe->StreamSnr[2]*0.25: 0.0);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "StreamSnr2");
// Sounding Response SNR
if (TxRate.field.eTxBF) {
snprintf(tmpBuff, sizeof(tmpBuff), "%0.1f", pe->SoundingRespSnr[0]*0.25);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "SoundingRespSnr0");
snprintf(tmpBuff, sizeof(tmpBuff), "%0.1f", pe->SoundingRespSnr[1]*0.25);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "SoundingRespSnr1");
snprintf(tmpBuff, sizeof(tmpBuff), "%0.1f", pe->SoundingRespSnr[2]*0.25);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "SoundingRespSnr2");
}
// Last RX NSS-MCS
if (RxRate.field.MODE >= MODE_VHT) {
nss_r = (((mcs_r & (0x3 << 4)) >> 4) + 1) / (RxRate.field.STBC + 1);
mcs_r = mcs_r & 0xF;
snprintf(tmpBuff, sizeof(tmpBuff), "%dSS-MCS%d", nss_r, mcs_r);
} else if (RxRate.field.MODE >= MODE_HTMIX) {
mcs_r = mcs_r & 0x3f;
snprintf(tmpBuff, sizeof(tmpBuff), "MCS%d", mcs_r);
} else if (RxRate.field.MODE == MODE_OFDM) {
mcs_r = mcs_r & 0xf;
snprintf(tmpBuff, sizeof(tmpBuff), "MCS%d", mcs_r);
RxRate.field.MCS = mcs_r;
} else if (RxRate.field.MODE == MODE_CCK) {
mcs_r = cck_to_mcs(mcs_r & 0x7);
snprintf(tmpBuff, sizeof(tmpBuff), "MCS%d", mcs_r);
RxRate.field.MCS = mcs_r;
}
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "LastMcs");
if (RxRate.field.BW == BW_20) {
snprintf(tmpBuff, sizeof(tmpBuff), "%d", 20);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "LastBw");
} else if (RxRate.field.BW == BW_40) {
snprintf(tmpBuff, sizeof(tmpBuff), "%d", 40);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "LastBw");
} else if (RxRate.field.BW == BW_80) {
snprintf(tmpBuff, sizeof(tmpBuff), "%d", 80);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "LastBw");
} else if (RxRate.field.BW == BW_160) {
snprintf(tmpBuff, sizeof(tmpBuff), "%d", 160);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "LastBw");
}
if (RxRate.field.MODE < MODE_HTMIX) {
snprintf(tmpBuff, sizeof(tmpBuff), "%s", "LGI");
} else if (RxRate.field.MODE >= MODE_HE) {
if (RxRate.field.ShortGI == 0)
snprintf(tmpBuff, sizeof(tmpBuff), "%s", "SGI");
else if (RxRate.field.ShortGI == 1)
snprintf(tmpBuff, sizeof(tmpBuff), "%s", "MGI");
else if (RxRate.field.ShortGI == 2)
snprintf(tmpBuff, sizeof(tmpBuff), "%s", "LGI");
} else {
snprintf(tmpBuff, sizeof(tmpBuff), "%s", RxRate.field.ShortGI ? "SGI" : "LGI");
}
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "LastGi");
snprintf(tmpBuff, sizeof(tmpBuff), "%s", phyMode[RxRate.field.MODE]);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "LastPhyMode");
snprintf(tmpBuff, sizeof(tmpBuff), "%s", RxRate.field.STBC ? "STBC": " ");
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "LastStbc");
// Connect time
snprintf(tmpBuff, sizeof(tmpBuff), "%02d", hr);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "Hr");
snprintf(tmpBuff, sizeof(tmpBuff), "%02d", min);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "Min");
snprintf(tmpBuff, sizeof(tmpBuff), "%02d", sec);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "Sec");
if (TxRate.field.MODE >= MODE_HE) {
get_rate_he((mcs & 0xf), TxRate.field.BW, nss, 0, &DataRate);
if (TxRate.field.ShortGI == 1)
DataRate = (DataRate * 967) >> 10;
else if (TxRate.field.ShortGI == 2)
DataRate = (DataRate * 870) >> 10;
} else {
getRate(TxRate, &DataRate);
}
snprintf(tmpBuff, sizeof(tmpBuff), "%ld", DataRate);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "TxRate");
if (RxRate.field.MODE >= MODE_HE) {
get_rate_he((mcs_r & 0xf), RxRate.field.BW, nss_r, 0, &DataRate_r);
if (RxRate.field.ShortGI == 1)
DataRate_r = (DataRate_r * 967) >> 10;
else if (RxRate.field.ShortGI == 2)
DataRate_r = (DataRate_r * 870) >> 10;
} else {
getRate(RxRate, &DataRate_r);
}
snprintf(tmpBuff, sizeof(tmpBuff), "%ld", DataRate_r);
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "RxRate");
snprintf(tmpBuff, sizeof(tmpBuff), "%s", GetEncryModeStr(pe->EncryMode));
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "EncryptMode");
snprintf(tmpBuff, sizeof(tmpBuff), "%s", GetAuthModeStr(pe->AuthMode));
lua_pushstring(L, tmpBuff);
lua_setfield(L, -2, "AuthMode");
lua_settable(L, -3);
}
free(table);
return 1;
}

View File

@@ -0,0 +1,221 @@
#ifndef __MTWIFI_H
#define __MTWIFI_H
#define USHORT unsigned short
#define UCHAR unsigned char
#define ULONG unsigned long
#define UINT8 unsigned char
#define UINT16 unsigned short
#define UINT32 unsigned int
#define INT32 int
#define INT int
#include <lua.h> /* Always include this */
#include <lauxlib.h> /* Always include this */
#include <lualib.h> /* Always include this */
typedef union _HTTRANSMIT_SETTING_FIX {
struct {
USHORT MCS:6;
USHORT ldpc:1;
USHORT BW:2;
USHORT ShortGI:2;
USHORT STBC:1;
USHORT eTxBF:1;
USHORT iTxBF:1;
USHORT MODE:4;
} field;
UINT32 word;
} HTTRANSMIT_SETTING_FIX, *PHTTRANSMIT_SETTING_FIX;
typedef struct _RT_802_11_MAC_ENTRY_FIX {
unsigned char ApIdx;
unsigned char Addr[6];
unsigned short Aid;
unsigned char Psm; // 0:PWR_ACTIVE, 1:PWR_SAVE
unsigned char MimoPs; // 0:MMPS_STATIC, 1:MMPS_DYNAMIC, 3:MMPS_Enabled
signed char AvgRssi0;
signed char AvgRssi1;
signed char AvgRssi2;
signed char AvgRssi3;
unsigned int ConnectedTime;
HTTRANSMIT_SETTING_FIX TxRate;
HTTRANSMIT_SETTING_FIX LastRxRate;
short StreamSnr[3];
short SoundingRespSnr[3];
UINT32 EncryMode;
UINT32 AuthMode;
} RT_802_11_MAC_ENTRY_FIX;
#define MAX_NUMBER_OF_MAC 544
typedef struct _RT_802_11_MAC_TABLE {
unsigned long Num;
RT_802_11_MAC_ENTRY_FIX Entry[MAX_NUMBER_OF_MAC];
} RT_802_11_MAC_TABLE_FIX;
#define IF_NAMESIZE 16
#define SIOCIWFIRSTPRIV 0x8BE0
#define RT_PRIV_IOCTL (SIOCIWFIRSTPRIV + 0x0E)
#define RTPRIV_IOCTL_GET_MAC_TABLE_STRUCT (SIOCIWFIRSTPRIV + 0x1F)
#define RTPRIV_IOCTL_GSITESURVEY (SIOCIWFIRSTPRIV + 0x0D)
#define OID_GET_WMODE 0x099E
#define OID_GET_CPU_TEMPERATURE 0x09A1
#define MODE_CCK 0
#define MODE_OFDM 1
#define MODE_HTMIX 2
#define MODE_HTGREENFIELD 3
#define MODE_VHT 4
#define MODE_HE 5
#define MODE_HE_5G 6
#define MODE_HE_24G 7
#define MODE_HE_SU 8
#define MODE_HE_EXT_SU 9
#define MODE_HE_TRIG 10
#define MODE_HE_MU 11
#define TMI_TX_RATE_OFDM_6M 11
#define TMI_TX_RATE_OFDM_9M 15
#define TMI_TX_RATE_OFDM_12M 10
#define TMI_TX_RATE_OFDM_18M 14
#define TMI_TX_RATE_OFDM_24M 9
#define TMI_TX_RATE_OFDM_36M 13
#define TMI_TX_RATE_OFDM_48M 8
#define TMI_TX_RATE_OFDM_54M 12
#define TMI_TX_RATE_CCK_1M_LP 0
#define TMI_TX_RATE_CCK_2M_LP 1
#define TMI_TX_RATE_CCK_5M_LP 2
#define TMI_TX_RATE_CCK_11M_LP 3
#define TMI_TX_RATE_CCK_2M_SP 5
#define TMI_TX_RATE_CCK_5M_SP 6
#define TMI_TX_RATE_CCK_11M_SP 7
enum oid_bw {
BAND_WIDTH_20,
BAND_WIDTH_40,
BAND_WIDTH_80,
BAND_WIDTH_160,
BAND_WIDTH_10,
BAND_WIDTH_5,
BAND_WIDTH_8080,
BAND_WIDTH_BOTH,
BAND_WIDTH_25,
BAND_WIDTH_20_242TONE,
BAND_WIDTH_NUM
};
#define BW_20 BAND_WIDTH_20
#define BW_40 BAND_WIDTH_40
#define BW_80 BAND_WIDTH_80
#define BW_160 BAND_WIDTH_160
#define BW_10 BAND_WIDTH_10
#define BW_5 BAND_WIDTH_5
#define BW_8080 BAND_WIDTH_8080
#define BW_25 BAND_WIDTH_25
#define BW_20_242TONE BAND_WIDTH_20_242TONE
#define BW_NUM BAND_WIDTH_NUM
typedef enum _SEC_CIPHER_MODE {
SEC_CIPHER_NONE,
SEC_CIPHER_WEP40,
SEC_CIPHER_WEP104,
SEC_CIPHER_WEP128,
SEC_CIPHER_TKIP,
SEC_CIPHER_CCMP128,
SEC_CIPHER_CCMP256,
SEC_CIPHER_GCMP128,
SEC_CIPHER_GCMP256,
SEC_CIPHER_BIP_CMAC128,
SEC_CIPHER_BIP_CMAC256,
SEC_CIPHER_BIP_GMAC128,
SEC_CIPHER_BIP_GMAC256,
SEC_CIPHER_WPI_SMS4, /* WPI SMS4 support */
SEC_CIPHER_MAX /* Not a real mode, defined as upper bound */
} SEC_CIPHER_MODE;
#define IS_CIPHER_NONE(_Cipher) (((_Cipher) & (1 << SEC_CIPHER_NONE)) > 0)
#define IS_CIPHER_WEP40(_Cipher) (((_Cipher) & (1 << SEC_CIPHER_WEP40)) > 0)
#define IS_CIPHER_WEP104(_Cipher) (((_Cipher) & (1 << SEC_CIPHER_WEP104)) > 0)
#define IS_CIPHER_WEP128(_Cipher) (((_Cipher) & (1 << SEC_CIPHER_WEP128)) > 0)
#define IS_CIPHER_WEP(_Cipher) (((_Cipher) & ((1 << SEC_CIPHER_WEP40) | (1 << SEC_CIPHER_WEP104) | (1 << SEC_CIPHER_WEP128))) > 0)
#define IS_CIPHER_TKIP(_Cipher) (((_Cipher) & (1 << SEC_CIPHER_TKIP)) > 0)
#define IS_CIPHER_WEP_TKIP_ONLY(_Cipher) ((IS_CIPHER_WEP(_Cipher) || IS_CIPHER_TKIP(_Cipher)) && (_Cipher < (1 << SEC_CIPHER_CCMP128)))
#define IS_CIPHER_CCMP128(_Cipher) (((_Cipher) & (1 << SEC_CIPHER_CCMP128)) > 0)
#define IS_CIPHER_CCMP256(_Cipher) (((_Cipher) & (1 << SEC_CIPHER_CCMP256)) > 0)
#define IS_CIPHER_GCMP128(_Cipher) (((_Cipher) & (1 << SEC_CIPHER_GCMP128)) > 0)
#define IS_CIPHER_GCMP256(_Cipher) (((_Cipher) & (1 << SEC_CIPHER_GCMP256)) > 0)
#define IS_CIPHER_BIP_CMAC128(_Cipher) (((_Cipher) & (1 << SEC_CIPHER_BIP_CMAC128)) > 0)
#define IS_CIPHER_BIP_CMAC256(_Cipher) (((_Cipher) & (1 << SEC_CIPHER_BIP_CMAC256)) > 0)
#define IS_CIPHER_BIP_GMAC128(_Cipher) (((_Cipher) & (1 << SEC_CIPHER_BIP_GMAC128)) > 0)
#define IS_CIPHER_BIP_GMAC256(_Cipher) (((_Cipher) & (1 << SEC_CIPHER_BIP_GMAC256)) > 0)
/* 802.11 authentication and key management */
typedef enum _SEC_AKM_MODE {
SEC_AKM_OPEN,
SEC_AKM_SHARED,
SEC_AKM_AUTOSWITCH,
SEC_AKM_WPA1, /* Enterprise security over 802.1x */
SEC_AKM_WPA1PSK,
SEC_AKM_WPANone, /* For Win IBSS, directly PTK, no handshark */
SEC_AKM_WPA2, /* Enterprise security over 802.1x */
SEC_AKM_WPA2PSK,
SEC_AKM_FT_WPA2,
SEC_AKM_FT_WPA2PSK,
SEC_AKM_WPA2_SHA256,
SEC_AKM_WPA2PSK_SHA256,
SEC_AKM_TDLS,
SEC_AKM_SAE_SHA256,
SEC_AKM_FT_SAE_SHA256,
SEC_AKM_SUITEB_SHA256,
SEC_AKM_SUITEB_SHA384,
SEC_AKM_FT_WPA2_SHA384,
SEC_AKM_WAICERT, /* WAI certificate authentication */
SEC_AKM_WAIPSK, /* WAI pre-shared key */
SEC_AKM_OWE,
SEC_AKM_FILS_SHA256,
SEC_AKM_FILS_SHA384,
SEC_AKM_WPA3, /* WPA3(ent) = WPA2(ent) + PMF MFPR=1 => WPA3 code flow is same as WPA2, the usage of SEC_AKM_WPA3 is to force pmf on */
SEC_AKM_MAX /* Not a real mode, defined as upper bound */
} SEC_AKM_MODE;
#define IS_AKM_OPEN(_AKMMap) ((_AKMMap & (1 << SEC_AKM_OPEN)) > 0)
#define IS_AKM_SHARED(_AKMMap) ((_AKMMap & (1 << SEC_AKM_SHARED)) > 0)
#define IS_AKM_AUTOSWITCH(_AKMMap) ((_AKMMap & (1 << SEC_AKM_AUTOSWITCH)) > 0)
#define IS_AKM_WPA1(_AKMMap) ((_AKMMap & (1 << SEC_AKM_WPA1)) > 0)
#define IS_AKM_WPA1PSK(_AKMMap) ((_AKMMap & (1 << SEC_AKM_WPA1PSK)) > 0)
#define IS_AKM_WPANONE(_AKMMap) ((_AKMMap & (1 << SEC_AKM_WPANone)) > 0)
#define IS_AKM_WPA2(_AKMMap) ((_AKMMap & (1 << SEC_AKM_WPA2)) > 0)
#define IS_AKM_WPA2PSK(_AKMMap) ((_AKMMap & (1 << SEC_AKM_WPA2PSK)) > 0)
#define IS_AKM_FT_WPA2(_AKMMap) ((_AKMMap & (1 << SEC_AKM_FT_WPA2)) > 0)
#define IS_AKM_FT_WPA2PSK(_AKMMap) ((_AKMMap & (1 << SEC_AKM_FT_WPA2PSK)) > 0)
#define IS_AKM_WPA2_SHA256(_AKMMap) ((_AKMMap & (1 << SEC_AKM_WPA2_SHA256)) > 0)
#define IS_AKM_WPA2PSK_SHA256(_AKMMap) ((_AKMMap & (1 << SEC_AKM_WPA2PSK_SHA256)) > 0)
#define IS_AKM_TDLS(_AKMMap) ((_AKMMap & (1 << SEC_AKM_TDLS)) > 0)
#define IS_AKM_SAE_SHA256(_AKMMap) ((_AKMMap & (1 << SEC_AKM_SAE_SHA256)) > 0)
#define IS_AKM_FT_SAE_SHA256(_AKMMap) ((_AKMMap & (1 << SEC_AKM_FT_SAE_SHA256)) > 0)
#define IS_AKM_SUITEB_SHA256(_AKMMap) ((_AKMMap & (1 << SEC_AKM_SUITEB_SHA256)) > 0)
#define IS_AKM_SUITEB_SHA384(_AKMMap) ((_AKMMap & (1 << SEC_AKM_SUITEB_SHA384)) > 0)
#define IS_AKM_FT_WPA2_SHA384(_AKMMap) ((_AKMMap & (1 << SEC_AKM_FT_WPA2_SHA384)) > 0)
#define IS_AKM_WPA3(_AKMMap) ((_AKMMap & (1 << SEC_AKM_WPA3)) > 0)
#define IS_AKM_WPA3PSK(_AKMMap) (IS_AKM_SAE_SHA256(_AKMMap))
#define IS_AKM_WPA3_192BIT(_AKMMap) (IS_AKM_SUITEB_SHA384(_AKMMap))
#define IS_AKM_OWE(_AKMMap) ((_AKMMap & (1 << SEC_AKM_OWE)) > 0)
int get_macaddr(lua_State *L);
int convert_string_display(lua_State *L);
int StaInfo(lua_State *L);
int getWMOde(lua_State *L);
int getTxPower(lua_State *L);
int getTempature(lua_State *L);
int getChannel(lua_State *L);
int scanResult(lua_State *L);
void getRate(HTTRANSMIT_SETTING_FIX HTSetting, ULONG *fLastTxRxRate);
void get_rate_he(UINT8 mcs, UINT8 bw, UINT8 nss, UINT8 dcm, ULONG *last_tx_rate);
UINT32 cck_to_mcs(UINT32 mcs);
const char *GetEncryModeStr(UINT32 encryMode);
const char *GetAuthModeStr(UINT32 authMode);
#endif

View File

@@ -0,0 +1,479 @@
#include "mtwifi.h"
#define MAX_NUM_HE_BANDWIDTHS 4
#define MAX_NUM_HE_SPATIAL_STREAMS 4
#define MAX_NUM_HE_MCS_ENTRIES 12
UINT32 cck_to_mcs(UINT32 mcs) {
UINT32 ret = 0;
if (mcs == TMI_TX_RATE_CCK_1M_LP)
ret = 0;
else if (mcs == TMI_TX_RATE_CCK_2M_LP)
ret = 1;
else if (mcs == TMI_TX_RATE_CCK_5M_LP)
ret = 2;
else if (mcs == TMI_TX_RATE_CCK_11M_LP)
ret = 3;
else if (mcs == TMI_TX_RATE_CCK_2M_SP)
ret = 1;
else if (mcs == TMI_TX_RATE_CCK_5M_SP)
ret = 2;
else if (mcs == TMI_TX_RATE_CCK_11M_SP)
ret = 3;
return ret;
}
static UINT16 he_mcs_phyrate_mapping_table[MAX_NUM_HE_BANDWIDTHS][MAX_NUM_HE_SPATIAL_STREAMS][MAX_NUM_HE_MCS_ENTRIES] = {
{ /*20 Mhz*/
/* 1 SS */
{
/* DCM 0*/
8,
17,
25,
34,
51,
68,
77,
86,
103,
114,
129,
143
},
/* 2 SS */
{
/* DCM 0 */
17,
34,
51,
68,
103,
137,
154,
172,
206,
229,
258,
286
},
/* 3 SS */
{
/* DCM 0 */
25,
51,
77,
103,
154,
206,
232,
258,
309,
344,
387,
430
},
/* 4 SS */
{
/* DCM 0 */
34,
68,
103,
137,
206,
275,
309,
344,
412,
458,
516,
573
}
},
{ /*40 Mhz*/
/* 1 SS */
{
/* DCM 0*/
17,
34,
51,
68,
103,
137,
154,
172,
206,
229,
258,
286
},
/* 2 SS */
{
/* DCM 0 */
34,
68,
103,
137,
206,
275,
309,
344,
412,
458,
516,
573
},
/* 3 SS */
{
/* DCM 0 */
51,
103,
154,
206,
309,
412,
464,
516,
619,
688,
774,
860
},
/* 4 SS */
{
/* DCM 0 */
68,
137,
206,
275,
412,
550,
619,
688,
825,
917,
1032,
1147
}
},
{ /*80 Mhz*/
/* 1 SS */
{
/* DCM 0*/
36,
72,
108,
144,
216,
288,
324,
360,
432,
480,
540,
600
},
/* 2 SS */
{
/* DCM 0 */
72,
144,
216,
288,
432,
576,
648,
720,
864,
960,
1080,
1201
},
/* 3 SS */
{
/* DCM 0 */
108,
216,
324,
432,
648,
864,
972,
1080,
1297,
1441,
1621,
1801
},
/* 4 SS */
{
/* DCM 0 */
144,
288,
432,
576,
864,
1152,
1297,
1141,
1729,
1921,
2161,
2401
}
},
{ /*160 Mhz*/
/* 1 SS */
{
/* DCM 0*/
72,
144,
216,
288,
432,
576,
648,
720,
864,
960,
1080,
1201
},
/* 2 SS */
{
/* DCM 0 */
144,
288,
432,
576,
864,
1152,
1297,
1441,
1729,
1921,
2161,
2401
},
/* 3 SS */
{
/* DCM 0 */
216,
432,
648,
864,
1297,
1729,
1945,
2161,
2594,
2882,
3242,
3602
},
/* 4 SS */
{
/* DCM 0 */
288,
576,
864,
1152,
1729,
2305,
2594,
2882,
3458,
3843,
4323,
4803
},
}
};
void get_rate_he(UINT8 mcs, UINT8 bw, UINT8 nss, UINT8 dcm, ULONG *last_tx_rate)
{
ULONG value = 0;
if (nss == 0)
nss = 1;
if (mcs >= MAX_NUM_HE_MCS_ENTRIES)
mcs = MAX_NUM_HE_MCS_ENTRIES - 1;
if (nss > MAX_NUM_HE_SPATIAL_STREAMS)
nss = MAX_NUM_HE_SPATIAL_STREAMS;
if (bw >= MAX_NUM_HE_BANDWIDTHS)
bw = MAX_NUM_HE_BANDWIDTHS - 1;
nss--;
value = he_mcs_phyrate_mapping_table[bw][nss][mcs];
/*In spec data rate when DCM =1 is half of the data rate when DCM = 0*/
if (dcm && value)
value = value / 2 ;
*last_tx_rate = (ULONG)value;
return;
}
static INT32 getLegacyOFDMMCSIndex(UINT8 MCS)
{
INT32 mcs_index = MCS;
if (MCS == 0xb)
mcs_index = 0;
else if (MCS == 0xf)
mcs_index = 1;
else if (MCS == 0xa)
mcs_index = 2;
else if (MCS == 0xe)
mcs_index = 3;
else if (MCS == 0x9)
mcs_index = 4;
else if (MCS == 0xd)
mcs_index = 5;
else if (MCS == 0x8)
mcs_index = 6;
else if (MCS == 0xc)
mcs_index = 7;
return mcs_index;
}
static INT MCSMappingRateTable[] = {
2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 109, 110, 111, 112,/* CCK and OFDM */
13, 26, 39, 52, 78, 104, 117, 130, 26, 52, 78, 104, 156, 208, 234, 260,
39, 78, 117, 156, 234, 312, 351, 390, /* BW 20, 800ns GI, MCS 0~23 */
27, 54, 81, 108, 162, 216, 243, 270, 54, 108, 162, 216, 324, 432, 486, 540,
81, 162, 243, 324, 486, 648, 729, 810, /* BW 40, 800ns GI, MCS 0~23 */
14, 29, 43, 57, 87, 115, 130, 144, 29, 59, 87, 115, 173, 230, 260, 288,
43, 87, 130, 173, 260, 317, 390, 433, /* BW 20, 400ns GI, MCS 0~23 */
30, 60, 90, 120, 180, 240, 270, 300, 60, 120, 180, 240, 360, 480, 540, 600,
90, 180, 270, 360, 540, 720, 810, 900, /* BW 40, 400ns GI, MCS 0~23 */
/*for 11ac:20 Mhz 800ns GI*/
6, 13, 19, 26, 39, 52, 58, 65, 78, 90, /*1ss mcs 0~8*/
13, 26, 39, 52, 78, 104, 117, 130, 156, 180, /*2ss mcs 0~8*/
19, 39, 58, 78, 117, 156, 175, 195, 234, 260, /*3ss mcs 0~9*/
26, 52, 78, 104, 156, 208, 234, 260, 312, 360, /*4ss mcs 0~8*/
/*for 11ac:40 Mhz 800ns GI*/
13, 27, 40, 54, 81, 108, 121, 135, 162, 180, /*1ss mcs 0~9*/
27, 54, 81, 108, 162, 216, 243, 270, 324, 360, /*2ss mcs 0~9*/
40, 81, 121, 162, 243, 324, 364, 405, 486, 540, /*3ss mcs 0~9*/
54, 108, 162, 216, 324, 432, 486, 540, 648, 720, /*4ss mcs 0~9*/
/*for 11ac:80 Mhz 800ns GI*/
29, 58, 87, 117, 175, 234, 263, 292, 351, 390, /*1ss mcs 0~9*/
58, 117, 175, 243, 351, 468, 526, 585, 702, 780, /*2ss mcs 0~9*/
87, 175, 263, 351, 526, 702, 0, 877, 1053, 1170, /*3ss mcs 0~9*/
117, 234, 351, 468, 702, 936, 1053, 1170, 1404, 1560, /*4ss mcs 0~9*/
/*for 11ac:160 Mhz 800ns GI*/
58, 117, 175, 234, 351, 468, 526, 585, 702, 780, /*1ss mcs 0~9*/
117, 234, 351, 468, 702, 936, 1053, 1170, 1404, 1560, /*2ss mcs 0~9*/
175, 351, 526, 702, 1053, 1404, 1579, 1755, 2160, 0, /*3ss mcs 0~8*/
234, 468, 702, 936, 1404, 1872, 2106, 2340, 2808, 3120, /*4ss mcs 0~9*/
/*for 11ac:20 Mhz 400ns GI*/
7, 14, 21, 28, 43, 57, 65, 72, 86, 100, /*1ss mcs 0~8*/
14, 28, 43, 57, 86, 115, 130, 144, 173, 200, /*2ss mcs 0~8*/
21, 43, 65, 86, 130, 173, 195, 216, 260, 288, /*3ss mcs 0~9*/
28, 57, 86, 115, 173, 231, 260, 288, 346, 400, /*4ss mcs 0~8*/
/*for 11ac:40 Mhz 400ns GI*/
15, 30, 45, 60, 90, 120, 135, 150, 180, 200, /*1ss mcs 0~9*/
30, 60, 90, 120, 180, 240, 270, 300, 360, 400, /*2ss mcs 0~9*/
45, 90, 135, 180, 270, 360, 405, 450, 540, 600, /*3ss mcs 0~9*/
60, 120, 180, 240, 360, 480, 540, 600, 720, 800, /*4ss mcs 0~9*/
/*for 11ac:80 Mhz 400ns GI*/
32, 65, 97, 130, 195, 260, 292, 325, 390, 433, /*1ss mcs 0~9*/
65, 130, 195, 260, 390, 520, 585, 650, 780, 866, /*2ss mcs 0~9*/
97, 195, 292, 390, 585, 780, 0, 975, 1170, 1300, /*3ss mcs 0~9*/
130, 260, 390, 520, 780, 1040, 1170, 1300, 1560, 1733, /*4ss mcs 0~9*/
/*for 11ac:160 Mhz 400ns GI*/
65, 130, 195, 260, 390, 520, 585, 650, 780, 866, /*1ss mcs 0~9*/
130, 260, 390, 520, 780, 1040, 1170, 1300, 1560, 1733, /*2ss mcs 0~9*/
195, 390, 585, 780, 1170, 1560, 1755, 1950, 2340, 0, /*3ss mcs 0~8*/
260, 520, 780, 1040, 1560, 2080, 2340, 2600, 3120, 3466, /*4ss mcs 0~9*/
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37
}; /* 3*3 */
void getRate(HTTRANSMIT_SETTING_FIX HTSetting, ULONG *fLastTxRxRate)
{
UINT8 Antenna = 0;
UINT8 MCS = HTSetting.field.MCS;
int rate_count = sizeof(MCSMappingRateTable) / sizeof(int);
int rate_index = 0;
int value = 0;
if (HTSetting.field.MODE >= MODE_VHT) {
MCS = HTSetting.field.MCS & 0xf;
Antenna = (HTSetting.field.MCS >> 4) + 1;
if (HTSetting.field.BW == BW_20) {
rate_index = 112 + ((Antenna - 1) * 10) +
((UCHAR)HTSetting.field.ShortGI * 160) +
((UCHAR)MCS);
} else if (HTSetting.field.BW == BW_40) {
rate_index = 152 + ((Antenna - 1) * 10) +
((UCHAR)HTSetting.field.ShortGI * 160) +
((UCHAR)MCS);
} else if (HTSetting.field.BW == BW_80) {
rate_index = 192 + ((Antenna - 1) * 10) +
((UCHAR)HTSetting.field.ShortGI * 160) +
((UCHAR)MCS);
} else if (HTSetting.field.BW == BW_160) {
rate_index = 232 + ((Antenna - 1) * 10) +
((UCHAR)HTSetting.field.ShortGI * 160) +
((UCHAR)MCS);
}
} else {
if (HTSetting.field.MODE >= MODE_HTMIX) {
MCS = HTSetting.field.MCS;
if ((HTSetting.field.MODE == MODE_HTMIX)
|| (HTSetting.field.MODE == MODE_HTGREENFIELD))
Antenna = (MCS >> 3) + 1;
/* map back to 1SS MCS , multiply by antenna numbers later */
if (MCS > 7)
MCS %= 8;
rate_index = 16 + ((UCHAR)HTSetting.field.BW * 24) + ((UCHAR)HTSetting.field.ShortGI * 48) + ((UCHAR)MCS);
} else {
if (HTSetting.field.MODE == MODE_OFDM)
rate_index = getLegacyOFDMMCSIndex(HTSetting.field.MCS) + 4;
else if (HTSetting.field.MODE == MODE_CCK)
rate_index = (UCHAR)(HTSetting.field.MCS);
}
}
if (rate_index < 0)
rate_index = 0;
if (rate_index >= rate_count)
rate_index = rate_count - 1;
if (HTSetting.field.MODE < MODE_VHT)
value = (MCSMappingRateTable[rate_index] * 5) / 10;
else
value = MCSMappingRateTable[rate_index];
if (HTSetting.field.MODE >= MODE_HTMIX && HTSetting.field.MODE < MODE_VHT)
value *= Antenna;
*fLastTxRxRate = (ULONG)value;
return;
}

View File

@@ -0,0 +1,79 @@
#include "mtwifi.h"
const char *GetEncryModeStr(UINT32 encryMode)
{
if (IS_CIPHER_NONE(encryMode))
return "NONE";
else if (IS_CIPHER_WEP(encryMode))
return "WEP";
else if (IS_CIPHER_TKIP(encryMode) && IS_CIPHER_CCMP128(encryMode))
return "TKIPAES";
else if (IS_CIPHER_TKIP(encryMode))
return "TKIP";
else if (IS_CIPHER_CCMP128(encryMode))
return "AES";
else if (IS_CIPHER_CCMP256(encryMode))
return "CCMP256";
else if (IS_CIPHER_GCMP128(encryMode))
return "GCMP128";
else if (IS_CIPHER_GCMP256(encryMode))
return "GCMP256";
else if (IS_CIPHER_BIP_CMAC128(encryMode))
return "BIP-CMAC128";
else if (IS_CIPHER_BIP_CMAC256(encryMode))
return "BIP-CMAC256";
else if (IS_CIPHER_BIP_GMAC128(encryMode))
return "BIP-GMAC128";
else if (IS_CIPHER_BIP_GMAC256(encryMode))
return "BIP-GMAC256";
else
return "Unknown";
}
const char *GetAuthModeStr(UINT32 authMode)
{
if (IS_AKM_OPEN(authMode))
return "OPEN";
else if (IS_AKM_SHARED(authMode))
return "SHARED";
else if (IS_AKM_AUTOSWITCH(authMode))
return "WEPAUTO";
else if (IS_AKM_WPANONE(authMode))
return "WPANONE";
else if (IS_AKM_FT_WPA2PSK(authMode) && IS_AKM_FT_SAE_SHA256(authMode))
return "FT-WPA2PSKWPA3PSK";
else if (IS_AKM_WPA1(authMode) && IS_AKM_WPA2(authMode))
return "WPA1WPA2";
else if (IS_AKM_WPA1PSK(authMode) && IS_AKM_WPA2PSK(authMode))
return "WPAPSKWPA2PSK";
else if (IS_AKM_WPA2PSK(authMode) && IS_AKM_WPA3PSK(authMode))
return "WPA2PSKWPA3PSK";
else if (IS_AKM_WPA2PSK(authMode) && IS_AKM_WPA2PSK_SHA256(authMode) && IS_AKM_WPA3PSK(authMode))
return "WPA2PSKMIXWPA3PSK";
else if (IS_AKM_FT_SAE_SHA256(authMode))
return "FT-SAE";
else if (IS_AKM_WPA3PSK(authMode))
return "WPA3PSK";
else if (IS_AKM_WPA1(authMode))
return "WPA";
else if (IS_AKM_WPA1PSK(authMode))
return "WPAPSK";
else if (IS_AKM_FT_WPA2(authMode))
return "FT-WPA2";
else if (IS_AKM_FT_WPA2PSK(authMode))
return "FT-WPA2PSK";
else if (IS_AKM_WPA3(authMode)) /* WPA3 will be always accompanied by WPA2, so it should put before the WPA2 */
return "WPA3";
else if (IS_AKM_WPA2(authMode))
return "WPA2";
else if (IS_AKM_WPA2(authMode) && IS_AKM_WPA2_SHA256(authMode))
return "WPA2MIX";
else if (IS_AKM_WPA2PSK(authMode))
return "WPA2PSK";
else if (IS_AKM_WPA3_192BIT(authMode))
return "WPA3-192";
else if (IS_AKM_OWE(authMode))
return "OWE";
else
return "Unknown";
}

View File

@@ -0,0 +1,17 @@
#
# Copyright (C) hanwckf <hanwckf@vip.qq.com>
#
# This is free software, licensed under the GNU General Public License v2.
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for mtwifi-cfg
LUCI_DEPENDS:=+mtwifi-cfg
LUCI_PKGARCH:=all
PKG_VERSION:=1
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@@ -0,0 +1,57 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8\n"
msgid "Target Wake Time"
msgstr "目标唤醒时间TWT"
msgid "MU-MIMO DL"
msgstr "下行 MU-MIMO"
msgid "MU-MIMO UL"
msgstr "上行 MU-MIMO"
msgid "OFDMA DL"
msgstr "下行 OFDMA"
msgid "OFDMA UL"
msgstr "上行 OFDMA"
msgid "A-MSDU"
msgstr "MSDU聚合A-MSDU"
msgid "Auto Block ACK"
msgstr "自动块确认"
msgid "U-APSD"
msgstr "U-APSD 省电模式"
msgid "Kick low RSSI station threshold"
msgstr "弱信号剔除阈值"
msgid "Station associate threshold"
msgstr "弱信号接入阈值"
msgid "802.11V roam steering threshold"
msgstr "802.11V漫游引导阈值"
msgid "802.11V roam target bssid"
msgstr "802.11V漫游引导目标BSSID"
msgid "only supports mt_wifi driver"
msgstr "仅支持MTK闭源驱动漫游域相关参数自动生成无需设置.确认路由器自身lan ip均在同一网段"
msgid "Wireless HWNAT"
msgstr "无线硬件加速"
msgid "Band Steering"
msgstr "引导已连接的强信号双频2.4G设备至5G频段"
msgid "Wireless configuration error"
msgstr "无线网络设置错误"
msgid "At least one MBSSID needs to be reserved"
msgstr "至少需要保留1个MBSSID"

View File

@@ -0,0 +1,17 @@
#!/bin/sh
if [ -d /www/luci-static/resources/view/network ]; then
mv -f /usr/share/luci-app-mtwifi-cfg/wireless-mtk.js /www/luci-static/resources/view/network/wireless.js
fi
if [ -d /usr/share/luci/menu.d ]; then
mv -f /usr/share/luci-app-mtwifi-cfg/luci-mod-status.json /usr/share/luci/menu.d/luci-mod-status.json
fi
luci_network_js="/www/luci-static/resources/network.js"
if [ -f $luci_network_js ]; then
if ! grep -sq 'ra\[xiyez\]' $luci_network_js ; then
sed -i 's#/^wlan\\d+/,#/^wlan\\d+/,/^ra[xiyez]?\\d+/,/^apcli[xiyez]?\\d+/,#' $luci_network_js
fi
fi

View File

@@ -0,0 +1,143 @@
{
"admin/status/overview": {
"title": "Overview",
"order": 1,
"action": {
"type": "template",
"path": "admin_status/index"
},
"depends": {
"acl": [ "luci-mod-status-index" ]
}
},
"admin/status/iptables": {
"title": "Firewall",
"order": 2,
"action": {
"type": "view",
"path": "status/iptables"
},
"depends": {
"acl": [ "luci-mod-status-firewall" ]
}
},
"admin/status/routes": {
"title": "Routing",
"order": 3,
"action": {
"type": "view",
"path": "status/routes"
},
"depends": {
"acl": [ "luci-mod-status-routes" ]
}
},
"admin/status/logs": {
"title": "System Log",
"order": 4,
"action": {
"type": "alias",
"path": "admin/status/logs/syslog"
},
"depends": {
"acl": [ "luci-mod-status-logs" ]
}
},
"admin/status/logs/syslog": {
"title": "System Log",
"order": 1,
"action": {
"type": "view",
"path": "status/syslog"
}
},
"admin/status/logs/dmesg": {
"title": "Kernel Log",
"order": 2,
"action": {
"type": "view",
"path": "status/dmesg"
}
},
"admin/status/processes": {
"title": "Processes",
"order": 6,
"action": {
"type": "view",
"path": "status/processes"
},
"depends": {
"acl": [ "luci-mod-status-processes" ]
}
},
"admin/status/channel_analysis": {
"title": "Channel Analysis",
"order": 7,
"action": {
"type": "view",
"path": "status/channel_analysis"
},
"depends": {
"acl": [ "luci-mod-status-channel_analysis" ],
"uci": { "wireless": { "@wifi-device": { "type": "mac80211" } } }
}
},
"admin/status/realtime": {
"title": "Realtime Graphs",
"order": 7,
"action": {
"type": "alias",
"path": "admin/status/realtime/load"
},
"depends": {
"acl": [ "luci-mod-status-realtime" ]
}
},
"admin/status/realtime/load": {
"title": "Load",
"order": 1,
"action": {
"type": "view",
"path": "status/load"
}
},
"admin/status/realtime/bandwidth": {
"title": "Traffic",
"order": 2,
"action": {
"type": "view",
"path": "status/bandwidth"
}
},
"admin/status/realtime/wireless": {
"title": "Wireless",
"order": 3,
"action": {
"type": "view",
"path": "status/wireless"
},
"depends": {
"uci": { "wireless": { "@wifi-device": true } }
}
},
"admin/status/realtime/connections": {
"title": "Connections",
"order": 4,
"action": {
"type": "view",
"path": "status/connections"
}
}
}

View File

@@ -0,0 +1,19 @@
# Copyright (C) 2016 Openwrt.org
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for MWAN3 Helper chinaroute
LUCI_DEPENDS:= dnsmasq-full +ipset
LUCI_PKGARCH:=all
PKG_VERSION:=1
PKG_RELEASE:=3
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@@ -0,0 +1,28 @@
-- Licensed to the public under the GNU General Public License v3.
module("luci.controller.mwan3helper", package.seeall)
function index()
if not nixio.fs.access("/etc/config/mwan3helper") then
return
end
local page = entry({"admin", "services", "mwan3helper"},alias("admin", "services", "mwan3helper", "client"),_("MWAN3 Helper"), 300)
page.dependent = true
page.acl_depends = { "luci-app-mwan3helper" }
entry({"admin", "services", "mwan3helper", "client"},cbi("mwan3helper/client"),_("Settings"), 10).leaf = true
entry({"admin", "services", "mwan3helper", "lists"},cbi("mwan3helper/list"),_("IPSet Lists"), 20).leaf = true
entry({"admin","services","mwan3helper","status"},call("act_status")).leaf=true
end
function act_status()
local e={}
e.running=luci.sys.call("pgrep mwan3dns >/dev/null")==0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end

View File

@@ -0,0 +1,23 @@
m = Map("mwan3helper")
m.title = translate("MWAN3 Helper")
s = m:section(TypedSection, "mwan3helper")
s.addremove = false
s.anonymous = true
o = s:option(Flag, "enabled", translate("启用转发"))
o.rmempty = false
o = s:option(ListValue, "mode", translate("转发流量模式"))
o:value("0", translate("国外流量"))
o:value("1", translate("GFWLIST流量"))
o = s:option(Value, "dns", translate("转发流量至IP"))
o = s:option(Value, "dev", translate("设备"))
o = s:option(Flag, "dnsen", translate("启用 DNS 防污染"))
o.rmempty = false
o = s:option(Value, "dnsserver", translate("Anti-pollution DNS Server"))
return m

View File

@@ -0,0 +1,37 @@
m = Map("mwan3helper")
m.title = translate("MWAN3 IPSets")
s = m:section(TypedSection, "mwan3helper")
s.addremove = false
s.anonymous = true
o = s:option(DummyValue, "gfwlist", translate("GFW列表"))
o.description = translate("GFW列表数据 5207 条IPSET 名称为 gfwlist")
o = s:option(DummyValue, "all_cn", translate("中国所有IP地址"))
o.description = translate("中国所有IP地址路由表数据 8304 条, IPSET 名称为 cn")
o = s:option(DummyValue, "chinatelecom", translate("中国电信"))
o.description = translate("中国电信路由表数据: 1948 条, IPSET 名称为 ct")
o = s:option(DummyValue, "unicom_cnc", translate("中国联通/网通"))
o.description = translate("中国联通/网通路由表数据: 895 条, IPSET 名称为 cnc")
o = s:option(DummyValue, "cmcc", translate("中国移动"))
o.description = translate("中国移动路由表数据: 55 条, IPSET 名称为 cmcc")
o = s:option(DummyValue, "crtc", translate("中国铁通"))
o.description = translate("中国铁通路由表数据: 16 条, IPSET 名称为 crtc")
o = s:option(DummyValue, "cernet", translate("中国教育网"))
o.description = translate("中国教育网路由表数据: 162 条, IPSET 名称为 cernet")
o = s:option(DummyValue, "gwbn", translate("长城宽带/鹏博士"))
o.description = translate("长城宽带/鹏博士: 94 条, IPSET 名称为 gwbn")
o = s:option(DummyValue, "othernet", translate("中国其他ISP"))
o.description = translate("中国其他ISP 5134 条, IPSET 名称为 othernet")
return m

View File

@@ -0,0 +1,22 @@
<script type="text/javascript">//<![CDATA[
XHR.poll(3, '<%=url([[admin]], [[services]], [[mwan3helper]], [[status]])%>', null,
function(x, data) {
var tb = document.getElementById('mwan3helper_status');
if (data && tb) {
if (data.running) {
var links = '<em><b><font color=green>MWAN3 Helper <%:RUNNING%></font></b></em>';
tb.innerHTML = links;
} else {
tb.innerHTML = '<em><b><font color=red>MWAN3 Helper <%:NOT RUNNING%></font></b></em>';
}
}
}
);
//]]>
</script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<p id="mwan3helper_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>

View File

@@ -0,0 +1,24 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"Language: zh_Hans\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
msgid "MWAN3 Helper"
msgstr "MWAN3 分流助手"
msgid "Settings"
msgstr "设置"
msgid "IPSet Lists"
msgstr "IPSet列表"
msgid "MWAN3 Helper generate IPSets"
msgstr "自动生成中国地址段和各大ISP运营商的 IPSet 地址段并解决国外域名的污染问题帮助MWAN3分流 ISP/WireGuard 等"
msgid "Enable GFW IPSet"
msgstr "启用 GFW IPSet"

View File

@@ -0,0 +1,6 @@
config mwan3helper 'config'
option dns '192.168.6.2'
option dev 'br-lan'
option enabled '0'

View File

@@ -0,0 +1,84 @@
#!/bin/sh /etc/rc.common
# Copyright (c) 2011-2015 OpenWrt.org
START=60
USE_PROCD=1
start_service(){
/etc/mwan3helper/genipset.sh cn '/etc/mwan3helper/all_cn.txt'
/etc/mwan3helper/genipset.sh ct '/etc/mwan3helper/chinatelecom.txt'
/etc/mwan3helper/genipset.sh cnc '/etc/mwan3helper/unicom_cnc.txt'
/etc/mwan3helper/genipset.sh cmcc '/etc/mwan3helper/cmcc.txt'
/etc/mwan3helper/genipset.sh crtc '/etc/mwan3helper/crtc.txt'
/etc/mwan3helper/genipset.sh cernet '/etc/mwan3helper/cernet.txt'
/etc/mwan3helper/genipset.sh gwbn '/etc/mwan3helper/gwbn.txt'
/etc/mwan3helper/genipset.sh othernet '/etc/mwan3helper/othernet.txt'
en=$(uci get mwan3helper.config.enabled 2>/dev/null)
dns=$(uci get mwan3helper.config.dns 2>/dev/null)
dev=$(uci get mwan3helper.config.dev 2>/dev/null)
dnsen=$(uci get mwan3helper.config.dnsen 2>/dev/null)
mode=$(uci get mwan3helper.config.mode 2>/dev/null)
dnsserver=$(uci get mwan3helper.config.dnsserver 2>/dev/null)
if [ $en -eq 1 ]; then
mkdir -p /tmp/etc/dnsmasq-mwan3.d
ipset -N gfwlist hash:net 2>/dev/null
if [ $dnsen -eq 1 ]; then
awk '!/^$/&&!/^#/{printf("ipset=/.%s/'"gfwlist"'\n",$0)}' /etc/mwan3helper/gfw.txt > /tmp/etc/dnsmasq-mwan3.d/mwan3_gfwlist.conf
awk '!/^$/&&!/^#/{printf("server=/.%s/'"$dnsserver#53"'\n",$0)}' /etc/mwan3helper/gfw.txt >> /tmp/etc/dnsmasq-mwan3.d/mwan3_gfwlist.conf
cat > /tmp/dnsmasq.d/dnsmasq-mwan3.conf <<EOF
conf-dir=/var/etc/dnsmasq-mwan3.d
EOF
fi
/etc/init.d/dnsmasq restart
ip route del default table 200
ip route add default via $dns dev $dev table 200
ip rule del table 200
ip rule add table 200 fwmark 200
iptables -t mangle -D PREROUTING -i br-lan -j MARK --set-mark 200
iptables -t mangle -D PREROUTING -i br-lan -m set --match-set cn dst -j MARK --set-mark 0
iptables -t mangle -D PREROUTING -s $dns -j MARK --set-mark 0
iptables -t mangle -D PREROUTING -i br-lan -m set --match-set gfwlist dst -j MARK --set-mark 200
if [ $mode -eq 0 ]; then
iptables -t mangle -A PREROUTING -i br-lan -j MARK --set-mark 200
iptables -t mangle -A PREROUTING -i br-lan -m set --match-set cn dst -j MARK --set-mark 0
fi
iptables -t mangle -A PREROUTING -i br-lan -m set --match-set gfwlist dst -j MARK --set-mark 200
iptables -t mangle -A PREROUTING -s $dns -j MARK --set-mark 0
sed -i '/\/etc\/init.d\/mwan3helper start/d' /etc/firewall.user
echo "/etc/init.d/mwan3helper start" >> /etc/firewall.user
ipset add gfwlist 91.108.4.0/22
ipset add gfwlist 91.108.8.0/22
ipset add gfwlist 91.108.56.0/22
ipset add gfwlist 95.161.64.0/20
ipset add gfwlist 149.154.160.0/22
ipset add gfwlist 149.154.164.0/22
fi
}
stop_service(){
rm -f /tmp/dnsmasq.d/dnsmasq-mwan3.conf
/etc/init.d/dnsmasq restart
dns=$(uci get mwan3helper.config.dns 2>/dev/null)
dev=$(uci get mwan3helper.config.dev 2>/dev/null)
ip route del default table 200
ip rule del table 200
iptables -t mangle -D PREROUTING -i br-lan -j MARK --set-mark 200
iptables -t mangle -D PREROUTING -i br-lan -m set --match-set cn dst -j MARK --set-mark 0
iptables -t mangle -D PREROUTING -s $dns -j MARK --set-mark 0
iptables -t mangle -D PREROUTING -i br-lan -m set --match-set gfwlist dst -j MARK --set-mark 200
sed -i '/\/etc\/init.d\/mwan3helper start/d' /etc/firewall.user
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger "mwan3helper"
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,171 @@
1.51.0.0/16
1.184.0.0/15
42.244.0.0/14
43.252.48.0/22
49.52.0.0/14
49.120.0.0/14
49.140.0.0/15
49.208.0.0/15
58.154.0.0/15
58.192.0.0/15
58.194.0.0/15
58.196.0.0/15
58.198.0.0/15
58.200.0.0/13
59.64.0.0/14
59.68.0.0/14
59.72.0.0/15
59.74.0.0/15
59.76.0.0/16
59.77.0.0/16
59.78.0.0/15
101.4.0.0/14
101.76.0.0/15
103.81.200.0/22
103.87.20.0/22
103.115.120.0/22
103.137.60.0/24
103.165.110.0/23
103.205.162.0/24
103.226.80.0/22
110.64.0.0/15
111.114.0.0/15
111.116.0.0/15
111.186.0.0/15
113.54.0.0/15
114.212.0.0/15
114.214.0.0/16
115.24.0.0/14
115.154.0.0/15
115.156.0.0/15
115.158.0.0/16
116.13.0.0/16
116.56.0.0/15
118.202.0.0/15
118.228.0.0/15
118.230.0.0/16
120.94.0.0/16
120.95.0.0/16
121.48.0.0/15
121.52.160.0/19
121.192.0.0/16
121.193.0.0/16
121.194.0.0/15
121.248.0.0/14
122.204.0.0/14
125.216.0.0/15
125.218.0.0/16
125.219.0.0/16
125.220.0.0/15
125.222.0.0/15
175.185.0.0/16
175.186.0.0/15
180.84.0.0/15
180.201.0.0/16
180.208.0.0/15
183.168.0.0/15
183.170.0.0/16
183.172.0.0/14
192.124.154.0/24
202.4.128.0/19
202.38.2.0/23
202.38.64.0/19
202.38.96.0/19
202.38.140.0/23
202.38.146.0/23
202.38.184.0/21
202.38.192.0/18
202.112.0.0/16
202.113.0.0/20
202.113.16.0/20
202.113.32.0/19
202.113.64.0/18
202.113.128.0/18
202.113.192.0/19
202.113.224.0/20
202.113.240.0/20
202.114.0.0/19
202.114.32.0/19
202.114.64.0/18
202.114.128.0/17
202.115.0.0/19
202.115.128.0/17
202.116.0.0/19
202.116.32.0/20
202.116.48.0/20
202.116.64.0/19
202.116.96.0/19
202.116.128.0/17
202.117.0.0/18
202.117.64.0/18
202.117.128.0/17
202.118.0.0/19
202.118.32.0/19
202.118.64.0/18
202.118.128.0/17
202.119.0.0/19
202.119.32.0/19
202.119.64.0/20
202.119.80.0/20
202.119.96.0/19
202.119.128.0/17
202.120.0.0/18
202.120.64.0/18
202.120.128.0/17
202.121.0.0/16
202.127.216.0/21
202.127.224.0/19
202.179.240.0/20
202.192.0.0/13
202.200.0.0/14
202.204.0.0/14
203.91.120.0/21
210.25.0.0/16
210.26.0.0/15
210.28.0.0/14
210.32.0.0/14
210.36.0.0/14
210.40.0.0/13
211.64.0.0/14
211.68.0.0/15
211.70.0.0/15
211.80.0.0/16
211.81.0.0/16
211.82.0.0/16
211.83.0.0/16
211.84.0.0/15
211.86.0.0/15
218.192.0.0/16
218.193.0.0/16
218.194.0.0/16
218.195.0.0/16
218.196.0.0/14
219.216.0.0/15
219.218.0.0/15
219.220.0.0/16
219.221.0.0/16
219.222.0.0/15
219.224.0.0/15
219.226.0.0/16
219.227.0.0/16
219.228.0.0/15
219.230.0.0/15
219.242.0.0/15
219.244.0.0/14
222.16.0.0/15
222.18.0.0/15
222.20.0.0/15
222.22.0.0/16
222.23.0.0/16
222.24.0.0/15
222.26.0.0/15
222.28.0.0/14
222.192.0.0/14
222.196.0.0/15
222.198.0.0/16
222.199.0.0/16
222.200.0.0/14
222.204.0.0/15
222.206.0.0/15
223.2.0.0/15
223.128.0.0/15

View File

@@ -0,0 +1,55 @@
36.128.0.0/10
39.128.0.0/10
43.239.172.0/22
43.251.244.0/22
45.121.68.0/22
45.121.72.0/22
45.121.172.0/22
45.121.176.0/22
45.122.96.0/21
45.123.152.0/22
45.124.36.0/22
45.125.24.0/22
45.253.72.0/22
61.14.240.0/22
61.14.244.0/22
103.20.112.0/22
103.21.176.0/22
103.35.104.0/22
103.61.156.0/22
103.61.160.0/22
103.62.24.0/22
103.62.204.0/22
103.62.208.0/22
103.192.0.0/22
103.192.144.0/22
103.193.140.0/22
103.203.164.0/22
103.205.108.0/22
103.205.116.0/22
103.222.196.0/22
111.0.0.0/10
112.0.0.0/10
117.128.0.0/10
120.192.0.0/10
175.176.188.0/22
183.192.0.0/10
211.103.0.0/17
211.136.0.0/14
211.140.0.0/15
211.142.0.0/17
211.142.128.0/17
211.143.0.0/16
218.200.0.0/14
218.204.0.0/15
218.206.0.0/15
221.130.0.0/15
221.176.0.0/13
223.64.0.0/11
223.96.0.0/12
223.112.0.0/14
223.116.0.0/15
223.120.128.0/17
223.121.128.0/17
223.123.128.0/17
223.124.0.0/14

View File

@@ -0,0 +1,16 @@
36.192.0.0/11
43.247.240.0/22
61.232.0.0/14
61.236.0.0/15
101.144.0.0/12
103.3.128.0/22
110.96.0.0/11
110.192.0.0/11
115.180.0.0/15
118.204.0.0/14
120.90.0.0/15
122.64.0.0/11
123.64.0.0/11
211.98.0.0/16
221.172.0.0/14
222.32.0.0/11

View File

@@ -0,0 +1,7 @@
ipset -N $1 hash:net 2>/dev/null
echo "create $1 hash:net family inet hashsize 1024 maxelem 65536" > /tmp/mwan3.ipset
cat $2 | sed -e "s/^/add $1 /" >> /tmp/mwan3.ipset
ipset -! flush $1
ipset -! restore < /tmp/mwan3.ipset 2>/dev/null
rm -f /tmp/mwan3.ipset

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,290 @@
1.94.0.0/15
14.1.24.0/22
14.103.0.0/16
14.196.0.0/15
42.196.0.0/14
43.242.56.0/22
43.242.144.0/22
43.243.144.0/22
43.243.148.0/22
43.247.200.0/22
43.247.204.0/22
43.247.208.0/22
43.247.224.0/22
43.250.16.0/22
43.250.20.0/22
45.121.240.0/22
45.121.244.0/22
45.121.248.0/22
45.121.252.0/22
45.122.4.0/22
45.122.8.0/22
45.122.12.0/22
45.122.16.0/22
45.122.20.0/22
45.122.24.0/22
45.122.28.0/22
45.122.32.0/22
45.122.36.0/22
45.122.40.0/22
45.122.192.0/22
45.122.196.0/22
45.122.200.0/22
45.122.204.0/22
45.122.208.0/22
45.122.212.0/22
45.122.216.0/22
45.123.28.0/22
45.123.32.0/22
45.123.36.0/22
45.123.76.0/22
45.123.80.0/22
45.123.84.0/22
45.123.88.0/22
45.123.204.0/22
45.123.212.0/22
45.123.224.0/22
45.123.228.0/22
45.123.232.0/22
45.123.236.0/22
45.123.240.0/22
45.123.244.0/22
45.123.248.0/22
45.123.252.0/22
45.124.0.0/22
45.124.100.0/22
45.252.152.0/22
45.252.200.0/22
45.252.204.0/22
45.252.208.0/22
45.252.212.0/22
45.252.216.0/22
45.252.220.0/22
45.252.224.0/22
45.253.0.0/22
45.253.4.0/22
45.253.8.0/22
45.253.12.0/22
45.253.16.0/22
45.253.20.0/22
45.253.28.0/22
45.253.36.0/22
45.253.40.0/22
45.253.56.0/22
45.253.76.0/22
45.253.80.0/22
45.253.84.0/22
45.253.92.0/22
45.254.28.0/22
45.254.56.0/22
45.254.96.0/22
45.254.132.0/22
45.254.152.0/22
45.254.180.0/22
45.254.200.0/22
45.254.204.0/22
45.254.208.0/22
45.254.212.0/22
45.254.216.0/22
45.254.220.0/22
45.254.224.0/22
45.254.228.0/22
49.220.0.0/14
59.152.16.0/22
59.152.20.0/22
59.152.24.0/22
59.152.28.0/22
59.152.64.0/22
59.152.68.0/22
59.152.72.0/22
59.152.76.0/22
59.152.112.0/22
59.152.116.0/22
60.194.0.0/15
60.206.0.0/15
61.14.212.0/22
61.14.216.0/22
61.14.220.0/22
101.38.0.0/15
101.40.0.0/15
101.104.0.0/14
101.130.0.0/15
103.23.56.0/22
103.24.184.0/22
103.38.0.0/22
103.38.228.0/22
103.38.232.0/22
103.41.148.0/22
103.41.152.0/22
103.62.72.0/22
103.62.76.0/22
103.62.80.0/22
103.62.84.0/22
103.62.96.0/22
103.62.100.0/22
103.62.104.0/22
103.62.108.0/22
103.62.112.0/22
103.62.116.0/22
103.62.120.0/22
103.62.124.0/22
103.62.128.0/22
103.62.132.0/22
103.63.64.0/22
103.63.68.0/22
103.63.72.0/22
103.63.76.0/22
103.63.80.0/22
103.63.84.0/22
103.63.88.0/22
103.63.140.0/22
103.63.144.0/22
103.63.152.0/22
103.63.196.0/22
103.63.200.0/22
103.63.204.0/22
103.63.208.0/22
103.192.48.0/22
103.192.52.0/22
103.192.56.0/22
103.192.84.0/22
103.192.88.0/22
103.192.92.0/22
103.192.96.0/22
103.192.100.0/22
103.192.104.0/22
103.192.108.0/22
103.192.112.0/22
103.192.216.0/22
103.202.152.0/22
103.202.156.0/22
103.202.160.0/22
103.202.164.0/22
103.202.168.0/22
103.202.172.0/22
103.202.176.0/22
103.202.180.0/22
103.202.184.0/22
103.202.188.0/22
103.202.192.0/22
103.202.196.0/22
103.202.200.0/21
103.202.228.0/22
103.202.236.0/22
103.202.240.0/22
103.202.244.0/22
103.202.248.0/22
103.202.252.0/22
103.203.0.0/22
103.203.4.0/22
103.203.8.0/22
103.203.12.0/22
103.203.16.0/22
103.203.20.0/22
103.203.24.0/22
103.203.28.0/22
103.203.32.0/22
103.203.104.0/22
103.203.108.0/22
103.203.112.0/22
103.203.116.0/22
103.203.120.0/22
103.203.124.0/22
103.203.128.0/22
103.204.88.0/22
103.204.112.0/22
103.204.148.0/22
103.204.152.0/22
103.221.88.0/22
103.221.132.0/22
103.221.156.0/22
103.221.180.0/22
103.221.184.0/22
103.221.188.0/22
103.221.192.0/22
103.221.196.0/22
103.222.0.0/22
103.222.4.0/22
103.222.8.0/22
103.222.12.0/22
103.222.16.0/22
103.222.24.0/22
103.222.28.0/22
103.222.36.0/22
103.222.44.0/22
103.222.48.0/22
103.222.56.0/22
103.222.60.0/22
103.222.64.0/22
103.222.68.0/22
103.222.72.0/22
103.222.76.0/22
103.222.80.0/22
103.222.84.0/22
103.222.88.0/22
103.222.92.0/22
103.222.96.0/22
103.222.100.0/22
103.222.104.0/22
103.222.108.0/22
103.222.200.0/22
103.222.204.0/22
103.222.208.0/22
103.222.212.0/22
103.238.20.0/22
103.238.24.0/22
103.238.40.0/22
115.31.72.0/22
115.31.76.0/22
115.47.0.0/16
115.182.0.0/16
115.183.0.0/16
115.187.0.0/22
115.187.4.0/22
115.187.8.0/22
115.187.12.0/22
115.190.0.0/15
116.199.128.0/19
117.58.0.0/17
117.120.64.0/18
118.28.0.0/15
124.14.0.0/15
124.192.0.0/15
124.200.0.0/13
124.254.0.0/18
175.188.0.0/14
180.88.0.0/14
180.235.112.0/22
202.4.252.0/22
202.160.156.0/22
202.168.136.0/22
202.168.140.0/22
203.78.156.0/22
203.82.112.0/22
203.82.116.0/22
203.82.120.0/22
203.82.124.0/22
203.82.224.0/22
203.82.228.0/22
203.82.232.0/22
203.82.236.0/22
203.86.64.0/20
203.114.80.0/22
203.114.84.0/22
203.114.88.0/22
203.114.92.0/22
203.207.92.0/22
203.207.112.0/20
203.207.192.0/21
203.207.208.0/20
211.101.0.0/18
211.103.128.0/17
211.164.0.0/14
218.249.0.0/16
219.90.68.0/22
219.90.72.0/22
219.90.76.0/22
219.238.0.0/15
220.112.0.0/14
223.208.0.0/14
223.255.0.0/17

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,887 @@
1.24.0.0/13
1.56.0.0/13
1.188.0.0/14
14.204.0.0/15
27.0.128.0/22
27.8.0.0/13
27.36.0.0/14
27.40.0.0/13
27.50.128.0/17
27.54.192.0/18
27.98.224.0/19
27.112.0.0/18
27.115.0.0/17
27.192.0.0/11
36.32.0.0/14
36.248.0.0/14
39.64.0.0/11
42.4.0.0/14
42.48.0.0/15
42.51.0.0/16
42.52.0.0/14
42.56.0.0/14
42.63.0.0/16
42.84.0.0/14
42.176.0.0/13
42.224.0.0/12
43.224.12.0/22
43.224.24.0/22
43.224.52.0/22
43.224.56.0/22
43.224.80.0/22
43.224.160.0/22
43.224.208.0/22
43.225.120.0/22
43.226.80.0/22
43.226.84.0/22
43.226.88.0/22
43.226.92.0/22
43.226.96.0/22
43.226.100.0/22
43.226.104.0/22
43.226.108.0/22
43.226.116.0/22
43.226.120.0/22
43.226.160.0/22
43.226.164.0/22
43.226.236.0/22
43.227.104.0/22
43.229.168.0/22
43.229.172.0/22
43.229.176.0/22
43.229.180.0/22
43.229.236.0/22
43.239.120.0/22
43.240.0.0/22
43.240.72.0/22
43.240.132.0/22
43.240.204.0/22
43.240.216.0/22
43.241.48.0/22
43.241.92.0/22
43.241.184.0/22
43.242.64.0/22
43.242.148.0/22
43.242.152.0/22
43.242.156.0/22
43.242.164.0/22
43.242.180.0/22
43.243.4.0/22
43.243.16.0/22
43.243.88.0/22
43.243.128.0/22
43.243.156.0/22
43.243.180.0/22
43.243.228.0/22
43.246.112.0/22
43.246.228.0/22
43.247.88.0/22
43.247.92.0/22
43.247.100.0/22
43.247.212.0/22
43.247.216.0/22
43.248.4.0/22
43.248.20.0/22
43.248.48.0/22
43.248.80.0/22
43.248.84.0/22
43.248.88.0/22
43.248.92.0/22
43.248.108.0/22
43.248.148.0/22
43.248.176.0/22
43.248.180.0/22
43.248.184.0/22
43.248.188.0/22
43.248.192.0/22
43.248.196.0/22
43.248.200.0/22
43.248.204.0/22
43.248.244.0/22
43.249.4.0/22
43.249.136.0/22
43.249.192.0/22
43.249.236.0/22
43.250.4.0/22
43.250.96.0/22
43.250.112.0/22
43.250.128.0/22
43.250.144.0/22
43.250.168.0/22
43.250.200.0/22
43.250.212.0/22
43.250.244.0/22
43.251.4.0/22
43.251.36.0/22
43.251.232.0/22
43.254.44.0/22
43.254.100.0/22
43.254.104.0/22
43.254.116.0/22
43.254.136.0/22
43.254.144.0/22
43.254.148.0/22
43.254.220.0/22
43.255.84.0/22
43.255.204.0/22
43.255.244.0/22
45.112.228.0/22
45.112.232.0/22
45.113.24.0/22
45.113.28.0/22
45.113.200.0/22
45.113.240.0/22
45.113.252.0/22
45.115.144.0/22
45.115.156.0/22
45.115.164.0/22
45.115.200.0/22
45.115.248.0/22
45.117.8.0/22
45.117.124.0/22
45.119.64.0/22
45.119.68.0/22
45.120.100.0/22
45.121.52.0/22
45.123.156.0/22
45.124.20.0/22
45.124.68.0/22
45.124.80.0/22
45.125.44.0/22
45.126.108.0/22
45.248.8.0/22
45.248.96.0/22
45.249.112.0/22
45.250.28.0/22
45.250.32.0/22
45.250.36.0/22
45.250.40.0/22
45.251.16.0/22
45.251.84.0/22
45.251.88.0/22
45.252.104.0/22
45.253.24.0/22
45.253.32.0/22
45.253.64.0/22
58.16.0.0/16
58.17.0.0/17
58.17.128.0/17
58.18.0.0/16
58.19.0.0/16
58.20.0.0/16
58.21.0.0/16
58.22.0.0/15
58.144.0.0/16
58.240.0.0/15
58.242.0.0/15
58.244.0.0/15
58.246.0.0/15
58.248.0.0/13
59.80.0.0/15
60.0.0.0/13
60.8.0.0/15
60.10.0.0/16
60.11.0.0/16
60.12.0.0/16
60.13.0.0/18
60.13.64.0/18
60.13.128.0/17
60.14.0.0/15
60.16.0.0/13
60.24.0.0/14
60.28.0.0/15
60.30.0.0/16
60.31.0.0/16
60.208.0.0/13
60.216.0.0/15
60.218.0.0/15
60.220.0.0/14
60.255.0.0/16
61.45.128.0/18
61.48.0.0/14
61.52.0.0/15
61.54.0.0/16
61.55.0.0/16
61.133.0.0/17
61.134.96.0/19
61.134.128.0/18
61.134.192.0/18
61.135.0.0/16
61.136.0.0/18
61.136.64.0/18
61.137.128.0/17
61.138.0.0/18
61.138.64.0/18
61.138.128.0/18
61.139.128.0/18
61.148.0.0/15
61.156.0.0/16
61.158.0.0/17
61.158.128.0/17
61.159.0.0/18
61.161.0.0/18
61.161.128.0/17
61.162.0.0/16
61.163.0.0/16
61.167.0.0/16
61.168.0.0/16
61.176.0.0/16
61.179.0.0/16
61.180.128.0/17
61.181.0.0/16
61.182.0.0/16
61.189.0.0/17
61.240.0.0/14
101.16.0.0/12
101.64.0.0/13
101.72.0.0/14
101.204.0.0/14
101.232.0.0/15
103.3.96.0/22
103.3.100.0/22
103.3.104.0/22
103.3.108.0/22
103.3.112.0/22
103.3.116.0/22
103.3.120.0/22
103.3.124.0/22
103.3.132.0/22
103.3.136.0/22
103.3.140.0/22
103.3.148.0/22
103.3.152.0/22
103.3.156.0/22
103.5.56.0/22
103.5.168.0/22
103.5.252.0/22
103.7.212.0/22
103.8.32.0/22
103.9.248.0/22
103.9.252.0/22
103.14.84.0/22
103.18.224.0/22
103.22.188.0/22
103.25.40.0/22
103.27.4.0/22
103.27.240.0/22
103.28.204.0/22
103.31.200.0/22
103.35.220.0/22
103.36.208.0/22
103.37.44.0/22
103.37.100.0/22
103.38.32.0/22
103.38.40.0/22
103.39.88.0/22
103.40.12.0/22
103.40.192.0/22
103.40.212.0/22
103.43.100.0/22
103.43.192.0/22
103.44.80.0/22
103.45.72.0/22
103.45.76.0/22
103.45.160.0/22
103.45.168.0/22
103.45.224.0/22
103.48.216.0/22
103.48.220.0/22
103.48.224.0/22
103.48.228.0/22
103.48.232.0/22
103.52.96.0/22
103.52.100.0/22
103.52.176.0/22
103.52.184.0/22
103.53.124.0/22
103.53.204.0/22
103.55.172.0/22
103.55.204.0/22
103.55.208.0/22
103.55.228.0/22
103.56.32.0/22
103.56.60.0/22
103.57.196.0/22
103.59.116.0/22
103.59.124.0/22
103.60.164.0/22
103.67.192.0/22
103.68.128.0/22
103.70.148.0/22
103.72.224.0/22
103.72.228.0/22
103.72.232.0/22
103.72.236.0/22
103.72.240.0/22
103.72.244.0/22
103.72.248.0/22
103.72.252.0/22
103.73.0.0/22
103.73.4.0/22
103.73.8.0/22
103.73.12.0/22
103.73.16.0/22
103.73.20.0/22
103.73.24.0/22
103.73.28.0/22
103.73.144.0/22
103.78.64.0/22
103.79.228.0/23
103.85.84.0/22
103.90.92.0/22
103.90.188.0/22
103.91.108.0/22
103.91.176.0/22
103.91.208.0/22
103.91.252.0/22
103.92.0.0/22
103.92.4.0/22
103.92.8.0/22
103.92.12.0/22
103.92.48.0/22
103.92.132.0/22
103.93.180.0/22
103.95.220.0/22
103.97.8.0/22
103.97.16.0/20
103.97.72.0/22
103.98.44.0/22
103.98.168.0/22
103.98.220.0/22
103.107.44.0/22
103.107.188.0/22
103.107.212.0/22
103.108.244.0/22
103.110.132.0/22
103.110.156.0/22
103.117.188.0/22
103.120.224.0/22
103.123.56.0/22
103.141.242.0/23
103.142.128.0/23
103.158.8.0/23
103.166.138.0/23
103.192.4.0/22
103.192.132.0/22
103.192.188.0/22
103.192.212.0/22
103.197.0.0/22
103.203.168.0/22
103.204.72.0/22
103.204.136.0/22
103.205.4.0/22
103.205.192.0/22
103.205.252.0/22
103.207.184.0/22
103.207.228.0/22
103.207.232.0/22
103.210.184.0/22
103.211.44.0/22
103.211.96.0/22
103.211.220.0/22
103.213.96.0/22
103.213.132.0/22
103.214.48.0/22
103.215.36.0/22
103.216.152.0/22
103.216.240.0/22
103.219.24.0/22
103.219.28.0/22
103.219.32.0/22
103.219.36.0/22
103.220.48.0/22
103.220.52.0/22
103.221.140.0/22
103.222.32.0/22
103.222.40.0/22
103.222.164.0/22
103.222.172.0/22
103.223.140.0/22
103.223.188.0/22
103.224.228.0/22
103.224.232.0/22
103.227.120.0/22
103.227.136.0/22
103.228.204.0/22
103.229.148.0/22
103.229.212.0/22
103.230.196.0/22
103.230.236.0/22
103.233.228.0/22
103.234.56.0/22
103.234.244.0/22
103.236.120.0/22
103.236.240.0/22
103.238.28.0/22
103.238.32.0/22
103.238.144.0/22
103.238.160.0/22
103.239.152.0/22
103.239.224.0/22
103.239.244.0/22
103.240.36.0/22
103.240.72.0/22
103.240.84.0/22
103.240.124.0/22
103.240.172.0/22
103.243.136.0/22
103.246.8.0/22
103.246.152.0/22
103.248.100.0/22
103.250.32.0/22
103.250.104.0/22
103.250.124.0/22
103.250.180.0/22
103.250.192.0/22
103.250.216.0/22
103.250.248.0/22
103.251.32.0/22
103.251.96.0/22
103.251.124.0/22
103.251.160.0/22
103.251.240.0/22
103.252.204.0/22
103.252.208.0/22
103.252.232.0/22
103.252.248.0/22
103.253.60.0/22
103.255.88.0/22
103.255.200.0/22
106.48.0.0/15
106.74.0.0/16
110.6.0.0/15
110.16.0.0/14
110.44.12.0/22
110.52.0.0/15
110.72.0.0/15
110.228.0.0/14
110.236.0.0/15
110.240.0.0/12
111.85.0.0/16
111.160.0.0/13
111.192.0.0/12
111.223.12.0/22
112.64.0.0/15
112.80.0.0/13
112.88.0.0/13
112.96.0.0/15
112.109.128.0/17
112.111.0.0/16
112.122.0.0/15
112.132.0.0/16
112.192.0.0/14
112.224.0.0/11
113.0.0.0/13
113.8.0.0/15
113.18.0.0/16
113.56.0.0/15
113.58.0.0/16
113.59.0.0/17
113.194.0.0/15
113.200.0.0/15
113.204.0.0/14
113.213.0.0/17
113.224.0.0/12
114.54.0.0/15
114.119.0.0/17
114.119.224.0/19
114.240.0.0/12
115.46.0.0/16
115.48.0.0/12
115.85.192.0/18
115.172.0.0/14
116.2.0.0/15
116.60.0.0/14
116.78.0.0/15
116.95.0.0/16
116.112.0.0/14
116.116.0.0/15
116.128.0.0/10
116.194.0.0/15
116.199.0.0/17
116.214.32.0/19
116.216.0.0/14
116.242.0.0/15
116.244.0.0/15
116.255.128.0/17
117.8.0.0/13
117.74.64.0/20
117.121.128.0/18
118.26.48.0/21
118.72.0.0/13
118.80.0.0/15
118.88.32.0/19
118.88.64.0/18
118.88.128.0/17
118.103.168.0/22
118.144.0.0/14
118.212.0.0/16
118.224.0.0/14
118.244.0.0/14
119.4.0.0/14
119.27.64.0/18
119.32.0.0/14
119.36.0.0/16
119.37.0.0/17
119.37.128.0/18
119.38.0.0/17
119.39.0.0/16
119.40.128.0/17
119.42.0.0/19
119.42.224.0/19
119.44.0.0/15
119.48.0.0/13
119.59.128.0/17
119.62.0.0/16
119.108.0.0/15
119.112.0.0/13
119.148.160.0/20
119.162.0.0/15
119.164.0.0/14
119.176.0.0/12
119.233.128.0/17
119.248.0.0/14
119.252.240.0/20
120.0.0.0/12
120.52.0.0/16
120.72.32.0/19
120.80.0.0/13
120.128.0.0/14
121.16.0.0/13
121.24.0.0/14
121.28.0.0/15
121.30.0.0/16
121.31.0.0/16
121.52.224.0/19
121.55.0.0/18
121.100.128.0/17
121.201.0.0/16
122.13.0.0/16
122.96.0.0/15
122.102.64.0/20
122.136.0.0/13
122.156.0.0/14
122.188.0.0/14
122.192.0.0/14
123.4.0.0/14
123.8.0.0/13
123.58.240.0/20
123.98.0.0/17
123.112.0.0/12
123.128.0.0/13
123.138.0.0/15
123.144.0.0/14
123.148.0.0/16
123.152.0.0/13
123.176.80.0/20
123.188.0.0/14
123.196.0.0/15
123.232.0.0/14
124.6.64.0/18
124.20.0.0/16
124.21.0.0/20
124.21.16.0/20
124.21.32.0/19
124.21.64.0/18
124.21.128.0/17
124.42.128.0/17
124.64.0.0/15
124.66.0.0/17
124.67.0.0/16
124.68.0.0/15
124.88.0.0/16
124.89.0.0/17
124.89.128.0/17
124.90.0.0/15
124.92.0.0/14
124.128.0.0/13
124.152.0.0/16
124.160.0.0/16
124.161.0.0/16
124.162.0.0/16
124.163.0.0/16
124.164.0.0/14
124.240.128.0/18
125.32.0.0/16
125.33.0.0/16
125.34.0.0/16
125.35.0.0/17
125.35.128.0/17
125.36.0.0/14
125.40.0.0/13
125.211.0.0/16
125.214.96.0/19
139.170.0.0/16
139.208.0.0/13
139.226.0.0/15
140.206.0.0/15
144.48.64.0/22
146.196.56.0/22
146.196.68.0/22
150.129.136.0/22
150.242.8.0/22
150.242.152.0/22
150.242.232.0/22
150.255.0.0/16
153.0.0.0/16
153.3.0.0/16
153.34.0.0/15
153.36.0.0/15
153.99.0.0/16
153.101.0.0/16
157.0.0.0/16
157.18.0.0/16
157.61.0.0/16
157.122.0.0/16
157.148.0.0/16
157.156.0.0/16
157.255.0.0/16
160.19.212.0/22
160.202.60.0/22
160.202.148.0/22
160.202.152.0/22
160.202.212.0/22
163.0.0.0/16
163.53.48.0/22
163.53.52.0/22
163.53.168.0/22
163.125.0.0/16
163.142.0.0/16
163.177.0.0/16
163.179.0.0/16
163.204.0.0/16
171.34.0.0/15
171.36.0.0/14
171.116.0.0/14
171.120.0.0/13
175.16.0.0/13
175.42.0.0/15
175.44.0.0/16
175.106.128.0/17
175.146.0.0/15
175.148.0.0/14
175.152.0.0/14
175.160.0.0/12
175.184.128.0/18
180.77.0.0/16
180.95.128.0/17
180.129.128.0/17
180.130.0.0/16
180.188.0.0/17
180.189.148.0/22
182.54.0.0/17
182.88.0.0/14
182.112.0.0/12
182.174.0.0/15
183.92.0.0/14
183.184.0.0/13
192.140.208.0/22
192.140.212.0/22
202.74.8.0/21
202.75.208.0/20
202.89.96.0/22
202.96.0.0/18
202.96.64.0/21
202.96.72.0/21
202.96.80.0/20
202.97.128.0/18
202.97.192.0/19
202.97.224.0/21
202.97.232.0/21
202.97.240.0/20
202.98.0.0/21
202.98.8.0/21
202.98.16.0/20
202.99.0.0/18
202.99.64.0/19
202.99.96.0/21
202.99.104.0/21
202.99.112.0/20
202.99.128.0/19
202.99.160.0/21
202.99.168.0/21
202.99.176.0/20
202.99.192.0/21
202.99.200.0/21
202.99.208.0/20
202.99.224.0/21
202.99.232.0/21
202.99.240.0/20
202.101.128.0/18
202.102.128.0/21
202.102.136.0/21
202.102.144.0/20
202.102.160.0/19
202.102.224.0/21
202.102.232.0/21
202.102.240.0/20
202.106.0.0/16
202.107.0.0/17
202.108.0.0/16
202.110.0.0/18
202.110.64.0/18
202.110.192.0/18
202.111.128.0/19
202.111.160.0/19
202.127.112.0/20
202.130.224.0/19
202.160.140.0/22
202.170.128.0/19
203.76.240.0/22
203.93.0.0/22
203.93.4.0/22
203.93.8.0/24
203.93.9.0/24
203.93.10.0/23
203.93.12.0/22
203.93.16.0/20
203.93.32.0/19
203.93.64.0/18
203.93.128.0/21
203.93.136.0/22
203.93.140.0/24
203.93.141.0/24
203.93.142.0/23
203.93.144.0/20
203.93.160.0/19
203.93.192.0/18
203.166.160.0/19
210.5.128.0/20
210.12.0.0/18
210.12.64.0/18
210.12.128.0/18
210.12.192.0/18
210.13.0.0/18
210.13.64.0/18
210.13.128.0/17
210.14.160.0/19
210.14.192.0/19
210.14.224.0/19
210.15.0.0/19
210.15.32.0/19
210.15.64.0/19
210.15.96.0/19
210.15.128.0/18
210.21.0.0/17
210.21.128.0/17
210.22.0.0/16
210.51.0.0/16
210.52.0.0/18
210.52.64.0/18
210.52.128.0/17
210.53.0.0/17
210.53.128.0/17
210.74.64.0/19
210.74.96.0/19
210.74.128.0/19
210.78.0.0/19
210.78.160.0/19
210.78.192.0/18
210.79.64.0/18
210.82.0.0/15
211.90.0.0/15
211.92.0.0/15
211.94.0.0/15
211.96.0.0/15
211.144.0.0/15
211.158.0.0/15
218.7.0.0/16
218.8.0.0/15
218.10.0.0/16
218.11.0.0/16
218.12.0.0/16
218.21.128.0/17
218.24.0.0/15
218.26.0.0/16
218.27.0.0/16
218.28.0.0/15
218.56.0.0/14
218.60.0.0/15
218.62.0.0/17
218.67.128.0/17
218.68.0.0/15
218.98.0.0/17
218.104.0.0/17
218.104.128.0/19
218.104.160.0/19
218.104.192.0/21
218.104.200.0/21
218.104.208.0/20
218.104.224.0/19
218.105.0.0/16
218.106.0.0/15
219.154.0.0/15
219.156.0.0/15
219.158.0.0/17
219.158.128.0/17
219.159.0.0/18
219.232.0.0/14
220.152.128.0/17
220.158.240.0/22
220.192.0.0/15
220.194.0.0/15
220.196.0.0/14
220.200.0.0/13
220.231.0.0/18
220.248.0.0/14
220.252.0.0/16
221.0.0.0/15
221.2.0.0/16
221.3.0.0/17
221.3.128.0/17
221.4.0.0/16
221.5.0.0/17
221.5.128.0/17
221.6.0.0/16
221.7.0.0/19
221.7.32.0/19
221.7.64.0/19
221.7.96.0/19
221.7.128.0/17
221.8.0.0/15
221.10.0.0/16
221.11.0.0/17
221.11.128.0/18
221.11.192.0/19
221.11.224.0/19
221.12.0.0/17
221.12.128.0/18
221.13.0.0/18
221.13.64.0/19
221.13.96.0/19
221.13.128.0/17
221.14.0.0/15
221.192.0.0/15
221.194.0.0/16
221.195.0.0/16
221.196.0.0/15
221.198.0.0/16
221.199.0.0/19
221.199.32.0/20
221.199.48.0/20
221.199.64.0/18
221.199.128.0/18
221.199.192.0/20
221.199.224.0/19
221.200.0.0/14
221.204.0.0/15
221.206.0.0/16
221.207.0.0/18
221.207.64.0/18
221.207.128.0/17
221.208.0.0/14
221.212.0.0/16
221.213.0.0/16
221.214.0.0/15
221.216.0.0/13
222.128.0.0/14
222.132.0.0/14
222.136.0.0/13
222.160.0.0/15
222.162.0.0/16
222.163.0.0/19
222.163.32.0/19
222.163.64.0/18
222.163.128.0/17
223.27.184.0/22
223.166.0.0/15

View File

@@ -0,0 +1,11 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@mwan3helper[-1]
add ucitrack mwan3helper
set ucitrack.@mwan3helper[-1].init=mwan3helper
commit ucitrack
EOF
rm -f /tmp/luci*
exit 0

View File

@@ -0,0 +1,11 @@
{
"luci-app-mwan3helper": {
"description": "Grant UCI access for luci-app-mwan3helper",
"read": {
"uci": [ "mwan3helper" ]
},
"write": {
"uci": [ "mwan3helper" ]
}
}
}

View File

@@ -0,0 +1,16 @@
# SPDX-Identifier-License: GPL-3.0-only
#
# Copyright (C) 2018 Lean <coolsnowwolf@gmail.com>
# Copyright (C) 2019-2022 ImmortalWrt.org
include $(TOPDIR)/rules.mk
PKG_LICENSE:=GPL-3.0-only
LUCI_TITLE:=LuCI support for MTK HNAT
LUCI_DEPENDS:=+kmod-tcp-bbr @!PACKAGE_luci-app-turboacc
LUCI_PKGARCH:=all
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@@ -0,0 +1,258 @@
/* Copyright (C) 2022 ImmortalWrt.org */
'use strict';
'require form';
'require fs';
'require poll';
'require rpc';
'require uci';
'require view';
var getSystemFeatures = rpc.declare({
object: 'luci.turboacc',
method: 'getSystemFeatures',
expect: { '': {} }
});
var getFastPathStat = rpc.declare({
object: 'luci.turboacc',
method: 'getFastPathStat',
expect: { '': {} }
});
var getFullConeStat = rpc.declare({
object: 'luci.turboacc',
method: 'getFullConeStat',
expect: { '': {} }
});
var getTCPCCAStat = rpc.declare({
object: 'luci.turboacc',
method: 'getTCPCCAStat',
expect: { '': {} }
});
var getMTKPPEStat = rpc.declare({
object: 'luci.turboacc',
method: 'getMTKPPEStat',
expect: { '': {} }
});
function getServiceStatus() {
return Promise.all([
L.resolveDefault(getFastPathStat(), {}),
L.resolveDefault(getFullConeStat(), {}),
L.resolveDefault(getTCPCCAStat(), {})
]);
}
function getMTKPPEStatus() {
return Promise.all([
L.resolveDefault(getMTKPPEStat(), {})
]);
}
function progressbar(value, max, byte) {
var vn = parseInt(value) || 0,
mn = parseInt(max) || 100,
fv = byte ? String.format('%1024.2mB', value) : value,
fm = byte ? String.format('%1024.2mB', max) : max,
pc = Math.floor((100 / mn) * vn);
return E('div', {
'class': 'cbi-progressbar',
'title': '%s / %s (%d%%)'.format(fv, fm, pc)
}, E('div', { 'style': 'width:%.2f%%'.format(pc) }));
}
function renderStatus(stats) {
var spanTemp = '<em><span style="color:%s"><strong>%s</strong></span></em>';
var renderHTML = [];
for (var stat of stats)
if (stat.type) {
if (stat.type.includes(' / ')) {
var types = stat.type.split(' / ');
var inner = spanTemp.format('green', types[0]);
for (var i of types.slice(1))
inner += spanTemp.format('none', ' / ') + spanTemp.format('red', i);
renderHTML.push(inner);
} else
renderHTML.push(spanTemp.format('green', stat.type));
} else
renderHTML.push(spanTemp.format('red', _('Disabled')));
return renderHTML;
}
return view.extend({
load: function() {
return Promise.all([
uci.load('turboacc'),
L.resolveDefault(getSystemFeatures(), {}),
L.resolveDefault(getMTKPPEStat(), {})
]);
},
render: function(data) {
var m, s, o;
var features = data[1];
var ppe_stats = data[2];
m = new form.Map('turboacc', _('TurboACC settings'),
_('Open source flow offloading engine (fast path or hardware NAT).'));
s = m.section(form.TypedSection);
s.anonymous = true;
s.render = function () {
poll.add(function () {
return L.resolveDefault(getServiceStatus()).then(function (res) {
var stats = renderStatus(res);
var tds = [ 'fastpath_state', 'fullcone_state', 'tcpcca_state' ];
for (var i in tds) {
var view = document.getElementById(tds[i]);
view.innerHTML = stats[i];
}
});
});
var acc_status = E('table', { 'class': 'table', 'width': '100%', 'cellspacing': '10' }, [
E('tr', {}, [
E('td', { 'width': '33%' }, _('FastPath Engine')),
E('td', { 'id': 'fastpath_state' }, E('em', {}, _('Collecting data...')))
]),
E('tr', {}, [
E('td', { 'width': '33%' }, _('Full Cone NAT')),
E('td', { 'id': 'fullcone_state' }, E('em', {}, _('Collecting data...')))
]),
E('tr', {}, [
E('td', { 'width': '33%' }, _('TCP CCA')),
E('td', { 'id': 'tcpcca_state' }, E('em', {}, _('Collecting data...')))
])
]);
if (ppe_stats.hasOwnProperty('PPE_NUM')) {
poll.add(function () {
return L.resolveDefault(getMTKPPEStatus()).then(function (res) {
var ppe_num = parseInt(res[0].PPE_NUM);
for (var i=0; i<ppe_num; i++) {
var ppe_bar = document.getElementById(`ppe${i}_entry`);
ppe_bar.innerHTML = E('td', {},
progressbar(res[0][`BIND_PPE${i}`], res[0][`ALL_PPE${i}`])).innerHTML;
}
});
}, 3);
var ppe_num = parseInt(ppe_stats.PPE_NUM);
for (var i=0; i<ppe_num; i++) {
acc_status.appendChild(E('tr', {}, [
E('td', { 'width': '33%' }, `PPE${i} ` + _('Bind Entrys')),
E('td', {'id': `ppe${i}_entry` },
progressbar(ppe_stats[`BIND_PPE${i}`], ppe_stats[`ALL_PPE${i}`]))
]));
}
}
return E('fieldset', { 'class': 'cbi-section' }, [
E('legend', {}, _('Acceleration Status')),
acc_status
]);
}
s = m.section(form.NamedSection, 'config', 'turboacc');
o = s.option(form.ListValue, 'fastpath', _('Fastpath engine'),
_('The offloading engine for routing/NAT.'));
o.value('disabled', _('Disable'));
if (features.hasFLOWOFFLOADING)
o.value('flow_offloading', _('Flow offloading'));
if (features.hasFASTCLASSIFIER)
o.value('fast_classifier', _('Fast classifier'));
if (features.hasSHORTCUTFECM)
o.value('shortcut_fe_cm', _('SFE connection manager'));
if (features.hasMEDIATEKHNAT)
o.value('mediatek_hnat', _('MediaTek HNAT'));
o.default = 'disabled';
o.rmempty = false;
o.onchange = function(ev, section_id, value) {
var desc = ev.target.nextElementSibling;
if (value === 'flow_offloading')
desc.innerHTML = _('Software based offloading for routing/NAT.');
else if (value === 'fast_classifier')
desc.innerHTML = _('Fast classifier connection manager for the shortcut forwarding engine.');
else if (value === 'shortcut_fe_cm')
desc.innerHTML = _('Simple connection manager for the shortcut forwarding engine.');
else if (value === 'mediatek_hnat')
desc.innerHTML = _('MediaTek\'s open source hardware offloading engine.');
else
desc.innerHTML = _('The offloading engine for routing/NAT.');
}
o = s.option(form.Flag, 'fastpath_fo_hw', _('Hardware flow offloading'),
_('Requires hardware NAT support. Implemented at least for mt7621.'));
o.default = o.disabled;
o.rmempty = false;
o.depends('fastpath', 'flow_offloading');
o = s.option(form.Flag, 'fastpath_fc_br', _('Bridge Acceleration'),
_('Enable bridge acceleration (may be functional conflict with bridge-mode VPN server).'));
o.default = o.disabled;
o.rmempty = false;
o.depends('fastpath', 'fast_classifier');
if (features.hasIPV6) {
o = s.option(form.Flag, 'fastpath_fc_ipv6', _('IPv6 acceleration'),
_('Enable IPv6 Acceleration.'));
o.default = o.disabled;
o.rmempty = false;
o.depends('fastpath', 'fast_classifier');
}
o = s.option(form.Flag, 'fastpath_mh_eth_hnat', _('Enable ethernet HNAT'),
_('Enable hardware offloading for wired connections.'));
o.default = o.enabled;
o.rmempty = false;
o.depends('fastpath', 'mediatek_hnat');
o = s.option(form.Flag, 'fastpath_mh_eth_hnat_v6', _('Enable ethernet IPv6 HNAT'),
_('Enable hardware offloading for wired IPv6 connections.'));
o.default = o.enabled;
o.rmempty = false;
o.depends('fastpath_mh_eth_hnat', '1');
o = s.option(form.Value, 'fastpath_mh_eth_hnat_ap', _('Enable AP Mode'),
_('Fill in ip to enable AP Mode(reboot needed)'));
o.optional = true;
o.depends('fastpath_mh_eth_hnat', '1');
o = s.option(form.Value, 'fastpath_mh_eth_hnat_bind_rate', _('HNAT bind rate threshold (pps)'),
_('The smaller the threshold, the easier it is for the connection to be accelerated.'));
o.optional = true;
o.datatype = 'range(1,30)';
o.placeholder = 30;
o.depends('fastpath_mh_eth_hnat', '1');
o = s.option(form.ListValue, 'fastpath_mh_eth_hnat_ppenum', _('Number of HNAT PPE'),
_('Apply this setting after reboot.'));
o.rmempty = false;
o.value(1);
o.value(2);
o.default = 2;
o.depends('fastpath_mh_eth_hnat', '1');
o = s.option(form.ListValue, 'fullcone', _('Full cone NAT'),
_('Full cone NAT (NAT1) can improve gaming performance effectively.'));
o.value('0', _('Disable'))
o.value('2', _('Boardcom_FULLCONE_NAT'));
o.default = '0';
o.rmempty = false;
o = s.option(form.ListValue, 'tcpcca', _('TCP CCA'),
_('TCP congestion control algorithm.'));
for (var i of features.hasTCPCCA.split(' ').sort())
o.value(i);
o.default = 'cubic';
o.rmempty = false;
return m.render();
}
});

View File

@@ -0,0 +1,185 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:91
msgid "Acceleration Status"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:191
msgid "Boardcom_FULLCONE_NAT"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:151
msgid "Bridge Acceleration"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:95
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:99
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:103
msgid "Collecting data..."
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:120
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:188
msgid "Disable"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:57
msgid "Disabled"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:159
msgid "Enable IPv6 Acceleration."
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:177
msgid "Enable AP Mode"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:178
msgid "Fill in ip to enable AP Mode(reboot needed)"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:183
msgid "HNAT bind rate threshold (pps)"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:184
msgid "The smaller the threshold, the easier it is for the connection to be accelerated."
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:152
msgid ""
"Enable bridge acceleration (may be functional conflict with bridge-mode VPN "
"server)."
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:165
msgid "Enable ethernet HNAT"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:171
msgid "Enable ethernet IPv6 HNAT"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:172
msgid "Enable hardware offloading for wired IPv6 connections."
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:166
msgid "Enable hardware offloading for wired connections."
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:178
msgid "Enable hardware offloading for wireless connections."
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:177
msgid "Enable wireless HNAT"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:124
msgid "Fast classifier"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:136
msgid "Fast classifier connection manager for the shortcut forwarding engine."
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:94
msgid "FastPath Engine"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:118
msgid "Fastpath engine"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:122
msgid "Flow offloading"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:98
msgid "Full Cone NAT"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:186
msgid "Full cone NAT"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:187
msgid "Full cone NAT (NAT1) can improve gaming performance effectively."
msgstr ""
#: applications/luci-app-turboacc/root/usr/share/rpcd/acl.d/luci-app-turboacc.json:3
msgid "Grant UCI access for luci-app-turboacc"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:145
msgid "Hardware flow offloading"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:158
msgid "IPv6 acceleration"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:128
msgid "MediaTek HNAT"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:140
msgid "MediaTek's open source hardware offloading engine."
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:74
msgid "Open source flow offloading engine (fast path or hardware NAT)."
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:179
msgid "Redirect to wireless settings"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:146
msgid "Requires hardware NAT support. Implemented at least for mt7621."
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:126
msgid "SFE connection manager"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:138
msgid "Simple connection manager for the shortcut forwarding engine."
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:134
msgid "Software based offloading for routing/NAT."
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:102
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:195
msgid "TCP CCA"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:196
msgid "TCP congestion control algorithm."
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:119
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:142
msgid "The offloading engine for routing/NAT."
msgstr ""
#: applications/luci-app-turboacc/root/usr/share/luci/menu.d/luci-app-turboacc.json:3
msgid "TurboACC"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:73
msgid "TurboACC settings"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:190
msgid "XT_FULLCONE_NAT"
msgstr ""
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:191
msgid "Boardcom_FULLCONE_NAT"
msgstr ""

View File

@@ -0,0 +1,200 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: zh-Hans\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:91
msgid "Acceleration Status"
msgstr "加速状态"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:191
msgid "Boardcom_FULLCONE_NAT"
msgstr "Boardcom_FULLCONE_NAT(更低的CPU占用)"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:151
msgid "Bridge Acceleration"
msgstr "桥接加速"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:95
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:99
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:103
msgid "Collecting data..."
msgstr "正在收集数据…"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:120
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:188
msgid "Disable"
msgstr "禁用"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:57
msgid "Disabled"
msgstr "已禁用"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:159
msgid "Enable IPv6 Acceleration."
msgstr "启用 IPv6 加速。"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:152
msgid ""
"Enable bridge acceleration (may be functional conflict with bridge-mode VPN "
"server)."
msgstr "启用桥接加速(可能会与桥接模式的 VPN 服务器冲突)。"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:165
msgid "Enable ethernet HNAT"
msgstr "启用以太网 HNAT"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:171
msgid "Enable ethernet IPv6 HNAT"
msgstr "启用以太网 IPv6 HNAT"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:172
msgid "Enable hardware offloading for wired IPv6 connections."
msgstr "为有线 IPv6 连接启用硬件加速。"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:177
msgid "Enable AP Mode"
msgstr "启用AP模式"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:178
msgid "Fill in ip to enable AP Mode(reboot needed)"
msgstr "填写IP将启动AP模式同网段不重复ip,需重启后生效.对于无线桥接请桥接完成后再启用AP模式)"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:183
msgid "HNAT bind rate threshold (pps)"
msgstr "HNAT连接速率绑定阈值(pps)"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:184
msgid "The smaller the threshold, the easier it is for the connection to be accelerated."
msgstr "阈值越小,连接越容易被加速。"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:166
msgid "Enable hardware offloading for wired connections."
msgstr "为有线连接启用硬件加速。"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:178
msgid "Enable hardware offloading for wireless connections."
msgstr "为无线连接启用硬件加速。"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:177
msgid "Enable wireless HNAT"
msgstr "启用无线 HNAT"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:124
msgid "Fast classifier"
msgstr "Fast classifier"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:136
msgid "Fast classifier connection manager for the shortcut forwarding engine."
msgstr "快速转发引擎SFE的 fast classifier 连接管理器。"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:94
msgid "FastPath Engine"
msgstr "快速转发引擎"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:118
msgid "Fastpath engine"
msgstr "快速转发引擎"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:122
msgid "Flow offloading"
msgstr "Flow offloading"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:98
msgid "Full Cone NAT"
msgstr "全锥形 NAT"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:186
msgid "Full cone NAT"
msgstr "全锥形 NAT"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:187
msgid "Full cone NAT (NAT1) can improve gaming performance effectively."
msgstr "Full cone NATNAT1可以有效提升游戏体验。"
#: applications/luci-app-turboacc/root/usr/share/rpcd/acl.d/luci-app-turboacc.json:3
msgid "Grant UCI access for luci-app-turboacc"
msgstr "授予 luci-app-turboacc 访问 UCI 配置的权限。"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:145
msgid "Hardware flow offloading"
msgstr "硬件流量分载"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:158
msgid "IPv6 acceleration"
msgstr "IPv6 加速"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:128
msgid "MediaTek HNAT"
msgstr "MediaTek HNAT"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:140
msgid "MediaTek's open source hardware offloading engine."
msgstr "由联发科实现的开源硬件流量分载引擎。"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:74
msgid "Open source flow offloading engine (fast path or hardware NAT)."
msgstr "开源流量分载引擎(快速转发或硬件 NAT。"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:179
msgid "Redirect to wireless settings"
msgstr "跳转到无线设置"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:146
msgid "Requires hardware NAT support. Implemented at least for mt7621."
msgstr "需要硬件 NAT 支持。目前 mt7621 已实现。"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:126
msgid "SFE connection manager"
msgstr "SFE connection manager"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:138
msgid "Simple connection manager for the shortcut forwarding engine."
msgstr "快速转发引擎SFE的简单连接管理器。"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:134
msgid "Software based offloading for routing/NAT."
msgstr "基于软件的 路由/NAT 分载。"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:102
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:195
msgid "TCP CCA"
msgstr "TCP 拥塞控制算法"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:196
msgid "TCP congestion control algorithm."
msgstr "TCP 拥塞控制算法。"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:119
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:142
msgid "The offloading engine for routing/NAT."
msgstr "用于 路由/NAT 的分载引擎。"
#: applications/luci-app-turboacc/root/usr/share/luci/menu.d/luci-app-turboacc.json:3
msgid "TurboACC"
msgstr "网络加速"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:73
msgid "TurboACC settings"
msgstr "网络加速设置"
#: applications/luci-app-turboacc/htdocs/luci-static/resources/view/turboacc.js:190
msgid "XT_FULLCONE_NAT"
msgstr "XT_FULLCONE_NAT(更佳的兼容性)"
msgid "Apply this setting after reboot."
msgstr "重启后应用此项设置。"
msgid "Number of HNAT PPE"
msgstr "HNAT PPE数量"
msgid "Bind Entrys"
msgstr "已绑定连接数"

View File

@@ -0,0 +1,2 @@
config turboacc 'config'

View File

@@ -0,0 +1,127 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2018 Lean <coolsnowwolf@gmail.com>
# Copyright (C) 2019-2022 Tianling Shen <cnsztl@immortalwrt.org>
START=90
STOP=10
USE_PROCD=1
start_service() {
config_load "turboacc"
local fastpath
config_get fastpath "config" "fastpath"
if [ "$fastpath" != "fast_classifier" ] && lsmod | grep -q "fast_classifier"; then
echo "0" > "/sys/fast_classifier/skip_to_bridge_ingress" 2>"/dev/null"
rm -f "/dev/sfe_ipv6"
rmmod "fast_classifier" 2>"/dev/null"
fi
if [ "$fastpath" != "shortcut_fe_cm" ] && lsmod | grep -q "shortcut_fe_cm"; then
rmmod "shortcut_fe_cm" 2>"/dev/null"
fi
if [ "$fastpath" != "mediatek_hnat" ] && lsmod | grep -q "mtkhnat"; then
echo "0" > "/sys/kernel/debug/hnat/hook_toggle" 2>"/dev/null"
fi
case "$fastpath" in
"fast_classifier")
local fastpath_fc_br fastpath_fc_ipv6
config_get_bool fastpath_fc_br "config" "fastpath_fc_br" "0"
config_get_bool fastpath_fc_ipv6 "config" "fastpath_fc_ipv6" "0"
lsmod | grep -q "fast_classifier" || modprobe "fast_classifier" 2>"/dev/null"
echo "$fastpath_fc_br" > "/sys/fast_classifier/skip_to_bridge_ingress" 2>"/dev/null"
if [ "$fastpath_fc_ipv6" -eq "1" ]; then
[ -e "/dev/sfe_ipv6" ] || mknod "/dev/sfe_ipv6" "c" "$(cat "/sys/sfe_ipv6/debug_dev")" "0"
else
[ ! -e "/dev/sfe_ipv6" ] || rm -f "/dev/sfe_ipv6"
fi
;;
"shortcut_fe_cm")
lsmod |grep -q "shortcut_fe_cm" || modprobe "shortcut_fe_cm" 2>"/dev/null"
;;
"mediatek_hnat")
local fastpath_mh_eth_hnat
local hnat_path="/sys/kernel/debug/hnat"
config_get_bool "fastpath_mh_eth_hnat" "config" "fastpath_mh_eth_hnat" "1"
echo "$fastpath_mh_eth_hnat" > "$hnat_path/hook_toggle"
if [ "$fastpath_mh_eth_hnat" -eq "1" ]; then
local fastpath_mh_eth_hnat_v6 fastpath_mh_eth_hnat_ap fastpath_mh_eth_hnat_bind_rate
config_get_bool "fastpath_mh_eth_hnat_v6" "config" "fastpath_mh_eth_hnat_v6" "1"
echo "8 $fastpath_mh_eth_hnat_v6" > "$hnat_path/hnat_setting"
config_get "fastpath_mh_eth_hnat_bind_rate" "config" "fastpath_mh_eth_hnat_bind_rate" "30"
echo "11 $fastpath_mh_eth_hnat_bind_rate" > "$hnat_path/hnat_setting"
config_get "fastpath_mh_eth_hnat_ap" "config" "fastpath_mh_eth_hnat_ap" ""
fi
;;
esac
local fullcone
config_get "fullcone" "config" "fullcone" "2"
echo "$fullcone" > /proc/sys/net/netfilter/nf_conntrack_nat_mode
local tcpcca
config_get "tcpcca" "config" "tcpcca" "cubic"
sysctl -w net.ipv4.tcp_congestion_control="$tcpcca" >"/dev/null"
uci -q commit "firewall"
/etc/init.d/firewall restart >"/dev/null" 2>&1
available_interfaces=""
for iface in eth0 eth1 wan; do
if ifconfig $iface 2>&1 | grep -qv "error fetching interface information"; then
echo "$iface interface detected."
available_interfaces="$available_interfaces $iface"
else
echo "$iface interface not found."
fi
done
if echo "$fastpath_mh_eth_hnat_ap" | grep -qE '^([0-9]{1,3}\.){3}[0-9]{1,3}$'; then
echo "Valid IPv4 address detected: $fastpath_mh_eth_hnat_ap"
uci delete network.wan
uci delete network.wwan
uci delete network.wan6
current_ports=$(uci get network.@device[0].ports)
echo "Current bridge ports: $current_ports"
new_ports="$current_ports"
for port in $available_interfaces; do
if echo "$current_ports" | grep -qw "$port"; then
echo "Port $port is already part of the bridge"
else
echo "Adding port $port to the bridge"
new_ports="$new_ports $port"
fi
done
uci set network.@device[0].ports="$new_ports"
uci set dhcp.lan.ignore=1
uci set network.lan.ipaddr="$fastpath_mh_eth_hnat_ap"
uci set wireless.wifinet1.network='lan'
uci set wireless.wifinet2.network='lan'
echo "Committing changes"
uci commit
else
echo "Invalid IPv4 address: $fastpath_mh_eth_hnat_ap"
fi
}
reload_service() {
start
}
stop_service() {
stop
}
service_triggers() {
procd_add_reload_trigger "turboacc"
}

View File

@@ -0,0 +1,37 @@
#!/bin/sh
kernel_ver="$(uname -r)"
if [ -e "/lib/modules/$kernel_ver/mtkhnat.ko" ]; then
uci -q set "turboacc.config.fastpath"="mediatek_hnat"
uci -q set "turboacc.config.fastpath_mh_eth_hnat"="1"
uci -q set "turboacc.config.fastpath_mh_eth_hnat_v6"="1"
uci -q set "turboacc.config.fastpath_mh_eth_hnat_macvlan"="0"
uci -q set "turboacc.config.fastpath_mh_eth_hnat_bind_rate"="30"
uci -q set "turboacc.config.fastpath_mh_eth_hnat_ppenum"="2"
elif [ -e "/lib/modules/$kernel_ver/fast-classifier.ko" ]; then
uci -q set "turboacc.config.fastpath"="fast_classifier"
uci -q set "turboacc.config.fastpath_fc_br"="1"
if [ -d "/proc/sys/net/ipv6" ]; then
uci -q set "turboacc.config.fastpath_fc_ipv6"="1"
else
uci -q set "turboacc.config.fastpath_fc_ipv6"="0"
fi
elif [ -e "/lib/modules/$kernel_ver/shortcut-fe-cm.ko" ]; then
uci -q set "turboacc.config.fastpath"="shortcut_fe_cm"
else
uci -q set "turboacc.config.fastpath"="none"
fi
uci -q set "turboacc.config.fullcone"="1"
uci -q commit "turboacc"
uci -q batch <<-EOF >"/dev/null"
delete ucitrack.@turboacc[-1]
add ucitrack turboacc
EOF
rm -f /tmp/luci-indexcache
exit 0

View File

@@ -0,0 +1,155 @@
#!/usr/bin/env lua
-- Copyright (C) 2022 ImmortalWrt.org
local json = require "luci.jsonc"
local fs = require "nixio.fs"
local util = require "luci.util"
local sys = require "luci.sys"
string.trim = util.trim
local function readfile(path)
local s = fs.readfile(path)
return s and (s:gsub("^%s+", ""):gsub("%s+$", ""))
end
local methods = {
getSystemFeatures = {
call = function()
local boardinfo = util.ubus("system", "board") or {}
local features = {
hasIPV6 = fs.access("/proc/net/ipv6_route"),
-- disable FLOWOFFLOADING for mt798x
hasFLOWOFFLOADING = false,
hasFASTCLASSIFIER = fs.access("/lib/modules/" .. boardinfo.kernel .. "/fast-classifier.ko"),
hasSHORTCUTFECM = fs.access("/lib/modules/" .. boardinfo.kernel .. "/shortcut-fe-cm.ko"),
hasMEDIATEKHNAT = fs.access("/lib/modules/" .. boardinfo.kernel .. "/mtkhnat.ko"),
hasXTFULLCONENAT = fs.access("/lib/modules/" .. boardinfo.kernel .. "/xt_FULLCONENAT.ko"),
hasTCPCCA = readfile("/proc/sys/net/ipv4/tcp_available_congestion_control")
}
print(json.stringify(features))
end
},
getFastPathStat = {
call = function()
local fptype
if fs.access("/sys/module/xt_FLOWOFFLOAD/refcnt") and
(readfile("/sys/module/xt_FLOWOFFLOAD/refcnt") or "0") ~= "0" then
fptype = "Flow offloading"
elseif fs.stat("/sys/module/fast_classifier", "type") == "dir" then
fptype = "Fast classifier"
elseif fs.stat("/sys/module/shortcut_fe_cm", "type") == "dir" then
fptype = "Shortcut-FE CM"
elseif fs.stat("/sys/kernel/debug/hnat", "type") == "dir" then
local ethernet_hnat = readfile("/sys/kernel/debug/hnat/hook_toggle")
ethernet_hnat = (ethernet_hnat ~= "enabled") and " / Ethernet HNAT Disabled" or ""
local wireless_hnat = (sys.call("grep -q 'WHNAT=1' '/etc/wireless/mediatek/'*_card*.dat") ~= 0) and " / Wireless HNAT Disabled" or ""
if (ethernet_hnat == "") or (wireless_hnat == "") then
fptype = "MediaTek HNAT" .. ethernet_hnat .. wireless_hnat
end
end
print(json.stringify({ type = fptype }))
end
},
getFullConeStat = {
call = function()
local fctype
if fs.access("/sys/module/xt_FULLCONENAT/refcnt") and
(readfile("/sys/module/xt_FULLCONENAT/refcnt") or "0") ~= "0" then
fctype = "xt_FULLCONENAT"
elseif fs.access("/proc/sys/net/netfilter/nf_conntrack_nat_mode") and
(readfile("/proc/sys/net/netfilter/nf_conntrack_nat_mode") or "0") ~= "0" then
fctype = "Boardcom Fullcone"
end
print(json.stringify({ type = fctype }))
end
},
getTCPCCAStat = {
call = function()
local ccatype = readfile("/proc/sys/net/ipv4/tcp_congestion_control")
ccatype = ccatype and ccatype:upper() or nil
print(json.stringify({ type = ccatype }))
end
},
getMTKPPEStat = {
call = function()
local ppe_stat = {}
local ppe_path = "/sys/kernel/debug/hnat/hnat_stats"
local fd = io.open(ppe_path, 'r')
if fd then
for line in fd:lines() do
local i = string.find(line, "=")
if i then
ppe_stat[string.sub(line,1,i-1)] = string.sub(line,i+1)
end
end
fd:close()
end
print(json.stringify(ppe_stat))
end
}
}
local function parseInput()
local parse = json.new()
local done, err
while true do
local chunk = io.read(4096)
if not chunk then
break
elseif not done and not err then
done, err = parse:parse(chunk)
end
end
if not done then
print(json.stringify({ error = err or "Incomplete input" }))
os.exit(1)
end
return parse:get()
end
local function validateArgs(func, uargs)
local method = methods[func]
if not method then
print(json.stringify({ error = "Method not found" }))
os.exit(1)
end
if type(uargs) ~= "table" then
print(json.stringify({ error = "Invalid arguments" }))
os.exit(1)
end
uargs.ubus_rpc_session = nil
local k, v
local margs = method.args or {}
for k, v in pairs(uargs) do
if margs[k] == nil or
(v ~= nil and type(v) ~= type(margs[k]))
then
print(json.stringify({ error = "Invalid arguments" }))
os.exit(1)
end
end
return method
end
if arg[1] == "list" then
local _, method, rv = nil, nil, {}
for _, method in pairs(methods) do rv[_] = method.args or {} end
print((json.stringify(rv):gsub(":%[%]", ":{}")))
elseif arg[1] == "call" then
local args = parseInput()
local method = validateArgs(arg[2], args)
local result, code = method.call(args)
print((json.stringify(result):gsub("^%[%]$", "{}")))
os.exit(code or 0)
end

View File

@@ -0,0 +1,13 @@
{
"admin/network/turboacc": {
"title": "TurboACC",
"action": {
"type": "view",
"path": "turboacc"
},
"depends": {
"acl": [ "luci-app-turboacc" ],
"uci": { "turboacc": true }
}
}
}

View File

@@ -0,0 +1,14 @@
{
"luci-app-turboacc": {
"description": "Grant UCI access for luci-app-turboacc",
"read": {
"ubus": {
"luci.turboacc": [ "getSystemFeatures", "getFastPathStat", "getFullConeStat", "getTCPCCAStat", "getMTKPPEStat" ]
},
"uci": [ "turboacc" ]
},
"write": {
"uci": [ "turboacc" ]
}
}
}

View File

@@ -0,0 +1,14 @@
#
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=Universal Plug & Play configuration module
LUCI_DEPENDS:=+miniupnpd-mtk-adjust +rpcd-mod-ucode
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@@ -0,0 +1,74 @@
'use strict';
'require baseclass';
'require dom';
'require rpc';
'require uci';
var callUpnpGetStatus, callUpnpDeleteRule, handleDelRule;
callUpnpGetStatus = rpc.declare({
object: 'luci.upnp',
method: 'get_status',
expect: { }
});
callUpnpDeleteRule = rpc.declare({
object: 'luci.upnp',
method: 'delete_rule',
params: [ 'token' ],
expect: { result : "OK" },
});
handleDelRule = function(num, ev) {
dom.parent(ev.currentTarget, '.tr').style.opacity = 0.5;
ev.currentTarget.classList.add('spinning');
ev.currentTarget.disabled = true;
ev.currentTarget.blur();
callUpnpDeleteRule(num);
};
return baseclass.extend({
title: _('Active UPnP Redirects'),
load: function() {
return Promise.all([
callUpnpGetStatus(),
]);
},
render: function(data) {
var table = E('table', { 'class': 'table', 'id': 'upnp_status_table' }, [
E('tr', { 'class': 'tr table-titles' }, [
E('th', { 'class': 'th' }, _('Protocol')),
E('th', { 'class': 'th' }, _('External Port')),
E('th', { 'class': 'th' }, _('Client Address')),
E('th', { 'class': 'th' }, _('Host')),
E('th', { 'class': 'th' }, _('Client Port')),
E('th', { 'class': 'th' }, _('Description')),
E('th', { 'class': 'th cbi-section-actions' }, '')
])
]);
var rules = Array.isArray(data[0].rules) ? data[0].rules : [];
var rows = rules.map(function(rule) {
return [
rule.proto,
rule.extport,
rule.intaddr,
rule.host_hint || _('Unknown'),
rule.intport,
rule.descr,
E('button', {
'class': 'btn cbi-button-remove',
'click': L.bind(handleDelRule, this, rule.num)
}, [ _('Delete') ])
];
});
cbi_update_table(table, rows, E('em', _('There are no active redirects.')));
return table;
}
});

View File

@@ -0,0 +1,215 @@
'use strict';
'require view';
'require dom';
'require poll';
'require uci';
'require rpc';
'require form';
var callInitAction, callUpnpGetStatus, callUpnpDeleteRule, handleDelRule;
callInitAction = rpc.declare({
object: 'luci',
method: 'setInitAction',
params: [ 'name', 'action' ],
expect: { result: false }
});
callUpnpGetStatus = rpc.declare({
object: 'luci.upnp',
method: 'get_status',
expect: { }
});
callUpnpDeleteRule = rpc.declare({
object: 'luci.upnp',
method: 'delete_rule',
params: [ 'token' ],
expect: { result : "OK" },
});
handleDelRule = function(num, ev) {
dom.parent(ev.currentTarget, '.tr').style.opacity = 0.5;
ev.currentTarget.classList.add('spinning');
ev.currentTarget.disabled = true;
ev.currentTarget.blur();
callUpnpDeleteRule(num);
};
return view.extend({
load: function() {
return Promise.all([
callUpnpGetStatus(),
uci.load('upnpd')
]);
},
poll_status: function(nodes, data) {
var rules = Array.isArray(data[0].rules) ? data[0].rules : [];
var rows = rules.map(function(rule) {
return [
rule.proto,
rule.extport,
rule.intaddr,
rule.host_hint || _('Unknown'),
rule.intport,
rule.descr,
E('button', {
'class': 'btn cbi-button-remove',
'click': L.bind(handleDelRule, this, rule.num)
}, [ _('Delete') ])
];
});
cbi_update_table(nodes.querySelector('#upnp_status_table'), rows, E('em', _('There are no active redirects.')));
return;
},
render: function(data) {
var m, s, o;
m = new form.Map('upnpd', [_('Universal Plug & Play')],
_('UPnP allows clients in the local network to automatically configure the router.'));
s = m.section(form.GridSection, '_active_rules');
s.render = L.bind(function(view, section_id) {
var table = E('table', { 'class': 'table cbi-section-table', 'id': 'upnp_status_table' }, [
E('tr', { 'class': 'tr table-titles' }, [
E('th', { 'class': 'th' }, _('Protocol')),
E('th', { 'class': 'th' }, _('External Port')),
E('th', { 'class': 'th' }, _('Client Address')),
E('th', { 'class': 'th' }, _('Host')),
E('th', { 'class': 'th' }, _('Client Port')),
E('th', { 'class': 'th' }, _('Description')),
E('th', { 'class': 'th cbi-section-actions' }, '')
])
]);
var rules = Array.isArray(data[0].rules) ? data[0].rules : [];
var rows = rules.map(function(rule) {
return [
rule.proto,
rule.extport,
rule.intaddr,
rule.host_hint || _('Unknown'),
rule.intport,
rule.descr,
E('button', {
'class': 'btn cbi-button-remove',
'click': L.bind(handleDelRule, this, rule.num)
}, [ _('Delete') ])
];
});
cbi_update_table(table, rows, E('em', _('There are no active redirects.')));
return E('div', { 'class': 'cbi-section cbi-tblsection' }, [
E('h3', _('Active UPnP Redirects')), table ]);
}, o, this);
s = m.section(form.NamedSection, 'config', 'upnpd', _('MiniUPnP settings'));
s.addremove = false;
s.tab('general', _('General Settings'));
s.tab('advanced', _('Advanced Settings'));
o = s.taboption('general', form.Flag, 'enabled', _('Start UPnP and NAT-PMP service'));
o.rmempty = false;
s.taboption('general', form.Flag, 'enable_upnp', _('Enable UPnP functionality')).default = '1'
s.taboption('general', form.Flag, 'enable_natpmp', _('Enable NAT-PMP functionality')).default = '1'
s.taboption('general', form.Flag, 'secure_mode', _('Enable secure mode'),
_('Allow adding forwards only to requesting ip addresses')).default = '1'
s.taboption('general', form.Flag, 'igdv1', _('Enable IGDv1 mode'),
_('Advertise as IGDv1 device instead of IGDv2')).default = '0'
s.taboption('general', form.Flag, 'log_output', _('Enable additional logging'),
_('Puts extra debugging information into the system log'))
s.taboption('general', form.Value, 'download', _('Downlink'),
_('Value in KByte/s, informational only')).rmempty = true
s.taboption('general', form.Value, 'upload', _('Uplink'),
_('Value in KByte/s, informational only')).rmempty = true
o = s.taboption('general', form.Value, 'port', _('Port'))
o.datatype = 'port'
o.default = 5000
s.taboption('advanced', form.Flag, 'system_uptime', _('Report system instead of daemon uptime')).default = '1'
s.taboption('advanced', form.Value, 'uuid', _('Device UUID'))
s.taboption('advanced', form.Value, 'serial_number', _('Announced serial number'))
s.taboption('advanced', form.Value, 'model_number', _('Announced model number'))
o = s.taboption('advanced', form.Value, 'notify_interval', _('Notify interval'))
o.datatype = 'uinteger'
o.placeholder = 30
o = s.taboption('advanced', form.Value, 'clean_ruleset_threshold', _('Clean rules threshold'))
o.datatype = 'uinteger'
o.placeholder = 20
o = s.taboption('advanced', form.Value, 'clean_ruleset_interval', _('Clean rules interval'))
o.datatype = 'uinteger'
o.placeholder = 600
o = s.taboption('advanced', form.Value, 'presentation_url', _('Presentation URL'))
o.placeholder = 'http://192.168.1.1/'
o = s.taboption('advanced', form.Value, 'upnp_lease_file', _('UPnP lease file'))
o.placeholder = '/var/run/miniupnpd.leases'
s.taboption('advanced', form.Flag, 'use_stun', _('Use STUN'))
o = s.taboption('advanced', form.Value, 'stun_host', _('STUN Host'))
o.depends('use_stun', '1');
o.datatype = 'host'
o = s.taboption('advanced', form.Value, 'stun_port', _('STUN Port'))
o.depends('use_stun', '1');
o.datatype = 'port'
o.placeholder = '0-65535'
s = m.section(form.GridSection, 'perm_rule', _('MiniUPnP ACLs'),
_('ACLs specify which external ports may be redirected to which internal addresses and ports'))
s.sortable = true
s.anonymous = true
s.addremove = true
s.option(form.Value, 'comment', _('Comment'))
o = s.option(form.Value, 'ext_ports', _('External ports'))
o.datatype = 'portrange'
o.placeholder = '0-65535'
o = s.option(form.Value, 'int_addr', _('Internal addresses'))
o.datatype = 'ip4addr'
o.placeholder = '0.0.0.0/0'
o = s.option(form.Value, 'int_ports', _('Internal ports'))
o.datatype = 'portrange'
o.placeholder = '0-65535'
o = s.option(form.ListValue, 'action', _('Action'))
o.value('allow', _('Allow'));
o.value('deny', _('Deny'));
return m.render().then(L.bind(function(m, nodes) {
poll.add(L.bind(function() {
return Promise.all([
callUpnpGetStatus()
]).then(L.bind(this.poll_status, this, nodes));
}, this), 5);
return nodes;
}, this, m));
}
});

View File

@@ -0,0 +1,238 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-19 19:36+0200\n"
"PO-Revision-Date: 2024-07-16 16:41+0000\n"
"Last-Translator: Rex_sa <rex.sa@pm.me>\n"
"Language-Team: Arabic <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsupnp/ar/>\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n"
"X-Generator: Weblate 5.7-dev\n"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:182
msgid ""
"ACLs specify which external ports may be redirected to which internal "
"addresses and ports"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:202
msgid "Action"
msgstr "إجراء"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:31
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:113
msgid "Active UPnP Redirects"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:119
msgid "Advanced Settings"
msgstr "إعدادات متقدمة"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:131
msgid "Advertise as IGDv1 device instead of IGDv2"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:203
msgid "Allow"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:128
msgid "Allow adding forwards only to requesting ip addresses"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:150
msgid "Announced model number"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:149
msgid "Announced serial number"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:160
msgid "Clean rules interval"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:156
msgid "Clean rules threshold"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:45
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:85
msgid "Client Address"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:47
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:87
msgid "Client Port"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:188
msgid "Comment"
msgstr "تعليق"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:66
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:62
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:106
msgid "Delete"
msgstr "احدف"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:204
msgid "Deny"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:48
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:88
msgid "Description"
msgstr "الوصف"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:148
msgid "Device UUID"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:136
msgid "Downlink"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:130
msgid "Enable IGDv1 mode"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:125
msgid "Enable NAT-PMP functionality"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:124
msgid "Enable UPnP functionality"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:133
msgid "Enable additional logging"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:127
msgid "Enable secure mode"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:44
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:84
msgid "External Port"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:190
msgid "External ports"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:118
msgid "General Settings"
msgstr "الاعدادات العامة"
#: applications/luci-app-upnp/root/usr/share/rpcd/acl.d/luci-app-upnp.json:3
msgid "Grant access to upnp procedures"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:46
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:86
msgid "Host"
msgstr "ضيف"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:194
msgid "Internal addresses"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:198
msgid "Internal ports"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:181
msgid "MiniUPnP ACLs"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:116
msgid "MiniUPnP settings"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:152
msgid "Notify interval"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:142
msgid "Port"
msgstr "المنفذ"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:164
msgid "Presentation URL"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:43
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:83
msgid "Protocol"
msgstr "البروتوكول"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:134
msgid "Puts extra debugging information into the system log"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:146
msgid "Report system instead of daemon uptime"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:172
msgid "STUN Host"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:176
msgid "STUN Port"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:121
msgid "Start UPnP and NAT-PMP service"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:70
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:66
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:110
msgid "There are no active redirects."
msgstr ""
#: applications/luci-app-upnp/root/usr/share/luci/menu.d/luci-app-upnp.json:3
msgid "UPnP"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:76
msgid ""
"UPnP allows clients in the local network to automatically configure the "
"router."
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:167
msgid "UPnP lease file"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:75
msgid "Universal Plug & Play"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:60
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:56
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:100
msgid "Unknown"
msgstr "مجهول"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:139
msgid "Uplink"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:170
msgid "Use STUN"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:137
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:140
msgid "Value in KByte/s, informational only"
msgstr ""

View File

@@ -0,0 +1,237 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-19 19:36+0200\n"
"PO-Revision-Date: 2024-02-28 14:29+0000\n"
"Last-Translator: Boyan Alexiev <nneauu@gmail.com>\n"
"Language-Team: Bulgarian <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsupnp/bg/>\n"
"Language: bg\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.5-dev\n"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:182
msgid ""
"ACLs specify which external ports may be redirected to which internal "
"addresses and ports"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:202
msgid "Action"
msgstr "Действие"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:31
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:113
msgid "Active UPnP Redirects"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:119
msgid "Advanced Settings"
msgstr "Разширени настройки"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:131
msgid "Advertise as IGDv1 device instead of IGDv2"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:203
msgid "Allow"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:128
msgid "Allow adding forwards only to requesting ip addresses"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:150
msgid "Announced model number"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:149
msgid "Announced serial number"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:160
msgid "Clean rules interval"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:156
msgid "Clean rules threshold"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:45
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:85
msgid "Client Address"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:47
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:87
msgid "Client Port"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:188
msgid "Comment"
msgstr "Коментар"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:66
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:62
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:106
msgid "Delete"
msgstr "Изтрий"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:204
msgid "Deny"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:48
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:88
msgid "Description"
msgstr "Описание"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:148
msgid "Device UUID"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:136
msgid "Downlink"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:130
msgid "Enable IGDv1 mode"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:125
msgid "Enable NAT-PMP functionality"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:124
msgid "Enable UPnP functionality"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:133
msgid "Enable additional logging"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:127
msgid "Enable secure mode"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:44
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:84
msgid "External Port"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:190
msgid "External ports"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:118
msgid "General Settings"
msgstr "Общи настройки"
#: applications/luci-app-upnp/root/usr/share/rpcd/acl.d/luci-app-upnp.json:3
msgid "Grant access to upnp procedures"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:46
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:86
msgid "Host"
msgstr "Хост"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:194
msgid "Internal addresses"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:198
msgid "Internal ports"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:181
msgid "MiniUPnP ACLs"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:116
msgid "MiniUPnP settings"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:152
msgid "Notify interval"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:142
msgid "Port"
msgstr "Порт"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:164
msgid "Presentation URL"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:43
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:83
msgid "Protocol"
msgstr "Протокол"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:134
msgid "Puts extra debugging information into the system log"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:146
msgid "Report system instead of daemon uptime"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:172
msgid "STUN Host"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:176
msgid "STUN Port"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:121
msgid "Start UPnP and NAT-PMP service"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:70
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:66
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:110
msgid "There are no active redirects."
msgstr ""
#: applications/luci-app-upnp/root/usr/share/luci/menu.d/luci-app-upnp.json:3
msgid "UPnP"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:76
msgid ""
"UPnP allows clients in the local network to automatically configure the "
"router."
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:167
msgid "UPnP lease file"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:75
msgid "Universal Plug & Play"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:60
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:56
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:100
msgid "Unknown"
msgstr "Неизвестно"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:139
msgid "Uplink"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:170
msgid "Use STUN"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:137
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:140
msgid "Value in KByte/s, informational only"
msgstr ""

View File

@@ -0,0 +1,237 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-19 19:36+0200\n"
"PO-Revision-Date: 2021-10-08 18:54+0000\n"
"Last-Translator: Rayhan Nabi <rayhanjanam@gmail.com>\n"
"Language-Team: Bengali (Bangladesh) <https://hosted.weblate.org/projects/"
"openwrt/luciapplicationsupnp/bn_BD/>\n"
"Language: bn_BD\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.9-dev\n"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:182
msgid ""
"ACLs specify which external ports may be redirected to which internal "
"addresses and ports"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:202
msgid "Action"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:31
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:113
msgid "Active UPnP Redirects"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:119
msgid "Advanced Settings"
msgstr "উন্নত সেটিংস"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:131
msgid "Advertise as IGDv1 device instead of IGDv2"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:203
msgid "Allow"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:128
msgid "Allow adding forwards only to requesting ip addresses"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:150
msgid "Announced model number"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:149
msgid "Announced serial number"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:160
msgid "Clean rules interval"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:156
msgid "Clean rules threshold"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:45
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:85
msgid "Client Address"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:47
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:87
msgid "Client Port"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:188
msgid "Comment"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:66
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:62
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:106
msgid "Delete"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:204
msgid "Deny"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:48
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:88
msgid "Description"
msgstr "বর্ণনা"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:148
msgid "Device UUID"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:136
msgid "Downlink"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:130
msgid "Enable IGDv1 mode"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:125
msgid "Enable NAT-PMP functionality"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:124
msgid "Enable UPnP functionality"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:133
msgid "Enable additional logging"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:127
msgid "Enable secure mode"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:44
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:84
msgid "External Port"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:190
msgid "External ports"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:118
msgid "General Settings"
msgstr "সাধারণ সেটিংস"
#: applications/luci-app-upnp/root/usr/share/rpcd/acl.d/luci-app-upnp.json:3
msgid "Grant access to upnp procedures"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:46
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:86
msgid "Host"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:194
msgid "Internal addresses"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:198
msgid "Internal ports"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:181
msgid "MiniUPnP ACLs"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:116
msgid "MiniUPnP settings"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:152
msgid "Notify interval"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:142
msgid "Port"
msgstr "পোর্ট"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:164
msgid "Presentation URL"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:43
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:83
msgid "Protocol"
msgstr "প্রোটোকল"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:134
msgid "Puts extra debugging information into the system log"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:146
msgid "Report system instead of daemon uptime"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:172
msgid "STUN Host"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:176
msgid "STUN Port"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:121
msgid "Start UPnP and NAT-PMP service"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:70
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:66
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:110
msgid "There are no active redirects."
msgstr ""
#: applications/luci-app-upnp/root/usr/share/luci/menu.d/luci-app-upnp.json:3
msgid "UPnP"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:76
msgid ""
"UPnP allows clients in the local network to automatically configure the "
"router."
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:167
msgid "UPnP lease file"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:75
msgid "Universal Plug & Play"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:60
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:56
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:100
msgid "Unknown"
msgstr "অজানা"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:139
msgid "Uplink"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:170
msgid "Use STUN"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:137
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:140
msgid "Value in KByte/s, informational only"
msgstr ""

View File

@@ -0,0 +1,243 @@
# upnp.pot
# generated from ./applications/luci-upnp/luasrc/i18n/upnp.en.lua
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-10 03:40+0200\n"
"PO-Revision-Date: 2021-09-17 06:52+0000\n"
"Last-Translator: Roger Pueyo Centelles <weblate@rogerpueyo.com>\n"
"Language-Team: Catalan <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsupnp/ca/>\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.9-dev\n"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:182
msgid ""
"ACLs specify which external ports may be redirected to which internal "
"addresses and ports"
msgstr ""
"Els ACL especifiquen quins ports externs es poden redirigir a quines adreces "
"i ports interns"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:202
msgid "Action"
msgstr "Acció"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:31
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:113
msgid "Active UPnP Redirects"
msgstr "Redireccions UPnP actives"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:119
msgid "Advanced Settings"
msgstr "Configuració avançada"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:131
msgid "Advertise as IGDv1 device instead of IGDv2"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:203
msgid "Allow"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:128
msgid "Allow adding forwards only to requesting ip addresses"
msgstr "Permet que s'afegeixin redireccions només a les adreces IP peticionant"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:150
msgid "Announced model number"
msgstr "Número de model anunciat"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:149
msgid "Announced serial number"
msgstr "Número de sèrie anunciat"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:160
msgid "Clean rules interval"
msgstr "Interval de neteja de regles"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:156
msgid "Clean rules threshold"
msgstr "Llindar de neteja de regles"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:45
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:85
msgid "Client Address"
msgstr "Adreça de client"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:47
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:87
msgid "Client Port"
msgstr "Port de client"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:188
msgid "Comment"
msgstr "Commentari"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:66
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:62
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:106
msgid "Delete"
msgstr "Suprimeix"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:204
msgid "Deny"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:48
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:88
msgid "Description"
msgstr "Descripció"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:148
msgid "Device UUID"
msgstr "UUID de dispositiu"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:136
msgid "Downlink"
msgstr "Enllaç de baixada"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:130
msgid "Enable IGDv1 mode"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:125
msgid "Enable NAT-PMP functionality"
msgstr "Habilita la funcionalitat NAT-PMP"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:124
msgid "Enable UPnP functionality"
msgstr "Habilita la funcionalitat UPnP"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:133
msgid "Enable additional logging"
msgstr "Habilita el registre addicional"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:127
msgid "Enable secure mode"
msgstr "Habilita mode segur"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:44
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:84
msgid "External Port"
msgstr "Port extern"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:190
msgid "External ports"
msgstr "Ports externs"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:118
msgid "General Settings"
msgstr "Paràmetres generals"
#: applications/luci-app-upnp/root/usr/share/rpcd/acl.d/luci-app-upnp.json:3
msgid "Grant access to upnp procedures"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:46
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:86
msgid "Host"
msgstr "Amfitrió"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:194
msgid "Internal addresses"
msgstr "Adreces internes"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:198
msgid "Internal ports"
msgstr "Ports interns"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:181
msgid "MiniUPnP ACLs"
msgstr "ACLs de MiniUPnP"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:116
msgid "MiniUPnP settings"
msgstr "Ajusts de MiniUPnP"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:152
msgid "Notify interval"
msgstr "Interval de notificació"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:142
msgid "Port"
msgstr "Port"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:164
msgid "Presentation URL"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:43
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:83
msgid "Protocol"
msgstr "Protocol"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:134
msgid "Puts extra debugging information into the system log"
msgstr "Posa informació extra de depuració en el registre de sistema"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:146
msgid "Report system instead of daemon uptime"
msgstr "Reporta el temps actiu del sistema en lloc del del dimoni"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:172
msgid "STUN Host"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:176
msgid "STUN Port"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:121
msgid "Start UPnP and NAT-PMP service"
msgstr "Inicia el servei UPnP i NAP-PMP"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:70
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:66
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:110
msgid "There are no active redirects."
msgstr "No hi ha redireccions actives."
#: applications/luci-app-upnp/root/usr/share/luci/menu.d/luci-app-upnp.json:3
msgid "UPnP"
msgstr "UPnP"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:76
msgid ""
"UPnP allows clients in the local network to automatically configure the "
"router."
msgstr ""
"UPnP permet als clients de la xarxa local configurar automàticament el "
"router."
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:167
msgid "UPnP lease file"
msgstr "Fitxer d'arrendament UPnP"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:75
msgid "Universal Plug & Play"
msgstr "Universal Plug & Play"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:60
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:56
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:100
msgid "Unknown"
msgstr "Desconegut"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:139
msgid "Uplink"
msgstr "Enllaç de pujada"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:170
msgid "Use STUN"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:137
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:140
msgid "Value in KByte/s, informational only"
msgstr "Valor en KByte/s, només per informació"

View File

@@ -0,0 +1,238 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2024-07-08 22:10+0000\n"
"Last-Translator: Milan <cirhanmilan@seznam.cz>\n"
"Language-Team: Czech <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsupnp/cs/>\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=((n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2);\n"
"X-Generator: Weblate 5.7-dev\n"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:182
msgid ""
"ACLs specify which external ports may be redirected to which internal "
"addresses and ports"
msgstr ""
"ACL stanovují, které vnější porty by měly být přesměrovány na které vnitřní "
"adresy a porty"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:202
msgid "Action"
msgstr "Akce"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:31
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:113
msgid "Active UPnP Redirects"
msgstr "Aktivní přesměrování UPnP"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:119
msgid "Advanced Settings"
msgstr "Pokročilé možnosti"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:131
msgid "Advertise as IGDv1 device instead of IGDv2"
msgstr "Inzerovat jako IGDv1 zařízení místo IGDv2"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:203
msgid "Allow"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:128
msgid "Allow adding forwards only to requesting ip addresses"
msgstr "Povolit přesměrování pouze na dotazující ip adresy"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:150
msgid "Announced model number"
msgstr "Oznámené číslo modelu"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:149
msgid "Announced serial number"
msgstr "Oznámené sériové číslo"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:160
msgid "Clean rules interval"
msgstr "Interval čištění pravidel"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:156
msgid "Clean rules threshold"
msgstr "Práh čištění pravidel"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:45
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:85
msgid "Client Address"
msgstr "Adresa klienta"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:47
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:87
msgid "Client Port"
msgstr "Port klienta"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:188
msgid "Comment"
msgstr "Komentář"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:66
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:62
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:106
msgid "Delete"
msgstr "Odstranit"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:204
msgid "Deny"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:48
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:88
msgid "Description"
msgstr "Popis"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:148
msgid "Device UUID"
msgstr "UUID zařízení"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:136
msgid "Downlink"
msgstr "Downlink"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:130
msgid "Enable IGDv1 mode"
msgstr "Povolit režim IGDv1"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:125
msgid "Enable NAT-PMP functionality"
msgstr "Povolit funkčnost NAT-PMP"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:124
msgid "Enable UPnP functionality"
msgstr "Povolit funkčnost UPnP"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:133
msgid "Enable additional logging"
msgstr "Povolit přídavné logování"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:127
msgid "Enable secure mode"
msgstr "Povolit bezpečný režim"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:44
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:84
msgid "External Port"
msgstr "Vnější port"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:190
msgid "External ports"
msgstr "Vnější porty"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:118
msgid "General Settings"
msgstr "Obecná nastavení"
#: applications/luci-app-upnp/root/usr/share/rpcd/acl.d/luci-app-upnp.json:3
msgid "Grant access to upnp procedures"
msgstr "Udělit oprávnění k procedůrám upnp"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:46
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:86
msgid "Host"
msgstr "Hostitel"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:194
msgid "Internal addresses"
msgstr "Vnitřní adresy"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:198
msgid "Internal ports"
msgstr "Vnitřní porty"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:181
msgid "MiniUPnP ACLs"
msgstr "MiniUPnP ACL listy"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:116
msgid "MiniUPnP settings"
msgstr "Nastavení MiniUPnP"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:152
msgid "Notify interval"
msgstr "Interval oznamování"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:142
msgid "Port"
msgstr "Port"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:164
msgid "Presentation URL"
msgstr "Prezentační URL"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:43
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:83
msgid "Protocol"
msgstr "Protokol"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:134
msgid "Puts extra debugging information into the system log"
msgstr "Vypisovat extra ladící informace do systémového záznamu"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:146
msgid "Report system instead of daemon uptime"
msgstr "Hlásit uptime systému namísto uptime daemonu"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:172
msgid "STUN Host"
msgstr "STUN Hostitel"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:176
msgid "STUN Port"
msgstr "STUN Port"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:121
msgid "Start UPnP and NAT-PMP service"
msgstr "Spustit službu UPnP a NAT-PMP"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:70
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:66
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:110
msgid "There are no active redirects."
msgstr "Neexistují žádná aktivní přesměrování."
#: applications/luci-app-upnp/root/usr/share/luci/menu.d/luci-app-upnp.json:3
msgid "UPnP"
msgstr "UPnP"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:76
msgid ""
"UPnP allows clients in the local network to automatically configure the "
"router."
msgstr ""
"UPnP umožňuje klientům v místní síti automaticky nakonfigurovat router."
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:167
msgid "UPnP lease file"
msgstr "Soubor UPnP výpůjček"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:75
msgid "Universal Plug & Play"
msgstr "Univerzální Plug & Play"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:60
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:56
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:100
msgid "Unknown"
msgstr "Neznámé"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:139
msgid "Uplink"
msgstr "Uplink"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:170
msgid "Use STUN"
msgstr "Použít STUN"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:137
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:140
msgid "Value in KByte/s, informational only"
msgstr "Pouze informační hodnoty (v KByte/s)"

View File

@@ -0,0 +1,241 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-19 19:36+0200\n"
"PO-Revision-Date: 2021-11-13 08:12+0000\n"
"Last-Translator: drax red <drax@outlook.dk>\n"
"Language-Team: Danish <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsupnp/da/>\n"
"Language: da\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.9.1-dev\n"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:182
msgid ""
"ACLs specify which external ports may be redirected to which internal "
"addresses and ports"
msgstr ""
"ACL'er angiver, hvilke eksterne porte der kan omdirigeres til hvilke interne "
"adresser og porte"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:202
msgid "Action"
msgstr "Handling"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:31
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:113
msgid "Active UPnP Redirects"
msgstr "Aktive UPnP-omdirigeringer"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:119
msgid "Advanced Settings"
msgstr "Avancerede indstillinger"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:131
msgid "Advertise as IGDv1 device instead of IGDv2"
msgstr "Annoncerer som IGDv1-enhed i stedet for IGDv2"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:203
msgid "Allow"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:128
msgid "Allow adding forwards only to requesting ip addresses"
msgstr "Tillad kun at tilføje viderestillinger til ip-adresser, der anmoder om"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:150
msgid "Announced model number"
msgstr "Annonceret modelnummer"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:149
msgid "Announced serial number"
msgstr "Annonceret serienummer"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:160
msgid "Clean rules interval"
msgstr "Interval for rene regler"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:156
msgid "Clean rules threshold"
msgstr "Tærskel for rene regler"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:45
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:85
msgid "Client Address"
msgstr "Klient adresse"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:47
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:87
msgid "Client Port"
msgstr "Klient port"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:188
msgid "Comment"
msgstr "Kommentar"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:66
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:62
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:106
msgid "Delete"
msgstr "Slet"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:204
msgid "Deny"
msgstr ""
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:48
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:88
msgid "Description"
msgstr "Beskrivelse"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:148
msgid "Device UUID"
msgstr "Enhedens UUID"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:136
msgid "Downlink"
msgstr "Downlink"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:130
msgid "Enable IGDv1 mode"
msgstr "Aktiver IGDv1-tilstand"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:125
msgid "Enable NAT-PMP functionality"
msgstr "Aktiver NAT-PMP-funktionalitet"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:124
msgid "Enable UPnP functionality"
msgstr "Aktiver UPnP-funktionalitet"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:133
msgid "Enable additional logging"
msgstr "Aktiver yderligere logning"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:127
msgid "Enable secure mode"
msgstr "Aktiver sikker tilstand"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:44
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:84
msgid "External Port"
msgstr "Ekstern port"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:190
msgid "External ports"
msgstr "Eksterne porte"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:118
msgid "General Settings"
msgstr "Generelle indstillinger"
#: applications/luci-app-upnp/root/usr/share/rpcd/acl.d/luci-app-upnp.json:3
msgid "Grant access to upnp procedures"
msgstr "Giv adgang til upnp-procedurer"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:46
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:86
msgid "Host"
msgstr "Vært"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:194
msgid "Internal addresses"
msgstr "Interne adresser"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:198
msgid "Internal ports"
msgstr "Interne porte"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:181
msgid "MiniUPnP ACLs"
msgstr "MiniUPnP ACL'er"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:116
msgid "MiniUPnP settings"
msgstr "MiniUPnP-indstillinger"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:152
msgid "Notify interval"
msgstr "Underretningsinterval"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:142
msgid "Port"
msgstr "Port"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:164
msgid "Presentation URL"
msgstr "URL til præsentation"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:43
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:83
msgid "Protocol"
msgstr "Protokol"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:134
msgid "Puts extra debugging information into the system log"
msgstr "Sætter ekstra fejlfindingsoplysninger i systemloggen"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:146
msgid "Report system instead of daemon uptime"
msgstr "Rapportere system i stedet for dæmonens oppetid"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:172
msgid "STUN Host"
msgstr "STUN vært"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:176
msgid "STUN Port"
msgstr "STUN Port"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:121
msgid "Start UPnP and NAT-PMP service"
msgstr "Start UPnP- og NAT-PMP-tjenesten"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:70
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:66
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:110
msgid "There are no active redirects."
msgstr "Der er ingen aktive omdirigeringer."
#: applications/luci-app-upnp/root/usr/share/luci/menu.d/luci-app-upnp.json:3
msgid "UPnP"
msgstr "UPnP"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:76
msgid ""
"UPnP allows clients in the local network to automatically configure the "
"router."
msgstr ""
"UPnP gør det muligt for klienter i det lokale netværk at konfigurere "
"routeren automatisk."
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:167
msgid "UPnP lease file"
msgstr "UPnP-lease-fil"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:75
msgid "Universal Plug & Play"
msgstr "Universelt plug &play"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:60
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:56
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:100
msgid "Unknown"
msgstr "Ukendt"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:139
msgid "Uplink"
msgstr "Uplink"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:170
msgid "Use STUN"
msgstr "Brug STUN"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:137
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:140
msgid "Value in KByte/s, informational only"
msgstr "Værdi i KByte/s, kun til information"

View File

@@ -0,0 +1,241 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-26 17:57+0200\n"
"PO-Revision-Date: 2024-02-09 17:28+0000\n"
"Last-Translator: ssantos <ssantos@web.de>\n"
"Language-Team: German <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsupnp/de/>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.4-dev\n"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:182
msgid ""
"ACLs specify which external ports may be redirected to which internal "
"addresses and ports"
msgstr ""
"ACLs definieren, welche externen Ports zu welchen internen Adressen und "
"Ports weitergeleitet werden dürfen"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:202
msgid "Action"
msgstr "Aktion"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:31
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:113
msgid "Active UPnP Redirects"
msgstr "Aktive UPnP-Weiterleitungen"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:119
msgid "Advanced Settings"
msgstr "Erweiterte Einstellungen"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:131
msgid "Advertise as IGDv1 device instead of IGDv2"
msgstr "Als IGDv1-Gerät anstelle von IGDv2 bekanntgeben"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:203
msgid "Allow"
msgstr "Erlauben"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:128
msgid "Allow adding forwards only to requesting ip addresses"
msgstr "Nur Weiterleitungen zurück zum anfordernden Client zulassen"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:150
msgid "Announced model number"
msgstr "Angekündigte Modellnummer"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:149
msgid "Announced serial number"
msgstr "Angekündigte Seriennummer"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:160
msgid "Clean rules interval"
msgstr "Aufräumintervall für Weiterleitungen"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:156
msgid "Clean rules threshold"
msgstr "Aufräumschwellenwert für Weiterleitungen"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:45
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:85
msgid "Client Address"
msgstr "Clientadresse"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:47
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:87
msgid "Client Port"
msgstr "Clientport"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:188
msgid "Comment"
msgstr "Kommentar"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:66
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:62
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:106
msgid "Delete"
msgstr "Löschen"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:204
msgid "Deny"
msgstr "Ablehnen"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:48
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:88
msgid "Description"
msgstr "Beschreibung"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:148
msgid "Device UUID"
msgstr "Geräte-UUID"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:136
msgid "Downlink"
msgstr "Download-Bandbreite"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:130
msgid "Enable IGDv1 mode"
msgstr "IGDv1 Modus aktivieren"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:125
msgid "Enable NAT-PMP functionality"
msgstr "NAT-PMP Funktionalität aktivieren"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:124
msgid "Enable UPnP functionality"
msgstr "UPnP Funktionalität aktivieren"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:133
msgid "Enable additional logging"
msgstr "Erweiterte Protokollierung aktivieren"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:127
msgid "Enable secure mode"
msgstr "Sicheren Modus aktivieren"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:44
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:84
msgid "External Port"
msgstr "Externer Port"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:190
msgid "External ports"
msgstr "Externe Ports"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:118
msgid "General Settings"
msgstr "Allgemeine Einstellungen"
#: applications/luci-app-upnp/root/usr/share/rpcd/acl.d/luci-app-upnp.json:3
msgid "Grant access to upnp procedures"
msgstr "Zugriff auf UPNP-Prozeduren gewähren"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:46
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:86
msgid "Host"
msgstr "Host"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:194
msgid "Internal addresses"
msgstr "Interne Adressen"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:198
msgid "Internal ports"
msgstr "Interne Ports"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:181
msgid "MiniUPnP ACLs"
msgstr "ACLs der MiniUPnP"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:116
msgid "MiniUPnP settings"
msgstr "MiniUPnP-Einstellungen"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:152
msgid "Notify interval"
msgstr "Benachrichtigungsintervall"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:142
msgid "Port"
msgstr "Port"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:164
msgid "Presentation URL"
msgstr "Präsentations-URL"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:43
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:83
msgid "Protocol"
msgstr "Protokoll"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:134
msgid "Puts extra debugging information into the system log"
msgstr "Schreibt zusätzliche Debug-Informationen in das Systemprotokoll"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:146
msgid "Report system instead of daemon uptime"
msgstr "Systemlaufzeit statt Prozesslaufzeit melden"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:172
msgid "STUN Host"
msgstr "STUN-Host"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:176
msgid "STUN Port"
msgstr "STUN-Port"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:121
msgid "Start UPnP and NAT-PMP service"
msgstr "UPnP und NAT-PMP Dienst starten"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:70
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:66
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:110
msgid "There are no active redirects."
msgstr "Es gibt keine aktiven Weiterleitungen."
#: applications/luci-app-upnp/root/usr/share/luci/menu.d/luci-app-upnp.json:3
msgid "UPnP"
msgstr "UPnP"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:76
msgid ""
"UPnP allows clients in the local network to automatically configure the "
"router."
msgstr ""
"UPnP erlaubt es Clients im lokalen Netzwerk automatisch Port-Weiterleitungen "
"auf diesem Router einzurichten."
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:167
msgid "UPnP lease file"
msgstr "UPnP Lease-Datei"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:75
msgid "Universal Plug & Play"
msgstr "Universal Plug & Play"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/status/include/80_upnp.js:60
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:56
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:100
msgid "Unknown"
msgstr "Unbekannt"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:139
msgid "Uplink"
msgstr "Uplink"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:170
msgid "Use STUN"
msgstr "STUN verwenden"
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:137
#: applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js:140
msgid "Value in KByte/s, informational only"
msgstr "Wert in Kilobyte/s, nur informativ"

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