From patchwork Wed Aug 12 10:54:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasanthakumar Thiagarajan X-Patchwork-Id: 7000421 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9566E9F373 for ; Wed, 12 Aug 2015 10:55:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B3B7A2054E for ; Wed, 12 Aug 2015 10:54:59 +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 E02442055A for ; Wed, 12 Aug 2015 10:54:58 +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 1ZPTgJ-0000ZX-OI; Wed, 12 Aug 2015 10:54:51 +0000 Received: from sabertooth01.qualcomm.com ([65.197.215.72]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZPTgH-0000R8-Hk for ath10k@lists.infradead.org; Wed, 12 Aug 2015 10:54:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1439376890; x=1470912890; h=from:to:cc:subject:date:message-id:mime-version; bh=vscwYveXln7WevK/KV9cIVwkxOdqWXz1hYHC8+7Zo9c=; b=kjLbCuNIUkmvvznixwE3rHJWQ+j+QR83d7CJaKdAKAcwf7EKv1IqqpSz Pd9/omkohp3L2YuczXlQmY0pJ9nX2q/+GJQpnaMo7O8vys8uMhq/FPxD2 K0w9rpCNF2Y4kIIZQjD/Cxu0x1qFKGliu9KYnMX2+xCfb+8UbjPhM5mPG g=; X-IronPort-AV: E=McAfee;i="5700,7163,7890"; a="94589898" Received: from ironmsg02-lv.qualcomm.com ([10.47.202.183]) by sabertooth01.qualcomm.com with ESMTP; 12 Aug 2015 03:54:27 -0700 X-IronPort-AV: E=Sophos;i="5.15,660,1432623600"; d="scan'208";a="33400624" Received: from nasanexm01f.na.qualcomm.com ([10.85.0.32]) by ironmsg02-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 12 Aug 2015 03:54:26 -0700 Received: from aphydexm01f.ap.qualcomm.com (10.252.127.15) by NASANEXM01F.na.qualcomm.com (10.85.0.32) with Microsoft SMTP Server (TLS) id 15.0.1076.9; Wed, 12 Aug 2015 03:54:24 -0700 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01f.ap.qualcomm.com (10.252.127.15) with Microsoft SMTP Server (TLS) id 15.0.1076.9; Wed, 12 Aug 2015 03:54:16 -0700 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Wed, 12 Aug 2015 16:24:06 +0530 From: Vasanthakumar Thiagarajan To: Subject: [PATCH 1/2] ath10k: Fix invalid survey reporting for QCA99X0 Date: Wed, 12 Aug 2015 16:24:04 +0530 Message-ID: <1439376845-17245-1-git-send-email-vthiagar@qti.qualcomm.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01G.na.qualcomm.com (10.85.0.33) To aphydexm01f.ap.qualcomm.com (10.252.127.15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150812_035449_758651_CA23502F X-CRM114-Status: GOOD ( 11.40 ) X-Spam-Score: -7.2 (-------) 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: Vasanthakumar Thiagarajan , linux-wireless@vger.kernel.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 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 There are three WMI_CHAN_INFO events reported per channel in QCA99X0 firmware. First one is a notification at the begining of the channel dwell time with cmd_flag as CHAN_INFO_START(cmd_flag = 0), second one is a notification at the end of the dwell time with cmd_flag CHAN_INFO_PRE_COMPLETE (cmd_flag = 2) and the third is the indication with CHAN_INFO_COMPLETE (cmd_flag = 1) which is the last indication for the channel. Since there is a new state before the completion, the handler is to fixed so that the counts are deducted from the ones reported with CHAN_INFO_START rather than the ones reported with CHAN_INFO_PRE_COMPLETE. Without this fix there will be lots of 0 msecs reported as active and busy time. Signed-off-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath10k/wmi.c | 6 ++++-- drivers/net/wireless/ath/ath10k/wmi.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index e6d6b42..38e22e0 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -2412,8 +2412,10 @@ void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb) ar->ch_info_can_report_survey = true; } - ar->survey_last_rx_clear_count = rx_clear_count; - ar->survey_last_cycle_count = cycle_count; + if (!(cmd_flags & WMI_CHAN_INFO_FLAG_PRE_COMPLETE)) { + ar->survey_last_rx_clear_count = rx_clear_count; + ar->survey_last_cycle_count = cycle_count; + } exit: spin_unlock_bh(&ar->data_lock); diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index 0d4efc9..5825c5c 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -5585,6 +5585,7 @@ struct wmi_peer_sta_kickout_event { } __packed; #define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0) +#define WMI_CHAN_INFO_FLAG_PRE_COMPLETE BIT(1) /* Beacon filter wmi command info */ #define BCN_FLT_MAX_SUPPORTED_IES 256