From patchwork Thu Aug 27 12:47:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 7084481 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D568ABEEC1 for ; Thu, 27 Aug 2015 12:47:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0787720984 for ; Thu, 27 Aug 2015 12:47:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2F8A8208BB for ; Thu, 27 Aug 2015 12:47:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZUwae-00068z-1m; Thu, 27 Aug 2015 12:47:36 +0000 Received: from mail-la0-x22b.google.com ([2a00:1450:4010:c03::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZUwab-00065B-5e for ath10k@lists.infradead.org; Thu, 27 Aug 2015 12:47:34 +0000 Received: by laba3 with SMTP id a3so11642308lab.1 for ; Thu, 27 Aug 2015 05:47:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3Ra5wqVzJ/t1I5Nmlimeh29oXDosrHoSoqc5254C31s=; b=Fu3+yFDLsMausagzjkU5iuC9ORUxfsxW5aVv0QNDblKiEZHbQJAkU9A3s0+fDbQyym 1fFa0ABgFjAJ5rtEa2FW7fMD5Iaxbs1ZDGjupMlLLx7KSkAcFvnnOSnMfZ3PkwFhP3oJ v9GYbx+wOsbSkCCCfLxUQm3Z1jUSXy/Z3OZXg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3Ra5wqVzJ/t1I5Nmlimeh29oXDosrHoSoqc5254C31s=; b=apWNNrrPm1jSaVNoa4XCyTtQ9wT8JPvg90huFfio2kvQc6y7Xg3iFFpgJ+azfzANKe xQ+kOxJufBz6frxBwLpFwLarG0Awj53ffZP95RYcC89Jhb93Bxt7NP2NBu8AEMryeiuE UIaGTrNsrhCfbP/O4MYGrnyHY/lomLPaLnHwDjsAeWTyWyEifdUvBFA3VeHvBcMciCcu D/FEJvhDgYlWgS7R+2nJEMmgx0BsOB3t4bmLNXdIuhWObgDeUDGDf0dKN7sqGhWHrIEp RxgzgayoZWa8GNjoKJ9Z+vI+W1SC1uoOEWIRaPOHH7vrqvwSWm5xjGPZexf1diHTlFRq roSw== X-Gm-Message-State: ALoCoQkkPimhxHWlJeu7K5hpbj/C+jVJbYn+mCehLdIVSAf63KgVEaE5KN20J4oIX55lwEt/vILjY4Nx8LBHFNPljVsDPDTuwUuvz2oHP8n9UVG2h/d0rcZMfxJwBvqsVy5eEAI79gGUB95hqDsRAG+wpdk7D17jDro2/3AtVccba5hDJG1xUMPg+zSsFntr+4O5ejM1IDWg X-Received: by 10.112.85.204 with SMTP id j12mr2090349lbz.47.1440679628861; Thu, 27 Aug 2015 05:47:08 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.10]) by smtp.gmail.com with ESMTPSA id g5sm554744laf.33.2015.08.27.05.47.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 Aug 2015 05:47:07 -0700 (PDT) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH 2/2] ath10k: fix mu-mimo rx status reporting Date: Thu, 27 Aug 2015 14:47:33 +0200 Message-Id: <1440679653-20289-2-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1440679653-20289-1-git-send-email-michal.kazior@tieto.com> References: <1440679653-20289-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150827_054733_392919_9C12C87A X-CRM114-Status: GOOD ( 13.49 ) X-Spam-Score: -2.7 (--) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, Michal Kazior MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP MU-MIMO Rx involves different interpretation of the VHT-SIG-A compared to SU-MIMO. The incorrect interpretation led ath10k to report VHT MCS values greater than 9 which subsequently prompted mac80211 to drop such frames. This effectively broke Rx with MU-MIMO in many cases and manifested with a kernel warning in the log which looked like this: [ 14.552520] WARNING: CPU: 2 PID: 0 at net/mac80211/rx.c:3578 ieee80211_rx+0x26c/0x940 [mac80211]() [ 14.552522] Rate marked as a VHT rate but data is invalid: MCS: 10, NSS: 2 ... call trace follows ... Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/htt_rx.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 1b7a04366256..8ba8fa9004cf 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -643,6 +643,8 @@ struct amsdu_subframe_hdr { __be16 len; } __packed; +#define GROUP_ID_IS_SU_MIMO(x) ((x) == 0 || (x) == 63) + static void ath10k_htt_rx_h_rates(struct ath10k *ar, struct ieee80211_rx_status *status, struct htt_rx_desc *rxd) @@ -650,6 +652,7 @@ static void ath10k_htt_rx_h_rates(struct ath10k *ar, struct ieee80211_supported_band *sband; u8 cck, rate, bw, sgi, mcs, nss; u8 preamble = 0; + u8 group_id; u32 info1, info2, info3; info1 = __le32_to_cpu(rxd->ppdu_start.info1); @@ -692,10 +695,27 @@ static void ath10k_htt_rx_h_rates(struct ath10k *ar, case HTT_RX_VHT_WITH_TXBF: /* VHT-SIG-A1 in info2, VHT-SIG-A2 in info3 TODO check this */ - mcs = (info3 >> 4) & 0x0F; - nss = ((info2 >> 10) & 0x07) + 1; bw = info2 & 3; sgi = info3 & 1; + group_id = (info2 >> 4) & 0x3F; + + if (GROUP_ID_IS_SU_MIMO(group_id)) { + mcs = (info3 >> 4) & 0x0F; + nss = ((info2 >> 10) & 0x07) + 1; + } else { + /* Hardware doesn't decode VHT-SIG-B into Rx descriptor + * so it's impossible to decode MCS. Also since + * firmware consumes Group Id Management frames host + * has no knowledge regarding group/user position + * mapping so it's impossible to pick the correct Nsts + * from VHT-SIG-A1. + * + * Bandwidth and SGI are valid so report the rateinfo + * on best-effort basis. + */ + mcs = 0; + nss = 1; + } status->rate_idx = mcs; status->vht_nss = nss;