From patchwork Sat Jun 13 16:36:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 1308726 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=phrozen.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=X1I/MMPZ; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49kjtV16C8z9sRK for ; Sun, 14 Jun 2020 02:37:20 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=SUTMkCMaJltbjBubrtDIG4Bz8+WtFVcxSUCdT9+5iSg=; b=X1I/MMPZfXNmsv F28EqzOEhG5/Uwte2hDK1u2wYEsKkn3Fa4lmvtzxIxVMVaO93beWUvKzluHt0lZ3/fZDYuxyamDU6 atmEs0UhLZSE1KRmV5Nl1bmYGUwOkUQJIAQpZNWflByHx3pOUb05B4Kep8T5J5tVE9Vf43A7ui4p5 WuS+JByzRSK/VJA4bhE9MR/AykiM6VnnkiKku46eznYetT/T08dYwR+PlRc47VhDFlu2kGTPHcvSi WxjJHr2ZQ+/W8Oir1UJBsutHY0crynNPz85w8/3xZHbyBrphZVp5ClRScLmqoPq/58KsM4L+dbqiZ 7T7LnINrWN62fcd4em/g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jk99h-000256-2f; Sat, 13 Jun 2020 16:37:17 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jk99d-00023v-6I for openwrt-devel@lists.openwrt.org; Sat, 13 Jun 2020 16:37:15 +0000 Received: from [134.101.206.16] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1jk99W-0001uP-2S; Sat, 13 Jun 2020 18:37:06 +0200 From: John Crispin To: openwrt-devel@lists.openwrt.org Date: Sat, 13 Jun 2020 18:36:59 +0200 Message-Id: <20200613163700.10091-1-john@phrozen.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200613_093713_391676_397CFF8B X-CRM114-Status: UNSURE ( 9.23 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record Subject: [OpenWrt-Devel] [PATCH 1/2] hostapd: add 11AX script support X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Crispin Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Signed-off-by: John Crispin --- package/network/services/hostapd/files/hostapd-basic.config | 2 +- package/network/services/hostapd/files/hostapd-full.config | 2 +- package/network/services/hostapd/files/hostapd-mini.config | 2 +- package/network/services/hostapd/files/hostapd.sh | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd-basic.config b/package/network/services/hostapd/files/hostapd-basic.config index 19ea850f6b..c3726dd552 100644 --- a/package/network/services/hostapd/files/hostapd-basic.config +++ b/package/network/services/hostapd/files/hostapd-basic.config @@ -168,7 +168,7 @@ CONFIG_IEEE80211AC=y # Note: This is experimental and work in progress. The definitions are still # subject to change and this should not be expected to interoperate with the # final IEEE 802.11ax version. -#CONFIG_IEEE80211AX=y +CONFIG_IEEE80211AX=y # Remove debugging code that is printing out debug messages to stdout. # This can be used to reduce the size of the hostapd considerably if debugging diff --git a/package/network/services/hostapd/files/hostapd-full.config b/package/network/services/hostapd/files/hostapd-full.config index 0ecce423e7..118ba000ba 100644 --- a/package/network/services/hostapd/files/hostapd-full.config +++ b/package/network/services/hostapd/files/hostapd-full.config @@ -168,7 +168,7 @@ CONFIG_IEEE80211AC=y # Note: This is experimental and work in progress. The definitions are still # subject to change and this should not be expected to interoperate with the # final IEEE 802.11ax version. -#CONFIG_IEEE80211AX=y +CONFIG_IEEE80211AX=y # Remove debugging code that is printing out debug messages to stdout. # This can be used to reduce the size of the hostapd considerably if debugging diff --git a/package/network/services/hostapd/files/hostapd-mini.config b/package/network/services/hostapd/files/hostapd-mini.config index d9511441e6..8589c41bde 100644 --- a/package/network/services/hostapd/files/hostapd-mini.config +++ b/package/network/services/hostapd/files/hostapd-mini.config @@ -168,7 +168,7 @@ CONFIG_IEEE80211AC=y # Note: This is experimental and work in progress. The definitions are still # subject to change and this should not be expected to interoperate with the # final IEEE 802.11ax version. -#CONFIG_IEEE80211AX=y +CONFIG_IEEE80211AX=y # Remove debugging code that is printing out debug messages to stdout. # This can be used to reduce the size of the hostapd considerably if debugging diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index f4e2aa559c..50573ebd42 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -807,9 +807,9 @@ wpa_supplicant_set_fixed_freq() { VHT*) append network_data "vht=1" "$N$T";; esac case "$htmode" in - VHT80) append network_data "max_oper_chwidth=1" "$N$T";; - VHT160) append network_data "max_oper_chwidth=2" "$N$T";; - VHT20|VHT40) append network_data "max_oper_chwidth=0" "$N$T";; + VHT80|HE80) append network_data "max_oper_chwidth=1" "$N$T";; + VHT160|HE160) append network_data "max_oper_chwidth=2" "$N$T";; + VHT20|VHT40|HE20|HE40) append network_data "max_oper_chwidth=0" "$N$T";; *) append network_data "disable_vht=1" "$N$T";; esac } From patchwork Sat Jun 13 16:37:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 1308727 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=phrozen.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=eHo1ARzb; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49kjtz0pPJz9sRK for ; Sun, 14 Jun 2020 02:37:47 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kV9ONMjlexngW/tpXfPxIpVH/mn+PIYdwtrIyft28x8=; b=eHo1ARzb5qLsm+ QXA16zunvw2OsQafNGrRDB/y61aUHeMtFOwtxZ8S9KpeUHwf6QWHBtdlu2n7ub0aP3zxqcHJZ6aOj oidoZ5DbAxlX+J6YBGzQC5PAjUWjjz9VV1uByDwc0jUMYxU2Yf7NSIZ/cuayihxlB6RQ8rLgMkedQ 9o1cg+Ucs0ZZ6zGufEz6e8C7oUhooQTivOI3ztTe1kFbgSaiecDhrDlGufGrwrr1XfV3YWLMqy35Y bWukUhusUBSxsYkp6bNNadOoXgBcjK7CkQEyvI9Fyy3y/oGGu7R9bikGHE6BG7zZQ0B3jp3fGEip+ esjQqp9lDIyoGRXRBFFg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jk99o-0002Be-Ls; Sat, 13 Jun 2020 16:37:24 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jk99e-00023y-4g for openwrt-devel@lists.openwrt.org; Sat, 13 Jun 2020 16:37:15 +0000 Received: from [134.101.206.16] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1jk99W-0001uP-98; Sat, 13 Jun 2020 18:37:06 +0200 From: John Crispin To: openwrt-devel@lists.openwrt.org Date: Sat, 13 Jun 2020 18:37:00 +0200 Message-Id: <20200613163700.10091-2-john@phrozen.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200613163700.10091-1-john@phrozen.org> References: <20200613163700.10091-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200613_093714_340936_ABFFE7F2 X-CRM114-Status: GOOD ( 11.22 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record Subject: [OpenWrt-Devel] [PATCH 2/2] mac80211: add 11AX script support X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Crispin Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Signed-off-by: John Crispin --- .../files/lib/netifd/wireless/mac80211.sh | 131 ++++++++++++++++-- .../mac80211/files/lib/wifi/mac80211.sh | 7 +- 2 files changed, 128 insertions(+), 10 deletions(-) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 4171af2f60..79f38eca8f 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -55,6 +55,12 @@ drv_mac80211_init_device_config() { short_gi_40 \ max_amsdu \ dsss_cck_40 + config_add_int \ + he_su_beamformer:1 \ + he_su_beamformee:0 \ + he_mu_beamformer:1 \ + he_twt_required:0 \ + he_spr_sr_control:0 } drv_mac80211_init_iface_config() { @@ -95,6 +101,20 @@ mac80211_add_capabilities() { export -n -- "$__var=$__out" } +mac80211_add_he_capabilities() { + local __out= oifs + + oifs="$IFS" + IFS=: + for capab in "$@"; do + set -- $capab + [ "$(($4))" -gt 0 ] || continue + [ "$(((0x$2) & $3))" -gt 0 ] || continue + append base_cfg "$1=1" "$N" + done + IFS="$oifs" +} + mac80211_hostapd_setup_base() { local phy="$1" @@ -118,8 +138,8 @@ mac80211_hostapd_setup_base() { ieee80211n=1 ht_capab= case "$htmode" in - VHT20|HT20) ;; - HT40*|VHT40|VHT80|VHT160) + VHT20|HT20|HE20) ;; + HT40*|VHT40|HE40|VHT80|HE80|VHT160|HE160) case "$hwmode" in a) case "$(( ($channel / 4) % 2 ))" in @@ -191,8 +211,8 @@ mac80211_hostapd_setup_base() { enable_ac=0 idx="$channel" case "$htmode" in - VHT20) enable_ac=1;; - VHT40) + VHT20|HE20) enable_ac=1;; + VHT40|HE40) case "$(( ($channel / 4) % 2 ))" in 1) idx=$(($channel + 2));; 0) idx=$(($channel - 2));; @@ -201,7 +221,7 @@ mac80211_hostapd_setup_base() { append base_cfg "vht_oper_chwidth=0" "$N" append base_cfg "vht_oper_centr_freq_seg0_idx=$idx" "$N" ;; - VHT80) + VHT80|HE80) case "$(( ($channel / 4) % 4 ))" in 1) idx=$(($channel + 6));; 2) idx=$(($channel + 2));; @@ -212,7 +232,7 @@ mac80211_hostapd_setup_base() { append base_cfg "vht_oper_chwidth=1" "$N" append base_cfg "vht_oper_centr_freq_seg0_idx=$idx" "$N" ;; - VHT160) + VHT160|HE160) case "$channel" in 36|40|44|48|52|56|60|64) idx=50;; 100|104|108|112|116|120|124|128) idx=114;; @@ -320,6 +340,99 @@ mac80211_hostapd_setup_base() { [ -n "$vht_capab" ] && append base_cfg "vht_capab=$vht_capab" "$N" fi + # 802.11ax + enable_ax=0 + idx="$channel" + case "$htmode" in + HE20) enable_ax=1;; + HE40) + case "$(( ($channel / 4) % 2 ))" in + 1) idx=$(($channel + 2));; + 0) idx=$(($channel - 2));; + esac + enable_ax=1 + if [ $channel -ge 36 ]; then + append base_cfg "he_oper_chwidth=0" "$N" + append base_cfg "he_oper_centr_freq_seg0_idx=$idx" "$N" + fi + ;; + HE80) + case "$(( ($channel / 4) % 4 ))" in + 1) idx=$(($channel + 6));; + 2) idx=$(($channel + 2));; + 3) idx=$(($channel - 2));; + 0) idx=$(($channel - 6));; + esac + enable_ax=1 + append base_cfg "he_oper_chwidth=1" "$N" + append base_cfg "he_oper_centr_freq_seg0_idx=$idx" "$N" + ;; + HE160) + case "$channel" in + 36|40|44|48|52|56|60|64) idx=50;; + 100|104|108|112|116|120|124|128) idx=114;; + esac + enable_ax=1 + append base_cfg "he_oper_chwidth=2" "$N" + append base_cfg "he_oper_centr_freq_seg0_idx=$idx" "$N" + ;; + esac + + if [ "$enable_ax" != "0" ]; then + json_get_vars \ + he_su_beamformer:1 \ + he_su_beamformee:0 \ + he_mu_beamformer:1 \ + he_twt_required:0 \ + he_spr_sr_control:0 + + append base_cfg "ieee80211ax=1" "$N" + he_phy_cap=$(iw phy "$phy" info | awk -F "[()]" '/HE PHY Capabilities/ { print $2 }' | head -1) + he_phy_cap=${he_phy_cap:2} + he_mac_cap=$(iw phy "$phy" info | awk -F "[()]" '/HE MAC Capabilities/ { print $2 }' | head -1) + he_mac_cap=${he_mac_cap:2} + + mac80211_add_he_capabilities \ + he_su_beamformer:${he_phy_cap:6:2}:0x80:$he_su_beamformer \ + he_su_beamformee:${he_phy_cap:8:2}:0x1:$he_su_beamformee \ + he_mu_beamformer:${he_phy_cap:8:2}:0x2:$he_mu_beamformer \ + he_spr_sr_control:${he_phy_cap:14:2}:0x1:$he_spr_sr_control \ + he_twt_required:${he_mac_cap:0:2}:0x6:$he_twt_required \ + + bsscolor=$(head -1 /dev/urandom | tr -dc '0-9' | head -c2) + bsscolor=$(($bsscolor + 1)) + bsscolor=$(($bsscolor % 63)) + + append base_cfg "he_bss_color=$bsscolor" "$N" + append base_cfg "he_default_pe_duration=4" "$N" + append base_cfg "he_mu_edca_qos_info_param_count=0" "$N" + append base_cfg "he_mu_edca_qos_info_q_ack=0" "$N" + append base_cfg "he_mu_edca_qos_info_queue_request=0" "$N" + append base_cfg "he_mu_edca_qos_info_txop_request=0" "$N" + append base_cfg "he_mu_edca_ac_be_aifsn=8" "$N" + append base_cfg "he_mu_edca_ac_be_aci=0" "$N" + append base_cfg "he_mu_edca_ac_be_ecwmin=9" "$N" + append base_cfg "he_mu_edca_ac_be_ecwmax=10" "$N" + append base_cfg "he_mu_edca_ac_be_timer=255" "$N" + append base_cfg "he_mu_edca_ac_bk_aifsn=15" "$N" + append base_cfg "he_mu_edca_ac_bk_aci=1" "$N" + append base_cfg "he_mu_edca_ac_bk_ecwmin=9" "$N" + append base_cfg "he_mu_edca_ac_bk_ecwmax=10" "$N" + append base_cfg "he_mu_edca_ac_bk_timer=255" "$N" + append base_cfg "he_mu_edca_ac_vi_ecwmin=5" "$N" + append base_cfg "he_mu_edca_ac_vi_ecwmax=7" "$N" + append base_cfg "he_mu_edca_ac_vi_aifsn=5" "$N" + append base_cfg "he_mu_edca_ac_vi_aci=2" "$N" + append base_cfg "he_mu_edca_ac_vi_timer=255" "$N" + append base_cfg "he_mu_edca_ac_vo_aifsn=5" "$N" + append base_cfg "he_mu_edca_ac_vo_aci=3" "$N" + append base_cfg "he_mu_edca_ac_vo_ecwmin=5" "$N" + append base_cfg "he_mu_edca_ac_vo_ecwmax=7" "$N" + append base_cfg "he_mu_edca_ac_vo_timer=255" "$N" + fi + + + hostapd_prepare_device_config "$hostapd_conf_file" nl80211 cat >> "$hostapd_conf_file" <