From patchwork Fri Jul 5 10:31:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 11032957 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3A03E1580 for ; Fri, 5 Jul 2019 15:48:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25ECC2846D for ; Fri, 5 Jul 2019 15:48:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19D122871A; Fri, 5 Jul 2019 15:48:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.4 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A9EB42846D for ; Fri, 5 Jul 2019 15:48:03 +0000 (UTC) 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:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=ei5VuBUg8ecWz+QYYwgJ63GlZ4XzVbTGQjfmw5YSHBI=; b=VfqZf/LCqjbKLj DYEHeFw/wSTIgGjHH9LkPXbrgYaUGOcaeWETyDn3FiHBZOTH/MNv+FsgESMmA4Fb8ESRXPR5Myseu NTOqusbP00z9Y88WKsQOrx6RBcj70G7UI/EKjCyxsWmM6CWL6ugzvO54PvjZIqbjWpilo/geKjndx T0vT4hgxgMVGJUaAvm/EXuCzdsx0ngh/kahzd7p+I5YnZ/IJyW2WEQPG8Cswaezh+wskY/6rGxogV +AtM8fBnMT4iFGbQUapzR7Unm8ylWhgQ8khIyTRQV39+Uy4ubBgQWv6URrthfwl34bX4sMSNESax2 End3gUn6pU5u75/VtZMg==; 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 1hjQRN-0002SM-83; Fri, 05 Jul 2019 15:48:01 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hjQNg-0005pg-Bs for ath11k@bombadil.infradead.org; Fri, 05 Jul 2019 15:44:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=en82HCSuK12gucji46cJXAs747jJRRF1gykMfYt8KQM=; b=WHgSaSm41a0RDVgVONjGjl54uK ZklvGZRWhlpvzTw3LDdUSj5AwvgokZHK012qnvHvBhKiiL872cWvuapURoJpf6GUkNW3z28r7+/tL Hv/K1mNOClFm1LEfUch/pVegRQ17ojV3H17sfVgiqUVUUhRnqodCwiYseo6OQTlH1N8L7brPQNTeP bVQ5bk7p8yTYz9yDHVS3njgGi3i0pM24ykXWu+jpBy5zAf74uWws2+DbF/pl9mADA9ihNOAzAhrWF Kk+PsJw7VaUcMWsHViOxcUMy9pXIucx/8O+91ZJWlz/Q3v4p97fTQEBJF0aPngHVuKubpkzlJEUnK 0o7ey+Ag==; Received: from dvalin.narfation.org ([213.160.73.56]) by merlin.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hjLcl-0001Ad-GP for ath11k@lists.infradead.org; Fri, 05 Jul 2019 10:39:28 +0000 Received: from sven-desktop.home.narfation.org (p5B34C688.dip0.t-ipconnect.de [91.52.198.136]) by dvalin.narfation.org (Postfix) with ESMTPSA id 86D7F20928; Fri, 5 Jul 2019 10:31:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1562322680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=en82HCSuK12gucji46cJXAs747jJRRF1gykMfYt8KQM=; b=O6eq6k88IIn27lMqzzg/4If8q4yCHLkYHGGfwa3985aI1t5Ql+jzYVpsVLuKDai4oaCFoP aQLiV0ydpCY/WhMRNzzWVqkEbdveY1j4Y/fOgbUlKB0PcMTbOPc5qwXbd4dun2+2xuovtd NjroTC/CZD5GvdCRJkPLb7rcbqsn0Sk= From: Sven Eckelmann To: ath11k@lists.infradead.org Subject: [PATCH 1/3] ath11k: support for multicast rate control Date: Fri, 5 Jul 2019 12:31:06 +0200 Message-Id: <20190705103109.3731-2-sven@narfation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190705103109.3731-1-sven@narfation.org> References: <20190705103109.3731-1-sven@narfation.org> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1562322680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=en82HCSuK12gucji46cJXAs747jJRRF1gykMfYt8KQM=; b=EedtzoKd0GfDs76GdkRNET3sk3ihcmoIsn81RFLGQw7aBVapqJ/EBM5xbmnYWqQ4LwptBX ImeQwneW6B/FkXO+EhhTUW8yA54dqpIvSvLO/aIElv3FJazfCp7EFn11hx9xNajSFLdY5W Qjo2cY2bEZNALd6RajAe+ZeATzc63fM= ARC-Seal: i=1; s=20121; d=narfation.org; t=1562322680; a=rsa-sha256; cv=none; b=V8DD7JHOKf/5p3zULgISFqLkiC72aJlCP80HPOcVN+XRqaFi7zBD9LAKMq+o5ZcYonJUCa ZTQdaFXfSaiClOjyG+p0JjKlmrScANSCemMJavRxFdEdGgnORKkJFfNwrFHWl6Ax4u0HoK ybWCtt5UE49Ij8erfKOPZnVcFAHYExI= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sven smtp.mailfrom=sven@narfation.org X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Eckelmann Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sven Eckelmann The multicasts have to be done at a rate which is a basic rate. But the ath11k firmware is always doing them on 1 Mbit/s for 2.4GHz and 6 Mbit/s for 5GHz. These might not be the basic rates which the AP advertised. Clients which don't support these rates will therefore not be able to receive the multicast/broadcast. Also some mesh protocols try to estimate the probability of a successful submission of broadcast/multicast frames. In such setups, the multicast rate is usually manually set to an higher value to better simulate the rates which are used for unicast transmission. mac80211 already calculates the correct multicast rate for the driver and ath11k just has to send this information to the firmware rate control. Signed-off-by: Sven Eckelmann --- drivers/net/wireless/ath/ath11k/mac.c | 53 +++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 3a3296b83cc1..592fe79e8489 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -1621,8 +1621,17 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw, { struct ath11k *ar = hw->priv; struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct cfg80211_chan_def def; u32 param_id, param_value; + enum nl80211_band band; + u32 vdev_param; + int mcast_rate; + u32 preamble; + u16 hw_value; + u16 bitrate; int ret = 0; + u8 rateidx; + u8 rate; mutex_lock(&ar->conf_mutex); @@ -1768,6 +1777,50 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw, ath11k_mac_txpower_recalc(ar); } + if (changed & BSS_CHANGED_MCAST_RATE && + !ath11k_mac_vif_chan(arvif->vif, &def)) { + band = def.chan->band; + mcast_rate = vif->bss_conf.mcast_rate[band]; + + if (mcast_rate > 0) + rateidx = mcast_rate - 1; + else + rateidx = ffs(vif->bss_conf.basic_rates) - 1; + + if (ar->pdev->cap.supported_bands & WMI_HOST_WLAN_5G_CAP) + rateidx += ATH11K_MAC_FIRST_OFDM_RATE_IDX; + + bitrate = ath11k_legacy_rates[rateidx].bitrate; + hw_value = ath11k_legacy_rates[rateidx].hw_value; + + if (ath11k_mac_bitrate_is_cck(bitrate)) + preamble = WMI_RATE_PREAMBLE_CCK; + else + preamble = WMI_RATE_PREAMBLE_OFDM; + + rate = ATH11K_HW_RATE_CODE(hw_value, 0, preamble); + + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, + "mac vdev %d mcast_rate %x\n", + arvif->vdev_id, rate); + + vdev_param = WMI_VDEV_PARAM_MCAST_DATA_RATE; + ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, + vdev_param, rate); + if (ret) + ath11k_warn(ar->ab, + "failed to set mcast rate on vdev %i: %d\n", + arvif->vdev_id, ret); + + vdev_param = WMI_VDEV_PARAM_BCAST_DATA_RATE; + ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, + vdev_param, rate); + if (ret) + ath11k_warn(ar->ab, + "failed to set bcast rate on vdev %i: %d\n", + arvif->vdev_id, ret); + } + mutex_unlock(&ar->conf_mutex); } From patchwork Fri Jul 5 10:31:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 11032955 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0D95A138D for ; Fri, 5 Jul 2019 15:48:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDE5C2846D for ; Fri, 5 Jul 2019 15:48:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1F5D2871A; Fri, 5 Jul 2019 15:48:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.4 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 48A4B2846D for ; Fri, 5 Jul 2019 15:48:02 +0000 (UTC) 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:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=mnzKLvN9tTdrhcoW3Kn1GZK8Nsy9qqHrwZmEiFkW/Bo=; b=eVLI9H94O1mJ77 1oa/6dtzy/T013EStwXjWMKsQ+HbAhBccWB/mR3PfT30IV7ZEzDdHOQwNNAd4kI6OcTlnIbHAZ158 fNO5nqXY1pLGpqbcrW8tH5oSBLM6BzZOedt3jsIWJtPwfu62xiMWPK6rI+8PwtGzgL3yERkseP3qi 90DeFAQrLU1tbUlct2TW1wsg+rk8cRoLBbmKMLO90tP3PbDWxEN1YZvix+0/Y3o3vYC7qgMIEdgMV /5OhrOyz90kmkd3rkDKDDM4bZnoOr0CcwVncganBbs29fXtLgqWi+Jx8CA4oQdMQgxJckc7JcoKUI aT/gUVOfigK+3Jaokuwg==; 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 1hjQRL-0002RH-Sg; Fri, 05 Jul 2019 15:47:59 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hjQNe-0005nI-Fo for ath11k@bombadil.infradead.org; Fri, 05 Jul 2019 15:44:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mf5Fde2gG95WpGUQ22PwBtDNx5lFGfrl9hRZUh6oVDg=; b=zPyii2o16tA6/JcpayA+uAwsXZ jDB60zIjfgLkopB57t/KsT2q7gVn2IFolSHxK3PeQbWh13lyfaXxf/9Uk4fbrPTRn3/tLo7FyJwej YTBi9+asNJSH1xFRt89Kf6WtHhW1rvyAkUenvBdbxHKRLD9l6r3HDGeiAagV0AUaw0pzEZete8ZuC /95POS/PFy/ZFp9VZUamZKg70Br2L6hqV+hmb85WHH1WbiQqcYkbnQUXZYxeteSJ4P86/lQwhTxED CkPzwMBjGKefywLV6smxq4Ro+lWFJ8W61OscNBy19+1JjvmZZFLINZLb0Ow10VPkeUhdaxlQ5k4Xr e/ek190w==; Received: from dvalin.narfation.org ([213.160.73.56]) by merlin.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hjLcl-0001Ae-GO for ath11k@lists.infradead.org; Fri, 05 Jul 2019 10:39:28 +0000 Received: from sven-desktop.home.narfation.org (p5B34C688.dip0.t-ipconnect.de [91.52.198.136]) by dvalin.narfation.org (Postfix) with ESMTPSA id 5B1F120948; Fri, 5 Jul 2019 10:31:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1562322684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mf5Fde2gG95WpGUQ22PwBtDNx5lFGfrl9hRZUh6oVDg=; b=Zhmcqj9Bfjk6JqeBgqb5LnrocRNMjrh/JjEkHolrZ7lQnlcegeySyy5dtMmdw9ukdTWfyV SlZdmWYUfqR0LQiQEvLdeULkFhvySHaDg0WthH5i+9sTqlPTkQ1IS6W4qSDnIjipj5V0yG WMZn4T36jwY7WBXFiTJEClE52wQSoKU= From: Sven Eckelmann To: ath11k@lists.infradead.org Subject: [PATCH 2/3] ath11k: support for mgmt rate control Date: Fri, 5 Jul 2019 12:31:07 +0200 Message-Id: <20190705103109.3731-3-sven@narfation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190705103109.3731-1-sven@narfation.org> References: <20190705103109.3731-1-sven@narfation.org> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1562322684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mf5Fde2gG95WpGUQ22PwBtDNx5lFGfrl9hRZUh6oVDg=; b=NXpk76j9Vu+OZNO0bp0PxUmvvXed1a9SqIgkt9BFv8/FfhJ8MonlBVl2Opu3LPAjiFI/HP uE1CmgwIJEjCdlYkm10gdalXLOjpmG5tJcPjkTy+09t+od4y+9BrTqKapAN9EuatVVkfqT xE23Y7gDDZZsUHFn+uDZVvm91pFfdwA= ARC-Seal: i=1; s=20121; d=narfation.org; t=1562322684; a=rsa-sha256; cv=none; b=p68mpeKyhW6myMwevgQg3wogzPhEOlOsxGN2tFWgJTp6Y2mbtjXGj+umPkxfvdSBTGZv6t yEvOKTI8LO/b/AX6UlAsvJc5OrOj13c7Kr8K2OCDRAV7cJuOmhAwlEVFA0Z8xPFHgSBWfB /2B7BwpwTCfADm/5UgEmDk6ObW5qeB4= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sven smtp.mailfrom=sven@narfation.org X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Eckelmann Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sven Eckelmann The management frames have to be sent at a basic rate. But the ath11k firmware is always doing them on 1 Mbit/s for 2.4GHz and 6 Mbit/s for 5GHz. These might not be the basic rates which the AP advertised. Clients which don't support these rates will therefore not be able to receive them correctly. mac80211 already provides a list of basic rates for the driver. ath11k has to pick the lowest one and send it to the firmware rate control. Signed-off-by: Sven Eckelmann --- drivers/net/wireless/ath/ath11k/mac.c | 60 +++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 592fe79e8489..cda5b39f1a9b 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -1614,6 +1614,62 @@ static void ath11k_bss_disassoc(struct ieee80211_hw *hw, /* TODO: cancel connection_loss_work */ } +static u32 ath11k_mac_get_rate_hw_value(int bitrate) +{ + u32 preamble; + u16 hw_value; + int rate; + size_t i; + + if (ath11k_mac_bitrate_is_cck(bitrate)) + preamble = WMI_RATE_PREAMBLE_CCK; + else + preamble = WMI_RATE_PREAMBLE_OFDM; + + for (i = 0; i < ARRAY_SIZE(ath11k_legacy_rates); i++) { + if (ath11k_legacy_rates[i].bitrate != bitrate) + continue; + + hw_value = ath11k_legacy_rates[i].hw_value; + rate = ATH11K_HW_RATE_CODE(hw_value, 0, preamble); + + return rate; + } + + return -EINVAL; +} + +static void ath11k_recalculate_mgmt_rate(struct ath11k *ar, + struct ieee80211_vif *vif, + struct cfg80211_chan_def *def) +{ + struct ath11k_vif *arvif = (void *)vif->drv_priv; + const struct ieee80211_supported_band *sband; + u8 basic_rate_idx; + int hw_rate_code; + u32 vdev_param; + u16 bitrate; + int ret; + + lockdep_assert_held(&ar->conf_mutex); + + sband = ar->hw->wiphy->bands[def->chan->band]; + basic_rate_idx = ffs(vif->bss_conf.basic_rates) - 1; + bitrate = sband->bitrates[basic_rate_idx].bitrate; + + hw_rate_code = ath11k_mac_get_rate_hw_value(bitrate); + if (hw_rate_code < 0) { + ath11k_warn(ar->ab, "bitrate not supported %d\n", bitrate); + return; + } + + vdev_param = WMI_VDEV_PARAM_MGMT_RATE; + ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, vdev_param, + hw_rate_code); + if (ret) + ath11k_warn(ar->ab, "failed to set mgmt tx rate %d\n", ret); +} + static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, @@ -1821,6 +1877,10 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw, arvif->vdev_id, ret); } + if (changed & BSS_CHANGED_BASIC_RATES && + !ath11k_mac_vif_chan(arvif->vif, &def)) + ath11k_recalculate_mgmt_rate(ar, vif, &def); + mutex_unlock(&ar->conf_mutex); } From patchwork Fri Jul 5 10:31:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 11032601 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D21DF13B1 for ; Fri, 5 Jul 2019 14:02:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFF2D28684 for ; Fri, 5 Jul 2019 14:02:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B35712874E; Fri, 5 Jul 2019 14:02:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.4 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4EE1C28684 for ; Fri, 5 Jul 2019 14:02:14 +0000 (UTC) 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:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=Otpfk8IJciyFknZlIGgy97H7arc5NiErmHjJOdYAays=; b=F4T1eJfl/7lGRu nj1Se7vQo35sXMcqtsDZto4kI05alREyRmCxHuNWVuKXtJfo+OWs6Yx2mKUZaikVZb+3Ww6UEwVPP WvxzBOTEHEJScwl8oBDxMQWNI6vgnMyZI/aD7YU1l+yxLkzYSVtw6AYSFVE2auu+KrxdtHeQssYUb vgtpB99vJbG/KvR83tav04ihNHQfYFN/AdAYkVw7+zFtax9fLBCn2nUt1213hTl3ivSIbR3e2d3nC +AHgzOG25B/0x1pJv3Edba3tbGyxLzmXUIHsK8I/4UNQ+9ycHaepvlDHTuZ6ii9/xu8SEAXy4N4Yl Du6nmiMJn8gumCxgk7rQ==; 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 1hjOmw-0006CW-J6; Fri, 05 Jul 2019 14:02:10 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hjOfg-0004xt-Q9 for ath11k@bombadil.infradead.org; Fri, 05 Jul 2019 13:54:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=y1jJzPZwHZomj7D2nO0Xopguozsxuctx1TYppOkpveQ=; b=DNoyhgP2pgmE8VwK9RayYLdAAm tgtKLEK3/5at3wQXOvQSl5gGilHHFxsFxCxjAcQi2HSdyGHoYq62KOvxtmOWd5Y0eFfONWnye6a75 jSUWSryjcMOZF2qgm4sVxLoaHw2PR40RTWqt5rNOlZKN7oZ3/KIiaJ+5pGyXPNKBP2SvPAkeh3U6h z/h4h3IoO7rHwuRRvvwbfwquIvCYklV3e8gF3xlZYxXgSDSFmuj+tXh0GzOCwBHWCTuWcwF3OIbsL rcfa7provVZCO8NRMWYInTXSmq4DmXfyG/fyRKHfoK6/r1fMjHfv/3Nk5+GLTSMy0kWRkhIsEsqpw MH++p35w==; Received: from dvalin.narfation.org ([213.160.73.56]) by casper.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hjLWT-0003Ge-LD for ath11k@lists.infradead.org; Fri, 05 Jul 2019 10:32:59 +0000 Received: from sven-desktop.home.narfation.org (p5B34C688.dip0.t-ipconnect.de [91.52.198.136]) by dvalin.narfation.org (Postfix) with ESMTPSA id A7AD220952; Fri, 5 Jul 2019 10:31:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1562322695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y1jJzPZwHZomj7D2nO0Xopguozsxuctx1TYppOkpveQ=; b=D7LBove4RZA1Ramny9Vllu2dBN0DETasZDhLzjzbNr+ZZD+QAeZymUIJo59dllO9Wrv4sT muqwyiVT3aFqCOE6WY10m11BmDjGZ4iQz3kVQ8e0xzdSa58uc8vn8U1yhkEHrBy88BRkRc flCPNtC2zbCHcpI5nT+QJQgJ4iRAtVE= From: Sven Eckelmann To: ath11k@lists.infradead.org Subject: [PATCH 3/3] ath11k: apply mgmt rate for beacons Date: Fri, 5 Jul 2019 12:31:08 +0200 Message-Id: <20190705103109.3731-4-sven@narfation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190705103109.3731-1-sven@narfation.org> References: <20190705103109.3731-1-sven@narfation.org> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1562322695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y1jJzPZwHZomj7D2nO0Xopguozsxuctx1TYppOkpveQ=; b=soZGfuofOkC0QiwwCbJ+jH8k9z5WwA/jFU7P0zP0ONf5j+eOCr3L2iGRVS+TKBiFqVtoSu KgM9EArA52YBOKn8otD917Kg0WETIiqxAkUa/Ib0OjOoIDbvpG9rwJ7EzScrJGYQ1K9Rgg nK1I869uSEOqYJhFVukSif7FaqBthE8= ARC-Seal: i=1; s=20121; d=narfation.org; t=1562322695; a=rsa-sha256; cv=none; b=RpmQVtDu8WQPaz5jgPi7w7Lo8OzzwJNzem79l5lsBp4giWNxSBkyCLUmaccBEUZd/f0YqL 4/5rg7wb0ZySlpUPzsGIql7A4G7dFOGB1Fnv3KjOKDzOrOZ8+6u7lzNk+1LrMa57Qcwlc8 fgLR6cgO1+mih670jT0d3On20cYdG+E= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sven smtp.mailfrom=sven@narfation.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190705_113257_743477_EF5239CC X-CRM114-Status: UNSURE ( 9.49 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Eckelmann Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sven Eckelmann ath11k is using the lowest basic rate to send management frames. But the firmware is still sending the beacons at 1 Mbit/s for 2.4GHz and 6 Mbit/s on 5GHz. But it could be that these rates are not part of the basic rates. And thus the AP should not try to submit using these rates when clients don't need to support these rates (and thus might not be able to receive these rates). Signed-off-by: Sven Eckelmann --- drivers/net/wireless/ath/ath11k/mac.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index cda5b39f1a9b..37e225e0205d 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -1668,6 +1668,12 @@ static void ath11k_recalculate_mgmt_rate(struct ath11k *ar, hw_rate_code); if (ret) ath11k_warn(ar->ab, "failed to set mgmt tx rate %d\n", ret); + + vdev_param = WMI_VDEV_PARAM_BEACON_RATE; + ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, vdev_param, + hw_rate_code); + if (ret) + ath11k_warn(ar->ab, "failed to set beacon tx rate %d\n", ret); } static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw,