Skip to content

Commit

Permalink
Merge pull request #9 from danpawlik/be14-janusz-v11-luci
Browse files Browse the repository at this point in the history
Be14 janusz v11 luci
  • Loading branch information
nextgen-networks authored Sep 27, 2024
2 parents a4c95f1 + 22343ff commit 543fb96
Show file tree
Hide file tree
Showing 13 changed files with 214 additions and 92 deletions.
2 changes: 1 addition & 1 deletion feeds.conf.default
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
src-git packages https://git.openwrt.org/feed/packages.git
src-git luci https://git.openwrt.org/project/luci.git
src-git luci https://github.com/danpawlik/luci.git;14be
src-git routing https://git.openwrt.org/feed/routing.git
src-git telephony https://git.openwrt.org/feed/telephony.git
#src-git video https://github.com/openwrt/video.git
Expand Down
2 changes: 1 addition & 1 deletion package/kernel/mac80211/ath.mk
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ define KernelPackage/ath12k
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath12k
DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11AC_SUPPORT +@DRIVER_11AX_SUPPORT \
+kmod-crypto-michael-mic +kmod-qrtr-mhi \
+kmod-qcom-qmi-helpers
+kmod-qcom-qmi-helpers +@DRIVER_11BE_SUPPORT
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath12k/ath12k.ko
AUTOLOAD:=$(call AutoProbe,ath12k)
endef
Expand Down
11 changes: 6 additions & 5 deletions package/kernel/mt76/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=

PKG_SOURCE_URL:=https://github.com/openwrt/mt76
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2024-09-05
PKG_SOURCE_VERSION:=65cc3daf2a332cc658e9f7438cdadde4392e672e
PKG_MIRROR_HASH:=c29c4f883051a6360119156a03e010ac11573011b23d9e873f83c720600970e7
PKG_SOURCE_DATE:=2024-09-27
PKG_SOURCE_VERSION:=addfbd141863a83ddf1dff60e1d85ff553b2b61e
# PKG_MIRROR_HASH:=c29c4f883051a6360119156a03e010ac11573011b23d9e873f83c720600970e7

PKG_MAINTAINER:=Felix Fietkau <[email protected]>
PKG_USE_NINJA:=0
Expand Down Expand Up @@ -318,7 +318,8 @@ endef
define KernelPackage/mt7996e
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7996E wireless driver
DEPENDS+=@PCI_SUPPORT +kmod-mt76-connac +kmod-hwmon-core +@DRIVER_11AX_SUPPORT +@KERNEL_RELAY
DEPENDS+=@PCI_SUPPORT +kmod-mt76-connac +kmod-hwmon-core +@DRIVER_11AX_SUPPORT \
+@KERNEL_RELAY +@DRIVER_11BE_SUPPORT
FILES:= $(PKG_BUILD_DIR)/mt7996/mt7996e.ko
AUTOLOAD:=$(call AutoProbe,mt7996e)
endef
Expand All @@ -339,7 +340,7 @@ define KernelPackage/mt7925-common
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7925 wireless driver common code
HIDDEN:=1
DEPENDS+=+kmod-mt792x-common +@DRIVER_11AX_SUPPORT +kmod-hwmon-core
DEPENDS+=+kmod-mt792x-common +@DRIVER_11AX_SUPPORT +kmod-hwmon-core +@DRIVER_11BE_SUPPORT
FILES:= $(PKG_BUILD_DIR)/mt7925/mt7925-common.ko
endef

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,77 +159,79 @@ mac80211_hostapd_setup_base() {
chan_ofs=0
[ "$band" = "6g" ] && chan_ofs=1

ieee80211n=1
ht_capab=
case "$htmode" in
VHT20|HT20|HE20) ;;
HT40*|VHT40|VHT80|VHT160|HE40|HE80|HE160)
case "$hwmode" in
a)
case "$(( (($channel / 4) + $chan_ofs) % 2 ))" in
1) ht_capab="[HT40+]";;
0) ht_capab="[HT40-]";;
esac
;;
*)
case "$htmode" in
HT40+) ht_capab="[HT40+]";;
HT40-) ht_capab="[HT40-]";;
*)
if [ "$channel" -lt 7 ]; then
ht_capab="[HT40+]"
else
ht_capab="[HT40-]"
fi
;;
esac
;;
esac
[ "$auto_channel" -gt 0 ] && ht_capab="[HT40+]"
;;
*) ieee80211n= ;;
esac

[ -n "$ieee80211n" ] && {
append base_cfg "ieee80211n=1" "$N"

set_default ht_coex 0
append base_cfg "ht_coex=$ht_coex" "$N"

json_get_vars \
ldpc:1 \
greenfield:0 \
short_gi_20:1 \
short_gi_40:1 \
tx_stbc:1 \
rx_stbc:3 \
max_amsdu:1 \
dsss_cck_40:1

ht_cap_mask=0
for cap in $(iw phy "$phy" info | grep 'Capabilities:' | cut -d: -f2); do
ht_cap_mask="$(($ht_cap_mask | $cap))"
done
if [ "$band" != "6g" ]; then
ieee80211n=1
ht_capab=
case "$htmode" in
VHT20|HT20|HE20|EHT20) ;;
HT40*|VHT40|VHT80|VHT160|HE40|HE80|HE160|EHT40|EHT80|EHT160)
case "$hwmode" in
a)
case "$(( (($channel / 4) + $chan_ofs) % 2 ))" in
1) ht_capab="[HT40+]";;
0) ht_capab="[HT40-]";;
esac
;;
*)
case "$htmode" in
HT40+) ht_capab="[HT40+]";;
HT40-) ht_capab="[HT40-]";;
*)
if [ "$channel" -lt 7 ]; then
ht_capab="[HT40+]"
else
ht_capab="[HT40-]"
fi
;;
esac
;;
esac
[ "$auto_channel" -gt 0 ] && ht_capab="[HT40+]"
;;
*) ieee80211n= ;;
esac

cap_rx_stbc=$((($ht_cap_mask >> 8) & 3))
[ "$rx_stbc" -lt "$cap_rx_stbc" ] && cap_rx_stbc="$rx_stbc"
ht_cap_mask="$(( ($ht_cap_mask & ~(0x300)) | ($cap_rx_stbc << 8) ))"

mac80211_add_capabilities ht_capab_flags $ht_cap_mask \
LDPC:0x1::$ldpc \
GF:0x10::$greenfield \
SHORT-GI-20:0x20::$short_gi_20 \
SHORT-GI-40:0x40::$short_gi_40 \
TX-STBC:0x80::$tx_stbc \
RX-STBC1:0x300:0x100:1 \
RX-STBC12:0x300:0x200:1 \
RX-STBC123:0x300:0x300:1 \
MAX-AMSDU-7935:0x800::$max_amsdu \
DSSS_CCK-40:0x1000::$dsss_cck_40

ht_capab="$ht_capab$ht_capab_flags"
[ -n "$ht_capab" ] && append base_cfg "ht_capab=$ht_capab" "$N"
}
[ -n "$ieee80211n" ] && {
append base_cfg "ieee80211n=1" "$N"

set_default ht_coex 0
append base_cfg "ht_coex=$ht_coex" "$N"

json_get_vars \
ldpc:1 \
greenfield:0 \
short_gi_20:1 \
short_gi_40:1 \
tx_stbc:1 \
rx_stbc:3 \
max_amsdu:1 \
dsss_cck_40:1

ht_cap_mask=0
for cap in $(iw phy "$phy" info | grep 'Capabilities:' | cut -d: -f2); do
ht_cap_mask="$(($ht_cap_mask | $cap))"
done

cap_rx_stbc=$((($ht_cap_mask >> 8) & 3))
[ "$rx_stbc" -lt "$cap_rx_stbc" ] && cap_rx_stbc="$rx_stbc"
ht_cap_mask="$(( ($ht_cap_mask & ~(0x300)) | ($cap_rx_stbc << 8) ))"

mac80211_add_capabilities ht_capab_flags $ht_cap_mask \
LDPC:0x1::$ldpc \
GF:0x10::$greenfield \
SHORT-GI-20:0x20::$short_gi_20 \
SHORT-GI-40:0x40::$short_gi_40 \
TX-STBC:0x80::$tx_stbc \
RX-STBC1:0x300:0x100:1 \
RX-STBC12:0x300:0x200:1 \
RX-STBC123:0x300:0x300:1 \
MAX-AMSDU-7935:0x800::$max_amsdu \
DSSS_CCK-40:0x1000::$dsss_cck_40

ht_capab="$ht_capab$ht_capab_flags"
[ -n "$ht_capab" ] && append base_cfg "ht_capab=$ht_capab" "$N"
}
fi

# 802.11ac
enable_ac=0
Expand All @@ -238,16 +240,16 @@ mac80211_hostapd_setup_base() {

idx="$channel"
case "$htmode" in
VHT20|HE20) enable_ac=1;;
VHT40|HE40)
VHT20|HE20|EHT20) enable_ac=1;;
VHT40|HE40|EHT40)
case "$(( (($channel / 4) + $chan_ofs) % 2 ))" in
1) idx=$(($channel + 2));;
0) idx=$(($channel - 2));;
esac
enable_ac=1
vht_center_seg0=$idx
;;
VHT80|HE80)
VHT80|HE80|EHT80)
case "$(( (($channel / 4) + $chan_ofs) % 4 ))" in
1) idx=$(($channel + 6));;
2) idx=$(($channel + 2));;
Expand All @@ -258,7 +260,7 @@ mac80211_hostapd_setup_base() {
vht_oper_chwidth=1
vht_center_seg0=$idx
;;
VHT160|HE160)
VHT160|HE160|EHT160|EHT320)
if [ "$band" = "6g" ]; then
case "$channel" in
1|5|9|13|17|21|25|29) idx=15;;
Expand Down Expand Up @@ -286,15 +288,32 @@ mac80211_hostapd_setup_base() {

[ "$background_radar" -eq 1 ] && append base_cfg "enable_background_radar=1" "$N"
}

