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); }