From patchwork Tue Dec 8 22:54:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muna Sinada X-Patchwork-Id: 11959993 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 X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B453CC1B0D9 for ; Tue, 8 Dec 2020 22:55:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8717523A7B for ; Tue, 8 Dec 2020 22:55:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731553AbgLHWzN (ORCPT ); Tue, 8 Dec 2020 17:55:13 -0500 Received: from m43-15.mailgun.net ([69.72.43.15]:16831 "EHLO m43-15.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731551AbgLHWzM (ORCPT ); Tue, 8 Dec 2020 17:55:12 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1607468089; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=M4C8Hv3trDh1UuYvfdljSvHf3EmvTxzIJ9NvbIQLttQ=; b=Pe8uiZKhyvC08oTmbX3jFfFrcepp866RCCVwAZ9f+L2SgVsnC22KLyYeLH2dV4LzWxA+q7YL VVvwEoyveKczRV0UxtS6dvzjP8mkrbjq966QQTgJQ46czcMj/vQmduCezqxp9Ff33aEXGH78 ENmh5pkFQwey8YaPWdJEfUHHVPI= X-Mailgun-Sending-Ip: 69.72.43.15 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 5fd0041c2265ffd861ae1682 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 08 Dec 2020 22:54:20 GMT Sender: msinada=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 1B4D4C433CA; Tue, 8 Dec 2020 22:54:20 +0000 (UTC) Received: from msinada-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: msinada) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3DEB2C433ED; Tue, 8 Dec 2020 22:54:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3DEB2C433ED Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=msinada@codeaurora.org From: Muna Sinada To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Muna Sinada Subject: [PATCH 1/2] cfg80211: Handling driver updated MU-EDCA params Date: Tue, 8 Dec 2020 14:54:03 -0800 Message-Id: <1607468044-31789-1-git-send-email-msinada@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Added necessary functions and attributes to be able to pass driver updated MU-EDCA parameters from mac80211 to user space. Signed-off-by: Muna Sinada --- include/net/cfg80211.h | 12 ++++++++++++ include/uapi/linux/nl80211.h | 10 ++++++++++ net/wireless/nl80211.c | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index ab249ca5d5d1..83e6101ad681 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -8038,4 +8038,16 @@ void cfg80211_update_owe_info_event(struct net_device *netdev, */ void cfg80211_bss_flush(struct wiphy *wiphy); +/** + * cfg80211_update_muedca_params_event - Notify the updated MU-EDCA parameters + * to user space. + * + * @wiphy: the wiphy + * @params: Updated MU-EDCA parameters + * @gfp: allocation flags + */ +void cfg80211_update_muedca_params_event(struct wiphy *wiphy, + struct ieee80211_mu_edca_param_set + *params, gfp_t gfp); + #endif /* __NET_CFG80211_H */ diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 3e0d4a038ab6..0cd2e33f3df8 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -1178,6 +1178,11 @@ * includes the contents of the frame. %NL80211_ATTR_ACK flag is included * if the recipient acknowledged the frame. * + * @NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS: Updated MU-EDCA parameters from + * driver. This event is used to update dynamic MU-EDCA parameters in + * Beacon frame, coming from driver and now need to be reflected in + * Beacon frame. + * * @NL80211_CMD_MAX: highest used command number * @__NL80211_CMD_AFTER_LAST: internal use */ @@ -1408,6 +1413,7 @@ enum nl80211_commands { NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS, + NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS, /* add new commands above here */ /* used to define NL80211_CMD_MAX below */ @@ -2534,6 +2540,9 @@ enum nl80211_commands { * This is a u8 attribute that encapsulates one of the values from * &enum nl80211_sae_pwe_mechanism. * + * @NL80211_ATTR_HE_MUEDCA_PARAMS: MU-EDCA AC parameters for the + * %NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS command. + * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use @@ -3025,6 +3034,7 @@ enum nl80211_attrs { NL80211_ATTR_SAE_PWE, + NL80211_ATTR_HE_MUEDCA_PARAMS, /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 8811a4b69f21..75493758ec8e 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -17806,6 +17806,42 @@ void cfg80211_update_owe_info_event(struct net_device *netdev, } EXPORT_SYMBOL(cfg80211_update_owe_info_event); +void cfg80211_update_muedca_params_event(struct wiphy *wiphy, + struct ieee80211_mu_edca_param_set + *params, gfp_t gfp) +{ + struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); + struct sk_buff *msg; + void *hdr; + + msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); + if (!msg) + return; + + hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS); + if (!hdr) + goto nla_put_failure; + + if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx)) + goto nla_put_failure; + + if (nla_put(msg, NL80211_ATTR_HE_MUEDCA_PARAMS, + sizeof(struct ieee80211_mu_edca_param_set), + (const void *)params)) + goto nla_put_failure; + + genlmsg_end(msg, hdr); + + genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, + NL80211_MCGRP_MLME, gfp); + return; + +nla_put_failure: + genlmsg_cancel(msg, hdr); + nlmsg_free(msg); +} +EXPORT_SYMBOL(cfg80211_update_muedca_params_event); + /* initialisation/exit functions */ int __init nl80211_init(void) From patchwork Tue Dec 8 22:54:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muna Sinada X-Patchwork-Id: 11959991 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 X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFF10C4167B for ; Tue, 8 Dec 2020 22:55:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A5DED23AC9 for ; Tue, 8 Dec 2020 22:55:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731555AbgLHWzV (ORCPT ); Tue, 8 Dec 2020 17:55:21 -0500 Received: from so254-31.mailgun.net ([198.61.254.31]:63135 "EHLO so254-31.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731243AbgLHWzU (ORCPT ); Tue, 8 Dec 2020 17:55:20 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1607468096; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=dLstmuiftDBm36AO/XybB5auDZnJ5xyen5F7BS3UFxI=; b=wcLAyKZx6M9pDzRCdzSz6zqT4J7ds1BmZrFxo+/7K4zr10cnvzsDDktWx9V3MoT7NYXzawAw R+mG79ak4nZUnn38c4y7MuESrdVrRicCiTJgfjBkNVZvadPdZfw3491qSVnqG+hSkzECmpmH k4Bvpb25OzoR3W3oy2QV9aiZ7eE= X-Mailgun-Sending-Ip: 198.61.254.31 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-east-1.postgun.com with SMTP id 5fd00425a44f9b1da0795117 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 08 Dec 2020 22:54:29 GMT Sender: msinada=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id E7283C433C6; Tue, 8 Dec 2020 22:54:28 +0000 (UTC) Received: from msinada-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: msinada) by smtp.codeaurora.org (Postfix) with ESMTPSA id 30DEFC433ED; Tue, 8 Dec 2020 22:54:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 30DEFC433ED Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=msinada@codeaurora.org From: Muna Sinada To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Muna Sinada Subject: [PATCH 2/2] mac80211: Handling driver updated MU-EDCA params Date: Tue, 8 Dec 2020 14:54:04 -0800 Message-Id: <1607468044-31789-2-git-send-email-msinada@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607468044-31789-1-git-send-email-msinada@codeaurora.org> References: <1607468044-31789-1-git-send-email-msinada@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Added necessary function to pass through driver updated MU-EDCA parameters to user space. Signed-off-by: Muna Sinada --- include/net/mac80211.h | 15 +++++++++++++++ net/mac80211/mlme.c | 12 ++++++++++++ net/mac80211/trace.h | 20 ++++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 05c7524bab26..eeadddaf1f6a 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -6695,4 +6695,19 @@ struct sk_buff *ieee80211_get_fils_discovery_tmpl(struct ieee80211_hw *hw, struct sk_buff * ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw, struct ieee80211_vif *vif); + +/** + * ieee80211_update_muedca_params - update MU-EDCA parameters. + * + * This function is used to pass dynamically updated MU-EDCA parameters + * from driver to user space in order for parameters to be updated in beacon. + * + * @hw: pointer as obtained from ieee80211_alloc_hw() + * @params: updated MU-EDCA parameters + * @gfp: allocation flags + */ +void ieee80211_update_muedca_params(struct ieee80211_hw *hw, + struct ieee80211_mu_edca_param_set + *params, gfp_t gfp); + #endif /* MAC80211_H */ diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 6adfcb9c06dc..aba8fecf8284 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -5934,3 +5934,15 @@ void ieee80211_cqm_beacon_loss_notify(struct ieee80211_vif *vif, gfp_t gfp) cfg80211_cqm_beacon_loss_notify(sdata->dev, gfp); } EXPORT_SYMBOL(ieee80211_cqm_beacon_loss_notify); + +void ieee80211_update_muedca_params(struct ieee80211_hw *hw, + struct ieee80211_mu_edca_param_set + *params, gfp_t gfp) +{ + struct ieee80211_local *local = hw_to_local(hw); + + trace_api_update_muedca_params(local, params); + + cfg80211_update_muedca_params_event(local->hw.wiphy, params, gfp); +} +EXPORT_SYMBOL(ieee80211_update_muedca_params); diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h index 89723907a094..4ede71bea435 100644 --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h @@ -2767,6 +2767,26 @@ TRACE_EVENT(drv_sta_set_4addr, ) ); +TRACE_EVENT(api_update_muedca_params, + TP_PROTO(struct ieee80211_local *local, + struct ieee80211_mu_edca_param_set *params), + + TP_ARGS(local, params), + + TP_STRUCT__entry( + LOCAL_ENTRY + ), + + TP_fast_assign( + LOCAL_ASSIGN; + ), + + TP_printk( + LOCAL_PR_FMT " updated MU-EDCA parameters", + LOCAL_PR_ARG + ) +); + #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */ #undef TRACE_INCLUDE_PATH