From patchwork Mon Feb 11 17:04:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= X-Patchwork-Id: 10806369 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD4DF6C2 for ; Mon, 11 Feb 2019 17:04:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B67672A473 for ; Mon, 11 Feb 2019 17:04:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AAC432A528; Mon, 11 Feb 2019 17:04:40 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 5121E2A473 for ; Mon, 11 Feb 2019 17:04:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729826AbfBKREj (ORCPT ); Mon, 11 Feb 2019 12:04:39 -0500 Received: from mail.toke.dk ([52.28.52.200]:55017 "EHLO mail.toke.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729148AbfBKREh (ORCPT ); Mon, 11 Feb 2019 12:04:37 -0500 Subject: [PATCH 2/3] iw: Add printing of station tx duration and airtime weight DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=toke.dk; s=20161023; t=1549904674; bh=4GkId4IC3bp4udG1xQUuZAlhtGc7HIzCJ22On33V9vU=; h=Subject:From:To:Date:In-Reply-To:References:From; b=CgWSWm2VHruCljGEAckkvnL6ipDCYRXE5eJQ7NQoFXazVe6lBE8xZLy/KNfQEI1UY c/oF+UbX6P24e0fVFldD+2jTWkD8Mgq2s27a5HzpD95Y3dDFIUiih7AmBzrznDjjK9 F3iMHsyxllg0UI25NlbFz5kxozCPSJdHw7ry2lRDwVm3lEdwsmwRSOKpSRKMC+8R/B VUyaZf65/MoMMBI4wzLFt9i4plAAmoexgDdfO4OfHTmzbjBVd0Svi7pgj1m8Ka9mjK 5EOb5wzrrKFxEZ4L4l3T2zLWNmX/b8wWHo37B5xJvPNLXBbJFjpkkOa79InzcuSjLE u5jQaaB6nctHQ== From: Toke =?utf-8?q?H=C3=B8iland-J=C3=B8rgensen?= To: linux-wireless@vger.kernel.org Date: Mon, 11 Feb 2019 18:04:34 +0100 X-Clacks-Overhead: GNU Terry Pratchett Message-ID: <154990467412.6770.17555468557188569403.stgit@alrua-x1> In-Reply-To: <154990467406.6770.8841156470323507480.stgit@alrua-x1> References: <154990467406.6770.8841156470323507480.stgit@alrua-x1> MIME-Version: 1.0 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 This adds printing of the station TX duration (along with the existing RX duration), and the airtime weight, both of which were added as part of the airtime fairness patches that were recently merged into mac80211. Signed-off-by: Toke Høiland-Jørgensen --- station.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/station.c b/station.c index 536120c..25cbbc3 100644 --- a/station.c +++ b/station.c @@ -309,6 +309,7 @@ static int print_sta_handler(struct nl_msg *msg, void *arg) [NL80211_STA_INFO_TID_STATS] = { .type = NLA_NESTED }, [NL80211_STA_INFO_BSS_PARAM] = { .type = NLA_NESTED }, [NL80211_STA_INFO_RX_DURATION] = { .type = NLA_U64 }, + [NL80211_STA_INFO_TX_DURATION] = { .type = NLA_U64 }, [NL80211_STA_INFO_ACK_SIGNAL] = {.type = NLA_U8 }, [NL80211_STA_INFO_ACK_SIGNAL_AVG] = { .type = NLA_U8 }, }; @@ -401,6 +402,10 @@ static int print_sta_handler(struct nl_msg *msg, void *arg) printf("\n\ttx bitrate:\t%s", buf); } + if (sinfo[NL80211_STA_INFO_TX_DURATION]) + printf("\n\ttx duration:\t%lld us", + (unsigned long long)nla_get_u64(sinfo[NL80211_STA_INFO_TX_DURATION])); + if (sinfo[NL80211_STA_INFO_RX_BITRATE]) { char buf[100]; @@ -420,6 +425,10 @@ static int print_sta_handler(struct nl_msg *msg, void *arg) printf("\n\tavg ack signal:\t%d dBm", (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_ACK_SIGNAL_AVG])); + if (sinfo[NL80211_STA_INFO_AIRTIME_WEIGHT]) { + printf("\n\tairtime weight: %d", nla_get_u16(sinfo[NL80211_STA_INFO_AIRTIME_WEIGHT])); + } + if (sinfo[NL80211_STA_INFO_EXPECTED_THROUGHPUT]) { uint32_t thr;