eht_oper_chwidth=$vht_oper_chwidth
eht_center_seg0=$vht_center_seg0

[ "$band" = "6g" ] && {
op_class=
case "$htmode" in
HE20) op_class=131;;
HE*) op_class=$((132 + $vht_oper_chwidth))
HE20|EHT20) op_class=131;;
EHT320)
case "$channel" in
1|5|9|13|17|21|25|29|33|37|41|45|49|53|57|61) idx=31;;
65|69|73|77|81|85|89|93|97|101|105|109|113|117|121|125) idx=95;;
129|133|137|141|145|149|153|157|161|165|169|173|177|181|185|189) idx=159;;
193|197|201|205|209|213|217|221) idx=191;;
esac

op_class=137
eht_center_seg0=$idx
eht_oper_chwidth=9
;;
HE*|EHT*) op_class=$((132 + $vht_oper_chwidth));;
esac
[ -n "$op_class" ] && append base_cfg "op_class=$op_class" "$N"
}
[ "$hwmode" = "a" ] || enable_ac=0
[ "$band" = "6g" ] && enable_ac=0

if [ "$enable_ac" != "0" ]; then
json_get_vars \
Expand Down Expand Up @@ -417,8 +436,10 @@ mac80211_hostapd_setup_base() {

# 802.11ax
enable_ax=0
enable_be=0
case "$htmode" in
HE*) enable_ax=1 ;;
EHT*) enable_ax=1; enable_be=1 ;;
esac

if [ "$enable_ax" != "0" ]; then
Expand Down Expand Up @@ -492,6 +513,14 @@ mac80211_hostapd_setup_base() {
append base_cfg "he_mu_edca_ac_vo_timer=255" "$N"
fi

if [ "$enable_be" != "0" ]; then
append base_cfg "ieee80211be=1" "$N"
[ "$hwmode" = "a" ] && {
append base_cfg "eht_oper_chwidth=$eht_oper_chwidth" "$N"
append base_cfg "eht_oper_centr_freq_seg0_idx=$eht_center_seg0" "$N"
}
fi

hostapd_prepare_device_config "$hostapd_conf_file" nl80211
cat >> "$hostapd_conf_file" <<EOF
${channel:+channel=$channel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { readfile } from "fs";
import * as uci from 'uci';

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

let board = json(readfile("/etc/board.json"));
if (!board.wlan)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,20 @@ function wiphy_detect() {
if (band.vht_capa > 0)
band_info.vht = true;
let he_phy_cap = 0;
let eht_phy_cap = 0;
for (let ift in band.iftype_data) {
if (!ift.he_cap_phy)
continue;
band_info.he = true;
he_phy_cap |= ift.he_cap_phy[0];
/* TODO: EHT */
if (!ift.eht_cap_phy)
continue;
band_info.eht = true;
eht_phy_cap |= ift.eht_cap_phy[0];
}
if (band_name != "2G" &&
Expand All @@ -138,14 +144,19 @@ function wiphy_detect() {
push(modes, "VHT20");
if (band_info.he)
push(modes, "HE20");
if (band_info.eht)
push(modes, "EHT20");
if (band.ht_capa & 0x2) {
push(modes, "HT40");
if (band_info.vht)
push(modes, "VHT40")
}
if (he_phy_cap & 0x2)
if (he_phy_cap & 2)
push(modes, "HE40");
if (eht_phy_cap && he_phy_cap & 2)
push(modes, "EHT40");
for (let freq in band.freqs) {
if (freq.disabled)
continue;
Expand All @@ -158,14 +169,26 @@ function wiphy_detect() {
if (band_name == "2G")
continue;
if (he_phy_cap & 4)
push(modes, "HE40");
if (eht_phy_cap && he_phy_cap & 4)
push(modes, "EHT40");
if (band_info.vht)
push(modes, "VHT80");
if (he_phy_cap & 4)
push(modes, "HE80");
if (eht_phy_cap && he_phy_cap & 4)
push(modes, "EHT80");
if ((band.vht_capa >> 2) & 0x3)
push(modes, "VHT160");
if (he_phy_cap & 0x18)
push(modes, "HE160");
if (eht_phy_cap && he_phy_cap & 0x18)
push(modes, "EHT160");
if (eht_phy_cap & 2)
push(modes, "ETH320");
}
let entry = wiphy_get_entry(name, path);
Expand Down
4 changes: 4 additions & 0 deletions package/network/services/hostapd/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ config DRIVER_11AX_SUPPORT
default n
select WPA_MBO_SUPPORT

config DRIVER_11BE_SUPPORT
bool
default n

config WPA_ENABLE_WEP
bool "Enable support for unsecure and obsolete WEP"
depends on PACKAGE_hostapd-common
Expand Down
Loading

0 comments on commit 543fb96

Please sign in to comment.