From patchwork Fri Mar 8 11:26:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rakesh Pillai X-Patchwork-Id: 10844515 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 CD232139A for ; Fri, 8 Mar 2019 11:26:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B20C92E24E for ; Fri, 8 Mar 2019 11:26:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A60EC2E278; Fri, 8 Mar 2019 11:26:20 +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=unavailable 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 4F68F2E24E for ; Fri, 8 Mar 2019 11:26:20 +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=WA/824iZc1UUP3Coy1o3K3eXbwnt19Bek7iZKINmu8k=; b=pVD Kbfv73GZUXLyEPOdipzpmr/o2n9eeGOUWd2OMsOMyDPqeYrPdarru0IwQOIFtZ0IBWK+DqPJfkje8 2Mp/YeFIF2bkimutLPZltcVMWW0GJfNul6qCilaGKiVHNnwjL4RLnTZ50+xxEsuKv6Gg5/Pj+Ge1I v9VtZPQaQ8NTdTG7wF3GB2a4kfCn/trvuU1O8WuEMRcorPQo0JY1u5lHRRsiotv6RuyrHVKlU4CPW 79WqjmFtmzVjaYQ9J0QvpFdkMR5ChedHa3YcFMerBSQgSMnEMTAhn4EeFiF+MPv4CWlm+3IYeXugg 1EfsB/sK69+hKzU8SyJx3SPv2MK+AZA==; 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 1h2Ddq-00075g-KO; Fri, 08 Mar 2019 11:26:18 +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 1h2Ddo-00075I-80 for ath10k@lists.infradead.org; Fri, 08 Mar 2019 11:26:17 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5A5E960328; Fri, 8 Mar 2019 11:26:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1552044375; bh=YCNFAnzFzyW65UY8uuOijnL6zUe7bftiF7DSyzA3QW8=; h=From:To:Cc:Subject:Date:From; b=G5+MSPhcu5rXPvYy+Eu3FUhjI+h+9QHBZmocSMRR5rJYtqjOT9uGVbq2Dp3bNfXUu 9Sm7NoKLR9VrZ3hk4XqVKlkzxKXkhg/LFUw6Eqje3nooCNwSMIgcl1GyLl2FzEiwop yq5NhkNAF7GqpGO9Cg5B9qoYESiwOEAAy1UpdNUo= Received: from pillair-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pillair@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id B7E996029B; Fri, 8 Mar 2019 11:26:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1552044374; bh=YCNFAnzFzyW65UY8uuOijnL6zUe7bftiF7DSyzA3QW8=; h=From:To:Cc:Subject:Date:From; b=HLLD3R05MT8pLliB3zLoHGyIQ/c9pOSD75y8dytGiIt5Ax6Kk4y7v8JetyQVeMgUm fZNGkfa8OHRvf8YINg6sY0ybSVWK3f0jt1P2XWvSNKRklNVkcWS3w4h7qQJ3fctTRa hge0AkAX5AaR8+8hggdnCPgWnFeTu6eoSLNcCwkc= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B7E996029B 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=pillair@codeaurora.org From: Rakesh Pillai To: ath10k@lists.infradead.org Subject: [PATCH] ath10k: Fix channel info parsing for non tlv target Date: Fri, 8 Mar 2019 16:56:06 +0530 Message-Id: <1552044366-9186-1-git-send-email-pillair@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-20190308_032616_322717_3987C3FD X-CRM114-Status: GOOD ( 11.43 ) 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: Rakesh Pillai , 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 The tlv targets such as WCN3990 send more data in the chan info event, which is not sent by the non tlv targets. There is a minimum size check in the wmi event for non-tlv targets and hence we cannot update the common channel info structure. If the common channel info structure is updated, the size check for chan info event for non-tlv targets will fail and return -EPROTO and we see the below error messages ath10k_pci 0000:01:00.0: failed to parse chan info event: -71 Add tlv specific channel info structure and restore the original size of the common channel info structure to mitigate this issue. Tested HW: WCN3990 QCA9887 Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1 10.2.4-1.0-00037 Fixes: 13104929d2ec ("ath10k: fill the channel survey results for WCN3990 correctly") Signed-off-by: Rakesh Pillai --- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 +- drivers/net/wireless/ath/ath10k/wmi-tlv.h | 16 ++++++++++++++++ drivers/net/wireless/ath/ath10k/wmi.h | 8 -------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index 582fb11..a826acb 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c @@ -810,7 +810,7 @@ static int ath10k_wmi_tlv_op_pull_ch_info_ev(struct ath10k *ar, struct wmi_ch_info_ev_arg *arg) { const void **tb; - const struct wmi_chan_info_event *ev; + const struct wmi_tlv_chan_info_event *ev; int ret; tb = ath10k_wmi_tlv_parse_alloc(ar, skb->data, skb->len, GFP_ATOMIC); diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.h b/drivers/net/wireless/ath/ath10k/wmi-tlv.h index 65e6aa5..4bdd655 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.h +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.h @@ -1607,6 +1607,22 @@ struct chan_info_params { #define WMI_TLV_FLAG_MGMT_BUNDLE_TX_COMPL BIT(9) +struct wmi_tlv_chan_info_event { + __le32 err_code; + __le32 freq; + __le32 cmd_flags; + __le32 noise_floor; + __le32 rx_clear_count; + __le32 cycle_count; + __le32 chan_tx_pwr_range; + __le32 chan_tx_pwr_tp; + __le32 rx_frame_count; + __le32 my_bss_rx_cycle_count; + __le32 rx_11b_mode_data_duration; + __le32 tx_frame_cnt; + __le32 mac_clk_mhz; +} __packed; + struct wmi_tlv_mgmt_tx_compl_ev { __le32 desc_id; __le32 status; diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index e1c40bb..d188a2c 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -6523,14 +6523,6 @@ struct wmi_chan_info_event { __le32 noise_floor; __le32 rx_clear_count; __le32 cycle_count; - __le32 chan_tx_pwr_range; - __le32 chan_tx_pwr_tp; - __le32 rx_frame_count; - __le32 my_bss_rx_cycle_count; - __le32 rx_11b_mode_data_duration; - __le32 tx_frame_cnt; - __le32 mac_clk_mhz; - } __packed; struct wmi_10_4_chan_info_event {