Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1813937ybb; Thu, 26 Mar 2020 07:49:06 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvJJizYChUCgeKzLe6wpp9iHl47VGqEAosSNCEH1PvUGqG509fhBcW21S9IxkBh3q3xLdJA X-Received: by 2002:a9d:1920:: with SMTP id j32mr6183470ota.221.1585234146311; Thu, 26 Mar 2020 07:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585234146; cv=none; d=google.com; s=arc-20160816; b=ZhtjHycfSnv+lCkQ7rcmYQeUl+MeYB9RaVIz2wMrLkOVD94olOj8ttKZd8WD6C+Y2+ V9vSoDXSRLKqFNdr9cMyv29rja/IbTi24jOOJDGVcpq1rJRUhlFsi1NzW48WHMjp0brj fo2vB4hd7/HiEdhtDNuLF7MQRhvXpv8d4eZF2gSzzPiEaCha3UtyaajdofRqiVmrhW0C oO/fvfiUFaX4zXvbwiKTAx+V/V5O3LbDtKxUsjQb4YMjUNASNKWuTJB+CvRc+5qkrbwx owEyRu5JVbBuv3Ze3CdN9LOwqgJ3F4PJnJhx8K0ucf3zutl25dCwUW5pNUKwr4s+b9Os j4tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=gJypkRBMTN5AeLQ5YUl1fTy/Tw2JI3Ibd/npijA4wvQ=; b=iyyr6lnOfwTMinSAYcFIVrOP33AF90Kgy6hXQXJpJUae/AWJHKFhZQeVJp7iFlj3wc IqdU8ruXy7VfKZCnuRvSdkzLxo2JYUNB6QY66iMi7KuoEQoHkJGyqibuDsdsrAK8t3Kp CvSwf95Voa24sFSZsr7/t/WE6cx84+57CDhQF3DFxuaIkl5g0wps/CV0nTR8AOVhQrGY c6S5VLxNIBE5n9U9t1InqzEkhaAaJFqkBCm1zoRjhAejJI8L+GfmJh00Uu8Xa5ZAMiS6 D5BmAp06Dm0k7z6j3KeYBQ7HVz1OdNBbWXyMbB2aw9Mm6KOsdJRsjhEQqufMPwR7O8sI XcPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="ox0nMnC/"; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g22si1154300otn.291.2020.03.26.07.48.55; Thu, 26 Mar 2020 07:49:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="ox0nMnC/"; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727944AbgCZOrx (ORCPT + 99 others); Thu, 26 Mar 2020 10:47:53 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:19355 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727547AbgCZOrx (ORCPT ); Thu, 26 Mar 2020 10:47:53 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1585234071; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=gJypkRBMTN5AeLQ5YUl1fTy/Tw2JI3Ibd/npijA4wvQ=; b=ox0nMnC/sU1eHeeFJET2JyLfDYZ8y7QGM4KjolpUlXwzhI+sfNxm4a/S988ClJM3YfBOOnbZ yPWXXpweDOrU3TMWHBKjNYJ6vyMIXPGZd6pIkgiCBXkm4llKYf7Kns1sCgMB/gJNDkATeTtf yxNSSs80x0fdDTB4EuNdjj4qjqg= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e7cc08e.7fdfd6a04f48-smtp-out-n03; Thu, 26 Mar 2020 14:47:42 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 71CEEC43636; Thu, 26 Mar 2020 14:47:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mkenna) by smtp.codeaurora.org (Postfix) with ESMTPSA id C40A6C433BA; Thu, 26 Mar 2020 14:47:39 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 26 Mar 2020 20:17:39 +0530 From: Maharaja Kennadyrajan To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Subject: Re: [PATCH] ath11k: add pktlog checksum in trace events to support pktlog In-Reply-To: <1585234044-30362-1-git-send-email-mkenna@codeaurora.org> References: <1585234044-30362-1-git-send-email-mkenna@codeaurora.org> Message-ID: <6a4d557a6bb5ef9f9f243c01e67be090@codeaurora.org> X-Sender: mkenna@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi, Please ignore this patch. Sent to wrong mailing list. Regret for the inconvenience caused. Regards, Maha On 2020-03-26 20:17, Maharaja Kennadyrajan wrote: > Pktlog data are different among the chipset & chipset versions. > As part of enhancing the user space script to decode the pktlog > trace events generated, it is desirable to know which chipset or > which chipset version has provided the events and thereby decode > the pktlogs appropriately. > > Pktlog checksum helps to determine the chipset variant which is > given by the firmware in the struct wmi_ready_event. > > Pktlog checksums are computed during the firmware build. > So, adding that pktlog checksum in the pklog trace events. > > Signed-off-by: Maharaja Kennadyrajan > --- > drivers/net/wireless/ath/ath11k/core.h | 1 + > drivers/net/wireless/ath/ath11k/dp_rx.c | 3 ++- > drivers/net/wireless/ath/ath11k/trace.h | 12 ++++++++---- > drivers/net/wireless/ath/ath11k/wmi.c | 21 +++++++++++++-------- > drivers/net/wireless/ath/ath11k/wmi.h | 8 +++++++- > 5 files changed, 31 insertions(+), 14 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath11k/core.h > b/drivers/net/wireless/ath/ath11k/core.h > index 6e7b8ec..a1e29f3 100644 > --- a/drivers/net/wireless/ath/ath11k/core.h > +++ b/drivers/net/wireless/ath/ath11k/core.h > @@ -650,6 +650,7 @@ struct ath11k_base { > /* protected by data_lock */ > u32 fw_crash_counter; > } stats; > + u32 pktlog_defs_checksum; > }; > > struct ath11k_fw_stats_pdev { > diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c > b/drivers/net/wireless/ath/ath11k/dp_rx.c > index f74a0e7..a3f2c76 100644 > --- a/drivers/net/wireless/ath/ath11k/dp_rx.c > +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c > @@ -1491,7 +1491,8 @@ static void ath11k_htt_pktlog(struct ath11k_base > *ab, struct sk_buff *skb) > return; > } > > - trace_ath11k_htt_pktlog(ar, data->payload, hdr->size); > + trace_ath11k_htt_pktlog(ar, data->payload, hdr->size, > + ar->ab->pktlog_defs_checksum); > } > > static void ath11k_htt_backpressure_event_handler(struct ath11k_base > *ab, > diff --git a/drivers/net/wireless/ath/ath11k/trace.h > b/drivers/net/wireless/ath/ath11k/trace.h > index 8700a62..66d0aae 100644 > --- a/drivers/net/wireless/ath/ath11k/trace.h > +++ b/drivers/net/wireless/ath/ath11k/trace.h > @@ -21,14 +21,16 @@ > #define TRACE_SYSTEM ath11k > > TRACE_EVENT(ath11k_htt_pktlog, > - TP_PROTO(struct ath11k *ar, const void *buf, u16 buf_len), > + TP_PROTO(struct ath11k *ar, const void *buf, u16 buf_len, > + u32 pktlog_checksum), > > - TP_ARGS(ar, buf, buf_len), > + TP_ARGS(ar, buf, buf_len, pktlog_checksum), > > TP_STRUCT__entry( > __string(device, dev_name(ar->ab->dev)) > __string(driver, dev_driver_string(ar->ab->dev)) > __field(u16, buf_len) > + __field(u32, pktlog_checksum) > __dynamic_array(u8, pktlog, buf_len) > ), > > @@ -36,14 +38,16 @@ > __assign_str(device, dev_name(ar->ab->dev)); > __assign_str(driver, dev_driver_string(ar->ab->dev)); > __entry->buf_len = buf_len; > + __entry->pktlog_checksum = pktlog_checksum; > memcpy(__get_dynamic_array(pktlog), buf, buf_len); > ), > > TP_printk( > - "%s %s size %hu", > + "%s %s size %hu pktlog_checksum %d", > __get_str(driver), > __get_str(device), > - __entry->buf_len > + __entry->buf_len, > + __entry->pktlog_checksum > ) > ); > > diff --git a/drivers/net/wireless/ath/ath11k/wmi.c > b/drivers/net/wireless/ath/ath11k/wmi.c > index e7ce369..ad88efe 100644 > --- a/drivers/net/wireless/ath/ath11k/wmi.c > +++ b/drivers/net/wireless/ath/ath11k/wmi.c > @@ -87,8 +87,8 @@ struct wmi_tlv_rdy_parse { > = { .min_len = sizeof(struct wmi_pdev_bss_chan_info_event) }, > [WMI_TAG_VDEV_INSTALL_KEY_COMPLETE_EVENT] > = { .min_len = sizeof(struct wmi_vdev_install_key_compl_event) }, > - [WMI_TAG_READY_EVENT] > - = {.min_len = sizeof(struct wmi_ready_event) }, > + [WMI_TAG_READY_EVENT] = { > + .min_len = sizeof(struct wmi_ready_event_min) }, > [WMI_TAG_SERVICE_AVAILABLE_EVENT] > = {.min_len = sizeof(struct wmi_service_available_event) }, > [WMI_TAG_PEER_ASSOC_CONF_EVENT] > @@ -4851,7 +4851,7 @@ static int ath11k_wmi_tlv_rdy_parse(struct > ath11k_base *ab, u16 tag, u16 len, > const void *ptr, void *data) > { > struct wmi_tlv_rdy_parse *rdy_parse = data; > - struct wmi_ready_event *fixed_param; > + struct wmi_ready_event fixed_param; > struct wmi_mac_addr *addr_list; > struct ath11k_pdev *pdev; > u32 num_mac_addr; > @@ -4859,11 +4859,16 @@ static int ath11k_wmi_tlv_rdy_parse(struct > ath11k_base *ab, u16 tag, u16 len, > > switch (tag) { > case WMI_TAG_READY_EVENT: > - fixed_param = (struct wmi_ready_event *)ptr; > - ab->wlan_init_status = fixed_param->status; > - rdy_parse->num_extra_mac_addr = fixed_param->num_extra_mac_addr; > - > - ether_addr_copy(ab->mac_addr, fixed_param->mac_addr.addr); > + memset(&fixed_param, 0, sizeof(fixed_param)); > + memcpy(&fixed_param, (struct wmi_ready_event *)ptr, > + min_t(u16, sizeof(fixed_param), len)); > + ab->wlan_init_status = fixed_param.ready_event_min.status; > + rdy_parse->num_extra_mac_addr = > + fixed_param.ready_event_min.num_extra_mac_addr; > + > + ether_addr_copy(ab->mac_addr, > + fixed_param.ready_event_min.mac_addr.addr); > + ab->pktlog_defs_checksum = fixed_param.pktlog_defs_checksum; > ab->wmi_ready = true; > break; > case WMI_TAG_ARRAY_FIXED_STRUCT: > diff --git a/drivers/net/wireless/ath/ath11k/wmi.h > b/drivers/net/wireless/ath/ath11k/wmi.h > index 510f9c6..58f9098 100644 > --- a/drivers/net/wireless/ath/ath11k/wmi.h > +++ b/drivers/net/wireless/ath/ath11k/wmi.h > @@ -2345,7 +2345,7 @@ struct wmi_mac_addr { > } __packed; > } __packed; > > -struct wmi_ready_event { > +struct wmi_ready_event_min { > struct wmi_abi_version fw_abi_vers; > struct wmi_mac_addr mac_addr; > u32 status; > @@ -2355,6 +2355,12 @@ struct wmi_ready_event { > u32 num_extra_peers; > } __packed; > > +struct wmi_ready_event { > + struct wmi_ready_event_min ready_event_min; > + u32 max_ast_index; > + u32 pktlog_defs_checksum; > +} __packed; > + > struct wmi_service_available_event { > u32 wmi_service_segment_offset; > u32 wmi_service_segment_bitmap[WMI_SERVICE_SEGMENT_BM_SIZE32];