From patchwork Fri Mar 21 10:00:14 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: 3872161 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 1AAE99F382 for ; Fri, 21 Mar 2014 10:00:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2FBAB2026C for ; Fri, 21 Mar 2014 10:00:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1464D20263 for ; Fri, 21 Mar 2014 10:00:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760162AbaCUKAY (ORCPT ); Fri, 21 Mar 2014 06:00:24 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:46524 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759943AbaCUKAX (ORCPT ); Fri, 21 Mar 2014 06:00:23 -0400 Received: by mail-pa0-f53.google.com with SMTP id ld10so2190885pab.40 for ; Fri, 21 Mar 2014 03:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=r+jAa7F9KQNZmviC5Kig2Q3zjKo/vZivbfm8NKp5Pvs=; b=0ViC9AvvhlYpBqwixIvGLMHk3gZ/Dxn/PBz0tbhWLN+Oi6Rq4octaDhHRNAgOdO3e9 VykeY3Dnv7tskh4h2RmfLgsupUDK5FjK+C+6nhwesiyzyDxQsu0pX9Ds8BqkJ7i9Isqq i1ysWUMKlSA5Eo+GlEAnW6ViWCWDfDR7eJPFkLvFFXmq37T9Yp0bohuXUPLJGZ7/VE+g HCs6p2TuAbvszoHGe0yPzTqGJx9MLqbET6nUNqRCKj4yN1w3nQbMVnKGiuecAjDkgXjL CIcMvC3gK6C0pX5hZUcJCGmyNU3J8UXgtWNyKbGJv5zVkXOLOSwdIgpQ76fNDSseNCIf nFWg== X-Received: by 10.68.229.106 with SMTP id sp10mr53482454pbc.23.1395396023122; Fri, 21 Mar 2014 03:00:23 -0700 (PDT) Received: from localhost.localdomain ([58.26.233.145]) by mx.google.com with ESMTPSA id et3sm8902135pbc.52.2014.03.21.03.00.20 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Mar 2014 03:00:22 -0700 (PDT) From: Chun-Yeow Yeoh To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, kvalo@qca.qualcomm.com, Chun-Yeow Yeoh Subject: [PATCH] ath10k: add the Rx rate in FW stats Date: Fri, 21 Mar 2014 18:00:14 +0800 Message-Id: <1395396014-24631-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=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 FW stats does provide the Rx rate information. Add this. Tested with firmware 10.1.467.2-1. Further investigation on firmware 999.999.0.636 indicates that there is no Tx Rate and Rx Rate in the peer stats. Signed-off-by: Chun-Yeow Yeoh --- drivers/net/wireless/ath/ath10k/core.h | 1 + drivers/net/wireless/ath/ath10k/debug.c | 5 +++++ drivers/net/wireless/ath/ath10k/wmi.h | 1 + 3 files changed, 7 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index ad209a6..ca4cdab 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -119,6 +119,7 @@ struct ath10k_peer_stat { u8 peer_macaddr[ETH_ALEN]; u32 peer_rssi; u32 peer_tx_rate; + u32 peer_rx_rate; }; struct ath10k_target_stats { diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index f95defa..4662cb7 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -257,6 +257,8 @@ void ath10k_debug_read_target_stats(struct ath10k *ar, s->peer_rssi = __le32_to_cpu(peer_stats->peer_rssi); s->peer_tx_rate = __le32_to_cpu(peer_stats->peer_tx_rate); + s->peer_rx_rate = + __le32_to_cpu(peer_stats->peer_rx_rate); tmp += sizeof(struct wmi_peer_stats); } @@ -425,6 +427,9 @@ static ssize_t ath10k_read_fw_stats(struct file *file, char __user *user_buf, len += scnprintf(buf + len, buf_len - len, "%30s %u\n", "Peer TX rate", fw_stats->peer_stat[i].peer_tx_rate); + len += scnprintf(buf + len, buf_len - len, "%30s %u\n", + "Peer RX rate", + fw_stats->peer_stat[i].peer_rx_rate); len += scnprintf(buf + len, buf_len - len, "\n"); } 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 084bcc5..2b2f0b7 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -2825,6 +2825,7 @@ struct wmi_peer_stats { struct wmi_mac_addr peer_macaddr; __le32 peer_rssi; __le32 peer_tx_rate; + __le32 peer_rx_rate; } __packed; struct wmi_vdev_create_cmd {