From patchwork Tue May 7 06:58:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 10932359 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 2B06F924 for ; Tue, 7 May 2019 06:58:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DA9F28910 for ; Tue, 7 May 2019 06:58:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0196028922; Tue, 7 May 2019 06:58:41 +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 7D42428910 for ; Tue, 7 May 2019 06:58:41 +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:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=HhhPEREbDxz2XjN6RoIxFXZyh8INOoFlPwCMMHYG3a4=; b=i16ddPQiPqESrk tJDjcbX3jyUzbTzjMeHI9vMlyDq+lf7lhK6z7MUM5SfbsemO/4eta1yzE8FRgnzlK1FBXsIfCZdAH i5Lasdwf3Wuyf1V9qdbR8LYM2O6jt/TmhAsaoottZBjN69hSY0gWUiuJjGuZwAArYdpGbl9a3/BFW 4JBvsBQASD64mgO5us2OArFUrEJ3qJnaf1yDjDCUX50t1pyR16bU+oF7ZprfjUjArM6g8Uo0DhPFD kKY9lB9sziWAgQUWC6y23OsWpV3OjZ3zP1j6uc9x8WFPl/SPNVcSM1NPE+OyRhihtK8WO0skboebO ZE0aj6HVudUcs7aPuPqA==; 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 1hNu3k-0003A1-3E; Tue, 07 May 2019 06:58:40 +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 1hNu3g-000397-U6 for ath11k@lists.infradead.org; Tue, 07 May 2019 06:58:38 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4EF9A6079C; Tue, 7 May 2019 06:58:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1557212316; bh=mQH3vMwA5uSG24ms4/CDl4C1j+4Xei4dZ99mbFdOchg=; h=From:To:Subject:Date:From; b=Ioo2mUQQ56CtHIMBZ9rOIudwwKPFvIWsYoXSB48tIxU933TnqgsCruk7onXDdMIgO 0vV0IWMgaXB+g2u7KLM0oM4P2ONhGSOrxBloRv23QGANG/YZUj4T6HF34wng8ZRIA/ GgJxYmMsD0axPaxOBusOrrYJb52zOX/uxZW+Z2tM= Received: from localhost.localdomain (37-136-65-53.rev.dnainternet.fi [37.136.65.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4156A6016D for ; Tue, 7 May 2019 06:58:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1557212315; bh=mQH3vMwA5uSG24ms4/CDl4C1j+4Xei4dZ99mbFdOchg=; h=From:To:Subject:Date:From; b=aNVEoFN4gzJif99bK5/CZ2hYgky/x0pjoJshWd/i6exO8bbQtDCLSLv1kvD0AV7HE AqAoLBYlV4RiFal3NvPWr4IHbBki13t1pM44+MpvuGPtSjNjjE9ZIIZh9Cng4LLN6Q 6xmeIY1ibslILqqCfAEj1I+0H6BShae3WkOe7nq8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4156A6016D 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=kvalo@codeaurora.org From: Kalle Valo To: ath11k@lists.infradead.org Subject: [PATCH 1/2] ath11k: fix assignment of struct hal_rx_mon_ppdu_info::ldpc Date: Tue, 7 May 2019 09:58:31 +0300 Message-Id: <1557212312-11990-1-git-send-email-kvalo@codeaurora.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190506_235837_009044_99F7D54F X-CRM114-Status: UNSURE ( 9.49 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP ath11k_dp_rx_update_peer_stats() assumes that struct hal_rx_mon_ppdu_info::ldpc contains the value enum hal_rx_su_mu_coding but way it was assigned in ath11k_hal_rx_parse_mon_status_tlv() was completely broken. Fix that using FIELD_GET(). Fixes GCC warnings: drivers/net/wireless/ath/ath11k/hal_rx.c:932:45: warning: bitwise comparison always evaluates to false [-Wtautological-compare] drivers/net/wireless/ath/ath11k/hal_rx.c:985:50: warning: bitwise comparison always evaluates to false [-Wtautological-compare] drivers/net/wireless/ath/ath11k/hal_rx.c:1026:46: warning: bitwise comparison always evaluates to false [-Wtautological-compare] drivers/net/wireless/ath/ath11k/hal_rx.c:1110:51: warning: bitwise comparison always evaluates to false [-Wtautological-compare] drivers/net/wireless/ath/ath11k/hal_rx.c:1131:51: warning: bitwise comparison always evaluates to false [-Wtautological-compare] Only compile tested and I didn't check if the firmware interface definitions are correct. Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath11k/hal_rx.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/hal_rx.c b/drivers/net/wireless/ath/ath11k/hal_rx.c index 2bdb53287d8e..b8a3e8714fff 100644 --- a/drivers/net/wireless/ath/ath11k/hal_rx.c +++ b/drivers/net/wireless/ath/ath11k/hal_rx.c @@ -928,9 +928,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struct ath11k_base *ab, ppdu_info->bw = FIELD_GET(HAL_RX_HT_SIG_INFO_INFO0_BW, info0); ppdu_info->is_stbc = FIELD_GET(HAL_RX_HT_SIG_INFO_INFO1_STBC, info1); - ppdu_info->ldpc = (info1 & - HAL_RX_HT_SIG_INFO_INFO1_FEC_CODING) == - HAL_RX_SU_MU_CODING_LDPC; + ppdu_info->ldpc = FIELD_GET(HAL_RX_HT_SIG_INFO_INFO1_FEC_CODING, info1); ppdu_info->gi = info1 & HAL_RX_HT_SIG_INFO_INFO1_GI; switch (ppdu_info->mcs) { @@ -981,9 +979,8 @@ ath11k_hal_rx_parse_mon_status_tlv(struct ath11k_base *ab, info0 = __le32_to_cpu(vht_sig->info0); info1 = __le32_to_cpu(vht_sig->info1); - ppdu_info->ldpc = (info1 & - HAL_RX_VHT_SIG_A_INFO_INFO1_SU_MU_CODING) == - HAL_RX_SU_MU_CODING_LDPC; + ppdu_info->ldpc = FIELD_GET(HAL_RX_VHT_SIG_A_INFO_INFO1_SU_MU_CODING, + info0); ppdu_info->mcs = FIELD_GET(HAL_RX_VHT_SIG_A_INFO_INFO1_MCS, info1); ppdu_info->gi = @@ -1022,9 +1019,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struct ath11k_base *ab, ppdu_info->bw = FIELD_GET(HAL_RX_HE_SIG_A_SU_INFO_INFO0_TRANSMIT_BW, info0); - ppdu_info->ldpc = (info1 & - HAL_RX_HE_SIG_A_SU_INFO_INFO1_CODING) == - HAL_RX_SU_MU_CODING_LDPC; + ppdu_info->ldpc = FIELD_GET(HAL_RX_HE_SIG_A_SU_INFO_INFO1_CODING, info0); ppdu_info->is_stbc = info1 & HAL_RX_HE_SIG_A_SU_INFO_INFO1_STBC; ppdu_info->beamformed = info1 & @@ -1106,9 +1101,8 @@ ath11k_hal_rx_parse_mon_status_tlv(struct ath11k_base *ab, ppdu_info->nss = FIELD_GET(HAL_RX_HE_SIG_B2_MU_INFO_INFO0_STA_NSTS, info0) + 1; - ppdu_info->ldpc = (info0 & - HAL_RX_HE_SIG_B2_MU_INFO_INFO0_STA_CODING) == - HAL_RX_SU_MU_CODING_LDPC; + ppdu_info->ldpc = FIELD_GET(HAL_RX_HE_SIG_B2_MU_INFO_INFO0_STA_CODING, + info0); break; } case HAL_PHYRX_HE_SIG_B2_OFDMA: { @@ -1126,10 +1120,8 @@ ath11k_hal_rx_parse_mon_status_tlv(struct ath11k_base *ab, ppdu_info->beamformed = info0 & HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_TXBF; - ppdu_info->ldpc = - (info0 & - HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_CODING) == - HAL_RX_SU_MU_CODING_LDPC; + ppdu_info->ldpc = FIELD_GET(HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_CODING, + info0); ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_MU_OFDMA; break; }