From patchwork Wed Mar 23 22:54:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 12790184 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16F61C433F5 for ; Wed, 23 Mar 2022 22:55:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345348AbiCWW4a (ORCPT ); Wed, 23 Mar 2022 18:56:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239692AbiCWW43 (ORCPT ); Wed, 23 Mar 2022 18:56:29 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AD2C9024C for ; Wed, 23 Mar 2022 15:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1648076095; x=1679612095; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=oh5yg7KzWxb/vP8i7mSdTsI1YAHykHomDuyvN6dmt9U=; b=zmDN6r7SYnKc+ywZEJ/o9OPwgRJT1iKQ59FOjgD6P/nSBdCMcpPnBQcm EcCS2oa1Fk4EdXy3PAhdmvbrfMG3tI+nltwYQQNFG4qDuxWm6AlCSNjWo q9Q4NXU+aBP1LbcmCj4kZTI7nJIS1nE9HTpEoadDu2TJP4saVkxzVkMf/ I=; Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 23 Mar 2022 15:54:55 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2022 15:54:55 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 23 Mar 2022 15:54:54 -0700 Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 23 Mar 2022 15:54:54 -0700 From: Aloka Dixit To: , CC: Vikram Kandukuri , Aloka Dixit , Veerendranath Jakkam Subject: [PATCH v2 1/3] nl80211: retrieve EHT capabilities in AP mode Date: Wed, 23 Mar 2022 15:54:41 -0700 Message-ID: <20220323225443.13947-1-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Vikram Kandukuri Add support to retrieve the EHT capabilities element passed by the userspace in the beacon template and store the pointer in struct cfg80211_ap_settings to be used by MAC80211. Signed-off-by: Vikram Kandukuri Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit Co-developed-by: Veerendranath Jakkam Signed-off-by: Veerendranath Jakkam --- v2: Rebased on top of wireless-next git repository include/net/cfg80211.h | 2 ++ net/wireless/nl80211.c | 3 +++ 2 files changed, 5 insertions(+) base-commit: f5ba9781dde28f87d1e6db580ab63b308b5b5e1b diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 68713388b617..845db70a9473 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -1285,6 +1285,7 @@ struct cfg80211_unsol_bcast_probe_resp { * @ht_cap: HT capabilities (or %NULL if HT isn't enabled) * @vht_cap: VHT capabilities (or %NULL if VHT isn't enabled) * @he_cap: HE capabilities (or %NULL if HE isn't enabled) + * @eht_cap: EHT capabilities (or %NULL if EHT isn't enabled) * @ht_required: stations must support HT * @vht_required: stations must support VHT * @twt_responder: Enable Target Wait Time @@ -1322,6 +1323,7 @@ struct cfg80211_ap_settings { const struct ieee80211_vht_cap *vht_cap; const struct ieee80211_he_cap_elem *he_cap; const struct ieee80211_he_operation *he_oper; + const struct ieee80211_eht_cap_elem *eht_cap; bool ht_required, vht_required, he_required, sae_h2e_required; bool twt_responder; u32 flags; diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index ee1c2b6b6971..71946ad89059 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -5442,6 +5442,9 @@ static void nl80211_calculate_ap_params(struct cfg80211_ap_settings *params) cap = cfg80211_find_ext_elem(WLAN_EID_EXT_HE_OPERATION, ies, ies_len); if (cap && cap->datalen >= sizeof(*params->he_oper) + 1) params->he_oper = (void *)(cap->data + 1); + cap = cfg80211_find_ext_elem(WLAN_EID_EXT_EHT_CAPABILITY, ies, ies_len); + if (cap && cap->datalen >= sizeof(*params->eht_cap) + 1) + params->eht_cap = (void *)(cap->data + 1); } static bool nl80211_get_ap_channel(struct cfg80211_registered_device *rdev, From patchwork Wed Mar 23 22:54:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 12790185 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C07FC433EF for ; Wed, 23 Mar 2022 22:55:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345359AbiCWW4b (ORCPT ); Wed, 23 Mar 2022 18:56:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345352AbiCWW4a (ORCPT ); Wed, 23 Mar 2022 18:56:30 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06EF490258 for ; Wed, 23 Mar 2022 15:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1648076096; x=1679612096; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5ZbuTHgf62vbvoTzyNHT+m+aU3c9Rm7X0ugWTjeC1c4=; b=XjgCYcF+wKZ2mGPiURO52csFKnRWV51TB/vx68lJbyFcd1U/ImrsH7gi LjIdesTaQAsePzcnLcFlzh+/r32yW9mQbmRR12y8Rv+ILc8XL6jTCtptY O20W7DMxo6XXUVkZ6aHTaA9osWFTujSnIa7rEziixNRz7kHhWR5z1ntJx U=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-01.qualcomm.com with ESMTP; 23 Mar 2022 15:54:55 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2022 15:54:55 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 23 Mar 2022 15:54:55 -0700 Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 23 Mar 2022 15:54:54 -0700 From: Aloka Dixit To: , CC: Aloka Dixit Subject: [PATCH v2 2/3] nl80211: retrieve EHT operation element in AP mode Date: Wed, 23 Mar 2022 15:54:42 -0700 Message-ID: <20220323225443.13947-2-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220323225443.13947-1-quic_alokad@quicinc.com> References: <20220323225443.13947-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Add support to retrieve the EHT operation element passed by the userspace in the beacon template and store the pointer in struct cfg80211_ap_settings to be used by MAC80211. Signed-off-by: Aloka Dixit --- v2: Rebased on top of wireless-next git repository include/net/cfg80211.h | 2 ++ net/wireless/nl80211.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 845db70a9473..45d676d0f61e 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -1295,6 +1295,7 @@ struct cfg80211_unsol_bcast_probe_resp { * @he_obss_pd: OBSS Packet Detection settings * @he_bss_color: BSS Color settings * @he_oper: HE operation IE (or %NULL if HE isn't enabled) + * @eht_oper: EHT operation IE (or %NULL if EHT isn't enabled) * @fils_discovery: FILS discovery transmission parameters * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters * @mbssid_config: AP settings for multiple bssid @@ -1324,6 +1325,7 @@ struct cfg80211_ap_settings { const struct ieee80211_he_cap_elem *he_cap; const struct ieee80211_he_operation *he_oper; const struct ieee80211_eht_cap_elem *eht_cap; + const struct ieee80211_eht_operation *eht_oper; bool ht_required, vht_required, he_required, sae_h2e_required; bool twt_responder; u32 flags; diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 71946ad89059..c16d554a1819 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -5445,6 +5445,9 @@ static void nl80211_calculate_ap_params(struct cfg80211_ap_settings *params) cap = cfg80211_find_ext_elem(WLAN_EID_EXT_EHT_CAPABILITY, ies, ies_len); if (cap && cap->datalen >= sizeof(*params->eht_cap) + 1) params->eht_cap = (void *)(cap->data + 1); + cap = cfg80211_find_ext_elem(WLAN_EID_EXT_EHT_OPERATION, ies, ies_len); + if (cap && cap->datalen >= sizeof(*params->eht_oper) + 1) + params->eht_oper = (void *)(cap->data + 1); } static bool nl80211_get_ap_channel(struct cfg80211_registered_device *rdev, From patchwork Wed Mar 23 22:54:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 12790186 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FA94C433FE for ; Wed, 23 Mar 2022 22:55:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345363AbiCWW4c (ORCPT ); Wed, 23 Mar 2022 18:56:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239692AbiCWW4b (ORCPT ); Wed, 23 Mar 2022 18:56:31 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86E509025B for ; Wed, 23 Mar 2022 15:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1648076096; x=1679612096; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MMRubxy4Ea09HKOuAvEbRBAJSSN5c8nMaNgnkBvqWNc=; b=hR9C9RvtA0e4NJU8d8kJ4+MRSU9PsI7WXoMFklo9FWr++4puesqRJTAa CsB8/PwTU3UC+PPP5du6VNghECSbJ/Isr9S4X1Iy/UNG+FzK9RQZNJOlj OKnTpErTN8u0ZuxnAdknQ5szV30S3JWyyGWVzBBL735j6/dXFgllleco/ 0=; Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-02.qualcomm.com with ESMTP; 23 Mar 2022 15:54:56 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg03-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2022 15:54:56 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 23 Mar 2022 15:54:55 -0700 Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 23 Mar 2022 15:54:55 -0700 From: Aloka Dixit To: , CC: Aloka Dixit Subject: [PATCH v2 3/3] mac80211: EHT operation element support in AP mode Date: Wed, 23 Mar 2022 15:54:43 -0700 Message-ID: <20220323225443.13947-3-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220323225443.13947-1-quic_alokad@quicinc.com> References: <20220323225443.13947-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Add new parameters to struct ieee80211_bss_conf for EHT operation element data in AP mode. Signed-off-by: Aloka Dixit --- v2: Rebased on top of wireless-next git repository include/net/mac80211.h | 7 +++++++ net/mac80211/cfg.c | 8 ++++++++ net/mac80211/eht.c | 11 +++++++++++ net/mac80211/ieee80211_i.h | 2 ++ 4 files changed, 28 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 382ebb862ea8..b3ab1f7cc2fb 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -637,6 +637,8 @@ struct ieee80211_fils_discovery { * @tx_pwr_env_num: number of @tx_pwr_env. * @pwr_reduction: power constraint of BSS. * @eht_support: does this BSS support EHT + * @eht_oper: EHT operation information of the BSS (AP/Mesh) or of the AP we + * are connected to (STA). */ struct ieee80211_bss_conf { const u8 *bssid; @@ -712,6 +714,11 @@ struct ieee80211_bss_conf { u8 tx_pwr_env_num; u8 pwr_reduction; bool eht_support; + struct { + u8 chan_width; + u8 ccfs; + u8 present_bm; + } eht_oper; }; /** diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index ba752539d1d9..01f3db0f20c6 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1177,6 +1177,14 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, changed |= BSS_CHANGED_HE_BSS_COLOR; } + if (params->eht_cap && params->eht_oper) { + if (!sdata->vif.bss_conf.he_support) + return -EOPNOTSUPP; + + sdata->vif.bss_conf.eht_support = true; + ieee80211_eht_op_ie_to_bss_conf(&sdata->vif, params->eht_oper); + } + if (sdata->vif.type == NL80211_IFTYPE_AP && params->mbssid_config.tx_wdev) { err = ieee80211_set_ap_mbssid_options(sdata, diff --git a/net/mac80211/eht.c b/net/mac80211/eht.c index 364ad0ef7692..243dfcfaf7b2 100644 --- a/net/mac80211/eht.c +++ b/net/mac80211/eht.c @@ -74,3 +74,14 @@ ieee80211_eht_cap_ie_to_sta_eht_cap(struct ieee80211_sub_if_data *sdata, sta->cur_max_bandwidth = ieee80211_sta_cap_rx_bw(sta); sta->sta.bandwidth = ieee80211_sta_cur_vht_bw(sta); } + +void ieee80211_eht_op_ie_to_bss_conf(struct ieee80211_vif *vif, + const struct ieee80211_eht_operation *op_ie) +{ + if (!op_ie) + return; + + vif->bss_conf.eht_oper.chan_width = op_ie->chan_width; + vif->bss_conf.eht_oper.ccfs = op_ie->ccfs; + vif->bss_conf.eht_oper.present_bm = op_ie->present_bm; +} diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index d4a7ba4a8202..f6f5efa7d987 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -2550,4 +2550,6 @@ ieee80211_eht_cap_ie_to_sta_eht_cap(struct ieee80211_sub_if_data *sdata, const u8 *he_cap_ie, u8 he_cap_len, const struct ieee80211_eht_cap_elem *eht_cap_ie_elem, u8 eht_cap_len, struct sta_info *sta); +void ieee80211_eht_op_ie_to_bss_conf(struct ieee80211_vif *vif, + const struct ieee80211_eht_operation *eht_op); #endif /* IEEE80211_I_H */