From patchwork Wed Jun 12 10:29:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anilkumar Kolli X-Patchwork-Id: 10989367 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 D996C1395 for ; Wed, 12 Jun 2019 10:29:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC9452893B for ; Wed, 12 Jun 2019 10:29:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0CD928A44; Wed, 12 Jun 2019 10:29:19 +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 B0C062893B for ; Wed, 12 Jun 2019 10:29:18 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=oRi6mTLFVUs88+AESzvgmO37q2Q/NTa1rTKPNpIFoUY=; b=K/1CTYikg+IAiZ 3kuzaMb2P7+AAeT8qN6S3a0jV+9F9ghuU+GKUbP4dEtM+CPmJnrWrjUzHIUDGwtOQ1lG27HWWEBog Qzc5OGt0Y8IFGnyaRqZ+50WejYpcRrxhAWrGf8iUTKlYHZBB1sC9nDtPgEaUg/dc2HfWuJxlAyFUU 98ACRSlAPHUCZaz1dgXE3VswWW20RHUmdku66/2RZWjrYvmtkorb3DuqAVrZlm1dBe0MKG90usKfh 0JZB6Tu4vbVPQydoUaH/yEO9eDOt4ZLM+Pj/AjNB4iUYLpULlbihJcVOJza8dVJrlmFAgS2BGHtoe zfH1cuxnw2nFl3n6osqQ==; 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 1hb0VJ-0006GM-JA; Wed, 12 Jun 2019 10:29:17 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hb0VH-0006Fw-3R for ath11k@lists.infradead.org; Wed, 12 Jun 2019 10:29:16 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8833F6032C; Wed, 12 Jun 2019 10:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1560335354; bh=qFNaP41hNMKOocbEMoTWpJvfQlwtHaAUvYMQGL9l/nc=; h=From:To:Cc:Subject:Date:From; b=lAS1gYhzGxSyIYDXs7roKxibLp5J1PkFhuLNX0GgpF31f05nuO+ZZCdrdr/syNOMP 53t5HzdJ4+zwFuWHuVMEiaR6A8D73B7KHW3CK8nUHD1TwtucjDN+n+dY1r2MDKd1SL Emf9X2WlOs5pb5QdPaE/2M2axBfB04H5ixQVA2LA= Received: from localhost (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: akolli@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 57010602F3; Wed, 12 Jun 2019 10:29:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1560335354; bh=qFNaP41hNMKOocbEMoTWpJvfQlwtHaAUvYMQGL9l/nc=; h=From:To:Cc:Subject:Date:From; b=lAS1gYhzGxSyIYDXs7roKxibLp5J1PkFhuLNX0GgpF31f05nuO+ZZCdrdr/syNOMP 53t5HzdJ4+zwFuWHuVMEiaR6A8D73B7KHW3CK8nUHD1TwtucjDN+n+dY1r2MDKd1SL Emf9X2WlOs5pb5QdPaE/2M2axBfB04H5ixQVA2LA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 57010602F3 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=akolli@codeaurora.org From: Anilkumar Kolli To: ath11k@lists.infradead.org Subject: [PATCH v2] ath11k: cleanup in htt pktlog Date: Wed, 12 Jun 2019 15:59:05 +0530 Message-Id: <1560335345-13626-1-git-send-email-akolli@codeaurora.org> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190612_032915_183502_DCBF2EB6 X-CRM114-Status: GOOD ( 12.27 ) 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: , Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Addressed below comments, * debug: move enum ath11k_wmi_pktlog_enable to wmi.h * dp_rx: ath11k_htt_pktlog(): 'u32 *data' needs a proper struct,   avoids pointer arithmetic. Signed-off-by: Anilkumar Kolli --- V2: - addressed sathish's comments drivers/net/wireless/ath/ath11k/debug.h | 5 ----- drivers/net/wireless/ath/ath11k/dp.h | 39 +++++++++++++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/dp_rx.c | 10 ++++----- drivers/net/wireless/ath/ath11k/wmi.h | 5 +++++ 4 files changed, 49 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/debug.h b/drivers/net/wireless/ath/ath11k/debug.h index 13973d972169..5774f531f268 100644 --- a/drivers/net/wireless/ath/ath11k/debug.h +++ b/drivers/net/wireless/ath/ath11k/debug.h @@ -80,11 +80,6 @@ enum ath11k_pktlog_filter { ATH11K_PKTLOG_ANY = 0x00000006f, }; -enum ath11k_wmi_pktlog_enable { - ATH11K_WMI_PKTLOG_ENABLE_AUTO = 0, - ATH11K_WMI_PKTLOG_ENABLE_FORCE = 1, -}; - enum ath11k_pktlog_mode { ATH11K_PKTLOG_MODE_LITE = 1, ATH11K_PKTLOG_MODE_FULL = 2, diff --git a/drivers/net/wireless/ath/ath11k/dp.h b/drivers/net/wireless/ath/ath11k/dp.h index 79b665816378..a4b32abbeaee 100644 --- a/drivers/net/wireless/ath/ath11k/dp.h +++ b/drivers/net/wireless/ath/ath11k/dp.h @@ -1214,6 +1214,45 @@ struct htt_ppdu_stats_info { }; /** + * @brief target -> host packet log message + * + * @details + * The following field definitions describe the format of the packet log + * message sent from the target to the host. + * The message consists of a 4-octet header,followed by a variable number + * of 32-bit character values. + * + * |31 16|15 12|11 10|9 8|7 0| + * |------------------------------------------------------------------| + * | payload_size | rsvd |pdev_id|mac_id| msg type | + * |------------------------------------------------------------------| + * | payload | + * |------------------------------------------------------------------| + * - MSG_TYPE + * Bits 7:0 + * Purpose: identifies this as a pktlog message + * Value: HTT_T2H_MSG_TYPE_PKTLOG + * - mac_id + * Bits 9:8 + * Purpose: identifies which MAC/PHY instance generated this pktlog info + * Value: 0-3 + * - pdev_id + * Bits 11:10 + * Purpose: pdev_id + * Value: 0-3 + * 0 (for rings at SOC level), + * 1/2/3 PDEV -> 0/1/2 + * - payload_size + * Bits 31:16 + * Purpose: explicitly specify the payload size + * Value: payload size in bytes (payload size is a multiple of 4 bytes) + */ +struct htt_pktlog_msg { + u32 hdr; + u8 payload[0]; +}; + +/** * @brief host -> target FW extended statistics retrieve * * @details diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index 59d2605c0ce2..e18ca4c0cda4 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -1084,11 +1084,12 @@ static int ath11k_htt_pull_ppdu_stats(struct ath11k_base *ab, static void ath11k_htt_pktlog(struct ath11k_base *ab, struct sk_buff *skb) { - u32 *data = (u32 *)skb->data, len; + struct htt_pktlog_msg *data = (struct htt_pktlog_msg *)skb->data; struct ath11k *ar; + u32 len; u8 pdev_id; - len = FIELD_GET(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M, *data); + len = FIELD_GET(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M, data->hdr); if (len > ATH11K_HTT_PKTLOG_MAX_SIZE) { @@ -1098,12 +1099,11 @@ static void ath11k_htt_pktlog(struct ath11k_base *ab, return; } - pdev_id = FIELD_GET(HTT_T2H_PPDU_STATS_PDEV_ID_M, *data); + pdev_id = FIELD_GET(HTT_T2H_PPDU_STATS_PDEV_ID_M, data->hdr); pdev_id = DP_HW2SW_MACID(pdev_id); ar = ab->pdevs[pdev_id].ar; - ++data; - trace_ath11k_htt_pktlog(ar, data, len); + trace_ath11k_htt_pktlog(ar, data->payload, len); } void ath11k_dp_htt_htc_t2h_msg_handler(struct ath11k_base *ab, diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h index f30542e2d090..d5b3de2e7e87 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h @@ -4148,6 +4148,11 @@ struct wmi_pdev_pktlog_filter_cmd { u32 num_mac; } __packed; +enum ath11k_wmi_pktlog_enable { + ATH11K_WMI_PKTLOG_ENABLE_AUTO = 0, + ATH11K_WMI_PKTLOG_ENABLE_FORCE = 1, +}; + struct wmi_pktlog_enable_cmd { u32 tlv_header; u32 pdev_id;