The original ar71xx version of this device used 1002 as mac address for
both ethernet and wireless. The ath79 version inexplicably changes this
to 2, which seems to be done nowhere else in ath79, indicating it's
bogus.
Restore previous ar71xx assignment. 1002 is used as an ethernet
interface with some other devices as well.
Also remove the bogus caldata userspace extraction. The size is bogus
and it's already handled in dts.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17083
Signed-off-by: John Crispin <john@phrozen.org>
NRadio C8-668GL is a Wi-Fi 6 5G cellular router based on MediaTek MT7981B SoC.
- **SoC**: MediaTek MT7981B (2x Cortex-A53, 1.3GHz)
- **RAM**: Nanya NT5AD512M16C4-JR 1GB DDR4
- **Flash**: ESMT FC51L08SFY3A 8GB eMMC
- **Ethernet**:
- 1x 2.5GbE (via GMAC0 and GPY211 PHY, shared with MT7531AE)
- 3x 10/100/1000 Mbps (via MT7531AE, connected to GMAC0)
- 5G Modem: GMAC1 (via GPY211 PHY - RTL8125BG - RM520N-GL)
- **Wi-Fi**: MediaTek MT7976CN (2.4GHz/5GHz, 802.11ax, 2x2 MIMO, AX3000)
- **Buttons**: Reset, WPS
- **LEDs**: Power, 5G, 4G, WiFi
- **SIM Slot**: 1x Nano SIM
- **5G Modem**: Quectel RM520N-GL (Snapdragon™ X62)
- **Power**: 12V/2A DC, 5.5×2.1 connector
The MAC addresses are derived from the `fac_mac` field in the `bdinfo` partition, formatted as `fac_mac = HWMAC`. The allocation is as follows:
| Vendor | OpenWrt Interface | Address | Notes |
|---------|-------------------|---------------|------------------------------------------------|
| LAN | br-lan | Label MAC | Default |
| WAN | lan4 | Label MAC+1 | Only when lan4 is switched to WAN |
| 2.4GHz | phy0-ap0 | Label MAC | |
| 5GHz | phy1-ap0 | Label MAC | (Local Admin bit set) |
| Modem | eth1 | Label MAC+2 | |
1. Log in to the router via `http://192.168.66.1`/.
2. Upgrade the official firmware to dual-system mode.
3. Select **Burn second system** and upload the `sysupgrade.bin` image.
- Download the image from the OpenWrt build system or build it yourself using the OpenWrt buildroot.
4. Wait for 30 seconds and click **Switch system**.
5. The device will reboot and switch to OpenWrt.
Set the U-Boot environment variable `boot_system=0` and reboot:
```bash
fw_setenv boot_system 0
```
Power off the router, hold the **WPS button**, and power it back on.
1. Rename the stock firmware file to **`recovery.bin`**.
2. Set your PC's Ethernet IP to **192.168.1.88** and connect it to the lan1 port on the router.
3. Run a TFTP server and place the `recovery.bin` file in its root directory.
4. Power off the router, press and hold the **Reset button**, and power it back on.
5. Release the Reset button when the TFTP server shows activity.
6. Wait for the router to flash the firmware and reboot automatically.
- By default, `lan4` is part of `br-lan` and uses the label MAC address.
- To query the RM520N-GL module, use the following command:
```bash
cat /dev/ttyUSB2 & printf 'ATI\r\n' > /dev/ttyUSB2
```
Signed-off-by: Yaoguang Bai <0xdeadc0de@badguys.club>
Link: https://github.com/openwrt/openwrt/pull/17093
Signed-off-by: John Crispin <john@phrozen.org>
Upstream uses devm_reset_control_array_get_optional_shared, which does
not use names. reset-names is also not specified in the documentation.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17118
Signed-off-by: John Crispin <john@phrozen.org>
Both generic-ehci.yaml and generic-ohci.yaml state that phy-names is to
only be usb.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17118
Signed-off-by: John Crispin <john@phrozen.org>
This matches the upstream PHY driver, which removed it.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17118
Signed-off-by: John Crispin <john@phrozen.org>
Don't fail wireless interface bringup on empty PSK set. This is a valid
configuration, resulting in a PSK network which can't be connected to.
It does not fail the bringup of the hostapd process.
Keep failing the interface setup in case a password with invalid length
is used.
This is also beneficial when intending to configure a PPSK network. It
allows to create a network where no PPSK is yet set.
Signed-off-by: David Bauer <mail@david-bauer.net>
Link: https://github.com/openwrt/openwrt/pull/17197
Signed-off-by: John Crispin <john@phrozen.org>
refresh the following patch for ath12k
001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch
Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17246
Signed-off-by: John Crispin <john@phrozen.org>
One is already present. The other one can be implemented in terms of the
PHY.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17250
Signed-off-by: John Crispin <john@phrozen.org>
Ensure that the code doesn't pass macaddr_base with the wrong type (null)
to the supplicant setup/start call.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Name the pidfile of each dropbear instance according to the
corresponding uci section name. This enables a 1:1 mapping between the
definition of the service instance and its process.
Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/15177
Signed-off-by: John Crispin <john@phrozen.org>
Instead of using regulator-output to manually control USB GPIO, let the
PHY handle it.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17221
Signed-off-by: John Crispin <john@phrozen.org>
fix default timezone to correct GMT0,
origin value 'UTC' is zonename, not timezone.
Signed-off-by: Jiale Liu <admin@licsber.site>
Link: https://github.com/openwrt/openwrt/pull/15128
Signed-off-by: John Crispin <john@phrozen.org>
Initial support for dynamic reload of RxKHs.
In order to check if RxKHs need reloading.
RxKHs defined in the rxkh_file first has to be parsed and formated,
the same way as hostapd will read from the file and also output,
with the command GET_RXKHS.
Then each list of RxKHs can be hashed and compared.
Ucode implementation of hostapds rkh_derive_key() function.
Hostapd converts hex keys with 128-bits or more when less than 256-bits
to 256-bits, and truncates those that are more than 256-bits.
See: https://w1.fi/cgit/hostap/commit/hostapd/config_file.c?id=245fc96e5f4b1c566b7eaa19180c774307ebed79
Signed-off-by: Sybil127 <sybil127@outlook.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
With rxkh_file, hostapd will read a list of RxKHs from a text file.
This also makes it possible for hostapd to dynamically reload RxKHs.
RxKHs defined in rxkh_file should be formated as described in hostapd.conf,
with one entry per line.
R0KH/R1KH format:
r0kh=<MAC address> <NAS Identifier> <256-bit key as hex string>
r1kh=<MAC address> <R1KH-ID> <256-bit key as hex string>
Reworked behavior of the uci options r0kh and r1kh.
When rxkh_file is not configured:
Instead of appending the RxKHs to the hostapd bss configuration.
They will be added to a interface specific file with name
/var/run/hostapd-phyX-apX.rxkh.
This file will be used as the rxkh_file in the hostapd bss configuration.
When rxkh_file is configured:
The specified file will be used in the hostapd bss configuration,
and will be the only source for configured RxKHs.
All RxKHs defined with the uci options r0kh or r1kh will be ignored.
Signed-off-by: Sybil127 <sybil127@outlook.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
The initialization of mesh interfaces currently fail when wpa_supplicant
is not installed. This is due to the script calling the wpa_supplicant
feature indicator without verifying wpa_supplicant is installed at all.
To avoid failing, first check if wpa_supplicant is installed before
determining the available featureset.
Signed-off-by: David Bauer <mail@david-bauer.net>
This reverts commit 1cea889c96.
This reverts commit 5fd86d66c1.
The patch is causing build servers to fail. Revert it for now.
Signed-off-by: John Crispin <john@phrozen.org>
This option enables support for monochrome LEDs that are grouped into multicolor
LEDs which is useful in the case where LEDs of different colors are physically
grouped in a single multi-color LED and driven by a controller that doesn't have
multi-color support.
Signed-off-by: Jonathan Brophy <professor_jonny@hotmail.com>
Link: https://github.com/openwrt/openwrt/pull/16397
Signed-off-by: John Crispin <john@phrozen.org>
Some devices use file '/tmp/sysupgrade.tar' during settings restore and
this potentially big file was not being cleaned up from RAM afterwards.
See: do_mount_root() (base-files/files/lib/preinit/80_mount_root)
Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15339
Signed-off-by: John Crispin <john@phrozen.org>
We have seen hung devices and failures during SPI transactions on
Fritzbox devices with a gluon based freifunk network. We have narrowed
down that disabling DMA for spi fixes the problem, so disable dma for
the SPI controller on the Fritzbox 4040.
Signed-off-by: Rouven Czerwinski <rouven@czerwinskis.de>
Link: https://github.com/openwrt/openwrt/pull/15966
Signed-off-by: John Crispin <john@phrozen.org>
git's default core.whitespace[1] setting doesn't agree with .patch
files. This causes whitespace warnings when running `git apply`,
(including via `git am`) and causes red highlighting when viewing diffs
to .patch files via `git diff` (including via `git show`) when
outputting to a terminal.
These types of whitespace “violations” will now be explicitly disabled
for .patch files in the repository-wide .gitattributes file to prevent
git from suggesting that there’s anything wrong with checked-in .patch
files.
A .patch file will naturally have `space-before-tab` if a context line
(not a +/- line) begins with a tab character (as is common in patches to
files that use the tab indent convention), and will also naturally have
`trailing-space` if a context line is blank (also common).
Neither `indent-with-non-tab` nor `tab-in-indent` are enabled in
core.whitespace by default, but could also occur naturally in .patch
files, and are also explicitly disabled here for completeness to cover
cases where they may be enabled in core.whitespace at the global or
system level.
These false violations may be flagged frequently in OpenWrt, because the
repository contains many .patch files. There are currently just over
5,000 .patch files, representing slightly more than half of all files.
[1] https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_core_whitespace
Link: https://github.com/openwrt/openwrt/pull/16012
Signed-off-by: Mark Mentovai <mark@mentovai.com>
Link: https://github.com/openwrt/openwrt/pull/16015
Signed-off-by: John Crispin <john@phrozen.org>
Update the compiler check for ccache so we don't
end up with the wrong binaries. Right now the
compiler check will not be able to correctly
distinguish the compiler used for build
ARMv8 binaries from the one used to build
ARMv7 binaries.
Signed-off-by: Markus Gothe <markus.gothe@genexis.eu>
Link: https://github.com/openwrt/openwrt/pull/16290
Signed-off-by: John Crispin <john@phrozen.org>
- Disable compression for ccache's cached files.
- Disable the hashing of the CWD inside debug information. This
increases the cache hits drastically.
Signed-off-by: Markus Gothe <markus.gothe@genexis.eu>
dnsmasq passes a limited amount of information via DHCP script arguments. Much
more information is available through environment variables starting with
DNSMASQ_, such as DNSMASQ_INTERFACE. However, when the dhcp-script builds its
JSON environment and passes it to hotplug, all of this information is discarded
since it is not copied to the JSON environment.
Personally, I have a custom-made set of DDNS scripts and rely on environment
variables such as DNSMASQ_INTERFACE in order to determine which DNS zones
to update. So, not being able to access these variables was detrimental to me.
I patched in a quick copy of all DNSMASQ_ variables to the JSON environment
so that they can be used in hotplug scripts. In order to do so I also copied
/usr/bin/env into dnsmasq's chroot jail.
Signed-off-by: Chuck R <github@chuck.cloud>
Link: https://github.com/openwrt/openwrt/pull/16354
Signed-off-by: John Crispin <john@phrozen.org>
Group 'local' declarations and 'json_get_vars', sort alphabetically within groups, and split off more generic parameters.
- delegate and sourcefilter were not declared as local variables
Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
Link: https://github.com/openwrt/openwrt/pull/16734
Signed-off-by: John Crispin <john@phrozen.org>
Group 'local' declarations and 'json_get_vars', sort alphabetically within groups, and split off more generic parameters.
- delegate and sourcefilter were not declared as local variables
Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
Group 'local' declarations and 'json_get_vars', sort alphabetically within groups, and split off more generic parameters.
- delegate and sourcefilter were not declared as local variables
Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
Add option to set LED brightness via uci:
config led 'led_blue'
option name 'blue'
option sysfs 'blue:status'
option brightness '1'
Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17190
Signed-off-by: John Crispin <john@phrozen.org>
change Support-UDP-Traceroute rule from 'enabled false' to 'enabled 0'
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17133
Signed-off-by: John Crispin <john@phrozen.org>
Regarding SAE support in wifi-station:
Important Note: Unlike PSK wifi-stations, both `mac` and `key` options are required
to make it work. With PSK, hostapd used to perform a brute-force match to find which
PSK entry to use, but with SAE this is infeasible due to SAE's design.
When `mac` is omitted, it will allow any MAC address to use the SAE password if it
didn't have a MAC address assigned to it, but this could only be done once.
The last wildcard entry would be used.
Also, unlike "hostapd: add support for SAE in PPSK option" (commit 913368a),
it is not required to set `sae_pwe` to `0`. This gives it a slight advantage
over using PPSK that goes beyond not needing RADIUS.
Example Configuration:
```
config wifi-vlan
option iface default_radio0
option name 999
option vid 999
option network management
config wifi-station
# Allow user with MAC address 00:11:22:33:44:55 and matching
# key "secretadminpass" to access the management network.
option iface default_radio0
option vid 999
option mac '00:11:22:33:44:55'
option key secretadminpass
config wifi-vlan
option iface default_radio0
option name 100
option vid 100
option network guest
config wifi-station
# With SAE, when 'mac' is omitted it will be the fallback in case no
# other MAC address matches. It won't be possible for a user that
# has a matching MAC to use this network (i.e., 00:11:22:33:44:55
# in this example).
option iface default_radio0
option vid 100
option key guestpass
```
Regarding PSK file creation optimization:
This patch now conditionally runs `hostapd_set_psk_file` depending on `auth_type`.
Previously, `hostapd_set_psk` would always execute `hostapd_set_psk_file`, which
would create a new file if `wifi-station` was in use even if PSK was not enabled.
This change checks the `auth_type` to ensure that it is appropriate to parse the
`wifi-station` entries and create those files.
Furthermore, we now only configure `wpa_psk_file` when it is a supported option
(i.e., psk or psk-sae is used). Previously, we used to configure it when it was
not necessary. While it didn't cause any issues, it would litter `/var/run` with
unnecessary files. This patch fixes that case by configuring it depending on the
`auth_type`.
The new SAE support is aligned with these PSK file changes.
Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/17145
Signed-off-by: John Crispin <john@phrozen.org>
Use ath11k_patch_mac and ath11k_set_macflag functions
instead of fix_wifi_mac script.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/17230
Signed-off-by: Robert Marko <robimarko@gmail.com>
93458ac dns: fix response to TYPE_PTR query
68af311 fix unicast response port and timeout
a2b4979 service: announce all services in single dns answer
4537734 display announced services in ubus call umdns browse
0b50c29 display more srv attributes in output of ubus browse function
Signed-off-by: John Crispin <john@phrozen.org>
e2f05de state: set_stdio: chdir back to / in case of failure
30542c9 inittab: Disable implicit controlling TTY.
Signed-off-by: John Crispin <john@phrozen.org>
Change partition table in dts file.
Change DEVICE_COMPAT_VERSION
Enable automatic build.
To take advantage of the bigger kernel partition,
the uboot environment has to be changed:
setenv nboot 'nand read 0x81000000 0x60000 0x500000; bootm 0x81000000'
setenv bootcmd 'run nboot'
saveenv
Of course you need a u-boot capable of handling this.
The u-boot discussed in this forum thread:
https://forum.openwrt.org/t/zyxel-p2812hnu-f1-u-boot/100281
should be able to handle kernels up to an uncompressed size of 16MiB.
Signed-off-by: Isaac de Wolff <idewolff@gmx.com>
Link: https://github.com/openwrt/openwrt/pull/17209
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The device path to the devices changed. Migrate the wifi
configurations from the old path to the new one. This is needed to
migrate Wireless configurations from OpenWrt 23.05 to OpenWrt 24.10.
This script is based on these two files:
target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate
target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate
Fixes: 0ef9274721 ("mediatek: filogic: move mt7981 on-SoC blocks to "soc" node in DT")
Fixes: https://github.com/openwrt/openwrt/issues/17174
Link: https://github.com/openwrt/openwrt/pull/17210
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The vendor U-Boot on the Cudy WR3000 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.
Related to: a55ab9e134 ("mediatek: filogic: prevent faulty mac address assignment")
Fixes: https://github.com/openwrt/openwrt/issues/15587
Signed-off-by: Ondřej Niesner <ondra.niesner@seznam.cz>
Link: https://github.com/openwrt/openwrt/pull/17201
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
libbfd feature is not used when building eBPF program, and it makes bpftool fail to build in a clean environment, since binutils in toolchain have libbfd disabled.
Signed-off-by: Eric Long <i@hack3r.moe>
Link: https://github.com/openwrt/openwrt/pull/17073
Signed-off-by: Robert Marko <robimarko@gmail.com>