From patchwork Thu Jun 13 05:31:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miles Hu X-Patchwork-Id: 1114961 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hoY8wOyh"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=codeaurora.org header.i=@codeaurora.org header.b="ACNVhOfw"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="KT2NVSb0"; 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 45PXRr4Ytvz9s1c for ; Thu, 13 Jun 2019 15:32:08 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject: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=9r5ynfcXm1CFxheniNu1NFh1gUYJQ/8Oe2v1Xcliym4=; b=hoY 8wOyhFA5COmAH/5Nu7ehyyHgTNrxWFYcndV3Ie2zxLcSBjyOWmYlEXZtIZYeWUr43jPxIcqtFNynw Tg13z6DGpbzVQocJFQYD0A4d2yBl4kkzgzPREstkQqJ33y6M6wA2pMIUCVp7eBtWRmPtQBa5EXxjv f3X1ZGrIR7sR8Y2vgeCYOFI8elxB3G8juljrHdDrikHUbC/7iHZtbxgCbkoYuFa11EAMFo3o348JB skaW8aXfq3o7W3fxqJVF93IdWkNQUAvSpWKMWuC4O3NCvSxw4paTj7GyWj1ZjkBpO6rv1RrQJz7NC usw4jUgjeHm40As0/lubFqONjU+Vkjw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hbILA-00077U-6m; Thu, 13 Jun 2019 05:32:00 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hbIL6-00077A-VW for hostap@lists.infradead.org; Thu, 13 Jun 2019 05:31:58 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 276AC6038E; Thu, 13 Jun 2019 05:31:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1560403916; bh=78f+cppbHlmiz017eOTZsx0Mwq0VUEU4Rh7ouP5J5J4=; h=From:To:Cc:Subject:Date:From; b=ACNVhOfwejz3hp38KCRmRaXNlhyRi2gJEqWD/y4XbLKHlt2C3t0T3Cq5sc8oaAgKA o7mrrD8foTxnA+WZyXoOxAT2/+2MjpLSSESK+pJeDhpEu8t7CDznafDGEDDpohecXC WRu9nJ6MEPH/qLo/i//EB8/Ud1I+CGRA9w+fdvPU= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED,SPF_NONE autolearn=no autolearn_force=no version=3.4.0 Received: from smtp.codeaurora.org (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: milehu@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 788B86038E; Thu, 13 Jun 2019 05:31:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1560403915; bh=78f+cppbHlmiz017eOTZsx0Mwq0VUEU4Rh7ouP5J5J4=; h=From:To:Cc:Subject:Date:From; b=KT2NVSb0nN5CIjpGHBZSc2X7GC7yy2ndEW1R0WOMGmO8Gju0+caq/nllKxHxPY+iy cETVhHd83KUVyNk3gso2ahuLOWe7y5lXolJqnNGSlokXa13MSYaQ7RamA1UVKpHOzE nzqd3a+v20ONf8aCrzIZZM3M7dXZs2ys6f+Dctq0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 788B86038E Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=milehu@codeaurora.org Received: by smtp.codeaurora.org (sSMTP sendmail emulation); Wed, 12 Jun 2019 22:31:53 -0700 From: Miles Hu To: hostap@lists.infradead.org Subject: [PATCH] hostapd: add HE cross check Date: Wed, 12 Jun 2019 22:31:52 -0700 Message-Id: <1560403912-27385-1-git-send-email-milehu@codeaurora.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190612_223157_053074_FED66CC5 X-CRM114-Status: GOOD ( 13.53 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [198.145.29.96 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Miles Hu MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Cross check between firmware and hostapd config capabilities. Signed-off-by: Miles Hu --- src/ap/hw_features.c | 53 ++++++++++++++++++++++++++++++++++++++++++++ src/common/ieee802_11_defs.h | 12 +++++++++- 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c index fec1a78..f1d8418 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c @@ -657,8 +657,60 @@ static int ieee80211ac_supported_vht_capab(struct hostapd_iface *iface) #ifdef CONFIG_IEEE80211AX +static int _ieee80211he_cap_check(u8 *hw, u32 offset, u8 bits) +{ + if (bits & hw[offset]) + return 1; + + return 0; +} + static int ieee80211ax_supported_he_capab(struct hostapd_iface *iface) { + struct hostapd_hw_modes *mode = iface->current_mode; + struct he_capabilities *hw = &mode->he_capab; + struct hostapd_config *conf = iface->conf; + u32 cap_ulmimo = 0, cap_ulofdma = 0; + +#define HE_CAP_CHECK(hw_cap, cap, bytes, conf) \ + do { \ + if (conf && !_ieee80211he_cap_check(hw_cap, bytes, cap)) { \ + wpa_printf(MSG_ERROR, "Driver does not support configured" \ + " HE capability [%s]", #cap); \ + return 0; \ + } \ + } while (0) + +#define HE_CAP_CHECK2(hw_cap, cap, bytes, cap1, bytes1, conf) \ + do { \ + if (conf && !(_ieee80211he_cap_check(hw_cap, bytes, cap) || \ + _ieee80211he_cap_check(hw_cap, bytes1, cap1))) { \ + wpa_printf(MSG_ERROR, "Driver does not support configured HE" \ + " capability [%s-%s]", #cap, #cap1); \ + return 0; \ + } \ + } while (0) + + HE_CAP_CHECK(hw->phy_cap, HE_PHYCAP_SU_BEAMFORMER_CAPAB, + HE_PHYCAP_SU_BEAMFORMER_CAPAB_IDX, + conf->he_phy_capab.he_su_beamformer); + HE_CAP_CHECK(hw->phy_cap, HE_PHYCAP_SU_BEAMFORMEE_CAPAB, + HE_PHYCAP_SU_BEAMFORMEE_CAPAB_IDX, + conf->he_phy_capab.he_su_beamformee); + HE_CAP_CHECK(hw->phy_cap, HE_PHYCAP_MU_BEAMFORMER_CAPAB, + HE_PHYCAP_MU_BEAMFORMER_CAPAB_IDX, + conf->he_phy_capab.he_mu_beamformer); + HE_CAP_CHECK(hw->phy_cap, HE_PHYCAP_SPR_SR_CAPB, + HE_PHYCAP_SPR_SR_CAPB_IDX, conf->spr.sr_control); + + HE_CAP_CHECK2(hw->phy_cap, HE_PHYCAP_UL_MUMIMO_CAPB, + HE_PHYCAP_UL_MUMIMO_CAPB_IDX, HE_PHYCAP_UL_MUOFDMA_CAPB, + HE_PHYCAP_UL_MUOFDMA_CAPB_IDX, conf->he_mu_edca.he_qos_info); + + HE_CAP_CHECK2(hw->mac_cap, HE_MACCAP_TWT_REQUESTER, HE_MACCAP_TWT_REQUESTER_IDX, + HE_MACCAP_TWT_RESPONDER, HE_MACCAP_TWT_RESPONDER_IDX, + conf->he_op.he_twt_required); + return 1; } #endif /* CONFIG_IEEE80211AX */ @@ -670,6 +722,7 @@ int hostapd_check_ht_capab(struct hostapd_iface *iface) { #ifdef CONFIG_IEEE80211N int ret; + if (!iface->conf->ieee80211n) return 0; diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index 12c004f..b1f9769 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -2139,7 +2139,10 @@ struct ieee80211_spatial_reuse { /* HE Capabilities Information defines */ -#define HE_MACCAP_TWT_RESPONDER ((u8) BIT(3)) +#define HE_MACCAP_TWT_REQUESTER_IDX 0 +#define HE_MACCAP_TWT_REQUESTER ((u8) BIT(1)) +#define HE_MACCAP_TWT_RESPONDER_IDX 0 +#define HE_MACCAP_TWT_RESPONDER ((u8) BIT(2)) #define HE_PHYCAP_CHANNEL_WIDTH_SET_IDX 0 #define HE_PHYCAP_CHANNEL_WIDTH_MASK ((u8) (BIT(1) | BIT(2) | \ @@ -2156,6 +2159,13 @@ struct ieee80211_spatial_reuse { #define HE_PHYCAP_MU_BEAMFORMER_CAPAB_IDX 4 #define HE_PHYCAP_MU_BEAMFORMER_CAPAB ((u8) BIT(1)) +#define HE_PHYCAP_UL_MUMIMO_CAPB_IDX 2 +#define HE_PHYCAP_UL_MUMIMO_CAPB ((u8) BIT(6)) +#define HE_PHYCAP_UL_MUOFDMA_CAPB_IDX 2 +#define HE_PHYCAP_UL_MUOFDMA_CAPB ((u8) BIT(7)) +#define HE_PHYCAP_SPR_SR_CAPB_IDX 7 +#define HE_PHYCAP_SPR_SR_CAPB ((u8) BIT(0)) + #define HE_PHYCAP_PPE_THRESHOLD_PRESENT_IDX 6 #define HE_PHYCAP_PPE_THRESHOLD_PRESENT ((u8) BIT(7))