From patchwork Tue Dec 11 04:56:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pradeep Kumar Chitrapu X-Patchwork-Id: 10723035 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 3458017FE for ; Tue, 11 Dec 2018 04:56:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 204FE2A96F for ; Tue, 11 Dec 2018 04:56:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12EFA2A97E; Tue, 11 Dec 2018 04:56:45 +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=-5.2 required=2.0 tests=BAYES_00,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 A660E2A96F for ; Tue, 11 Dec 2018 04:56:44 +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: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=nW0ucW4gftdwg4CD89mFQnlhYlv6Mf98chsAKcqYoVo=; b=exx wLv7vd1oWBObV6iooIaA1CS4PI1lY5el9JZ+c7yERHr7eCArHCpQL6IyeED3psDd4Z4Qal1m6IiF3 BarHDNMEOTUM3AKa7a/HzfD02qRilx+JyURcTV2+K5e1ekUo8KeeXcmitXiTm9o0KWBHi3sI2DwPN 7mYF0iltx1FXTJAFE5q+rflcQhiLWyw/zH2g+3oXSUpGzXy/I0covCsboFFp7N+sc+3Mr7oY0Ygn2 NUhyiqN3rNOreess/CeZpUSbV2y+MvVlwdtoVqJCHfUVVzDPs14sc1q0pbdk2UVVtNNqK/Jb0SBSI uhxDdCax44DNQaHYAS3ryl8glji1CmA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWa66-0002bi-93; Tue, 11 Dec 2018 04:56:42 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWa5u-0001en-UP for ath10k@lists.infradead.org; Tue, 11 Dec 2018 04:56:39 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 34D596019F; Tue, 11 Dec 2018 04:56:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1544504179; bh=qa0/KGmy2+XgApv/BwF2KWlw/HYRLBKDORjacXMfZeQ=; h=From:To:Cc:Subject:Date:From; b=K4ktmhVugx8yNHZbdasWiqbVBMzeXryZqTTfKFS9DlsEAlc5VQrSkXKiDU/ZxZEVs K1ADiTNZNxbvNVjr10gqRGe4StRVqKNVCtbsxvO6GGsrn5Q7efw3xAhigQ9U3fi3n5 ISGBgK7dJrMyXP/Hsmd91wjHUPxDGYle30XoLcNQ= Received: from pradeepc-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: pradeepc@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0234C60B73; Tue, 11 Dec 2018 04:56:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1544504178; bh=qa0/KGmy2+XgApv/BwF2KWlw/HYRLBKDORjacXMfZeQ=; h=From:To:Cc:Subject:Date:From; b=IzRYcOAeiz5RXZgOWDXF74amj7FVgyUjCf2e62ksd66uYGQu5Xe1DlOt6d7CzcyRw GlyEfcluF1PZlGTJnqu+s/D9kaseNJszVCzMJRpaLmwOVSo021AoJswUTT+rnu2Pnm 1Yl8H43ZkGMaJGI6cLEYqIYPFCDAo6cj4tEJu8LE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0234C60B73 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=pradeepc@codeaurora.org From: Pradeep Kumar Chitrapu To: ath10k@lists.infradead.org Subject: [PATCH] ath10k: fix incorrect multicast/broadcast rate setting Date: Mon, 10 Dec 2018 20:56:11 -0800 Message-Id: <1544504171-19810-1-git-send-email-pradeepc@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181210_205631_330798_F64940C0 X-CRM114-Status: UNSURE ( 9.60 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pradeep kumar Chitrapu , Zhi Chen , linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Pradeep kumar Chitrapu Invalid rate code is sent to firmware when multicast rate value of 0 is sent to driver indicating disabled case, causing broken mesh path. so fix that. Tested on QCA9984 with firmware 10.4-3.6.1-00827 Fixes: cd93b83ad92 ("ath10k: support for multicast rate control") Co-developed-by: Zhi Chen Signed-off-by: Zhi Chen Signed-off-by: Pradeep Kumar Chitrapu Tested-by: Sven Eckelmann --- drivers/net/wireless/ath/ath10k/mac.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 6771d8185af5..4546b73b2e45 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -5486,8 +5486,8 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, struct cfg80211_chan_def def; u32 vdev_param, pdev_param, slottime, preamble; u16 bitrate, hw_value; - u8 rate, basic_rate_idx; - int rateidx, ret = 0, hw_rate_code; + u8 rate, basic_rate_idx, rateidx; + int ret = 0, hw_rate_code, mcast_rate; enum nl80211_band band; const struct ieee80211_supported_band *sband; @@ -5674,7 +5674,11 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_MCAST_RATE && !WARN_ON(ath10k_mac_vif_chan(arvif->vif, &def))) { band = def.chan->band; - rateidx = vif->bss_conf.mcast_rate[band] - 1; + 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->phy_capability & WHAL_WLAN_11A_CAPABILITY) rateidx += ATH10K_MAC_FIRST_OFDM_RATE_IDX;