From patchwork Tue Jul 3 13:32:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Danzberger X-Patchwork-Id: 938672 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=dd-wrt.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YD3UGBIX"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=dd-wrt.com header.i=@dd-wrt.com header.b="pjkczEgb"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41KlRq6TMJz9s29 for ; Tue, 3 Jul 2018 23:32:55 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jSE3Sas+ECiOkbm2hgr8EF27J8+Mq4UCQJ8f4ksykRA=; b=YD3UGBIX9qbf0N CiIOZNugatjgQkqGXA4rW3Bo9rVvw8Vl+gvilaetjqupfeq6OYKvg1ZcXv+Wo6doHBpaAQNGTckVt zRE2IrixX/oh6v2FgEq7IZOLKpE+iRG2VaTBOeyYz0SD/xgTuZw5jVV/HtbCZbZl2tZW+BXChhgEo tiJ+QfiIOSfRAJnfXYX0Qg+11YB42onslrj5n4BPXwmjwDpfrMKq5mK7W2L4wYOWL3ZXW9t+3LeSQ AHQJ963AidioFaOypb5FXjUdGrgI6JN9MbaILoS0+kGU6j9nfyWWY8rGSOTp2TxrY0UQWmIhjcVN1 /ZUMWOfDmhm2ewxpSNyA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1faLQI-0003vq-UA; Tue, 03 Jul 2018 13:32:50 +0000 Received: from smtps.newmedia-net.de ([2a05:a1c0:0:de::167] helo=webmail.newmedia-net.de) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1faLQF-0003pw-9V for openwrt-devel@lists.openwrt.org; Tue, 03 Jul 2018 13:32:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dd-wrt.com; s=mikd; h=Subject:References:In-Reply-To:Message-Id:Date:Cc:To:From; bh=JDf/86H/2XVz9dNHnGfr+P4B/GdWicnwo1JjOrBOadU=; b=pjkczEgbsaCnWR5f5JSYKkcDDicPsjQ5KdoZ1a0iAqrhfEy2ecvO83zx/FfPPQjG7ZUpUkFNRh2HZdQYMkGHWnRFz02TEEcQk35dj5CiwqlsQUeOWNyitaOW8k4Tm7KEC7bkDed4rlo4QQ1qjTsSm9bVOgfnAVEURqjEd9vP6OU=; From: Daniel Danzberger To: openwrt-devel@lists.openwrt.org Date: Tue, 3 Jul 2018 15:32:10 +0200 Message-Id: <20180703133211.23120-2-daniel@dd-wrt.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180703133211.23120-1-daniel@dd-wrt.com> References: <20180703133211.23120-1-daniel@dd-wrt.com> X-SA-Exim-Connect-IP: 2a05:a1c7:1:b101:c961:6254:c20e:6974 X-SA-Exim-Mail-From: daniel@dd-wrt.com X-Spam-Checker-Version: SpamAssassin 3.1.9 (2007-02-13) on webmail.newmedia-net.de X-Spam-Level: X-Spam-Status: No, score=-2.6 required=4.0 tests=BAYES_00,NO_RELAYS, UPPERCASE_25_50 autolearn=ham version=3.1.9, No X-SA-Exim-Version: 4.2.1 (built Thu, 26 May 2011 15:22:33 +0200) X-SA-Exim-Scanned: Yes (on webmail.newmedia-net.de) X-NMN-MailScanner-Information: Please contact the ISP for more information X-NMN-MailScanner-ID: 1faLQ3-000715-2t X-NMN-MailScanner: Found to be clean X-NMN-MailScanner-From: daniel@dd-wrt.com X-Received: from [2a05:a1c7:1:b101:c961:6254:c20e:6974] (helo=lappi.newmedia-net.de) by webmail.newmedia-net.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1faLQ3-000715-2t; Tue, 03 Jul 2018 15:32:36 +0200 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180703_063247_670771_92DB8B88 X-CRM114-Status: UNSURE ( 8.33 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid Subject: [OpenWrt-Devel] [PATCH 1/2] iwinfo: nl80211: add more stats to assoclist. X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Danzberger MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org + NL80211_STA_INFO_SIGNAL_AVG + NL80211_STA_INFO_RX_DROP_MISC + NL80211_STA_INFO_CONNECTED_TIME Signed-off-by: Daniel Danzberger --- include/iwinfo.h | 3 +++ iwinfo_nl80211.c | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/iwinfo.h b/include/iwinfo.h index 929f697..4111205 100644 --- a/include/iwinfo.h +++ b/include/iwinfo.h @@ -105,10 +105,13 @@ struct iwinfo_rate_entry { struct iwinfo_assoclist_entry { uint8_t mac[6]; int8_t signal; + int8_t signal_avg; int8_t noise; uint32_t inactive; + uint32_t connected_time; uint32_t rx_packets; uint32_t tx_packets; + uint64_t rx_drop_misc; struct iwinfo_rate_entry rx_rate; struct iwinfo_rate_entry tx_rate; uint32_t rx_bytes; diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c index ecd2d6a..0e0206b 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -1694,10 +1694,13 @@ static int nl80211_get_assoclist_cb(struct nl_msg *msg, void *arg) [NL80211_STA_INFO_RX_BITRATE] = { .type = NLA_NESTED }, [NL80211_STA_INFO_TX_BITRATE] = { .type = NLA_NESTED }, [NL80211_STA_INFO_SIGNAL] = { .type = NLA_U8 }, + [NL80211_STA_INFO_SIGNAL_AVG] = { .type = NLA_U8 }, [NL80211_STA_INFO_RX_BYTES] = { .type = NLA_U32 }, [NL80211_STA_INFO_TX_BYTES] = { .type = NLA_U32 }, [NL80211_STA_INFO_TX_RETRIES] = { .type = NLA_U32 }, [NL80211_STA_INFO_TX_FAILED] = { .type = NLA_U32 }, + [NL80211_STA_INFO_CONNECTED_TIME]= { .type = NLA_U32 }, + [NL80211_STA_INFO_RX_DROP_MISC] = { .type = NLA_U64 }, [NL80211_STA_INFO_T_OFFSET] = { .type = NLA_U64 }, [NL80211_STA_INFO_STA_FLAGS] = { .minlen = sizeof(struct nl80211_sta_flag_update) }, @@ -1725,9 +1728,15 @@ static int nl80211_get_assoclist_cb(struct nl_msg *msg, void *arg) if (sinfo[NL80211_STA_INFO_SIGNAL]) e->signal = nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL]); + if (sinfo[NL80211_STA_INFO_SIGNAL_AVG]) + e->signal_avg = nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL_AVG]); + if (sinfo[NL80211_STA_INFO_INACTIVE_TIME]) e->inactive = nla_get_u32(sinfo[NL80211_STA_INFO_INACTIVE_TIME]); + if (sinfo[NL80211_STA_INFO_CONNECTED_TIME]) + e->connected_time = nla_get_u32(sinfo[NL80211_STA_INFO_CONNECTED_TIME]); + if (sinfo[NL80211_STA_INFO_RX_PACKETS]) e->rx_packets = nla_get_u32(sinfo[NL80211_STA_INFO_RX_PACKETS]); @@ -1759,6 +1768,9 @@ static int nl80211_get_assoclist_cb(struct nl_msg *msg, void *arg) if (sinfo[NL80211_STA_INFO_T_OFFSET]) e->t_offset = nla_get_u64(sinfo[NL80211_STA_INFO_T_OFFSET]); + if (sinfo[NL80211_STA_INFO_RX_DROP_MISC]) + e->rx_drop_misc = nla_get_u64(sinfo[NL80211_STA_INFO_RX_DROP_MISC]); + if (sinfo[NL80211_STA_INFO_EXPECTED_THROUGHPUT]) e->thr = nla_get_u32(sinfo[NL80211_STA_INFO_EXPECTED_THROUGHPUT]);