Skip to content

Commit

Permalink
Merge branch 'openwrt:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
aUsernameWoW authored Jun 23, 2024
2 parents 6aef02f + 0ed72c2 commit 2b650ec
Show file tree
Hide file tree
Showing 48 changed files with 985 additions and 826 deletions.
4 changes: 2 additions & 2 deletions include/kernel-6.6
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LINUX_VERSION-6.6 = .34
LINUX_KERNEL_HASH-6.6.34 = c4e0ec8f593aa3717e85abad940466e7d7cbc362989426eb37f499330a461ba0
LINUX_VERSION-6.6 = .35
LINUX_KERNEL_HASH-6.6.35 = fce3ee728712ed063aa8c14a8756c8ff8c7a46ba3827f61d2b04a73c7cf5dd9e
4 changes: 3 additions & 1 deletion package/libs/openssl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=openssl
PKG_VERSION:=3.0.14
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto

PKG_BUILD_PARALLEL:=1
Expand Down Expand Up @@ -416,6 +416,8 @@ define Package/libopenssl-conf/install
$(INSTALL_BIN) ./files/openssl.init $(1)/etc/init.d/openssl
$(SED) 's!%ENGINES_DIR%!/usr/lib/$(ENGINES_DIR)!' $(1)/etc/init.d/openssl
touch $(1)/etc/config/openssl
$(if $(CONFIG_OPENSSL_ENGINE),,
$(SED) 's!engines = engines_sect!#&!' $(1)/etc/ssl/openssl.cnf)
$(if $(CONFIG_OPENSSL_ENGINE_BUILTIN_DEVCRYPTO),
$(CP) ./files/devcrypto.cnf $(1)/etc/ssl/modules.cnf.d/
echo -e "config engine 'devcrypto'\n\toption enabled '1'\n\toption builtin '1'" >> $(1)/etc/config/openssl)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ $1 ~ /Band/ {
}
band_match && $3 == "MHz" && $4 == channel {
print $2
print int($2)
exit
}
'
Expand Down
217 changes: 0 additions & 217 deletions package/network/config/wifi-scripts/files/lib/wifi/mac80211.sh

This file was deleted.

94 changes: 94 additions & 0 deletions package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#!/usr/bin/env ucode
import { readfile } from "fs";
import * as uci from 'uci';

const bands_order = [ "6G", "5G", "2G" ];
const htmode_order = [ "HE", "VHT", "HT" ];

let board = json(readfile("/etc/board.json"));
if (!board.wlan)
exit(0);

let idx = 0;
let commit;

let config = uci.cursor().get_all("wireless") ?? {};

function radio_exists(path, macaddr, phy) {
for (let name, s in config) {
if (s[".type"] != "wifi-device")
continue;
if (s.macaddr & lc(s.macaddr) == lc(macaddr))
return true;
if (s.phy == phy)
return true;
if (!s.path || !path)
continue;
if (substr(s.path, -length(path)) == path)
return true;
}
}

for (let phy_name, phy in board.wlan) {
let info = phy.info;
if (!info || !length(info.bands))
continue;

while (config[`radio${idx}`])
idx++;
let name = "radio" + idx++;

let s = "wireless." + name;
let si = "wireless.default_" + name;

let band_name = filter(bands_order, (b) => info.bands[b])[0];
if (!band_name)
continue;

let band = info.bands[band_name];
let channel = band.default_channel ?? "auto";

let width = band.max_width;
if (band_name == "2G")
width = 20;
else if (width > 80)
width = 80;

let htmode = filter(htmode_order, (m) => band[lc(m)])[0];
if (htmode)
htmode += width;
else
htmode = "NOHT";

if (!phy.path)
continue;

let macaddr = trim(readfile(`/sys/class/ieee80211/${phy_name}/macaddress`));
if (radio_exists(phy.path, macaddr, phy_name))
continue;

let id = `phy='${phy_name}'`;
if (match(phy_name, /^phy[0-9]/))
id = `path='${phy.path}'`;

print(`set ${s}=wifi-device
set ${s}.type='mac80211'
set ${s}.${id}
set ${s}.band='${lc(band_name)}'
set ${s}.channel='${channel}'
set ${s}.htmode='${htmode}'
set ${s}.disabled='1'

set ${si}=wifi-iface
set ${si}.device='${name}'
set ${si}.network='lan'
set ${si}.mode='ap'
set ${si}.ssid='OpenWrt'
set ${si}.encryption='none'

`);
commit = true;
}

if (commit)
print("commit wireless\n");
1 change: 1 addition & 0 deletions package/network/config/wifi-scripts/files/sbin/wifi
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ wifi_config() {
[ -e /tmp/.config_pending ] && return
ucode /usr/share/hostap/wifi-detect.uc
[ ! -f /etc/config/wireless ] && touch /etc/config/wireless
ucode /lib/wifi/mac80211.uc | uci -q batch

for driver in $DRIVERS; do (
if eval "type detect_$driver" 2>/dev/null >/dev/null; then
Expand Down
Loading

0 comments on commit 2b650ec

Please sign in to comment.