From patchwork Thu Nov 12 13:15:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz.Dziedzic@tieto.com X-Patchwork-Id: 7602171 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@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 ED6C79F1C2 for ; Thu, 12 Nov 2015 13:16:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3761B20737 for ; Thu, 12 Nov 2015 13:16:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4729520434 for ; Thu, 12 Nov 2015 13:16:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753118AbbKLNQ0 (ORCPT ); Thu, 12 Nov 2015 08:16:26 -0500 Received: from mail-lf0-f44.google.com ([209.85.215.44]:36291 "EHLO mail-lf0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753067AbbKLNQZ (ORCPT ); Thu, 12 Nov 2015 08:16:25 -0500 Received: by lfs39 with SMTP id 39so33706318lfs.3 for ; Thu, 12 Nov 2015 05:16:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CddP5BHjt7y77+GV8KswaHuUsbeJXXR3I5+9JbZHKpQ=; b=YFQqBxSs9IOqaSAfu7RuG+n5QoKJOtZUMYUW/g4OTlROb717ifh7ak/c7//q67H1+F sfajLyY9WHoicmB6k0ybRLoWoHbT/5Irxp516gRTbb7PpCMfESDGPXt5NsSosklZPyrX IM2/1eXOPinjMx8JNEt6sYY2yqdJ8X9wuJDaY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CddP5BHjt7y77+GV8KswaHuUsbeJXXR3I5+9JbZHKpQ=; b=VN0+XpfHdm3mfetgrLiui12h6GXNoykqtjmGTlQL+fgLnEowJrNJlua1cV0ftt9k8t HxNVgCe4HqsvNGS/Yc0V3J9aEvyNDceEicyTxZLmCDTo29PNa2CYvxgK/ElXYEDbnyUi lThFm4aobaqjhzTH2lHTBNtrvHq/eT3Q2MbF0yG1HGTwciyKm24tkJPmQjFwbbXdAKVX MrqSeOMI4g9DiZyDfrXs4GJwklx5m0eNkpVnL0QKEONddXDq77ODB8COk8WSTx3teySc lKMtD3Ic2YRrlPWDuvV8C07GMcF+zVuUdljQpNaLkzJrKqYqCekCOmCQOEeZPO0p+sAV rAsA== X-Gm-Message-State: ALoCoQns3PNW3VNt72m5PpsHal6jvhiLgcARLImq4TDg6sXA1HnzJziNA5A0E9Gj3icu4xYQfC1tCOHsfK3J0XU2MhZRHNH1xtSKtudoNKaV3XPVNhcn0p68olaS87XI/jfBwZKCqhUyVyoVr9Z3FOquwGzFx1dFkLDwE/miT/bq36oi7XAyVIOZTcnnUZiKop03BYkT5mwn X-Received: by 10.25.139.68 with SMTP id n65mr7316889lfd.81.1447334183805; Thu, 12 Nov 2015 05:16:23 -0800 (PST) Received: from localhost.localdomain ([91.198.246.8]) by smtp.gmail.com with ESMTPSA id i7sm2251430lbo.39.2015.11.12.05.16.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Nov 2015 05:16:23 -0800 (PST) From: Janusz Dziedzic To: linux-wireless@vger.kernel.org Cc: ath9k-devel@lists.ath9k.org, Janusz Dziedzic Subject: [PATCH 12/12] ath9k: MCC, print time elapsed between events Date: Thu, 12 Nov 2015 14:15:49 +0100 Message-Id: <1447334149-15507-12-git-send-email-janusz.dziedzic@tieto.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447334149-15507-1-git-send-email-janusz.dziedzic@tieto.com> References: <1447334149-15507-1-git-send-email-janusz.dziedzic@tieto.com> X-DomainID: tieto.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 This is useful for MCC debugging and bug fixing. Signed-off-by: Janusz Dziedzic --- drivers/net/wireless/ath/ath9k/ath9k.h | 1 + drivers/net/wireless/ath/ath9k/channel.c | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 4616229..952a467 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h @@ -983,6 +983,7 @@ struct ath_softc { struct ath_offchannel offchannel; struct ath_chanctx *next_chan; struct completion go_beacon; + struct timespec last_event_time; #endif unsigned long driver_data; diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c index b0d74f0..d6b1076 100644 --- a/drivers/net/wireless/ath/ath9k/channel.c +++ b/drivers/net/wireless/ath/ath9k/channel.c @@ -226,6 +226,20 @@ static const char *chanctx_state_string(enum ath_chanctx_state state) } } +static const u32 chanctx_event_delta(struct ath_softc *sc) +{ + u64 ms; + struct timespec ts, *old; + + getrawmonotonic(&ts); + old = &sc->last_event_time; + ms = ts.tv_sec * 1000 + ts.tv_nsec / 1000000; + ms -= old->tv_sec * 1000 + old->tv_nsec / 1000000; + sc->last_event_time = ts; + + return (u32)ms; +} + void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx) { struct ath_common *common = ath9k_hw_common(sc->sc_ah); @@ -507,10 +521,11 @@ void ath_chanctx_event(struct ath_softc *sc, struct ieee80211_vif *vif, spin_lock_bh(&sc->chan_lock); - ath_dbg(common, CHAN_CTX, "cur_chan: %d MHz, event: %s, state: %s\n", + ath_dbg(common, CHAN_CTX, "cur_chan: %d MHz, event: %s, state: %s, delta: %u ms\n", sc->cur_chan->chandef.center_freq1, chanctx_event_string(ev), - chanctx_state_string(sc->sched.state)); + chanctx_state_string(sc->sched.state), + chanctx_event_delta(sc)); switch (ev) { case ATH_CHANCTX_EVENT_BEACON_PREPARE: