From patchwork Tue Jun 7 13:09:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Berg X-Patchwork-Id: 9161153 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.web.codeaurora.org (Postfix) with ESMTP id 0FC5C60571 for ; Tue, 7 Jun 2016 13:10:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00A4E22A2A for ; Tue, 7 Jun 2016 13:10:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8DC428179; Tue, 7 Jun 2016 13:10:23 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8785722A2A for ; Tue, 7 Jun 2016 13:10:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932605AbcFGNKL (ORCPT ); Tue, 7 Jun 2016 09:10:11 -0400 Received: from s3.sipsolutions.net ([5.9.151.49]:45935 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932114AbcFGNKK (ORCPT ); Tue, 7 Jun 2016 09:10:10 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1bAGlk-0007aI-97; Tue, 07 Jun 2016 15:10:08 +0200 From: Benjamin Berg To: linux-wireless@vger.kernel.org Cc: Kalle Valo , Felix Fietkau , ath9k-devel@lists.ath9k.org, Benjamin Berg Subject: [PATCH 4/6] ath9k: Expose tsf_adjustment in mac80211 tsf getters and setters. Date: Tue, 7 Jun 2016 15:09:59 +0200 Message-Id: <1465305001-26067-4-git-send-email-benjamin@sipsolutions.net> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1465305001-26067-1-git-send-email-benjamin@sipsolutions.net> References: <1465305001-26067-1-git-send-email-benjamin@sipsolutions.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Benjamin Berg Signed-off-by: Benjamin Berg --- drivers/net/wireless/ath/ath9k/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 375c2ac..f2ebc85 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -1835,6 +1835,7 @@ static u64 ath9k_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif) tsf = sc->cur_chan->tsf_val + ath9k_hw_get_tsf_offset(&sc->cur_chan->tsf_ts, NULL); } + tsf += le64_to_cpu(avp->tsf_adjust); ath9k_ps_restore(sc); mutex_unlock(&sc->mutex); @@ -1850,6 +1851,7 @@ static void ath9k_set_tsf(struct ieee80211_hw *hw, mutex_lock(&sc->mutex); ath9k_ps_wakeup(sc); + tsf -= le64_to_cpu(avp->tsf_adjust); getrawmonotonic(&avp->chanctx->tsf_ts); if (sc->cur_chan == avp->chanctx) ath9k_hw_settsf64(sc->sc_ah, tsf);