From patchwork Wed Feb 12 09:37:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Yeow Yeoh X-Patchwork-Id: 3635751 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9FDD09F382 for ; Wed, 12 Feb 2014 09:38:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BE6A520165 for ; Wed, 12 Feb 2014 09:38:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9A9F32015D for ; Wed, 12 Feb 2014 09:38:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751757AbaBLJiA (ORCPT ); Wed, 12 Feb 2014 04:38:00 -0500 Received: from mail-pb0-f52.google.com ([209.85.160.52]:34533 "EHLO mail-pb0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751626AbaBLJh7 (ORCPT ); Wed, 12 Feb 2014 04:37:59 -0500 Received: by mail-pb0-f52.google.com with SMTP id jt11so8991663pbb.25 for ; Wed, 12 Feb 2014 01:37:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=d633FC7Kvf2EnSS+ykl3J5dyBhsXSjxz7eRl8uar6gI=; b=pdmHTuYBpUPBPANgsy4mGd6sdpGpygG7AqZsz5rTS3xEtReY2GPmJWBaHPBM8FH7KO rTMgjfSzcqcS8l5/ZqAxqHKZ1uec+U6GPtIcDtQu++3CMCviKjyv7RgXKPKbS9XS4p2d 5PS06hSJCd6Ui5bX2j2FpxrroKztZ6ZIEx7QG9+5UMdFCFiish4siS/BdfpV0xmNUKdk /stgcXwEinsbEbe4Xjs5a0rv95F4lUmYuPuvgzHXuNQKhvSC3hplHpENHKdQ6ReMlD+w fk9cgbbXdc7Ucd50VT4PY0/C4A7mApywx6y+LG18szIb7TuzP/85YBjJm43DLNZX96Pw y9pg== X-Received: by 10.68.130.234 with SMTP id oh10mr49770875pbb.136.1392197879052; Wed, 12 Feb 2014 01:37:59 -0800 (PST) Received: from localhost.localdomain ([58.26.233.145]) by mx.google.com with ESMTPSA id bz4sm61626054pbb.12.2014.02.12.01.37.56 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Feb 2014 01:37:58 -0800 (PST) From: Chun-Yeow Yeoh To: linux-wireless@vger.kernel.org Cc: ath10k@lists.infradead.org, kvalo@qca.qualcomm.com, Chun-Yeow Yeoh Subject: [PATCH] ath10k: set the mactime of ieee80211_rx_status Date: Wed, 12 Feb 2014 17:37:46 +0800 Message-Id: <1392197866-1261-1-git-send-email-yeohchunyeow@gmail.com> X-Mailer: git-send-email 1.7.9.5 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.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 Retrieve the mactime of ieee80211_rx_status based on received data frame. The value is obtained from the htt_rx_indication_ppdu structure and only available in 32-bit. Signed-off-by: Chun-Yeow Yeoh --- drivers/net/wireless/ath/ath10k/htt.h | 1 + drivers/net/wireless/ath/ath10k/htt_rx.c | 1 + drivers/net/wireless/ath/ath10k/txrx.c | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h index b93ae35..bf6b415 100644 --- a/drivers/net/wireless/ath/ath10k/htt.h +++ b/drivers/net/wireless/ath/ath10k/htt.h @@ -1181,6 +1181,7 @@ struct htt_rx_info { u32 info1; u32 info2; } rate; + u32 tsf; bool fcs_err; bool amsdu_more; bool mic_err; diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 820c8ba..4ec2b5d 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -989,6 +989,7 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt, info.rate.info0 = rx->ppdu.info0; info.rate.info1 = __le32_to_cpu(rx->ppdu.info1); info.rate.info2 = __le32_to_cpu(rx->ppdu.info2); + info.tsf = __le32_to_cpu(rx->ppdu.tsf); hdr = ath10k_htt_rx_skb_get_hdr(msdu_head); diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c index b11e478..4713bdb 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -258,6 +258,12 @@ void ath10k_process_rx(struct ath10k *ar, struct htt_rx_info *info) status->band = ch->band; status->freq = ch->center_freq; + if (info->rate.info0 & HTT_RX_INDICATION_INFO0_END_VALID) { + /* TSF available only in 32-bit */ + status->mactime = info->tsf & 0xffffffff; + status->flag |= RX_FLAG_MACTIME_END; + } + ath10k_dbg(ATH10K_DBG_DATA, "rx skb %p len %u %s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i\n", info->skb,